/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/multistream-select@3.0.2/src/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";const select=require("./select"),handle=require("./handle"),ls=require("./ls"),{PROTOCOL_ID:PROTOCOL_ID}=require("./constants");exports.PROTOCOL_ID=PROTOCOL_ID;class MultistreamSelect{constructor(e){this._stream=e,this._shaken=!1}async _handshake(e){if(this._shaken)return;const{stream:s}=await select(this._stream,PROTOCOL_ID,void 0,e);this._stream=s,this._shaken=!0}}class Dialer extends MultistreamSelect{select(e,s){return select(this._stream,e,this._shaken?void 0:PROTOCOL_ID,s)}async ls(e){await this._handshake(e);const s=await ls(this._stream,e),{stream:t,protocols:r}=s;return this._stream=t,r}}exports.Dialer=Dialer;class Listener extends MultistreamSelect{handle(e,s){return handle(this._stream,e,s)}}exports.Listener=Listener;
//# sourceMappingURL=/sm/6830ffcedd156b5dfca8c69e1139ee04579849666b213eb5cedbc912f407f637.map