anchor.diff:  
   uses
     Classes, SysUtils, Generics.Collections, Generics.Defaults,
  -  Variants, LazUTF8, math, typinfo, UMemory;
  +  Variants, LazUTF8, math, typinfo, UMemory, ExtCtrls;
   
   { CONSTANTS }
   
  
positive.code:     Result := LowerCase(Result + IntToHex(Ord(Buffer[n]), 2));
  end;
  
  
  function Buffer2Hex(const ABuffer: TBytes) : AnsiString;
  var
    i : Integer;
    s : AnsiString;
    b : Byte;
  begin
    System.SetLength(Result, System.Length(ABuffer)*2);
    for i := 0 to System.Length( ABuffer ) - 1 do begin
      b := Ord(ABuffer[i+1]);
      s := IntToHex(b,2);
      Result[(i*2)+1] := s[1];
      Result[(i*2)+2] := s[2];
    end;
  end;
  
  
negative.code: begin
    for i := Low(Self) to high(Self) do
      self[i](sender, args);
  end;
  
  {%endregion}
  
  {%region TThrottledEvent }
  
  constructor TThrottledEvent.Create(Owner:TComponent);
  begin
    Inherited Create(Owner);
    FTimer := TTimer.Create(Self);
    FTimer.Interval := CT_DEFAULT_DELAYEDREFRESH_MS;
    FTimer.OnTimer := OnTimer;
    FTimer.Enabled := false;
    FSuppressedInvocations:=0;
    FLastClientNotify := MinDateTime;
    FLastActualNotify := MinDateTime;
    FMode:=temNone;
  end;
  
  procedure TThrottledEvent.Add(AListener : TNotifyEvent);
  begin
    FHandler.Add(AListener);
  end;
  
  procedure TThrottledEvent.Remove(AListener : TNotifyEvent);
  begin
    FHandler.Remove(AListener);
  end;
  
  procedure TThrottledEvent.Notify;
  var LIdleDuration : TTimeSpan;
  begin
    FLastClientNotify:=Now;
    LIdleDuration := TTimeSpan.Subtract(Now, FLastActualNotify);
    if (FMode = temNone) OR ((NOT FTimer.Enabled) AND (LIdleDuration > Interval)) then
      NotifyNow
    else
      NotifyLater;
  end;
  
  procedure TThrottledEvent.NotifyNow;
  begin
    FTimer.Enabled := false;
    FLastActualNotify:=Now;
    FHandler.Invoke(nil);
    FSuppressedInvocations:=0;
  end;
  
  procedure TThrottledEvent.NotifyLater;
  begin
    inc(FSuppressedInvocations);
    if NOT FTimer.Enabled then
      FTimer.Enabled:=true;
  end;
  
  procedure TThrottledEvent.OnTimer(Sender: TObject);
  var LDuration : TTimeSpan;
  begin
    case FMode of
      temNone: NotifyNow;
      temNotifyEveryInterval: begin
        LDuration := TTimeSpan.Subtract(Now, FLastActualNotify);
        if LDuration > Interval then
          NotifyNow;
      end;
      temNotifyOnEventBurstFinished: begin
        LDuration := TTimeSpan.Subtract(Now, FLastClientNotify);
        if LDuration > Interval then
          NotifyNow;
      end;
    end;
  end;
  
  procedure TThrottledEvent.SetInterval(const ATimeSpan : TTimeSpan);
  begin
    if ATimeSpan.TotalMilliseconds = 0 then
      raise EArgumentOutOfRangeException.Create('ATimeSpan was 0');
  
    FTimer.Interval := round( abs( ATimeSpan.TotalMilliseconds ) );
  end;
  
  function TThrottledEvent.GetInterval : TTimeSpan;
  begin
   Result := TTimeSpan.FromMilliseconds( FTimer.Interval );
  end;
  
  {%endregion}
  