var Common;!function(e){!function(e){"use strict";class t{constructor(t){this._start=t.start;this._end=t.end;this._lineOffsets=t.lineOffsets;this._generatedLineOffset=t.generatedLineOffset;this._sourcemap=new e.SourcemapMappings(t.mappings,[]);this._length=t.length}get start(){return this._start}get end(){return this._end}get generatedLineOffset(){return this._generatedLineOffset}get sourcemap(){return this._sourcemap}getPosition(t){F12.Tools.Utility.Assert.isTrue(t>=0,"Negative offset");F12.Tools.Utility.Assert.isTrue(this._lineOffsets.length>=1,"Need to call calculateLineOffsets first");t=Math.min(t,this._length-1);for(var s=this._lineOffsets.length-1,i=0;i<s;){var n=i+s>>1;this._lineOffsets[n]<t?i=n+1:s=n}i>0&&i<this._lineOffsets.length&&this._lineOffsets[i]>t&&(i-=1);var l=t-this._lineOffsets[i];F12.Tools.Utility.Assert.isTrue(l>=0,"Calculated negative column");return new e.Position(i,l)}getOffset(e){F12.Tools.Utility.Assert.isTrue(this._lineOffsets.length>=1,"Need to call calculateLineOffsets first");F12.Tools.Utility.Assert.isTrue(e.line>=0,"Line outside of range");F12.Tools.Utility.Assert.isTrue(e.column>=0,"Column outside of range");var t;if(e.line>=this._lineOffsets.length)t=Math.max(0,this._length-1);else{t=this._lineOffsets[e.line]+e.column;e.line<this._lineOffsets.length-1&&t>=this._lineOffsets[e.line+1]&&(t=this._lineOffsets[e.line+1]-1);t>=this._length&&(t=Math.max(0,this._length-1))}return t+this._start}}e.SourceSpan=t}(e.FormatService||(e.FormatService={}))}(Common||(Common={}));
