Loading [MathJax]/extensions/MathZoom.js

AmpHour Calculator

This tool allows you to get the maximum current and time duration that a battery can put out.  You can specify the time in 24-hour format. So if you know the amp-hour capacity and the load you can then determine the time it will be running stable. It even intergrades with NL5 Circuit Simulator.
More calculators coming soon!
  1. program amphour;
  2. {$APPTYPE Console}
  3. {$RESource ahres.res}
  4. uses
  5. windows,
  6. SysUtils,urlmon,math,
  7. Classes;
  8. type TNL5=record
  9. FirstValue,LastValue:extended;
  10. HError:hresult;
  11. data:string;
  12. end;
  13. var CONST_HOUR_VALUE,hdt:TDateTime;
  14. ah,a,h:extended;
  15. sh,sah,sa,sd:string;
  16. dd,mIndex,i:integer;
  17. nl5opt:tstringlist;
  18. nl5:tnl5;
  19. function StrToFloatDef(const S:String; def:extended):extended;
  20. begin
  21. try result:=strtofloat(s) except result:=def; end;
  22. end;
  23. function nl5requestoutput(nl5opt:tstringlist;param:string;outp:extended):TNL5;
  24. var nl5filen,nl5url:array[0..max_path]of char;
  25. nl5ans:tstringlist;
  26. begin
  27. result.HError:=urldownloadtocachefile(nil,strfmt(nl5url,
  28. 'http://localhost:%u/?%s=%g',[strtointdef(nl5opt.values['nl5port'],80),
  29. nl5opt.values[param],outp]),nl5filen,max_path+1,0,nil);
  30. if nl5.HError=s_ok then begin
  31. nl5ans:=tstringlist.Create;
  32. nl5ans.LoadFromFile(nl5filen);
  33. result.data:=nl5ans.Text;
  34. nl5ans.Free;
  35. end;
  36. end;
  37. function nl5requestinput(nl5opt:tstringlist;param:string;intype:char):tnl5;
  38. var nl5filen,nl5url:array[0..max_path]of char;
  39. nl5ans:tstringlist;
  40. begin
  41. result.HError:=urldownloadtocachefile(nil,strfmt(nl5url,
  42. 'http://localhost:%u/?%s(%s)',[strtointdef(nl5opt.values['nl5port'],80),intype,
  43. nl5opt.values[param]]),nl5filen,max_path+1,0,nil);
  44. if nl5.HError=s_ok then begin
  45. nl5ans:=tstringlist.Create;
  46. nl5ans.LoadFromFile(nl5filen);
  47. result.data:=nl5ans.Text;
  48. nl5ans.CommaText:=nl5ans[0];
  49. result.FirstValue:=strtofloatdef(nl5ans[0],0);
  50. result.LastValue:=strtofloatdef(nl5ans[nl5ans.count-1],0);
  51. nl5ans.Free;
  52. end;
  53. deletefile(nl5filen);
  54. end;
  55. label mysub;
  56. begin
  57. if paramstr(1)='/?'then begin
  58. writeln('Usage: ',extractfilename(paramstr(0)),' [nl5port=port nl5options]');
  59. writeln('nl5port=port Spefifies the HTTP Link port.(default port 80)');
  60. writeln;
  61. writeln('NL5 Options:');
  62. writeln('bat_loadinp= Spefifies the NL5 component to get its battery load current from');
  63. writeln('bat_loadout= NL5 Current Source to set the amphour load.');
  64. exitprocess(0);
  65. end;
  66. SetConsoleTitle('AmpHour Calculator');
  67. const_hour_Value:=EncodeTime(1,0,0,0);
  68. nl5opt:=tstringlist.Create;
  69. for i:=1to paramcount do nl5opt.Add(paramstr(i));
  70. mysub:
  71. sh:='0';sa:='0';sah:='';sd:='0';hdt:=0;
  72. writeln('Leave one answer blank');
  73. write('Enter Discharge time(hh:mm:ss):');
  74. readln(sh);
  75. if sh<>'' then begin
  76. write('Enter discharge days(optional):');
  77. readln(sd);
  78. if sd='' then sd:='0';
  79. end;
  80. write('Enter AmpHour rating(in Amphours):');
  81. readln(sah);
  82. if(nl5opt.Values['bat_loadinp']='')and(nl5opt.Values['bat_loadout']='') then begin
  83. write('Enter current draw in Amps:');
  84. readln(sa);
  85. end else begin if nl5opt.Values['bat_loadinp']<>''then begin nl5:=nl5requestinput(
  86. nl5opt,'bat_loadinp','I');
  87. sa:=floattostr(nl5.LastValue);
  88. if nl5.herror<>s_ok then begin writeln('URLErr:',inttohex(nl5.herror,0));
  89. exitprocess(1);end;
  90. end;
  91. end;
  92. if sa='' then sa:='0';
  93. if sah='' then sah:='0';
  94. a:=StrTofloat(sa);
  95. ah:=strtofloat(sah);
  96. if ((sh='')and(ah=0))or((ah=0)and(a=0))or((sh='')and(a=0))then begin
  97. writeln('Error in one or more variables, please check to make sure only numbers are entered and only one answer is blank');
  98. write('Try Again(Yes/no)? ');
  99. readln(sh);
  100. if pos('Y',Uppercase(sh))>0 then goto mysub else exitprocess(0);
  101. end;
  102. if sh<>'' then
  103. try
  104. hdt:=dd+StrToTime(sh);
  105. except on e:exception do begin
  106. writeln('Error:',e.message);
  107. write('Try Again(Yes/No)?');
  108. readln(sh);
  109. if pos('Y',uppercase(sh))>0 then sh:= 'TRY_AGAIN' else sh:= 'EXIT';
  110. end;
  111. end;
  112. if sh='TRY_AGAIN' then goto mysub;
  113. if sh='EXIT' then exitprocess(0);
  114. if a*ah*hdt<>0 then begin
  115. writeln('You didnt leave any answer blank');
  116. write('Try Again(Yes/No)?');
  117. readln(sh);
  118. if pos('Y',uppercase(sh))>0 then goto mysub else exitprocess(0);
  119. end;
  120. if sh='' then
  121. hdt :=(ah/a)*const_hour_value;
  122. h:=hdt/const_hour_value;
  123. if a=0 then a:=ah/h;
  124. if ah=0 then
  125. ah:=a*h;
  126. nl5:=nl5requestoutput(nl5opt,'bat_loadout',a);
  127. if nl5.HError<>s_ok then writeln('URLErr:',inttohex(nl5.HError,0));
  128. Writeln('Duration: ',Trunc(hdt),' days ',formatdatetime('hh:mm:ss',hdt));
  129. writeln('AmpHour Rating:',floattostr(ah));
  130. writeln('Current Draw:',floattostr(a),' Amps');
  131. write('Do you want to try again(Yes/No)?');
  132. readln(sh);
  133. if pos('Y',Uppercase(sh))>0 then goto mysub;
  134. end.
