(self.webpackChunk_digicms_admin=self.webpackChunk_digicms_admin||[]).push([[5509],{59577:function(C,x,_){(function(l){l(_(27509))})(function(l){"use strict";l.defineOption("styleSelectedText",!1,function(e,t,n){var r=n&&n!=l.Init;t&&!r?(e.state.markedSelection=[],e.state.markedSelectionStyle=typeof t=="string"?t:"CodeMirror-selectedtext",v(e),e.on("cursorActivity",h),e.on("change",p)):!t&&r&&(e.off("cursorActivity",h),e.off("change",p),u(e),e.state.markedSelection=e.state.markedSelectionStyle=null)});function h(e){e.state.markedSelection&&e.operation(function(){y(e)})}function p(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){u(e)})}var f=8,S=l.Pos,o=l.cmpPos;function s(e,t,n,r){if(o(t,n)!=0)for(var i=e.state.markedSelection,a=e.state.markedSelectionStyle,c=t.line;;){var w=c==t.line?t:S(c,0),d=c+f,g=d>=n.line,b=g?n:S(d,0),k=e.markText(w,b,{className:a});if(r==null?i.push(k):i.splice(r++,0,k),g)break;c=d}}function u(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function v(e){u(e);for(var t=e.listSelections(),n=0;n<t.length;n++)s(e,t[n].from(),t[n].to())}function y(e){if(!e.somethingSelected())return u(e);if(e.listSelections().length>1)return v(e);var t=e.getCursor("start"),n=e.getCursor("end"),r=e.state.markedSelection;if(!r.length)return s(e,t,n);var i=r[0].find(),a=r[r.length-1].find();if(!i||!a||n.line-t.line<=f||o(t,a.to)>=0||o(n,i.from)<=0)return v(e);for(;o(t,i.from)>0;)r.shift().clear(),i=r[0].find();for(o(t,i.from)<0&&(i.to.line-t.line<f?(r.shift().clear(),s(e,t,i.to,0)):s(e,t,i.from,0));o(n,a.to)<0;)r.pop().clear(),a=r[r.length-1].find();o(n,a.to)>0&&(n.line-a.from.line<f?(r.pop().clear(),s(e,a.from,n)):s(e,a.to,n))}})}}]);
