@10play/expo-air 0.7.1 → 0.7.2
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.
package/ios/widget.jsbundle
CHANGED
|
@@ -13,7 +13,7 @@ var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow()
|
|
|
13
13
|
* SPDX-License-Identifier: MIT
|
|
14
14
|
*/
|
|
15
15
|
function r(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function t(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function o(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e){var r=i(e,"string");return"symbol"==typeof r?r:r+""}function i(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,r||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}!(function(){"use strict";function t(){}function n(e){return"object"==typeof e&&null!==e||"function"==typeof e}var i=t;function a(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch(e){}}var l=Promise,s=Promise.resolve.bind(l),u=Promise.prototype.then,d=Promise.reject.bind(l),c=s;function f(e){return new l(e)}function h(e){return f(r=>r(e))}function b(e){return d(e)}function v(e,r,t){return u.call(e,r,t)}function _(e,r,t){v(v(e,r,t),void 0,i)}function p(e,r){_(e,r)}function m(e,r){_(e,void 0,r)}function y(e,r,t){return v(e,r,t)}function g(e){v(e,void 0,i)}var w=e=>{if("function"==typeof queueMicrotask)w=queueMicrotask;else{var r=h(void 0);w=e=>v(r,e)}return w(e)};function S(e,r,t){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function T(e,r,t){try{return h(S(e,r,t))}catch(e){return b(e)}}var R=o(function e(){r(this,e),this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0},[{key:"length",get:function(){return this._size}},{key:"push",value:function(e){var r=this._back,t=r;16383===r._elements.length&&(t={_elements:[],_next:void 0}),r._elements.push(e),t!==r&&(this._back=t,r._next=t),++this._size}},{key:"shift",value:function(){var e=this._front,r=e,t=this._cursor,o=t+1,n=e._elements,i=n[t];return 16384===o&&(r=e._next,o=0),--this._size,this._cursor=o,e!==r&&(this._front=r),n[t]=void 0,i}},{key:"forEach",value:function(e){for(var r=this._cursor,t=this._front,o=t._elements;!(r===o.length&&void 0===t._next||r===o.length&&(t=t._next,o=t._elements,r=0,0===o.length));)e(o[r]),++r}},{key:"peek",value:function(){var e=this._front,r=this._cursor;return e._elements[r]}}]),P=Symbol("[[AbortSteps]]"),k=Symbol("[[ErrorSteps]]"),q=Symbol("[[CancelSteps]]"),C=Symbol("[[PullSteps]]"),E=Symbol("[[ReleaseSteps]]");function j(e,r){e._ownerReadableStream=r,r._reader=e,"readable"===r._state?z(e):"closed"===r._state?(function(e){z(e),I(e)})(e):B(e,r._storedError)}function O(e,r){return $t(e._ownerReadableStream,r)}function W(e){var r=e._ownerReadableStream;"readable"===r._state?F(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):(function(e){B(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"))})(e),r._readableStreamController[E](),r._reader=void 0,e._ownerReadableStream=void 0}function A(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function z(e){e._closedPromise=f((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t})}function B(e,r){z(e),F(e,r)}function F(e,r){void 0!==e._closedPromise_reject&&(g(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function I(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var L=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},$=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function M(e,r){if(void 0!==e&&"object"!=typeof(t=e)&&"function"!=typeof t)throw new TypeError(`${r} is not an object.`);var t}function D(e,r){if("function"!=typeof e)throw new TypeError(`${r} is not a function.`)}function x(e,r){if(!(function(e){return"object"==typeof e&&null!==e||"function"==typeof e})(e))throw new TypeError(`${r} is not an object.`)}function N(e,r,t){if(void 0===e)throw new TypeError(`Parameter ${r} is required in '${t}'.`)}function Q(e,r,t){if(void 0===e)throw new TypeError(`${r} is required in '${t}'.`)}function Y(e){return Number(e)}function H(e){return 0===e?0:e}function V(e,r){var t=Number.MAX_SAFE_INTEGER,o=Number(e);if(o=H(o),!L(o))throw new TypeError(`${r} is not a finite number`);if(o=(function(e){return H($(e))})(o),o<0||o>t)throw new TypeError(`${r} is outside the accepted range of 0 to ${t}, inclusive`);return L(o)&&0!==o?o:0}function U(e,r){if(!It(e))throw new TypeError(`${r} is not a ReadableStream.`)}function G(e){return new oe(e)}function X(e,r){e._reader._readRequests.push(r)}function J(e,r,t){var o=e._reader._readRequests.shift();t?o._closeSteps():o._chunkSteps(r)}function K(e){return e._reader._readRequests.length}function Z(e){var r=e._reader;return void 0!==r&&!!ne(r)}var ee,re,te,oe=o(function e(t){if(r(this,e),N(t,1,"ReadableStreamDefaultReader"),U(t,"First parameter"),Lt(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");j(this,t),this._readRequests=new R},[{key:"closed",get:function(){return ne(this)?this._closedPromise:b(le("closed"))}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return ne(this)?void 0===this._ownerReadableStream?b(A("cancel")):O(this,e):b(le("cancel"))}},{key:"read",value:function(){if(!ne(this))return b(le("read"));if(void 0===this._ownerReadableStream)return b(A("read from"));var e,r,t=f((t,o)=>{e=t,r=o});return ie(this,{_chunkSteps:r=>e({value:r,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>r(e)}),t}},{key:"releaseLock",value:function(){if(!ne(this))throw le("releaseLock");void 0!==this._ownerReadableStream&&(function(e){W(e),ae(e,new TypeError("Reader was released"))})(this)}}]);function ne(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof oe}function ie(e,r){var t=e._ownerReadableStream;t._disturbed=!0,"closed"===t._state?r._closeSteps():"errored"===t._state?r._errorSteps(t._storedError):t._readableStreamController[C](r)}function ae(e,r){var t=e._readRequests;e._readRequests=new R,t.forEach(e=>{e._errorSteps(r)})}function le(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}function se(e){return e.slice()}function ue(e,r,t,o,n){new Uint8Array(e).set(new Uint8Array(t,o,n),r)}Object.defineProperties(oe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),a(oe.prototype.cancel,"cancel"),a(oe.prototype.read,"read"),a(oe.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(oe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var de=e=>(de="function"==typeof e.transfer?e=>e.transfer():"function"==typeof structuredClone?e=>structuredClone(e,{transfer:[e]}):e=>e,de(e)),ce=e=>(ce="boolean"==typeof e.detached?e=>e.detached:e=>0===e.byteLength,ce(e));function fe(e,r,t){if(e.slice)return e.slice(r,t);var o=t-r,n=new ArrayBuffer(o);return ue(n,0,e,r,o),n}function he(e,r){var t=e[r];if(null!=t){if("function"!=typeof t)throw new TypeError(`${String(r)} is not a function`);return t}}function be(e){try{var r=e.done,t=e.value;return v(c(t),e=>({done:r,value:e}))}catch(e){return b(e)}}var ve=null!==(te=null!==(ee=Symbol.asyncIterator)&&void 0!==ee?ee:null===(re=Symbol.for)||void 0===re?void 0:re.call(Symbol,"Symbol.asyncIterator"))&&void 0!==te?te:"@@asyncIterator";function _e(e){var r=arguments.length>2?arguments[2]:void 0;if(void 0===r)if("async"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sync")){if(void 0===(r=he(e,ve)))return(function(e){var r={next(){var r;try{r=pe(e)}catch(e){return b(e)}return be(r)},return(r){var t;try{var o=he(e.iterator,"return");if(void 0===o)return h({done:!0,value:r});t=S(o,e.iterator,[r])}catch(e){return b(e)}return n(t)?be(t):b(new TypeError("The iterator.return() method must return an object"))}};return{iterator:r,nextMethod:r.next,done:!1}})(_e(e,"sync",he(e,Symbol.iterator)))}else r=he(e,Symbol.iterator);if(void 0===r)throw new TypeError("The object is not iterable");var t=S(r,e,[]);if(!n(t))throw new TypeError("The iterator method must return an object");return{iterator:t,nextMethod:t.next,done:!1}}function pe(e){var r=S(e.nextMethod,e.iterator,[]);if(!n(r))throw new TypeError("The iterator.next() method must return an object");return r}var me=o(function e(t,o){r(this,e),this._ongoingPromise=void 0,this._isFinished=!1,this._reader=t,this._preventCancel=o},[{key:"next",value:function(){var e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?y(this._ongoingPromise,e,e):e(),this._ongoingPromise}},{key:"return",value:function(e){var r=()=>this._returnSteps(e);return this._ongoingPromise=this._ongoingPromise?y(this._ongoingPromise,r,r):r(),this._ongoingPromise}},{key:"_nextSteps",value:function(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var e,r,t=this._reader,o=f((t,o)=>{e=t,r=o});return ie(t,{_chunkSteps:r=>{this._ongoingPromise=void 0,w(()=>e({value:r,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,W(t),e({value:void 0,done:!0})},_errorSteps:e=>{this._ongoingPromise=void 0,this._isFinished=!0,W(t),r(e)}}),o}},{key:"_returnSteps",value:function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var r=this._reader;if(!this._preventCancel){var t=O(r,e);return W(r),y(t,()=>({value:e,done:!0}))}return W(r),h({value:e,done:!0})}}]),ye={next(){return ge(this)?this._asyncIteratorImpl.next():b(we("next"))},return(e){return ge(this)?this._asyncIteratorImpl.return(e):b(we("return"))},[ve](){return this}};function ge(e){if(!n(e))return!1;if(!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof me}catch(e){return!1}}function we(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(ye,ve,{enumerable:!1});var Se=Number.isNaN||function(e){return e!=e};function Te(e){var r=fe(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Re(e){var r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function Pe(e,r,t){if("number"!=typeof(o=t)||Se(o)||o<0||t===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var o;e._queue.push({value:r,size:t}),e._queueTotalSize+=t}function ke(e){e._queue=new R,e._queueTotalSize=0}function qe(e){return e===DataView}var Ce=o(function e(){throw r(this,e),new TypeError("Illegal constructor")},[{key:"view",get:function(){if(!Oe(this))throw or("view");return this._view}},{key:"respond",value:function(e){if(!Oe(this))throw or("respond");if(N(e,1,"respond"),e=V(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(ce(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");er(this._associatedReadableByteStreamController,e)}},{key:"respondWithNewView",value:function(e){if(!Oe(this))throw or("respondWithNewView");if(N(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(ce(e.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");rr(this._associatedReadableByteStreamController,e)}}]);Object.defineProperties(Ce.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),a(Ce.prototype.respond,"respond"),a(Ce.prototype.respondWithNewView,"respondWithNewView"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ce.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Ee=o(function e(){throw r(this,e),new TypeError("Illegal constructor")},[{key:"byobRequest",get:function(){if(!je(this))throw nr("byobRequest");return Ke(this)}},{key:"desiredSize",get:function(){if(!je(this))throw nr("desiredSize");return Ze(this)}},{key:"close",value:function(){if(!je(this))throw nr("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Ue(this)}},{key:"enqueue",value:function(e){if(!je(this))throw nr("enqueue");if(N(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var r=this._controlledReadableByteStream._state;if("readable"!==r)throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);Ge(this,e)}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!je(this))throw nr("error");Xe(this,e)}},{key:q,value:function(e){Ae(this),ke(this);var r=this._cancelAlgorithm(e);return Ve(this),r}},{key:C,value:function(e){var r=this._controlledReadableByteStream;if(this._queueTotalSize>0)Je(this,e);else{var t=this._autoAllocateChunkSize;if(void 0!==t){var o;try{o=new ArrayBuffer(t)}catch(r){return void e._errorSteps(r)}var n={buffer:o,bufferByteLength:t,byteOffset:0,byteLength:t,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}X(r,e),We(this)}}},{key:E,value:function(){if(this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new R,this._pendingPullIntos.push(e)}}}]);function je(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Ee}function Oe(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof Ce}function We(e){var r=(function(e){var r=e._controlledReadableByteStream;return"readable"===r._state&&(!e._closeRequested&&(!!e._started&&(!!(Z(r)&&K(r)>0)||(!!(ur(r)&&sr(r)>0)||Ze(e)>0))))})(e);r&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,_(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,We(e)),null),r=>(Xe(e,r),null))))}function Ae(e){Ne(e),e._pendingPullIntos=new R}function ze(e,r){var t=!1;"closed"===e._state&&(t=!0);var o=Fe(r);"default"===r.readerType?J(e,o,t):(function(e,r,t){var o=e._reader._readIntoRequests.shift();t?o._closeSteps(r):o._chunkSteps(r)})(e,o,t)}function Be(e,r){for(var t=0;t<r.length;++t)ze(e,r[t])}function Fe(e){var r=e.bytesFilled,t=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/t)}function Ie(e,r,t,o){e._queue.push({buffer:r,byteOffset:t,byteLength:o}),e._queueTotalSize+=o}function Le(e,r,t,o){var n;try{n=fe(r,t,t+o)}catch(r){throw Xe(e,r),r}Ie(e,n,0,o)}function $e(e,r){r.bytesFilled>0&&Le(e,r.buffer,r.byteOffset,r.bytesFilled),He(e)}function Me(e,r){var t=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),o=r.bytesFilled+t,n=t,i=!1,a=o-o%r.elementSize;a>=r.minimumFill&&(n=a-r.bytesFilled,i=!0);for(var l=e._queue;n>0;){var s=l.peek(),u=Math.min(n,s.byteLength),d=r.byteOffset+r.bytesFilled;ue(r.buffer,d,s.buffer,s.byteOffset,u),s.byteLength===u?l.shift():(s.byteOffset+=u,s.byteLength-=u),e._queueTotalSize-=u,De(e,u,r),n-=u}return i}function De(e,r,t){t.bytesFilled+=r}function xe(e){0===e._queueTotalSize&&e._closeRequested?(Ve(e),Mt(e._controlledReadableByteStream)):We(e)}function Ne(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Qe(e){for(var r=[];e._pendingPullIntos.length>0&&0!==e._queueTotalSize;){var t=e._pendingPullIntos.peek();Me(e,t)&&(He(e),r.push(t))}return r}function Ye(e,r){var t=e._pendingPullIntos.peek();Ne(e),"closed"===e._controlledReadableByteStream._state?(function(e,r){"none"===r.readerType&&He(e);var t=e._controlledReadableByteStream;if(ur(t)){for(var o=[],n=0;n<sr(t);++n)o.push(He(e));Be(t,o)}})(e,t):(function(e,r,t){if(De(0,r,t),"none"!==t.readerType){if(!(t.bytesFilled<t.minimumFill)){He(e);var o=t.bytesFilled%t.elementSize;if(o>0){var n=t.byteOffset+t.bytesFilled;Le(e,t.buffer,n-o,o)}t.bytesFilled-=o;var i=Qe(e);ze(e._controlledReadableByteStream,t),Be(e._controlledReadableByteStream,i)}}else{$e(e,t);var a=Qe(e);Be(e._controlledReadableByteStream,a)}})(e,r,t),We(e)}function He(e){return e._pendingPullIntos.shift()}function Ve(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ue(e){var r=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===r._state)if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){var t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!=0){var o=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Xe(e,o),o}}Ve(e),Mt(r)}}function Ge(e,r){var t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state){var o=r.buffer,n=r.byteOffset,i=r.byteLength;if(ce(o))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");var a=de(o);if(e._pendingPullIntos.length>0){var l=e._pendingPullIntos.peek();if(ce(l.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Ne(e),l.buffer=de(l.buffer),"none"===l.readerType&&$e(e,l)}if(Z(t))(function(e){for(var r=e._controlledReadableByteStream._reader;r._readRequests.length>0;){if(0===e._queueTotalSize)return;Je(e,r._readRequests.shift())}})(e),0===K(t)?Ie(e,a,n,i):(e._pendingPullIntos.length>0&&He(e),J(t,new Uint8Array(a,n,i),!1));else if(ur(t)){Ie(e,a,n,i);var s=Qe(e);Be(e._controlledReadableByteStream,s)}else Ie(e,a,n,i);We(e)}}function Xe(e,r){var t=e._controlledReadableByteStream;"readable"===t._state&&(Ae(e),ke(e),Ve(e),Dt(t,r))}function Je(e,r){var t=e._queue.shift();e._queueTotalSize-=t.byteLength,xe(e);var o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);r._chunkSteps(o)}function Ke(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){var r=e._pendingPullIntos.peek(),t=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),o=Object.create(Ce.prototype);!(function(e,r,t){e._associatedReadableByteStreamController=r,e._view=t})(o,e,t),e._byobRequest=o}return e._byobRequest}function Ze(e){var r=e._controlledReadableByteStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function er(e,r){var t=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==r)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===r)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range")}t.buffer=de(t.buffer),Ye(e,r)}function rr(e,r){var t=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==r.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===r.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(t.bytesFilled+r.byteLength>t.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var o=r.byteLength;t.buffer=de(r.buffer),Ye(e,o)}function tr(e,r,t,o,n,i,a){r._controlledReadableByteStream=e,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,ke(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=i,r._pullAlgorithm=o,r._cancelAlgorithm=n,r._autoAllocateChunkSize=a,r._pendingPullIntos=new R,e._readableStreamController=r,_(h(t()),()=>(r._started=!0,We(r),null),e=>(Xe(r,e),null))}function or(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function nr(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function ir(e,r){if("byob"!=(e=`${e}`))throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function ar(e){return new dr(e)}function lr(e,r){e._reader._readIntoRequests.push(r)}function sr(e){return e._reader._readIntoRequests.length}function ur(e){var r=e._reader;return void 0!==r&&!!cr(r)}Object.defineProperties(Ee.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),a(Ee.prototype.close,"close"),a(Ee.prototype.enqueue,"enqueue"),a(Ee.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ee.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var dr=o(function e(t){if(r(this,e),N(t,1,"ReadableStreamBYOBReader"),U(t,"First parameter"),Lt(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!je(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");j(this,t),this._readIntoRequests=new R},[{key:"closed",get:function(){return cr(this)?this._closedPromise:b(br("closed"))}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return cr(this)?void 0===this._ownerReadableStream?b(A("cancel")):O(this,e):b(br("cancel"))}},{key:"read",value:function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!cr(this))return b(br("read"));if(!ArrayBuffer.isView(e))return b(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return b(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return b(new TypeError("view's buffer must have non-zero byteLength"));if(ce(e.buffer))return b(new TypeError("view's buffer has been detached"));try{r=(function(e,r){var t;return M(e,r),{min:V(null!==(t=null==e?void 0:e.min)&&void 0!==t?t:1,`${r} has member 'min' that`)}})(t,"options")}catch(e){return b(e)}var o,n,i=r.min;if(0===i)return b(new TypeError("options.min must be greater than 0"));if((function(e){return qe(e.constructor)})(e)){if(i>e.byteLength)return b(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(i>e.length)return b(new RangeError("options.min must be less than or equal to view's length"));if(void 0===this._ownerReadableStream)return b(A("read from"));var a=f((e,r)=>{o=e,n=r});return fr(this,e,i,{_chunkSteps:e=>o({value:e,done:!1}),_closeSteps:e=>o({value:e,done:!0}),_errorSteps:e=>n(e)}),a}},{key:"releaseLock",value:function(){if(!cr(this))throw br("releaseLock");void 0!==this._ownerReadableStream&&(function(e){W(e),hr(e,new TypeError("Reader was released"))})(this)}}]);function cr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof dr}function fr(e,r,t,o){var n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?o._errorSteps(n._storedError):(function(e,r,t,o){var n,i=e._controlledReadableByteStream,a=r.constructor,l=(function(e){return qe(e)?1:e.BYTES_PER_ELEMENT})(a),s=r.byteOffset,u=r.byteLength,d=t*l;try{n=de(r.buffer)}catch(e){return void o._errorSteps(e)}var c={buffer:n,bufferByteLength:n.byteLength,byteOffset:s,byteLength:u,bytesFilled:0,minimumFill:d,elementSize:l,viewConstructor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(c),void lr(i,o);if("closed"!==i._state){if(e._queueTotalSize>0){if(Me(e,c)){var f=Fe(c);return xe(e),void o._chunkSteps(f)}if(e._closeRequested){var h=new TypeError("Insufficient bytes to fill elements in the given buffer");return Xe(e,h),void o._errorSteps(h)}}e._pendingPullIntos.push(c),lr(i,o),We(e)}else{var b=new a(c.buffer,c.byteOffset,0);o._closeSteps(b)}})(n._readableStreamController,r,t,o)}function hr(e,r){var t=e._readIntoRequests;e._readIntoRequests=new R,t.forEach(e=>{e._errorSteps(r)})}function br(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function vr(e,r){var t=e.highWaterMark;if(void 0===t)return r;if(Se(t)||t<0)throw new RangeError("Invalid highWaterMark");return t}function _r(e){return e.size||(()=>1)}function pr(e,r){M(e,r);var t=null==e?void 0:e.highWaterMark,o=null==e?void 0:e.size;return{highWaterMark:void 0===t?void 0:Y(t),size:void 0===o?void 0:mr(o,`${r} has member 'size' that`)}}function mr(e,r){return D(e,r),r=>Y(e(r))}function yr(e,r,t){return D(e,t),t=>T(e,r,[t])}function gr(e,r,t){return D(e,t),()=>T(e,r,[])}function wr(e,r,t){return D(e,t),t=>S(e,r,[t])}function Sr(e,r,t){return D(e,t),(t,o)=>T(e,r,[t,o])}function Tr(e,r){if(!qr(e))throw new TypeError(`${r} is not a WritableStream.`)}Object.defineProperties(dr.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),a(dr.prototype.cancel,"cancel"),a(dr.prototype.read,"read"),a(dr.prototype.releaseLock,"releaseLock"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(dr.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var Rr=o(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),void 0===t?t=null:x(t,"First parameter");var n=pr(o,"Second parameter"),i=(function(e,r){M(e,r);var t=null==e?void 0:e.abort,o=null==e?void 0:e.close,n=null==e?void 0:e.start,i=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===t?void 0:yr(t,e,`${r} has member 'abort' that`),close:void 0===o?void 0:gr(o,e,`${r} has member 'close' that`),start:void 0===n?void 0:wr(n,e,`${r} has member 'start' that`),write:void 0===a?void 0:Sr(a,e,`${r} has member 'write' that`),type:i}})(t,"First parameter");if(kr(this),void 0!==i.type)throw new RangeError("Invalid type is specified");var a=_r(n);!(function(e,r,t,o){var n,i,a,l,s=Object.create(Qr.prototype);n=void 0!==r.start?()=>r.start(s):()=>{},i=void 0!==r.write?e=>r.write(e,s):()=>h(void 0),a=void 0!==r.close?()=>r.close():()=>h(void 0),l=void 0!==r.abort?e=>r.abort(e):()=>h(void 0),Hr(e,s,n,i,a,l,t,o)})(this,i,vr(n,1),a)},[{key:"locked",get:function(){if(!qr(this))throw Zr("locked");return Cr(this)}},{key:"abort",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return qr(this)?Cr(this)?b(new TypeError("Cannot abort a stream that already has a writer")):Er(this,e):b(Zr("abort"))}},{key:"close",value:function(){return qr(this)?Cr(this)?b(new TypeError("Cannot close a stream that already has a writer")):zr(this)?b(new TypeError("Cannot close an already-closing stream")):jr(this):b(Zr("close"))}},{key:"getWriter",value:function(){if(!qr(this))throw Zr("getWriter");return Pr(this)}}]);function Pr(e){return new Ir(e)}function kr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new R,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function qr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Rr}function Cr(e){return void 0!==e._writer}function Er(e,r){var t;if("closed"===e._state||"errored"===e._state)return h(void 0);e._writableStreamController._abortReason=r,null===(t=e._writableStreamController._abortController)||void 0===t||t.abort(r);var o=e._state;if("closed"===o||"errored"===o)return h(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===o&&(n=!0,r=void 0);var i=f((t,o)=>{e._pendingAbortRequest={_promise:void 0,_resolve:t,_reject:o,_reason:r,_wasAlreadyErroring:n}});return e._pendingAbortRequest._promise=i,n||Wr(e,r),i}function jr(e){var r=e._state;if("closed"===r||"errored"===r)return b(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));var t,o=f((r,t)=>{var o={_resolve:r,_reject:t};e._closeRequest=o}),n=e._writer;return void 0!==n&&e._backpressure&&"writable"===r&&ct(n),Pe(t=e._writableStreamController,Nr,0),Gr(t),o}function Or(e,r){"writable"!==e._state?Ar(e):Wr(e,r)}function Wr(e,r){var t=e._writableStreamController;e._state="erroring",e._storedError=r;var o=e._writer;void 0!==o&&Mr(o,r),!(function(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest})(e)&&t._started&&Ar(e)}function Ar(e){e._state="errored",e._writableStreamController[k]();var r=e._storedError;if(e._writeRequests.forEach(e=>{e._reject(r)}),e._writeRequests=new R,void 0!==e._pendingAbortRequest){var t=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,t._wasAlreadyErroring)return t._reject(r),void Br(e);_(e._writableStreamController[P](t._reason),()=>(t._resolve(),Br(e),null),r=>(t._reject(r),Br(e),null))}else Br(e)}function zr(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Br(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var r=e._writer;void 0!==r&&it(r,e._storedError)}function Fr(e,r){var t=e._writer;void 0!==t&&r!==e._backpressure&&(r?(function(e){lt(e)})(t):ct(t)),e._backpressure=r}Object.defineProperties(Rr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),a(Rr.prototype.abort,"abort"),a(Rr.prototype.close,"close"),a(Rr.prototype.getWriter,"getWriter"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Rr.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});var Ir=o(function e(t){if(r(this,e),N(t,1,"WritableStreamDefaultWriter"),Tr(t,"First parameter"),Cr(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;var o=t._state;if("writable"===o)!zr(t)&&t._backpressure?lt(this):ut(this),ot(this);else if("erroring"===o)st(this,t._storedError),ot(this);else if("closed"===o)ut(this),ot(this),at(this);else{var n=t._storedError;st(this,n),nt(this,n)}},[{key:"closed",get:function(){return Lr(this)?this._closedPromise:b(rt("closed"))}},{key:"desiredSize",get:function(){if(!Lr(this))throw rt("desiredSize");if(void 0===this._ownerWritableStream)throw tt("desiredSize");return(function(e){var r=e._ownerWritableStream,t=r._state;return"errored"===t||"erroring"===t?null:"closed"===t?0:Ur(r._writableStreamController)})(this)}},{key:"ready",get:function(){return Lr(this)?this._readyPromise:b(rt("ready"))}},{key:"abort",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return Lr(this)?void 0===this._ownerWritableStream?b(tt("abort")):(function(e,r){return Er(e._ownerWritableStream,r)})(this,e):b(rt("abort"))}},{key:"close",value:function(){if(!Lr(this))return b(rt("close"));var e=this._ownerWritableStream;return void 0===e?b(tt("close")):zr(e)?b(new TypeError("Cannot close an already-closing stream")):$r(this)}},{key:"releaseLock",value:function(){if(!Lr(this))throw rt("releaseLock");void 0!==this._ownerWritableStream&&Dr(this)}},{key:"write",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return Lr(this)?void 0===this._ownerWritableStream?b(tt("write to")):xr(this,e):b(rt("write"))}}]);function Lr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Ir}function $r(e){return jr(e._ownerWritableStream)}function Mr(e,r){"pending"===e._readyPromiseState?dt(e,r):(function(e,r){st(e,r)})(e,r)}function Dr(e){var r=e._ownerWritableStream,t=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Mr(e,t),(function(e,r){"pending"===e._closedPromiseState?it(e,r):(function(e,r){nt(e,r)})(e,r)})(e,t),r._writer=void 0,e._ownerWritableStream=void 0}function xr(e,r){var t=e._ownerWritableStream,o=t._writableStreamController,n=(function(e,r){if(void 0===e._strategySizeAlgorithm)return 1;try{return e._strategySizeAlgorithm(r)}catch(r){return Xr(e,r),1}})(o,r);if(t!==e._ownerWritableStream)return b(tt("write to"));var i=t._state;if("errored"===i)return b(t._storedError);if(zr(t)||"closed"===i)return b(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return b(t._storedError);var a=(function(e){return f((r,t)=>{var o={_resolve:r,_reject:t};e._writeRequests.push(o)})})(t);return(function(e,r,t){try{Pe(e,r,t)}catch(r){return void Xr(e,r)}var o=e._controlledWritableStream;zr(o)||"writable"!==o._state||Fr(o,Jr(e)),Gr(e)})(o,r,n),a}Object.defineProperties(Ir.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),a(Ir.prototype.abort,"abort"),a(Ir.prototype.close,"close"),a(Ir.prototype.releaseLock,"releaseLock"),a(Ir.prototype.write,"write"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Ir.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Nr={},Qr=o(function e(){throw r(this,e),new TypeError("Illegal constructor")},[{key:"abortReason",get:function(){if(!Yr(this))throw et("abortReason");return this._abortReason}},{key:"signal",get:function(){if(!Yr(this))throw et("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!Yr(this))throw et("error");"writable"===this._controlledWritableStream._state&&Kr(this,e)}},{key:P,value:function(e){var r=this._abortAlgorithm(e);return Vr(this),r}},{key:k,value:function(){ke(this)}}]);function Yr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Qr}function Hr(e,r,t,o,n,i,a,l){r._controlledWritableStream=e,e._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,ke(r),r._abortReason=void 0,r._abortController=(function(){if("function"==typeof AbortController)return new AbortController})(),r._started=!1,r._strategySizeAlgorithm=l,r._strategyHWM=a,r._writeAlgorithm=o,r._closeAlgorithm=n,r._abortAlgorithm=i;var s=Jr(r);Fr(e,s),_(h(t()),()=>(r._started=!0,Gr(r),null),t=>(r._started=!0,Or(e,t),null))}function Vr(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ur(e){return e._strategyHWM-e._queueTotalSize}function Gr(e){var r=e._controlledWritableStream;if(e._started&&void 0===r._inFlightWriteRequest)if("erroring"!==r._state){if(0!==e._queue.length){var t=e._queue.peek().value;t===Nr?(function(e){var r=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(r),Re(e);var t=e._closeAlgorithm();Vr(e),_(t,()=>((function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var r=e._writer;void 0!==r&&at(r)})(r),null),e=>((function(e,r){e._inFlightCloseRequest._reject(r),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(r),e._pendingAbortRequest=void 0),Or(e,r)})(r,e),null))})(e):(function(e,r){var t=e._controlledWritableStream;!(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(t),_(e._writeAlgorithm(r),()=>{!(function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0})(t);var r=t._state;if(Re(e),!zr(t)&&"writable"===r){var o=Jr(e);Fr(t,o)}return Gr(e),null},r=>("writable"===t._state&&Vr(e),(function(e,r){e._inFlightWriteRequest._reject(r),e._inFlightWriteRequest=void 0,Or(e,r)})(t,r),null))})(e,t)}}else Ar(r)}function Xr(e,r){"writable"===e._controlledWritableStream._state&&Kr(e,r)}function Jr(e){return Ur(e)<=0}function Kr(e,r){var t=e._controlledWritableStream;Vr(e),Wr(t,r)}function Zr(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function et(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function rt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function tt(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function ot(e){e._closedPromise=f((r,t)=>{e._closedPromise_resolve=r,e._closedPromise_reject=t,e._closedPromiseState="pending"})}function nt(e,r){ot(e),it(e,r)}function it(e,r){void 0!==e._closedPromise_reject&&(g(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function at(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function lt(e){e._readyPromise=f((r,t)=>{e._readyPromise_resolve=r,e._readyPromise_reject=t}),e._readyPromiseState="pending"}function st(e,r){lt(e),dt(e,r)}function ut(e){lt(e),ct(e)}function dt(e,r){void 0!==e._readyPromise_reject&&(g(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function ct(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Qr.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Qr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:void 0!==e?e:void 0,ht=(function(){var e=null==ft?void 0:ft.DOMException;return(function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;if("DOMException"!==e.name)return!1;try{return new e,!0}catch(e){return!1}})(e)?e:void 0})()||(function(){var e=function(e,r){this.message=e||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return a(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e})();function bt(e,r,o,n,i,a){var l=G(e),s=Pr(r);e._disturbed=!0;var u=!1,d=h(void 0);return f((c,y)=>{var w,S,T,R;if(void 0!==a){if(w=()=>{var t=void 0!==a.reason?a.reason:new ht("Aborted","AbortError"),o=[];n||o.push(()=>"writable"===r._state?Er(r,t):h(void 0)),i||o.push(()=>"readable"===e._state?$t(e,t):h(void 0)),C(()=>Promise.all(o.map(e=>e())),!0,t)},a.aborted)return void w();a.addEventListener("abort",w)}if(q(e,l._closedPromise,e=>(n?E(!0,e):C(()=>Er(r,e),!0,e),null)),q(r,s._closedPromise,r=>(i?E(!0,r):C(()=>$t(e,r),!0,r),null)),S=e,T=l._closedPromise,R=()=>(o?E():C(()=>(function(e){var r=e._ownerWritableStream,t=r._state;return zr(r)||"closed"===t?h(void 0):"errored"===t?b(r._storedError):$r(e)})(s)),null),"closed"===S._state?R():p(T,R),zr(r)||"closed"===r._state){var P=new TypeError("the destination writable stream closed before all data could be piped to it");i?E(!0,P):C(()=>$t(e,P),!0,P)}function k(){var e=d;return v(d,()=>e!==d?k():void 0)}function q(e,r,t){"errored"===e._state?t(e._storedError):m(r,t)}function C(e,t,o){function n(){return _(e(),()=>j(t,o),e=>j(!0,e)),null}u||(u=!0,"writable"!==r._state||zr(r)?n():p(k(),n))}function E(e,t){u||(u=!0,"writable"!==r._state||zr(r)?j(e,t):p(k(),()=>j(e,t)))}function j(e,r){return Dr(s),W(l),void 0!==a&&a.removeEventListener("abort",w),e?y(r):c(void 0),null}g(f((e,r)=>{!(function o(n){n?e():v(u?h(!0):v(s._readyPromise,()=>f((e,r)=>{ie(l,{_chunkSteps:r=>{d=v(xr(s,r),void 0,t),e(!1)},_closeSteps:()=>e(!0),_errorSteps:r})})),o,r)})(!1)}))})}var vt=o(function e(){throw r(this,e),new TypeError("Illegal constructor")},[{key:"desiredSize",get:function(){if(!_t(this))throw kt("desiredSize");return Tt(this)}},{key:"close",value:function(){if(!_t(this))throw kt("close");if(!Rt(this))throw new TypeError("The stream is not in a state that permits close");gt(this)}},{key:"enqueue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!_t(this))throw kt("enqueue");if(!Rt(this))throw new TypeError("The stream is not in a state that permits enqueue");return wt(this,e)}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!_t(this))throw kt("error");St(this,e)}},{key:q,value:function(e){ke(this);var r=this._cancelAlgorithm(e);return yt(this),r}},{key:C,value:function(e){var r=this._controlledReadableStream;if(this._queue.length>0){var t=Re(this);this._closeRequested&&0===this._queue.length?(yt(this),Mt(r)):pt(this),e._chunkSteps(t)}else X(r,e),pt(this)}},{key:E,value:function(){}}]);function _t(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof vt}function pt(e){mt(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,_(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,pt(e)),null),r=>(St(e,r),null))))}function mt(e){var r=e._controlledReadableStream;return!!Rt(e)&&!!e._started&&(!!(Lt(r)&&K(r)>0)||Tt(e)>0)}function yt(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function gt(e){if(Rt(e)){var r=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(yt(e),Mt(r))}}function wt(e,r){if(Rt(e)){var t=e._controlledReadableStream;if(Lt(t)&&K(t)>0)J(t,r,!1);else{var o;try{o=e._strategySizeAlgorithm(r)}catch(r){throw St(e,r),r}try{Pe(e,r,o)}catch(r){throw St(e,r),r}}pt(e)}}function St(e,r){var t=e._controlledReadableStream;"readable"===t._state&&(ke(e),yt(e),Dt(t,r))}function Tt(e){var r=e._controlledReadableStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function Rt(e){var r=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===r}function Pt(e,r,t,o,n,i,a){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,ke(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=a,r._strategyHWM=i,r._pullAlgorithm=o,r._cancelAlgorithm=n,e._readableStreamController=r,_(h(t()),()=>(r._started=!0,pt(r),null),e=>(St(r,e),null))}function kt(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function qt(e){return n(r=e)&&void 0!==r.getReader?(function(e){var r;return r=zt(t,function(){var t;try{t=e.read()}catch(t){return b(t)}return y(t,e=>{if(!n(e))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(e.done)gt(r._readableStreamController);else{var t=e.value;wt(r._readableStreamController,t)}})},function(r){try{return h(e.cancel(r))}catch(r){return b(r)}},0),r})(e.getReader()):(function(e){var r,o=_e(e,"async");return r=zt(t,function(){var e;try{e=pe(o)}catch(e){return b(e)}return y(h(e),e=>{if(!n(e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(e.done)gt(r._readableStreamController);else{var t=e.value;wt(r._readableStreamController,t)}})},function(e){var r,t=o.iterator;try{r=he(t,"return")}catch(e){return b(e)}return void 0===r?h(void 0):y(T(r,t,[e]),e=>{if(!n(e))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})},0),r})(e);var r}function Ct(e,r,t){return D(e,t),t=>T(e,r,[t])}function Et(e,r,t){return D(e,t),t=>T(e,r,[t])}function jt(e,r,t){return D(e,t),t=>S(e,r,[t])}function Ot(e,r){if("bytes"!=(e=`${e}`))throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Wt(e,r){M(e,r);var t=null==e?void 0:e.preventAbort,o=null==e?void 0:e.preventCancel,n=null==e?void 0:e.preventClose,i=null==e?void 0:e.signal;return void 0!==i&&(function(e,r){if(!(function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}})(e))throw new TypeError(`${r} is not an AbortSignal.`)})(i,`${r} has member 'signal' that`),{preventAbort:Boolean(t),preventCancel:Boolean(o),preventClose:Boolean(n),signal:i}}Object.defineProperties(vt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),a(vt.prototype.close,"close"),a(vt.prototype.enqueue,"enqueue"),a(vt.prototype.error,"error"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(vt.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var At=o(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),void 0===t?t=null:x(t,"First parameter");var n=pr(o,"Second parameter"),i=(function(e,r){M(e,r);var t=e,o=null==t?void 0:t.autoAllocateChunkSize,n=null==t?void 0:t.cancel,i=null==t?void 0:t.pull,a=null==t?void 0:t.start,l=null==t?void 0:t.type;return{autoAllocateChunkSize:void 0===o?void 0:V(o,`${r} has member 'autoAllocateChunkSize' that`),cancel:void 0===n?void 0:Ct(n,t,`${r} has member 'cancel' that`),pull:void 0===i?void 0:Et(i,t,`${r} has member 'pull' that`),start:void 0===a?void 0:jt(a,t,`${r} has member 'start' that`),type:void 0===l?void 0:Ot(l,`${r} has member 'type' that`)}})(t,"First parameter");if(Ft(this),"bytes"===i.type){if(void 0!==n.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!(function(e,r,t){var o,n,i,a=Object.create(Ee.prototype);o=void 0!==r.start?()=>r.start(a):()=>{},n=void 0!==r.pull?()=>r.pull(a):()=>h(void 0),i=void 0!==r.cancel?e=>r.cancel(e):()=>h(void 0);var l=r.autoAllocateChunkSize;if(0===l)throw new TypeError("autoAllocateChunkSize must be greater than 0");tr(e,a,o,n,i,t,l)})(this,i,vr(n,0))}else{var a=_r(n);!(function(e,r,t,o){var n,i,a,l=Object.create(vt.prototype);n=void 0!==r.start?()=>r.start(l):()=>{},i=void 0!==r.pull?()=>r.pull(l):()=>h(void 0),a=void 0!==r.cancel?e=>r.cancel(e):()=>h(void 0),Pt(e,l,n,i,a,t,o)})(this,i,vr(n,1),a)}},[{key:"locked",get:function(){if(!It(this))throw xt("locked");return Lt(this)}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return It(this)?Lt(this)?b(new TypeError("Cannot cancel a stream that already has a reader")):$t(this,e):b(xt("cancel"))}},{key:"getReader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!It(this))throw xt("getReader");return void 0===(function(e,r){M(e,r);var t=null==e?void 0:e.mode;return{mode:void 0===t?void 0:ir(t,`${r} has member 'mode' that`)}})(e,"First parameter").mode?G(this):ar(this)}},{key:"pipeThrough",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!It(this))throw xt("pipeThrough");N(e,1,"pipeThrough");var t=(function(e,r){M(e,r);var t=null==e?void 0:e.readable;Q(t,"readable","ReadableWritablePair"),U(t,`${r} has member 'readable' that`);var o=null==e?void 0:e.writable;return Q(o,"writable","ReadableWritablePair"),Tr(o,`${r} has member 'writable' that`),{readable:t,writable:o}})(e,"First parameter"),o=Wt(r,"Second parameter");if(Lt(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Cr(t.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return g(bt(this,t.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal)),t.readable}},{key:"pipeTo",value:function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!It(this))return b(xt("pipeTo"));if(void 0===e)return b("Parameter 1 is required in 'pipeTo'.");if(!qr(e))return b(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));try{r=Wt(t,"Second parameter")}catch(e){return b(e)}return Lt(this)?b(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Cr(e)?b(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):bt(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}},{key:"tee",value:function(){if(!It(this))throw xt("tee");return se((function(e){return je(e._readableStreamController)?(function(e){var r,t,o,n,i,a=G(e),l=!1,s=!1,u=!1,d=!1,c=!1,b=f(e=>{i=e});function v(e){m(e._closedPromise,r=>(e!==a||(Xe(o._readableStreamController,r),Xe(n._readableStreamController,r),d&&c||i(void 0)),null))}function _(){cr(a)&&(W(a),v(a=G(e))),ie(a,{_chunkSteps:r=>{w(()=>{s=!1,u=!1;var t=r,a=r;if(!d&&!c)try{a=Te(r)}catch(r){return Xe(o._readableStreamController,r),Xe(n._readableStreamController,r),void i($t(e,r))}d||Ge(o._readableStreamController,t),c||Ge(n._readableStreamController,a),l=!1,s?y():u&&g()})},_closeSteps:()=>{l=!1,d||Ue(o._readableStreamController),c||Ue(n._readableStreamController),o._readableStreamController._pendingPullIntos.length>0&&er(o._readableStreamController,0),n._readableStreamController._pendingPullIntos.length>0&&er(n._readableStreamController,0),d&&c||i(void 0)},_errorSteps:()=>{l=!1}})}function p(r,t){ne(a)&&(W(a),v(a=ar(e)));var f=t?n:o,h=t?o:n;fr(a,r,1,{_chunkSteps:r=>{w(()=>{s=!1,u=!1;var o=t?c:d;if(t?d:c)o||rr(f._readableStreamController,r);else{var n;try{n=Te(r)}catch(r){return Xe(f._readableStreamController,r),Xe(h._readableStreamController,r),void i($t(e,r))}o||rr(f._readableStreamController,r),Ge(h._readableStreamController,n)}l=!1,s?y():u&&g()})},_closeSteps:e=>{l=!1;var r=t?c:d,o=t?d:c;r||Ue(f._readableStreamController),o||Ue(h._readableStreamController),void 0!==e&&(r||rr(f._readableStreamController,e),!o&&h._readableStreamController._pendingPullIntos.length>0&&er(h._readableStreamController,0)),r&&o||i(void 0)},_errorSteps:()=>{l=!1}})}function y(){if(l)return s=!0,h(void 0);l=!0;var e=Ke(o._readableStreamController);return null===e?_():p(e._view,!1),h(void 0)}function g(){if(l)return u=!0,h(void 0);l=!0;var e=Ke(n._readableStreamController);return null===e?_():p(e._view,!0),h(void 0)}function S(){}return o=Bt(S,y,function(o){if(d=!0,r=o,c){var n=se([r,t]),a=$t(e,n);i(a)}return b}),n=Bt(S,g,function(o){if(c=!0,t=o,d){var n=se([r,t]),a=$t(e,n);i(a)}return b}),v(a),[o,n]})(e):(function(e){var r,t,o,n,i,a=G(e),l=!1,s=!1,u=!1,d=!1,c=f(e=>{i=e});function b(){return l?(s=!0,h(void 0)):(l=!0,ie(a,{_chunkSteps:e=>{w(()=>{s=!1;var r=e,t=e;u||wt(o._readableStreamController,r),d||wt(n._readableStreamController,t),l=!1,s&&b()})},_closeSteps:()=>{l=!1,u||gt(o._readableStreamController),d||gt(n._readableStreamController),u&&d||i(void 0)},_errorSteps:()=>{l=!1}}),h(void 0))}function v(){}return o=zt(v,b,function(o){if(u=!0,r=o,d){var n=se([r,t]),a=$t(e,n);i(a)}return c}),n=zt(v,b,function(o){if(d=!0,t=o,u){var n=se([r,t]),a=$t(e,n);i(a)}return c}),m(a._closedPromise,e=>(St(o._readableStreamController,e),St(n._readableStreamController,e),u&&d||i(void 0),null)),[o,n]})(e)})(this))}},{key:"values",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!It(this))throw xt("values");return(function(e,r){var t=G(e),o=new me(t,r),n=Object.create(ye);return n._asyncIteratorImpl=o,n})(this,(function(e){M(e,"First parameter");var r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}})(e).preventCancel)}},{key:ve,value:function(e){return this.values(e)}}],[{key:"from",value:function(e){return qt(e)}}]);function zt(e,r,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>1,i=Object.create(At.prototype);return Ft(i),Pt(i,Object.create(vt.prototype),e,r,t,o,n),i}function Bt(e,r,t){var o=Object.create(At.prototype);return Ft(o),tr(o,Object.create(Ee.prototype),e,r,t,0,void 0),o}function Ft(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function It(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof At}function Lt(e){return void 0!==e._reader}function $t(e,r){if(e._disturbed=!0,"closed"===e._state)return h(void 0);if("errored"===e._state)return b(e._storedError);Mt(e);var o=e._reader;if(void 0!==o&&cr(o)){var n=o._readIntoRequests;o._readIntoRequests=new R,n.forEach(e=>{e._closeSteps(void 0)})}return y(e._readableStreamController[q](r),t)}function Mt(e){e._state="closed";var r=e._reader;if(void 0!==r&&(I(r),ne(r))){var t=r._readRequests;r._readRequests=new R,t.forEach(e=>{e._closeSteps()})}}function Dt(e,r){e._state="errored",e._storedError=r;var t=e._reader;void 0!==t&&(F(t,r),ne(t)?ae(t,r):hr(t,r))}function xt(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Nt(e,r){M(e,r);var t=null==e?void 0:e.highWaterMark;return Q(t,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Y(t)}}Object.defineProperties(At,{from:{enumerable:!0}}),Object.defineProperties(At.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),a(At.from,"from"),a(At.prototype.cancel,"cancel"),a(At.prototype.getReader,"getReader"),a(At.prototype.pipeThrough,"pipeThrough"),a(At.prototype.pipeTo,"pipeTo"),a(At.prototype.tee,"tee"),a(At.prototype.values,"values"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(At.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(At.prototype,ve,{value:At.prototype.values,writable:!0,configurable:!0});var Qt=e=>e.byteLength;a(Qt,"size");var Yt=o(function e(t){r(this,e),N(t,1,"ByteLengthQueuingStrategy"),t=Nt(t,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=t.highWaterMark},[{key:"highWaterMark",get:function(){if(!Vt(this))throw Ht("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}},{key:"size",get:function(){if(!Vt(this))throw Ht("size");return Qt}}]);function Ht(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Vt(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Yt}Object.defineProperties(Yt.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Yt.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var Ut=()=>1;a(Ut,"size");var Gt=o(function e(t){r(this,e),N(t,1,"CountQueuingStrategy"),t=Nt(t,"First parameter"),this._countQueuingStrategyHighWaterMark=t.highWaterMark},[{key:"highWaterMark",get:function(){if(!Jt(this))throw Xt("highWaterMark");return this._countQueuingStrategyHighWaterMark}},{key:"size",get:function(){if(!Jt(this))throw Xt("size");return Ut}}]);function Xt(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Jt(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Gt}function Kt(e,r,t){return D(e,t),t=>T(e,r,[t])}function Zt(e,r,t){return D(e,t),t=>S(e,r,[t])}function eo(e,r,t){return D(e,t),(t,o)=>T(e,r,[t,o])}function ro(e,r,t){return D(e,t),t=>T(e,r,[t])}Object.defineProperties(Gt.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(Gt.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var to=o(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),void 0===t&&(t=null);var i=pr(o,"Second parameter"),a=pr(n,"Third parameter"),l=(function(e,r){M(e,r);var t=null==e?void 0:e.cancel,o=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,a=null==e?void 0:e.transform,l=null==e?void 0:e.writableType;return{cancel:void 0===t?void 0:ro(t,e,`${r} has member 'cancel' that`),flush:void 0===o?void 0:Kt(o,e,`${r} has member 'flush' that`),readableType:n,start:void 0===i?void 0:Zt(i,e,`${r} has member 'start' that`),transform:void 0===a?void 0:eo(a,e,`${r} has member 'transform' that`),writableType:l}})(t,"First parameter");if(void 0!==l.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==l.writableType)throw new RangeError("Invalid writableType specified");var s,u=vr(a,0),d=_r(a),c=vr(i,1),v=_r(i);!(function(e,r,t,o,n,i){function a(){return r}e._writable=(function(e,r,t,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>1,a=Object.create(Rr.prototype);return kr(a),Hr(a,Object.create(Qr.prototype),e,r,t,o,n,i),a})(a,function(r){return(function(e,r){var t=e._transformStreamController;return e._backpressure?y(e._backpressureChangePromise,()=>{var o=e._writable;if("erroring"===o._state)throw o._storedError;return ho(t,r)}):ho(t,r)})(e,r)},function(){return(function(e){var r=e._transformStreamController;if(void 0!==r._finishPromise)return r._finishPromise;var t=e._readable;r._finishPromise=f((e,t)=>{r._finishPromise_resolve=e,r._finishPromise_reject=t});var o=r._flushAlgorithm();return co(r),_(o,()=>("errored"===t._state?_o(r,t._storedError):(gt(t._readableStreamController),vo(r)),null),e=>(St(t._readableStreamController,e),_o(r,e),null)),r._finishPromise})(e)},function(r){return(function(e,r){var t=e._transformStreamController;if(void 0!==t._finishPromise)return t._finishPromise;var o=e._readable;t._finishPromise=f((e,r)=>{t._finishPromise_resolve=e,t._finishPromise_reject=r});var n=t._cancelAlgorithm(r);return co(t),_(n,()=>("errored"===o._state?_o(t,o._storedError):(St(o._readableStreamController,r),vo(t)),null),e=>(St(o._readableStreamController,e),_o(t,e),null)),t._finishPromise})(e,r)},t,o),e._readable=zt(a,function(){return(function(e){return lo(e,!1),e._backpressureChangePromise})(e)},function(r){return(function(e,r){var t=e._transformStreamController;if(void 0!==t._finishPromise)return t._finishPromise;var o=e._writable;t._finishPromise=f((e,r)=>{t._finishPromise_resolve=e,t._finishPromise_reject=r});var n=t._cancelAlgorithm(r);return co(t),_(n,()=>("errored"===o._state?_o(t,o._storedError):(Xr(o._writableStreamController,r),ao(e),vo(t)),null),r=>(Xr(o._writableStreamController,r),ao(e),_o(t,r),null)),t._finishPromise})(e,r)},n,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,lo(e,!0),e._transformStreamController=void 0})(this,f(e=>{s=e}),c,v,u,d),(function(e,r){var t,o,n,i=Object.create(so.prototype);t=void 0!==r.transform?e=>r.transform(e,i):e=>{try{return fo(i,e),h(void 0)}catch(e){return b(e)}},o=void 0!==r.flush?()=>r.flush(i):()=>h(void 0),n=void 0!==r.cancel?e=>r.cancel(e):()=>h(void 0),(function(e,r,t,o,n){r._controlledTransformStream=e,e._transformStreamController=r,r._transformAlgorithm=t,r._flushAlgorithm=o,r._cancelAlgorithm=n,r._finishPromise=void 0,r._finishPromise_resolve=void 0,r._finishPromise_reject=void 0})(e,i,t,o,n)})(this,l),void 0!==l.start?s(l.start(this._transformStreamController)):s(void 0)},[{key:"readable",get:function(){if(!oo(this))throw po("readable");return this._readable}},{key:"writable",get:function(){if(!oo(this))throw po("writable");return this._writable}}]);function oo(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof to}function no(e,r){St(e._readable._readableStreamController,r),io(e,r)}function io(e,r){co(e._transformStreamController),Xr(e._writable._writableStreamController,r),ao(e)}function ao(e){e._backpressure&&lo(e,!1)}function lo(e,r){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=f(r=>{e._backpressureChangePromise_resolve=r}),e._backpressure=r}Object.defineProperties(to.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(to.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});var so=o(function e(){throw r(this,e),new TypeError("Illegal constructor")},[{key:"desiredSize",get:function(){if(!uo(this))throw bo("desiredSize");return Tt(this._controlledTransformStream._readable._readableStreamController)}},{key:"enqueue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!uo(this))throw bo("enqueue");fo(this,e)}},{key:"error",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!uo(this))throw bo("error");e=r,no(this._controlledTransformStream,e)}},{key:"terminate",value:function(){if(!uo(this))throw bo("terminate");!(function(e){var r=e._controlledTransformStream;gt(r._readable._readableStreamController),io(r,new TypeError("TransformStream terminated"))})(this)}}]);function uo(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof so}function co(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function fo(e,r){var t=e._controlledTransformStream,o=t._readable._readableStreamController;if(!Rt(o))throw new TypeError("Readable side is not in a state that permits enqueue");try{wt(o,r)}catch(e){throw io(t,e),t._readable._storedError}var n=(function(e){return!mt(e)})(o);n!==t._backpressure&&lo(t,!0)}function ho(e,r){return y(e._transformAlgorithm(r),void 0,r=>{throw no(e._controlledTransformStream,r),r})}function bo(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function vo(e){void 0!==e._finishPromise_resolve&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function _o(e,r){void 0!==e._finishPromise_reject&&(g(e._finishPromise),e._finishPromise_reject(r),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function po(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(so.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),a(so.prototype.enqueue,"enqueue"),a(so.prototype.error,"error"),a(so.prototype.terminate,"terminate"),"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(so.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var mo={ReadableStream:At,ReadableStreamDefaultController:vt,ReadableByteStreamController:Ee,ReadableStreamBYOBRequest:Ce,ReadableStreamDefaultReader:oe,ReadableStreamBYOBReader:dr,WritableStream:Rr,WritableStreamDefaultController:Qr,WritableStreamDefaultWriter:Ir,ByteLengthQueuingStrategy:Yt,CountQueuingStrategy:Gt,TransformStream:to,TransformStreamDefaultController:so};for(var yo in mo)Object.prototype.hasOwnProperty.call(mo,yo)&&Object.defineProperty(ft,yo,{value:mo[yo],writable:!0,configurable:!0})})()})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
|
|
16
|
-
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]);var
|
|
16
|
+
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]);var o=r(d[1]),t=r(d[2]);o.LogBox.ignoreAllLogs(!0),o.AppRegistry.registerComponent('ExpoAirBubble',()=>t.BubbleContent)},0,[1,258,485]);
|
|
17
17
|
__d(function(g,r,i,a,m,e,d){'use strict';var t=Date.now();r(d[0]).default();var n=r(d[1]).default;n.markPoint('initializeCore_start',n.currentTimestamp()-(Date.now()-t)),n.markPoint('initializeCore_end')},1,[2,196]);
|
|
18
18
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=!1;function n(){t||(t=!0,r(d[0]),r(d[1]).default(),r(d[2]),r(d[3]),r(d[4]),r(d[5]),r(d[6]),r(d[7]),r(d[8]),r(d[9]),r(d[10]),r(d[11]),r(d[12]))}},2,[3,4,154,168,173,181,182,185,223,228,229,233,236]);
|
|
19
19
|
__d(function(g,r,i,a,m,e,d){'use strict';void 0===g.window&&(g.window=g),void 0===g.self&&(g.self=g),g.process=g.process||{},g.process.env=g.process.env||{},g.process.env.NODE_ENV||(g.process.env.NODE_ENV='production')},3,[]);
|
|
@@ -534,12 +534,12 @@ __d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{v
|
|
|
534
534
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=(r(d[1]).default,!1),o=0;function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(u=!0,0===e[0]&&(n.default.vibrate(400),e=e.slice(1)),0!==e.length?setTimeout(()=>l(++o,e,t,1),e[0]):u=!1)}function l(e,t,f,v){if(u&&e===o){if(n.default.vibrate(400),v>=t.length){if(!f)return void(u=!1);v=0}setTimeout(()=>l(e,t,f,v+1),t[v])}}var v={vibrate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!u)if('number'==typeof e)n.default.vibrate(e);else{if(!Array.isArray(e))throw new Error('Vibration pattern should be a number or array');f(e,t)}},cancel:function(){u=!1}},c=v},482,[483,60]);
|
|
535
535
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=((t=e)&&t.__esModule?t:{default:t}).default},483,[484]);
|
|
536
536
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).getEnforcing('Vibration')},484,[50]);
|
|
537
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size,e.color;var T=e.expanded,C=void 0!==T&&T,O=e.serverUrl,f=void 0===O?"ws://localhost:3847":O,R=(0,s.useState)("disconnected"),x=(0,n.default)(R,2),y=x[0],I=x[1],P=(0,s.useState)([]),D=(0,n.default)(P,2),N=D[0],k=D[1],w=(0,s.useState)([]),B=(0,n.default)(w,2),j=B[0],L=B[1],U=(0,s.useState)("main"),G=(0,n.default)(U,2),V=G[0],M=G[1],Y=(0,s.useState)([]),W=(0,n.default)(Y,2),H=W[0],Z=W[1],q=(0,s.useState)(!1),z=(0,n.default)(q,2),X=z[0],F=z[1],K=(0,s.useState)(),J=(0,n.default)(K,2),Q=J[0],$=J[1],ee=(0,s.useState)("chat"),te=(0,n.default)(ee,2),ne=te[0],ae=te[1],re=(0,s.useState)(!1),se=(0,n.default)(re,2),oe=se[0],ie=se[1],ce=(0,s.useState)([]),le=(0,n.default)(ce,2),ue=le[0],de=le[1],he=(0,s.useState)(null),Se=(0,n.default)(he,2),pe=Se[0],me=Se[1],Te=(0,s.useRef)(!1),be=(0,s.useRef)(0),ge=(0,s.useRef)([]),Ce=(0,s.useRef)(null),Oe=(0,s.useRef)(null);(0,s.useEffect)(()=>{C&&"chat"===ne&&setTimeout(()=>Oe.current?.focus(),100)},[C]);var fe=Q?.match(/\/pull\/(\d+)/)?.[1];(0,s.useEffect)(()=>{console.log("[expo-air] Connecting to:",f);var e=(0,h.createWebSocketClient)({url:f,onStatusChange:I,onMessage:xe,onError:e=>{console.error("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[f]),(0,s.useEffect)(()=>(0,S.setupTapHandler)((e,t)=>{var n=(0,h.getWebSocketClient)();n&&!n.isConnected()&&n.connect()}),[]);var Re=(0,s.useCallback)((e,t)=>{var n=ge.current;if(n.length>0){var s={type:"assistant_parts",promptId:e,parts:n,isComplete:t,timestamp:Date.now()};k(e=>[...e,s])}ge.current=[],Ce.current=null,L([])},[]),xe=(0,s.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==Ce.current&&(ge.current.length>0&&Ce.current&&Re(Ce.current,!1),Ce.current=e.promptId),!e.done&&e.chunk){var t=ge.current,n=t[t.length-1];"text"===n?.type?(n.content+=e.chunk,ge.current=[...t]):ge.current=[...t,{type:"text",id:"text-"+be.current++,content:e.chunk}],L([...ge.current])}break;case"tool":if("started"!==e.status){var s={type:"tool",id:"tool-"+be.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};ge.current=[...ge.current,s],L([...ge.current])}break;case"result":if(ge.current.length>0){var o={type:"assistant_parts",promptId:e.promptId,parts:ge.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};k(e=>[...e,o,c])}else k(e=>[...e,o])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"error":if(ge.current.length>0&&Ce.current){var l={type:"assistant_parts",promptId:Ce.current,parts:ge.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,l,e])}else k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"status":break;case"session_cleared":k([]),ge.current=[],Ce.current=null,be.current=0,L([]);break;case"stopped":ge.current.length>0&&Ce.current?Re(Ce.current,!1):(ge.current=[],Ce.current=null,L([]));break;case"history":var u=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);k(u);break;case"git_status":M(e.branchName),Z(e.changes),F(e.hasPR),$(e.prUrl);break;case"branches_list":de(e.branches);break;case"branch_switched":case"branch_created":e.success?(ie(!1),me(null)):e.error&&me(e.error)}},[Re]),Ae=(0,s.useCallback)((function(){var e=(0,t.default)(function*(e){if(!Te.current){var t=yield(0,S.requestPushToken)();if(t){var n=(0,h.getWebSocketClient)();n?.isConnected()&&(n.sendPushToken(t),Te.current=!0)}}k(t=>[...t,{type:"user_prompt",content:e,timestamp:Date.now()}]),ge.current=[],Ce.current=null,L([]);var s=(0,h.getWebSocketClient)();s&&s.sendPrompt(e)});return function(t){return e.apply(this,arguments)}})(),[]),ve=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestNewSession()},[]),ye=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestStop()},[]),Ee=(0,s.useCallback)(()=>{ae("chat"),Ae("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes and commit them.")},[Ae]),Ie=(0,s.useCallback)(()=>{ae("chat"),Ae("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[Ae]),Pe=(0,s.useCallback)(()=>{Q&&o.Linking.openURL(Q)},[Q]),De=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Ne=(0,s.useCallback)(()=>{if(ie(e=>!e),!oe){var e=(0,h.getWebSocketClient)();e&&e.requestBranches()}},[oe]),ke=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[]),we=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);if(!C)return(0,b.jsx)(o.View,{style:_.collapsedPill,children:(0,b.jsx)(E,{status:y})});return(0,b.jsxs)(o.View,{style:_.expanded,children:[(0,b.jsx)(A,{status:y,branchName:V,onBranchPress:Ne}),(0,b.jsx)(v,{activeTab:ne,onTabChange:ae,onNewSession:ve,canStartNew:"connected"===y,hasPR:X,hasChanges:H.length>0,prNumber:fe,onCreatePR:Ie,onCommit:Ee,onViewPR:Pe}),(0,b.jsx)(o.View,{style:_.body,children:"chat"===ne?(0,b.jsx)(l.ResponseArea,{messages:N,currentParts:j}):(0,b.jsx)(u.GitChangesTab,{changes:H,onDiscard:De})}),"chat"===ne&&(0,b.jsx)(c.PromptInput,{ref:Oe,onSubmit:Ae,onStop:ye,disabled:"disconnected"===y,isProcessing:"processing"===y}),oe&&(0,b.jsx)(p.BranchSwitcher,{branches:ue,currentBranch:V,onSelect:ke,onCreate:we,onClose:()=>{ie(!1),me(null)},error:pe})]})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]),h=r(d[7]),S=r(d[8]),p=r(d[9]),T=r(d[10]),b=r(d[11]),C=o.Animated.Text,O=o.Animated.View,f=o.NativeModules.WidgetBridge,R=o.NativeModules.ExpoAir;function x(){try{f?.collapse?f.collapse():R?.collapse?R.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}function A(e){var t=e.status,n=e.branchName,s=e.onBranchPress,c={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO};return(0,b.jsxs)(o.View,{style:_.header,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:x,style:_.closeButton,children:(0,b.jsx)(o.Text,{style:_.closeButtonText,children:"\u2715"})}),(0,b.jsxs)(o.TouchableOpacity,{style:_.branchButton,onPress:s,children:[(0,b.jsx)(o.Text,{style:_.branchName,numberOfLines:1,children:n}),(0,b.jsx)(o.Text,{style:_.branchChevron,children:"\u25be"})]}),(0,b.jsx)(o.View,{style:[_.statusDot,{backgroundColor:c[t]}]})]})}function v(e){var t=e.activeTab,n=e.onTabChange,s=e.onNewSession,c=e.canStartNew,l=e.hasPR,u=e.hasChanges,h=e.prNumber,S=e.onCreatePR,p=e.onCommit,T=e.onViewPR;return(0,b.jsxs)(o.View,{style:_.tabBar,children:[(0,b.jsxs)(o.View,{style:_.tabButtons,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("chat"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"chat"===t?_.tabTextActive:_.tabTextInactive],children:"Chat"})}),(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("changes"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"changes"===t?_.tabTextActive:_.tabTextInactive],children:"Changes"})})]}),"chat"===t?(0,b.jsx)(o.TouchableOpacity,{onPress:s,style:[_.ctaButton,!c&&_.ctaButtonDisabled],disabled:!c,children:(0,b.jsx)(o.Text,{style:[_.ctaText,!c&&_.ctaTextDisabled],children:"New"})}):!l&&u?(0,b.jsx)(y,{onPress:S,children:"Create PR"}):l&&u?(0,b.jsx)(y,{onPress:p,children:"Commit"}):l&&!u&&h?(0,b.jsxs)(y,{onPress:T,children:["#",h]}):null]})}function y(e){var t=e.children,n=e.onPress,c=(0,s.useRef)(new o.Animated.Value(.6)).current;return(0,s.useEffect)(()=>{var e=o.Animated.loop(o.Animated.sequence([o.Animated.timing(c,{toValue:.9,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(c,{toValue:.6,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[c]),(0,b.jsx)(o.TouchableOpacity,{onPress:n,style:_.ctaButton,activeOpacity:.7,children:(0,b.jsx)(C,{style:[_.ctaText,{opacity:c}],children:t})})}function E(e){var t=e.status,n={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO},c="processing"===t||"connecting"===t,l=(0,s.useRef)(new o.Animated.Value(1)).current,u=(0,s.useRef)(new o.Animated.Value(.4)).current;return(0,s.useEffect)(()=>{if(c){var e=o.Animated.loop(o.Animated.sequence([o.Animated.parallel([o.Animated.timing(l,{toValue:1.3,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(u,{toValue:0,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]),o.Animated.parallel([o.Animated.timing(l,{toValue:1,duration:0,useNativeDriver:!0}),o.Animated.timing(u,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}l.setValue(1),u.setValue(.4)},[c,l,u]),(0,b.jsxs)(o.View,{style:_.indicatorContainer,children:[(0,b.jsx)(o.View,{style:[_.indicator,{backgroundColor:n[t]}]}),c&&(0,b.jsx)(O,{style:[_.indicatorRing,{borderColor:n[t],transform:[{scale:l}],opacity:u}]})]})}var _=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4},expanded:{flex:1,backgroundColor:T.COLORS.BACKGROUND,borderRadius:T.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},closeButton:{width:T.SIZES.CLOSE_BUTTON,height:T.SIZES.CLOSE_BUTTON,borderRadius:T.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:T.SPACING.MD},closeButtonText:{color:"transparent",fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:T.COLORS.TEXT_SECONDARY,fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:T.COLORS.TEXT_MUTED,fontSize:T.TYPOGRAPHY.SIZE_SM,marginLeft:T.SPACING.XS},statusDot:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2,marginLeft:T.SPACING.MD},ctaButton:{paddingHorizontal:T.SIZES.CTA_PADDING_H,paddingVertical:T.SIZES.CTA_PADDING_V,borderRadius:T.LAYOUT.BORDER_RADIUS_SM,backgroundColor:T.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:T.COLORS.TEXT_PRIMARY,fontSize:T.TYPOGRAPHY.SIZE_SM,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6},tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:T.SPACING.XL},tabText:{fontSize:T.TYPOGRAPHY.SIZE_LG,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:T.COLORS.TEXT_PRIMARY},tabTextInactive:{color:T.COLORS.TEXT_MUTED},body:{flex:1,backgroundColor:T.COLORS.BACKGROUND_ELEVATED}})},485,[346,29,63,258,486,488,489,490,491,492,487,250]);
|
|
537
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.BubbleContent=function(e){e.size,e.color;var T=e.expanded,C=void 0!==T&&T,O=e.serverUrl,f=void 0===O?"ws://localhost:3847":O,R=(0,s.useState)("disconnected"),x=(0,n.default)(R,2),y=x[0],I=x[1],P=(0,s.useState)([]),D=(0,n.default)(P,2),N=D[0],k=D[1],w=(0,s.useState)([]),B=(0,n.default)(w,2),j=B[0],L=B[1],U=(0,s.useState)("main"),G=(0,n.default)(U,2),V=G[0],M=G[1],Y=(0,s.useState)([]),W=(0,n.default)(Y,2),H=W[0],Z=W[1],q=(0,s.useState)(!1),z=(0,n.default)(q,2),X=z[0],F=z[1],K=(0,s.useState)(),J=(0,n.default)(K,2),Q=J[0],$=J[1],ee=(0,s.useState)("chat"),te=(0,n.default)(ee,2),ne=te[0],ae=te[1],re=(0,s.useState)(!1),se=(0,n.default)(re,2),oe=se[0],ie=se[1],ce=(0,s.useState)([]),le=(0,n.default)(ce,2),ue=le[0],de=le[1],he=(0,s.useState)(null),Se=(0,n.default)(he,2),pe=Se[0],me=Se[1],Te=(0,s.useRef)(!1),be=(0,s.useRef)(0),ge=(0,s.useRef)([]),Ce=(0,s.useRef)(null),Oe=(0,s.useRef)(null);(0,s.useEffect)(()=>{C&&"chat"===ne&&setTimeout(()=>Oe.current?.focus(),100)},[C]);var fe=Q?.match(/\/pull\/(\d+)/)?.[1];(0,s.useEffect)(()=>{console.log("[expo-air] Connecting to:",f);var e=(0,h.createWebSocketClient)({url:f,onStatusChange:I,onMessage:xe,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[f]),(0,s.useEffect)(()=>(0,S.setupTapHandler)((e,t)=>{var n=(0,h.getWebSocketClient)();n&&!n.isConnected()&&n.connect()}),[]);var Re=(0,s.useCallback)((e,t)=>{var n=ge.current;if(n.length>0){var s={type:"assistant_parts",promptId:e,parts:n,isComplete:t,timestamp:Date.now()};k(e=>[...e,s])}ge.current=[],Ce.current=null,L([])},[]),xe=(0,s.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==Ce.current&&(ge.current.length>0&&Ce.current&&Re(Ce.current,!1),Ce.current=e.promptId),!e.done&&e.chunk){var t=ge.current,n=t[t.length-1];"text"===n?.type?(n.content+=e.chunk,ge.current=[...t]):ge.current=[...t,{type:"text",id:"text-"+be.current++,content:e.chunk}],L([...ge.current])}break;case"tool":if("started"!==e.status){var s={type:"tool",id:"tool-"+be.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};ge.current=[...ge.current,s],L([...ge.current])}break;case"result":if(ge.current.length>0){var o={type:"assistant_parts",promptId:e.promptId,parts:ge.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};k(e=>[...e,o,c])}else k(e=>[...e,o])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"error":if(ge.current.length>0&&Ce.current){var l={type:"assistant_parts",promptId:Ce.current,parts:ge.current,isComplete:!1,timestamp:Date.now()};k(t=>[...t,l,e])}else k(t=>[...t,e]);ge.current=[],Ce.current=null,L([]);break;case"status":break;case"session_cleared":k([]),ge.current=[],Ce.current=null,be.current=0,L([]);break;case"stopped":ge.current.length>0&&Ce.current?Re(Ce.current,!1):(ge.current=[],Ce.current=null,L([]));break;case"history":var u=e.entries.flatMap(e=>"user"===e.role?[{type:"user_prompt",content:e.content,timestamp:e.timestamp}]:"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]);k(u);break;case"git_status":M(e.branchName),Z(e.changes),F(e.hasPR),$(e.prUrl);break;case"branches_list":de(e.branches);break;case"branch_switched":case"branch_created":e.success?(ie(!1),me(null)):e.error&&me(e.error)}},[Re]),Ae=(0,s.useCallback)((function(){var e=(0,t.default)(function*(e){if(!Te.current){var t=yield(0,S.requestPushToken)();if(t){var n=(0,h.getWebSocketClient)();n?.isConnected()&&(n.sendPushToken(t),Te.current=!0)}}k(t=>[...t,{type:"user_prompt",content:e,timestamp:Date.now()}]),ge.current=[],Ce.current=null,L([]);var s=(0,h.getWebSocketClient)();s&&s.sendPrompt(e)});return function(t){return e.apply(this,arguments)}})(),[]),ve=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestNewSession()},[]),ye=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestStop()},[]),Ee=(0,s.useCallback)(()=>{ae("chat"),Ae("Look at my current git changes and create a commit with a good conventional commit message. Stage all changes and commit them.")},[Ae]),Ie=(0,s.useCallback)(()=>{ae("chat"),Ae("Create a pull request for my current branch. First commit any uncommitted changes with a good message. Then generate a title and description based on the commits, and use `gh pr create --title \"...\" --body \"...\"` (non-interactive mode) to create it. Push to remote first if needed.")},[Ae]),Pe=(0,s.useCallback)(()=>{Q&&o.Linking.openURL(Q)},[Q]),De=(0,s.useCallback)(()=>{var e=(0,h.getWebSocketClient)();e&&e.requestDiscardChanges()},[]),Ne=(0,s.useCallback)(()=>{if(ie(e=>!e),!oe){var e=(0,h.getWebSocketClient)();e&&e.requestBranches()}},[oe]),ke=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestSwitchBranch(e)},[]),we=(0,s.useCallback)(e=>{me(null);var t=(0,h.getWebSocketClient)();t&&t.requestCreateBranch(e)},[]);if(!C)return(0,b.jsx)(o.View,{style:_.collapsedPill,children:(0,b.jsx)(E,{status:y})});return(0,b.jsxs)(o.View,{style:_.expanded,children:[(0,b.jsx)(A,{status:y,branchName:V,onBranchPress:Ne}),(0,b.jsx)(v,{activeTab:ne,onTabChange:ae,onNewSession:ve,canStartNew:"connected"===y,hasPR:X,hasChanges:H.length>0,prNumber:fe,onCreatePR:Ie,onCommit:Ee,onViewPR:Pe}),(0,b.jsx)(o.View,{style:_.body,children:"chat"===ne?(0,b.jsx)(l.ResponseArea,{messages:N,currentParts:j}):(0,b.jsx)(u.GitChangesTab,{changes:H,onDiscard:De})}),"chat"===ne&&(0,b.jsx)(c.PromptInput,{ref:Oe,onSubmit:Ae,onStop:ye,disabled:"disconnected"===y,isProcessing:"processing"===y}),oe&&(0,b.jsx)(p.BranchSwitcher,{branches:ue,currentBranch:V,onSelect:ke,onCreate:we,onClose:()=>{ie(!1),me(null)},error:pe})]})};var t=e(r(d[0])),n=e(r(d[1])),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]),h=r(d[7]),S=r(d[8]),p=r(d[9]),T=r(d[10]),b=r(d[11]),C=o.Animated.Text,O=o.Animated.View,f=o.NativeModules.WidgetBridge,R=o.NativeModules.ExpoAir;function x(){try{f?.collapse?f.collapse():R?.collapse?R.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}function A(e){var t=e.status,n=e.branchName,s=e.onBranchPress,c={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO};return(0,b.jsxs)(o.View,{style:_.header,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:x,style:_.closeButton,children:(0,b.jsx)(o.Text,{style:_.closeButtonText,children:"\u2715"})}),(0,b.jsxs)(o.TouchableOpacity,{style:_.branchButton,onPress:s,children:[(0,b.jsx)(o.Text,{style:_.branchName,numberOfLines:1,children:n}),(0,b.jsx)(o.Text,{style:_.branchChevron,children:"\u25be"})]}),(0,b.jsx)(o.View,{style:[_.statusDot,{backgroundColor:c[t]}]})]})}function v(e){var t=e.activeTab,n=e.onTabChange,s=e.onNewSession,c=e.canStartNew,l=e.hasPR,u=e.hasChanges,h=e.prNumber,S=e.onCreatePR,p=e.onCommit,T=e.onViewPR;return(0,b.jsxs)(o.View,{style:_.tabBar,children:[(0,b.jsxs)(o.View,{style:_.tabButtons,children:[(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("chat"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"chat"===t?_.tabTextActive:_.tabTextInactive],children:"Chat"})}),(0,b.jsx)(o.TouchableOpacity,{onPress:()=>n("changes"),children:(0,b.jsx)(o.Text,{style:[_.tabText,"changes"===t?_.tabTextActive:_.tabTextInactive],children:"Changes"})})]}),"chat"===t?(0,b.jsx)(o.TouchableOpacity,{onPress:s,style:[_.ctaButton,!c&&_.ctaButtonDisabled],disabled:!c,children:(0,b.jsx)(o.Text,{style:[_.ctaText,!c&&_.ctaTextDisabled],children:"New"})}):!l&&u?(0,b.jsx)(y,{onPress:S,children:"Create PR"}):l&&u?(0,b.jsx)(y,{onPress:p,children:"Commit"}):l&&!u&&h?(0,b.jsxs)(y,{onPress:T,children:["#",h]}):null]})}function y(e){var t=e.children,n=e.onPress,c=(0,s.useRef)(new o.Animated.Value(.6)).current;return(0,s.useEffect)(()=>{var e=o.Animated.loop(o.Animated.sequence([o.Animated.timing(c,{toValue:.9,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(c,{toValue:.6,duration:1500,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[c]),(0,b.jsx)(o.TouchableOpacity,{onPress:n,style:_.ctaButton,activeOpacity:.7,children:(0,b.jsx)(C,{style:[_.ctaText,{opacity:c}],children:t})})}function E(e){var t=e.status,n={disconnected:T.COLORS.STATUS_ERROR,connecting:T.COLORS.STATUS_INFO,connected:T.COLORS.STATUS_SUCCESS,processing:T.COLORS.STATUS_INFO},c="processing"===t||"connecting"===t,l=(0,s.useRef)(new o.Animated.Value(1)).current,u=(0,s.useRef)(new o.Animated.Value(.4)).current;return(0,s.useEffect)(()=>{if(c){var e=o.Animated.loop(o.Animated.sequence([o.Animated.parallel([o.Animated.timing(l,{toValue:1.3,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0}),o.Animated.timing(u,{toValue:0,duration:1200,easing:o.Easing.inOut(o.Easing.ease),useNativeDriver:!0})]),o.Animated.parallel([o.Animated.timing(l,{toValue:1,duration:0,useNativeDriver:!0}),o.Animated.timing(u,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}l.setValue(1),u.setValue(.4)},[c,l,u]),(0,b.jsxs)(o.View,{style:_.indicatorContainer,children:[(0,b.jsx)(o.View,{style:[_.indicator,{backgroundColor:n[t]}]}),c&&(0,b.jsx)(O,{style:[_.indicatorRing,{borderColor:n[t],transform:[{scale:l}],opacity:u}]})]})}var _=o.StyleSheet.create({collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4},expanded:{flex:1,backgroundColor:T.COLORS.BACKGROUND,borderRadius:T.LAYOUT.BORDER_RADIUS_LG,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},closeButton:{width:T.SIZES.CLOSE_BUTTON,height:T.SIZES.CLOSE_BUTTON,borderRadius:T.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:T.SPACING.MD},closeButtonText:{color:"transparent",fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:T.COLORS.TEXT_SECONDARY,fontSize:T.TYPOGRAPHY.SIZE_MD,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:T.COLORS.TEXT_MUTED,fontSize:T.TYPOGRAPHY.SIZE_SM,marginLeft:T.SPACING.XS},statusDot:{width:T.SIZES.STATUS_DOT,height:T.SIZES.STATUS_DOT,borderRadius:T.SIZES.STATUS_DOT/2,marginLeft:T.SPACING.MD},ctaButton:{paddingHorizontal:T.SIZES.CTA_PADDING_H,paddingVertical:T.SIZES.CTA_PADDING_V,borderRadius:T.LAYOUT.BORDER_RADIUS_SM,backgroundColor:T.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:T.COLORS.TEXT_PRIMARY,fontSize:T.TYPOGRAPHY.SIZE_SM,fontWeight:T.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6},tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:T.LAYOUT.CONTENT_PADDING_H,paddingVertical:T.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:T.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:T.SPACING.XL},tabText:{fontSize:T.TYPOGRAPHY.SIZE_LG,fontWeight:T.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:T.COLORS.TEXT_PRIMARY},tabTextInactive:{color:T.COLORS.TEXT_MUTED},body:{flex:1,backgroundColor:T.COLORS.BACKGROUND_ELEVATED}})},485,[346,29,63,258,486,488,489,490,491,492,487,250]);
|
|
538
538
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PromptInput",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),s=r(d[2]),l=r(d[3]),u=r(d[4]),c=(0,n.forwardRef)((e,t)=>{var c=e.onSubmit,R=e.onStop,h=e.disabled,S=void 0!==h&&h,C=e.isProcessing,p=void 0!==C&&C,I=(0,n.useState)(""),f=(0,o.default)(I,2),y=f[0],B=f[1],_=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,()=>({focus:()=>_.current?.focus()}));var L=()=>{var e=y.trim();!e||S||p||(c(e),B(""))},w=y.trim().length>0&&!S&&!p;return(0,u.jsxs)(s.View,{style:O.container,children:[(0,u.jsx)(s.TextInput,{ref:_,style:O.input,placeholder:"Ask Claude...",placeholderTextColor:l.COLORS.TEXT_TERTIARY,value:y,onChangeText:B,onSubmitEditing:L,editable:!p,multiline:!0,maxLength:2e3,returnKeyType:"send",blurOnSubmit:!0}),p?(0,u.jsx)(s.TouchableOpacity,{style:[O.submitButton,O.stopButton],onPress:R,activeOpacity:.7,children:(0,u.jsx)(b,{})}):(0,u.jsx)(s.TouchableOpacity,{style:[O.submitButton,!w&&O.submitButtonDisabled],onPress:L,disabled:!w,activeOpacity:.7,children:(0,u.jsx)(T,{})})]})});function T(){return(0,u.jsxs)(s.View,{style:O.arrowIcon,children:[(0,u.jsx)(s.View,{style:O.arrowLine}),(0,u.jsx)(s.View,{style:O.arrowHead})]})}function b(){return(0,u.jsx)(s.View,{style:O.stopIcon})}var O=s.StyleSheet.create({container:{flexDirection:"row",alignItems:"flex-end",paddingHorizontal:l.LAYOUT.CONTENT_PADDING_H,paddingVertical:l.SPACING.MD,borderTopWidth:1,borderTopColor:l.COLORS.BORDER,backgroundColor:l.COLORS.BACKGROUND},input:{flex:1,backgroundColor:l.COLORS.BACKGROUND_INPUT,borderRadius:22,paddingHorizontal:18,paddingVertical:l.SPACING.MD,color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_LG,maxHeight:100},submitButton:{width:l.SIZES.SUBMIT_BUTTON,height:l.SIZES.SUBMIT_BUTTON,borderRadius:l.SIZES.SUBMIT_BUTTON/2,backgroundColor:l.COLORS.BACKGROUND_BUTTON,alignItems:"center",justifyContent:"center",marginLeft:l.SPACING.SM+2},submitButtonDisabled:{opacity:.4},stopButton:{backgroundColor:l.COLORS.STATUS_NEUTRAL},stopIcon:{width:12,height:12,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:2},arrowIcon:{width:16,height:16,alignItems:"center",justifyContent:"center"},arrowLine:{width:2,height:10,backgroundColor:l.COLORS.TEXT_PRIMARY,borderRadius:1},arrowHead:{position:"absolute",top:0,width:0,height:0,borderLeftWidth:5,borderRightWidth:5,borderBottomWidth:6,borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:l.COLORS.TEXT_PRIMARY}})},486,[29,63,258,487,250]);
|
|
539
539
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SPACING",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"LAYOUT",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"COLORS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"TYPOGRAPHY",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return D}});var T={XS:4,SM:8,MD:12,LG:16,XL:20,XXL:24},_={CONTENT_PADDING_H:T.LG,SECTION_PADDING_V:T.MD,ELEMENT_GAP:T.MD,BORDER_RADIUS_LG:32,BORDER_RADIUS_MD:20,BORDER_RADIUS_SM:14},E={BACKGROUND:"#000",BACKGROUND_ELEVATED:"rgba(255,255,255,0.03)",BACKGROUND_INTERACTIVE:"rgba(255,255,255,0.08)",BACKGROUND_INPUT:"rgba(255,255,255,0.1)",BACKGROUND_BUTTON:"rgba(255,255,255,0.15)",TEXT_PRIMARY:"#fff",TEXT_SECONDARY:"rgba(255,255,255,0.6)",TEXT_TERTIARY:"rgba(255,255,255,0.5)",TEXT_MUTED:"rgba(255,255,255,0.4)",BORDER:"rgba(255,255,255,0.08)",STATUS_SUCCESS:"#30D158",STATUS_ERROR:"#FF3B30",STATUS_INFO:"#007AFF",STATUS_NEUTRAL:"#8E8E93"},S={SIZE_XS:11,SIZE_SM:13,SIZE_MD:14,SIZE_LG:15,SIZE_XL:17,WEIGHT_NORMAL:"400",WEIGHT_MEDIUM:"500",WEIGHT_SEMIBOLD:"600"},D={STATUS_DOT:8,CLOSE_BUTTON:30,SUBMIT_BUTTON:40,CTA_PADDING_V:6,CTA_PADDING_H:12}},487,[]);
|
|
540
540
|
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResponseArea=function(e){var l=e.messages,s=e.currentParts,u=(0,n.useRef)(null),h=(0,n.useState)(!0),T=(0,t.default)(h,2),S=T[0],x=T[1],f=(0,n.useRef)(0),p=(0,n.useRef)(0),C=(0,n.useCallback)(e=>{var t=e.nativeEvent,n=t.contentOffset,l=t.contentSize,i=t.layoutMeasurement,s=l.height-i.height-n.y;x(s<50)},[]),y=(0,n.useCallback)((e,t)=>{f.current=t},[]),I=(0,n.useCallback)(e=>{p.current=e.nativeEvent.layout.height},[]);(0,n.useEffect)(()=>{if(S){var e=setTimeout(()=>{u.current?.scrollToEnd({animated:!1})},16);return()=>clearTimeout(e)}},[l,s,S]),(0,n.useEffect)(()=>{var e=l[l.length-1];"user_prompt"===e?.type&&(u.current?.scrollToEnd({animated:!0}),x(!0))},[l]),(0,n.useEffect)(()=>{var e=i.Keyboard.addListener("keyboardWillShow",()=>{S&&setTimeout(()=>{u.current?.scrollToEnd({animated:!0})},100)});return()=>e.remove()},[S]);var G=(0,n.useCallback)(()=>{u.current?.scrollToEnd({animated:!0}),x(!0)},[]);if(!(l.length>0||s.length>0))return(0,o.jsx)(i.View,{style:A.emptyContainer,children:(0,o.jsx)(i.Text,{style:A.emptyText,children:"Send a prompt to start coding with Claude"})});return(0,o.jsxs)(i.View,{style:A.wrapper,children:[(0,o.jsxs)(i.ScrollView,{ref:u,style:A.container,contentContainerStyle:A.content,showsVerticalScrollIndicator:!0,onScroll:C,onContentSizeChange:y,onLayout:I,scrollEventThrottle:16,children:[l.map((e,t)=>(0,o.jsx)(c,{message:e},t)),s.length>0&&(0,o.jsx)(P,{parts:s,isStreaming:!0})]}),!S&&(0,o.jsx)(i.TouchableOpacity,{style:A.scrollButton,onPress:G,activeOpacity:.8,children:(0,o.jsx)(i.Text,{style:A.scrollButtonText,children:"\u2193"})})]})};var t=e(r(d[0])),n=r(d[1]),l=e(n),i=r(d[2]),s=r(d[3]),o=r(d[4]);function c(e){var t=e.message;switch(t.type){case"stream":case"status":default:return null;case"tool":return(0,o.jsx)(O,{tool:t});case"result":return(0,o.jsx)(b,{result:t});case"error":return(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.message})});case"user_prompt":return(0,o.jsx)(u,{message:t});case"history_result":return(0,o.jsx)(h,{message:t});case"assistant_parts":return(0,o.jsx)(C,{message:t});case"system_message":return(0,o.jsx)(T,{message:t})}}function u(e){var t=e.message;return(0,o.jsx)(i.View,{style:A.userPromptContainer,children:(0,o.jsx)(i.Text,{style:A.userPromptText,selectable:!0,children:t.content})})}function h(e){var t=e.message;return(0,o.jsx)(i.View,{style:A.resultContainer,children:(0,o.jsx)(S,{content:t.content})})}function T(e){var t=e.message;return"error"===t.messageType?(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.content})}):(0,o.jsx)(i.View,{style:A.systemContainer,children:(0,o.jsx)(i.Text,{style:A.systemText,children:t.content})})}function S(e){for(var n=e.content,l=e.isStreaming,c=n.split('\n'),u=[],h=0;h<c.length;){var T=c[h],S=T.trim();if(S.startsWith('```')){var f=[],p=S.slice(3).trim();for(h++;h<c.length&&!c[h].trim().startsWith('```');)f.push(c[h]),h++;u.push((0,o.jsxs)(i.View,{style:A.codeBlock,children:[p&&(0,o.jsx)(i.Text,{style:A.codeLang,children:p}),(0,o.jsx)(i.Text,{style:A.codeText,selectable:!0,children:f.join('\n')})]},`code-${h}`)),h++}else{var P=S.match(/^(#{1,6})\s+(.+)$/);if(P){var C=P[1].length,y=C<=2?A.heading1:C<=4?A.heading2:A.heading3;u.push((0,o.jsx)(i.Text,{style:y,selectable:!0,children:x(P[2])},h)),h++}else if(S.startsWith('> ')||'>'===S){for(var I=[];h<c.length&&(c[h].trim().startsWith('> ')||'>'===c[h].trim());){var G=c[h].trim().startsWith('> ')?c[h].trim().slice(2):'';I.push(G),h++}u.push((0,o.jsx)(i.View,{style:A.blockquote,children:(0,o.jsx)(i.Text,{style:A.blockquoteText,selectable:!0,children:x(I.join('\n'))})},`quote-${h}`))}else{var O=S.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(O){var b=' '!==O[1];u.push((0,o.jsxs)(i.View,{style:A.listItem,children:[(0,o.jsx)(i.Text,{style:A.listBullet,children:b?'\u2611':'\u2610'}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(O[2])})]},h)),h++}else{var R=T.match(/^(\s*)(\d+)\.\s+(.+)$/);if(R){var j=Math.floor(R[1].length/2),E=(0,t.default)(R,4),M=E[2],L=E[3];u.push((0,o.jsxs)(i.View,{style:[A.listItem,j>0&&{paddingLeft:s.SPACING.SM+j*s.SPACING.LG}],children:[(0,o.jsxs)(i.Text,{style:A.listNumber,children:[M,"."]}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(L)})]},h)),h++}else{var Y=T.match(/^(\s*)[-*]\s+(.+)$/);if(Y){var _=Math.floor(Y[1].length/2),v=0===_?'\u2022':1===_?'\u25e6':'\u25aa';u.push((0,o.jsxs)(i.View,{style:[A.listItem,_>0&&{paddingLeft:s.SPACING.SM+_*s.SPACING.LG}],children:[(0,o.jsx)(i.Text,{style:A.listBullet,children:v}),(0,o.jsx)(i.Text,{style:A.listText,selectable:!0,children:x(Y[2])})]},h)),h++}else/^[-*_]{3,}$/.test(S)?(u.push((0,o.jsx)(i.View,{style:A.horizontalRule},h)),h++):S?(u.push((0,o.jsx)(i.Text,{style:A.responseText,selectable:!0,children:x(T)},h)),h++):(u.push((0,o.jsx)(i.View,{style:A.paragraphBreak},h)),h++)}}}}}return(0,o.jsxs)(i.View,{style:A.formattedContainer,children:[u,l&&(0,o.jsx)(i.View,{style:A.cursor})]})}function x(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?f(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(i.Text,{style:A.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(l.default.Fragment,{children:f(e)},t))}function f(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?p(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(i.Text,{style:A.linkText,onPress:()=>i.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(l.default.Fragment,{children:p(e)},t)})}function p(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(i.Text,{style:A.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(i.Text,{style:A.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(i.Text,{style:A.italicText,children:e.slice(1,-1)},t):e)}function P(e){var t=e.parts,n=e.isStreaming;return(0,o.jsx)(i.View,{style:A.partsContainer,children:t.map((e,l)=>{if("text"===e.type){var s=l===t.length-1;return(0,o.jsx)(i.View,{style:A.messageContainer,children:(0,o.jsx)(S,{content:e.content,isStreaming:n&&s})},e.id)}return"tool"===e.type?(0,o.jsx)(G,{part:e},e.id):null})})}function C(e){var t=e.message;return(0,o.jsxs)(i.View,{style:A.resultContainer,children:[(0,o.jsx)(P,{parts:t.parts,isStreaming:!1}),!t.isComplete&&(0,o.jsx)(i.Text,{style:A.interruptedText,children:"(interrupted)"})]})}function y(e,t){var n=e=>e.split('/').pop()||e;switch(e){case"Read":return{label:"read",value:n(t?.file_path||"file")};case"Edit":return{label:"edit",value:n(t?.file_path||"file")};case"Write":return{label:"write",value:n(t?.file_path||"file")};case"Bash":var l=t?.command||"";return{label:"$",value:l.length>45?l.slice(0,45)+"\u2026":l};case"Glob":return{label:"glob",value:t?.pattern||"*"};case"Grep":return{label:"grep",value:t?.pattern||"search"};case"Task":return{label:"agent",value:t?.description||"task"};default:return{label:e.toLowerCase(),value:""}}}function I(e){var t=e.toolName,n=e.input,l=e.isFailed,s=y(t,n),c=s.label,u=s.value;return(0,o.jsxs)(i.View,{style:A.toolLine,children:[(0,o.jsx)(i.Text,{style:l?A.toolLabelFailed:A.toolLabel,children:c}),(0,o.jsx)(i.Text,{style:l?A.toolValueFailed:A.toolValue,numberOfLines:1,children:u}),l&&(0,o.jsx)(i.Text,{style:A.toolLabelFailed,children:" \u2715"})]})}function G(e){var t=e.part;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function O(e){var t=e.tool;return"started"===t.status?null:(0,o.jsx)(I,{toolName:t.toolName,input:t.input,isFailed:"failed"===t.status})}function b(e){var t=e.result;return!t.success&&t.error?(0,o.jsx)(i.View,{style:A.errorContainer,children:(0,o.jsx)(i.Text,{style:A.errorText,children:t.error})}):(0,o.jsxs)(i.View,{style:A.resultContainer,children:[t.result&&(0,o.jsx)(i.Text,{style:A.responseText,selectable:!0,children:t.result}),(void 0!==t.costUsd||void 0!==t.durationMs)&&(0,o.jsxs)(i.Text,{style:A.metaText,children:[void 0!==t.durationMs&&`${t.durationMs}ms`,void 0!==t.costUsd&&void 0!==t.durationMs&&" \u2022 ",void 0!==t.costUsd&&`$${t.costUsd.toFixed(4)}`]})]})}var A=i.StyleSheet.create({wrapper:{flex:1,position:"relative"},container:{flex:1,backgroundColor:s.COLORS.BACKGROUND},content:{padding:s.LAYOUT.CONTENT_PADDING_H,paddingBottom:s.SPACING.XXL},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:s.SPACING.XXL},emptyText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,textAlign:"center",lineHeight:22},messageContainer:{flexDirection:"row",flexWrap:"wrap"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:s.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},resultContainer:{marginTop:s.SPACING.SM},partsContainer:{},formattedContainer:{flexDirection:"column"},listItem:{flexDirection:"row",marginVertical:s.SPACING.XS/2,paddingLeft:s.SPACING.SM},listNumber:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:s.SPACING.SM,padding:s.SPACING.MD,marginVertical:s.SPACING.SM},codeLang:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:s.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:s.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_XL,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:s.SPACING.MD,marginBottom:s.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:s.SPACING.SM,marginBottom:s.SPACING.XS},boldText:{fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:s.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:s.COLORS.TEXT_MUTED},linkText:{color:s.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:s.SPACING.MD,marginVertical:s.SPACING.XS},blockquoteText:{color:s.COLORS.TEXT_SECONDARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:s.COLORS.BORDER,marginVertical:s.SPACING.MD},paragraphBreak:{height:s.SPACING.SM},interruptedText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontStyle:"italic",marginTop:s.SPACING.XS},metaText:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,marginTop:s.SPACING.SM+2},errorContainer:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},errorText:{color:"#FF6B6B",fontSize:s.TYPOGRAPHY.SIZE_MD},systemContainer:{backgroundColor:"rgba(255,255,255,0.05)",borderRadius:s.SPACING.MD,padding:s.SPACING.MD,marginVertical:s.SPACING.SM-2},systemText:{color:s.COLORS.TEXT_TERTIARY,fontSize:s.TYPOGRAPHY.SIZE_MD,fontStyle:"italic"},toolLine:{flexDirection:"row",alignItems:"center",marginVertical:s.SPACING.XS},toolLabel:{color:s.COLORS.TEXT_MUTED,fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolLabelFailed:{color:"rgba(255,100,100,0.6)",fontSize:s.TYPOGRAPHY.SIZE_XS+1,fontFamily:"Menlo",marginRight:s.SPACING.SM,minWidth:36},toolValue:{color:"rgba(255,255,255,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},toolValueFailed:{color:"rgba(255,100,100,0.7)",fontSize:s.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",flexShrink:1},userPromptContainer:{backgroundColor:"rgba(0,122,255,0.15)",borderRadius:s.LAYOUT.BORDER_RADIUS_SM+2,padding:s.SPACING.MD,marginVertical:s.SPACING.SM,alignSelf:"flex-end",maxWidth:"85%"},userPromptText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_LG,lineHeight:20},scrollButton:{position:"absolute",bottom:s.LAYOUT.CONTENT_PADDING_H,alignSelf:"center",left:"50%",marginLeft:-18,width:36,height:36,borderRadius:18,backgroundColor:"rgba(255,255,255,0.12)",borderWidth:1,borderColor:"rgba(255,255,255,0.2)",alignItems:"center",justifyContent:"center"},scrollButtonText:{color:s.COLORS.TEXT_PRIMARY,fontSize:18,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD}})},488,[29,63,258,487,250]);
|
|
541
541
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},489,[63,258,250]);
|
|
542
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.
|
|
542
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var e={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};this.ws.send(JSON.stringify(e)),this.setStatus("processing")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},490,[8,9]);
|
|
543
543
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.requestPushToken=function(){return u.apply(this,arguments)},_e.setupTapHandler=function(e){return console.log("[expo-air] setupTapHandler: tap handling managed by main app"),()=>{}};var e,n=r(d[0]),o=(e=n)&&e.__esModule?e:{default:e},t=r(d[1]).NativeModules.WidgetBridge;function u(){return(u=(0,o.default)(function*(){try{if(!t?.requestPushToken)return console.log("[expo-air] WidgetBridge.requestPushToken not available"),null;console.log("[expo-air] Requesting push token via native bridge");var e=yield t.requestPushToken();return e?(console.log("[expo-air] Got push token:",e),e):(console.log("[expo-air] Push notification permission denied or token unavailable"),null)}catch(e){return console.error("[expo-air] Failed to get push token:",e),null}})).apply(this,arguments)}},491,[346,258]);
|
|
544
544
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,h=(e.currentBranch,e.onSelect),b=e.onCreate,u=e.onClose,C=e.error,I=(0,n.useState)(!1),T=(0,o.default)(I,2),p=T[0],P=T[1],O=(0,n.useState)(""),x=(0,o.default)(O,2),A=x[0],f=x[1],y=()=>{var e=A.trim();e&&(b(e),f(""),P(!1))};return(0,s.jsxs)(l.View,{style:S.overlay,children:[(0,s.jsx)(l.TouchableOpacity,{style:S.backdrop,onPress:u,activeOpacity:1}),(0,s.jsxs)(l.View,{style:S.dropdown,children:[C&&(0,s.jsx)(l.View,{style:S.errorBanner,children:(0,s.jsx)(l.Text,{style:S.errorText,numberOfLines:2,children:C})}),(0,s.jsx)(l.ScrollView,{style:S.branchList,bounces:!1,children:t.map((e,t)=>(0,s.jsxs)(l.TouchableOpacity,{style:[S.branchItem,e.isCurrent&&S.branchItemCurrent,0===t&&S.branchItemFirst],onPress:()=>{e.isCurrent||h(e.name)},activeOpacity:e.isCurrent?1:.6,children:[(0,s.jsxs)(l.View,{style:S.branchInfo,children:[(0,s.jsx)(l.Text,{style:[S.branchName,e.isCurrent&&S.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,s.jsx)(l.View,{style:S.prBadge,children:(0,s.jsxs)(l.Text,{style:S.prBadgeText,children:["#",e.prNumber]})})]}),e.isCurrent&&(0,s.jsx)(l.Text,{style:S.currentIndicator,children:"\u2713"})]},e.name))}),(0,s.jsx)(l.View,{style:S.createSection,children:p?(0,s.jsxs)(l.View,{style:S.createInputRow,children:[(0,s.jsx)(l.TextInput,{style:S.createInput,value:A,onChangeText:f,placeholder:"branch-name",placeholderTextColor:c.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:y,returnKeyType:"done"}),(0,s.jsx)(l.TouchableOpacity,{style:[S.createConfirmButton,!A.trim()&&S.createConfirmDisabled],onPress:y,disabled:!A.trim(),children:(0,s.jsx)(l.Text,{style:S.createConfirmText,children:"Create"})})]}):(0,s.jsx)(l.TouchableOpacity,{style:S.createButton,onPress:()=>P(!0),children:(0,s.jsx)(l.Text,{style:S.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),l=r(d[2]),c=r(d[3]),s=r(d[4]);var S=l.StyleSheet.create({overlay:{...l.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...l.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:c.SPACING.SM,right:c.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:c.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},branchList:{maxHeight:300},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD+2,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:c.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:c.COLORS.TEXT_PRIMARY,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:c.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_XS,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},currentIndicator:{color:c.COLORS.STATUS_SUCCESS,fontSize:c.TYPOGRAPHY.SIZE_SM,marginLeft:c.SPACING.SM},createSection:{paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.MD,borderTopWidth:l.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:c.SPACING.XS},createButtonText:{color:c.COLORS.STATUS_INFO,fontSize:c.TYPOGRAPHY.SIZE_MD,fontWeight:c.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:c.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_MD,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:c.COLORS.STATUS_INFO,paddingHorizontal:c.SPACING.MD,paddingVertical:c.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:c.COLORS.TEXT_PRIMARY,fontSize:c.TYPOGRAPHY.SIZE_SM,fontWeight:c.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:c.SPACING.LG,paddingVertical:c.SPACING.SM,borderBottomWidth:l.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:c.TYPOGRAPHY.SIZE_SM}})},492,[29,63,258,487,250]);
|
|
545
545
|
__r(1);
|
package/package.json
CHANGED
package/widget/BubbleContent.tsx
CHANGED
|
@@ -94,7 +94,7 @@ export function BubbleContent({
|
|
|
94
94
|
onStatusChange: setStatus,
|
|
95
95
|
onMessage: handleMessage,
|
|
96
96
|
onError: (error) => {
|
|
97
|
-
console.
|
|
97
|
+
console.warn("[expo-air] WebSocket error:", error);
|
|
98
98
|
},
|
|
99
99
|
});
|
|
100
100
|
client.connect();
|
package/widget/index.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import 'react-native/Libraries/Core/InitializeCore';
|
|
2
|
-
import { AppRegistry } from 'react-native';
|
|
2
|
+
import { AppRegistry, LogBox } from 'react-native';
|
|
3
3
|
import { BubbleContent } from './BubbleContent';
|
|
4
4
|
|
|
5
|
+
// Suppress all LogBox warnings/errors in the widget — these are expected
|
|
6
|
+
// operational issues (e.g. WebSocket disconnect on airplane mode) and should
|
|
7
|
+
// never surface as red/yellow modals to the end user.
|
|
8
|
+
LogBox.ignoreAllLogs(true);
|
|
9
|
+
|
|
5
10
|
AppRegistry.registerComponent('ExpoAirBubble', () => BubbleContent);
|
|
@@ -278,7 +278,7 @@ export class WebSocketClient {
|
|
|
278
278
|
const message = JSON.parse(event.data) as ServerMessage;
|
|
279
279
|
this.handleMessage(message);
|
|
280
280
|
} catch (e) {
|
|
281
|
-
console.
|
|
281
|
+
console.warn("[expo-air] Failed to parse message:", e);
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
284
|
} catch (e) {
|