UNPKG

react-voice-search

Version:

React voice search component with audio visualization, speech recognition, and cross-browser support for Web Speech API. SSR-compatible with Next.js.

16 lines 54 kB
"use strict";var e=require("react");function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function t(e,r,t,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void t(e)}s.done?r(c):Promise.resolve(c).then(n,i)}function n(e){return function(){var r=this,n=arguments;return new Promise(function(i,o){var a=e.apply(r,n);function s(e){t(a,i,o,s,c,"next",e)}function c(e){t(a,i,o,s,c,"throw",e)}s(void 0)})}}function i(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach(function(r){i(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function s(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e,r,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function o(t,n,i,o){var s=n&&n.prototype instanceof u?n:u,l=Object.create(s.prototype);return c(l,"_invoke",function(t,n,i){var o,s,c,u=0,l=i||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(r,t){return o=r,s=0,c=e,p.n=t,a}};function d(t,n){for(s=t,c=n,r=0;!f&&u&&!i&&r<l.length;r++){var i,o=l[r],d=p.p,b=o[2];t>3?(i=b===n)&&(c=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=t<2&&d<o[1])?(s=0,p.v=n,p.n=o[1]):d<b&&(i=t<3||o[0]>n||n>b)&&(o[4]=t,o[5]=n,p.n=b,s=0))}if(i||t>1)return a;throw f=!0,n}return function(i,l,b){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,b),s=l,c=b;(r=s<2?e:c)||!f;){o||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,o){if(s||(i="next"),r=o[i]){if(!(r=r.call(o,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,s<2&&(s=0)}else 1===s&&(r=o.return)&&r.call(o),s<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((r=(f=p.n<0)?c:t.call(n,p))!==a)break}catch(r){o=e,s=1,c=r}finally{u=1}}return{value:r,done:f}}}(t,i,o),!0),l}var a={};function u(){}function l(){}function f(){}r=Object.getPrototypeOf;var p=[][n]?r(r([][n]())):(c(r={},n,function(){return this}),r),d=f.prototype=u.prototype=Object.create(p);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,c(d,"constructor",f),c(f,"constructor",l),l.displayName="GeneratorFunction",c(f,i,"GeneratorFunction"),c(d),c(d,i,"Generator"),c(d,n,function(){return this}),c(d,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:b}})()}function c(e,r,t,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}c=function(e,r,t,n){if(r)i?i(e,r,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[r]=t;else{function o(r,t){c(e,r,function(e){return this._invoke(r,t,e)})}o("next",0),o("throw",1),o("return",2)}},c(e,r,t,n)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(t=t.call(e)).next,0===r);else for(;!(c=(n=o.call(t)).done)&&(s.push(n.value),s.length!==r);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f,p={exports:{}},d={exports:{}},b={};var w,m,h,y,v,g,x,k,S,O,E,j,C,T,P,_={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function I(){return m||(m=1,"production"===process.env.NODE_ENV?d.exports=function(){if(f)return b;f=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,w=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case r:switch(e=e.type){case c:case u:case n:case o:case i:case p:return e;default:switch(e=e&&e.$$typeof){case s:case l:case m:case w:case a:return e;default:return f}}case t:return f}}}function k(e){return x(e)===u}return b.AsyncMode=c,b.ConcurrentMode=u,b.ContextConsumer=s,b.ContextProvider=a,b.Element=r,b.ForwardRef=l,b.Fragment=n,b.Lazy=m,b.Memo=w,b.Portal=t,b.Profiler=o,b.StrictMode=i,b.Suspense=p,b.isAsyncMode=function(e){return k(e)||x(e)===c},b.isConcurrentMode=k,b.isContextConsumer=function(e){return x(e)===s},b.isContextProvider=function(e){return x(e)===a},b.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},b.isForwardRef=function(e){return x(e)===l},b.isFragment=function(e){return x(e)===n},b.isLazy=function(e){return x(e)===m},b.isMemo=function(e){return x(e)===w},b.isPortal=function(e){return x(e)===t},b.isProfiler=function(e){return x(e)===o},b.isStrictMode=function(e){return x(e)===i},b.isSuspense=function(e){return x(e)===p},b.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===o||e===i||e===p||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===w||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===y||e.$$typeof===v||e.$$typeof===g||e.$$typeof===h)},b.typeOf=x,b}():d.exports=(w||(w=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,w=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:var w=e.type;switch(w){case c:case u:case n:case o:case i:case f:return w;default:var m=w&&w.$$typeof;switch(m){case s:case l:case b:case d:case a:return m;default:return p}}case t:return p}}}var g=c,x=u,k=s,S=a,O=r,E=l,j=n,C=b,T=d,P=t,I=o,M=i,$=f,A=!1;function N(e){return v(e)===u}_.AsyncMode=g,_.ConcurrentMode=x,_.ContextConsumer=k,_.ContextProvider=S,_.Element=O,_.ForwardRef=E,_.Fragment=j,_.Lazy=C,_.Memo=T,_.Portal=P,_.Profiler=I,_.StrictMode=M,_.Suspense=$,_.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),N(e)||v(e)===c},_.isConcurrentMode=N,_.isContextConsumer=function(e){return v(e)===s},_.isContextProvider=function(e){return v(e)===a},_.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},_.isForwardRef=function(e){return v(e)===l},_.isFragment=function(e){return v(e)===n},_.isLazy=function(e){return v(e)===b},_.isMemo=function(e){return v(e)===d},_.isPortal=function(e){return v(e)===t},_.isProfiler=function(e){return v(e)===o},_.isStrictMode=function(e){return v(e)===i},_.isSuspense=function(e){return v(e)===f},_.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===o||e===i||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===m||e.$$typeof===h||e.$$typeof===y||e.$$typeof===w)},_.typeOf=v}()),_)),d.exports} /* object-assign (c) Sindre Sorhus @license MIT */function M(){if(y)return h;y=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return h=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,i){for(var o,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),c=1;c<arguments.length;c++){for(var u in o=Object(arguments[c]))r.call(o,u)&&(s[u]=o[u]);if(e){a=e(o);for(var l=0;l<a.length;l++)t.call(o,a[l])&&(s[a[l]]=o[a[l]])}}return s},h}function $(){if(g)return v;g=1;return v="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function A(){return k?x:(k=1,x=Function.call.bind(Object.prototype.hasOwnProperty))}function N(){if(O)return S;O=1;var e=function(){};if("production"!==process.env.NODE_ENV){var r=$(),t={},n=A();e=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function i(i,o,a,s,c){if("production"!==process.env.NODE_ENV)for(var u in i)if(n(i,u)){var l;try{if("function"!=typeof i[u]){var f=Error((s||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}l=i[u](o,u,s,a,null,r)}catch(e){l=e}if(!l||l instanceof Error||e((s||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in t)){t[l.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+l.message+(null!=p?p:""))}}}return i.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},S=i}function R(){if(j)return E;j=1;var e=I(),r=M(),t=$(),n=A(),i=N(),o=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),E=function(s,c){var u="function"==typeof Symbol&&Symbol.iterator;var l="<<anonymous>>",f={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:b(a),arrayOf:function(e){return b(function(r,n,i,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var s=r[n];if(!Array.isArray(s))return new d("Invalid "+o+" `"+a+"` of type `"+y(s)+"` supplied to `"+i+"`, expected an array.");for(var c=0;c<s.length;c++){var u=e(s,c,i,o,a+"["+c+"]",t);if(u instanceof Error)return u}return null})},element:b(function(e,r,t,n,i){var o=e[r];return s(o)?null:new d("Invalid "+n+" `"+i+"` of type `"+y(o)+"` supplied to `"+t+"`, expected a single ReactElement.")}),elementType:b(function(r,t,n,i,o){var a=r[t];return e.isValidElementType(a)?null:new d("Invalid "+i+" `"+o+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return b(function(r,t,n,i,o){if(!(r[t]instanceof e)){var a=e.name||l;return new d("Invalid "+i+" `"+o+"` of type `"+(((s=r[t]).constructor&&s.constructor.name?s.constructor.name:l)+"` supplied to `")+n+"`, expected instance of `"+a+"`.")}var s;return null})},node:b(function(e,r,t,n,i){return h(e[r])?null:new d("Invalid "+n+" `"+i+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return b(function(r,i,o,a,s){if("function"!=typeof e)return new d("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var c=r[i],u=y(c);if("object"!==u)return new d("Invalid "+a+" `"+s+"` of type `"+u+"` supplied to `"+o+"`, expected an object.");for(var l in c)if(n(c,l)){var f=e(c,l,o,a,s+"."+l,t);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return b(function(r,t,n,i,o){for(var a=r[t],s=0;s<e.length;s++)if(p(a,e[s]))return null;var c=JSON.stringify(e,function(e,r){return"symbol"===v(r)?String(r):r});return new d("Invalid "+i+" `"+o+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+c+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var r=0;r<e.length;r++){var i=e[r];if("function"!=typeof i)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(i)+" at index "+r+"."),a}return b(function(r,i,o,a,s){for(var c=[],u=0;u<e.length;u++){var l=(0,e[u])(r,i,o,a,s,t);if(null==l)return null;l.data&&n(l.data,"expectedType")&&c.push(l.data.expectedType)}return new d("Invalid "+a+" `"+s+"` supplied to `"+o+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return b(function(r,n,i,o,a){var s=r[n],c=y(s);if("object"!==c)return new d("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+i+"`, expected `object`.");for(var u in e){var l=e[u];if("function"!=typeof l)return m(i,o,a,u,v(l));var f=l(s,u,i,o,a+"."+u,t);if(f)return f}return null})},exact:function(e){return b(function(i,o,a,s,c){var u=i[o],l=y(u);if("object"!==l)return new d("Invalid "+s+" `"+c+"` of type `"+l+"` supplied to `"+a+"`, expected `object`.");var f=r({},i[o],e);for(var p in f){var b=e[p];if(n(e,p)&&"function"!=typeof b)return m(a,s,c,p,v(b));if(!b)return new d("Invalid "+s+" `"+c+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(i[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var w=b(u,p,a,s,c+"."+p,t);if(w)return w}return null})}};function p(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function d(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function b(e){if("production"!==process.env.NODE_ENV)var r={},n=0;function i(i,a,s,u,f,p,b){if(u=u||l,p=p||s,b!==t){if(c){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=u+":"+s;!r[m]&&n<3&&(o("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[m]=!0,n++)}}return null==a[s]?i?null===a[s]?new d("The "+f+" `"+p+"` is marked as required in `"+u+"`, but its value is `null`."):new d("The "+f+" `"+p+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(a,s,u,f,p)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function w(e){return b(function(r,t,n,i,o,a){var s=r[t];return y(s)!==e?new d("Invalid "+i+" `"+o+"` of type `"+v(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function m(e,r,t,n,i){return new d((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||s(e))return!0;var r=function(e){var r=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof r)return r}(e);if(!r)return!1;var t,n=r.call(e);if(r!==e.entries){for(;!(t=n.next()).done;)if(!h(t.value))return!1}else for(;!(t=n.next()).done;){var i=t.value;if(i&&!h(i[1]))return!1}return!0;default:return!1}}function y(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function v(e){if(null==e)return""+e;var r=y(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function g(e){var r=v(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return d.prototype=Error.prototype,f.checkPropTypes=i,f.resetWarningCache=i.resetWarningCache,f.PropTypes=f,f},E}function z(){if(T)return C;T=1;var e=$();function r(){}function t(){}return t.resetWarningCache=r,C=function(){function n(r,t,n,i,o,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function i(){return n}n.isRequired=n;var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:r};return o.PropTypes=o,o}}function q(){if(P)return p.exports;if(P=1,"production"!==process.env.NODE_ENV){var e=I();p.exports=R()(e.isElement,true)}else p.exports=z()();return p.exports}var V,D=l(q()),F="user-agent",H="",U="function",B="undefined",W="object",L="string",G="browser",X="cpu",Y="device",J="engine",K="os",Q="result",Z="name",ee="type",re="vendor",te="version",ne="architecture",ie="major",oe="model",ae="console",se="mobile",ce="tablet",ue="smarttv",le="wearable",fe="xr",pe="embedded",de="inapp",be="brands",we="formFactors",me="fullVersionList",he="platform",ye="platformVersion",ve="bitness",ge="sec-ch-ua",xe=ge+"-full-version-list",ke=ge+"-arch",Se=ge+"-"+ve,Oe=ge+"-form-factors",Ee=ge+"-"+se,je=ge+"-"+oe,Ce=ge+"-"+he,Te=Ce+"-version",Pe=[be,me,se,oe,he,ye,ne,we,ve],_e="Amazon",Ie="Apple",Me="ASUS",$e="BlackBerry",Ae="Google",Ne="Huawei",Re="Lenovo",ze="Honor",qe="LG",Ve="Microsoft",De="Motorola",Fe="Nvidia",He="OnePlus",Ue="OPPO",Be="Samsung",We="Sharp",Le="Sony",Ge="Xiaomi",Xe="Zebra",Ye="Chrome",Je="Chromium",Ke="Chromecast",Qe="Edge",Ze="Firefox",er="Opera",rr="Facebook",tr="Sogou",nr="Mobile ",ir=" Browser",or="Windows",ar=typeof window!==B&&window.navigator?window.navigator:void 0,sr=ar&&ar.userAgentData?ar.userAgentData:void 0,cr=function(e){for(var r={},t=0;t<e.length;t++)r[e[t].toUpperCase()]=e[t];return r},ur=function(e,r){if(typeof e===W&&e.length>0){for(var t in e)if(dr(r)==dr(e[t]))return!0;return!1}return!!fr(e)&&dr(r)==dr(e)},lr=function(e,r){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||!!r&&lr(e[t])},fr=function(e){return typeof e===L},pr=function(e){if(e){for(var r=[],t=mr(/\\?\"/g,e).split(","),n=0;n<t.length;n++)if(t[n].indexOf(";")>-1){var i=yr(t[n]).split(";v=");r[n]={brand:i[0],version:i[1]}}else r[n]=yr(t[n]);return r}},dr=function(e){return fr(e)?e.toLowerCase():e},br=function(e){return fr(e)?mr(/[^\d\.]/g,e).split(".")[0]:void 0},wr=function(e){for(var r in e){var t=e[r];typeof t==W&&2==t.length?this[t[0]]=t[1]:this[t]=void 0}return this},mr=function(e,r){return fr(r)?r.replace(e,H):r},hr=function(e){return mr(/\\?\"/g,e)},yr=function(e,r){if(fr(e))return e=mr(/^\s\s*/,e),typeof r===B?e:e.substring(0,500)},vr=function(e,r){if(e&&r)for(var t,n,i,o,a,s,c=0;c<r.length&&!a;){var u=r[c],l=r[c+1];for(t=n=0;t<u.length&&!a&&u[t];)if(a=u[t++].exec(e))for(i=0;i<l.length;i++)s=a[++n],typeof(o=l[i])===W&&o.length>0?2===o.length?typeof o[1]==U?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]!==U||o[1].exec&&o[1].test?3==o.length?this[o[0]]=s?s.replace(o[1],o[2]):void 0:4==o.length?this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=s?o[3].apply(this,[s.replace(o[1],o[2])].concat(o.slice(4))):void 0):o.length>3?this[o[0]]=s?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0):this[o]=s||void 0;c+=2}},gr=function(e,r){for(var t in r)if(typeof r[t]===W&&r[t].length>0){for(var n=0;n<r[t].length;n++)if(ur(r[t][n],e))return"?"===t?void 0:t}else if(ur(r[t],e))return"?"===t?void 0:t;return r.hasOwnProperty("*")?r["*"]:e},xr={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},kr={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Sr={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Or={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[te,[Z,nr+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[te,[Z,Qe+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[te,[Z,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[Z,te],[/opios[\/ ]+([\w\.]+)/i],[te,[Z,er+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[te,[Z,er+" GX"]],[/\bopr\/([\w\.]+)/i],[te,[Z,er]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[te,[Z,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[te,[Z,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[Z,te],[/quark(?:pc)?\/([-\w\.]+)/i],[te,[Z,"Quark"]],[/\bddg\/([\w\.]+)/i],[te,[Z,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[te,[Z,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[te,[Z,"WeChat"]],[/konqueror\/([\w\.]+)/i],[te,[Z,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[te,[Z,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[te,[Z,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[te,[Z,"Smart "+Re+ir]],[/(avast|avg)\/([\w\.]+)/i],[[Z,/(.+)/,"$1 Secure"+ir],te],[/\bfocus\/([\w\.]+)/i],[te,[Z,Ze+" Focus"]],[/\bopt\/([\w\.]+)/i],[te,[Z,er+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[te,[Z,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[te,[Z,"Dolphin"]],[/coast\/([\w\.]+)/i],[te,[Z,er+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[te,[Z,"MIUI"+ir]],[/fxios\/([\w\.-]+)/i],[te,[Z,nr+Ze]],[/\bqihoobrowser\/?([\w\.]*)/i],[te,[Z,"360"]],[/\b(qq)\/([\w\.]+)/i],[[Z,/(.+)/,"$1Browser"],te],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[Z,/(.+)/,"$1"+ir],te],[/samsungbrowser\/([\w\.]+)/i],[te,[Z,Be+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[te,[Z,tr+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[Z,tr+" Mobile"],te],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[Z,te],[/(lbbrowser|rekonq)/i],[Z],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[te,Z],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[Z,rr],te,[ee,de]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[Z,te,[ee,de]],[/\bgsa\/([\w\.]+) .*safari\//i],[te,[Z,"GSA"],[ee,de]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[te,[Z,"TikTok"],[ee,de]],[/\[(linkedin)app\]/i],[Z,[ee,de]],[/(chromium)[\/ ]([-\w\.]+)/i],[Z,te],[/headlesschrome(?:\/([\w\.]+)| )/i],[te,[Z,Ye+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[te,[Z,Qe+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[Z,Ye+" WebView"],te],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[te,[Z,"Android"+ir]],[/chrome\/([\w\.]+) mobile/i],[te,[Z,nr+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[Z,te],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[te,[Z,nr+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[Z,nr+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[te,Z],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[Z,[te,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[Z,te],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[Z,nr+Ze],te],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[Z,"Netscape"],te],[/(wolvic|librewolf)\/([\w\.]+)/i],[Z,te],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[te,[Z,Ze+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[Z,[te,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[Z,[te,/[^\d\.]+./,H]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ne,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ne,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ne,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ne,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ne,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ne,/ower/,H,dr]],[/ sun4\w[;\)]/i],[[ne,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ne,dr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[oe,[re,Be],[ee,ce]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[oe,[re,Be],[ee,se]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[oe,[re,Ie],[ee,se]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[oe,[re,Ie],[ee,ce]],[/(macintosh);/i],[oe,[re,Ie]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[oe,[re,We],[ee,se]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[oe,[re,ze],[ee,ce]],[/honor([-\w ]+)[;\)]/i],[oe,[re,ze],[ee,se]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[oe,[re,Ne],[ee,ce]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[oe,[re,Ne],[ee,se]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[oe,/_/g," "],[re,Ge],[ee,ce]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[oe,/_/g," "],[re,Ge],[ee,se]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[oe,[re,He],[ee,se]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[oe,[re,Ue],[ee,se]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[oe,[re,gr,{OnePlus:["203","304","403","404","413","415"],"*":Ue}],[ee,ce]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[oe,[re,"BLU"],[ee,se]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[oe,[re,"Vivo"],[ee,se]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[oe,[re,"Realme"],[ee,se]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[oe,[re,Re],[ee,ce]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[oe,[re,Re],[ee,se]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[oe,[re,De],[ee,se]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[oe,[re,De],[ee,ce]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[oe,[re,qe],[ee,ce]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[oe,[re,qe],[ee,se]],[/(nokia) (t[12][01])/i],[re,oe,[ee,ce]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[oe,/_/g," "],[ee,se],[re,"Nokia"]],[/(pixel (c|tablet))\b/i],[oe,[re,Ae],[ee,ce]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[oe,[re,Ae],[ee,se]],[/(google) (pixelbook( go)?)/i],[re,oe],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[oe,[re,Le],[ee,se]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[oe,"Xperia Tablet"],[re,Le],[ee,ce]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[oe,[re,_e],[ee,ce]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[oe,/(.+)/g,"Fire Phone $1"],[re,_e],[ee,se]],[/(playbook);[-\w\),; ]+(rim)/i],[oe,re,[ee,ce]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[oe,[re,$e],[ee,se]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[oe,[re,Me],[ee,ce]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[oe,[re,Me],[ee,se]],[/(nexus 9)/i],[oe,[re,"HTC"],[ee,ce]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[re,[oe,/_/g," "],[ee,se]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[oe,[re,"TCL"],[ee,ce]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[oe,[re,"TCL"],[ee,se]],[/(itel) ((\w+))/i],[[re,dr],oe,[ee,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[oe,[re,"Acer"],[ee,ce]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[oe,[re,"Meizu"],[ee,se]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[oe,[re,"Ulefone"],[ee,se]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[oe,[re,"Energizer"],[ee,se]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[oe,[re,"Cat"],[ee,se]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[oe,[re,"Smartfren"],[ee,se]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[oe,[re,"Nothing"],[ee,se]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[oe,[re,"Archos"],[ee,ce]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[oe,[re,"Archos"],[ee,se]],[/; (n159v)/i],[oe,[re,"HMD"],[ee,se]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[re,oe,[ee,ce]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[re,oe,[ee,se]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[re,oe,[ee,ce]],[/(surface duo)/i],[oe,[re,Ve],[ee,ce]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[oe,[re,"Fairphone"],[ee,se]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[oe,[re,Fe],[ee,ce]],[/(sprint) (\w+)/i],[re,oe,[ee,se]],[/(kin\.[onetw]{3})/i],[[oe,/\./g," "],[re,Ve],[ee,se]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[oe,[re,Xe],[ee,ce]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[oe,[re,Xe],[ee,se]],[/smart-tv.+(samsung)/i],[re,[ee,ue]],[/hbbtv.+maple;(\d+)/i],[[oe,/^/,"SmartTV"],[re,Be],[ee,ue]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[re,oe,[ee,ue]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[re,qe],[ee,ue]],[/(apple) ?tv/i],[re,[oe,Ie+" TV"],[ee,ue]],[/crkey.*devicetype\/chromecast/i],[[oe,Ke+" Third Generation"],[re,Ae],[ee,ue]],[/crkey.*devicetype\/([^/]*)/i],[[oe,/^/,"Chromecast "],[re,Ae],[ee,ue]],[/fuchsia.*crkey/i],[[oe,Ke+" Nest Hub"],[re,Ae],[ee,ue]],[/crkey/i],[[oe,Ke],[re,Ae],[ee,ue]],[/(portaltv)/i],[oe,[re,rr],[ee,ue]],[/droid.+aft(\w+)( bui|\))/i],[oe,[re,_e],[ee,ue]],[/(shield \w+ tv)/i],[oe,[re,Fe],[ee,ue]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[oe,[re,We],[ee,ue]],[/(bravia[\w ]+)( bui|\))/i],[oe,[re,Le],[ee,ue]],[/(mi(tv|box)-?\w+) bui/i],[oe,[re,Ge],[ee,ue]],[/Hbbtv.*(technisat) (.*);/i],[re,oe,[ee,ue]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[re,/.+\/(\w+)/,"$1",gr,{LG:"lge"}],[oe,yr],[ee,ue]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[oe,[ee,ue]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[ee,ue]],[/(playstation \w+)/i],[oe,[re,Le],[ee,ae]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[oe,[re,Ve],[ee,ae]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[re,oe,[ee,ae]],[/droid.+; (shield)( bui|\))/i],[oe,[re,Fe],[ee,ae]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[oe,[re,Be],[ee,le]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[re,oe,[ee,le]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[oe,[re,Ue],[ee,le]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[oe,[re,Ie],[ee,le]],[/(opwwe\d{3})/i],[oe,[re,He],[ee,le]],[/(moto 360)/i],[oe,[re,De],[ee,le]],[/(smartwatch 3)/i],[oe,[re,Le],[ee,le]],[/(g watch r)/i],[oe,[re,qe],[ee,le]],[/droid.+; (wt63?0{2,3})\)/i],[oe,[re,Xe],[ee,le]],[/droid.+; (glass) \d/i],[oe,[re,Ae],[ee,fe]],[/(pico) (4|neo3(?: link|pro)?)/i],[re,oe,[ee,fe]],[/(quest( \d| pro)?s?).+vr/i],[oe,[re,rr],[ee,fe]],[/mobile vr; rv.+firefox/i],[[ee,fe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[re,[ee,pe]],[/(aeobc)\b/i],[oe,[re,_e],[ee,pe]],[/(homepod).+mac os/i],[oe,[re,Ie],[ee,pe]],[/windows iot/i],[[ee,pe]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[oe,[ee,gr,{mobile:"Mobile",xr:"VR","*":ce}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[ee,ce]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[ee,se]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[oe,[re,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[te,[Z,Qe+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[Z,te],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[te,[Z,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[Z,te],[/ladybird\//i],[[Z,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[te,Z]],os:[[/(windows nt) (6\.[23]); arm/i],[[Z,/N/,"R"],[te,gr,xr]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[Z,te],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[te,/(;|\))/g,"",gr,xr],[Z,or]],[/(windows ce)\/?([\d\.]*)/i],[Z,te],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[te,/_/g,"."],[Z,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[Z,"macOS"],[te,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[te,[Z,Ke+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[te,[Z,Ke+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[te,[Z,Ke+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[te,[Z,Ke+" Linux"]],[/crkey\/([\d\.]+)/i],[te,[Z,Ke]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[te,Z],[/(ubuntu) ([\w\.]+) like android/i],[[Z,/(.+)/,"$1 Touch"],te],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[Z,te],[/\(bb(10);/i],[te,[Z,$e]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[te,[Z,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[te,[Z,Ze+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[te,[Z,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[te,gr,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[Z,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[te,[Z,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[Z,"Chrome OS"],te],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[Z,te],[/(sunos) ?([\d\.]*)/i],[[Z,"Solaris"],te],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[Z,te]]},Er=(wr.call((V={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}}).init,[[G,[Z,te,ie,ee]],[X,[ne]],[Y,[ee,oe,re]],[J,[Z,te]],[K,[Z,te]]]),wr.call(V.isIgnore,[[G,[te,ie]],[J,[te]],[K,[te]]]),wr.call(V.isIgnoreRgx,[[G,/ ?browser$/i],[K,/ ?os$/i]]),wr.call(V.toString,[[G,[Z,te]],[X,[ne]],[Y,[re,oe]],[J,[Z,te]],[K,[Z,te]]]),V),jr=function(e,r){var t=Er.init[r],n=Er.isIgnore[r]||0,i=Er.isIgnoreRgx[r]||0,o=Er.toString[r]||0;function a(){wr.call(this,t)}return a.prototype.getItem=function(){return e},a.prototype.withClientHints=function(){return sr?sr.getHighEntropyValues(Pe).then(function(r){return e.setCH(new Cr(r,!1)).parseCH().get()}):e.parseCH().get()},a.prototype.withFeatureCheck=function(){return e.detectFeature().get()},r!=Q&&(a.prototype.is=function(e){var r=!1;for(var t in this)if(this.hasOwnProperty(t)&&!ur(n,t)&&dr(i?mr(i,this[t]):this[t])==dr(i?mr(i,e):e)){if(r=!0,e!=B)break}else if(e==B&&r){r=!r;break}return r},a.prototype.toString=function(){var e=H;for(var r in o)typeof this[o[r]]!==B&&(e+=(e?" ":H)+this[o[r]]);return e||B}),sr||(a.prototype.then=function(e){var r=this,t=function(){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e])};t.prototype={is:a.prototype.is,toString:a.prototype.toString};var n=new t;return e(n),n}),new a};function Cr(e,r){if(e=e||{},wr.call(this,Pe),r)wr.call(this,[[be,pr(e[ge])],[me,pr(e[xe])],[se,/\?1/.test(e[Ee])],[oe,hr(e[je])],[he,hr(e[Ce])],[ye,hr(e[Te])],[ne,hr(e[ke])],[we,pr(e[Oe])],[ve,hr(e[Se])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==B&&(this[t]=e[t])}function Tr(e,r,t,n){return this.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},this.set=function(e,r){return this.data[e]=r,this},this.setCH=function(e){return this.uaCH=e,this},this.detectFeature=function(){if(ar&&ar.userAgent==this.ua)switch(this.itemType){case G:ar.brave&&typeof ar.brave.isBrave==U&&this.set(Z,"Brave");break;case Y:!this.get(ee)&&sr&&sr[se]&&this.set(ee,se),"Macintosh"==this.get(oe)&&ar&&typeof ar.standalone!==B&&ar.maxTouchPoints&&ar.maxTouchPoints>2&&this.set(oe,"iPad").set(ee,ce);break;case K:!this.get(Z)&&sr&&sr[he]&&this.set(Z,sr[he]);break;case Q:var e=this.data,r=function(r){return e[r].getItem().detectFeature().get()};this.set(G,r(G)).set(X,r(X)).set(Y,r(Y)).set(J,r(J)).set(K,r(K))}return this},this.parseUA=function(){return this.itemType!=Q&&vr.call(this.data,this.ua,this.rgxMap),this.itemType==G&&this.set(ie,br(this.get(te))),this},this.parseCH=function(){var e=this.uaCH,r=this.rgxMap;switch(this.itemType){case G:case J:var t,n=e[me]||e[be];if(n)for(var i in n){var o=n[i].brand||n[i],a=n[i].version;this.itemType==G&&!/not.a.brand/i.test(o)&&(!t||/Chrom/.test(t)&&o!=Je||t==Qe&&/WebView2/.test(o))&&(o=gr(o,Sr),(t=this.get(Z))&&!/Chrom/.test(t)&&/Chrom/.test(o)||this.set(Z,o).set(te,a).set(ie,br(a)),t=o),this.itemType==J&&o==Je&&this.set(te,a)}break;case X:var s=e[ne];s&&(s&&"64"==e[ve]&&(s+="64"),vr.call(this.data,s+";",r));break;case Y:if(e[se]&&this.set(ee,se),e[oe]&&(this.set(oe,e[oe]),!this.get(ee)||!this.get(re))){var c={};vr.call(c,"droid 9; "+e[oe]+")",r),!this.get(ee)&&c.type&&this.set(ee,c.type),!this.get(re)&&c.vendor&&this.set(re,c.vendor)}if(e[we]){var u;if("string"!=typeof e[we])for(var l=0;!u&&l<e[we].length;)u=gr(e[we][l++],kr);else u=gr(e[we],kr);this.set(ee,u)}break;case K:var f=e[he];if(f){var p=e[ye];f==or&&(p=parseInt(br(p),10)>=13?"11":"10"),this.set(Z,f).set(te,p)}this.get(Z)==or&&"Xbox"==e[oe]&&this.set(Z,"Xbox").set(te,void 0);break;case Q:var d=this.data,b=function(r){return d[r].getItem().setCH(e).parseCH().get()};this.set(G,b(G)).set(X,b(X)).set(Y,b(Y)).set(J,b(J)).set(K,b(K))}return this},wr.call(this,[["itemType",e],["ua",r],["uaCH",n],["rgxMap",t],["data",jr(this,e)]]),this}function Pr(e,r,t){if(typeof e===W?(lr(e,!0)?(typeof r===W&&(t=r),r=e):(t=e,r=void 0),e=void 0):typeof e!==L||lr(r,!0)||(t=r,r=void 0),t&&typeof t.append===U){var n={};t.forEach(function(e,r){n[r]=e}),t=n}if(!(this instanceof Pr))return new Pr(e,r,t).getResult();var i=typeof e===L?e:t&&t[F]?t[F]:ar&&ar.userAgent?ar.userAgent:H,o=new Cr(t,!0),a=r?function(e,r){var t={},n=r;if(!lr(r))for(var i in n={},r)for(var o in r[i])n[o]=r[i][o].concat(n[o]?n[o]:[]);for(var a in e)t[a]=n[a]&&n[a].length%2==0?n[a].concat(e[a]):e[a];return t}(Or,r):Or,s=function(e){return e==Q?function(){return new Tr(e,i,a,o).set("ua",i).set(G,this.getBrowser()).set(X,this.getCPU()).set(Y,this.getDevice()).set(J,this.getEngine()).set(K,this.getOS()).get()}:function(){return new Tr(e,i,a[e],o).parseUA().get()}};return wr.call(this,[["getBrowser",s(G)],["getCPU",s(X)],["getDevice",s(Y)],["getEngine",s(J)],["getOS",s(K)],["getResult",s(Q)],["getUA",function(){return i}],["setUA",function(e){return fr(e)&&(i=e.length>500?yr(e,500):e),this}]]).setUA(i),this}Pr.VERSION="2.0.4",Pr.BROWSER=cr([Z,te,ie,ee]),Pr.CPU=cr([ne]),Pr.DEVICE=cr([oe,re,ee,ae,se,ue,ce,le,pe]),Pr.ENGINE=Pr.OS=cr([Z,te]);var _r=function(r){var t=r.className;return e.createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"24",height:"24"},e.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1-9c0-.55.45-1 1-1s1 .45 1 1v6c0 .55-.45 1-1 1s-1-.45-1-1V5zm6 6c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))},Ir="undefined"!=typeof window,Mr=null;Ir&&(Mr=window.SpeechRecognition||window.webkitSpeechRecognition||null);var $r=function(r){var t=r.width,i=r.darkMode,o=void 0!==i&&i,c=r.handleSearch,l=r.language,f=void 0===l?"en-US":l,p=r.customMicIcon,d=r.customStyles,b=void 0===d?{}:d,w=r.customClasses,m=void 0===w?{}:w,h=r.Error,y=void 0===h?function(){}:h,v=u(e.useState(!1),2),g=v[0],x=v[1],k=u(e.useState(0),2),S=k[0],O=k[1],E=u(e.useState(!1),2),j=E[0],C=E[1],T=u(e.useState(!1),2),P=T[0],_=T[1],I=e.useRef(null),M=e.useRef(null),$=e.useRef(null),A=e.useRef(null),N=e.useRef(null),R=e.useRef(null),z=e.useRef(!1);e.useEffect(function(){if(Ir)try{var e,r,t=(new Pr).getResult(),n=(null===(e=t.browser.name)||void 0===e?void 0:e.includes("Firefox"))||(null===(r=t.browser.name)||void 0===r?void 0:r.includes("Opera"));_(Mr&&!n)}catch(e){if(!Ir)return;var i=window.navigator.userAgent.toLowerCase(),o=i.indexOf("firefox")>-1||i.indexOf("opera")>-1;_(Mr&&!o)}},[]),e.useEffect(function(){if(Ir){var e=window.navigator.userAgent.toLowerCase();C(/android/.test(e))}},[]);var q=function(){if(N.current){try{cancelAnimationFrame(N.current)}catch(e){}N.current=null}z.current=!1},V=function(){if(I.current){try{I.current.abort()}catch(e){}try{I.current.stop()}catch(e){}try{I.current.onresult=null,I.current.onerror=null,I.current.onend=null,I.current.onstart=null,I.current.onspeechend=null,I.current.onsoundstart=null,I.current.onsoundend=null,I.current.onaudiostart=null,I.current.onaudioend=null,I.current.onnomatch=null}catch(e){}I.current=null}},D=function(){x(!1),V(),q(),function(){if(A.current)try{A.current.getTracks().forEach(function(e){try{e.stop()}catch(e){}try{e.enabled=!1}catch(e){}})}catch(e){}}(),R.current&&clearTimeout(R.current),R.current=setTimeout(function(){!function(){if(q(),A.current){try{A.current.getTracks().forEach(function(e){try{e.stop()}catch(e){}try{e.enabled=!1}catch(e){}try{e.onended=null}catch(e){}try{e.onmute=null}catch(e){}try{e.onunmute=null}catch(e){}})}catch(e){}A.current=null}if(M.current){try{"closed"!==M.current.state&&M.current.close()}catch(e){}M.current=null}if($.current=null,O(0),navigator.mediaDevices)try{var e;"function"==typeof(null===(e=navigator.permissions)||void 0===e?void 0:e.revoke)?navigator.permissions.revoke({name:"microphone"}).catch(function(){}):navigator.mediaDevices.getUserMedia({audio:!1}).catch(function(){})}catch(e){}if(Ir&&!M.current)try{var r=window.AudioContext||window.webkitAudioContext;r&&(new r).close().catch(function(){})}catch(e){}}(),R.current=null},300)},F=function(){var e=n(s().m(function e(){var r,t,n,i,o;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(Ir&&!j){e.n=1;break}return e.a(2);case 1:if(e.p=1,q(),M.current){e.n=4;break}if(!(t=window.AudioContext||window.webkitAudioContext)){e.n=2;break}M.current=new t,e.n=3;break;case 2:return e.a(2);case 3:e.n=5;break;case 4:if("suspended"!==M.current.state){e.n=5;break}return e.n=5,M.current.resume();case 5:if(null!==(r=navigator)&&void 0!==r&&null!==(r=r.mediaDevices)&&void 0!==r&&r.getUserMedia){e.n=6;break}return e.a(2);case 6:return e.n=7,navigator.mediaDevices.getUserMedia({audio:!0,video:!1});case 7:n=e.v,A.current=n,(i=M.current.createAnalyser()).fftSize=256,i.smoothingTimeConstant=.8,M.current.createMediaStreamSource(n).connect(i),$.current=i,H(),e.n=9;break;case 8:e.p=8,o=e.v,console.error("Error accessing microphone for analysis:",o);case 9:return e.a(2)}},e,null,[[1,8]])}));return function(){return e.apply(this,arguments)}}(),H=function(){if($.current&&Ir){q();var e=new Uint8Array($.current.frequencyBinCount);z.current=!0;var r=function(){if($.current&&z.current)try{$.current.getByteFrequencyData(e);for(var t=0,n=0;n<e.length;n++)t+=e[n];var i=t/e.length,o=Math.min(100,Math.max(0,1.5*i));z.current&&(O(o),N.current=requestAnimationFrame(r))}catch(e){q()}else q()};N.current=re