usegamigameapi 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -37
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ Your code should look like:
|
|
|
10
10
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
11
|
2. You might be breaking the Rules of Hooks
|
|
12
12
|
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function q(){d.asyncTransitions--}function H(e){if(Z===null)try{var n=("require"+Math.random()).slice(0,7);Z=(te&&te[n]).call(te,"timers").setImmediate}catch(o){Z=function(u){ze===!1&&(ze=!0,typeof MessageChannel=="undefined"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var a=new MessageChannel;a.port1.onmessage=u,a.port2.postMessage(void 0)}}return Z(e)}function S(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function L(e,n){n!==V-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),V=n}function se(e,n,o){var u=d.actQueue;if(u!==null)if(u.length!==0)try{ie(u),H(function(){return se(e,n,o)});return}catch(a){d.thrownErrors.push(a)}else d.actQueue=null;0<d.thrownErrors.length?(u=S(d.thrownErrors),d.thrownErrors.length=0,o(u)):n(e)}function ie(e){if(!de){de=!0;var n=0;try{for(;n<e.length;n++){var o=e[n];do{d.didUsePromise=!1;var u=o(!1);if(u!==null){if(d.didUsePromise){e[n]=o,e.splice(0,n);return}o=u}else break}while(!0)}e.length=0}catch(a){e.splice(0,n+1),d.thrownErrors.push(a)}finally{de=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ae=Symbol.for("react.transitional.element"),Oe=Symbol.for("react.portal"),ce=Symbol.for("react.fragment"),Se=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),fe=Symbol.for("react.consumer"),Ce=Symbol.for("react.context"),Ae=Symbol.for("react.forward_ref"),ke=Symbol.for("react.suspense"),ut=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),Pe=Symbol.for("react.activity"),Ne=Symbol.iterator,je={},Le={isMounted:function(){return!1},enqueueForceUpdate:function(e){s(e,"forceUpdate")},enqueueReplaceState:function(e){s(e,"replaceState")},enqueueSetState:function(e){s(e,"setState")}},Me=Object.assign,pe={};Object.freeze(pe),i.prototype.isReactComponent={},i.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var O={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(G in O)O.hasOwnProperty(G)&&t(G,O[G]);c.prototype=i.prototype,O=y.prototype=new c,O.constructor=y,Me(O,i.prototype),O.isPureReactComponent=!0;var $e=Array.isArray,st=Symbol.for("react.client.reference"),d={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},F=Object.prototype.hasOwnProperty,Ie=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(e){return e()}};var De,He,Ue={},it=O.react_stack_bottom_frame.bind(O,W)(),at=Ie(B(W)),Ye=!1,xe=/\/+/g,We=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ze=!1,Z=null,V=0,J=!1,de=!1,qe=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:H;O=Object.freeze({__proto__:null,c:function(e){return m().useMemoCache(e)}});var G={map:D,forEach:function(e,n,o){D(e,function(){n.apply(this,arguments)},o)},count:function(e){var n=0;return D(e,function(){n++}),n},toArray:function(e){return D(e,function(n){return n})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};f.Activity=Pe,f.Children=G,f.Component=i,f.Fragment=ce,f.Profiler=be,f.PureComponent=y,f.StrictMode=Se,f.Suspense=ke,f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,f.__COMPILER_RUNTIME=O,f.act=function(e){var n=d.actQueue,o=V;V++;var u=d.actQueue=n!==null?n:[],a=!1;try{var _=e()}catch(E){d.thrownErrors.push(E)}if(0<d.thrownErrors.length)throw L(n,o),e=S(d.thrownErrors),d.thrownErrors.length=0,e;if(_!==null&&typeof _=="object"&&typeof _.then=="function"){var p=_;return qe(function(){a||J||(J=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(E,k){a=!0,p.then(function(U){if(L(n,o),o===0){try{ie(u),H(function(){return se(U,E,k)})}catch(ft){d.thrownErrors.push(ft)}if(0<d.thrownErrors.length){var ct=S(d.thrownErrors);d.thrownErrors.length=0,k(ct)}}else E(U)},function(U){L(n,o),0<d.thrownErrors.length&&(U=S(d.thrownErrors),d.thrownErrors.length=0),k(U)})}}}var v=_;if(L(n,o),o===0&&(ie(u),u.length!==0&&qe(function(){a||J||(J=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),d.actQueue=null),0<d.thrownErrors.length)throw e=S(d.thrownErrors),d.thrownErrors.length=0,e;return{then:function(E,k){a=!0,o===0?(d.actQueue=u,H(function(){return se(v,E,k)})):E(v)}}},f.cache=function(e){return function(){return e.apply(null,arguments)}},f.cacheSignal=function(){return null},f.captureOwnerStack=function(){var e=d.getCurrentStack;return e===null?null:e()},f.cloneElement=function(e,n,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=Me({},e.props),a=e.key,_=e._owner;if(n!=null){var p;e:{if(F.call(n,"ref")&&(p=Object.getOwnPropertyDescriptor(n,"ref").get)&&p.isReactWarning){p=!1;break e}p=n.ref!==void 0}p&&(_=K()),X(n)&&(R(n.key),a=""+n.key);for(v in n)!F.call(n,v)||v==="key"||v==="__self"||v==="__source"||v==="ref"&&n.ref===void 0||(u[v]=n[v])}var v=arguments.length-2;if(v===1)u.children=o;else if(1<v){p=Array(v);for(var E=0;E<v;E++)p[E]=arguments[E+2];u.children=p}for(u=N(e.type,a,u,_,e._debugStack,e._debugTask),a=2;a<arguments.length;a++)z(arguments[a]);return u},f.createContext=function(e){return e={$$typeof:Ce,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:fe,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},f.createElement=function(e,n,o){for(var u=2;u<arguments.length;u++)z(arguments[u]);u={};var a=null;if(n!=null)for(E in He||!("__self"in n)||"key"in n||(He=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),X(n)&&(R(n.key),a=""+n.key),n)F.call(n,E)&&E!=="key"&&E!=="__self"&&E!=="__source"&&(u[E]=n[E]);var _=arguments.length-2;if(_===1)u.children=o;else if(1<_){for(var p=Array(_),v=0;v<_;v++)p[v]=arguments[v+2];Object.freeze&&Object.freeze(p),u.children=p}if(e&&e.defaultProps)for(E in _=e.defaultProps,_)u[E]===void 0&&(u[E]=_[E]);a&&ne(u,typeof e=="function"?e.displayName||e.name||"Unknown":e);var E=1e4>d.recentlyCreatedOwnerStacks++;return N(e,a,u,K(),E?Error("react-stack-top-frame"):it,E?Ie(B(e)):at)},f.createRef=function(){var e={current:null};return Object.seal(e),e},f.forwardRef=function(e){e!=null&&e.$$typeof===le?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var n={$$typeof:Ae,render:e},o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.isValidElement=C,f.lazy=function(e){e={_status:-1,_result:e};var n={$$typeof:Q,_payload:e,_init:ue},o={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=o,n._debugInfo=[{awaited:o}],n},f.memo=function(e,n){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),n={$$typeof:le,type:e,compare:n===void 0?null:n};var o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.startTransition=function(e){var n=d.T,o={};o._updatedFibers=new Set,d.T=o;try{var u=e(),a=d.S;a!==null&&a(o,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&(d.asyncTransitions++,u.then(q,q),u.then(h,We))}catch(_){We(_)}finally{n===null&&o._updatedFibers&&(e=o._updatedFibers.size,o._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),n!==null&&o.types!==null&&(n.types!==null&&n.types!==o.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),n.types=o.types),d.T=n}},f.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},f.use=function(e){return m().use(e)},f.useActionState=function(e,n,o){return m().useActionState(e,n,o)},f.useCallback=function(e,n){return m().useCallback(e,n)},f.useContext=function(e){var n=m();return e.$$typeof===fe&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),n.useContext(e)},f.useDebugValue=function(e,n){return m().useDebugValue(e,n)},f.useDeferredValue=function(e,n){return m().useDeferredValue(e,n)},f.useEffect=function(e,n){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(e,n)},f.useEffectEvent=function(e){return m().useEffectEvent(e)},f.useId=function(){return m().useId()},f.useImperativeHandle=function(e,n,o){return m().useImperativeHandle(e,n,o)},f.useInsertionEffect=function(e,n){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(e,n)},f.useLayoutEffect=function(e,n){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(e,n)},f.useMemo=function(e,n){return m().useMemo(e,n)},f.useOptimistic=function(e,n){return m().useOptimistic(e,n)},f.useReducer=function(e,n,o){return m().useReducer(e,n,o)},f.useRef=function(e){return m().useRef(e)},f.useState=function(e){return m().useState(e)},f.useSyncExternalStore=function(e,n,o){return m().useSyncExternalStore(e,n,o)},f.useTransition=function(){return m().useTransition()},f.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var ot=ye((It,we)=>{"use strict";process.env.NODE_ENV==="production"?we.exports=nt():we.exports=rt()});var w=mt(ot());var M={SHOW_LO5:"SHOW_LO5",RETURN_LO5:"RETURN_LO5",UPDATE_ANSWER:"UPDATE_ANSWER",RETURN_UPDATE_ANSWER:"RETURN_UPDATE_ANSWER",FINISH:"FINISH"},Te=class{constructor(){this.handlers={};window.addEventListener("message",this.handleMessage.bind(this))}handleMessage(r){let{type:s,payload:i}=r.data;this.handlers[s]&&this.handlers[s](i)}on(r,s){this.handlers[r]=s}send(r,s={}){window.parent&&window.parent.postMessage({type:r,payload:s},"*")}},$=new Te;console.log("useGameAPI-V1.0.8");function Ut({onAnswerCorrect:t,onAnswerIncorrect:r}){let[s,i]=(0,w.useState)(0),c=(0,w.useRef)(0),[y,h]=(0,w.useState)(null),[T,R]=(0,w.useState)([]),[b,B]=(0,w.useState)(null),[K,W]=(0,w.useState)(null),[X,ne]=(0,w.useState)(0),[P,N]=(0,w.useState)(!1),[j,z]=(0,w.useState)(!1),[C,re]=(0,w.useState)(!1),I=(0,w.useRef)(!1),oe=(0,w.useCallback)(()=>{$.send(M.FINISH)},[]),A=(0,w.useCallback)(async()=>{if(!(!y||P))return $.send(M.UPDATE_ANSWER,y.id),N(!0),z(!0),Promise.resolve()},[y,P]),D=(0,w.useCallback)(()=>{if(j)if(I.current)re(!0);else{$.send(M.SHOW_LO5);let m=c.current+1;c.current=m,i(m),h(null),N(!1),z(!1),W(null)}},[j]),ue=(0,w.useCallback)(m=>{!P&&!j&&h(m)},[P,j]);return(0,w.useEffect)(()=>{$.send(M.SHOW_LO5),$.on(M.RETURN_LO5,m=>{B(m)}),$.on(M.RETURN_UPDATE_ANSWER,m=>{let q=(m==null?void 0:m.isCorrect)===!0,H=(m==null?void 0:m.isLastQuestion)===!0;I.current=H,R(S=>{let L=[...S];return L[c.current]=q,L}),q?(ne(S=>S+1),console.log({currentQuestionIndex:c.current}),t==null||t({currentQuestionIndex:c.current})):r==null||r(),N(!1),W(m)})},[]),{quiz:b,currentResult:K,answers:T,correctCount:X,currentQuestionIndex:s,selectedAnswer:y,isSubmitting:P,hasSubmitted:j,isCompleted:C,handleAnswerSelect:ue,updateAnswer:A,handleContinue:D,finish:oe}}export{Ut as useGameAPI};
|
|
13
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function q(){d.asyncTransitions--}function H(e){if(Z===null)try{var n=("require"+Math.random()).slice(0,7);Z=(te&&te[n]).call(te,"timers").setImmediate}catch(o){Z=function(u){ze===!1&&(ze=!0,typeof MessageChannel=="undefined"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var a=new MessageChannel;a.port1.onmessage=u,a.port2.postMessage(void 0)}}return Z(e)}function S(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function L(e,n){n!==V-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),V=n}function se(e,n,o){var u=d.actQueue;if(u!==null)if(u.length!==0)try{ie(u),H(function(){return se(e,n,o)});return}catch(a){d.thrownErrors.push(a)}else d.actQueue=null;0<d.thrownErrors.length?(u=S(d.thrownErrors),d.thrownErrors.length=0,o(u)):n(e)}function ie(e){if(!de){de=!0;var n=0;try{for(;n<e.length;n++){var o=e[n];do{d.didUsePromise=!1;var u=o(!1);if(u!==null){if(d.didUsePromise){e[n]=o,e.splice(0,n);return}o=u}else break}while(!0)}e.length=0}catch(a){e.splice(0,n+1),d.thrownErrors.push(a)}finally{de=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ae=Symbol.for("react.transitional.element"),Oe=Symbol.for("react.portal"),ce=Symbol.for("react.fragment"),Se=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),fe=Symbol.for("react.consumer"),Ce=Symbol.for("react.context"),Ae=Symbol.for("react.forward_ref"),ke=Symbol.for("react.suspense"),ut=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),Pe=Symbol.for("react.activity"),Ne=Symbol.iterator,je={},Le={isMounted:function(){return!1},enqueueForceUpdate:function(e){s(e,"forceUpdate")},enqueueReplaceState:function(e){s(e,"replaceState")},enqueueSetState:function(e){s(e,"setState")}},Me=Object.assign,pe={};Object.freeze(pe),i.prototype.isReactComponent={},i.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var O={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(G in O)O.hasOwnProperty(G)&&t(G,O[G]);c.prototype=i.prototype,O=y.prototype=new c,O.constructor=y,Me(O,i.prototype),O.isPureReactComponent=!0;var $e=Array.isArray,st=Symbol.for("react.client.reference"),d={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},F=Object.prototype.hasOwnProperty,Ie=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(e){return e()}};var De,He,Ue={},it=O.react_stack_bottom_frame.bind(O,W)(),at=Ie(B(W)),Ye=!1,xe=/\/+/g,We=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ze=!1,Z=null,V=0,J=!1,de=!1,qe=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:H;O=Object.freeze({__proto__:null,c:function(e){return m().useMemoCache(e)}});var G={map:D,forEach:function(e,n,o){D(e,function(){n.apply(this,arguments)},o)},count:function(e){var n=0;return D(e,function(){n++}),n},toArray:function(e){return D(e,function(n){return n})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};f.Activity=Pe,f.Children=G,f.Component=i,f.Fragment=ce,f.Profiler=be,f.PureComponent=y,f.StrictMode=Se,f.Suspense=ke,f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,f.__COMPILER_RUNTIME=O,f.act=function(e){var n=d.actQueue,o=V;V++;var u=d.actQueue=n!==null?n:[],a=!1;try{var _=e()}catch(E){d.thrownErrors.push(E)}if(0<d.thrownErrors.length)throw L(n,o),e=S(d.thrownErrors),d.thrownErrors.length=0,e;if(_!==null&&typeof _=="object"&&typeof _.then=="function"){var p=_;return qe(function(){a||J||(J=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(E,k){a=!0,p.then(function(U){if(L(n,o),o===0){try{ie(u),H(function(){return se(U,E,k)})}catch(ft){d.thrownErrors.push(ft)}if(0<d.thrownErrors.length){var ct=S(d.thrownErrors);d.thrownErrors.length=0,k(ct)}}else E(U)},function(U){L(n,o),0<d.thrownErrors.length&&(U=S(d.thrownErrors),d.thrownErrors.length=0),k(U)})}}}var v=_;if(L(n,o),o===0&&(ie(u),u.length!==0&&qe(function(){a||J||(J=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),d.actQueue=null),0<d.thrownErrors.length)throw e=S(d.thrownErrors),d.thrownErrors.length=0,e;return{then:function(E,k){a=!0,o===0?(d.actQueue=u,H(function(){return se(v,E,k)})):E(v)}}},f.cache=function(e){return function(){return e.apply(null,arguments)}},f.cacheSignal=function(){return null},f.captureOwnerStack=function(){var e=d.getCurrentStack;return e===null?null:e()},f.cloneElement=function(e,n,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=Me({},e.props),a=e.key,_=e._owner;if(n!=null){var p;e:{if(F.call(n,"ref")&&(p=Object.getOwnPropertyDescriptor(n,"ref").get)&&p.isReactWarning){p=!1;break e}p=n.ref!==void 0}p&&(_=K()),X(n)&&(R(n.key),a=""+n.key);for(v in n)!F.call(n,v)||v==="key"||v==="__self"||v==="__source"||v==="ref"&&n.ref===void 0||(u[v]=n[v])}var v=arguments.length-2;if(v===1)u.children=o;else if(1<v){p=Array(v);for(var E=0;E<v;E++)p[E]=arguments[E+2];u.children=p}for(u=N(e.type,a,u,_,e._debugStack,e._debugTask),a=2;a<arguments.length;a++)z(arguments[a]);return u},f.createContext=function(e){return e={$$typeof:Ce,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:fe,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},f.createElement=function(e,n,o){for(var u=2;u<arguments.length;u++)z(arguments[u]);u={};var a=null;if(n!=null)for(E in He||!("__self"in n)||"key"in n||(He=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),X(n)&&(R(n.key),a=""+n.key),n)F.call(n,E)&&E!=="key"&&E!=="__self"&&E!=="__source"&&(u[E]=n[E]);var _=arguments.length-2;if(_===1)u.children=o;else if(1<_){for(var p=Array(_),v=0;v<_;v++)p[v]=arguments[v+2];Object.freeze&&Object.freeze(p),u.children=p}if(e&&e.defaultProps)for(E in _=e.defaultProps,_)u[E]===void 0&&(u[E]=_[E]);a&&ne(u,typeof e=="function"?e.displayName||e.name||"Unknown":e);var E=1e4>d.recentlyCreatedOwnerStacks++;return N(e,a,u,K(),E?Error("react-stack-top-frame"):it,E?Ie(B(e)):at)},f.createRef=function(){var e={current:null};return Object.seal(e),e},f.forwardRef=function(e){e!=null&&e.$$typeof===le?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var n={$$typeof:Ae,render:e},o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.isValidElement=C,f.lazy=function(e){e={_status:-1,_result:e};var n={$$typeof:Q,_payload:e,_init:ue},o={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=o,n._debugInfo=[{awaited:o}],n},f.memo=function(e,n){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),n={$$typeof:le,type:e,compare:n===void 0?null:n};var o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.startTransition=function(e){var n=d.T,o={};o._updatedFibers=new Set,d.T=o;try{var u=e(),a=d.S;a!==null&&a(o,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&(d.asyncTransitions++,u.then(q,q),u.then(h,We))}catch(_){We(_)}finally{n===null&&o._updatedFibers&&(e=o._updatedFibers.size,o._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),n!==null&&o.types!==null&&(n.types!==null&&n.types!==o.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),n.types=o.types),d.T=n}},f.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},f.use=function(e){return m().use(e)},f.useActionState=function(e,n,o){return m().useActionState(e,n,o)},f.useCallback=function(e,n){return m().useCallback(e,n)},f.useContext=function(e){var n=m();return e.$$typeof===fe&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),n.useContext(e)},f.useDebugValue=function(e,n){return m().useDebugValue(e,n)},f.useDeferredValue=function(e,n){return m().useDeferredValue(e,n)},f.useEffect=function(e,n){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(e,n)},f.useEffectEvent=function(e){return m().useEffectEvent(e)},f.useId=function(){return m().useId()},f.useImperativeHandle=function(e,n,o){return m().useImperativeHandle(e,n,o)},f.useInsertionEffect=function(e,n){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(e,n)},f.useLayoutEffect=function(e,n){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(e,n)},f.useMemo=function(e,n){return m().useMemo(e,n)},f.useOptimistic=function(e,n){return m().useOptimistic(e,n)},f.useReducer=function(e,n,o){return m().useReducer(e,n,o)},f.useRef=function(e){return m().useRef(e)},f.useState=function(e){return m().useState(e)},f.useSyncExternalStore=function(e,n,o){return m().useSyncExternalStore(e,n,o)},f.useTransition=function(){return m().useTransition()},f.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var ot=ye((It,we)=>{"use strict";process.env.NODE_ENV==="production"?we.exports=nt():we.exports=rt()});var w=mt(ot());var M={SHOW_LO5:"SHOW_LO5",RETURN_LO5:"RETURN_LO5",UPDATE_ANSWER:"UPDATE_ANSWER",RETURN_UPDATE_ANSWER:"RETURN_UPDATE_ANSWER",FINISH:"FINISH"},Te=class{constructor(){this.handlers={};window.addEventListener("message",this.handleMessage.bind(this))}handleMessage(r){let{type:s,payload:i}=r.data;this.handlers[s]&&this.handlers[s](i)}on(r,s){this.handlers[r]=s}send(r,s={}){window.parent&&window.parent.postMessage({type:r,payload:s},"*")}},$=new Te;console.log("useGameAPI-V1.0.11");function Ut({onAnswerCorrect:t,onAnswerIncorrect:r}){let[s,i]=(0,w.useState)(0),c=(0,w.useRef)(0),[y,h]=(0,w.useState)(null),[T,R]=(0,w.useState)([]),[b,B]=(0,w.useState)(null),[K,W]=(0,w.useState)(null),[X,ne]=(0,w.useState)(0),[P,N]=(0,w.useState)(!1),[j,z]=(0,w.useState)(!1),[C,re]=(0,w.useState)(!1),I=(0,w.useRef)(!1),oe=(0,w.useCallback)(()=>{$.send(M.FINISH)},[]),A=(0,w.useCallback)(async()=>{if(!(!y||P))return $.send(M.UPDATE_ANSWER,y.id),N(!0),z(!0),Promise.resolve()},[y,P]),D=(0,w.useCallback)(()=>{if(j)if(I.current)re(!0);else{$.send(M.SHOW_LO5);let m=c.current+1;c.current=m,i(m),h(null),N(!1),z(!1),W(null)}},[j]),ue=(0,w.useCallback)(m=>{!P&&!j&&h(m)},[P,j]);return(0,w.useEffect)(()=>{$.send(M.SHOW_LO5),$.on(M.RETURN_LO5,m=>{B(m)}),$.on(M.RETURN_UPDATE_ANSWER,m=>{let q=(m==null?void 0:m.isCorrect)===!0,H=(m==null?void 0:m.isLastQuestion)===!0;I.current=H,R(S=>{let L=[...S];return L[c.current]=q,L}),q?(ne(S=>S+1),console.log({currentQuestionIndex:c.current}),t==null||t({currentQuestionIndex:c.current})):r==null||r(),N(!1),W(m)})},[]),{quiz:b,currentResult:K,answers:T,correctCount:X,currentQuestionIndex:s,selectedAnswer:y,isSubmitting:P,hasSubmitted:j,isCompleted:C,handleAnswerSelect:ue,updateAnswer:A,handleContinue:D,finish:oe}}export{Ut as useGameAPI};
|
|
14
14
|
/*! Bundled license information:
|
|
15
15
|
|
|
16
16
|
react/cjs/react.production.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usegamigameapi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsup",
|
|
12
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external react",
|
|
13
13
|
"publish": "npm run build && npm publish --access public"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
package/dist/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare function useGameAPI({ onAnswerCorrect, onAnswerIncorrect }: any): {
|
|
2
|
-
quiz: any;
|
|
3
|
-
currentResult: any;
|
|
4
|
-
answers: (boolean | null)[];
|
|
5
|
-
correctCount: number;
|
|
6
|
-
currentQuestionIndex: number;
|
|
7
|
-
selectedAnswer: {
|
|
8
|
-
id: number;
|
|
9
|
-
content: string;
|
|
10
|
-
} | null;
|
|
11
|
-
isSubmitting: boolean;
|
|
12
|
-
hasSubmitted: boolean;
|
|
13
|
-
isCompleted: boolean;
|
|
14
|
-
handleAnswerSelect: (answer: {
|
|
15
|
-
id: number;
|
|
16
|
-
content: string;
|
|
17
|
-
}) => void;
|
|
18
|
-
updateAnswer: () => Promise<void>;
|
|
19
|
-
handleContinue: () => void;
|
|
20
|
-
finish: () => void;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { useGameAPI };
|
package/dist/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";var pt=Object.create;var ee=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var yt=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var _e=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),mt=(t,r)=>{for(var s in r)ee(t,s,{get:r[s],enumerable:!0})},Ge=(t,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of yt(r))!Et.call(t,c)&&c!==s&&ee(t,c,{get:()=>r[c],enumerable:!(i=dt(r,c))||i.enumerable});return t};var ht=(t,r,s)=>(s=t!=null?pt(_t(t)):{},Ge(r||!t||!t.__esModule?ee(s,"default",{value:t,enumerable:!0}):s,t)),vt=t=>Ge(ee({},"__esModule",{value:!0}),t);var rt=_e(l=>{"use strict";var he=Symbol.for("react.transitional.element"),gt=Symbol.for("react.portal"),Rt=Symbol.for("react.fragment"),wt=Symbol.for("react.strict_mode"),Tt=Symbol.for("react.profiler"),Ot=Symbol.for("react.consumer"),St=Symbol.for("react.context"),bt=Symbol.for("react.forward_ref"),Ct=Symbol.for("react.suspense"),At=Symbol.for("react.memo"),Ze=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),Be=Symbol.iterator;function Pt(t){return t===null||typeof t!="object"?null:(t=Be&&t[Be]||t["@@iterator"],typeof t=="function"?t:null)}var Ve={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Je=Object.assign,et={};function x(t,r,s){this.props=t,this.context=r,this.refs=et,this.updater=s||Ve}x.prototype.isReactComponent={};x.prototype.setState=function(t,r){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,r,"setState")};x.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function tt(){}tt.prototype=x.prototype;function ve(t,r,s){this.props=t,this.context=r,this.refs=et,this.updater=s||Ve}var ge=ve.prototype=new tt;ge.constructor=ve;Je(ge,x.prototype);ge.isPureReactComponent=!0;var Ke=Array.isArray;function me(){}var g={H:null,A:null,T:null,S:null},nt=Object.prototype.hasOwnProperty;function Re(t,r,s){var i=s.ref;return{$$typeof:he,type:t,key:r,ref:i!==void 0?i:null,props:s}}function Nt(t,r){return Re(t.type,r,t.props)}function we(t){return typeof t=="object"&&t!==null&&t.$$typeof===he}function jt(t){var r={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(s){return r[s]})}var Xe=/\/+/g;function Ee(t,r){return typeof t=="object"&&t!==null&&t.key!=null?jt(""+t.key):r.toString(36)}function Lt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(me,me):(t.status="pending",t.then(function(r){t.status==="pending"&&(t.status="fulfilled",t.value=r)},function(r){t.status==="pending"&&(t.status="rejected",t.reason=r)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Y(t,r,s,i,c){var y=typeof t;(y==="undefined"||y==="boolean")&&(t=null);var h=!1;if(t===null)h=!0;else switch(y){case"bigint":case"string":case"number":h=!0;break;case"object":switch(t.$$typeof){case he:case gt:h=!0;break;case Ze:return h=t._init,Y(h(t._payload),r,s,i,c)}}if(h)return c=c(t),h=i===""?"."+Ee(t,0):i,Ke(c)?(s="",h!=null&&(s=h.replace(Xe,"$&/")+"/"),Y(c,r,s,"",function(b){return b})):c!=null&&(we(c)&&(c=Nt(c,s+(c.key==null||t&&t.key===c.key?"":(""+c.key).replace(Xe,"$&/")+"/")+h)),r.push(c)),1;h=0;var T=i===""?".":i+":";if(Ke(t))for(var R=0;R<t.length;R++)i=t[R],y=T+Ee(i,R),h+=Y(i,r,s,y,c);else if(R=Pt(t),typeof R=="function")for(t=R.call(t),R=0;!(i=t.next()).done;)i=i.value,y=T+Ee(i,R++),h+=Y(i,r,s,y,c);else if(y==="object"){if(typeof t.then=="function")return Y(Lt(t),r,s,i,c);throw r=String(t),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return h}function te(t,r,s){if(t==null)return t;var i=[],c=0;return Y(t,i,"","",function(y){return r.call(s,y,c++)}),i}function Mt(t){if(t._status===-1){var r=t._result;r=r(),r.then(function(s){(t._status===0||t._status===-1)&&(t._status=1,t._result=s)},function(s){(t._status===0||t._status===-1)&&(t._status=2,t._result=s)}),t._status===-1&&(t._status=0,t._result=r)}if(t._status===1)return t._result.default;throw t._result}var Fe=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},$t={map:te,forEach:function(t,r,s){te(t,function(){r.apply(this,arguments)},s)},count:function(t){var r=0;return te(t,function(){r++}),r},toArray:function(t){return te(t,function(r){return r})||[]},only:function(t){if(!we(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};l.Activity=kt;l.Children=$t;l.Component=x;l.Fragment=Rt;l.Profiler=Tt;l.PureComponent=ve;l.StrictMode=wt;l.Suspense=Ct;l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=g;l.__COMPILER_RUNTIME={__proto__:null,c:function(t){return g.H.useMemoCache(t)}};l.cache=function(t){return function(){return t.apply(null,arguments)}};l.cacheSignal=function(){return null};l.cloneElement=function(t,r,s){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Je({},t.props),c=t.key;if(r!=null)for(y in r.key!==void 0&&(c=""+r.key),r)!nt.call(r,y)||y==="key"||y==="__self"||y==="__source"||y==="ref"&&r.ref===void 0||(i[y]=r[y]);var y=arguments.length-2;if(y===1)i.children=s;else if(1<y){for(var h=Array(y),T=0;T<y;T++)h[T]=arguments[T+2];i.children=h}return Re(t.type,c,i)};l.createContext=function(t){return t={$$typeof:St,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Ot,_context:t},t};l.createElement=function(t,r,s){var i,c={},y=null;if(r!=null)for(i in r.key!==void 0&&(y=""+r.key),r)nt.call(r,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(c[i]=r[i]);var h=arguments.length-2;if(h===1)c.children=s;else if(1<h){for(var T=Array(h),R=0;R<h;R++)T[R]=arguments[R+2];c.children=T}if(t&&t.defaultProps)for(i in h=t.defaultProps,h)c[i]===void 0&&(c[i]=h[i]);return Re(t,y,c)};l.createRef=function(){return{current:null}};l.forwardRef=function(t){return{$$typeof:bt,render:t}};l.isValidElement=we;l.lazy=function(t){return{$$typeof:Ze,_payload:{_status:-1,_result:t},_init:Mt}};l.memo=function(t,r){return{$$typeof:At,type:t,compare:r===void 0?null:r}};l.startTransition=function(t){var r=g.T,s={};g.T=s;try{var i=t(),c=g.S;c!==null&&c(s,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(me,Fe)}catch(y){Fe(y)}finally{r!==null&&s.types!==null&&(r.types=s.types),g.T=r}};l.unstable_useCacheRefresh=function(){return g.H.useCacheRefresh()};l.use=function(t){return g.H.use(t)};l.useActionState=function(t,r,s){return g.H.useActionState(t,r,s)};l.useCallback=function(t,r){return g.H.useCallback(t,r)};l.useContext=function(t){return g.H.useContext(t)};l.useDebugValue=function(){};l.useDeferredValue=function(t,r){return g.H.useDeferredValue(t,r)};l.useEffect=function(t,r){return g.H.useEffect(t,r)};l.useEffectEvent=function(t){return g.H.useEffectEvent(t)};l.useId=function(){return g.H.useId()};l.useImperativeHandle=function(t,r,s){return g.H.useImperativeHandle(t,r,s)};l.useInsertionEffect=function(t,r){return g.H.useInsertionEffect(t,r)};l.useLayoutEffect=function(t,r){return g.H.useLayoutEffect(t,r)};l.useMemo=function(t,r){return g.H.useMemo(t,r)};l.useOptimistic=function(t,r){return g.H.useOptimistic(t,r)};l.useReducer=function(t,r,s){return g.H.useReducer(t,r,s)};l.useRef=function(t){return g.H.useRef(t)};l.useState=function(t){return g.H.useState(t)};l.useSyncExternalStore=function(t,r,s){return g.H.useSyncExternalStore(t,r,s)};l.useTransition=function(){return g.H.useTransition()};l.version="19.2.3"});var ot=_e((f,ne)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function t(e,n){Object.defineProperty(i.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})}function r(e){return e===null||typeof e!="object"?null:(e=je&&e[je]||e["@@iterator"],typeof e=="function"?e:null)}function s(e,n){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var o=e+"."+n;Le[o]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,e),Le[o]=!0)}function i(e,n,o){this.props=e,this.context=n,this.refs=de,this.updater=o||Me}function c(){}function y(e,n,o){this.props=e,this.context=n,this.refs=de,this.updater=o||Me}function h(){}function T(e){return""+e}function R(e){try{T(e);var n=!1}catch(a){n=!0}if(n){n=console;var o=n.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),T(e)}}function b(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===it?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fe:return"Fragment";case Ce:return"Profiler";case be:return"StrictMode";case Pe:return"Suspense";case st:return"SuspenseList";case Ne:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Se:return"Portal";case Ae:return e.displayName||"Context";case le:return(e._context.displayName||"Context")+".Consumer";case ke:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pe:return n=e.displayName||null,n!==null?n:b(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return b(e(n))}catch(o){}}return null}function B(e){if(e===fe)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Q)return"<...>";try{var n=b(e);return n?"<"+n+">":"<...>"}catch(o){return"<...>"}}function K(){var e=d.A;return e===null?null:e.getOwner()}function W(){return Error("react-stack-top-frame")}function X(e){if(F.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function re(e,n){function o(){He||(He=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function P(){var e=b(this.type);return Ye[e]||(Ye[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function N(e,n,o,u,a,_){var p=o.ref;return e={$$typeof:ce,type:e,key:n,props:o,_owner:u},(p!==void 0?p:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:P}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:_}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,n){return n=N(e.type,n,e.props,e._owner,e._debugStack,e._debugTask),e._store&&(n._store.validated=e._store.validated),n}function z(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===Q&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===ce}function oe(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return n[o]})}function I(e,n){return typeof e=="object"&&e!==null&&e.key!=null?(R(e.key),oe(""+e.key)):n.toString(36)}function ue(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(h,h):(e.status="pending",e.then(function(n){e.status==="pending"&&(e.status="fulfilled",e.value=n)},function(n){e.status==="pending"&&(e.status="rejected",e.reason=n)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function A(e,n,o,u,a){var _=typeof e;(_==="undefined"||_==="boolean")&&(e=null);var p=!1;if(e===null)p=!0;else switch(_){case"bigint":case"string":case"number":p=!0;break;case"object":switch(e.$$typeof){case ce:case Se:p=!0;break;case Q:return p=e._init,A(p(e._payload),n,o,u,a)}}if(p){p=e,a=a(p);var v=u===""?"."+I(p,0):u;return Ie(a)?(o="",v!=null&&(o=v.replace(We,"$&/")+"/"),A(a,n,o,"",function(k){return k})):a!=null&&(C(a)&&(a.key!=null&&(p&&p.key===a.key||R(a.key)),o=j(a,o+(a.key==null||p&&p.key===a.key?"":(""+a.key).replace(We,"$&/")+"/")+v),u!==""&&p!=null&&C(p)&&p.key==null&&p._store&&!p._store.validated&&(o._store.validated=2),a=o),n.push(a)),1}if(p=0,v=u===""?".":u+":",Ie(e))for(var E=0;E<e.length;E++)u=e[E],_=v+I(u,E),p+=A(u,n,o,_,a);else if(E=r(e),typeof E=="function")for(E===e.entries&&(xe||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),xe=!0),e=E.call(e),E=0;!(u=e.next()).done;)u=u.value,_=v+I(u,E++),p+=A(u,n,o,_,a);else if(_==="object"){if(typeof e.then=="function")return A(ue(e),n,o,u,a);throw n=String(e),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return p}function D(e,n,o){if(e==null)return e;var u=[],a=0;return A(e,u,"","",function(_){return n.call(o,_,a++)}),u}function se(e){if(e._status===-1){var n=e._ioInfo;n!=null&&(n.start=n.end=performance.now()),n=e._result;var o=n();if(o.then(function(a){if(e._status===0||e._status===-1){e._status=1,e._result=a;var _=e._ioInfo;_!=null&&(_.end=performance.now()),o.status===void 0&&(o.status="fulfilled",o.value=a)}},function(a){if(e._status===0||e._status===-1){e._status=2,e._result=a;var _=e._ioInfo;_!=null&&(_.end=performance.now()),o.status===void 0&&(o.status="rejected",o.reason=a)}}),n=e._ioInfo,n!=null){n.value=o;var u=o.displayName;typeof u=="string"&&(n.name=u)}e._status===-1&&(e._status=0,e._result=o)}if(e._status===1)return n=e._result,n===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
-
|
|
3
|
-
Your code should look like:
|
|
4
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
-
|
|
6
|
-
Did you accidentally put curly braces around the import?`,n),"default"in n||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
-
|
|
8
|
-
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,n),n.default;throw e._result}function m(){var e=d.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
-
2. You might be breaking the Rules of Hooks
|
|
12
|
-
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function q(){d.asyncTransitions--}function H(e){if(Z===null)try{var n=("require"+Math.random()).slice(0,7);Z=(ne&&ne[n]).call(ne,"timers").setImmediate}catch(o){Z=function(u){qe===!1&&(qe=!0,typeof MessageChannel=="undefined"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var a=new MessageChannel;a.port1.onmessage=u,a.port2.postMessage(void 0)}}return Z(e)}function S(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function L(e,n){n!==V-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),V=n}function ie(e,n,o){var u=d.actQueue;if(u!==null)if(u.length!==0)try{ae(u),H(function(){return ie(e,n,o)});return}catch(a){d.thrownErrors.push(a)}else d.actQueue=null;0<d.thrownErrors.length?(u=S(d.thrownErrors),d.thrownErrors.length=0,o(u)):n(e)}function ae(e){if(!ye){ye=!0;var n=0;try{for(;n<e.length;n++){var o=e[n];do{d.didUsePromise=!1;var u=o(!1);if(u!==null){if(d.didUsePromise){e[n]=o,e.splice(0,n);return}o=u}else break}while(!0)}e.length=0}catch(a){e.splice(0,n+1),d.thrownErrors.push(a)}finally{ye=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ce=Symbol.for("react.transitional.element"),Se=Symbol.for("react.portal"),fe=Symbol.for("react.fragment"),be=Symbol.for("react.strict_mode"),Ce=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),Ae=Symbol.for("react.context"),ke=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),st=Symbol.for("react.suspense_list"),pe=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),Ne=Symbol.for("react.activity"),je=Symbol.iterator,Le={},Me={isMounted:function(){return!1},enqueueForceUpdate:function(e){s(e,"forceUpdate")},enqueueReplaceState:function(e){s(e,"replaceState")},enqueueSetState:function(e){s(e,"setState")}},$e=Object.assign,de={};Object.freeze(de),i.prototype.isReactComponent={},i.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var O={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(G in O)O.hasOwnProperty(G)&&t(G,O[G]);c.prototype=i.prototype,O=y.prototype=new c,O.constructor=y,$e(O,i.prototype),O.isPureReactComponent=!0;var Ie=Array.isArray,it=Symbol.for("react.client.reference"),d={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},F=Object.prototype.hasOwnProperty,De=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(e){return e()}};var He,Ue,Ye={},at=O.react_stack_bottom_frame.bind(O,W)(),ct=De(B(W)),xe=!1,We=/\/+/g,ze=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qe=!1,Z=null,V=0,J=!1,ye=!1,Qe=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:H;O=Object.freeze({__proto__:null,c:function(e){return m().useMemoCache(e)}});var G={map:D,forEach:function(e,n,o){D(e,function(){n.apply(this,arguments)},o)},count:function(e){var n=0;return D(e,function(){n++}),n},toArray:function(e){return D(e,function(n){return n})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};f.Activity=Ne,f.Children=G,f.Component=i,f.Fragment=fe,f.Profiler=Ce,f.PureComponent=y,f.StrictMode=be,f.Suspense=Pe,f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,f.__COMPILER_RUNTIME=O,f.act=function(e){var n=d.actQueue,o=V;V++;var u=d.actQueue=n!==null?n:[],a=!1;try{var _=e()}catch(E){d.thrownErrors.push(E)}if(0<d.thrownErrors.length)throw L(n,o),e=S(d.thrownErrors),d.thrownErrors.length=0,e;if(_!==null&&typeof _=="object"&&typeof _.then=="function"){var p=_;return Qe(function(){a||J||(J=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(E,k){a=!0,p.then(function(U){if(L(n,o),o===0){try{ae(u),H(function(){return ie(U,E,k)})}catch(lt){d.thrownErrors.push(lt)}if(0<d.thrownErrors.length){var ft=S(d.thrownErrors);d.thrownErrors.length=0,k(ft)}}else E(U)},function(U){L(n,o),0<d.thrownErrors.length&&(U=S(d.thrownErrors),d.thrownErrors.length=0),k(U)})}}}var v=_;if(L(n,o),o===0&&(ae(u),u.length!==0&&Qe(function(){a||J||(J=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),d.actQueue=null),0<d.thrownErrors.length)throw e=S(d.thrownErrors),d.thrownErrors.length=0,e;return{then:function(E,k){a=!0,o===0?(d.actQueue=u,H(function(){return ie(v,E,k)})):E(v)}}},f.cache=function(e){return function(){return e.apply(null,arguments)}},f.cacheSignal=function(){return null},f.captureOwnerStack=function(){var e=d.getCurrentStack;return e===null?null:e()},f.cloneElement=function(e,n,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=$e({},e.props),a=e.key,_=e._owner;if(n!=null){var p;e:{if(F.call(n,"ref")&&(p=Object.getOwnPropertyDescriptor(n,"ref").get)&&p.isReactWarning){p=!1;break e}p=n.ref!==void 0}p&&(_=K()),X(n)&&(R(n.key),a=""+n.key);for(v in n)!F.call(n,v)||v==="key"||v==="__self"||v==="__source"||v==="ref"&&n.ref===void 0||(u[v]=n[v])}var v=arguments.length-2;if(v===1)u.children=o;else if(1<v){p=Array(v);for(var E=0;E<v;E++)p[E]=arguments[E+2];u.children=p}for(u=N(e.type,a,u,_,e._debugStack,e._debugTask),a=2;a<arguments.length;a++)z(arguments[a]);return u},f.createContext=function(e){return e={$$typeof:Ae,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:le,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},f.createElement=function(e,n,o){for(var u=2;u<arguments.length;u++)z(arguments[u]);u={};var a=null;if(n!=null)for(E in Ue||!("__self"in n)||"key"in n||(Ue=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),X(n)&&(R(n.key),a=""+n.key),n)F.call(n,E)&&E!=="key"&&E!=="__self"&&E!=="__source"&&(u[E]=n[E]);var _=arguments.length-2;if(_===1)u.children=o;else if(1<_){for(var p=Array(_),v=0;v<_;v++)p[v]=arguments[v+2];Object.freeze&&Object.freeze(p),u.children=p}if(e&&e.defaultProps)for(E in _=e.defaultProps,_)u[E]===void 0&&(u[E]=_[E]);a&&re(u,typeof e=="function"?e.displayName||e.name||"Unknown":e);var E=1e4>d.recentlyCreatedOwnerStacks++;return N(e,a,u,K(),E?Error("react-stack-top-frame"):at,E?De(B(e)):ct)},f.createRef=function(){var e={current:null};return Object.seal(e),e},f.forwardRef=function(e){e!=null&&e.$$typeof===pe?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var n={$$typeof:ke,render:e},o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.isValidElement=C,f.lazy=function(e){e={_status:-1,_result:e};var n={$$typeof:Q,_payload:e,_init:se},o={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=o,n._debugInfo=[{awaited:o}],n},f.memo=function(e,n){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),n={$$typeof:pe,type:e,compare:n===void 0?null:n};var o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},f.startTransition=function(e){var n=d.T,o={};o._updatedFibers=new Set,d.T=o;try{var u=e(),a=d.S;a!==null&&a(o,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&(d.asyncTransitions++,u.then(q,q),u.then(h,ze))}catch(_){ze(_)}finally{n===null&&o._updatedFibers&&(e=o._updatedFibers.size,o._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),n!==null&&o.types!==null&&(n.types!==null&&n.types!==o.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),n.types=o.types),d.T=n}},f.unstable_useCacheRefresh=function(){return m().useCacheRefresh()},f.use=function(e){return m().use(e)},f.useActionState=function(e,n,o){return m().useActionState(e,n,o)},f.useCallback=function(e,n){return m().useCallback(e,n)},f.useContext=function(e){var n=m();return e.$$typeof===le&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),n.useContext(e)},f.useDebugValue=function(e,n){return m().useDebugValue(e,n)},f.useDeferredValue=function(e,n){return m().useDeferredValue(e,n)},f.useEffect=function(e,n){return e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useEffect(e,n)},f.useEffectEvent=function(e){return m().useEffectEvent(e)},f.useId=function(){return m().useId()},f.useImperativeHandle=function(e,n,o){return m().useImperativeHandle(e,n,o)},f.useInsertionEffect=function(e,n){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useInsertionEffect(e,n)},f.useLayoutEffect=function(e,n){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),m().useLayoutEffect(e,n)},f.useMemo=function(e,n){return m().useMemo(e,n)},f.useOptimistic=function(e,n){return m().useOptimistic(e,n)},f.useReducer=function(e,n,o){return m().useReducer(e,n,o)},f.useRef=function(e){return m().useRef(e)},f.useState=function(e){return m().useState(e)},f.useSyncExternalStore=function(e,n,o){return m().useSyncExternalStore(e,n,o)},f.useTransition=function(){return m().useTransition()},f.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var ut=_e((Yt,Te)=>{"use strict";process.env.NODE_ENV==="production"?Te.exports=rt():Te.exports=ot()});var Dt={};mt(Dt,{useGameAPI:()=>It});module.exports=vt(Dt);var w=ht(ut());var M={SHOW_LO5:"SHOW_LO5",RETURN_LO5:"RETURN_LO5",UPDATE_ANSWER:"UPDATE_ANSWER",RETURN_UPDATE_ANSWER:"RETURN_UPDATE_ANSWER",FINISH:"FINISH"},Oe=class{constructor(){this.handlers={};window.addEventListener("message",this.handleMessage.bind(this))}handleMessage(r){let{type:s,payload:i}=r.data;this.handlers[s]&&this.handlers[s](i)}on(r,s){this.handlers[r]=s}send(r,s={}){window.parent&&window.parent.postMessage({type:r,payload:s},"*")}},$=new Oe;console.log("useGameAPI-V1.0.8");function It({onAnswerCorrect:t,onAnswerIncorrect:r}){let[s,i]=(0,w.useState)(0),c=(0,w.useRef)(0),[y,h]=(0,w.useState)(null),[T,R]=(0,w.useState)([]),[b,B]=(0,w.useState)(null),[K,W]=(0,w.useState)(null),[X,re]=(0,w.useState)(0),[P,N]=(0,w.useState)(!1),[j,z]=(0,w.useState)(!1),[C,oe]=(0,w.useState)(!1),I=(0,w.useRef)(!1),ue=(0,w.useCallback)(()=>{$.send(M.FINISH)},[]),A=(0,w.useCallback)(async()=>{if(!(!y||P))return $.send(M.UPDATE_ANSWER,y.id),N(!0),z(!0),Promise.resolve()},[y,P]),D=(0,w.useCallback)(()=>{if(j)if(I.current)oe(!0);else{$.send(M.SHOW_LO5);let m=c.current+1;c.current=m,i(m),h(null),N(!1),z(!1),W(null)}},[j]),se=(0,w.useCallback)(m=>{!P&&!j&&h(m)},[P,j]);return(0,w.useEffect)(()=>{$.send(M.SHOW_LO5),$.on(M.RETURN_LO5,m=>{B(m)}),$.on(M.RETURN_UPDATE_ANSWER,m=>{let q=(m==null?void 0:m.isCorrect)===!0,H=(m==null?void 0:m.isLastQuestion)===!0;I.current=H,R(S=>{let L=[...S];return L[c.current]=q,L}),q?(re(S=>S+1),console.log({currentQuestionIndex:c.current}),t==null||t({currentQuestionIndex:c.current})):r==null||r(),N(!1),W(m)})},[]),{quiz:b,currentResult:K,answers:T,correctCount:X,currentQuestionIndex:s,selectedAnswer:y,isSubmitting:P,hasSubmitted:j,isCompleted:C,handleAnswerSelect:se,updateAnswer:A,handleContinue:D,finish:ue}}0&&(module.exports={useGameAPI});
|
|
14
|
-
/*! Bundled license information:
|
|
15
|
-
|
|
16
|
-
react/cjs/react.production.js:
|
|
17
|
-
(**
|
|
18
|
-
* @license React
|
|
19
|
-
* react.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*)
|
|
26
|
-
|
|
27
|
-
react/cjs/react.development.js:
|
|
28
|
-
(**
|
|
29
|
-
* @license React
|
|
30
|
-
* react.development.js
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*)
|
|
37
|
-
*/
|