{"version":3,"names":["_unsupportedIterableToArray","require","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","unsupportedIterableToArray","length","i","F","s","n","done","value","e","f","TypeError","normalCompletion","didErr","err","call","step","next","return"],"sources":["../../src/helpers/createForOfIteratorHelper.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n\nexport type IteratorFunction = () => Iterator;\n\nexport interface ForOfIteratorHelper {\n // s: start (create the iterator)\n s: () => void;\n // n: next\n n: () => IteratorResult;\n // e: error (called whenever something throws)\n e: (e: Error) => void;\n // f: finish (always called at the end)\n f: () => void;\n}\n\nexport default function _createForOfIteratorHelper(\n o: T[] | Iterable | ArrayLike,\n allowArrayLike: boolean,\n): ForOfIteratorHelper {\n var it: IteratorFunction | Iterator | T[] | undefined =\n (typeof Symbol !== \"undefined\" && (o as Iterable)[Symbol.iterator]) ||\n (o as any)[\"@@iterator\"];\n\n if (!it) {\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n // union type doesn't work with function overload, have to use \"as any\".\n (it = unsupportedIterableToArray(o as any) as T[] | undefined) ||\n (allowArrayLike && o && typeof (o as ArrayLike).length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n var F = function () {};\n return {\n s: F,\n n: function () {\n // After \"Array.isArray\" check, unsupportedIterableToArray to array, and allow arraylike\n // o is sure to be an array or arraylike, but TypeScript doesn't know that\n if (i >= (o as T[] | ArrayLike).length) {\n // explicit missing the \"value\" (undefined) to reduce the bundle size\n return { done: true } as IteratorReturnResult;\n }\n return { done: false, value: (o as T[] | ArrayLike)[i++] };\n },\n e: function (e: Error) {\n throw e;\n },\n f: F,\n };\n }\n\n throw new TypeError(\n \"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n }\n\n var normalCompletion = true,\n didErr = false,\n err: Error | undefined;\n\n // \"it\" is being reassigned multiple times to reduce the variables (bundle size)\n // thus TypeScript can't infer the correct type of the \"it\"\n return {\n s: function () {\n it = (it as IteratorFunction).call(o);\n },\n n: function () {\n var step = (it as Iterator).next();\n normalCompletion = step.done!;\n return step;\n },\n e: function (e: Error) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && (it as Iterator).return != null) {\n (it as Iterator).return!();\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didErr) throw err!;\n }\n },\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAee,SAASC,0BAA0BA,CAChDC,CAAmC,EACnCC,cAAuB,EACC;EACxB,IAAIC,EAAuD,GACxD,OAAOC,MAAM,KAAK,WAAW,IAAKH,CAAC,CAAiBG,MAAM,CAACC,QAAQ,CAAC,IACpEJ,CAAC,CAAS,YAAY,CAAC;EAE1B,IAAI,CAACE,EAAE,EAAE;IAEP,IACEG,KAAK,CAACC,OAAO,CAACN,CAAC,CAAC,KAEfE,EAAE,GAAG,IAAAK,mCAA0B,EAACP,CAAQ,CAAoB,CAAC,IAC7DC,cAAc,IAAID,CAAC,IAAI,OAAQA,CAAC,CAAkBQ,MAAM,KAAK,QAAS,EACvE;MACA,IAAIN,EAAE,EAAEF,CAAC,GAAGE,EAAE;MACd,IAAIO,CAAC,GAAG,CAAC;MACT,IAAIC,CAAC,GAAG,SAAAA,CAAA,EAAY,CAAC,CAAC;MACtB,OAAO;QACLC,CAAC,EAAED,CAAC;QACJE,CAAC,EAAE,SAAAA,CAAA,EAAY;UAGb,IAAIH,CAAC,IAAKT,CAAC,CAAwBQ,MAAM,EAAE;YAEzC,OAAO;cAAEK,IAAI,EAAE;YAAK,CAAC;UACvB;UACA,OAAO;YAAEA,IAAI,EAAE,KAAK;YAAEC,KAAK,EAAGd,CAAC,CAAwBS,CAAC,EAAE;UAAE,CAAC;QAC/D,CAAC;QACDM,CAAC,EAAE,SAAAA,CAAUA,CAAQ,EAAE;UACrB,MAAMA,CAAC;QAC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