。
She was gazing absently out the window.
Literal
She [topic-は] absently window's outside [object-を] was-gazing.
眺める is a more contemplative cousin of 見る ('see'), implying gazing or surveying — taking in a scene with some duration and attention. Pairing it with ぼんやりと creates a tension: a focused, absorbed activity (gazing) carried out in an unfocused, drifting state of mind. The と after ぼんやり is the optional adverbial と that often attaches to mimetic adverbs and a few other modifiers; ぼんやり alone would be fine too. The past progressive ~ていた sets the scene as a continuing past action.