PageSourceSearch

https://www.akincankilic.com/_next/static/chunks/2893hi9_-tn12.js

js akincankilic.com collected 2026-10-02 01:22:05 UTC 209,559 bytes, 7 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66054,(e,t,r)=>{var a={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],a=t[1];return(r+a)*3/4-a},t.toByteArray=function(e){var t,r,i=l(e),s=i[0],o=i[1],u=new n((s+o)*3/4-o),c=0,d=o>0?s-4:s;for(r=0;r<d;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,a=e.length,n=a%3,i=[],s=0,o=a-n;s<o;s+=16383)i.push(function(e,t,a){for(var n,i=[],s=t;s<a;s+=3)n=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[n>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return i.join("")}(e,s,s+16383>o?o:s+16383));return 1===n?i.push(r[(t=e[a-1])>>2]+r[t<<4&63]+"=="):2===n&&i.push(r[(t=(e[a-2]<<8)+e[a-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],a=[],n="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=i.length;s<o;++s)r[s]=i[s],a[i.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var a=r===t?0:4-r%4;return[r,a]}a[45]=62,a[95]=63},72:function(e,t,r){"use strict";var a=r(675),n=r(783),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var a=e,n=t;if(("string"!=typeof n||""===n)&&(n="utf8"),!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);var i=0|p(a,n),l=s(i),u=l.write(a,n);return u!==i&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return function(e,t,r){var a;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(a=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),a}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var h=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(h)return h;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),s(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=s(t),a=0;a<t;a+=1)r[a]=255&e[a];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return S(e).length;default:if(n)return a?-1:j(e).length;t=(""+t).toLowerCase(),n=!0}}function h(e,t,r){var n,i,s,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);for(var n="",i=t;i<r;++i)n+=N[e[i]];return n}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(127&e[n]);return a}(this,t,r);case"latin1":case"binary":return function(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(e[n]);return a}(this,t,r);case"base64":return n=this,i=t,s=r,0===i&&s===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(i,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var a=e.slice(t,r),n="",i=0;i<a.length;i+=2)n+=String.fromCharCode(a[i]+256*a[i+1]);return n}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){var i;if(0===e.length)return -1;if("string"==typeof r?(a=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(n)return -1;else r=e.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,a)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,a,n)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,s=1,o=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return -1;s=2,o/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var c=-1;for(i=r;i<o;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*s}else -1!==c&&(i-=i-c),c=-1}else for(r+l>o&&(r=o-l),i=r;i>=0;i--){for(var d=!0,f=0;f<l;f++)if(u(e,i+f)!==u(t,f)){d=!1;break}if(d)return i}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n<i;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:+(a<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,a=o.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var i=e[r];if(A(i,Uint8Array)&&(i=o.from(i)),!o.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(a,n),n+=i.length}return a},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):h.apply(this,arguments)}
vendor: 10,368 bytes, line 1
1,o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(o.prototype[i]=o.prototype.inspect),o.prototype.compare=function(e,t,r,a,n){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,n>>>=0,this===e)return 0;for(var i=n-a,s=r-t,l=Math.min(i,s),u=this.slice(a,n),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){i=u[d],s=c[d];break}return i<s?-1:+(s<i)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n<r;){var i,s,o,l,u=e[n],c=null,d=u>239?4:u>223?3:u>191?2:1;if(n+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(i=e[n+1]))==128&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],s=e[n+2],(192&i)==128&&(192&s)==128&&(l=(15&u)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],s=e[n+2],o=e[n+3],(192&i)==128&&(192&s)==128&&(192&o)==128&&(l=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=d}var f=a,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var h="",m=0;m<p;)h+=String.fromCharCode.apply(String,f.slice(m,m+=4096));return h}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,a,n,i){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw RangeError('"value" argument is out of bounds');if(r+a>e.length)throw RangeError("Index out of range")}function _(e,t,r,a,n,i){if(r+a>e.length||r<0)throw RangeError("Index out of range")}function w(e,t,r,a,i){return t*=1,r>>>=0,i||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,a,23,4),r+4}function k(e,t,r,a,i){return t*=1,r>>>=0,i||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,a,52,8),r+8}o.prototype.write=function(e,t,r,a){if(void 0===t)a="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)a=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,i,s,o,l,u,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var p=!1;;)switch(a){case"hex":return function(e,t,r,a){r=Number(r)||0;var n=e.length-r;a?(a=Number(a))>n&&(a=n):a=n;var i=t.length;a>i/2&&(a=i/2);for(var s=0;s<a;++s){var o,l=parseInt(t.substr(2*s,2),16);if((o=l)!=o)break;e[r+s]=l}return s}(this,e,t,r);case"utf8":case"utf-8":return n=t,i=r,I(j(e,this.length-n),this,n,i);case"ascii":return s=t,o=r,I(T(e),this,s,o);case"latin1":case"binary":return function(e,t,r,a){return I(T(t),e,r,a)}(this,e,t,r);case"base64":return l=t,u=r,I(S(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,I(function(e,t){for(var r,a,n=[],i=0;i<e.length&&!((t-=2)<0);++i)a=(r=e.charCodeAt(i))>>8,n.push(r%256),n.push(a);return n}(e,this.length-c),this,c,d);default:if(p)throw TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var a=this.subarray(e,t);return Object.setPrototypeOf(a,o.prototype),a},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e+--t],n=1;t>0&&(n*=256);)a+=this[e+--t]*n;return a},o.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,a){if(e*=1,t>>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,a){if(e*=1,t>>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,a){if(e*=1,t>>>=0,!a){var n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}var i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,a){if(e*=1,t>>>=0,!a){var n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}var i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,a){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(a<0)throw RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var n=a-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,a);else if(this===e&&r<t&&t<a)for(var i=n-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,a),t);return n},o.prototype.fill=function(e,t,r,a){if("string"==typeof e){if("string"==typeof t?(a=t,t=0,r=this.length):"string"==typeof r&&(a=r,r=this.length),void 0!==a&&"string"!=typeof a)throw TypeError("encoding must be a string");if("string"==typeof a&&!o.isEncoding(a))throw TypeError("Unknown encoding: "+a);if(1===e.length){var n,i=e.charCodeAt(0);("utf8"===a&&i<128||"latin1"===a)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{var s=o.isBuffer(e)?e:o.from(e,a),l=s.length;
1if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%l]}return this};var E=/[^+/0-9A-Za-z-_]/g;function j(e,t){t=t||1/0;for(var r,a=e.length,n=null,i=[],s=0;s<a;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319||s+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function T(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function S(e){return a.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,r,a){for(var n=0;n<a&&!(n+r>=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var a=16*r,n=0;n<16;++n)t[a+n]=e[r]+e[n];return t}()},783:function(e,t){t.read=function(e,t,r,a,n){var i,s,o=8*n-a-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?n-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=o;c>0;i=256*i+e[t+d],d+=f,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=a;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,a),i-=u}return(p?-1:1)*s*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var s,o,l,u=8*i-n-1,c=(1<<u)-1,d=c>>1,f=5960464477539062e-23*(23===n),p=a?0:i-1,h=a?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,n),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;e[r+p]=255&o,p+=h,o/=256,n-=8);for(s=s<<n|o,u+=n;u>0;e[r+p]=255&s,p+=h,s/=256,u-=8);e[r+p-h]|=128*m}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}},s=!0;try{a[e](r,r.exports,i),s=!1}finally{s&&delete n[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/buffer/",t.exports=i(72)},54471,(e,t,r)=>{"use strict";var a=e.i(66054);let n=void 0!==a.Buffer,i=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,s=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function o(e,t,r){null==r&&null!==t&&"object"==typeof t&&(r=t,t=void 0),n&&a.Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));let o=JSON.parse(e,t);if(null===o||"object"!=typeof o)return o;let u=r&&r.protoAction||"error",c=r&&r.constructorAction||"error";if("ignore"===u&&"ignore"===c)return o;if("ignore"!==u&&"ignore"!==c){if(!1===i.test(e)&&!1===s.test(e))return o}else if("ignore"!==u&&"ignore"===c){if(!1===i.test(e))return o}else if(!1===s.test(e))return o;return l(o,{protoAction:u,constructorAction:c,safe:r&&r.safe})}function l(e,{protoAction:t="error",constructorAction:r="error",safe:a}={}){let n=[e];for(;n.length;){let e=n;for(let i of(n=[],e)){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(!0===a)return null;if("error"===t)throw SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if("ignore"!==r&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(!0===a)return null;if("error"===r)throw SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(let e in i){let t=i[e];t&&"object"==typeof t&&n.push(t)}}}return e}function u(e,t,r){let a=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return o(e,t,r)}finally{Error.stackTraceLimit=a}}t.exports=u,t.exports.default=u,t.exports.parse=u,t.exports.safeParse=function(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return o(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=r}},t.exports.scan=l},71363,(e,t,r)=>{"use strict";var a=e.r(15947),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=a.useState,s=a.useEffect,o=a.useLayoutEffect,l=a.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),a=i({inst:{value:r,getSnapshot:t}}),n=a[0].inst,c=a[1];return o(function(){n.value=r,n.getSnapshot=t,u(n)&&c({inst:n})},[e,r,t]),s(function(){return u(n)&&c({inst:n}),e(function(){u(n)&&c({inst:n})})},[e]),l(r),r};r.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:c},7998,(e,t,r)=>{"use strict";
1t.exports=e.r(71363)},61030,(e,t,r)=>{t.exports=function(e,t){let r;if("function"!=typeof e)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a=0;return function(...n){clearTimeout(r);let i=Date.now(),s=t-(i-a);s<=0?(a=i,e.apply(this,n)):r=setTimeout(()=>{a=Date.now(),e.apply(this,n)},s)}}},94059,e=>{"use strict";let t,r,a,n,i,s,o,l;var u,c,d,f,p,h,m,g,y,v,b,x,_,w=e.i(29977),k=e.i(34026),E=e.i(48367),j=e.i(15947),T=e.i(75602),S=e.i(47248);function I(e,t){let r,a=()=>{let{currentTime:a}=t,n=(null===a?0:a.value)/100;r!==n&&e(n),r=n};return S.frame.preUpdate(a,!0),()=>(0,S.cancelFrame)(a)}var A=e.i(15965),N=e.i(61979),C=e.i(69710);let O=new WeakMap,R=(e,t,r)=>(a,n)=>n&&n[0]?n[0][e+"Size"]:(0,N.isSVGElement)(a)&&"getBBox"in a?a.getBBox()[t]:a[r],M=R("inline","width","offsetWidth"),P=R("block","height","offsetHeight");function L({target:e,borderBoxSize:t}){O.get(e)?.forEach(r=>{r(e,{get width(){return M(e,t)},get height(){return P(e,t)}})})}function Z(e){e.forEach(L)}let $=new Set;var z=e.i(47113),F=e.i(95153);let B=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),D={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function U(e,t,r,a){let n=r[t],{length:i,position:s}=D[t],o=n.current,l=r.time;n.current=e[`scroll${s}`],n.scrollLength=e[`scroll${i}`]-e[`client${i}`],n.offset.length=0,n.offset[0]=0,n.offset[1]=n.scrollLength,n.progress=(0,z.progress)(0,n.scrollLength,n.current);let u=a-l;n.velocity=u>50?0:(0,F.velocityPerSecond)(n.current-o,u)}e.i(45487);var V=e.i(79126),W=e.i(68617),q=e.i(83032),J=e.i(12064);let K={start:0,center:.5,end:1};function Y(e,t,r=0){let a=0;if(e in K&&(e=K[e]),"string"==typeof e){let t=parseFloat(e);e.endsWith("px")?a=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?a=t/100*document.documentElement.clientWidth:e.endsWith("vh")?a=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(a=t*e),r+a}let G=[0,0],H=[[0,0],[1,1]],X={x:0,y:0},Q=new WeakMap,ee=new WeakMap,et=new WeakMap,er=e=>e===document.scrollingElement?window:e;function ea(e,{container:a=document.scrollingElement,...n}={}){if(!a)return T.noop;let i=et.get(a);i||(i=new Set,et.set(a,i));let s=function(e,t,r,a={}){return{measure:t=>{!function(e,t=e,r){if(r.x.targetOffset=0,r.y.targetOffset=0,t!==e){let a=t;for(;a&&a!==e;)r.x.targetOffset+=a.offsetLeft,r.y.targetOffset+=a.offsetTop,a=a.offsetParent}r.x.targetLength=t===e?t.scrollWidth:t.clientWidth,r.y.targetLength=t===e?t.scrollHeight:t.clientHeight,r.x.containerLength=e.clientWidth,r.y.containerLength=e.clientHeight}(e,a.target,r),U(e,"x",r,t),U(e,"y",r,t),r.time=t,(a.offset||a.target)&&function(e,t,r){let{offset:a=H}=r,{target:n=e,axis:i="y"}=r,s="y"===i?"height":"width",o=n!==e?function(e,t){let r={x:0,y:0},a=e;for(;a&&a!==t;)if((0,J.isHTMLElement)(a))r.x+=a.offsetLeft,r.y+=a.offsetTop,a=a.offsetParent;else if("svg"===a.tagName){let e=a.getBoundingClientRect(),t=(a=a.parentElement).getBoundingClientRect();r.x+=e.left-t.left,r.y+=e.top-t.top}else if(a instanceof SVGGraphicsElement){let{x:e,y:t}=a.getBBox();r.x+=e,r.y+=t;let n=null,i=a.parentNode;for(;!n;)"svg"===i.tagName&&(n=i),i=a.parentNode;a=n}else break;return r}(n,e):X,l=n===e?{width:e.scrollWidth,height:e.scrollHeight}:"getBBox"in n&&"svg"!==n.tagName?n.getBBox():{width:n.clientWidth,height:n.clientHeight},u={width:e.clientWidth,height:e.clientHeight};t[i].offset.length=0;let c=!t[i].interpolate,d=a.length;for(let e=0;e<d;e++){let r=function(e,t,r,a){let n=Array.isArray(e)?e:G,i=0;return"number"==typeof e?n=[e,e]:"string"==typeof e&&(n=(e=e.trim()).includes(" ")?e.split(" "):[e,K[e]?e:"0"]),(i=Y(n[0],r,a))-Y(n[1],t)}(a[e],u[s],l[s],o[i]);c||r===t[i].interpolatorOffsets[e]||(c=!0),t[i].offset[e]=r}c&&(t[i].interpolate=(0,V.interpolate)(t[i].offset,(0,W.defaultOffset)(a),{clamp:!1}),t[i].interpolatorOffsets=[...t[i].offset]),t[i].progress=(0,q.clamp)(0,1,t[i].interpolate(t[i].current))}(e,r,a)},notify:()=>t(r)}}(a,e,{time:0,x:B(),y:B()},n);if(i.add(s),!Q.has(a)){let e,n=()=>{for(let e of i)e.measure(S.frameData.timestamp);S.frame.preUpdate(s)},s=()=>{for(let e of i)e.notify()},o=()=>S.frame.read(n);Q.set(a,o);let l=er(a);window.addEventListener("resize",o,{passive:!0}),a!==document.documentElement&&ee.set(a,"function"==typeof a?($.add(a),r||(r=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};$.forEach(t=>t(e))},window.addEventListener("resize",r)),()=>{$.delete(a),$.size||"function"!=typeof r||(window.removeEventListener("resize",r),r=void 0)}):(!t&&"u">typeof ResizeObserver&&(t=new ResizeObserver(Z)),(e=(0,C.resolveElements)(a)).forEac
1h(e=>{let r=O.get(e);r||(r=new Set,O.set(e,r)),r.add(o),t?.observe(e)}),()=>{e.forEach(e=>{let r=O.get(e);r?.delete(o),r?.size||t?.unobserve(e)})})),l.addEventListener("scroll",o,{passive:!0}),o()}let o=Q.get(a);return S.frame.read(o,!1,!0),()=>{(0,S.cancelFrame)(o);let e=et.get(a);if(!e||(e.delete(s),e.size))return;let t=Q.get(a);Q.delete(a),t&&(er(a).removeEventListener("scroll",t),ee.get(a)?.(),window.removeEventListener("resize",t))}}let en=new Map;function ei({source:e,container:t,...r}){var a;let n,i,{axis:s}=r;e&&(t=e);let o=en.get(t)??new Map;en.set(t,o);let l=r.target??"self",u=o.get(l)??{},c=s+(r.offset??[]).join(",");return u[c]||(u[c]=!r.target&&(0,A.supportsScrollTimeline)()?new ScrollTimeline({source:t,axis:s}):(a={container:t,...r},n={value:0},i=ea(e=>{n.value=100*e[a.axis].progress},a),{currentTime:n,cancel:i})),u[c]}var es=e.i(64317),eo=e.i(54887);let el=()=>({scrollX:(0,k.motionValue)(0),scrollY:(0,k.motionValue)(0),scrollXProgress:(0,k.motionValue)(0),scrollYProgress:(0,k.motionValue)(0)}),eu=e=>!!e&&!e.current;var ec=e.i(98619),ed=e.i(29805),ef=e.i(47158),ep=e.i(75157);let eh=({children:e,className:t,rotationFactor:r=.8,glareIntensity:a=1})=>{let n=(0,j.useRef)(!1),i=(0,j.useRef)(null),s=(0,j.useRef)(!0),o=(0,j.useRef)(null),l=(0,j.useRef)(null),u=(0,j.useRef)({glare:{x:50,y:50},background:{x:50,y:50},rotate:{x:0,y:0}});(0,j.useEffect)(()=>{let e=window.matchMedia("(hover: none), (pointer: coarse)").matches,t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;s.current=!e&&!t},[]),(0,j.useEffect)(()=>()=>{null!=l.current&&cancelAnimationFrame(l.current)},[]);let c=.4*a,d={"--step":`${5*a}%`,"--pattern":"linear-gradient(transparent, transparent)","--rainbow":`repeating-linear-gradient(0deg,rgb(var(--color-accent-soft-rgb)) calc(var(--step) * 1),rgb(var(--color-accent-rgb)) calc(var(--step) * 3),rgb(var(--color-accent-mid-rgb)) calc(var(--step) * 5),rgb(var(--color-accent-deep-rgb)) calc(var(--step) * 7)) 0% var(--bg-y)/${200*a}% ${700*a}% no-repeat`,"--diagonal":`repeating-linear-gradient(128deg,rgb(var(--color-surface-rgb)) 0%,rgb(var(--color-ink-muted-rgb)/0.65) 4.5%,rgb(var(--color-surface-rgb)) 10%,rgb(var(--color-surface-rgb)) 12%) var(--bg-x) var(--bg-y)/${300*a}% no-repeat`,"--shade":`radial-gradient(farthest-corner circle at var(--m-x) var(--m-y),rgb(var(--color-ink-rgb)/${.05*a}) 12%,rgb(var(--color-ink-rgb)/${.08*a}) 20%,rgb(var(--color-ink-rgb)/${.12*a}) 120%) var(--bg-x) var(--bg-y)/${300*a}% no-repeat`,backgroundBlendMode:"hue, hue, hue, overlay"},f=(0,j.useCallback)(()=>{l.current=null;let e=i.current;if(!e)return;let{background:t,rotate:r,glare:a}=u.current;e.style.setProperty("--m-x",`${a.x}%`),e.style.setProperty("--m-y",`${a.y}%`),e.style.setProperty("--r-x",`${r.x}deg`),e.style.setProperty("--r-y",`${r.y}deg`),e.style.setProperty("--bg-x",`${t.x}%`),e.style.setProperty("--bg-y",`${t.y}%`)},[]),p=(0,j.useCallback)(()=>{null==l.current&&(l.current=requestAnimationFrame(f))},[f]);return(0,w.jsx)("div",{style:{"--m-x":"50%","--m-y":"50%","--r-x":"0deg","--r-y":"0deg","--bg-x":"50%","--bg-y":"50%","--duration":"300ms","--foil-size":"100%","--opacity":"0","--radius":"48px","--easing":"ease","--transition":"var(--duration) var(--easing)"},className:"relative isolate [contain:layout_style] [perspective:600px] transition-transform duration-[var(--duration)] ease-[var(--easing)] delay-[var(--delay)] w-full h-full",ref:i,onPointerMove:e=>{if(!s.current)return;let t=o.current;if(!t||!t.width||!t.height)return;let n={x:100/t.width*(e.clientX-t.left),y:100/t.height*(e.clientY-t.top)},i={x:n.x-50,y:n.y-50},{background:l,rotate:c,glare:d}=u.current;l.x=50+n.x/4*a-12.5,l.y=50+n.y/3*a-16.67,c.x=-(i.x/3.5)*r,c.y=i.y/2*r,d.x=n.x,d.y=n.y,p()},onPointerEnter:e=>{if(!s.current)return;o.current=e.currentTarget.getBoundingClientRect(),n.current=!0;let t=i.current;t&&(t.style.setProperty("--opacity",c.toString()),window.setTimeout(()=>{n.current&&i.current&&i.current.style.setProperty("--duration","0s")},300))},onPointerLeave:()=>{if(!s.current)return;n.current=!1,o.current=null,null!=l.current&&(cancelAnimationFrame(l.current),l.current=null);let e=i.current;e&&(e.style.setProperty("--opacity","0"),e.style.removeProperty("--duration"),e.style.setProperty("--r-x","0deg"),e.style.setProperty("--r-y","0deg"))},children:(0,w.jsxs)("div",{className:"h-full grid origin-center transition-transform duration-[var(--duration)] ease-[var(--easing)] delay-[var(--delay)] [transform:rotateY(var(--r-x))_rotateX(var(--r-y))] rounded-[var(--radius)] border border-ink-muted hover:[--duration:200ms] hover:[--easing:linear] hover:filter-none overflow-hidden",children:[(0,w.jsx)("div",{className:"w-full h-full grid [grid-area:1/1] mix-blend-soft-light [clip-path:inset(0_0_0_0_round_var(--radius))]",children:(0,w.jsx)("div",{className:(0,ep.cn)("h-full w-full bg-ink-muted",t),children:e})}),(0,w.jsx)("div",{className:"w-full h-full grid [grid-area:1/1] mix-blend-soft-light [clip-path:inset(0_0_1px_0_round_var(--radius))] opacity-[var(--opacity)] transition-opacity duration-[var(--duration)] ease-[var(--easing)] delay-[var(--delay)] pointer-events-none",style:{background:`radial-gradient(farthest-corner circle at var(--m-x) var(--m-y),rgb(var(--color-ink-rgb)/${.3*a}) 10%,rgb(var(--color-ink-rgb)/${.2*a}) 20%,transparent 90%)`}}),(0,w.jsx)("div",{className:"w-full h-full grid [grid-area:1/1] mix-blend-color-dodge opacity-[var(--opacity)] transition-opacity [clip-path:inset(0_0_1px_0_round_var(--radius))] [background-blend-mode:hue_hue_hue_overlay] [background:var(--pattern),_var(--rainbow),_var(--diagonal),_var(--shade)] relative after:content-[''] after:grid-area-[inherit] after:bg-repeat-[inherit] after:bg-attachment-[inherit] after:bg-origin-[inherit] after:bg-clip-[inherit] after:bg-[inherit] after:mix-blend-exclusion after:[background-size:var(--foil-size),_200%_400%,_800%,_200%] after:[background-position:center,_0%_var(--bg-y),_c
1alc(var(--bg-x)*_-1)_calc(var(--bg-y)*_-1),_var(--bg-x)_var(--bg-y)] after:[background-blend-mode:soft-light,_hue,_hard-light] pointer-events-none",style:{...d}})]})})};var em=e.i(91696);let eg=({data:e})=>{let t=(0,j.useRef)(null),r=(0,j.useRef)(null),[a,n]=(0,j.useState)(0);(0,j.useEffect)(()=>{let e=()=>{t.current&&n(t.current.getBoundingClientRect().height)};e();let r=[setTimeout(e,100),setTimeout(e,500),setTimeout(e,1e3),setTimeout(e,2e3)],a=new ResizeObserver(e);return t.current&&a.observe(t.current),()=>{r.forEach(clearTimeout),a.disconnect()}},[e]);let{scrollYProgress:i}=function({container:e,target:t,...r}={}){let a=(0,es.useConstant)(el),n=(0,j.useRef)(null),i=(0,j.useRef)(!1),s=(0,j.useCallback)(()=>(n.current=function(e,{axis:t="y",container:r=document.scrollingElement,...a}={}){var n,i;let s;if(!r)return T.noop;let o={axis:t,container:r,...a};return"function"==typeof e?(n=e,i=o,2===n.length?ea(e=>{n(e[i.axis].progress,e)},i):I(n,ei(i))):(s=ei(o),e.attachTimeline({timeline:o.target?void 0:s,observe:e=>(e.pause(),I(t=>{e.time=e.iterationDuration*t},s))}))}((e,{x:t,y:r})=>{a.scrollX.set(t.current),a.scrollXProgress.set(t.progress),a.scrollY.set(r.current),a.scrollYProgress.set(r.progress)},{...r,container:e?.current||void 0,target:t?.current||void 0}),()=>{n.current?.()}),[e,t,JSON.stringify(r.offset)]);return(0,eo.useIsomorphicLayoutEffect)(()=>{if(i.current=!1,!(eu(e)||eu(t)))return s();i.current=!0},[s]),(0,j.useEffect)(()=>i.current?((0,E.invariant)(!eu(e),"Container ref is defined but not hydrated","use-scroll-ref"),(0,E.invariant)(!eu(t),"Target ref is defined but not hydrated","use-scroll-ref"),s()):void 0,[s]),a}({target:r,offset:["start 10%","end 80%"]}),s=(0,ef.useSpring)((0,ec.useTransform)(i,[0,.8],[50,a]),{stiffness:500,damping:90}),o=(0,ef.useSpring)((0,ec.useTransform)(i,[0,1],[50,a-200]),{stiffness:500,damping:90});return(0,w.jsx)("div",{className:"relative w-full",ref:r,children:(0,w.jsxs)("div",{ref:t,className:"relative max-w-7xl mx-auto pb-20",children:[e.map((e,t)=>(0,w.jsxs)("div",{id:e.id,style:{scrollMarginTop:100},className:"flex flex-col md:flex-row justify-start pt-8 sm:pt-10 md:pt-20 md:gap-10",children:[(0,w.jsxs)("div",{className:"hidden md:sticky md:flex flex-col md:flex-row z-40 items-center top-20 self-start max-w-xs lg:max-w-sm md:w-full",children:[(0,w.jsx)("div",{className:"h-10 absolute left-3 md:left-3 w-10 rounded-full bg-canvas-deep/40 border border-ink/10 flex items-center justify-center",children:(0,w.jsx)("div",{className:"h-4 w-4 rounded-full bg-ink/10 border border-ink/20"})}),(0,w.jsxs)("div",{className:"flex flex-col items-center md:items-start md:pl-20 space-y-4",children:[(0,w.jsx)("h3",{className:"hidden md:block text-xl md:text-2xl font-bold text-ink-secondary",children:e.title}),e.logo&&(0,w.jsx)("div",{className:"flex justify-center",children:(0,w.jsx)("div",{className:"relative",style:{width:"horizontal"===e.logo.aspectRatio?"160px":"vertical"===e.logo.aspectRatio?"100px":"120px",height:"horizontal"===e.logo.aspectRatio?"100px":"vertical"===e.logo.aspectRatio?"160px":"120px"},children:(0,w.jsx)(eh,{className:"w-full h-full bg-transparent border-ink/5",rotationFactor:1.4,glareIntensity:1.6,children:(0,w.jsxs)("div",{className:"w-full h-full flex items-center justify-center p-3",children:[e.logo.plate?(0,w.jsx)("div",{className:"absolute inset-0 rounded-[calc(var(--radius)-1px)]",style:{backgroundColor:`rgb(var(--color-ink-rgb) / ${e.logo.plate})`}}):null,(0,w.jsx)(em.default,{src:e.logo.src,alt:e.logo.alt,width:"horizontal"===e.logo.aspectRatio?140:"vertical"===e.logo.aspectRatio?80:100,height:"horizontal"===e.logo.aspectRatio?80:"vertical"===e.logo.aspectRatio?140:100,className:`relative z-10 max-h-full max-w-full object-contain transition-opacity duration-300 ${e.logo.plate?"opacity-100":"opacity-70 hover:opacity-90"}`})]})})})})]})]}),(0,w.jsxs)("div",{className:"md:hidden flex items-center gap-2 sm:gap-3 mb-4 pl-2 overflow-x-auto scrollbar-none",children:[(0,w.jsx)("div",{className:"h-8 w-8 rounded-full bg-canvas-deep/40 border border-ink/10 flex items-center justify-center flex-shrink-0",children:(0,w.jsx)("div",{className:"h-3 w-3 rounded-full bg-ink/10 border border-ink/20"})}),e.logo&&(0,w.jsx)("div",{className:"flex-shrink-0",children:(0,w.jsx)("div",{className:"relative",style:{width:"horizontal"===e.logo.aspectRatio?"70px":"vertical"===e.logo.aspectRatio?"45px":"55px",height:"horizontal"===e.logo.aspectRatio?"45px":"vertical"===e.logo.aspectRatio?"70px":"55px"},children:(0,w.jsx)(eh,{className:"w-full h-full bg-transparent border-ink/5",rotationFactor:1.4,glareIntensity:1.6,children:(0,w.jsxs)("div",{className:"w-full h-full flex items-center justify-center p-1.5",children:[e.logo.plate?(0,w.jsx)("div",{className:"absolute inset-0 rounded-[calc(var(--radius)-1px)]",style:{backgroundColor:`rgb(var(--color-ink-rgb) / ${e.logo.plate})`}}):null,(0,w.jsx)(em.default,{src:e.logo.src,alt:e.logo.alt,width:"horizontal"===e.logo.aspectRatio?60:"vertical"===e.logo.aspectRatio?35:45,height:"horizontal"===e.logo.aspectRatio?35:"vertical"===e.logo.aspectRatio?60:45,className:`relative z-10 max-h-full max-w-full object-contain transition-opacity duration-300 ${e.logo.plate?"opacity-100":"opacity-70 hover:opacity-90"}`})]})})})}),(0,w.jsx)("h3",{className:"text-sm sm:text-base md:text-lg font-bold text-ink-secondary whitespace-nowrap flex-shrink-0",children:e.title})]}),(0,w.jsx)("div",{className:"relative pl-2 pr-2 sm:pl-4 sm:pr-4 md:pl-4 w-full",children:e.content})]},t)),(0,w.jsx)("div",{className:"absolute md:left-3 left-3 top-3 hidden md:block",children:(0,w.jsxs)("svg",{viewBox:`0 0 40 ${a}`,width:"40",height:a,className:"block","aria-hidden":"true",children:[(0,w.jsx)(ed.motion.path,{d:`M 20 0 L 20 ${a}`,fill:"none",stroke:"var(--color-ink-muted)",strokeOpacity:"0.16",strokeWidth:"2",transition:{duration:10}}),(0,w.jsx)(ed.motion.path,{d:`M 20 0 L 20 ${a}
1`,fill:"none",stroke:"url(#gradient)",strokeWidth:"2",className:"motion-reduce:hidden",transition:{duration:10}}),(0,w.jsx)("defs",{children:(0,w.jsxs)(ed.motion.linearGradient,{id:"gradient",gradientUnits:"userSpaceOnUse",x1:"0",x2:"0",y1:s,y2:o,children:[(0,w.jsx)("stop",{stopColor:"var(--color-accent-soft)",stopOpacity:"0"}),(0,w.jsx)("stop",{stopColor:"var(--color-accent-soft)"}),(0,w.jsx)("stop",{offset:"0.325",stopColor:"var(--color-accent)"}),(0,w.jsx)("stop",{offset:"1",stopColor:"var(--color-accent-deep)",stopOpacity:"0"})]})})]})})]})})};var ey=e.i(94372);let ev=({items:e})=>{let[t,r]=(0,j.useState)(""),[a,n]=(0,j.useState)(!1),[i,s]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{let e=()=>{s(window.innerWidth<640)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,j.useEffect)(()=>{let a=()=>{let a=window.scrollY,i=window.innerHeight,s=document.documentElement.scrollHeight;n(a>800&&!(a+i>=s-200));let o=e.map(e=>document.getElementById(e.id)).filter(Boolean),l="";o.forEach(e=>{if(e){let t=e.getBoundingClientRect();t.top<=300&&t.bottom>=300&&(l=e.id)}}),l!==t&&r(l)};return a(),window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[e,t]),(0,w.jsx)(ed.motion.div,{initial:{opacity:0,y:100},animate:{opacity:+!!a,y:100*!a},transition:{duration:.4,ease:"easeOut"},className:`fixed bottom-[calc(1rem+env(safe-area-inset-bottom))] sm:bottom-8 left-0 right-0 z-40 flex justify-center px-2 ${a?"pointer-events-auto":"pointer-events-none"}`,children:(0,w.jsxs)("div",{className:"relative mx-auto max-w-[95vw]",children:[(0,w.jsx)("div",{className:"bg-canvas-deep/95 sm:bg-canvas-deep/60 border border-ink/10 rounded-full px-2 sm:px-4 py-2 sm:py-3 shadow-2xl overflow-x-auto scrollbar-none overflow-y-hidden",children:(0,w.jsx)("nav",{className:"flex items-center justify-center gap-1 sm:gap-2 md:gap-4 min-w-max",children:e.map(e=>{var r;let a=t===e.id;return(0,w.jsxs)(ed.motion.button,{onClick:()=>{var t;return t=e.id,void(0,ey.scrollToId)(t)},layout:!0,className:`relative flex items-center gap-1 sm:gap-2 rounded-full transition-all duration-300 ${a?"bg-ink/10 px-3 sm:px-3 py-1.5 sm:py-2":"hover:bg-ink/5 px-2 sm:px-3 py-1.5 sm:py-2"}`,whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",bounce:.2,duration:.4},children:[a&&(0,w.jsx)(ed.motion.div,{layoutId:"active-pill",className:"absolute inset-0 bg-ink/10 rounded-full border border-ink/20",transition:{type:"spring",bounce:.2,duration:.6}}),(0,w.jsx)("div",{className:`relative z-10 p-1 sm:p-1.5 rounded-md sm:rounded-lg flex-shrink-0 ${a?"bg-ink/10":"bg-ink/5"}`,children:e.icon}),(0,w.jsx)(ed.motion.div,{initial:!1,animate:{maxWidth:i?200*!!a:200,opacity:i?+!!a:1},transition:{duration:.3,ease:"easeInOut"},className:"relative z-10 overflow-hidden",children:(0,w.jsx)("span",{className:`text-xs sm:text-sm font-medium whitespace-nowrap block ${((e,t=!1)=>{if(!t)return"text-ink-tertiary hover:text-ink-secondary";switch(e){case"work":return"text-accent";case"education":case"skills":return"text-accent-soft";default:return"text-ink-primary"}})(e.type,a)}`,children:{Intero:"Intero",Viable:"Viable",Freelance:"Freelance",CBU:"CBU",Sapienza:"Sapienza","Technical Skills":"Skills"}[r=e.title]||r})})]},e.id)})})}),(0,w.jsx)("div",{className:"pointer-events-none absolute inset-x-4 -top-1 h-0.5 overflow-hidden rounded-full bg-ink/10",children:(0,w.jsx)(ed.motion.div,{className:"h-full bg-gradient-to-r from-accent-deep via-accent to-accent-soft",style:{width:`${(e.findIndex(e=>e.id===t)+1)/e.length*100}%`},transition:{duration:.3}})})]})})};var eb="vercel.ai.error",ex=Symbol.for(eb),e_=class e extends Error{constructor({name:e,message:t,cause:r}){super(t),this[f]=!0,this.name=e,this.cause=r}static isInstance(t){return e.hasMarker(t,eb)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}};f=ex;var ew=e_;function ek(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}Symbol.for("vercel.ai.error.AI_APICallError"),Symbol.for("vercel.ai.error.AI_EmptyResponseBodyError");var eE="AI_InvalidArgumentError",ej=`vercel.ai.error.${eE}`,eT=Symbol.for(ej),eS=class extends ew{constructor({message:e,cause:t,argument:r}){super({name:eE,message:e,cause:t}),this[p]=!0,this.argument=r}static isInstance(e){return ew.hasMarker(e,ej)}};p=eT,Symbol.for("vercel.ai.error.AI_InvalidPromptError"),Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var eI="AI_JSONParseError",eA=`vercel.ai.error.${eI}`,eN=Symbol.for(eA),eC=class extends ew{constructor({text:e,cause:t}){super({name:eI,message:`JSON parsing failed: Text: ${e}.
2Error message: ${ek(t)}`,cause:t}),this[h]=!0,this.text=e}static isInstance(e){return ew.hasMarker(e,eA)}};h=eN,Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),Symbol.for("vercel.ai.error.AI_LoadSettingError"),Symbol.for("vercel.ai.error.AI_NoContentGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchMo
2delError"),Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var eO="AI_TypeValidationError",eR=`vercel.ai.error.${eO}`,eM=Symbol.for(eR),eP=class e extends ew{constructor({value:e,cause:t}){super({name:eO,message:`Type validation failed: Value: ${JSON.stringify(e)}.
3Error message: ${ek(t)}`,cause:t}),this[m]=!0,this.value=e}static isInstance(e){return ew.hasMarker(e,eR)}static wrap({value:t,cause:r}){return e.isInstance(r)&&r.value===t?r:new e({value:t,cause:r})}};m=eM,Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");var eL=e.i(54471),eZ=(({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:a="-"}={})=>{let n=((e,t=21)=>(r=t)=>{let a="",n=0|r;for(;n--;)a+=e[Math.random()*e.length|0];return a})(r,t);if(null==e)return n;if(r.includes(a))throw new eS({argument:"separator",message:`The separator "${a}" must not be part of the alphabet "${r}".`});return t=>`${e}${a}${n(t)}`})(),e$=Symbol.for("vercel.ai.validator");function ez({text:e,schema:t}){try{let r=eL.default.parse(e);if(null==t)return{success:!0,value:r,rawValue:r};let a=function({value:e,schema:t}){var r;let a="object"==typeof t&&null!==t&&e$ in t&&!0===t[e$]&&"validate"in t?t:(r=t,{[e$]:!0,validate:e=>{let t=r.safeParse(e);return t.success?{success:!0,value:t.data}:{success:!1,error:t.error}}});try{if(null==a.validate)return{success:!0,value:e};let t=a.validate(e);if(t.success)return t;return{success:!1,error:eP.wrap({value:e,cause:t.error})}}catch(t){return{success:!1,error:eP.wrap({value:e,cause:t})}}}({value:r,schema:t});return a.success?{...a,rawValue:r}:a}catch(t){return{success:!1,error:eC.isInstance(t)?t:new eC({text:e,cause:t})}}}var{btoa:eF,atob:eB}=globalThis;let eD=Symbol("Let zodToJsonSchema decide on which parser to use");(u=g||(g={})).assertEqual=e=>e,u.assertIs=function(e){},u.assertNever=function(e){throw Error()},u.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},u.getValidEnumValues=e=>{let t=u.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let a of t)r[a]=e[a];return u.objectValues(r)},u.objectValues=e=>u.objectKeys(e).map(function(t){return e[t]}),u.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},u.find=(e,t)=>{for(let r of e)if(t(r))return r},u.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,u.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},u.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(y||(y={})).mergeShapes=(e,t)=>({...e,...t});let eU=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),eV=e=>{switch(typeof e){case"undefined":return eU.undefined;case"string":return eU.string;case"number":return isNaN(e)?eU.nan:eU.number;case"boolean":return eU.boolean;case"function":return eU.function;case"bigint":return eU.bigint;case"symbol":return eU.symbol;case"object":if(Array.isArray(e))return eU.array;if(null===e)return eU.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return eU.promise;if("u">typeof Map&&e instanceof Map)return eU.map;if("u">typeof Set&&e instanceof Set)return eU.set;if("u">typeof Date&&e instanceof Date)return eU.date;return eU.object;default:return eU.unknown}}
vendor: 5,758 bytes, line 3
3,eW=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class eq extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(a);else if("invalid_return_type"===n.code)a(n.returnTypeError);else if("invalid_arguments"===n.code)a(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,a=0;for(;a<n.path.length;){let r=n.path[a];a===n.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(n))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof eq))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,g.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}eq.create=e=>new eq(e);let eJ=(e,t)=>{let r;switch(e.code){case eW.invalid_type:r=e.received===eU.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case eW.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,g.jsonStringifyReplacer)}`;break;case eW.unrecognized_keys:r=`Unrecognized key(s) in object: ${g.joinValues(e.keys,", ")}`;break;case eW.invalid_union:r="Invalid input";break;case eW.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${g.joinValues(e.options)}`;break;case eW.invalid_enum_value:r=`Invalid enum value. Expected ${g.joinValues(e.options)}, received '${e.received}'`;break;case eW.invalid_arguments:r="Invalid function arguments";break;case eW.invalid_return_type:r="Invalid function return type";break;case eW.invalid_date:r="Invalid date";break;case eW.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:g.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case eW.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case eW.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case eW.custom:r="Invalid input";break;case eW.invalid_intersection_types:r="Intersection results could not be merged";break;case eW.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case eW.not_finite:r="Number must be finite";break;default:r=t.defaultError,g.assertNever(e)}return{message:r}},eK=e=>{let{data:t,path:r,errorMaps:a,issueData:n}=e,i=[...r,...n.path||[]],s={...n,path:i};if(void 0!==n.message)return{...n,path:i,message:n.message};let o="";for(let e of a.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...n,path:i,message:o}};function eY(e,t){let r=eK({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,eJ,void 0].filter(e=>!!e)});e.common.issues.push(r)}class eG{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if("aborted"===a.status)return eH;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,a=await e.value;r.push({key:t,value:a})}return eG.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:t,value:n}=a;if("aborted"===t.status||"aborted"===n.status)return eH;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||a.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}let eH=Object.freeze({status:"aborted"}),eX=e=>({status:"dirty",value:e}),eQ=e=>
3({status:"valid",value:e}),e0=e=>"u">typeof Promise&&e instanceof Promise;function e1(e,t,r,a){if("a"===r&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}function e2(e,t,r,a,n){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?n.call(e,r):n?n.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError,(c=v||(v={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},c.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class e5{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let e4=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new eq(e.common.issues);return this._error=t,this._error}}};function e3(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:n}=e;if(t&&(r||a))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var i,s;let{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!=(i=null!=o?o:a)?i:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!=(s=null!=o?o:r)?s:n.defaultError}},description:n}}class e9{get description(){return this._def.description}_getType(e){return eV(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:eV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eG,ctx:{common:e.parent.common,data:e.data,parsedType:eV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(e0(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let a={common:{issues:[],async:null!=(r=null==t?void 0:t.async)&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eV(e)},n=this._parseSync({data:e,path:a.path,parent:a});return e4(a,n)}"~validate"(e){var t,r;let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eV(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:a});return"valid"===t.status?{value:t.value}:{issues:a.common.issues}}catch(e){(null==(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>"valid"===e.status?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eV(e)},a=this._parse({data:e,path:r.path,parent:r});return e4(r,await (e0(a)?a:Promise.resolve(a)))}refine(e,t){return this._refinement((r,a)=>{let n=e(r),i=()=>a.addIssue({code:eW.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&n instanceof Promise?n.then(e=>!!e||(i(),!1)):!!n||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new tU({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return tV.create(this,this._def)}nullable(){return tW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tT.create(this)}promise(){return tD.create(this,this._def)}or(e){return tI.create([this,e],this._def)}and(e){return tC.create(this,e,this._def)}transform(e){return new tU({...e3(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new tq({...e3(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:_.ZodDefault})}brand(){return new tY({typeName:_.ZodBranded,type:this,...e3(this._def)})}catch(e){return new tJ({...e3(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:_.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return tG.create(this,e)}readonly(){return tH.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let e6=/^c[^\s-]{8,}
vendor: 7,247 bytes, line 3
3$/i,e8=/^[0-9a-z]+$/,e7=/^[0-9A-HJKMNP-TV-Z]{26}$/i,te=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tt=/^[a-z0-9_-]{21}$/i,tr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ta=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ti=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,to=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,td="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",tf=RegExp(`^${td}$`);function tp(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}class th extends e9{_parse(e){var t,r,n,i;let s;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==eU.string){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.string,received:t.parsedType}),eH}let o=new eG;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(eY(s=this._getOrReturnCtx(e,s),{code:eW.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(eY(s=this._getOrReturnCtx(e,s),{code:eW.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,r=e.data.length<l.value;(t||r)&&(s=this._getOrReturnCtx(e,s),t?eY(s,{code:eW.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):r&&eY(s,{code:eW.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)tn.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"email",code:eW.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)a||(a=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),a.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:eW.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)te.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:eW.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)tt.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"nanoid",code:eW.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)e6.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:eW.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)e8.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:eW.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)e7.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:eW.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch(t){eY(s=this._getOrReturnCtx(e,s),{validation:"url",code:eW.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"regex",code:eW.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${td}T${tp(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?tf.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${tp(l)}$`).test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{code:eW.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?ta.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"duration",code:eW.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,!(("v4"===(r=l.version)||!r)&&ti.test(t)||("v6"===r||!r)&&to.test(t))&&1&&(eY(s=this._getOrReturnCtx(e,s),{validation:"ip",code:eW.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!tr.test(e))return!1;try{let[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(a));if("object"!=typeof n||null===n||!n.typ||!n.alg||t&&n.alg!==t)return!1;return!0}catch(e){return!1}}(e.data,l.alg)&&(eY(s=this._getOrReturnCtx(e,s),{validation:"jwt",code:eW.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(n=e.data,!(("v4"===(i=l.version)||!i)&&ts.test(n)||("v6"===i||!i)&&tl.test(n))&&1&&
3(eY(s=this._getOrReturnCtx(e,s),{validation:"cidr",code:eW.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?tu.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"base64",code:eW.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?tc.test(e.data)||(eY(s=this._getOrReturnCtx(e,s),{validation:"base64url",code:eW.invalid_string,message:l.message}),o.dirty()):g.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:eW.invalid_string,...v.errToObj(r)})}_addCheck(e){return new th({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!=(t=null==e?void 0:e.offset)&&t,local:null!=(r=null==e?void 0:e.local)&&r,...v.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...v.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...v.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new th({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new th({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new th({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}th.create=e=>{var t;return new th({checks:[],typeName:_.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...e3(e)})};class tm extends e9{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==eU.number){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.number,received:t.parsedType}),eH}let r=new eG;for(let a of this._def.checks)"int"===a.kind?g.isInteger(e.data)||(eY(t=this._getOrReturnCtx(e,t),{code:eW.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,n=r>a?r:a;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}(e.data,a.value)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(eY(t=this._getOrReturnCtx(e,t),{code:eW.not_finite,message:a.message}),r.dirty()):g.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,r,a){return new tm({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:v.toString(a)}]})}_addCheck(e){return new tm({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}tm.create=e=>new tm({checks:[],typeName:_.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...e3(e)});class tg extends e9{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==eU.bigint)return this._getInvalidInput(e);let r=new eG;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):g.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.bigint,received:t.parsedType}),eH}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,r,a){return new tg({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:v.toString(a)}]})}_addCheck(e){return new tg({...this._def,checks:[...this._def.checks,e]})}
3positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}tg.create=e=>{var t;return new tg({checks:[],typeName:_.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...e3(e)})};class ty extends e9{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==eU.boolean){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.boolean,received:t.parsedType}),eH}return eQ(e.data)}}ty.create=e=>new ty({typeName:_.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...e3(e)});class tv extends e9{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==eU.date){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.date,received:t.parsedType}),eH}if(isNaN(e.data.getTime()))return eY(this._getOrReturnCtx(e),{code:eW.invalid_date}),eH;let r=new eG;for(let a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(eY(t=this._getOrReturnCtx(e,t),{code:eW.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):g.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tv({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}tv.create=e=>new tv({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:_.ZodDate,...e3(e)});class tb extends e9{_parse(e){if(this._getType(e)!==eU.symbol){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.symbol,received:t.parsedType}),eH}return eQ(e.data)}}tb.create=e=>new tb({typeName:_.ZodSymbol,...e3(e)});class tx extends e9{_parse(e){if(this._getType(e)!==eU.undefined){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.undefined,received:t.parsedType}),eH}return eQ(e.data)}}tx.create=e=>new tx({typeName:_.ZodUndefined,...e3(e)});class t_ extends e9{_parse(e){if(this._getType(e)!==eU.null){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.null,received:t.parsedType}),eH}return eQ(e.data)}}t_.create=e=>new t_({typeName:_.ZodNull,...e3(e)});class tw extends e9{constructor(){super(...arguments),this._any=!0}_parse(e){return eQ(e.data)}}tw.create=e=>new tw({typeName:_.ZodAny,...e3(e)});class tk extends e9{constructor(){super(...arguments),this._unknown=!0}_parse(e){return eQ(e.data)}}tk.create=e=>new tk({typeName:_.ZodUnknown,...e3(e)});class tE extends e9{_parse(e){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.never,received:t.parsedType}),eH}}tE.create=e=>new tE({typeName:_.ZodNever,...e3(e)});class tj extends e9{_parse(e){if(this._getType(e)!==eU.undefined){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.void,received:t.parsedType}),eH}return eQ(e.data)}}tj.create=e=>new tj({typeName:_.ZodVoid,...e3(e)});class tT extends e9{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==eU.array)return eY(t,{code:eW.invalid_type,expected:eU.array,received:t.parsedType}),eH;if(null!==a.exactLength){let e=t.data.length>
3a.exactLength.value,n=t.data.length<a.exactLength.value;(e||n)&&(eY(t,{code:e?eW.too_big:eW.too_small,minimum:n?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(eY(t,{code:eW.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(eY(t,{code:eW.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new e5(t,e,t.path,r)))).then(e=>eG.mergeArray(r,e));let n=[...t.data].map((e,r)=>a.type._parseSync(new e5(t,e,t.path,r)));return eG.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new tT({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new tT({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new tT({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}tT.create=(e,t)=>new tT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...e3(t)});class tS extends e9{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==eU.object){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.object,received:t.parsedType}),eH}let{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:n}=this._getCached(),i=[];if(!(this._def.catchall instanceof tE&&"strip"===this._def.unknownKeys))for(let e in r.data)n.includes(e)||i.push(e);let s=[];for(let e of n){let t=a[e],n=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new e5(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof tE){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(eY(r,{code:eW.unrecognized_keys,keys:i}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of i){let a=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new e5(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>eG.mergeObjectSync(t,e)):eG.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new tS({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,n,i,s;let o=null!=(i=null==(n=(a=this._def).errorMap)?void 0:n.call(a,t,r).message)?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!=(s=v.errToObj(e).message)?s:o}:{message:o}}}:{}})}strip(){return new tS({...this._def,unknownKeys:"strip"})}passthrough(){return new tS({...this._def,unknownKeys:"passthrough"})}extend(e){return new tS({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tS({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new tS({...this._def,catchall:e})}pick(e){let t={};return g.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new tS({...this._def,shape:()=>t})}omit(e){let t={};return g.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new tS({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof tS){let r={};for(let a in t.shape){let n=t.shape[a];r[a]=tV.create(e(n))}return new tS({...t._def,shape:()=>r})}if(t instanceof tT)return new tT({...t._def,type:e(t.element)});if(t instanceof tV)return tV.create(e(t.unwrap()));if(t instanceof tW)return tW.create(e(t.unwrap()));if(t instanceof tO)return tO.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};return g.objectKeys(this.shape).forEach(r=>{let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}),new tS({...this._def,shape:()=>t})}required(e){let t={};return g.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof tV;)e=e._def.innerType;t[r]=e}}),new tS({...this._def,shape:()=>t})}keyof(){return tz(g.objectKeys(this.shape))}}tS.create=(e,t)=>
3new tS({shape:()=>e,unknownKeys:"strip",catchall:tE.create(),typeName:_.ZodObject,...e3(t)}),tS.strictCreate=(e,t)=>new tS({shape:()=>e,unknownKeys:"strict",catchall:tE.create(),typeName:_.ZodObject,...e3(t)}),tS.lazycreate=(e,t)=>new tS({shape:e,unknownKeys:"strip",catchall:tE.create(),typeName:_.ZodObject,...e3(t)});class tI extends e9{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new eq(e.ctx.common.issues));return eY(t,{code:eW.invalid_union,unionErrors:r}),eH});{let e,a=[];for(let n of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=a.map(e=>new eq(e));return eY(t,{code:eW.invalid_union,unionErrors:n}),eH}}get options(){return this._def.options}}tI.create=(e,t)=>new tI({options:e,typeName:_.ZodUnion,...e3(t)});let tA=e=>{if(e instanceof tZ)return tA(e.schema);if(e instanceof tU)return tA(e.innerType());if(e instanceof t$)return[e.value];if(e instanceof tF)return e.options;if(e instanceof tB)return g.objectValues(e.enum);else if(e instanceof tq)return tA(e._def.innerType);else if(e instanceof tx)return[void 0];else if(e instanceof t_)return[null];else if(e instanceof tV)return[void 0,...tA(e.unwrap())];else if(e instanceof tW)return[null,...tA(e.unwrap())];else if(e instanceof tY)return tA(e.unwrap());else if(e instanceof tH)return tA(e.unwrap());else if(e instanceof tJ)return tA(e._def.innerType);else return[]};class tN extends e9{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eU.object)return eY(t,{code:eW.invalid_type,expected:eU.object,received:t.parsedType}),eH;let r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(eY(t,{code:eW.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),eH)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let r of t){let t=tA(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(a.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);a.set(n,r)}}return new tN({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...e3(r)})}}class tC extends e9{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if("aborted"===e.status||"aborted"===a.status)return eH;let n=function e(t,r){let a=eV(t),n=eV(r);if(t===r)return{valid:!0,data:t};if(a===eU.object&&n===eU.object){let a=g.objectKeys(r),n=g.objectKeys(t).filter(e=>-1!==a.indexOf(e)),i={...t,...r};for(let a of n){let n=e(t[a],r[a]);if(!n.valid)return{valid:!1};i[a]=n.data}return{valid:!0,data:i}}if(a===eU.array&&n===eU.array){if(t.length!==r.length)return{valid:!1};let a=[];for(let n=0;n<t.length;n++){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}if(a===eU.date&&n===eU.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,a.value);return n.valid?(("dirty"===e.status||"dirty"===a.status)&&t.dirty(),{status:t.value,value:n.data}):(eY(r,{code:eW.invalid_intersection_types}),eH)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}tC.create=(e,t,r)=>new tC({left:e,right:t,typeName:_.ZodIntersection,...e3(r)});class tO extends e9{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eU.array)return eY(r,{code:eW.invalid_type,expected:eU.array,received:r.parsedType}),eH;if(r.data.length<this._def.items.length)return eY(r,{code:eW.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),eH;!this._def.rest&&r.data.length>this._def.items.length&&(eY(r,{code:eW.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((e,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new e5(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>eG.mergeArray(t,e)):eG.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new tO({...this._def,rest:e})}}tO.create=(e,t)=>
3{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tO({items:e,typeName:_.ZodTuple,rest:null,...e3(t)})};class tR extends e9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eU.object)return eY(r,{code:eW.invalid_type,expected:eU.object,received:r.parsedType}),eH;let a=[],n=this._def.keyType,i=this._def.valueType;for(let e in r.data)a.push({key:n._parse(new e5(r,e,r.path,e)),value:i._parse(new e5(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?eG.mergeObjectAsync(t,a):eG.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new tR(t instanceof e9?{keyType:e,valueType:t,typeName:_.ZodRecord,...e3(r)}:{keyType:th.create(),valueType:e,typeName:_.ZodRecord,...e3(t)})}}class tM extends e9{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eU.map)return eY(r,{code:eW.invalid_type,expected:eU.map,received:r.parsedType}),eH;let a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new e5(r,e,r.path,[i,"key"])),value:n._parse(new e5(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of i){let a=await r.key,n=await r.value;if("aborted"===a.status||"aborted"===n.status)return eH;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of i){let a=r.key,n=r.value;if("aborted"===a.status||"aborted"===n.status)return eH;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}}}tM.create=(e,t,r)=>new tM({valueType:t,keyType:e,typeName:_.ZodMap,...e3(r)});class tP extends e9{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eU.set)return eY(r,{code:eW.invalid_type,expected:eU.set,received:r.parsedType}),eH;let a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(eY(r,{code:eW.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(eY(r,{code:eW.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let n=this._def.valueType;function i(e){let r=new Set;for(let a of e){if("aborted"===a.status)return eH;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>n._parse(new e5(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(e,t){return new tP({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new tP({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tP.create=(e,t)=>new tP({valueType:e,minSize:null,maxSize:null,typeName:_.ZodSet,...e3(t)});class tL extends e9{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eU.function)return eY(t,{code:eW.invalid_type,expected:eU.function,received:t.parsedType}),eH;function r(e,r){return eK({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eJ,eJ].filter(e=>!!e),issueData:{code:eW.invalid_arguments,argumentsError:r}})}function a(e,r){return eK({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eJ,eJ].filter(e=>!!e),issueData:{code:eW.invalid_return_type,returnTypeError:r}})}let n={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof tD){let e=this;return eQ(async function(...t){let s=new eq([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw s.addIssue(r(t,e)),s}),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch(e=>{throw s.addIssue(a(l,e)),s})})}{let e=this;return eQ(function(...t){let s=e._def.args.safeParse(t,n);if(!s.success)throw new eq([r(t,s.error)]);let o=Reflect.apply(i,this,s.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new eq([a(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new tL({...this._def,args:tO.create(e).rest(tk.create())})}returns(e){return new tL({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new tL({args:e||tO.create([]).rest(tk.create()),returns:t||tk.create(),typeName:_.ZodFunction,...e3(r)})}}class tZ extends e9{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}tZ.create=(e,t)=>
3new tZ({getter:e,typeName:_.ZodLazy,...e3(t)});class t$ extends e9{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return eY(t,{received:t.data,code:eW.invalid_literal,expected:this._def.value}),eH}return{status:"valid",value:e.data}}get value(){return this._def.value}}function tz(e,t){return new tF({values:e,typeName:_.ZodEnum,...e3(t)})}t$.create=(e,t)=>new t$({value:e,typeName:_.ZodLiteral,...e3(t)});class tF extends e9{constructor(){super(...arguments),b.set(this,void 0)}_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return eY(t,{expected:g.joinValues(r),received:t.parsedType,code:eW.invalid_type}),eH}if(e1(this,b,"f")||e2(this,b,new Set(this._def.values),"f"),!e1(this,b,"f").has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return eY(t,{received:t.data,code:eW.invalid_enum_value,options:r}),eH}return eQ(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return tF.create(e,{...this._def,...t})}exclude(e,t=this._def){return tF.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}b=new WeakMap,tF.create=tz;class tB extends e9{constructor(){super(...arguments),x.set(this,void 0)}_parse(e){let t=g.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==eU.string&&r.parsedType!==eU.number){let e=g.objectValues(t);return eY(r,{expected:g.joinValues(e),received:r.parsedType,code:eW.invalid_type}),eH}if(e1(this,x,"f")||e2(this,x,new Set(g.getValidEnumValues(this._def.values)),"f"),!e1(this,x,"f").has(e.data)){let e=g.objectValues(t);return eY(r,{received:r.data,code:eW.invalid_enum_value,options:e}),eH}return eQ(e.data)}get enum(){return this._def.values}}x=new WeakMap,tB.create=(e,t)=>new tB({values:e,typeName:_.ZodNativeEnum,...e3(t)});class tD extends e9{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==eU.promise&&!1===t.common.async?(eY(t,{code:eW.invalid_type,expected:eU.promise,received:t.parsedType}),eH):eQ((t.parsedType===eU.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}tD.create=(e,t)=>new tD({type:e,typeName:_.ZodPromise,...e3(t)});class tU extends e9{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:e=>{eY(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===a.type){let e=a.transform(r.data,n);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return eH;let a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?eH:"dirty"===a.status||"dirty"===t.value?eX(a.value):a});{if("aborted"===t.value)return eH;let a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?eH:"dirty"===a.status||"dirty"===t.value?eX(a.value):a}}if("refinement"===a.type){let e=e=>{let t=a.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?eH:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?eH:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}}if("transform"===a.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?e:Promise.resolve(a.transform(e.value,n)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return e;let i=a.transform(e.value,n);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}g.assertNever(a)}}tU.create=(e,t,r)=>new tU({schema:e,typeName:_.ZodEffects,effect:t,...e3(r)}),tU.createWithPreprocess=(e,t,r)=>new tU({schema:t,effect:{type:"preprocess",transform:e},typeName:_.ZodEffects,...e3(r)});class tV extends e9{_parse(e){return this._getType(e)===eU.undefined?eQ(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tV.create=(e,t)=>
3new tV({innerType:e,typeName:_.ZodOptional,...e3(t)});class tW extends e9{_parse(e){return this._getType(e)===eU.null?eQ(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tW.create=(e,t)=>new tW({innerType:e,typeName:_.ZodNullable,...e3(t)});class tq extends e9{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===eU.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}tq.create=(e,t)=>new tq({innerType:e,typeName:_.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...e3(t)});class tJ extends e9{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return e0(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new eq(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new eq(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}tJ.create=(e,t)=>new tJ({innerType:e,typeName:_.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...e3(t)});class tK extends e9{_parse(e){if(this._getType(e)!==eU.nan){let t=this._getOrReturnCtx(e);return eY(t,{code:eW.invalid_type,expected:eU.nan,received:t.parsedType}),eH}return{status:"valid",value:e.data}}}tK.create=e=>new tK({typeName:_.ZodNaN,...e3(e)}),Symbol("zod_brand");class tY extends e9{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class tG extends e9{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eH:"dirty"===e.status?(t.dirty(),eX(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eH:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new tG({in:e,out:t,typeName:_.ZodPipeline})}}class tH extends e9{_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return e0(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function tX(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function tQ(e,t,r,a,n){e[t]=r,tX(e,t,a,n)}function t0(e,t){return rd(e.type._def,t)}tH.create=(e,t)=>new tH({innerType:e,typeName:_.ZodReadonly,...e3(t)}),tS.lazycreate,(d=_||(_={})).ZodString="ZodString",d.ZodNumber="ZodNumber",d.ZodNaN="ZodNaN",d.ZodBigInt="ZodBigInt",d.ZodBoolean="ZodBoolean",d.ZodDate="ZodDate",d.ZodSymbol="ZodSymbol",d.ZodUndefined="ZodUndefined",d.ZodNull="ZodNull",d.ZodAny="ZodAny",d.ZodUnknown="ZodUnknown",d.ZodNever="ZodNever",d.ZodVoid="ZodVoid",d.ZodArray="ZodArray",d.ZodObject="ZodObject",d.ZodUnion="ZodUnion",d.ZodDiscriminatedUnion="ZodDiscriminatedUnion",d.ZodIntersection="ZodIntersection",d.ZodTuple="ZodTuple",d.ZodRecord="ZodRecord",d.ZodMap="ZodMap",d.ZodSet="ZodSet",d.ZodFunction="ZodFunction",d.ZodLazy="ZodLazy",d.ZodLiteral="ZodLiteral",d.ZodEnum="ZodEnum",d.ZodEffects="ZodEffects",d.ZodNativeEnum="ZodNativeEnum",d.ZodOptional="ZodOptional",d.ZodNullable="ZodNullable",d.ZodDefault="ZodDefault",d.ZodCatch="ZodCatch",d.ZodPromise="ZodPromise",d.ZodBranded="ZodBranded",d.ZodPipeline="ZodPipeline",d.ZodReadonly="ZodReadonly",th.create,tm.create,tK.create,tg.create,ty.create,tv.create,tb.create,tx.create,t_.create,tw.create,tk.create,tE.create,tj.create,tT.create,tS.create,tS.strictCreate,tI.create,tN.create,tC.create,tO.create,tR.create,tM.create,tP.create,tL.create,tZ.create,t$.create,tF.create,tB.create,tD.create,tU.create,tV.create,tW.create,tU.createWithPreprocess,tG.create;let t1=/^[cC][^\s-]{8,}
3$/,t2=/^[0-9a-z]+$/,t5=/^[0-9A-HJKMNP-TV-Z]{26}$/,t4=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,t3=()=>(void 0===n&&(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n),t9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,t6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,t8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,t7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,re=/^[a-zA-Z0-9_-]{21}$/,rt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function rr(e,t){let r={type:"string"};if(e.checks)for(let a of e.checks)switch(a.kind){case"min":tQ(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t);break;case"max":tQ(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ri(r,"email",a.message,t);break;case"format:idn-email":ri(r,"idn-email",a.message,t);break;case"pattern:zod":rs(r,t4,a.message,t)}break;case"url":ri(r,"uri",a.message,t);break;case"uuid":ri(r,"uuid",a.message,t);break;case"regex":rs(r,a.regex,a.message,t);break;case"cuid":rs(r,t1,a.message,t);break;case"cuid2":rs(r,t2,a.message,t);break;case"startsWith":rs(r,RegExp(`^${ra(a.value,t)}`),a.message,t);break;case"endsWith":rs(r,RegExp(`${ra(a.value,t)}$`),a.message,t);break;case"datetime":ri(r,"date-time",a.message,t);break;case"date":ri(r,"date",a.message,t);break;case"time":ri(r,"time",a.message,t);break;case"duration":ri(r,"duration",a.message,t);break;case"length":tQ(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t),tQ(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"includes":rs(r,RegExp(ra(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&ri(r,"ipv4",a.message,t),"v4"!==a.version&&ri(r,"ipv6",a.message,t);break;case"base64url":rs(r,t7,a.message,t);break;case"jwt":rs(r,rt,a.message,t);break;case"cidr":"v6"!==a.version&&rs(r,t9,a.message,t),"v4"!==a.version&&rs(r,t6,a.message,t);break;case"emoji":rs(r,t3(),a.message,t);break;case"ulid":rs(r,t5,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":ri(r,"binary",a.message,t);break;case"contentEncoding:base64":tQ(r,"contentEncoding","base64",a.message,t);break;case"pattern:zod":rs(r,t8,a.message,t)}break;case"nanoid":rs(r,re,a.message,t)}return r}function ra(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)rn.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}let rn=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ri(e,t,r,a){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):tQ(e,"format",t,r,a)}function rs(e,t,r,a){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:ro(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):tQ(e,"pattern",ro(t,a),r,a)}
3function ro(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=r.i?e.source.toLowerCase():e.source,n="",i=!1,s=!1,o=!1;for(let e=0;e<a.length;e++){if(i){n+=a[e],i=!1;continue}if(r.i){if(s){if(a[e].match(/[a-z]/)){o?(n+=a[e],n+=`${a[e-2]}-${a[e]}`.toUpperCase(),o=!1):"-"===a[e+1]&&a[e+2]?.match(/[a-z]/)?(n+=a[e],o=!0):n+=`${a[e]}${a[e].toUpperCase()}`;continue}}else if(a[e].match(/[a-z]/)){n+=`[${a[e]}${a[e].toUpperCase()}]`;continue}}if(r.m){if("^"===a[e]){n+=`(^|(?<=[\r
4]))`;continue}else if("$"===a[e]){n+=`($|(?=[\r
5]))`;continue}}if(r.s&&"."===a[e]){n+=s?`${a[e]}\r
6`:`[${a[e]}\r
7]`;continue}n+=a[e],"\\"===a[e]?i=!0:s&&"]"===a[e]?s=!1:s||"["!==a[e]||(s=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function rl(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===_.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,a)=>({...r,[a]:rd(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??{}}),{}),additionalProperties:!1};let r={type:"object",additionalProperties:rd(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===_.ZodString&&e.keyType._def.checks?.length){let{type:a,...n}=rr(e.keyType._def,t);return{...r,propertyNames:n}}if(e.keyType?._def.typeName===_.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===_.ZodBranded&&e.keyType._def.type._def.typeName===_.ZodString&&e.keyType._def.type._def.checks?.length){let{type:a,...n}=t0(e.keyType._def,t);return{...r,propertyNames:n}}return r}let ru={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},rc=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>rd(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function rd(e,t,r=!1){let a=t.seen.get(e);if(t.override){let n=t.override?.(e,t,a,r);if(n!==eD)return n}if(a&&!r){let e=rf(a,t);if(void 0!==e)return e}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let i=((e,t,r)=>{switch(t){case _.ZodString:return rr(e,r);case _.ZodNumber:let a={type:"number"};if(!e.checks)return a;for(let t of e.checks)switch(t.kind){case"int":a.type="integer",tX(a,"type",t.message,r);break;case"min":"jsonSchema7"===r.target?t.inclusive?tQ(a,"minimum",t.value,t.message,r):tQ(a,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(a.exclusiveMinimum=!0),tQ(a,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?tQ(a,"maximum",t.value,t.message,r):tQ(a,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(a.exclusiveMaximum=!0),tQ(a,"maximum",t.value,t.message,r));break;case"multipleOf":tQ(a,"multipleOf",t.value,t.message,r)}return a;case _.ZodObject:let n,i;return n="openAi"===r.target,(i={type:"object",...Object.entries(e.shape()).reduce((e,[t,a])=>{if(void 0===a||void 0===a._def)return e;let i=a.isOptional();i&&n&&(a instanceof tV&&(a=a._def.innerType),a.isNullable()||(a=a.nullable()),i=!1);let s=rd(a._def,{...r,currentPath:[...r.currentPath,"properties",t],propertyPath:[...r.currentPath,"properties",t]});return void 0===s?e:{properties:{...e.properties,[t]:s},required:i?e.required:[...e.required,t]}},{properties:{},required:[]}),additionalProperties:"strict"===r.removeAdditionalStrategy?"ZodNever"===e.catchall._def.typeName?"strict"!==e.unknownKeys:rd(e.catchall._def,{...r,currentPath:[...r.currentPath,"additionalProperties"]})??!0:"ZodNever"===e.catchall._def.typeName?"passthrough"===e.unknownKeys:rd(e.catchall._def,{...r,currentPath:[...r.currentPath,"additionalProperties"]})??!0}).required.length||delete i.required,i;case _.ZodBigInt:let s={type:"integer",format:"int64"};if(!e.checks)return s;for(let t of e.checks)switch(t.kind){case"min":"jsonSchema7"===r.target?t.inclusive?tQ(s,"minimum",t.value,t.message,r):tQ(s,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(s.exclusiveMinimum=!0),tQ(s,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?tQ(s,"maximum",t.value,t.message,r):tQ(s,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(s.exclusiveMaximum=!0),tQ(s,"maximum",t.value,t.message,r));break;case"multipleOf":tQ(s,"multipleOf",t.value,t.message,r)}return s;case _.ZodBoolean:return{type:"boolean"};case _.ZodDate:return function e(t,r,a){let n=a??r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((a,n)=>e(t,r,a))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var i=t,s=r;let o={type:"integer",format:"unix-time"};if("openApi3"===s.target)return o;for(let e of i.checks)switch(e.kind){case"min":tQ(o,"minimum",e.value,e.message,s);break;case"max":tQ(o,"maximum",e.value,e.message,s)}return o}}(e,r);case _.ZodUndefined:return{not:{}};case _.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case _.ZodArray:let o;return o={type:"array"},e.type?._def&&e.type?._def?.typeName!==_.ZodAny&&(o.items=rd(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})),e.minLength&&tQ(o,"minItems",e.minLength.value,e.minLength.message,r),e.maxLength&&tQ(o,"maxItems",e.maxLength.value,e.maxLength.message,r),e.exactLength&&(tQ(o,"minItems",e.exactLength.value,e.exactLength.message,r),tQ(o,"maxItems",e.exactLength.value,e.exactLength.message,r)),o;case _.ZodUnion:case _.ZodDiscriminatedUnion:if("openApi3"===r.target)return rc(e,r);let l=e.options instanceof Map?Array.from(e.options.values()):e.options;if(l.every(e=>e._def.typeName in ru&&(!e._def.checks||!e._def.checks.length))){let e=l.reduce((e,t)=>
7{let r=ru[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(l.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=l.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===l.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:l.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(l.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:l.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return rc(e,r);case _.ZodIntersection:let u,c,d;return u=[rd(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),rd(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(e=>!!e),c="jsonSchema2019-09"===r.target?{unevaluatedProperties:!1}:void 0,d=[],u.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)d.push(...e.allOf),void 0===e.unevaluatedProperties&&(c=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...a}=e;t=a}else c=void 0;d.push(t)}}),d.length?{allOf:d,...c}:void 0;case _.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>rd(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:rd(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>rd(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case _.ZodRecord:return rl(e,r);case _.ZodLiteral:let f;return"bigint"!=(f=typeof e.value)&&"number"!==f&&"boolean"!==f&&"string"!==f?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===r.target?{type:"bigint"===f?"integer":f,enum:[e.value]}:{type:"bigint"===f?"integer":f,const:e.value};case _.ZodEnum:return{type:"string",enum:Array.from(e.values)};case _.ZodNativeEnum:let p,h,m;return p=e.values,{type:1===(m=Array.from(new Set((h=Object.keys(e.values).filter(e=>"number"!=typeof p[p[e]]).map(e=>p[e])).map(e=>typeof e)))).length?"string"===m[0]?"string":"number":["string","number"],enum:h};case _.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===r.target?{type:ru[e.innerType._def.typeName],nullable:!0}:{type:[ru[e.innerType._def.typeName],"null"]};if("openApi3"===r.target){let t=rd(e.innerType._def,{...r,currentPath:[...r.currentPath]});return t&&"$ref"in t?{allOf:[t],nullable:!0}:t&&{...t,nullable:!0}}let g=rd(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return g&&{anyOf:[g,{type:"null"}]};case _.ZodOptional:if(r.currentPath.toString()===r.propertyPath?.toString())return rd(e.innerType._def,r);let y=rd(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return y?{anyOf:[{not:{}},y]}:{};case _.ZodMap:if("record"===r.mapStrategy)return rl(e,r);return{type:"array",maxItems:125,items:{type:"array",items:[rd(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||{},rd(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case _.ZodSet:let v;return v={type:"array",uniqueItems:!0,items:rd(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})},e.minSize&&tQ(v,"minItems",e.minSize.value,e.minSize.message,r),e.maxSize&&tQ(v,"maxItems",e.maxSize.value,e.maxSize.message,r),v;case _.ZodLazy:return()=>e.getter()._def;case _.ZodPromise:return rd(e.type._def,r);case _.ZodNaN:case _.ZodNever:return{not:{}};case _.ZodEffects:return"input"===r.effectStrategy?rd(e.schema._def,r):{};case _.ZodAny:case _.ZodUnknown:return{};case _.ZodDefault:return{...rd(e.innerType._def,r),default:e.defaultValue()};case _.ZodBranded:return t0(e,r);case _.ZodReadonly:case _.ZodCatch:return rd(e.innerType._def,r);case _.ZodPipeline:if("input"===r.pipeStrategy)return rd(e.in._def,r);if("output"===r.pipeStrategy)return rd(e.out._def,r);let b=rd(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),x=rd(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",b?"1":"0"]});return{allOf:[b,x].filter(e=>void 0!==e)};case _.ZodFunction:case _.ZodVoid:case _.ZodSymbol:default:return}})(e,e.typeName,t),s="function"==typeof i?rd(i(),t):i;return s&&rh(e,t,s),n.jsonSchema=s,s}let rf=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:rp(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},rp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},rh=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var rm={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},rg={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},ry={code:"4",name:"assistant_message",parse:e=>{if(null==e||"object"!=typeof e||!("id"in e)||!("role"in e)||!("content"in e)||"string"!=typeof e.id||"string"!=typeof e.role||"assistant"!==e.role||!Array.isArray(e.content)||!e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))throw Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},rv={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},rb={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},rx=[rm,rg,ry,rv,rb];rm.code,rg.code,ry.code,rv.code,rb.code,rm.name,rm.code,rg.name,rg.code,ry.name,ry.code,rv.name,rv.code,rb.name,rb.code,rx.map(e=>e.code);var r_=[{code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},{code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw Error('"data" parts expect an array value.');return{type:"data",value:e}}},{code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},{code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},{code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},{code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},{code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},{code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},{code:"d",name:"finish_message",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),{type:"finish_message",value:t}}}
7,{code:"e",name:"finish_step",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),"isContinued"in e&&"boolean"==typeof e.isContinued&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},{code:"f",name:"start_step",parse:e=>{if(null==e||"object"!=typeof e||!("messageId"in e)||"string"!=typeof e.messageId)throw Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},{code:"g",name:"reasoning",parse:e=>{if("string"!=typeof e)throw Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},{code:"h",name:"source",parse:e=>{if(null==e||"object"!=typeof e)throw Error('"source" parts expect a Source object.');return{type:"source",value:e}}},{code:"i",name:"redacted_reasoning",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data)throw Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},{code:"j",name:"reasoning_signature",parse:e=>{if(null==e||"object"!=typeof e||!("signature"in e)||"string"!=typeof e.signature)throw Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},{code:"k",name:"file",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data||!("mimeType"in e)||"string"!=typeof e.mimeType)throw Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}}],rw=Object.fromEntries(r_.map(e=>[e.code,e]));Object.fromEntries(r_.map(e=>[e.name,e.code]));var rk=r_.map(e=>e.code),rE=e=>{let t=e.indexOf(":");if(-1===t)throw Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!rk.includes(r))throw Error(`Failed to parse stream string. Invalid code ${r}.`);let a=JSON.parse(e.slice(t+1));return rw[r].parse(a)};async function rj({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:a,onRedactedReasoningPart:n,onSourcePart:i,onFilePart:s,onDataPart:o,onErrorPart:l,onToolCallStreamingStartPart:u,onToolCallDeltaPart:c,onToolCallPart:d,onToolResultPart:f,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:g}){let y=e.getReader(),v=new TextDecoder,b=[],x=0;for(;;){let{value:e}=await y.read();if(e&&(b.push(e),x+=e.length,10!==e[e.length-1]))continue;if(0===b.length)break;let _=function(e,t){let r=new Uint8Array(t),a=0;for(let t of e)r.set(t,a),a+=t.length;return e.length=0,r}(b,x);for(let{type:e,value:y}of(x=0,v.decode(_,{stream:!0}).split("\n").filter(e=>""!==e).map(rE)))switch(e){case"text":await (null==t?void 0:t(y));break;case"reasoning":await (null==r?void 0:r(y));break;case"reasoning_signature":await (null==a?void 0:a(y));break;case"redacted_reasoning":await (null==n?void 0:n(y));break;case"file":await (null==s?void 0:s(y));break;case"source":await (null==i?void 0:i(y));break;case"data":await (null==o?void 0:o(y));break;case"error":await (null==l?void 0:l(y));break;case"message_annotations":await (null==p?void 0:p(y));break;case"tool_call_streaming_start":await (null==u?void 0:u(y));break;case"tool_call_delta":await (null==c?void 0:c(y));break;case"tool_call":await (null==d?void 0:d(y));break;case"tool_result":await (null==f?void 0:f(y));break;case"finish_message":await (null==h?void 0:h(y));break;case"finish_step":await (null==m?void 0:m(y));break;case"start_step":await (null==g?void 0:g(y));break;default:throw Error(`Unknown stream part type: ${e}`)}}}async function rT({stream:e,update:t,onToolCall:r,onFinish:a,generateId:n=eZ,getCurrentDate:i=()=>new Date,lastMessage:s}){var o,l;let u,c,d,f=(null==s?void 0:s.role)==="assistant",p=f?1+(null!=(l=null==(o=s.toolInvocations)?void 0:o.reduce((e,t)=>
7{var r;return Math.max(e,null!=(r=t.step)?r:0)},0))?l:0):0,h=f?structuredClone(s):{id:n(),createdAt:i(),role:"assistant",content:"",parts:[]};function m(e,t){let r=h.parts.find(t=>"tool-invocation"===t.type&&t.toolInvocation.toolCallId===e);null!=r?r.toolInvocation=t:h.parts.push({type:"tool-invocation",toolInvocation:t})}let g=[],y=f?null==s?void 0:s.annotations:void 0,v={},b={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},x="unknown";function _(){let e=[...g];(null==y?void 0:y.length)&&(h.annotations=y),t({message:{...structuredClone(h),revisionId:n()},data:e,replaceLastMessage:f})}await rj({stream:e,onTextPart(e){null==u?(u={type:"text",text:e},h.parts.push(u)):u.text+=e,h.content+=e,_()},onReasoningPart(e){var t;null==d?(d={type:"text",text:e},null!=c&&c.details.push(d)):d.text+=e,null==c?(c={type:"reasoning",reasoning:e,details:[d]},h.parts.push(c)):c.reasoning+=e,h.reasoning=(null!=(t=h.reasoning)?t:"")+e,_()},onReasoningSignaturePart(e){null!=d&&(d.signature=e.signature)},onRedactedReasoningPart(e){null==c&&(c={type:"reasoning",reasoning:"",details:[]},h.parts.push(c)),c.details.push({type:"redacted",data:e.data}),d=void 0,_()},onFilePart(e){h.parts.push({type:"file",mimeType:e.mimeType,data:e.data}),_()},onSourcePart(e){h.parts.push({type:"source",source:e}),_()},onToolCallStreamingStartPart(e){null==h.toolInvocations&&(h.toolInvocations=[]),v[e.toolCallId]={text:"",step:p,toolName:e.toolName,index:h.toolInvocations.length};let t={state:"partial-call",step:p,toolCallId:e.toolCallId,toolName:e.toolName,args:void 0};h.toolInvocations.push(t),m(e.toolCallId,t),_()},onToolCallDeltaPart(e){let t=v[e.toolCallId];t.text+=e.argsTextDelta;let{value:r}=function(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=ez({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=ez({text:function(e){let t=["ROOT"],r=-1,a=null;function n(e,n,i){switch(e){case'"':r=n,t.pop(),t.push(i),t.push("INSIDE_STRING");break;case"f":case"t":case"n":r=n,a=n,t.pop(),t.push(i),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=n,t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"{":r=n,t.pop(),t.push(i),t.push("INSIDE_OBJECT_START");break;case"[":r=n,t.pop(),t.push(i),t.push("INSIDE_ARRAY_START")}}function i(e,a){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=a,t.pop()}}function s(e,a){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=a,t.pop()}}for(let o=0;o<e.length;o++){let l=e[o];switch(t[t.length-1]){case"ROOT":n(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":r=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":n(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),r=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:r=o}break;case"INSIDE_ARRAY_START":"]"===l?(r=o,t.pop()):(r=o,n(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=o,t.pop();break;default:r=o}break;case"INSIDE_ARRAY_AFTER_COMMA":n(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),r=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{let n=e.substring(a,o+1);"false".startsWith(n)||"true".startsWith(n)||"null".startsWith(n)?r=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?i(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(l,o))}}}let o=e.slice(0,r+1);for(let r=t.length-1;r>=0;r--)switch(t[r]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{let t=e.substring(a,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}(t.text),a={state:"partial-call",step:t.step,toolCallId:e.toolCallId,toolName:t.toolName,args:r};h.toolInvocations[t.index]=a,m(e.toolCallId,a),_()},async onToolCallPart(e){let t={state:"call",step:p,...e};if(null!=v[e.toolCallId]?h.toolInvocations[v[e.toolCallId].index]=t:(null==h.toolInvocations&&(h.toolInvocations=[]),h.toolInvocations.push(t)),m(e.toolCallId,t),_(),r){let t=await r({toolCall:e});if(null!=t){let r={state:"result",step:p,...e,result:t};h.toolInvocations[h.toolInvocations.length-1]=r,m(e.toolCallId,r),_()}}},onToolResultPart(e){let t=h.toolInvocations;if(null==t)throw Error("tool_result must be preceded by a tool_call");let r=t.findIndex(t=>t.toolCallId===e.toolCallId);if(-1===r)throw Error("tool_result must be preceded by a tool_call with the same toolCallId");let a={...t[r],state:"result",...e};t[r]=a,m(e.toolCallId,a),_()}
7,onDataPart(e){g.push(...e),_()},onMessageAnnotationsPart(e){null==y?y=[...e]:y.push(...e),_()},onFinishStepPart(e){p+=1,u=e.isContinued?u:void 0,c=void 0,d=void 0},onStartStepPart(e){f||(h.id=e.messageId),h.parts.push({type:"step-start"}),_()},onFinishMessagePart(e){x=e.finishReason,null!=e.usage&&(b=function({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}(e.usage))},onErrorPart(e){throw Error(e)}}),null==a||a({message:h,finishReason:x,usage:b})}async function rS({stream:e,onTextPart:t}){let r=e.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:e,value:a}=await r.read();if(e)break;await t(a)}}async function rI({stream:e,update:t,onFinish:r,getCurrentDate:a=()=>new Date,generateId:n=eZ}){let i={type:"text",text:""},s={id:n(),createdAt:a(),role:"assistant",content:"",parts:[i]};await rS({stream:e,onTextPart:e=>{s.content+=e,i.text+=e,t({message:{...s},data:[],replaceLastMessage:!1})}}),null==r||r(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}async function rA({api:e,body:t,streamProtocol:r="data",credentials:a,headers:n,abortController:i,restoreMessagesOnFailure:s,onResponse:o,onUpdate:l,onFinish:u,onToolCall:c,generateId:d,fetch:f=fetch,lastMessage:p,requestType:h="generate"}){var m,g,y;let v="resume"===h?f(`${e}?chatId=${t.id}`,{method:"GET",headers:{"Content-Type":"application/json",...n},signal:null==(m=null==i?void 0:i())?void 0:m.signal,credentials:a}):f(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...n},signal:null==(g=null==i?void 0:i())?void 0:g.signal,credentials:a}),b=await v.catch(e=>{throw s(),e});if(o)try{await o(b)}catch(e){throw e}if(!b.ok)throw s(),Error(null!=(y=await b.text())?y:"Failed to fetch the chat response.");if(!b.body)throw Error("The response body is empty.");switch(r){case"text":return void await rI({stream:b.body,update:l,onFinish:u,generateId:d});case"data":return void await rT({stream:b.body,update:l,lastMessage:p,onToolCall:c,onFinish({message:e,finishReason:t,usage:r}){u&&null!=e&&u(e,{usage:r,finishReason:t})},generateId:d});default:throw Error(`Unknown stream protocol: ${r}`)}}function rN(e){return null==e?void 0:e.reduce((e,t)=>{var r;return Math.max(e,null!=(r=t.step)?r:0)},0)}function rC(e){var t;return null!=(t=e.parts)?t:[...e.toolInvocations?e.toolInvocations.map(e=>({type:"tool-invocation",toolInvocation:e})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function rO(e){return e.map(e=>({...e,parts:rC(e)}))}async function rR(e){if(!e)return[];if(globalThis.FileList&&e instanceof globalThis.FileList)return Promise.all(Array.from(e).map(async e=>{let{name:t,type:r}=e;return{name:t,contentType:r,url:await new Promise((t,r)=>{let a=new FileReader;a.onload=e=>{var r;t(null==(r=e.target)?void 0:r.result)},a.onerror=e=>r(e),a.readAsDataURL(e)})}}));if(Array.isArray(e))return e;throw Error("Invalid attachments type")}function rM(e){if("assistant"!==e.role)return!1;let t=e.parts.reduce((e,t,r)=>"step-start"===t.type?r:e,-1),r=e.parts.slice(t+1).filter(e=>"tool-invocation"===e.type);return r.length>0&&r.every(e=>"result"in e.toolInvocation)}Symbol.for("vercel.ai.schema");var rP=e.i(7998);e.s(["ERROR_REVALIDATE_EVENT",0,3,"FOCUS_EVENT",0,0,"MUTATE_EVENT",0,2,"RECONNECT_EVENT",0,1],3281);var rL=Object.prototype.hasOwnProperty;let rZ=new WeakMap,r$=()=>{},rz=r$(),rF=Object,rB=e=>e===rz,rD=(e,t)=>({...e,...t}),rU={},rV={},rW="undefined",rq=typeof window!=rW,rJ=typeof document!=rW,rK=rq&&"Deno"in window,rY=(e,t)=>{let r=rZ.get(e);return[()=>!rB(t)&&e.get(t)||rU,a=>{if(!rB(t)){let n=e.get(t);t in rV||(rV[t]=n),r[5](t,rD(n,a),n||rU)}},r[6],()=>!rB(t)&&t in rV?rV[t]:!rB(t)&&e.get(t)||rU]},rG=!0,[rH,rX]=rq&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[r$,r$],rQ={initFocus:e=>(rJ&&document.addEventListener("visibilitychange",e),rH("focus",e),()=>{rJ&&document.removeEventListener("visibilitychange",e),rX("focus",e)}),initReconnect:e=>{let t=()=>{rG=!0,e()},r=()=>{rG=!1};
7return rH("online",t),rH("offline",r),()=>{rX("online",t),rX("offline",r)}}},r0=!j.default.useId,r1=!rq||rK,r2=r1?j.useEffect:j.useLayoutEffect,r5="u">typeof navigator&&navigator.connection,r4=!r1&&r5&&(["slow-2g","2g"].includes(r5.effectiveType)||r5.saveData),r3=new WeakMap,r9=(e,t)=>e===`[object ${t}]`,r6=0,r8=e=>{let t,r,a=typeof e,n=rF.prototype.toString.call(e),i=r9(n,"Date"),s=r9(n,"RegExp"),o=r9(n,"Object");if(rF(e)!==e||i||s)t=i?e.toJSON():"symbol"==a?e.toString():"string"==a?JSON.stringify(e):""+e;else{if(t=r3.get(e))return t;if(t=++r6+"~",r3.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=r8(e[r])+",";r3.set(e,t)}if(o){t="#";let a=rF.keys(e).sort();for(;!rB(r=a.pop());)rB(e[r])||(t+=r+":"+r8(e[r])+",");r3.set(e,t)}}return t},r7=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?r8(e):"",t]},ae=0,at=()=>++ae;async function ar(...e){let[t,r,a,n]=e,i=rD({populateCache:!0,throwOnError:!0},"boolean"==typeof n?{revalidate:n}:n||{}),s=i.populateCache,o=i.rollbackOnError,l=i.optimisticData,u=i.throwOnError;if("function"==typeof r){let e=[];for(let a of t.keys())!/^\$(inf|sub)\$/.test(a)&&r(t.get(a)._k)&&e.push(a);return Promise.all(e.map(c))}return c(r);async function c(r){let n,[c]=r7(r);if(!c)return;let[d,f]=rY(t,c),[p,h,m,g]=rZ.get(t),y=()=>{let e=p[c];return("function"==typeof i.revalidate?i.revalidate(d().data,r):!1!==i.revalidate)&&(delete m[c],delete g[c],e&&e[0])?e[0](2).then(()=>d().data):d().data};if(e.length<3)return y();let v=a,b=!1,x=at();h[c]=[x,0];let _=!rB(l),w=d(),k=w.data,E=w._c,j=rB(E)?k:E;if(_&&f({data:l="function"==typeof l?l(j,k):l,_c:j}),"function"==typeof v)try{v=v(j)}catch(e){n=e,b=!0}if(v&&"function"==typeof v.then){let e;if(v=await v.catch(e=>{n=e,b=!0}),x!==h[c][0]){if(b)throw n;return v}b&&_&&(e=n,"function"==typeof o?o(e):!1!==o)&&(s=!0,f({data:j,_c:rz}))}if(s&&!b&&("function"==typeof s?f({data:s(v,j),error:rz,_c:rz}):f({data:v,error:rz,_c:rz})),h[c][1]=at(),Promise.resolve(y()).then(()=>{f({_c:rz})}),b){if(u)throw n;return}return v}}let aa=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},an=(e,t)=>{if(!rZ.has(e)){let r=rD(rQ,t),a=Object.create(null),n=ar.bind(rz,e),i=r$,s=Object.create(null),o=(e,t)=>{let r=s[e]||[];return s[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,a)=>{e.set(t,r);let n=s[t];if(n)for(let e of n)e(r,a)},u=()=>{if(!rZ.has(e)&&(rZ.set(e,[a,Object.create(null),Object.create(null),Object.create(null),n,l,o]),!r1)){let t=r.initFocus(setTimeout.bind(rz,aa.bind(rz,a,0))),n=r.initReconnect(setTimeout.bind(rz,aa.bind(rz,a,1)));i=()=>{t&&t(),n&&n(),rZ.delete(e)}}};return u(),[e,n,u,i]}return[e,rZ.get(e)[4]]},[ai,as]=an(new Map),ao=rD({onLoadingSlow:r$,onSuccess:r$,onError:r$,onErrorRetry:(e,t,r,a,n)=>{let i=r.errorRetryCount,s=n.retryCount,o=~~((Math.random()+.5)*(1<<(s<8?s:8)))*r.errorRetryInterval;(rB(i)||!(s>i))&&setTimeout(a,o,n)},onDiscarded:r$,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:r4?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:r4?5e3:3e3,compare:function e(t,r){var a,n;if(t===r)return!0;if(t&&r&&(a=t.constructor)===r.constructor){if(a===Date)return t.getTime()===r.getTime();if(a===RegExp)return t.toString()===r.toString();if(a===Array){if((n=t.length)===r.length)for(;n--&&e(t[n],r[n]););return -1===n}if(!a||"object"==typeof t){for(a in n=0,t)if(rL.call(t,a)&&++n&&!rL.call(r,a)||!(a in r)||!e(t[a],r[a]))return!1;return Object.keys(r).length===n}}return t!=t&&r!=r},isPaused:()=>!1,cache:ai,mutate:as,fallback:{}},{isOnline:()=>rG,isVisible:()=>{let e=rJ&&document.visibilityState;return rB(e)||"hidden"!==e}}),al=(e,t)=>{let r=rD(e,t);if(t){let{use:a,fallback:n}=e,{use:i,fallback:s}=t;a&&i&&(r.use=a.concat(i)),n&&s&&(r.fallback=rD(n,s))}return r},au=(0,j.createContext)({});var ac=e.i(3281);let ad=rq&&window.__SWR_DEVTOOLS_USE__,af=(ad?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,a)=>{let n=r&&((...e)=>{let[a]=r7(t),[,,,n]=rZ.get(ai);if(a.startsWith("$inf$"))return r(...e);let i=n[a];return rB(i)?r(...e):(delete n[a],i)});return e(t,n,a)});ad&&(window.__SWR_DEVTOOLS_REACT__=j.default);let ap=()=>{},ah=ap(),am=(new WeakMap,j.default.use||(e=>
7{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),ag={dedupe:!0},ay=Promise.resolve(rz);rF.defineProperty(e=>{let{value:t}=e,r=(0,j.useContext)(au),a="function"==typeof t,n=(0,j.useMemo)(()=>a?t(r):t,[a,r,t]),i=(0,j.useMemo)(()=>a?n:al(r,n),[a,r,n]),s=n&&n.provider,o=(0,j.useRef)(rz);s&&!o.current&&(o.current=an(s(i.cache||ai),n));let l=o.current;return l&&(i.cache=l[0],i.mutate=l[1]),r2(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,j.createElement)(au.Provider,rD(e,{value:i}))},"defaultValue",{value:ao});let av=(i=(e,t,r)=>{let{cache:a,compare:n,suspense:i,fallbackData:s,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f,strictServerPrefetchWarning:p}=r,[h,m,g,y]=rZ.get(a),[v,b]=r7(e),x=(0,j.useRef)(!1),_=(0,j.useRef)(!1),w=(0,j.useRef)(v),k=(0,j.useRef)(t),E=(0,j.useRef)(r),T=()=>E.current.isVisible()&&E.current.isOnline(),[S,I,A,N]=rY(a,v),C=(0,j.useRef)({}).current,O=rB(s)?rB(r.fallback)?rz:r.fallback[v]:s,R=(e,t)=>{for(let r in C)if("data"===r){if(!n(e[r],t[r])&&(!rB(e[r])||!n(D,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},M=(0,j.useMemo)(()=>{let e=!!v&&!!t&&(rB(o)?!E.current.isPaused()&&!i&&!1!==l:o),r=t=>{let r=rD(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},a=S(),n=N(),s=r(a),u=a===n?s:r(n),c=s;return[()=>{let e=r(S());return R(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>u]},[a,v]),P=(0,rP.useSyncExternalStore)((0,j.useCallback)(e=>A(v,(t,r)=>{R(r,t)||e()}),[a,v]),M[0],M[1]),L=!x.current,Z=h[v]&&h[v].length>0,$=P.data,z=rB($)?O&&"function"==typeof O.then?am(O):O:$,F=P.error,B=(0,j.useRef)(z),D=f?rB($)?rB(B.current)?z:B.current:$:z,U=v&&rB(z),V=!r1&&(0,rP.useSyncExternalStore)(()=>r$,()=>!1,()=>!0);p&&V&&!i&&U&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let W=(!Z||!!rB(F))&&(L&&!rB(o)?o:!E.current.isPaused()&&(i?!rB(z)&&l:rB(z)||l)),q=!!(v&&t&&L&&W),J=rB(P.isValidating)?q:P.isValidating,K=rB(P.isLoading)?q:P.isLoading,Y=(0,j.useCallback)(async e=>{let t,a,i=k.current;if(!v||!i||_.current||E.current.isPaused())return!1;let s=!0,o=e||{},l=!g[v]||!o.dedupe,u=()=>r0?!_.current&&v===w.current&&x.current:v===w.current,c={isValidating:!1,isLoading:!1},d=()=>{I(c)},f=()=>{let e=g[v];e&&e[1]===a&&delete g[v]},p={isValidating:!0};rB(S().data)&&(p.isLoading=!0);try{if(l&&(I(p),r.loadingTimeout&&rB(S().data)&&setTimeout(()=>{s&&u()&&E.current.onLoadingSlow(v,r)},r.loadingTimeout),g[v]=[i(b),at()]),[t,a]=g[v],t=await t,l&&setTimeout(f,r.dedupingInterval),!g[v]||g[v][1]!==a)return l&&u()&&E.current.onDiscarded(v),!1;c.error=rz;let e=m[v];if(!rB(e)&&(a<=e[0]||a<=e[1]||0===e[1]))return d(),l&&u()&&E.current.onDiscarded(v),!1;let o=S().data;c.data=n(o,t)?o:t,l&&u()&&E.current.onSuccess(t,v,r)}catch(r){f();let e=E.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=r,l&&u())&&(e.onError(r,v,e),(!0===t||"function"==typeof t&&t(r))&&(!E.current.revalidateOnFocus||!E.current.revalidateOnReconnect||T())&&e.onErrorRetry(r,v,e,e=>{let t=h[v];t&&t[0]&&t[0](ac.ERROR_REVALIDATE_EVENT,e)},{retryCount:(o.retryCount||0)+1,dedupe:!0}))}return s=!1,d(),!0},[v,a]),G=(0,j.useCallback)((...e)=>ar(a,w.current,...e),[]);if(r2(()=>{k.current=t,E.current=r,rB($)||(B.current=$)}),r2(()=>{var e;let t;if(!v)return;let r=Y.bind(rz,ag),a=0;E.current.revalidateOnFocus&&(a=Date.now()+E.current.focusThrottleInterval);let n=(e=(e,t={})=>{if(e==ac.FOCUS_EVENT){let e=Date.now();E.current.revalidateOnFocus&&e>a&&T()&&(a=e+E.current.focusThrottleInterval,r())}else if(e==ac.RECONNECT_EVENT)E.current.revalidateOnReconnect&&T()&&r();else if(e==ac.MUTATE_EVENT)return Y();else if(e==ac.ERROR_REVALIDATE_EVENT)return Y(t)},(t=h[v]||(h[v]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(_.current=!1,w.current=v,x.current=!0,I({_k:b}),W&&!g[v])if(rB(z)||r1)r();else rq&&typeof window.requestAnimationFrame!=rW?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{_.current=!0,n()}},[v]),r2(()=>{let e;function t(){let t="function"==typeof u?u(S().data):u;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!S().error&&(c||E.current.isVisible())&&(d||E.current.isOnline())?Y(ag).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,c,d,v]),(0,j.useDebugValue)(D),i){if(!r0&&r1&&U)throw Error("Fallback data is required when using Suspense in SSR.");U&&(k.current=t,E.current=r,_.current=!1);let e=y[v];if(am(!rB(e)&&U?G(e):ay),!rB(F)&&U)throw F;
7let a=U?Y(ag):ay;!rB(D)&&U&&(a.status="fulfilled",a.value=!0),am(a)}return{mutate:G,get data(){return C.data=!0,D},get error(){return C.error=!0,F},get isValidating(){return C.isValidating=!0,J},get isLoading(){return C.isLoading=!0,K}}},function(...e){let t,r=(t=(0,j.useContext)(au),(0,j.useMemo)(()=>rD(ao,t),[t])),[a,n,s]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],o=al(r,s),l=i,{use:u}=o,c=(u||[]).concat(af);for(let e=c.length;e--;)l=c[e](l);return l(a,n||o.fetcher||null,o)});var ab=e.i(61030);function ax(e,t){return null!=t?(0,ab.default)(e,t):e}var a_=e.i(54645);let aw=(0,a_.default)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),ak=(0,a_.default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var aE=e.i(14507);let aj=(0,a_.default)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),aT=(0,a_.default)("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]),aS=(0,a_.default)("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]),aI=(0,a_.default)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),aA=(0,a_.default)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);var aN=e.i(59748),aC=e.i(37491);let aO=(0,a_.default)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var aR=e.i(13040);let aM=[{id:"email",label:"Email",icon:(0,w.jsx)(aI,{className:"w-5 h-5"}),href:aR.SOCIALS.email,external:!1},{id:"phone",label:"Phone",icon:(0,w.jsx)(aA,{className:"w-5 h-5"}),href:"tel:+905413809098",external:!1},{id:"discord",label:"Discord",icon:(0,w.jsx)(({className:e})=>(0,w.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,w.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),{className:"w-5 h-5"}),href:aR.SOCIALS.discord,external:!0},{id:"whatsapp",label:"WhatsApp",icon:(0,w.jsx)(({className:e})=>
7(0,w.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,w.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.464 3.488"})}),{className:"w-5 h-5"}),href:aR.SOCIALS.whatsapp,external:!0},{id:"telegram",label:"Telegram",icon:(0,w.jsx)(aO,{className:"w-5 h-5"}),href:aR.SOCIALS.telegram,external:!0},{id:"github",label:"GitHub",icon:(0,w.jsx)(aj,{className:"w-5 h-5"}),href:aR.SOCIALS.github,external:!0},{id:"linkedin",label:"LinkedIn",icon:(0,w.jsx)(aT,{className:"w-5 h-5"}),href:aR.SOCIALS.linkedin,external:!0},{id:"instagram",label:"Instagram",icon:(0,w.jsx)(aS,{className:"w-5 h-5"}),href:aR.SOCIALS.instagram,external:!0}];function aP(){let e=(0,j.useRef)(null),[t,r]=(0,j.useState)(!1),[a,n]=(0,j.useState)(!1),i=(0,j.useCallback)(()=>{let t=e.current;t&&(r(t.scrollLeft>1),n(t.scrollLeft<t.scrollWidth-t.clientWidth-1))},[]);(0,j.useEffect)(()=>{let t=e.current;if(!t)return;i(),t.addEventListener("scroll",i,{passive:!0});let r=new ResizeObserver(i);return r.observe(t),()=>{t.removeEventListener("scroll",i),r.disconnect()}},[i]);let s=t=>{e.current?.scrollBy({left:t,behavior:"smooth"})};return(0,w.jsx)("div",{className:"my-3 relative",children:(0,w.jsxs)("div",{className:"relative",children:[t&&(0,w.jsx)("button",{type:"button",onClick:()=>s(-120),"aria-label":"Scroll contact methods left",className:"hidden [@media(hover:hover)_and_(pointer:fine)]:flex absolute left-0 top-1/2 -translate-y-1/2 z-20 rounded-full bg-canvas-deep/55 p-1.5 shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.08)] transition-colors duration-150 hover:bg-canvas-deep/75",children:(0,w.jsx)(aN.ChevronLeft,{className:"w-3 h-3 text-ink-secondary"})}),a&&(0,w.jsx)("button",{type:"button",onClick:()=>s(120),"aria-label":"Scroll contact methods right",className:"hidden [@media(hover:hover)_and_(pointer:fine)]:flex absolute right-0 top-1/2 -translate-y-1/2 z-20 rounded-full bg-canvas-deep/55 p-1.5 shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.08)] transition-colors duration-150 hover:bg-canvas-deep/75",children:(0,w.jsx)(aC.ChevronRight,{className:"w-3 h-3 text-ink-secondary"})}),(0,w.jsx)("ul",{ref:e,className:"flex gap-3 overflow-x-auto scrollbar-none py-2 px-1 list-none m-0",style:{scrollbarWidth:"none",msOverflowStyle:"none",overscrollBehaviorX:"contain",WebkitOverflowScrolling:"touch"},children:aM.map(e=>(0,w.jsx)("li",{className:"flex-shrink-0",children:(0,w.jsxs)("a",{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},"aria-label":"email"===e.id?"Email Akıncan":"phone"===e.id?"Call Akıncan":`Open ${e.label}`,className:"\\ flex flex-col items-center justify-center gap-1.5\\ min-w-[68px] min-h-[68px] sm:min-w-[80px] sm:min-h-[76px] p-2 sm:p-3\\ rounded-xl bg-ink/[0.055]\\ shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.08),inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.07)]\\ text-ink-primary no-underline\\ [touch-action:manipulation] [-webkit-tap-highlight-color:transparent]\\ transition-[background-color,box-shadow,transform] duration-150 ease-out\\ active:scale-[0.97] active:bg-ink/[0.11]\\ focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink/60\\ hover:bg-ink/[0.1] hover:shadow-[inset_0_0_0_1px_rgb(var(--color-accent-rgb)/0.38)]\\ motion-reduce:transition-none motion-reduce:active:scale-100\\ ",children:[(0,w.jsx)("span",{className:"[&>svg]:w-4 [&>svg]:h-4 sm:[&>svg]:w-5 sm:[&>svg]:h-5",children:e.icon}),(0,w.jsx)("span",{className:"text-[10px] sm:text-xs text-ink-secondary font-medium leading-none",children:e.label})]})},e.id))})]})})}let aL="$$SOCIALS$$";function aZ({text:e}){let t=e.split(/(\s+)/);return(0,w.jsx)(w.Fragment,{children:t.map((e,t)=>/\s/.test(e)?e:(0,w.jsx)(ed.motion.span,{initial:{opacity:0,y:3}
7,animate:{opacity:1,y:0},transition:{duration:.34,ease:[.16,1,.3,1]},style:{display:"inline-block",maxWidth:"100%",overflowWrap:"anywhere"},children:e},t))})}function a$(e,t,r){return`radial-gradient(circle at ${e}, black ${t}px, transparent ${r}px)`}let az=(s=[a$("100% 100%",14,24),a$("0 100%",14,24),a$("100% 0",14,24),a$("0 0",14,24),"linear-gradient(to bottom, transparent, black 10px)","linear-gradient(to top, transparent, black 10px)","linear-gradient(to right, transparent, black 10px)","linear-gradient(to left, transparent, black 10px)","linear-gradient(black, black)"].join(", "),{maskImage:s,WebkitMaskImage:s,maskSize:o="24px 24px, 24px 24px, 24px 24px, 24px 24px, calc(100% - 48px) 24px, calc(100% - 48px) 24px, 24px calc(100% - 48px), 24px calc(100% - 48px), calc(100% - 48px) calc(100% - 48px)",WebkitMaskSize:o,maskPosition:l="0 0, 100% 0, 0 100%, 100% 100%, 24px 0, 24px 100%, 0 24px, 100% 24px, 24px 24px",WebkitMaskPosition:l,maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat"});function aF({text:e}){let t=e.split("$$SOCIALS$$");return 1===t.length?(0,w.jsx)(aZ,{text:e}):(0,w.jsx)(w.Fragment,{children:t.map((e,r)=>(0,w.jsxs)(j.Fragment,{children:[e&&(0,w.jsx)("p",{className:"m-0 whitespace-pre-wrap",children:(0,w.jsx)(aZ,{text:e.trim()})}),r<t.length-1&&(0,w.jsx)(ed.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.45,ease:[.16,1,.3,1]},children:(0,w.jsx)(aP,{})})]},r))})}function aB({role:e,content:t,onGrow:r}){let a="assistant"===e,n=function(e,t,r){var a;let n,i,[s,o]=(0,j.useState)(0),l=(0,j.useRef)(0),u=(0,j.useRef)(r);return(0,j.useEffect)(()=>{u.current=r}),(0,j.useEffect)(()=>{if(!t||l.current>=e.length)return;let r=0,a=performance.now(),n=t=>{let i=Math.max(0,Math.min(.1,(t-a)/1e3));a=t;let s=Math.max(68,(e.length-l.current)/3.5);l.current=Math.max(0,Math.min(e.length,l.current+s*i)),o(Math.floor(l.current)),u.current?.(),l.current<e.length&&(r=requestAnimationFrame(n))};return r=requestAnimationFrame(n),()=>cancelAnimationFrame(r)},[e,t]),a=t?s:e.length,n=Math.max(0,Math.min(e.length,a)),-1!==(i=e.lastIndexOf(aL,n-1))&&n>i&&n<i+aL.length?e.slice(0,i):e.slice(0,n)}(t,a,r),i=t.includes("$$SOCIALS$$");return(0,w.jsx)(ed.motion.div,{layout:"position",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:340,damping:30,mass:.7},className:`flex ${a?"justify-start":"justify-end"}`,children:(0,w.jsx)("div",{className:`break-words rounded-[18px] px-4 py-3 text-[15px] leading-[1.6] ${i?"w-full min-w-0":"max-w-[95%] sm:max-w-[85%]"} ${a?"rounded-tl-md bg-accent-soft/[0.075] text-ink-primary shadow-[inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.08)]":"rounded-tr-md bg-accent-deep/75 text-ink-primary shadow-[inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.1)]"}`,children:(0,w.jsx)(aF,{text:n})})})}let aD=["What have you actually built?","What is your stack?","How do you train models?"],aU="Oh no, I have hit the rate limit for today. This thing is not free to run :p How about you contact the real me instead? $$SOCIALS$$";function aV(){let{messages:e,input:t,handleInputChange:r,handleSubmit:a,append:n,setMessages:i,error:s,status:o}=function({api:e="/api/chat",id:t,initialMessages:r,initialInput:a="",sendExtraMessageFields:n,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:o=1,streamProtocol:l="data",onResponse:u,onFinish:c,onError:d,credentials:f,headers:p,body:h,generateId:m=eZ,fetch:g,keepLastMessageOnError:y=!0,experimental_throttle:v}={}){let[b]=(0,j.useState)(m),x=null!=t?t:b,_="string"==typeof e?[e,x]:x,w=function(e){let[t,r]=(0,j.useState)(e);return(0,j.useEffect)(()=>{!function e(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if("object"!=typeof t&&"object"!=typeof r)return t===r;if(t.constructor!==r.constructor)return!1;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(Array.isArray(t)){if(t.length!==r.length)return!1;for(let a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}let a=Object.keys(t),n=Object.keys(r);if(a.length!==n.length)return!1;for(let i of a)if(!n.includes(i)||!e(t[i],r[i]))return!1;return!0}(e,t)&&r(e)},[e,t]),t}(null!=r?r:[]),{data:k,mutate:E}=av([_,"messages"],null,{fallbackData:(0,j.useMemo)(()=>rO(w),[w])}),T=(0,j.useRef)(k||[]);(0,j.useEffect)(()=>{T.current=k||[]},[k]);let{data:S,mutate:I}=av([_,"streamData"],null),A=(0,j.useRef)(S);(0,j.useEffect)(()=>{A.current=S},[S]);let{data:N="ready",mutate:C}=av([_,"status"],null),{data:O,mutate:R}=av([_,"error"],null),M=(0,j.useRef)(null),P=(0,j.useRef)({credentials:f,headers:p,body:h});(0,j.useEffect)(()=>{P.current={credentials:f,headers:p,body:h}},[f,p,h]);let L=(0,j.useCallback)(async(t,r="generate")=>{var a,f;C("submitted"),R(void 0);let p=rO(t.messages),h=p.length,b=rN(null==(a=p[p.length-1])?void 0:a.toolInvocations);
7try{M.current=new AbortController;let a=ax(E,v),o=ax(I,v),d=T.current;a(p,!1);let h=n?p:p.map(({role:e,content:t,experimental_attachments:r,data:a,annotations:n,toolInvocations:i,parts:s})=>({role:e,content:t,...void 0!==r&&{experimental_attachments:r},...void 0!==a&&{data:a},...void 0!==n&&{annotations:n},...void 0!==i&&{toolInvocations:i},...void 0!==s&&{parts:s}})),b=A.current;await rA({api:e,body:null!=(f=null==s?void 0:s({id:x,messages:p,requestData:t.data,requestBody:t.body}))?f:{id:x,messages:h,data:t.data,...P.current.body,...t.body},streamProtocol:l,credentials:P.current.credentials,headers:{...P.current.headers,...t.headers},abortController:()=>M.current,restoreMessagesOnFailure(){y||a(d,!1)},onResponse:u,onUpdate({message:e,data:t,replaceLastMessage:r}){C("streaming"),a([...r?p.slice(0,p.length-1):p,e],!1),(null==t?void 0:t.length)&&o([...null!=b?b:[],...t],!1)},onToolCall:i,onFinish:c,generateId:m,fetch:g,lastMessage:p[p.length-1],requestType:r}),M.current=null,C("ready")}catch(e){if("AbortError"===e.name)return M.current=null,C("ready"),null;d&&e instanceof Error&&d(e),R(e),C("error")}let _=T.current;(function({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:r,messages:a}){var n;let i=a[a.length-1];return r>1&&null!=i&&(a.length>t||rN(i.toolInvocations)!==e)&&rM(i)&&(null!=(n=rN(i.toolInvocations))?n:0)<r})({originalMaxToolInvocationStep:b,originalMessageCount:h,maxSteps:o,messages:_})&&await L({messages:_})},[E,C,e,P,u,c,d,R,I,A,l,n,s,i,o,T,M,m,g,y,v,x]),Z=(0,j.useCallback)(async(e,{data:t,headers:r,body:a,experimental_attachments:n=e.experimental_attachments}={})=>{var i,s;let o=await rR(n);return L({messages:T.current.concat({...e,id:null!=(i=e.id)?i:m(),createdAt:null!=(s=e.createdAt)?s:new Date,experimental_attachments:o.length>0?o:void 0,parts:rC(e)}),headers:r,body:a,data:t})},[L,m]),$=(0,j.useCallback)(async({data:e,headers:t,body:r}={})=>{let a=T.current;return 0===a.length?null:L({messages:"assistant"===a[a.length-1].role?a.slice(0,-1):a,headers:t,body:r,data:e})},[L]),z=(0,j.useCallback)(()=>{M.current&&(M.current.abort(),M.current=null)},[]),F=(0,j.useCallback)(async()=>{L({messages:T.current},"resume")},[L]),B=(0,j.useCallback)(e=>{"function"==typeof e&&(e=e(T.current));let t=rO(e);E(t,!1),T.current=t},[E]),D=(0,j.useCallback)(e=>{"function"==typeof e&&(e=e(A.current)),I(e,!1),A.current=e},[I]),[U,V]=(0,j.useState)(a),W=(0,j.useCallback)(async(e,t={},r)=>{var a;if(null==(a=null==e?void 0:e.preventDefault)||a.call(e),!U&&!t.allowEmptySubmit)return;r&&(P.current={...P.current,...r});let n=await rR(t.experimental_attachments);L({messages:T.current.concat({id:m(),createdAt:new Date,role:"user",content:U,experimental_attachments:n.length>0?n:void 0,parts:[{type:"text",text:U}]}),headers:t.headers,body:t.body,data:t.data}),V("")},[U,m,L]),q=(0,j.useCallback)(({toolCallId:e,result:t})=>{let r=T.current;!function({messages:e,toolCallId:t,toolResult:r}){var a;let n=e[e.length-1],i=n.parts.find(e=>"tool-invocation"===e.type&&e.toolInvocation.toolCallId===t);if(null==i)return;let s={...i.toolInvocation,state:"result",result:r};i.toolInvocation=s,n.toolInvocations=null==(a=n.toolInvocations)?void 0:a.map(e=>e.toolCallId===t?s:e)}({messages:r,toolCallId:e,toolResult:t}),E([...r.slice(0,r.length-1),{...r[r.length-1]}],!1),"submitted"===N||"streaming"===N||rM(r[r.length-1])&&L({messages:r})},[E,N,L]);return{messages:null!=k?k:[],id:x,setMessages:B,data:S,setData:D,error:O,append:Z,reload:$,stop:z,experimental_resume:F,input:U,setInput:V,handleInputChange:e=>{V(e.target.value)},handleSubmit:W,isLoading:"submitted"===N||"streaming"===N,status:N,addToolResult:q}}({initialMessages:[{id:"welcome",role:"assistant",content:"Hi, I am Akın. Feel free to ask me anything about my background, experience, or skills here."}],api:"/api/chat",onError:async e=>{console.error("Chat error:",e),(e.message?.includes("RATE_LIMIT_EXCEEDED")||e.message?.includes("429"))&&i(e=>[...e,{id:`limit-${e.length}`,role:"assistant",content:aU}])}}),l=(0,j.useRef)(null),u=(0,j.useRef)(!1),c=(0,j.useRef)(!0),d="submitted"===o||"streaming"===o,f=e.length<=1&&!d,p=e.some(e=>e.content===aU),h=(0,j.useCallback)(()=>{let e=l.current;e&&c.current&&(e.scrollTop=e.scrollHeight)},[]),m=(0,j.useCallback)(()=>{let e=l.current;e&&(c.current=e.scrollHeight-e.scrollTop-e.clientHeight<48)},[]);return(0,j.useEffect)(()=>
7{if(!u.current){u.current=!0;return}h()},[e,h]),(0,w.jsx)("div",{className:"relative w-full max-w-xl",style:az,children:(0,w.jsxs)("div",{className:"relative flex h-[27rem] flex-col overflow-hidden rounded-[24px] bg-[linear-gradient(158deg,rgb(var(--color-surface-raised-rgb)/0.86),rgb(var(--color-surface-rgb)/0.8)_46%,rgb(var(--color-canvas-deep-rgb)/0.94))] shadow-[0_52px_72px_-44px_rgb(var(--color-shadow-rgb)/0.92)] sm:h-[30rem]",children:[(0,w.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(120%_70%_at_8%_-8%,rgb(var(--color-accent-soft-rgb)/0.09),transparent_58%)]"}),(0,w.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-[0.05] mix-blend-overlay",style:{backgroundImage:"image-set(url('/visuals/grain-1024.webp') 1x, url('/visuals/grain-2048.webp') 2x)",backgroundSize:"cover",backgroundPosition:"center"}}),(0,w.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-5 py-3.5 shadow-[inset_0_-1px_0_0_rgb(var(--color-ink-rgb)/0.055)]",children:[(0,w.jsxs)("div",{className:"relative shrink-0",children:[(0,w.jsx)("div",{className:"relative h-9 w-9 overflow-hidden rounded-full shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.14)]",children:(0,w.jsx)(em.default,{src:"/personal_images/akin_transparent.png",alt:"",fill:!0,sizes:"108px",quality:90,className:"object-cover"})}),(0,w.jsx)("span",{"aria-hidden":"true",className:"absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-accent shadow-[0_0_0_2px_rgb(var(--color-surface-rgb))]"})]}),(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("p",{className:"text-sm leading-tight text-ink-primary",children:"Akıncan"}),(0,w.jsx)("p",{className:"text-[11px] leading-tight text-ink-tertiary",children:d?"Typing":"Answers on my behalf"})]})]}),(0,w.jsx)("div",{ref:l,"data-lenis-prevent":!0,onScroll:m,className:"scrollbar-thin relative z-10 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-5 sm:py-5",children:(0,w.jsxs)("div",{className:"flex min-h-full flex-col justify-end space-y-5",children:[e.map(e=>(0,w.jsx)(aB,{role:e.role,content:"string"==typeof e.content?e.content:"",onGrow:h},e.id)),(0,w.jsx)(aE.AnimatePresence,{children:f?(0,w.jsxs)(ed.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:.4,ease:[.16,1,.3,1],delay:1.5}},exit:{opacity:0,y:-6,transition:{duration:.18,ease:"easeOut"}},className:"pt-1",children:[(0,w.jsx)("p",{className:"mb-2.5 text-[11px] text-ink-tertiary",children:"Or start here"}),(0,w.jsx)("ul",{className:"flex flex-wrap gap-2",children:aD.map(e=>(0,w.jsx)("li",{children:(0,w.jsx)("button",{type:"button",onClick:()=>n({role:"user",content:e}),disabled:d,className:"min-h-11 rounded-2xl bg-ink/[0.045] px-3 py-2 text-left text-[13px] sm:min-h-0 sm:rounded-full text-ink-secondary shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.07),inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.06)] transition-[background-color,color,box-shadow] duration-200 ease-out hover:bg-ink/[0.09] hover:text-ink-primary hover:shadow-[inset_0_0_0_1px_rgb(var(--color-accent-rgb)/0.4)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed disabled:opacity-50 sm:px-3.5 sm:py-2 sm:text-[13px]",children:e})},e))})]},"openers"):null}),d&&(0,w.jsx)(ed.motion.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.28,ease:"easeOut"},className:"flex justify-start",children:(0,w.jsx)("div",{className:"rounded-[18px] rounded-tl-md bg-accent-soft/[0.075] px-4 py-3.5 shadow-[inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.08)]",role:"status","aria-label":"Akıncan is typing",children:(0,w.jsx)("span",{className:"flex items-center gap-1.5",children:[0,1,2].map(e=>(0,w.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-accent-soft/70 motion-reduce:animate-none",style:{animationDelay:`${160*e}ms`}},e))})})}),s&&!p&&(0,w.jsx)("div",{className:"flex justify-center",children:(0,w.jsx)("p",{className:"rounded-xl bg-danger/10 px-4 py-2 text-center text-[13px] leading-snug text-danger shadow-[inset_0_0_0_1px_rgb(var(--color-danger-rgb)/0.25)]",children:"That did not go through. Try sending it again."})})]})}),(0,w.jsx)("form",{onSubmit:a,className:"relative z-10 p-4 shadow-[inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.055)]",children:(0,w.jsxs)("div",{className:"relative flex items-center rounded-full bg-ink/[0.055] shadow-[inset_0_0_0_1px_rgb(var(--color-ink-rgb)/0.075),inset_0_1px_0_0_rgb(var(--color-ink-rgb)/0.07)] transition-[background-color,box-shadow] duration-200 focus-within:bg-ink/[0.085] focu
7s-within:shadow-[inset_0_0_0_1px_rgb(var(--color-accent-rgb)/0.5),0_0_0_4px_rgb(var(--color-accent-rgb)/0.09)]",children:[(0,w.jsx)("label",{htmlFor:"chat-input",className:"sr-only",children:"Ask Akıncan anything"}),(0,w.jsx)("input",{id:"chat-input",value:t,onChange:r,placeholder:"Ask me anything",autoComplete:"off",disabled:d,className:"w-full bg-transparent py-3 pl-5 pr-14 text-base text-ink-primary placeholder:text-ink-secondary focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"}),(0,w.jsx)("button",{type:"submit","aria-label":"Send message",disabled:!t.trim()||d,className:"absolute right-1.5 flex h-11 w-11 sm:h-9 sm:w-9 items-center justify-center rounded-full bg-accent text-canvas-deep transition-[background-color,transform] duration-200 ease-out hover:bg-accent-soft active:scale-95 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed disabled:bg-ink/10 disabled:text-ink-tertiary motion-reduce:transition-none motion-reduce:active:scale-100",children:d?(0,w.jsx)(ak,{className:"h-4 w-4 animate-spin motion-reduce:animate-none"}):(0,w.jsx)(aw,{className:"h-4 w-4"})})]})})]})})}function aW(e,t,r,a){return new(r||(r=Promise))(function(n,i){function s(e){try{l(a.next(e))}catch(e){i(e)}}function o(e){try{l(a.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((a=a.apply(e,t||[])).next())})}function aq(e,t){var r,a,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){var l=[i,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,a&&(n=2&l[0]?a.return:l[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,l[1])).done)return n;switch(a=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,a=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){s.label=l[1];break}if(6===l[0]&&s.label<n[1]){s.label=n[1],n=l;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(l);break}n[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],a=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function aJ(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function aK(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(a=i.next()).done;)s.push(a.value)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s}function aY(e,t,r){if(r||2==arguments.length)for(var a,n=0,i=t.length;n<i;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function aG(e,t,r,a,n){for(var i=[],s=5;s<arguments.length;s++)i[s-5]=arguments[s];return aW(this,void 0,void 0,function(){var s,o,l,u,c;return aq(this,function(d){switch(d.label){case 0:d.trys.push([0,12,13,14]),o=(s=aJ(i)).next(),d.label=1;case 1:if(o.done)return[3,11];switch(typeof(l=o.value)){case"string":return[3,2];case"number":return[3,4];case"function":return[3,6]}return[3,8];case 2:return[4,function(e,t,r,a,n,i){return aW(this,void 0,void 0,function(){var s,o;return aq(this,function(l){switch(l.label){case 0:var u,c;return u=s=e.textContent||"",c=aK(r).slice(0),o=aY(aY([],aK(u),!1),[NaN],!1).findIndex(function(e,t){return c[t]!==e}),[4,function(e,t,r,a,n){return aW(this,void 0,void 0,function(){var i,s,o,l,u,c,d,f,p,h,m,g;return aq(this,function(y){switch(y.label){case 0:if(i=t,n){for(s=0,o=1;o<t.length;
7o++)if(u=(l=aK([t[o-1],t[o]],2))[0],(c=l[1]).length>u.length||""===c){s=o;break}i=t.slice(s,t.length)}y.label=1;case 1:y.trys.push([1,6,7,8]),f=(d=aJ(function(e){var t,r,a,n,i,s;return aq(this,function(o){switch(o.label){case 0:t=function(e){return aq(this,function(t){switch(t.label){case 0:return[4,{op:function(t){return requestAnimationFrame(function(){return t.textContent=e})},opCode:function(t){var r=t.textContent||"";return""===e||r.length>e.length?"DELETE":"WRITING"}}];case 1:return t.sent(),[2]}})},o.label=1;case 1:o.trys.push([1,6,7,8]),a=(r=aJ(e)).next(),o.label=2;case 2:return a.done?[3,5]:(n=a.value,[5,t(n)]);case 3:o.sent(),o.label=4;case 4:return a=r.next(),[3,2];case 5:return[3,8];case 6:return i={error:o.sent()},[3,8];case 7:try{a&&!a.done&&(s=r.return)&&s.call(r)}finally{if(i)throw i.error}return[7];case 8:return[2]}})}(i))).next(),y.label=2;case 2:return f.done?[3,5]:(h="WRITING"===(p=f.value).opCode(e)?r+r*(Math.random()-.5):a+a*(Math.random()-.5),p.op(e),[4,aH(h)]);case 3:y.sent(),y.label=4;case 4:return f=d.next(),[3,2];case 5:return[3,8];case 6:return m={error:y.sent()},[3,8];case 7:try{f&&!f.done&&(g=d.return)&&g.call(d)}finally{if(m)throw m.error}return[7];case 8:return[2]}})})}(e,aY(aY([],aK(function(e,t,r){var a,n;return void 0===r&&(r=0),aq(this,function(i){switch(i.label){case 0:n=(a=t(e)).length,i.label=1;case 1:return n>r?[4,a.slice(0,--n).join("")]:[3,3];case 2:return i.sent(),[3,1];case 3:return[2]}})}(s,t,o)),!1),aK(function(e,t,r){var a,n;return void 0===r&&(r=0),aq(this,function(i){switch(i.label){case 0:n=(a=t(e)).length,i.label=1;case 1:return r<n?[4,a.slice(0,++r).join("")]:[3,3];case 2:return i.sent(),[3,1];case 3:return[2]}})}(r,t,o)),!1),a,n,i)];case 1:return l.sent(),[2]}})})}(e,t,l,r,a,n)];case 3:case 5:case 7:return d.sent(),[3,10];case 4:return[4,aH(l)];case 6:return[4,l.apply(void 0,aY([e,t,r,a,n],aK(i),!1))];case 8:return[4,l];case 9:d.sent(),d.label=10;case 10:return o=s.next(),[3,1];case 11:return[3,14];case 12:return u={error:d.sent()},[3,14];case 13:try{o&&!o.done&&(c=s.return)&&c.call(s)}finally{if(u)throw u.error}return[7];case 14:return[2]}})})}function aH(e){return aW(this,void 0,void 0,function(){return aq(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){return setTimeout(t,e)})];case 1:return t.sent(),[2]}})})}!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"u">typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".index-module_type__E-SaG::after {\n  content: '|';\n  animation: index-module_cursor__PQg0P 1.1s infinite step-start;\n}\n\n@keyframes index-module_cursor__PQg0P {\n  50% {\n    opacity: 0;\n  }\n}\n");var aX=(0,j.memo)((0,j.forwardRef)(function(e,t){var r=e.sequence,a=e.repeat,n=e.className,i=e.speed,s=void 0===i?40:i,o=e.deletionSpeed,l=e.omitDeletionAnimation,u=void 0!==l&&l,c=e.preRenderFirstString,d=e.wrapper,f=e.splitter,p=void 0===f?function(e){return aY([],aK(e),!1)}:f,h=e.cursor,m=void 0===h||h,g=e.style,y=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)0>t.indexOf(a[n])&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}(e,["sequence","repeat","className","speed","deletionSpeed","omitDeletionAnimation","preRenderFirstString","wrapper","splitter","cursor","style"]),v=y["aria-label"],b=y["aria-hidden"],x=y.role;o||(o=s);var _=[,,].fill(40);[s,o].forEach(function(e,t){switch(typeof e){case"number":_[t]=Math.abs(e-100);break;case"object":var r=e.type,a=e.value;if("number"!=typeof a)break;"keyStrokeDelayInMs"===r&&(_[t]=a)}});var w,k,E,T,S,I,A,N,C=_[0],O=_[1],R=(void 0===w&&(w=null),k=(0,j.useRef)(w),(0,j.useEffect)(function(){t&&("function"==typeof t?t(k.current):t.current=k.current)},[t]),k),M="index-module_type__E-SaG";E=n?"".concat(m?M+" ":"").concat(n):m?M:"",T=(0,j.useRef)(function(){var e,t=r;a===1/0?e=aG:"number"==typeof a&&(t=Array(1+a).fill(r).flat());var n=e?aY(aY([],aK(t),!1),[e],!1):aY([],aK(t),!1);
7return aG.apply(void 0,aY([R.current,p,C,O,u],aK(n),!1)),function(){R.current}}),S=(0,j.useRef)(),I=(0,j.useRef)(!1),A=(0,j.useRef)(!1),N=aK((0,j.useState)(0),2)[1],I.current&&(A.current=!0),(0,j.useEffect)(function(){return I.current||(S.current=T.current(),I.current=!0),N(function(e){return e+1}),function(){A.current&&S.current&&S.current()}},[]);var P=void 0!==c&&c?r.find(function(e){return"string"==typeof e})||"":null;return j.default.createElement(void 0===d?"span":d,{"aria-hidden":b,"aria-label":v,role:x,style:g,className:E,children:v?j.default.createElement("span",{"aria-hidden":"true",ref:R,children:P}):P,ref:v?void 0:R})}),function(e,t){return!0});let aQ=({text:e,className:t="",typingSpeed:r=100,infiniteCursor:a=!1,onTypingComplete:n})=>(0,w.jsx)("span",{className:t,children:(0,w.jsx)(aX,{sequence:[e,()=>{n?.()}],speed:{type:"keyStrokeDelayInMs",value:r},cursor:a,style:{whiteSpace:"pre-line"}})}),a0=(0,j.forwardRef)(({text:e,scrambleSpeed:t=50,scrambledLetterCount:r=2,characters:a="abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+",className:n="",scrambledClassName:i="",autoStart:s=!0,delay:o=0,onStart:l,onComplete:u},c)=>{let d,f,[p,h]=(0,j.useState)(""),[m,g]=(0,j.useState)(!1),[y,v]=(0,j.use
7State)(0),[b,x]=(0,j.useState)(0),_=(0,j.useCallback)(()=>{g(!0),v(0),x(0),l?.()},[l]),k=(0,j.useCallback)(()=>{g(!1),v(0),x(0),h("")},[]);return(0,j.useImperativeHandle)(c,()=>({start:_,reset:k})),(0,j.useEffect)(()=>{if(s){if(o>0){let e=setTimeout(_,o);return()=>clearTimeout(e)}_()}},[s,o,_]),(0,j.useEffect)(()=>{let n;return m&&(n=setInterval(()=>{y<e.length?v(e=>e+1):b<r?x(e=>e+1):(clearInterval(n),g(!1),u?.());let t=Array(Math.min(Math.max(0,e.length-y),r)).fill(0).map(()=>a[Math.floor(Math.random()*a.length)]).join("");h(e.slice(0,y)+t)},t)),()=>{n&&clearInterval(n)}},[m,e,y,b,r,a,t,u]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:"sr-only",children:e}),(0,w.jsx)("span",{className:"inline-block whitespace-pre-wrap","aria-hidden":"true",children:(d=p.slice(0,y),f=p.slice(y),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:n,children:d}),(0,w.jsx)("span",{className:i,children:f})]}))})]})});a0.displayName="ScrambleText";var a1=e.i(98013);function a2({texts:e,holdMs:t=2600,shouldStart:r=!0,startDelay:a=0,className:n=""}
7){let[i,s]=(0,j.useState)(0),[o,l]=(0,j.useState)(!1),u=(0,a1.usePrefersReducedMotion)();(0,j.useEffect)(()=>{if(!r||o)return;let e=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(e)},[r,a,o]);let c=(0,j.useCallback)(()=>{let r=window.setTimeout(()=>{document.hidden||s(t=>t+1<e.length?t+1:t)},t);return()=>window.clearTimeout(r)},[t,e.length]),[d,f]=(0,j.useState)(null);return((0,j.useEffect)(()=>()=>d?.(),[d]),u)?(0,w.jsx)(a5,{texts:e,holdMs:t+900,shouldStart:r,className:n}):o?(0,w.jsx)(a0,{text:e[i],scrambleSpeed:38,scrambledLetterCount:3,characters:"abcdefghijklmnopqrstuvwxyz0123456789/\\\\<>[]{}*#@",className:n,scrambledClassName:"text-ink-quiet",onComplete:()=>f(()=>c())},e[i]):(0,w.jsx)("span",{className:n,children:" "})}function a5({texts:e,holdMs:t,shouldStart:r,className:a}){let[n,i]=(0,j.useState)(0);return(0,j.useEffect)(()=>{if(!r)return;let a=window.setInterval(()=>{document.hidden||i(t=>t+1<e.length?t+1:t)},t);return()=>window.clearInterval(a)},[r,t,e.length]),(0,w.jsx)("span",{className:a,children:e[n]})}var a4=e.i(63129);let a3=(0,a_.default)("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);function a9({workStartId:e,educationId:t}){let[r,a]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{let r=document.getElementById(e),n=document.getElementById(t);if(!r||!n)return;let i=!1,s=!1,o=(e,t)=>{let r=new IntersectionObserver(([e])=>{t(e.isIntersecting),a(i&&!s)},{root:null,rootMargin:"10000px 0px 0px 0px",threshold:0});return r.observe(e),r},l=o(r,e=>{i=e}),u=o(n,e=>{s=e});return()=>{l.disconnect(),u.disconnect()}},[e,t]),(0,w.jsx)("div",{className:"pointer-events-none fixed bottom-[calc(10rem+var(--footer-clearance))] right-4 z-50 sm:bottom-[calc(6rem+var(--footer-clearance))] sm:right-8",children:(0,w.jsxs)("button",{type:"button",tabIndex:r?0:-1,"aria-hidden":!r,onClick:()=>(0,ey.scrollToId)(t),className:`flex max-w-[16.5rem] items-center gap-2 rounded-full border border-ink/[0.16] bg-canvas-deep/90 px-3.5 py-2 text-left text-[12px] leading-snug text-ink-secondary shadow-[0_12px_32px_rgb(var(--color-shadow-rgb)/0.4)] transition-[opacity,transform] duration-300 ease-out hover:border-ink/[0.28] hover:text-ink-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ink/60 sm:max-w-none sm:px-4 sm:text-[13px] ${r?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0 motion-reduce:translate-y-0"}`,children:[(0,w.jsx)(a3,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),"Move to my education section"]})})}var a6=e.i(12060),a8=e.i(6028),a7=e.i(91970),ne=e.i(82633),nt=e.i(69308);let nr=({role:e,company:t,body:r,highlights:a,technologies:n,variant:i="work",projects:s})=>(0,w.jsxs)("article",{className:"relative",children:[(0,w.jsx)(a7.SoftReveal,{as:"h3",className:"font-serif text-[1.75rem] font-normal leading-[1.08] tracking-[-0.025em] text-ink-primary sm:text-[2.25rem]",children:e}),(0,w.jsxs)(a7.SoftReveal,{as:"p",delay:.08,className:"mt-2.5 text-[0.875rem] tracking-[0.01em] text-accent",children:[t,"education"===i?(0,w.jsx)("span",{className:"ml-2 text-ink-quiet",children:"Education"}):null]}),(0,w.jsx)("div",{"aria-hidden":"true",className:"mt-5 h-px w-full max-w-[42rem] bg-gradient-to-r from-ink/[0.14] to-transparent"}),(0,w.jsx)("div",{className:"mt-5 max-w-[38rem] space-y-4 text-[0.9375rem] leading-[1.75] text-ink-secondary sm:text-base",children:r.map((e,t)=>(0,w.jsx)(a7.SoftReveal,{as:"p",delay:.08*t,children:e},e.slice(0,32)))}),a?.length?(0,w.jsxs)(a7.SoftReveal,{delay:.12,className:"mt-6 max-w-[42rem]",children:[(0,w.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ink-tertiary",children:"What I worked on"}),(0,w.jsx)("ul",{className:"mt-3 grid gap-x-6 gap-y-2 border-y border-ink/[0.07] py-4 text-[13px] leading-relaxed text-ink-secondary sm:grid-cols-2 sm:text-[14px]",children:a.map(e=>(0,w.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,w.jsx)("span",{"aria-hidden":"true",className:"mt-[0.58em] h-1 w-1 shrink-0 rounded-full bg-accent"}),(0,w.jsx)("span",{children:e})]},e))})]}):null,n?.length?(0,w.jsx)(a7.SoftReveal,{delay:.16,className:"mt-5 max-w-[42rem]",children:(0,w.jsx)(ne.TechPillRow,{size:"sm",label:`Tools I used at ${t}`,items:n.flatMap(({slug:e,note:t})=>{let r=(0,nt.getTech)(e);return r?[{slug:e,name:r.name,hex:r.hex,note:t}]:[]})})}
7):null,s]}),na=(0,a_.default)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),nn=(0,a_.default)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),ni=(0,a_.default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),ns=[{id:"capabilities",title:"What I build",subtitle:"Models, cloud, data and infrastructure",icon:(0,w.jsx)(ni,{size:16}),type:"work"},{id:"intero-2024",title:"Intero",subtitle:"Founding ML Engineer (2024-Present)",icon:(0,w.jsx)(na,{size:16}),type:"work"},{id:"viable-2022-2024",title:"Viable",subtitle:"Junior ML Engineer (2022-2024)",icon:(0,w.jsx)(na,{size:16}),type:"work"},{id:"client-projects-2026",title:"Vipulse",subtitle:"Software Engineer (2026)",icon:(0,w.jsx)(nn,{size:16}),type:"work"},{id:"cbu-bachelor",title:"CBU",subtitle:"Computer Engineering (2019-2023)",icon:(0,w.jsx)(a3,{size:16}),type:"education"},{id:"sapienza-erasmus",title:"Sapienza",subtitle:"Erasmus Exchange (2021-2022)",icon:(0,w.jsx)(a3,{size:16}),type:"education"}],no=(0,a_.default)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),nl="radial-gradient(ellipse 82% 72% at 50% 30%, black 0%, color-mix(in srgb, black 99%, transparent) 22%, color-mix(in srgb, black 94%, transparent) 36%, color-mix(in srgb, black 82%, transparent) 48%, color-mix(in srgb, black 63%, transparent) 59%, color-mix(in srgb, black 42%, transparent) 70%, color-mix(in srgb, black 24%, transparent) 80%, color-mix(in srgb, black 11%, transparent) 88%, color-mix(in srgb, black 4%, transparent) 95%, transparent 100%)";e.s(["HomeView",0,function({rails:e,contributions:t}){let[r,a]=(0,j.useState)(!1),[n,i]=(0,j.useState)(!1);(0,j.useEffect)(()=>{let e=()=>{i(window.scrollY>400)};return window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);let s=[{title:"Apr 2024 - Present",id:"intero-2024",logo:{src:"/company_logos/intero_logo_transparent.png",alt:"Intero Logo",aspectRatio:"square"},content:(0,w.jsx)(nr,{role:"Founding Machine Learning Engineer",company:"Intero",variant:"work",projects:e["intero-2024"],body:["I joined Intero as its founding machine learning engineer. I build the machine learning systems the product runs on, and I run the infrastructure they sit on."],highlights:["I built the LLM pipeline from scratch, and I still run it.","I train, evaluate and serve the models behind it, GPU work included.","I built the async data and vision infrastructure that feeds it.","I run the Google Cloud services and the Linux machines all of it sits on."],technologies:[{slug:"python",note:"The main pipeline, model and operations language"},{slug:"pytorch",note:"Training and inference for language and vision models"},{slug:"googlecloud",note:"Functions, VMs, IAM, secrets and deployment"},{slug:"firebase",note:"Firestore state and event-driven orchestration"},{slug:"tailscale",note:"Private access to Intero machines and services"},{slug:"docker",note:"Repeatable application and worker deployments"},{slug:"sentry",note:"Application errors with release context"}]})},{title:"Jun 2022 - May 2024",id:"viable-2022-2024",logo:{src:"/company_logos/viable_logo_horizontal.svg",alt:"Viable Logo",aspectRatio:"horizontal"},content:(0,w.jsx)(nr,{role:"Junior Machine Learning Engineer",company:"Viable",variant:"work",projects:e["viable-2022-2024"],body:["I spent two years working remotely with a US team, moving between the data side and the model side of the product depending on what needed building."],highlights:["I ran embedding and clustering services in production, GPU inference included.","I built the ingestion path that turned inconsistent customer files into usable data.","I chose the models and the clustering algorithms, and built the evaluation behind those choices.","I automated the recurring report work and the checks that ran before anything went out."],technologies:[{slug:"python",note:"Data services, automation and research tooling"},{slug:"pandas",note:"Ingestion, cleaning and dataset construction"}
7,{slug:"pytorch",note:"Transformer inference and model experiments"},{slug:"fastapi",note:"Embedding and clustering service contracts"},{slug:"googlecloud",note:"Functions, compute workers and object storage"},{slug:"postgresql",note:"Application and analytical data"}]})},{title:"2026 - Present",id:"client-projects-2026",logo:{src:"/personal_website_logo_ak.svg",alt:"Akıncan Kılıç",aspectRatio:"square"},content:(0,w.jsx)(nr,{role:"Software Engineer",company:"Vipulse",variant:"work",projects:e["client-projects-2026"],body:["I designed and built Vipulse’s multilingual corporate website and its publishing platform. The work covers the Next.js application, Payload CMS, PostgreSQL data model, lead capture, consent-aware analytics, search foundations and the release workflow.","I took the project from information architecture and visual system through implementation and deployment, with separate English and Hungarian content and a CMS workflow the company can operate directly."],highlights:["I built the application in Next.js, TypeScript and React.","I designed the Payload CMS collections and PostgreSQL publishing model.","I implemented multilingual routing, structured metadata, lead capture and consent-aware analytics.","I set up previews, validation and controlled Vercel releases."],technologies:[{slug:"typescript",note:"Application code and CMS contracts"},{slug:"nextdotjs",note:"App Router, server rendering and metadata"},{slug:"react",note:"The interface and interaction layer"},{slug:"payloadcms",note:"The publishing workflow and content model"},{slug:"postgresql",note:"The CMS system of record"},{slug:"vercel",note:"Previews and production releases"}]})},{title:"Sep 2019 - Jun 2023",id:"cbu-bachelor",logo:{src:"/education_logos/cbu_horizontal_english.png",alt:"Manisa Celal Bayar University Logo",aspectRatio:"horizontal",plate:.72},content:(0,w.jsx)(nr,{role:"BSc Computer Engineering",company:"Manisa Celal Bayar University",variant:"education",projects:e["cbu-bachelor"],body:["Four years of computer engineering fundamentals, including algorithms, operating systems, data analysis and artificial intelligence. I graduated as valedictorian with a 3.84 out of 4.00 GPA.","My graduation work included a custom wire protocol built directly on sockets and a tweet signal/noise classifier with data collection, annotation, transformer training and a small inference application."],highlights:["Algorithms, data structures and operating systems","Machine learning and statistical evaluation","Networking and protocol design","Software engineering and database systems"]})},{title:"Sep 2021 - Feb 2022",id:"sapienza-erasmus",logo:{src:"/education_logos/sapienza-universita-di-roma-seeklogo.png",alt:"Sapienza University Logo",aspectRatio:"horizontal",plate:.72},content:(0,w.jsx)(nr,{role:"Erasmus exchange",company:"Sapienza Università di Roma",variant:"education",projects:e["sapienza-erasmus"],body:["A semester in Rome studying machine learning, cybersecurity and software engineering. Living and studying abroad also gave me the chance to learn Italian and work in a new academic environment."],highlights:["Machine learning coursework","Cybersecurity coursework","Software engineering coursework","International study experience"]})}];return(0,j.useEffect)(()=>(window.dispatchEvent(new Event("theme:rays-changed")),()=>{window.dispatchEvent(new Event("theme:rays-changed"))}),[]),(0,w.jsx)(a8.TooltipSurface,{children:(0,w.jsx)("main",{className:"relative min-h-screen text-ink-primary",children:(0,w.jsxs)("div",{className:"w-full",children:[(0,w.jsx)(ev,{items:ns}),(0,w.jsx)(a9,{workStartId:"intero-2024",educationId:"cbu-bachelor"}),n?(0,w.jsx)("button",{onClick:()=>(0,ey.scrollToTop)(),className:"fixed bottom-[calc(6rem+var(--footer-clearance))] right-4 z-50 rounded-full border border-ink/10 bg-canvas-deep/40 p-2 text-ink-primary shadow-lg transition-all duration-300 hover:bg-canvas-deep/60 sm:bottom-[calc(2rem+var(--footer-clearance))] sm:right-8 sm:p-3","aria-label":"Scroll to top",children:(0,w.jsx)(no,{size:20,className:"sm:h-6 sm:w-6"})}):null,(0,w.jsxs)("div",{className:"flex min-h-screen flex-col items-center px-3 pb-16 pt-6 sm:px-5 sm:pb-24 sm:pt-10",children:[(0,w.jsxs)("section",{className:"relative flex min-h-[calc(100svh-6rem)] w-full max-w-6xl flex-col items-center pb-10 pt-8 sm:pb-16 sm:pt-12",children:[(0,w.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute left-1/2 top-[-17rem] z-0 h-[54rem] w-screen -translate-x-1/2 overflow-hidden sm:top-[-22rem] sm:h-[68rem]",children:(0,w.jsx)("div",{className:"relative left-1/2 h-full w-[min(1760px,168vw)] max-w-none -translate-x-1/2 select-none sm:w-[min(2040px,142vw)]",style:{maskImage:nl,WebkitMaskImage:nl},children:(0,w.jsx)("div",{"data-parallax-ray":!0,className:"relative h-full w-full",children:(0,w.jsx)(em.default,{src:"/visuals/god-ray.webp",alt:"",fill:!0,priority:!0,sizes:"(max-width: 640px) 168vw, 142vw",className:"object-cover object-[38%_top] brightness-[1.65] contrast-125 saturate-125 mix-blend-screen opacity-100"})})})}),(0,w.jsxs)("div",{className:"relative z-10 flex w-full flex-col items-center",children:[(0,w.jsxs)("h1",{className:"min-h-[1.05em] max-w-[11ch] text-center font-serif text-[clamp(3.35rem,11vw,6rem)] font-normal leading-[0.92] tracking-[-0.035em] text-ink-primary [text-shadow:0_3px_28px_rgb(var(--color-shadow-rgb)/0.48)]",children:[(0,w.jsx)("span",{className:"sr-only",children:"Akıncan Kılıç"}),(0,w.jsx)("span",{"aria-hidden":"true",children:(0,w.jsx)(aQ,{text:"Akıncan Kılıç",typingSpeed:100,infiniteCursor:!1,onTypingComplete:()=>a(!0)})})]}),(0,w.jsx)("p",{className:"mt-4 min-h-10 max-w-full px-2 text-center text-sm sm:min-h-6 text-accent-soft/[0.82] [text-shadow:0_2px_18px_rgb(var(--color-shadow-rgb)/0.58)] sm:text-base",children:(0,w.jsx)(a2,{texts:["Machine Learning Engineer","Software Engineer","Production AI and ML systems","Python, TypeScript and Google Cloud","Model training, evaluation and deployment","Founding Machine Learning Engineer at Intero"],holdMs:2600,shouldStart:r,startDelay:700})}),(0,w.jsx)("div",{id:"chat",className:"relative mt-8 flex w-full scroll-mt-28 justify-center px-0 py-6 sm:mt-12 sm:px-8 sm:py-12",children:(0,w.jsxs)("div",{className:"relative flex w-full max-w-xl flex-col items-center",children:[(0,w.jsx)(a4.TextReveal,{as:"h2",text:"Talk to me.",className:"mb-7 font-serif text-[2.4rem] font-normal leading-none tracking-[-0.025em] text-ink-primary [text-shadow:0_2px_20px_rgb(var(--color-shadow-rgb)/0.52)] sm:text-[3rem]"}),(0,w.jsx)(aV,{})]})})]})]}),(0,w.jsxs)("div",{className:"w-full overflow-x-clip",children:[(0,w.jsx)("div",{className:"mx-auto mt-10 w-full max-w-6xl py-12 sm:mt-16 sm:py-20",children:(0,w.jsx)(a6.CapabilityMap,{})}),(0,w.jsxs)("div",{className:"mx-auto w-full max-w-6xl py-12 sm:py-20",children:[(0,w.jsx)(a4.TextReveal,{as:"h2",text:"Experience & Education",className:"mb-6 text-center font-serif text-3xl font-normal tracking-[-0.025em] text-ink-primary sm:mb-10 sm:text-4xl md:text-5xl"}),(0,w.jsx)(eg,{data:s})]}),t?(0,w.jsx)("div",{className:"w-full py-12 sm:py-20",children:t}):null]})]})]})})})}],94059)},19348,e=>{"use strict";var t=e.i(29977),r=e.i(15947),a=e.i(14507),n=e.i(29805);e.i(45487);var i=e.i(89361),s=e.i(21425),o=e.i(36255),l=e.i(75157);let u=o.GRAPH_PALETTES;function c(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let t=new Date(`${e}T00:00:00.000Z`);return Number.isNaN(t.getTime())?null:t}function d(e,t){let r=new Date(e);return r.setUTCDate(r.getUTCDate()+t),r}function f(e){let t=e.map(e=>({...e,parsedDate:c(e.date)})).filter(e=>null!==e.parsedDate&&Number.isFinite(e.count)).sort((e,t)=>
7e.date.localeCompare(t.date));if(0===t.length)return[];let r=Math.max(0,...t.map(e=>e.count)),a=new Map(t.map(e=>[e.date,e])),n=t[0].parsedDate,i=t[t.length-1].parsedDate,s=d(n,-n.getUTCDay()),o=d(i,6-i.getUTCDay()),l=[];for(let e=s;e<=o;e=d(e,1)){let t=e.toISOString().slice(0,10),n=a.get(t),i=Math.max(0,n?.count??0),s=n?.level,o=Number.isInteger(s)&&s>=0&&s<=4?0===i?0:s:!Number.isFinite(i)||i<=0||r<=0?0:Math.min(4,Math.max(1,Math.ceil(i/r*4)));l.push({date:t,count:i,level:o})}return Array.from({length:Math.ceil(l.length/7)},(e,t)=>l.slice(7*t,7*t+7))}function p(e){let t=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(c(e.date)??new Date),r=1===e.count?"contribution":"contributions";return`${e.count} ${r} \xb7 ${t}`}function h({cellSize:e,cellGap:r,cellRadius:a,months:n,autoFit:i,autoFitColumns:s}){let o=Math.ceil((31*Math.max(1,n??3)+6)/7);return i?(0,t.jsx)("div",{className:"w-full overflow-hidden",children:(0,t.jsx)("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${s}, ${e}px)`,gap:r,justifyContent:"space-between"},"aria-label":"Loading contributions",children:Array.from({length:7*o},(r,n)=>(0,t.jsx)("span",{className:"animate-pulse bg-muted",style:{width:e,height:e,borderRadius:a,animationDelay:`${12*n}ms`}},n))})}):(0,t.jsx)("div",{className:"overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:(0,t.jsx)("div",{className:"flex min-w-max",style:{gap:r},"aria-label":"Loading contributions",children:Array.from({length:o},(n,i)=>(0,t.jsx)("div",{className:"grid grid-rows-7",style:{gap:r},children:Array.from({length:7},(r,n)=>(0,t.jsx)("span",{className:"animate-pulse bg-muted",style:{width:e,height:e,borderRadius:a,animationDelay:`${(i+n)*12}ms`}},n))},i))})})}function m({account:e="shadcn",months:o=6,variant:d="github",animation:g="wave",animationSpeed:y=1,cellSize:v=18,cellGap:b=4,cellRadius:x=3,autoFit:_=!1,showLegend:w=!1,showAccount:k=!0,ambientEffect:E="twinkle",ambientIntensity:j=.65,data:T,className:S}){let I=r.useRef(null),A=function(){s.hasReducedMotionListener.current||(0,i.initPrefersReducedMotion)();let[e]=(0,r.useState)(s.prefersReducedMotion.current);return e}(),N=r.useMemo(()=>{let t;return t=e.trim().replace(/^@+/,""),/^(?!-)[a-z\d](?:[a-z\d-]{0,37}[a-z\d])?$/i.test(t)?t:null},[e]),[C,O]=r.useState({status:"loading"}),[R,M]=r.useState(0),[P,L]=r.useState(null),Z=u[d],$=Math.max(0,Math.min(x,Math.max(0,v)/2)),z=Math.max(1,Math.floor((R+Math.max(0,b))/Math.max(1,v+b)));r.useLayoutEffect(()=>{if(!_||!I.current)return;let e=I.current,t=()=>M(e.clientWidth);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[_]),r.useEffect(()=>{if(T)return void O({status:"ready",contributions:T});if(!N)return void O({status:"error",message:"Enter a valid GitHub username."});let e=new AbortController;return O({status:"loading"}),fetch(`https://github-contributions-api.jogruber.de/v4/${N}?y=last`,{signal:e.signal}).then(async e=>{if(!e.ok)throw Error("GitHub account not found.");let t=await e.json();if(!Array.isArray(t.contributions))throw Error("No public contributions were returned.");return t.contributions}).then(t=>{e.signal.aborted||O({status:"ready",contributions:t})}).catch(t=>{e.signal.aborted||O({status:"error",message:t instanceof Error?t.message:"Could not load contributions."})}),()=>e.abort()},[T,N]);let F=r.useMemo(()=>"ready"!==C.status?[]:f(function(e,t){let r=e.map(e=>({contribution:e,date:c(e.date)})).filter(e=>null!==e.date),a=r.reduce((e,t)=>!e||t.date>e?t.date:e,null);if(!a)return[];let n=new Date(a);return n.setUTCMonth(n.getUTCMonth()-Math.max(1,Math.min(12,Math.round(t)))),r.filter(e=>e.date>=n).map(e=>e.contribution)}(C.contributions,o)),[o,C]),B=`${N??e}-${o}-${d}-${g}-${v}-${b}-${_}`,D=r.useCallback((e,t,r,a,n)=>{let i=e.getBoundingClientRect(),s=i.top>56?"above":"below",o=Math.min(Math.max(i.left+i.width/2,96),window.innerWidth-96);L({contribution:t,left:o,top:"above"===s?i.top-9:i.bottom+9,originLeft:n?.clientX??o,originTop:n?.clientY??i.top+i.height/2,placement:s,weekIndex:r,dayIndex:a})},[]),U=(e,r,a)=>
7{let i=p(e),s=A?0:"none"===g?0:("wave"===g?.026*r+.016*a:"scan"===g?.03*r:(r+2*a)*.018)/Math.max(y,.1),o=function(e,t,r,a,n,i){if(i||"none"===e)return{animate:{opacity:1,scale:1},transition:{opacity:{duration:.14,delay:n},scale:{type:"spring",stiffness:900,damping:32}}};let s=Math.min(1,Math.max(0,t)),o=(17*r+31*a)%11/10,l="tide"===e,u="drift"===e,c=l?3.2:u?3.8+o:2+1.4*o,d=n+(l?(r+1.8*a)*.055:.85*o),f=1-(l?.24:u?.16:.34)*s,p=1-(l?.07:u?.04:.08)*s;return{animate:{opacity:u?[1,f,1-.06*s,1]:[1,f,1],scale:u?[1,p,1+.025*s,1]:[1,p,1]},transition:{opacity:{duration:c,delay:d,ease:"easeInOut",repeat:1/0},scale:{duration:c,delay:d,ease:"easeInOut",repeat:1/0}}}}(E,j,r,a,s,A),l=Math.max(0,1-(P?Math.hypot(r-P.weekIndex,a-P.dayIndex):1/0)/3),u=`brightness(${1+.45*l}) saturate(${1+.2*l})`;return(0,t.jsx)(n.motion.button,{type:"button",role:"gridcell","aria-label":i,className:"relative outline-none ring-offset-2 ring-offset-background transition-shadow focus-visible:ring-2 focus-visible:ring-foreground/60",style:{width:v,height:v,borderRadius:$},initial:!A&&"none"!==g&&{opacity:0,scale:.35,y:4},animate:{opacity:1,scale:1,y:0,filter:u},transition:{opacity:{duration:.14,delay:s},y:{type:"spring",stiffness:520,damping:28,delay:s},scale:{type:"spring",stiffness:900,damping:32},filter:{duration:.08,ease:"easeOut"}},onMouseEnter:t=>D(t.currentTarget,e,r,a,t),onFocus:t=>D(t.currentTarget,e,r,a),onBlur:()=>L(null),children:(0,t.jsx)(n.motion.span,{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{backgroundColor:Z[e.level],borderRadius:$},animate:o.animate,transition:o.transition})},`${B}-${e.date}`)};return(0,t.jsxs)("div",{ref:I,className:(0,l.cn)(_?"w-full":"w-fit max-w-full",S),"aria-busy":"loading"===C.status,children:[k&&(0,t.jsxs)("p",{className:"mb-5 text-lg font-medium tracking-tight text-foreground",children:["@",N??e]}),"loading"===C.status&&(0,t.jsx)(h,{cellSize:v,cellGap:b,cellRadius:$,months:o,autoFit:_,autoFitColumns:z}),"error"===C.status&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:C.message}),"ready"===C.status&&F.length>0&&(0,t.jsx)("div",{className:(0,l.cn)("py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_?"w-full overflow-hidden":"overflow-x-auto"),children:(0,t.jsxs)("div",{className:(0,l.cn)("relative",_?"grid w-full":"flex min-w-max"),style:_?{gridTemplateColumns:`repeat(${z}, ${v}px)`,gap:b,justifyContent:"space-between"}:{gap:b},role:"grid","aria-label":`GitHub contributions for ${N??e}`,onMouseLeave:()=>L(null),children:[_?F.flat().map((e,t)=>U(e,t%z,Math.floor(t/z))):F.map((e,r)=>(0,t.jsx)("div",{className:"grid grid-rows-7",style:{gap:b},role:"row",children:e.map((e,t)=>U(e,r,t))},`${B}-${r}`)),(0,t.jsx)(a.AnimatePresence,{children:P&&(0,t.jsx)(n.motion.span,{role:"tooltip",className:"pointer-events-none fixed z-50 whitespace-nowrap rounded-full bg-foreground px-3 py-1.5 text-sm font-medium text-background ring-1 ring-foreground/15",initial:{opacity:0,scale:.92,left:P.originLeft,top:P.originTop,x:"-50%",y:"above"===P.placement?"-100%":"0%"},animate:{opacity:1,scale:1,left:P.left,top:P.top,x:"-50%",y:"above"===P.placement?"-100%":"0%"},exit:{opacity:0,scale:.92},transition:{opacity:{duration:.12},scale:{duration:.12},left:{type:"spring",stiffness:620,damping:42},top:{type:"spring",stiffness:620,damping:42},y:{duration:.12}},children:p(P.contribution)})})]})}),w&&"ready"===C.status&&(0,t.jsx)("div",{className:"mt-4 flex gap-1.5","aria-label":"Contribution activity legend",children:Z.map((e,r)=>(0,t.jsx)("span",{style:{width:v,height:v,backgroundColor:e,borderRadius:$},"aria-label":`Level ${r}`},e))})]})}e.s(["FittedGithubGraph",0,function({contributions:e,account:a}){let n=(0,r.useRef)(null),i=(0,r.useMemo)(()=>f(e).length,[e]),[s,o]=(0,r.useState)(13),[l,u]=(0,r.useState)(3);return(0,r.useLayoutEffect)(()=>{let e=n.current;if(!e||i<=0)return;let t=()=>{let t=function(e,t){if(e<=0||t<=0)return{cellSize:13,cellGap:3};let r=e/t,a=r>=16?3:r>=7?2:1;return{cellSize:Math.max(2,Math.min(13,Math.floor((e-(t-1)*a)/t))),cellGap:a}}(e.clientWidth,i);o(e=>e===t.cellSize?e:t.cellSize),u(e=>e===t.cellGap?e:t.cellGap)};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[i]),(0,t.jsx)("div",{ref:n,className:"w-full overflow-hidden",children:(0,t.jsx)(m,{account:a,data:e,months:12,variant:"violet",animation:"wave",ambientEffect:"none",showAccount:!1,showLegend:!0,cellSize:s,cellGap:l,cellRadius:Math.max(1,Math.round(s/4)),className:"max-w-none"})})}],19348)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.