···2323await customElements.whenDefined(outputOrchestrator.localName);
2424await customElements.whenDefined(ATPROTO_NAME);
25252626-// The AT Protocol option is added dynamically by the output-bundle facet, which
2727-// runs in a separate script and appends the element to the output configurator
2828-// via a signal effect. That effect may not have fired yet when this facet loads,
2929-// so we observe the configurator for child-list mutations and resolve as soon as
3030-// the option appears.
3131-const outputConfigurator = outputOrchestrator.outputConfigurator;
3232-3333-const atprotoOption = await new Promise((resolve) => {
3434- const check = async () => {
3535- const opt = (await outputOrchestrator.options()).find(
3636- (o) => o.label === "AT Protocol",
3737- );
3838- if (opt) {
3939- observer.disconnect();
4040- resolve(opt);
4141- }
4242- };
4343-4444- const observer = new MutationObserver(check);
4545- observer.observe(outputConfigurator, { childList: true });
4646- check();
4747-});
4848-2626+const atprotoOption = await outputOrchestrator.waitForOption("AT Protocol");
4927const ATPROTO_OUTPUT_ID = atprotoOption.id;
50285129const atprotoEl = /** @type {ATProtoOutputElement | undefined} */ (