Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/edit/matchtags",["module","exports","require","../../lib/codemirror","../fold/xml-fold"],(function(t,e,a){var o;window,o=function(t){"use strict";function e(t){t.state.tagHit&&t.state.tagHit.clear(),t.state.tagOther&&t.state.tagOther.clear(),t.state.tagHit=t.state.tagOther=null}function a(a){a.state.failedTagMatch=!1,a.operation((function(){if(e(a),!a.somethingSelected()){var o=a.getCursor(),r=a.getViewport();r.from=Math.min(r.from,o.line),r.to=Math.max(o.line+1,r.to);var i=t.findMatchingTag(a,o,r);if(i){if(a.state.matchBothTags){var n="open"==i.at?i.open:i.close;n&&(a.state.tagHit=a.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var c="close"==i.at?i.open:i.close;c?a.state.tagOther=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}}}))}function o(t){t.state.failedTagMatch&&a(t)}t.defineOption("matchTags",!1,(function(r,i,n){n&&n!=t.Init&&(r.off("cursorActivity",a),r.off("viewportChange",o),e(r)),i&&(r.state.matchBothTags="object"==typeof i&&i.bothTags,r.on("cursorActivity",a),r.on("viewportChange",o),a(r))})),t.commands.toMatchingTag=function(e){var a=t.findMatchingTag(e,e.getCursor());if(a){var o="close"==a.at?a.open:a.close;o&&e.extendSelection(o.to,o.from)}}},"object"==typeof e&&"object"==typeof t?o(a("../../lib/codemirror"),a("../fold/xml-fold")):o(CodeMirror)}));
//# sourceMappingURL=matchtags.js.map