program amphour;
{$APPTYPE Console}
{$RESource ahres.res}
uses
windows,
  SysUtils,urlmon,math,
  Classes;

type TNL5=record
FirstValue,LastValue:extended;
HError:hresult;
data:string;
end;
var CONST_HOUR_VALUE,hdt:TDateTime;
ah,a,h:extended;
sh,sah,sa,sd:string;
dd,mIndex,i:integer;
nl5opt:tstringlist;
nl5:tnl5;
function StrToFloatDef(const S:String; def:extended):extended;
begin
try result:=strtofloat(s) except result:=def; end;
end;

function nl5requestoutput(nl5opt:tstringlist;param:string;outp:extended):TNL5;
var nl5filen,nl5url:array[0..max_path]of char;
nl5ans:tstringlist;
begin
result.HError:=urldownloadtocachefile(nil,strfmt(nl5url,
'http://localhost:%u/?%s=%g',[strtointdef(nl5opt.values['nl5port'],80),
nl5opt.values[param],outp]),nl5filen,max_path+1,0,nil);
if nl5.HError=s_ok then begin
nl5ans:=tstringlist.Create;
nl5ans.LoadFromFile(nl5filen);
result.data:=nl5ans.Text;
nl5ans.Free;
end;
end;

function nl5requestinput(nl5opt:tstringlist;param:string;intype:char):tnl5;
var nl5filen,nl5url:array[0..max_path]of char;
nl5ans:tstringlist;
begin
result.HError:=urldownloadtocachefile(nil,strfmt(nl5url,
'http://localhost:%u/?%s(%s)',[strtointdef(nl5opt.values['nl5port'],80),intype,
nl5opt.values[param]]),nl5filen,max_path+1,0,nil);
if nl5.HError=s_ok then begin
nl5ans:=tstringlist.Create;
nl5ans.LoadFromFile(nl5filen);
result.data:=nl5ans.Text;
nl5ans.CommaText:=nl5ans[0];
result.FirstValue:=strtofloatdef(nl5ans[0],0);
result.LastValue:=strtofloatdef(nl5ans[nl5ans.count-1],0);
nl5ans.Free;
end;
deletefile(nl5filen);
end;
label mysub;
begin
if paramstr(1)='/?'then begin
writeln('Usage: ',extractfilename(paramstr(0)),' [nl5port=port nl5options]');
writeln('nl5port=port     Spefifies the HTTP Link port.(default port 80)');
writeln;
writeln('NL5 Options:');
writeln('bat_loadinp=     Spefifies the NL5 component to get its battery load current from');
writeln('bat_loadout=     NL5 Current Source to set the amphour load.');
exitprocess(0);
end;
SetConsoleTitle('AmpHour Calculator');
const_hour_Value:=EncodeTime(1,0,0,0);
nl5opt:=tstringlist.Create;
for i:=1to paramcount do nl5opt.Add(paramstr(i));
mysub:
sh:='0';sa:='0';sah:='';sd:='0';hdt:=0;
writeln('Leave one answer blank');
write('Enter Discharge time(hh:mm:ss):');
readln(sh);
if sh<>'' then begin
write('Enter discharge days(optional):');
readln(sd);
if sd='' then sd:='0';
end;
write('Enter AmpHour rating(in Amphours):');
readln(sah);
if(nl5opt.Values['bat_loadinp']='')and(nl5opt.Values['bat_loadout']='') then begin
write('Enter current draw in Amps:');
readln(sa);
end else begin if nl5opt.Values['bat_loadinp']<>''then begin nl5:=nl5requestinput(
nl5opt,'bat_loadinp','I');
sa:=floattostr(nl5.LastValue);
if nl5.herror<>s_ok then begin writeln('URLErr:',inttohex(nl5.herror,0));
exitprocess(1);end;
end;
end;
if sa='' then sa:='0';
if sah='' then sah:='0';
a:=StrTofloat(sa);
ah:=strtofloat(sah);
if ((sh='')and(ah=0))or((ah=0)and(a=0))or((sh='')and(a=0))then begin
writeln('Error in one or more variables, please check to make sure only numbers are entered and only one answer is blank');
write('Try Again(Yes/no)? ');
readln(sh);
if pos('Y',Uppercase(sh))>0 then goto mysub else exitprocess(0);
end;
if sh<>'' then
try
 hdt:=dd+StrToTime(sh);
