(function(i,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis<"u"?globalThis:i||self,i.index=t())})(this,function(){"use strict";const t=typeof window<"u"&&window.navigator.userAgent.toLowerCase(),f=t&&/msie|trident/.test(t),a=t&&/iphone|ipad|ipod|ios/.test(t);function c(e){return typeof e=="function"&&/native code/.test(e.toString())}const l=typeof Promise<"u"&&c(Promise),p=!f&&typeof MutationObserver<"u"&&(c(MutationObserver)||MutationObserver.toString()==="[object MutationObserverConstructor]");let u=!1;const d=[];function s(){u=!1;const e=d.slice(0);d.length=0;for(let n=0;n{Promise.resolve().then(s),a&&setTimeout(()=>{})};else if(p){let e=1;const n=new MutationObserver(s),r=document.createTextNode(String(e));n.observe(r,{characterData:!0}),o=()=>{e=(e+1)%2,r.data=String(e)}}else typeof setImmediate<"u"&&c(setImmediate)?o=()=>{setImmediate(s)}:o=()=>{setTimeout(s,0)};function m(e,n){e&&d.push(()=>{try{e.call(n)}catch(r){console.error("Error occurred in nextTick callback:",r)}}),u||(u=!0,o())}return m});