Comparing version 0.0.5 to 0.0.6
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).quikpik=t()}(this,(function(){"use strict";var e=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t=Array.isArray;function n(e){var t=typeof e;return"string"===t||"number"===t}function r(e){return null==e}function o(e){return null===e||!1===e||!0===e||void 0===e}function i(e){return"function"==typeof e}function a(e){return"string"==typeof e}function u(e){return null===e}function c(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var o in t)n[o]=t[o];return n}function l(e){return!u(e)&&"object"==typeof e}var s={};function f(e){return e.substr(2).toLowerCase()}function p(e,t){e.appendChild(t)}function d(e,t,n){u(n)?p(e,t):e.insertBefore(t,n)}function v(e,t){e.removeChild(t)}function h(e){for(var t=0;t<e.length;t++)e[t]()}function k(e,t,n){var r=e.children;return 4&n?r.$LI:8192&n?2===e.childFlags?r:r[t?0:r.length-1]:r}function m(e,t){for(var n;e;){if(2033&(n=e.flags))return e.dom;e=k(e,t,n)}return null}function g(e,t){do{var n=e.flags;if(2033&n)return void v(t,e.dom);var r=e.children;if(4&n&&(e=r.$LI),8&n&&(e=r),8192&n){if(2!==e.childFlags){for(var o=0,i=r.length;o<i;++o)g(r[o],t);return}e=r}}while(e)}function b(e,t,n){do{var r=e.flags;if(2033&r)return void d(t,e.dom,n);var o=e.children;if(4&r&&(e=o.$LI),8&r&&(e=o),8192&r){if(2!==e.childFlags){for(var i=0,a=o.length;i<a;++i)b(o[i],t,n);return}e=o}}while(e)}function y(e,t,n){return e.constructor.getDerivedStateFromProps?c(n,e.constructor.getDerivedStateFromProps(t,n)):n}var w={v:!1},x={componentComparator:null,createVNode:null,renderComplete:null};function q(e,t){e.textContent=t}function C(e,t){return l(e)&&e.event===t.event&&e.data===t.data}function $(e,t){for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e}function O(e,t){return!!i(e)&&(e(t),!0)}function P(e,t,n,r,o,i,a,u){this.childFlags=e,this.children=t,this.className=n,this.dom=null,this.flags=r,this.key=void 0===o?null:o,this.props=void 0===i?null:i,this.ref=void 0===a?null:a,this.type=u}function S(e,t,n,r,o,i,a,u){var c=void 0===o?1:o,l=new P(c,r,n,e,a,i,u,t);return x.createVNode&&x.createVNode(l),0===c&&F(l,l.children),l}function j(e,t,n,o,i){var a=new P(1,null,null,e=function(e,t){return 12&e?e:t.prototype&&t.prototype.render?4:t.render?32776:8}(e,t),o,function(e,t,n){var o=(32768&e?t.render:t).defaultProps;return r(o)?n:r(n)?c(o,null):$(n,o)}(e,t,n),function(e,t,n){if(4&e)return n;var o=(32768&e?t.render:t).defaultHooks;return r(o)?n:r(n)?o:$(n,o)}(e,t,i),t);return x.createVNode&&x.createVNode(a),a}function U(e,t){return new P(1,r(e)||!0===e||!1===e?"":e,null,16,t,null,null,null)}function D(e,t,n){var r=S(8192,8192,null,e,t,null,n,null);switch(r.childFlags){case 1:r.children=M(),r.childFlags=2;break;case 16:r.children=[U(e)],r.childFlags=4}return r}function E(e){var t=-16385&e.flags,n=e.props;if(14&t&&!u(n)){var r=n;for(var o in n={},r)n[o]=r[o]}return 0==(8192&t)?new P(e.childFlags,e.children,e.className,t,e.key,n,e.ref,e.type):function(e){var t,n=e.children,r=e.childFlags;if(2===r)t=E(n);else if(12&r){t=[];for(var o=0,i=n.length;o<i;++o)t.push(E(n[o]))}return D(t,r,e.key)}(e)}function M(){return U("",null)}function N(e,r,i,c){for(var l=e.length;i<l;i++){var s=e[i];if(!o(s)){var f=c+"$"+i;if(t(s))N(s,r,0,f);else{if(n(s))s=U(s,f);else{var p=s.key,d=a(p)&&"$"===p[0];(81920&s.flags||d)&&(s=E(s)),s.flags|=65536,d?p.substring(0,c.length)!==c&&(s.key=c+p):u(p)?s.key=f:s.key=c+p}r.push(s)}}}}function F(e,r){var i,c=1;if(o(r))i=r;else if(n(r))c=16,i=r;else if(t(r)){for(var l=r.length,s=0;s<l;++s){var f=r[s];if(o(f)||t(f)){i=i||r.slice(0,s),N(r,i,s,"");break}if(n(f))(i=i||r.slice(0,s)).push(U(f,"$"+s));else{var p=f.key,d=(81920&f.flags)>0,v=u(p),h=a(p)&&"$"===p[0];d||v||h?(i=i||r.slice(0,s),(d||h)&&(f=E(f)),(v||h)&&(f.key="$"+s),i.push(f)):i&&i.push(f),f.flags|=65536}}c=0===(i=i||r).length?1:8}else(i=r).flags|=65536,81920&r.flags&&(i=E(r)),c=2;return e.children=i,e.childFlags=c,e}function L(e){return o(e)||n(e)?U(e,null):t(e)?D(e,0,null):16384&e.flags?E(e):e}var I="http://www.w3.org/1999/xlink",z="http://www.w3.org/XML/1998/namespace",V={"xlink:actuate":I,"xlink:arcrole":I,"xlink:href":I,"xlink:role":I,"xlink:show":I,"xlink:title":I,"xlink:type":I,"xml:base":z,"xml:lang":z,"xml:space":z};function T(e){return{onClick:e,onDblClick:e,onFocusIn:e,onFocusOut:e,onKeyDown:e,onKeyPress:e,onKeyUp:e,onMouseDown:e,onMouseMove:e,onMouseUp:e,onTouchEnd:e,onTouchMove:e,onTouchStart:e}}var A=T(0),B=T(null),R=T(!0);function W(e,t){var n=t.$EV;return n||(n=t.$EV=T(null)),n[e]||1==++A[e]&&(B[e]=function(e){var t="onClick"===e||"onDblClick"===e?function(e){return function(t){0===t.button?_(t,!0,e,G(t)):t.stopPropagation()}}(e):function(e){return function(t){_(t,!1,e,G(t))}}(e);return document.addEventListener(f(e),t),t}(e)),n}function H(e,t){var n=t.$EV;n&&n[e]&&(0==--A[e]&&(document.removeEventListener(f(e),B[e]),B[e]=null),n[e]=null)}function _(e,t,n,r){var o=function(e){return i(e.composedPath)?e.composedPath()[0]:e.target}(e);do{if(t&&o.disabled)return;var a=o.$EV;if(a){var c=a[n];if(c&&(r.dom=o,c.event?c.event(c.data,e):c(e),e.cancelBubble))return}o=o.parentNode}while(!u(o))}function X(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function Q(){return this.defaultPrevented}function Y(){return this.cancelBubble}function G(e){var t={dom:document};return e.isDefaultPrevented=Q,e.isPropagationStopped=Y,e.stopPropagation=X,Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return t.dom}}),t}function K(e,t,n){if(e[t]){var r=e[t];r.event?r.event(r.data,n):r(n)}else{var o=t.toLowerCase();e[o]&&e[o](n)}}function J(e,t){var n=function(n){var r=this.$V;if(r){var o=r.props||s,u=r.dom;if(a(e))K(o,e,n);else for(var c=0;c<e.length;++c)K(o,e[c],n);if(i(t)){var l=this.$V,f=l.props||s;t(f,u,!1,l)}}};return Object.defineProperty(n,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),n}function Z(e,t,n){var r="$"+t,o=e[r];if(o){if(o[1].wrapped)return;e.removeEventListener(o[0],o[1]),e[r]=null}i(n)&&(e.addEventListener(t,n),e[r]=[t,n])}function ee(e){return"checkbox"===e||"radio"===e}var te=J("onInput",oe),ne=J(["onClick","onChange"],oe);function re(e){e.stopPropagation()}function oe(e,t){var n=e.type,o=e.value,i=e.checked,a=e.multiple,u=e.defaultValue,c=!r(o);n&&n!==t.type&&t.setAttribute("type",n),r(a)||a===t.multiple||(t.multiple=a),r(u)||c||(t.defaultValue=u+""),ee(n)?(c&&(t.value=o),r(i)||(t.checked=i)):c&&t.value!==o?(t.defaultValue=o,t.value=o):r(i)||(t.checked=i)}function ie(e,n){if("option"===e.type)!function(e,n){var o=e.props||s,i=e.dom;i.value=o.value,o.value===n||t(n)&&-1!==n.indexOf(o.value)?i.selected=!0:r(n)&&r(o.selected)||(i.selected=o.selected||!1)}(e,n);else{var o=e.children,i=e.flags;if(4&i)ie(o.$LI,n);else if(8&i)ie(o,n);else if(2===e.childFlags)ie(o,n);else if(12&e.childFlags)for(var a=0,u=o.length;a<u;++a)ie(o[a],n)}}re.wrapped=!0;var ae=J("onChange",ue);function ue(e,t,n,o){var i=Boolean(e.multiple);r(e.multiple)||i===t.multiple||(t.multiple=i);var a=e.selectedIndex;if(-1===a&&(t.selectedIndex=-1),1!==o.childFlags){var u=e.value;"number"==typeof a&&a>-1&&t.options[a]&&(u=t.options[a].value),n&&r(u)&&(u=e.defaultValue),ie(o,u)}}var ce,le,se=J("onInput",pe),fe=J("onChange");function pe(e,t,n){var o=e.value,i=t.value;if(r(o)){if(n){var a=e.defaultValue;r(a)||a===i||(t.defaultValue=a,t.value=a)}}else i!==o&&(t.defaultValue=o,t.value=o)}function de(e,t,n,r,o,i){64&e?oe(r,n):256&e?ue(r,n,o,t):128&e&&pe(r,n,o),i&&(n.$V=t)}function ve(e,t,n){64&e?function(e,t){ee(t.type)?(Z(e,"change",ne),Z(e,"click",re)):Z(e,"input",te)}(t,n):256&e?function(e){Z(e,"change",ae)}(t):128&e&&function(e,t){Z(e,"input",se),t.onChange&&Z(e,"change",fe)}(t,n)}function he(e){return e.type&&ee(e.type)?!r(e.checked):!r(e.value)}function ke(e){e&&!O(e,null)&&e.current&&(e.current=null)}function me(e,t,n){e&&(i(e)||void 0!==e.current)&&n.push((function(){O(e,t)||void 0===e.current||(e.current=t)}))}function ge(e,t){be(e),g(e,t)}function be(e){var t,n=e.flags,o=e.children;if(481&n){t=e.ref;var a=e.props;ke(t);var c=e.childFlags;if(!u(a))for(var l=Object.keys(a),f=0,p=l.length;f<p;f++){var d=l[f];R[d]&&H(d,e.dom)}12&c?ye(o):2===c&&be(o)}else o&&(4&n?(i(o.componentWillUnmount)&&o.componentWillUnmount(),ke(e.ref),o.$UN=!0,be(o.$LI)):8&n?(!r(t=e.ref)&&i(t.onComponentWillUnmount)&&t.onComponentWillUnmount(m(e,!0),e.props||s),be(o)):1024&n?ge(o,e.ref):8192&n&&12&e.childFlags&&ye(o))}function ye(e){for(var t=0,n=e.length;t<n;++t)be(e[t])}function we(e){e.textContent=""}function xe(e,t,n){ye(n),8192&t.flags?g(t,e):we(e)}function qe(e,t,n,o){var i=e&&e.__html||"",a=t&&t.__html||"";i!==a&&(r(a)||function(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}(o,a)||(u(n)||(12&n.childFlags?ye(n.children):2===n.childFlags&&be(n.children),n.children=null,n.childFlags=1),o.innerHTML=a))}function Ce(e,t,n,o,u,c,s){switch(e){case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":case"selectedIndex":break;case"autoFocus":o.autofocus=!!n;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":o[e]=!!n;break;case"defaultChecked":case"value":case"volume":if(c&&"value"===e)break;var p=r(n)?"":n;o[e]!==p&&(o[e]=p);break;case"style":!function(e,t,n){if(r(t))n.removeAttribute("style");else{var o,i,u=n.style;if(a(t))u.cssText=t;else if(r(e)||a(e))for(o in t)i=t[o],u.setProperty(o,i);else{for(o in t)(i=t[o])!==e[o]&&u.setProperty(o,i);for(o in e)r(t[o])&&u.removeProperty(o)}}}(t,n,o);break;case"dangerouslySetInnerHTML":qe(t,n,s,o);break;default:R[e]?function(e,t,n,r){if(i(n))W(e,r)[e]=n;else if(l(n)){if(C(t,n))return;W(e,r)[e]=n}else H(e,r)}(e,t,n,o):111===e.charCodeAt(0)&&110===e.charCodeAt(1)?function(e,t,n,r){if(l(n)){if(C(t,n))return;n=function(e){var t=e.event;return function(n){t(e.data,n)}}(n)}Z(r,f(e),n)}(e,t,n,o):r(n)?o.removeAttribute(e):u&&V[e]?o.setAttributeNS(V[e],e,n):o.setAttribute(e,n)}}function $e(e,t,n){var r=L(e.render(t,e.state,n)),o=n;return i(e.getChildContext)&&(o=c(n,e.getChildContext())),e.$CX=o,r}function Oe(e,t,n,o,a,c){var l=e.flags|=16384;481&l?function(e,t,n,o,i,a){var c=e.flags,l=e.props,s=e.className,f=e.children,p=e.childFlags,v=e.dom=function(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}(e.type,o=o||(32&c)>0);r(s)||""===s||(o?v.setAttribute("class",s):v.className=s);if(16===p)q(v,f);else if(1!==p){var h=o&&"foreignObject"!==e.type;2===p?(16384&f.flags&&(e.children=f=E(f)),Oe(f,v,n,h,null,a)):8!==p&&4!==p||Se(f,v,n,h,null,a)}u(t)||d(t,v,i);u(l)||function(e,t,n,r,o){var i=!1,a=(448&t)>0;for(var u in a&&(i=he(n))&&ve(t,r,n),n)Ce(u,null,n[u],r,o,i,null);a&&de(t,e,r,n,!0,i)}(e,c,l,v,o);me(e.ref,v,a)}(e,t,n,o,a,c):4&l?function(e,t,n,r,o,a){var c=function(e,t,n,r,o,a){var c=new t(n,r),l=c.$N=Boolean(t.getDerivedStateFromProps||c.getSnapshotBeforeUpdate);if(c.$SVG=o,c.$L=a,e.children=c,c.$BS=!1,c.context=r,c.props===s&&(c.props=n),l)c.state=y(c,n,c.state);else if(i(c.componentWillMount)){c.$BR=!0,c.componentWillMount();var f=c.$PS;if(!u(f)){var p=c.state;if(u(p))c.state=f;else for(var d in f)p[d]=f[d];c.$PS=null}c.$BR=!1}return c.$LI=$e(c,n,r),c}(e,e.type,e.props||s,n,r,a);Oe(c.$LI,t,c.$CX,r,o,a),function(e,t,n){me(e,t,n),i(t.componentDidMount)&&n.push(function(e){return function(){e.componentDidMount()}}(t))}(e.ref,c,a)}(e,t,n,o,a,c):8&l?(function(e,t,n,r,o,i){Oe(e.children=L(function(e,t){return 32768&e.flags?e.type.render(e.props||s,e.ref,t):e.type(e.props||s,t)}(e,n)),t,n,r,o,i)}(e,t,n,o,a,c),function(e,t){var n=e.ref;r(n)||(O(n.onComponentWillMount,e.props||s),i(n.onComponentDidMount)&&t.push(function(e,t){return function(){e.onComponentDidMount(m(t,!0),t.props||s)}}(n,e)))}(e,c)):512&l||16&l?Pe(e,t,a):8192&l?function(e,t,n,r,o,i){var a=e.children,u=e.childFlags;12&u&&0===a.length&&(u=e.childFlags=2,a=e.children=M());2===u?Oe(a,n,o,r,o,i):Se(a,n,t,r,o,i)}(e,n,t,o,a,c):1024&l&&function(e,t,n,r,o){Oe(e.children,e.ref,t,!1,null,o);var i=M();Pe(i,n,r),e.dom=i.dom}(e,n,t,a,c)}function Pe(e,t,n){var r=e.dom=document.createTextNode(e.children);u(t)||d(t,r,n)}function Se(e,t,n,r,o,i){for(var a=0;a<e.length;++a){var u=e[a];16384&u.flags&&(e[a]=u=E(u)),Oe(u,t,n,r,o,i)}}function je(e,t,n,a,l,f,d){var h=t.flags|=16384;e.flags!==h||e.type!==t.type||e.key!==t.key||2048&h?16384&e.flags?function(e,t,n,r,o,i){be(e),0!=(t.flags&e.flags&2033)?(Oe(t,null,r,o,null,i),function(e,t,n){e.replaceChild(t,n)}(n,t.dom,e.dom)):(Oe(t,n,r,o,m(e,!0),i),g(e,n))}(e,t,n,a,l,d):Oe(t,n,a,l,f,d):481&h?function(e,t,n,o,i,a){var u,c=t.dom=e.dom,l=e.props,f=t.props,p=!1,d=!1;if(o=o||(32&i)>0,l!==f){var v=l||s;if((u=f||s)!==s)for(var h in(p=(448&i)>0)&&(d=he(u)),u){var k=v[h],m=u[h];k!==m&&Ce(h,k,m,c,o,d,e)}if(v!==s)for(var g in v)r(u[g])&&!r(v[g])&&Ce(g,v[g],null,c,o,d,e)}var b=t.children,y=t.className;e.className!==y&&(r(y)?c.removeAttribute("class"):o?c.setAttribute("class",y):c.className=y);4096&i?function(e,t){e.textContent!==t&&(e.textContent=t)}(c,b):Ue(e.childFlags,t.childFlags,e.children,b,c,n,o&&"foreignObject"!==t.type,null,e,a);p&&de(i,t,c,u,!1,d);var w=t.ref,x=e.ref;x!==w&&(ke(x),me(w,c,a))}(e,t,a,l,h,d):4&h?function(e,t,n,r,o,a,l){var f=t.children=e.children;if(u(f))return;f.$L=l;var p=t.props||s,d=t.ref,v=e.ref,h=f.state;if(!f.$N){if(i(f.componentWillReceiveProps)){if(f.$BR=!0,f.componentWillReceiveProps(p,r),f.$UN)return;f.$BR=!1}u(f.$PS)||(h=c(h,f.$PS),f.$PS=null)}De(f,h,p,n,r,o,!1,a,l),v!==d&&(ke(v),me(d,f,l))}(e,t,n,a,l,f,d):8&h?function(e,t,n,o,a,u,c){var l=!0,f=t.props||s,p=t.ref,d=e.props,v=!r(p),h=e.children;v&&i(p.onComponentShouldUpdate)&&(l=p.onComponentShouldUpdate(d,f));if(!1!==l){v&&i(p.onComponentWillUpdate)&&p.onComponentWillUpdate(d,f);var k=t.type,m=L(32768&t.flags?k.render(f,p,o):k(f,o));je(h,m,n,o,a,u,c),t.children=m,v&&i(p.onComponentDidUpdate)&&p.onComponentDidUpdate(d,f)}else t.children=h}(e,t,n,a,l,f,d):16&h?function(e,t){var n=t.children,r=t.dom=e.dom;n!==e.children&&(r.nodeValue=n)}(e,t):512&h?t.dom=e.dom:8192&h?function(e,t,n,r,o,i){var a=e.children,u=t.children,c=e.childFlags,l=t.childFlags,s=null;12&l&&0===u.length&&(l=t.childFlags=2,u=t.children=M());var f=0!=(2&l);if(12&c){var p=a.length;(8&c&&8&l||f||!f&&u.length>p)&&(s=m(a[p-1],!1).nextSibling)}Ue(c,l,a,u,n,r,o,s,e,i)}(e,t,n,a,l,d):function(e,t,n,r){var i=e.ref,a=t.ref,u=t.children;if(Ue(e.childFlags,t.childFlags,e.children,u,i,n,!1,null,e,r),t.dom=e.dom,i!==a&&!o(u)){var c=u.dom;v(i,c),p(a,c)}}(e,t,a,d)}function Ue(e,t,n,r,o,i,a,u,c,l){switch(e){case 2:switch(t){case 2:je(n,r,o,i,a,u,l);break;case 1:ge(n,o);break;case 16:be(n),q(o,r);break;default:!function(e,t,n,r,o,i){be(e),Se(t,n,r,o,m(e,!0),i),g(e,n)}(n,r,o,i,a,l)}break;case 1:switch(t){case 2:Oe(r,o,i,a,u,l);break;case 1:break;case 16:q(o,r);break;default:Se(r,o,i,a,u,l)}break;case 16:switch(t){case 16:!function(e,t,n){e!==t&&(""!==e?n.firstChild.nodeValue=t:q(n,t))}(n,r,o);break;case 2:we(o),Oe(r,o,i,a,u,l);break;case 1:we(o);break;default:we(o),Se(r,o,i,a,u,l)}break;default:switch(t){case 16:ye(n),q(o,r);break;case 2:xe(o,c,n),Oe(r,o,i,a,u,l);break;case 1:xe(o,c,n);break;default:var s=0|n.length,f=0|r.length;0===s?f>0&&Se(r,o,i,a,u,l):0===f?xe(o,c,n):8===t&&8===e?function(e,t,n,r,o,i,a,u,c,l){var s,f,p=i-1,d=a-1,v=0,h=e[v],k=t[v];e:{for(;h.key===k.key;){if(16384&k.flags&&(t[v]=k=E(k)),je(h,k,n,r,o,u,l),e[v]=k,++v>p||v>d)break e;h=e[v],k=t[v]}for(h=e[p],k=t[d];h.key===k.key;){if(16384&k.flags&&(t[d]=k=E(k)),je(h,k,n,r,o,u,l),e[p]=k,p--,d--,v>p||v>d)break e;h=e[p],k=t[d]}}if(v>p){if(v<=d)for(f=(s=d+1)<a?m(t[s],!0):u;v<=d;)16384&(k=t[v]).flags&&(t[v]=k=E(k)),++v,Oe(k,n,r,o,f,l)}else if(v>d)for(;v<=p;)ge(e[v++],n);else!function(e,t,n,r,o,i,a,u,c,l,s,f,p){var d,v,h,k=0,g=u,y=u,w=i-u+1,x=a-u+1,q=new Int32Array(x+1),C=w===r,$=!1,O=0,P=0;if(o<4||(w|x)<32)for(k=g;k<=i;++k)if(d=e[k],P<x){for(u=y;u<=a;u++)if(v=t[u],d.key===v.key){if(q[u-y]=k+1,C)for(C=!1;g<k;)ge(e[g++],c);O>u?$=!0:O=u,16384&v.flags&&(t[u]=v=E(v)),je(d,v,c,n,l,s,p),++P;break}!C&&u>a&&ge(d,c)}else C||ge(d,c);else{var S={};for(k=y;k<=a;++k)S[t[k].key]=k;for(k=g;k<=i;++k)if(d=e[k],P<x)if(void 0!==(u=S[d.key])){if(C)for(C=!1;k>g;)ge(e[g++],c);q[u-y]=k+1,O>u?$=!0:O=u,16384&(v=t[u]).flags&&(t[u]=v=E(v)),je(d,v,c,n,l,s,p),++P}else C||ge(d,c);else C||ge(d,c)}if(C)xe(c,f,e),Se(t,c,n,l,s,p);else if($){var j=function(e){var t=0,n=0,r=0,o=0,i=0,a=0,u=0,c=e.length;c>Ee&&(Ee=c,ce=new Int32Array(c),le=new Int32Array(c));for(;n<c;++n)if(0!==(t=e[n])){if(r=ce[o],e[r]<t){le[n]=r,ce[++o]=n;continue}for(i=0,a=o;i<a;)e[ce[u=i+a>>1]]<t?i=u+1:a=u;t<e[ce[i]]&&(i>0&&(le[n]=ce[i-1]),ce[i]=n)}i=o+1;var l=new Int32Array(i);a=ce[i-1];for(;i-- >0;)l[i]=a,a=le[a],ce[i]=0;return l}(q);for(u=j.length-1,k=x-1;k>=0;k--)0===q[k]?(16384&(v=t[O=k+y]).flags&&(t[O]=v=E(v)),Oe(v,c,n,l,(h=O+1)<o?m(t[h],!0):s,p)):u<0||k!==j[u]?b(v=t[O=k+y],c,(h=O+1)<o?m(t[h],!0):s):u--}else if(P!==x)for(k=x-1;k>=0;k--)0===q[k]&&(16384&(v=t[O=k+y]).flags&&(t[O]=v=E(v)),Oe(v,c,n,l,(h=O+1)<o?m(t[h],!0):s,p))}(e,t,r,i,a,p,d,v,n,o,u,c,l)}(n,r,o,i,a,s,f,u,c,l):function(e,t,n,r,o,i,a,u,c){for(var l,s,f=i>a?a:i,p=0;p<f;++p)l=t[p],s=e[p],16384&l.flags&&(l=t[p]=E(l)),je(s,l,n,r,o,u,c),e[p]=l;if(i<a)for(p=f;p<a;++p)16384&(l=t[p]).flags&&(l=t[p]=E(l)),Oe(l,n,r,o,u,c);else if(i>a)for(p=f;p<i;++p)ge(e[p],n)}(n,r,o,i,a,s,f,u,l)}}}function De(e,t,n,r,o,a,u,l,s){var f=e.state,p=e.props,d=Boolean(e.$N),v=i(e.shouldComponentUpdate);if(d&&(t=y(e,n,t!==f?c(f,t):t)),u||!v||v&&e.shouldComponentUpdate(n,t,o)){!d&&i(e.componentWillUpdate)&&e.componentWillUpdate(n,t,o),e.props=n,e.state=t,e.context=o;var h=null,k=$e(e,n,o);d&&i(e.getSnapshotBeforeUpdate)&&(h=e.getSnapshotBeforeUpdate(p,f)),je(e.$LI,k,r,e.$CX,a,l,s),e.$LI=k,i(e.componentDidUpdate)&&function(e,t,n,r,o){o.push((function(){e.componentDidUpdate(t,n,r)}))}(e,p,f,h,s)}else e.props=n,e.state=t,e.context=o}var Ee=0;function Me(e,t,n,o){void 0===n&&(n=null),void 0===o&&(o=s),function(e,t,n,o){var a=[],u=t.$V;w.v=!0,r(u)?r(e)||(16384&e.flags&&(e=E(e)),Oe(e,t,o,!1,null,a),t.$V=e,u=e):r(e)?(ge(u,t),t.$V=null):(16384&e.flags&&(e=E(e)),je(u,e,t,o,!1,null,a),u=t.$V=e),h(a),w.v=!1,i(n)&&n(),i(x.renderComplete)&&x.renderComplete(u,t)}(e,t,n,o)}"undefined"!=typeof document&&window.Node&&(Node.prototype.$EV=null,Node.prototype.$V=null);var Ne=[],Fe="undefined"!=typeof Promise?Promise.resolve().then.bind(Promise.resolve()):function(e){window.setTimeout(e,0)},Le=!1;function Ie(e,t,n,o){var a=e.$PS;if(i(t)&&(t=t(a?c(e.state,a):e.state,e.props,e.context)),r(a))e.$PS=t;else for(var u in t)a[u]=t[u];if(e.$BR)i(n)&&e.$L.push(n.bind(e));else{if(!w.v&&0===Ne.length)return Te(e,o),void(i(n)&&n.call(e));if(-1===Ne.indexOf(e)&&Ne.push(e),Le||(Le=!0,Fe(Ve)),i(n)){var l=e.$QU;l||(l=e.$QU=[]),l.push(n)}}}function ze(e){for(var t=e.$QU,n=0;n<t.length;++n)t[n].call(e);e.$QU=null}function Ve(){var e;for(Le=!1;e=Ne.shift();)e.$UN||(Te(e,!1),e.$QU&&ze(e))}function Te(e,t){if(t||!e.$BR){var n=e.$PS;e.$PS=null;var r=[];w.v=!0,De(e,c(e.state,n),e.props,m(e.$LI,!0).parentNode,e.context,e.$SVG,t,null,r),h(r),w.v=!1}else e.state=e.$PS,e.$PS=null}var Ae=function(e,t){this.state=null,this.$BR=!1,this.$BS=!0,this.$PS=null,this.$LI=null,this.$UN=!1,this.$CX=null,this.$QU=null,this.$N=!1,this.$L=null,this.$SVG=!1,this.props=e||s,this.context=t||s};Ae.prototype.forceUpdate=function(e){this.$UN||Ie(this,{},e,!0)},Ae.prototype.setState=function(e,t){this.$UN||this.$BS||Ie(this,e,t,!1)},Ae.prototype.render=function(e,t,n){return null};var Be=function(e){if(Array.isArray(e))return e};var Re=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}};var We=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var He=function(e,t){if(e){if("string"==typeof e)return We(e,t);var n=Object.prototype.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)?We(e,t):void 0}};var _e=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.")};var Xe=function(e,t){return Be(e)||Re(e,t)||He(e,t)||_e()};var Qe=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};function Ye(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var Ge=Ye((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t}));var Ke=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)},Je=Ye((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t}));var Ze=function(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?Qe(e):t},et=Ye((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}));var tt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var rt=function(e,t,n){return t&&nt(e.prototype,t),n&&nt(e,n),e};function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=et(e);if(t){var o=et(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ze(this,n)}}var it=function(){function e(){tt(this,e),this.id=0,this.hookInstances=[]}return rt(e,[{key:"beginRender",value:function(){this.id=0}},{key:"nextId",value:function(){return this.id++}},{key:"createHook",value:function(e){var t=this;return function(n,r){var o,i,a=t.nextId(),u=t.hookInstances[a];if(u&&((o=u.watchList)===(i=r)||Array.isArray(o)&&Array.isArray(i)&&o.length===i.length&&o.every((function(e,t){return e===i[t]}))))return u.value;u&&u.dispose&&u.dispose();var c=e(n);return t.hookInstances[a]={watchList:r,dispose:c.dispose,get value(){return c.value}},c.value}}},{key:"dispose",value:function(){this.hookInstances.forEach((function(e){return e&&e.dispose&&e.dispose()}))}}]),e}(),at=function(e){Ke(n,e);var t=ot(n);function n(e,r){var o;tt(this,n),(o=t.call(this,e,r)).tracker=new it;var i=Qe(o),a=function(e){return i.setState((function(t){return{value:"function"==typeof e?e(t.value):e}}))};return o.hooks={useDisposable:i.tracker.createHook((function(e){return e()})),useMemo:i.tracker.createHook((function(e){return{value:e()}})),useEffect:i.tracker.createHook((function(e){return{dispose:e()}})),useState:i.tracker.createHook((function(t){return i.state={value:"function"==typeof t?t(e):t},{get value(){return[i.state.value,a]}}}))},o}return rt(n,[{key:"componentWillUnmount",value:function(){this.tracker.dispose()}},{key:"render",value:function(){return this.tracker.beginRender(),this.props.render(this.props.props,this.hooks)}}]),n}(Ae);function ut(e){return function(t){return j(2,at,{props:t,render:e})}}function ct(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}ct(".quikpik-nav{display:flex}.quikpik-nav-menu{color:#6b7280;margin-right:1.5rem;padding-right:1.5rem;border-right:1px dashed #ddd;display:flex;flex-direction:column;white-space:nowrap;align-items:flex-start}.quikpik-opt{background:transparent;cursor:pointer;border:0;font:inherit;font-size:.875rem;display:inline-flex;color:inherit;align-items:center;margin-bottom:.75rem;border-left:2px solid transparent;padding-left:.5rem;margin-left:-.5rem;text-decoration:none;outline:none;border-radius:0}.quikpik-opt:hover{color:#5a67d8}.quikpik-opt-current{color:#5a67d8;border-color:#5a67d8}.quikpik-opt-ico{margin-right:.75rem;height:1.25rem}.quikpik-nav-mobile-toggle{display:none}@-webkit-keyframes quikpik-menu-in{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes quikpik-menu-in{0%{transform:translateX(100%)}to{transform:translateX(0)}}@media only screen and (max-width:600px){.quikpik-nav-menu{position:absolute;top:0;left:0;bottom:0;right:0;background:#fff;box-shadow:.5rem 0 1rem -.5rem rgba(0,0,0,.5);border:0;padding:2rem;z-index:1;display:flex;margin:0;transform:translateX(100%);z-index:-1;visibility:hidden}.quikpik-nav-flyout{transform:translateY(0);-webkit-animation:quikpik-menu-in .1s ease forwards;animation:quikpik-menu-in .1s ease forwards;z-index:9;visibility:visible}.quikpik-nav-mobile-toggle{display:inline-block;background:transparent;border:none;outline:none;font-size:1rem;position:absolute;right:.5rem;top:.5rem;z-index:10;color:#718096}}");var lt=ut((function(e,t){var n=e.setMode,r=e.sources,o=e.mode,i=t.useState(!1),a=Xe(i,2),u=a[0],c=a[1];if(!(r.length<2))return S(1,"div","quikpik-nav",[S(1,"button","quikpik-nav-mobile-toggle","☰",16,{type:"button",onClick:function(){return c(!u)}}),S(1,"nav","quikpik-nav-menu ".concat(u?"quikpik-nav-flyout":""),[r.includes("filepicker")&&S(1,"button","quikpik-opt ".concat("pickfile"===o?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M20 18.5c0 .276-.224.5-.5.5s-.5-.224-.5-.5.224-.5.5-.5.5.224.5.5zm4-2.5l-5-14h-14l-5 14v6h24v-6zm-17.666-12h11.333l3.75 11h-18.834l3.751-11zm15.666 16h-20v-3h20v3zm-9-6v-5h3l-4-4-4 4h3v5h2z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),U("File picker")],4,{type:"button",onClick:function(){return n("pickfile")}}),r.includes("takephoto")&&S(1,"button","quikpik-opt ".concat("takephoto"===o?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M5 4h-3v-1h3v1zm10.93 0l.812 1.219c.743 1.115 1.987 1.781 3.328 1.781h1.93v13h-20v-13h3.93c1.341 0 2.585-.666 3.328-1.781l.812-1.219h5.86zm1.07-2h-8l-1.406 2.109c-.371.557-.995.891-1.664.891h-5.93v17h24v-17h-3.93c-.669 0-1.293-.334-1.664-.891l-1.406-2.109zm-11 8c0-.552-.447-1-1-1s-1 .448-1 1 .447 1 1 1 1-.448 1-1zm7 0c1.654 0 3 1.346 3 3s-1.346 3-3 3-3-1.346-3-3 1.346-3 3-3zm0-2c-2.761 0-5 2.239-5 5s2.239 5 5 5 5-2.239 5-5-2.239-5-5-5z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),U("Take picture")],4,{type:"button",onClick:function(){return n("takephoto")}}),r.includes("takevideo")&&S(1,"button","quikpik-opt ".concat("takevideo"===o?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M2.184 7.874l-2.184-.918 2.967-2.956.933 2.164-1.716 1.71zm21.816 2.126l-3 2v4l3 2v-8zm-7-2h-7.018l.79.787c.356.355.629.769.831 1.213h4.897c.276 0 .5.224.5.5v7c0 .276-.224.5-.5.5h-11c-.276 0-.5-.224-.5-.5v-2.909l-.018-.014-1.982-1.975v5.398c0 1.104.896 2 2 2h12c1.104 0 2-.896 2-2v-8c0-1.104-.896-2-2-2zm-14.65 1.13l2.967-2.956 4.044 4.029c.819.816.819 2.14 0 2.956-.819.816-2.147.815-2.967 0l-4.044-4.029z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),U("Capture video")],4,{type:"button",onClick:function(){return n("takevideo")}}),r.includes("takeaudio")&&S(1,"button","quikpik-opt ".concat("takeaudio"===o?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M12 2c1.103 0 2 .897 2 2v7c0 1.103-.897 2-2 2s-2-.897-2-2v-7c0-1.103.897-2 2-2zm0-2c-2.209 0-4 1.791-4 4v7c0 2.209 1.791 4 4 4s4-1.791 4-4v-7c0-2.209-1.791-4-4-4zm8 9v2c0 4.418-3.582 8-8 8s-8-3.582-8-8v-2h2v2c0 3.309 2.691 6 6 6s6-2.691 6-6v-2h2zm-7 13v-2h-2v2h-4v2h10v-2h-4z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),U("Record audio")],4,{type:"button",onClick:function(){return n("takeaudio")}})],0,{onClick:function(){return c(!1)}})],4)}));ct(".quikpik-filepicker{display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:.375rem;padding:2rem;flex-grow:1}.quikpik-drop-target{background:#ebf4ff}.quikpik-icon{color:#9fa6b2;width:3rem;height:3rem}.quikpik-header{color:#161e2e;line-height:1.5rem;font-size:1.125rem;font-weight:500;margin:1.25rem 0 0}.quikpik-text{display:block;color:#6b7280;line-height:1.25rem;max-width:75%;margin:.5rem auto 1.5rem}.quikpik-action{display:block;background:#5a67d8;color:#fff;border:0;padding:.5rem .75rem;font-size:.875rem;border-radius:.375rem;cursor:pointer}.quikpik-action:active,.quikpik-action:focus{outline:none;box-shadow:0 0 0 3px rgba(180,198,252,.45)}.quikpik-input{position:absolute;top:-10000px;left:-10000px;width:1px;overflow:hidden;z-index:1}");var st=ut((function(e,t){var n=e.uploadFile,r=t.useState(!1),o=Xe(r,2),i=o[0],a=o[1];function u(e){e.clipboardData&&e.clipboardData.files&&e.clipboardData.files.length&&n(e.clipboardData.files[0])}function c(){a(!1)}return t.useEffect((function(){return document.addEventListener("paste",u),function(){return document.removeEventListener("paste",u)}})),S(1,"div","quikpik-filepicker ".concat(i?"quikpik-drop-target":""),[S(32,"svg","quikpik-icon",S(32,"path",null,null,1,{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),2,{stroke:"currentColor",fill:"none",viewBox:"0 0 48 48"}),S(1,"h2","quikpik-header","Upload a file",16),S(1,"div","quikpik-instructions",[S(1,"span","quikpik-text","Drag or paste a file here, or click to choose a file from your computer.",16),S(1,"label","quikpik-action",[U("Choose File"),S(64,"input","quikpik-input",null,1,{type:"file",onChange:function(e){n(e.target.files[0])}})],4)],4)],4,{onDragover:function(e){e.preventDefault(),a(!0)},onDragend:c,onDrop:function(e){e.preventDefault(),e.stopPropagation(),n(e.dataTransfer.files&&e.dataTransfer.files[0]),c()}})}));function ft(e){var t=Date.now()-e,n=Math.floor(t/1e3)%60,r=Math.floor(n/60)%60,o=Math.floor(r/60);return"".concat(o?o+":":"").concat(r.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))}ct(".quikpik-elapsed-time{position:absolute;left:calc(50% + 2.75rem);top:50%;margin-top:-.5rem;line-height:1;opacity:.8}");var pt=ut((function(e,t){var n=t.useMemo((function(){return Date.now()})),r=t.useState(ft(n)),o=Xe(r,2),i=o[0],a=o[1];return t.useEffect((function(){var e=setTimeout((function t(){a(ft(n)),e=setTimeout(t,1e3)}),1e3);return function(){return clearTimeout(e)}})),S(1,"span","quikpik-elapsed-time",[U("Recording "),i],0)}));ct(".quikpik-confirm-item{width:100%;max-width:100%;max-height:100%}");var dt=ut((function(e,t){var n=e.file,r=t.useDisposable((function(){var e=URL.createObjectURL(n);return{value:e,dispose:function(){return URL.revokeObjectURL(e)}}}),n);return n.type.startsWith("video/")||n.type.startsWith("audio/")?S(1,"div","quikpik-vid-wrapper",S(1,"video","quikpik-vid",null,1,{src:r,muted:!1,controls:!0}),2):S(1,"div","quikpik-confirm-wrapper",S(1,"img","quikpik-confirm-item",null,1,{src:r,alt:"Confirm"}),2)}));function vt(e){var t=e.recorder;return S(1,"div","quikpik-vid-wrapper",S(1,"video","quikpik-vid",null,1,null,null,(function(e){e&&!e.$autoplay&&(e.srcObject=t.liveSrc(),e.muted=!0,e.controls=!1,e.play())})),2)}function ht(e){var t=(e.video?["video/mpeg","video/webm"]:["audio/mpeg","audio/webm","audio/ogg","audio/wav"]).filter((function(e){return MediaRecorder.isTypeSupported(e)})),n=Xe(t,1)[0];if(!n)throw new Error("No supported mime type found.");return n}function kt(e){return e.name="your".concat(e.type.replace("/",".")),e}ct(".quikpik-vid-wrapper{position:relative;width:100%;flex-grow:1}.quikpik-vid{position:absolute;height:100%;width:100%;margin:auto;left:50%;transform:translateX(-50%);border-radius:2px;outline:none}"),function(){if(!window.ImageCapture){var e=document.createElement("script");e.src="https://unpkg.com/browse/image-capture@0.4.0/lib/imagecapture.min.js",document.head.appendChild(e)}}();function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}ct('.quikpik-media{box-sizing:border-box;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center;background:#1a202c;color:#fff;padding:1rem;border-radius:.375rem}.quikpik-media-footer{position:relative;padding:1rem;width:100%}.quikpik-snap-photo{background:#fff}.quikpik-record-media,.quikpik-snap-photo,.quikpik-stop-media{cursor:pointer;box-shadow:inset 0 0 0 2px;border:4px solid #fff;width:3rem;height:3rem;border-radius:100%;outline:none}.quikpik-record-media,.quikpik-stop-media{position:relative;display:inline-flex;align-items:center;justify-content:center;background:red}.quikpik-stop-media{background:transparent}.quikpik-stop-media:before{content:"";background:red;height:1.5rem;width:1.5rem;border-radius:2px}.quikpik-snap-photo:focus{box-shadow:inset 0 0 0 4px}.quikpik-media-accept,.quikpik-media-retake{background:#5a67d8;color:#fff;border:0;padding:.5rem .75rem;font-size:.875rem;border-radius:.375rem;cursor:pointer;margin:0 .25rem;outline:none}.quikpik-media-retake{border:1px solid;background:transparent;color:inherit}.quikpik-info{color:#6b7280;display:flex;align-items:center;justify-content:center}');var bt=ut((function(e,t){var n=e.mode,r=e.uploadFile,o=t.useState({status:"init",error:void 0,recorder:void 0,recorderMode:void 0,file:void 0}),i=Xe(o,2),a=i[0],u=a.status,c=a.error,l=a.recorder,s=a.recorderMode,f=a.file,p=i[1];function d(e){console.error(e),p((function(e){return gt(gt({},e),{},{status:"error",error:"Unable to connect to your camera."})}))}return t.useEffect((function(){(function(e){var t,n,r=[];function o(e){e.data.size>0?r.push(e.data):console.error("No data",e)}function i(){return t}function a(){var e=t.getVideoTracks()[0];return new ImageCapture(e).takePhoto().then(kt)}function u(){r=[],(n=new MediaRecorder(t,{mimeType:ht(e)})).ondataavailable=o,n.start()}function c(){return new Promise((function(t,o){n.onstop=function(){try{var n=new Blob(r,{type:ht(e)});t(kt(n))}catch(e){o(e)}},n.stop()}))}return navigator.mediaDevices.getUserMedia(e).then((function(e){return t=e,{liveSrc:i,capturePhoto:a,beginMediaCapture:u,endMediaCapture:c}}))})({video:"takeaudio"!==n,audio:!0}).then((function(e){p((function(t){return gt(gt({},t),{},{status:"live",recorder:e,recorderMode:n})}))})).catch(d)}),n),S(1,"div","quikpik-media",["error"===u&&S(1,"p","quikpik-error",c,0),"init"===u&&S(1,"p","quikpik-info","Waiting for your camera or microphone to be ready.",16),("live"===u||"recording"===u)&&"takeaudio"!==n&&j(2,vt,{recorder:l}),"live"===u&&"takeaudio"===n&&S(1,"p","quikpik-info","Click the red button to begin recording.",16),"live"===u&&S(1,"footer","quikpik-media-footer",S(1,"button","quikpik-snap-photo ".concat("takephoto"!==n?"quikpik-record-media":""," ").concat("recording"===u?"quikpik-stop-media":""),null,1,{disabled:s!==n,onClick:function(){"takephoto"===n?l.capturePhoto().then((function(e){p((function(t){return gt(gt({},t),{},{file:e,status:"confirm"})}))})).catch(d):(l.beginMediaCapture(),p((function(e){return gt(gt({},e),{},{status:"recording"})})))}}),2),"recording"===u&&S(1,"footer","quikpik-media-footer",[S(1,"button","quikpik-stop-media",null,1,{onClick:function(){l.endMediaCapture().then((function(e){p((function(t){return gt(gt({},t),{},{file:e,status:"confirm"})}))})).catch(d)}}),j(2,pt)],4),"confirm"===u&&j(2,dt,{file:f}),"confirm"===u&&S(1,"footer","quikpik-media-footer",[S(1,"button","quikpik-media-retake","Retake",16,{onClick:function(){p((function(e){return gt(gt({},e),{},{status:"live",file:void 0})}))}}),S(1,"button","quikpik-media-accept","Accept & upload",16,{onClick:function(){r(f)}})],4)],0)}));function yt(e){var t=e.file,n=e.progress;return S(1,"div","quikpik-progress",[S(1,"span","quikpik-progress-text",[S(1,"span","quikpik-filename",[U("Uploading "),t.name||""],0),S(1,"span","quikpik-percent",[Math.round(n),U("%")],0)],4),S(1,"span","quikpik-progress-bar-wrapper",S(1,"span","quikpik-progress-bar ".concat(n>=100?"quikpik-done-bar":""),null,1,{style:{width:"".concat(n,"%")}}),2)],4)}ct(".quikpik-progress{width:100%}.quikpik-progress-text{display:flex;justify-content:space-between;color:#6b7280;line-height:1.25rem;margin:.5rem auto}.quikpik-progress-bar,.quikpik-progress-bar-wrapper{display:block;background:#c3dafe;height:8px;border-radius:4px}.quikpik-progress-bar{background:#667eea;width:0;transition:width .25s,background-color .5s}.quikpik-done-bar{background:#48bb78}");function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?wt(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}ct('.quikpik{position:fixed;max-height:100vh;display:flex;align-items:center;justify-content:center;font-family:Inter var,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.quikpik,.quikpik:before{top:0;left:0;right:0;bottom:0;z-index:10000}.quikpik:before{content:"";position:absolute;background:#6b7280;opacity:.75}@-webkit-keyframes quikpik-up{0%{opacity:0;transform:translateY(4rem)}to{opacity:1;transform:translateY(0)}}@keyframes quikpik-up{0%{opacity:0;transform:translateY(4rem)}to{opacity:1;transform:translateY(0)}}.quikpik-body{position:relative;background:#fff;padding:1.5rem;border-radius:.5rem;text-align:center;font-size:.875rem;z-index:10001;width:calc(100vw - 5rem);height:calc(100vh - 5rem);max-width:1024px;max-height:780px;box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);outline:none;-webkit-animation:quikpik-up .25s ease forwards;animation:quikpik-up .25s ease forwards;display:flex;overflow:hidden}@media only screen and (max-width:600px){.quikpik-body{padding:0;width:calc(100% - 2rem);height:calc(100% - 2rem)}}.quikpik-body-fit{height:auto;max-width:24rem;padding:1.5rem}');var qt=ut((function(e,t){var n=t.useState({mode:"pickfile",file:void 0,uploader:void 0,progress:0}),r=Xe(n,2),o=r[0],i=o.mode,a=o.uploader,u=o.file,c=o.progress,l=r[1],s=e.customProgress,f=e.close,p=e.upload,d=e.sources,v=function(e){return l((function(t){return xt(xt({},t),{},{progress:e})}))};function h(e){"Escape"!==e.key&&"Escape"!==e.code||f()}function k(e){if(e){var t=p({file:e,onProgress:v});l((function(n){return xt(xt({},n),{},{file:e,uploader:t})})),t.promise.then((function(){return setTimeout(f,750)})).catch((function(e){e&&0!==e.status&&alert("Upload failed. "+(e.message||""))}))}}if(t.useEffect((function(){return window.addEventListener("keydown",h),function(){return window.removeEventListener("keydown",h)}})),!s||!a)return S(1,"div","quikpik",S(1,"div","quikpik-body ".concat(a?"quikpik-body-fit":""),[a&&j(2,yt,{progress:c,file:u}),!a&&j(2,lt,{mode:i,setMode:function(e){return l((function(t){return xt(xt({},t),{},{mode:e})}))},sources:d}),!a&&"pickfile"===i&&j(2,st,{uploadFile:k}),!a&&"pickfile"!==i&&j(2,bt,{uploadFile:k,mode:i})],0,{onClick:function(e){return e.stopPropagation()},onTouchEnd:function(e){return e.stopPropagation()}}),2,{onClick:f,onTouchEnd:f})}));function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Ct(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ot,Pt=(Ot=!!window.MediaRecorder,{filepicker:!0,takephoto:!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),takevideo:Ot,takeaudio:Ot});return function(e){var t=document.createElement("div"),n={close:i,uploader:void 0},o=(e.sources||["filepicker","takephoto","takevideo","takeaudio"]).filter((function(e){return Pt[e]}));function i(){n.uploader&&n.uploader.cancel(),t.remove()}return document.body.appendChild(t),Me(function(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&r(e.children)&&F(e,t.children),void 0!==t.className&&(e.className=t.className||null,t.className=void 0)),void 0!==t.key&&(e.key=t.key,t.key=void 0),void 0!==t.ref&&(e.ref=8&n?c(e.ref,t.ref):t.ref,t.ref=void 0)}return e}(j(2,qt,$t($t({},e),{},{sources:o,close:i,upload:function(){return n.uploader=e.upload.apply(e,arguments),n.uploader}}))),t),{close:i}}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).quikpik=t()}(this,(function(){"use strict";var e=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t=Array.isArray;function n(e){var t=typeof e;return"string"===t||"number"===t}function r(e){return null==e}function i(e){return null===e||!1===e||!0===e||void 0===e}function o(e){return"function"==typeof e}function a(e){return"string"==typeof e}function u(e){return null===e}function c(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var i in t)n[i]=t[i];return n}function l(e){return!u(e)&&"object"==typeof e}var s={};function f(e){return e.substr(2).toLowerCase()}function p(e,t){e.appendChild(t)}function d(e,t,n){u(n)?p(e,t):e.insertBefore(t,n)}function h(e,t){e.removeChild(t)}function v(e){for(var t=0;t<e.length;t++)e[t]()}function m(e,t,n){var r=e.children;return 4&n?r.$LI:8192&n?2===e.childFlags?r:r[t?0:r.length-1]:r}function k(e,t){for(var n;e;){if(2033&(n=e.flags))return e.dom;e=m(e,t,n)}return null}function g(e,t){do{var n=e.flags;if(2033&n)return void h(t,e.dom);var r=e.children;if(4&n&&(e=r.$LI),8&n&&(e=r),8192&n){if(2!==e.childFlags){for(var i=0,o=r.length;i<o;++i)g(r[i],t);return}e=r}}while(e)}function b(e,t,n){do{var r=e.flags;if(2033&r)return void d(t,e.dom,n);var i=e.children;if(4&r&&(e=i.$LI),8&r&&(e=i),8192&r){if(2!==e.childFlags){for(var o=0,a=i.length;o<a;++o)b(i[o],t,n);return}e=i}}while(e)}function y(e,t,n){return e.constructor.getDerivedStateFromProps?c(n,e.constructor.getDerivedStateFromProps(t,n)):n}var w={v:!1},x={componentComparator:null,createVNode:null,renderComplete:null};function q(e,t){e.textContent=t}function C(e,t){return l(e)&&e.event===t.event&&e.data===t.data}function $(e,t){for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e}function P(e,t){return!!o(e)&&(e(t),!0)}function O(e,t,n,r,i,o,a,u){this.childFlags=e,this.children=t,this.className=n,this.dom=null,this.flags=r,this.key=void 0===i?null:i,this.props=void 0===o?null:o,this.ref=void 0===a?null:a,this.type=u}function S(e,t,n,r,i,o,a,u){var c=void 0===i?1:i,l=new O(c,r,n,e,a,o,u,t);return x.createVNode&&x.createVNode(l),0===c&&I(l,l.children),l}function j(e,t,n,i,o){var a=new O(1,null,null,e=function(e,t){return 12&e?e:t.prototype&&t.prototype.render?4:t.render?32776:8}(e,t),i,function(e,t,n){var i=(32768&e?t.render:t).defaultProps;return r(i)?n:r(n)?c(i,null):$(n,i)}(e,t,n),function(e,t,n){if(4&e)return n;var i=(32768&e?t.render:t).defaultHooks;return r(i)?n:r(n)?i:$(n,i)}(e,t,o),t);return x.createVNode&&x.createVNode(a),a}function D(e,t){return new O(1,r(e)||!0===e||!1===e?"":e,null,16,t,null,null,null)}function U(e,t,n){var r=S(8192,8192,null,e,t,null,n,null);switch(r.childFlags){case 1:r.children=E(),r.childFlags=2;break;case 16:r.children=[D(e)],r.childFlags=4}return r}function M(e){var t=-16385&e.flags,n=e.props;if(14&t&&!u(n)){var r=n;for(var i in n={},r)n[i]=r[i]}return 0==(8192&t)?new O(e.childFlags,e.children,e.className,t,e.key,n,e.ref,e.type):function(e){var t,n=e.children,r=e.childFlags;if(2===r)t=M(n);else if(12&r){t=[];for(var i=0,o=n.length;i<o;++i)t.push(M(n[i]))}return U(t,r,e.key)}(e)}function E(){return D("",null)}function F(e,r,o,c){for(var l=e.length;o<l;o++){var s=e[o];if(!i(s)){var f=c+"$"+o;if(t(s))F(s,r,0,f);else{if(n(s))s=D(s,f);else{var p=s.key,d=a(p)&&"$"===p[0];(81920&s.flags||d)&&(s=M(s)),s.flags|=65536,d?p.substring(0,c.length)!==c&&(s.key=c+p):u(p)?s.key=f:s.key=c+p}r.push(s)}}}}function I(e,r){var o,c=1;if(i(r))o=r;else if(n(r))c=16,o=r;else if(t(r)){for(var l=r.length,s=0;s<l;++s){var f=r[s];if(i(f)||t(f)){o=o||r.slice(0,s),F(r,o,s,"");break}if(n(f))(o=o||r.slice(0,s)).push(D(f,"$"+s));else{var p=f.key,d=(81920&f.flags)>0,h=u(p),v=a(p)&&"$"===p[0];d||h||v?(o=o||r.slice(0,s),(d||v)&&(f=M(f)),(h||v)&&(f.key="$"+s),o.push(f)):o&&o.push(f),f.flags|=65536}}c=0===(o=o||r).length?1:8}else(o=r).flags|=65536,81920&r.flags&&(o=M(r)),c=2;return e.children=o,e.childFlags=c,e}function T(e){return i(e)||n(e)?D(e,null):t(e)?U(e,0,null):16384&e.flags?M(e):e}var N="http://www.w3.org/1999/xlink",L="http://www.w3.org/XML/1998/namespace",z={"xlink:actuate":N,"xlink:arcrole":N,"xlink:href":N,"xlink:role":N,"xlink:show":N,"xlink:title":N,"xlink:type":N,"xml:base":L,"xml:lang":L,"xml:space":L};function V(e){return{onClick:e,onDblClick:e,onFocusIn:e,onFocusOut:e,onKeyDown:e,onKeyPress:e,onKeyUp:e,onMouseDown:e,onMouseMove:e,onMouseUp:e,onTouchEnd:e,onTouchMove:e,onTouchStart:e}}var B=V(0),A=V(null),R=V(!0);function W(e,t){var n=t.$EV;return n||(n=t.$EV=V(null)),n[e]||1==++B[e]&&(A[e]=function(e){var t="onClick"===e||"onDblClick"===e?function(e){return function(t){0===t.button?_(t,!0,e,G(t)):t.stopPropagation()}}(e):function(e){return function(t){_(t,!1,e,G(t))}}(e);return document.addEventListener(f(e),t),t}(e)),n}function H(e,t){var n=t.$EV;n&&n[e]&&(0==--B[e]&&(document.removeEventListener(f(e),A[e]),A[e]=null),n[e]=null)}function _(e,t,n,r){var i=function(e){return o(e.composedPath)?e.composedPath()[0]:e.target}(e);do{if(t&&i.disabled)return;var a=i.$EV;if(a){var c=a[n];if(c&&(r.dom=i,c.event?c.event(c.data,e):c(e),e.cancelBubble))return}i=i.parentNode}while(!u(i))}function X(){this.cancelBubble=!0,this.immediatePropagationStopped||this.stopImmediatePropagation()}function Q(){return this.defaultPrevented}function Y(){return this.cancelBubble}function G(e){var t={dom:document};return e.isDefaultPrevented=Q,e.isPropagationStopped=Y,e.stopPropagation=X,Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return t.dom}}),t}function K(e,t,n){if(e[t]){var r=e[t];r.event?r.event(r.data,n):r(n)}else{var i=t.toLowerCase();e[i]&&e[i](n)}}function J(e,t){var n=function(n){var r=this.$V;if(r){var i=r.props||s,u=r.dom;if(a(e))K(i,e,n);else for(var c=0;c<e.length;++c)K(i,e[c],n);if(o(t)){var l=this.$V,f=l.props||s;t(f,u,!1,l)}}};return Object.defineProperty(n,"wrapped",{configurable:!1,enumerable:!1,value:!0,writable:!1}),n}function Z(e,t,n){var r="$"+t,i=e[r];if(i){if(i[1].wrapped)return;e.removeEventListener(i[0],i[1]),e[r]=null}o(n)&&(e.addEventListener(t,n),e[r]=[t,n])}function ee(e){return"checkbox"===e||"radio"===e}var te=J("onInput",ie),ne=J(["onClick","onChange"],ie);function re(e){e.stopPropagation()}function ie(e,t){var n=e.type,i=e.value,o=e.checked,a=e.multiple,u=e.defaultValue,c=!r(i);n&&n!==t.type&&t.setAttribute("type",n),r(a)||a===t.multiple||(t.multiple=a),r(u)||c||(t.defaultValue=u+""),ee(n)?(c&&(t.value=i),r(o)||(t.checked=o)):c&&t.value!==i?(t.defaultValue=i,t.value=i):r(o)||(t.checked=o)}function oe(e,n){if("option"===e.type)!function(e,n){var i=e.props||s,o=e.dom;o.value=i.value,i.value===n||t(n)&&-1!==n.indexOf(i.value)?o.selected=!0:r(n)&&r(i.selected)||(o.selected=i.selected||!1)}(e,n);else{var i=e.children,o=e.flags;if(4&o)oe(i.$LI,n);else if(8&o)oe(i,n);else if(2===e.childFlags)oe(i,n);else if(12&e.childFlags)for(var a=0,u=i.length;a<u;++a)oe(i[a],n)}}re.wrapped=!0;var ae=J("onChange",ue);function ue(e,t,n,i){var o=Boolean(e.multiple);r(e.multiple)||o===t.multiple||(t.multiple=o);var a=e.selectedIndex;if(-1===a&&(t.selectedIndex=-1),1!==i.childFlags){var u=e.value;"number"==typeof a&&a>-1&&t.options[a]&&(u=t.options[a].value),n&&r(u)&&(u=e.defaultValue),oe(i,u)}}var ce,le,se=J("onInput",pe),fe=J("onChange");function pe(e,t,n){var i=e.value,o=t.value;if(r(i)){if(n){var a=e.defaultValue;r(a)||a===o||(t.defaultValue=a,t.value=a)}}else o!==i&&(t.defaultValue=i,t.value=i)}function de(e,t,n,r,i,o){64&e?ie(r,n):256&e?ue(r,n,i,t):128&e&&pe(r,n,i),o&&(n.$V=t)}function he(e,t,n){64&e?function(e,t){ee(t.type)?(Z(e,"change",ne),Z(e,"click",re)):Z(e,"input",te)}(t,n):256&e?function(e){Z(e,"change",ae)}(t):128&e&&function(e,t){Z(e,"input",se),t.onChange&&Z(e,"change",fe)}(t,n)}function ve(e){return e.type&&ee(e.type)?!r(e.checked):!r(e.value)}function me(e){e&&!P(e,null)&&e.current&&(e.current=null)}function ke(e,t,n){e&&(o(e)||void 0!==e.current)&&n.push((function(){P(e,t)||void 0===e.current||(e.current=t)}))}function ge(e,t){be(e),g(e,t)}function be(e){var t,n=e.flags,i=e.children;if(481&n){t=e.ref;var a=e.props;me(t);var c=e.childFlags;if(!u(a))for(var l=Object.keys(a),f=0,p=l.length;f<p;f++){var d=l[f];R[d]&&H(d,e.dom)}12&c?ye(i):2===c&&be(i)}else i&&(4&n?(o(i.componentWillUnmount)&&i.componentWillUnmount(),me(e.ref),i.$UN=!0,be(i.$LI)):8&n?(!r(t=e.ref)&&o(t.onComponentWillUnmount)&&t.onComponentWillUnmount(k(e,!0),e.props||s),be(i)):1024&n?ge(i,e.ref):8192&n&&12&e.childFlags&&ye(i))}function ye(e){for(var t=0,n=e.length;t<n;++t)be(e[t])}function we(e){e.textContent=""}function xe(e,t,n){ye(n),8192&t.flags?g(t,e):we(e)}function qe(e,t,n,i){var o=e&&e.__html||"",a=t&&t.__html||"";o!==a&&(r(a)||function(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}(i,a)||(u(n)||(12&n.childFlags?ye(n.children):2===n.childFlags&&be(n.children),n.children=null,n.childFlags=1),i.innerHTML=a))}function Ce(e,t,n,i,u,c,s){switch(e){case"children":case"childrenType":case"className":case"defaultValue":case"key":case"multiple":case"ref":case"selectedIndex":break;case"autoFocus":i.autofocus=!!n;break;case"allowfullscreen":case"autoplay":case"capture":case"checked":case"controls":case"default":case"disabled":case"hidden":case"indeterminate":case"loop":case"muted":case"novalidate":case"open":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"selected":i[e]=!!n;break;case"defaultChecked":case"value":case"volume":if(c&&"value"===e)break;var p=r(n)?"":n;i[e]!==p&&(i[e]=p);break;case"style":!function(e,t,n){if(r(t))n.removeAttribute("style");else{var i,o,u=n.style;if(a(t))u.cssText=t;else if(r(e)||a(e))for(i in t)o=t[i],u.setProperty(i,o);else{for(i in t)(o=t[i])!==e[i]&&u.setProperty(i,o);for(i in e)r(t[i])&&u.removeProperty(i)}}}(t,n,i);break;case"dangerouslySetInnerHTML":qe(t,n,s,i);break;default:R[e]?function(e,t,n,r){if(o(n))W(e,r)[e]=n;else if(l(n)){if(C(t,n))return;W(e,r)[e]=n}else H(e,r)}(e,t,n,i):111===e.charCodeAt(0)&&110===e.charCodeAt(1)?function(e,t,n,r){if(l(n)){if(C(t,n))return;n=function(e){var t=e.event;return function(n){t(e.data,n)}}(n)}Z(r,f(e),n)}(e,t,n,i):r(n)?i.removeAttribute(e):u&&z[e]?i.setAttributeNS(z[e],e,n):i.setAttribute(e,n)}}function $e(e,t,n){var r=T(e.render(t,e.state,n)),i=n;return o(e.getChildContext)&&(i=c(n,e.getChildContext())),e.$CX=i,r}function Pe(e,t,n,i,a,c){var l=e.flags|=16384;481&l?function(e,t,n,i,o,a){var c=e.flags,l=e.props,s=e.className,f=e.children,p=e.childFlags,h=e.dom=function(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}(e.type,i=i||(32&c)>0);r(s)||""===s||(i?h.setAttribute("class",s):h.className=s);if(16===p)q(h,f);else if(1!==p){var v=i&&"foreignObject"!==e.type;2===p?(16384&f.flags&&(e.children=f=M(f)),Pe(f,h,n,v,null,a)):8!==p&&4!==p||Se(f,h,n,v,null,a)}u(t)||d(t,h,o);u(l)||function(e,t,n,r,i){var o=!1,a=(448&t)>0;for(var u in a&&(o=ve(n))&&he(t,r,n),n)Ce(u,null,n[u],r,i,o,null);a&&de(t,e,r,n,!0,o)}(e,c,l,h,i);ke(e.ref,h,a)}(e,t,n,i,a,c):4&l?function(e,t,n,r,i,a){var c=function(e,t,n,r,i,a){var c=new t(n,r),l=c.$N=Boolean(t.getDerivedStateFromProps||c.getSnapshotBeforeUpdate);if(c.$SVG=i,c.$L=a,e.children=c,c.$BS=!1,c.context=r,c.props===s&&(c.props=n),l)c.state=y(c,n,c.state);else if(o(c.componentWillMount)){c.$BR=!0,c.componentWillMount();var f=c.$PS;if(!u(f)){var p=c.state;if(u(p))c.state=f;else for(var d in f)p[d]=f[d];c.$PS=null}c.$BR=!1}return c.$LI=$e(c,n,r),c}(e,e.type,e.props||s,n,r,a);Pe(c.$LI,t,c.$CX,r,i,a),function(e,t,n){ke(e,t,n),o(t.componentDidMount)&&n.push(function(e){return function(){e.componentDidMount()}}(t))}(e.ref,c,a)}(e,t,n,i,a,c):8&l?(function(e,t,n,r,i,o){Pe(e.children=T(function(e,t){return 32768&e.flags?e.type.render(e.props||s,e.ref,t):e.type(e.props||s,t)}(e,n)),t,n,r,i,o)}(e,t,n,i,a,c),function(e,t){var n=e.ref;r(n)||(P(n.onComponentWillMount,e.props||s),o(n.onComponentDidMount)&&t.push(function(e,t){return function(){e.onComponentDidMount(k(t,!0),t.props||s)}}(n,e)))}(e,c)):512&l||16&l?Oe(e,t,a):8192&l?function(e,t,n,r,i,o){var a=e.children,u=e.childFlags;12&u&&0===a.length&&(u=e.childFlags=2,a=e.children=E());2===u?Pe(a,n,i,r,i,o):Se(a,n,t,r,i,o)}(e,n,t,i,a,c):1024&l&&function(e,t,n,r,i){Pe(e.children,e.ref,t,!1,null,i);var o=E();Oe(o,n,r),e.dom=o.dom}(e,n,t,a,c)}function Oe(e,t,n){var r=e.dom=document.createTextNode(e.children);u(t)||d(t,r,n)}function Se(e,t,n,r,i,o){for(var a=0;a<e.length;++a){var u=e[a];16384&u.flags&&(e[a]=u=M(u)),Pe(u,t,n,r,i,o)}}function je(e,t,n,a,l,f,d){var v=t.flags|=16384;e.flags!==v||e.type!==t.type||e.key!==t.key||2048&v?16384&e.flags?function(e,t,n,r,i,o){be(e),0!=(t.flags&e.flags&2033)?(Pe(t,null,r,i,null,o),function(e,t,n){e.replaceChild(t,n)}(n,t.dom,e.dom)):(Pe(t,n,r,i,k(e,!0),o),g(e,n))}(e,t,n,a,l,d):Pe(t,n,a,l,f,d):481&v?function(e,t,n,i,o,a){var u,c=t.dom=e.dom,l=e.props,f=t.props,p=!1,d=!1;if(i=i||(32&o)>0,l!==f){var h=l||s;if((u=f||s)!==s)for(var v in(p=(448&o)>0)&&(d=ve(u)),u){var m=h[v],k=u[v];m!==k&&Ce(v,m,k,c,i,d,e)}if(h!==s)for(var g in h)r(u[g])&&!r(h[g])&&Ce(g,h[g],null,c,i,d,e)}var b=t.children,y=t.className;e.className!==y&&(r(y)?c.removeAttribute("class"):i?c.setAttribute("class",y):c.className=y);4096&o?function(e,t){e.textContent!==t&&(e.textContent=t)}(c,b):De(e.childFlags,t.childFlags,e.children,b,c,n,i&&"foreignObject"!==t.type,null,e,a);p&&de(o,t,c,u,!1,d);var w=t.ref,x=e.ref;x!==w&&(me(x),ke(w,c,a))}(e,t,a,l,v,d):4&v?function(e,t,n,r,i,a,l){var f=t.children=e.children;if(u(f))return;f.$L=l;var p=t.props||s,d=t.ref,h=e.ref,v=f.state;if(!f.$N){if(o(f.componentWillReceiveProps)){if(f.$BR=!0,f.componentWillReceiveProps(p,r),f.$UN)return;f.$BR=!1}u(f.$PS)||(v=c(v,f.$PS),f.$PS=null)}Ue(f,v,p,n,r,i,!1,a,l),h!==d&&(me(h),ke(d,f,l))}(e,t,n,a,l,f,d):8&v?function(e,t,n,i,a,u,c){var l=!0,f=t.props||s,p=t.ref,d=e.props,h=!r(p),v=e.children;h&&o(p.onComponentShouldUpdate)&&(l=p.onComponentShouldUpdate(d,f));if(!1!==l){h&&o(p.onComponentWillUpdate)&&p.onComponentWillUpdate(d,f);var m=t.type,k=T(32768&t.flags?m.render(f,p,i):m(f,i));je(v,k,n,i,a,u,c),t.children=k,h&&o(p.onComponentDidUpdate)&&p.onComponentDidUpdate(d,f)}else t.children=v}(e,t,n,a,l,f,d):16&v?function(e,t){var n=t.children,r=t.dom=e.dom;n!==e.children&&(r.nodeValue=n)}(e,t):512&v?t.dom=e.dom:8192&v?function(e,t,n,r,i,o){var a=e.children,u=t.children,c=e.childFlags,l=t.childFlags,s=null;12&l&&0===u.length&&(l=t.childFlags=2,u=t.children=E());var f=0!=(2&l);if(12&c){var p=a.length;(8&c&&8&l||f||!f&&u.length>p)&&(s=k(a[p-1],!1).nextSibling)}De(c,l,a,u,n,r,i,s,e,o)}(e,t,n,a,l,d):function(e,t,n,r){var o=e.ref,a=t.ref,u=t.children;if(De(e.childFlags,t.childFlags,e.children,u,o,n,!1,null,e,r),t.dom=e.dom,o!==a&&!i(u)){var c=u.dom;h(o,c),p(a,c)}}(e,t,a,d)}function De(e,t,n,r,i,o,a,u,c,l){switch(e){case 2:switch(t){case 2:je(n,r,i,o,a,u,l);break;case 1:ge(n,i);break;case 16:be(n),q(i,r);break;default:!function(e,t,n,r,i,o){be(e),Se(t,n,r,i,k(e,!0),o),g(e,n)}(n,r,i,o,a,l)}break;case 1:switch(t){case 2:Pe(r,i,o,a,u,l);break;case 1:break;case 16:q(i,r);break;default:Se(r,i,o,a,u,l)}break;case 16:switch(t){case 16:!function(e,t,n){e!==t&&(""!==e?n.firstChild.nodeValue=t:q(n,t))}(n,r,i);break;case 2:we(i),Pe(r,i,o,a,u,l);break;case 1:we(i);break;default:we(i),Se(r,i,o,a,u,l)}break;default:switch(t){case 16:ye(n),q(i,r);break;case 2:xe(i,c,n),Pe(r,i,o,a,u,l);break;case 1:xe(i,c,n);break;default:var s=0|n.length,f=0|r.length;0===s?f>0&&Se(r,i,o,a,u,l):0===f?xe(i,c,n):8===t&&8===e?function(e,t,n,r,i,o,a,u,c,l){var s,f,p=o-1,d=a-1,h=0,v=e[h],m=t[h];e:{for(;v.key===m.key;){if(16384&m.flags&&(t[h]=m=M(m)),je(v,m,n,r,i,u,l),e[h]=m,++h>p||h>d)break e;v=e[h],m=t[h]}for(v=e[p],m=t[d];v.key===m.key;){if(16384&m.flags&&(t[d]=m=M(m)),je(v,m,n,r,i,u,l),e[p]=m,p--,d--,h>p||h>d)break e;v=e[p],m=t[d]}}if(h>p){if(h<=d)for(f=(s=d+1)<a?k(t[s],!0):u;h<=d;)16384&(m=t[h]).flags&&(t[h]=m=M(m)),++h,Pe(m,n,r,i,f,l)}else if(h>d)for(;h<=p;)ge(e[h++],n);else!function(e,t,n,r,i,o,a,u,c,l,s,f,p){var d,h,v,m=0,g=u,y=u,w=o-u+1,x=a-u+1,q=new Int32Array(x+1),C=w===r,$=!1,P=0,O=0;if(i<4||(w|x)<32)for(m=g;m<=o;++m)if(d=e[m],O<x){for(u=y;u<=a;u++)if(h=t[u],d.key===h.key){if(q[u-y]=m+1,C)for(C=!1;g<m;)ge(e[g++],c);P>u?$=!0:P=u,16384&h.flags&&(t[u]=h=M(h)),je(d,h,c,n,l,s,p),++O;break}!C&&u>a&&ge(d,c)}else C||ge(d,c);else{var S={};for(m=y;m<=a;++m)S[t[m].key]=m;for(m=g;m<=o;++m)if(d=e[m],O<x)if(void 0!==(u=S[d.key])){if(C)for(C=!1;m>g;)ge(e[g++],c);q[u-y]=m+1,P>u?$=!0:P=u,16384&(h=t[u]).flags&&(t[u]=h=M(h)),je(d,h,c,n,l,s,p),++O}else C||ge(d,c);else C||ge(d,c)}if(C)xe(c,f,e),Se(t,c,n,l,s,p);else if($){var j=function(e){var t=0,n=0,r=0,i=0,o=0,a=0,u=0,c=e.length;c>Me&&(Me=c,ce=new Int32Array(c),le=new Int32Array(c));for(;n<c;++n)if(0!==(t=e[n])){if(r=ce[i],e[r]<t){le[n]=r,ce[++i]=n;continue}for(o=0,a=i;o<a;)e[ce[u=o+a>>1]]<t?o=u+1:a=u;t<e[ce[o]]&&(o>0&&(le[n]=ce[o-1]),ce[o]=n)}o=i+1;var l=new Int32Array(o);a=ce[o-1];for(;o-- >0;)l[o]=a,a=le[a],ce[o]=0;return l}(q);for(u=j.length-1,m=x-1;m>=0;m--)0===q[m]?(16384&(h=t[P=m+y]).flags&&(t[P]=h=M(h)),Pe(h,c,n,l,(v=P+1)<i?k(t[v],!0):s,p)):u<0||m!==j[u]?b(h=t[P=m+y],c,(v=P+1)<i?k(t[v],!0):s):u--}else if(O!==x)for(m=x-1;m>=0;m--)0===q[m]&&(16384&(h=t[P=m+y]).flags&&(t[P]=h=M(h)),Pe(h,c,n,l,(v=P+1)<i?k(t[v],!0):s,p))}(e,t,r,o,a,p,d,h,n,i,u,c,l)}(n,r,i,o,a,s,f,u,c,l):function(e,t,n,r,i,o,a,u,c){for(var l,s,f=o>a?a:o,p=0;p<f;++p)l=t[p],s=e[p],16384&l.flags&&(l=t[p]=M(l)),je(s,l,n,r,i,u,c),e[p]=l;if(o<a)for(p=f;p<a;++p)16384&(l=t[p]).flags&&(l=t[p]=M(l)),Pe(l,n,r,i,u,c);else if(o>a)for(p=f;p<o;++p)ge(e[p],n)}(n,r,i,o,a,s,f,u,l)}}}function Ue(e,t,n,r,i,a,u,l,s){var f=e.state,p=e.props,d=Boolean(e.$N),h=o(e.shouldComponentUpdate);if(d&&(t=y(e,n,t!==f?c(f,t):t)),u||!h||h&&e.shouldComponentUpdate(n,t,i)){!d&&o(e.componentWillUpdate)&&e.componentWillUpdate(n,t,i),e.props=n,e.state=t,e.context=i;var v=null,m=$e(e,n,i);d&&o(e.getSnapshotBeforeUpdate)&&(v=e.getSnapshotBeforeUpdate(p,f)),je(e.$LI,m,r,e.$CX,a,l,s),e.$LI=m,o(e.componentDidUpdate)&&function(e,t,n,r,i){i.push((function(){e.componentDidUpdate(t,n,r)}))}(e,p,f,v,s)}else e.props=n,e.state=t,e.context=i}var Me=0;function Ee(e,t,n,i){void 0===n&&(n=null),void 0===i&&(i=s),function(e,t,n,i){var a=[],u=t.$V;w.v=!0,r(u)?r(e)||(16384&e.flags&&(e=M(e)),Pe(e,t,i,!1,null,a),t.$V=e,u=e):r(e)?(ge(u,t),t.$V=null):(16384&e.flags&&(e=M(e)),je(u,e,t,i,!1,null,a),u=t.$V=e),v(a),w.v=!1,o(n)&&n(),o(x.renderComplete)&&x.renderComplete(u,t)}(e,t,n,i)}"undefined"!=typeof document&&window.Node&&(Node.prototype.$EV=null,Node.prototype.$V=null);var Fe=[],Ie="undefined"!=typeof Promise?Promise.resolve().then.bind(Promise.resolve()):function(e){window.setTimeout(e,0)},Te=!1;function Ne(e,t,n,i){var a=e.$PS;if(o(t)&&(t=t(a?c(e.state,a):e.state,e.props,e.context)),r(a))e.$PS=t;else for(var u in t)a[u]=t[u];if(e.$BR)o(n)&&e.$L.push(n.bind(e));else{if(!w.v&&0===Fe.length)return Ve(e,i),void(o(n)&&n.call(e));if(-1===Fe.indexOf(e)&&Fe.push(e),Te||(Te=!0,Ie(ze)),o(n)){var l=e.$QU;l||(l=e.$QU=[]),l.push(n)}}}function Le(e){for(var t=e.$QU,n=0;n<t.length;++n)t[n].call(e);e.$QU=null}function ze(){var e;for(Te=!1;e=Fe.shift();)e.$UN||(Ve(e,!1),e.$QU&&Le(e))}function Ve(e,t){if(t||!e.$BR){var n=e.$PS;e.$PS=null;var r=[];w.v=!0,Ue(e,c(e.state,n),e.props,k(e.$LI,!0).parentNode,e.context,e.$SVG,t,null,r),v(r),w.v=!1}else e.state=e.$PS,e.$PS=null}var Be=function(e,t){this.state=null,this.$BR=!1,this.$BS=!0,this.$PS=null,this.$LI=null,this.$UN=!1,this.$CX=null,this.$QU=null,this.$N=!1,this.$L=null,this.$SVG=!1,this.props=e||s,this.context=t||s};Be.prototype.forceUpdate=function(e){this.$UN||Ne(this,{},e,!0)},Be.prototype.setState=function(e,t){this.$UN||this.$BS||Ne(this,e,t,!1)},Be.prototype.render=function(e,t,n){return null},console.warn("You are running production build of Inferno in development mode. Use dev:module entry point.");var Ae=function(e){if(Array.isArray(e))return e};var Re=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}};var We=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var He=function(e,t){if(e){if("string"==typeof e)return We(e,t);var n=Object.prototype.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)?We(e,t):void 0}};var _e=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.")};var Xe=function(e,t){return Ae(e)||Re(e,t)||He(e,t)||_e()};var Qe=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};function Ye(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var Ge=Ye((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t}));var Ke=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)},Je=Ye((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t}));var Ze=function(e,t){return!t||"object"!==Je(t)&&"function"!=typeof t?Qe(e):t},et=Ye((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}));var tt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var rt=function(e,t,n){return t&&nt(e.prototype,t),n&&nt(e,n),e};function it(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=et(e);if(t){var i=et(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ze(this,n)}}var ot=function(){function e(){tt(this,e),this.id=0,this.hookInstances=[]}return rt(e,[{key:"beginRender",value:function(){this.id=0}},{key:"nextId",value:function(){return this.id++}},{key:"createHook",value:function(e){var t=this;return function(n,r){var i,o,a=t.nextId(),u=t.hookInstances[a];if(u&&((i=u.watchList)===(o=r)||Array.isArray(i)&&Array.isArray(o)&&i.length===o.length&&i.every((function(e,t){return e===o[t]}))))return u.value;u&&u.dispose&&u.dispose();var c=e(n);return t.hookInstances[a]={watchList:r,dispose:c.dispose,get value(){return c.value}},c.value}}},{key:"dispose",value:function(){this.hookInstances.forEach((function(e){return e&&e.dispose&&e.dispose()}))}}]),e}(),at=function(e){Ke(n,e);var t=it(n);function n(e,r){var i;tt(this,n),(i=t.call(this,e,r)).tracker=new ot;var o=Qe(i),a=function(e){return o.setState((function(t){return{value:"function"==typeof e?e(t.value):e}}))};return i.hooks={useDisposable:o.tracker.createHook((function(e){return e()})),useMemo:o.tracker.createHook((function(e){return{value:e()}})),useEffect:o.tracker.createHook((function(e){return{dispose:e()}})),useState:o.tracker.createHook((function(t){return o.state={value:"function"==typeof t?t(e):t},{get value(){return[o.state.value,a]}}}))},i}return rt(n,[{key:"componentWillUnmount",value:function(){this.tracker.dispose()}},{key:"render",value:function(){return this.tracker.beginRender(),this.props.render(this.props.props,this.hooks)}}]),n}(Be);function ut(e){return function(t){return j(2,at,{props:t,render:e})}}function ct(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}ct(".quikpik-nav{display:flex}.quikpik-nav-menu{color:#6b7280;margin-right:1.5rem;padding-right:1.5rem;border-right:1px dashed #ddd;display:flex;flex-direction:column;white-space:nowrap;align-items:flex-start}.quikpik-opt{background:transparent;cursor:pointer;border:0;font:inherit;font-size:.875rem;display:inline-flex;color:inherit;align-items:center;margin-bottom:.75rem;border-left:2px solid transparent;padding-left:.5rem;margin-left:-.5rem;text-decoration:none;outline:none;border-radius:0}.quikpik-opt:hover{color:#5a67d8}.quikpik-opt-current{color:#5a67d8;border-color:#5a67d8}.quikpik-opt-ico{margin-right:.75rem;height:1.25rem}.quikpik-nav-mobile-toggle{display:none}@-webkit-keyframes quikpik-menu-in{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes quikpik-menu-in{0%{transform:translateX(100%)}to{transform:translateX(0)}}@media only screen and (max-width:600px){.quikpik-nav-menu{position:absolute;top:0;left:0;bottom:0;right:0;background:#fff;box-shadow:.5rem 0 1rem -.5rem rgba(0,0,0,.5);border:0;padding:2rem;z-index:1;display:flex;margin:0;transform:translateX(100%);z-index:-1;visibility:hidden}.quikpik-nav-flyout{transform:translateY(0);-webkit-animation:quikpik-menu-in .1s ease forwards;animation:quikpik-menu-in .1s ease forwards;z-index:9;visibility:visible}.quikpik-nav-mobile-toggle{display:inline-block;background:transparent;border:none;outline:none;font-size:1rem;position:absolute;right:.5rem;top:.5rem;z-index:10;color:#718096}}");var lt=ut((function(e,t){var n=e.setMode,r=e.sources,i=e.mode,o=t.useState(!1),a=Xe(o,2),u=a[0],c=a[1];if(!(r.length<2))return S(1,"div","quikpik-nav",[S(1,"button","quikpik-nav-mobile-toggle","☰",16,{type:"button",onClick:function(){return c(!u)}}),S(1,"nav","quikpik-nav-menu ".concat(u?"quikpik-nav-flyout":""),[r.includes("filepicker")&&S(1,"button","quikpik-opt ".concat("pickfile"===i?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M20 18.5c0 .276-.224.5-.5.5s-.5-.224-.5-.5.224-.5.5-.5.5.224.5.5zm4-2.5l-5-14h-14l-5 14v6h24v-6zm-17.666-12h11.333l3.75 11h-18.834l3.751-11zm15.666 16h-20v-3h20v3zm-9-6v-5h3l-4-4-4 4h3v5h2z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),D("File picker")],4,{type:"button",onClick:function(){return n("pickfile")}}),r.includes("takephoto")&&S(1,"button","quikpik-opt ".concat("takephoto"===i?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M5 4h-3v-1h3v1zm10.93 0l.812 1.219c.743 1.115 1.987 1.781 3.328 1.781h1.93v13h-20v-13h3.93c1.341 0 2.585-.666 3.328-1.781l.812-1.219h5.86zm1.07-2h-8l-1.406 2.109c-.371.557-.995.891-1.664.891h-5.93v17h24v-17h-3.93c-.669 0-1.293-.334-1.664-.891l-1.406-2.109zm-11 8c0-.552-.447-1-1-1s-1 .448-1 1 .447 1 1 1 1-.448 1-1zm7 0c1.654 0 3 1.346 3 3s-1.346 3-3 3-3-1.346-3-3 1.346-3 3-3zm0-2c-2.761 0-5 2.239-5 5s2.239 5 5 5 5-2.239 5-5-2.239-5-5-5z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),D("Take picture")],4,{type:"button",onClick:function(){return n("takephoto")}}),r.includes("takevideo")&&S(1,"button","quikpik-opt ".concat("takevideo"===i?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M2.184 7.874l-2.184-.918 2.967-2.956.933 2.164-1.716 1.71zm21.816 2.126l-3 2v4l3 2v-8zm-7-2h-7.018l.79.787c.356.355.629.769.831 1.213h4.897c.276 0 .5.224.5.5v7c0 .276-.224.5-.5.5h-11c-.276 0-.5-.224-.5-.5v-2.909l-.018-.014-1.982-1.975v5.398c0 1.104.896 2 2 2h12c1.104 0 2-.896 2-2v-8c0-1.104-.896-2-2-2zm-14.65 1.13l2.967-2.956 4.044 4.029c.819.816.819 2.14 0 2.956-.819.816-2.147.815-2.967 0l-4.044-4.029z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),D("Capture video")],4,{type:"button",onClick:function(){return n("takevideo")}}),r.includes("takeaudio")&&S(1,"button","quikpik-opt ".concat("takeaudio"===i?"quikpik-opt-current":""),[S(32,"svg","quikpik-opt-ico",S(32,"path",null,null,1,{d:"M12 2c1.103 0 2 .897 2 2v7c0 1.103-.897 2-2 2s-2-.897-2-2v-7c0-1.103.897-2 2-2zm0-2c-2.209 0-4 1.791-4 4v7c0 2.209 1.791 4 4 4s4-1.791 4-4v-7c0-2.209-1.791-4-4-4zm8 9v2c0 4.418-3.582 8-8 8s-8-3.582-8-8v-2h2v2c0 3.309 2.691 6 6 6s6-2.691 6-6v-2h2zm-7 13v-2h-2v2h-4v2h10v-2h-4z"}),2,{fill:"currentColor",width:"24",height:"24",viewBox:"0 0 24 24"}),D("Record audio")],4,{type:"button",onClick:function(){return n("takeaudio")}})],0,{onClick:function(){return c(!1)}})],4)}));ct(".quikpik-filepicker{display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:.375rem;padding:2rem;flex-grow:1}.quikpik-drop-target{background:#ebf4ff}.quikpik-icon{color:#9fa6b2;width:3rem;height:3rem}.quikpik-header{color:#161e2e;line-height:1.5rem;font-size:1.125rem;font-weight:500;margin:1.25rem 0 0}.quikpik-text{display:block;color:#6b7280;line-height:1.25rem;max-width:75%;margin:.5rem auto 1.5rem}.quikpik-action{display:block;background:#5a67d8;color:#fff;border:0;padding:.5rem .75rem;font-size:.875rem;border-radius:.375rem;cursor:pointer}.quikpik-action:active,.quikpik-action:focus{outline:none;box-shadow:0 0 0 3px rgba(180,198,252,.45)}.quikpik-input{position:absolute;top:-10000px;left:-10000px;width:1px;overflow:hidden;z-index:1}");ct(".quikpik-confirm-wrapper{max-width:100%;max-height:100%;width:100%}.quikpik-confirm-wrapper,.quikpik-img-wrapper{display:flex;flex-grow:1;align-items:center;justify-content:center;flex-direction:column}.quikpik-img-wrapper{max-width:90%;max-height:90%}.quikpik-confirm-item{max-width:100%;max-height:100%}.quikpik-media-rotate svg{height:.9rem;margin-right:.5rem}.quikpik-media-accept,.quikpik-media-retake,.quikpik-media-rotate{display:inline-flex;align-items:center;justify-content:center;background:#5a67d8;color:#fff;border:0;padding:.5rem .75rem;font-size:.875rem;border-radius:.375rem;cursor:pointer;margin:0 .25rem;outline:none}.quikpik-media-retake,.quikpik-media-rotate{border:1px solid;background:transparent;color:inherit}");var st=ut((function(e,t){var n=e.file,r=e.cancelText,i=e.confirmText,o=e.onCancel,a=e.onConfirm,u=t.useDisposable((function(){var e=URL.createObjectURL(n);return{value:e,dispose:function(){return URL.revokeObjectURL(e)}}}),n),c=n.type.startsWith("image/")&&function(e){var t=0,n=void 0,r=!1,i=new Image;function o(e,t,n){if(t&&r){var i=t.width;t.width=t.height,t.height=i;var o=t.getContext("2d");o.translate(t.width/2,t.height/2),o.rotate(n*Math.PI/180),o.drawImage(e,-e.width/2,-e.height/2),o.rotate(-n*Math.PI/180),o.translate(-t.width/2,-t.height/2)}}return i.addEventListener("load",(function(){r=!0,n.width=i.width,n.height=i.height,o(i,n,t)})),i.addEventListener("error",(function(){return alert("Failed to load image.")})),i.src=e,{setCanvas(e){e&&!e.$rotater&&((n=e).$rotater=!0,o(i,n,t))},save(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return t?new Promise((function(t){return n.toBlob(t,e,r)})):Promise.resolve(blob)},rotate(){o(i,n,t=(t+90)%360)}}}(u);return S(1,"div","quikpik-confirm-wrapper",[c?S(1,"div","quikpik-img-wrapper",S(1,"canvas","quikpik-confirm-item",null,1,null,null,(function(e){return c.setCanvas(e)})),2):S(1,"div","quikpik-vid-wrapper",S(1,"video","quikpik-vid",null,1,{src:u,muted:!1,controls:!0}),2),S(1,"footer","quikpik-media-footer",[c&&S(1,"button","quikpik-media-rotate",[S(32,"svg",null,S(32,"path",null,null,1,{d:"M12 0c3.31 0 6.291 1.353 8.459 3.522l2.48-2.48 1.061 7.341-7.437-.966 2.489-2.489c-1.808-1.807-4.299-2.928-7.052-2.928-5.514 0-10 4.486-10 10s4.486 10 10 10c3.872 0 7.229-2.216 8.89-5.443l1.717 1.046c-2.012 3.803-6.005 6.397-10.607 6.397-6.627 0-12-5.373-12-12s5.373-12 12-12z"}),2,{viewBox:"0 0 24 24",fill:"currentColor"}),D("Rotate")],4,{onClick:function(){return c.rotate()}}),S(1,"button","quikpik-media-retake",r,0,{onClick:o}),S(1,"button","quikpik-media-accept",i,0,{onClick:function(){c||a(n),c.save().then((function(e){e.name=n.name,a(e)}))}})],0)],0)})),ft=ut((function(e,t){var n=e.uploadFile,r=t.useState({isDropTarget:!1}),i=Xe(r,2),o=i[0],a=o.isDropTarget,u=o.imgFile,c=i[1];function l(e){e.clipboardData&&e.clipboardData.files&&e.clipboardData.files.length&&n(e.clipboardData.files[0])}function s(){c({isDropTarget:!1})}return t.useEffect((function(){return document.addEventListener("paste",l),function(){return document.removeEventListener("paste",l)}})),u?j(2,st,{file:u,cancelText:"Cancel",confirmText:"Upload",onCancel:function(){return c({isDropTarget:!1})},onConfirm:n}):S(1,"div","quikpik-filepicker ".concat(a?"quikpik-drop-target":""),[S(32,"svg","quikpik-icon",S(32,"path",null,null,1,{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),2,{stroke:"currentColor",fill:"none",viewBox:"0 0 48 48"}),S(1,"h2","quikpik-header","Upload a file",16),S(1,"div","quikpik-instructions",[S(1,"span","quikpik-text","Drag or paste a file here, or click to choose a file from your computer.",16),S(1,"label","quikpik-action",[D("Choose File"),S(64,"input","quikpik-input",null,1,{type:"file",onChange:function(e){var t=e.target.files[0];"image/gif"!==t.type&&t.type.startsWith("image/")?c({isDropTarget:!1,imgFile:t}):n(t)}})],4)],4)],4,{onDragover:function(e){e.preventDefault(),c({isDropTarget:!0})},onDragend:s,onDrop:function(e){e.preventDefault(),e.stopPropagation(),n(e.dataTransfer.files&&e.dataTransfer.files[0]),s()}})}));function pt(e){var t=Date.now()-e,n=Math.floor(t/1e3)%60,r=Math.floor(n/60)%60,i=Math.floor(r/60);return"".concat(i?i+":":"").concat(r.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))}ct(".quikpik-elapsed-time{position:absolute;left:calc(50% + 2.75rem);top:50%;margin-top:-.5rem;line-height:1;opacity:.8}");var dt=ut((function(e,t){var n=t.useMemo((function(){return Date.now()})),r=t.useState(pt(n)),i=Xe(r,2),o=i[0],a=i[1];return t.useEffect((function(){var e=setTimeout((function t(){a(pt(n)),e=setTimeout(t,1e3)}),1e3);return function(){return clearTimeout(e)}})),S(1,"span","quikpik-elapsed-time",[D("Recording "),o],0)}));function ht(e){var t=e.recorder;return S(1,"div","quikpik-vid-wrapper",S(1,"video","quikpik-vid",null,1,null,null,(function(e){e&&!e.$autoplay&&(e.srcObject=t.liveSrc(),e.muted=!0,e.controls=!1,e.play())})),2)}function vt(e){var t=(e.video?["video/mpeg","video/webm"]:["audio/mpeg","audio/webm","audio/ogg","audio/wav"]).filter((function(e){return MediaRecorder.isTypeSupported(e)})),n=Xe(t,1)[0];if(!n)throw new Error("No supported mime type found.");return n}function mt(e){return e.name="your".concat(e.type.replace("/",".")),e}ct(".quikpik-vid-wrapper{position:relative;width:100%;flex-grow:1}.quikpik-vid{position:absolute;height:100%;width:100%;margin:auto;left:50%;transform:translateX(-50%);border-radius:2px;outline:none}"),function(){if(!window.ImageCapture){var e=document.createElement("script");e.src="https://unpkg.com/browse/image-capture@0.4.0/lib/imagecapture.min.js",document.head.appendChild(e)}}();function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?kt(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}ct('.quikpik-media{box-sizing:border-box;flex-grow:1;flex-direction:column;background:#1a202c;color:#fff;border-radius:.375rem}.quikpik-media,.quikpik-media-footer{display:flex;justify-content:center;align-items:center;padding:1rem}.quikpik-media-footer{position:relative;width:100%}.quikpik-snap-photo{background:#fff}.quikpik-record-media,.quikpik-snap-photo,.quikpik-stop-media{cursor:pointer;box-shadow:inset 0 0 0 2px;border:4px solid #fff;width:3rem;height:3rem;border-radius:100%;outline:none}.quikpik-record-media,.quikpik-stop-media{position:relative;display:inline-flex;align-items:center;justify-content:center;background:red}.quikpik-stop-media{background:transparent}.quikpik-stop-media:before{content:"";background:red;height:1.5rem;width:1.5rem;border-radius:2px}.quikpik-snap-photo:focus{box-shadow:inset 0 0 0 4px}.quikpik-info{color:#6b7280;display:flex;align-items:center;justify-content:center}');var bt=ut((function(e,t){var n=e.mode,r=e.uploadFile,i=t.useState({status:"init",error:void 0,recorder:void 0,recorderMode:void 0,file:void 0}),o=Xe(i,2),a=o[0],u=a.status,c=a.error,l=a.recorder,s=a.recorderMode,f=a.file,p=o[1];function d(e){console.error(e),p((function(e){return gt(gt({},e),{},{status:"error",error:"Unable to connect to your camera."})}))}return t.useEffect((function(){(function(e){var t,n,r=[];function i(e){e.data.size>0?r.push(e.data):console.error("No data",e)}function o(){return t}function a(){var e=t.getVideoTracks()[0];return new ImageCapture(e).takePhoto().then(mt)}function u(){r=[],(n=new MediaRecorder(t,{mimeType:vt(e)})).ondataavailable=i,n.start()}function c(){return new Promise((function(t,i){n.onstop=function(){try{var n=new Blob(r,{type:vt(e)});t(mt(n))}catch(e){i(e)}},n.stop()}))}return navigator.mediaDevices.getUserMedia(e).then((function(e){return t=e,{liveSrc:o,capturePhoto:a,beginMediaCapture:u,endMediaCapture:c}}))})({video:"takeaudio"!==n,audio:!0}).then((function(e){p((function(t){return gt(gt({},t),{},{status:"live",recorder:e,recorderMode:n})}))})).catch(d)}),n),S(1,"div","quikpik-media",["error"===u&&S(1,"p","quikpik-error",c,0),"init"===u&&S(1,"p","quikpik-info","Waiting for your camera or microphone to be ready.",16),("live"===u||"recording"===u)&&"takeaudio"!==n&&j(2,ht,{recorder:l}),"live"===u&&"takeaudio"===n&&S(1,"p","quikpik-info","Click the red button to begin recording.",16),"live"===u&&S(1,"footer","quikpik-media-footer",S(1,"button","quikpik-snap-photo ".concat("takephoto"!==n?"quikpik-record-media":""," ").concat("recording"===u?"quikpik-stop-media":""),null,1,{disabled:s!==n,onClick:function(){"takephoto"===n?l.capturePhoto().then((function(e){p((function(t){return gt(gt({},t),{},{file:e,status:"confirm"})}))})).catch(d):(l.beginMediaCapture(),p((function(e){return gt(gt({},e),{},{status:"recording"})})))}}),2),"recording"===u&&S(1,"footer","quikpik-media-footer",[S(1,"button","quikpik-stop-media",null,1,{onClick:function(){l.endMediaCapture().then((function(e){p((function(t){return gt(gt({},t),{},{file:e,status:"confirm"})}))})).catch(d)}}),j(2,dt)],4),"confirm"===u&&j(2,st,{file:f,onCancel:function(){p((function(e){return gt(gt({},e),{},{status:"live",file:void 0})}))},onConfirm:function(){r(f)},cancelText:"Retake",confirmText:"Accept & upload"})],0)}));function yt(e){var t=e.file,n=e.progress;return S(1,"div","quikpik-progress",[S(1,"span","quikpik-progress-text",[S(1,"span","quikpik-filename",[D("Uploading "),t.name||""],0),S(1,"span","quikpik-percent",[Math.round(n),D("%")],0)],4),S(1,"span","quikpik-progress-bar-wrapper",S(1,"span","quikpik-progress-bar ".concat(n>=100?"quikpik-done-bar":""),null,1,{style:{width:"".concat(n,"%")}}),2)],4)}ct(".quikpik-progress{width:100%}.quikpik-progress-text{display:flex;justify-content:space-between;color:#6b7280;line-height:1.25rem;margin:.5rem auto}.quikpik-progress-bar,.quikpik-progress-bar-wrapper{display:block;background:#c3dafe;height:8px;border-radius:4px}.quikpik-progress-bar{background:#667eea;width:0;transition:width .25s,background-color .5s}.quikpik-done-bar{background:#48bb78}");function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?wt(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}ct('.quikpik{position:fixed;max-height:100vh;display:flex;align-items:center;justify-content:center;font-family:Inter var,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.quikpik,.quikpik:before{top:0;left:0;right:0;bottom:0;z-index:10000}.quikpik:before{content:"";position:absolute;background:#6b7280;opacity:.75}@-webkit-keyframes quikpik-up{0%{opacity:0;transform:translateY(4rem)}to{opacity:1;transform:translateY(0)}}@keyframes quikpik-up{0%{opacity:0;transform:translateY(4rem)}to{opacity:1;transform:translateY(0)}}.quikpik-body{position:relative;background:#fff;padding:1.5rem;border-radius:.5rem;text-align:center;font-size:.875rem;z-index:10001;width:calc(100vw - 5rem);height:calc(100vh - 5rem);max-width:1024px;max-height:780px;box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);outline:none;-webkit-animation:quikpik-up .25s ease forwards;animation:quikpik-up .25s ease forwards;display:flex;overflow:hidden}@media only screen and (max-width:600px){.quikpik-body{padding:0;width:calc(100% - 2rem);height:calc(100% - 2rem)}}.quikpik-body-fit{height:auto;max-width:24rem;padding:1.5rem}');var qt=ut((function(e,t){var n=t.useState({mode:"pickfile",file:void 0,uploader:void 0,progress:0}),r=Xe(n,2),i=r[0],o=i.mode,a=i.uploader,u=i.file,c=i.progress,l=r[1],s=e.customProgress,f=e.close,p=e.upload,d=e.sources,h=function(e){return l((function(t){return xt(xt({},t),{},{progress:e})}))};function v(e){"Escape"!==e.key&&"Escape"!==e.code||f()}function m(e){if(e){var t=p({file:e,onProgress:h});l((function(n){return xt(xt({},n),{},{file:e,uploader:t})})),t.promise.then((function(){return setTimeout(f,750)})).catch((function(e){e&&0!==e.status&&alert("Upload failed. "+(e.message||""))}))}}if(t.useEffect((function(){return window.addEventListener("keydown",v),function(){return window.removeEventListener("keydown",v)}})),!s||!a)return S(1,"div","quikpik",S(1,"div","quikpik-body ".concat(a?"quikpik-body-fit":""),[a&&j(2,yt,{progress:c,file:u}),!a&&j(2,lt,{mode:o,setMode:function(e){return l((function(t){return xt(xt({},t),{},{mode:e})}))},sources:d}),!a&&"pickfile"===o&&j(2,ft,{uploadFile:m}),!a&&"pickfile"!==o&&j(2,bt,{uploadFile:m,mode:o})],0,{onClick:function(e){return e.stopPropagation()},onTouchEnd:function(e){return e.stopPropagation()}}),2,{onClick:f,onTouchEnd:f})}));function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Ct(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Pt,Ot=(Pt=!!window.MediaRecorder,{filepicker:!0,takephoto:!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),takevideo:Pt,takeaudio:Pt});return function(e){var t=document.createElement("div"),n={close:o,uploader:void 0},i=(e.sources||["filepicker","takephoto","takevideo","takeaudio"]).filter((function(e){return Ot[e]}));function o(){n.uploader&&n.uploader.cancel(),t.remove()}return document.body.appendChild(t),Ee(function(e){var t=e.props;if(t){var n=e.flags;481&n&&(void 0!==t.children&&r(e.children)&&I(e,t.children),void 0!==t.className&&(e.className=t.className||null,t.className=void 0)),void 0!==t.key&&(e.key=t.key,t.key=void 0),void 0!==t.ref&&(e.ref=8&n?c(e.ref,t.ref):t.ref,t.ref=void 0)}return e}(j(2,qt,$t($t({},e),{},{sources:i,close:o,upload:function(){return n.uploader=e.upload.apply(e,arguments),n.uploader}}))),t),{close:o}}})); | ||
//# sourceMappingURL=quikpik.js.map |
{ | ||
"name": "quikpik", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"scripts": { | ||
@@ -8,3 +8,3 @@ "prepublishOnly": "npm run build", | ||
"dev": "rollup -c -w", | ||
"start": "sirv public --host 0.0.0.0 --port 3000", | ||
"start": "sirv public --dev --host 0.0.0.0 --port 3000", | ||
"test": "jest lib" | ||
@@ -11,0 +11,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
213047
173