text: !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Sukkula=n():t.Sukkula=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,e),u.l=!0,u.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var u in t)e.d(r,u,function(n){return t[n]}.bind(null,u));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports={PRE_EXECUTE:"@sukkula/pre-execute",POST_EXECUTE:"@sukkula/post-execute"}},function(t,n,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,u=!1,o=void 0;try{for(var i,f=t[Symbol.iterator]();!(r=(i=f.next()).done)&&(e.push(i.value),!n||e.length!==n);r=!0);}catch(t){u=!0,o=t}finally{try{r||null==f.return||f.return()}finally{if(u)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=e(2),i=o.usable,f=o.getEnv,c=e(0).POST_EXECUTE,s=function(){var t=f();if(!t)throw new Error("You can't use useResume outside the usable function");return t.resume},a=function(t){var n=f();if(!n)throw new Error("You can't use useState outside the usable function");var e=n.stateList,r=e.exist(),u=s(),o=e.get(t);if(!r){var i=o[1];o[1]=function(t){i(t),u()}}return o},l=function(){var t=f();if(!t)throw new Error("You can't use useUnsubscribe outside the usable function");return t.unsubscribe};t.exports={run:function(t,n){return t.run(n)},subscribe:function(t,n,e,u){return"object"===r(t)&&(e=t.finish,n=t.next,u=t.effect,t=t.source),t.subscribe(n,e,u)},unsubscribe:function(t){if(t)t.unsubscribe();else{var n=l();n()}},dispatch:function(t,n,e){return t.dispatch(n,e)},usable:i,useState:a,useEffect:function(t,n,e){var r=f();if(!r)throw new Error("You can't use useEffect outside the usable function");"function"==typeof t&&(e=n,n=t,t=c),r.effectList.get(t,n,e)},useRef:function(t){var n=f();if(!n)throw new Error("You can't use useRef outside the usable function");return n.refList.get(t)},useResume:s,useDispatch:function(){var t=f();if(!t)throw new Error("You can't use useDispatch outside the usable function");return t.dispatch},useGetSet:function(t){var n=f();if(!n)throw new Error("You can't use useGetSet outside the usable function");var e=n.stateList.exist(),r=a(t);if(!e){var o=u(r,2),i=o[0],c=o[1],s=function(){return i};r[0]=s,r[1]=function(t){i=t,c(s)}}return r},useProps:function(){var t=f();if(!t)throw new Error("You can't use useProps outside the usable function");return t.props},useUnsubscribe:l}},function(t,n,e){function r(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){u(t,n,e[n])})}return t}function u(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=e(3),i=o.shallowEqualList,f=o.isThenable,c=o.makeList,s=(o.makeDict,e(0)),a=s.PRE_EXECUTE,l=s.POST_EXECUTE,b=null,y=function(){var t=c();return r({},t,{get:function(n,e,r){t.exist()||t.set(function(t,n,e){var r=!1,u=null,o=function(){if(u){var t=u;u=null,t()}},f={action:t,handler:n,argList:e,clean:o,perform:function(t,n){if(f.action===t&&!r){o(),r=!0;var e=f.handler.call(null,n,t);"function"==typeof e&&(u=e)}},update:function(t,n,e){var u=f.action===t,o=i(f.argList,e);u&&o||(f.handler=n,r=!1),f.action=t,f.argList=e}};return f}(n,e,r));var u=t.get();return u.update(n,e,r),u}})},p=function(t){var n=null,e=function(){return u.run(n)},u=function(t){var n=!1,e=!1;return{run:function r(u){if(!n){var o;try{b={props:u},n=!0,o=t(u)}finally{n=!1}return e?(e=!1,r(u)):o}e=!0}}}(function(u){try{return b=r({},b,{resume:e}),n=b.props,t(u)}finally{b=null}});return u},h=function(t){var n=function(){var t=c();return r({},t,{get:function(n){return t.exist()||t.set({current:n}),t.get()}})}();return p(function(e){b=r({},b,{refList:n});try{return n.reset(),t(e)}finally{n.reset()}})},v=function(t){var n=function(){var t=c();return r({},t,{get:function(n){if(!t.exist()){var e=[n,function(t){return e[0]=t}];t.set(e)}return t.get()}})}();return h(function(e){b=r({},b,{stateList:n});try{return n.reset(),t(e)}finally{n.reset()}})},d=function(t){var n=null,e=function(t,e){if(!n)throw new Error("effect list is empty");n.each(function(n){return n.perform(t,e)})},u=function(t){var n=y();return v(function(e){b=r({},b,{effectList:n});try{return n.reset(),t(e)}finally{n.reset()}})}(function(u){return b=r({},b,{dispatch:e}),n=b.effectList,t(u)});return r({},u,{clean:function(){n.each(function(t){return t.clean()})},dispatch:e})},m=function(){},g=function(t){var n=function(t){var n,e=null,u=null,o=null,i=function(){var t=u;e=null,u=null,o=null,f.clean(),t&&t(n)},f=d(function(u){b=r({},b,{unsubscribe:i});try{n=t(u)}catch(t){if(!o)throw t;return o(t,b.resume),n}return e&&e(n),n});return r({},f,{subscribe:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m,r=arguments.length>2?arguments[2]:void 0;if(e)throw new Error("can not subscribe twice");if("function"!=typeof t){var i="first argument of subscribe must be a function instead of ".concat(t);throw new Error(i)}if("function"!=typeof n){var f="second argument of subscribe must be a function instead of ".concat(n);throw new Error(f)}if(null!=r&&"function"!=typeof r){var c="third argument of subscribe must be a function instead of ".concat(r);throw new Error(c)}e=t,u=n,o=r},unsubscribe:i})}(t);return r({},n,{subscribe:function(t,e,r){return n.subscribe(t,e,function(t,n){if(f(t))t.then(function(){return n()});else{if("function"!=typeof r)throw t;r(t,n)}})}})};t.exports={getEnv:function(){return b},usable:function(t){var n=function(t){var n=g(t);return r({},n,{subscribe:function(t,e,r){return n.subscribe(t,e,function(t,n){if(t!==a){if("function"!=typeof r)throw t;r(t,n)}})}})}(function(n){var e=t(n);return b.dispatch(l),e});return r({},n,{producer:t})}}},function(t,n){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=function(t,n){if(t===n)return!0;if("object"!==e(t)||null===t||"object"!==e(n)||null===n)return!1;var r=Object.keys(t),u=Object.keys(n);if(r.length!==u.length)return!1;for(var o=0;o<r.length;o++)if(!n.hasOwnProperty(r[o])||t[r[o]]!==n[r[o]])return!1;return!0};t.exports={isThenable:function(t){return!(!t||"function"!=typeof t.then)},shallowEqual:r,shallowEqualList:function(t,n){if(!Array.isArray(t)||!Array.isArray(n))return!1;if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!r(t[e],n[e]))return!1;return!0},makeList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=0;return{exist:function(){return t.length>n},get:function(){var e=t[n];return n+=1,e},set:function(e){return t[n]=e},reset:function(){return n=0},each:function(n){return t.forEach(n)},getAll:function(){return t}}},makeDict:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{exist:function(n){return t.hasOwnProperty(n)},get:function(n){return t[n]},set:function(n,e){return t[e]=n},getAll:function(){return t}}}}}])});