except on e:exception do begin
writeln('Error:',e.message);
write('Try Again(Yes/No)?');
readln(sh);
if pos('Y',uppercase(sh))>0 then sh:= 'TRY_AGAIN' else sh:= 'EXIT';
end;
end;
if sh='TRY_AGAIN' then goto mysub;
if sh='EXIT' then exitprocess(0);
if a*ah*hdt<>0 then begin
writeln('You didnt leave any answer blank');
write('Try Again(Yes/No)?');
readln(sh);
if pos('Y',uppercase(sh))>0 then goto mysub else exitprocess(0);
end;
if sh='' then
hdt :=(ah/a)*const_hour_value;
h:=hdt/const_hour_value;
if a=0 then a:=ah/h;
if ah=0 then
ah:=a*h;
nl5:=nl5requestoutput(nl5opt,'bat_loadout',a);
if nl5.HError<>s_ok then writeln('URLErr:',inttohex(nl5.HError,0));
Writeln('Duration: ',Trunc(hdt),' days ',formatdatetime('hh:mm:ss',hdt));
writeln('AmpHour Rating:',floattostr(ah));
writeln('Current Draw:',floattostr(a),' Amps');
write('Do you want to try again(Yes/No)?');
readln(sh);
if pos('Y',Uppercase(sh))>0 then goto mysub;
end.                                   
Trash
 
 
Error
Unable to connect to backend.
HTTP error 0

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

