constructor(url, eventSourceInitDict = {}) {
        super();
        __privateAdd(this, _connect);
        /**
         * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
         * @returns {Promise<void>}
         */
        __privateAdd(this, _reconnect);
        __privateAdd(this, _events, {
          open: null,
          error: null,
          message: null
        });
        __privateAdd(this, _url, null);
        __privateAdd(this, _withCredentials, false);
        __privateAdd(this, _readyState, CONNECTING);
        __privateAdd(this, _request, null);
        __privateAdd(this, _controller, null);
        __privateAdd(this, _dispatcher, void 0);
        /**
         * @type {import('./eventsource-stream').eventSourceSettings}
         */
        __privateAdd(this, _state, void 0);
        webidl.util.markAsUncloneable(this);
        const prefix = "EventSource constructor";
        webidl.argumentLengthCheck(arguments, 1, prefix);
        if (!experimentalWarned) {
          experimentalWarned = true;
          define_process_default.emitWarning("EventSource is experimental, expect them to change at any time.", {
            code: "UNDICI-ES"
          });
        }
        url = webidl.converters.USVString(url, prefix, "url");
        eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict");
        __privateSet(this, _dispatcher, eventSourceInitDict.dispatcher);
        __privateSet(this, _state, {
          lastEventId: "",
          reconnectionTime: defaultReconnectionTime
        });
        const settings = environmentSettingsObject;
        let urlRecord;
        try {
          urlRecord = new URL(url, settings.settingsObject.baseUrl);
          __privateGet(this, _state).origin = urlRecord.origin;
        } catch (e) {
          throw new DOMException(e, "SyntaxError");
        }
        __privateSet(this, _url, urlRecord.href);
        let corsAttributeState = ANONYMOUS;
        if (eventSourceInitDict.withCredentials) {
          corsAttributeState = USE_CREDENTIALS;
          __privateSet(this, _withCredentials, true);
        }
        const initRequest = {
          redirect: "follow",
          keepalive: true,
          // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
          mode: "cors",
          credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit",
          referrer: "no-referrer"
        };
        initRequest.client = environmentSettingsObject.settingsObject;
        initRequest.headersList = [["accept", { name: "accept", value: "text/event-stream" }]];
        initRequest.cache = "no-store";
        initRequest.initiator = "other";
        initRequest.urlList = [new URL(__privateGet(this, _url))];
        __privateSet(this, _request, makeRequest(initRequest));
        __privateMethod(this, _connect, connect_fn).call(this);
      }
Creates a new EventSource object.
@param {string} url
@param {EventSourceInit} [eventSourceInitDict]
@see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface