>o]++;return s}(e,t),c=1;c0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}}},t.f=function(e,t){var r=n(e);return function(e,t,r){r||(r=e);for(var n=e.data,o=n.length,s=r.data;o--;)s[o]=n[o]l)for((s=c[a]).score=o,s.item=e[n],l=Number.MAX_VALUE,i=0;i0&&(r=Math.abs(e[t]-h)>Math.abs(e[t-1]-h)?e[t-1]:e[t]),h/rc[d-1]/c[d]?{x:r,y:r}:null}var n,s=o(t.x),i=o(t.y),a=Math.max(t.x,t.y),l=function(e,t){for(var r=0,n=0,o=[];rt[n]?n++:r++;return o}(s,i),c=[8,10,15,20,32,60,80],u={"x-small":5,small:4,medium:3,large:2,"x-large":1},d=u[e]||u.medium,p=c[d],h=Math.floor(a/p);return(n=r(l))||(n=r(o(a)))||(n=r(o(h*p))),n},t.j=function(e,t,r){var n={width:e,height:t},o=Object.keys(r).reduce((function(e,t){var o=function(e){return{value:parseFloat(e),unit:(e.indexOf("%"),e.length,"%")}}(r[t]),s=c[t](o,n);return e[t]=s,e}),{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}};var a={clone:r(7)},l={clone:r(83)},c={top:function(e,t){if("%"===e.unit)return Math.floor(t.height*(e.value/100))},right:function(e,t){if("%"===e.unit)return Math.floor(t.width-t.width*(e.value/100))},bottom:function(e,t){if("%"===e.unit)return Math.floor(t.height-t.height*(e.value/100))},left:function(e,t){if("%"===e.unit)return Math.floor(t.width*(e.value/100))}}},function(e,t,r){"use strict";function n(e,t,r,n){t?this.data=t:r?(this.data=new r(e.x*e.y),r===Array&&n&&i.a.init(this.data,0)):(this.data=new Uint8Array(e.x*e.y),Uint8Array===Array&&n&&i.a.init(this.data,0)),this.size=e}var o=r(53),s=r(19),i=r(3),a={clone:r(7)};n.prototype.inImageWithBorder=function(e,t){return e.x>=t&&e.y>=t&&e.x0&&((i=g[n-1]).m00+=1,i.m01+=r,i.m10+=t,i.m11+=t*r,i.m02+=o,i.m20+=t*t);for(s=0;s=0?k:-k)+v,i.theta=(180*d/v+90)%180-90,i.theta<0&&(i.theta+=180),i.rad=d>v?d-v:d,i.vec=a.clone([Math.cos(d),Math.sin(d)]),f.push(i));return f},n.prototype.show=function(e,t){var r,n,o,s,i,a,l;for(t||(t=1),r=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,o=(n=r.getImageData(0,0,e.width,e.height)).data,s=0,l=0;l360)&&(t=360);for(var o=[0,1,1],i=[0,0,0],a=[255,255,255],l=[0,0,0],c=[],u=e.getContext("2d"),d=u.getImageData(n.x,n.y,this.size.x,this.size.y),p=d.data,h=this.data.length;h--;)o[0]=this.data[h]*t,c=o[0]<=0?a:o[0]>=360?l:r.i(s.a)(o,i),p[4*h+0]=c[0],p[4*h+1]=c[1],p[4*h+2]=c[2],p[4*h+3]=255;u.putImageData(d,n.x,n.y)},t.a=n},function(e,t,r){var n=r(37);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t,r){var n=r(97),o=r(120);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},function(e,t,r){var n=r(27),o=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t,r){var n=r(25),o=r(26);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(8),o=r(0),s="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",l="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=n(e);return t==i||t==a||t==s||t==l}},function(e,t){var r=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}},function(e,t,r){var n=r(8),o=r(6),s="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&n(e)==s}},function(e,t,r){var n=r(100),o=r(116)((function(e,t,r){n(e,t,r)}));e.exports=o},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";t.a={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(e,t){function r(e,t,r,n){var o,u,d;for(o=0;o<7;o++){if(u=e.cy+l[e.dir][0],d=e.cx+l[e.dir][1],i[s=u*c+d]===t&&(0===a[s]||a[s]===r))return a[s]=r,e.cy=u,e.cx=d,!0;0===a[s]&&(a[s]=n),e.dir=(e.dir+1)%8}return!1}function n(e,t,r){return{dir:r,x:e,y:t,next:null,prev:null}}function o(e,t,o,s,i){var a,l,c,u=null,d={cx:t,cy:e,dir:0};if(r(d,s,o,i)){a=u=n(t,e,d.dir),c=d.dir,(l=n(d.cx,d.cy,0)).prev=a,a.next=l,l.next=null,a=l;do{d.dir=(d.dir+6)%8,r(d,s,o,i),c!==d.dir?(a.dir=d.dir,(l=n(d.cx,d.cy,0)).prev=a,a.next=l,l.next=null,a=l):(a.dir=c,a.x=d.cx,a.y=d.cy),c=d.dir}while(d.cx!==t||d.cy!==e);u.prev=a.prev,a.prev.next=u}return u}var s,i=e.data,a=t.data,l=this.searchDirections,c=e.size.x;return{trace:function(e,t,n,o){return r(e,t,n,o)},contourTracing:function(e,t,r,n,s){return o(e,t,r,n,s)}}}}},function(e,t,r){"use strict";function n(){o.a.call(this)}var o=r(1),s=r(3);n.prototype=Object.create(o.a.prototype,{ALPHABETH_STRING:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,45,46,32,42,36,47,43,37]},CHARACTER_ENCODINGS:{value:[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]},ASTERISK:{value:148},FORMAT:{value:"code_39",writeable:!1}}),n.prototype.constructor=n,n.prototype._decode=function(){var e,t,r,n,o=this,i=[0,0,0,0,0,0,0,0,0],a=[],l=o._findStart();if(!l)return null;n=o._nextSet(o._row,l.end);do{if(i=o._toCounters(n,i),(r=o._toPattern(i))<0)return null;if((e=o._patternToChar(r))<0)return null;a.push(e),t=n,n+=s.a.sum(i),n=o._nextSet(o._row,n)}while("*"!==e);return a.pop(),a.length&&o._verifyTrailingWhitespace(t,n,i)?{code:a.join(""),start:l.start,end:n,startInfo:l,decodedCodes:a}:null},n.prototype._verifyTrailingWhitespace=function(e,t,r){var n=s.a.sum(r);return 3*(t-e-n)>=n},n.prototype._patternToChar=function(e){var t,r=this;for(t=0;tt&&(n=e[r]);return n},n.prototype._toPattern=function(e){for(var t,r,n=e.length,o=0,s=n,i=0;s>3;){for(o=this._findNextWidth(e,o),s=0,t=0,r=0;ro&&(t|=1<0;r++)if(e[r]>o&&(s--,2*e[r]>=i))return-1;return t}}return-1},n.prototype._findStart=function(){var e,t,r,n=this,o=n._nextSet(n._row),s=o,i=[0,0,0,0,0,0,0,0,0],a=0,l=!1;for(e=o;e0)for(r=0;r0){if(!(e=I.filter((function(e){return!e.busy}))[0]))return;m.attachData(e.imageData)}else m.attachData(C.data);m.grab()&&(e?(e.busy=!0,e.worker.postMessage({cmd:"process",imageData:e.imageData},[e.imageData.buffer])):d())}else d()}function h(){U&&"LiveStream"===F.inputStream.type?function(){var e=null,t=1e3/(F.frequency||60);y=!1,function r(n){e=e||n,y||(n>=e&&(e+=t,p()),window.requestAnimFrame(r))}(performance.now())}():p()}function w(e){var t,r={worker:void 0,imageData:new Uint8Array(x.getWidth()*x.getHeight()),busy:!0};t=v(),r.worker=new Worker(t),r.worker.onmessage=function(n){if("initialized"===n.data.event)return URL.revokeObjectURL(t),r.busy=!1,r.imageData=new Uint8Array(n.data.imageData),e(r);"processed"===n.data.event?(r.imageData=new Uint8Array(n.data.imageData),r.busy=!1,u(n.data.result,r.imageData)):n.data.event},r.worker.postMessage({cmd:"init",size:{x:x.getWidth(),y:x.getHeight()},imageData:r.imageData,config:g(F)},[r.imageData.buffer])}function g(e){return T({},e,{inputStream:T({},e.inputStream,{target:null})})}function f(e){function t(e){self.postMessage({event:"processed",imageData:o.data,result:e},[o.data.buffer])}function r(){self.postMessage({event:"initialized",imageData:o.data},[o.data.buffer])}if(e){var n=e().default;if(!n)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var o;self.onmessage=function(e){if("init"===e.data.cmd){var s=e.data.config;s.numOfWorkers=0,o=new n.ImageWrapper({x:e.data.size.x,y:e.data.size.y},new Uint8Array(e.data.imageData)),n.init(s,r,o),n.onProcessed(t)}else"process"===e.data.cmd?(o.data=new Uint8Array(e.data.imageData),n.start()):"setReaders"===e.data.cmd&&n.setReaders(e.data.readers)}}function v(){var t,r;return void 0!==e&&(r=e),t=new Blob(["("+f.toString()+")("+r+");"],{type:"text/javascript"}),window.URL.createObjectURL(t)}function k(e,t){var r=e-I.length;if(0===r)return t&&t();if(r<0)return I.slice(r).forEach((function(e){e.worker.terminate()})),I=I.slice(0,r),t&&t();for(var n=function(r){I.push(r),I.length>=e&&t&&t()},o=0;o0&&I.forEach((function(t){t.worker.postMessage({cmd:"setReaders",readers:e})}))}(e)},registerResultCollector:function(e){e&&"function"==typeof e.addResult&&(A=e)},canvas:D,decodeSingle:function(e,t){var r=this;e=Z()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:e.src},numOfWorkers:1,locator:{halfSample:!1}},e),this.init(e,(function(){B.a.once("processed",(function(e){r.stop(),t.call(null,e)}),!0),h()}))},ImageWrapper:V.a,ImageDebug:E.a,ResultCollector:z.a,CameraAccess:_.a}},function(e,t,r){"use strict";var n=r(9);t.a={create:function(e){function t(t){return i&&t&&!function(e,t){return!!t&&t.some((function(t){return Object.keys(t).every((function(r){return t[r]===e[r]}))}))}(t,e.blacklist)&&function(e,t){return"function"!=typeof t||t(e)}(t,e.filter)}var r=document.createElement("canvas"),o=r.getContext("2d"),s=[],i=e.capacity||20,a=!0===e.capture;return{addResult:function(e,l,c){var u={};t(c)&&(i--,u.codeResult=c,a&&(r.width=l.x,r.height=l.y,n.a.drawImage(e,l,o),u.frame=r.toDataURL()),s.push(u))},getResults:function(){return s}}}}},function(e,t,r){"use strict";var n={clone:r(7),dot:r(32)};t.a={create:function(e,t){function r(e){a[e.id]=e,s.push(e)}function o(){var e,t=0;for(e=0;et},getPoints:function(){return s},getCenter:function(){return i}}},createPoint:function(e,t,r){return{rad:e[r],point:e,id:t}}}},function(e,t,r){"use strict";t.a=function(){function e(e){return o[e]||(o[e]={subscribers:[]}),o[e]}function t(){o={}}function r(e,t){e.async?setTimeout((function(){e.callback(t)}),4):e.callback(t)}function n(t,r,n){var o;if("function"==typeof r)o={callback:r,async:n};else if(!(o=r).callback)throw"Callback was not specified on options";e(t).subscribers.push(o)}var o={};return{subscribe:function(e,t,r){return n(e,t,r)},publish:function(t,n){var o=e(t),s=o.subscribers;s.filter((function(e){return!!e.once})).forEach((function(e){r(e,n)})),o.subscribers=s.filter((function(e){return!e.once})),o.subscribers.forEach((function(e){r(e,n)}))},once:function(e,t,r){n(e,{callback:t,async:r,once:!0})},unsubscribe:function(r,n){var o;r?(o=e(r)).subscribers=o&&n?o.subscribers.filter((function(e){return e.callback!==n})):[]:t()}}}()},function(e,t,r){"use strict";t.b=function(){return navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():Promise.reject(new Error("enumerateDevices is not defined"))},t.a=function(e){return navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e):Promise.reject(new Error("getUserMedia is not defined"))}},function(e,t,r){"use strict";function n(e,t,r){r||(r={data:null,size:t}),this.data=r.data,this.originalSize=r.size,this.I=r,this.from=e,this.size=t}n.prototype.show=function(e,t){var r,n,o,s,i,a,l;for(t||(t=1),r=e.getContext("2d"),e.width=this.size.x,e.height=this.size.y,o=(n=r.getImageData(0,0,e.width,e.height)).data,s=0,i=0;i>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},"function"!=typeof Object.assign&&(Object.assign=function(e){"use strict";if(null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r1&&(!t.inImageWithBorder(e[0],0)||!t.inImageWithBorder(e[1],0));)o(-(n-=Math.ceil(n/2)));return e}function s(e){var r,o=null,s=n.a.getBarcodeLine(t,e[0],e[1]);for(n.a.toBinaryLine(s),r=0;ry?d:y,v.push(d)}var o,s,i,a,l,c,u,d,p=0|t.x,h=0|t.y,w=0|r.x,g=0|r.y,f=Math.abs(g-h)>Math.abs(w-p),v=[],k=e.data,x=e.size.x,m=255,y=0;for(f&&(c=p,p=h,h=c,c=w,w=g,g=c),p>w&&(c=p,p=w,w=c,c=h,h=g,g=c),o=w-p,s=Math.abs(g-h),i=o/2|0,l=h,a=hd?o.UP:o.DOWN,p.push({pos:0,val:u[0]}),i=0;ih&&u[i+1]>.5*d?o.UP:n)&&(p.push({pos:i,val:u[i]}),n=s);for(p.push({pos:u.length,val:u[u.length-1]}),a=p[0].pos;ad?0:1;for(i=1;i
p[i].val?p[i].val+(p[i+1].val-p[i].val)/3*2|0:p[i+1].val+(p[i].val-p[i+1].val)/3|0,a=p[i].pos;ah?0:1;return{line:u,threshold:h}},n.debug={printFrequency:function(e,t){var r,n=t.getContext("2d");for(t.width=e.length,t.height=256,n.beginPath(),n.strokeStyle="blue",r=0;r0?e.videoWidth>10&&e.videoHeight>10?t():window.setTimeout(o,500):r("Unable to play video stream. Is webcam working?"),n--}()}))}function o(e,t){return r.i(u.a)(t).then((function(t){return new Promise((function(r){a=t,e.setAttribute("autoplay",!0),e.setAttribute("muted",!0),e.setAttribute("playsinline",!0),e.srcObject=t,e.addEventListener("loadedmetadata",(function(){e.play(),r()}))}))})).then(n.bind(null,e))}function s(e){var t=c()(e,["width","height","facingMode","aspectRatio","deviceId"]);return void 0!==e.minAspectRatio&&e.minAspectRatio>0&&(t.aspectRatio=e.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),void 0!==e.facing&&(t.facingMode=e.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),t}function i(){if(a){var e=a.getVideoTracks();if(e&&e.length)return e[0]}}var a,l=r(162),c=r.n(l),u=r(52);t.a={request:function(e,t){return function(e){var t={audio:!1,video:s(e)};return t.video.deviceId&&t.video.facingMode&&delete t.video.facingMode,Promise.resolve(t)}(t).then(o.bind(null,e))},release:function(){var e=a&&a.getVideoTracks();e&&e.length&&e[0].stop(),a=null},enumerateVideoDevices:function(){return r.i(u.b)().then((function(e){return e.filter((function(e){return"videoinput"===e.kind}))}))},getActiveStreamLabel:function(){var e=i();return e?e.label:""},getActiveTrack:i}},function(e,t,r){"use strict";function n(e){return new Promise((function(t){var r=new FileReader;r.onload=function(e){return t(e.target.result)},r.readAsArrayBuffer(e)}))}function o(e,t,r){if("Exif"!==function(e,t,r){for(var n="",o=t;o1&&void 0!==arguments[1]?arguments[1]:a;return/^blob\:/i.test(e)?function(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onreadystatechange=function(){n.readyState!==XMLHttpRequest.DONE||200!==n.status&&0!==n.status||t(this.response)},n.onerror=r,n.send()}))}(e).then(n).then((function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=new DataView(e),n=e.byteLength,s=t.reduce((function(e,t){var r=Object.keys(i).filter((function(e){return i[e]===t}))[0];return r&&(e[r]=t),e}),{}),l=2;if(255!==r.getUint8(0)||216!==r.getUint8(1))return!1;for(;l1?s.size:Math.floor(t/o*s.size):t,n=s.size?t/o>1?Math.floor(o/t*s.size):s.size:o,c.x=r,c.y=n}var r,n,o={},s=null,i=["canrecord","ended"],a={},l={x:0,y:0},c={x:0,y:0};return o.getRealWidth=function(){return e.videoWidth},o.getRealHeight=function(){return e.videoHeight},o.getWidth=function(){return r},o.getHeight=function(){return n},o.setWidth=function(e){r=e},o.setHeight=function(e){n=e},o.setInputStream=function(t){s=t,e.src=void 0!==t.src?t.src:""},o.ended=function(){return e.ended},o.getConfig=function(){return s},o.setAttribute=function(t,r){e.setAttribute(t,r)},o.pause=function(){e.pause()},o.play=function(){e.play()},o.setCurrentTime=function(t){"LiveStream"!==s.type&&(e.currentTime=t)},o.addEventListener=function(t,r,n){-1!==i.indexOf(t)?(a[t]||(a[t]=[]),a[t].push(r)):e.addEventListener(t,r,n)},o.clearEventHandlers=function(){i.forEach((function(t){var r=a[t];r&&r.length>0&&r.forEach((function(r){e.removeEventListener(t,r)}))}))},o.trigger=function(e,r){var n,s=a[e];if("canrecord"===e&&t(),s&&s.length>0)for(n=0;n1?i.size:Math.floor(a/l*i.size):a,o=i.size?a/l>1?Math.floor(l/a*i.size):i.size:l,m.x=r,m.y=o,d=!0,c=0,setTimeout((function(){t("canrecord",[])}),0)}),w,h,i.sequence)}function t(e,t){var r,n=k[e];if(n&&n.length>0)for(r=0;rd&&(d=o.box[n][0]),o.box[n][1]p&&(p=o.box[n][1]);for(i=[[c,u],[d,u],[d,p],[c,p]],a=l.halfSample?2:1,s=Z.invert(s,s),n=0;n<4;n++)j.transformMat2(i[n],i[n],s);for(n=0;n<4;n++)j.scale(i[n],i[n],a);return i}function s(e){var t=r.i(y.g)(e,.9),n=r.i(y.h)(t,1,(function(e){return e.getPoints().length})),o=[],s=[];if(1===n.length){o=n[0].item.getPoints();for(var i=0;i=2){for(o=0;op&&c.push(e[o]);if(c.length>=2){for(a=s(c),i=0,o=0;o1&&a.length>=c.length/4*3&&a.length>e.length/4&&(i/=a.length,l={index:t[1]*V.x+t[0],pos:{x:r,y:n},box:[j.clone([r,n]),j.clone([r+d.size.x,n]),j.clone([r+d.size.x,n+d.size.y]),j.clone([r,n+d.size.y])],moments:a,rad:i,vec:j.clone([Math.cos(i),Math.sin(i)])},u.push(l))}}return u}var l,c,u,d,p,h,w,g,f,v,k,x,m=r(20),y=r(19),C=r(3),b=(r(9),r(65)),M=r(30),A=r(66),j={clone:r(7),dot:r(32),scale:r(81),transformMat2:r(82)},Z={copy:r(78),create:r(79),invert:r(80)},H={ctx:{binary:null},dom:{binary:null}},V={x:0,y:0};t.a={init:function(e,t){l=t,k=e,n(),l.useWorker||"undefined"==typeof document||(H.dom.binary=document.createElement("canvas"),H.dom.binary.className="binaryBuffer",H.ctx.binary=H.dom.binary.getContext("2d"),H.dom.binary.width=f.size.x,H.dom.binary.height=f.size.y)},locate:function(){var e,t;if(l.halfSample&&r.i(y.i)(k,c),r.i(y.f)(c,f),f.zeroBorder(),e=function(){var e,t,r,n,o,s,l=[];for(e=0;ei&&r(a):w.data[a]=Number.MAX_VALUE}var n,o,s=0,i=.95,a=0;for(C.a.init(h.data,0),C.a.init(w.data,0),C.a.init(g.data,null),n=0;n0&&n[w.data[r]-1]++;return n=n.map((function(e,t){return{val:e,label:t+1}})),n.sort((function(e,t){return t.val-e.val})),n.filter((function(e){return e.val>=5}))}(n),0===t.length?null:function(e,t){var r,n,s,i,a=[],l=[];for(r=0;r0){i=i-1|0;n[r+i|0]=(n[e+i|0]|0)-(n[t+i|0]|0)|0}}function l(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;i=s(o,o)|0;while((i|0)>0){i=i-1|0;n[r+i|0]=n[e+i|0]|0|(n[t+i|0]|0)|0}}function c(e){e=e|0;var t=0,r=0;r=s(o,o)|0;while((r|0)>0){r=r-1|0;t=(t|0)+(n[e+r|0]|0)|0}return t|0}function u(e,t){e=e|0;t=t|0;var r=0;r=s(o,o)|0;while((r|0)>0){r=r-1|0;n[e+r|0]=t}}function d(e,t){e=e|0;t=t|0;var r=0,s=0,i=0,a=0,l=0,c=0,u=0,d=0;for(r=1;(r|0)<(o-1|0);r=r+1|0){d=d+o|0;for(s=1;(s|0)<(o-1|0);s=s+1|0){a=d-o|0;l=d+o|0;c=s-1|0;u=s+1|0;i=(n[e+a+c|0]|0)+(n[e+a+u|0]|0)+(n[e+d+s|0]|0)+(n[e+l+c|0]|0)+(n[e+l+u|0]|0)|0;if((i|0)>(0|0)){n[t+d+s|0]=1}else{n[t+d+s|0]=0}}}return}function p(e,t){e=e|0;t=t|0;var r=0;r=s(o,o)|0;while((r|0)>0){r=r-1|0;n[t+r|0]=n[e+r|0]|0}}function h(e){e=e|0;var t=0,r=0;for(t=0;(t|0)<(o-1|0);t=t+1|0){n[e+t|0]=0;n[e+r|0]=0;r=r+o-1|0;n[e+r|0]=0;r=r+1|0}for(t=0;(t|0)<(o|0);t=t+1|0){n[e+r|0]=0;r=r+1|0}}function w(){var e=0,t=0,r=0,n=0,w=0,g=0;t=s(o,o)|0;r=t+t|0;n=r+t|0;u(n,0);h(e);do{i(e,t);d(t,r);a(e,r,r);l(n,r,n);p(t,e);w=c(e)|0;g=(w|0)==0|0}while(!g)}return{skeletonize:w}}},function(e,t,r){"use strict";function n(e){o.a.call(this,e),this.barSpaceRatio=[1,1]}var o=r(1),s={START_PATTERN:{value:[3,1,3,1,1,1]},STOP_PATTERN:{value:[3,1,1,1,3]},CODE_PATTERN:{value:[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.3,writable:!0},FORMAT:{value:"2of5"}},i=s.START_PATTERN.value.reduce((function(e,t){return e+t}),0);n.prototype=Object.create(o.a.prototype,s),n.prototype.constructor=n,n.prototype._findPattern=function(e,t,r,n){var o,s,i,a,l=[],c=this,u=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0},p=c.AVG_CODE_ERROR;for(r=r||!1,n=n||!1,t||(t=c._nextSet(c._row)),o=0;o=0&&r._matchRange(e,t.start,0))return t;n=t.end,t=null}},n.prototype._verifyTrailingWhitespace=function(e){var t;return(t=e.end+(e.end-e.start)/2)1&&s._isStartEnd(r))break}while(ns._counters.length?s._counters.length:n,o=e.start+s._sumCounters(e.startCounter,n-8),{code:i.join(""),start:e.start,end:o,startInfo:e,decodedCodes:i}):null},n.prototype._verifyWhitespace=function(e,t){return(e-1<=0||this._counters[e-1]>=this._calculatePatternLength(e)/2)&&(t+8>=this._counters.length||this._counters[t+7]>=this._calculatePatternLength(t)/2)},n.prototype._calculatePatternLength=function(e){var t,r=0;for(t=e;t=0;s--)r=2==(1&s)?l.bar:l.space,(n=1==(1&i)?r.wide:r.narrow).size+=a._counters[c+s],n.counts++,i>>=1;c+=8}return["space","bar"].forEach((function(e){var t=l[e];t.wide.min=Math.floor((t.narrow.size/t.narrow.counts+t.wide.size/t.wide.counts)/2),t.narrow.max=Math.ceil(t.wide.min),t.wide.max=Math.ceil((t.wide.size*a.MAX_ACCEPTABLE+a.PADDING)/t.wide.counts)})),l},n.prototype._charToPattern=function(e){var t,r=this,n=e.charCodeAt(0);for(t=0;t=0;n--){if(o=0==(1&n)?c.bar:c.space,s=1==(1&a)?o.wide:o.narrow,(i=l._counters[u+n])s.max)return!1;a>>=1}u+=8}return!0},n.prototype._patternToChar=function(e){var t,r=this;for(t=0;ts&&(s=n),nthis._counters.length)return-1;for(t=this._computeAlternatingThreshold(e,s),r=this._computeAlternatingThreshold(e+1,s),n=0;n<7;n++)o=0==(1&n)?t:r,this._counters[e+n]>o&&(a|=i),i>>=1;return a},n.prototype._isStartEnd=function(e){var t;for(t=0;ta.AVG_CODE_ERROR?null:(a.CODE_PATTERN[d.code]&&(d.correction.bar=o(a.CODE_PATTERN[d.code],i,this.MODULE_INDICES.bar),d.correction.space=o(a.CODE_PATTERN[d.code],i,this.MODULE_INDICES.space)),d)}i[++u]=1,c=!c}return null},n.prototype._correct=function(e,t){this._correctBars(e,t.bar,this.MODULE_INDICES.bar),this._correctBars(e,t.space,this.MODULE_INDICES.space)},n.prototype._findStart=function(){var e,t,r,n,s,i=[0,0,0,0,0,0],a=this,l=a._nextSet(a._row),c=!1,u=0,d={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}};for(e=l;e4)return-1;if(0==(1&s))for(var a=0;a="a"&&o<="d"){if(n>t-2)return null;var s=e[++n],i=s.charCodeAt(0),a=void 0;switch(o){case"a":if(!(s>="A"&&s<="Z"))return null;a=String.fromCharCode(i-64);break;case"b":if(s>="A"&&s<="E")a=String.fromCharCode(i-38);else if(s>="F"&&s<="J")a=String.fromCharCode(i-11);else if(s>="K"&&s<="O")a=String.fromCharCode(i+16);else if(s>="P"&&s<="S")a=String.fromCharCode(i+43);else{if(!(s>="T"&&s<="Z"))return null;a=String.fromCharCode(127)}break;case"c":if(s>="A"&&s<="O")a=String.fromCharCode(i-32);else{if("Z"!==s)return null;a=":"}break;case"d":if(!(s>="A"&&s<="Z"))return null;a=String.fromCharCode(i+32)}r.push(a)}else r.push(o)}return r},n.prototype._verifyChecksums=function(e){return this._matchCheckChar(e,e.length-2,20)&&this._matchCheckChar(e,e.length-1,15)},n.prototype._matchCheckChar=function(e,t,r){var n=this,o=e.slice(0,t),s=o.length,i=o.reduce((function(e,t,o){return e+((-1*o+(s-1))%r+1)*n.ALPHABET.indexOf(t.charCodeAt(0))}),0);return this.ALPHABET[i%47]===e[t].charCodeAt(0)},t.a=n},function(e,t,r){"use strict";function n(){o.a.call(this)}var o=r(4);n.prototype=Object.create(o.a.prototype,{FORMAT:{value:"ean_2",writeable:!1}}),n.prototype.constructor=n,n.prototype.decode=function(e,t){this._row=e;var r,n=0,o=0,s=t,i=this._row.length,a=[],l=[];for(o=0;o<2&&s=this.CODE_G_START&&(n|=1<<1-o),1!=o&&(s=this._nextSet(this._row,r.end),s=this._nextUnset(this._row,s))}return 2!=a.length||parseInt(a.join(""))%4!==n?null:{code:a.join(""),decodedCodes:l,end:r.end}},t.a=n},function(e,t,r){"use strict";function n(){s.a.call(this)}function o(e){var t;for(t=0;t<10;t++)if(e===i[t])return t;return null}var s=r(4),i=[24,20,18,17,12,6,3,10,9,5];n.prototype=Object.create(s.a.prototype,{FORMAT:{value:"ean_5",writeable:!1}}),n.prototype.constructor=n,n.prototype.decode=function(e,t){this._row=e;var r,n=0,s=0,i=t,a=this._row.length,l=[],c=[];for(s=0;s<5&&i=this.CODE_G_START&&(n|=1<<4-s),4!=s&&(i=this._nextSet(this._row,r.end),i=this._nextUnset(this._row,i))}return 5!=l.length||function(e){var t,r=e.length,n=0;for(t=r-2;t>=0;t-=2)n+=e[t];for(n*=3,t=r-1;t>=0;t-=2)n+=e[t];return(n*=3)%10}(l)!==o(n)?null:{code:l.join(""),decodedCodes:c,end:r.end}},t.a=n},function(e,t,r){"use strict";function n(e,t){o.a.call(this,e,t)}var o=r(4);n.prototype=Object.create(o.a.prototype,{FORMAT:{value:"ean_8",writeable:!1}}),n.prototype.constructor=n,n.prototype._decodePayload=function(e,t,r){var n,o=this;for(n=0;n<4;n++){if(!(e=o._decodeCode(e.end,o.CODE_G_START)))return null;t.push(e.code),r.push(e)}if(null===(e=o._findPattern(o.MIDDLE_PATTERN,e.end,!0,!1)))return null;for(r.push(e),n=0;n<4;n++){if(!(e=o._decodeCode(e.end,o.CODE_G_START)))return null;r.push(e),t.push(e.code)}return e},t.a=n},function(e,t,r){"use strict";function n(e){e=s()(function(){var e={};return Object.keys(n.CONFIG_KEYS).forEach((function(t){e[t]=n.CONFIG_KEYS[t].default})),e}(),e),i.a.call(this,e),this.barSpaceRatio=[1,1],e.normalizeBarSpaceWidth&&(this.SINGLE_CODE_ERROR=.38,this.AVG_CODE_ERROR=.09)}var o=r(28),s=r.n(o),i=r(1),a={START_PATTERN:{value:[1,1,1,1]},STOP_PATTERN:{value:[1,1,3]},CODE_PATTERN:{value:[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.38,writable:!0},MAX_CORRECTION_FACTOR:{value:5},FORMAT:{value:"i2of5"}};n.prototype=Object.create(i.a.prototype,a),n.prototype.constructor=n,n.prototype._matchPattern=function(e,t){if(this.config.normalizeBarSpaceWidth){var r,n=[0,0],o=[0,0],s=[0,0],a=this.MAX_CORRECTION_FACTOR,l=1/a;for(r=0;r=0&&r._matchRange(e,t.start,0))return t;n=t.end,t=null}},n.prototype._verifyTrailingWhitespace=function(e){var t;return(t=e.end+(e.end-e.start)/2)=o.CODE_G_START&&(e.code=e.code-o.CODE_G_START,s|=1<<5-n),t.push(e.code),r.push(e)}return o._determineParity(s,t)?e:null},n.prototype._determineParity=function(e,t){var r,n;for(n=0;n0&&s(u)?r>1?e(u,r-1,s,i,a):n(a,u):i||(a[a.length]=u)}return a}},function(e,t,r){var n=r(117)();e.exports=n},function(e,t,r){var n=r(13),o=r(23);e.exports=function(e,t){for(var r=0,s=(t=n(t,e)).length;null!=e&&r1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(s--,i):void 0,a&&o(r[0],r[1],a)&&(i=s<3?void 0:i,s=1),t=Object(t);++n-1}},function(e,t,r){var n=r(12);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(84),o=r(10),s=r(33);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(s||o),string:new n}}},function(e,t,r){var n=r(14);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t,r){var n=r(14);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(14);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(14);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},function(e,t,r){var n=r(161),o=500;e.exports=function(e){var t=n(e,(function(e){return r.size===o&&r.clear(),e})),r=t.cache;return t}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},function(e,t,r){(function(e){var n=r(38),o="object"==typeof t&&t&&!t.nodeType&&t,s=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=s&&s.exports===o&&n.process,a=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}).call(t,r(29)(e))},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t){var r=800,n=16,o=Date.now;e.exports=function(e){var t=0,s=0;return function(){var i=o(),a=n-(i-s);if(s=i,a>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,r){var n=r(10);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(10),o=r(33),s=r(34),i=200;e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length{"use strict";var n=r(791),o=r(296);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rt}return!1}(t,r,o,n)&&(r=null),n||null===o?function(e){return!!d.call(w,e)||!d.call(h,e)&&(p.test(e)?w[e]=!0:(h[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=null===r?3!==o.type&&"":r:(t=o.attributeName,n=o.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(o=o.type)||4===o&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,k);f[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,k);f[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,k);f[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){f[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),f.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){f[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var m=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for("react.element"),C=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),Z=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var _=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var E=Symbol.iterator;function z(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=E&&e[E]||e["@@iterator"])?e:null}var P,N=Object.assign;function O(e){if(void 0===P)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);P=t&&t[1]||""}return"\n"+P+e}var T=!1;function R(e,t){if(!e||T)return"";T=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var o=c.stack.split("\n"),s=n.stack.split("\n"),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(1!==i||1!==a)do{if(i--,0>--a||o[i]!==s[a]){var l="\n"+o[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=i&&0<=a);break}}}finally{T=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?O(e):""}function D(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=R(e.type,!1);case 11:return e=R(e.type.render,!1);case 1:return e=R(e.type,!0);default:return""}}function I(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case b:return"Fragment";case C:return"Portal";case A:return"Profiler";case M:return"StrictMode";case V:return"Suspense";case S:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case Z:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case H:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case L:return null!==(t=e.displayName||null)?t:I(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return I(e(t))}catch(r){}}return null}function U(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return I(t);case 8:return t===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function F(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function W(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var o=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=q(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function X(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var r=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Y(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=F(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Q(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function J(e,t){Q(e,t);var r=F(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,r):t.hasOwnProperty("defaultValue")&&ee(e,t.type,F(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ee(e,t,r){"number"===t&&X(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var te=Array.isArray;function re(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function pe(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},we=["Webkit","ms","Moz","O"];function ge(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function fe(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),o=ge(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}Object.keys(he).forEach((function(e){we.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ve=N({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ke(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(s(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var me=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ce=null,be=null,Me=null;function Ae(e){if(e=mo(e)){if("function"!==typeof Ce)throw Error(s(280));var t=e.stateNode;t&&(t=Co(t),Ce(e.stateNode,e.type,t))}}function je(e){be?Me?Me.push(e):Me=[e]:be=e}function Ze(){if(be){var e=be,t=Me;if(Me=be=null,Ae(e),t)for(e=0;e>>=0,0===e?32:31-(at(e)/lt|0)|0},at=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,o=e.suspendedLanes,s=e.pingedLanes,i=268435455&r;if(0!==i){var a=i&~o;0!==a?n=dt(a):0!==(s&=i)&&(n=dt(s))}else 0!==(i=r&~o)?n=dt(i):0!==s&&(n=dt(s));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&o)&&((o=n&-n)>=(s=t&-t)||16===o&&0!==(4194240&s)))return t;if(0!==(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function vt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=r}function kt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-it(r),o=1<=Er),Nr=String.fromCharCode(32),Or=!1;function Tr(e,t){switch(e){case"keyup":return-1!==Br.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Dr=!1;var Ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ir[e.type]:"textarea"===t}function Fr(e,t,r,n){je(n),0<(t=Wn(t,"onChange")).length&&(r=new cr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qr=null,Wr=null;function Gr(e){On(e,0)}function Xr(e){if(G(yo(e)))return e}function Kr(e,t){if("change"===e)return t}var Yr=!1;if(u){var Qr;if(u){var Jr="oninput"in document;if(!Jr){var $r=document.createElement("div");$r.setAttribute("oninput","return;"),Jr="function"===typeof $r.oninput}Qr=Jr}else Qr=!1;Yr=Qr&&(!document.documentMode||9=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cn(n)}}function dn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pn(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=X((e=t.contentWindow).document)}return t}function hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function wn(e){var t=pn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&dn(r.ownerDocument.documentElement,r)){if(null!==n&&hn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=r.textContent.length,s=Math.min(n.start,o);n=void 0===n.end?s:Math.min(n.end,o),!e.extend&&s>n&&(o=n,n=s,s=o),o=un(r,s);var i=un(r,n);o&&i&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof r.focus&&r.focus(),r=0;r=document.documentMode,fn=null,vn=null,kn=null,xn=!1;function mn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;xn||null==fn||fn!==X(n)||("selectionStart"in(n=fn)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},kn&&ln(kn,n)||(kn=n,0<(n=Wn(vn,"onSelect")).length&&(t=new cr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=fn)))}function yn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Cn={animationend:yn("Animation","AnimationEnd"),animationiteration:yn("Animation","AnimationIteration"),animationstart:yn("Animation","AnimationStart"),transitionend:yn("Transition","TransitionEnd")},bn={},Mn={};function An(e){if(bn[e])return bn[e];if(!Cn[e])return e;var t,r=Cn[e];for(t in r)if(r.hasOwnProperty(t)&&t in Mn)return bn[e]=r[t];return e}u&&(Mn=document.createElement("div").style,"AnimationEvent"in window||(delete Cn.animationend.animation,delete Cn.animationiteration.animation,delete Cn.animationstart.animation),"TransitionEvent"in window||delete Cn.transitionend.transition);var jn=An("animationend"),Zn=An("animationiteration"),Hn=An("animationstart"),Vn=An("transitionend"),Sn=new Map,Ln="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){Sn.set(e,t),l(t,[e])}for(var _n=0;_nMo||(e.current=bo[Mo],bo[Mo]=null,Mo--)}function Zo(e,t){Mo++,bo[Mo]=e.current,e.current=t}var Ho={},Vo=Ao(Ho),So=Ao(!1),Lo=Ho;function Bo(e,t){var r=e.type.contextTypes;if(!r)return Ho;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o,s={};for(o in r)s[o]=t[o];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function _o(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Eo(){jo(So),jo(Vo)}function zo(e,t,r){if(Vo.current!==Ho)throw Error(s(168));Zo(Vo,t),Zo(So,r)}function Po(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var o in n=n.getChildContext())if(!(o in t))throw Error(s(108,U(e)||"Unknown",o));return N({},r,n)}function No(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ho,Lo=Vo.current,Zo(Vo,e),Zo(So,So.current),!0}function Oo(e,t,r){var n=e.stateNode;if(!n)throw Error(s(169));r?(e=Po(e,t,Lo),n.__reactInternalMemoizedMergedChildContext=e,jo(So),jo(Vo),Zo(Vo,e)):jo(So),Zo(So,r)}var To=null,Ro=!1,Do=!1;function Io(e){null===To?To=[e]:To.push(e)}function Uo(){if(!Do&&null!==To){Do=!0;var e=0,t=xt;try{var r=To;for(xt=1;e>=i,o-=i,Qo=1<<32-it(t)+o|r<g?(f=d,d=null):f=d.sibling;var v=h(o,d,a[g],l);if(null===v){null===d&&(d=f);break}e&&d&&null===v.alternate&&t(o,d),s=i(v,s,g),null===u?c=v:u.sibling=v,u=v,d=f}if(g===a.length)return r(o,d),ss&&$o(o,g),c;if(null===d){for(;gf?(v=g,g=null):v=g.sibling;var x=h(o,g,k.value,c);if(null===x){null===g&&(g=v);break}e&&g&&null===x.alternate&&t(o,g),a=i(x,a,f),null===d?u=x:d.sibling=x,d=x,g=v}if(k.done)return r(o,g),ss&&$o(o,f),u;if(null===g){for(;!k.done;f++,k=l.next())null!==(k=p(o,k.value,c))&&(a=i(k,a,f),null===d?u=k:d.sibling=k,d=k);return ss&&$o(o,f),u}for(g=n(o,g);!k.done;f++,k=l.next())null!==(k=w(g,o,f,k.value,c))&&(e&&null!==k.alternate&&g.delete(null===k.key?f:k.key),a=i(k,a,f),null===d?u=k:d.sibling=k,d=k);return e&&g.forEach((function(e){return t(o,e)})),ss&&$o(o,f),u}return function e(n,s,i,l){if("object"===typeof i&&null!==i&&i.type===b&&null===i.key&&(i=i.props.children),"object"===typeof i&&null!==i){switch(i.$$typeof){case y:e:{for(var c=i.key,u=s;null!==u;){if(u.key===c){if((c=i.type)===b){if(7===u.tag){r(n,u.sibling),(s=o(u,i.props.children)).return=n,n=s;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===B&&Ks(c)===u.type){r(n,u.sibling),(s=o(u,i.props)).ref=Gs(n,u,i),s.return=n,n=s;break e}r(n,u);break}t(n,u),u=u.sibling}i.type===b?((s=Pc(i.props.children,n.mode,l,i.key)).return=n,n=s):((l=zc(i.type,i.key,i.props,null,n.mode,l)).ref=Gs(n,s,i),l.return=n,n=l)}return a(n);case C:e:{for(u=i.key;null!==s;){if(s.key===u){if(4===s.tag&&s.stateNode.containerInfo===i.containerInfo&&s.stateNode.implementation===i.implementation){r(n,s.sibling),(s=o(s,i.children||[])).return=n,n=s;break e}r(n,s);break}t(n,s),s=s.sibling}(s=Tc(i,n.mode,l)).return=n,n=s}return a(n);case B:return e(n,s,(u=i._init)(i._payload),l)}if(te(i))return g(n,s,i,l);if(z(i))return f(n,s,i,l);Xs(n,i)}return"string"===typeof i&&""!==i||"number"===typeof i?(i=""+i,null!==s&&6===s.tag?(r(n,s.sibling),(s=o(s,i)).return=n,n=s):(r(n,s),(s=Oc(i,n.mode,l)).return=n,n=s),a(n)):r(n,s)}}var Qs=Ys(!0),Js=Ys(!1),$s={},ei=Ao($s),ti=Ao($s),ri=Ao($s);function ni(e){if(e===$s)throw Error(s(174));return e}function oi(e,t){switch(Zo(ri,t),Zo(ti,e),Zo(ei,$s),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}jo(ei),Zo(ei,t)}function si(){jo(ei),jo(ti),jo(ri)}function ii(e){ni(ri.current);var t=ni(ei.current),r=le(t,e.type);t!==r&&(Zo(ti,e),Zo(ei,r))}function ai(e){ti.current===e&&(jo(ei),jo(ti))}var li=Ao(0);function ci(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ui=[];function di(){for(var e=0;er?r:4,e(!0);var n=hi.transition;hi.transition={};try{e(!1),t()}finally{xt=r,hi.transition=n}}function ea(){return Zi().memoizedState}function ta(e,t,r){var n=rc(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},na(e))oa(t,r);else if(null!==(r=Vs(e,t,r,n))){nc(r,e,n,tc()),sa(r,t,n)}}function ra(e,t,r){var n=rc(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(na(e))oa(t,o);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var i=t.lastRenderedState,a=s(i,r);if(o.hasEagerState=!0,o.eagerState=a,an(a,i)){var l=t.interleaved;return null===l?(o.next=o,Hs(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(r=Vs(e,t,o,n))&&(nc(r,e,n,o=tc()),sa(r,t,n))}}function na(e){var t=e.alternate;return e===gi||null!==t&&t===gi}function oa(e,t){xi=ki=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function sa(e,t,r){if(0!==(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,kt(e,r)}}var ia={readContext:js,useCallback:Ci,useContext:Ci,useEffect:Ci,useImperativeHandle:Ci,useInsertionEffect:Ci,useLayoutEffect:Ci,useMemo:Ci,useReducer:Ci,useRef:Ci,useState:Ci,useDebugValue:Ci,useDeferredValue:Ci,useTransition:Ci,useMutableSource:Ci,useSyncExternalStore:Ci,useId:Ci,unstable_isNewReconciler:!1},aa={readContext:js,useCallback:function(e,t){return ji().memoizedState=[e,void 0===t?null:t],e},useContext:js,useEffect:Ui,useImperativeHandle:function(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Di(4194308,4,Gi.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Di(4194308,4,e,t)},useInsertionEffect:function(e,t){return Di(4,2,e,t)},useMemo:function(e,t){var r=ji();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ji();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=ta.bind(null,gi,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ji().memoizedState=e},useState:Oi,useDebugValue:Ki,useDeferredValue:function(e){return ji().memoizedState=e},useTransition:function(){var e=Oi(!1),t=e[0];return e=$i.bind(null,e[1]),ji().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=gi,o=ji();if(ss){if(void 0===r)throw Error(s(407));r=r()}else{if(r=t(),null===Sl)throw Error(s(349));0!==(30&wi)||_i(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,Ui(zi.bind(null,n,i,e),[e]),n.flags|=2048,Ti(9,Ei.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ji(),t=Sl.identifierPrefix;if(ss){var r=Jo;t=":"+t+"R"+(r=(Qo&~(1<<32-it(Qo)-1)).toString(32)+r),0<(r=mi++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=yi++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},la={readContext:js,useCallback:Yi,useContext:js,useEffect:Fi,useImperativeHandle:Xi,useInsertionEffect:qi,useLayoutEffect:Wi,useMemo:Qi,useReducer:Vi,useRef:Ri,useState:function(){return Vi(Hi)},useDebugValue:Ki,useDeferredValue:function(e){return Ji(Zi(),fi.memoizedState,e)},useTransition:function(){return[Vi(Hi)[0],Zi().memoizedState]},useMutableSource:Li,useSyncExternalStore:Bi,useId:ea,unstable_isNewReconciler:!1},ca={readContext:js,useCallback:Yi,useContext:js,useEffect:Fi,useImperativeHandle:Xi,useInsertionEffect:qi,useLayoutEffect:Wi,useMemo:Qi,useReducer:Si,useRef:Ri,useState:function(){return Si(Hi)},useDebugValue:Ki,useDeferredValue:function(e){var t=Zi();return null===fi?t.memoizedState=e:Ji(t,fi.memoizedState,e)},useTransition:function(){return[Si(Hi)[0],Zi().memoizedState]},useMutableSource:Li,useSyncExternalStore:Bi,useId:ea,unstable_isNewReconciler:!1};function ua(e,t){try{var r="",n=t;do{r+=D(n),n=n.return}while(n);var o=r}catch(s){o="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:o,digest:null}}function da(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function pa(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}var ha="function"===typeof WeakMap?WeakMap:Map;function wa(e,t,r){(r=Es(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ql||(ql=!0,Wl=n),pa(0,t)},r}function ga(e,t,r){(r=Es(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var o=t.value;r.payload=function(){return n(o)},r.callback=function(){pa(0,t)}}var s=e.stateNode;return null!==s&&"function"===typeof s.componentDidCatch&&(r.callback=function(){pa(0,t),"function"!==typeof n&&(null===Gl?Gl=new Set([this]):Gl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function fa(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new ha;var o=new Set;n.set(t,o)}else void 0===(o=n.get(t))&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=jc.bind(null,e,t,r),t.then(e,e))}function va(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ka(e,t,r,n,o){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Es(-1,1)).tag=2,zs(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var xa=m.ReactCurrentOwner,ma=!1;function ya(e,t,r,n){t.child=null===e?Js(t,null,r,n):Qs(t,e.child,r,n)}function Ca(e,t,r,n,o){r=r.render;var s=t.ref;return As(t,o),n=Mi(e,t,r,n,s,o),r=Ai(),null===e||ma?(ss&&r&&ts(t),t.flags|=1,ya(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qa(e,t,o))}function ba(e,t,r,n,o){if(null===e){var s=r.type;return"function"!==typeof s||_c(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=zc(r.type,null,n,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Ma(e,t,s,n,o))}if(s=e.child,0===(e.lanes&o)){var i=s.memoizedProps;if((r=null!==(r=r.compare)?r:ln)(i,n)&&e.ref===t.ref)return qa(e,t,o)}return t.flags|=1,(e=Ec(s,n)).ref=t.ref,e.return=t,t.child=e}function Ma(e,t,r,n,o){if(null!==e){var s=e.memoizedProps;if(ln(s,n)&&e.ref===t.ref){if(ma=!1,t.pendingProps=n=s,0===(e.lanes&o))return t.lanes=e.lanes,qa(e,t,o);0!==(131072&e.flags)&&(ma=!0)}}return Za(e,t,r,n,o)}function Aa(e,t,r){var n=t.pendingProps,o=n.children,s=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zo(El,_l),_l|=r;else{if(0===(1073741824&r))return e=null!==s?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Zo(El,_l),_l|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==s?s.baseLanes:r,Zo(El,_l),_l|=n}else null!==s?(n=s.baseLanes|r,t.memoizedState=null):n=r,Zo(El,_l),_l|=n;return ya(e,t,o,r),t.child}function ja(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Za(e,t,r,n,o){var s=_o(r)?Lo:Vo.current;return s=Bo(t,s),As(t,o),r=Mi(e,t,r,n,s,o),n=Ai(),null===e||ma?(ss&&n&&ts(t),t.flags|=1,ya(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qa(e,t,o))}function Ha(e,t,r,n,o){if(_o(r)){var s=!0;No(t)}else s=!1;if(As(t,o),null===t.stateNode)Fa(e,t),Fs(t,r,n),Ws(t,r,n,o),n=!0;else if(null===e){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=r.contextType;"object"===typeof c&&null!==c?c=js(c):c=Bo(t,c=_o(r)?Lo:Vo.current);var u=r.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof i.getSnapshotBeforeUpdate;d||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(a!==n||l!==c)&&qs(t,i,n,c),Ls=!1;var p=t.memoizedState;i.state=p,Os(t,n,i,o),l=t.memoizedState,a!==n||p!==l||So.current||Ls?("function"===typeof u&&(Ds(t,r,u,n),l=t.memoizedState),(a=Ls||Us(t,r,a,n,p,l,c))?(d||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||("function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"===typeof i.componentDidMount&&(t.flags|=4194308)):("function"===typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=c,n=a):("function"===typeof i.componentDidMount&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,_s(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:vs(t.type,a),i.props=c,d=t.pendingProps,p=i.context,"object"===typeof(l=r.contextType)&&null!==l?l=js(l):l=Bo(t,l=_o(r)?Lo:Vo.current);var h=r.getDerivedStateFromProps;(u="function"===typeof h||"function"===typeof i.getSnapshotBeforeUpdate)||"function"!==typeof i.UNSAFE_componentWillReceiveProps&&"function"!==typeof i.componentWillReceiveProps||(a!==d||p!==l)&&qs(t,i,n,l),Ls=!1,p=t.memoizedState,i.state=p,Os(t,n,i,o);var w=t.memoizedState;a!==d||p!==w||So.current||Ls?("function"===typeof h&&(Ds(t,r,h,n),w=t.memoizedState),(c=Ls||Us(t,r,c,n,p,w,l)||!1)?(u||"function"!==typeof i.UNSAFE_componentWillUpdate&&"function"!==typeof i.componentWillUpdate||("function"===typeof i.componentWillUpdate&&i.componentWillUpdate(n,w,l),"function"===typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(n,w,l)),"function"===typeof i.componentDidUpdate&&(t.flags|=4),"function"===typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof i.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),i.props=n,i.state=w,i.context=l,n=c):("function"!==typeof i.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return Va(e,t,r,n,s,o)}function Va(e,t,r,n,o,s){ja(e,t);var i=0!==(128&t.flags);if(!n&&!i)return o&&Oo(t,r,!1),qa(e,t,s);n=t.stateNode,xa.current=t;var a=i&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&i?(t.child=Qs(t,e.child,null,s),t.child=Qs(t,null,a,s)):ya(e,t,a,s),t.memoizedState=n.state,o&&Oo(t,r,!0),t.child}function Sa(e){var t=e.stateNode;t.pendingContext?zo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&zo(0,t.context,!1),oi(e,t.containerInfo)}function La(e,t,r,n,o){return ws(),gs(o),t.flags|=256,ya(e,t,r,n),t.child}var Ba,_a,Ea,za,Pa={dehydrated:null,treeContext:null,retryLane:0};function Na(e){return{baseLanes:e,cachePool:null,transitions:null}}function Oa(e,t,r){var n,o=t.pendingProps,i=li.current,a=!1,l=0!==(128&t.flags);if((n=l)||(n=(null===e||null!==e.memoizedState)&&0!==(2&i)),n?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Zo(li,1&i),null===e)return us(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,a?(o=t.mode,a=t.child,l={mode:"hidden",children:l},0===(1&o)&&null!==a?(a.childLanes=0,a.pendingProps=l):a=Nc(l,o,0,null),e=Pc(e,o,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Na(r),t.memoizedState=Pa,e):Ta(t,l));if(null!==(i=e.memoizedState)&&null!==(n=i.dehydrated))return function(e,t,r,n,o,i,a){if(r)return 256&t.flags?(t.flags&=-257,Ra(e,t,a,n=da(Error(s(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=n.fallback,o=t.mode,n=Nc({mode:"visible",children:n.children},o,0,null),(i=Pc(i,o,a,null)).flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,0!==(1&t.mode)&&Qs(t,e.child,null,a),t.child.memoizedState=Na(a),t.memoizedState=Pa,i);if(0===(1&t.mode))return Ra(e,t,a,null);if("$!"===o.data){if(n=o.nextSibling&&o.nextSibling.dataset)var l=n.dgst;return n=l,Ra(e,t,a,n=da(i=Error(s(419)),n,void 0))}if(l=0!==(a&e.childLanes),ma||l){if(null!==(n=Sl)){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(n.suspendedLanes|a))?0:o)&&o!==i.retryLane&&(i.retryLane=o,Ss(e,o),nc(n,e,o,-1))}return fc(),Ra(e,t,a,n=da(Error(s(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Hc.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,os=co(o.nextSibling),ns=t,ss=!0,is=null,null!==e&&(Xo[Ko++]=Qo,Xo[Ko++]=Jo,Xo[Ko++]=Yo,Qo=e.id,Jo=e.overflow,Yo=t),t=Ta(t,n.children),t.flags|=4096,t)}(e,t,l,o,n,i,r);if(a){a=o.fallback,l=t.mode,n=(i=e.child).sibling;var c={mode:"hidden",children:o.children};return 0===(1&l)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=Ec(i,c)).subtreeFlags=14680064&i.subtreeFlags,null!==n?a=Ec(n,a):(a=Pc(a,l,r,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,l=null===(l=e.child.memoizedState)?Na(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=Pa,o}return e=(a=e.child).sibling,o=Ec(a,{mode:"visible",children:o.children}),0===(1&t.mode)&&(o.lanes=r),o.return=t,o.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=o,t.memoizedState=null,o}function Ta(e,t){return(t=Nc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ra(e,t,r,n){return null!==n&&gs(n),Qs(t,e.child,null,r),(e=Ta(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Da(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ms(e.return,t,r)}function Ia(e,t,r,n,o){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=o)}function Ua(e,t,r){var n=t.pendingProps,o=n.revealOrder,s=n.tail;if(ya(e,t,n.children,r),0!==(2&(n=li.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Da(e,r,t);else if(19===e.tag)Da(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Zo(li,n),0===(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;null!==r;)null!==(e=r.alternate)&&null===ci(e)&&(o=r),r=r.sibling;null===(r=o)?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Ia(t,!1,o,r,s);break;case"backwards":for(r=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ci(e)){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Ia(t,!0,r,null,s);break;case"together":Ia(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fa(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qa(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Nl|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(r=Ec(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Ec(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Wa(e,t){if(!ss)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ga(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=14680064&o.subtreeFlags,n|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Xa(e,t,r){var n=t.pendingProps;switch(rs(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ga(t),null;case 1:case 17:return _o(t.type)&&Eo(),Ga(t),null;case 3:return n=t.stateNode,si(),jo(So),jo(Vo),di(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ps(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==is&&(ac(is),is=null))),_a(e,t),Ga(t),null;case 5:ai(t);var o=ni(ri.current);if(r=t.type,null!==e&&null!=t.stateNode)Ea(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(s(166));return Ga(t),null}if(e=ni(ei.current),ps(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[ho]=t,n[wo]=i,e=0!==(1&t.mode),r){case"dialog":Tn("cancel",n),Tn("close",n);break;case"iframe":case"object":case"embed":Tn("load",n);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),"select"===r&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[ho]=t,e[wo]=n,Ba(e,t,!1,!1),t.stateNode=e;e:{switch(l=xe(r,n),r){case"dialog":Tn("cancel",e),Tn("close",e),o=n;break;case"iframe":case"object":case"embed":Tn("load",e),o=n;break;case"video":case"audio":for(o=0;oUl&&(t.flags|=128,n=!0,Wa(i,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=ci(l))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Wa(i,!0),null===i.tail&&"hidden"===i.tailMode&&!l.alternate&&!ss)return Ga(t),null}else 2*Qe()-i.renderingStartTime>Ul&&1073741824!==r&&(t.flags|=128,n=!0,Wa(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=i.last)?r.sibling=l:t.child=l,i.last=l)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qe(),t.sibling=null,r=li.current,Zo(li,n?1&r|2:1&r),t):(Ga(t),null);case 22:case 23:return pc(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!==(1&t.mode)?0!==(1073741824&_l)&&(Ga(t),6&t.subtreeFlags&&(t.flags|=8192)):Ga(t),null;case 24:case 25:return null}throw Error(s(156,t.tag))}function Ka(e,t){switch(rs(t),t.tag){case 1:return _o(t.type)&&Eo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return si(),jo(So),jo(Vo),di(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ai(t),null;case 13:if(jo(li),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(s(340));ws()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return jo(li),null;case 4:return si(),null;case 10:return bs(t.type._context),null;case 22:case 23:return pc(),null;default:return null}}Ba=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},_a=function(){},Ea=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,ni(ei.current);var s,i=null;switch(r){case"input":o=K(e,o),n=K(e,n),i=[];break;case"select":o=N({},o,{value:void 0}),n=N({},n,{value:void 0}),i=[];break;case"textarea":o=ne(e,o),n=ne(e,n),i=[];break;default:"function"!==typeof o.onClick&&"function"===typeof n.onClick&&(e.onclick=$n)}for(u in ke(r,n),r=null,o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=null!=o?o[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(i||(i=[]),i.push(u,r)),r=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(i=i||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(i=i||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Tn("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},za=function(e,t,r,n){r!==n&&(t.flags|=4)};var Ya=!1,Qa=!1,Ja="function"===typeof WeakSet?WeakSet:Set,$a=null;function el(e,t){var r=e.ref;if(null!==r)if("function"===typeof r)try{r(null)}catch(n){Ac(e,t,n)}else r.current=null}function tl(e,t,r){try{r()}catch(n){Ac(e,t,n)}}var rl=!1;function nl(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var o=n=n.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,void 0!==s&&tl(t,r,s)}o=o.next}while(o!==n)}}function ol(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function sl(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"===typeof t?t(e):t.current=e}}function il(e){var t=e.alternate;null!==t&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[ho],delete t[wo],delete t[fo],delete t[vo],delete t[ko])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function al(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=$n));else if(4!==n&&null!==(e=e.child))for(cl(e,t,r),e=e.sibling;null!==e;)cl(e,t,r),e=e.sibling}function ul(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ul(e,t,r),e=e.sibling;null!==e;)ul(e,t,r),e=e.sibling}var dl=null,pl=!1;function hl(e,t,r){for(r=r.child;null!==r;)wl(e,t,r),r=r.sibling}function wl(e,t,r){if(st&&"function"===typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(ot,r)}catch(a){}switch(r.tag){case 5:Qa||el(r,t);case 6:var n=dl,o=pl;dl=null,hl(e,t,r),pl=o,null!==(dl=n)&&(pl?(e=dl,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):dl.removeChild(r.stateNode));break;case 18:null!==dl&&(pl?(e=dl,r=r.stateNode,8===e.nodeType?lo(e.parentNode,r):1===e.nodeType&&lo(e,r),It(e)):lo(dl,r.stateNode));break;case 4:n=dl,o=pl,dl=r.stateNode.containerInfo,pl=!0,hl(e,t,r),dl=n,pl=o;break;case 0:case 11:case 14:case 15:if(!Qa&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){o=n=n.next;do{var s=o,i=s.destroy;s=s.tag,void 0!==i&&(0!==(2&s)||0!==(4&s))&&tl(r,t,i),o=o.next}while(o!==n)}hl(e,t,r);break;case 1:if(!Qa&&(el(r,t),"function"===typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ac(r,t,a)}hl(e,t,r);break;case 21:hl(e,t,r);break;case 22:1&r.mode?(Qa=(n=Qa)||null!==r.memoizedState,hl(e,t,r),Qa=n):hl(e,t,r);break;default:hl(e,t,r)}}function gl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Ja),t.forEach((function(t){var n=Vc.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function fl(e,t){var r=t.deletions;if(null!==r)for(var n=0;no&&(o=a),n&=~i}if(n=o,10<(n=(120>(n=Qe()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Al(n/1960))-n)){e.timeoutHandle=no(Cc.bind(null,e,Dl,Fl),n);break}Cc(e,Dl,Fl);break;default:throw Error(s(329))}}}return oc(e,Qe()),e.callbackNode===r?sc.bind(null,e):null}function ic(e,t){var r=Rl;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),2!==(e=vc(e,t))&&(t=Dl,Dl=r,null!==t&&ac(t)),e}function ac(e){null===Dl?Dl=e:Dl.push.apply(Dl,e)}function lc(e,t){for(t&=~Tl,t&=~Ol,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Kl)var n=!1;else{if(e=Kl,Kl=null,Yl=0,0!==(6&Vl))throw Error(s(331));var o=Vl;for(Vl|=4,$a=e.current;null!==$a;){var i=$a,a=i.child;if(0!==(16&$a.flags)){var l=i.deletions;if(null!==l){for(var c=0;cQe()-Il?hc(e,0):Tl|=r),oc(e,t)}function Zc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var r=tc();null!==(e=Ss(e,t))&&(vt(e,t,r),oc(e,r))}function Hc(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Zc(e,r)}function Vc(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;null!==o&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(s(314))}null!==n&&n.delete(t),Zc(e,r)}function Sc(e,t){return Ge(e,t)}function Lc(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bc(e,t,r,n){return new Lc(e,t,r,n)}function _c(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ec(e,t){var r=e.alternate;return null===r?((r=Bc(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function zc(e,t,r,n,o,i){var a=2;if(n=e,"function"===typeof e)_c(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case b:return Pc(r.children,o,i,t);case M:a=8,o|=8;break;case A:return(e=Bc(12,r,t,2|o)).elementType=A,e.lanes=i,e;case V:return(e=Bc(13,r,t,o)).elementType=V,e.lanes=i,e;case S:return(e=Bc(19,r,t,o)).elementType=S,e.lanes=i,e;case _:return Nc(r,o,i,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case j:a=10;break e;case Z:a=9;break e;case H:a=11;break e;case L:a=14;break e;case B:a=16,n=null;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Bc(a,r,t,o)).elementType=e,t.type=n,t.lanes=i,t}function Pc(e,t,r,n){return(e=Bc(7,e,n,t)).lanes=r,e}function Nc(e,t,r,n){return(e=Bc(22,e,n,t)).elementType=_,e.lanes=r,e.stateNode={isHidden:!1},e}function Oc(e,t,r){return(e=Bc(6,e,null,t)).lanes=r,e}function Tc(e,t,r){return(t=Bc(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Rc(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ft(0),this.expirationTimes=ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Dc(e,t,r,n,o,s,i,a,l){return e=new Rc(e,t,r,a,l),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Bc(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bs(s),e}function Ic(e){if(!e)return Ho;e:{if(Ie(e=e._reactInternals)!==e||1!==e.tag)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_o(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(s(171))}if(1===e.tag){var r=e.type;if(_o(r))return Po(e,r,t)}return t}function Uc(e,t,r,n,o,s,i,a,l){return(e=Dc(r,n,!0,e,0,s,0,a,l)).context=Ic(null),r=e.current,(s=Es(n=tc(),o=rc(r))).callback=void 0!==t&&null!==t?t:null,zs(r,s,o),e.current.lanes=o,vt(e,o,n),oc(e,n),e}function Fc(e,t,r,n){var o=t.current,s=tc(),i=rc(o);return r=Ic(r),null===t.context?t.context=r:t.pendingContext=r,(t=Es(s,i)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=zs(o,t,i))&&(nc(e,o,i,s),Ps(e,o,i)),i}function qc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Wc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r{"use strict";var n=r(164);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},164:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(463)},37:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=o?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(n,s,i):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(r(791)),o=p(r(7)),s=p(r(164)),i=p(r(182)),a=r(280),l=r(580),c=r(693),u=p(r(91)),d=p(r(655));function p(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{(0,d.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),g(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const r=(0,l.createDraggableData)(this,t),n={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=n;n.x+=this.state.slackX,n.y+=this.state.slackY;const[o,s]=(0,l.getBoundPosition)(this,n.x,n.y);n.x=o,n.y=s,n.slackX=this.state.slackX+(e-n.x),n.slackY=this.state.slackY+(t-n.y),r.x=n.x,r.y=n.y,r.deltaX=n.x-this.state.x,r.deltaY=n.y-this.state.y}if(!1===this.props.onDrag(e,r))return!1;this.setState(n)})),g(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const r={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;r.x=e,r.y=t}this.setState(r)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){"undefined"!==typeof window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:s.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:r,defaultPosition:o,defaultClassName:s,defaultClassNameDragging:c,defaultClassNameDragged:d,position:p,positionOffset:h,scale:g,...f}=this.props;let v={},k=null;const x=!Boolean(p)||this.state.dragging,m=p||o,y={x:(0,l.canDragX)(this)&&x?this.state.x:m.x,y:(0,l.canDragY)(this)&&x?this.state.y:m.y};this.state.isElementSVG?k=(0,a.createSVGTransform)(y,h):v=(0,a.createCSSTransform)(y,h);const C=(0,i.default)(r.props.className||"",s,{[c]:this.state.dragging,[d]:this.state.dragged});return n.createElement(u.default,w({},f,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(r),{className:C,style:{...r.props.style,...v},transform:k}))}}t.default=f,g(f,"displayName","Draggable"),g(f,"propTypes",{...u.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),g(f,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},91:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=o?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(n,s,i):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(r(791)),o=u(r(7)),s=u(r(164)),i=r(280),a=r(580),l=r(693),c=u(r(655));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function p(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const h={start:"touchstart",move:"touchmove",stop:"touchend"},w={start:"mousedown",move:"mousemove",stop:"mouseup"};let g=w;class f extends n.Component{constructor(){super(...arguments),p(this,"dragging",!1),p(this,"lastX",NaN),p(this,"lastY",NaN),p(this,"touchIdentifier",null),p(this,"mounted",!1),p(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"===typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=t;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,i.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,i.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const n=(0,i.getTouchIdentifier)(e);this.touchIdentifier=n;const o=(0,a.getControlPosition)(e,n,this);if(null==o)return;const{x:s,y:l}=o,u=(0,a.createCoreData)(this,s,l);(0,c.default)("DraggableCore: handleDragStart: %j",u),(0,c.default)("calling",this.props.onStart);!1!==this.props.onStart(e,u)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,i.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=l,(0,i.addEvent)(r,g.move,this.handleDrag),(0,i.addEvent)(r,g.stop,this.handleDragStop))})),p(this,"handleDrag",(e=>{const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX,t=n-this.lastY;if([e,t]=(0,a.snapToGrid)(this.props.grid,e,t),!e&&!t)return;r=this.lastX+e,n=this.lastY+t}const o=(0,a.createCoreData)(this,r,n);(0,c.default)("DraggableCore: handleDrag: %j",o);if(!1!==this.props.onDrag(e,o)&&!1!==this.mounted)this.lastX=r,this.lastY=n;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(s){const e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}})),p(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,a.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX||0,t=n-this.lastY||0;[e,t]=(0,a.snapToGrid)(this.props.grid,e,t),r=this.lastX+e,n=this.lastY+t}const o=(0,a.createCoreData)(this,r,n);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(s.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,c.default)("DraggableCore: Removing handlers"),(0,i.removeEvent)(s.ownerDocument,g.move,this.handleDrag),(0,i.removeEvent)(s.ownerDocument,g.stop,this.handleDragStop))})),p(this,"onMouseDown",(e=>(g=w,this.handleDragStart(e)))),p(this,"onMouseUp",(e=>(g=w,this.handleDragStop(e)))),p(this,"onTouchStart",(e=>(g=h,this.handleDragStart(e)))),p(this,"onTouchEnd",(e=>(g=h,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,i.addEvent)(e,h.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,i.removeEvent)(t,w.move,this.handleDrag),(0,i.removeEvent)(t,h.move,this.handleDrag),(0,i.removeEvent)(t,w.stop,this.handleDragStop),(0,i.removeEvent)(t,h.stop,this.handleDragStop),(0,i.removeEvent)(e,h.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,i.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:s.default.findDOMNode(this)}render(){return n.cloneElement(n.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=f,p(f,"displayName","DraggableCore"),p(f,"propTypes",{allowAnyClick:o.default.bool,children:o.default.node.isRequired,disabled:o.default.bool,enableUserSelectHack:o.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:o.default.arrayOf(o.default.number),handle:o.default.string,cancel:o.default.string,nodeRef:o.default.object,onStart:o.default.func,onDrag:o.default.func,onStop:o.default.func,onMouseDown:o.default.func,scale:o.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),p(f,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},962:(e,t,r)=>{"use strict";const{default:n,DraggableCore:o}=r(37);e.exports=n,e.exports.default=n,e.exports.DraggableCore=o},280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=c,t.addEvent=function(e,t,r,n){if(!e)return;const o={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,o):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&c(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const r=l(e,t,"px");return{[(0,o.browserPrefixToKey)("transform",o.default)]:r}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,n.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,n.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingTop),t-=(0,n.int)(r.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingLeft),t-=(0,n.int)(r.paddingRight),t},t.matchesSelector=a,t.matchesSelectorAndParentsTo=function(e,t,r){let n=e;do{if(a(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1},t.offsetXYFromParent=function(e,t,r){const n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-n.left)/r,s=(e.clientY+t.scrollTop-n.top)/r;return{x:o,y:s}},t.outerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderTopWidth),t+=(0,n.int)(r.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderLeftWidth),t+=(0,n.int)(r.borderRightWidth),t},t.removeClassName=u,t.removeEvent=function(e,t,r,n){if(!e)return;const o={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,o):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&u(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(t){}};var n=r(693),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(21));function s(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}let i="";function a(e,t){return i||(i=(0,n.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,n.isFunction)(e[t])}))),!!(0,n.isFunction)(e[i])&&e[i](t)}function l(e,t,r){let{x:n,y:o}=e,s="translate(".concat(n).concat(r,",").concat(o).concat(r,")");if(t){const e="".concat("string"===typeof t.x?t.x:t.x+r),n="".concat("string"===typeof t.y?t.y:t.y+r);s="translate(".concat(e,", ").concat(n,")")+s}return s}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function u(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},21:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=n;const r=["Moz","Webkit","O","ms"];function n(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"===typeof window)return"";const n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(let s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,r){const o=!(0,n.isNum)(e.lastX),i=s(e);return o?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}},t.createDraggableData=function(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:i}=e.props;i="string"===typeof i?i:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(i);const a=s(e);if("string"===typeof i){const{ownerDocument:e}=a,t=e.defaultView;let r;if(r="parent"===i?a.parentNode:e.querySelector(i),!(r instanceof t.HTMLElement))throw new Error('Bounds selector "'+i+'" could not find an element.');const s=r,l=t.getComputedStyle(a),c=t.getComputedStyle(s);i={left:-a.offsetLeft+(0,n.int)(c.paddingLeft)+(0,n.int)(l.marginLeft),top:-a.offsetTop+(0,n.int)(c.paddingTop)+(0,n.int)(l.marginTop),right:(0,o.innerWidth)(s)-(0,o.outerWidth)(a)-a.offsetLeft+(0,n.int)(c.paddingRight)-(0,n.int)(l.marginRight),bottom:(0,o.innerHeight)(s)-(0,o.outerHeight)(a)-a.offsetTop+(0,n.int)(c.paddingBottom)-(0,n.int)(l.marginBottom)}}(0,n.isNum)(i.right)&&(t=Math.min(t,i.right));(0,n.isNum)(i.bottom)&&(r=Math.min(r,i.bottom));(0,n.isNum)(i.left)&&(t=Math.max(t,i.left));(0,n.isNum)(i.top)&&(r=Math.max(r,i.top));return[t,r]},t.getControlPosition=function(e,t,r){const n="number"===typeof t?(0,o.getTouch)(e,t):null;if("number"===typeof t&&!n)return null;const i=s(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,o.offsetXYFromParent)(n||e,a,r.props.scale)},t.snapToGrid=function(e,t,r){const n=Math.round(t/e[0])*e[0],o=Math.round(r/e[1])*e[1];return[n,o]};var n=r(693),o=r(280);function s(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}},693:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let r=0,n=e.length;r0?t[0]:"object"===typeof t&&t.ideal?t.ideal:null};MediaStreamTrack.getSources((function(e){var t=null,i=null;e.forEach((function(e){"audio"===e.kind?t=e.id:"video"===e.kind&&(i=e.id)}));var a=s(r.audioConstraints);a&&(t=a);var l=s(r.videoConstraints);l&&(i=l),n(o(t),o(i))}))}},t.prototype.handleUserMedia=function(e,t){var r=this.props;if(e||!t)return this.setState({hasUserMedia:!1}),void r.onUserMediaError(e);this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch(n){this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}r.onUserMedia(t)},t.prototype.render=function(){var e=this,t=this.state,r=this.props,o=r.audio,a=(r.forceScreenshotSourceSize,r.disablePictureInPicture),l=(r.onUserMedia,r.onUserMediaError,r.screenshotFormat,r.screenshotQuality,r.minScreenshotWidth,r.minScreenshotHeight,r.audioConstraints,r.videoConstraints,r.imageSmoothing,r.mirrored),c=r.style,u=void 0===c?{}:c,d=r.children,p=i(r,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),h=l?s(s({},u),{transform:(u.transform||"")+" scaleX(-1)"}):u,w={getScreenshot:this.getScreenshot.bind(this)};return n.createElement(n.Fragment,null,n.createElement("video",s({autoPlay:!0,disablePictureInPicture:a,src:t.src,muted:!o,playsInline:!0,ref:function(t){e.video=t},style:h},p)),d&&d(w))},t.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},t}(n.Component);t.default=l},react:function(t,r){t.exports=e}}).default},e.exports=n(r(791))},374:(e,t,r)=>{"use strict";var n=r(791),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},117:(e,t)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,f={};function v(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||w}function k(){}function x(e,t,r){this.props=e,this.context=t,this.refs=f,this.updater=r||w}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=v.prototype;var m=x.prototype=new k;m.constructor=x,g(m,v.prototype),m.isPureReactComponent=!0;var y=Array.isArray,C=Object.prototype.hasOwnProperty,b={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,n){var o,s={},i=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)C.call(t,o)&&!M.hasOwnProperty(o)&&(s[o]=t[o]);var l=arguments.length-2;if(1===l)s.children=n;else if(1{"use strict";e.exports=r(117)},184:(e,t,r)=>{"use strict";e.exports=r(374)},813:(e,t)=>{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0>>1,o=e[n];if(!(0>>1;ns(l,r))cs(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[a]=r,n=a);else{if(!(cs(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function s(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,p=null,h=3,w=!1,g=!1,f=!1,v="function"===typeof setTimeout?setTimeout:null,k="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function m(e){for(var t=n(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function y(e){if(f=!1,m(e),!g)if(null!==n(c))g=!0,_(C);else{var t=n(u);null!==t&&E(y,t.startTime-e)}}function C(e,r){g=!1,f&&(f=!1,k(j),j=-1),w=!0;var s=h;try{for(m(r),p=n(c);null!==p&&(!(p.expirationTime>r)||e&&!V());){var i=p.callback;if("function"===typeof i){p.callback=null,h=p.priorityLevel;var a=i(p.expirationTime<=r);r=t.unstable_now(),"function"===typeof a?p.callback=a:p===n(c)&&o(c),m(r)}else o(c);p=n(c)}if(null!==p)var l=!0;else{var d=n(u);null!==d&&E(y,d.startTime-r),l=!1}return l}finally{p=null,h=s,w=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var b,M=!1,A=null,j=-1,Z=5,H=-1;function V(){return!(t.unstable_now()-He||125i?(e.sortIndex=s,r(u,e),null===n(c)&&e===n(u)&&(f?(k(j),j=-1):f=!0,E(y,s-i))):(e.sortIndex=a,r(c,e),g||w||(g=!0,_(C))),e},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}},296:(e,t,r)=>{"use strict";e.exports=r(813)},399:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"===typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"===typeof n.then)return n}var s=Object.create(null);r.r(s);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&o&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,r.d(s,i),s}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+e+".c6122c6f.chunk.js",r.miniCssF=e=>{},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="wwcalc:";r.l=(n,o,s,i)=>{if(e[n])e[n].push(o);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(h);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}}})(),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",(()=>{var e={179:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var s=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=s);var i=r.p+r.u(t),a=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var s=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",a.name="ChunkLoadError",a.type=s,a.request=i,o[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,s,i=n[0],a=n[1],l=n[2],c=0;if(i.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(l)l(r)}for(t&&t(n);c{"use strict";var e={};r.r(e),r.d(e,{hasBrowserEnv:()=>Xt,hasStandardBrowserEnv:()=>Kt,hasStandardBrowserWebWorkerEnv:()=>Qt});var t,n=r(791),o=r.t(n,2),s=r(250);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function w(e,r,n,o){void 0===o&&(o={});let{window:s=document.defaultView,v5Compat:c=!1}=o,h=s.history,w=t.Pop,g=null,f=v();function v(){return(h.state||{idx:null}).idx}function k(){w=t.Pop;let e=v(),r=null==e?null:e-f;f=e,g&&g({action:w,location:m.location,delta:r})}function x(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"===typeof e?e:p(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==f&&(f=0,h.replaceState(i({},h.state,{idx:f}),""));let m={get action(){return w},get location(){return e(s,h)},listen(e){if(g)throw new Error("A history only accepts one active listener");return s.addEventListener(a,k),g=e,()=>{s.removeEventListener(a,k),g=null}},createHref:e=>r(s,e),createURL:x,encodeLocation(e){let t=x(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,r){w=t.Push;let o=d(m.location,e,r);n&&n(o,e),f=v()+1;let i=u(o,f),a=m.createHref(o);try{h.pushState(i,"",a)}catch(l){if(l instanceof DOMException&&"DataCloneError"===l.name)throw l;s.location.assign(a)}c&&g&&g({action:w,location:m.location,delta:1})},replace:function(e,r){w=t.Replace;let o=d(m.location,e,r);n&&n(o,e),f=v();let s=u(o,f),i=m.createHref(o);h.replaceState(s,"",i),c&&g&&g({action:w,location:m.location,delta:0})},go:e=>h.go(e)};return m}var g;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function f(e,t,r){void 0===r&&(r="/");let n=S(("string"===typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let o=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let s=null;for(let i=0;null==s&&i{let i={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let a=z([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),v(e.children,t,c,a)),(null!=e.path||e.index)&&t.push({path:a,score:j(a,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of k(e.path))o(e,t,n);else o(e,t)})),t}function k(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(0===n.length)return o?[s,""]:[s];let i=k(n.join("/")),a=[];return a.push(...i.map((e=>""===e?s:[s,e].join("/")))),o&&a.push(...i),a.map((t=>e.startsWith("/")&&""===t?"/":t))}const x=/^:\w+$/,m=3,y=2,C=1,b=10,M=-2,A=e=>"*"===e;function j(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=M),t&&(n+=y),r.filter((e=>!A(e))).reduce(((e,t)=>e+(x.test(t)?m:""===t?C:b)),n)}function Z(e,t){let{routesMeta:r}=e,n={},o="/",s=[];for(let i=0;i(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let s=new RegExp(o,t?void 0:"i");return[s,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let s=o[0],i=s.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:o}=t;if("*"===n){let e=a[r]||"";i=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const l=a[r];return e[n]=o&&!l?void 0:function(e,t){try{return decodeURIComponent(e)}catch(r){return c(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l||"",n),e}),{}),pathname:s,pathnameBase:i,pattern:e}}function V(e){try{return decodeURI(e)}catch(t){return c(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function S(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function L(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function B(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function _(e,t){let r=B(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function E(e,t,r,n){let o;void 0===n&&(n=!1),"string"===typeof e?o=h(e):(o=i({},e),l(!o.pathname||!o.pathname.includes("?"),L("?","pathname","search",o)),l(!o.pathname||!o.pathname.includes("#"),L("#","pathname","hash",o)),l(!o.search||!o.search.includes("#"),L("#","search","hash",o)));let s,a=""===e||""===o.pathname,c=a?"/":o.pathname;if(null==c)s=r;else if(n){let e=0===t.length?[]:t[t.length-1].replace(/^\//,"").split("/");if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e.pop();o.pathname=t.join("/")}s="/"+e.join("/")}else{let e=t.length-1;if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"===typeof e?h(e):e,s=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:s,search:N(n),hash:O(o)}}(o,s),d=c&&"/"!==c&&c.endsWith("/"),p=(a||"."===c)&&r.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const z=e=>e.join("/").replace(/\/\/+/g,"/"),P=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function T(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const R=["post","put","patch","delete"],D=(new Set(R),["get",...R]);new Set(D),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),n.useCallback((function(n,o){void 0===o&&(o={}),r.current&&("number"===typeof n?e.navigate(n):e.navigate(n,I({fromRouteId:t},o)))}),[e,t])}():function(){K()||l(!1);let e=n.useContext(U),{basename:t,future:r,navigator:o}=n.useContext(q),{matches:s}=n.useContext(G),{pathname:i}=Y(),a=JSON.stringify(_(s,r.v7_relativeSplatPath)),c=n.useRef(!1);return Q((()=>{c.current=!0})),n.useCallback((function(r,n){if(void 0===n&&(n={}),!c.current)return;if("number"===typeof r)return void o.go(r);let s=E(r,JSON.parse(a),i,"path"===n.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:z([t,s.pathname])),(n.replace?o.replace:o.push)(s,n.state,n)}),[t,o,a,i,e])}()}function $(e,t){let{relative:r}=void 0===t?{}:t,{future:o}=n.useContext(q),{matches:s}=n.useContext(G),{pathname:i}=Y(),a=JSON.stringify(_(s,o.v7_relativeSplatPath));return n.useMemo((()=>E(e,JSON.parse(a),i,"path"===r)),[e,a,i,r])}function ee(e,r,o,s){K()||l(!1);let{navigator:i}=n.useContext(q),{matches:a}=n.useContext(G),c=a[a.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let p,w=Y();if(r){var g;let e="string"===typeof r?h(r):r;"/"===d||(null==(g=e.pathname)?void 0:g.startsWith(d))||l(!1),p=e}else p=w;let v=p.pathname||"/",k=f(e,{pathname:"/"===d?v:v.slice(d.length)||"/"});let x=se(k&&k.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:z([d,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:z([d,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,o,s);return r&&x?n.createElement(W.Provider,{value:{location:I({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:t.Pop}},x):x}function te(){let e=function(){var e;let t=n.useContext(X),r=ce(ae.UseRouteError),o=ue(ae.UseRouteError);if(void 0!==t)return t;return null==(e=r.errors)?void 0:e[o]}(),t=T(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:o};return n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:s},r):null,null)}const re=n.createElement(te,null);class ne extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?n.createElement(G.Provider,{value:this.props.routeContext},n.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oe(e){let{routeContext:t,match:r,children:o}=e,s=n.useContext(U);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),n.createElement(G.Provider,{value:t},o)}function se(e,t,r,o){var s;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===o&&(o=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let a=e,c=null==(s=r)?void 0:s.errors;if(null!=c){let e=a.findIndex((e=>e.route.id&&(null==c?void 0:c[e.route.id])));e>=0||l(!1),a=a.slice(0,Math.min(a.length,e+1))}let u=!1,d=-1;if(r&&o&&o.v7_partialHydration)for(let n=0;n=0?a.slice(0,d+1):[a[0]];break}}return a.reduceRight(((e,o,s)=>{let i,l=!1,p=null,h=null;var w;r&&(i=c&&o.route.id?c[o.route.id]:void 0,p=o.route.errorElement||re,u&&(d<0&&0===s?(w="route-fallback",!1||de[w]||(de[w]=!0),l=!0,h=null):d===s&&(l=!0,h=o.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,s+1)),f=()=>{let t;return t=i?p:l?h:o.route.Component?n.createElement(o.route.Component,null):o.route.element?o.route.element:e,n.createElement(oe,{match:o,routeContext:{outlet:e,matches:g,isDataRoute:null!=r},children:t})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===s)?n.createElement(ne,{location:r.location,revalidation:r.revalidation,component:p,error:i,children:f(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):f()}),null)}var ie=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ie||{}),ae=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ae||{});function le(e){let t=n.useContext(U);return t||l(!1),t}function ce(e){let t=n.useContext(F);return t||l(!1),t}function ue(e){let t=function(e){let t=n.useContext(G);return t||l(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||l(!1),r.route.id}const de={};o.startTransition;function pe(e){l(!1)}function he(e){let{basename:r="/",children:o=null,location:s,navigationType:i=t.Pop,navigator:a,static:c=!1,future:u}=e;K()&&l(!1);let d=r.replace(/^\/*/,"/"),p=n.useMemo((()=>({basename:d,navigator:a,static:c,future:I({v7_relativeSplatPath:!1},u)})),[d,u,a,c]);"string"===typeof s&&(s=h(s));let{pathname:w="/",search:g="",hash:f="",state:v=null,key:k="default"}=s,x=n.useMemo((()=>{let e=S(w,d);return null==e?null:{location:{pathname:e,search:g,hash:f,state:v,key:k},navigationType:i}}),[d,w,g,f,v,k,i]);return null==x?null:n.createElement(q.Provider,{value:p},n.createElement(W.Provider,{children:o,value:x}))}function we(e){let{children:t,location:r}=e;return ee(ge(t),r)}new Promise((()=>{}));n.Component;function ge(e,t){void 0===t&&(t=[]);let r=[];return n.Children.forEach(e,((e,o)=>{if(!n.isValidElement(e))return;let s=[...t,o];if(e.type===n.Fragment)return void r.push.apply(r,ge(e.props.children,s));e.type!==pe&&l(!1),e.props.index&&e.props.children&&l(!1);let i={id:e.props.id||s.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=ge(e.props.children,s)),r.push(i)})),r}var fe=r(164),ve=r.t(fe,2);function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[r]=e[r]);return o}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const me=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ye=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];const Ce=n.createContext({isTransitioning:!1});new Map;const be=o.startTransition;ve.flushSync;function Me(e){let{basename:t,children:r,future:o,window:s}=e,i=n.useRef();var a;null==i.current&&(i.current=(void 0===(a={window:s,v5Compat:!0})&&(a={}),w((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return d("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:p(t)}),null,a)));let l=i.current,[c,u]=n.useState({action:l.action,location:l.location}),{v7_startTransition:h}=o||{},g=n.useCallback((e=>{h&&be?be((()=>u(e))):u(e)}),[u,h]);return n.useLayoutEffect((()=>l.listen(g)),[l,g]),n.createElement(he,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:l,future:o})}const Ae="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,je=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ze=n.forwardRef((function(e,t){let r,{onClick:o,relative:s,reloadDocument:i,replace:a,state:c,target:u,to:d,preventScrollReset:h,unstable_viewTransition:w}=e,g=xe(e,me),{basename:f}=n.useContext(q),v=!1;if("string"===typeof d&&je.test(d)&&(r=d,Ae))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),r=S(t.pathname,f);t.origin===e.origin&&null!=r?d=r+t.search+t.hash:v=!0}catch(m){}let k=function(e,t){let{relative:r}=void 0===t?{}:t;K()||l(!1);let{basename:o,navigator:s}=n.useContext(q),{hash:i,pathname:a,search:c}=$(e,{relative:r}),u=a;return"/"!==o&&(u="/"===a?o:z([o,a])),s.createHref({pathname:u,search:c,hash:i})}(d,{relative:s}),x=function(e,t){let{target:r,replace:o,state:s,preventScrollReset:i,relative:a,unstable_viewTransition:l}=void 0===t?{}:t,c=J(),u=Y(),d=$(e,{relative:a});return n.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,r)){t.preventDefault();let r=void 0!==o?o:p(u)===p(d);c(e,{replace:r,state:s,preventScrollReset:i,relative:a,unstable_viewTransition:l})}}),[u,c,d,o,s,r,e,i,a,l])}(d,{replace:a,state:c,target:u,preventScrollReset:h,relative:s,unstable_viewTransition:w});return n.createElement("a",ke({},g,{href:r||k,onClick:v||i?o:function(e){o&&o(e),e.defaultPrevented||x(e)},ref:t,target:u}))}));const He=n.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:o=!1,className:s="",end:i=!1,style:a,to:c,unstable_viewTransition:u,children:d}=e,p=xe(e,ye),h=$(c,{relative:p.relative}),w=Y(),g=n.useContext(F),{navigator:f}=n.useContext(q),v=null!=g&&function(e,t){void 0===t&&(t={});let r=n.useContext(Ce);null==r&&l(!1);let{basename:o}=Le(Ve.useViewTransitionState),s=$(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=S(r.currentLocation.pathname,o)||r.currentLocation.pathname,a=S(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=H(s.pathname,a)||null!=H(s.pathname,i)}(h)&&!0===u,k=f.encodeLocation?f.encodeLocation(h).pathname:h.pathname,x=w.pathname,m=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;o||(x=x.toLowerCase(),m=m?m.toLowerCase():null,k=k.toLowerCase());const y="/"!==k&&k.endsWith("/")?k.length-1:k.length;let C,b=x===k||!i&&x.startsWith(k)&&"/"===x.charAt(y),M=null!=m&&(m===k||!i&&m.startsWith(k)&&"/"===m.charAt(k.length)),A={isActive:b,isPending:M,isTransitioning:v},j=b?r:void 0;C="function"===typeof s?s(A):[s,b?"active":null,M?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let Z="function"===typeof a?a(A):a;return n.createElement(Ze,ke({},p,{"aria-current":j,className:C,ref:t,style:Z,to:c,unstable_viewTransition:u}),"function"===typeof d?d(A):d)}));var Ve,Se;function Le(e){let t=n.useContext(U);return t||l(!1),t}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ve||(Ve={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Se||(Se={}));const Be=e=>e.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return r.addPlatform=(e,t)=>{r.platforms.set(e,t)},r.setPlatform=e=>{r.platforms.has(e)&&(r.currentPlatform=r.platforms.get(e))},r})(e),_e=Be("undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:{});_e.addPlatform,_e.setPlatform;var Ee;!function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"}(Ee||(Ee={}));class ze extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}const Pe=e=>{var t,r,n,o,s;const i=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},l=a.Plugins=a.Plugins||{},c=e.CapacitorPlatforms,u=(null===(t=null===c||void 0===c?void 0:c.currentPlatform)||void 0===t?void 0:t.getPlatform)||(()=>null!==i?i.name:(e=>{var t,r;return(null===e||void 0===e?void 0:e.androidBridge)?"android":(null===(r=null===(t=null===e||void 0===e?void 0:e.webkit)||void 0===t?void 0:t.messageHandlers)||void 0===r?void 0:r.bridge)?"ios":"web"})(e)),d=(null===(r=null===c||void 0===c?void 0:c.currentPlatform)||void 0===r?void 0:r.isNativePlatform)||(()=>"web"!==u()),p=(null===(n=null===c||void 0===c?void 0:c.currentPlatform)||void 0===n?void 0:n.isPluginAvailable)||(e=>{const t=w.get(e);return!!(null===t||void 0===t?void 0:t.platforms.has(u()))||!!h(e)}),h=(null===(o=null===c||void 0===c?void 0:c.currentPlatform)||void 0===o?void 0:o.getPluginHeader)||(e=>{var t;return null===(t=a.PluginHeaders)||void 0===t?void 0:t.find((t=>t.name===e))}),w=new Map,g=(null===(s=null===c||void 0===c?void 0:c.currentPlatform)||void 0===s?void 0:s.registerPlugin)||function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=w.get(e);if(r)return console.warn('Capacitor plugin "'.concat(e,'" already registered. Cannot register plugins twice.')),r.proxy;const n=u(),o=h(e);let s;const c=r=>{let l;const c=function(){for(var c=arguments.length,u=new Array(c),d=0;d(!s&&n in t?s=s="function"===typeof t[n]?await t[n]():t[n]:null!==i&&!s&&"web"in t&&(s=s="function"===typeof t.web?await t.web():t.web),s))().then((t=>{const s=((t,r)=>{var s,i;if(!o){if(t)return null===(i=t[r])||void 0===i?void 0:i.bind(t);throw new ze('"'.concat(e,'" plugin is not implemented on ').concat(n),Ee.Unimplemented)}{const n=null===o||void 0===o?void 0:o.methods.find((e=>r===e.name));if(n)return"promise"===n.rtype?t=>a.nativePromise(e,r.toString(),t):(t,n)=>a.nativeCallback(e,r.toString(),t,n);if(t)return null===(s=t[r])||void 0===s?void 0:s.bind(t)}})(t,r);if(s){const e=s(...u);return l=null===e||void 0===e?void 0:e.remove,e}throw new ze('"'.concat(e,".").concat(r,'()" is not implemented on ').concat(n),Ee.Unimplemented)}));return"addListener"===r&&(p.remove=async()=>l()),p};return c.toString=()=>"".concat(r.toString(),"() { [capacitor code] }"),Object.defineProperty(c,"name",{value:r,writable:!1,configurable:!1}),c},d=c("addListener"),p=c("removeListener"),g=(e,t)=>{const r=d({eventName:e},t),n=async()=>{const n=await r;p({eventName:e,callbackId:n},t)},o=new Promise((e=>r.then((()=>e({remove:n})))));return o.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await n()},o},f=new Proxy({},{get(e,t){switch(t){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return o?g:d;case"removeListener":return p;default:return c(t)}}});return l[e]=f,w.set(e,{name:e,proxy:f,platforms:new Set([...Object.keys(t),...o?[n]:[]])}),f};return a.convertFileSrc||(a.convertFileSrc=e=>e),a.getPlatform=u,a.handleError=t=>e.console.error(t),a.isNativePlatform=d,a.isPluginAvailable=p,a.pluginMethodNoop=(e,t,r)=>Promise.reject("".concat(r,' does not have an implementation of "').concat(t,'".')),a.registerPlugin=g,a.Exception=ze,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},Ne=(e=>e.Capacitor=Pe(e))("undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:{}),Oe=Ne.registerPlugin;Ne.Plugins;class Te{constructor(e){this.listeners={},this.retainedEventArguments={},this.windowListeners={},e&&(console.warn('Capacitor WebPlugin "'.concat(e.name,'" config object was deprecated in v3 and will be removed in v4.')),this.config=e)}addListener(e,t){let r=!1;this.listeners[e]||(this.listeners[e]=[],r=!0),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n),r&&this.sendRetainedArgumentsForEvent(e);return Promise.resolve({remove:async()=>this.removeListener(e,t)})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,r){const n=this.listeners[e];if(n)n.forEach((e=>e(t)));else if(r){let r=this.retainedEventArguments[e];r||(r=[]),r.push(t),this.retainedEventArguments[e]=r}}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"not implemented";return new Ne.Exception(e,Ee.Unimplemented)}unavailable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"not available";return new Ne.Exception(e,Ee.Unavailable)}async removeListener(e,t){const r=this.listeners[e];if(!r)return;const n=r.indexOf(t);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach((t=>{this.notifyListeners(e,t)})))}}const Re=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),De=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Ie extends Te{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach((e=>{if(e.length<=0)return;let[r,n]=e.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=De(r).trim(),n=De(n).trim(),t[r]=n})),t}async setCookie(e){try{const t=Re(e.key),r=Re(e.value),n="; expires=".concat((e.expires||"").replace("expires=","")),o=(e.path||"/").replace("path=",""),s=null!=e.url&&e.url.length>0?"domain=".concat(e.url):"";document.cookie="".concat(t,"=").concat(r||"").concat(n,"; path=").concat(o,"; ").concat(s,";")}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie="".concat(e.key,"=; Max-Age=0")}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,"=;expires=".concat((new Date).toUTCString(),";path=/"))}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Oe("CapacitorCookies",{web:()=>new Ie});const Ue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Object.assign({method:e.method||"GET",headers:e.headers},t),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.keys(e),r=Object.keys(e).map((e=>e.toLocaleLowerCase()));return r.reduce(((r,n,o)=>(r[n]=e[t[o]],r)),{})}(e.headers),o=n["content-type"]||"";if("string"===typeof e.data)r.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const t=new URLSearchParams;for(const[r,n]of Object.entries(e.data||{}))t.set(r,n);r.body=t.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const t=new FormData;if(e.data instanceof FormData)e.data.forEach(((e,r)=>{t.append(r,e)}));else for(const r of Object.keys(e.data))t.append(r,e.data[r]);r.body=t;const n=new Headers(r.headers);n.delete("content-type"),r.headers=n}else(o.includes("application/json")||"object"===typeof e.data)&&(r.body=JSON.stringify(e.data));return r};class Fe extends Te{async request(e){const t=Ue(e,e.webFetchExtra),r=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?Object.entries(e).reduce(((e,r)=>{const[n,o]=r;let s,i;return Array.isArray(o)?(i="",o.forEach((e=>{s=t?encodeURIComponent(e):e,i+="".concat(n,"=").concat(s,"&")})),i.slice(0,-1)):(s=t?encodeURIComponent(o):o,i="".concat(n,"=").concat(s)),"".concat(e,"&").concat(i)}),"").substr(1):null}(e.params,e.shouldEncodeUrlParams),n=r?"".concat(e.url,"?").concat(r):e.url,o=await fetch(n,t),s=o.headers.get("content-type")||"";let i,a,{responseType:l="text"}=o.ok?e:{};switch(s.includes("application/json")&&(l="json"),l){case"arraybuffer":case"blob":a=await o.blob(),i=await(async e=>new Promise(((t,r)=>{const n=new FileReader;n.onload=()=>{const e=n.result;t(e.indexOf(",")>=0?e.split(",")[1]:e)},n.onerror=e=>r(e),n.readAsDataURL(e)})))(a);break;case"json":i=await o.json();break;default:i=await o.text()}const c={};return o.headers.forEach(((e,t)=>{c[t]=e})),{data:i,headers:c,status:o.status,url:o.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Oe("CapacitorHttp",{web:()=>new Fe});var qe=r(184);const We=(0,n.createContext)(),Ge=e=>{let{children:t}=e;const[r,o]=(0,n.useState)(null),[s,i]=(0,n.useState)(!0),a=J();(0,n.useEffect)((()=>{const e=JSON.parse(localStorage.getItem("user"));e&&o(e),i(!1)}),[]);return s?(0,qe.jsx)("div",{children:"Loading..."}):(0,qe.jsx)(We.Provider,{value:{user:r,login:(e,t)=>{const r={userId:e,token:t};o(r),localStorage.setItem("user",JSON.stringify(r))},logout:()=>{localStorage.removeItem("user"),o(null),Ne.isNativePlatform()?a("/app"):a("/")}},children:t})},Xe=()=>(0,n.useContext)(We);function Ke(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ye}=Object.prototype,{getPrototypeOf:Qe}=Object,Je=($e=Object.create(null),e=>{const t=Ye.call(e);return $e[t]||($e[t]=t.slice(8,-1).toLowerCase())});var $e;const et=e=>(e=e.toLowerCase(),t=>Je(t)===e),tt=e=>t=>typeof t===e,{isArray:rt}=Array,nt=tt("undefined");const ot=et("ArrayBuffer");const st=tt("string"),it=tt("function"),at=tt("number"),lt=e=>null!==e&&"object"===typeof e,ct=e=>{if("object"!==Je(e))return!1;const t=Qe(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ut=et("Date"),dt=et("File"),pt=et("Blob"),ht=et("FileList"),wt=et("URLSearchParams");function gt(e,t){let r,n,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),rt(e))for(r=0,n=e.length;r0;)if(n=r[o],t===n.toLowerCase())return n;return null}const vt="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,kt=e=>!nt(e)&&e!==vt;const xt=(mt="undefined"!==typeof Uint8Array&&Qe(Uint8Array),e=>mt&&e instanceof mt);var mt;const yt=et("HTMLFormElement"),Ct=(e=>{let{hasOwnProperty:t}=e;return(e,r)=>t.call(e,r)})(Object.prototype),bt=et("RegExp"),Mt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};gt(r,((r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)})),Object.defineProperties(e,n)},At="abcdefghijklmnopqrstuvwxyz",jt="0123456789",Zt={DIGIT:jt,ALPHA:At,ALPHA_DIGIT:At+At.toUpperCase()+jt};const Ht=et("AsyncFunction"),Vt={isArray:rt,isArrayBuffer:ot,isBuffer:function(e){return null!==e&&!nt(e)&&null!==e.constructor&&!nt(e.constructor)&&it(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||it(e.append)&&("formdata"===(t=Je(e))||"object"===t&&it(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ot(e.buffer),t},isString:st,isNumber:at,isBoolean:e=>!0===e||!1===e,isObject:lt,isPlainObject:ct,isUndefined:nt,isDate:ut,isFile:dt,isBlob:pt,isRegExp:bt,isFunction:it,isStream:e=>lt(e)&&it(e.pipe),isURLSearchParams:wt,isTypedArray:xt,isFileList:ht,forEach:gt,merge:function e(){const{caseless:t}=kt(this)&&this||{},r={},n=(n,o)=>{const s=t&&ft(r,o)||o;ct(r[s])&&ct(n)?r[s]=e(r[s],n):ct(n)?r[s]=e({},n):rt(n)?r[s]=n.slice():r[s]=n};for(let o=0,s=arguments.length;o3&&void 0!==arguments[3]?arguments[3]:{};return gt(t,((t,n)=>{r&&it(t)?e[n]=Ke(t,r):e[n]=t}),{allOwnKeys:n}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&Qe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Je,kindOfTest:et,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(rt(e))return e;let t=e.length;if(!at(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:yt,hasOwnProperty:Ct,hasOwnProp:Ct,reduceDescriptors:Mt,freezeMethods:e=>{Mt(e,((t,r)=>{if(it(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];it(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return rt(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:ft,global:vt,isContextDefined:kt,ALPHABET:Zt,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.ALPHA_DIGIT,r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&it(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(lt(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=rt(e)?[]:{};return gt(e,((e,t)=>{const s=r(e,n+1);!nt(s)&&(o[t]=s)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:Ht,isThenable:e=>e&&(lt(e)||it(e))&&it(e.then)&&it(e.catch)};function St(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}Vt.inherits(St,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Vt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Lt=St.prototype,Bt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Bt[e]={value:e}})),Object.defineProperties(St,Bt),Object.defineProperty(Lt,"isAxiosError",{value:!0}),St.from=(e,t,r,n,o,s)=>{const i=Object.create(Lt);return Vt.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),St.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const _t=St;function Et(e){return Vt.isPlainObject(e)||Vt.isArray(e)}function zt(e){return Vt.endsWith(e,"[]")?e.slice(0,-2):e}function Pt(e,t,r){return e?e.concat(t).map((function(e,t){return e=zt(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Nt=Vt.toFlatObject(Vt,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Ot=function(e,t,r){if(!Vt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Vt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Vt.isUndefined(t[e])}))).metaTokens,o=r.visitor||c,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!==typeof Blob&&Blob)&&Vt.isSpecCompliantForm(t);if(!Vt.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Vt.isDate(e))return e.toISOString();if(!a&&Vt.isBlob(e))throw new _t("Blob is not supported. Use a Buffer instead.");return Vt.isArrayBuffer(e)||Vt.isTypedArray(e)?a&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,o){let a=e;if(e&&!o&&"object"===typeof e)if(Vt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Vt.isArray(e)&&function(e){return Vt.isArray(e)&&!e.some(Et)}(e)||(Vt.isFileList(e)||Vt.endsWith(r,"[]"))&&(a=Vt.toArray(e)))return r=zt(r),a.forEach((function(e,n){!Vt.isUndefined(e)&&null!==e&&t.append(!0===i?Pt([r],n,s):null===i?r:r+"[]",l(e))})),!1;return!!Et(e)||(t.append(Pt(o,r,s),l(e)),!1)}const u=[],d=Object.assign(Nt,{defaultVisitor:c,convertValue:l,isVisitable:Et});if(!Vt.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Vt.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),Vt.forEach(r,(function(r,s){!0===(!(Vt.isUndefined(r)||null===r)&&o.call(t,r,Vt.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])})),u.pop()}}(e),t};function Tt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Rt(e,t){this._pairs=[],e&&Ot(e,this,t)}const Dt=Rt.prototype;Dt.append=function(e,t){this._pairs.push([e,t])},Dt.toString=function(e){const t=e?function(t){return e.call(this,t,Tt)}:Tt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const It=Rt;function Ut(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ft(e,t,r){if(!t)return e;const n=r&&r.encode||Ut,o=r&&r.serialize;let s;if(s=o?o(t,r):Vt.isURLSearchParams(t)?t.toString():new It(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const qt=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Wt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gt={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:It,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Xt="undefined"!==typeof window&&"undefined"!==typeof document,Kt=(Yt="undefined"!==typeof navigator&&navigator.product,Xt&&["ReactNative","NativeScript","NS"].indexOf(Yt)<0);var Yt;const Qt="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,Jt={...e,...Gt};const $t=function(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Vt.isArray(n)?n.length:s,a)return Vt.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i;n[s]&&Vt.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],o)&&Vt.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n{t(function(e){return Vt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null};const er={transitional:Wt,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Vt.isObject(e);o&&Vt.isHTMLForm(e)&&(e=new FormData(e));if(Vt.isFormData(e))return n&&n?JSON.stringify($t(e)):e;if(Vt.isArrayBuffer(e)||Vt.isBuffer(e)||Vt.isStream(e)||Vt.isFile(e)||Vt.isBlob(e))return e;if(Vt.isArrayBufferView(e))return e.buffer;if(Vt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ot(e,new Jt.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Jt.isNode&&Vt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=Vt.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ot(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(Vt.isString(e))try{return(t||JSON.parse)(e),Vt.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||er.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Vt.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(o){if(r){if("SyntaxError"===o.name)throw _t.from(o,_t.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vt.forEach(["delete","get","head","post","put","patch"],(e=>{er.headers[e]={}}));const tr=er,rr=Vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),nr=Symbol("internals");function or(e){return e&&String(e).trim().toLowerCase()}function sr(e){return!1===e||null==e?e:Vt.isArray(e)?e.map(sr):String(e)}function ir(e,t,r,n,o){return Vt.isFunction(n)?n.call(this,t,r):(o&&(t=r),Vt.isString(t)?Vt.isString(n)?-1!==t.indexOf(n):Vt.isRegExp(n)?n.test(t):void 0:void 0)}class ar{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=or(t);if(!o)throw new Error("header name must be a non-empty string");const s=Vt.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=sr(e))}const s=(e,t)=>Vt.forEach(e,((e,r)=>o(e,r,t)));return Vt.isPlainObject(e)||e instanceof this.constructor?s(e,t):Vt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&rr[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&o(t,e,r),this}get(e,t){if(e=or(e)){const r=Vt.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Vt.isFunction(t))return t.call(this,e,r);if(Vt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=or(e)){const r=Vt.findKey(this,e);return!(!r||void 0===this[r]||t&&!ir(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=or(e)){const o=Vt.findKey(r,e);!o||t&&!ir(0,r[o],o,t)||(delete r[o],n=!0)}}return Vt.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ir(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Vt.forEach(this,((n,o)=>{const s=Vt.findKey(r,o);if(s)return t[s]=sr(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=sr(n),r[i]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),r=0;r{null!=r&&!1!==r&&(t[n]=e&&Vt.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,r]=e;return t+": "+r})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;ot.set(e))),t}static accessor(e){const t=(this[nr]=this[nr]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=or(e);t[n]||(!function(e,t){const r=Vt.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Vt.isArray(e)?e.forEach(n):n(e),this}}ar.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vt.reduceDescriptors(ar.prototype,((e,t)=>{let{value:r}=e,n=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(e){this[n]=e}}})),Vt.freezeMethods(ar);const lr=ar;function cr(e,t){const r=this||tr,n=t||r,o=lr.from(n.headers);let s=n.data;return Vt.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function ur(e){return!(!e||!e.__CANCEL__)}function dr(e,t,r){_t.call(this,null==e?"canceled":e,_t.ERR_CANCELED,t,r),this.name="CanceledError"}Vt.inherits(dr,_t,{__CANCEL__:!0});const pr=dr;const hr=Jt.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const i=[e+"="+encodeURIComponent(t)];Vt.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),Vt.isString(n)&&i.push("path="+n),Vt.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function wr(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const gr=Jt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=Vt.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};const fr=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[i];o||(o=l),r[s]=a,n[s]=l;let u=i,d=0;for(;u!==s;)d+=r[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,l=n(a);r=s;const c={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&s<=i?(i-s)/l:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const kr={http:null,xhr:"undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const o=lr.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(Vt.isFormData(n))if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const d=wr(e.baseURL,e.url);function p(){if(!u)return;const n=lr.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new _t("Request failed with status code "+r.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Ft(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(r(new _t("Request aborted",_t.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new _t("Network Error",_t.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Wt;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new _t(t,n.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,u)),u=null},Jt.hasStandardBrowserEnv&&(l&&Vt.isFunction(l)&&(l=l(e)),l||!1!==l&&gr(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&hr.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in u&&Vt.forEach(o.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),Vt.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&u.addEventListener("progress",vr(e.onDownloadProgress,!0)),"function"===typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",vr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{u&&(r(!t||t.type?new pr(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);h&&-1===Jt.protocols.indexOf(h)?r(new _t("Unsupported protocol "+h+":",_t.ERR_BAD_REQUEST,e)):u.send(n||null)}))}};Vt.forEach(kr,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}}));const xr=e=>"- ".concat(e),mr=e=>Vt.isFunction(e)||null===e||!1===e,yr=e=>{e=Vt.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let s=0;s{let[t,r]=e;return"adapter ".concat(t," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));let r=t?e.length>1?"since :\n"+e.map(xr).join("\n"):" "+xr(e[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Cr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pr(null,e)}function br(e){Cr(e),e.headers=lr.from(e.headers),e.data=cr.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return yr(e.adapter||tr.adapter)(e).then((function(t){return Cr(e),t.data=cr.call(e,e.transformResponse,t),t.headers=lr.from(t.headers),t}),(function(t){return ur(t)||(Cr(e),t&&t.response&&(t.response.data=cr.call(e,e.transformResponse,t.response),t.response.headers=lr.from(t.response.headers))),Promise.reject(t)}))}const Mr=e=>e instanceof lr?e.toJSON():e;function Ar(e,t){t=t||{};const r={};function n(e,t,r){return Vt.isPlainObject(e)&&Vt.isPlainObject(t)?Vt.merge.call({caseless:r},e,t):Vt.isPlainObject(t)?Vt.merge({},t):Vt.isArray(t)?t.slice():t}function o(e,t,r){return Vt.isUndefined(t)?Vt.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!Vt.isUndefined(t))return n(void 0,t)}function i(e,t){return Vt.isUndefined(t)?Vt.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Mr(e),Mr(t),!0)};return Vt.forEach(Object.keys(Object.assign({},e,t)),(function(n){const s=l[n]||o,i=s(e[n],t[n],n);Vt.isUndefined(i)&&s!==a||(r[n]=i)})),r}const jr="1.6.2",Zr={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Zr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Hr={};Zr.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new _t(n(o," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!Hr[o]&&(Hr[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};const Vr={assertOptions:function(e,t,r){if("object"!==typeof e)throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new _t("option "+s+" must be "+r,_t.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new _t("Unknown option "+s,_t.ERR_BAD_OPTION)}},validators:Zr},Sr=Vr.validators;class Lr{constructor(e){this.defaults=e,this.interceptors={request:new qt,response:new qt}}request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=Ar(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Vr.assertOptions(r,{silentJSONParsing:Sr.transitional(Sr.boolean),forcedJSONParsing:Sr.transitional(Sr.boolean),clarifyTimeoutError:Sr.transitional(Sr.boolean)},!1),null!=n&&(Vt.isFunction(n)?t.paramsSerializer={serialize:n}:Vr.assertOptions(n,{encode:Sr.function,serialize:Sr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Vt.merge(o.common,o[t.method]);o&&Vt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=lr.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[br.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new pr(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new _r((function(t){e=t}));return{token:t,cancel:e}}}const Er=_r;const zr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(zr).forEach((e=>{let[t,r]=e;zr[r]=t}));const Pr=zr;const Nr=function e(t){const r=new Br(t),n=Ke(Br.prototype.request,r);return Vt.extend(n,Br.prototype,r,{allOwnKeys:!0}),Vt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ar(t,r))},n}(tr);Nr.Axios=Br,Nr.CanceledError=pr,Nr.CancelToken=Er,Nr.isCancel=ur,Nr.VERSION=jr,Nr.toFormData=Ot,Nr.AxiosError=_t,Nr.Cancel=Nr.CanceledError,Nr.all=function(e){return Promise.all(e)},Nr.spread=function(e){return function(t){return e.apply(null,t)}},Nr.isAxiosError=function(e){return Vt.isObject(e)&&!0===e.isAxiosError},Nr.mergeConfig=Ar,Nr.AxiosHeaders=lr,Nr.formToJSON=e=>$t(Vt.isHTMLForm(e)?new FormData(e):e),Nr.getAdapter=yr,Nr.HttpStatusCode=Pr,Nr.default=Nr;const Or=Nr;var Tr=r(182);const Rr=e=>"number"==typeof e&&!isNaN(e),Dr=e=>"string"==typeof e,Ir=e=>"function"==typeof e,Ur=e=>Dr(e)||Ir(e)?e:null,Fr=e=>(0,n.isValidElement)(e)||Dr(e)||Ir(e)||Rr(e);function qr(e){let{enter:t,exit:r,appendPosition:o=!1,collapse:s=!0,collapseDuration:i=300}=e;return function(e){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:d,isIn:p}=e;const h=o?"".concat(t,"--").concat(l):t,w=o?"".concat(r,"--").concat(l):r,g=(0,n.useRef)(0);return(0,n.useLayoutEffect)((()=>{const e=d.current,t=h.split(" "),r=n=>{n.target===d.current&&(e.dispatchEvent(new Event("d")),e.removeEventListener("animationend",r),e.removeEventListener("animationcancel",r),0===g.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}),[]),(0,n.useEffect)((()=>{const e=d.current,t=()=>{e.removeEventListener("animationend",t),s?function(e,t,r){void 0===r&&(r=300);const{scrollHeight:n,style:o}=e;requestAnimationFrame((()=>{o.minHeight="initial",o.height=n+"px",o.transition="all ".concat(r,"ms"),requestAnimationFrame((()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,r)}))}))}(e,u,i):u()};p||(c?t():(g.current=1,e.className+=" ".concat(w),e.addEventListener("animationend",t)))}),[p]),n.createElement(n.Fragment,null,a)}}function Wr(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Gr={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const r=this.list.get(e).filter((e=>e!==t));return this.list.set(e,r),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach((t=>{const r=setTimeout((()=>{t(...[].slice.call(arguments,1))}),0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(r)}))}},Xr=e=>{let{theme:t,type:r,...o}=e;return n.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-".concat(r,")"),...o})},Kr={info:function(e){return n.createElement(Xr,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return n.createElement(Xr,{...e},n.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return n.createElement(Xr,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return n.createElement(Xr,{...e},n.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return n.createElement("div",{className:"Toastify__spinner"})}};function Yr(e){const[,t]=(0,n.useReducer)((e=>e+1),0),[r,o]=(0,n.useState)([]),s=(0,n.useRef)(null),i=(0,n.useRef)(new Map).current,a=e=>-1!==r.indexOf(e),l=(0,n.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:e=>i.get(e)}).current;function c(e){let{containerId:t}=e;const{limit:r}=l.props;!r||t&&l.containerId!==t||(l.count-=l.queue.length,l.queue=[])}function u(e){o((t=>null==e?[]:t.filter((t=>t!==e))))}function d(){const{toastContent:e,toastProps:t,staleId:r}=l.queue.shift();h(e,t,r)}function p(e,r){let{delay:o,staleId:a,...c}=r;if(!Fr(e)||function(e){return!s.current||l.props.enableMultiContainer&&e.containerId!==l.props.containerId||i.has(e.toastId)&&null==e.updateId}(c))return;const{toastId:p,updateId:w,data:g}=c,{props:f}=l,v=()=>u(p),k=null==w;k&&l.count++;const x={...f,style:f.toastStyle,key:l.toastKey++,...Object.fromEntries(Object.entries(c).filter((e=>{let[t,r]=e;return null!=r}))),toastId:p,updateId:w,data:g,closeToast:v,isIn:!1,className:Ur(c.className||f.toastClassName),bodyClassName:Ur(c.bodyClassName||f.bodyClassName),progressClassName:Ur(c.progressClassName||f.progressClassName),autoClose:!c.isLoading&&(m=c.autoClose,y=f.autoClose,!1===m||Rr(m)&&m>0?m:y),deleteToast(){const e=Wr(i.get(p),"removed");i.delete(p),Gr.emit(4,e);const r=l.queue.length;if(l.count=null==p?l.count-l.displayedToast:l.count-1,l.count<0&&(l.count=0),r>0){const e=null==p?l.props.limit:1;if(1===r||1===e)l.displayedToast++,d();else{const t=e>r?r:e;l.displayedToast=t;for(let e=0;ee in Kr)(r)&&(i=Kr[r](a))),i}(x),Ir(c.onOpen)&&(x.onOpen=c.onOpen),Ir(c.onClose)&&(x.onClose=c.onClose),x.closeButton=f.closeButton,!1===c.closeButton||Fr(c.closeButton)?x.closeButton=c.closeButton:!0===c.closeButton&&(x.closeButton=!Fr(f.closeButton)||f.closeButton);let C=e;(0,n.isValidElement)(e)&&!Dr(e.type)?C=(0,n.cloneElement)(e,{closeToast:v,toastProps:x,data:g}):Ir(e)&&(C=e({closeToast:v,toastProps:x,data:g})),f.limit&&f.limit>0&&l.count>f.limit&&k?l.queue.push({toastContent:C,toastProps:x,staleId:a}):Rr(o)?setTimeout((()=>{h(C,x,a)}),o):h(C,x,a)}function h(e,t,r){const{toastId:n}=t;r&&i.delete(r);const s={content:e,props:t};i.set(n,s),o((e=>[...e,n].filter((e=>e!==r)))),Gr.emit(4,Wr(s,null==s.props.updateId?"added":"updated"))}return(0,n.useEffect)((()=>(l.containerId=e.containerId,Gr.cancelEmit(3).on(0,p).on(1,(e=>s.current&&u(e))).on(5,c).emit(2,l),()=>{i.clear(),Gr.emit(3,l)})),[]),(0,n.useEffect)((()=>{l.props=e,l.isToastActive=a,l.displayedToast=r.length})),{getToastToRender:function(t){const r=new Map,n=Array.from(i.values());return e.newestOnTop&&n.reverse(),n.forEach((e=>{const{position:t}=e.props;r.has(t)||r.set(t,[]),r.get(t).push(e)})),Array.from(r,(e=>t(e[0],e[1])))},containerRef:s,isToastActive:a}}function Qr(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Jr(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function $r(e){const[t,r]=(0,n.useState)(!1),[o,s]=(0,n.useState)(!1),i=(0,n.useRef)(null),a=(0,n.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=(0,n.useRef)(e),{autoClose:c,pauseOnHover:u,closeToast:d,onClick:p,closeOnClick:h}=e;function w(t){if(e.draggable){"touchstart"===t.nativeEvent.type&&t.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",k),document.addEventListener("mouseup",x),document.addEventListener("touchmove",k),document.addEventListener("touchend",x);const r=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=r.getBoundingClientRect(),r.style.transition="",a.x=Qr(t.nativeEvent),a.y=Jr(t.nativeEvent),"x"===e.draggableDirection?(a.start=a.x,a.removalDistance=r.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=r.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function g(t){if(a.boundingRect){const{top:r,bottom:n,left:o,right:s}=a.boundingRect;"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&a.x>=o&&a.x<=s&&a.y>=r&&a.y<=n?v():f()}}function f(){r(!0)}function v(){r(!1)}function k(r){const n=i.current;a.canDrag&&n&&(a.didMove=!0,t&&v(),a.x=Qr(r),a.y=Jr(r),a.delta="x"===e.draggableDirection?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),n.style.transform="translate".concat(e.draggableDirection,"(").concat(a.delta,"px)"),n.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function x(){document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",x);const t=i.current;if(a.canDrag&&a.didMove&&t){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate".concat(e.draggableDirection,"(0)"),t.style.opacity="1"}}(0,n.useEffect)((()=>{l.current=e})),(0,n.useEffect)((()=>(i.current&&i.current.addEventListener("d",f,{once:!0}),Ir(e.onOpen)&&e.onOpen((0,n.isValidElement)(e.children)&&e.children.props),()=>{const e=l.current;Ir(e.onClose)&&e.onClose((0,n.isValidElement)(e.children)&&e.children.props)})),[]),(0,n.useEffect)((()=>(e.pauseOnFocusLoss&&(document.hasFocus()||v(),window.addEventListener("focus",f),window.addEventListener("blur",v)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",f),window.removeEventListener("blur",v))})),[e.pauseOnFocusLoss]);const m={onMouseDown:w,onTouchStart:w,onMouseUp:g,onTouchEnd:g};return c&&u&&(m.onMouseEnter=v,m.onMouseLeave=f),h&&(m.onClick=e=>{p&&p(e),a.canCloseOnClick&&d()}),{playToast:f,pauseToast:v,isRunning:t,preventExitTransition:o,toastRef:i,eventHandlers:m}}function en(e){let{closeToast:t,theme:r,ariaLabel:o="close"}=e;return n.createElement("button",{className:"Toastify__close-button Toastify__close-button--".concat(r),type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":o},n.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function tn(e){let{delay:t,isRunning:r,closeToast:o,type:s="default",hide:i,className:a,style:l,controlledProgress:c,progress:u,rtl:d,isIn:p,theme:h}=e;const w=i||c&&0===u,g={...l,animationDuration:"".concat(t,"ms"),animationPlayState:r?"running":"paused",opacity:w?0:1};c&&(g.transform="scaleX(".concat(u,")"));const f=(0,Tr.default)("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--".concat(h),"Toastify__progress-bar--".concat(s),{"Toastify__progress-bar--rtl":d}),v=Ir(a)?a({rtl:d,type:s,defaultClassName:f}):(0,Tr.default)(f,a);return n.createElement("div",{role:"progressbar","aria-hidden":w?"true":"false","aria-label":"notification timer",className:v,style:g,[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{p&&o()}})}const rn=e=>{const{isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:s}=$r(e),{closeButton:i,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:d,closeToast:p,transition:h,position:w,className:g,style:f,bodyClassName:v,bodyStyle:k,progressClassName:x,progressStyle:m,updateId:y,role:C,progress:b,rtl:M,toastId:A,deleteToast:j,isIn:Z,isLoading:H,iconOut:V,closeOnClick:S,theme:L}=e,B=(0,Tr.default)("Toastify__toast","Toastify__toast-theme--".concat(L),"Toastify__toast--".concat(u),{"Toastify__toast--rtl":M},{"Toastify__toast--close-on-click":S}),_=Ir(g)?g({rtl:M,position:w,type:u,defaultClassName:B}):(0,Tr.default)(B,g),E=!!b||!l,z={closeToast:p,type:u,theme:L};let P=null;return!1===i||(P=Ir(i)?i(z):(0,n.isValidElement)(i)?(0,n.cloneElement)(i,z):en(z)),n.createElement(h,{isIn:Z,done:j,position:w,preventExitTransition:r,nodeRef:o},n.createElement("div",{id:A,onClick:c,className:_,...s,style:f,ref:o},n.createElement("div",{...Z&&{role:C},className:Ir(v)?v({type:u}):(0,Tr.default)("Toastify__toast-body",v),style:k},null!=V&&n.createElement("div",{className:(0,Tr.default)("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!H})},V),n.createElement("div",null,a)),P,n.createElement(tn,{...y&&!E?{key:"pb-".concat(y)}:{},rtl:M,theme:L,delay:l,isRunning:t,isIn:Z,closeToast:p,hide:d,type:u,style:m,className:x,controlledProgress:E,progress:b||0})))},nn=function(e,t){return void 0===t&&(t=!1),{enter:"Toastify--animate Toastify__".concat(e,"-enter"),exit:"Toastify--animate Toastify__".concat(e,"-exit"),appendPosition:t}},on=qr(nn("bounce",!0)),sn=(qr(nn("slide",!0)),qr(nn("zoom")),qr(nn("flip")),(0,n.forwardRef)(((e,t)=>{const{getToastToRender:r,containerRef:o,isToastActive:s}=Yr(e),{className:i,style:a,rtl:l,containerId:c}=e;function u(e){const t=(0,Tr.default)("Toastify__toast-container","Toastify__toast-container--".concat(e),{"Toastify__toast-container--rtl":l});return Ir(i)?i({position:e,rtl:l,defaultClassName:t}):(0,Tr.default)(t,Ur(i))}return(0,n.useEffect)((()=>{t&&(t.current=o.current)}),[]),n.createElement("div",{ref:o,className:"Toastify",id:c},r(((e,t)=>{const r=t.length?{...a}:{...a,pointerEvents:"none"};return n.createElement("div",{className:u(e),style:r,key:"container-".concat(e)},t.map(((e,r)=>{let{content:o,props:i}=e;return n.createElement(rn,{...i,isIn:s(i.toastId),style:{...i.style,"--nth":r+1,"--len":t.length},key:"toast-".concat(i.key)},o)})))})))})));sn.displayName="ToastContainer",sn.defaultProps={position:"top-right",transition:on,autoClose:5e3,closeButton:en,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let an,ln=new Map,cn=[],un=1;function dn(){return""+un++}function pn(e){return e&&(Dr(e.toastId)||Rr(e.toastId))?e.toastId:dn()}function hn(e,t){return ln.size>0?Gr.emit(0,e,t):cn.push({content:e,options:t}),t.toastId}function wn(e,t){return{...t,type:t&&t.type||e,toastId:pn(t)}}function gn(e){return(t,r)=>hn(t,wn(e,r))}function fn(e,t){return hn(e,wn("default",t))}fn.loading=(e,t)=>hn(e,wn("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),fn.promise=function(e,t,r){let n,{pending:o,error:s,success:i}=t;o&&(n=Dr(o)?fn.loading(o,r):fn.loading(o.render,{...r,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(e,t,o)=>{if(null==t)return void fn.dismiss(n);const s={type:e,...a,...r,data:o},i=Dr(t)?{render:t}:t;return n?fn.update(n,{...s,...i}):fn(i.render,{...s,...i}),o},c=Ir(e)?e():e;return c.then((e=>l("success",i,e))).catch((e=>l("error",s,e))),c},fn.success=gn("success"),fn.info=gn("info"),fn.error=gn("error"),fn.warning=gn("warning"),fn.warn=fn.warning,fn.dark=(e,t)=>hn(e,wn("default",{theme:"dark",...t})),fn.dismiss=e=>{ln.size>0?Gr.emit(1,e):cn=cn.filter((t=>null!=e&&t.options.toastId!==e))},fn.clearWaitingQueue=function(e){return void 0===e&&(e={}),Gr.emit(5,e)},fn.isActive=e=>{let t=!1;return ln.forEach((r=>{r.isToastActive&&r.isToastActive(e)&&(t=!0)})),t},fn.update=function(e,t){void 0===t&&(t={}),setTimeout((()=>{const r=function(e,t){let{containerId:r}=t;const n=ln.get(r||an);return n&&n.getToast(e)}(e,t);if(r){const{props:n,content:o}=r,s={delay:100,...n,...t,toastId:t.toastId||e,updateId:dn()};s.toastId!==e&&(s.staleId=e);const i=s.render||o;delete s.render,hn(i,s)}}),0)},fn.done=e=>{fn.update(e,{progress:1})},fn.onChange=e=>(Gr.on(4,e),()=>{Gr.off(4,e)}),fn.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},fn.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Gr.on(2,(e=>{an=e.containerId||e,ln.set(an,e),cn.forEach((e=>{Gr.emit(0,e.content,e.options)})),cn=[]})).on(3,(e=>{ln.delete(e.containerId||e),0===ln.size&&Gr.off(0).off(1).off(5)}));r(399);Object.create(null);const vn={};function kn(){for(var e=arguments.length,t=new Array(e),r=0;r()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout((()=>{e.off("initialized",r)}),0),t()};e.on("initialized",r)}};function mn(e,t,r){e.loadNamespaces(t,xn(e,r))}function yn(e,t,r,n){"string"===typeof r&&(r=[r]),r.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,xn(e,n))}const Cn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bn={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"\u2026","…":"\u2026","/":"/","/":"/"},Mn=e=>bn[e];let An,jn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Cn,Mn)};const Zn={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jn={...jn,...e}}(e.options.react),function(e){An=e}(e)}},Hn=(0,n.createContext)();class Vn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Sn(e,t,r,n){return e.getFixedT(t,r,n)}function Ln(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:r}=t,{i18n:o,defaultNS:s}=(0,n.useContext)(Hn)||{},i=r||o||An;if(i&&!i.reportNamespaces&&(i.reportNamespaces=new Vn),!i){kn("You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>"string"===typeof t?t:t&&"object"===typeof t&&"string"===typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}i.options.react&&void 0!==i.options.react.wait&&kn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...jn,...i.options.react,...t},{useSuspense:l,keyPrefix:c}=a;let u=e||s||i.options&&i.options.defaultNS;u="string"===typeof u?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every((e=>function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:r.lng,precheck:(t,n)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=t.languages[0],o=!!t.options&&t.options.fallbackLng,s=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,r)=>{const n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};return!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(n,e)||!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!i(n,e)||o&&!i(s,e)))}(e,t,r):(kn("i18n.languages were undefined or empty",t.languages),!0)}(e,i,a))),p=function(e,t,r,o){return(0,n.useCallback)(Sn(e,t,r,o),[e,t,r,o])}(i,t.lng||null,"fallback"===a.nsMode?u:u[0],c),h=()=>p,w=()=>Sn(i,t.lng||null,"fallback"===a.nsMode?u:u[0],c),[g,f]=(0,n.useState)(h);let v=u.join();t.lng&&(v="".concat(t.lng).concat(v));const k=((e,t)=>{const r=(0,n.useRef)();return(0,n.useEffect)((()=>{r.current=t?r.current:e}),[e,t]),r.current})(v),x=(0,n.useRef)(!0);(0,n.useEffect)((()=>{const{bindI18n:e,bindI18nStore:r}=a;function n(){x.current&&f(w)}return x.current=!0,d||l||(t.lng?yn(i,t.lng,u,(()=>{x.current&&f(w)})):mn(i,u,(()=>{x.current&&f(w)}))),d&&k&&k!==v&&x.current&&f(w),e&&i&&i.on(e,n),r&&i&&i.store.on(r,n),()=>{x.current=!1,e&&i&&e.split(" ").forEach((e=>i.off(e,n))),r&&i&&r.split(" ").forEach((e=>i.store.off(e,n)))}}),[i,v]),(0,n.useEffect)((()=>{x.current&&d&&f(h)}),[i,c,d]);const m=[g,i,d];if(m.t=g,m.i18n=i,m.ready=d,d)return m;if(!d&&!l)return m;throw new Promise((e=>{t.lng?yn(i,t.lng,u,(()=>e())):mn(i,u,(()=>e()))}))}var Bn=r(641),_n=r.n(Bn),En=r(763),zn=r.n(En);function Pn(){let e="https://api.diabcalc.com/";return window.location.hostname.includes("localhost")&&(e="http://localhost:3001/"),Ne.isNativePlatform()&&(e="https://api.diabcalc.com/"),e}const Nn=()=>{const{user:e}=Xe(),t=J(),{t:r}=Ln(),[o,s]=(0,n.useState)(""),[i,a]=(0,n.useState)([]),[l,c]=(0,n.useState)([]),[u,d]=(0,n.useState)(null),[p,h]=(0,n.useState)(!0),[w,g]=(0,n.useState)(1),[f,v]=(0,n.useState)(!0),k=Pn(),x=(0,n.useRef)(!1),m=(0,n.useRef)(),y=(0,n.useRef)();(0,n.useEffect)((()=>{u&&(fn.error("".concat(r("errorOccurred"),": ").concat(u)),d(null))}),[u,r]);const C=(0,n.useCallback)((async()=>{if(!x.current){x.current=!0;try{const e=await Or.get("".concat(k,"search"),{params:{query:encodeURIComponent(o),page:w,limit:50},withCredentials:!0}),{success:t,products:r}=e.data;t?(a((e=>[...e,...r])),g((e=>e+1)),v(r.length>0)):d(e.data.message)}catch(u){console.error(u),d(u.message)}finally{x.current=!1}}}),[o,w,k]);(0,n.useEffect)((()=>{y.current&&(m.current&&m.current.disconnect(),m.current=new IntersectionObserver((e=>{e[0].isIntersecting&&f&&C()})),m.current.observe(y.current))}),[y,f,C]),(0,n.useEffect)((()=>{const e=zn().throttle((()=>{window.innerHeight+document.documentElement.scrollTop+100>=document.documentElement.offsetHeight&&f&&!x.current&&C()}),300);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}),[C,f]);const b=async e=>{try{g(1),v(!0);const t=await Or.get("".concat(k,"search"),{params:{query:encodeURIComponent(e),page:1,limit:50},withCredentials:!0}),{success:r,products:n}=t.data;r?(a(n),h(!1),g(2),v(n.length>0),H()):d(t.data.message)}catch(u){console.error(u),d(u.message)}},M=e=>e?parseFloat((e/10).toFixed(1)):null,A=(e,t)=>parseFloat((4*e+9*t)/100).toFixed(1),j=(e,t)=>{const r=parseFloat(t);return isNaN(r)||null===e?null:e*r/100},Z=e=>"number"===typeof e&&isFinite(e)?e.toFixed(1):r("noInformation"),H=()=>{var e=document.querySelector(".product-list");null!==e&&e.scrollTo({top:0,behavior:"smooth"})},V=async(e,n)=>{if(!e)return fn.error(r("mustBeLoggedInToAddProduct")),void t("/app/login");try{var o,s,i,a,l,c;const t=Math.floor(1e6*Math.random()),u=await Or.post("".concat(k,"addProductToList"),{userId:e.userId,productId:t,productJson:JSON.stringify({product_name:n.product_name||n.name,barcode:n.barcode||"",nutriments:{carbohydrates_100g:n.carbohydrates_per100||(null===(o=n.nutriments)||void 0===o?void 0:o.carbohydrates_100g)||(null===(s=n.nutriments)||void 0===s?void 0:s.carbohydrates)||0,proteins_100g:n.protein_per100||(null===(i=n.nutriments)||void 0===i?void 0:i.proteins_100g)||(null===(a=n.nutriments)||void 0===a?void 0:a.proteins)||0,fats_100g:n.fat_per100||(null===(l=n.nutriments)||void 0===l?void 0:l.fats_100g)||(null===(c=n.nutriments)||void 0===c?void 0:c.fat)||0}})},{headers:{Authorization:"Bearer ".concat(e.token)},withCredentials:!0}),{success:d,message:p}=u.data;d?fn.success("".concat(r("saved")," ").concat(n.product_name||n.name," ").concat(r("saved2"))):fn.error("".concat(r("errorOccurred"),": ").concat(p))}catch(u){console.error(u),fn.error(r("errorSaving"))}};return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"product-search",children:[p?(0,qe.jsxs)("div",{className:"search",children:[(0,qe.jsx)("input",{type:"text",value:o,onChange:e=>{const{value:t}=e.target;s(t)},onKeyDown:e=>{"Enter"===e.key&&b(o)},"aria-label":r("search")}),(0,qe.jsx)("button",{onClick:()=>b(o),children:r("search")}),l.length>0&&(0,qe.jsx)("ul",{className:"suggestions",children:l.map(((e,t)=>(0,qe.jsx)("li",{onClick:()=>(e=>{s(e.product_name),c([]),b(e.product_name)})(e),children:e.product_name},t)))})]}):(0,qe.jsx)("div",{className:"searchclick",children:(0,qe.jsx)("button",{onClick:()=>h(!0),children:(0,qe.jsx)(_n(),{size:"50px",name:"search-outline"})})}),0===i.length?(0,qe.jsx)("div",{className:"notfound",children:(0,qe.jsx)("p",{children:r("noProductsFound")})}):(0,qe.jsxs)("div",{className:"product-list",children:[i.map(((t,n)=>(0,qe.jsxs)("div",{className:"product-item",ref:i.length===n+1?y:null,children:[(0,qe.jsx)("h2",{className:"product-name-search",children:t.product_name||r("noname")}),(0,qe.jsx)("img",{src:t.image_url||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADICAYAAADBXvybAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE82lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSdhZG9iZTpuczptZXRhLyc+CiAgICAgICAgPHJkZjpSREYgeG1sbnM6cmRmPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjJz4KCiAgICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICAgICAgICB4bWxuczpkYz0naHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8nPgogICAgICAgIDxkYzp0aXRsZT4KICAgICAgICA8cmRmOkFsdD4KICAgICAgICA8cmRmOmxpIHhtbDpsYW5nPSd4LWRlZmF1bHQnPkJyYWsgb2JyYXprYSAtIDE8L3JkZjpsaT4KICAgICAgICA8L3JkZjpBbHQ+CiAgICAgICAgPC9kYzp0aXRsZT4KICAgICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KCiAgICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICAgICAgICB4bWxuczpBdHRyaWI9J2h0dHA6Ly9ucy5hdHRyaWJ1dGlvbi5jb20vYWRzLzEuMC8nPgogICAgICAgIDxBdHRyaWI6QWRzPgogICAgICAgIDxyZGY6U2VxPgogICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0nUmVzb3VyY2UnPgogICAgICAgIDxBdHRyaWI6Q3JlYXRlZD4yMDI0LTA4LTA2PC9BdHRyaWI6Q3JlYXRlZD4KICAgICAgICA8QXR0cmliOkV4dElkPjM1MzkwZmRmLTI3NDgtNDA4NS1iMWU3LWVkZDM0N2VlOWQ5YjwvQXR0cmliOkV4dElkPgogICAgICAgIDxBdHRyaWI6RmJJZD41MjUyNjU5MTQxNzk1ODA8L0F0dHJpYjpGYklkPgogICAgICAgIDxBdHRyaWI6VG91Y2hUeXBlPjI8L0F0dHJpYjpUb3VjaFR5cGU+CiAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgPC9yZGY6U2VxPgogICAgICAgIDwvQXR0cmliOkFkcz4KICAgICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KCiAgICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICAgICAgICB4bWxuczpwZGY9J2h0dHA6Ly9ucy5hZG9iZS5jb20vcGRmLzEuMy8nPgogICAgICAgIDxwZGY6QXV0aG9yPkthY3BlciBTaWtvcmE8L3BkZjpBdXRob3I+CiAgICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CgogICAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PScnCiAgICAgICAgeG1sbnM6eG1wPSdodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvJz4KICAgICAgICA8eG1wOkNyZWF0b3JUb29sPkNhbnZhIChSZW5kZXJlcik8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgICAgICAKICAgICAgICA8L3JkZjpSREY+CiAgICAgICAgPC94OnhtcG1ldGE+aZrkPgAAGI1JREFUeJzt3flzE+f9B/D3rmTr8IVl4wtsDmN8xmAOO5wTIIFMmRZ6JIWGBprml8y0/S/6V2SAZtppOtOZdkJoEogNsSnhKOADEh/IxsbIV4JlhI1tydJ+f/Dsfi3rsCRb2pX3/ZphBq20q49sv7XP7rP7PEJ3d7cEIlrVRLULIKL4Y9CJdIBBJ9IBBp1IBxh0Ih1g0Il0gEEn0gEGnUgHGHQiHWDQiXSAQSfSAQadSAcYdCIdYNCJdIBBJ9IBBp1IBxh0Ih1g0Il0gEEn0gGj2gWsBqIoIjMzExkZGUhNTYUoihAEQe2ykpIkSfD5fHC73Xj58iVcLhd8Pp/aZSU9Bn2Z1qxZg5ycHBgMBrVLWRUEQYDBYIDFYoHFYkFOTg6eP3+OiYkJtUtLagx6jARBQH5+PjIzM9UuZVUzGAzIy8uDyWTC2NgYJImDFseCx+gxstlsDHkCZWVlwWazqV1G0mLQY2AymfhHpwKbzQaTyaR2GUmJQY9Bbm4uT7apQBAE5Obmql1GUmLQoySKIqxWq9pl6JbVaoUo8s82WvyJRclsNnNvriJBEGA2m9UuI+kw6FFiN5r6+DuIHoMeJTYb1cffQfT4EyPSAQadSAcYdCIdYNApYdxuN65cuQKv16t2KbrDa90pIdxuN86fP4/e3l6Mjo7izJkzPKmWQPxJU9wtDDkAdHR04NNPP+XtpwnEoFNcLQ65rLW1Ff/85z9Vqkp/GHSKm1Ahl23atCnBFekXj9E14MWLF7hz5w4cDgdmZmbULiesjz76KKLXLRXyd999F/X19StZGoXBoKuss7MTf/vb3zA7O6t2KSuGIdceBl1Fw8PD+OSTTzA3N6d2KSuGIdcmHqOr6KuvvtJVyN955x2GXCUMuopCBSIZLRVyAGhoaEhgRbQQm+4qCnbiLdKTXVoSSchJXQy6xpSWlqpdQlQY8uTApjvFzOPxMORJgkGnmIQLOYfa0h4GnaImh9xutwd9/t13301wRbQUBp2islTIf/3rX2P37t0JroqWwqBTxBjy5MWgU0QY8uTGoNOSGPLkx350CitcyAVBwKlTp7Bz504VKqNoMOgU0lIhP336NHbs2KFCZRQtNt0pKIZ8dWHQKQBDvvow6OSHIV+deIxOiqVC/pvf/AZ1dXUqVEbLxaAnqc7OTnz33XdwOp3Izs5GTU0NKioqYt7eUiF/7733sH379uWUTCpi0JOM2+3Gp59+iocPH/otv337Nmpra3Hq1CmkpqZGtU2GfPXjMXoSke/9XhxyWUdHBy5cuACPxxPxNhlyfWDQk4TH48GFCxeWvPfbbrfj4sWLEY1Fx5DrB4OeBJa6BHWxnp4e/OUvfwkb9nDbFEURZ86cYchXEQZd48IF0mg04q233oLBYAh4rre3FyMjI1FvUw75tm3bll88aQZPxmnYUiE/d+4cKioqUFxcjE8++USZjjg1NRUffPAB1q9fH9U25ZDX1tau/IchVXGPrlGRhhwAqqqq8P7770MURaSmpuLDDz/Eli1botomQ766Gb/66iu1a0gqtbW1yM/Pj+t7eDweXLx4MaKQy6qrq3HmzBlkZGQEnbxwNYW8s7MTHR0dapeRVIxPnz5Vu4akUlxcHNftyyHv6ekJeC5UyGWhgrqaQg4ATqcT/LuNDo/RNSbWkIeyVMh/+9vf4rXXXou5XkoOPEbXGIac4sH49ttvq11DUgl2Jjue4hFyAMjLy8PWrVsj3p7X68Xo6CgAID8/P2iXXqJUVlYiIyNDtfdPRsaSkhK1a0gqWVlZCXuv5YT8woULYS+wGRkZwfnz5/Hhhx+GvTbe6/Xi6tWruHHjBtxuN4D57ruDBw+G7MOPt+zsbIgiG6PR4E9Lo5a7J3/8+PGSr+3r68P58+dDXhvvdrvx8ccfo6mpSQm5vLyxsREff/xxVNfVk3oYdA2KR3PdYDDAaAw899rb2xs07G63e8lWgd1ux/nz5/2+BEibGHSNiVfIz549iw8++CBo2O12u99db5E0/UOtS9rEoGtMvEJeVVWFrVu34ty5c0GPqx8/foyLFy9ieno67MU6kXxRkPYw6BoTr5Av3H6osPf09ODPf/5z0C4+eVvnzp0LGvbHjx8z7BrGoCexaEMuq6ysxNmzZ4OGfWZmJui2zp07h8rKSuWLIlTYL168yLBrEIOepGINuayqqgpnz55dsptK3lZlZaWyLFzY5XvhSVsY9CQU7qaXSEIuk+96C9UXHm5b4cLe3d0dwaegRGLQk0y4m16iCbmspqYGf/jDH7D4wqkNGzbgj3/8Y9hthQs7aQt/Q0lE7vYKdjFMLCGXFRcX409/+hNcLhecTidsNlvEl5jKYV9q6CpSF/foSULek690yBfKzMzEhg0bor6OnHt27eNvRkUfffRRRK9b6eZ6PHDPrm0MuopKS0uXfE0yhFzGsGsXm+4alkwhl8lhJ21h0DUqGUMuW84ccBQfDLoGJXPISZsYdI1hyCkeGHQNYcgpXhh0jWDIKZ4YdA1gyCneGHSVMeSUCLxgRkXhrl0HAIvFgubmZjQ3Nye4spWn5vDQxKCrZqmQA8Dk5CQmJycTWFX8xHu+OgqPTXcVRBLy1Wb37t1ql6BrDHqChbsLbbWqqqrCvn371C5D19h0T6BwJ95Wo9TUVOzfvx/Hjh3jzCoqY9ATJFzIRVHEL37xC6xdu1aFyuLDYrEgLy+P96hrBH8LCfLXv/41ZMjff/991NTUqFAV6QXbUwmyb9++gL2bKIo4e/YsQ05xx6AnSHl5OX73u98pYZdDXl1drXJlpAcMegKVl5fj97//PUwmE0NOCSV0d3dLaheRTLKyspZ98cf09DQsFssKVaQ/o6OjePHihdplJBXu0VXAkFOiMehEOsCgE+kAg06kAwx6lLxer9ol6B7HjI8egx4l/pGpj7+D6DHoUZqZmeFeXUVerxezs7Nql5F0GPQYsA9XPfzZx4ZBj8H4+DibjyqYm5vD+Pi42mUkJQY9Bj6fD8PDw5AkXlSYKJIkYXh4GD6fT+1SkhKDHqPp6Wk4HA4eryeA1+uFw+HA9PS02qUkLd6PvgyvXr3CwMAAcnJykJmZCUEQ1C5pVZEkCS6XC8+fP+eh0jLxppYVIooiMjIyYDQaGfhlkiQJc3NzePnyJZvqK4R79BXi8/l4Rpg0i8foRDrAoBPpAINOpAMMOpEOMOhEOsCgE+kAu9coYg8ePMCTJ08AAGvWrMGRI0dUrogixaBrzO3btzE6Ouq3TBAEGI1GWCwWZGdno6SkBDabLeG1TU1N4fnz5wl/X1o+Bl1jnE5nQNAXu3v3LkpLS/HGG2/AYDAkqDJKZjxGT1K9vb1obW1VuwxKEtyja1h+fj6OHTsGAJidnYXD4cCtW7eUO+Z6e3uxa9euJbczPT2N2dlZpKenB8z/JkkSpqam4Ha7lev12UpYfRh0DRNFEWazGQBgNpuRlZWF4eFh9Pb2Apgf1mqhq1evYmhoCCkpKTh9+jQmJyfR3NyM4eFhAMCbb76JzZs3AwAGBgbQ3d0Nh8MBj8fj957r1q1DQ0NDVOcBvF4vrly5grGxMQDzk1QcP34c6enpsf8AaMUw6ElmYbgzMjL8nvN4PHC73XC73RgcHERLS4vfPdzylwYAdHR0KF8AC/l8PgwODmJkZAQnT55Ednb2kjX5fD40NTXh2bNnAICUlBQcOXKEIdcQBl3DZmZm0NfXB2A+xA6HAw6HQ3m+qqoq5LqNjY0Bg2IsnApqx44d+PLLL7Fu3ToUFRXBarXC6XSio6MDPp8PHo8HbW1tOHToUNgaJUlCS0sL+vv7AQAGgwHHjh1Dbm5utB+X4ohB1zCn04nGxsaA5WlpaaitrUVFRUXIdb1eLzIzM7Fnzx4UFhZCFEWI4v+fe123bh3OnDnjt5cH5r9curq6ACDs2X/5WP/OnTvo6ekBMN8NePjwYRQVFUX+ISkhGPQkNDMzgx9++CHsrKyiKOL48eMBzfuFzGYzJEnCq1evMDMzg7m5Ob9BM9xud8h1TSYTenp60NHRoSzbv38/Nm3aFMMnonhj0DUsMzMTr732GoD5EVBHR0fR398Pr9cLu90Ol8uFEydOBB3RJj8/P2zInz59ikePHmFkZCSmYZqmpqZw48YN5fH69etRWVkZ9XYoMRh0DUtLS0N1dbXfsnv37uHBgwcAgLGxMfz4449Yu3ZtwLomkynkdh89eoRvv/3Wb1lmZibMZjOmp6fx8uXLJWtbfIXcs2fP8PTpU5SUlCy5LiUeL5hJMgUFBX6PXS5XVOt7vV7873//Ux7n5ubi9OnTOHXqFE6ePBn2BN9iqampfl8y169fx+TkZFT1UGIw6ElG7qeWpaSkRLX+y5cv/frNa2pq/Jr4kQbVbDbj5z//OY4ePaqc0JudncW1a9c4oKMGsemuYdPT07Db7QDm98Sjo6Po7u5WnjcYDMjPz49qm4uvjJuYmFD+Pzo6qpxBX0paWhqysrIAAAcPHsTVq1cBACMjI7h37x7q6+ujqovii0HXsImJCVy7di3k8zt37gx7LB5Meno60tPTlT13W1sb+vv7IQgCnE5nTJe/bty4EZWVlejs7FS2WVhYiOLi4qi3RfHBpnsSMpvN2L9/P7Zv3x7T+nv37vXrU5+YmIDT6YTJZMLx48eVPXU09uzZ47fe9evXMTU1FVN9tPK4R9eYLVu2IC8vL2C5IAhISUlBdnY2CgsLg+55y8rKlJN1a9asCfkeGzduxMmTJ9Hd3Q2XywWDwYDc3FxUVFTAarVi7969GBsbC2jml5SUwGq1AkBA/73RaMRbb72lDEwBzE9GmZaWFvmHp7jhTC1EOsCmO5EOMOhEOsCgE+kAg06kAww6kQ4w6EQ6wKAT6QCDTqQDDDqRDjDoRDrAoBPpAINOpAO8e01F//73v5XRWLZt24YtW7aoXFH0nj596jc01YkTJwLueiP18TeiovHxcWWShcXTKyULt9vtN1CkJPFmSC1i051IBxh0Ih1g032FyTOfeDweWCyWiMd0kydh8Pl8mJqagiAISEtLCzo5QygejweTk5OwWq1B31eekUUURaSlpUU9gmw8abm21YBBXyFTU1O4f/8+njx5gtnZWWW5zWbDtm3bUFZWFnZ9o9GIR48eobW1VZkBNT09Ha+//roy1bHs4cOHuH//PgDg+PHjyM7Oxs2bN/H48WP4fD5UV1dj3759AIDh4WF0dnbi2bNnfucBBEFAfn4+6uvr/caKHx8fx6VLl5b8vO+8805Ew0TdvXsX33//vfKeR44cwfr162OqjWLHpvsKcDqd+Ne//oWuri6/kAPzwbl+/TpaWlrCbqOnpwfffvut3zTHk5OTaGxs9BuHDZgf+lmeHnloaAhffvkluru7lTP4C8dz6+7uht1uDzjZJ0kSRkZGcPnyZQwNDfktl7cd7l8k2tvb0dbWpqxTX1+vhDyW2ih23KMvkyRJaGpqUgIqCAKKi4thtVoxPDyMFy9eAAC6urqQl5cXcgbU4eFhpKeno7i4GNPT08o0xABw8+ZNbNiwwW/kVtm9e/cCpkdeOENqXV0d7HY78vPzsX79emWo57a2Nng8Hvh8Pty7dw8/+9nPAMzPvrK4BQHMd6PJc7Slp6cveUjS3d2NO3fuKI93794dMDdbtLVR7Bj0ZRocHMT4+Ljy+ODBgygvLwcwf7z9+eefK9MPt7W1hQy61WrFL3/5SyVAra2tSv/0q1ev8OzZs6Dzmnm9XhiNRjQ0NGDTpk0wm81+M6VkZWXhvffeCzrrqrz9sbExSJIEQRCQkZGBN9980+913d3dyjztcvM7VF+5wWBAf3+/XwumpqYGdXV1Aa+NtjaKHZvuy+RwOJT/m0wmbN26VXksiqLfJIkul8tvZpSFNm3a5LeXrKmp8duD//DDDyFrOHjwIKqrq2G1WiGKYkAILRaLcpJwfHwcY2Njfl8GPp8voFUgm5iYwM2bN5XHu3btCjk7TEpKijLphNyfXlZWhj179oSsfTm1UeS4R1+mhTOPZmVlBex5Fo+v7nK5go65vniK45SUFKSlpSnbDzUZgiiKQZvastHRUbS3t2NoaCjiY2vZ3NwcGhsblSb7unXrwk4aIYoivv76a+X1qampOHDgQMi98XJqo+gw6Mu0cG7xYMfQiydaCLV3ChaGheuGWi8lJSXo+wJAf38/vv76a7+r1dLT02GxWODxeEK2LmS3b99WDkssFgsOHToUtgk9OzvrdzLS7Xbj/v37aGhoWPHaKDoM+jItPPEV7DLWxcsWvn6hxWfrAfidgY92jjUAuHPnjhKk9PR0vP3227DZbACA3t5eNDU1hVz3yZMnSrcYALzxxhvKLC3hCIKAwsJC5Wx5e3s7CgsLA84vLKc2ih6P0Zdp4fzgL168CGhiL+weEgQBOTk5QbczPDzs93hsbMwv/NHOh+b1epUz/gBQUVGhBAkIfSgAzB+ONDc3K4+3bdsW8YSJR48exfHjx/36v7/55hu/91tObRQbBn2ZSktLlSa2JEn45ptv4HK54PV6MTAwgI6ODuW1JSUlSE1NDbqd4eFhtLW1YWZmBhMTE7hx44bf8wv7nyMhimLARIoL/7+wroV8Ph+uXbumHDOvWbMG1dXVePXqld+/UIcSRUVFEAQBhw4dUj7rzMwMmpqalJNssdZGsWPTfZmsVivq6upw7949APNn4f/xj38EvE7uAgvn7t27uHv3bsDyjRs3Rr1Hl68uk1sKdrsdY2NjSElJwfj4eMhj7e+//17pDgTmg/f3v/894HVHjx7Fxo0bQ75/RkYGDhw4oDTBR0ZGcP/+fezevTvm2ih23KOvgLq6OuzYsSPkH6jVasVPfvKTkDOcGgwGHDp0KGjftM1mw4EDB2Kqq6GhwW+bLpcLz58/hyiKfpeiLrTwvMBylZaW+l3629raimfPnsVcG8WOe/QVIAgCdu3ahbKyMtjtduU+c4vFgoKCApSWlgYNcV1dHSRJQkZGhjLlcVdXF8bHx2EwGFBYWIiKioqAM/cFBQXYuXMngMCz+gvl5eXhV7/6FTo7O+F0OiEIArKzs1FeXo6srCykpaUpfeJyU7qoqCjkWfyF5C8tm82m1LJwO7J9+/YhMzNTeexyuWKujWLHaZOJdIBflUQ6wKAT6QCDTqQDDDqRDjDoRDrA7jUV+Hw+tLa2ql2GKurq6thdpgL+xIl0gP3oRDrAPTqRDjDoRDrAoGuQ1+vF0NAQRkZGlGU+nw9DQ0MR33Ti8XjQ1NTE4ZIJAIOuSbOzs7h8+TIuXbqEwcFBAPPhj2acc0mSMDs7y4EVCQC71zTNZDLh1q1bWLduXcBz09PT+O677zA5OamMF7+w20oezUae2uju3bsoKSnBwMAA3G43KisrMTExAYfDgdzcXFRVVUEQBPT398PhcMDj8aCwsFAZunpoaAh9fX2QJAmpqakwmUzYvn07nj9/jq6uLni9XpSWlgatldTHPbqGbdu2DRMTE3j06JHfcp/Ph8uXL6Orqws+nw+3bt3yG5IZmG+6t7e3K8NEP3z4EF988QWmpqbQ19eHS5cuoaOjAy6XCzdv3lQmjJAPFwRBQHNzM/r6+jAxMYH//Oc/SE1NhSAIaG9vh9VqhcvlwmeffYbJyUkIgoAvvvjCb9AK0g4GXcNsNhvKysrw4MEDv0Emx8bG4HQ68frrr+Pw4cMoLy9HT0+P33jowZSUlCivn5ubw7Fjx3D48GEA/3+feFVVFdauXYvs7GwA8yPMTE5OQpIkbNq0CRs2bAAAZGdno6+vD3NzcygoKEBOTg6MRiMGBgbi8aOgZWLTXePq6+vx5MkTPHjwQFkmDzEtjwxrNpvh9Xrh9XrDXnUmj+IqD4JhtVr9xlMfHR3F559/jqKiIhQWFirLCwsLkZeXhytXrkCSJJSUlCAnJ0eZE04eOGLz5s0hB78kdTHoGpeWlobt27crs6cCQG5uLgwGA+x2O6xWKwYGBpCVlbXkVMOLh7pa/PjHH3+Ez+fDzp07A4affvHiBWpqalBUVASbzQZRFJGbmwtgfsSbzZs3Y2JiIqIZVinxGPQkUFtbi66uLkxOTgKY34MfPHhQmSo5LS0tYL60WJSUlODBgwf47LPPUFBQoARZkiSYzWbcv39f+cJpaGhAbW0tqqur8d///hctLS1ISUnBT3/6U4Zdg3gJbBLz+XyYnZ2F2WxesZFTfT4f3G6330QTzc3NcLlcOHz4MERRREtLC2ZmZnDixAkA84cS8jq8YUWbuEdPYqIoBp2JdLnbXDybjMlkwvj4OFpbW+F2u+FwOLB3717leaPRGHJ2VdIG7tFpSZIkYXBwEC6XC0ajEYWFhVGPM0/q4tcwLUkQhKBzs1Py4AEVkQ4w6EQ6wKAT6QCDTqQD/wcuaXCjOJvC6gAAAABJRU5ErkJggg==",alt:t.product_name}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)("button",{className:"search-link",onClick:()=>V(e,t),children:(0,qe.jsx)(_n(),{name:"bookmark"})}),(0,qe.jsx)("button",{className:"search-link",disabled:!0,children:(0,qe.jsx)(_n(),{name:"restaurant"})})]}),void 0!==t.is_gluten_free?t.is_gluten_free?(0,qe.jsx)("p",{className:"text-search-info",children:r("glutenFree")}):(0,qe.jsx)("p",{className:"text-search-info",children:r("containsGluten")}):(0,qe.jsx)("p",{}),(0,qe.jsx)("p",{className:"text-search-info",children:t.info||r("No information")}),(0,qe.jsxs)("table",{className:"table",children:[(0,qe.jsx)("thead",{children:(0,qe.jsxs)("tr",{className:"bold",children:[(0,qe.jsx)("th",{children:r("nutritionalValue")}),(0,qe.jsx)("th",{children:r("per100g")}),(0,qe.jsx)("th",{className:"table-item",children:"".concat(r("perServing")," ").concat(t.serving_size||"")})]})}),(0,qe.jsxs)("tbody",{children:[(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:r("carbohydrates")}),(0,qe.jsx)("td",{children:Z(t.nutriments.carbohydrates)}),(0,qe.jsx)("td",{children:Z(j(t.nutriments.carbohydrates,t.serving_size))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:r("protein")}),(0,qe.jsx)("td",{children:Z(t.nutriments.proteins)}),(0,qe.jsx)("td",{children:Z(j(t.nutriments.proteins,t.serving_size))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:r("fat")}),(0,qe.jsx)("td",{children:Z(t.nutriments.fat)}),(0,qe.jsx)("td",{children:Z(j(t.nutriments.fat,t.serving_size))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsxs)("td",{children:[(0,qe.jsx)(_n(),{name:"flash",className:"text-search"}),r("exchange")]}),(0,qe.jsx)("td",{children:M(t.nutriments.carbohydrates)}),(0,qe.jsx)("td",{children:M(j(t.nutriments.carbohydrates,t.serving_size))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsxs)("td",{children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text-search"}),r("fpu")]}),(0,qe.jsx)("td",{children:A(t.nutriments.proteins,t.nutriments.fat)}),(0,qe.jsx)("td",{children:A(j(t.nutriments.proteins,t.serving_size),j(t.nutriments.fat,t.serving_size))})]})]})]})]},n))),(0,qe.jsx)("div",{className:"spacer"})]})]})]})},On=(e,t)=>t.some((t=>e instanceof t));let Tn,Rn;const Dn=new WeakMap,In=new WeakMap,Un=new WeakMap;let Fn={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Dn.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Xn(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function qn(e){Fn=e(Fn)}function Wn(e){return(Rn||(Rn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,r=new Array(t),n=0;n{const n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),n()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));Dn.set(e,t)}(e),On(e,Tn||(Tn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Fn):e)}function Xn(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(Xn(e.result)),n()},s=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",s)}));return Un.set(t,e),t}(e);if(In.has(e))return In.get(e);const t=Gn(e);return t!==e&&(In.set(e,t),Un.set(t,e)),t}const Kn=e=>Un.get(e);const Yn=["get","getKey","getAll","getAllKeys","count"],Qn=["put","add","delete","clear"],Jn=new Map;function $n(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(Jn.get(t))return Jn.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=Qn.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!Yn.includes(r))return;const s=async function(e){const t=this.transaction(e,o?"readwrite":"readonly");let s=t.store;for(var i=arguments.length,a=new Array(i>1?i-1:0),l=1;l({...e,get:(t,r,n)=>$n(t,r)||e.get(t,r,n),has:(t,r)=>!!$n(t,r)||e.has(t,r)})));const eo=["continue","continuePrimaryKey","advance"],to={},ro=new WeakMap,no=new WeakMap,oo={get(e,t){if(!eo.includes(t))return e[t];let r=to[t];return r||(r=to[t]=function(){ro.set(this,no.get(this)[t](...arguments))}),r}};async function*so(){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...arguments)),!e)return;const t=new Proxy(e,oo);for(no.set(t,e),Un.set(t,Kn(e));e;)yield t,e=await(ro.get(t)||e.continue()),ro.delete(t)}function io(e,t){return t===Symbol.asyncIterator&&On(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&On(e,[IDBIndex,IDBObjectStore])}qn((e=>({...e,get:(t,r,n)=>io(t,r)?so:e.get(t,r,n),has:(t,r)=>io(t,r)||e.has(t,r)})));const ao=async()=>function(e,t){let{blocked:r,upgrade:n,blocking:o,terminated:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),a=Xn(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(Xn(i.result),e.oldVersion,e.newVersion,Xn(i.transaction),e)})),r&&i.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}("MealDB",1,{upgrade(e){e.objectStoreNames.contains("meals")||e.createObjectStore("meals",{keyPath:"userId"})}}),lo=()=>{const{t:e}=Ln(),[t,r]=(0,n.useState)([]),[o,s]=(0,n.useState)({}),[i,a]=(0,n.useState)({}),[l,c]=(0,n.useState)(0),[u,d]=(0,n.useState)(0),{user:p}=Xe(),[h,w]=(0,n.useState)({}),g=J(),f=Pn(),[v,k]=(0,n.useState)(!1),[x,m]=(0,n.useState)(null),y=(0,n.useCallback)((async()=>{try{if(!p)return console.error("User not available. Redirecting to login..."),void g("/app/login");if(k(!0),m(null),navigator.onLine){const e=p.token,t={Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},n=p.userId,o=await Or.get("".concat(f,"getProductsInList/").concat(n),{headers:t});if(!o.data.success)throw new Error("Server responded with an error.");{const e=o.data.mealProducts||[];r(e),Ne.isNativePlatform()&&await(async(e,t)=>{const r=(await ao()).transaction("meals","readwrite");await r.store.put({userId:e,meals:t}),await r.done})(n,e)}}else if(Ne.isNativePlatform()){const e=await(async e=>{const t=await ao();return await t.get("meals",e)})(p.userId);e?r(e.meals||[]):console.log("No offline data available")}}catch(x){console.error("An error occurred during communication with the server:",x),m(e("fetchError"))}finally{k(!1)}}),[p,g,e]);(0,n.useEffect)((()=>{y()}),[y]);const C=(e,t)=>{const r=parseFloat(t);return isNaN(r)||null===e?null:e*r/100},b=(0,n.useCallback)(((e,r)=>{if(!isNaN(r)&&r>=0){const n=t.find((t=>t.Id===e)),o=JSON.parse(n.json).nutriments,s=(null===o||void 0===o?void 0:o.carbohydrates_100g)||0,i=(null===o||void 0===o?void 0:o.proteins_100g)||0,a=(null===o||void 0===o?void 0:o.fats_100g)||0,l=Z(C(s,r)),c=j(C(i,r),C(a,r));A(e,c),M(e,l)}else s((t=>({...t,[e]:null}))),a((t=>({...t,[e]:null})))}),[t]),M=(e,t)=>{s((r=>{const n={...r,[e]:null!==t&&void 0!==t?t:"0.0"},o=Object.values(n).reduce(((e,t)=>e+(parseFloat(t)||0)),0);return c(parseFloat(o.toFixed(1))),n}))},A=(e,t)=>{a((r=>{const n={...r,[e]:t},o=Object.values(n).reduce(((e,t)=>e+(parseFloat(t)||0)),0);return d(parseFloat(o.toFixed(1))),n}))},j=(e,t)=>parseFloat((4*e+9*t)/100).toFixed(1),Z=e=>e?parseFloat((e/10).toFixed(1)):null,H=t=>{try{const r=JSON.parse(t.json).nutriments;return r&&void 0!==r.carbohydrates_100g?Z(r.carbohydrates_100g):e("noInformation")}catch(x){return console.error("Error parsing JSON:",x),e("dataError")}},V=t=>{try{const r=JSON.parse(t.json).nutriments;return r&&void 0!==r.proteins_100g&&void 0!==r.fats_100g?j(r.proteins_100g,r.fats_100g):e("noInformation")}catch(x){return console.error("Error parsing JSON:",x),e("dataError")}};return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h2",{className:"meal-title",children:e("ListTitle")}),v&&(0,qe.jsxs)("div",{className:"syncing-indicator",children:[(0,qe.jsx)(_n(),{name:"sync",className:"sync-icon",size:24,spin:!0}),(0,qe.jsx)("span",{children:e("syncing")})]}),x&&(0,qe.jsx)("p",{className:"error-message",children:x}),(0,qe.jsx)("h3",{children:e("information")}),(0,qe.jsxs)("p",{className:"meal-total-cu",children:[(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20})," ",e("totalCU")," ",(()=>{const e=t.reduce(((e,t)=>e+Z(JSON.parse(t.json).nutriments.carbohydrates_100g)),0);return parseFloat(e.toFixed(1))})()]}),(0,qe.jsxs)("p",{className:"meal-total-cu",children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text",size:20})," ",e("totalFPU100")," ",(()=>{const e=t.reduce(((e,t)=>e+j(JSON.parse(t.json).nutriments.proteins_100g,JSON.parse(t.json).nutriments.fats_100g)),0);return parseFloat(e).toFixed(1)})()]}),(0,qe.jsxs)("p",{className:"total-ww-for-calculator",children:[(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20})," ",e("totalWW")," ",l]}),(0,qe.jsxs)("p",{className:"total-ww-for-calculator",children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text",size:20})," ",e("totalFPU")," ",u]}),(0,qe.jsx)("div",{className:"meal-products",children:t.map((n=>(0,qe.jsxs)("div",{className:"meal-product",children:[(0,qe.jsx)("h3",{className:"product-name",children:JSON.parse(n.json).product_name}),(0,qe.jsxs)("p",{className:"product-cu",children:[(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20})," ",e("carbsExPer100g"),": ",H(n)]}),(0,qe.jsxs)("p",{className:"product-cu",children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text",size:20})," ",e("FPUPer100g"),": ",V(n)]}),(0,qe.jsxs)("div",{className:"calculator",children:[(0,qe.jsx)("h3",{children:e("calculatorTitle")}),(0,qe.jsxs)("label",{children:[e("gramInputLabel"),(0,qe.jsx)("input",{type:"number",value:h[n.Id]||"",onChange:e=>w({...h,[n.Id]:e.target.value})})]}),(0,qe.jsx)("button",{onClick:()=>b(n.Id,parseFloat(h[n.Id])),children:e("calculateWWBtn")}),null!==o[n.Id]&&(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20})," ",e("calculatedWWLabel")," ",o[n.Id]]}),null!==i[n.Id]&&(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text",size:20})," ",e("calculatedFPULabel")," ",i[n.Id]]})]}),navigator.onLine&&(0,qe.jsx)("button",{className:"product-remove-btn",onClick:()=>(async e=>{try{const n=p.token,s={Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},a=await Or.delete("".concat(f,"removeProductFromList/").concat(e),{headers:s});if(!a.data.success)return void console.error("Server error: ".concat(a.status," - ").concat(a.statusText));const l=t.filter((t=>t.Id!==e));r(l);const u=Object.values(o).reduce(((e,t)=>e+(parseFloat(t)||0)),0);c(parseFloat(u.toFixed(1)));const h=Object.values(i).reduce(((e,t)=>e+(parseFloat(t)||0)),0);d(parseFloat(h.toFixed(1)))}catch(x){console.error("Error removing product from meal:",x)}})(n.Id),children:e("removeFromMealBtn")})]},n.Id)))}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)(Ze,{className:"search-link",to:"/app/search",children:(0,qe.jsx)(_n(),{name:"search"})}),(0,qe.jsx)(Ze,{className:"search-link",to:"/app/scanner",children:(0,qe.jsx)(_n(),{name:"scan"})}),(0,qe.jsx)(Ze,{className:"search-link",to:"/app/calc",children:(0,qe.jsx)(_n(),{name:"calculator"})})]})]})]})};var co=function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(i,a)}l((n=n.apply(e,t||[])).next())}))};const uo=new class extends Te{constructor(){super({name:"Permissions",platforms:["web"]}),this.requestPermission=e=>co(this,void 0,void 0,(function*(){return{status:e.permission}})),this.checkStatus=e=>co(this,void 0,void 0,(function*(){return{status:e.permission}}))}};((e,t)=>{var r;const n=t.config,o=e.Plugins;if(!(null===n||void 0===n?void 0:n.name))throw new Error('Capacitor WebPlugin is using the deprecated "registerWebPlugin()" function, but without the config. Please use "registerPlugin()" instead to register this web plugin."');console.warn('Capacitor plugin "'.concat(n.name,'" is using the deprecated "registerWebPlugin()" function')),o[n.name]&&!(null===(r=null===n||void 0===n?void 0:n.platforms)||void 0===r?void 0:r.includes(e.getPlatform()))||(o[n.name]=t)})(Ne,uo);var po=r(97),ho=r.n(po),wo=r(87),go=r.n(wo);const fo=r.p+"static/media/scansoundgood.a194cd079a32d8ca571b.mp3",vo=r.p+"static/media/scansoundbad.23359985b300ca2c64ae.mp3",ko=r.p+"static/media/scansounddetected.abad0b38c994ad681e81.mp3",xo=()=>{const e=(0,n.useRef)(null),[t,r]=(0,n.useState)(null),[o,s]=(0,n.useState)(null),{t:i}=Ln();(0,n.useCallback)((()=>{const r=e.current.getScreenshot();r&&(s(r),"scan"===t?console.log("Scan Image Captured"):"analyze"===t&&console.log("AI Analyze Image Captured"))}),[e,t]);return(0,qe.jsx)("div",{className:"camera-interface-container",children:(0,qe.jsxs)("div",{className:"camera-controls",children:[(0,qe.jsx)(Ze,{className:"control-button ".concat("scan"===t?"active":""),to:"/app/scanner",children:i("scanner")}),(0,qe.jsx)(Ze,{className:"control-button ".concat("scan"===t?"active":""),to:"/app/analyze",children:i("AI")})]})})},mo={width:{min:window.innerHeight},height:{min:window.innerWidth},facingMode:"environment"},yo=(e,t)=>parseFloat((4*e+9*t)/100).toFixed(1),Co=e=>e?parseFloat((e/10).toFixed(1)):null,bo=(e,t)=>{const r=parseFloat(t);return isNaN(r)||null===e?null:e*r/100},Mo=e=>"number"===typeof e&&isFinite(e)?e.toFixed(1):"Brak informacji",Ao=e=>{var t,r,n,o,s,i,a,l,c,u,d,p;let{product:h,onClose:w,onAddToMealClick:g}=e;const{t:f}=Ln(),{user:v}=Xe();J();return(0,qe.jsxs)("div",{className:"product-popup",children:[(0,qe.jsx)("button",{className:"close-button",onClick:w,children:"X"}),(0,qe.jsx)("h2",{children:h.product_name||h.name}),(0,qe.jsx)("img",{src:h.image_url,alt:h.product_name}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)("button",{className:"search-link",onClick:g,children:(0,qe.jsx)(_n(),{name:"bookmark"})}),(0,qe.jsx)("button",{className:"search-link",disabled:!0,children:(0,qe.jsx)(_n(),{name:"restaurant"})})]}),void 0!==h.is_gluten_free?h.is_gluten_free?(0,qe.jsx)("p",{children:f("glutenFree")}):(0,qe.jsx)("p",{children:f("containsGluten")}):(0,qe.jsx)("p",{}),(0,qe.jsx)("p",{children:h.info||""}),(0,qe.jsxs)("table",{children:[(0,qe.jsx)("thead",{children:(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("th",{children:f("nutritionalValue")}),(0,qe.jsx)("th",{children:f("per100g")}),(0,qe.jsxs)("th",{children:[f("perServing")," ",h.portion||""]})]})}),(0,qe.jsxs)("tbody",{children:[(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:f("carbohydrates")}),(0,qe.jsx)("td",{children:Mo(h.carbohydrates_per100||(null===(t=h.nutriments)||void 0===t?void 0:t.carbohydrates_100g))}),(0,qe.jsx)("td",{children:Mo(bo(h.carbohydrates_per100||(null===(r=h.nutriments)||void 0===r?void 0:r.carbohydrates_100g),h.serving_size||h.portion))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:f("protein")}),(0,qe.jsx)("td",{children:Mo(h.protein_per100||(null===(n=h.nutriments)||void 0===n?void 0:n.proteins_100g))}),(0,qe.jsx)("td",{children:Mo(bo(h.protein_per100||(null===(o=h.nutriments)||void 0===o?void 0:o.proteins_100g),h.serving_size||h.portion))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:f("fat")}),(0,qe.jsx)("td",{children:Mo(h.fat_per100||(null===(s=h.nutriments)||void 0===s?void 0:s.fats_100g))}),(0,qe.jsx)("td",{children:Mo(bo(h.fat_per100||(null===(i=h.nutriments)||void 0===i?void 0:i.fats_100g),h.serving_size||h.portion))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsxs)("td",{children:[" ",(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20}),f("WW")]}),(0,qe.jsx)("td",{children:Co(h.carbohydrates_per100||(null===(a=h.nutriments)||void 0===a?void 0:a.carbohydrates_100g))}),(0,qe.jsx)("td",{children:Co(bo(h.carbohydrates_per100||(null===(l=h.nutriments)||void 0===l?void 0:l.carbohydrates_100g),h.serving_size||h.portion))})]}),(0,qe.jsxs)("tr",{children:[(0,qe.jsxs)("td",{children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"text-search"}),f("fpu")]}),(0,qe.jsx)("td",{children:yo(null===(c=h.nutriments)||void 0===c?void 0:c.proteins,null===(u=h.nutriments)||void 0===u?void 0:u.fat)}),(0,qe.jsx)("td",{children:yo(bo(null===(d=h.nutriments)||void 0===d?void 0:d.proteins,h.serving_size),bo(null===(p=h.nutriments)||void 0===p?void 0:p.fat,h.serving_size))})]})]})]})]})},jo=()=>{const e=(0,n.useRef)(null),[t,r]=(0,n.useState)(null),[o,s]=(0,n.useState)(!1),{t:i}=Ln(),[a,l]=(0,n.useState)(new Audio(fo)),[c,u]=(0,n.useState)(new Audio(vo)),[d,p]=(0,n.useState)(new Audio(ko)),[h,w]=(0,n.useState)(!0),g=()=>{go().init({inputStream:{type:"LiveStream",target:document.querySelector("#target"),constraints:mo},locator:{patchSize:"medium",halfSample:!0},numOfWorkers:2,decoder:{readers:["code_128_reader","ean_reader","ean_8_reader","code_39_reader","code_39_vin_reader","codabar_reader","upc_reader","upc_e_reader","i2of5_reader","2of5_reader","code_93_reader"]}},(e=>e?(console.error(e),void fn.error(i("scannerInitializationError"))):(console.log("Initialization finished. Ready to start"),go().onDetected((e=>{const t=e.codeResult.code;k(t)})),go().start(),()=>{go().offDetected(k)})))},[f,v]=(0,n.useState)(""),k=async e=>{const n=Pn();v(""),d.play();try{if(!0===h){const l=await Or.get("".concat(n,"scan?barcode=").concat(e),{withCredentials:!0});if(200===l.status){var o;if(l.data.success)v(""),(null===t||void 0===t?void 0:t.name)!==(null===(o=l.data.product)||void 0===o?void 0:o.name)&&(a.play(),r(l.data.product),s(!0),w(!1));else v(l.data.message),c.play()}else{if(404===l.status)return l.data&&l.data.message?fn.error(l.data.message,{autoClose:5e3}):(setTimeout((()=>{null!==t&&t||c.play()}),1e3),fn.error(i("productNotFound"),{autoClose:5e3}));c.play(),fn.error(i("barcodeScanningError"))}}}catch(l){setTimeout((()=>{if(l.response&&404===l.response.status)return null!==t&&t||c.play(),v(i("codeOrProductNotFound"));fn.error(i("barcodeScanningError"))}),1e3)}};(0,n.useEffect)((()=>{if(Ne.isNativePlatform())try{(async()=>{"granted"!==(await uo.check({permission:"camera"})).state?"granted"===(await uo.request({permission:"camera"})).state?console.log("Permission granted"):console.log("Permission denied"):console.log("Permission already granted")})(),g()}catch(e){fn.error(i("scannerInitializationError"))}else g()}),[]);const x=async(e,t,r,n,o)=>{const s=Pn();if(!e)return n.error(o("mustBeLoggedInToAddProduct")),void r("/app/login");try{var i,a,l,c,u,d;const r=m(),p=await Or.post("".concat(s,"addProductToList"),{userId:e.userId,productId:r,productJson:JSON.stringify({product_name:t.product_name||t.name,barcode:t.barcode||"",nutriments:{carbohydrates_100g:t.carbohydrates_per100||(null===(i=t.nutriments)||void 0===i?void 0:i.carbohydrates_100g)||(null===(a=t.nutriments)||void 0===a?void 0:a.carbohydrates)||0,proteins_100g:t.protein_per100||(null===(l=t.nutriments)||void 0===l?void 0:l.proteins_100g)||(null===(c=t.nutriments)||void 0===c?void 0:c.proteins)||0,fats_100g:t.fat_per100||(null===(u=t.nutriments)||void 0===u?void 0:u.fats_100g)||(null===(d=t.nutriments)||void 0===d?void 0:d.fat)||0}})},{headers:{Authorization:"Bearer ".concat(e.token)},withCredentials:!0}),{success:h,message:w}=p.data;h?n.success("".concat(o("saved")," ").concat(t.product_name||t.name," ").concat(o("saved2"))):n.error("".concat(o("errorOccurred"),": ").concat(w))}catch(p){console.error(p),n.error(o("errorSaving"))}},m=()=>Math.floor(1e6*Math.random()),{user:y}=Xe(),C=J();return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{class:"overlay"}),(0,qe.jsxs)("div",{style:{position:"relative",width:"100%",height:"100%"},children:[(0,qe.jsx)(ho(),{id:"target",className:"target",ref:e,audio:!1,videoConstraints:mo,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),(0,qe.jsx)(xo,{}),o&&(0,qe.jsx)(Ao,{product:t,onClose:()=>{r(null),s(!1),w(!0),go().start()},onAddToMealClick:()=>x(y,t,C,fn,i)}),f&&(0,qe.jsx)("div",{className:"errormessage",children:f})]})]})},Zo=()=>{const[e,t]=(0,n.useState)(1),[r,o]=(0,n.useState)([]),[s,i]=(0,n.useState)(!0),[a,l]=(0,n.useState)(""),[c,u]=(0,n.useState)(1),{t:d}=Ln(),{user:p}=Xe(),h=J(),[w,g]=(0,n.useState)(null),f=Pn();(0,n.useEffect)((()=>{p||(fn.error(d("mustBeLoggedInToAddProduct")),h("/login"))}),[p,d,h]);const v=(0,n.useRef)(null),k={width:{min:window.innerHeight},height:{min:window.innerWidth},facingMode:"environment"},x=async()=>{t((e=>e+1))},m=()=>{t((e=>e-1))};return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsx)("div",{className:"addPanel",children:1===e&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("h1",{children:d("timeToAdd")}),(0,qe.jsx)("p",{children:d("prepare")}),(0,qe.jsx)("p",{children:d("photosInfo")}),(0,qe.jsx)("button",{className:"button",onClick:x,children:d("next")})]})}),2===e&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsxs)("div",{className:"addPanel Up",style:{opacity:s?1:0},children:[(0,qe.jsx)("p",{children:a}),(0,qe.jsx)("button",{className:"button",onClick:async()=>{const e=v.current.getScreenshot();o((t=>{const r=[...t,e];return r.length>=3&&x(),r})),i(!1),setTimeout((()=>{i(!0)}),500),u((e=>e+1)),l(d("photoDesc".concat(c)))},children:d("takePhoto")}),(0,qe.jsx)("button",{className:"button",onClick:m,children:d("back")})]}),(0,qe.jsx)(ho(),{audio:!1,ref:v,videoConstraints:k,screenshotFormat:"image/jpeg",className:"webcam",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),3===e&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsxs)("div",{className:"addPanel ThreeStep",children:[(0,qe.jsx)("p",{children:d("checkPhotos")}),(0,qe.jsx)("div",{className:"preview-photos",children:r.map(((e,t)=>(0,qe.jsx)("img",{className:"photo",onClick:()=>(e=>{g(e)})(e),src:e,alt:"Photo ".concat(t+1)},t)))}),(0,qe.jsx)("button",{className:"button",onClick:async()=>{(async()=>{try{const e=r[1],t=new FormData;t.append("file",e),t.append("userId",p.userId),await Or.post("".concat(f,"upload"),t,{headers:{"Content-Type":"multipart/form-data"}}),alert("File uploaded successfully!")}catch(e){console.error("Error uploading file:",e),alert("An error occurred while uploading the file.")}})()},children:d("sendPhotos")}),(0,qe.jsx)("button",{className:"button",onClick:m,children:d("back")})]}),w&&(0,qe.jsx)("div",{className:"modal",children:(0,qe.jsxs)("div",{className:"modal-content",children:[(0,qe.jsx)("span",{className:"close",onClick:()=>{g(null)},children:"\xd7"}),(0,qe.jsx)("img",{src:w,className:"photosel",alt:"Selected"})]})})]}),4===e&&(0,qe.jsx)(qe.Fragment,{children:(0,qe.jsxs)("div",{className:"addPanel",children:[(0,qe.jsx)("p",{children:d("adminAddProduct")}),(0,qe.jsx)("p",{children:d("thanks")}),(0,qe.jsx)(Ze,{className:"button",to:"/",children:d("gobacktoapp")})]})})]})};var Ho=r(962),Vo=r.n(Ho);const So=100,Lo=e=>{let{shortcuts:t,setShortcuts:r,isEditing:o}=e;(0,n.useEffect)((()=>{localStorage.setItem("shortcuts",JSON.stringify(t))}),[t]);return(0,qe.jsx)("div",{className:"shortcuts-container",children:t.map((e=>(0,qe.jsx)(Vo(),{position:{x:0,y:e.position.y*So},grid:[So,So],disabled:!o,onStop:(n,o)=>((e,n,o)=>{const s=Math.round(n.y/So);if(t.some((e=>e.id!==o&&e.position.y===s)))console.log("This position is already taken");else{const e=t.map((e=>e.id===o?{...e,position:{x:e.position.x,y:s}}:e));r(e)}})(0,o,e.id),cancel:".delete-btn",children:(0,qe.jsx)("div",{className:"shortcut-button ".concat(o?"editing":""),style:{backgroundColor:e.color||"var(--ui_background)"},children:o?(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("p",{className:"shortcut-label",children:e.label}),(0,qe.jsx)(_n(),{name:e.icon,className:"shortcut-icon"}),(0,qe.jsx)("button",{onClick:()=>(e=>{const n=t.filter((t=>t.id!==e));r(n)})(e.id),className:"delete-btn","aria-label":"Delete shortcut",children:"\xd7"})]}):(0,qe.jsxs)(Ze,{to:e.link,className:"shortcut-link",children:[(0,qe.jsx)("p",{className:"shortcut-label",children:e.label}),(0,qe.jsx)(_n(),{name:e.icon,className:"shortcut-icon"})]})})},e.id)))})},Bo=e=>{let{availableShortcuts:t,onAddShortcut:r,onClose:n}=e;return(0,qe.jsx)("div",{className:"popup-overlay",children:(0,qe.jsxs)("div",{className:"popup-content",children:[(0,qe.jsx)("h3",{children:"Wybierz skr\xf3t"}),(0,qe.jsx)("ul",{children:t.map((e=>(0,qe.jsxs)("li",{onClick:()=>r(e),children:[(0,qe.jsx)(_n(),{name:e.icon,style:{marginRight:"8px"}}),e.label]},e.id)))}),(0,qe.jsx)("button",{onClick:n,children:"Zamknij"})]})})},_o=()=>{const[e,t]=(0,n.useState)(!1),[r,o]=(0,n.useState)(!1),{user:s}=Xe(),{t:i}=Ln(),[a,l]=(0,n.useState)(!1),c=Pn();(0,n.useEffect)((()=>{d()}),[s]);const u=e=>{for(let t=0;t<4;t++)for(let r=0;r<4;r++)if(!e.some((e=>e.x===r&&e.y===t)))return{x:r,y:t};return{x:0,y:0}},d=async()=>{if(s)try{s.userId,s.token;const e={Authorization:"Bearer ".concat(s.token),"Content-Type":"application/json"},t=await Or.get("".concat(c,"checkAdmin/").concat(s.userId),{headers:e}),r=t.data;200===t.status&&t.data.isAdmin?l(!0):console.error("Error checking admin status: ".concat(r.message))}catch(e){console.error("Error checking admin status: ".concat(e.message))}else l(!1)},[p,h]=(0,n.useState)((()=>{const e=localStorage.getItem("shortcuts");return e?JSON.parse(e):[{id:1,label:i("scaninfo"),icon:"scan",link:"/app/scanner",position:u([])},{id:2,label:i("searchinfo"),icon:"search",link:"/app/search",position:u([{x:0,y:0}])},{id:3,label:i("ainfo"),icon:"image",link:"/app/analyze",position:u([{x:0,y:0},{x:1,y:0}])},{id:4,label:i("listview"),icon:"bookmark",link:"/app/listview",position:u([{x:0,y:0},{x:1,y:0}])}]}));return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:i("welcome")}),(0,qe.jsx)("p",{children:(0,qe.jsx)("b",{children:i("quicksteps")})}),(0,qe.jsx)(Lo,{shortcuts:p,setShortcuts:h,isEditing:e}),(0,qe.jsx)("button",{onClick:()=>{t(!e)},children:i(e?"done":"edit")}),r&&(0,qe.jsx)(Bo,{availableShortcuts:[{id:5,label:i("scaninfo"),icon:"scan",link:"/app/scanner"},{id:6,label:i("searchinfo"),icon:"search",link:"/app/search"},{id:7,label:i("ainfo"),icon:"image",link:"/app/analyze"},{id:8,label:i("listview"),icon:"bookmark",link:"/app/listview"}],onAddShortcut:e=>{const t=u(p.map((e=>e.position))),r={...e,id:p.length+1,position:t};h([...p,r]),o(!1)},onClose:()=>{o(!1)}}),e&&(0,qe.jsx)("button",{onClick:()=>{o(!0)},children:i("addButton")}),(0,qe.jsx)("div",{className:"admin-options",children:a&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Ze,{to:"/app/add-product",children:(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"add-circle-outline"})," ",i("addproductinfo")]})}),(0,qe.jsx)(Ze,{to:"/app/userslist",children:(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"people-outline"})," ",i("manageUsers")]})})]})})]})]})},Eo=r.p+"static/media/logo.3addaa30eae6dfdf8dbf.jpg",zo=()=>{const[e,t]=(0,n.useState)(""),[r,o]=(0,n.useState)(""),[s,i]=(0,n.useState)(""),[a,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(""),{user:d}=Xe(),p=J(),{t:h}=Ln(),w=Pn();return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:h("calculateExchange")}),(0,qe.jsx)("input",{type:"number",value:e,onChange:e=>t(e.target.value),placeholder:h("enterCarbs")}),(0,qe.jsx)("input",{type:"number",value:[r],onChange:e=>o(e.target.value),placeholder:h("enterProteins")}),(0,qe.jsx)("input",{type:"number",value:s,onChange:e=>i(e.target.value),placeholder:h("enterFats")}),(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"flash",className:"text",size:20})," ",h("wwPer100g"),":"]}),(0,qe.jsx)("h1",{children:(v=e,v?parseFloat((v/10).toFixed(1)):null)}),(0,qe.jsxs)("p",{children:[" ",(0,qe.jsx)(_n(),{name:"flash-outline",className:"text",size:20}),h("wbtPer100g"),":"]}),(0,qe.jsx)("h1",{children:(g=r,f=s,parseFloat((4*g+9*f)/100).toFixed(1))}),(0,qe.jsx)("button",{className:"btnaddproduct",onClick:()=>l(!0),children:h("savecalc")}),a&&(0,qe.jsxs)("div",{className:"popup",children:[(0,qe.jsx)("h2",{children:h("enterProductInfo")}),(0,qe.jsx)("input",{type:"text",value:c,onChange:e=>u(e.target.value),placeholder:h("productName")}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)("button",{className:"search-link",onClick:async()=>{if(!d)return fn.error(h("mustBeLoggedIn")),void p("/app/login");if(c.trim()&&e.trim()&&r.trim()&&s.trim()){try{const t=Math.floor(1e6*Math.random()),n=d.token,o={Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},i=await Or.post("".concat(w,"addProductToList"),{userId:d.userId,productId:t,productJson:JSON.stringify({product_name:c,nutriments:{carbohydrates_100g:e||"0",proteins_100g:r||"0",fats_100g:s||"0"}})},{headers:o}),{success:a,message:l}=i.data;a?fn.success(h("addedToMeal",{productName:c})):fn.error("".concat(h("errorOccurred"),": ").concat(l))}catch(n){console.error(n),fn.error(h("errorSaving"))}l(!1),u(""),t(""),o(""),i("")}else fn.error(h("allFieldsRequired"))},children:(0,qe.jsx)(_n(),{name:"bookmark"})}),(0,qe.jsx)("button",{className:"search-link",disabled:!0,children:(0,qe.jsx)(_n(),{name:"restaurant"})})]})]})]})]});var g,f,v},Po=()=>{const{login:e}=Xe(),{t:t}=Ln(),[r,o]=(Pn(),(0,n.useState)("")),[s,i]=(0,n.useState)(""),a=J();return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:t("login")}),(0,qe.jsx)("hr",{}),(0,qe.jsxs)("label",{children:[t("email"),": ",(0,qe.jsx)("input",{type:"text",value:r,onChange:e=>o(e.target.value)})]}),(0,qe.jsxs)("label",{children:[t("password"),": ",(0,qe.jsx)("input",{type:"password",value:s,onChange:e=>i(e.target.value)})]}),(0,qe.jsx)("button",{onClick:async()=>{if(r&&s)try{const n=await Or.post("".concat(Pn(),"login"),{username:r,password:s},{withCredentials:!0});n.data.success?(fn.success(t("loginSuccess")),e(n.data.userId,n.data.token),a("/app")):fn.error(t("loginError"))}catch(n){console.error(n.response.data),fn.error(t("loginErrorConnection"))}else fn.error(t("enterUsernameAndPassword"))},children:t("login")}),(0,qe.jsx)("hr",{}),(0,qe.jsxs)("p",{children:[t("noAccount")," ",(0,qe.jsx)(Ze,{className:"change",to:"/app/register",children:t("registerHere")}),"."]})]})]})},No=()=>{const{t:e}=Ln(),[t,r]=(0,n.useState)(""),[o,s]=(0,n.useState)(""),[i,a]=(0,n.useState)(""),l=J(),c=Pn();return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:e("register1.title")}),(0,qe.jsx)("hr",{}),(0,qe.jsxs)("label",{children:[e("register1.email")," ",(0,qe.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value)})]}),(0,qe.jsxs)("label",{children:[e("register1.password")," ",(0,qe.jsx)("input",{type:"password",value:o,onChange:e=>s(e.target.value)})]}),(0,qe.jsxs)("label",{children:[e("register1.confirmPassword")," ",(0,qe.jsx)("input",{type:"password",value:i,onChange:e=>a(e.target.value)})]}),(0,qe.jsx)("button",{onClick:async()=>{if(t&&o&&i)if(o===i)try{(await Or.post("".concat(c,"register"),{username:t,password:o},{withCredentials:!0})).data.success?(fn.success(e("register1.success")),l("/app/login")):fn.error(e("register1.failure"))}catch(r){console.error(r.response.data),fn.error(e("register1.error"))}else fn.error(e("register1.passwordMismatch"));else fn.error(e("register1.missingFields"))},children:e("register1.registerButton")}),(0,qe.jsxs)("p",{children:[e("register1.acceptTerms")," ",(0,qe.jsx)(Ze,{className:"change",to:"/terms",children:e("register1.terms")})," ",e("register1.and")," ",(0,qe.jsx)(Ze,{className:"change",to:"/policy",children:e("register1.privacyPolicy")})]}),(0,qe.jsxs)("p",{children:[e("register1.alreadyHaveAccount")," ",(0,qe.jsx)(Ze,{className:"change",to:"/app/login",children:e("register1.login")}),"."]})]})]})},Oo=()=>{const[e,t]=(0,n.useState)(""),[r,o]=(0,n.useState)(""),[s,i]=(0,n.useState)(""),[a,l]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[d,p]=(0,n.useState)(""),[h,w]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[v,k]=(0,n.useState)(""),[x,m]=(0,n.useState)(""),[y,C]=(0,n.useState)(""),[b,M]=(0,n.useState)(!1),[A,j]=(0,n.useState)(""),{user:Z}=Xe(),H=J(),{t:V}=Ln(),[S,L]=(0,n.useState)(!1),[B,_]=(0,n.useState)(!0),E=Pn();(0,n.useEffect)((()=>{(async()=>{if(!Z)return fn.error(V("notLoggedRedirect")),void H("/app/login");try{Z.token;const e={Authorization:"Bearer ".concat(Z.token),"Content-Type":"application/json"},t="".concat(E,"checkAdmin/").concat(Z.userId);(await Or.get(t,{headers:e,mode:"cors"})).data.isAdmin?L(!0):(fn.error(V("notAdminRedirect")),H("/app/login"))}catch(e){console.error("Error:",e),fn.error(V("errorOccurred")),H("/app/login")}finally{_(!1)}})()}),[Z,H,V]);const z=()=>{t(""),o(""),i(""),l(""),u(""),p(""),w(""),f(""),k(""),m(""),C(""),M(!1),j("")};return B?(0,qe.jsx)("div",{children:V("loading")}):S?(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:V("addNewProduct")}),(0,qe.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),placeholder:V("productName")}),(0,qe.jsx)("input",{type:"text",value:r,onChange:e=>o(e.target.value),placeholder:V("barcode")}),(0,qe.jsx)("input",{type:"text",value:s,onChange:e=>i(e.target.value),placeholder:V("energyPer100g")}),(0,qe.jsx)("input",{type:"text",value:a,onChange:e=>l(e.target.value),placeholder:V("fatPer100g")}),(0,qe.jsx)("input",{type:"text",value:c,onChange:e=>u(e.target.value),placeholder:V("carbsPer100g")}),(0,qe.jsx)("input",{type:"text",value:d,onChange:e=>p(e.target.value),placeholder:V("fiberPer100g")}),(0,qe.jsx)("input",{type:"text",value:h,onChange:e=>w(e.target.value),placeholder:V("proteinPer100g")}),(0,qe.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),placeholder:V("portionSize")}),(0,qe.jsx)("input",{type:"text",value:v,onChange:e=>k(e.target.value),placeholder:V("brand")}),(0,qe.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),placeholder:V("category")}),(0,qe.jsx)("input",{type:"text",value:y,onChange:e=>C(e.target.value),placeholder:V("imageUrl")}),(0,qe.jsxs)("label",{children:[V("glutenFree"),":",(0,qe.jsx)("input",{type:"checkbox",checked:b,onChange:e=>M(e.target.checked)})]}),(0,qe.jsx)("input",{type:"text",value:A,onChange:e=>j(e.target.value),placeholder:V("info")})," ",(0,qe.jsx)("button",{className:"btnaddproduct",onClick:async()=>{const t=Pn();try{Z.token;const n={Authorization:"Bearer ".concat(Z.token),"Content-Type":"application/json"},o="".concat(t,"addProduct"),i=await Or.post(o,{name:e,barcode:r,energy_per100:s,fat_per100:a,carbohydrates_per100:c,fiber_per100:d,protein_per100:h,portion:g,brand:v,category:x,image_url:y,glutenFree:b,info:A},{headers:n}),{success:l,message:u,product:p}=i.data;l?(fn.success("".concat(V("addedNewProduct"),": ").concat(p.name," ").concat(V("toDatabase"))),z()):fn.error("".concat(V("errorOccurred"),": ").concat(u))}catch(n){console.error("Error adding product:",n),fn.error(V("errorSaving"))}},children:"Dodaj produkt "})]})]}):(0,qe.jsx)("div",{children:V("notAuthorized")})},To=()=>{const{user:e}=Xe(),t=J(),{t:r}=Ln(),[o,s]=(0,n.useState)([]),[i,a]=(0,n.useState)(!1),[l,c]=(0,n.useState)(!0),u=Pn();return(0,n.useEffect)((()=>{(async()=>{if(e)try{e.token;const n={Authorization:"Bearer ".concat(e.token),"Content-Type":"application/json"},o=await Or.get("".concat(u,"checkAdmin/").concat(e.userId),{headers:n});if(200===o.status&&o.data.isAdmin){a(!0);const e=await Or.get("".concat(u,"users"),{headers:n});200===e.status?s(e.data.users):(console.error("Error fetching users: ".concat(e.data.message)),fn.error(r("errorFetchingUsers")))}else console.error("Error checking admin status: ".concat(o.data.message)),fn.error(r("notAdminRedirect")),t("/app")}catch(n){console.error("Error in fetchUsers: ".concat(n.message)),fn.error(r("errorOccurred")),t("/app")}finally{c(!1)}else t("/app/login")})()}),[e,t,r]),l?(0,qe.jsx)("div",{children:r("loading")}):i?(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"info",children:[(0,qe.jsx)("h1",{children:r("manageUsers")}),(0,qe.jsx)("br",{}),(0,qe.jsxs)("table",{children:[(0,qe.jsx)("thead",{children:(0,qe.jsx)("tr",{children:(0,qe.jsx)("th",{children:r("email")})})}),(0,qe.jsx)("tbody",{children:o.map((e=>(0,qe.jsx)("tr",{children:(0,qe.jsx)("td",{children:e.email})},e.id)))})]})]})]}):(0,qe.jsx)("div",{children:r("notAuthorized")})},Ro={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Do{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Ro,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),r=0;r{this.observers[e]||(this.observers[e]=new Map);const r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{let[t,n]=e;for(let o=0;o{let[n,o]=t;for(let s=0;s{e=r,t=n}));return r.resolve=e,r.reject=t,r}function qo(e){return null==e?"":""+e}const Wo=/###/g;function Go(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(Wo,"."):e}function o(){return!e||"string"===typeof e}const s="string"!==typeof t?t:t.split(".");let i=0;for(;i":">",'"':""","'":"'","/":"/"};function $o(e){return"string"===typeof e?e.replace(/[&<>"'\/]/g,(e=>Jo[e])):e}const es=[" ",",","?","!",";"],ts=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20);function rs(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let o=e;for(let s=0;s-1&&i0?e.replace("_","-"):e}class os extends Uo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):"string"===typeof r&&o?i.push(...r.split(o)):i.push(r)));const a=Ko(this.data,i);return!a&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),a||!s||"string"!==typeof r?a:rs(this.data&&this.data[e]&&this.data[e][t],r,o)}addResource(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let i=[e,t];r&&(i=i.concat(s?r.split(s):r)),e.indexOf(".")>-1&&(i=e.split("."),n=t,t=i[1]),this.addNamespaces(t),Xo(this.data,i,n),o.silent||this.emit("added",e,t,r,n)}addResources(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const o in r)"string"!==typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(e,t,o,r[o],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,o){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),n=r,r=t,t=i[1]),this.addNamespaces(t);let a=Ko(this.data,i)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?Yo(a,r,o):a={...a,...r},Xo(this.data,i,a),s.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var ss={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,o){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,r,n,o))})),t}};const is={};class as extends Uo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,r){e.forEach((e=>{t[e]&&(r[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Io.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(void 0===e||null===e)return!1;const r=this.resolve(e,t);return r&&void 0!==r.res}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");const n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const s=r&&e.indexOf(r)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,r){t=t||"",r=r||"";const n=es.filter((e=>t.indexOf(e)<0&&r.indexOf(e)<0));if(0===n.length)return!0;const o=ts.getRegExp("(".concat(n.map((e=>"?"===e?"\\?":e)).join("|"),")"));let s=!o.test(e);if(!s){const t=e.indexOf(r);t>0&&!o.test(e.substring(0,t))&&(s=!0)}return s}(e,r,n);if(s&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};const s=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),e=s.join(n)}return"string"===typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,r){if("object"!==typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof t&&(t={...t}),t||(t={}),void 0===e||null===e)return"";Array.isArray(e)||(e=[String(e)]);const n=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:s,namespaces:i}=this.extractFromKey(e[e.length-1],t),a=i[i.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return n?{res:"".concat(a).concat(e).concat(s),usedKey:s,exactUsedKey:s,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:"".concat(a).concat(e).concat(s)}return n?{res:s,usedKey:s,exactUsedKey:s,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:s}const u=this.resolve(e,t);let d=u&&u.res;const p=u&&u.usedKey||s,h=u&&u.exactUsedKey||s,w=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject;if(f&&d&&("string"!==typeof d&&"boolean"!==typeof d&&"number"!==typeof d)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(w)<0&&("string"!==typeof g||"[object Array]"!==w)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,d,{...t,ns:i}):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");return n?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(o){const e="[object Array]"===w,r=e?[]:{},n=e?h:p;for(const s in d)if(Object.prototype.hasOwnProperty.call(d,s)){const e="".concat(n).concat(o).concat(s);r[s]=this.translate(e,{...t,joinArrays:!1,ns:i}),r[s]===e&&(r[s]=d[s])}d=r}}else if(f&&"string"===typeof g&&"[object Array]"===w)d=d.join(g),d&&(d=this.extendTranslation(d,e,t,r));else{let n=!1,i=!1;const c=void 0!==t.count&&"string"!==typeof t.count,p=as.hasDefaultValue(t),h=c?this.pluralResolver.getSuffix(l,t.count,t):"",w=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",g=c&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),f=g&&t["defaultValue".concat(this.options.pluralSeparator,"zero")]||t["defaultValue".concat(h)]||t["defaultValue".concat(w)]||t.defaultValue;!this.isValidLookup(d)&&p&&(n=!0,d=f),this.isValidLookup(d)||(i=!0,d=s);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:d,k=p&&f!==d&&this.options.updateMissing;if(i||n||k){if(this.logger.log(k?"updateKey":"missingKey",l,a,s,k?f:d),o){const e=this.resolve(s,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const r=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&r&&r[0])for(let t=0;t{const o=p&&n!==d?n:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,r,o,k,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,a,r,o,k,t),this.emit("missingKey",e,a,r,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{const r=this.pluralResolver.getSuffixes(e,t);g&&t["defaultValue".concat(this.options.pluralSeparator,"zero")]&&r.indexOf("".concat(this.options.pluralSeparator,"zero"))<0&&r.push("".concat(this.options.pluralSeparator,"zero")),r.forEach((r=>{n([e],s+r,t["defaultValue".concat(r)]||f)}))})):n(e,s,f))}d=this.extendTranslation(d,e,t,u,r),i&&d===s&&this.options.appendNamespaceToMissingKey&&(d="".concat(a,":").concat(s)),(i||n)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(a,":").concat(s):s,n?d:void 0):this.options.parseMissingKeyHandler(d))}return n?(u.res=d,u.usedParams=this.getUsedParamsDetails(t),u):d}extendTranslation(e,t,r,n,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const i="string"===typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=r.replace&&"string"!==typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(r.nest=!1)}!r.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(r.lng=n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,i),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==i.count&&"string"!==typeof i.count,d=u&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==i.context&&("string"===typeof i.context||"number"===typeof i.context)&&""!==i.context,h=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(s=e,!is["".concat(h[0],"-").concat(e)]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(is["".concat(h[0],"-").concat(e)]=!0,this.logger.warn('key "'.concat(r,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((r=>{if(this.isValidLookup(t))return;o=r;const s=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,i);else{let e;u&&(e=this.pluralResolver.getSuffix(r,i.count,i));const t="".concat(this.options.pluralSeparator,"zero"),n="".concat(this.options.pluralSeparator,"ordinal").concat(this.options.pluralSeparator);if(u&&(s.push(l+e),i.ordinal&&0===e.indexOf(n)&&s.push(l+e.replace(n,this.options.pluralSeparator)),d&&s.push(l+t)),p){const r="".concat(l).concat(this.options.contextSeparator).concat(i.context);s.push(r),u&&(s.push(r+e),i.ordinal&&0===e.indexOf(n)&&s.push(r+e.replace(n,this.options.pluralSeparator)),d&&s.push(r+t))}}let a;for(;a=s.pop();)this.isValidLookup(t)||(n=a,t=this.getResource(r,e,a,i))})))}))})),{res:t,usedKey:r,exactUsedKey:n,usedLng:o,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&"string"!==typeof e.replace;let n=r?e.replace:e;if(r&&"undefined"!==typeof e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!r){n={...n};for(const e of t)delete n[e]}return n}static hasDefaultValue(e){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,12)&&void 0!==e[r])return!0;return!1}}function ls(e){return e.charAt(0).toUpperCase()+e.slice(1)}class cs{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Io.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ns(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ns(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"===typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map((e=>e.toLowerCase())):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=ls(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=ls(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=ls(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const r=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(r)||(t=r)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find((e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),"string"===typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],o=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"===typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"===typeof e&&o(this.formatLanguageCode(e)),r.forEach((e=>{n.indexOf(e)<0&&o(this.formatLanguageCode(e))})),n}}let us=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ds={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const ps=["v1","v2","v3"],hs=["v4"],ws={zero:0,one:1,two:2,few:3,many:4,other:5};class gs{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Io.create("pluralResolver"),this.options.compatibilityJSON&&!hs.includes(this.options.compatibilityJSON)||"undefined"!==typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const e={};return us.forEach((t=>{t.lngs.forEach((r=>{e[r]={numbers:t.nr,plurals:ds[t.fc]}}))})),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(ns("dev"===e?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch(r){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((e=>"".concat(t).concat(e)))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.getRule(e,t);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(((e,t)=>ws[e]-ws[t])).map((e=>"".concat(this.options.prepend).concat(t.ordinal?"ordinal".concat(this.options.prepend):"").concat(e))):r.numbers.map((r=>this.getSuffix(e,r,t))):[]}getSuffix(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.ordinal?"ordinal".concat(this.options.prepend):"").concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}getSuffixRetroCompatible(e,t){const r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let n=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));const o=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"===typeof n?"_plural_".concat(n.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!ps.includes(this.options.compatibilityJSON)}}function fs(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=function(e,t,r){const n=Ko(e,r);return void 0!==n?n:Ko(t,r)}(e,t,r);return!s&&o&&"string"===typeof r&&(s=rs(e,r,n),void 0===s&&(s=rs(t,r,n))),s}class vs{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Io.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:$o,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Qo(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Qo(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Qo(t.nestingPrefix):t.nestingPrefixEscaped||Qo("$t("),this.nestingSuffix=t.nestingSuffix?Qo(t.nestingSuffix):t.nestingSuffixEscaped||Qo(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,"".concat(this.prefix,"(.+?)").concat(this.suffix)),this.regexpUnescape=e(this.regexpUnescape,"".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix)),this.nestingRegexp=e(this.nestingRegexp,"".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix))}interpolate(e,t,r,n){let o,s,i;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}const c=e=>{if(e.indexOf(this.formatSeparator)<0){const o=fs(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,r,{...n,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),s=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(fs(t,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),i,r,{...n,...t,interpolationkey:s})};this.resetRegExp();const u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,d=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>l(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?l(this.escape(e)):l(e)}].forEach((t=>{for(i=0;o=t.regex.exec(e);){const r=o[1].trim();if(s=c(r),void 0===s)if("function"===typeof u){const t=u(e,o,n);s="string"===typeof t?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))s="";else{if(d){s=o[0];continue}this.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),s=""}else"string"===typeof s||this.useRawValueToEscape||(s=qo(s));const a=t.safeValue(s);if(e=e.replace(o[0],a),d?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}})),e}nest(e,t){let r,n,o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function i(e,t){const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const n=e.split(new RegExp("".concat(r,"[ ]*{")));let s="{".concat(n[1]);e=n[0],s=this.interpolate(s,o);const i=s.match(/'/g),a=s.match(/"/g);(i&&i.length%2===0&&!a||a.length%2!==0)&&(s=s.replace(/'/g,'"'));try{o=JSON.parse(s),t&&(o={...t,...o})}catch(l){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),l),"".concat(e).concat(r).concat(s)}return delete o.defaultValue,e}for(;r=this.nestingRegexp.exec(e);){let a=[];o={...s},o=o.replace&&"string"!==typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){const e=r[1].split(this.formatSeparator).map((e=>e.trim()));r[1]=e.shift(),a=e,l=!0}if(n=t(i.call(this,r[1].trim(),o),o),n&&r[0]===e&&"string"!==typeof n)return n;"string"!==typeof n&&(n=qo(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=a.reduce(((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:r[1].trim()})),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}function ks(e){const t={};return function(r,n,o){const s=n+JSON.stringify(o);let i=t[s];return i||(i=e(ns(n),o),t[s]=i),i(r)}}class xs{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Io.create("formatter"),this.options=e,this.formats={number:ks(((e,t)=>{const r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)})),currency:ks(((e,t)=>{const r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)})),datetime:ks(((e,t)=>{const r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)})),relativetime:ks(((e,t)=>{const r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")})),list:ks(((e,t)=>{const r=new Intl.ListFormat(e,{...t});return e=>r.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ks(t)}format(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:o,formatOptions:s}=function(e){let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);"currency"===t&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach((e=>{if(!e)return;const[t,...n]=e.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,"");r[t.trim()]||(r[t.trim()]=o),"false"===o&&(r[t.trim()]=!1),"true"===o&&(r[t.trim()]=!0),isNaN(o)||(r[t.trim()]=parseInt(o,10))}))}return{formatName:t,formatOptions:r}}(t);if(this.formats[o]){let t=e;try{const i=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},a=i.locale||i.lng||n.locale||n.lng||r;t=this.formats[o](e,a,{...s,...n,...i})}catch(i){this.logger.warn(i)}return t}return this.logger.warn("there was no format function for ".concat(o)),e}),e);return o}}class ms extends Uo{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=Io.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,n.backend,n)}queueLoad(e,t,r,n){const o={},s={},i={},a={};return e.forEach((e=>{let n=!0;t.forEach((t=>{const i="".concat(e,"|").concat(t);!r.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===s[i]&&(s[i]=!0):(this.state[i]=1,n=!1,void 0===s[i]&&(s[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===a[t]&&(a[t]=!0)))})),n||(i[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,r){const n=e.split("|"),o=n[0],s=n[1];t&&this.emit("failedLoading",o,s,t),r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;const i={};this.queue.forEach((r=>{!function(e,t,r,n){const{obj:o,k:s}=Go(e,t,Object);o[s]=o[s]||[],n&&(o[s]=o[s].concat(r)),n||o[s].push(r)}(r.loaded,[o],s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((e=>{i[e]||(i[e]={});const t=r.loaded[e];t.length&&t.forEach((t=>{void 0===i[e][t]&&(i[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((e=>!e.done))}read(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:o,callback:s});this.readingCalls++;const i=(i,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&a&&n{this.read.call(this,e,t,r,n+1,2*o,s)}),o):s(i,a)},a=this.backend[r].bind(this.backend);if(2!==a.length)return a(e,t,i);try{const r=a(e,t);r&&"function"===typeof r.then?r.then((e=>i(null,e))).catch(i):i(null,r)}catch(l){i(l)}}prepareLoading(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"===typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"===typeof t&&(t=[t]);const o=this.queueLoad(e,t,r,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.split("|"),n=r[0],o=r[1];this.read(n,o,"read",void 0,void 0,((r,s)=>{r&&this.logger.warn("".concat(t,"loading namespace ").concat(o," for language ").concat(n," failed"),r),!r&&s&&this.logger.log("".concat(t,"loaded namespace ").concat(o," for language ").concat(n),s),this.loaded(e,r,s)}))}saveMissing(e,t,r,n,o){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(void 0!==r&&null!==r&&""!==r){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;o=5===c.length?c(e,t,r,n,l):c(e,t,r,n),o&&"function"===typeof o.then?o.then((e=>i(null,e))).catch(i):i(null,o)}catch(a){i(a)}else c(e,t,r,n,i,l)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}function ys(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"===typeof e[1]&&(t=e[1]),"string"===typeof e[1]&&(t.defaultValue=e[1]),"string"===typeof e[2]&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const r=e[3]||e[2];Object.keys(r).forEach((e=>{t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Cs(e){return"string"===typeof e.ns&&(e.ns=[e.ns]),"string"===typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"===typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function bs(){}class Ms extends Uo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var r;if(super(),this.options=Cs(e),this.services={},this.logger=Io,this.modules={external:[]},r=this,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((e=>{"function"===typeof r[e]&&(r[e]=r[e].bind(r))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"===typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"===typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=ys();function o(e){return e?"function"===typeof e?new e:e:null}if(this.options={...n,...this.options,...Cs(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?Io.init(o(this.modules.logger),this.options):Io.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!==typeof Intl&&(t=xs);const r=new cs(this.options);this.store=new os(this.options.resources,this.options);const s=this.services;s.logger=Io,s.resourceStore=this.store,s.languageUtils=r,s.pluralResolver=new gs(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=o(t),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new vs(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new ms(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o1?r-1:0),o=1;o{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,r||(r=bs),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const s=Fo(),i=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(t),r(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),s}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bs;const r="string"===typeof e?e:this.language;if("function"===typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],n=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(r)n(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>n(e)))}this.options.preload&&this.options.preload.forEach((e=>n(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,r){const n=Fo();return e||(e=this.languages),t||(t=this.options.ns),r||(r=bs),this.services.backendConnector.reload(e,t,(e=>{n.resolve(),r(e)})),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ss.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var r=this;this.isLanguageChangingTo=e;const n=Fo();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(e,s)=>{s?(o(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve((function(){return r.t(...arguments)})),t&&t(e,(function(){return r.t(...arguments)}))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const r="string"===typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);r&&(this.language||o(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(r)),this.loadResources(r,(e=>{s(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,r){var n=this;const o=function(e,t){let s;if("object"!==typeof t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l"".concat(s.keyPrefix).concat(c).concat(e))):s.keyPrefix?"".concat(s.keyPrefix).concat(c).concat(e):e,n.t(u,s)};return"string"===typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;const s=(e,t)=>{const r=this.services.backendConnector.state["".concat(e,"|").concat(t)];return-1===r||2===r};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||n&&!s(o,e)))}loadNamespaces(e,t){const r=Fo();return this.options.ns?("string"===typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=Fo();"string"===typeof e&&(e=[e]);const n=this.options.preload||[],o=e.filter((e=>n.indexOf(e)<0));return o.length?(this.options.preload=n.concat(o),this.loadResources((e=>{r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new cs(ys());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Ms(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bs;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},o=new Ms(n);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new os(this.store.data,n),o.services.resourceStore=o.store),o.translator=new as(o.services,n),o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{const{user:e,logout:t}=Xe(),{t:r}=(J(),Ln()),[o,s]=(0,n.useState)((()=>localStorage.getItem("language")||Hs.language||navigator.language.split("-")[0])),[i,a]=(0,n.useState)("system"),[l,c]=(0,n.useState)(!0);(0,n.useEffect)((()=>{Hs.changeLanguage(o)}),[o]),(0,n.useEffect)((()=>{const e=localStorage.getItem("themeMode");a(e||"system");const t=localStorage.getItem("syncEnabled");c("false"!==t)}),[]);const u=e=>{if("dark"===e)document.body.classList.add("dark-mode");else if("light"===e)document.body.classList.remove("dark-mode");else if("system"===e){window.matchMedia("(prefers-color-scheme: dark)").matches?document.body.classList.add("dark-mode"):document.body.classList.remove("dark-mode")}};(0,n.useEffect)((()=>{u(i),"system"!==i&&localStorage.setItem("themeMode",i)}),[i]);const d=Ne.isNativePlatform();return(0,qe.jsxs)("div",{className:"panel",children:[(0,qe.jsx)("div",{className:"overlay"}),(0,qe.jsxs)("div",{className:"modal",children:[(0,qe.jsx)("h1",{children:r("settings")}),(0,qe.jsx)("h2",{children:r("appearance")}),(0,qe.jsx)("p",{children:r("changeLanguage")}),(0,qe.jsxs)("select",{value:o,onChange:e=>{return t=e.target.value,Hs.changeLanguage(t),s(t),localStorage.setItem("language",t),void fn.success(r("languageChanged"));var t},children:[(0,qe.jsx)("option",{value:"en",children:"English"}),(0,qe.jsx)("option",{value:"pl",children:"Polski"})]}),(0,qe.jsx)("p",{children:r("defaultTheme")}),(0,qe.jsxs)("select",{value:i,onChange:e=>{return t=e.target.value,a(t),u(t),void("system"!==t?(localStorage.setItem("themeMode",t),fn.success(r("modeChanged"))):localStorage.removeItem("themeMode"));var t},children:[(0,qe.jsx)("option",{value:"light",children:r("lightMode")}),(0,qe.jsx)("option",{value:"dark",children:r("darkMode")}),(0,qe.jsx)("option",{value:"system",children:r("systemMode")})]}),d&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("h2",{children:r("dataSettings")}),(0,qe.jsx)("p",{children:r("syncData")}),(0,qe.jsxs)("label",{className:"switch",children:[(0,qe.jsx)("input",{type:"checkbox",checked:l,onChange:()=>{const e=!l;c(e),localStorage.setItem("syncEnabled",e),fn.success(r(e?"syncEnabled":"syncDisabled"))}}),(0,qe.jsx)("span",{className:"slider round"})]}),(0,qe.jsx)("button",{className:"buttonlogout",onClick:async()=>{window.confirm(r("confirmDeleteData"))&&(await(async e=>{const t=(await ao()).transaction("meals","readwrite");await t.store.delete(e),await t.done})(e.userId),fn.success(r("dataDeleted")))},children:r("deleteData")})]}),e?(0,qe.jsxs)("div",{children:[(0,qe.jsx)("h2",{children:r("user")}),(0,qe.jsx)("p",{children:r("logoutText")}),(0,qe.jsx)("button",{className:"buttonlogout",onClick:t,children:r("logout")})]}):null,(0,qe.jsx)("hr",{}),(0,qe.jsx)("p",{children:r("otherLinks")}),(0,qe.jsx)(Ze,{to:"/policy",children:(0,qe.jsx)("p",{children:r("privacyPolicyLink")})}),(0,qe.jsx)(Ze,{to:"/terms",children:(0,qe.jsx)("p",{children:r("termsLink")})})]})]})},Ss=()=>{const[e,t]=(0,n.useState)(!1),{t:r}=Ln();return(0,qe.jsx)("div",{className:"top-bar",children:(0,qe.jsxs)("div",{className:"centertopbar",children:[(0,qe.jsxs)(Ze,{to:"/",className:"logo-container",children:[(0,qe.jsx)("img",{src:Eo,alt:"DiabCalc Logo",className:"logolanding"}),(0,qe.jsx)("span",{className:"diabcalc-title",children:"DiabCalc"})]}),(0,qe.jsxs)("div",{className:"nav-links ".concat(e?"open":""),children:[(0,qe.jsx)("a",{href:"#details-section",children:r("onas")}),(0,qe.jsx)("a",{href:"#goals-section",children:r("goals")}),(0,qe.jsx)("a",{href:"#about-section",children:r("team")}),(0,qe.jsx)("a",{href:"#contact",children:r("contact")})]}),(0,qe.jsx)("div",{className:"menu-icon",onClick:()=>{t((e=>!e))},children:"\u2630"})]})})},Ls=()=>{const{t:e}=Ln(),[t,r]=(0,n.useState)("pl");return(0,qe.jsx)("footer",{className:"landing-footer",children:(0,qe.jsxs)("div",{className:"footer-text",children:[e("footerinfo"),(0,qe.jsx)(Ze,{className:"zwolnieni",to:"https://zwolnienizteorii.pl/",children:e("footerzwolnieni")}),(0,qe.jsx)("br",{}),e("otherLinks"),(0,qe.jsx)(Ze,{className:"link",to:"/policy",children:(0,qe.jsx)("p",{children:e("privacyPolicyLink")})}),(0,qe.jsx)(Ze,{className:"link",to:"/terms",children:(0,qe.jsx)("p",{children:e("termsLink")})}),(0,qe.jsxs)("select",{value:t,className:"selectlanguage",onChange:e=>{return t=e.target.value,Hs.changeLanguage(t),void r(t);var t},children:[(0,qe.jsx)("option",{value:"en",children:"English"}),(0,qe.jsx)("option",{value:"pl",children:"Polish"})]}),(0,qe.jsx)("h1",{children:e("contact")}),(0,qe.jsx)(_n(),{name:"mail-outline",size:50}),(0,qe.jsx)("p",{children:e("contactdetails")}),(0,qe.jsx)("p",{children:e("visitsm")}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)(Ze,{to:"https://www.instagram.com/diabcalcapp",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-instagram"})}),(0,qe.jsx)(Ze,{to:"https://www.youtube.com/@DiabCalcApp",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-youtube"})}),(0,qe.jsx)(Ze,{to:"https://www.tiktok.com/@diabcalc",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-tiktok"})}),(0,qe.jsx)(Ze,{to:"https://www.facebook.com/profile.php?id=61557310356369",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-facebook"})}),(0,qe.jsx)(Ze,{to:"https://www.linkedin.com/company/diabcalc",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-linkedin"})})]})]})})},Bs=()=>{const{t:e}=Ln();return(0,qe.jsxs)("div",{className:"landing-page terms",children:[(0,qe.jsx)(Ss,{}),(0,qe.jsxs)("div",{className:"landinginfo",children:[(0,qe.jsx)("h1",{children:e("termsOfService")}),(0,qe.jsx)("hr",{}),(0,qe.jsx)("p",{className:"zakladkip",children:e("termsIntro")}),(0,qe.jsxs)("ol",{children:[(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("informationSources"),":"]})," ",e("informationSourcesDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataUpdate"),":"]})," ",e("dataUpdateDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("userAddedProducts"),":"]})," ",e("userAddedProductsDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("userResponsibility"),":"]})," ",e("userResponsibilityDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("medicalAdvice"),":"]})," ",e("medicalAdviceDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("errorReporting"),":"]})," ",e("errorReportingDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("appUpdates"),":"]})," ",e("appUpdatesDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("userPrivacy"),":"]})," ",e("userPrivacyDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("termsChanges"),":"]})," ",e("termsChangesDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("validityScope"),":"]})," ",e("validityScopeDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("contact"),":"]})," ",(0,qe.jsx)("a",{href:"mailto:diabcalcapp@gmail.com",children:"diabcalcapp@gmail.com"})]})]})]}),(0,qe.jsx)(Ls,{})]})},_s=()=>{const{t:e}=Ln();return(0,qe.jsxs)("div",{className:"landing-page policy",children:[(0,qe.jsx)(Ss,{}),(0,qe.jsxs)("div",{className:"landinginfo",children:[(0,qe.jsx)("h1",{children:e("privacyPolicy")}),(0,qe.jsx)("hr",{}),(0,qe.jsx)("p",{className:"zakladkip",children:e("privacyIntro")}),(0,qe.jsxs)("ol",{children:[(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataController"),":"]})," ",e("dataControllerDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("processingPurpose"),":"]})," ",e("processingPurposeDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataTypes"),":"]})," ",e("dataTypesDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataSharing"),":"]})," ",e("dataSharingDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataRetentionPeriod"),":"]})," ",e("dataRetentionPeriodDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("userRights"),":"]})," ",e("userRightsDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("dataSecurity"),":"]})," ",e("dataSecurityDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("policyChanges"),":"]})," ",e("policyChangesDetails")]}),(0,qe.jsxs)("li",{children:[(0,qe.jsxs)("strong",{children:[e("contactDetailsPolicy"),":"]})," ",(0,qe.jsx)("a",{href:"mailto:diabcalcapp@gmail.com",children:"diabcalcapp@gmail.com"})]})]})]}),(0,qe.jsx)(Ls,{})]})},Es=r.p+"static/media/scansoundgoodai.1dd2eda18e900449e771.mp3",zs=r.p+"static/media/scansoundquestionai.963c8bc627db05170b24.mp3",Ps={width:{min:window.innerHeight},height:{min:window.innerWidth},facingMode:"environment"},Ns=()=>(0,qe.jsxs)("div",{className:"loading-dots",children:[(0,qe.jsx)("div",{className:"dot"}),(0,qe.jsx)("div",{className:"dot"}),(0,qe.jsx)("div",{className:"dot"})]}),Os=e=>{let{analysisResult:t,question:r,onResponseSubmit:o,onClose:s}=e;const{t:i}=Ln(),[a,l]=n.useState(""),[c,u]=n.useState(!1),d=e=>e?parseFloat((e/10).toFixed(1)):null,p=null===t||void 0===t?void 0:t.reduce(((e,t)=>(e.carbs+=t.carbs,e.proteins+=t.proteins,e.fats+=t.fats,e.count+=1,e)),{carbs:0,proteins:0,fats:0,count:0});return(0,qe.jsxs)("div",{className:"analysis-popup",children:[(0,qe.jsx)("button",{className:"close-button",onClick:s,children:"X"}),(0,qe.jsx)("h2",{children:i("mealAnalysis")}),t?(0,qe.jsxs)("div",{className:"analysis-details",children:[(0,qe.jsx)("h3",{children:i("ingredients")}),(0,qe.jsxs)("table",{children:[(0,qe.jsx)("thead",{children:(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("th",{children:i("ingredient")}),(0,qe.jsx)("th",{children:i("carbs")}),(0,qe.jsx)("th",{children:i("proteins")}),(0,qe.jsx)("th",{children:i("fats")})]})}),(0,qe.jsxs)("tbody",{children:[t.map(((e,t)=>(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:e.ingredient}),(0,qe.jsxs)("td",{children:[e.carbs," g"]}),(0,qe.jsxs)("td",{children:[e.proteins," g"]}),(0,qe.jsxs)("td",{children:[e.fats," g"]})]},t))),(0,qe.jsxs)("tr",{children:[(0,qe.jsx)("td",{children:(0,qe.jsx)("strong",{children:i("total")})}),(0,qe.jsx)("td",{children:(0,qe.jsxs)("strong",{children:[(null===p||void 0===p?void 0:p.carbs)||0," g"]})}),(0,qe.jsx)("td",{children:(0,qe.jsxs)("strong",{children:[(null===p||void 0===p?void 0:p.proteins)||0," g"]})}),(0,qe.jsx)("td",{children:(0,qe.jsxs)("strong",{children:[(null===p||void 0===p?void 0:p.fats)||0," g"]})})]})]})]}),(0,qe.jsxs)("div",{className:"totals-breakdown",children:[(0,qe.jsx)("h3",{children:i("nutritionalBreakdown")}),(0,qe.jsxs)("p",{children:[(0,qe.jsxs)("strong",{children:[i("totalCarbs"),":"]})," ",(null===p||void 0===p?void 0:p.carbs)||0," g"]}),(0,qe.jsxs)("p",{children:[(0,qe.jsxs)("strong",{children:[i("totalProteins"),":"]})," ",(null===p||void 0===p?void 0:p.proteins)||0," g"]}),(0,qe.jsxs)("p",{children:[(0,qe.jsxs)("strong",{children:[i("totalFats"),":"]})," ",(null===p||void 0===p?void 0:p.fats)||0," g"]})]}),(0,qe.jsx)("h3",{children:i("diabeticdata")}),(0,qe.jsxs)("p",{children:[" ",(0,qe.jsx)(_n(),{name:"flash",className:"text-search"}),i("WW"),":"," "+d(null===p||void 0===p?void 0:p.carbs)||0," "]}),(0,qe.jsxs)("p",{children:[" ",(0,qe.jsx)(_n(),{name:"flash-outline",className:"text-search"}),i("fpu")," "+d(null===p||void 0===p?void 0:p.carbs)||0]}),(0,qe.jsxs)("p",{children:[(0,qe.jsx)(_n(),{name:"hardware-chip-outline",className:"text-search"})," ",i("AIdislaimer")]})]}):(0,qe.jsx)("p",{}),r&&(0,qe.jsxs)("div",{className:"question-section",children:[(0,qe.jsx)("h3",{children:i("questionFromAssistant")}),(0,qe.jsx)("p",{children:r}),(0,qe.jsx)("textarea",{value:a,onChange:e=>{l(e.target.value)},placeholder:i("enterYourAnswer")}),(0,qe.jsx)("button",{onClick:()=>{u(!0),o(a).finally((()=>{u(!1),l("")}))},disabled:c,children:c?(0,qe.jsx)(Ns,{}):i("submit")})]})]})},Ts=()=>{const{t:e}=Ln(),t=(0,n.useRef)(null),[r,o]=(0,n.useState)(null),[s,i]=(0,n.useState)(!1),[a,l]=(0,n.useState)(null),[c,u]=(0,n.useState)(""),[d,p]=(0,n.useState)(!1),[h,w]=(0,n.useState)(null),[g,f]=(0,n.useState)(new Audio(Es)),[v,k]=(0,n.useState)(new Audio(vo)),[x,m]=(0,n.useState)(new Audio(zs)),y=(0,n.useCallback)((()=>{const e=t.current.getScreenshot();e&&(o(e),C(e))}),[t]),C=async t=>{if(!t)return fn.error(e("noImageCaptured")),void v.play();i(!0),u("");const r=new FormData;r.append("image",b(t),"image.png");try{const t="".concat(Pn(),"analyze-image"),n=await Or.post(t,r,{headers:{"Content-Type":"multipart/form-data"}});if(200===n.status){const{analysis:t,query:r}=n.data;n.data.success?(l(t||null),w(r||null),null!==r?x.play():g.play(),p(!0)):(fn.error(r||e("analysisFailed")),u(r||e("analysisFailed")),v.play())}else fn.error(e("analysisFailed")),u(e("analysisFailed")),v.play()}catch(n){fn.error(e("serverError")),u(e("serverError")),v.play()}finally{i(!1)}},b=e=>{const t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),o=new Uint8Array(n);for(let s=0;s{try{const r="".concat(Pn(),"respond-query"),n=await Or.post(r,{userResponse:t});if(200===n.status){const{analysis:t,query:r}=n.data;n.data.success?(t?(l(t),w(null)):r&&w(r),fn.success(e("responseSubmitted"))):fn.error(r||e("responseSubmissionFailed"))}else fn.error(e("responseSubmissionFailed"))}catch(r){fn.error(e("responseSubmissionFailed"))}},onClose:()=>{p(!1),o(null),l(null),u(""),w(null)}})]})},Rs=r.p+"static/media/cukrzyca.8c21890a6491e1ca9966.jpg",Ds=r.p+"static/media/Kacper.832b468ef1214b4193be.jpg",Is=r.p+"static/media/Pawel.42584c8195cb57174b5d.jpg",Us=()=>{J();const{t:e}=Ln();return(0,qe.jsxs)("section",{className:"about",children:[(0,qe.jsx)(Ss,{}),(0,qe.jsxs)("div",{className:"about",children:[(0,qe.jsx)("h1",{className:"ourteam",children:e("ourteam")}),(0,qe.jsx)("br",{}),(0,qe.jsxs)("div",{className:"member",children:[(0,qe.jsx)("h2",{children:"Kacper Sikora"}),(0,qe.jsx)("img",{className:"imgks",src:Ds}),(0,qe.jsx)("p",{children:e("ksopis")}),(0,qe.jsxs)("div",{className:"social-media",children:[(0,qe.jsx)(Ze,{to:"https://www.youtube.com/channel/UC37t0k39bcWRzAreu7bAkSQ",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-youtube"})}),(0,qe.jsx)(Ze,{to:"https://github.com/koderhack",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-github"})}),(0,qe.jsx)(Ze,{to:"https://www.linkedin.com/in/kacper-sikora-b63ab9260/",className:"social-link",children:(0,qe.jsx)(_n(),{name:"logo-linkedin"})})]})]}),(0,qe.jsx)("br",{}),(0,qe.jsxs)("div",{className:"member",children:[(0,qe.jsx)("h2",{children:"Pawe\u0142 Bystrzy\u0144ski"}),(0,qe.jsx)("img",{className:"imgks",src:Is}),(0,qe.jsx)("p",{children:e("pbopis")}),(0,qe.jsx)("div",{className:"social-media",children:(0,qe.jsxs)(Ze,{to:"https://stacja4.ignatianum.edu.pl/audycje/magazyn-sportowy-pierwsze-miejsce/",className:"audycja",children:[(0,qe.jsx)(_n(),{name:"radio",className:"icon",size:50})," Audycja"]})})]})]})]})},Fs=r.p+"static/media/woman.106938d532abd488524c.png",qs=e=>{let{handleOpenWebVersion:t}=e;const{t:r}=Ln();return(0,qe.jsxs)("header",{className:"header-container",children:[(0,qe.jsxs)("div",{className:"text-section",children:[(0,qe.jsxs)("div",{className:"header-title",children:[(0,qe.jsx)("h1",{children:r("welcomedc")}),(0,qe.jsx)("h1",{className:"dc",children:"DiabCalc"})]}),(0,qe.jsx)("br",{}),(0,qe.jsx)("p",{className:"header-description",children:r("diabcalcinfo")}),(0,qe.jsxs)("p",{className:"header-description blue",children:[" ",(0,qe.jsx)(_n(),{name:"hardware-chip"}),r("newinfo")]}),(0,qe.jsx)("br",{}),(0,qe.jsx)("h2",{className:"download-title",children:r("pobierz")}),(0,qe.jsxs)("button",{className:"open-web-btn",onClick:t,children:[(0,qe.jsx)(_n(),{name:"globe-outline",className:"icon",size:50}),r("openweb"),(0,qe.jsx)("br",{}),(0,qe.jsxs)("div",{className:"osicons",children:[(0,qe.jsx)(_n(),{name:"logo-android",className:"osicon"}),(0,qe.jsx)(_n(),{name:"logo-apple",className:"osicon"}),(0,qe.jsx)(_n(),{name:"logo-microsoft",className:"osicon"})]})]}),(0,qe.jsx)("br",{}),(0,qe.jsxs)(Ze,{className:"open-web-btn",to:"https://play.google.com/store/apps/details?id=com.koderteam.diabcalcnative",children:[(0,qe.jsx)(_n(),{name:"logo-google-playstore",className:"icon",size:50}),r("openandroid"),(0,qe.jsx)("br",{}),(0,qe.jsx)("div",{className:"osicons",children:(0,qe.jsx)(_n(),{name:"logo-android",className:"osicon"})})]})]}),(0,qe.jsx)("div",{className:"image-section",children:(0,qe.jsx)("img",{src:Fs,className:"family-image",alt:"Happy Family"})})]})},Ws=r.p+"static/media/app.51f5d7710ba3990b8563.png",Gs=()=>{const{t:e}=Ln();return(0,qe.jsxs)("section",{className:"details-container",children:[(0,qe.jsx)("div",{className:"dt-image-section",children:(0,qe.jsx)("img",{src:Ws,className:"appimg",alt:"Happy Family"})}),(0,qe.jsxs)("div",{className:"dt-text-section",children:[(0,qe.jsx)("div",{className:"details-title",children:(0,qe.jsxs)("h1",{children:[e("whatis")," ",(0,qe.jsx)("span",{className:"dc",children:"DiabCalc"})]})}),(0,qe.jsx)("br",{}),(0,qe.jsx)("p",{className:"details-description",children:e("details")})]})]})},Xs=()=>{const{t:e}=Ln(),t=[{id:1,title:e("goal1Title"),description:e("goal1Description"),icon:"image"},{id:2,title:e("goal2Title"),description:e("goal2Description"),icon:"restaurant"},{id:3,title:e("goal3Title"),description:e("goal3Description"),icon:"search"},{id:4,title:e("goal4Title"),description:e("goal4Description"),icon:"construct"}];return(0,qe.jsxs)("section",{className:"ideas-container",id:"goals-section",children:[(0,qe.jsx)("h1",{className:"goalstitle",children:e("goalstitle")}),(0,qe.jsx)("div",{className:"goals",children:t.map((e=>(0,qe.jsxs)("div",{className:"goal-tile",children:[(0,qe.jsx)("h2",{className:"goal-title",children:e.title}),(0,qe.jsx)(_n(),{size:50,name:e.icon}),(0,qe.jsx)("p",{className:"goal-description",children:e.description})]},e.id)))})]})},Ks=e=>{let{t:t,handleOpenWebVersion:r}=e;return(0,qe.jsxs)("div",{className:"landinginfo",children:[(0,qe.jsx)(qs,{id:"header",handleOpenWebVersion:r}),(0,qe.jsx)("hr",{}),(0,qe.jsx)("div",{id:"details-section",children:(0,qe.jsx)(Gs,{})}),(0,qe.jsx)("hr",{}),(0,qe.jsx)(Xs,{}),(0,qe.jsx)("hr",{}),(0,qe.jsx)("div",{id:"about-section",children:(0,qe.jsx)(Us,{})})]})};function Ys(e){for(var t=1;t{const e=J(),{t:t}=Ln(),[r,o]=(0,n.useState)(),[s,i]=(0,n.useState)(!1);(0,n.useEffect)((()=>{fetch("https://api.ipify.org?format=json").then((e=>e.json())).then((e=>{Hs.changeLanguage("pl"),o("pl")})).catch((e=>{console.error("Error fetching IP address:",e)}));Ne.isNativePlatform()&&e("/app"),("standalone"in window.navigator&&window.navigator.standalone||"serviceWorker"in navigator&&navigator.serviceWorker.controller)&&e("/app")}),[e]);return(0,qe.jsxs)("div",{className:"landing-page",style:{backgroundImage:"url(".concat(Rs,")")},children:[(0,qe.jsx)(Ss,{}),(0,qe.jsx)(Ks,{t:t,handleOpenWebVersion:()=>{e("/app")}}),(0,qe.jsx)("div",{id:"contact",children:(0,qe.jsx)(Ls,{})})]})},Js=()=>{const[e,t]=(0,n.useState)(navigator.onLine),[r,o]=(0,n.useState)(navigator.connection?navigator.connection.effectiveType:"unknown"),[s,i]=(0,n.useState)(!1),[a,l]=(0,n.useState)(!1),{user:c}=Xe(),u=Pn();(0,n.useEffect)((()=>{const e=()=>{t(navigator.onLine)},r=()=>{navigator.connection&&o(navigator.connection.effectiveType)};return window.addEventListener("online",e),window.addEventListener("offline",e),navigator.connection&&navigator.connection.addEventListener("change",r),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e),navigator.connection&&navigator.connection.removeEventListener("change",r)}}),[]),(0,n.useEffect)((()=>{let e;return c?d():l(!0),c&&(e=setInterval((()=>{d()}),1e4)),()=>{e&&clearInterval(e)}}),[c]);const d=async()=>{if(c)try{const e=c.userId,t=c.token,r={Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},n=await Or.get("".concat(u,"checkVerify/").concat(e),{headers:r}),o=n.data;200===n.status?l(o.isVerify):(console.error("Error checking verification status: ".concat(o.message)),l(!1))}catch(e){console.error("Error checking verification status: ".concat(e.message)),l(!1)}else l(!1)},p=["2g","slow-2g","3g","slow-3g"].includes(r);return(0,qe.jsxs)(qe.Fragment,{children:[s&&(0,qe.jsxs)("div",{className:"internet-status",children:[(0,qe.jsx)("p",{children:(0,qe.jsx)("strong",{children:"Wprowadzili\u015bmy dodatkowe zabezpieczenia do aplikacji \ud83d\udee1\ufe0f Je\u015bli wi\u0119c aplikacja nie pobiera danych wyloguj si\u0119 w ustawieniach i zaloguj ponownie. Powinno wtedy wszystko ju\u017c dzia\u0142a\u0107. Pozdrawiamy "})}),(0,qe.jsx)("button",{className:"close-button",onClick:()=>{i(!1)},children:"X"})]}),!e&&(0,qe.jsx)("div",{className:"internet-status",children:(0,qe.jsx)("p",{children:(0,qe.jsx)("strong",{children:"Jeste\u015b obecnie offline. Niekt\xf3re funkcje mog\u0105 by\u0107 niedost\u0119pne."})})}),p&&e&&(0,qe.jsx)("div",{className:"internet-status weak-connection",children:(0,qe.jsx)("p",{children:(0,qe.jsx)("strong",{children:"Twoje po\u0142\u0105czenie jest s\u0142abe. Mo\u017cesz do\u015bwiadcza\u0107 op\xf3\u017anie\u0144."})})}),!p&&e&&!a&&(0,qe.jsx)("div",{className:"internet-status",children:(0,qe.jsx)("p",{children:(0,qe.jsx)("strong",{children:"Tw\xf3j email nie jest zweryfikowany. Prosz\u0119 zweryfikuj sw\xf3j email, aby uzyska\u0107 pe\u0142en dost\u0119p."})})})]})},$s=()=>{const{t:e}=Ln(),{user:t}=Xe(),r=J(),o=Pn(),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)({}),[c,u]=(0,n.useState)(0),[d,p]=(0,n.useState)(!1),[h,w]=(0,n.useState)(""),g=(0,n.useCallback)((async()=>{try{const e={Authorization:"Bearer ".concat(t.token),"Content-Type":"application/json"},r=t.userId,n=await Or.get("".concat(o,"/meals/").concat(r),{headers:e});n.data.success?i(n.data.meals||[]):console.error("Error in server response:",n.data)}catch(e){console.error("An error occurred during communication with the server:",e)}}),[t.token,t.userId]);(0,n.useEffect)((()=>{g()}),[g]);const f=(0,n.useCallback)((async e=>{try{const r={Authorization:"Bearer ".concat(t.token),"Content-Type":"application/json"},n=await Or.get("".concat(o,"/mealProducts/").concat(e,"/").concat(t.userId),{headers:r});return n.data.success?n.data.products||[]:(console.error("Error in server response:",n.data),[])}catch(r){return console.error("An error occurred while fetching meal products:",r),[]}}),[t.token,t.userId,o]),v=(0,n.useCallback)((async e=>{try{const t=await f(e.id);if(0===t.length)return 0;const r=t.reduce(((e,t)=>{const r=JSON.parse(t.json).nutriments,n=t.grams||100;return e+(r.carbohydrates_100g||0)*(n/100)}),0),n=r/10;return l((t=>({...t,[e.id]:n.toFixed(1)}))),n}catch(t){return console.error("Error calculating WW for meal:",t),0}}),[f]);(0,n.useEffect)((()=>{(async()=>{try{const e=s.map((e=>v(e))),t=(await Promise.all(e)).reduce(((e,t)=>e+(parseFloat(t)||0)),0);u(t.toFixed(1))}catch(e){console.error("Error calculating total WW:",e)}})()}),[s,v]);const k=(r,n)=>{window.confirm(e("confirmDeleteMeal"))&&(async(e,r)=>{try{const n={Authorization:"Bearer ".concat(t.token),"Content-Type":"application/json"},l={mealId:e,iduser:r},c=await Or.delete("".concat(o,"/removeMeal"),{headers:n,data:l});if(c.data.success){console.log("Posi\u0142ek zosta\u0142 usuni\u0119ty.");const t=s.filter((t=>t.id!==e));i(t);const r=Object.values(a).reduce(((e,t)=>e+(parseFloat(t)||0)),0);u(parseFloat(r.toFixed(1)))}else console.error("Server error: ".concat(c.status," - ").concat(c.statusText))}catch(n){console.error("B\u0142\u0105d podczas usuwania posi\u0142ku:",n)}})(r,n)};return(0,qe.jsxs)("div",{className:"container",children:[(0,qe.jsxs)("div",{className:"header",children:[(0,qe.jsx)("h1",{className:"title",children:e("myMeals")}),(0,qe.jsx)("button",{className:"add-button",onClick:()=>p(!0),children:"+"})]}),d&&(0,qe.jsx)("div",{className:"add-meal-modal",children:(0,qe.jsxs)("div",{className:"add-meal-modal-content",children:[(0,qe.jsx)("span",{className:"close",onClick:()=>p(!1),children:"\xd7"}),(0,qe.jsx)("h1",{children:e("addnewmeal")}),(0,qe.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),h)try{const e={Authorization:"Bearer ".concat(t.token),"Content-Type":"application/json"},n=await Or.post("".concat(o,"/addMeal"),{mealname:h,userid:t.userId},{headers:e});if(n.data.success){const e=n.data.meal;i([...s,e]),w(""),p(!1),r("/app/meal/".concat(e.id))}else console.error("Error adding meal:",n.data)}catch(n){console.error("An error occurred while adding the meal:",n)}},children:[(0,qe.jsx)("input",{type:"text",value:h,onChange:e=>w(e.target.value),placeholder:e("mealName"),required:!0}),(0,qe.jsx)("button",{type:"submit",children:e("addMeal")})]})]})}),(0,qe.jsx)("div",{className:"meal-list",children:s.length>0?s.map((n=>(0,qe.jsxs)("div",{className:"meal-card",children:[(0,qe.jsx)("div",{className:"meal-name",onClick:()=>r("/app/meal/".concat(n.id)),children:n.mealname}),(0,qe.jsx)(_n(),{name:"restaurant",className:"searchbtn",size:50}),(0,qe.jsxs)("div",{className:"meal-info",children:[(0,qe.jsxs)("div",{className:"meal-carbs",children:[(0,qe.jsx)(_n(),{name:"flash-outline",className:"texticon",size:20}),void 0!==a[n.id]?"".concat(e("total")," ").concat(a[n.id]," WW"):""]}),(0,qe.jsx)("div",{className:"meal-more",onClick:()=>r("/app/meal/".concat(n.id)),children:e("more")}),(0,qe.jsx)("button",{className:"delete-button",onClick:()=>k(n.id,t.userId),children:e("delete")})]})]},n.id))):(0,qe.jsx)("div",{className:"no-meals",children:e("noMealsFound")})})]})},ei=e=>{let{productName:t,onClose:r,onAdd:o}=e;const[s,i]=(0,n.useState)(""),{t:a}=Ln();return(0,qe.jsx)("div",{className:"popup-overlay grams",children:(0,qe.jsxs)("div",{className:"popup-container ",children:[(0,qe.jsxs)("div",{className:"popup-header",children:[(0,qe.jsxs)("h2",{children:[a("addpr")," ",t]}),(0,qe.jsx)("button",{className:"close-button",onClick:r,children:"X"})]}),(0,qe.jsx)("div",{className:"popup-body",children:(0,qe.jsxs)("form",{onSubmit:e=>{e.preventDefault(),s&&o(t,s)},children:[(0,qe.jsxs)("label",{children:[a("grams"),(0,qe.jsx)("input",{type:"number",value:s,onChange:e=>i(e.target.value),required:!0})]}),(0,qe.jsx)("div",{className:"popup-buttons",children:(0,qe.jsx)("button",{type:"submit",className:"standard-button",children:a("add")})})]})})]})})},ti=e=>{let{isVisible:t,onClose:r,addProductToMeal:o,user:s}=e;const{t:i}=Ln(),[a,l]=(0,n.useState)([]),[c,u]=(0,n.useState)(!1),[d,p]=(0,n.useState)(""),h=Pn();(0,n.useEffect)((()=>{t&&w()}),[t]);const w=async()=>{try{const e=await Or.get("".concat(h,"recommendations"),{headers:{Authorization:"Bearer ".concat(s.token),"Content-Type":"application/json"},mode:"cors"});e.data.success?l(e.data.products):console.error("Failed to fetch standard recommendations:",e.data.message)}catch(e){console.error("An error occurred while fetching standard recommendations:",e)}};return t?(0,qe.jsxs)("div",{className:"popup-overlay",children:[(0,qe.jsxs)("div",{className:"popup-container",children:[(0,qe.jsxs)("div",{className:"popup-header",children:[(0,qe.jsx)("h2",{children:i("addProductPopup.title")}),(0,qe.jsx)("button",{className:"close-button",onClick:r,children:"X"})]}),(0,qe.jsxs)("div",{className:"popup-body",children:[a.length>0&&(0,qe.jsxs)("div",{children:[(0,qe.jsx)("h3",{children:i("addProductPopup.standardRecommendations")}),(0,qe.jsx)("div",{className:"recommendations",children:a.map((e=>(0,qe.jsx)("button",{className:"recommendation-button",onClick:()=>{return t=e.product_name,p(t),void u(!0);var t},children:e.product_name},e.id)))})]}),(0,qe.jsx)(Ze,{className:"standard-button",to:"/app/search",children:i("searchNewProductBtn")}),(0,qe.jsx)(Ze,{className:"standard-button",to:"/app/scanner",children:i("scanNewProductBtn")}),(0,qe.jsx)(Ze,{className:"standard-button",to:"/app/calc",children:i("addNewProductBtn")})]})]}),c&&(0,qe.jsx)(ei,{productName:d,onClose:()=>u(!1),onAdd:async(e,t)=>{try{const n=await Or.post("".concat(h,"add_to_meal"),{mealid:"your_meal_id_here",productName:e,grams:t},{headers:{Authorization:"Bearer ".concat(s.token),"Content-Type":"application/json"},mode:"cors"});n.data.success?(console.log("Added ".concat(e," to the meal")),o(e,t),u(!1),r()):console.error("Failed to add product to the meal:",n.data.message)}catch(n){console.error("An error occurred while adding product to the meal:",n)}}})]}):null},ri=()=>{const{t:e}=Ln(),{mealid:t}=function(){let{matches:e}=n.useContext(G),t=e[e.length-1];return t?t.params:{}}(),[r,o]=(0,n.useState)(null),[s,i]=(0,n.useState)([]),[a,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(!1),{user:d}=Xe(),p=(J(),Pn()),h=(0,n.useCallback)((async()=>{try{const e=d.token,r={Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},n=d.userId,s=await Or.get("".concat(p,"meal/").concat(t,"/").concat(n),{headers:r});s.data.success?(o(s.data.meal),i(s.data.products),w(s.data.products)):console.error("Failed to fetch meal details:",s.data.message)}catch(e){console.error("An error occurred during communication with the server:",e)}}),[t,d]);(0,n.useEffect)((()=>{h()}),[h]);const w=e=>{const t=e.length>0?(e=>e.reduce(((e,t)=>e+JSON.parse(t.json).nutriments.carbohydrates_100g*(t.grams/100)/10),0).toFixed(1))(e):"?";o((e=>({...e,ww:t})))};return r?(0,qe.jsxs)("div",{className:"container",children:[(0,qe.jsxs)("div",{className:"meal-details-header",children:[(0,qe.jsx)("h1",{children:r.mealname}),(0,qe.jsx)("button",{className:"edit-button",onClick:()=>{l(!a)},children:(0,qe.jsx)(_n(),{name:"create-outline",size:24})})]}),(0,qe.jsx)("div",{className:"meal-details-summary",children:(0,qe.jsxs)("div",{children:[e("exchangeCount"),": ",s.length>0?r.ww:"?"," WW"]})}),(0,qe.jsx)("div",{className:"meal-details-circle",children:(0,qe.jsx)("div",{className:"circle",children:(0,qe.jsxs)("span",{children:[s.length>0?r.ww:"?"," WW"]})})}),(0,qe.jsxs)("div",{className:"meal-details-products",children:[(0,qe.jsx)("h2",{children:e("products")}),s.length>0?s.map((r=>(0,qe.jsxs)("div",{className:"product-item ".concat(a?"draggable":""),children:[(0,qe.jsx)("div",{className:"product-name",children:r.product_name}),(0,qe.jsxs)("div",{className:"product-info",children:[(0,qe.jsxs)("div",{children:[e("amountOfGrams"),": ",r.grams,"g"]}),(0,qe.jsxs)("div",{children:[(JSON.parse(r.json).nutriments.carbohydrates_100g*(r.grams/100)/10).toFixed(1)," WW"]})]}),a&&(0,qe.jsx)("button",{className:"delete-product-button",onClick:()=>(async e=>{try{const r=d.token,n={Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},o=await Or.delete("/removeProduct",{headers:n,data:{mealid:t,userid:d.userId,productId:e}});if(o.data.success){const t=s.filter((t=>t.id!==e));i(t),w(t)}else console.error("Failed to delete product:",o.data.message)}catch(r){console.error("An error occurred during communication with the server:",r)}})(r.id),children:e("delete")})]},r.id))):(0,qe.jsx)("p",{children:e("noProducts")})]}),a&&(0,qe.jsx)("button",{className:"add-product-button",onClick:()=>{u(!0)},children:e("addProduct")}),(0,qe.jsx)(ti,{isVisible:c,user:d,onClose:()=>{u(!1)}})]}):(0,qe.jsx)("div",{children:e("loading")})},ni=e=>{let{isiOSDevice:t,refresh:r}=e;const{logout:o,user:s}=Xe(),i=J();(0,n.useEffect)((()=>{if(s){const e=()=>{const e=s.token;if(!e)return o(),void i("/app/login");const t=a(e);if(!t||!t.exp)return o(),void i("/app/login");const r=Math.floor(Date.now()/1e3);t.expclearInterval(t)}}),[o,i,s]);const a=e=>{try{const t=e.split(".")[1];return JSON.parse(atob(t))}catch(t){return console.error("Error decoding JWT:",t),null}},l=localStorage.getItem("themeMode");return(0,qe.jsxs)("div",{className:"app-container",children:[(0,qe.jsxs)("div",{className:"logo",children:[t&&(0,qe.jsx)("button",{className:"refresh-btn",onClick:r,children:(0,qe.jsx)(_n(),{className:"refreshicon",name:"refresh-outline"})}),(0,qe.jsx)("img",{className:"logoimg",src:Eo,alt:"DiabCalc Logo"}),(0,qe.jsx)("p",{children:(0,qe.jsx)(Ze,{to:"/app",children:"DiabCalc"})}),(0,qe.jsx)(Ze,{to:"/app/settings",className:"settings-btn",children:(0,qe.jsx)(_n(),{className:"ion",name:"settings-outline",size:20,color:"white"})})]}),(0,qe.jsx)(Js,{}),(0,qe.jsxs)(we,{children:[(0,qe.jsx)(pe,{path:"/",element:(0,qe.jsx)(_o,{})}),(0,qe.jsx)(pe,{path:"search",element:(0,qe.jsx)(Nn,{})}),(0,qe.jsx)(pe,{path:"listview",element:(0,qe.jsx)(lo,{})}),(0,qe.jsx)(pe,{path:"scanner",element:(0,qe.jsx)(jo,{})}),(0,qe.jsx)(pe,{path:"calc",element:(0,qe.jsx)(zo,{})}),(0,qe.jsx)(pe,{path:"login",element:(0,qe.jsx)(Po,{})}),(0,qe.jsx)(pe,{path:"register",element:(0,qe.jsx)(No,{})}),(0,qe.jsx)(pe,{path:"add-product",element:(0,qe.jsx)(Oo,{})}),(0,qe.jsx)(pe,{path:"userslist",element:(0,qe.jsx)(To,{})}),(0,qe.jsx)(pe,{path:"settings",element:(0,qe.jsx)(Vs,{})}),(0,qe.jsx)(pe,{path:"addproductuser",element:(0,qe.jsx)(Zo,{})}),(0,qe.jsx)(pe,{path:"analyze",element:(0,qe.jsx)(Ts,{})}),(0,qe.jsx)(pe,{path:"meals",element:(0,qe.jsx)($s,{})}),(0,qe.jsx)(pe,{path:"meal/:mealid",element:(0,qe.jsx)(ri,{})})]}),(0,qe.jsx)(oi,{}),(0,qe.jsx)(sn,{theme:l})]})},oi=()=>{const{user:e}=Xe(),{t:t}=Ln(),[r,o]=(0,n.useState)(""),s=Y();(0,n.useEffect)((()=>{(()=>{let e=s.pathname;if("/app"===e)return void o("Home");e=e.replace("/app","");let t={"/":"Home","/search":"Search","/calc":"Calc","/scanner":"Scanner","/login":"Login","/register":"Register","/logout":"Logout","/meal":"Meal","/listview":"List"}[e];t||[{path:"/meal",tab:"Meal"}].forEach((r=>{e.startsWith(r.path)&&(t=r.tab)}));"Register"===t&&(t="Login"),o(t||"Home")})()}),[s]);const i=e=>{let t;return"Home"===e?t="Home"===r?"home":"home-outline":"Search"===e?t="Search"===r?"search":"search-outline":"Calc"===e?t="Calc"===r?"calculator":"calculator-outline":"Scanner"===e?t="Scanner"===r?"scan":"scan-outline":"Login"===e?t="Login"===r?"person":"person-outline":"Meal"===e?t="Meal"===r?"restaurant":"restaurant-outline":"List"===e&&(t="List"===r?"bookmark":"bookmark-outline"),t},a=e=>{let t;return"Home"===e?t="Home"===r?"nav-link activeclass":"nav-link":"Search"===e?t="Search"===r?"nav-link activeclass":"nav-link":"Calc"===e?t="Calc"===r?"nav-link activeclass":"nav-link":"Scanner"===e?t="Scanner"===r?"nav-link activeclass":"nav-link":"Login"===e?t="Login"===r?"nav-link activeclass":"nav-link":"Meal"===e?t="Meal"===r?"nav-link activeclass":"nav-link":"List"===e&&(t="List"===r?"nav-link activeclass":"nav-link"),t};return(0,qe.jsxs)("nav",{className:"bottom-nav",children:[(0,qe.jsxs)(He,{to:"/app/",className:a("Home"),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("Home"),size:20,color:"blue"}),t("home")]}),(0,qe.jsxs)(He,{to:"/app/search",className:a("Search"),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("Search"),size:20,color:"blue"}),t("search")]}),(0,qe.jsxs)(He,{to:"/app/calc",className:a("Calc"),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("Calc"),size:20,color:"blue"}),t("calc")]}),(0,qe.jsxs)(He,{to:"/app/scanner",className:"scanner ".concat(a("Scanner")),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("Scanner"),size:20,color:"blue"}),t("scanner")]}),e?(0,qe.jsxs)(He,{to:"/app/listview",className:a("List"),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("List"),size:20,color:"blue"}),t("listview")]}):(0,qe.jsxs)(He,{to:"/app/login",className:a("Login"),children:[(0,qe.jsx)(_n(),{className:"ion",name:i("Login"),size:20,color:"blue"}),t("account")]})]})},si=()=>{const[e,t]=(0,n.useState)(),[r,o]=(0,n.useState)(!1),s=(J(),/iPhone|iPod|iPad/.test(navigator.userAgent));Pn();(0,n.useEffect)((()=>{const e=localStorage.getItem("language");if(e)Hs.changeLanguage(e);else{const e=navigator.language||navigator.userLanguage;Hs.changeLanguage(e.split("-")[0])}document.documentElement.lang=Hs.language;(e=>{if("dark"===e)document.body.classList.add("dark-mode");else if("light"===e)document.body.classList.remove("dark-mode");else{window.matchMedia("(prefers-color-scheme: dark)").matches?document.body.classList.add("dark-mode"):document.body.classList.remove("dark-mode")}})(localStorage.getItem("themeMode")||"system")}),[]);return(0,qe.jsx)(Ge,{children:(0,qe.jsxs)(we,{children:[(0,qe.jsx)(pe,{path:"/",element:(0,qe.jsx)(Qs,{})}),(0,qe.jsx)(pe,{path:"/policy",element:(0,qe.jsx)(_s,{})}),(0,qe.jsx)(pe,{path:"/terms",element:(0,qe.jsx)(Bs,{})}),(0,qe.jsx)(pe,{path:"/app/*",element:(0,qe.jsx)(ni,{isiOSDevice:s,refresh:()=>{window.location.reload()}})})]})})},ii=e=>{e&&e instanceof Function&&r.e(787).then(r.bind(r,787)).then((t=>{let{getCLS:r,getFID:n,getFCP:o,getLCP:s,getTTFB:i}=t;r(e),n(e),o(e),s(e),i(e)}))};const ai=(0,n.createContext)(null);function li(e){let{clientId:t,nonce:r,onScriptLoadSuccess:o,onScriptLoadError:s,children:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{nonce:t,onScriptLoadSuccess:r,onScriptLoadError:o}=e,[s,i]=(0,n.useState)(!1),a=(0,n.useRef)(r);a.current=r;const l=(0,n.useRef)(o);return l.current=o,(0,n.useEffect)((()=>{const e=document.createElement("script");return e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.nonce=t,e.onload=()=>{var e;i(!0),null===(e=a.current)||void 0===e||e.call(a)},e.onerror=()=>{var e;i(!1),null===(e=l.current)||void 0===e||e.call(l)},document.body.appendChild(e),()=>{document.body.removeChild(e)}}),[t]),s}({nonce:r,onScriptLoadSuccess:o,onScriptLoadError:s}),l=(0,n.useMemo)((()=>({clientId:t,scriptLoadedSuccessfully:a})),[t,a]);return n.createElement(ai.Provider,{value:l},i)}s.createRoot(document.getElementById("root")).render((0,qe.jsx)(n.StrictMode,{children:(0,qe.jsx)(li,{clientId:"258496790445-pmrd6jhnbmudig1fmr6av458q6907908.apps.googleusercontent.com",children:(0,qe.jsx)(Me,{children:(0,qe.jsx)(si,{})})})})),ii()})()})();
//# sourceMappingURL=main.a77bec03.js.map