Published by Justin Roeder

I am an electronics engineer and computer programmer that has autism. I learned by myself

delphijustin Industries is an Autism Supported Business
Social Media Auto Publish Powered By : XYZScripts.com
All in one
Start
Amazon.com, Inc. OH Dublin
Your cart is empty.
There are 0 days, 14 hours, 51 minutes and 25 seconds left until Justin's Birthday

You can use the keyboard arrows to navigate between the component buttons
",e=e.removeChild(e.firstChild)):"string"==typeof o.is?e=l.createElement(a,{is:o.is}):(e=l.createElement(a),"select"===a&&(l=e,o.multiple?l.multiple=!0:o.size&&(l.size=o.size))):e=l.createElementNS(e,a),e[Ni]=t,e[Pi]=o,Pl(e,t,!1,!1),t.stateNode=e,l=Ae(a,o),a){case"iframe":case"object":case"embed":Te("load",e),u=o;break;case"video":case"audio":for(u=0;u<$a.length;u++)Te($a[u],e);u=o;break;case"source":Te("error",e),u=o;break;case"img":case"image":case"link":Te("error",e),Te("load",e),u=o;break;case"form":Te("reset",e),Te("submit",e),u=o;break;case"details":Te("toggle",e),u=o;break;case"input":A(e,o),u=M(e,o),Te("invalid",e),Ie(n,"onChange");break;case"option":u=B(e,o);break;case"select":e._wrapperState={wasMultiple:!!o.multiple},u=Uo({},o,{value:void 0}),Te("invalid",e),Ie(n,"onChange");break;case"textarea":V(e,o),u=H(e,o),Te("invalid",e),Ie(n,"onChange");break;default:u=o}Me(a,u);var s=u;for(i in s)if(s.hasOwnProperty(i)){var c=s[i];"style"===i?ze(e,c):"dangerouslySetInnerHTML"===i?(c=c?c.__html:void 0,null!=c&&Aa(e,c)):"children"===i?"string"==typeof c?("textarea"!==a||""!==c)&&X(e,c):"number"==typeof c&&X(e,""+c):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(ea.hasOwnProperty(i)?null!=c&&Ie(n,i):null!=c&&x(e,i,c,l))}switch(a){case"input":L(e),j(e,o,!1);break;case"textarea":L(e),$(e);break;case"option":null!=o.value&&e.setAttribute("value",""+P(o.value));break;case"select":e.multiple=!!o.multiple,n=o.value,null!=n?q(e,!!o.multiple,n,!1):null!=o.defaultValue&&q(e,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof u.onClick&&(e.onclick=Fe)}Ve(a,o)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Ll(e,t,e.memoizedProps,o);else{if("string"!=typeof o&&null===t.stateNode)throw Error(r(166));n=yn(yu.current),yn(bu.current),Jn(t)?(n=t.stateNode,o=t.memoizedProps,n[Ni]=t,n.nodeValue!==o&&(t.effectTag|=4)):(n=(9===n.nodeType?n:n.ownerDocument).createTextNode(o),n[Ni]=t,t.stateNode=n)}return null;case 13:return zt(vu),o=t.memoizedState,0!==(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==o,o=!1,null===e?void 0!==t.memoizedProps.fallback&&Jn(t):(a=e.memoizedState,o=null!==a,n||null===a||(a=e.child.sibling,null!==a&&(i=t.firstEffect,null!==i?(t.firstEffect=a,a.nextEffect=i):(t.firstEffect=t.lastEffect=a,a.nextEffect=null),a.effectTag=8))),n&&!o&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&vu.current)?rs===Qu&&(rs=Yu):(rs!==Qu&&rs!==Yu||(rs=Gu),0!==us&&null!==es&&(To(es,ns),Co(es,us)))),(n||o)&&(t.effectTag|=4),null);case 4:return wn(),Ol(t),null;case 10:return Zt(t),null;case 17:return It(t.type)&&Ft(),null;case 19:if(zt(vu),o=t.memoizedState,null===o)return null;if(a=0!==(64&t.effectTag),i=o.rendering,null===i){if(a)mr(o,!1);else if(rs!==Qu||null!==e&&0!==(64&e.effectTag))for(i=t.child;null!==i;){if(e=_n(i),null!==e){for(t.effectTag|=64,mr(o,!1),a=e.updateQueue,null!==a&&(t.updateQueue=a,t.effectTag|=4),null===o.lastEffect&&(t.firstEffect=null),t.lastEffect=o.lastEffect,o=t.child;null!==o;)a=o,i=n,a.effectTag&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,e=a.alternate,null===e?(a.childExpirationTime=0,a.expirationTime=i,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null):(a.childExpirationTime=e.childExpirationTime,a.expirationTime=e.expirationTime,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,i=e.dependencies,a.dependencies=null===i?null:{expirationTime:i.expirationTime,firstContext:i.firstContext,responders:i.responders}),o=o.sibling;return Mt(vu,1&vu.current|2),t.child}i=i.sibling}}else{if(!a)if(e=_n(i),null!==e){if(t.effectTag|=64,a=!0,n=e.updateQueue,null!==n&&(t.updateQueue=n,t.effectTag|=4),mr(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate)return t=t.lastEffect=o.lastEffect,null!==t&&(t.nextEffect=null),null}else 2*ru()-o.renderingStartTime>o.tailExpiration&&1t)&&vs.set(e,t)))}}function Ur(e,t){e.expirationTimee?n:e,2>=e&&t!==e?0:e}function qr(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=$t(Vr.bind(null,e));else{var t=Br(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Fr();if(1073741823===t?r=99:1===t||2===t?r=95:(r=10*(1073741821-t)-10*(1073741821-r),r=0>=r?99:250>=r?98:5250>=r?97:95),null!==n){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=r)return;n!==Yl&&Bl(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?$t(Vr.bind(null,e)):Wt(r,Hr.bind(null,e),{timeout:10*(1073741821-t)-ru()}),e.callbackNode=t}}}function Hr(e,t){if(ks=0,t)return t=Fr(),No(e,t),qr(e),null;var n=Br(e);if(0!==n){if(t=e.callbackNode,(Ju&(Wu|$u))!==Hu)throw Error(r(327));if(lo(),e===es&&n===ns||Kr(e,n),null!==ts){var o=Ju;Ju|=Wu;for(var a=Yr();;)try{eo();break}catch(t){Xr(e,t)}if(Gt(),Ju=o,Bu.current=a,rs===Ku)throw t=os,Kr(e,n),To(e,n),qr(e),t;if(null===ts)switch(a=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,o=rs,es=null,o){case Qu:case Ku:throw Error(r(345));case Xu:No(e,2=n){e.lastPingedTime=n,Kr(e,n);break}}if(i=Br(e),0!==i&&i!==n)break;if(0!==o&&o!==n){e.lastPingedTime=o;break}e.timeoutHandle=Si(oo.bind(null,e),a);break}oo(e);break;case Gu:if(To(e,n),o=e.lastSuspendedTime,n===o&&(e.nextKnownPendingLevel=ro(a)),ss&&(a=e.lastPingedTime,0===a||a>=n)){e.lastPingedTime=n,Kr(e,n);break}if(a=Br(e),0!==a&&a!==n)break;if(0!==o&&o!==n){e.lastPingedTime=o;break}if(1073741823!==is?o=10*(1073741821-is)-ru():1073741823===as?o=0:(o=10*(1073741821-as)-5e3,a=ru(),n=10*(1073741821-n)-a,o=a-o,0>o&&(o=0),o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Uu(o/1960))-o,n=o?o=0:(a=0|l.busyDelayMs,i=ru()-(10*(1073741821-i)-(0|l.timeoutMs||5e3)),o=i<=a?0:a+o-i),10 component higher in the tree to provide a loading indicator or placeholder to display."+N(i))}rs!==Zu&&(rs=Xu),l=yr(l,i),f=a;do{switch(f.tag){case 3:u=l,f.effectTag|=4096,f.expirationTime=t;var w=Ar(f,u,t);ln(f,w); break e;case 1:u=l;var E=f.type,k=f.stateNode;if(0===(64&f.effectTag)&&("function"==typeof E.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===ms||!ms.has(k)))){f.effectTag|=4096,f.expirationTime=t;var _=Ir(f,u,t);ln(f,_);break e}}f=f.return}while(null!==f)}ts=no(ts)}catch(e){t=e;continue}break}}function Yr(){var e=Bu.current;return Bu.current=Cu,null===e?Cu:e}function Gr(e,t){eus&&(us=e)}function Jr(){for(;null!==ts;)ts=to(ts)}function eo(){for(;null!==ts&&!Gl();)ts=to(ts)}function to(e){var t=Fu(e.alternate,e,ns);return e.memoizedProps=e.pendingProps,null===t&&(t=no(e)),qu.current=null,t}function no(e){ts=e;do{var t=ts.alternate;if(e=ts.return,0===(2048&ts.effectTag)){if(t=br(t,ts,ns),1===ns||1!==ts.childExpirationTime){for(var n=0,r=ts.child;null!==r;){var o=r.expirationTime,a=r.childExpirationTime;o>n&&(n=o),a>n&&(n=a),r=r.sibling}ts.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=ts.firstEffect),null!==ts.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=ts.firstEffect),e.lastEffect=ts.lastEffect),1e?t:e}function oo(e){var t=qt();return Vt(99,ao.bind(null,e,t)),null}function ao(e,t){do lo();while(null!==gs);if((Ju&(Wu|$u))!==Hu)throw Error(r(327));var n=e.finishedWork,o=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var a=ro(n);if(e.firstPendingTime=a,o<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:o<=e.firstSuspendedTime&&(e.firstSuspendedTime=o-1),o<=e.lastPingedTime&&(e.lastPingedTime=0),o<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===es&&(ts=es=null,ns=0),1u&&(c=u,u=l,l=c),c=Ue(w,l),f=Ue(w,u),c&&f&&(1!==k.rangeCount||k.anchorNode!==c.node||k.anchorOffset!==c.offset||k.focusNode!==f.node||k.focusOffset!==f.offset)&&(E=E.createRange(),E.setStart(c.node,c.offset),k.removeAllRanges(),l>u?(k.addRange(E),k.extend(f.node,f.offset)):(E.setEnd(f.node,f.offset),k.addRange(E)))))),E=[];for(k=w;k=k.parentNode;)1===k.nodeType&&E.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w=t&&e<=t}function To(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Co(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function No(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Po(e,t,n,o){var a=t.current,i=Fr(),l=su.suspense;i=jr(i,a,l);e:if(n){n=n._reactInternalFiber;t:{if(J(n)!==n||1!==n.tag)throw Error(r(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(It(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(r(171))}if(1===n.tag){var s=n.type;if(It(s)){n=Dt(n,s,u);break e}}n=u}else n=Al;return null===t.context?t.context=n:t.pendingContext=n,t=on(i,l),t.payload={element:e},o=void 0===o?null:o,null!==o&&(t.callback=o),an(a,t),Dr(a,i),i}function Oo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ro(e,t){e=e.memoizedState,null!==e&&null!==e.dehydrated&&e.retryTime