A 42-year-old woman presented to the hospital with a severe headache on the right side and loss of vision that had been going on for two days. She had a history of hypertension and was taking bendroflumethiazide. Her family had a history of thyroid problems, and she had experienced intermittent headaches in the past, although they were not regular. On examination, she was agitated and distressed, with a temperature of 37.5°C, a pulse of 110 beats per minute, and a blood pressure of 145/95 mmHg. The right eye showed chemosis and proptosis, with upward and downward gaze paralysis and preserved lateral gaze. The right pupil was dilated and unresponsive to light, while the left eye was normal. Bilateral papilloedema was observed during fundoscopy. What is the most likely diagnosis?