$(function () {
  const noteStore = lichess.storage.make('inquiry-note');
  const noteTextArea = $('#inquiry .notes').find('textarea')[0];

  $('#inquiry .notes').on('mouseenter', function () {
    noteTextArea.focus();
    noteTextArea.value = noteStore.get();
  });

  $('#inquiry .notes').on('keydown', function () {
    setTimeout(function () {
      noteStore.set(noteTextArea.value);
    }, 5);
  });

  $('#inquiry .notes').on('submit', function () {
    noteStore.remove();
  });

  $('#inquiry .costello').on('click', () => {
    $('#inquiry').toggleClass('hidden');
    $('body').toggleClass('no-inquiry');
  });

  const nextStore = lichess.storage.makeBoolean('inquiry-auto-next');

  if (!nextStore.get()) {
    $('#inquiry .switcher input').prop('checked', false);
    $('#inquiry input.auto-next').val('0');
  }

  $('#inquiry .switcher input').on('change', function () {
    nextStore.set(this.checked);
    $('#inquiry input.auto-next').val(this.checked ? '1' : '0');
  });

  Mousetrap.bind('d', () => $('#inquiry .actions.close form.process button[type="submit"]').trigger('click'));
});

@@ -1095,13 +1095,193 @@
 lick'));
+%0A%0A  $('#inquiry .atom p').each(function () %7B%0A    $(this).html(%0A      $(this)%0A        .html()%0A        .replaceAll(/lichess%5C.org%5C/(%5B%5Cw%5C/%5D%7B8,%7D)/g, '%3Ca href=%22/$1%22%3E$1%3C/a%3E')%0A    );%0A  %7D);
 %0A%7D);%0A

patch inquiry link - replace me with server-side fix