PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
const selection = document.getSelection();
    const { focusNode, anchorNode } = selection;
    if (
      anchorNode &&
      focusNode &&
      selection.containsNode(this.#hiddenCopyElement)
    ) {
      
      
      
      
      
      
      
      if (
        this.#getAllTextInProgress ||
        textLayerMode === TextLayerMode.ENABLE_PERMISSIONS
      ) {
        event.preventDefault();
        event.stopPropagation();
        return;
      }
      this.#getAllTextInProgress = true;