@ApiStatus.Internal
  void cancelTemplate() {
    if (isDisposed()) return;
    try {
      fireTemplateCancelled();
      cleanupTemplateState();
    }
    finally {
      Disposer.dispose(this);
    }
  }
@ApiStatus.Internal
  void cancelTemplate()