ocearo-ui 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/404.html +1 -1
  2. package/README.fr.md +9 -7
  3. package/README.md +9 -7
  4. package/__next.__PAGE__.txt +3 -3
  5. package/__next._full.txt +3 -3
  6. package/__next._tree.txt +2 -2
  7. package/_next/static/chunks/0ath9h2eo-m4-.js +1 -0
  8. package/_next/static/chunks/0bxzs0khjn1uj.js +1 -0
  9. package/_next/static/chunks/0ejjon45nq_-h.js +9 -0
  10. package/_next/static/chunks/0glm63vhzbxk5.js +9 -0
  11. package/_next/static/chunks/0n5v9mjln3x9c.js +121 -0
  12. package/_next/static/chunks/{1bvrvkcwf3ge-.js → 0ngl63fz0a-bo.js} +1 -1
  13. package/_next/static/chunks/0vhk5q54me91_.js +1 -0
  14. package/_next/static/chunks/0wi5jop1ihbm6.js +2 -0
  15. package/_next/static/chunks/1442uc2w4y1ve.js +503 -0
  16. package/_next/static/chunks/18vlmqe7txbmt.js +1 -0
  17. package/_next/static/chunks/{3utjjgdhnlx86.js → 192c42s2wc7qe.js} +1 -1
  18. package/_next/static/chunks/1_twx50ejqan5.js +1 -0
  19. package/_next/static/chunks/1na56snuhu-pc.js +346 -0
  20. package/_next/static/chunks/1vchkqgn-xw-o.js +1 -0
  21. package/_next/static/chunks/21408p9d6c0sg.js +1 -0
  22. package/_next/static/chunks/2393lwi8kee3m.js +48 -0
  23. package/_next/static/chunks/25v2cwta2fy-7.js +393 -0
  24. package/_next/static/chunks/28wfa6j-9g_qc.js +1 -0
  25. package/_next/static/chunks/2cecf_xnd_9em.js +1 -0
  26. package/_next/static/chunks/2die6btm3_mhq.js +1 -0
  27. package/_next/static/chunks/{18_i6mf6hb_c7.js → 2gsiwp60towtx.js} +1 -1
  28. package/_next/static/chunks/2ijx7rln4jshb.css +3 -0
  29. package/_next/static/chunks/2qch0at4eelx8.js +1 -0
  30. package/_next/static/chunks/2qylgmdj-32um.js +503 -0
  31. package/_next/static/chunks/2xntuu6mzh41s.js +1 -0
  32. package/_next/static/chunks/30p1dpgmonstj.js +1 -0
  33. package/_next/static/chunks/31p7nz0hfuym7.js +1 -0
  34. package/_next/static/chunks/{1e-w_-usen7fy.js → 34nhy77liurum.js} +2 -2
  35. package/_next/static/chunks/3h_m2s30sr9mt.js +430 -0
  36. package/_next/static/chunks/3j453-2u58qbv.js +1 -0
  37. package/_next/static/chunks/3k-r-4veivdjr.js +1 -0
  38. package/_next/static/chunks/3nv6p6vvu2zlg.js +1 -0
  39. package/_next/static/chunks/3yz0mxxv4vrfg.js +1 -0
  40. package/_next/static/chunks/3z29h80ysf4f1.js +739 -0
  41. package/_next/static/chunks/40b8ooaw6x7my.js +180 -0
  42. package/_not-found/__next._full.txt +2 -2
  43. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  44. package/_not-found/__next._tree.txt +2 -2
  45. package/_not-found.html +1 -1
  46. package/_not-found.txt +2 -2
  47. package/boats/boats.json +11 -19
  48. package/boats/windsurf/assets/license.txt +6 -8
  49. package/boats/windsurf/assets/rider.glb +0 -0
  50. package/boats/wingfoil/assets/license.txt +9 -0
  51. package/boats/wingfoil/assets/rider.glb +0 -0
  52. package/guide/bathymetry.jpg +0 -0
  53. package/guide/weather.jpg +0 -0
  54. package/index.html +1 -1
  55. package/index.txt +3 -3
  56. package/package.json +2 -2
  57. package/settings/__next._full.txt +3 -3
  58. package/settings/__next._tree.txt +2 -2
  59. package/settings/__next.settings.__PAGE__.txt +3 -3
  60. package/settings.html +1 -1
  61. package/settings.txt +3 -3
  62. package/_next/static/chunks/0-19-ljntm5ig.js +0 -1
  63. package/_next/static/chunks/0-g-ujyrfgutp.js +0 -2
  64. package/_next/static/chunks/0-jqvc-r0kh0c.js +0 -1
  65. package/_next/static/chunks/05do10p9ldt1p.js +0 -409
  66. package/_next/static/chunks/0c91q-13wh8hk.js +0 -1
  67. package/_next/static/chunks/0fv1wwxeyagln.js +0 -446
  68. package/_next/static/chunks/0jucaltuccn03.js +0 -1
  69. package/_next/static/chunks/0m7wbuocx-b4_.js +0 -9
  70. package/_next/static/chunks/0o7hu-sypv2u9.js +0 -1
  71. package/_next/static/chunks/0ujzg6ofy2r73.js +0 -1
  72. package/_next/static/chunks/162bfkgcudvew.js +0 -9
  73. package/_next/static/chunks/1bo0ke8gjc1c2.js +0 -1
  74. package/_next/static/chunks/1do-2zwq3ws0f.js +0 -346
  75. package/_next/static/chunks/1ho2ekxa9io1_.js +0 -1
  76. package/_next/static/chunks/1m3-nchdgcxy1.css +0 -3
  77. package/_next/static/chunks/271ys-u920uqd.js +0 -564
  78. package/_next/static/chunks/2_iau6x7s0vil.js +0 -1131
  79. package/_next/static/chunks/2ab6q6u6uo_bf.js +0 -1
  80. package/_next/static/chunks/2pt-apz8_pa4j.js +0 -1
  81. package/_next/static/chunks/2rnpgrmuyhpkd.js +0 -119
  82. package/_next/static/chunks/2w71oj1brox5z.js +0 -1
  83. package/_next/static/chunks/3e5jmzthktu9w.js +0 -1
  84. package/_next/static/chunks/3r8nellt-dsed.js +0 -1
  85. package/_next/static/chunks/3wwn1rti8oc_r.js +0 -1
  86. package/_next/static/chunks/41odv061mfm6t.js +0 -1
  87. package/boats/optimist/Scene.jsx +0 -28
  88. package/boats/optimist/assets/license.txt +0 -11
  89. package/boats/optimist/assets/scene-transformed.glb +0 -0
  90. package/boats/sailboat/Scene.jsx +0 -21
  91. package/boats/sailboat/assets/license.txt +0 -10
  92. package/boats/sailboat/assets/scene-transformed.glb +0 -0
  93. package/boats/windsurf/Scene.jsx +0 -22
  94. package/boats/windsurf/assets/scene-transformed.glb +0 -0
  95. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_buildManifest.js +0 -0
  96. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_clientMiddlewareManifest.js +0 -0
  97. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,48390,t=>{"use strict";var e=t.i(67034),r=t.i(83402);let n=()=>{let t,e=r.default.getAll();return t=e.signalKUrlSet&&e.signalkUrl?r.default.normalizeSignalKUrl(e.signalkUrl):"function"==typeof r.default.getComputedSignalKUrl?r.default.getComputedSignalKUrl():e.signalkUrl||"http://localhost:3000",{enabled:!1!==e.ocearoCoreEnabled,baseUrl:t,timeout:6e4,useAuthentication:e.useAuthentication||!1,username:e.username||"",password:e.password||""}},o=async(t,r={})=>{let o=n();if(!o.enabled)throw Error("OcearoCore is not enabled");let i=new AbortController,{timeout:a,...s}=r,u=setTimeout(()=>i.abort(),a||o.timeout);try{let r=`${o.baseUrl}/plugins/ocearo-core${t}`,n={"Content-Type":"application/json",...s.headers};if(o.useAuthentication&&o.username)try{let t="function"==typeof btoa?btoa(`${o.username}:${o.password||""}`):e.Buffer.from(`${o.username}:${o.password||""}`).toString("base64");n.Authorization=`Basic ${t}`}catch(t){}let a=await fetch(r,{signal:i.signal,headers:n,credentials:"include",...s});if(clearTimeout(u),!a.ok){let t=a.headers.get("content-type")||"";if(404===a.status||t.includes("text/html")){let t=Error(`OcearoCore plugin not available at ${r}`);throw t.name="NetworkError",t}let e=await a.text().catch(()=>a.statusText);throw Error(`OcearoCore API error (${a.status}): ${e}`)}return await a.json()}catch(t){if(clearTimeout(u),"AbortError"===t.name){let t=Error("OcearoCore API request timed out");throw t.name="TimeoutError",t}if("TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))){let t=Error(`OcearoCore server unreachable at ${o.baseUrl}`);throw t.name="NetworkError",t}throw t}},i=async()=>{try{return await o("/status")}catch(t){return console.warn("Failed to get OcearoCore status:",t),{error:t.message,available:!1}}},a=async(t,e={})=>{let r=["weather","sail","alerts","ais","status","logbook","route","racing","briefing"];if(!r.includes(t))throw Error(`Invalid analysis type. Valid types: ${r.join(", ")}`);return await o("/analyze",{method:"POST",timeout:12e4,body:JSON.stringify({type:t,...e})})},s=async t=>{let e=["sailing","anchored","motoring","moored","racing"];if(!e.includes(t))throw Error(`Invalid mode. Valid modes: ${e.join(", ")}`);return await o("/mode",{method:"POST",body:JSON.stringify({mode:t})})},u=async()=>await o("/dnd"),f=async(t,e)=>{let r=["off","safety","all"];if(!r.includes(t))throw Error(`Invalid DND mode. Valid modes: ${r.join(", ")}`);let n={mode:t};return"number"==typeof e&&e>0&&(n.durationMinutes=e),await o("/dnd",{method:"POST",body:JSON.stringify(n)})},l=async(t=[])=>await o("/logbook/analyze",{method:"POST",body:JSON.stringify({entries:t})}),h=async t=>{if(!t||"object"!=typeof t)throw Error("Current data is required and must be an object");return await o("/logbook/entry",{method:"POST",body:JSON.stringify({currentData:t})})},c=async(t,e=null)=>{if(!t||"object"!=typeof t)throw Error("Fuel data is required and must be an object");try{let r={datetime:new Date().toISOString(),type:"fuel_refill",position:e||{latitude:null,longitude:null},fuel:{liters:t.liters,cost:t.cost,additive:t.additive||!1,engineHoursAtRefill:t.engineHours,previousEngineHours:t.previousEngineHours||null,hoursSinceLastRefill:t.hoursSinceLastRefill||null},liters:t.liters,author:"fuel_log",text:`Fuel refill: ${t.liters}L - ${t.cost}€${t.additive?" (with additive)":""} - Engine hours: ${t.engineHours}h`};return await o("/logbook/fuel",{method:"POST",body:JSON.stringify(r)})}catch(n){let r={datetime:new Date().toISOString(),type:"fuel_refill",position:e||{latitude:null,longitude:null},fuel:{liters:t.liters,cost:t.cost,additive:t.additive||!1,engineHoursAtRefill:t.engineHours,previousEngineHours:t.previousEngineHours||null,hoursSinceLastRefill:t.hoursSinceLastRefill||null},author:"fuel_log",text:`Fuel refill: ${t.liters}L - ${t.cost}€${t.additive?" (with additive)":""} - Engine hours: ${t.engineHours}h`};return await w(r)}},g=async()=>{try{let t=await o("/logbook/fuel");if(Array.isArray(t)&&t.length>=0)return t}catch(t){}return(await b()).filter(t=>"fuel_refill"===t.type||"fuel_log"===t.author)},p=(t,e=null)=>{if(!t||0===t.length)return{averageConsumption:null,totalLiters:0,totalCost:0,refillCount:0,estimatedTankLevel:null,lastRefill:null};let r=[...t].sort((t,e)=>new Date(t.datetime)-new Date(e.datetime)),n=0,o=0,i=0,a=[];for(let t=0;t<r.length;t++){let e=r[t].fuel||{};if(n+=e.liters||0,o+=e.cost||0,e.hoursSinceLastRefill&&e.hoursSinceLastRefill>0){let t=e.liters||0,r=e.hoursSinceLastRefill;t>0&&r>0&&(a.push(t/r),i+=r)}}let s=a.length>0?a.reduce((t,e)=>t+e,0)/a.length:null,u=a.length>0?Math.max(...a):null,f=r[r.length-1],l=f?.fuel||{};return{averageConsumption:s?Math.round(10*s)/10:null,worstConsumption:u?Math.round(10*u)/10:null,totalLiters:Math.round(10*n)/10,totalCost:Math.round(100*o)/100,refillCount:r.length,totalHours:Math.round(10*i)/10,lastRefill:f?{date:new Date(f.datetime),liters:l.liters,engineHours:l.engineHoursAtRefill}:null}},d=async t=>{let e=Number.isFinite(t)&&t>0?`?limit=${t}`:"";return await o(`/navigation/anchor/track${e}`)},y=async()=>await o("/bathymetry/status"),m=async(t,e,r)=>await o("/bathymetry/download",{method:"POST",body:JSON.stringify({lat:t,lon:e,radiusNm:r})}),b=async(t,e)=>{let r=new URLSearchParams;t&&r.append("startDate",t),e&&r.append("endDate",e);let n=r.toString(),i=`/logbook/all-entries${n?`?${n}`:""}`;return await o(i)},w=async t=>{if(!t||"object"!=typeof t)throw Error("Entry data is required and must be an object");return await o("/logbook/add-entry",{method:"POST",body:JSON.stringify(t)})};t.s(["addFuelLogEntry",0,c,"addLogbookEntry",0,w,"analyzeLogbookWithOcearoCore",0,l,"bathymetryTileTemplate",0,()=>{let t=n();return t.enabled?`${t.baseUrl}/plugins/ocearo-core/bathymetry/tiles/{z}/{x}/{y}.png`:null},"calculateFuelStats",0,p,"downloadBathymetry",0,m,"estimateTankLevel",0,(t,e,r,n=null)=>{let o=p(t,r);if(!o.lastRefill||!o.averageConsumption||!e)return{estimatedLiters:null,estimatedPercent:null,hoursRemaining:null,basedOnSensor:null!==n,sensorLevel:null!==n?Math.round(100*n):null};let i=e-o.lastRefill.engineHours,a=o.worstConsumption||o.averageConsumption,s=i*o.averageConsumption,u=t=>{let e;if(r)e=r-t;else{if(!o.lastRefill.liters)return null;e=o.lastRefill.liters-t}return Math.max(0,e)},f=u(s),l=u(i*a),h=t=>null!==t&&r?Math.round(Math.max(0,Math.min(100,t/r*100))):null,c=null!==f&&o.averageConsumption>0?Math.max(0,f/o.averageConsumption):null,g=null!==l&&a>0?Math.max(0,l/a):null;return{estimatedLiters:null!==f?Math.round(10*f)/10:null,estimatedLitersWorst:null!==l?Math.round(10*l)/10:null,estimatedPercent:h(f),estimatedPercentWorst:h(l),hoursRemaining:null!==c?Math.round(10*c)/10:null,hoursRemainingWorst:null!==g?Math.round(10*g)/10:null,hoursSinceLastRefill:Math.round(10*i)/10,estimatedUsed:Math.round(10*s)/10,basedOnSensor:null!==n,sensorLevel:null!==n?Math.round(100*n):null}},"fetchFuelLogEntries",0,g,"fetchLogbookEntries",0,b,"generateOcearoCoreLogbookEntry",0,h,"getAnchorTrack",0,d,"getBathymetryStatus",0,y,"getOcearoCoreDnd",0,u,"getOcearoCoreStatus",0,i,"handleOcearoCoreError",0,(t,e="OcearoCore operation")=>"NetworkError"===t.name?(console.warn(`${e} failed: OcearoCore server unreachable.`,t.message),"OcearoCore server unreachable. Please check if the service is running."):"TimeoutError"===t.name||t.message.includes("timed out")?(console.warn(`${e} failed: OcearoCore request timed out.`),"OcearoCore service is not responding (timeout)"):(console.warn(`${e} failed:`,t.message),t.message.includes("not enabled"))?"OcearoCore is not enabled in the configuration":t.message.includes("Logbook write failed")||t.message.includes("Logbook manager not initialized")?"Logbook service error. Please check the ocearo-core plugin status.":t.message.includes("503")?"Service temporarily unavailable. Please try again later.":t.message.includes("404")?"Feature not found or not installed":t.message.includes("500")?"Internal server error. Check server logs for details.":t.message||"Unknown error occurred","isOcearoCoreEnabled",0,()=>n().enabled,"makeOcearoCoreApiCall",0,o,"requestAnalysis",0,a,"setOcearoCoreDnd",0,f,"updateOcearoCoreMode",0,s])},67034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],s=i[1],f=new o((a+s)*3/4-s),l=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(function(t,e,n){for(var o,i=[],a=e;a<n;a+=3)o=(t[a]<<16&0xff0000)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(r[o>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,a,a+16383>s?s:a+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),o=r(321),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,o=e;if(("string"!=typeof o||""===o)&&(o="utf8"),!s.isEncoding(o))throw TypeError("Unknown encoding: "+o);var i=0|g(n,o),u=a(i),f=u.write(n,o);return f!==i&&(u=u.slice(0,f)),u}if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(L(t,SharedArrayBuffer)||t&&L(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),s.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var l=t.valueOf&&t.valueOf();if(null!=l&&l!==t)return s.from(l,e,r);var p=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(f(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)};function c(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function g(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(o)return n?-1:B(t).length;e=(""+e).toLowerCase(),o=!0}}function p(t,e,r){var o,i,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=x[t[i]];return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return o=this,i=e,a=r,0===i&&a===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(s)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(o)return -1;else r=t.length-1;else if(r<0)if(!o)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,o)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;i<s;i++)if(f(t,i)===f(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else -1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var h=!0,c=0;c<u;c++)if(f(t,i+c)!==f(e,c)){h=!1;break}if(h)return i}return -1}s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(L(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),L(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(L(i,Uint8Array)&&(i=s.from(i)),!s.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},s.byteLength=g,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(L(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=r-e,u=Math.min(i,a),f=this.slice(n,o),l=t.slice(e,r),h=0;h<u;++h)if(f[h]!==l[h]){i=f[h],a=l[h];break}return i<a?-1:+(a<i)},s.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,u,f=t[o],l=null,h=f>239?4:f>223?3:f>191?2:1;if(o+h<=r)switch(h){case 1:f<128&&(l=f);break;case 2:(192&(i=t[o+1]))==128&&(u=(31&f)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],a=t[o+2],(192&i)==128&&(192&a)==128&&(u=(15&f)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],(192&i)==128&&(192&a)==128&&(192&s)==128&&(u=(15&f)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=h}var c=n,g=c.length;if(g<=4096)return String.fromCharCode.apply(String,c);for(var p="",d=0;d<g;)p+=String.fromCharCode.apply(String,c.slice(d,d+=4096));return p}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function v(t,e,r,n,o,i){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function E(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function C(t,e,r,n,i){return e*=1,r>>>=0,i||E(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function S(t,e,r,n,i){return e*=1,r>>>=0,i||E(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,a,s,u,f,l,h,c=this.length-e;if((void 0===r||r>c)&&(r=c),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var g=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s,u=parseInt(e.substr(2*a,2),16);if((s=u)!=s)break;t[r+a]=u}return a}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,T(B(t,this.length-o),this,o,i);case"ascii":return a=e,s=r,T(O(t),this,a,s);case"latin1":case"binary":return function(t,e,r,n){return T(O(e),t,r,n)}(this,t,e,r);case"base64":return u=e,f=r,T(U(t),this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,h=r,T(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-l),this,l,h);default:if(g)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),g=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;v(this,t,e,r,o,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);v(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return S(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return S(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;i>=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:s.from(t,n),u=a.length;if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var A=/[^+/0-9A-Za-z-_]/g;function B(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319||a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function O(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function U(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(A,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var x=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},321:function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,f=u>>1,l=-7,h=r?o-1:0,c=r?-1:1,g=t[e+h];for(h+=c,i=g&(1<<-l)-1,g>>=-l,l+=s;l>0;i=256*i+t[e+h],h+=c,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=c,l-=8);if(0===i)i=1-f;else{if(i===u)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,n),i-=f}return(g?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,f=8*i-o-1,l=(1<<f)-1,h=l>>1,c=5960464477539062e-23*(23===o),g=n?0:i-1,p=n?1:-1,d=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?e+=c/u:e+=c*Math.pow(2,1-h),e*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,o),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),a=0));o>=8;t[r+g]=255&s,g+=p,s/=256,o-=8);for(a=a<<o|s,f+=o;f>0;t[r+g]=255&a,g+=p,a/=256,f-=8);t[r+g-p]|=128*d}}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}},a=!0;try{n[t](r,r.exports,i),a=!1}finally{a&&delete o[t]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=i(230)},79866,(t,e,r)=>{e.exports={boats:[{name:"Racer 10.8",modelPath:"racer",capabilities:["navigation","sail","color"]},{name:"Catamaran 14",modelPath:"catamaran",capabilities:["navigation","sail","color"]},{name:"Sailboat",modelPath:"default",capabilities:["navigation","rudder","sail","color"]},{name:"Ship",modelPath:"ship",capabilities:["navigation","ais"]},{name:"Windsurf",modelPath:"windsurf",capabilities:["navigation","ais"]},{name:"Wing foil",modelPath:"wingfoil",capabilities:["navigation","ais"]}]}},83402,t=>{"use strict";var e=t.i(79866);let r=new class{constructor(){this.defaultConfig={signalkUrl:"http://localhost:3000",username:"",password:"",useAuthentication:!1,signalKUrlSet:!1,debugMode:!1,selectedBoat:"Racer 10.8",primaryColor:null,metallicEffect:!1,aisLengthScalingFactor:.7,compassNorthUp:!1,hide3DCompass:!1,hideTrueWind:!1,showCustomUrls:!1,customExternalUrls:{},currentView:"default",theme:"dark",language:"en",distanceUnits:"nm",depthUnits:"m",speedUnits:"kn",temperatureUnits:"C",positionFormat:"DD",preferTrueValues:!0,preferredWindSpeedPath:"speedTrue",preferredWindDirectionPath:"directionTrue",preferredHeadingPath:"courseOverGroundTrue",debugWindOverride:!1,debugWindSpeed:10,debugWindDirection:0,debugShowAxes:!1,showSailTrimSliders:!0,showRigging:!0,showSeamarks3D:!0,seamarksOverpass:!0,staleDataTimeout:30},this.configKey="ocearoConfig",this.inMemoryConfig={...this.defaultConfig},this.config=this.loadConfig()}isLocalStorageAvailable(){try{return"u">typeof localStorage}catch{return!1}}loadConfig(){if(this.isLocalStorageAvailable()){let t=localStorage.getItem(this.configKey);if(!t)return this.saveConfig(this.defaultConfig),{...this.defaultConfig};try{let e={...this.defaultConfig,...JSON.parse(t)};return(e.boatChosen||"Default"!==e.selectedBoat)&&"RM1080"!==e.selectedBoat&&"Optimist"!==e.selectedBoat||(e.selectedBoat="Racer 10.8"),"Default"===e.selectedBoat&&(e.selectedBoat="Sailboat"),e}catch(t){return console.error("Failed to parse stored configuration:",t),{...this.defaultConfig}}}return{...this.inMemoryConfig}}saveConfig(t){this.config={...this.config,...t},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.config}}get(t){return this.config[t]}set(t,e){this.config[t]=e,this.saveConfig(this.config)}resetConfig(){this.config={...this.defaultConfig},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.defaultConfig}}getAll(){return{...this.config}}getDefaultConfig(){return{...this.defaultConfig}}getSelectedBoat(){let t=this.config.selectedBoat;return t?this.getBoatsData().find(e=>e.name===t):null}getBoatsData(){return e.default.boats}getSignalKUrl(){return this.config.signalKUrlSet&&this.config.signalkUrl?this.normalizeSignalKUrl(this.config.signalkUrl):this.getComputedSignalKUrl()}normalizeSignalKUrl(t){let e=String(t).trim().replace(/\/+$/,"");if(!e)return e;e=e.replace(/^wss:\/\//i,"https://").replace(/^ws:\/\//i,"http://");let r="https:"===window.location.protocol;return/^https?:\/\//i.test(e)||(e=`${r?"https":"http"}://${e}`),e=e.replace(/^https?:/i,t=>t.toLowerCase()),r&&e.startsWith("http://")&&(e="https://"+e.slice(7).replace(/:80(?=\/|$)/,"")),e}getComputedSignalKUrl(){return this.config.debugMode?"https://demo.signalk.org:443":`${window.location.protocol}//${window.location.hostname}${window.location.port?":"+window.location.port:""}`}getCurrentView(){return this.config.currentView||this.defaultConfig.currentView}setCurrentView(t){this.set("currentView",t)}};t.s(["default",0,r])}]);