PageSourceSearch

https://appraisalbureau.com/assets/index-oxgqk5Zl.js

js appraisalbureau.com collected 2026-10-07 14:46:41 UTC 2,049,795 bytes, 5,129 lines download raw bytes

vendor: 4,841 bytes, lines 1-9
1var B5=Object.defineProperty;var mS=e=>{throw TypeError(e)};var U5=(e,t,r)=>t in e?B5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>U5(e,typeof t!="symbol"?t+"":t,r),Xv=(e,t,r)=>t.has(e)||mS("Cannot "+r);var Ve=(e,t,r)=>(Xv(e,t,"read from private field"),r?r.call(e):t.get(e)),mr=(e,t,r)=>t.has(e)?mS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Vt=(e,t,r,n)=>(Xv(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),as=(e,t,r)=>(Xv(e,t,"access private method"),r);var Sf=(e,t,r,n)=>({set _(s){Vt(e,t,s,r)},get _(){return Ve(e,t,n)}});function W5(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function Zd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xN={exports:{}},Yg={},bN={exports:{}},Jt={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Th=Symbol.for("react.element"),V5=Symbol.for("react.portal"),G5=Symbol.for("react.fragment"),q5=Symbol.for("react.strict_mode"),H5=Symbol.for("react.profiler"),K5=Symbol.for("react.provider"),Q5=Symbol.for("react.context"),Y5=Symbol.for("react.forward_ref"),J5=Symbol.for("react.suspense"),Z5=Symbol.for("react.memo"),X5=Symbol.for("react.lazy"),gS=Symbol.iterator;function e6(e){return e===null||typeof e!="object"?null:(e=gS&&e[gS]||e["@@iterator"],typeof e=="function"?e:null)}var kN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TN=Object.assign,MN={};function Xd(e,t,r){this.props=e,this.context=t,this.refs=MN,this.updater=r||kN}Xd.prototype.isReactComponent={};Xd.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Xd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function EN(){}EN.prototype=Xd.prototype;function Zb(e,t,r){this.props=e,this.context=t,this.refs=MN,this.updater=r||kN}var Xb=Zb.prototype=new EN;Xb.constructor=Zb;TN(Xb,Xd.prototype);Xb.isPureReactComponent=!0;var yS=Array.isArray,SN=Object.prototype.hasOwnProperty,e0={current:null},AN={key:!0,ref:!0,__self:!0,__source:!0};function PN(e,t,r){var n,s={},a=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)SN.call(t,n)&&!AN.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Th,type:e,key:a,ref:i,props:s,_owner:e0.current}}function t6(e,t){return{$$typeof:Th,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function t0(e){return typeof e=="object"&&e!==null&&e.$$typeof===Th}function r6(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var vS=/\/+/g;function e_(e,t){return typeof e=="object"&&e!==null&&e.key!=null?r6(""+e.key):t.toString(36)}function Sm(e,t,r,n,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Th:case V5:i=!0}}if(i)return i=e,s=s(i),e=n===""?"."+e_(i,0):n,yS(s)?(r="",e!=null&&(r=e.replace(vS,"$&/")+"/"),Sm(s,t,r,"",function(d){return d})):s!=null&&(t0(s)&&(s=t6(s,r+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(vS,"$&/")+"/")+e)),t.push(s)),1;if(i=0,n=n===""?".":n+":",yS(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+e_(a,l);
vendor: 4,254 bytes, lines 9-17
9i+=Sm(a,t,r,c,s)}else if(c=e6(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+e_(a,l++),i+=Sm(a,t,r,c,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Af(e,t,r){if(e==null)return e;var n=[],s=0;return Sm(e,n,"","",function(a){return t.call(r,a,s++)}),n}function n6(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xs={current:null},Am={transition:null},s6={ReactCurrentDispatcher:xs,ReactCurrentBatchConfig:Am,ReactCurrentOwner:e0};function CN(){throw Error("act(...) is not supported in production builds of React.")}Jt.Children={map:Af,forEach:function(e,t,r){Af(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Af(e,function(){t++}),t},toArray:function(e){return Af(e,function(t){return t})||[]},only:function(e){if(!t0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Jt.Component=Xd;Jt.Fragment=G5;Jt.Profiler=H5;Jt.PureComponent=Zb;Jt.StrictMode=q5;Jt.Suspense=J5;Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s6;Jt.act=CN;Jt.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=TN({},e.props),s=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=e0.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)SN.call(t,c)&&!AN.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:Th,type:e.type,key:s,ref:a,props:n,_owner:i}};Jt.createContext=function(e){return e={$$typeof:Q5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:K5,_context:e},e.Consumer=e};Jt.createElement=PN;Jt.createFactory=function(e){var t=PN.bind(null,e);return t.type=e,t};Jt.createRef=function(){return{current:null}};Jt.forwardRef=function(e){return{$$typeof:Y5,render:e}};Jt.isValidElement=t0;Jt.lazy=function(e){return{$$typeof:X5,_payload:{_status:-1,_result:e},_init:n6}};Jt.memo=function(e,t){return{$$typeof:Z5,type:e,compare:t===void 0?null:t}};Jt.startTransition=function(e){var t=Am.transition;Am.transition={};try{e()}finally{Am.transition=t}};Jt.unstable_act=CN;Jt.useCallback=function(e,t){return xs.current.useCallback(e,t)};Jt.useContext=function(e){return xs.current.useContext(e)};Jt.useDebugValue=function(){};Jt.useDeferredValue=function(e){return xs.current.useDeferredValue(e)};Jt.useEffect=function(e,t){return xs.current.useEffect(e,t)};Jt.useId=function(){return xs.current.useId()};Jt.useImperativeHandle=function(e,t,r){return xs.current.useImperativeHandle(e,t,r)};Jt.useInsertionEffect=function(e,t){return xs.current.useInsertionEffect(e,t)};Jt.useLayoutEffect=function(e,t){return xs.current.useLayoutEffect(e,t)};Jt.useMemo=function(e,t){return xs.current.useMemo(e,t)};Jt.useReducer=function(e,t,r){return xs.current.useReducer(e,t,r)};Jt.useRef=function(e){return xs.current.useRef(e)};Jt.useState=function(e){return xs.current.useState(e)};Jt.useSyncExternalStore=function(e,t,r){return xs.current.useSyncExternalStore(e,t,r)};Jt.useTransition=function(){return xs.current.useTransition()};Jt.version="18.3.1";bN.exports=Jt;var D=bN.exports;const Le=Zd(D),jN=W5({__proto__:null,default:Le},[D]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var a6=D,i6=Symbol.for("react.element"),o6=Symbol.for("react.fragment"),l6=Object.prototype.hasOwnProperty,c6=a6.__SECRET_INT
vendor: 11,503 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d6={key:!0,ref:!0,__self:!0,__source:!0};function IN(e,t,r){var n,s={},a=null,i=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)l6.call(t,n)&&!d6.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:i6,type:e,key:a,ref:i,props:s,_owner:c6.current}}Yg.Fragment=o6;Yg.jsx=IN;Yg.jsxs=IN;xN.exports=Yg;var o=xN.exports,$N={exports:{}},Js={},NN={exports:{}},ON={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(V,ae){var ne=V.length;V.push(ae);e:for(;0<ne;){var L=ne-1>>>1,$=V[L];if(0<s($,ae))V[L]=ae,V[ne]=$,ne=L;else break e}}function r(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var ae=V[0],ne=V.pop();if(ne!==ae){V[0]=ne;e:for(var L=0,$=V.length,G=$>>>1;L<G;){var se=2*(L+1)-1,_e=V[se],de=se+1,Ee=V[de];if(0>s(_e,ne))de<$&&0>s(Ee,_e)?(V[L]=Ee,V[de]=ne,L=de):(V[L]=_e,V[se]=ne,L=se);else if(de<$&&0>s(Ee,ne))V[L]=Ee,V[de]=ne,L=de;else break e}}return ae}function s(V,ae){var ne=V.sortIndex-ae.sortIndex;return ne!==0?ne:V.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],d=[],p=1,u=null,h=3,f=!1,m=!1,v=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(V){for(var ae=r(d);ae!==null;){if(ae.callback===null)n(d);else if(ae.startTime<=V)n(d),ae.sortIndex=ae.expirationTime,t(c,ae);else break;ae=r(d)}}function w(V){if(v=!1,_(V),!m)if(r(c)!==null)m=!0,ee(x);else{var ae=r(d);ae!==null&&te(w,ae.startTime-V)}}function x(V,ae){m=!1,v&&(v=!1,y(S),S=-1),f=!0;var ne=h;try{for(_(ae),u=r(c);u!==null&&(!(u.expirationTime>ae)||V&&!q());){var L=u.callback;if(typeof L=="function"){u.callback=null,h=u.priorityLevel;var $=L(u.expirationTime<=ae);ae=e.unstable_now(),typeof $=="function"?u.callback=$:u===r(c)&&n(c),_(ae)}else n(c);u=r(c)}if(u!==null)var G=!0;else{var se=r(d);se!==null&&te(w,se.startTime-ae),G=!1}return G}finally{u=null,h=ne,f=!1}}var b=!1,M=null,S=-1,j=5,I=-1;function q(){return!(e.unstable_now()-I<j)}function U(){if(M!==null){var V=e.unstable_now();I=V;var ae=!0;try{ae=M(!0,V)}finally{ae?R():(b=!1,M=null)}}else b=!1}var R;if(typeof g=="function")R=function(){g(U)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,H=K.port2;K.port1.onmessage=U,R=function(){H.postMessage(null)}}else R=function(){k(U,0)};function ee(V){M=V,b||(b=!0,R())}function te(V,ae){S=k(function(){V(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_continueExecution=function(){m||f||(m=!0,ee(x))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(V){switch(h){case 1:case 2:case 3:var ae=3;break;default:ae=h}var ne=h;h=ae;try{return V()}finally{h=ne}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,ae){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ne=h;h=V;try{return ae()}finally{h=ne}},e.unstable_scheduleCallback=function(V,ae,ne){var L=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?L+ne:L):ne=L,V){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=ne+$,V={id:p++,callback:ae,priorityLevel:V,startTime:ne,expirationTime:$,sortIndex:-1},ne>L?(V.sortIndex=ne,t(d,V),r(c)===null&&V===r(d)&&(v?(y(S),S=-1):v=!0,te(w,ne-L))):(V.sortIndex=$,t(c,V),m||f||(m=!0,ee(x))),V},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(V){var ae=h;return function(){var ne=h;h=ae;try{return V.apply(this,arguments)}finally{h=ne}}}})(ON);NN.exports=ON;var u6=NN.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var p6=D,Ys=u6;function Xe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var RN=new Set,Bp={};function hc(e,t){zd(e,t),zd(e+"Capture",t)}function zd(e,t){for(Bp[e]=t,e=0;e<t.length;e++)RN.add(t[e])}var Ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ax=Object.prototype.hasOwnProperty,h6=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_S={},wS={};function f6(e){return ax.call(wS,e)?!0:ax.call(_S,e)?!1:h6.test(e)?wS[e]=!0:(_S[e]=!0,!1)}function m6(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function g6(e,t,r,n){if(t===null||typeof t>"u"||m6(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bs(e,t,r,n,s,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var ts={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ts[e]=new bs(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ts[t]=new bs(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ts[e]=new bs(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ts[e]=new bs(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ts[e]=new bs(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ts[e]=new bs(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ts[e]=new bs(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ts[e]=new bs(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ts[e]=new bs(e,5,!1,e.toLowerCase(),null,!1,!1)});var r0=/[\-:]([a-z])/g;function n0(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(r0,n0);ts[t]=new bs(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(r0,n0);ts[t]=new bs(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(r0,n0);ts[t]=new bs(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ts[e]=new bs(e,1,!1,e.toLowerCase(),null,!1,!1)});ts.xlinkHref=new bs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ts[e]=new bs(e,1,!1,e.toLowerCase(),null,!0,!0)});function s0(e,t,r,n){var s=ts.hasOwnProperty(t)?ts[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(g6(t,r,s,n)&&(r=null),n||s===null?f6(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Qi=p6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pf=Symbol.for("react.element"),td=Symbol.for("react.portal"),rd=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),ix=Symbol.for("react.profiler"),DN=Symbol.for("react.provider"),FN=Symbol.for("react.context"),i0=Symbol.for("react.forward_ref"),ox=Symbol.for("react.suspense"),lx=Symbol.for("react.suspense_list"),o0=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),LN=Symbol.for("react.offscreen"),xS=Symbol.iterator;function Wu(e){return e===null||typeof e!="object"?null:(e=xS&&e[xS]||e["@@iterator"],typeof e=="function"?e:null)}var Yr=Object.assign,t_;function mp(e){if(t_===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);t_=t&&t[1]||""}return`
34`+t_+e}var r_=!1;function n_(e,t){if(!e||r_)return"";r_=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var n=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){n=d}e.call(t.prototype)}else{try{throw Error()}catch(d){n=d}e()}}
vendor: 14,106 bytes, lines 34-37
34catch(d){if(d&&n&&typeof d.stack=="string"){for(var s=d.stack.split(`
35`),a=n.stack.split(`
36`),i=s.length-1,l=a.length-1;1<=i&&0<=l&&s[i]!==a[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==a[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==a[l]){var c=`
37`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{r_=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?mp(e):""}function y6(e){switch(e.tag){case 5:return mp(e.type);case 16:return mp("Lazy");case 13:return mp("Suspense");case 19:return mp("SuspenseList");case 0:case 2:case 15:return e=n_(e.type,!1),e;case 11:return e=n_(e.type.render,!1),e;case 1:return e=n_(e.type,!0),e;default:return""}}function cx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case rd:return"Fragment";case td:return"Portal";case ix:return"Profiler";case a0:return"StrictMode";case ox:return"Suspense";case lx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case FN:return(e.displayName||"Context")+".Consumer";case DN:return(e._context.displayName||"Context")+".Provider";case i0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case o0:return t=e.displayName||null,t!==null?t:cx(e.type)||"Memo";case _o:t=e._payload,e=e._init;try{return cx(e(t))}catch{}}return null}function v6(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cx(t);case 8:return t===a0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _6(e){var t=zN(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cf(e){e._valueTracker||(e._valueTracker=_6(e))}function BN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zN(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Zm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dx(e,t){var r=t.checked;return Yr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function bS(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Vo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function UN(e,t){t=t.checked,t!=null&&s0(e,"checked",t,!1)}function ux(e,t){UN(e,t);var r=Vo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?px(e,t.type,r):t.hasOwnProperty("defaultValue")&&px(e,t.type,Vo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function kS(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function px(e,t,r){(t!=="number"||Zm(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var gp=Array.isArray;function vd(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Vo(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function hx(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Xe(91));return Yr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function TS(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Xe(92));if(gp(r)){if(1<r.length)throw Error(Xe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Vo(r)}}function WN(e,t){var r=Vo(t.value),n=Vo(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function MS(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function VN(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?VN(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var jf,GN=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(jf=jf||document.createElement("div"),jf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=jf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Up(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Mp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},w6=["Webkit","ms","Moz","O"];Object.keys(Mp).forEach(function(e){w6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mp[t]=Mp[e]})});function qN(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Mp.hasOwnProperty(e)&&Mp[e]?(""+t).trim():t+"px"}function HN(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=qN(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var x6=Yr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mx(e,t){if(t){if(x6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Xe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Xe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Xe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Xe(62))}}function gx(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yx=null;function l0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vx=null,_d=null,wd=null;function ES(e){if(e=Sh(e)){if(typeof vx!="function")throw Error(Xe(280));var t=e.stateNode;t&&(t=ty(t),vx(e.stateNode,e.type,t))}}function KN(e){_d?wd?wd.push(e):wd=[e]:_d=e}function QN(){if(_d){var e=_d,t=wd;if(wd=_d=null,ES(e),t)for(e=0;e<t.length;e++)ES(t[e])}}function YN(e,t){return e(t)}function JN(){}var s_=!1;function ZN(e,t,r){if(s_)return e(t,r);s_=!0;try{return YN(e,t,r)}finally{s_=!1,(_d!==null||wd!==null)&&(JN(),QN())}}function Wp(e,t){var r=e.stateNode;if(r===null)return null;var n=ty(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Xe(231,t,typeof r));return r}var _x=!1;if(Ui)try{var Vu={};Object.defineProperty(Vu,"passive",{get:function(){_x=!0}}),window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{_x=!1}function b6(e,t,r,n,s,a,i,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(p){this.onError(p)}}var Ep=!1,Xm=null,eg=!1,wx=null,k6={onError:function(e){Ep=!0,Xm=e}};function T6(e,t,r,n,s,a,i,l,c){Ep=!1,Xm=null,b6.apply(k6,arguments)}function M6(e,t,r,n,s,a,i,l,c){if(T6.apply(this,arguments),Ep){if(Ep){var d=Xm;Ep=!1,Xm=null}else throw Error(Xe(198));eg||(eg=!0,wx=d)}}function fc(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function XN(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function SS(e){if(fc(e)!==e)throw Error(Xe(188))}function E6(e){var t=e.alternate;if(!t){if(t=fc(e),t===null)throw Error(Xe(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return SS(s),e;if(a===n)return SS(s),t;a=a.sibling}throw Error(Xe(188))}if(r.return!==n.return)r=s,n=a;else{for(var i=!1,l=s.child;l;){if(l===r){i=!0,r=s,n=a;break}if(l===n){i=!0,n=s,r=a;break}l=l.sibling}if(!i){for(l=a.child;l;){if(l===r){i=!0,r=a,n=s;break}if(l===n){i=!0,n=a,r=s;break}l=l.sibling}if(!i)throw Error(Xe(189))}}if(r.alternate!==n)throw Error(Xe(190))}if(r.tag!==3)throw Error(Xe(188));return r.stateNode.current===r?e:t}function eO(e){return e=E6(e),e!==null?tO(e):null}function tO(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=tO(e);if(t!==null)return t;e=e.sibling}return null}var rO=Ys.unstable_scheduleCallback,AS=Ys.unstable_cancelCallback,S6=Ys.unstable_shouldYield,A6=Ys.unstable_requestPaint,mn=Ys.unstable_now,P6=Ys.unstable_getCurrentPriorityLevel,c0=Ys.unstable_ImmediatePriority,nO=Ys.unstable_UserBlockingPriority,tg=Ys.unstable_NormalPriority,C6=Ys.unstable_LowPriority,sO=Ys.unstable_IdlePriority,Jg=null,bi=null;function j6(e){if(bi&&typeof bi.onCommitFiberRoot=="function")try{bi.onCommitFiberRoot(Jg,e,void 0,(e.current.flags&128)===128)}catch{}}var Ha=Math.clz32?Math.clz32:N6,I6=Math.log,$6=Math.LN2;function N6(e){return e>>>=0,e===0?32:31-(I6(e)/$6|0)|0}var If=64,$f=4194304;function yp(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function rg(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,i=r&268435455;if(i!==0){var l=i&~s;l!==0?n=yp(l):(a&=i,a!==0&&(n=yp(a)))}else i=r&~s,i!==0?n=yp(i):a!==0&&(n=yp(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Ha(t),s=1<<r,n|=e[r],t&=~s;return n}function O6(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function R6(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-Ha(a),l=1<<i,c=s[i];c===-1?(!(l&r)||l&n)&&(s[i]=O6(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function xx(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function aO(){var e=If;return If<<=1,!(If&4194240)&&(If=64),e}function a_(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Mh(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ha(t),e[t]=r}function D6(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Ha(r),a=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~a}}function d0(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Ha(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var wr=0;function iO(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var oO,u0,lO,cO,dO,bx=!1,Nf=[],No=null,Oo=null,Ro=null,Vp=new Map,Gp=new Map,bo=[],F6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function PS(e,t){switch(e){case"focusin":case"focusout":No=null;break;case"dragenter":case"dragleave":Oo=null;break;case"mouseover":case"mouseout":Ro=null;break;case"pointerover":case"pointerout":Vp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gp.delete(t.pointerId)}}function Gu(e,t,r,n,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[s]},t!==null&&(t=Sh(t),t!==null&&u0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function L6(e,t,r,n,s){switch(t){case"focusin":return No=Gu(No,e,t,r,n,s),!0;case"dragenter":return Oo=Gu(Oo,e,t,r,n,s),!0;case"mouseover":return Ro=Gu(Ro,e,t,r,n,s),!0;case"pointerover":var a=s.pointerId;return Vp.set(a,Gu(Vp.get(a)||null,e,t,r,n,s)),!0;case"gotpointercapture":return a=s.pointerId,Gp.set(a,Gu(Gp.get(a)||null,e,t,r,n,s)),!0}return!1}function uO(e){var t=Ul(e.target);if(t!==null){var r=fc(t);if(r!==null){if(t=r.tag,t===13){if(t=XN(r),t!==null){e.blockedOn=t,dO(e.priority,function(){lO(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=kx(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);yx=n,r.target.dispatchEvent(n),yx=null}else return t=Sh(r),t!==null&&u0(t),e.blockedOn=r,!1;t.shift()}return!0}function CS(e,t,r){Pm(e)&&r.delete(t)}function z6(){bx=!1,No!==null&&Pm(No)&&(No=null),Oo!==null&&Pm(Oo)&&(Oo=null),Ro!==null&&Pm(Ro)&&(Ro=null),Vp.forEach(CS),Gp.forEach(CS)}function qu(e,t){e.blockedOn===t&&(e.blockedOn=null,bx||(bx=!0,Ys.unstable_scheduleCallback(Ys.unstable_NormalPriority,z6)))}function qp(e){function t(s){return qu(s,e)}if(0<Nf.length){qu(Nf[0],e);for(var r=1;r<Nf.length;r++){var n=Nf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(No!==null&&qu(No,e),Oo!==null&&qu(Oo,e),Ro!==null&&qu(Ro,e),Vp.forEach(t),Gp.forEach(t),r=0;r<bo.length;r++)n=bo[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<bo.length&&(r=bo[0],r.blockedOn===null);)uO(r),r.blockedOn===null&&bo.shift()}var xd=Qi.ReactCurrentBatchConfig,ng=!0;function B6(e,t,r,n){var s=wr,a=xd.transition;xd.transition=null;try{wr=1,p0(e,t,r,n)}finally{wr=s,xd.transition=a}}function U6(e,t,r,n){var s=wr,a=xd.transition;xd.transition=null;try{wr=4,p0(e,t,r,n)}finally{wr=s,xd.transition=a}}function p0(e,t,r,n){if(ng){var s=kx(e,t,r,n);if(s===null)m_(e,t,n,sg,r),PS(e,n);else if(L6(s,e,t,r,n))n.stopPropagation();else if(PS(e,n),t&4&&-1<F6.indexOf(e)){for(;s!==null;){var a=Sh(s);if(a!==null&&oO(a),a=kx(e,t,r,n),a===null&&m_(e,t,n,sg,r),a===s)break;s=a}s!==null&&n.stopPropagation()}else m_(e,t,n,null,r)}}var sg=null;function kx(e,t,r,n){if(sg=null,e=l0(n),e=Ul(e),e!==null)if(t=fc(e),t===null)e=null;else if(r=t.tag,r===13){if(e=XN(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return sg=e,null}
vendor: 10,401 bytes, line 37
37function pO(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(P6()){case c0:return 1;case nO:return 4;case tg:case C6:return 16;case sO:return 536870912;default:return 16}default:return 16}}var jo=null,h0=null,Cm=null;function hO(){if(Cm)return Cm;var e,t=h0,r=t.length,n,s="value"in jo?jo.value:jo.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var i=r-e;for(n=1;n<=i&&t[r-n]===s[a-n];n++);return Cm=s.slice(e,1<n?1-n:void 0)}function jm(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Of(){return!0}function jS(){return!1}function Zs(e){function t(r,n,s,a,i){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Of:jS,this.isPropagationStopped=jS,this}return Yr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Of)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Of)},persist:function(){},isPersistent:Of}),t}var eu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f0=Zs(eu),Eh=Yr({},eu,{view:0,detail:0}),W6=Zs(Eh),i_,o_,Hu,Zg=Yr({},Eh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:m0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Hu&&(Hu&&e.type==="mousemove"?(i_=e.screenX-Hu.screenX,o_=e.screenY-Hu.screenY):o_=i_=0,Hu=e),i_)},movementY:function(e){return"movementY"in e?e.movementY:o_}}),IS=Zs(Zg),V6=Yr({},Zg,{dataTransfer:0}),G6=Zs(V6),q6=Yr({},Eh,{relatedTarget:0}),l_=Zs(q6),H6=Yr({},eu,{animationName:0,elapsedTime:0,pseudoElement:0}),K6=Zs(H6),Q6=Yr({},eu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y6=Zs(Q6),J6=Yr({},eu,{data:0}),$S=Zs(J6),Z6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tU(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eU[e])?!!t[e]:!1}function m0(){return tU}var rU=Yr({},Eh,{key:function(e){if(e.key){var t=Z6[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X6[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:m0,charCode:function(e){return e.type==="keypress"?jm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nU=Zs(rU),sU=Yr({},Zg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NS=Zs(sU),aU=Yr({},Eh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:m0}),iU=Zs(aU),oU=Yr({},eu,{propertyName:0,elapsedTime:0,pseudoElement:0}),lU=Zs(oU),cU=Yr({},Zg,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),dU=Zs(cU),uU=[9,13,27,32],g0=Ui&&"CompositionEvent"in window,Sp=null;Ui&&"documentMode"in document&&(Sp=document.documentMode);var pU=Ui&&"TextEvent"in window&&!Sp,fO=Ui&&(!g0||Sp&&8<Sp&&11>=Sp),OS=" ",RS=!1;function mO(e,t){switch(e){case"keyup":return uU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gO(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nd=!1;function hU(e,t){switch(e){case"compositionend":return gO(t);case"keypress":return t.which!==32?null:(RS=!0,OS);case"textInput":return e=t.data,e===OS&&RS?null:e;default:return null}}function fU(e,t){if(nd)return e==="compositionend"||!g0&&mO(e,t)?(e=hO(),Cm=h0=jo=null,nd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fO&&t.locale!=="ko"?null:t.data;default:return null}}var mU={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function DS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mU[e.type]:t==="textarea"}function yO(e,t,r,n){KN(n),t=ag(t,"onChange"),0<t.length&&(r=new f0("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ap=null,Hp=null;function gU(e){AO(e,0)}function Xg(e){var t=id(e);if(BN(t))return e}function yU(e,t){if(e==="change")return t}var vO=!1;if(Ui){var c_;if(Ui){var d_="oninput"in document;if(!d_){var FS=document.createElement("div");FS.setAttribute("oninput","return;"),d_=typeof FS.oninput=="function"}c_=d_}else c_=!1;vO=c_&&(!document.documentMode||9<document.documentMode)}function LS(){Ap&&(Ap.detachEvent("onpropertychange",_O),Hp=Ap=null)}function _O(e){if(e.propertyName==="value"&&Xg(Hp)){var t=[];yO(t,Hp,e,l0(e)),ZN(gU,t)}}function vU(e,t,r){e==="focusin"?(LS(),Ap=t,Hp=r,Ap.attachEvent("onpropertychange",_O)):e==="focusout"&&LS()}function _U(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xg(Hp)}function wU(e,t){if(e==="click")return Xg(t)}function xU(e,t){if(e==="input"||e==="change")return Xg(t)}function bU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ya=typeof Object.is=="function"?Object.is:bU;function Kp(e,t){if(Ya(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!ax.call(t,s)||!Ya(e[s],t[s]))return!1}return!0}function zS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function BS(e,t){var r=zS(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=zS(r)}}function wO(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wO(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xO(){for(var e=window,t=Zm();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Zm(e.document)}return t}function y0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function kU(e){var t=xO(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&wO(r.ownerDocument.documentElement,r)){if(n!==null&&y0(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=BS(r,a);var i=BS(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var TU=Ui&&"documentMode"in document&&11>=document.documentMode,sd=null,Tx=null,Pp=null,Mx=!1;function US(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mx||sd==null||sd!==Zm(n)||(n=sd,"selectionStart"in n&&y0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Pp&&Kp(Pp,n)||(Pp=n,n=ag(Tx,"onSelect"),0<n.length&&(t=new f0("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=sd)))}function Rf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ad={animationend:Rf("Animation","AnimationEnd"),animationiteration:Rf("Animation","AnimationIteration"),animationstart:Rf("Animation","AnimationStart"),transitionend:Rf("Transition","TransitionEnd")},u_={},bO={};Ui&&(bO=document.createElement("div").style,"AnimationEvent"in window||(delete ad.animationend.animation,delete ad.animationiteration.animation,delete ad.animationstart.animation),"TransitionEvent"in window||delete ad.transitionend.transition);function ey(e){if(u_[e])return u_[e];if(!ad[e])return e;var t=ad[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in bO)return u_[e]=t[r];return e}var kO=ey("animationend"),TO=ey("animationiteration"),MO=ey("animationstart"),EO=ey("transitionend"),SO=new Map,WS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Jo(e,t){SO.set(e,t),hc(t,[e])}for(var p_=0;p_<WS.length;p_++){var h_=WS[p_],MU=h_.toLowerCase(),EU=h_[0].toUpperCase()+h_.slice(1);Jo(MU,"on"+EU)}Jo(kO,"onAnimationEnd");Jo(TO,"onAnimationIteration");Jo(MO,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(EO,"onTransitionEnd");zd("onMouseEnter",["mouseout","mouseover"]);zd("onMouseLeave",["mouseout","mouseover"]);zd("onPointerEnter",["pointerout","pointerover"]);zd("onPointerLeave",["pointerout","pointerover"]);hc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hc("onBeforeInput",["compositionend","keypress","textInput","paste"]);hc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),SU=new Set("cancel close invalid load scroll toggle".split(" ").concat(vp));function VS(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,M6(n,t,void 0,e),e.currentTarget=null}function AO(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==a&&s.isPropagationStopped())break e;VS(s,l,d),a=c}else for(i=0;i<n.length;i++){if(l=n[i],c=l.instance,d=l.currentTarget,l=l.listener,c!==a&&s.isPropagationStopped())break e;VS(s,l,d),a=c}}}if(eg)throw e=wx,eg=!1,wx=null,e}function Fr(e,t){var r=t[Cx];r===void 0&&(r=t[Cx]=new Set);var n=e+"__bubble";r.has(n)||(PO(t,e,2,!1),r.add(n))}function f_(e,t,r){var n=0;t&&(n|=4),PO(r,e,n,t)}var Df="_reactListening"+Math.random().toString(36).slice(2);function Qp(e){if(!e[Df]){e[Df]=!0,RN.forEach(function(r){r!=="selectionchange"&&(SU.has(r)||f_(r,!1,e),f_(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Df]||(t[Df]=!0,f_("selectionchange",!1,t))}}function PO(e,t,r,n){switch(pO(t)){case 1:var s=B6;break;case 4:s=U6;break;default:s=p0}r=s.bind(null,t,r,e),s=void 0,!_x||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function m_(e,t,r,n,s){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;
vendor: 21,733 bytes, lines 37-38
37if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=n.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;i=i.return}for(;l!==null;){if(i=Ul(l),i===null)return;if(c=i.tag,c===5||c===6){n=a=i;continue e}l=l.parentNode}}n=n.return}ZN(function(){var d=a,p=l0(r),u=[];e:{var h=SO.get(e);if(h!==void 0){var f=f0,m=e;switch(e){case"keypress":if(jm(r)===0)break e;case"keydown":case"keyup":f=nU;break;case"focusin":m="focus",f=l_;break;case"focusout":m="blur",f=l_;break;case"beforeblur":case"afterblur":f=l_;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=IS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=G6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=iU;break;case kO:case TO:case MO:f=K6;break;case EO:f=lU;break;case"scroll":f=W6;break;case"wheel":f=dU;break;case"copy":case"cut":case"paste":f=Y6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=NS}var v=(t&4)!==0,k=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var g=d,_;g!==null;){_=g;var w=_.stateNode;if(_.tag===5&&w!==null&&(_=w,y!==null&&(w=Wp(g,y),w!=null&&v.push(Yp(g,w,_)))),k)break;g=g.return}0<v.length&&(h=new f(h,m,null,r,p),u.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",h&&r!==yx&&(m=r.relatedTarget||r.fromElement)&&(Ul(m)||m[Wi]))break e;if((f||h)&&(h=p.window===p?p:(h=p.ownerDocument)?h.defaultView||h.parentWindow:window,f?(m=r.relatedTarget||r.toElement,f=d,m=m?Ul(m):null,m!==null&&(k=fc(m),m!==k||m.tag!==5&&m.tag!==6)&&(m=null)):(f=null,m=d),f!==m)){if(v=IS,w="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=NS,w="onPointerLeave",y="onPointerEnter",g="pointer"),k=f==null?h:id(f),_=m==null?h:id(m),h=new v(w,g+"leave",f,r,p),h.target=k,h.relatedTarget=_,w=null,Ul(p)===d&&(v=new v(y,g+"enter",m,r,p),v.target=_,v.relatedTarget=k,w=v),k=w,f&&m)t:{for(v=f,y=m,g=0,_=v;_;_=Nc(_))g++;for(_=0,w=y;w;w=Nc(w))_++;for(;0<g-_;)v=Nc(v),g--;for(;0<_-g;)y=Nc(y),_--;for(;g--;){if(v===y||y!==null&&v===y.alternate)break t;v=Nc(v),y=Nc(y)}v=null}else v=null;f!==null&&GS(u,h,f,v,!1),m!==null&&k!==null&&GS(u,k,m,v,!0)}}e:{if(h=d?id(d):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var x=yU;else if(DS(h))if(vO)x=xU;else{x=_U;var b=vU}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(x=wU);if(x&&(x=x(e,d))){yO(u,x,r,p);break e}b&&b(e,h,d),e==="focusout"&&(b=h._wrapperState)&&b.controlled&&h.type==="number"&&px(h,"number",h.value)}switch(b=d?id(d):window,e){case"focusin":(DS(b)||b.contentEditable==="true")&&(sd=b,Tx=d,Pp=null);break;case"focusout":Pp=Tx=sd=null;break;case"mousedown":Mx=!0;break;case"contextmenu":case"mouseup":case"dragend":Mx=!1,US(u,r,p);break;case"selectionchange":if(TU)break;case"keydown":case"keyup":US(u,r,p)}var M;if(g0)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else nd?mO(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(fO&&r.locale!=="ko"&&(nd||S!=="onCompositionStart"?S==="onCompositionEnd"&&nd&&(M=hO()):(jo=p,h0="value"in jo?jo.value:jo.textContent,nd=!0)),b=ag(d,S),0<b.length&&(S=new $S(S,e,null,r,p),u.push({event:S,listeners:b}),M?S.data=M:(M=gO(r),M!==null&&(S.data=M)))),(M=pU?hU(e,r):fU(e,r))&&(d=ag(d,"onBeforeInput"),0<d.length&&(p=new $S("onBeforeInput","beforeinput",null,r,p),u.push({event:p,listeners:d}),p.data=M))}AO(u,t)})}function Yp(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ag(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=Wp(e,r),a!=null&&n.unshift(Yp(e,a,s)),a=Wp(e,t),a!=null&&n.push(Yp(e,a,s))),e=e.return}return n}function Nc(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function GS(e,t,r,n,s){for(var a=t._reactName,i=[];r!==null&&r!==n;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,s?(c=Wp(r,a),c!=null&&i.unshift(Yp(r,c,l))):s||(c=Wp(r,a),c!=null&&i.push(Yp(r,c,l)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var AU=/\r\n?/g,PU=/\u0000|\uFFFD/g;function qS(e){return(typeof e=="string"?e:""+e).replace(AU,`
38`).replace(PU,"")}function Ff(e,t,r){if(t=qS(t),qS(e)!==t&&r)throw Error(Xe(425))}function ig(){}var Ex=null,Sx=null;function Ax(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Px=typeof setTimeout=="function"?setTimeout:void 0,CU=typeof clearTimeout=="function"?clearTimeout:void 0,HS=typeof Promise=="function"?Promise:void 0,jU=typeof queueMicrotask=="function"?queueMicrotask:typeof HS<"u"?function(e){return HS.resolve(null).then(e).catch(IU)}:Px;function IU(e){setTimeout(function(){throw e})}function g_(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),qp(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);qp(t)}function Do(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function KS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var tu=Math.random().toString(36).slice(2),_i="__reactFiber$"+tu,Jp="__reactProps$"+tu,Wi="__reactContainer$"+tu,Cx="__reactEvents$"+tu,$U="__reactListeners$"+tu,NU="__reactHandles$"+tu;function Ul(e){var t=e[_i];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Wi]||r[_i]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=KS(e);e!==null;){if(r=e[_i])return r;e=KS(e)}return t}e=r,r=e.parentNode}return null}function Sh(e){return e=e[_i]||e[Wi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function id(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Xe(33))}function ty(e){return e[Jp]||null}var jx=[],od=-1;function Zo(e){return{current:e}}function Lr(e){0>od||(e.current=jx[od],jx[od]=null,od--)}function Rr(e,t){od++,jx[od]=e.current,e.current=t}var Go={},us=Zo(Go),Cs=Zo(!1),tc=Go;function Bd(e,t){var r=e.type.contextTypes;if(!r)return Go;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function js(e){return e=e.childContextTypes,e!=null}function og(){Lr(Cs),Lr(us)}function QS(e,t,r){if(us.current!==Go)throw Error(Xe(168));Rr(us,t),Rr(Cs,r)}function CO(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(Xe(108,v6(e)||"Unknown",s));return Yr({},r,n)}function lg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Go,tc=us.current,Rr(us,e),Rr(Cs,Cs.current),!0}function YS(e,t,r){var n=e.stateNode;if(!n)throw Error(Xe(169));r?(e=CO(e,t,tc),n.__reactInternalMemoizedMergedChildContext=e,Lr(Cs),Lr(us),Rr(us,e)):Lr(Cs),Rr(Cs,r)}var Ri=null,ry=!1,y_=!1;function jO(e){Ri===null?Ri=[e]:Ri.push(e)}function OU(e){ry=!0,jO(e)}function Xo(){if(!y_&&Ri!==null){y_=!0;var e=0,t=wr;try{var r=Ri;for(wr=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ri=null,ry=!1}catch(s){throw Ri!==null&&(Ri=Ri.slice(e+1)),rO(c0,Xo),s}finally{wr=t,y_=!1}}return null}var ld=[],cd=0,cg=null,dg=0,ua=[],pa=0,rc=null,Fi=1,Li="";function Nl(e,t){ld[cd++]=dg,ld[cd++]=cg,cg=e,dg=t}function IO(e,t,r){ua[pa++]=Fi,ua[pa++]=Li,ua[pa++]=rc,rc=e;var n=Fi;e=Li;var s=32-Ha(n)-1;n&=~(1<<s),r+=1;var a=32-Ha(t)+s;if(30<a){var i=s-s%5;a=(n&(1<<i)-1).toString(32),n>>=i,s-=i,Fi=1<<32-Ha(t)+s|r<<s|n,Li=a+e}else Fi=1<<a|r<<s|n,Li=e}function v0(e){e.return!==null&&(Nl(e,1),IO(e,1,0))}function _0(e){for(;e===cg;)cg=ld[--cd],ld[cd]=null,dg=ld[--cd],ld[cd]=null;for(;e===rc;)rc=ua[--pa],ua[pa]=null,Li=ua[--pa],ua[pa]=null,Fi=ua[--pa],ua[pa]=null}var Hs=null,qs=null,Ur=!1,Wa=null;function $O(e,t){var r=ga(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function JS(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Hs=e,qs=Do(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Hs=e,qs=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=rc!==null?{id:Fi,overflow:Li}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ga(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Hs=e,qs=null,!0):!1;default:return!1}}function Ix(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $x(e){if(Ur){var t=qs;if(t){var r=t;if(!JS(e,t)){if(Ix(e))throw Error(Xe(418));t=Do(r.nextSibling);var n=Hs;t&&JS(e,t)?$O(n,r):(e.flags=e.flags&-4097|2,Ur=!1,Hs=e)}}else{if(Ix(e))throw Error(Xe(418));e.flags=e.flags&-4097|2,Ur=!1,Hs=e}}}function ZS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Hs=e}function Lf(e){if(e!==Hs)return!1;if(!Ur)return ZS(e),Ur=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ax(e.type,e.memoizedProps)),t&&(t=qs)){if(Ix(e))throw NO(),Error(Xe(418));for(;t;)$O(e,t),t=Do(t.nextSibling)}if(ZS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Xe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){qs=Do(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}qs=null}}else qs=Hs?Do(e.stateNode.nextSibling):null;return!0}function NO(){for(var e=qs;e;)e=Do(e.nextSibling)}function Ud(){qs=Hs=null,Ur=!1}function w0(e){Wa===null?Wa=[e]:Wa.push(e)}var RU=Qi.ReactCurrentBatchConfig;function Ku(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Xe(309));var n=r.stateNode}if(!n)throw Error(Xe(147,e));var s=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var l=s.refs;i===null?delete l[a]:l[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(Xe(284));if(!r._owner)throw Error(Xe(290,e))}return e}function zf(e,t){throw e=Object.prototype.toString.call(t),Error(Xe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function XS(e){var t=e._init;return t(e._payload)}function OO(e){function t(y,g){if(e){var _=y.deletions;_===null?(y.deletions=[g],y.flags|=16):_.push(g)}}function r(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function n(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function s(y,g){return y=Bo(y,g),y.index=0,y.sibling=null,y}function a(y,g,_){return y.index=_,e?(_=y.alternate,_!==null?(_=_.index,_<g?(y.flags|=2,g):_):(y.flags|=2,g)):(y.flags|=1048576,g)}function i(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,g,_,w){return g===null||g.tag!==6?(g=T_(_,y.mode,w),g.return=y,g):(g=s(g,_),g.return=y,g)}function c(y,g,_,w){var x=_.type;return x===rd?p(y,g,_.props.children,w,_.key):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===_o&&XS(x)===g.type)?(w=s(g,_.props),w.ref=Ku(y,g,_),w.return=y,w):(w=Fm(_.type,_.key,_.props,null,y.mode,w),w.ref=Ku(y,g,_),w.return=y,w)}function d(y,g,_,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==_.containerInfo||g.stateNode.implementation!==_.implementation?(g=M_(_,y.mode,w),g.return=y,g):(g=s(g,_.children||[]),g.return=y,g)}function p(y,g,_,w,x){return g===null||g.tag!==7?(g=Xl(_,y.mode,w,x),g.return=y,g):(g=s(g,_),g.return=y,g)}function u(y,g,_){if(typeof g=="string"&&g!==""||typeof g=="number")return g=T_(""+g,y.mode,_),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Pf:return _=Fm(g.type,g.key,g.props,null,y.mode,_),_.ref=Ku(y,null,g),_.return=y,_;case td:return g=M_(g,y.mode,_),g.return=y,g;case _o:var w=g._init;return u(y,w(g._payload),_)}if(gp(g)||Wu(g))return g=Xl(g,y.mode,_,null),g.return=y,g;zf(y,g)}return null}function h(y,g,_,w){var x=g!==null?g.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return x!==null?null:l(y,g,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Pf:return _.key===x?c(y,g,_,w):null;case td:return _.key===x?d(y,g,_,w):null;case _o:return x=_._init,h(y,g,x(_._payload),w)}if(gp(_)||Wu(_))return x!==null?null:p(y,g,_,w,null);zf(y,_)}return null}function f(y,g,_,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(_)||null,l(g,y,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Pf:return y=y.get(w.key===null?_:w.key)||null,c(g,y,w,x);case td:return y=y.get(w.key===null?_:w.key)||null,d(g,y,w,x);case _o:var b=w._init;return f(y,g,_,b(w._payload),x)}if(gp(w)||Wu(w))return y=y.get(_)||null,p(g,y,w,x,null);zf(g,w)}return null}function m(y,g,_,w){for(var x=null,b=null,M=g,S=g=0,j=null;M!==null&&S<_.length;S++){M.index>S?(j=M,M=null):j=M.sibling;var I=h(y,M,_[S],w);if(I===null){M===null&&(M=j);break}e&&M&&I.alternate===null&&t(y,M),g=a(I,g,S),b===null?x=I:b.sibling=I,b=I,M=j}if(S===_.length)return r(y,M),Ur&&Nl(y,S),x;if(M===null){for(;S<_.length;S++)M=u(y,_[S],w),M!==null&&(g=a(M,g,S),b===null?x=M:b.sibling=M,b=M);return Ur&&Nl(y,S),x}for(M=n(y,M);S<_.length;S++)j=f(M,y,S,_[S],w),j!==null&&(e&&j.alternate!==null&&M.delete(j.key===null?S:j.key),g=a(j,g,S),b===null?x=j:b.sibling=j,b=j);return e&&M.forEach(function(q){return t(y,q)}),Ur&&Nl(y,S),x}function v(y,g,_,w){var x=Wu(_);if(typeof x!="function")throw Error(Xe(150));if(_=x.call(_),_==null)throw Error(Xe(151));for(var b=x=null,M=g,S=g=0,j=null,I=_.next();M!==null&&!I.done;S++,I=_.next()){M.index>S?(j=M,M=null):j=M.sibling;var q=h(y,M,I.value,w);if(q===null){M===null&&(M=j);break}e&&M&&q.alternate===null&&t(y,M),g=a(q,g,S),b===null?x=q:b.sibling=q,b=q,M=j}if(I.done)return r(y,M),Ur&&Nl(y,S),x;if(M===null){for(;!I.done;S++,I=_.next())I=u(y,I.value,w),I!==null&&(g=a(I,g,S),b===null?x=I:b.sibling=I,b=I);return Ur&&Nl(y,S),x}for(M=n(y,M);!I.done;S++,I=_.next())I=f(M,y,S,I.value,w),I!==null&&(e&&I.alternate!==null&&M.delete(I.key===null?S:I.key),g=a(I,g,S),b===null?x=I:b.sibling=I,b=I);return e&&M.forEach(function(U){return t(y,U)}),Ur&&Nl(y,S),x}function k(y,g,_,w){if(typeof _=="object"&&_!==null&&_.type===rd&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Pf:e:{for(var x=_.key,b=g;b!==null;){if(b.key===x){if(x=_.type,x===rd){if(b.tag===7){r(y,b.sibling),g=s(b,_.props.children),g.return=y,y=g;break e}}else if(b.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===_o&&XS(x)===b.type){r(y,b.sibling),g=s(b,_.props),g.ref=Ku(y,b,_),g.return=y,y=g;break e}r(y,b);break}else t(y,b);b=b.sibling}_.type===rd?(g=Xl(_.props.children,y.mode,w,_.key),g.return=y,y=g):(w=Fm(_.type,_.key,_.props,null,y.mode,w),w.ref=Ku(y,g,_),w.return=y,y=w)}return i(y);case td:e:{for(b=_.key;g!==null;){if(g.key===b)if(g.tag===4&&g.stateNode.containerInfo===_.containerInfo&&g.stateNode.implementation===_.implementation){r(y,g.sibling),g=s(g,_.children||[]),g.return=y,y=g;break e}else{r(y,g);break}else t(y,g);g=g.sibling}g=M_(_,y.mode,w),g.return=y,y=g}return i(y);case _o:return b=_._init,k(y,g,b(_._payload),w)}if(gp(_))return m(y,g,_,w);if(Wu(_))return v(y,g,_,w);zf(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,g!==null&&g.tag===6?(r(y,g.sibling),g=s(g,_),g.return=y,y=g):(r(y,g),g=T_(_,y.mode,w),g.return=y,y=g),i(y)):r(y,g)}return k}var Wd=OO(!0),RO=OO(!1),ug=Zo(null),pg=null,dd=null,x0=null;function b0(){x0=dd=pg=null}function k0(e){var t=ug.current;Lr(ug),e._currentValue=t}function Nx(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bd(e,t){pg=e,x0=dd=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ps=!0),e.firstContext=null)}function wa(e){var t=e._currentValue;if(x0!==e)if(e={context:e,memoizedValue:t,next:null},dd===null){if(pg===null)throw Error(Xe(308));dd=e,pg.dependencies={lanes:0,firstContext:e}}else dd=dd.next=e;return t}var Wl=null;function T0(e){Wl===null?Wl=[e]:Wl.push(e)}function DO(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,T0(t)):(r.next=s.next,s.next=r),t.interleaved=r,Vi(e,n)}function Vi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var wo=!1;function M0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function FO(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fo(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,lr&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Vi(e,r)}return s=n.interleaved,s===null?(t.next=t,T0(n)):(t.next=s.next,s.next=t),n.interleaved=t,Vi(e,r)}function Im(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,d0(e,r)}}function eA(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=i:a=a.next=i,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function hg(e,t,r,n){var s=e.updateQueue;wo=!1;var a=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,i===null?a=d:i.next=d,i=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==i&&(l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=c))}if(a!==null){var u=s.baseState;i=0,p=d=c=null,l=a;do{var h=l.lane,f=l.eventTime;if((n&h)===h){p!==null&&(p=p.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,v=l;switch(h=t,f=r,v.tag){case 1:if(m=v.payload,typeof m=="function"){u=m.call(f,u,h);break e}u=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,h=typeof m=="function"?m.call(f,u,h):m,h==null)break e;u=Yr({},u,h);break e;case 2:wo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else f={eventTime:f,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(d=p=f,c=u):p=p.next=f,i|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(p===null&&(c=u),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=p,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);sc|=i,e.lanes=i,e.memoizedState=u}}function tA(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(Xe(191,s));s.call(n)}}}var Ah={},ki=Zo(Ah),Zp=Zo(Ah),Xp=Zo(Ah);function Vl(e){if(e===Ah)throw Error(Xe(174));return e}function E0(e,t){switch(Rr(Xp,t),Rr(Zp,e),Rr(ki,Ah),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fx(t,e)}Lr(ki),Rr(ki,t)}function Vd(){Lr(ki),Lr(Zp),Lr(Xp)}function LO(e){Vl(Xp.current);var t=Vl(ki.current),r=fx(t,e.type);t!==r&&(Rr(Zp,e),Rr(ki,r))}function S0(e){Zp.current===e&&(Lr(ki),Lr(Zp))}var Kr=Zo(0);function fg(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var v_=[];function A0(){for(var e=0;e<v_.length;e++)v_[e]._workInProgressVersionPrimary=null;v_.length=0}var $m=Qi.ReactCurrentDispatcher,__=Qi.ReactCurrentBatchConfig,nc=0,Qr=null,On=null,Gn=null,mg=!1,Cp=!1,eh=0,DU=0;function is(){throw Error(Xe(321))}function P0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ya(e[r],t[r]))return!1;return!0}function C0(e,t,r,n,s,a){if(nc=a,Qr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$m.current=e===null||e.memoizedState===null?BU:UU,e=r(n,s),Cp){a=0;
vendor: 4,141 bytes, line 38
38do{if(Cp=!1,eh=0,25<=a)throw Error(Xe(301));a+=1,Gn=On=null,t.updateQueue=null,$m.current=WU,e=r(n,s)}while(Cp)}if($m.current=gg,t=On!==null&&On.next!==null,nc=0,Gn=On=Qr=null,mg=!1,t)throw Error(Xe(300));return e}function j0(){var e=eh!==0;return eh=0,e}function hi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?Qr.memoizedState=Gn=e:Gn=Gn.next=e,Gn}function xa(){if(On===null){var e=Qr.alternate;e=e!==null?e.memoizedState:null}else e=On.next;var t=Gn===null?Qr.memoizedState:Gn.next;if(t!==null)Gn=t,On=e;else{if(e===null)throw Error(Xe(310));On=e,e={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},Gn===null?Qr.memoizedState=Gn=e:Gn=Gn.next=e}return Gn}function th(e,t){return typeof t=="function"?t(e):t}function w_(e){var t=xa(),r=t.queue;if(r===null)throw Error(Xe(311));r.lastRenderedReducer=e;var n=On,s=n.baseQueue,a=r.pending;if(a!==null){if(s!==null){var i=s.next;s.next=a.next,a.next=i}n.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,n=n.baseState;var l=i=null,c=null,d=a;do{var p=d.lane;if((nc&p)===p)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var u={lane:p,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=u,i=n):c=c.next=u,Qr.lanes|=p,sc|=p}d=d.next}while(d!==null&&d!==a);c===null?i=n:c.next=l,Ya(n,t.memoizedState)||(Ps=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do a=s.lane,Qr.lanes|=a,sc|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function x_(e){var t=xa(),r=t.queue;if(r===null)throw Error(Xe(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var i=s=s.next;do a=e(a,i.action),i=i.next;while(i!==s);Ya(a,t.memoizedState)||(Ps=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function zO(){}function BO(e,t){var r=Qr,n=xa(),s=t(),a=!Ya(n.memoizedState,s);if(a&&(n.memoizedState=s,Ps=!0),n=n.queue,I0(VO.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Gn!==null&&Gn.memoizedState.tag&1){if(r.flags|=2048,rh(9,WO.bind(null,r,n,s,t),void 0,null),qn===null)throw Error(Xe(349));nc&30||UO(r,t,s)}return s}function UO(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Qr.updateQueue,t===null?(t={lastEffect:null,stores:null},Qr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function WO(e,t,r,n){t.value=r,t.getSnapshot=n,GO(t)&&qO(e)}function VO(e,t,r){return r(function(){GO(t)&&qO(e)})}function GO(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ya(e,r)}catch{return!0}}function qO(e){var t=Vi(e,1);t!==null&&Ka(t,e,1,-1)}function rA(e){var t=hi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:th,lastRenderedState:e},t.queue=e,e=e.dispatch=zU.bind(null,Qr,e),[t.memoizedState,e]}function rh(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Qr.updateQueue,t===null?(t={lastEffect:null,stores:null},Qr.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function HO(){return xa().memoizedState}function Nm(e,t,r,n){var s=hi();Qr.flags|=e,s.memoizedState=rh(1|t,r,void 0,n===void 0?null:n)}function ny(e,t,r,n){var s=xa();n=n===void 0?null:n;var a=void 0;if(On!==null){var i=On.memoizedState;if(a=i.destroy,n!==null&&P0(n,i.deps)){s.memoizedState=rh(t,r,a,n);return}}Qr.flags|=e,s.memoizedState=rh(1|t,r,a,n)}function nA(e,t){return Nm(8390656,8,e,t)}function I0(e,t){return ny(2048,8,e,t)}function KO(e,t){return ny(4,2,e,t)}function QO(e,t){return ny(4,4,e,t)}function YO(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function JO(e,t,r){return r=r!=null?r.concat([e]):null,ny(4,4,YO.bind(null,t,e),r)}function $0(){}function ZO(e,t){var r=xa();
vendor: 9,890 bytes, lines 38-40
38t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&P0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function XO(e,t){var r=xa();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&P0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function e3(e,t,r){return nc&21?(Ya(r,t)||(r=aO(),Qr.lanes|=r,sc|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ps=!0),e.memoizedState=r)}function FU(e,t){var r=wr;wr=r!==0&&4>r?r:4,e(!0);var n=__.transition;__.transition={};try{e(!1),t()}finally{wr=r,__.transition=n}}function t3(){return xa().memoizedState}function LU(e,t,r){var n=zo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},r3(e))n3(t,r);else if(r=DO(e,t,r,n),r!==null){var s=ws();Ka(r,e,n,s),s3(r,t,n)}}function zU(e,t,r){var n=zo(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(r3(e))n3(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,l=a(i,r);if(s.hasEagerState=!0,s.eagerState=l,Ya(l,i)){var c=t.interleaved;c===null?(s.next=s,T0(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=DO(e,t,s,n),r!==null&&(s=ws(),Ka(r,e,n,s),s3(r,t,n))}}function r3(e){var t=e.alternate;return e===Qr||t!==null&&t===Qr}function n3(e,t){Cp=mg=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function s3(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,d0(e,r)}}var gg={readContext:wa,useCallback:is,useContext:is,useEffect:is,useImperativeHandle:is,useInsertionEffect:is,useLayoutEffect:is,useMemo:is,useReducer:is,useRef:is,useState:is,useDebugValue:is,useDeferredValue:is,useTransition:is,useMutableSource:is,useSyncExternalStore:is,useId:is,unstable_isNewReconciler:!1},BU={readContext:wa,useCallback:function(e,t){return hi().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:nA,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Nm(4194308,4,YO.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Nm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nm(4,2,e,t)},useMemo:function(e,t){var r=hi();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=hi();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=LU.bind(null,Qr,e),[n.memoizedState,e]},useRef:function(e){var t=hi();return e={current:e},t.memoizedState=e},useState:rA,useDebugValue:$0,useDeferredValue:function(e){return hi().memoizedState=e},useTransition:function(){var e=rA(!1),t=e[0];return e=FU.bind(null,e[1]),hi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Qr,s=hi();if(Ur){if(r===void 0)throw Error(Xe(407));r=r()}else{if(r=t(),qn===null)throw Error(Xe(349));nc&30||UO(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,nA(VO.bind(null,n,a,e),[e]),n.flags|=2048,rh(9,WO.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=hi(),t=qn.identifierPrefix;if(Ur){var r=Li,n=Fi;r=(n&~(1<<32-Ha(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=eh++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=DU++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},UU={readContext:wa,useCallback:ZO,useContext:wa,useEffect:I0,useImperativeHandle:JO,useInsertionEffect:KO,useLayoutEffect:QO,useMemo:XO,useReducer:w_,useRef:HO,useState:function(){return w_(th)},useDebugValue:$0,useDeferredValue:function(e){var t=xa();return e3(t,On.memoizedState,e)},useTransition:function(){var e=w_(th)[0],t=xa().memoizedState;return[e,t]},useMutableSource:zO,useSyncExternalStore:BO,useId:t3,unstable_isNewReconciler:!1},WU={readContext:wa,useCallback:ZO,useContext:wa,useEffect:I0,useImperativeHandle:JO,useInsertionEffect:KO,useLayoutEffect:QO,useMemo:XO,useReducer:x_,useRef:HO,useState:function(){return x_(th)},useDebugValue:$0,useDeferredValue:function(e){var t=xa();return On===null?t.memoizedState=e:e3(t,On.memoizedState,e)},useTransition:function(){var e=x_(th)[0],t=xa().memoizedState;return[e,t]},useMutableSource:zO,useSyncExternalStore:BO,useId:t3,unstable_isNewReconciler:!1};function Da(e,t){if(e&&e.defaultProps){t=Yr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ox(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Yr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sy={isMounted:function(e){return(e=e._reactInternals)?fc(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=ws(),s=zo(e),a=Bi(n,s);a.payload=t,r!=null&&(a.callback=r),t=Fo(e,a,s),t!==null&&(Ka(t,e,s,n),Im(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=ws(),s=zo(e),a=Bi(n,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Fo(e,a,s),t!==null&&(Ka(t,e,s,n),Im(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ws(),n=zo(e),s=Bi(r,n);s.tag=2,t!=null&&(s.callback=t),t=Fo(e,s,n),t!==null&&(Ka(t,e,n,r),Im(t,e,n))}};function sA(e,t,r,n,s,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,i):t.prototype&&t.prototype.isPureReactComponent?!Kp(r,n)||!Kp(s,a):!0}function a3(e,t,r){var n=!1,s=Go,a=t.contextType;return typeof a=="object"&&a!==null?a=wa(a):(s=js(t)?tc:us.current,n=t.contextTypes,a=(n=n!=null)?Bd(e,s):Go),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sy,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function aA(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&sy.enqueueReplaceState(t,t.state,null)}function Rx(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},M0(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=wa(a):(a=js(t)?tc:us.current,s.context=Bd(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ox(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&sy.enqueueReplaceState(s,s.state,null),hg(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Gd(e,t){try{var r="",n=t;do r+=y6(n),n=n.return;while(n);var s=r}catch(a){s=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:e,source:t,stack:s,digest:null}}function b_(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Dx(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var VU=typeof WeakMap=="function"?WeakMap:Map;function i3(e,t,r){r=Bi(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){vg||(vg=!0,Hx=n),Dx(e,t)},r}function o3(e,t,r){r=Bi(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Dx(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Dx(e,t),typeof n!="function"&&(Lo===null?Lo=new Set([this]):Lo.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function iA(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new VU;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=s8.bind(null,e,t,r),t.then(e,e))}function oA(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function lA(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Bi(-1,1),t.tag=2,Fo(r,t,1))),r.lanes|=1),e)}var GU=Qi.ReactCurrentOwner,Ps=!1;function ys(e,t,r,n){t.child=e===null?RO(t,null,r,n):Wd(t,e.child,r,n)}function cA(e,t,r,n,s){r=r.render;var a=t.ref;return bd(t,s),n=C0(e,t,r,n,a,s),r=j0(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Gi(e,t,s)):(Ur&&r&&v0(t),t.flags|=1,ys(e,t,n,s),t.child)}function dA(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!B0(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,l3(e,t,a,n,s)):(e=Fm(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var i=a.memoizedProps;if(r=r.compare,r=r!==null?r:Kp,r(i,n)&&e.ref===t.ref)return Gi(e,t,s)}return t.flags|=1,e=Bo(a,n),e.ref=t.ref,e.return=t,t.child=e}function l3(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(Kp(a,n)&&e.ref===t.ref)if(Ps=!1,t.pendingProps=n=a,(e.lanes&s)!==0)e.flags&131072&&(Ps=!0);else return t.lanes=e.lanes,Gi(e,t,s)}return Fx(e,t,r,n,s)}function c3(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rr(pd,Us),Us|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Rr(pd,Us),Us|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Rr(pd,Us),Us|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Rr(pd,Us),Us|=n;return ys(e,t,s,r),t.child}function d3(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function Fx(e,t,r,n,s){var a=js(r)?tc:us.current;return a=Bd(t,a),bd(t,s),r=C0(e,t,r,n,a,s),n=j0(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Gi(e,t,s)):(Ur&&n&&v0(t),t.flags|=1,ys(e,t,r,s),t.child)}function uA(e,t,r,n,s){if(js(r)){var a=!0;lg(t)}else a=!1;if(bd(t,s),t.stateNode===null)Om(e,t),a3(t,r,n),Rx(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,d=r.contextType;typeof d=="object"&&d!==null?d=wa(d):(d=js(r)?tc:us.current,d=Bd(t,d));var p=r.getDerivedStateFromProps,u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function";u||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==n||c!==d)&&aA(t,i,n,d),wo=!1;var h=t.memoizedState;i.state=h,hg(t,n,i,s),c=t.memoizedState,l!==n||h!==c||Cs.current||wo?(typeof p=="function"&&(Ox(t,r,p,n),c=t.memoizedState),(l=wo||sA(t,r,l,n,h,c,d))?(u||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),i.props=n,i.state=c,i.context=d,n=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,FO(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Da(t.type,l),i.props=d,u=t.pendingProps,h=i.context,c=r.contextType,typeof c=="object"&&c!==null?c=wa(c):(c=js(r)?tc:us.current,c=Bd(t,c));var f=r.getDerivedStateFromProps;(p=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==u||h!==c)&&aA(t,i,n,c),wo=!1,h=t.memoizedState,i.state=h,hg(t,n,i,s);var m=t.memoizedState;l!==u||h!==m||Cs.current||wo?(typeof f=="function"&&(Ox(t,r,f,n),m=t.memoizedState),(d=wo||sA(t,r,d,n,h,m,c)||!1)?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,m,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,m,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),i.props=n,i.state=m,i.context=c,n=d):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Lx(e,t,r,n,a,s)}function Lx(e,t,r,n,s,a){d3(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&YS(t,r,!1),Gi(e,t,a);n=t.stateNode,GU.current=t;var l=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=Wd(t,e.child,null,a),t.child=Wd(t,null,l,a)):ys(e,t,l,a),t.memoizedState=n.state,s&&YS(t,r,!0),t.child}function u3(e){var t=e.stateNode;t.pendingContext?QS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&QS(e,t.context,!1),E0(e,t.containerInfo)}function pA(e,t,r,n,s){return Ud(),w0(s),t.flags|=256,ys(e,t,r,n),t.child}var zx={dehydrated:null,treeContext:null,retryLane:0};function Bx(e){return{baseLanes:e,cachePool:null,transitions:null}}function p3(e,t,r){var n=t.pendingProps,s=Kr.current,a=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Rr(Kr,s&1),e===null)return $x(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,a?(n=t.mode,a=t.child,i={mode:"hidden",children:i},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=oy(i,n,0,null),e=Xl(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Bx(r),t.memoizedState=zx,e):N0(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return qU(e,t,i,n,l,s,r);if(a){a=n.fallback,i=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Bo(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?a=Bo(l,a):(a=Xl(a,i,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,i=e.child.memoizedState,i=i===null?Bx(r):{base
vendor: 8,923 bytes, line 40
40Lanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~r,t.memoizedState=zx,n}return a=e.child,e=a.sibling,n=Bo(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function N0(e,t){return t=oy({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bf(e,t,r,n){return n!==null&&w0(n),Wd(t,e.child,null,r),e=N0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qU(e,t,r,n,s,a,i){if(r)return t.flags&256?(t.flags&=-257,n=b_(Error(Xe(422))),Bf(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=oy({mode:"visible",children:n.children},s,0,null),a=Xl(a,s,i,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Wd(t,e.child,null,i),t.child.memoizedState=Bx(i),t.memoizedState=zx,a);if(!(t.mode&1))return Bf(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Xe(419)),n=b_(a,n,void 0),Bf(e,t,i,n)}if(l=(i&e.childLanes)!==0,Ps||l){if(n=qn,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Vi(e,s),Ka(n,e,s,-1))}return z0(),n=b_(Error(Xe(421))),Bf(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=a8.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,qs=Do(s.nextSibling),Hs=t,Ur=!0,Wa=null,e!==null&&(ua[pa++]=Fi,ua[pa++]=Li,ua[pa++]=rc,Fi=e.id,Li=e.overflow,rc=t),t=N0(t,n.children),t.flags|=4096,t)}function hA(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Nx(e.return,t,r)}function k_(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function h3(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(ys(e,t,n.children,r),n=Kr.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hA(e,r,t);else if(e.tag===19)hA(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Rr(Kr,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&fg(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),k_(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&fg(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}k_(t,!0,r,null,a);break;case"together":k_(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Om(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gi(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),sc|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Xe(153));if(t.child!==null){for(e=t.child,r=Bo(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Bo(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function HU(e,t,r){switch(t.tag){case 3:u3(t),Ud();break;case 5:LO(t);break;case 1:js(t.type)&&lg(t);break;case 4:E0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Rr(ug,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Rr(Kr,Kr.current&1),t.flags|=128,null):r&t.child.childLanes?p3(e,t,r):(Rr(Kr,Kr.current&1),e=Gi(e,t,r),e!==null?e.sibling:null);Rr(Kr,Kr.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return h3(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Rr(Kr,Kr.current),n)break;return null;case 22:case 23:return t.lanes=0,c3(e,t,r)}return Gi(e,t,r)}var f3,Ux,m3,g3;f3=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ux=function(){};m3=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Vl(ki.current);var a=null;switch(r){case"input":s=dx(e,s),n=dx(e,n),a=[];break;case"select":s=Yr({},s,{value:void 0}),n=Yr({},n,{value:void 0}),a=[];break;case"textarea":s=hx(e,s),n=hx(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=ig)}mx(r,n);var i;r=null;for(d in s)if(!n.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(i in l)l.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Bp.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in n){var c=n[d];if(l=s!=null?s[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(r||(r={}),r[i]=c[i])}else r||(a||(a=[]),a.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Bp.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Fr("scroll",e),a||l===c||(a=[])):(a=a||[]).push(d,c))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};g3=function(e,t,r,n){r!==n&&(t.flags|=4)};function Qu(e,t){if(!Ur)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function os(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function KU(e,t,r){var n=t.pendingProps;switch(_0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return os(t),null;case 1:return js(t.type)&&og(),os(t),null;case 3:return n=t.stateNode,Vd(),Lr(Cs),Lr(us),A0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Lf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wa!==null&&(Yx(Wa),Wa=null))),Ux(e,t),os(t),null;case 5:S0(t);var s=Vl(Xp.current);if(r=t.type,e!==null&&t.stateNode!=null)m3(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Xe(166));return os(t),null}if(e=Vl(ki.current),Lf(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[_i]=t,n[Jp]=a,e=(t.mode&1)!==0,r){case"dialog":Fr("cancel",n),Fr("close",n);break;case"iframe":case"object":case"embed":Fr("load",n);break;case"video":case"audio":for(s=0;s<vp.length;s++)Fr(vp[s],n);break;case"source":Fr("error",n);break;case"img":case"image":case"link":Fr("error",n),Fr("load",n);break;case"details":Fr("toggle",n);break;case"input":bS(n,a),Fr("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Fr("invalid",n);break;case"textarea":TS(n,a),Fr("invalid",n)}mx(r,a),s=null;for(var i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&Ff(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Ff(n.textContent,l,e),s=["children",""+l]):Bp.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Fr("scroll",n)}switch(r){case"input":Cf(n),kS(n,a,!0);break;case"textarea":Cf(n),MS(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=ig)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=VN(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[_i]=t,e[Jp]=n,f3(e,t,!1,!1),t.stateNode=e;e:{switch(i=gx(r,n),r){case"dialog":Fr("cancel",e),Fr("close",e),s=n;break;case"iframe":case"object":case"embed":Fr("load",e),s=n;break;case"video":case"audio":for(s=0;s<vp.length;s++)Fr(vp[s],e);s=n;break;case"source":Fr("error",e),s=n;break;case"img":case"image":case"link":Fr("error",e),Fr("load",e),s=n;break;case"details":Fr("toggle",e),s=n;break;case"input":bS(e,n),s=dx(e,n),Fr("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Yr({},n,{value:void 0}),Fr("invalid",e);break;case"textarea":TS(e,n),s=hx(e,n),Fr("invalid",e);break;default:s=n}mx(r,s),l=s;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?HN(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&GN(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Up(e,c):typeof c=="number"&&Up(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Bp.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Fr("scroll",e):c!=null&&s0(e,a,c,i))}switch(r){case"input":Cf(e),kS(e,n,!1);break;case"textarea":Cf(e),MS(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Vo(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?vd(e,!!n.multiple,a,!1):n.defaultValue!=null&&vd(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ig)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return os(t),null;case 6:if(e&&t.stateNode!=null)g3(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Xe(166));if(r=Vl(Xp.current),Vl(ki.current),Lf(t)){if(n=t.stateNode,r=t.memoizedProps,n[_i]=t,(a=n.nodeValue!==r)&&(e=Hs,e!==null))switch(e.tag){case 3:Ff(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ff(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[_i]=t,t.stateNode=n}return os(t),null;case 13:if(Lr(Kr),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ur&&qs!==null&&t.mode&1&&!(t.flags&128))NO(),Ud(),t.flags|=98560,a=!1;else if(a=Lf(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Xe(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Xe(317));a[_i]=t}else Ud(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;os(t),a=!1}else Wa!==null&&(Yx(Wa),Wa=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Kr.current&1?Rn===0&&(Rn=3):z0())),t.updateQueue!==null&&(t.flags|=4),os(t),null);case 4:return Vd(),Ux(e,t),e===null&&Qp(t.stateNode.containerInfo),os(t),null;case 10:return k0(t.type._context),os(t),null;case 17:return js(t.type)&&og(),os(t),null;case 19:if(Lr(Kr),a=t.memoizedState,a===null)return os(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)Qu(a,!1);else{if(Rn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fg(e),i!==null){for(t.flags|=128,Qu(a,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Rr(Kr,Kr.current&1|2),t.child}e=e.sibling}a.tail!==null&&mn()>qd&&(t.flags|=128,n=!0,Qu(a,!1),t.lanes=4194304)}else{if(!n)if(e=fg(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Qu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Ur)return os(t),null}else 2*mn()-a.renderingStartTime>qd&&r!==1073741824&&(t.flags|=128,n=!0,Qu(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(r=a.last,r!==null?r.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=mn(),t.sibling=null,r=Kr.current,Rr(Kr,n?r&1|2:r&1),t):(os(t),null);case 22:case 23:return L0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Us&1073741824&&(os(t),t.subtreeFlags&6&&(t.flags|=8192)):os(t),null;case 24:return null;case 25:return null}throw Error(Xe(156,t.tag))}function QU(e,t){switch(_0(t),t.tag){case 1:return js(t.type)&&og(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 26,035 bytes, line 40
40case 3:return Vd(),Lr(Cs),Lr(us),A0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return S0(t),null;case 13:if(Lr(Kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Xe(340));Ud()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lr(Kr),null;case 4:return Vd(),null;case 10:return k0(t.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var Uf=!1,ds=!1,YU=typeof WeakSet=="function"?WeakSet:Set,ht=null;function ud(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){an(e,t,n)}else r.current=null}function Wx(e,t,r){try{r()}catch(n){an(e,t,n)}}var fA=!1;function JU(e,t){if(Ex=ng,e=xO(),y0(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var i=0,l=-1,c=-1,d=0,p=0,u=e,h=null;t:for(;;){for(var f;u!==r||s!==0&&u.nodeType!==3||(l=i+s),u!==a||n!==0&&u.nodeType!==3||(c=i+n),u.nodeType===3&&(i+=u.nodeValue.length),(f=u.firstChild)!==null;)h=u,u=f;for(;;){if(u===e)break t;if(h===r&&++d===s&&(l=i),h===a&&++p===n&&(c=i),(f=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=f}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sx={focusedElem:e,selectionRange:r},ng=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){t=ht;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,k=m.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Da(t.type,v),k);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Xe(163))}}catch(w){an(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}return m=fA,fA=!1,m}function jp(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Wx(t,r,a)}s=s.next}while(s!==n)}}function ay(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Vx(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function y3(e){var t=e.alternate;t!==null&&(e.alternate=null,y3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_i],delete t[Jp],delete t[Cx],delete t[$U],delete t[NU])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function v3(e){return e.tag===5||e.tag===3||e.tag===4}function mA(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||v3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gx(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ig));else if(n!==4&&(e=e.child,e!==null))for(Gx(e,t,r),e=e.sibling;e!==null;)Gx(e,t,r),e=e.sibling}function qx(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(qx(e,t,r),e=e.sibling;e!==null;)qx(e,t,r),e=e.sibling}var Xn=null,Ba=!1;function lo(e,t,r){for(r=r.child;r!==null;)_3(e,t,r),r=r.sibling}function _3(e,t,r){if(bi&&typeof bi.onCommitFiberUnmount=="function")try{bi.onCommitFiberUnmount(Jg,r)}catch{}switch(r.tag){case 5:ds||ud(r,t);case 6:var n=Xn,s=Ba;Xn=null,lo(e,t,r),Xn=n,Ba=s,Xn!==null&&(Ba?(e=Xn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xn.removeChild(r.stateNode));break;case 18:Xn!==null&&(Ba?(e=Xn,r=r.stateNode,e.nodeType===8?g_(e.parentNode,r):e.nodeType===1&&g_(e,r),qp(e)):g_(Xn,r.stateNode));break;case 4:n=Xn,s=Ba,Xn=r.stateNode.containerInfo,Ba=!0,lo(e,t,r),Xn=n,Ba=s;break;case 0:case 11:case 14:case 15:if(!ds&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&Wx(r,t,i),s=s.next}while(s!==n)}lo(e,t,r);break;case 1:if(!ds&&(ud(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){an(r,t,l)}lo(e,t,r);break;case 21:lo(e,t,r);break;case 22:r.mode&1?(ds=(n=ds)||r.memoizedState!==null,lo(e,t,r),ds=n):lo(e,t,r);break;default:lo(e,t,r)}}function gA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new YU),t.forEach(function(n){var s=i8.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Ca(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var a=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:Xn=l.stateNode,Ba=!1;break e;case 3:Xn=l.stateNode.containerInfo,Ba=!0;break e;case 4:Xn=l.stateNode.containerInfo,Ba=!0;break e}l=l.return}if(Xn===null)throw Error(Xe(160));_3(a,i,s),Xn=null,Ba=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){an(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)w3(t,e),t=t.sibling}function w3(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ca(t,e),di(e),n&4){try{jp(3,e,e.return),ay(3,e)}catch(v){an(e,e.return,v)}try{jp(5,e,e.return)}catch(v){an(e,e.return,v)}}break;case 1:Ca(t,e),di(e),n&512&&r!==null&&ud(r,r.return);break;case 5:if(Ca(t,e),di(e),n&512&&r!==null&&ud(r,r.return),e.flags&32){var s=e.stateNode;try{Up(s,"")}catch(v){an(e,e.return,v)}}if(n&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,i=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&UN(s,a),gx(l,i);var d=gx(l,a);for(i=0;i<c.length;i+=2){var p=c[i],u=c[i+1];p==="style"?HN(s,u):p==="dangerouslySetInnerHTML"?GN(s,u):p==="children"?Up(s,u):s0(s,p,u,d)}switch(l){case"input":ux(s,a);break;case"textarea":WN(s,a);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var f=a.value;f!=null?vd(s,!!a.multiple,f,!1):h!==!!a.multiple&&(a.defaultValue!=null?vd(s,!!a.multiple,a.defaultValue,!0):vd(s,!!a.multiple,a.multiple?[]:"",!1))}s[Jp]=a}catch(v){an(e,e.return,v)}}break;case 6:if(Ca(t,e),di(e),n&4){if(e.stateNode===null)throw Error(Xe(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(v){an(e,e.return,v)}}break;case 3:if(Ca(t,e),di(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(v){an(e,e.return,v)}break;case 4:Ca(t,e),di(e);break;case 13:Ca(t,e),di(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(D0=mn())),n&4&&gA(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(ds=(d=ds)||p,Ca(t,e),ds=d):Ca(t,e),di(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&e.mode&1)for(ht=e,p=e.child;p!==null;){for(u=ht=p;ht!==null;){switch(h=ht,f=h.child,h.tag){case 0:case 11:case 14:case 15:jp(4,h,h.return);break;case 1:ud(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){an(n,r,v)}}break;case 5:ud(h,h.return);break;case 22:if(h.memoizedState!==null){vA(u);continue}}f!==null?(f.return=h,ht=f):vA(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{s=u.stateNode,d?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=u.stateNode,c=u.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=qN("display",i))}catch(v){an(e,e.return,v)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(v){an(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Ca(t,e),di(e),n&4&&gA(e);break;case 21:break;default:Ca(t,e),di(e)}}function di(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(v3(r)){var n=r;break e}r=r.return}throw Error(Xe(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Up(s,""),n.flags&=-33);var a=mA(e);qx(e,a,s);break;case 3:case 4:var i=n.stateNode.containerInfo,l=mA(e);Gx(e,l,i);break;default:throw Error(Xe(161))}}catch(c){an(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZU(e,t,r){ht=e,x3(e)}function x3(e,t,r){for(var n=(e.mode&1)!==0;ht!==null;){var s=ht,a=s.child;if(s.tag===22&&n){var i=s.memoizedState!==null||Uf;if(!i){var l=s.alternate,c=l!==null&&l.memoizedState!==null||ds;l=Uf;var d=ds;if(Uf=i,(ds=c)&&!d)for(ht=s;ht!==null;)i=ht,c=i.child,i.tag===22&&i.memoizedState!==null?_A(s):c!==null?(c.return=i,ht=c):_A(s);for(;a!==null;)ht=a,x3(a),a=a.sibling;ht=s,Uf=l,ds=d}yA(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,ht=a):yA(e)}}function yA(e){for(;ht!==null;){var t=ht;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ds||ay(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!ds)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Da(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&tA(t,a,n);break;case 3:var i=t.updateQueue;if(i!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}tA(t,i,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&qp(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Xe(163))}ds||t.flags&512&&Vx(t)}catch(h){an(t,t.return,h)}}if(t===e){ht=null;break}if(r=t.sibling,r!==null){r.return=t.return,ht=r;break}ht=t.return}}function vA(e){for(;ht!==null;){var t=ht;if(t===e){ht=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ht=r;break}ht=t.return}}function _A(e){for(;ht!==null;){var t=ht;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ay(4,t)}catch(c){an(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){an(t,s,c)}}var a=t.return;try{Vx(t)}catch(c){an(t,a,c)}break;case 5:var i=t.return;try{Vx(t)}catch(c){an(t,i,c)}}}catch(c){an(t,t.return,c)}if(t===e){ht=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ht=l;break}ht=t.return}}var XU=Math.ceil,yg=Qi.ReactCurrentDispatcher,O0=Qi.ReactCurrentOwner,va=Qi.ReactCurrentBatchConfig,lr=0,qn=null,Mn=null,es=0,Us=0,pd=Zo(0),Rn=0,nh=null,sc=0,iy=0,R0=0,Ip=null,As=null,D0=0,qd=1/0,Ni=null,vg=!1,Hx=null,Lo=null,Wf=!1,Io=null,_g=0,$p=0,Kx=null,Rm=-1,Dm=0;function ws(){return lr&6?mn():Rm!==-1?Rm:Rm=mn()}function zo(e){return e.mode&1?lr&2&&es!==0?es&-es:RU.transition!==null?(Dm===0&&(Dm=aO()),Dm):(e=wr,e!==0||(e=window.event,e=e===void 0?16:pO(e.type)),e):1}function Ka(e,t,r,n){if(50<$p)throw $p=0,Kx=null,Error(Xe(185));Mh(e,r,n),(!(lr&2)||e!==qn)&&(e===qn&&(!(lr&2)&&(iy|=r),Rn===4&&ko(e,es)),Is(e,n),r===1&&lr===0&&!(t.mode&1)&&(qd=mn()+500,ry&&Xo()))}function Is(e,t){var r=e.callbackNode;R6(e,t);var n=rg(e,e===qn?es:0);if(n===0)r!==null&&AS(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&AS(r),t===1)e.tag===0?OU(wA.bind(null,e)):jO(wA.bind(null,e)),jU(function(){!(lr&6)&&Xo()}),r=null;else{switch(iO(n)){case 1:r=c0;break;case 4:r=nO;break;case 16:r=tg;break;case 536870912:r=sO;break;default:r=tg}r=P3(r,b3.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function b3(e,t){if(Rm=-1,Dm=0,lr&6)throw Error(Xe(327));var r=e.callbackNode;if(kd()&&e.callbackNode!==r)return null;var n=rg(e,e===qn?es:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=wg(e,n);else{t=n;var s=lr;lr|=2;var a=T3();(qn!==e||es!==t)&&(Ni=null,qd=mn()+500,Zl(e,t));do try{r8();break}catch(l){k3(e,l)}while(!0);b0(),yg.current=a,lr=s,Mn!==null?t=0:(qn=null,es=0,t=Rn)}if(t!==0){if(t===2&&(s=xx(e),s!==0&&(n=s,t=Qx(e,s))),t===1)throw r=nh,Zl(e,0),ko(e,n),Is(e,mn()),r;if(t===6)ko(e,n);else{if(s=e.current.alternate,!(n&30)&&!e8(s)&&(t=wg(e,n),t===2&&(a=xx(e),a!==0&&(n=a,t=Qx(e,a))),t===1))throw r=nh,Zl(e,0),ko(e,n),Is(e,mn()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(Xe(345));case 2:Ol(e,As,Ni);break;case 3:if(ko(e,n),(n&130023424)===n&&(t=D0+500-mn(),10<t)){if(rg(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){ws(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Px(Ol.bind(null,e,As,Ni),t);break}Ol(e,As,Ni);break;case 4:if(ko(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var i=31-Ha(n);a=1<<i,i=t[i],i>s&&(s=i),n&=~a}if(n=s,n=mn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*XU(n/1960))-n,10<n){e.timeoutHandle=Px(Ol.bind(null,e,As,Ni),n);break}Ol(e,As,Ni);break;case 5:Ol(e,As,Ni);break;default:throw Error(Xe(329))}}}return Is(e,mn()),e.callbackNode===r?b3.bind(null,e):null}function Qx(e,t){var r=Ip;return e.current.memoizedState.isDehydrated&&(Zl(e,t).flags|=256),e=wg(e,t),e!==2&&(t=As,As=r,t!==null&&Yx(t)),e}function Yx(e){As===null?As=e:As.push.apply(As,e)}function e8(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],a=s.getSnapshot;s=s.value;try{if(!Ya(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ko(e,t){for(t&=~R0,t&=~iy,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ha(t),n=1<<r;e[r]=-1,t&=~n}}function wA(e){if(lr&6)throw Error(Xe(327));kd();var t=rg(e,0);if(!(t&1))return Is(e,mn()),null;var r=wg(e,t);if(e.tag!==0&&r===2){var n=xx(e);n!==0&&(t=n,r=Qx(e,n))}if(r===1)throw r=nh,Zl(e,0),ko(e,t),Is(e,mn()),r;if(r===6)throw Error(Xe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ol(e,As,Ni),Is(e,mn()),null}function F0(e,t){var r=lr;lr|=1;try{return e(t)}finally{lr=r,lr===0&&(qd=mn()+500,ry&&Xo())}}function ac(e){Io!==null&&Io.tag===0&&!(lr&6)&&kd();var t=lr;lr|=1;var r=va.transition,n=wr;try{if(va.transition=null,wr=1,e)return e()}finally{wr=n,va.transition=r,lr=t,!(lr&6)&&Xo()}}function L0(){Us=pd.current,Lr(pd)}function Zl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,CU(r)),Mn!==null)for(r=Mn.return;r!==null;){var n=r;switch(_0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&og();break;case 3:Vd(),Lr(Cs),Lr(us),A0();break;case 5:S0(n);break;case 4:Vd();break;case 13:Lr(Kr);break;case 19:Lr(Kr);break;case 10:k0(n.type._context);break;case 22:case 23:L0()}r=r.return}if(qn=e,Mn=e=Bo(e.current,null),es=Us=t,Rn=0,nh=null,R0=iy=sc=0,As=Ip=null,Wl!==null){for(t=0;t<Wl.length;t++)if(r=Wl[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,a=r.pending;if(a!==null){var i=a.next;a.next=s,n.next=i}r.pending=n}Wl=null}return e}function k3(e,t){do{var r=Mn;try{if(b0(),$m.current=gg,mg){for(var n=Qr.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}mg=!1}if(nc=0,Gn=On=Qr=null,Cp=!1,eh=0,O0.current=null,r===null||r.return===null){Rn=1,nh=t,Mn=null;break}e:{var a=e,i=r.return,l=r,c=t;if(t=es,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,p=l,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var h=p.alternate;h?(p.updateQueue=h.updateQueue,p.memoizedState=h.memoizedState,p.lanes=h.lanes):(p.updateQueue=null,p.memoizedState=null)}var f=oA(i);if(f!==null){f.flags&=-257,lA(f,i,l,a,t),f.mode&1&&iA(a,d,t),t=f,c=d;var m=t.updateQueue;if(m===null){var v=new Set;v.add(c),t.updateQueue=v}else m.add(c);break e}else{if(!(t&1)){iA(a,d,t),z0();break e}c=Error(Xe(426))}}else if(Ur&&l.mode&1){var k=oA(i);if(k!==null){!(k.flags&65536)&&(k.flags|=256),lA(k,i,l,a,t),w0(Gd(c,l));break e}}a=c=Gd(c,l),Rn!==4&&(Rn=2),Ip===null?Ip=[a]:Ip.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=i3(a,c,t);eA(a,y);break e;case 1:l=c;var g=a.type,_=a.stateNode;if(!(a.flags&128)&&(typeof g.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Lo===null||!Lo.has(_)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=o3(a,l,t);eA(a,w);break e}}a=a.return}while(a!==null)}E3(r)}catch(x){t=x,Mn===r&&r!==null&&(Mn=r=r.return);continue}break}while(!0)}function T3(){var e=yg.current;return yg.current=gg,e===null?gg:e}function z0(){(Rn===0||Rn===3||Rn===2)&&(Rn=4),qn===null||!(sc&268435455)&&!(iy&268435455)||ko(qn,es)}function wg(e,t){var r=lr;lr|=2;var n=T3();(qn!==e||es!==t)&&(Ni=null,Zl(e,t));do try{t8();break}catch(s){k3(e,s)}while(!0);if(b0(),lr=r,yg.current=n,Mn!==null)throw Error(Xe(261));return qn=null,es=0,Rn}function t8(){for(;Mn!==null;)M3(Mn)}function r8(){for(;Mn!==null&&!S6();)M3(Mn)}function M3(e){var t=A3(e.alternate,e,Us);e.memoizedProps=e.pendingProps,t===null?E3(e):Mn=t,O0.current=null}function E3(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=QU(r,t),r!==null){r.flags&=32767,Mn=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Rn=6,Mn=null;return}}else if(r=KU(r,t,Us),r!==null){Mn=r;return}if(t=t.sibling,t!==null){Mn=t;return}Mn=t=e}while(t!==null);Rn===0&&(Rn=5)}function Ol(e,t,r){var n=wr,s=va.transition;try{va.transition=null,wr=1,n8(e,t,r,n)}finally{va.transition=s,wr=n}return null}function n8(e,t,r,n){do kd();while(Io!==null);if(lr&6)throw Error(Xe(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Xe(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(D6(e,a),e===qn&&(Mn=qn=null,es=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Wf||(Wf=!0,P3(tg,function(){return kd(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=va.transition,va.transition=null;var i=wr;wr=1;var l=lr;lr|=4,O0.current=null,JU(e,r),w3(r,e),kU(Sx),ng=!!Ex,Sx=Ex=null,e.current=r,ZU(r),A6(),lr=l,wr=i,va.transition=a}else e.current=r;if(Wf&&(Wf=!1,Io=e,_g=s),a=e.pendingLanes,a===0&&(Lo=null),j6(r.stateNode),Is(e,mn()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(vg)throw vg=!1,e=Hx,Hx=null,e;return _g&1&&e.tag!==0&&kd(),a=e.pendingLanes,a&1?e===Kx?$p++:($p=0,Kx=e):$p=0,Xo(),null}function kd(){if(Io!==null){var e=iO(_g),t=va.transition,r=wr;try{if(va.transition=null,wr=16>e?16:e,Io===null)var n=!1;else{if(e=Io,Io=null,_g=0,lr&6)throw Error(Xe(331));var s=lr;for(lr|=4,ht=e.current;ht!==null;){var a=ht,i=a.child;if(ht.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ht=d;ht!==null;){var p=ht;switch(p.tag){case 0:case 11:case 15:jp(8,p,a)}var u=p.child;if(u!==null)u.return=p,ht=u;else for(;ht!==null;){p=ht;var h=p.sibling,f=p.return;if(y3(p),p===d){ht=null;break}if(h!==null){h.return=f,ht=h;break}ht=f}}}var m=a.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var k=v.sibling;v.sibling=null,v=k}while(v!==null)}}ht=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,ht=i;else e:for(;ht!==null;){if(a=ht,a.flags&2048)switch(a.tag){case 0:case 11:case 15:jp(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ht=y;break e}ht=a.return}}var g=e.current;for(ht=g;ht!==null;){i=ht;var _=i.child;if(i.subtreeFlags&2064&&_!==null)_.return=i,ht=_;else e:for(i=g;ht!==null;){if(l=ht,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ay(9,l)}}catch(x){an(l,l.return,x)}if(l===i){ht=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ht=w;break e}ht=l.return}}if(lr=s,Xo(),bi&&typeof bi.onPostCommitFiberRoot=="function")try{bi.onPostCommitFiberRoot(Jg,e)}catch{}n=!0}return n}finally{wr=r,va.transition=t}}return!1}function xA(e,t,r){t=Gd(r,t),t=i3(e,t,1),e=Fo(e,t,1),t=ws(),e!==null&&(Mh(e,1,t),Is(e,t))}function an(e,t,r){if(e.tag===3)xA(e,e,r);else for(;t!==null;){if(t.tag===3){xA(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Lo===null||!Lo.has(n))){e=Gd(r,e),e=o3(t,e,1),t=Fo(t,e,1),e=ws(),t!==null&&(Mh(t,1,e),Is(t,e));break}}t=t.return}}function s8(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=ws(),e.pingedLanes|=e.suspendedLanes&r,qn===e&&(es&r)===r&&(Rn===4||Rn===3&&(es&130023424)===es&&500>mn()-D0?Zl(e,0):R0|=r),Is(e,t)}function S3(e,t){t===0&&(e.mode&1?(t=$f,$f<<=1,!($f&130023424)&&($f=4194304)):t=1);var r=ws();e=Vi(e,t),e!==null&&(Mh(e,t,r),Is(e,r))}function a8(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),S3(e,r)}function i8(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Xe(314))}n!==null&&n.delete(t),S3(e,r)}var A3;A3=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cs.current)Ps=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ps=!1,HU(e,t,r);Ps=!!(e.flags&131072)}else Ps=!1,Ur&&t.flags&1048576&&IO(t,dg,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Om(e,t),e=t.pendingProps;var s=Bd(t,us.current);bd(t,r),s=C0(null,t,n,e,s,r);var a=j0();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,js(n)?(a=!0,lg(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,M0(t),s.updater=sy,t.stateNode=s,s._reactInternals=t,Rx(t,n,e,r),t=Lx(null,t,n,!0,a,r)):(t.tag=0,Ur&&a&&v0(t),ys(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Om(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=l8(n),e=Da(n,e),s){case 0:t=Fx(null,t,n,e,r);break e;case 1:t=uA(null,t,n,e,r);break e;case 11:t=cA(null,t,n,e,r);break e;case 14:t=dA(null,t,n,Da(n.type,e),r);break e}throw Error(Xe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Da(n,s),Fx(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Da(n,s),uA(e,t,n,s,r);case 3:e:{if(u3(t),e===null)throw Error(Xe(387));n=t.pendingProps,a=t.memoizedState,s=a.element,FO(e,t),hg(t,n,null,r);var i=t.memoizedState;if(n=i.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Gd(Error(Xe(423)),t),t=pA(e,t,n,r,s);break e}else if(n!==s){s=Gd(Error(Xe(424)),t),t=pA(e,t,n,r,s);break e}else for(qs=Do(t.stateNode.containerInfo.firstChild),Hs=t,Ur=!0,Wa=null,r=RO(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ud(),n===s){t=Gi(e,t,r);break e}ys(e,t,n,r)}t=t.child}return t;case 5:return LO(t),e===null&&$x(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,i=s.children,Ax(n,s)?i=null:a!==null&&Ax(n,a)&&(t.flags|=32),d3(e,t),ys(e,t,i,r),t.child;case 6:return e===null&&$x(t),null;case 13:return p3(e,t,r);case 4:return E0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Wd(t,null,n,r):ys(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Da(n,s),cA(e,t,n,s,r);case 7:return ys(e,t,t.pendingProps,r),t.child;case 8:return ys(e,t,t.pendingProps.children,r),t.child;case 12:return ys(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,i=s.value,Rr(ug,n._currentValue),n._currentValue=i,a!==null)if(Ya(a.value,i)){if(a.children===s.children&&!Cs.current){t=Gi(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){i=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=Bi(-1,r&-r),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),Nx(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(Xe(341));i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Nx(i,r,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}ys(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,bd(t,r),s=wa(s),n=n(s),t.flags|=1,ys(e,t,n,r),t.child;case 14:return n=t.type,s=Da(n,t.pendingProps),s=Da(n.type,s),dA(e,t,n,s,r);case 15:return l3(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Da(n,s),Om(e,t),t.tag=1,js(n)?(e=!0,lg(t)):e=!1,bd(t,r),a3(t,n,s),Rx(t,n,s,r),Lx(null,t,n,!0,e,r);case 19:return h3(e,t,r);case 22:return c3(e,t,r)}throw Error(Xe(156,t.tag))};function P3(e,t){return rO(e,t)}function o8(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 5,844 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ga(e,t,r,n){return new o8(e,t,r,n)}function B0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function l8(e){if(typeof e=="function")return B0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===i0)return 11;if(e===o0)return 14}return 2}function Bo(e,t){var r=e.alternate;return r===null?(r=ga(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fm(e,t,r,n,s,a){var i=2;if(n=e,typeof e=="function")B0(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case rd:return Xl(r.children,s,a,t);case a0:i=8,s|=8;break;case ix:return e=ga(12,r,t,s|2),e.elementType=ix,e.lanes=a,e;case ox:return e=ga(13,r,t,s),e.elementType=ox,e.lanes=a,e;case lx:return e=ga(19,r,t,s),e.elementType=lx,e.lanes=a,e;case LN:return oy(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case DN:i=10;break e;case FN:i=9;break e;case i0:i=11;break e;case o0:i=14;break e;case _o:i=16,n=null;break e}throw Error(Xe(130,e==null?e:typeof e,""))}return t=ga(i,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function Xl(e,t,r,n){return e=ga(7,e,n,t),e.lanes=r,e}function oy(e,t,r,n){return e=ga(22,e,n,t),e.elementType=LN,e.lanes=r,e.stateNode={isHidden:!1},e}function T_(e,t,r){return e=ga(6,e,null,t),e.lanes=r,e}function M_(e,t,r){return t=ga(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c8(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=a_(0),this.expirationTimes=a_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=a_(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function U0(e,t,r,n,s,a,i,l,c){return e=new c8(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ga(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},M0(a),e}function d8(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:td,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function C3(e){if(!e)return Go;e=e._reactInternals;e:{if(fc(e)!==e||e.tag!==1)throw Error(Xe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(js(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Xe(171))}if(e.tag===1){var r=e.type;if(js(r))return CO(e,r,t)}return t}function j3(e,t,r,n,s,a,i,l,c){return e=U0(r,n,!0,e,s,a,i,l,c),e.context=C3(null),r=e.current,n=ws(),s=zo(r),a=Bi(n,s),a.callback=t??null,Fo(r,a,s),e.current.lanes=s,Mh(e,s,n),Is(e,n),e}function ly(e,t,r,n){var s=t.current,a=ws(),i=zo(s);return r=C3(r),t.context===null?t.context=r:t.pendingContext=r,t=Bi(a,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fo(s,t,i),e!==null&&(Ka(e,s,i,a),Im(e,s,i)),i}function xg(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bA(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function W0(e,t){bA(e,t),(e=e.alternate)&&bA(e,t)}function u8(){return null}var I3=typeof reportError=="function"?reportError:function(e){console.error(e)};function V0(e){this._internalRoot=e}cy.prototype.render=V0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Xe(409));ly(e,t,null,null)};cy.prototype.unmount=V0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ac(function(){ly(null,e,null,null)}),t[Wi]=null}};function cy(e){this._internalRoot=e}cy.prototype.unstable_scheduleHydration=function(e){if(e){var t=cO();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bo.length&&t!==0&&t<bo[r].priority;r++);bo.splice(r,0,e),r===0&&uO(e)}};function G0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function kA(){}function p8(e,t,r,n,s){if(s){if(typeof n=="function"){var a=n;n=function(){var d=xg(i);a.call(d)}}var i=j3(t,n,e,0,null,!1,!1,"",kA);return e._reactRootContainer=i,e[Wi]=i.current,Qp(e.nodeType===8?e.parentNode:e),ac(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var d=xg(c);l.call(d)}}var c=U0(e,0,!1,null,null,!1,!1,"",kA);return e._reactRootContainer=c,e[Wi]=c.current,Qp(e.nodeType===8?e.parentNode:e),ac(function(){ly(t,c,r,n)}),c}function uy(e,t,r,n,s){var a=r._reactRootContainer;if(a){var i=a;if(typeof s=="function"){var l=s;s=function(){var c=xg(i);l.call(c)}}ly(t,i,e,s)}else i=p8(r,t,e,s,n);return xg(i)}oO=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=yp(t.pendingLanes);
vendor: 4,389 bytes, line 40
40r!==0&&(d0(t,r|1),Is(t,mn()),!(lr&6)&&(qd=mn()+500,Xo()))}break;case 13:ac(function(){var n=Vi(e,1);if(n!==null){var s=ws();Ka(n,e,1,s)}}),W0(e,1)}};u0=function(e){if(e.tag===13){var t=Vi(e,134217728);if(t!==null){var r=ws();Ka(t,e,134217728,r)}W0(e,134217728)}};lO=function(e){if(e.tag===13){var t=zo(e),r=Vi(e,t);if(r!==null){var n=ws();Ka(r,e,t,n)}W0(e,t)}};cO=function(){return wr};dO=function(e,t){var r=wr;try{return wr=e,t()}finally{wr=r}};vx=function(e,t,r){switch(t){case"input":if(ux(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=ty(n);if(!s)throw Error(Xe(90));BN(n),ux(n,s)}}}break;case"textarea":WN(e,r);break;case"select":t=r.value,t!=null&&vd(e,!!r.multiple,t,!1)}};YN=F0;JN=ac;var h8={usingClientEntryPoint:!1,Events:[Sh,id,ty,KN,QN,F0]},Yu={findFiberByHostInstance:Ul,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},f8={bundleType:Yu.bundleType,version:Yu.version,rendererPackageName:Yu.rendererPackageName,rendererConfig:Yu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=eO(e),e===null?null:e.stateNode},findFiberByHostInstance:Yu.findFiberByHostInstance||u8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vf.isDisabled&&Vf.supportsFiber)try{Jg=Vf.inject(f8),bi=Vf}catch{}}Js.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=h8;Js.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G0(t))throw Error(Xe(200));return d8(e,t,null,r)};Js.createRoot=function(e,t){if(!G0(e))throw Error(Xe(299));var r=!1,n="",s=I3;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=U0(e,1,!1,null,null,r,!1,n,s),e[Wi]=t.current,Qp(e.nodeType===8?e.parentNode:e),new V0(t)};Js.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Xe(188)):(e=Object.keys(e).join(","),Error(Xe(268,e)));return e=eO(t),e=e===null?null:e.stateNode,e};Js.flushSync=function(e){return ac(e)};Js.hydrate=function(e,t,r){if(!dy(t))throw Error(Xe(200));return uy(null,e,t,!0,r)};Js.hydrateRoot=function(e,t,r){if(!G0(e))throw Error(Xe(405));var n=r!=null&&r.hydratedSources||null,s=!1,a="",i=I3;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=j3(t,null,e,1,r??null,s,!1,a,i),e[Wi]=t.current,Qp(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new cy(t)};Js.render=function(e,t,r){if(!dy(t))throw Error(Xe(200));return uy(null,e,t,!1,r)};Js.unmountComponentAtNode=function(e){if(!dy(e))throw Error(Xe(40));return e._reactRootContainer?(ac(function(){uy(null,null,e,!1,function(){e._reactRootContainer=null,e[Wi]=null})}),!0):!1};Js.unstable_batchedUpdates=F0;Js.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!dy(r))throw Error(Xe(200));if(e==null||e._reactInternals===void 0)throw Error(Xe(38));return uy(e,t,r,!1,n)};Js.version="18.3.1-next-f1338f8080-20240426";function $3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($3)}catch(e){console.error(e)}}$3(),$N.exports=Js;var Ph=$N.exports;const N3=Zd(Ph);var O3,TA=Ph;O3=TA.createRoot,TA.hydrateRoot;const m8=1,g8=1e6;let E_=0;function y8(){return E_=(E_+1)%Number.MAX_SAFE_INTEGER,E_.toString()}const S_=new Map,MA=e=>{if(S_.has(e))return;const t=setTimeout(()=>{S_.delete(e),Np({type:"REMOVE_TOAST",toastId:e})},g8);S_.set(e,t)},v8=(e,t)=>
40{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,m8)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?MA(r):e.toasts.forEach(n=>{MA(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Lm=[];let zm={toasts:[]};function Np(e){zm=v8(zm,e),Lm.forEach(t=>{t(zm)})}function _8({...e}){const t=y8(),r=s=>Np({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Np({type:"DISMISS_TOAST",toastId:t});return Np({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function w8(){const[e,t]=D.useState(zm);return D.useEffect(()=>(Lm.push(t),()=>{const r=Lm.indexOf(t);r>-1&&Lm.splice(r,1)}),[e]),{...e,toast:_8,dismiss:r=>Np({type:"DISMISS_TOAST",toastId:r})}}function Tr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function x8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function R3(...e){return t=>e.forEach(r=>x8(r,t))}function Hn(...e){return D.useCallback(R3(...e),e)}function b8(e,t=[]){let r=[];function n(a,i){const l=D.createContext(i),c=r.length;r=[...r,i];function d(u){const{scope:h,children:f,...m}=u,v=(h==null?void 0:h[e][c])||l,k=D.useMemo(()=>m,Object.values(m));return o.jsx(v.Provider,{value:k,children:f})}function p(u,h){const f=(h==null?void 0:h[e][c])||l,m=D.useContext(f);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}const s=()=>{const a=r.map(i=>D.createContext(i));return function(l){const c=(l==null?void 0:l[e])||a;return D.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,k8(s,...t)]}function k8(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const u=c(a)[`__scope${d}`];return{...l,...u}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Hd=D.forwardRef((e,t)=>{const{children:r,...n}=e,s=D.Children.toArray(r),a=s.find(T8);if(a){const i=a.props.children,l=s.map(c=>c===a?D.Children.count(i)>1?D.Children.only(null):D.isValidElement(i)?i.props.children:null:c);return o.jsx(Jx,{...n,ref:t,children:D.isValidElement(i)?D.cloneElement(i,void 0,l):null})}return o.jsx(Jx,{...n,ref:t,children:r})});Hd.displayName="Slot";var Jx=D.forwardRef((e,t)=>{const{children:r,...n}=e;if(D.isValidElement(r)){const s=E8(r);return D.cloneElement(r,{...M8(n,r.props),ref:t?R3(t,s):s})}return D.Children.count(r)>1?D.Children.only(null):null});Jx.displayName="SlotClone";var D3=({children:e})=>o.jsx(o.Fragment,{children:e});function T8(e){return D.isValidElement(e)&&e.type===D3}function M8(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...l)=>{a(...l),s(...l)}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}function E8(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function F3(e){const t=e+"CollectionProvider",[r,n]=b8(t),[s,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:m,children:v}=f,k=Le.useRef(null),y=Le.useRef(new Map).current;return o.jsx(s,{scope:m,itemMap:y,collectionRef:k,children:v})};i.displayName=t;const l=e+"CollectionSlot",c=Le.forwardRef((f,m)=>{const{scope:v,children:k}=f,y=a(l,v),g=Hn(m,y.collectionRef);return o.jsx(Hd,{ref:g,children:k})});c.displayName=l;const d=e+"CollectionItemSlot",p="data-radix-collection-item",u=Le.forwardRef((f,m)=>{const{scope:v,children:k,...y}=f,g=Le.useRef(null),_=Hn(m,g),w=a(d,v);return Le.useEffect(()=>(w.itemMap.set(g,{ref:g,...y}),()=>void w.itemMap.delete(g))),o.jsx(Hd,{[p]:"",ref:_,children:k})});u.displayName=d;function h(f){const m=a(e+"CollectionConsumer",f);return Le.useCallback(()=>{const k=m.collectionRef.current;if(!k)return[];const y=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((w,x)=>y.indexOf(w.ref.current)-y.indexOf(x.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:c,ItemSlot:u},h,n]}function S8(e,t){const r=D.createContext(t),n=a=>{const{children:i,...l}=a,c=D.useMemo(()=>l,Object.values(l));return o.jsx(r.Provider,{value:c,children:i})};n.displayName=e+"Provider";function s(a){const i=D.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,s]}function ru(e,t=[]){let r=[];function n(a,i){const l=D.createContext(i),c=r.length;r=[...r,i];const d=u=>{var y;const{scope:h,children:f,...m}=u,v=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,k=D.useMemo(()=>m,Object.values(m));return o.jsx(v.Provider,{value:k,children:f})};d.displayName=a+"Provider";function p(u,h){var v;const f=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,m=D.useContext(f);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}
vendor: 4,138 bytes, line 40
40return[d,p]}const s=()=>{const a=r.map(i=>D.createContext(i));return function(l){const c=(l==null?void 0:l[e])||a;return D.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,A8(s,...t)]}function A8(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const u=c(a)[`__scope${d}`];return{...l,...u}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var P8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Er=P8.reduce((e,t)=>{const r=D.forwardRef((n,s)=>{const{asChild:a,...i}=n,l=a?Hd:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function L3(e,t){e&&Ph.flushSync(()=>e.dispatchEvent(t))}function ba(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function C8(e,t=globalThis==null?void 0:globalThis.document){const r=ba(e);D.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var j8="DismissableLayer",Zx="dismissableLayer.update",I8="dismissableLayer.pointerDownOutside",$8="dismissableLayer.focusOutside",EA,z3=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),py=D.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:l,...c}=e,d=D.useContext(z3),[p,u]=D.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=D.useState({}),m=Hn(t,M=>u(M)),v=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(k),g=p?v.indexOf(p):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,w=g>=y,x=O8(M=>{const S=M.target,j=[...d.branches].some(I=>I.contains(S));!w||j||(s==null||s(M),i==null||i(M),M.defaultPrevented||l==null||l())},h),b=R8(M=>{const S=M.target;[...d.branches].some(I=>I.contains(S))||(a==null||a(M),i==null||i(M),M.defaultPrevented||l==null||l())},h);return C8(M=>{g===d.layers.size-1&&(n==null||n(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},h),D.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(EA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),SA(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=EA)}},[p,h,r,d]),D.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),SA())},[p,d]),D.useEffect(()=>{const M=()=>f({});return document.addEventListener(Zx,M),()=>document.removeEventListener(Zx,M)},[]),o.jsx(Er.div,{...c,ref:m,style:{pointerEvents:_?w?"auto":"none":void 0,...e.style},onFocusCapture:Tr(e.onFocusCapture,b.onFocusCapture),onBlurCapture:Tr(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:Tr(e.onPointerDownCapture,x.onPointerDownCapture)})});py.displayName=j8;var N8="DismissableLayerBranch",B3=D.forwardRef((e,t)=>{const r=D.useContext(z3),n=D.useRef(null),s=Hn(t,n);return D.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),o.jsx(Er.div,{...e,ref:s})});B3.displayName=N8;function O8(e,t=globalThis==null?void 0:globalThis.document){const r=ba(e),n=D.useRef(!1),s=D.useRef(()=>{});return D.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){U3(I8,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",
40s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function R8(e,t=globalThis==null?void 0:globalThis.document){const r=ba(e),n=D.useRef(!1);return D.useEffect(()=>{const s=a=>{a.target&&!n.current&&U3($8,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function SA(){const e=new CustomEvent(Zx);document.dispatchEvent(e)}function U3(e,t,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?L3(s,a):s.dispatchEvent(a)}var D8=py,F8=B3,qi=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},L8="Portal",q0=D.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,a]=D.useState(!1);qi(()=>a(!0),[]);const i=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?N3.createPortal(o.jsx(Er.div,{...n,ref:t}),i):null});q0.displayName=L8;function z8(e,t){return D.useReducer((r,n)=>t[r][n]??r,e)}var el=e=>{const{present:t,children:r}=e,n=B8(t),s=typeof r=="function"?r({present:n.isPresent}):D.Children.only(r),a=Hn(n.ref,U8(s));return typeof r=="function"||n.isPresent?D.cloneElement(s,{ref:a}):null};el.displayName="Presence";function B8(e){const[t,r]=D.useState(),n=D.useRef({}),s=D.useRef(e),a=D.useRef("none"),i=e?"mounted":"unmounted",[l,c]=z8(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const d=Gf(n.current);a.current=l==="mounted"?d:"none"},[l]),qi(()=>{const d=n.current,p=s.current;if(p!==e){const h=a.current,f=Gf(d);e?c("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(p&&h!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),qi(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,u=f=>{const v=Gf(n.current).includes(f.animationName);if(f.target===t&&v&&(c("ANIMATION_END"),!s.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},h=f=>{f.target===t&&(a.current=Gf(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:D.useCallback(d=>{d&&(n.current=getComputedStyle(d)),r(d)},[])}}function Gf(e){return(e==null?void 0:e.animationName)||"none"}function U8(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function nu({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=W8({defaultProp:t,onChange:r}),a=e!==void 0,i=a?e:n,l=ba(r),c=D.useCallback(d=>{if(a){const u=typeof d=="function"?d(e):d;u!==e&&l(u)}else s(d)},[a,e,s,l]);return[i,c]}function W8({defaultProp:e,onChange:t}){const r=D.useState(e),[n]=r,s=D.useRef(n),a=ba(t);return D.useEffect(()=>{s.current!==n&&(a(n),s.current=n)},[n,s,a]),r}var V8="VisuallyHidden",hy=D.forwardRef((e,t)=>o.jsx(Er.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));hy.displayName=V8;var G8=hy,H0="ToastProvider",[K0,q8,H8]=F3("Toast"),[W3,vae]=ru("Toast",[H8]),[K8,fy]=W3(H0),V3=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=e,[l,c]=D.useState(null),[d,p]=D.useState(0),u=D.useRef(!1),h=D.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${H0}\`. Expected non-empty \`string\`.`),o.jsx(K0.Provider,{scope:t,children:o.jsx(K8,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:D.useCallback(()=>p(f=>f+1),[]),onToastRemove:D.useCallback(()=>p(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:h,children:i})})};V3.displayName=H0;var G3="ToastViewport",Q8=["F8"],Xx="toast.viewportPause",eb="toast.viewportResume",q3=D.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=Q8,label:s="Notifications ({hotkey})",...a}=e,i=fy(G3,r),l=q8(r),c=D.useRef(null),d=D.useRef(null),p=D.useRef(null),u=D.useRef(null),h=Hn(t,u,i.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;D.useEffect(()=>{const k=y=>{var _;n.length!==0&&n.every(w=>y[w]||y.code===w)&&((_=u.current)==null||_.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[n]),D.useEffect(()=>{const k=c.current,y=u.current;if(m&&k&&y){const g=()=>{if(!i.isClosePausedRef.current){const b=new CustomEvent(Xx);y.dispatchEvent(b),i.isClosePausedRef.current=!0}},_=()=>{if(i.isClosePausedRef.current){const b=new CustomEvent(eb);y.dispatchEvent(b),i.isClosePausedRef.current=!1}},w=b=>{!k.contains(b.relatedTarget)&&_()},x=()=>{k.contains(document.activeElement)||_()};return k.addEventListener("focusin",g),k.addEventListener("focusout",w),k.addEventListener("pointermove",g),k.addEventListener("pointerleave",x),window.addEventListener("blur",g),window.addEventListener("focus",_),()=>{k.removeEventListener("focusin",g),k.removeEventListener("focusout",w),k.removeEventListener("pointermove",g),k.removeEventListener("pointerleave",x),window.removeEventListener("blur",g),window.removeEventListener("focus",_)}}},[m,i.isClosePausedRef]);const v=D.useCallback(({tabbingDirection:k})=>{const g=l().map(_=>{const w=_.ref.current,x=[w,...lW(w)];return k==="forwards"?x:x.reverse()});return(k==="forwards"?g.reverse():g).flat()},[l]);return D.useEffect(()=>{const k=u.current;if(k){const y=g=>{var x,b,M;const _=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!_){const S=document.activeElement,j=g.shiftKey;if(g.target===k&&j){(x=d.current)==null||x.focus();return}const U=v({tabbingDirection:j?"backwards":"forwards"}),R=U.findIndex(K=>K===S);A_(U.slice(R+1))?g.preventDefault():j?(b=d.current)==null||b.focus():(M=p.current)==null||M.focus()}};return k.addEventListener("keydown",y),()=>k.removeEventListener("keydown",y)}},[l,v]),o.jsxs(F8,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&o.jsx(tb,{ref:d,onFocusFromOutsideViewport:()=>{const k=v({tabbingDirection:"forwards"});A_(k)}}),o.jsx(K0.Slot,{scope:r,children:o.jsx(Er.ol,{tabIndex:-1,...a,ref:h})}),m&&o.jsx(tb,{ref:p,onFocusFromOutsideViewport:()=>{const k=v({tabbingDirection:"backwards"});A_(k)}})]})});q3.displayName=G3;var H3="ToastFocusProxy",tb=D.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,a=fy(H3,r);return o.jsx(hy,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var d;const l=i.relatedTarget;!((d=a.viewport)!=null&&d.contains(l))&&n()}})});tb.displayName=H3;var my="Toast",Y8="toast.swipeStart",J8="toast.swipeMove",Z8="toast.swipeCancel",X8="toast.swipeEnd",K3=D.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:a,...i}=e,[l=!0,c]=nu({prop:n,defaultProp:s,onChange:a});return o.jsx(el,{present:r||l,children:o.jsx(rW,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:ba(e.onPause),onResume:ba(e.onResume),onSwipeStart:Tr(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Tr(e.onSwipeMove,d=>{const{x:p,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:Tr(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Tr(e.onSwipeEnd,d=>{const{x:p,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});K3.displayName=my;var[eW,tW]=W3(my,{onClose(){}}),rW=D.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:a,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:p,onSwipeMove:u,onSwipeCancel:h,onSwipeEnd:f,...m}=e,v=fy(my,r),[k,y]=D.useState(null),g=Hn(t,K=>y(K)),_=D.useRef(null),w=D.useRef(null),x=s||v.duration,b=D.useRef(0),M=D.useRef(x),S=D.useRef(0),{onToastAdd:j,onToastRemove:I}=v,q=ba(()=>{var H;(k==null?void 0:k.contains(document.activeElement))&&((H=v.viewport)==null||H.focus()),i()}),U=D.useCallback(K=>{!K||K===1/0||(window.clearTimeout(S.current),b.current=new Date().getTime(),S.current=window.setTimeout(q,K))},[q]);D.useEffect(()=>{const K=v.viewport;if(K){const H=()=>{U(M.current),d==null||d()},ee=()=>{const te=new Date().getTime()-b.current;M.current=M.current-te,window.clearTimeout(S.current),c==null||c()};return K.addEventListener(Xx,ee),K.addEventListener(eb,H),()=>{K.removeEventListener(Xx,ee),K.removeEventListener(eb,H)}}},[v.viewport,x,c,d,U]),D.useEffect(()=>{a&&!v.isClosePausedRef.current&&U(x)},[a,x,v.isClosePausedRef,U]),D.useEffect(()=>(j(),()=>I()),[j,I]);const R=D.useMemo(()=>k?tR(k):null,[k]);return v.viewport?o.jsxs(o.Fragment,{children:[R&&o.jsx(nW,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),o.jsx(eW,{scope:r,onClose:q,children:Ph.createPortal(o.jsx(K0.ItemSlot,{scope:r,children:o.jsx(D8,{asChild:!0,onEscapeKeyDown:Tr(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||q(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Er.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...m,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Tr(e.onKeyDown,K=>{K.key==="Escape"&&(l==null||l(K.nativeEvent),K.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Tr(e.onPointerDown,K=>{K.button===0&&(_.current={x:K.clientX,y:K.clientY})}),onPointerMove:Tr(e.onPointerMove,K=>{if(!_.current)return;const H=K.clientX-_.current.x,ee=K.clientY-_.current.y,te=!!w.current,V=["left","right"].includes(v.swipeDirection),ae=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,ne=V?ae(0,H):0,L=V?0:ae(0,ee),$=K.pointerType==="touch"?10:2,G={x:ne,y:L},se={originalEvent:K,delta:G};te?(w.current=G,qf(J8,u,se,{discrete:!1})):AA(G,v.swipeDirection,$)?(w.current=G,qf(Y8,p,se,{discrete:!1}),K.target.setPointerCapture(K.pointerId)):(Math.abs(H)>$||Math.abs(ee)>$)&&(_.current=null)}),onPointerUp:Tr(e.onPointerUp,K=>{const H=w.current,ee=K.target;if(ee.hasPointerCapture(K.pointerId)&&ee.releasePointerCapture(K.pointerId),w.current=null,_.current=null,H){const te=K.currentTarget,V={originalEvent:K,delta:H};AA(H,v.swipeDirection,v.swipeThreshold)?qf(X8,f,V,{discrete:!0}):qf(Z8,h,V,{discrete:!0}),te.addEventListener("click",ae=>ae.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),nW=e=>{const{__scopeToast:t,children:r,...n}=e,s=fy(my,t),[a,i]=D.useState(!1),[l,c]=D.useState(!1);return iW(()=>i(!0)),D.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(q0,{asChild:!0,children:o.jsx(hy,{...n,children:a&&o.jsxs(o.Fragment,{children:[s.label," ",r]})})})},sW="ToastTitle",Q3=D.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Er.div,{...n,ref:t})});Q3.displayName=sW;var aW="ToastDescription",Y3=D.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Er.div,{...n,ref:t})});Y3.displayName=aW;var J3="ToastAction",Z3=D.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?o.jsx(eR,{altText:r,asChild:!0,children:o.jsx(Q0,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${J3}\`. Expected non-empty \`string\`.`),null)});Z3.displayName=J3;var X3="ToastClose",Q0=D.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=tW(X3,r);return o.jsx(eR,{asChild:!0,children:o.jsx(Er.button,{type:"button",...n,ref:t,onClick:Tr(e.onClick,s.onClose)})})});Q0.displayName=X3;var eR=D.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return o.jsx(Er.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function tR(e){const t=[];
vendor: 8,013 bytes, lines 40-119
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),oW(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...tR(n))}}),t}function qf(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?L3(s,a):s.dispatchEvent(a)}var AA=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),a=n>s;return t==="left"||t==="right"?a&&n>r:!a&&s>r};function iW(e=()=>{}){const t=ba(e);qi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function oW(e){return e.nodeType===e.ELEMENT_NODE}function lW(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function A_(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var cW=V3,rR=q3,nR=K3,sR=Q3,aR=Y3,iR=Z3,oR=Q0;function lR(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=lR(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function cR(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=lR(e))&&(n&&(n+=" "),n+=t);return n}const PA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CA=cR,gy=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return CA(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(d=>{const p=r==null?void 0:r[d],u=a==null?void 0:a[d];if(p===null)return null;const h=PA(p)||PA(u);return s[d][h]}),l=r&&Object.entries(r).reduce((d,p)=>{let[u,h]=p;return h===void 0||(d[u]=h),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:u,className:h,...f}=p;return Object.entries(f).every(m=>{let[v,k]=m;return Array.isArray(k)?k.includes({...a,...l}[v]):{...a,...l}[v]===k})?[...d,u,h]:d},[]);return CA(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const dW=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var uW={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const pW=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:a,iconNode:i,...l},c)=>D.createElement("svg",{ref:c,...uW,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:dR("lucide",s),...l},[...i.map(([d,p])=>D.createElement(d,p)),...Array.isArray(a)?a:[a]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const Cr=(e,t)=>{const r=D.forwardRef(({className:n,...s},a)=>D.createElement(pW,{ref:a,iconNode:t,className:dR(`lucide-${dW(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const jA=Cr("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const ya=Cr("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const hW=Cr("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const rb=Cr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const uR=Cr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const pR=Cr("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const fW=Cr("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const mW=Cr("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const gW=Cr("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const yW=Cr("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const P_=Cr("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"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const vW=Cr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const _W=Cr("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const C_=Cr("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"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const wW=Cr("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const xW=Cr("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const bW=Cr("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const kW=Cr("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const TW=Cr("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const MW=Cr("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const hR=Cr("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const fR=Cr("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"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const mR=Cr("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const EW=Cr("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
vendor: 13,199 bytes, lines 180-195
180y:"oel41y"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const SW=Cr("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const AW=Cr("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const Y0=Cr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),J0="-",PW=e=>{const t=jW(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const l=i.split(J0);return l[0]===""&&l.length!==1&&l.shift(),gR(l,t)||CW(i)},getConflictingClassGroupIds:(i,l)=>{const c=r[i]||[];return l&&n[i]?[...c,...n[i]]:c}}},gR=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?gR(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(J0);return(i=t.validators.find(({validator:l})=>l(a)))==null?void 0:i.classGroupId},IA=/^\[(.+)\]$/,CW=e=>{if(IA.test(e)){const t=IA.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},jW=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return $W(Object.entries(e.classGroups),r).forEach(([a,i])=>{nb(i,n,a,t)}),n},nb=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:$A(t,s);a.classGroupId=r;return}if(typeof s=="function"){if(IW(s)){nb(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([a,i])=>{nb(i,$A(t,a),r,n)})})},$A=(e,t)=>{let r=e;return t.split(J0).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},IW=e=>e.isThemeGetter,$W=(e,t)=>t?e.map(([r,n])=>{const s=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,l])=>[t+i,l])):a);return[r,s]}):e,NW=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=n.get(a))!==void 0)return s(a,i),i},set(a,i){r.has(a)?r.set(a,i):s(a,i)}}},yR="!",OW=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],a=t.length,i=l=>{const c=[];let d=0,p=0,u;for(let k=0;k<l.length;k++){let y=l[k];if(d===0){if(y===s&&(n||l.slice(k,k+a)===t)){c.push(l.slice(p,k)),p=k+a;continue}if(y==="/"){u=k;continue}}y==="["?d++:y==="]"&&d--}const h=c.length===0?l:l.substring(p),f=h.startsWith(yR),m=f?h.substring(1):h,v=u&&u>p?u-p:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:v}};return r?l=>r({className:l,parseClassName:i}):i},RW=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},DW=e=>({cache:NW(e.cacheSize),parseClassName:OW(e),...PW(e)}),FW=/\s+/,LW=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,a=[],i=e.trim().split(FW);let l="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:p,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:f}=r(d);let m=!!f,v=n(m?h.substring(0,f):h);if(!v){if(!m){l=d+(l.length>0?" "+l:l);continue}if(v=n(h),!v){l=d+(l.length>0?" "+l:l);continue}m=!1}const k=RW(p).join(":"),y=u?k+yR:k,g=y+v;if(a.includes(g))continue;a.push(g);const _=s(v,m);for(let w=0;w<_.length;++w){const x=_[w];a.push(y+x)}l=d+(l.length>0?" "+l:l)}return l};function zW(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=vR(t))&&(n&&(n+=" "),n+=r);return n}const vR=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=vR(e[n]))&&(r&&(r+=" "),r+=t);return r};function BW(e,...t){let r,n,s,a=i;function i(c){const d=t.reduce((p,u)=>u(p),e());return r=DW(d),n=r.cache.get,s=r.cache.set,a=l,l(c)}function l(c){const d=n(c);if(d)return d;const p=LW(c,r);return s(c,p),p}return function(){return a(zW.apply(null,arguments))}}const Dr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},_R=/^\[(?:([a-z-]+):)?(.+)\]$/i,UW=/^\d+\/\d+$/,WW=new Set(["px","full","screen"]),VW=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GW=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,HW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ai=e=>Td(e)||WW.has(e)||UW.test(e),co=e=>su(e,"length",rV),Td=e=>!!e&&!Number.isNaN(Number(e)),j_=e=>su(e,"number",Td),Ju=e=>!!e&&Number.isInteger(Number(e)),QW=e=>e.endsWith("%")&&Td(e.slice(0,-1)),Wt=e=>_R.test(e),uo=e=>VW.test(e),YW=new Set(["length","size","percentage"]),JW=e=>su(e,YW,wR),ZW=e=>su(e,"position",wR),XW=new Set(["image","url"]),eV=e=>su(e,XW,sV),tV=e=>su(e,"",nV),Zu=()=>!0,su=(e,t,r)=>{const n=_R.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},rV=e=>GW.test(e)&&!qW.test(e),wR=()=>!1,nV=e=>HW.test(e),sV=e=>KW.test(e),aV=()=>{const e=Dr("colors"),t=Dr("spacing"),r=Dr("blur"),n=Dr("brightness"),s=Dr("borderColor"),a=Dr("borderRadius"),i=Dr("borderSpacing"),l=Dr("borderWidth"),c=Dr("contrast"),d=Dr("grayscale"),p=Dr("hueRotate"),u=Dr("invert"),h=Dr("gap"),f=Dr("gradientColorStops"),m=Dr("gradientColorStopPositions"),v=Dr("inset"),k=Dr("margin"),y=Dr("opacity"),g=Dr("padding"),_=Dr("saturate"),w=Dr("scale"),x=Dr("sepia"),b=Dr("skew"),M=Dr("space"),S=Dr("translate"),j=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Wt,t],U=()=>[Wt,t],R=()=>["",Ai,co],K=()=>["auto",Td,Wt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",Wt],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Td,Wt];return{cacheSize:500,separator:":",theme:{colors:[Zu],spacing:[Ai,co],blur:["none","",uo,Wt],brightness:L(),borderColor:[e],borderRadius:["none","","full",uo,Wt],borderSpacing:U(),borderWidth:R(),contrast:L(),grayscale:ae(),hueRotate:L(),invert:ae(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[QW,co],inset:q(),margin:q(),opacity:L(),padding:U(),saturate:L(),scale:L(),sepia:ae(),skew:L(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",Wt]}],container:["container"],columns:[{columns:[uo]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Wt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ju,Wt]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Wt]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",Ju,Wt]}],"grid-cols":[{"grid-cols":[Zu]}],"col-start-end":[{col:["auto",{span:["full",Ju,Wt]},Wt]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[Zu]}],"row-start-end":[{row:["auto",{span:[Ju,Wt]},Wt]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Wt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Wt,t]}],"min-w":[{"min-w":[Wt,t,"min","max","fit"]}],"max-w":[{"max-w":[Wt,t,"none","full","min","max","fit","prose",{screen:[uo]},uo]}],h:[{h:[Wt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Wt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Wt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Wt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",uo,co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j_]}],"font-family":[{font:[Zu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Wt]}],"line-clamp":[{"line-clamp":["none",Td,j_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ai,Wt]}],"list-image":[{"list-image":["none",Wt]}],"list-style-type":[{list:["none","disc","decimal",Wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ai,co]}],"underline-offset":[{"underline-offset":["auto",Ai,Wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),ZW]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JW]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}
195],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,471 bytes, line 195
195],"divide-style":[{divide:ee()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Ai,Wt]}],"outline-w":[{outline:[Ai,co]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ai,co]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",uo,tV]}],"shadow-color":[{shadow:[Zu]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",uo,Wt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[u]}],saturate:[{saturate:[_]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Wt]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",Wt]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",Wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Ju,Wt]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Wt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ai,co,j_]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
195none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},iV=BW(aV);function Sn(...e){return iV(cR(e))}const oV=cW,xR=D.forwardRef(({className:e,...t},r)=>o.jsx(rR,{ref:r,className:Sn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));xR.displayName=rR.displayName;const lV=gy("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),bR=D.forwardRef(({className:e,variant:t,...r},n)=>o.jsx(nR,{ref:n,className:Sn(lV({variant:t}),e),...r}));bR.displayName=nR.displayName;const cV=D.forwardRef(({className:e,...t},r)=>o.jsx(iR,{ref:r,className:Sn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));cV.displayName=iR.displayName;const kR=D.forwardRef(({className:e,...t},r)=>o.jsx(oR,{ref:r,className:Sn("absolute right-2 top-2 rounded-md p-1 text-foreground
195/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Y0,{className:"h-4 w-4"})}));kR.displayName=oR.displayName;const TR=D.forwardRef(({className:e,...t},r)=>o.jsx(sR,{ref:r,className:Sn("text-sm font-semibold",e),...t}));TR.displayName=sR.displayName;const MR=D.forwardRef(({className:e,...t},r)=>o.jsx(aR,{ref:r,className:Sn("text-sm opacity-90",e),...t}));MR.displayName=aR.displayName;function dV(){const{toasts:e}=w8();return o.jsxs(oV,{children:[e.map(function({id:t,title:r,description:n,action:s,...a}){return o.jsxs(bR,{...a,children:[o.jsxs("div",{className:"grid gap-1",children:[r&&o.jsx(TR,{children:r}),n&&o.jsx(MR,{children:n})]}),s,o.jsx(kR,{})]},t)}),o.jsx(xR,{})]})}var NA=["light","dark"],uV="(prefers-color-scheme: dark)",pV=D.createContext(void 0),hV={setTheme:e=>{},themes:[]},fV=()=>{var e;return(e=D.useContext(pV))!=null?e:hV};D.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:a,value:i,attrs:l,nonce:c})=>{let d=a==="system",p=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,u=s?NA.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(m,v=!1,k=!0)=>{let y=i?i[m]:m,g=v?m+"|| ''":`'${y}'`,_="";return s&&k&&!v&&NA.includes(m)&&(_+=`d.style.colorScheme = '${m}';`),r==="class"?v||y?_+=`c.add(${g})`:_+="null":y&&(_+=`d[s](n,${g})`),_},f=e?`!function(){${p}${h(e)}}()`:n?`!function(){try{${p}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${uV}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${d?"":"else{"+h(a,!1,!1)+"}"}${u}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(a,!1,!1)};}${u}}catch(t){}}();`;return D.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var mV=e=>{switch(e){case"success":return vV;case"info":return wV;case"warning":return _V;case"error":return xV;default:return null}},gV=Array(12).fill(0),yV=({visible:e})=>Le.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},Le.createElement("div",{className:"sonner-spinner"},gV.map((t,r)=>Le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),vV=Le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_V=Le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),wV=Le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),xV=Le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),bV=()=>{let[e,t]=Le.useState(document.hidden);return Le.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},sb=1,kV=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>
195{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:n,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:sb++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t||this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let s=t instanceof Promise?t:t(),a=n!==void 0;return s.then(async i=>{if(MV(i)&&!i.ok){a=!1;let l=typeof r.error=="function"?await r.error(`HTTP error! status: ${i.status}`):r.error,c=typeof r.description=="function"?await r.description(`HTTP error! status: ${i.status}`):r.description;this.create({id:n,type:"error",message:l,description:c})}else if(r.success!==void 0){a=!1;let l=typeof r.success=="function"?await r.success(i):r.success,c=typeof r.description=="function"?await r.description(i):r.description;this.create({id:n,type:"success",message:l,description:c})}}).catch(async i=>{if(r.error!==void 0){a=!1;let l=typeof r.error=="function"?await r.error(i):r.error,c=typeof r.description=="function"?await r.description(i):r.description;this.create({id:n,type:"error",message:l,description:c})}}).finally(()=>{var i;a&&(this.dismiss(n),n=void 0),(i=r.finally)==null||i.call(r)}),n},this.custom=(t,r)=>{let n=(r==null?void 0:r.id)||sb++;return this.create({jsx:t(n),id:n,...r}),n},this.subscribers=[],this.toasts=[]}},Bs=new kV,TV=(e,t)=>{let r=(t==null?void 0:t.id)||sb++;return Bs.addToast({title:e,...t,id:r}),r},MV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",EV=TV,SV=()=>Bs.toasts,ha=Object.assign(EV,{success:Bs.success,info:Bs.info,warning:Bs.warning,error:Bs.error,custom:Bs.custom,message:Bs.message,promise:Bs.promise,dismiss:Bs.dismiss,loading:Bs.loading},{getHistory:SV});function AV(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}AV(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
195left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
195:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
196`);function Hf(e){return e.label!==void 0}var PV=3,CV="32px",jV=4e3,IV=356,$V=14,NV=20,OV=200;function RV(...e){return e.filter(Boolean).join(" ")}var DV=e=>{var t,r,n,s,a,i,l,c,d,p;let{invert:u,toast:h,unstyled:f,interacting:m,setHeights:v,visibleToasts:k,heights:y,index:g,toasts:_,expanded:w,removeToast:x,defaultRichColors:b,closeButton:M,style:S,cancelButtonStyle:j,actionButtonStyle:I,className:q="",descriptionClassName:U="",duration:R,position:K,gap:H,loadingIcon:ee,expandByDefault:te,classNames:V,icons:ae,closeButtonAriaLabel:ne="Close toast",pauseWhenPageIsHidden:L,cn:$}=e,[G,se]=Le.useState(!1),[_e,de]=Le.useState(!1),[Ee,ze]=Le.useState(!1),[Ke,ve]=Le.useState(!1),[J,ue]=Le.useState(0),[Y,Se]=Le.useState(0),Ae=Le.useRef(null),Oe=Le.useRef(null),Ne=g===0,Q=g+1<=k,re=h.type,pe=h.dismissible!==!1,Me=h.className||"",Te=h.descriptionClassName||"",me=Le.useMemo(()=>y.findIndex(F=>F.toastId===h.id)||0,[y,h.id]),Pe=Le.useMemo(()=>{var F;return(F=h.closeButton)!=null?F:M},[h.closeButton,M]),Be=Le.useMemo(()=>h.duration||R||jV,[h.duration,R]),rt=Le.useRef(0),et=Le.useRef(0),Ye=Le.useRef(0),Fe=Le.useRef(null),[lt,It]=K.split("-"),Qt=Le.useMemo(()=>y.reduce((F,le,B)=>B>=me?F:F+le.height,0),[y,me]),Gt=bV(),zr=h.invert||u,hr=re==="loading";et.current=Le.useMemo(()=>me*H+Qt,[me,Qt]),Le.useEffect(()=>{se(!0)},[]),Le.useLayoutEffect(()=>{if(!G)return;let F=Oe.current,le=F.style.height;F.style.height="auto";let B=F.getBoundingClientRect().height;F.style.height=le,Se(B),v(oe=>oe.find(xe=>xe.toastId===h.id)?oe.map(xe=>xe.toastId===h.id?{...xe,height:B}:xe):[{toastId:h.id,height:B,position:h.position},...oe])},[G,h.title,h.description,v,h.id]);let Tt=Le.useCallback(()=>{de(!0),ue(et.current),v(F=>F.filter(le=>le.toastId!==h.id)),setTimeout(()=>{x(h)},OV)},[h,x,v,et]);Le.useEffect(()=>{if(h.promise&&re==="loading"||h.duration===1/0||h.type==="loading")return;let F,le=Be;return w||m||L&&Gt?(()=>{if(Ye.current<rt.current){let B=new Date().getTime()-rt.current;le=le-B}
196Ye.current=new Date().getTime()})():le!==1/0&&(rt.current=new Date().getTime(),F=setTimeout(()=>{var B;(B=h.onAutoClose)==null||B.call(h,h),Tt()},le)),()=>clearTimeout(F)},[w,m,te,h,Be,Tt,h.promise,re,L,Gt]),Le.useEffect(()=>{let F=Oe.current;if(F){let le=F.getBoundingClientRect().height;return Se(le),v(B=>[{toastId:h.id,height:le,position:h.position},...B]),()=>v(B=>B.filter(oe=>oe.toastId!==h.id))}},[v,h.id]),Le.useEffect(()=>{h.delete&&Tt()},[Tt,h.delete]);function ks(){return ae!=null&&ae.loading?Le.createElement("div",{className:"sonner-loader","data-visible":re==="loading"},ae.loading):ee?Le.createElement("div",{className:"sonner-loader","data-visible":re==="loading"},ee):Le.createElement(yV,{visible:re==="loading"})}return Le.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Oe,className:$(q,Me,V==null?void 0:V.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,V==null?void 0:V.default,V==null?void 0:V[re],(r=h==null?void 0:h.classNames)==null?void 0:r[re]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:b,"data-styled":!(h.jsx||h.unstyled||f),"data-mounted":G,"data-promise":!!h.promise,"data-removed":_e,"data-visible":Q,"data-y-position":lt,"data-x-position":It,"data-index":g,"data-front":Ne,"data-swiping":Ee,"data-dismissible":pe,"data-type":re,"data-invert":zr,"data-swipe-out":Ke,"data-expanded":!!(w||te&&G),style:{"--index":g,"--toasts-before":g,"--z-index":_.length-g,"--offset":`${_e?J:et.current}px`,"--initial-height":te?"auto":`${Y}px`,...S,...h.style},onPointerDown:F=>{hr||!pe||(Ae.current=new Date,ue(et.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(ze(!0),Fe.current={x:F.clientX,y:F.clientY}))},onPointerUp:()=>{var F,le,B,oe;if(Ke||!pe)return;Fe.current=null;let xe=Number(((F=Oe.current)==null?void 0:F.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Ue=new Date().getTime()-((le=Ae.current)==null?void 0:le.getTime()),je=Math.abs(xe)/Ue;if(Math.abs(xe)>=NV||je>.11){ue(et.current),(B=h.onDismiss)==null||B.call(h,h),Tt(),ve(!0);return}(oe=Oe.current)==null||oe.style.setProperty("--swipe-amount","0px"),ze(!1)},onPointerMove:F=>{var le;if(!Fe.current||!pe)return;let B=F.clientY-Fe.current.y,oe=F.clientX-Fe.current.x,xe=(lt==="top"?Math.min:Math.max)(0,B),Ue=F.pointerType==="touch"?10:2;Math.abs(xe)>Ue?(le=Oe.current)==null||le.style.setProperty("--swipe-amount",`${B}px`):Math.abs(oe)>Ue&&(Fe.current=null)}},Pe&&!h.jsx?Le.createElement("button",{"aria-label":ne,"data-disabled":hr,"data-close-button":!0,onClick:hr||!pe?()=>{}:()=>{var F;Tt(),(F=h.onDismiss)==null||F.call(h,h)},className:$(V==null?void 0:V.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},Le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||Le.isValidElement(h.title)?h.jsx||h.title:Le.createElement(Le.Fragment,null,re||h.icon||h.promise?Le.createElement("div",{"data-icon":"",className:$(V==null?void 0:V.icon,(a=h==null?void 0:h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ks():null,h.type!=="loading"?h.icon||(ae==null?void 0:ae[re])||mV(re):null):null,Le.createElement("div",{"data-content":"",className:$(V==null?void 0:V.content,(i=h==null?void 0:h.classNames)==null?void 0:i.content)},Le.createElement("div",{"data-title":"",className:$(V==null?void 0:V.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},h.title),h.description?Le.createElement("div",{"data-description":"",className:$(U,Te,V==null?void 0:V.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},h.description):null),Le.isValidElement(h.cancel)?h.cancel:h.cancel&&Hf(h.cancel)?Le.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:F=>{var le,B;Hf(h.cancel)&&pe&&((B=(le=h.cancel).onClick)==null||B.call(le,F),Tt())},className:$(V==null?void 0:V.cancelButton,(d=h==null?void 0:h.classNames)==null?void 0:d.cancelButton)}
196,h.cancel.label):null,Le.isValidElement(h.action)?h.action:h.action&&Hf(h.action)?Le.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||I,onClick:F=>{var le,B;Hf(h.action)&&(F.defaultPrevented||((B=(le=h.action).onClick)==null||B.call(le,F),Tt()))},className:$(V==null?void 0:V.actionButton,(p=h==null?void 0:h.classNames)==null?void 0:p.actionButton)},h.action.label):null))};function OA(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var FV=e=>{let{invert:t,position:r="bottom-right",hotkey:n=["altKey","KeyT"],expand:s,closeButton:a,className:i,offset:l,theme:c="light",richColors:d,duration:p,style:u,visibleToasts:h=PV,toastOptions:f,dir:m=OA(),gap:v=$V,loadingIcon:k,icons:y,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:_,cn:w=RV}=e,[x,b]=Le.useState([]),M=Le.useMemo(()=>Array.from(new Set([r].concat(x.filter(L=>L.position).map(L=>L.position)))),[x,r]),[S,j]=Le.useState([]),[I,q]=Le.useState(!1),[U,R]=Le.useState(!1),[K,H]=Le.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=Le.useRef(null),te=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),V=Le.useRef(null),ae=Le.useRef(!1),ne=Le.useCallback(L=>{var $;($=x.find(G=>G.id===L.id))!=null&&$.delete||Bs.dismiss(L.id),b(G=>G.filter(({id:se})=>se!==L.id))},[x]);return Le.useEffect(()=>Bs.subscribe(L=>{if(L.dismiss){b($=>$.map(G=>G.id===L.id?{...G,delete:!0}:G));return}setTimeout(()=>{N3.flushSync(()=>{b($=>{let G=$.findIndex(se=>se.id===L.id);return G!==-1?[...$.slice(0,G),{...$[G],...L},...$.slice(G+1)]:[L,...$]})})})}),[]),Le.useEffect(()=>{if(c!=="system"){H(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:L})=>{H(L?"dark":"light")})},[c]),Le.useEffect(()=>{x.length<=1&&q(!1)},[x]),Le.useEffect(()=>{let L=$=>{var G,se;n.every(_e=>$[_e]||$.code===_e)&&(q(!0),(G=ee.current)==null||G.focus()),$.code==="Escape"&&(document.activeElement===ee.current||(se=ee.current)!=null&&se.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[n]),Le.useEffect(()=>{if(ee.current)return()=>{V.current&&(V.current.focus({preventScroll:!0}),V.current=null,ae.current=!1)}},[ee.current]),x.length?Le.createElement("section",{"aria-label":`${g} ${te}`,tabIndex:-1},M.map((L,$)=>{var G;let[se,_e]=L.split("-");return Le.createElement("ol",{key:L,dir:m==="auto"?OA():m,tabIndex:-1,ref:ee,className:i,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":se,"data-x-position":_e,style:{"--front-toast-height":`${((G=S[0])==null?void 0:G.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||CV,"--width":`${IV}px`,"--gap":`${v}px`,...u},onBlur:de=>{ae.current&&!de.currentTarget.contains(de.relatedTarget)&&(ae.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,V.current=de.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||R(!0)},onPointerUp:()=>R(!1)},x.filter(de=>!de.position&&$===0||de.position===L).map((de,Ee)=>{var ze,Ke;return Le.createElement(DV,{key:de.id,icons:y,index:Ee,toast:de,defaultRichColors:d,duration:(ze=f==null?void 0:f.duration)!=null?ze:p,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:t,visibleToasts:h,closeButton:(Ke=f==null?void 0:f.closeButton)!=null?Ke:a,interacting:U,position:L,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,removeToast:ne,toasts:x.filter(ve=>ve.position==de.position),heights:S.filter(ve=>ve.position==de.position),setHeights:j,expandByDefault:s,gap:v,loadingIcon:k,expanded:I,pauseWhenPageIsHidden:_,cn:w})}))})):null};const LV=({...e})=>{const{theme:t="system"}=fV();return o.jsx(FV,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var zV=jN.useId||(()=>{}),BV=0;function Op(e){const[t,r]=D.useState(zV());return qi(()=>{r(n=>n??String(BV++))},[e]),t?`radix-${t}`:""}const UV=["top","right","bottom","left"],qo=Math.min,Ws=Math.max,bg=Math.round,Kf=Math.floor,Ho=e=>({x:e,y:e}
vendor: 2,282 bytes, line 196
196),WV={left:"right",right:"left",bottom:"top",top:"bottom"},VV={start:"end",end:"start"};function ab(e,t,r){return Ws(e,qo(t,r))}function Hi(e,t){return typeof e=="function"?e(t):e}function Ki(e){return e.split("-")[0]}function au(e){return e.split("-")[1]}function Z0(e){return e==="x"?"y":"x"}function X0(e){return e==="y"?"height":"width"}function Ko(e){return["top","bottom"].includes(Ki(e))?"y":"x"}function e1(e){return Z0(Ko(e))}function GV(e,t,r){r===void 0&&(r=!1);const n=au(e),s=e1(e),a=X0(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=kg(i)),[i,kg(i)]}function qV(e){const t=kg(e);return[ib(e),t,ib(t)]}function ib(e){return e.replace(/start|end/g,t=>VV[t])}function HV(e,t,r){const n=["left","right"],s=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?a:i;default:return[]}}function KV(e,t,r,n){const s=au(e);let a=HV(Ki(e),r==="start",n);return s&&(a=a.map(i=>i+"-"+s),t&&(a=a.concat(a.map(ib)))),a}function kg(e){return e.replace(/left|right|bottom|top/g,t=>WV[t])}function QV(e){return{top:0,right:0,bottom:0,left:0,...e}}function ER(e){return typeof e!="number"?QV(e):{top:e,right:e,bottom:e,left:e}}function Tg(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function RA(e,t,r){let{reference:n,floating:s}=e;const a=Ko(t),i=e1(t),l=X0(i),c=Ki(t),d=a==="y",p=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,h=n[l]/2-s[l]/2;let f;switch(c){case"top":f={x:p,y:n.y-s.height};break;case"bottom":f={x:p,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-s.width,y:u};break;default:f={x:n.x,y:n.y}}switch(au(t)){case"start":f[i]-=h*(r&&d?-1:1);break;case"end":f[i]+=h*(r&&d?-1:1);break}return f}const YV=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,l=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:u}=RA(d,n,c),h=n,f={},m=0;for(let v=0;v<l.length;v++){const{name:k,fn:y}=l[v],{x:g,y:_,data:w,reset:x}=await y({x:p,y:u,initialPlacement:n,placement:h,strategy:s,middlewareData:f,re
vendor: 9,175 bytes, line 196
196cts:d,platform:i,elements:{reference:e,floating:t}});p=g??p,u=_??u,f={...f,[k]:{...f[k],...w}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(d=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):x.rects),{x:p,y:u}=RA(d,h,c)),v=-1)}return{x:p,y:u,placement:h,strategy:s,middlewareData:f}};async function sh(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:a,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:u="floating",altBoundary:h=!1,padding:f=0}=Hi(t,e),m=ER(f),k=l[h?u==="floating"?"reference":"floating":u],y=Tg(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(k)))==null||r?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:c})),g=u==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),w=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},x=Tg(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:_,strategy:c}):g);return{top:(y.top-x.top+m.top)/w.y,bottom:(x.bottom-y.bottom+m.bottom)/w.y,left:(y.left-x.left+m.left)/w.x,right:(x.right-y.right+m.right)/w.x}}const JV=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:a,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:p=0}=Hi(e,t)||{};if(d==null)return{};const u=ER(p),h={x:r,y:n},f=e1(s),m=X0(f),v=await i.getDimensions(d),k=f==="y",y=k?"top":"left",g=k?"bottom":"right",_=k?"clientHeight":"clientWidth",w=a.reference[m]+a.reference[f]-h[f]-a.floating[m],x=h[f]-a.reference[f],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let M=b?b[_]:0;(!M||!await(i.isElement==null?void 0:i.isElement(b)))&&(M=l.floating[_]||a.floating[m]);const S=w/2-x/2,j=M/2-v[m]/2-1,I=qo(u[y],j),q=qo(u[g],j),U=I,R=M-v[m]-q,K=M/2-v[m]/2+S,H=ab(U,K,R),ee=!c.arrow&&au(s)!=null&&K!==H&&a.reference[m]/2-(K<U?I:q)-v[m]/2<0,te=ee?K<U?K-U:K-R:0;return{[f]:h[f]+te,data:{[f]:H,centerOffset:K-H-te,...ee&&{alignmentOffset:te}},reset:ee}}}),ZV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...k}=Hi(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const y=Ki(s),g=Ko(l),_=Ki(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),x=h||(_||!v?[kg(l)]:qV(l)),b=m!=="none";!h&&b&&x.push(...KV(l,v,m,w));const M=[l,...x],S=await sh(t,k),j=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(p&&j.push(S[y]),u){const K=GV(s,i,w);j.push(S[K[0]],S[K[1]])}if(I=[...I,{placement:s,overflows:j}],!j.every(K=>K<=0)){var q,U;const K=(((q=a.flip)==null?void 0:q.index)||0)+1,H=M[K];if(H)return{data:{index:K,overflows:I},reset:{placement:H}};let ee=(U=I.filter(te=>te.overflows[0]<=0).sort((te,V)=>te.overflows[1]-V.overflows[1])[0])==null?void 0:U.placement;if(!ee)switch(f){case"bestFit":{var R;const te=(R=I.filter(V=>{if(b){const ae=Ko(V.placement);return ae===g||ae==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ae=>ae>0).reduce((ae,ne)=>ae+ne,0)]).sort((V,ae)=>V[1]-ae[1])[0])==null?void 0:R[0];te&&(ee=te);break}case"initialPlacement":ee=l;break}if(s!==ee)return{reset:{placement:ee}}}return{}}}};function DA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function FA(e){return UV.some(t=>e[t]>=0)}const XV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Hi(e,t);switch(n){case"referenceHidden":{const a=await sh(t,{...s,elementContext:"reference"}),i=DA(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:FA(i)}}}case"escaped":{const a=await sh(t,{...s,altBoundary:!0}),i=DA(a,r.floating);return{data:{escapedOffsets:i,escaped:FA(i)}}}default:return{}}}}};async function eG(e,t){const{placement:r,platform:n,elements:s}=e,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=Ki(r),l=au(r),c=Ko(r)==="y",d=["left","top"].includes(i)?-1:1,p=a&&c?-1:1,u=Hi(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof m=="number"&&(f=l==="end"?m*-1:m),c?{x:f*p,y:h*d}:{x:h*d,y:f*p}}const tG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:a,placement:i,middlewareData:l}=t,c=await eG(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},rG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:k=>{let{x:y,y:g}=k;return{x:y,y:g}}},...c}=Hi(e,t),d={x:r,y:n},p=await sh(t,c),u=Ko(Ki(s)),h=Z0(u);let f=d[h],m=d[u];if(a){const k=h==="y"?"top":"left",y=h==="y"?"bottom":"right",g=f+p[k],_=f-p[y];f=ab(g,f,_)}if(i){const k=u==="y"?"top":"left",y=u==="y"?"bottom":"right",g=m+p[k],_=m-p[y];m=ab(g,m,_)}const v=l.fn({...t,[h]:f,[u]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[h]:a,[u]:i}}}}}},nG=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Hi(e,t),p={x:r,y:n},u=Ko(s),h=Z0(u);let f=p[h],m=p[u];const v=Hi(l,t),k=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=h==="y"?"height":"width",w=a.reference[h]-a.floating[_]+k.mainAxis,x=a.reference[h]+a.reference[_]-k.mainAxis;f<w?f=w:f>x&&(f=x)}if(d){var y,g;const _=h==="y"?"width":"height",w=["top","left"].includes(Ki(s)),x=a.reference[u]-a.floating[_]+(w&&((y=i.offset)==null?void 0:y[u])||0)+(w?0:k.crossAxis),b=a.reference[u]+a.reference[_]+(w?0:((g=i.offset)==null?void 0:g[u])||0)-(w?k.crossAxis:0);m<x?m=x:m>b&&(m=b)}return{[h]:f,[u]:m}}}},sG=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:a,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Hi(e,t),p=await sh(t,d),u=Ki(s),h=au(s),f=Ko(s)==="y",{width:m,height:v}=a.floating;let k,y;u==="top"||u==="bottom"?(k=u,y=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=u,k=h==="end"?"top":"bottom");const g=v-p.top-p.bottom,_=m-p.left-p.right,w=qo(v-p[k],g),x=qo(m-p[y],_),b=!t.middlewareData.shift;let M=w,S=x;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=_),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(M=g),b&&!h){const I=Ws(p.left,0),q=Ws(p.right,0),U=Ws(p.top,0),R=Ws(p.bottom,0);f?S=m-2*(I!==0||q!==0?I+q:Ws(p.left,p.right)):M=v-2*(U!==0||R!==0?U+R:Ws(p.top,p.bottom))}await c({...t,availableWidth:S,availableHeight:M});const j=await i.getDimensions(l.floating);return m!==j.width||v!==j.height?{reset:{rects:!0}}:{}}}};function yy(){return typeof window<"u"}function iu(e){return SR(e)?(e.nodeName||"").toLowerCase():"#document"}function Ks(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mi(e){var t;return(t=(SR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function SR(e){return yy()?e instanceof Node||e instanceof Ks(e).Node:!1}function Ja(e){return yy()?e instanceof Element||e instanceof Ks(e).Element:!1}function Ti(e){return yy()?e instanceof HTMLElement||e instanceof Ks(e).HTMLElement:!1}function LA(e){return!yy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ks(e).ShadowRoot}function Ch(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Za(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function aG(e){return["table","td","th"].includes(iu(e))}function vy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function t1(e){const t=r1(),r=Ja(e)?Za(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function iG(e){let t=Qo(e);for(;Ti(t)&&!Kd(t);){if(t1(t))return t;if(vy(t))return null;t=Qo(t)}return null}function r1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Kd(e){return["html","body","#document"].includes(iu(e))}function Za(e){return Ks(e).getComputedStyle(e)}function _y(e){return Ja(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qo(e){if(iu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||LA(e)&&e.host||Mi(e);return LA(t)?t.host:t}function AR(e){const t=Qo(e);
vendor: 7,356 bytes, line 196
196return Kd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ti(t)&&Ch(t)?t:AR(t)}function ah(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=AR(e),a=s===((n=e.ownerDocument)==null?void 0:n.body),i=Ks(s);if(a){const l=ob(i);return t.concat(i,i.visualViewport||[],Ch(s)?s:[],l&&r?ah(l):[])}return t.concat(s,ah(s,[],r))}function ob(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PR(e){const t=Za(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Ti(e),a=s?e.offsetWidth:r,i=s?e.offsetHeight:n,l=bg(r)!==a||bg(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function n1(e){return Ja(e)?e:e.contextElement}function Md(e){const t=n1(e);if(!Ti(t))return Ho(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:a}=PR(t);let i=(a?bg(r.width):r.width)/n,l=(a?bg(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const oG=Ho(0);function CR(e){const t=Ks(e);return!r1()||!t.visualViewport?oG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lG(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ks(e)?!1:t}function ic(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),a=n1(e);let i=Ho(1);t&&(n?Ja(n)&&(i=Md(n)):i=Md(e));const l=lG(a,r,n)?CR(a):Ho(0);let c=(s.left+l.x)/i.x,d=(s.top+l.y)/i.y,p=s.width/i.x,u=s.height/i.y;if(a){const h=Ks(a),f=n&&Ja(n)?Ks(n):n;let m=h,v=ob(m);for(;v&&n&&f!==m;){const k=Md(v),y=v.getBoundingClientRect(),g=Za(v),_=y.left+(v.clientLeft+parseFloat(g.paddingLeft))*k.x,w=y.top+(v.clientTop+parseFloat(g.paddingTop))*k.y;c*=k.x,d*=k.y,p*=k.x,u*=k.y,c+=_,d+=w,m=Ks(v),v=ob(m)}}return Tg({width:p,height:u,x:c,y:d})}function cG(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const a=s==="fixed",i=Mi(n),l=t?vy(t.floating):!1;if(n===i||l&&a)return r;let c={scrollLeft:0,scrollTop:0},d=Ho(1);const p=Ho(0),u=Ti(n);if((u||!u&&!a)&&((iu(n)!=="body"||Ch(i))&&(c=_y(n)),Ti(n))){const h=ic(n);d=Md(n),p.x=h.x+n.clientLeft,p.y=h.y+n.clientTop}return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+p.x,y:r.y*d.y-c.scrollTop*d.y+p.y}}function dG(e){return Array.from(e.getClientRects())}function lb(e,t){const r=_y(e).scrollLeft;return t?t.left+r:ic(Mi(e)).left+r}function uG(e){const t=Mi(e),r=_y(e),n=e.ownerDocument.body,s=Ws(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Ws(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+lb(e);const l=-r.scrollTop;return Za(n).direction==="rtl"&&(i+=Ws(t.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:l}}function pG(e,t){const r=Ks(e),n=Mi(e),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,l=0,c=0;if(s){a=s.width,i=s.height;const d=r1();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:i,x:l,y:c}}function hG(e,t){const r=ic(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,a=Ti(e)?Md(e):Ho(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,d=n*a.y;return{width:i,height:l,x:c,y:d}}function zA(e,t,r){let n;if(t==="viewport")n=pG(e,r);else if(t==="document")n=uG(Mi(e));else if(Ja(t))n=hG(t,r);else{const s=CR(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Tg(n)}function jR(e,t){const r=Qo(e);return r===t||!Ja(r)||Kd(r)?!1:Za(r).position==="fixed"||jR(r,t)}function fG(e,t){const r=t.get(e);if(r)return r;let n=ah(e,[],!1).filter(l=>Ja(l)&&iu(l)!=="body"),s=null;const a=Za(e).position==="fixed";let i=a?Qo(e):e;for(;Ja(i)&&!Kd(i);){const l=Za(i),c=t1(i);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ch(i)&&!c&&jR(e,i))?n=n.filter(p=>p!==i):s=l,i=Qo(i)}return t.set(e,n),n}function mG(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?vy(t)?[]:fG(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((d,p)=>{const u=zA(t,p,s);return d.top=Ws(u.top,d.top),d.right=qo(u.right,d.right),d.bottom=qo(u.bottom,d.bottom),d.left=Ws(u.left,d.left),d},zA(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function gG(e){const{width:t,height:r}=PR(e);return{width:t,height:r}}function yG(e,t,r){const n=Ti(t),s=Mi(t),a=r==="fixed",i=ic(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Ho(0);if(n||!n&&!a)if((iu(t)!=="body"||Ch(s))&&(l=_y(t)),n){const f=ic(t,!0,a,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&(c.x=lb(s));let d=0,p=0;if(s&&!n&&!a){const f=s.getBoundingClientRect();p=f.top+l.scrollTop,d=f.left+l.scrollLeft-lb(s,f)}const u=i.left+l.scrollLeft-c.x-d,h=i.top+l.scrollTop-c.y-p;return{x:u,y:h,width:i.width,height:i.height}}function I_(e){return Za(e).position==="static"}function BA(e,t){if(!Ti(e)||Za(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Mi(e)===r&&(r=r.ownerDocument.body),r}function IR(e,t){const r=Ks(e);if(vy(e))return r;if(!Ti(e)){let s=Qo(e);for(;s&&!Kd(s);){if(Ja(s)&&!I_(s))return s;s=Qo(s)}return r}let n=BA(e,t);for(;n&&aG(n)&&I_(n);)n=BA(n,t);return n&&Kd(n)&&I_(n)&&!t1(n)?r:n||iG(e)||r}const vG=async function(e){const t=this.getOffsetParent||IR,r=this.getDimensions,n=await r(e.floating);return{reference:yG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function _G(e){return Za(e).direction==="rtl"}const wG={convertOffsetParentRelativeRectToViewportRelativeRect:cG,getDocumentElement:Mi,getClippingRect:mG,getOffsetParent:IR,getElementRects:vG,getClientRects:dG,getDimensions:gG,getScale:Md,isElement:Ja,isRTL:_G};function xG(e,t){let r=null,n;const s=Mi(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:d,top:p,width:u,height:h}=e.getBoundingClientRect();if(l||t(),!u||!h)return;const f=Kf(p),m=Kf(s.clientWidth-(d+u)),v=Kf(s.clientHeight-(p+h)),k=Kf(d),g={rootMargin:-f+"px "+-m+"px "+-v+"px "+-k+"px",threshold:Ws(0,qo(1,c))||1};let _=!0;function w(x){const b=x[0].intersectionRatio;if(b!==c){if(!_)return i();b?i(!1,b):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(w,{...g,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,g)}r.observe(e)}return i(!0),a}function bG(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=n1(e),p=s||a?[...d?ah(d):[],...ah(t)]:[];p.forEach(y=>{s&&y.addEventListener("scroll",r,{passive:!0}),a&&y.addEventListener("resize",r)});const u=d&&l?xG(d,r):null;let h=-1,f=null;i&&(f=new ResizeObserver(y=>{let[g]=y;g&&g.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(t)})),r()}),d&&!c&&f.observe(d),f.observe(t));let m,v=c?ic(e):null;c&&k();function k(){const y=ic(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,m=requestAnimationFrame(k)}return r(),()=>{var y;p.forEach(g=>{s&&g.removeEventListener("scroll",r),a&&g.removeEventListener("resize",r)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,c&&cancelAnimationFrame(m)}}const kG=tG,TG=rG,MG=ZV,EG=sG,SG=XV,UA=JV,AG=nG,PG=(e,t,r)=>{const n=new Map,s={platform:wG,...r},a={...s.platform,_c:n};return YV(e,t,{...s,platform:a})};var Bm=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Mg(e,t){if(e===t)return!0;
vendor: 7,386 bytes, line 196
196if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Mg(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&e.$$typeof)&&!Mg(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function $R(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WA(e,t){const r=$R(e);return Math.round(t*r)/r}function $_(e){const t=D.useRef(e);return Bm(()=>{t.current=e}),t}function CG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[p,u]=D.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=D.useState(n);Mg(h,n)||f(n);const[m,v]=D.useState(null),[k,y]=D.useState(null),g=D.useCallback(V=>{V!==b.current&&(b.current=V,v(V))},[]),_=D.useCallback(V=>{V!==M.current&&(M.current=V,y(V))},[]),w=a||m,x=i||k,b=D.useRef(null),M=D.useRef(null),S=D.useRef(p),j=c!=null,I=$_(c),q=$_(s),U=$_(d),R=D.useCallback(()=>{if(!b.current||!M.current)return;const V={placement:t,strategy:r,middleware:h};q.current&&(V.platform=q.current),PG(b.current,M.current,V).then(ae=>{const ne={...ae,isPositioned:U.current!==!1};K.current&&!Mg(S.current,ne)&&(S.current=ne,Ph.flushSync(()=>{u(ne)}))})},[h,t,r,q,U]);Bm(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(V=>({...V,isPositioned:!1})))},[d]);const K=D.useRef(!1);Bm(()=>(K.current=!0,()=>{K.current=!1}),[]),Bm(()=>{if(w&&(b.current=w),x&&(M.current=x),w&&x){if(I.current)return I.current(w,x,R);R()}},[w,x,R,I,j]);const H=D.useMemo(()=>({reference:b,floating:M,setReference:g,setFloating:_}),[g,_]),ee=D.useMemo(()=>({reference:w,floating:x}),[w,x]),te=D.useMemo(()=>{const V={position:r,left:0,top:0};if(!ee.floating)return V;const ae=WA(ee.floating,p.x),ne=WA(ee.floating,p.y);return l?{...V,transform:"translate("+ae+"px, "+ne+"px)",...$R(ee.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:ne}},[r,l,ee.floating,p.x,p.y]);return D.useMemo(()=>({...p,update:R,refs:H,elements:ee,floatingStyles:te}),[p,R,H,ee,te])}const jG=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?UA({element:n.current,padding:s}).fn(r):{}:n?UA({element:n,padding:s}).fn(r):{}}}},IG=(e,t)=>({...kG(e),options:[e,t]}),$G=(e,t)=>({...TG(e),options:[e,t]}),NG=(e,t)=>({...AG(e),options:[e,t]}),OG=(e,t)=>({...MG(e),options:[e,t]}),RG=(e,t)=>({...EG(e),options:[e,t]}),DG=(e,t)=>({...SG(e),options:[e,t]}),FG=(e,t)=>({...jG(e),options:[e,t]});var LG="Arrow",NR=D.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...a}=e;return o.jsx(Er.svg,{...a,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});NR.displayName=LG;var zG=NR;function BG(e,t=[]){let r=[];function n(a,i){const l=D.createContext(i),c=r.length;r=[...r,i];function d(u){const{scope:h,children:f,...m}=u,v=(h==null?void 0:h[e][c])||l,k=D.useMemo(()=>m,Object.values(m));return o.jsx(v.Provider,{value:k,children:f})}function p(u,h){const f=(h==null?void 0:h[e][c])||l,m=D.useContext(f);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}const s=()=>{const a=r.map(i=>D.createContext(i));return function(l){const c=(l==null?void 0:l[e])||a;return D.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,UG(s,...t)]}function UG(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const u=c(a)[`__scope${d}`];return{...l,...u}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function OR(e){const[t,r]=D.useState(void 0);return qi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,l;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var RR="Popper",[DR,FR]=BG(RR),[wae,LR]=DR(RR),zR="PopperAnchor",BR=D.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,a=LR(zR,r),i=D.useRef(null),l=Hn(t,i);return D.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:o.jsx(Er.div,{...s,ref:l})});BR.displayName=zR;var s1="PopperContent",[WG,VG]=DR(s1),UR=D.forwardRef((e,t)=>{var Ee,ze,Ke,ve,J,ue;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...v}=e,k=LR(s1,r),[y,g]=D.useState(null),_=Hn(t,Y=>g(Y)),[w,x]=D.useState(null),b=OR(w),M=(b==null?void 0:b.width)??0,S=(b==null?void 0:b.height)??0,j=n+(a!=="center"?"-"+a:""),I=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},q=Array.isArray(d)?d:[d],U=q.length>0,R={padding:I,boundary:q.filter(qG),altBoundary:U},{refs:K,floatingStyles:H,placement:ee,isPositioned:te,middlewareData:V}=CG({strategy:"fixed",placement:j,whileElementsMounted:(...Y)=>bG(...Y,{animationFrame:f==="always"}),elements:{reference:k.anchor},middleware:[IG({mainAxis:s+S,alignmentAxis:i}),c&&$G({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?NG():void 0,...R}),c&&OG({...R}),RG({...R,apply:({elements:Y,rects:Se,availableWidth:Ae,availableHeight:Oe})=>{const{width:Ne,height:Q}=Se.reference,re=Y.floating.style;re.setProperty("--radix-popper-available-width",`${Ae}px`),re.setProperty("--radix-popper-available-height",`${Oe}px`),re.setProperty("--radix-popper-anchor-width",`${Ne}px`),re.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),w&&FG({element:w,padding:l}),HG({arrowWidth:M,arrowHeight:S}),h&&DG({strategy:"referenceHidden",...R})]}),[ae,ne]=GR(ee),L=ba(m);qi(()=>{te&&(L==null||L())},[te,L]);const $=(Ee=V.arrow)==null?void 0:Ee.x,G=(ze=V.arrow)==null?void 0:ze.y,se=((Ke=V.arrow)==null?void 0:Ke.centerOffset)!==0,[_e,de]=D.useState();return qi(()=>{y&&de(window.getComputedStyle(y).zIndex)},[y]),o.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:te?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(ve=V.transformOrigin)==null?void 0:ve.x,(J=V.transformOrigin)==null?void 0:J.y].join(" "),...((ue=V.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(WG,{scope:r,placedSide:ae,onArrowChange:x,arrowX:$,arrowY:G,shouldHideArrow:se,children:o.jsx(Er.div,{"data-side":ae,"data-align":ne,...v,ref:_,style:{...v.style,animation:te?void 0:"none"}})})})});UR.displayName=s1;var WR="PopperArrow",GG={top:"bottom",right:"left",bottom:"top",left:"r
196ight"},VR=D.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,a=VG(WR,n),i=GG[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:o.jsx(zG,{...s,ref:r,style:{...s.style,display:"block"}})})});VR.displayName=WR;function qG(e){return e!==null}var HG=e=>({name:"transformOrigin",options:e,fn(t){var k,y,g;const{placement:r,rects:n,middlewareData:s}=t,i=((k=s.arrow)==null?void 0:k.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,p]=GR(r),u={start:"0%",center:"50%",end:"100%"}[p],h=(((y=s.arrow)==null?void 0:y.x)??0)+l/2,f=(((g=s.arrow)==null?void 0:g.y)??0)+c/2;let m="",v="";return d==="bottom"?(m=i?u:`${h}px`,v=`${-c}px`):d==="top"?(m=i?u:`${h}px`,v=`${n.floating.height+c}px`):d==="right"?(m=`${-c}px`,v=i?u:`${f}px`):d==="left"&&(m=`${n.floating.width+c}px`,v=i?u:`${f}px`),{data:{x:m,y:v}}}});function GR(e){const[t,r="center"]=e.split("-");return[t,r]}var KG=BR,QG=UR,YG=VR,[wy,xae]=ru("Tooltip",[FR]),a1=FR(),qR="TooltipProvider",JG=700,VA="tooltip.open",[ZG,HR]=wy(qR),KR=e=>{const{__scopeTooltip:t,delayDuration:r=JG,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:a}=e,[i,l]=D.useState(!0),c=D.useRef(!1),d=D.useRef(0);return D.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),o.jsx(ZG,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:D.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:D.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:D.useCallback(p=>{c.current=p},[]),disableHoverableContent:s,children:a})};KR.displayName=qR;var QR="Tooltip",[bae,xy]=wy(QR),cb="TooltipTrigger",XG=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=xy(cb,r),a=HR(cb,r),i=a1(r),l=D.useRef(null),c=Hn(t,l,s.onTriggerChange),d=D.useRef(!1),p=D.useRef(!1),u=D.useCallback(()=>d.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),o.jsx(KG,{asChild:!0,...i,children:o.jsx(Er.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:Tr(e.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Tr(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Tr(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:Tr(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Tr(e.onBlur,s.onClose),onClick:Tr(e.onClick,s.onClose)})})});XG.displayName=cb;var e9="TooltipPortal",[kae,t9]=wy(e9,{forceMount:void 0}),Qd="TooltipContent",YR=D.forwardRef((e,t)=>{const r=t9(Qd,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...a}=e,i=xy(Qd,e.__scopeTooltip);return o.jsx(el,{present:n||i.open,children:i.disableHoverableContent?o.jsx(JR,{side:s,...a,ref:t}):o.jsx(r9,{side:s,...a,ref:t})})}),r9=D.forwardRef((e,t)=>{const r=xy(Qd,e.__scopeTooltip),n=HR(Qd,e.__scopeTooltip),s=D.useRef(null),a=Hn(t,s),[i,l]=D.useState(null),{trigger:c,onClose:d}=r,p=s.current,{onPointerInTransitChange:u}=n,h=D.useCallback(()=>{l(null),u(!1)},[u]),f=D.useCallback((m,v)=>{const k=m.currentTarget,y={x:m.clientX,y:m.clientY},g=i9(y,k.getBoundingClientRect()),_=o9(y,g),w=l9(v.getBoundingClientRect()),x=d9([..._,...w]);l(x),u(!0)},[u]);return D.useEffect(()=>()=>h(),[h]),D.useEffect(()=>{if(c&&p){const m=k=>f(k,p),v=k=>f(k,c);return c.addEventListener("pointerleave",m),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",m),p.removeEventListener("pointerleave",v)}}},[c,p,f,h]),D.useEffect(()=>{if(i){const m=v=>{const k=v.target,y={x:v.clientX,y:v.clientY},g=(c==null?void 0:c.contains(k))||(p==null?void 0:p.contains(k)),_=!c9(y,i);g?h():_&&(h(),d())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,p,i,d,h]),o.jsx(JR,{...e,ref:a})}),[n9,s9]=wy(QR,{isInside:!1}),JR=D.forwardRef((e,t)=>
196{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=xy(Qd,r),d=a1(r),{onClose:p}=c;return D.useEffect(()=>(document.addEventListener(VA,p),()=>document.removeEventListener(VA,p)),[p]),D.useEffect(()=>{if(c.trigger){const u=h=>{const f=h.target;f!=null&&f.contains(c.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,p]),o.jsx(py,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:p,children:o.jsxs(QG,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(D3,{children:n}),o.jsx(n9,{scope:r,isInside:!0,children:o.jsx(G8,{id:c.contentId,role:"tooltip",children:s||n})})]})})});YR.displayName=Qd;var ZR="TooltipArrow",a9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=a1(r);return s9(ZR,r).isInside?null:o.jsx(YG,{...s,...n,ref:t})});a9.displayName=ZR;function i9(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,s,a)){case a:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function o9(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function l9(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function c9(e,t){const{x:r,y:n}=e;let s=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a].x,c=t[a].y,d=t[i].x,p=t[i].y;c>n!=p>n&&r<(d-l)*(n-c)/(p-c)+l&&(s=!s)}return s}function d9(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),u9(t)}function u9(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var p9=KR,XR=YR;const h9=p9,f9=D.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(XR,{ref:n,sideOffset:t,className:Sn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));f9.displayName=XR.displayName;var by=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ky=typeof window>"u"||"Deno"in globalThis;function Fa(){}function m9(e,t){return typeof e=="function"?e(t):e}function g9(e){return typeof e=="number"&&e>=0&&e!==1/0}function y9(e,t){return Math.max(e+(t||0)-Date.now(),0)}function GA(e,t){return typeof e=="function"?e(t):e}function v9(e,t){return typeof e=="function"?e(t):e}function qA(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==i1(i,t.options))return!1}else if(!oh(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function HA(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(ih(t.options.mutationKey)!==ih(a))return!1}else if(!oh(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function i1(e,t){return((t==null?void 0:t.queryKeyHashFn)||ih)(e)}function ih(e){return JSON.stringify(e,(t,r)=>db(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function oh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!oh(e[r],t[r])):!1}function eD(e,t){if(e===t)return e;const r=KA(e)&&KA(t);if(r||db(e)&&db(t)){const n=r?e:Object.keys(e),s=n.length,a=r?t:Object.keys(t),i=a.length,l=r?[]:{};let c=0;for(let d=0;d<i;d++){const p=r?d:a[d];(!r&&n.includes(p)||r)&&e[p]===void 0&&t[p]===void 0?(l[p]=void 0,c++):(l[p]=eD(e[p],t[p]),l[p]===e[p]&&e[p]!==void 0&&c++)}return s===i&&c===s?e:l}return t}function KA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function db(e){if(!QA(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;
vendor: 24,154 bytes, lines 196-205
196return!(!QA(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function QA(e){return Object.prototype.toString.call(e)==="[object Object]"}function _9(e){return new Promise(t=>{setTimeout(t,e)})}function w9(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?eD(e,t):t}function x9(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function b9(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var o1=Symbol();function tD(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===o1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Kl,Eo,jd,hN,k9=(hN=class extends by{constructor(){super();mr(this,Kl);mr(this,Eo);mr(this,jd);Vt(this,jd,t=>{if(!ky&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Ve(this,Eo)||this.setEventListener(Ve(this,jd))}onUnsubscribe(){var t;this.hasListeners()||((t=Ve(this,Eo))==null||t.call(this),Vt(this,Eo,void 0))}setEventListener(t){var r;Vt(this,jd,t),(r=Ve(this,Eo))==null||r.call(this),Vt(this,Eo,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){Ve(this,Kl)!==t&&(Vt(this,Kl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof Ve(this,Kl)=="boolean"?Ve(this,Kl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Kl=new WeakMap,Eo=new WeakMap,jd=new WeakMap,hN),rD=new k9,Id,So,$d,fN,T9=(fN=class extends by{constructor(){super();mr(this,Id,!0);mr(this,So);mr(this,$d);Vt(this,$d,t=>{if(!ky&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){Ve(this,So)||this.setEventListener(Ve(this,$d))}onUnsubscribe(){var t;this.hasListeners()||((t=Ve(this,So))==null||t.call(this),Vt(this,So,void 0))}setEventListener(t){var r;Vt(this,$d,t),(r=Ve(this,So))==null||r.call(this),Vt(this,So,t(this.setOnline.bind(this)))}setOnline(t){Ve(this,Id)!==t&&(Vt(this,Id,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Ve(this,Id)}},Id=new WeakMap,So=new WeakMap,$d=new WeakMap,fN),Eg=new T9;function M9(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function E9(e){return Math.min(1e3*2**e,3e4)}function nD(e){return(e??"online")==="online"?Eg.isOnline():!0}var sD=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function N_(e){return e instanceof sD}function aD(e){let t=!1,r=0,n=!1,s;const a=M9(),i=v=>{var k;n||(h(new sD(v)),(k=e.abort)==null||k.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>rD.isFocused()&&(e.networkMode==="always"||Eg.isOnline())&&e.canRun(),p=()=>nD(e.networkMode)&&e.canRun(),u=v=>{var k;n||(n=!0,(k=e.onSuccess)==null||k.call(e,v),s==null||s(),a.resolve(v))},h=v=>{var k;n||(n=!0,(k=e.onError)==null||k.call(e,v),s==null||s(),a.reject(v))},f=()=>new Promise(v=>{var k;s=y=>{(n||d())&&v(y)},(k=e.onPause)==null||k.call(e)}).then(()=>{var v;s=void 0,n||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(n)return;let v;const k=r===0?e.initialPromise:void 0;try{v=k??e.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(u).catch(y=>{var b;if(n)return;const g=e.retry??(ky?0:3),_=e.retryDelay??E9,w=typeof _=="function"?_(r,y):_,x=g===!0||typeof g=="number"&&r<g||typeof g=="function"&&g(r,y);if(t||!x){h(y);return}r++,(b=e.onFail)==null||b.call(e,r,y),_9(w).then(()=>d()?void 0:f()).then(()=>{t?h(y):m()})})};return{promise:a,cancel:i,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:p,start:()=>(p()?m():f().then(m),a)}}function S9(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=l=>setTimeout(l,0);const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var _s=S9(),Ql,mN,iD=(mN=class{constructor(){mr(this,Ql)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),g9(this.gcTime)&&Vt(this,Ql,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ky?1/0:5*60*1e3))}clearGcTimeout(){Ve(this,Ql)&&(clearTimeout(Ve(this,Ql)),Vt(this,Ql,void 0))}},Ql=new WeakMap,mN),Nd,Od,da,ls,bh,Yl,za,$i,gN,A9=(gN=class extends iD{constructor(t){super();mr(this,za);mr(this,Nd);mr(this,Od);mr(this,da);mr(this,ls);mr(this,bh);mr(this,Yl);Vt(this,Yl,!1),Vt(this,bh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Vt(this,da,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Vt(this,Nd,C9(this.options)),this.state=t.state??Ve(this,Nd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ve(this,ls))==null?void 0:t.promise}setOptions(t){this.options={...Ve(this,bh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ve(this,da).remove(this)}setData(t,r){const n=w9(this.state.data,t,this.options);return as(this,za,$i).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){as(this,za,$i).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=Ve(this,ls))==null?void 0:n.promise;return(s=Ve(this,ls))==null||s.cancel(t),r?r.then(Fa).catch(Fa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ve(this,Nd))}isActive(){return this.observers.some(t=>v9(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===o1||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!y9(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=Ve(this,ls))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=Ve(this,ls))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ve(this,da).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(Ve(this,ls)&&(Ve(this,Yl)?Ve(this,ls).cancel({revert:!0}):Ve(this,ls).cancelRetry()),this.scheduleGc()),Ve(this,da).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||as(this,za,$i).call(this,{type:"invalidate"})}fetch(t,r){var c,d,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Ve(this,ls))return Ve(this,ls).continueRetry(),Ve(this,ls).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(Vt(this,Yl,!0),n.signal)})},a=()=>{const u=tD(this.options,r),h={queryKey:this.queryKey,meta:this.meta};return s(h),Vt(this,Yl,!1),this.options.persister?this.options.persister(u,h,this):u(h)},i={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};s(i),(c=this.options.behavior)==null||c.onFetch(i,this),Vt(this,Od,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=i.fetchOptions)==null?void 0:d.meta))&&as(this,za,$i).call(this,{type:"fetch",meta:(p=i.fetchOptions)==null?void 0:p.meta});const l=u=>{var h,f,m,v;N_(u)&&u.silent||as(this,za,$i).call(this,{type:"error",error:u}),N_(u)||((f=(h=Ve(this,da).config).onError)==null||f.call(h,u,this),(v=(m=Ve(this,da).config).onSettled)==null||v.call(m,this.state.data,u,this)),this.scheduleGc()};return Vt(this,ls,aD({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:u=>{var h,f,m,v;if(u===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(k){l(k);return}(f=(h=Ve(this,da).config).onSuccess)==null||f.call(h,u,this),(v=(m=Ve(this,da).config).onSettled)==null||v.call(m,u,this.state.error,this),this.scheduleGc()},onError:l,onFail:(u,h)=>{as(this,za,$i).call(this,{type:"failed",failureCount:u,error:h})},onPause:()=>{as(this,za,$i).call(this,{type:"pause"})},onContinue:()=>{as(this,za,$i).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),Ve(this,ls).start()}},Nd=new WeakMap,Od=new WeakMap,da=new WeakMap,ls=new WeakMap,bh=new WeakMap,Yl=new WeakMap,za=new WeakSet,$i=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...P9(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return N_(s)&&s.revert&&Ve(this,Od)?{...Ve(this,Od),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),_s.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Ve(this,da).notify({query:this,type:"updated",action:t})})},gN);function P9(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function C9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var mi,yN,j9=(yN=class extends by{constructor(t={}){super();mr(this,mi);this.config=t,Vt(this,mi,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??i1(s,r);let i=this.get(a);return i||(i=new A9({cache:this,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){Ve(this,mi).has(t.queryHash)||(Ve(this,mi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=Ve(this,mi).get(t.queryHash);r&&(t.destroy(),r===t&&Ve(this,mi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_s.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ve(this,mi).get(t)}getAll(){return[...Ve(this,mi).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>qA(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>qA(t,n)):r}notify(t){_s.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){_s.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_s.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mi=new WeakMap,yN),gi,gs,Jl,yi,yo,vN,I9=(vN=class extends iD{constructor(t){super();mr(this,yi);mr(this,gi);mr(this,gs);mr(this,Jl);this.mutationId=t.mutationId,Vt(this,gs,t.mutationCache),Vt(this,gi,[]),this.state=t.state||$9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ve(this,gi).includes(t)||(Ve(this,gi).push(t),this.clearGcTimeout(),Ve(this,gs).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Vt(this,gi,Ve(this,gi).filter(r=>r!==t)),this.scheduleGc(),Ve(this,gs).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ve(this,gi).length||(this.state.status==="pending"?this.scheduleGc():Ve(this,gs).remove(this))}continue(){var t;return((t=Ve(this,Jl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,i,l,c,d,p,u,h,f,m,v,k,y,g,_,w,x,b,M;Vt(this,Jl,aD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(S,j)=>{as(this,yi,yo).call(this,{type:"failed",failureCount:S,error:j})},onPause:()=>{as(this,yi,yo).call(this,{type:"pause"})},onContinue:()=>{as(this,yi,yo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ve(this,gs).canRun(this)}));const r=this.state.status==="pending",n=!Ve(this,Jl).canStart();try{if(!r){as(this,yi,yo).call(this,{type:"pending",variables:t,isPaused:n}),await((a=(s=Ve(this,gs).config).onMutate)==null?void 0:a.call(s,t,this));const j=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t));j!==this.state.context&&as(this,yi,yo).call(this,{type:"pending",context:j,variables:t,isPaused:n})}const S=await Ve(this,Jl).start();return await((d=(c=Ve(this,gs).config).onSuccess)==null?void 0:d.call(c,S,t,this.state.context,this)),await((u=(p=this.options).onSuccess)==null?void 0:u.call(p,S,t,this.state.context)),await((f=(h=Ve(this,gs).config).onSettled)==null?void 0:f.call(h,S,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,S,null,t,this.state.context)),as(this,yi,yo).call(this,{type:"success",data:S}),S}catch(S){try{throw await((y=(k=Ve(this,gs).config).onError)==null?void 0:y.call(k,S,t,this.state.context,this)),await((_=(g=this.options).onError)==null?void 0:_.call(g,S,t,this.state.context)),await((x=(w=Ve(this,gs).config).onSettled)==null?void 0:x.call(w,void 0,S,this.state.variables,this.state.context,this)),await((M=(b=this.options).onSettled)==null?void 0:M.call(b,void 0,S,t,this.state.context)),S}finally{as(this,yi,yo).call(this,{type:"error",error:S})}}finally{Ve(this,gs).runNext(this)}}},gi=new WeakMap,gs=new WeakMap,Jl=new WeakMap,yi=new WeakSet,yo=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),_s.batch(()=>{Ve(this,gi).forEach(n=>{n.onMutationUpdate(t)}),Ve(this,gs).notify({mutation:this,type:"updated",action:t})})},vN);function $9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zs,kh,_N,N9=(_N=class extends by{constructor(t={}){super();mr(this,zs);mr(this,kh);this.config=t,Vt(this,zs,new Map),Vt(this,kh,Date.now())}build(t,r,n){const s=new I9({mutationCache:this,mutationId:++Sf(this,kh)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){const r=Qf(t),n=Ve(this,zs).get(r)??[];n.push(t),Ve(this,zs).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=Qf(t);if(Ve(this,zs).has(r)){const s=(n=Ve(this,zs).get(r))==null?void 0:n.filter(a=>a!==t);s&&(s.length===0?Ve(this,zs).delete(r):Ve(this,zs).set(r,s))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=Ve(this,zs).get(Qf(t)))==null?void 0:n.find(s=>s.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=Ve(this,zs).get(Qf(t)))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){_s.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...Ve(this,zs).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>HA(r,n))}findAll(t={}){return this.getAll().filter(r=>HA(t,r))}notify(t){_s.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return _s.batch(()=>Promise.all(t.map(r=>r.continue().catch(Fa))))}},zs=new WeakMap,kh=new WeakMap,_N);function Qf(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function YA(e){return{onFetch:(t,r)=>{var p,u,h,f,m;const n=t.options,s=(h=(u=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:u.fetchMore)==null?void 0:h.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],i=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let v=!1;const k=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},y=tD(t.options,t.fetchOptions),g=async(_,w,x)=>{if(v)return Promise.reject();if(w==null&&_.pages.length)return Promise.resolve(_);const b={queryKey:t.queryKey,pageParam:w,direction:x?"backward":"forward",meta:t.options.meta};k(b);const M=await y(b),{maxPages:S}=t.options,j=x?b9:x9;return{pages:j(_.pages,M,S),pageParams:j(_.pageParams,w,S)}};if(s&&a.length){const _=s==="backward",w=_?O9:JA,x={pages:a,pageParams:i},b=w(n,x);l=await g(x,b,_)}else{const _=e??a.length;do{const w=c===0?i[0]??n.initialPageParam:JA(n,l);if(c>0&&w==null)break;l=await g(l,w),c++}while(c<_)}return l};t.options.persister?t.fetchFn=()=>{var v,k;return(k=(v=t.options).persister)==null?void 0:k.call(v,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function JA(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function O9(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var nn,Ao,Po,Rd,Dd,Co,Fd,Ld,wN,R9=(wN=class{constructor(e={}){mr(this,nn);mr(this,Ao);mr(this,Po);mr(this,Rd);mr(this,Dd);mr(this,Co);mr(this,Fd);mr(this,Ld);Vt(this,nn,e.queryCache||new j9),Vt(this,Ao,e.mutationCache||new N9),Vt(this,Po,e.defaultOptions||{}),Vt(this,Rd,new Map),Vt(this,Dd,new Map),Vt(this,Co,0)}mount(){Sf(this,Co)._++,Ve(this,Co)===1&&(Vt(this,Fd,rD.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ve(this,nn).onFocus())})),Vt(this,Ld,Eg.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ve(this,nn).onOnline())})))}unmount(){var e,t;Sf(this,Co)._--,Ve(this,Co)===0&&((e=Ve(this,Fd))==null||e.call(this),Vt(this,Fd,void 0),(t=Ve(this,Ld))==null||t.call(this),Vt(this,Ld,void 0))}isFetching(e){return Ve(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ve(this,Ao).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=Ve(this,nn).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=Ve(this,nn).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(GA(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return Ve(this,nn).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=Ve(this,nn).get(n.queryHash),a=s==null?void 0:s.state.data,i=m9(t,a);if(i!==void 0)return Ve(this,nn).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return _s.batch(()=>Ve(this,nn).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=Ve(this,nn).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=Ve(this,nn);_s.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=Ve(this,nn),n={type:"active",...e};return _s.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=_s.batch(()=>Ve(this,nn).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Fa).catch(Fa)}invalidateQueries(e={},t={}){return _s.batch(()=>{if(Ve(this,nn).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=_s.batch(()=>Ve(this,nn).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Fa)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Fa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=Ve(this,nn).build(this,t);return r.isStaleByTime(GA(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fa).catch(Fa)}fetchInfiniteQuery(e){return e.behavior=YA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fa).catch(Fa)}ensureInfiniteQueryData(e){return e.behavior=YA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Eg.isOnline()?Ve(this,Ao).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ve(this,nn)}getMutationCache(){return Ve(this,Ao)}getDefaultOptions(){return Ve(this,Po)}setDefaultOptions(e){Vt(this,Po,e)}setQueryDefaults(e,t){Ve(this,Rd).set(ih(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ve(this,Rd).values()];let r={};return t.forEach(n=>{oh(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){Ve(this,Dd).set(ih(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ve(this,Dd).values()];let r={};return t.forEach(n=>{oh(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ve(this,Po).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=i1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===o1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ve(this,Po).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ve(this,nn).clear(),Ve(this,Ao).clear()}},nn=new WeakMap,Ao=new WeakMap,Po=new WeakMap,Rd=new WeakMap,Dd=new WeakMap,Co=new WeakMap,Fd=new WeakMap,Ld=new WeakMap,wN),D9=D.createContext(void 0),F9=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(D9.Provider,{value:e,children:t}));/**
197 * @remix-run/router v1.20.0
198 *
199 * Copyright (c) Remix Software Inc.
200 *
201 * This source code is licensed under the MIT license found in the
202 * LICENSE.md file in the root directory of this source tree.
203 *
204 * @license MIT
205 */function lh(){return lh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 5,028 bytes, line 205
205for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lh.apply(this,arguments)}var $o;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})($o||($o={}));const ZA="popstate";function L9(e){e===void 0&&(e={});function t(n,s){let{pathname:a,search:i,hash:l}=n.location;return ub("",{pathname:a,search:i,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Sg(s)}return B9(t,r,null,e)}function En(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oD(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function z9(){return Math.random().toString(36).substr(2,8)}function XA(e,t){return{usr:e.state,key:e.key,idx:t}}function ub(e,t,r,n){return r===void 0&&(r=null),lh({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ou(t):t,{state:r,key:t&&t.key||n||z9()})}function Sg(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ou(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function B9(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:a=!1}=n,i=s.history,l=$o.Pop,c=null,d=p();d==null&&(d=0,i.replaceState(lh({},i.state,{idx:d}),""));function p(){return(i.state||{idx:null}).idx}function u(){l=$o.Pop;let k=p(),y=k==null?null:k-d;d=k,c&&c({action:l,location:v.location,delta:y})}function h(k,y){l=$o.Push;let g=ub(v.location,k,y);d=p()+1;let _=XA(g,d),w=v.createHref(g);try{i.pushState(_,"",w)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;s.location.assign(w)}a&&c&&c({action:l,location:v.location,delta:1})}function f(k,y){l=$o.Replace;let g=ub(v.location,k,y);d=p();let _=XA(g,d),w=v.createHref(g);i.replaceState(_,"",w),a&&c&&c({action:l,location:v.location,delta:0})}function m(k){let y=s.location.origin!=="null"?s.location.origin:s.location.href,g=typeof k=="string"?k:Sg(k);return g=g.replace(/ $/,"%20"),En(y,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,y)}let v={get action(){return l},get location(){return e(s,i)},listen(k){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(ZA,u),c=k,()=>{s.removeEventListener(ZA,u),c=null}},createHref(k){return t(s,k)},createURL:m,encodeLocation(k){let y=m(k);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:f,go(k){return i.go(k)}};return v}var eP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(eP||(eP={}));function U9(e,t,r){return r===void 0&&(r="/"),W9(e,t,r,!1)}function W9(e,t,r,n){let s=typeof t=="string"?ou(t):t,a=l1(s.pathname||"/",r);if(a==null)return null;let i=lD(e);V9(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let d=tq(a);l=X9(i[c],d,n)}return l}function lD(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(a,i,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};c.relativePath.startsWith("/")&&(En(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Uo([n,c.relativePath]),p=r.concat(c);a.children&&a.children.length>0&&(En(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),lD(a.children,t,p,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:J9(d,a.index),routesMeta:p})};return e.forEach((a,i)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,i);else for(let c of cD(a.path))s(a,i,c)}),t}function cD(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return s?[a,""]:[a];let i=cD(n.join("/")),l=[];return l.push(...i.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function V9(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Z9(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const G9=/^:[\w-]+$/,q9=3,H9=2,K9=1,Q9=10,Y9=-2,tP=e=>e==="*";function J9(e,t){let r=e.split("/"),n=r.length;return r.some(tP)&&(n+=Y9),t&&(n+=H9),r.filter(s=>!tP(s)).reduce((s,a)=>s+(G9.test(a)?q9:a===""?K9:Q9),n)}function Z9(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function X9(e,t,r){let{routesMeta:n}=e,s={},a="/",i=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,p=a==="/"?t:t.slice(a.length)||"/",u=rP({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},p),h=c.route;if(!u&&d&&r&&!n[n.length-1].route.index&&(u=rP({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},p)),!u)return null;
vendor: 9,495 bytes, lines 205-214
205Object.assign(s,u.params),i.push({params:s,pathname:Uo([a,u.pathname]),pathnameBase:aq(Uo([a,u.pathnameBase])),route:h}),u.pathnameBase!=="/"&&(a=Uo([a,u.pathnameBase]))}return i}function rP(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=eq(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((d,p,u)=>{let{paramName:h,isOptional:f}=p;if(h==="*"){let v=l[u]||"";i=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const m=l[u];return f&&!m?d[h]=void 0:d[h]=(m||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:i,pattern:e}}function eq(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),oD(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function tq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oD(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function l1(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function rq(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?ou(e):e;return{pathname:r?r.startsWith("/")?r:nq(r,t):t,search:iq(n),hash:oq(s)}}function nq(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function O_(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function sq(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function dD(e,t){let r=sq(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function uD(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=ou(e):(s=lh({},e),En(!s.pathname||!s.pathname.includes("?"),O_("?","pathname","search",s)),En(!s.pathname||!s.pathname.includes("#"),O_("#","pathname","hash",s)),En(!s.search||!s.search.includes("#"),O_("#","search","hash",s)));let a=e===""||s.pathname==="",i=a?"/":s.pathname,l;if(i==null)l=r;else{let u=t.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),u-=1;s.pathname=h.join("/")}l=u>=0?t[u]:"/"}let c=rq(s,l),d=i&&i!=="/"&&i.endsWith("/"),p=(a||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||p)&&(c.pathname+="/"),c}const Uo=e=>e.join("/").replace(/\/\/+/g,"/"),aq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iq=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oq=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function lq(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pD=["post","put","patch","delete"];new Set(pD);const cq=["get",...pD];new Set(cq);/**
206 * React Router v6.27.0
207 *
208 * Copyright (c) Remix Software Inc.
209 *
210 * This source code is licensed under the MIT license found in the
211 * LICENSE.md file in the root directory of this source tree.
212 *
213 * @license MIT
214 */function ch(){return ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ch.apply(this,arguments)}const c1=D.createContext(null),dq=D.createContext(null),mc=D.createContext(null),Ty=D.createContext(null),tl=D.createContext({outlet:null,matches:[],isDataRoute:!1}),hD=D.createContext(null);function uq(e,t){let{relative:r}=t===void 0?{}:t;jh()||En(!1);let{basename:n,navigator:s}=D.useContext(mc),{hash:a,pathname:i,search:l}=mD(e,{relative:r}),c=i;return n!=="/"&&(c=i==="/"?n:Uo([n,i])),s.createHref({pathname:c,search:l,hash:a})}function jh(){return D.useContext(Ty)!=null}function rl(){return jh()||En(!1),D.useContext(Ty).location}function fD(e){D.useContext(mc).static||D.useLayoutEffect(e)}function d1(){let{isDataRoute:e}=D.useContext(tl);return e?Mq():pq()}function pq(){jh()||En(!1);let e=D.useContext(c1),{basename:t,future:r,navigator:n}=D.useContext(mc),{matches:s}=D.useContext(tl),{pathname:a}=rl(),i=JSON.stringify(dD(s,r.v7_relativeSplatPath)),l=D.useRef(!1);return fD(()=>{l.current=!0}),D.useCallback(function(d,p){if(p===void 0&&(p={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let u=uD(d,JSON.parse(i),a,p.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Uo([t,u.pathname])),(p.replace?n.replace:n.push)(u,p.state,p)},[t,n,i,a,e])}function hq(){let{matches:e}=D.useContext(tl),t=e[e.length-1];return t?t.params:{}}function mD(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=D.useContext(mc),{matches:s}=D.useContext(tl),{pathname:a}=rl(),i=JSON.stringify(dD(s,n.v7_relativeSplatPath));return D.useMemo(()=>uD(e,JSON.parse(i),a,r==="path"),[e,i,a,r])}function fq(e,t){return mq(e,t)}function mq(e,t,r,n){jh()||En(!1);let{navigator:s}=D.useContext(mc),{matches:a}=D.useContext(tl),i=a[a.length-1],l=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let d=rl(),p;if(t){var u;let k=typeof t=="string"?ou(t):t;c==="/"||(u=k.pathname)!=null&&u.startsWith(c)||En(!1),p=k}else p=d;let h=p.pathname||"/",f=h;if(c!=="/"){let k=c.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(k.length).join("/")}let m=U9(e,{pathname:f}),v=wq(m&&m.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:Uo([c,s.encodeLocation?s.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?c:Uo([c,s.encodeLocation?s.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),a,r,n);return t&&v?D.createElement(Ty.Provider,{value:{location:ch({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:$o.Pop}},v):v}function gq(){let e=Tq(),t=lq(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},t),r?D.createElement("pre",{style:s},r):null,null)}const yq=D.createElement(gq,null);class vq extends D.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?D.createElement(tl.Provider,{value:this.props.routeContext},D.createElement(hD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _q(e){let{routeContext:t,match:r,children:n}=e,s=D.useContext(c1);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),D.createElement(tl.Provider,{value:t},n)}function wq(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let p=i.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);p>=0||En(!1),i=i.slice(0,Math.min(i.length,p+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let p=0;p<i.length;p++){let u=i[p];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=p),u.route.id){let{loaderData:h,errors:f}=r,m=u.route.loader&&h[u.route.id]===void 0&&(!f||f[u.route.id]===void 0);if(u.route.lazy||m){c=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((p,u,h)=>{let f,m=!1,v=null,k=null;r&&(f=l&&u.route.id?l[u.route.id]:void 0,v=u.route.errorElement||yq,c&&(d<0&&h===0?(m=!0,k=null):d===h&&(m=!0,k=u.route.hydrateFallbackElement||null)));let y=t.concat(i.slice(0,h+1)),g=()=>{let _;return f?_=v:m?_=k:u.route.Component?_=D.createElement(u.route.Component,null):u.route.element?_=u.route.element:_=p,D.createElement(_q,{match:u,routeContext:{outlet:p,matches:y,isDataRoute:r!=null},children:_})};return r&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?D.createElement(vq,{location:r.location,revalidation:r.revalidation,component:v,error:f,children:g(),routeC
214ontext:{outlet:null,matches:y,isDataRoute:!0}}):g()},null)}var gD=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gD||{}),Ag=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ag||{});function xq(e){let t=D.useContext(c1);return t||En(!1),t}function bq(e){let t=D.useContext(dq);return t||En(!1),t}function kq(e){let t=D.useContext(tl);return t||En(!1),t}function yD(e){let t=kq(),r=t.matches[t.matches.length-1];return r.route.id||En(!1),r.route.id}function Tq(){var e;let t=D.useContext(hD),r=bq(Ag.UseRouteError),n=yD(Ag.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Mq(){let{router:e}=xq(gD.UseNavigateStable),t=yD(Ag.UseNavigateStable),r=D.useRef(!1);return fD(()=>{r.current=!0}),D.useCallback(function(s,a){a===void 0&&(a={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ch({fromRouteId:t},a)))},[e,t])}function xr(e){En(!1)}function Eq(e){let{basename:t="/",children:r=null,location:n,navigationType:s=$o.Pop,navigator:a,static:i=!1,future:l}=e;jh()&&En(!1);let c=t.replace(/^\/*/,"/"),d=D.useMemo(()=>({basename:c,navigator:a,static:i,future:ch({v7_relativeSplatPath:!1},l)}),[c,l,a,i]);typeof n=="string"&&(n=ou(n));let{pathname:p="/",search:u="",hash:h="",state:f=null,key:m="default"}=n,v=D.useMemo(()=>{let k=l1(p,c);return k==null?null:{location:{pathname:k,search:u,hash:h,state:f,key:m},navigationType:s}},[c,p,u,h,f,m,s]);return v==null?null:D.createElement(mc.Provider,{value:d},D.createElement(Ty.Provider,{children:r,value:v}))}function Sq(e){let{children:t,location:r}=e;return fq(pb(t),r)}new Promise(()=>{});function pb(e,t){t===void 0&&(t=[]);let r=[];return D.Children.forEach(e,(n,s)=>{if(!D.isValidElement(n))return;let a=[...t,s];if(n.type===D.Fragment){r.push.apply(r,pb(n.props.children,a));return}n.type!==xr&&En(!1),!n.props.index||!n.props.children||En(!1);let i={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=pb(n.props.children,a)),r.push(i)}),r}/**
215 * React Router DOM v6.27.0
216 *
217 * Copyright (c) Remix Software Inc.
218 *
219 * This source code is licensed under the MIT license found in the
220 * LICENSE.md file in the root directory of this source tree.
221 *
222 * @license MIT
223 */function hb(){return hb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hb.apply(this,arguments)}function Aq(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function Pq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Cq(e,t){return e.button===0&&(!t||t==="_self")&&!Pq(e)}function fb(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function jq(e,t){let r=fb(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(a=>{r.append(s,a)})}),r}const Iq=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],$q="6";try{window.__reactRouterVersion=$q}catch{}const Nq="startTransition",nP=jN[Nq];function Oq(e){let{basename:t,children:r,future:n,window:s}=e,a=D.useRef();a.current==null&&(a.current=L9({window:s,v5Compat:!0}));let i=a.current,[l,c]=D.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},p=D.useCallback(u=>{d&&nP?nP(()=>c(u)):c(u)},[c,d]);return D.useLayoutEffect(()=>i.listen(p),[i,p]),D.createElement(Eq,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}const Rq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dq=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ut=D.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:a,replace:i,state:l,target:c,to:d,preventScrollReset:p,viewTransition:u}=t,h=Aq(t,Iq),{basename:f}=D.useContext(mc),m,v=!1;
223if(typeof d=="string"&&Dq.test(d)&&(m=d,Rq))try{let _=new URL(window.location.href),w=d.startsWith("//")?new URL(_.protocol+d):new URL(d),x=l1(w.pathname,f);w.origin===_.origin&&x!=null?d=x+w.search+w.hash:v=!0}catch{}let k=uq(d,{relative:s}),y=Fq(d,{replace:i,state:l,target:c,preventScrollReset:p,relative:s,viewTransition:u});function g(_){n&&n(_),_.defaultPrevented||y(_)}return D.createElement("a",hb({},h,{href:m||k,onClick:v||a?n:g,ref:r,target:c}))});var sP;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sP||(sP={}));var aP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(aP||(aP={}));function Fq(e,t){let{target:r,replace:n,state:s,preventScrollReset:a,relative:i,viewTransition:l}=t===void 0?{}:t,c=d1(),d=rl(),p=mD(e,{relative:i});return D.useCallback(u=>{if(Cq(u,r)){u.preventDefault();let h=n!==void 0?n:Sg(d)===Sg(p);c(e,{replace:h,state:s,preventScrollReset:a,relative:i,viewTransition:l})}},[d,c,p,n,s,r,e,a,i,l])}function vD(e){let t=D.useRef(fb(e)),r=D.useRef(!1),n=rl(),s=D.useMemo(()=>jq(n.search,r.current?null:t.current),[n.search]),a=d1(),i=D.useCallback((l,c)=>{const d=fb(typeof l=="function"?l(s):l);r.current=!0,a("?"+d,c)},[a,s]);return[s,i]}var _D={exports:{}},Lq="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",zq=Lq,Bq=zq;function wD(){}function xD(){}xD.resetWarningCache=wD;var Uq=function(){function e(n,s,a,i,l,c){if(c!==Bq){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:xD,resetWarningCache:wD};return r.PropTypes=r,r};_D.exports=Uq();var Wq=_D.exports;const tr=Zd(Wq);var Vq=typeof Element<"u",Gq=typeof Map=="function",qq=typeof Set=="function",Hq=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Um(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Um(e[n],t[n]))return!1;return!0}var a;if(Gq&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!Um(n.value[1],t.get(n.value[0])))return!1;return!0}if(qq&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Hq&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Vq&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Um(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Kq=function(t,r){try{return Um(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Qq=Zd(Kq);var Yq=function(e,t,r,n,s,a,i,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,n,s,a,i,l],p=0;c=new Error(t.replace(/%s/g,function(){return d[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},Jq=Yq;const iP=Zd(Jq);var Zq=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;
223if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var i=Object.keys(t),l=Object.keys(r);if(i.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),d=0;d<i.length;d++){var p=i[d];if(!c(p))return!1;var u=t[p],h=r[p];if(a=n?n.call(s,u,h,p):void 0,a===!1||a===void 0&&u!==h)return!1}return!0};const Xq=Zd(Zq);function hn(){return hn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hn.apply(this,arguments)}function u1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,mb(e,t)}function mb(e,t){return mb=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},mb(e,t)}function oP(e,t){if(e==null)return{};var r,n,s={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(s[r]=e[r]);return s}var Ct={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},eH={rel:["amphtml","canonical","alternate"]},tH={type:["application/ld+json"]},rH={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},lP=Object.keys(Ct).map(function(e){return Ct[e]}),Pg={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},nH=Object.keys(Pg).reduce(function(e,t){return e[Pg[t]]=t,e},{}),Ed=function(e,t){for(var r=e.length-1;r>=0;r-=1){var n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},sH=function(e){var t=Ed(e,Ct.TITLE),r=Ed(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,function(){return t});var n=Ed(e,"defaultTitle");return t||n||void 0},aH=function(e){return Ed(e,"onChangeClientState")||function(){}},R_=function(e,t){return t.filter(function(r){return r[e]!==void 0}).map(function(r){return r[e]}).reduce(function(r,n){return hn({},r,n)},{})},iH=function(e,t){return t.filter(function(r){return r[Ct.BASE]!==void 0}).map(function(r){return r[Ct.BASE]}).reverse().reduce(function(r,n){if(!r.length)for(var s=Object.keys(n),a=0;a<s.length;a+=1){var i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}return r},[])},Xu=function(e,t,r){var n={};return r.filter(function(s){return!!Array.isArray(s[e])||(s[e]!==void 0&&console&&typeof console.warn=="function"&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof s[e]+'"'),!1)}).map(function(s){return s[e]}).reverse().reduce(function(s,a){var i={};a.filter(function(u){for(var h,f=Object.keys(u),m=0;m<f.length;m+=1){var v=f[m],k=v.toLowerCase();t.indexOf(k)===-1||h==="rel"&&u[h].toLowerCase()==="canonical"||k==="rel"&&u[k].toLowerCase()==="stylesheet"||(h=k),t.indexOf(v)===-1||v!=="innerHTML"&&v!=="cssText"&&v!=="itemprop"||(h=v)}if(!h||!u[h])return!1;var y=u[h].toLowerCase();return n[h]||(n[h]={}),i[h]||(i[h]={}),!n[h][y]&&(i[h][y]=!0,!0)}).reverse().forEach(function(u){return s.push(u)});for(var l=Object.keys(i),c=0;c<l.length;c+=1){var d=l[c],p=hn({},n[d],i[d]);n[d]=p}return s},[]).reverse()},oH=function(e,t){if(Array.isArray(e)&&e.length){for(var r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},bD=function(e){return Array.isArray(e)?e.join(""):e},D_=function(e,t){return Array.isArray(e)?e.reduce(function(r,n){return function(s,a){for(var i=Object.keys(s),l=0;l<i.length;l+=1)if(a[i[l]]&&a[i[l]].includes(s[i[l]]))return!0;return!1}(n,t)?r.priority.push(n):r.default.push(n),r},{priority:[],default:[]}):{default:e}},cP=function(e,t){var r;return hn({},e,((r={})[t]=void 0,r))},lH=[Ct.NOSCRIPT,Ct.SCRIPT,Ct.STYLE],F_=function(e,t){return t===void 0&&(t=!0),t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},dP=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r]!==void 0?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n},"")},uP=function(e,t){return t===void 0&&(t={}),Object.keys(e).reduce(function(r,n){return r[Pg[n]||n]=e[n],r},t)},Wm=function(e,t){return t.map(function(r,n){var s,a=((s={key:n})["data-rh"]=!0,s);return Object.keys(r).forEach(function(i){var l=Pg[i]||i;l==="innerHTML"||l==="cssText"?a.dangerouslySetInnerHTML={__html:r.innerHTML||r.cssText}:a[l]=r[i]}),Le.createElement(e,a)})},oa=function(e,t,r){switch(e){case Ct.TITLE:return{toComponent:function(){return s=t.titleAttributes,(a={key:n=t.title})["data-rh"]=!0,i=uP(s,a),[Le.createElement(Ct.TITLE,i,n)];var n,s,a,i},toString:function(){return function(n,s,a,i){var l=dP(a),c=bD(s);return l?"<"+n+' data-rh="true" '+l+">"+F_(c,i)+"</"+n+">":"<"+n+' data-rh="true">'+F_(c,i)+"</"+n+">"}(e,t.title,t.titleAttributes,r)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return uP(t)},toString:function(){return dP(t)}};default:return{toComponent:function(){return Wm(e,t)},toString:function(){return function(n,s,a){return s.reduce(function(i,l){var c=Object.keys(l).filter(function(u){return!(u==="innerHTML"||u==="cssText")}).reduce(function(u,h){var f=l[h]===void 0?h:h+'="'+F_(l[h],a)+'"';return u?u+" "+f:f},""),d=l.innerHTML||l.cssText||"",p=lH.indexOf(n)===-1;return i+"<"+n+' data-rh="true" '+c+(p?"/>":">"+d+"</"+n+">")},"")}(e,t,r)}}}},gb=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,s=e.htmlAttributes,a=e.noscriptTags,i=e.styleTags,l=e.title,c=l===void 0?"":l,d=e.titleAttributes,p=e.linkTags,u=e.metaTags,h=e.scriptTags,f={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var m=function(v){var k=v.linkTags,y=v.scriptTags,g=v.encode,_=D_(v.metaTags,rH),w=D_(k,eH),x=D_(y,tH);return{priorityMethods:{toComponent:function(){return[].concat(Wm(Ct.META,_.priority),Wm(Ct.LINK,w.priority),Wm(Ct.SCR
223IPT,x.priority))},toString:function(){return oa(Ct.META,_.priority,g)+" "+oa(Ct.LINK,w.priority,g)+" "+oa(Ct.SCRIPT,x.priority,g)}},metaTags:_.default,linkTags:w.default,scriptTags:x.default}}(e);f=m.priorityMethods,p=m.linkTags,u=m.metaTags,h=m.scriptTags}return{priority:f,base:oa(Ct.BASE,t,n),bodyAttributes:oa("bodyAttributes",r,n),htmlAttributes:oa("htmlAttributes",s,n),link:oa(Ct.LINK,p,n),meta:oa(Ct.META,u,n),noscript:oa(Ct.NOSCRIPT,a,n),script:oa(Ct.SCRIPT,h,n),style:oa(Ct.STYLE,i,n),title:oa(Ct.TITLE,{title:c,titleAttributes:d},n)}},Yf=[],yb=function(e,t){var r=this;t===void 0&&(t=typeof document<"u"),this.instances=[],this.value={setHelmet:function(n){r.context.helmet=n},helmetInstances:{get:function(){return r.canUseDOM?Yf:r.instances},add:function(n){(r.canUseDOM?Yf:r.instances).push(n)},remove:function(n){var s=(r.canUseDOM?Yf:r.instances).indexOf(n);(r.canUseDOM?Yf:r.instances).splice(s,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=gb({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},kD=Le.createContext({}),cH=tr.shape({setHelmet:tr.func,helmetInstances:tr.shape({get:tr.func,add:tr.func,remove:tr.func})}),dH=typeof document<"u",hd=function(e){function t(r){var n;return(n=e.call(this,r)||this).helmetData=new yb(n.props.context,t.canUseDOM),n}return u1(t,e),t.prototype.render=function(){return Le.createElement(kD.Provider,{value:this.helmetData.value},this.props.children)},t}(D.Component);hd.canUseDOM=dH,hd.propTypes={context:tr.shape({helmet:tr.shape()}),children:tr.node.isRequired},hd.defaultProps={context:{}},hd.displayName="HelmetProvider";var Oc=function(e,t){var r,n=document.head||document.querySelector(Ct.HEAD),s=n.querySelectorAll(e+"[data-rh]"),a=[].slice.call(s),i=[];return t&&t.length&&t.forEach(function(l){var c=document.createElement(e);for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(d==="innerHTML"?c.innerHTML=l.innerHTML:d==="cssText"?c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText)):c.setAttribute(d,l[d]===void 0?"":l[d]));c.setAttribute("data-rh","true"),a.some(function(p,u){return r=u,c.isEqualNode(p)})?a.splice(r,1):i.push(c)}),a.forEach(function(l){return l.parentNode.removeChild(l)}),i.forEach(function(l){return n.appendChild(l)}),{oldTags:a,newTags:i}},L_=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute("data-rh"),s=n?n.split(","):[],a=[].concat(s),i=Object.keys(t),l=0;l<i.length;l+=1){var c=i[l],d=t[c]||"";r.getAttribute(c)!==d&&r.setAttribute(c,d),s.indexOf(c)===-1&&s.push(c);var p=a.indexOf(c);p!==-1&&a.splice(p,1)}for(var u=a.length-1;u>=0;u-=1)r.removeAttribute(a[u]);s.length===a.length?r.removeAttribute("data-rh"):r.getAttribute("data-rh")!==i.join(",")&&r.setAttribute("data-rh",i.join(","))}},pP=function(e,t){var r=e.baseTag,n=e.htmlAttributes,s=e.linkTags,a=e.metaTags,i=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,d=e.styleTags,p=e.title,u=e.titleAttributes;L_(Ct.BODY,e.bodyAttributes),L_(Ct.HTML,n),function(v,k){v!==void 0&&document.title!==v&&(document.title=bD(v)),L_(Ct.TITLE,k)}(p,u);var h={baseTag:Oc(Ct.BASE,r),linkTags:Oc(Ct.LINK,s),metaTags:Oc(Ct.META,a),noscriptTags:Oc(Ct.NOSCRIPT,i),scriptTags:Oc(Ct.SCRIPT,c),styleTags:Oc(Ct.STYLE,d)},f={},m={};Object.keys(h).forEach(function(v){var k=h[v],y=k.newTags,g=k.oldTags;y.length&&(f[v]=y),g.length&&(m[v]=h[v].oldTags)}),t&&t(),l(e,f,m)},ep=null,Cg=function(e){function t(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return(n=e.call.apply(e,[this].concat(a))||this).rendered=!1,n}u1(t,e);var r=t.prototype;return r.shouldComponentUpdate=function(n){return!Xq(n,this.props)},r.componentDidUpdate=function(){this.emitChange()},r.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},r.emitChange=function(){var n,s,a=this.props.context,i=a.setHelmet,l=null,c=(n=a.helmetInstances.get().map(function(d){var p=hn({},d.props);return delete p.context,p}),{baseTag:iH(["href"],n),bodyAttributes:R_("bodyAttributes",n),defer:Ed(n,"defer"),encode:Ed(n,"encodeSpecialCharacters"),htmlAttributes:R_("htmlAttributes",n),linkTags:Xu(Ct.LINK,["rel","href"],n),metaTags:Xu(Ct.META,["name","charset","http-equiv","property","itemprop"],n),noscriptTags:Xu(Ct.NOSCRIPT,["innerHTML"],n),onChangeClientState:aH(n),scriptTags:Xu(Ct.SCRIPT,["src","innerHTML"],n),styleTags:Xu(Ct.STYLE,["cssText"],n),title:sH(n),titleAttributes:R_("titleAttributes",n),prioritizeSeoTags:oH(n,"prioritizeSeoTags")});hd.canUseDOM?(s=c,ep&&cancelAnimationFrame(ep),s.defer?ep=requestAnimationFrame(function(){pP(s,function(){ep=null})}):(pP(s),ep=null)):gb&&(l=gb(c)),i(l)},r.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},r.render=function(){return this.init(),null},t}(D.Component);Cg.propTypes={context:cH.isRequired},Cg.displayName="HelmetDispatcher";var uH=["children"],pH=["children"],Sd=function(e){function t(){return e.apply(this,arguments)||this}u1(t,e);var r=t.prototype;return r.shouldComponentUpdate=function(n){return!Qq(cP(this.props,"helmetData"),cP(n,"helmetData"))},r.mapNestedChildrenToProps=function(n,s){if(!s)return null;switch(n.type){case Ct.SCRIPT:case Ct.NOSCRIPT:return{innerHTML:s};case Ct.STYLE:return{cssText:s};default:throw new Error("<"+n.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},r.flattenArrayTypeChildren=function(n){var s,a=n.child,i=n.arrayTypeChildren;return hn({},i,((s={})[a.type]=[].concat(i[a.type]||[],[hn({},n.newChildProps,this.mapNestedChildrenToProps(a,n.nestedChildren))]),s))},r.mapObjectTypeChildren=function(n){var s,a,i=n.child,l=n.newProps,c=n.newChildProps,d=n.nestedChildren;switch(i.type){case Ct.TITLE:return hn({},l,((s={})[i.type]=d,s.titleAttributes=hn({},c),s));case Ct.BODY:return hn({},l,{bodyAttributes:hn({},c)});case Ct.HTML:return hn({},l,{htmlAttributes:hn({},c)});default:return hn({},l,((a={})[i.type]=hn({},c),a))}},r.mapArrayTypeChildrenToProps=function(n,s){var a=hn({},s);
223return Object.keys(n).forEach(function(i){var l;a=hn({},a,((l={})[i]=n[i],l))}),a},r.warnOnInvalidChildren=function(n,s){return iP(lP.some(function(a){return n.type===a}),typeof n.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+lP.join(", ")+" are allowed. Helmet does not support rendering <"+n.type+"> elements. Refer to our API for more information."),iP(!s||typeof s=="string"||Array.isArray(s)&&!s.some(function(a){return typeof a!="string"}),"Helmet expects a string as a child of <"+n.type+">. Did you forget to wrap your children in braces? ( <"+n.type+">{``}</"+n.type+"> ) Refer to our API for more information."),!0},r.mapChildrenToProps=function(n,s){var a=this,i={};return Le.Children.forEach(n,function(l){if(l&&l.props){var c=l.props,d=c.children,p=oP(c,uH),u=Object.keys(p).reduce(function(f,m){return f[nH[m]||m]=p[m],f},{}),h=l.type;switch(typeof h=="symbol"?h=h.toString():a.warnOnInvalidChildren(l,d),h){case Ct.FRAGMENT:s=a.mapChildrenToProps(d,s);break;case Ct.LINK:case Ct.META:case Ct.NOSCRIPT:case Ct.SCRIPT:case Ct.STYLE:i=a.flattenArrayTypeChildren({child:l,arrayTypeChildren:i,newChildProps:u,nestedChildren:d});break;default:s=a.mapObjectTypeChildren({child:l,newProps:s,newChildProps:u,nestedChildren:d})}}}),this.mapArrayTypeChildrenToProps(i,s)},r.render=function(){var n=this.props,s=n.children,a=oP(n,pH),i=hn({},a),l=a.helmetData;return s&&(i=this.mapChildrenToProps(s,i)),!l||l instanceof yb||(l=new yb(l.context,l.instances)),l?Le.createElement(Cg,hn({},i,{context:l.value,helmetData:void 0})):Le.createElement(kD.Consumer,null,function(c){return Le.createElement(Cg,hn({},i,{context:c}))})},t}(D.Component);Sd.propTypes={base:tr.object,bodyAttributes:tr.object,children:tr.oneOfType([tr.arrayOf(tr.node),tr.node]),defaultTitle:tr.string,defer:tr.bool,encodeSpecialCharacters:tr.bool,htmlAttributes:tr.object,link:tr.arrayOf(tr.object),meta:tr.arrayOf(tr.object),noscript:tr.arrayOf(tr.object),onChangeClientState:tr.func,script:tr.arrayOf(tr.object),style:tr.arrayOf(tr.object),title:tr.string,titleAttributes:tr.object,titleTemplate:tr.string,prioritizeSeoTags:tr.bool,helmetData:tr.object},Sd.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},Sd.displayName="Helmet";const hH=()=>{const{pathname:e}=rl();return D.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null};var wi=function(){return wi=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},wi.apply(this,arguments)};function lu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function fH(e,t,r,n){function s(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function l(p){try{d(n.next(p))}catch(u){i(u)}}function c(p){try{d(n.throw(p))}catch(u){i(u)}}function d(p){p.done?a(p.value):s(p.value).then(l,c)}d((n=n.apply(e,t||[])).next())})}function mH(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;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))}const gH=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);
223class p1 extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class yH extends p1{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class hP extends p1{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class fP extends p1{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var vb;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(vb||(vb={}));class vH{constructor(t,{headers:r={},customFetch:n,region:s=vb.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=gH(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return fH(this,arguments,void 0,function*(r,n={}){var s;let a,i;try{const{headers:l,method:c,body:d,signal:p,timeout:u}=n;let h={},{region:f}=n;f||(f=this.region);const m=new URL(`${this.url}/${r}`);f&&f!=="any"&&(h["x-region"]=f,m.searchParams.set("forceFunctionRegion",f));let v;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",v=d):typeof d=="string"?(h["Content-Type"]="text/plain",v=d):typeof FormData<"u"&&d instanceof FormData?v=d:(h["Content-Type"]="application/json",v=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?v=JSON.stringify(d):v=d;let k=p;u&&(i=new AbortController,a=setTimeout(()=>i.abort(),u),p?(k=i.signal,p.addEventListener("abort",()=>i.abort())):k=i.signal);const y=yield this.fetch(m.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:v,signal:k}).catch(x=>{throw new yH(x)}),g=y.headers.get("x-relay-error");if(g&&g==="true")throw new hP(y);if(!y.ok)throw new fP(y);let _=((s=y.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),w;return _==="application/json"?w=yield y.json():_==="application/octet-stream"||_==="application/pdf"?w=yield y.blob():_==="text/event-stream"?w=y:_==="multipart/form-data"?w=yield y.formData():w=yield y.text(),{data:w,error:null,response:y}}catch(l){return{data:null,error:l,response:l instanceof fP||l instanceof hP?l.context:void 0}}finally{a&&clearTimeout(a)}})}}var _H=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
223de=e.code}},wH=class{constructor(e){var t,r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=e.urlLengthLimit)!==null&&n!==void 0?n:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let s=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{let i=null,l=null,c=null,d=a.status,p=a.statusText;if(a.ok){var u,h;if(r.method!=="HEAD"){var f;const y=await a.text();y===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((f=r.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?l=y:l=JSON.parse(y))}const v=(u=r.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),k=(h=a.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");v&&k&&k.length>1&&(c=parseInt(k[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(l)&&(l.length>1?(i={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,d=406,p="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var m;const v=await a.text();try{i=JSON.parse(v),Array.isArray(i)&&a.status===404&&(l=[],i=null,d=200,p="OK")}catch{a.status===404&&v===""?(d=204,p="No Content"):i={message:v}}if(i&&r.isMaybeSingle&&(!(i==null||(m=i.details)===null||m===void 0)&&m.includes("0 rows"))&&(i=null,d=200,p="OK"),i&&r.shouldThrowOnError)throw new _H(i)}return{error:i,data:l,count:c,status:d,statusText:p}});return this.shouldThrowOnError||(s=s.catch(a=>{var i;let l="",c="",d="";const p=a==null?void 0:a.cause;if(p){var u,h,f,m;const y=(u=p==null?void 0:p.message)!==null&&u!==void 0?u:"",g=(h=p==null?void 0:p.code)!==null&&h!==void 0?h:"";l=`${(f=a==null?void 0:a.name)!==null&&f!==void 0?f:"FetchError"}: ${a==null?void 0:a.message}`,l+=`
224
225Caused by: ${(m=p==null?void 0:p.name)!==null&&m!==void 0?m:"Error"}: ${y}`,g&&(l+=` (${g})`),p!=null&&p.stack&&(l+=`
226${p.stack}`)}else{var v;l=(v=a==null?void 0:a.stack)!==null&&v!==void 0?v:""}const k=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(d="",c="Request was aborted (timeout or manual cancellation)",k>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${k} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((p==null?void 0:p.name)==="HeadersOverflowError"||(p==null?void 0:p.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",c="HTTP headers exceeded server limits (typically 16KB)",k>this.urlLengthLimit&&(c+=`. Your request URL is ${k} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(i=a==null?void 0:a.name)!==null&&i!==void 0?i:"FetchError"}: ${a==null?void 0:a.message}`,details:l,hint:c,code:d},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},xH=class extends wH{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const a=s?`${s}.order`:"order",i=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${i?`${i},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
226explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:a="text"}={}){var i;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const mP=new RegExp("[,()]");var Yc=class extends xH{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&mP.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&mP.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${a}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},bH=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let a=!1;const i=(e??"*").split("").map(d=>/\s/.test(d)&&!a?"":(d==='"'&&(a=!a),d)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",i),n&&c.append("Prefer",`count=${n}`),new Yc({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:a,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(l.length>0){const c=[...new Set(l)].map(d=>`"${d}"`);a.searchParams.set("columns",c.join(","))}}return new Yc({method:s,url:a,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var a;const i="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((p,u)=>p.concat(Object.keys(u)),[]);if(d.length>0){const p=[...new Set(d)].map(u=>`"${u}"`);l.searchParams.set("columns",p.join(","))}}return new Yc({method:i,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new Yc({method:n,url:s,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Yc({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function dh(e){"@babel/helpers - typeof";return dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dh(e)}function kH(e,t){if(dh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TH(e){var t=kH(e,"string");return dh(t)=="symbol"?t:t+""}function MH(e,t,r){return(t=TH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Jf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
226t%2?gP(Object(r),!0).forEach(function(n){MH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var EH=class TD{constructor(t,{headers:r={},schema:n,fetch:s,timeout:a,urlLengthLimit:i=8e3}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const l=s??globalThis.fetch;a!==void 0&&a>0?this.fetch=(c,d)=>{const p=new AbortController,u=setTimeout(()=>p.abort(),a),h=d==null?void 0:d.signal;if(h){if(h.aborted)return clearTimeout(u),l(c,d);const f=()=>{clearTimeout(u),p.abort()};return h.addEventListener("abort",f,{once:!0}),l(c,Jf(Jf({},d),{},{signal:p.signal})).finally(()=>{clearTimeout(u),h.removeEventListener("abort",f)})}return l(c,Jf(Jf({},d),{},{signal:p.signal})).finally(()=>clearTimeout(u))}:this.fetch=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new bH(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new TD(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,r={},{head:n=!1,get:s=!1,count:a}={}){var i;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;const p=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(p)),u=n&&Object.values(r).some(p);u?(l="POST",d=r):n||s?(l=n?"HEAD":"GET",Object.entries(r).filter(([f,m])=>m!==void 0).map(([f,m])=>[f,Array.isArray(m)?`{${m.join(",")}}`:`${m}`]).forEach(([f,m])=>{c.searchParams.append(f,m)})):(l="POST",d=r);const h=new Headers(this.headers);return u?h.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&h.set("Prefer",`count=${a}`),new Yc({method:l,url:c,headers:h,schema:this.schemaName,body:d,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit})}};class SH{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,a=parseInt(s.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
227import ws from "ws"
228new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
229
230Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const AH="2.95.3",PH=`realtime-js/${AH}`,CH="1.0.0",MD="2.0.0",yP=MD,_b=1e4,jH=1e3,IH=100;var xo;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(xo||(xo={}));var $n;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})($n||($n={}));var Ua;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Ua||(Ua={}));var wb;(function(e){e.websocket="websocket"})(wb||(wb={}));var Fl;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Fl||(Fl={}));class $H{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(t,r,n){var s,a;const i=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",d=t.payload.event,p=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},u=Object.keys(p).length===0?"":JSON.stringify(p);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`metadata length ${u.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+i.length+d.length+u.length,f=new ArrayBuffer(this.HEADER_LENGTH+h);let m=new DataView(f),v=0;m.setUint8(v++,this.KINDS.userBroadcastPush),m.setUint8(v++,c.length),m.setUint8(v++,l.length),m.setUint8(v++,i.length),m.setUint8(v++,d.length),m.setUint8(v++,u.length),m.setUint8(v++,r),Array.from(c,y=>
230m.setUint8(v++,y.charCodeAt(0))),Array.from(l,y=>m.setUint8(v++,y.charCodeAt(0))),Array.from(i,y=>m.setUint8(v++,y.charCodeAt(0))),Array.from(d,y=>m.setUint8(v++,y.charCodeAt(0))),Array.from(u,y=>m.setUint8(v++,y.charCodeAt(0)));var k=new Uint8Array(f.byteLength+n.byteLength);return k.set(new Uint8Array(f),0),k.set(new Uint8Array(n),f.byteLength),k.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,a,i,l,c]=n;return r({join_ref:s,ref:a,topic:i,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),a=r.getUint8(2),i=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const d=n.decode(t.slice(c,c+s));c=c+s;const p=n.decode(t.slice(c,c+a));c=c+a;const u=n.decode(t.slice(c,c+i));c=c+i;const h=t.slice(c,t.byteLength),f=l===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,m={type:this.BROADCAST_EVENT,event:p,payload:f};return i>0&&(m.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class ED{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Or;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Or||(Or={}));const vP=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((a,i)=>(a[i]=NH(i,e,t,s),a),{}):{}},NH=(e,t,r,n)=>{const s=t.find(l=>
230l.name===e),a=s==null?void 0:s.type,i=r[e];return a&&!n.includes(a)?SD(a,i):xb(i)},SD=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return FH(t,r)}switch(e){case Or.bool:return OH(t);case Or.float4:case Or.float8:case Or.int2:case Or.int4:case Or.int8:case Or.numeric:case Or.oid:return RH(t);case Or.json:case Or.jsonb:return DH(t);case Or.timestamp:return LH(t);case Or.abstime:case Or.date:case Or.daterange:case Or.int4range:case Or.int8range:case Or.money:case Or.reltime:case Or.text:case Or.time:case Or.timestamptz:case Or.timetz:case Or.tsrange:case Or.tstzrange:return xb(t);default:return xb(t)}},xb=e=>e,OH=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},RH=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},DH=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},FH=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let a;const i=e.slice(1,r);try{a=JSON.parse("["+i+"]")}catch{a=i?i.split(","):[]}return a.map(l=>SD(t,l))}return e},LH=e=>typeof e=="string"?e.replace(" ","T"):e,AD=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class z_{constructor(t,r,n={},s=_b){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var _P;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(_P||(_P={}));class Rp{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:a,onLeave:i,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Rp.syncState(this.state,s,a,i),this.pendingDiffs.forEach(c=>{this.state=Rp.syncDiff(this.state,c,a,i)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:a,onLeave:i,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Rp.syncDiff(this.state,s,a,i),l())}),this.onJoin((s,a,i)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:a,newPresences:i})}),this.onLeave((s,a,i)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:a,leftPresences:i})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const a=this.cloneDeep(t),i=this.transformState(r),l={},c={};return this.map(a,(d,p)=>{i[d]||(c[d]=p)}),this.map(i,(d,p)=>{const u=a[d];if(u){const h=p.map(k=>k.presence_ref),f=u.map(k=>k.presence_ref),m=p.filter(k=>f.indexOf(k.presence_ref)<0),v=u.filter(k=>h.indexOf(k.presence_ref)<0);m.length>0&&(l[d]=m),v.length>0&&(c[d]=v)}else l[d]=p}),this.syncDiff(a,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:a,leaves:i}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(a,(l,c)=>{var d;const p=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),p.length>0){const u=t[l].map(f=>f.presence_ref),h=p.filter(f=>u.indexOf(f.presence_ref)<0);t[l].unshift(...h)}n(l,p,c)}),this.map(i,(l,c)=>{let d=t[l];if(!d)return;const p=c.map(u=>u.presence_ref);d=d.filter(u=>p.indexOf(u.presence_ref)<0),t[l]=d,s(l,d,c),d.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=s,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var wP;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(wP||(wP={}));var Dp;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Dp||(Dp={}));var Oi;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Oi||(Oi={}));class fd{constructor(t,r={config:{}},n){var s,a;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=$n.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new z_(this,Ua.join,this.params,this.timeout),this.rejoinTimer=new ED(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=$n.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>
230i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=$n.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=$n.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=$n.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=$n.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ua.reply,{},(i,l)=>{this._trigger(this._replyEventName(l),i)}),this.presence=new Rp(this),this.broadcastEndpointURL=AD(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,a;if(this.socket.isConnected()||this.socket.connect(),this.state==$n.closed){const{config:{broadcast:i,presence:l,private:c}}=this.params,d=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(f=>f.filter))!==null&&s!==void 0?s:[],p=!!this.bindings[Dp.PRESENCE]&&this.bindings[Dp.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,u={},h={broadcast:i,presence:Object.assign(Object.assign({},l),{enabled:p}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(u.access_token=this.socket.accessTokenValue),this._onError(f=>t==null?void 0:t(Oi.CHANNEL_ERROR,f)),this._onClose(()=>t==null?void 0:t(Oi.CLOSED)),this.updateJoinPayload(Object.assign({config:h},u)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:f})=>{var m;if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(Oi.SUBSCRIBED);return}else{const v=this.bindings.postgres_changes,k=(m=v==null?void 0:v.length)!==null&&m!==void 0?m:0,y=[];for(let g=0;g<k;g++){const _=v[g],{filter:{event:w,schema:x,table:b,filter:M}}=_,S=f&&f[g];if(S&&S.event===w&&fd.isFilterValueEqual(S.schema,x)&&fd.isFilterValueEqual(S.table,b)&&fd.isFilterValueEqual(S.filter,M))y.push(Object.assign(Object.assign({},_),{id:S.id}));else{this.unsubscribe(),this.state=$n.errored,t==null||t(Oi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Oi.SUBSCRIBED);return}}).receive("error",f=>{this.state=$n.errored,t==null||t(Oi.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Oi.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===$n.joined&&t===Dp.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const i={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,i,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;try{const d=await l.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
230in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:i}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:i,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var i,l,c;const d=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(i=this.params)===null||i===void 0?void 0:i.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=$n.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ua.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new z_(this,Ua.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=$n.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,a=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(a),i}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new z_(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>IH){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,a;const i=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:p}=Ua;if(n&&[l,c,d,p].indexOf(i)>=0&&n!==this._joinRef())return;let h=this._onMessage(i,r,n);if(r&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(i)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(f=>{var m,v,k;return((m=f.filter)===null||m===void 0?void 0:m.event)==="*"||((k=(v=f.filter)===null||v===void 0?void 0:v.event)===null||k===void 0?void 0:k.toLocaleLowerCase())===i}).map(f=>f.callback(h,n)):(a=this.bindings[i])===null||a===void 0||a.filter(f=>{var m,v,k,y,g,_;if(["broadcast","presence","postgres_changes"].includes(i))if("id"in f){const w=f.id,x=(m=f.filter)===null||m===void 0?void 0:m.event;return w&&((v=r.ids)===null||v===void 0?void 0:v.includes(w))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((k=r.data)===null||k===void 0?void 0:k.type.toLocaleLowerCase()))}else{const w=(g=(y=f==null?void 0:f.filter)===null||y===void 0?void 0:y.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return w==="*"||w===((_=r==null?void 0:r.event)===null||_===void 0?void 0:_.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===i}).map(f=>{if(typeof h=="object"&&"ids"in h){const m=h.data,{schema:v,table:k,commit_timestamp:y,type:g,errors:_}=m;h=Object.assign(Object.assign({},{schema:v,table:k,commit_timestamp:y,eventType:g,new:{},old:{},errors:_}),this._getPayloadRecords(m))}f.callback(h,n)})}_isClosed(){return this.state===$n.closed}_isJoined(){return this.state===$n.joined}_isJoining(){return this.state===$n.joining}_isLeaving(){return this.state===$n.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),a={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var a;return!(((a=s.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&fd.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Ua.close,{},t)}_onError(t){this._on(Ua.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=$n.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=vP(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=vP(t.columns,t.old_record)),r}}const B_=()=>{},Zf={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},zH=[1e3,2e3,5e3,1e4],BH=1e4,UH=`
231  addEventListener("message", (e) => {
232    if (e.data.event === "start") {
233      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
234    }
235  });`;class WH{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=_b,this.transport=null,this.heartbeatIntervalMs=Zf.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=B_,this.ref=0,this.reconnectTimer=null,this.vsn=yP,this.logger=B_,this.conn=null,this.sendBuffer=[],this.serializer
235=new $H,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${wb.websocket}`,this.httpEndpoint=AD(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=SH.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r}
236
237To use Realtime in Node.js, you need to provide a WebSocket implementation:
238
239Option 1: Use Node.js 22+ which has native WebSocket support
240Option 2: Install and provide the "ws" package:
241
242  npm install ws
243
244  import ws from "ws"
245  const client = new RealtimeClient(url, {
246    ...options,
247    transport: ws
248  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&this._remove(t),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case xo.connecting:return Fl.Connecting;case xo.open:return Fl.Open;case xo.closing:return Fl.Closing;default:return Fl.Closed}}isConnected(){return this.connectionState()===Fl.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(a=>a.topic===n);if(s)return s;{const a=new fd(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){const{topic:r,event:n,payload:s,ref:a}=t,i=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${a})`,s),this.isConnected()?i():this.sendBuffer.push(i)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(jH,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
vendor: 3,886 bytes, line 248
248heduleTimeout()},Zf.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const d=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",d)}catch(p){this.log("error","error in heartbeat callback",p)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:s,payload:a,ref:i}=r,l=i?`(${i})`:"",c=a.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),a),this.channels.filter(d=>d._isMember(n)).forEach(d=>d._trigger(s,a,i)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===xo.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===xo.open||this.conn.readyState===xo.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
248heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(r){this.log("error","error in heartbeat callback",r)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(Ua.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([UH],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const a={access_token:r,version:PH};r&&s.updateJoinPayload(a),s.joinedOnce&&s._isJoined()&&s._push(Ua.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new ED(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Zf.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,a,i,l,c,d,p,u,h,f;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:_b,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:Zf.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(i=t==null?void 0:t.accessToken)!==null&&i!==void 0?i:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:B_,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:yP,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:m=>zH[m-1]||BH,this.vsn){case CH:this.encode=(p=t==null?void 0:t.encode)!==null&&p!==void 0?p:(m,v)=>v(JSON.stringify(m)),this.decode=(u=t==null?void 0:t.decode)!==null&&u!==void 0?u:(m,v)=>v(JSON.parse(m));break;case MD:this.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:this.serializer.encode.bind(this.serializer),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var uh=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function VH(e,t,r){const n=new URL(t,e);if(r)for(const[s,a]of Object.entries(r))a!==void 0&&n.searchParams.set(s,a);return n.toString()}async function GH(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function qH(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:a,headers:i}){const l=VH(e.baseUrl,n,s),c=await GH(e.auth),d=await t(l,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...c,...i},body:a?JSON.stringify(a):void 0}),p=await d.text(),u=(d.headers.get("content-type")||"").includes("application/json"),h=u&&p?JSON.parse(p):p;if(!d.ok){const f=u?h:void 0,m=f==null?void 0:f.error;throw new uh((m==null?void 0:m.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:f})}return{status:d.status,headers:d.headers,data:h}}}}function Xf(e){return e.join("�")}var HH=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Xf(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}
248/namespaces/${Xf(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xf(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xf(e.namespace)}`}),!0}catch(t){if(t instanceof uh&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof uh&&r.status===409)return;throw r}}};function Rc(e){return e.join("�")}var KH=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Rc(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof uh&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof uh&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},QH=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=qH({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new HH(this.client,t),this.tableOps=new KH(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},My=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function Ey(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var em=class extends My{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},PD=class extends My{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const YH=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),JH=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
248return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},bb=e=>{if(Array.isArray(e))return e.map(r=>bb(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[s]=bb(n)}),t},ZH=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function XH(e,t){if(ph(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eK(e){var t=XH(e,"string");return ph(t)=="symbol"?t:t+""}function tK(e,t,r){return(t=eK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xP(Object(r),!0).forEach(function(n){tK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const bP=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},rK=async(e,t,r,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const s=e,a=s.status||500;if(typeof s.json=="function")s.json().then(i=>{const l=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||a+"";t(new em(bP(i),a,l,n))}).catch(()=>{if(n==="vectors"){const i=a+"";t(new em(s.statusText||`HTTP ${a} error`,a,i,n))}else{const i=a+"";t(new em(s.statusText||`HTTP ${a} error`,a,i,n))}});else{const i=a+"";t(new em(s.statusText||`HTTP ${a} error`,a,i,n))}}else t(new PD(bP(e),e,n))},nK=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!n?jt(jt({},s),r):(JH(n)?(s.headers=jt({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),jt(jt({},s),r))};async function tp(e,t,r,n,s,a,i){return new Promise((l,c)=>{e(r,nK(t,n,s,a)).then(d=>{if(!d.ok)throw d;if(n!=null&&n.noResolveJson)return d;if(i==="vectors"){const p=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!p||!p.includes("application/json"))return{}}return d.json()}).then(d=>l(d)).catch(d=>rK(d,c,n,i))})}function CD(e="storage"){return{get:async(t,r,n,s)=>tp(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,a)=>tp(t,"POST",r,s,a,n,e),put:async(t,r,n,s,a)=>tp(t,"PUT",r,s,a,n,e),head:async(t,r,n,s)=>tp(t,"HEAD",r,jt(jt({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,a)=>tp(t,"DELETE",r,s,a,n,e)}}const sK=CD("storage"),{get:hh,post:La,put:kb,head:aK,remove:h1}=sK,Gs=CD("vectors");var cu=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=YH(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ey(r))return{data:null,error:r};throw r}}},iK=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ey(t))return{data:null,error:t};throw t}}};let jD;jD=Symbol.toStringTag;var oK=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[jD]="BlobDownloadBuilder",this.promise=null}asStream(){return new iK(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ey(t))return{data:null,error:t};throw t}}};const lK={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},kP={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var cK=class extends cu{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let a;const i=jt(jt({},kP),n);let l=jt(jt({},s.headers),e==="POST"&&{"x-upsert":String(i.upsert)});const c=i.metadata;typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",i.cacheControl),c&&a.append("metadata",s.encodeMetadata(c)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",i.cacheControl),c&&!a.has("metadata")&&a.append("metadata",s.encodeMetadata(c))):(a=r,l["cache-control"]=`max-age=${i.cacheControl}`,l["content-type"]=i.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&a 
248instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers&&(l=jt(jt({},l),n.headers));const d=s._removeEmptyFolders(t),p=s._getFinalPath(d),u=await(e=="PUT"?kb:La)(s.fetch,`${s.url}/object/${p}`,a,jt({headers:l},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:d,id:u.Id,fullPath:u.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const a=s._removeEmptyFolders(e),i=s._getFinalPath(a),l=new URL(s.url+`/object/upload/sign/${i}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const d=jt({upsert:kP.upsert},n),p=jt(jt({},s.headers),{"x-upsert":String(d.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",d.cacheControl)):(c=r,p["cache-control"]=`max-age=${d.cacheControl}`,p["content-type"]=d.contentType),{path:a,fullPath:(await kb(s.fetch,l.toString(),c,{headers:p})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const s=jt({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const a=await La(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+a.url),l=i.searchParams.get("token");if(!l)throw new My("No token returned by API");return{signedUrl:i.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await La(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
248stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await La(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),a=await La(n.fetch,`${n.url}/object/sign/${s}`,jt({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${n.url}${a.signedURL}${i}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const s=await La(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s.map(i=>jt(jt({},i),{},{signedUrl:i.signedURL?encodeURI(`${n.url}${i.signedURL}${a}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=s?`?${s}`:"",i=this._getFinalPath(e),l=()=>hh(this.fetch,`${this.url}/${n}/${i}${a}`,{headers:this.headers,noResolveJson:!0},r);return new oK(l,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>bb(await hh(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await aK(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Ey(n)&&n instanceof PD){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&n.push(s);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});i!==""&&n.push(i);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await h1(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=jt(jt(jt({},lK),t),{},{prefix:e||""});return await La(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=jt({},e);return await La(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const dK="2.95.3",Ih={"X-Client-Info":`storage-js/${dK}`};var uK=class extends cu{constructor(e,t={},r,n){const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const a=s.href.replace(/\/$/,""),i=jt(jt({},Ih),t);super(a,i,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await hh(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await hh(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await La(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await kb(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await La(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await h1(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},pK=class extends cu{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=jt(jt({},Ih),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await La(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
248{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await hh(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await h1(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!ZH(e))throw new My("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new QH({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,a){const i=s[a];return typeof i!="function"?i:async(...l)=>{try{return{data:await i.apply(s,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},hK=class extends cu{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=jt(jt({},Ih),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Gs.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Gs.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},fK=class extends cu{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=jt(jt({},Ih),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},mK=class extends cu{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=jt(jt({},Ih),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Gs.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},gK=class extends mK{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new yK(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},yK=class extends hK{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName}))}
248async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new vK(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},vK=class extends fK{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,jt(jt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},_K=class extends uK{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new cK(this.url,this.headers,e,this.fetch)}get vectors(){return new gK(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new pK(this.url+"/iceberg",this.headers,this.fetch)}};const ID="2.95.3",Jc=30*1e3,Tb=3,U_=Tb*Jc,wK="http://localhost:9999",xK="supabase.auth.token",bK={"X-Client-Info":`gotrue-js/${ID}`},Mb="X-Supabase-Api-Version",$D={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},kK=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,TK=10*60*1e3;
248class fh extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function kt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class MK extends fh{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function EK(e){return kt(e)&&e.name==="AuthApiError"}class Ll extends fh{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Yi extends fh{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class Fs extends Yi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function W_(e){return kt(e)&&e.name==="AuthSessionMissingError"}class Dc extends Yi{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class tm extends Yi{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class rm extends Yi{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function SK(e){return kt(e)&&e.name==="AuthImplicitGrantRedirectError"}class TP extends Yi{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class AK extends Yi{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Eb extends Yi{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function V_(e){return kt(e)&&e.name==="AuthRetryableFetchError"}class MP extends Yi{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Sb extends Yi{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),EP=` 	
249\r=`.split(""),PK=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<EP.length;t+=1)e[EP[t].charCodeAt(0)]=-2;for(let t=0;t<jg.length;t+=1)e[jg[t].charCodeAt(0)]=t;return e})();function SP(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(jg[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(jg[n]),t.queuedBits-=6}}function ND(e,t,r){const n=PK[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function AP(e){const t=[],r=i=>{t.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},a=i=>{IK(i,n,r)};for(let i=0;i<e.length;i+=1)ND(e.charCodeAt(i),s,a);return t.join("")}function CK(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function jK(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}CK(n,t)}}function IK(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Ad(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;
249s+=1)ND(e.charCodeAt(s),r,n);return new Uint8Array(t)}function $K(e){const t=[];return jK(e,r=>t.push(r)),new Uint8Array(t)}function Gl(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>SP(s,r,n)),SP(null,r,n),t.join("")}function NK(e){return Math.round(Date.now()/1e3)+e}function OK(){return Symbol("auth-callback")}const Zn=()=>typeof window<"u"&&typeof document<"u",Sl={tested:!1,writable:!1},OD=()=>{if(!Zn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Sl.tested)return Sl.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Sl.tested=!0,Sl.writable=!0}catch{Sl.tested=!0,Sl.writable=!1}return Sl.writable};function RK(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,a)=>{t[a]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const RD=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),DK=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Zc=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Al=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Jn=async(e,t)=>{await e.removeItem(t)};class Sy{constructor(){this.promise=new Sy.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Sy.promiseConstructor=Promise;function nm(e){const t=e.split(".");if(t.length!==3)throw new Sb("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!kK.test(t[n]))throw new Sb("JWT not in base64url format");return{header:JSON.parse(AP(t[0])),payload:JSON.parse(AP(t[1])),signature:Ad(t[2]),raw:{header:t[0],payload:t[1]}}}async function FK(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function LK(e,t){return new Promise((n,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{const i=await e(a);if(!t(a,null,i)){n(i);return}}catch(i){if(!t(a,i)){s(i);return}}})()})}function zK(e){return("0"+e.toString(16)).substr(-2)}function BK(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let a=0;a<56;a++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,zK).join("")}async function UK(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}async function WK(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await UK(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Fc(e,t,r=!1){const n=BK();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await Zc(e,`${t}-code-verifier`,s);const a=await WK(n);return[a,n===a?"plain":"s256"]}const VK=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function GK(e){const t=e.headers.get(Mb);if(!t||!t.match(VK))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function qK(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function HK(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const KK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Lc(e){if(!KK.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function G_(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function QK(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
249if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function PP(e){return JSON.parse(JSON.stringify(e))}const Rl=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),YK=[502,503,504];async function CP(e){var t;if(!DK(e))throw new Eb(Rl(e),0);if(YK.includes(e.status))throw new Eb(Rl(e),e.status);let r;try{r=await e.json()}catch(a){throw new Ll(Rl(a),a)}let n;const s=GK(e);if(s&&s.getTime()>=$D["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new MP(Rl(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Fs}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,i)=>a&&typeof i=="string",!0))throw new MP(Rl(r),e.status,r.weak_password.reasons);throw new MK(Rl(r),e.status||500,n)}const JK=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function Pt(e,t,r,n){var s;const a=Object.assign({},n==null?void 0:n.headers);a[Mb]||(a[Mb]=$D["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const l=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",c=await ZK(e,t,r+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function ZK(e,t,r,n,s,a){const i=JK(t,n,s,a);let l;try{l=await e(r,Object.assign({},i))}catch(c){throw console.error(c),new Eb(Rl(c),0)}if(l.ok||await CP(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await CP(c)}}function Ra(e){var t;let r=null;t7(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=NK(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function jP(e){const t=Ra(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function To(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function XK(e){return{data:e,error:null}}function e7(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a}=e,i=lu(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a},c=Object.assign({},i);return{data:{properties:l,user:c},error:null}}function IP(e){return e}function t7(e){return e.access_token&&e.refresh_token&&e.expires_in}const q_=["global","local","others"];class r7{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=RD(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=q_[0]){if(q_.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${q_.join(", ")}`);try{return await Pt(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(kt(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await Pt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:To})}catch(n){if(kt(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=lu(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await Pt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:e7,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(kt(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await Pt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:To})}catch(r){if(kt(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,a,i,l,c;try{const d={nextPage:null,lastPage:0,total:0},p=await Pt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:IP});if(p.error)throw p.error;const u=await p.json(),h=(i=p.headers.get("x-total-count"))!==null&&i!==void 0?i:0,f=(c=(l=p.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(m=>{const v=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(m.split(";")[1].split("=")[1]);d[`${k}Page`]=v}),d.total=parseInt(h)),{data:Object.assign(Object.assign({},u),d),error:null}}catch(d){if(kt(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Lc(t);try{return await Pt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:To})}catch(r){if(kt(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Lc(t);try{return await Pt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:To})}catch(n){if(kt(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Lc(t);
249try{return await Pt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:To})}catch(n){if(kt(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Lc(t.userId);try{const{data:r,error:n}=await Pt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(kt(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Lc(t.userId),Lc(t.id);try{return{data:await Pt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(kt(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,a,i,l,c;try{const d={nextPage:null,lastPage:0,total:0},p=await Pt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:IP});if(p.error)throw p.error;const u=await p.json(),h=(i=p.headers.get("x-total-count"))!==null&&i!==void 0?i:0,f=(c=(l=p.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(m=>{const v=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(m.split(";")[1].split("=")[1]);d[`${k}Page`]=v}),d.total=parseInt(h)),{data:Object.assign(Object.assign({},u),d),error:null}}catch(d){if(kt(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await Pt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(kt(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await Pt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(kt(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await Pt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(kt(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await Pt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(kt(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await Pt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(kt(r))return{data:null,error:r};throw r}}}function $P(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const zc={debug:!!(globalThis&&OD()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class DD extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class n7 extends DD{}async function s7(e,t,r){zc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),zc.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){zc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{zc.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw zc.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new n7(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(zc.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null,"  "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}
249function a7(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function FD(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function i7(e){return parseInt(e,16)}function o7(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function l7(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:a=new Date,nonce:i,notBefore:l,requestId:c,resources:d,scheme:p,uri:u,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!u)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
250`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=FD(e.address),m=p?`${p}://${n}`:n,v=e.statement?`${e.statement}
251`:"",k=`${m} wants you to sign in with your Ethereum account:
252${f}
253
254${v}`;let y=`URI: ${u}
255Version: ${h}
256Chain ID: ${r}${i?`
257Nonce: ${i}`:""}
258Issued At: ${a.toISOString()}`;if(s&&(y+=`
259Expiration Time: ${s.toISOString()}`),l&&(y+=`
260Not Before: ${l.toISOString()}`),c&&(y+=`
261Request ID: ${c}`),d){let g=`
262Resources:`;for(const _ of d){if(!_||typeof _!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${_}`);g+=`
263- ${_}`}y+=g}return`${k}
264${y}`}class Tn extends Error{constructor({message:t,code:r,cause:n,name:s}){var a;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=s??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class Ig extends Tn{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function c7({error:e,options:t}){var r,n,s;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Tn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Tn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Tn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Tn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Tn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Tn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Tn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Tn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(LD(i)){if(a.rp.id!==i)return new Tn({message:`The RP ID "${a.rp.id}
264" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Tn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Tn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Tn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Tn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function d7({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Tn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Tn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(LD(n)){if(r.rpId!==n)return new Tn({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Tn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Tn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Tn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class u7{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const p7=new u7;function h7(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=lu(e,["challenge","user","excludeCredentials"]),a=Ad(t).buffer,i=Object.assign(Object.assign({},r),{id:Ad(r.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:a,user:i});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const d=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},d),{id:Ad(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function f7(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=lu(e,["challenge","allowCredentials"]),s=Ad(t).buffer,a=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const l=r[i];a.allowCredentials[i]=Object.assign(Object.assign({},l),{id:Ad(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function m7(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:Gl(new Uint8Array(e.response.attestationObject)),clientDataJSON:Gl(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function g7(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Gl(new Uint8Array(s.authenticatorData)),clientDataJSON:Gl(new Uint8Array(s.clientDataJSON)),signature:Gl(new Uint8Array(s.signature)),userHandle:s.userHandle?Gl(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function LD(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function NP(){var e,t;return!!(Zn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function y7(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ig("Browser returned unexpected credential type",t)}:{data:null,error:new Ig("Empty credential response",t)}}
264catch(t){return{data:null,error:c7({error:t,options:e})}}}async function v7(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ig("Browser returned unexpected credential type",t)}:{data:null,error:new Ig("Empty credential response",t)}}catch(t){return{data:null,error:d7({error:t,options:e})}}}const _7={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},w7={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function $g(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const a in s){const i=s[a];if(i!==void 0)if(Array.isArray(i))n[a]=i;else if(r(i))n[a]=i;else if(t(i)){const l=n[a];t(l)?n[a]=$g(l,i):n[a]=$g(i)}else n[a]=i}return n}function x7(e,t){return $g(_7,e,t||{})}function b7(e,t){return $g(w7,e,t||{})}class k7{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},a){var i;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const d=s??p7.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:p}=l.webauthn.credential_options.publicKey;if(!p.name){const u=n;if(u)p.name=`${p.id}:${u}`;else{const f=(await this.client.getUser()).data.user,m=((i=f==null?void 0:f.user_metadata)===null||i===void 0?void 0:i.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";p.name=`${p.id}:${m}`}}p.displayName||(p.displayName=p.name)}switch(l.webauthn.type){case"create":{const p=x7(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:u,error:h}=await y7({publicKey:p,signal:d});return u?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}case"request":{const p=b7(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:u,error:h}=await v7(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:p,signal:d}));return u?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}}}catch(l){return kt(l)?{data:null,error:l}:{data:null,error:new Ll("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new fh("rpId is required for WebAuthn authentication")};try{if(!NP())return{data:null,error:new Ll("Browser does not support WebAuthn",null)};const{data:i,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:a});if(!i)return{data:null,error:l};const{webauthn:c}=i;return this._verify({factorId:t,challengeId:i.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(i){return kt(i)?{data:null,error:i}:{data:null,error:new Ll("Unexpected error in authenticate",i)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new fh("rpId is required for WebAuthn registration")};try{if(!NP())return{data:null,error:new Ll("Browser does not support WebAuthn",null)};const{data:i,error:l}=await this._enroll({friendlyName:t});if(!i)return await this.client.mfa.listFactors().then(p=>{var u;return(u=p.data)===null||u===void 0?void 0:u.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(p=>p?this.client.mfa.unenroll({factorId:p==null?void 0:p.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:a});return c?this._verify({factorId:i.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:d}}catch(i){return kt(i)?{data:null,error:i}:{data:null,error:new Ll("Unexpected error in register",i)}}}}a7();const T7={url:wK,storageKey:xK,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bK,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function OP(e,t,r){return await r()}const Bc={};class mh{get jwks(){var t,r;return(r=(t=Bc[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Bc[this.storageKey]=Object.assign(Object.assign({},Bc[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Bc[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Bc[this.storageKey]=Object.assign(Object.assign({},Bc[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},T7),t);
264if(this.storageKey=a.storageKey,this.instanceID=(r=mh.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,mh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Zn()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new r7({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=RD(a.fetch),this.lock=a.lock||OP,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Zn()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=s7:this.lock=OP,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new k7(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:OD()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=$P(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=$P(this.memoryStorage)),Zn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${ID}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Zn()&&(r=RK(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Zn()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),SK(a)){const c=(t=a.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:i,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",l),await this._saveSession(i),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return kt(r)?this._returnResult({error:r}):this._returnResult({error:new Ll("Unexpected error during initialization",r)}
264)}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const a=await Pt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ra}),{data:i,error:l}=a;if(l||!i)return this._returnResult({data:{user:null,session:null},error:l});const c=i.session,d=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(kt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,n,s;try{let a;if("email"in t){const{email:p,password:u,options:h}=t;let f=null,m=null;this.flowType==="pkce"&&([f,m]=await Fc(this.storage,this.storageKey)),a=await Pt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:p,password:u,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:m},xform:Ra})}else if("phone"in t){const{phone:p,password:u,options:h}=t;a=await Pt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:u,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:Ra})}else throw new tm("You must provide either an email or phone number and a password");const{data:i,error:l}=a;if(l||!i)return await Jn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=i.session,d=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:i,options:l}=t;r=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:i,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:jP})}else if("phone"in t){const{phone:a,password:i,options:l}=t;r=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:i,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:jP})}else throw new tm("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const a=new Dc;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(kt(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=t.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,a,i,l,c,d,p,u,h;let f,m;if("message"in t)f=t.message,m=t.signature;else{const{chain:v,wallet:k,statement:y,options:g}=t;let _;if(Zn())if(typeof k=="object")_=k;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")_=j.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=k}const w=new URL((r=g==null?void 0:g.url)!==null&&r!==void 0?r:window.location.href),x=await _.request({method:"eth_requestAccounts"}).then(j=>j).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!x||x.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const b=FD(x[0]);let M=(n=g==null?void 0:g.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!M){const j=await _.request({method:"eth_chainId"});M=i7(j)}const S={domain:w.host,address:b,statement:y,uri:w.href,version:"1",chainId:M,nonce:(s=g==null?void 0:g.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(a=g==null?void 0:g.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(l=g==null?void 0:g.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=g==null?void 0:g.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=g==null?void 0:g.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(p=g==null?void 0:g.signInWithEthereum)===null||p===void 0?void 0:p.resources};f=l7(S),m=await _.request({method:"personal_sign",params:[o7(f),b]})}try{const{data:v,error:k}=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:m},!((u=t.options)===null||u===void 0)&&u.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Ra});if(k)throw k;if(!v||!v.session||!v.user){const y=new Dc;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:k})}catch(v){if(kt(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(t){var r,n,s,a,i,l,c,d,p,u,h,f;let m,v;if("message"in t)m=t.message,v=t.signature;else{const{chain:k,wallet:y,statement:g,options:_}=t;let w;if(Zn())if(typeof y=="object")w=y;else{const b=window;if("solana"in b&&typeof b.solana=="object"&&("signIn"in b.solana&&typeof b.solana.signIn=="function"||"signMessage"in b.solana&&typeof b.solana.signMessage=="function"))w=b.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(_!=null&&_.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const x=new URL((r=_==null?void 0:_.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in w&&w.signIn){const b=await w.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},_==null?void 0:_.signInWithSolana),{version:"1",domain:x.host,uri:x.href}),g?{statement:g}:null));let M;if(Array.isArray(b)&&b[0]&&typeof b[0]=="object")M=b[0];else if(b&&typeof b=="object"&&"signedMessage"in b&&"signature"in b)M=b;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in M&&"signature"in M&&(typeof M.signedMessage=="string"||M.signedMessage instanceof Uint8Array)&&M.signature instanceof Uint8Array)m=typeof M.signedMessage=="string"?M.signedMessage:new TextDecoder().decode(M.signedMessage),v=M.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in w)||typeof w.signMessage!="function"||!("publicKey"in w)||typeof w!="object"||!w.publicKey||!("toBase58"in w.publicKey)||typeof w.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${x.host} wants you to sign in with your Solana account:`,w.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${x.href}`,`Issued At: ${(s=(n=_==null?void 0:_.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((a=_==null?void 0:_.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${_.signInWithSolana.notBefore}`]:[],...!((i=_==null?void 0:_.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${_.signInWithSolana.expirationTime}`]:[],...!((l=_==null?void 0:_.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${_.signInWithSolana.chainId}`]:[],...!((c=_==null?void 0:_.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${_.signInWithSolana.nonce}`]:[],...!((d=_==null?void 0:_.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${_.signInWithSolana.requestId}`]:[],...!((u=(p=_==null?void 0:_.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||u===void 0)&&u.length?["Resources",..._.signInWithSolana.resources.map(M=>`- ${M}`)]:[]].join(`
265`);const b=await w.signMessage(new TextEncoder().encode(m),"utf8");if(!b||!(b instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=b}}try{const{data:k,error:y}=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:Gl(v)}
265,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Ra});if(y)throw y;if(!k||!k.session||!k.user){const g=new Dc;return this._returnResult({data:{user:null,session:null},error:g})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:y})}catch(k){if(kt(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async _exchangeCodeForSession(t){const r=await Al(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new AK;const{data:a,error:i}=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Ra});if(await Jn(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!a||!a.session||!a.user){const l=new Dc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:s??null}),error:i})}catch(a){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:a,nonce:i}=t,l=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:a,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Ra}),{data:c,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user){const p=new Dc;return this._returnResult({data:{user:null,session:null},error:p})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:d})}catch(r){if(kt(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,a,i;try{if("email"in t){const{email:l,options:c}=t;let d=null,p=null;this.flowType==="pkce"&&([d,p]=await Fc(this.storage,this.storageKey));const{error:u}=await Pt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:p},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:p}=await Pt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(i=c==null?void 0:c.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:p})}throw new tm("You must provide either an email or phone number.")}catch(l){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let s,a;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:l}=await Pt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:s,xform:Ra});if(l)throw l;if(!i)throw new Error("An error occurred on token verification.");const c=i.session,d=i.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(s){if(kt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,a,i;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Fc(this.storage,this.storageKey));const d=await Pt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:XK});return!((a=d.data)===null||a===void 0)&&a.url&&Zn()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Fs;const{error:s}=await Pt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(kt(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:a}=t,{error:i}=await Pt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}else if("phone"in t){const{phone:n,type:s,options:a}=t,{data:i,error:l}=await Pt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:l})}throw new tm("You must provide either an email or phone number and a type")}catch(r){if(kt(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Al(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
265id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<U_:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const i=await Al(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=G_()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=QK(t.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await Pt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:To}):await this._useSession(async r=>{var n,s,a;const{data:i,error:l}=r;if(l)throw l;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Fs}:await Pt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:To})})}catch(r){if(kt(r))return W_(r)&&(await this._removeSession(),await Jn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:a}=n;if(a)throw a;if(!s.session)throw new Fs;const i=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Fc(this.storage,this.storageKey));const{data:d,error:p}=await Pt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:i.access_token,xform:To});if(p)throw p;return i.user=d.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Fs;const r=Date.now()/1e3;let n=r,s=!0,a=null;const{payload:i}=nm(t.access_token);if(i.exp&&(n=i.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(kt(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:i,error:l}=r;if(l)throw l;t=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Fs;const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(kt(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}
265async _getSessionFromURL(t,r){try{if(!Zn())throw new rm("No browser detected.");if(t.error||t.error_description||t.error_code)throw new rm(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new TP("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new rm("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new TP("No code detected.");const{data:g,error:_}=await this._exchangeCodeForSession(t.code);if(_)throw _;const w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:g.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:a,refresh_token:i,expires_in:l,expires_at:c,token_type:d}=t;if(!a||!l||!i||!d)throw new rm("No session defined in URL");const p=Math.round(Date.now()/1e3),u=parseInt(l);let h=p+u;c&&(h=parseInt(c));const f=h-p;f*1e3<=Jc&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);const m=h-u;p-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,p):p-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,p);const{data:v,error:k}=await this._getUser(a);if(k)throw k;const y={provider_token:n,provider_refresh_token:s,access_token:a,expires_in:u,expires_at:h,refresh_token:i,token_type:d,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(n){if(kt(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await Al(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a&&!W_(a))return this._returnResult({error:a});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:l}=await this.admin.signOut(i,t);if(l&&!(EK(l)&&(l.status===404||l.status===401||l.status===403)||W_(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Jn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=OK(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:a},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Fc(this.storage,this.storageKey,!0));try{return await Pt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async a=>{var i,l,c,d,p;const{data:u,error:h}=a;if(h)throw h;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(i=t.options)===null||i===void 0?void 0:i.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Pt(this.fetch,"GET",f,{headers:this.headers,jwt:(p=(d=u.session)===null||d===void 0?void 0:d.access_token)!==null&&p!==void 0?p:void 0})});if(s)throw s;return Zn()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(kt(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:a}}=r;if(s)throw s;const{options:i,provider:l,token:c,access_token:d,nonce:p}=t,u=await Pt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:d,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:Ra}),{data:h,error:f}=u;return f?this._returnResult({data:{user:null,session:null},error:f}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Dc}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:f}))}catch(s){if(await Jn(this.storage,`${this.storageKey}-code-verifier`),kt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:i}=r;if(i)throw i;
265return await Pt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await LK(async s=>(s>0&&await FK(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await Pt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ra})),(s,a)=>{const i=200*Math.pow(2,s);return a&&V_(a)&&Date.now()+i-n<Jc})}catch(n){if(this._debug(r,"error",n),kt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Zn()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Al(this.storage,this.storageKey);if(s&&this.userStorage){let i=await Al(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await Zc(this.userStorage,this.storageKey+"-user",i)),s.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:G_()}else if(s&&!s.user&&!s.user){const i=await Al(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await Jn(this.storage,this.storageKey+"-user"),await Zc(this.storage,this.storageKey,s)):s.user=G_()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const a=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<U_;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${U_}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(console.error(i),V_(i)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:l}=await this._getUser(s.access_token);!l&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Fs;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Sy;const{data:a,error:i}=await this._refreshAccessToken(t);if(i)throw i;if(!a.session)throw new Fs;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(s,"error",a),kt(a)){const i={data:null,error:a};return V_(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],i=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){a.push(c)}});if(await Promise.all(i),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Jn(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Zc(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const a=PP(s);await Zc(this.storage,this.storageKey,a)}else{const s=PP(r);await Zc(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Jn(this.storage,this.storageKey),await Jn(this.storage,this.storageKey+"-code-verifier"),await Jn(this.storage,this.storageKey+"-user"),this.userStorage&&await Jn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Zn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
265catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Jc);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Jc);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Jc}ms, refresh threshold is ${Tb} ticks`),s<=Tb&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof DD)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Zn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,i]=await Fc(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);s.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;return a?this._returnResult({data:null,error:a}):await Pt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:i}=r;if(i)return this._returnResult({data:null,error:i});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:d}=await Pt(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const i=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?m7(t.webauthn.credential_response):g7(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await Pt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:i,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const i=await Pt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(i.error)return i;const{data:l}=i;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:h7(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:f7(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(a),a.status==="verified"&&s[a.factor_type].push(a);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,s,a;
265if(t)try{const{payload:f}=nm(t);let m=null;f.aal&&(m=f.aal);let v=m;const{data:{user:k},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((n=(r=k==null?void 0:k.factors)===null||r===void 0?void 0:r.filter(w=>w.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(v="aal2");const _=f.amr||[];return{data:{currentLevel:m,nextLevel:v,currentAuthenticationMethods:_},error:null}}catch(f){if(kt(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:i},error:l}=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=nm(i.access_token);let d=null;c.aal&&(d=c.aal);let p=d;((a=(s=i.user.factors)===null||s===void 0?void 0:s.filter(f=>f.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(p="aal2");const h=c.amr||[];return{data:{currentLevel:d,nextLevel:p,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await Pt(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Fs})})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Fs});const i=await Pt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return i.data&&i.data.redirect_url&&Zn()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(kt(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Fs});const i=await Pt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return i.data&&i.data.redirect_url&&Zn()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(kt(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await Pt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Fs})})}catch(t){if(kt(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await Pt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Fs})})}catch(r){if(kt(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+TK>s)return n;const{data:a,error:i}=await Pt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=s,n=a.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:f,error:m}
265=await this.getSession();if(m||!f.session)return this._returnResult({data:null,error:m});n=f.session.access_token}const{header:s,payload:a,signature:i,raw:{header:l,payload:c}}=nm(n);r!=null&&r.allowExpired||qK(a.exp);const d=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:a,header:s,signature:i},error:null}}const p=HK(s.alg),u=await crypto.subtle.importKey("jwk",d,p,!0,["verify"]);if(!await crypto.subtle.verify(p,u,i,$K(`${l}.${c}`)))throw new Sb("Invalid JWT signature");return{data:{claims:a,header:s,signature:i},error:null}}catch(n){if(kt(n))return this._returnResult({data:null,error:n});throw n}}}mh.nextInstanceID={};const M7=mh,E7="2.95.3";let _p="";typeof Deno<"u"?_p="deno":typeof document<"u"?_p="web":typeof navigator<"u"&&navigator.product==="ReactNative"?_p="react-native":_p="node";const S7={"X-Client-Info":`supabase-js-${_p}/${E7}`},A7={headers:S7},P7={schema:"public"},C7={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},j7={};function gh(e){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gh(e)}function I7(e,t){if(gh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $7(e){var t=I7(e,"string");return gh(t)=="symbol"?t:t+""}function N7(e,t,r){return(t=$7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(r),!0).forEach(function(n){N7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const O7=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),R7=()=>Headers,D7=(e,t,r)=>{const n=O7(r),s=R7();return async(a,i)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let d=new s(i==null?void 0:i.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),n(a,sn(sn({},i),{},{headers:d}))}};function F7(e){return e.endsWith("/")?e:e+"/"}function L7(e,t){var r,n;const{db:s,auth:a,realtime:i,global:l}=e,{db:c,auth:d,realtime:p,global:u}=t,h={db:sn(sn({},c),s),auth:sn(sn({},d),a),realtime:sn(sn({},p),i),storage:{},global:sn(sn(sn({},u),l),{},{headers:sn(sn({},(r=u==null?void 0:u.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function z7(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(F7(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var B7=class extends M7{constructor(e){super(e)}},U7=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const a=z7(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const i=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:P7,realtime:j7,auth:sn(sn({},C7),{},{storageKey:i}),global:A7},c=L7(r??{},l);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(p,u)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(u)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=c.auth)!==null&&d!==void 0?d:{},this.headers,c.global.fetch)}this.fetch=D7(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(sn({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(p=>this.realtime.setAuth(p)).catch(p=>console.warn("Failed to set initial Realtime auth token:",p)),this.rest=new EH(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new _K(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new vH(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
265channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:a,flowType:i,lock:l,debug:c,throwOnError:d},p,u){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new B7({url:this.authUrl.href,headers:sn(sn({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:l,debug:c,throwOnError:d,fetch:u,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new WH(this.realtimeUrl.href,sn(sn({},e),{},{params:sn(sn({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const W7=(e,t,r)=>new U7(e,t,r);function V7(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}V7()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function G7(){var k,y;if(typeof window>"u")return;const e=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(g=>e===g||e.endsWith("."+g)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=r?((k=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:k[1])??((y=e.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:y[1]):void 0,a=window.parent&&window.parent!==window;if(!s||!a)return localStorage;const i=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=i?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),d=c&&l.test(c)?[c]:i?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],p="lovable-preview-auth:result",u=2e3,h=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),f=(g,_,w)=>new Promise(x=>{const b=h();let M=!1,S;const j=U=>{M||(M=!0,clearTimeout(S),window.removeEventListener("message",I),x(U))},I=U=>{if(d.indexOf(U.origin)<0)return;const R=U.data;R&&R.type===p&&R.requestId===b&&j(R)};window.addEventListener("message",I);const q={type:g,requestId:b,projectId:s,key:_};w!==void 0&&(q.value=w);for(const U of d)window.parent.postMessage(q,U);S=setTimeout(()=>j(null),u)});let m=!0;const v=250;return{getItem:async g=>{let _=await f("lovable-preview-auth:get",g);return!_&&m&&(await new Promise(w=>setTimeout(w,v)),_=await f("lovable-preview-auth:get",g)),m=!1,_&&_.ok&&typeof _.value=="string"?_.value===""?(localStorage.removeItem(g),null):_.value:localStorage.getItem(g)},setItem:(g,_)=>(localStorage.setItem(g,_),f("lovable-preview-auth:set",g,_).then(w=>{w&&w.ok&&typeof w.value=="string"&&localStorage.getItem(g)===_&&(w.value===""?localStorage.removeItem(g):localStorage.setItem(g,w.value))})),removeItem:g=>(localStorage.removeItem(g),f("lovable-preview-auth:remove",g).then(()=>{}))}}const q7="https://liedziqwqjrifamddcro.supabase.co",H7="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxpZWR6aXF3cWpyaWZhbWRkY3JvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc0MDExOTIsImV4cCI6MjA5Mjk3NzE5Mn0.iNrgvaKm3VOby7RGwDAmM4zDB7IthFzlHztLwkkw2ls",ec=W7(q7,H7,{auth:{storage:G7(),persistSession:!0,autoRefreshToken:!0}}),zD=D.createContext({language:"en",setLanguage:()=>{},isBrazil:!1,t:e=>e.en}),gc=()=>D.useContext(zD),K7=({children:e})=>{const[t,r]=D.useState("en"),[n,s]=D.useState(!1);D.useEffect(()=>{const l=localStorage.getItem("ab-language"),c=async()=>{try{const{data:d,error:p}=await ec.functions.invoke("detect-country");!p&&(d!=null&&d.isBrazil)&&(s(!0),l||(r("pt-BR"),localStorage.setItem("ab-language","pt-BR")))}catch(d){console.error("Country detection failed:",d)}};l&&r(l),c()},[]);const a=D.useCallback(l=>{r(l),localStorage.setItem("ab-language",l)},[]),i=D.useCallback(l=>l[t]||l.en,[t]);return o.jsx(zD.Provider,{value:{language:t,setLanguage:a,isBrazil:n,t:i},children:e})},Q7=gy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),rr=D.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const i=n?Hd:"button";return o.jsx(i,{className:Sn(Q7({variant:t,size:r,className:e})),ref:a,...s})});rr.displayName="Button";var H_="focusScope.autoFocusOnMount",K_="focusScope.autoFocusOnUnmount",DP={bubbles:!1,cancelable:!0},Y7="FocusScope",BD=D.forwardRef((e,t)=>
vendor: 4,257 bytes, line 265
265{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=D.useState(null),d=ba(s),p=ba(a),u=D.useRef(null),h=Hn(t,v=>c(v)),f=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(n){let v=function(_){if(f.paused||!l)return;const w=_.target;l.contains(w)?u.current=w:vo(u.current,{select:!0})},k=function(_){if(f.paused||!l)return;const w=_.relatedTarget;w!==null&&(l.contains(w)||vo(u.current,{select:!0}))},y=function(_){if(document.activeElement===document.body)for(const x of _)x.removedNodes.length>0&&vo(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",k);const g=new MutationObserver(y);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",k),g.disconnect()}}},[n,l,f.paused]),D.useEffect(()=>{if(l){LP.add(f);const v=document.activeElement;if(!l.contains(v)){const y=new CustomEvent(H_,DP);l.addEventListener(H_,d),l.dispatchEvent(y),y.defaultPrevented||(J7(rQ(UD(l)),{select:!0}),document.activeElement===v&&vo(l))}return()=>{l.removeEventListener(H_,d),setTimeout(()=>{const y=new CustomEvent(K_,DP);l.addEventListener(K_,p),l.dispatchEvent(y),y.defaultPrevented||vo(v??document.body,{select:!0}),l.removeEventListener(K_,p),LP.remove(f)},0)}}},[l,d,p,f]);const m=D.useCallback(v=>{if(!r&&!n||f.paused)return;const k=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(k&&y){const g=v.currentTarget,[_,w]=Z7(g);_&&w?!v.shiftKey&&y===w?(v.preventDefault(),r&&vo(_,{select:!0})):v.shiftKey&&y===_&&(v.preventDefault(),r&&vo(w,{select:!0})):y===g&&v.preventDefault()}},[r,n,f.paused]);return o.jsx(Er.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});BD.displayName=Y7;function J7(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(vo(n,{select:t}),document.activeElement!==r)return}function Z7(e){const t=UD(e),r=FP(t,e),n=FP(t.reverse(),e);return[r,n]}function UD(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function FP(e,t){for(const r of e)if(!X7(r,{upTo:t}))return r}function X7(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function eQ(e){return e instanceof HTMLInputElement&&"select"in e}function vo(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&eQ(e)&&t&&e.select()}}var LP=tQ();function tQ(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=zP(e,t),e.unshift(t)},remove(t){var r;e=zP(e,t),(r=e[0])==null||r.resume()}}}function zP(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function rQ(e){return e.filter(t=>t.tagName!=="A")}var Q_=0;function nQ(){D.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??BP()),document.body.insertAdjacentElement("beforeend",e[1]??BP()),Q_++,()=>{Q_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q_--}},[])}function BP(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vm="right-scroll-bar-position",Gm="width-before-scroll-bar",sQ="with-scroll-bars-hidden",aQ="--removed-body-scroll-bar-size";function Y_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iQ(e,t){var r=D.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var oQ=typeof window<"u"?D.useLayoutEffect:D.useEffect,UP=new WeakMap;function lQ(e,t){var r=iQ(null,function(n){return e.forEach(function(s){return Y_(s,n)})});return oQ(function(){var n=UP.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;
vendor: 4,155 bytes, lines 265-280
265s.forEach(function(l){a.has(l)||Y_(l,null)}),a.forEach(function(l){s.has(l)||Y_(l,i)})}UP.set(r,e)},[e]),r}function cQ(e){return e}function dQ(e,t){t===void 0&&(t=cQ);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var c=function(){var p=i;i=[],p.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),r}}}};return s}function uQ(e){e===void 0&&(e={});var t=dQ(null);return t.options=wi({async:!0,ssr:!1},e),t}var WD=function(e){var t=e.sideCar,r=lu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return D.createElement(n,wi({},r))};WD.isSideCarExport=!0;function pQ(e,t){return e.useMedium(t),WD}var VD=uQ(),J_=function(){},Ay=D.forwardRef(function(e,t){var r=D.useRef(null),n=D.useState({onScrollCapture:J_,onWheelCapture:J_,onTouchMoveCapture:J_}),s=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,u=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,k=e.as,y=k===void 0?"div":k,g=e.gapMode,_=lu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,x=lQ([r,t]),b=wi(wi({},_),s);return D.createElement(D.Fragment,null,p&&D.createElement(w,{sideCar:VD,removeScrollBar:d,shards:u,noIsolation:f,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:g}),i?D.cloneElement(D.Children.only(l),wi(wi({},b),{ref:x})):D.createElement(y,wi({},b,{className:c,ref:x}),l))});Ay.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ay.classNames={fullWidth:Gm,zeroRight:Vm};var hQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hQ();return t&&e.setAttribute("nonce",t),e}function mQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yQ=function(){var e=0,t=null;return{add:function(r){e==0&&(t=fQ())&&(mQ(t,r),gQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vQ=function(){var e=yQ();return function(t,r){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},GD=function(){var e=vQ(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},_Q={left:0,top:0,right:0,gap:0},Z_=function(e){return parseInt(e||"",10)||0},wQ=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Z_(r),Z_(n),Z_(s)]},xQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _Q;var t=wQ(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},bQ=GD(),Pd="data-scroll-locked",kQ=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
266  .`.concat(sQ,` {
267   overflow: hidden `).concat(n,`;
268   padding-right: `).concat(l,"px ").concat(n,`;
269  }
270  body[`).concat(Pd,`] {
271    overflow: hidden `).concat(n,`;
272    overscroll-behavior: contain;
273    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
274    padding-left: `.concat(s,`px;
275    padding-top: `).concat(a,`px;
276    padding-right: `).concat(i,`px;
277    margin-left:0;
278    margin-top:0;
279    margin-right: `).concat(l,"px ").concat(n,`;
280    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
280")].filter(Boolean).join(""),`
281  }
282  
283  .`).concat(Vm,` {
284    right: `).concat(l,"px ").concat(n,`;
285  }
286  
287  .`).concat(Gm,` {
288    margin-right: `).concat(l,"px ").concat(n,`;
289  }
290  
291  .`).concat(Vm," .").concat(Vm,` {
292    right: 0 `).concat(n,`;
293  }
294  
295  .`).concat(Gm," .").concat(Gm,` {
296    margin-right: 0 `).concat(n,`;
297  }
298  
299  body[`).concat(Pd,`] {
300    `).concat(aQ,": ").concat(l,`px;
301  }
302`)},WP=function(){var e=parseInt(document.body.getAttribute(Pd)||"0",10);return isFinite(e)?e:0},TQ=function(){D.useEffect(function(){return document.body.setAttribute(Pd,(WP()+1).toString()),function(){var e=WP()-1;e<=0?document.body.removeAttribute(Pd):document.body.setAttribute(Pd,e.toString())}},[])},MQ=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;TQ();var a=D.useMemo(function(){return xQ(s)},[s]);return D.createElement(bQ,{styles:kQ(a,!t,s,r?"":"!important")})},Ab=!1;if(typeof window<"u")try{var sm=Object.defineProperty({},"passive",{get:function(){return Ab=!0,!0}});window.addEventListener("test",sm,sm),window.removeEventListener("test",sm,sm)}catch{Ab=!1}var Uc=Ab?{passive:!1}:!1,EQ=function(e){return e.tagName==="TEXTAREA"},qD=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!EQ(e)&&r[t]==="visible")},SQ=function(e){return qD(e,"overflowY")},AQ=function(e){return qD(e,"overflowX")},VP=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=HD(e,n);if(s){var a=KD(e,n),i=a[1],l=a[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},PQ=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},CQ=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},HD=function(e,t){return e==="v"?SQ(t):AQ(t)},KD=function(e,t){return e==="v"?PQ(t):CQ(t)},jQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},IQ=function(e,t,r,n,s){var a=jQ(e,window.getComputedStyle(t).direction),i=a*n,l=r.target,c=t.contains(l),d=!1,p=i>0,u=0,h=0;do{var f=KD(e,l),m=f[0],v=f[1],k=f[2],y=v-k-a*m;(m||y)&&HD(e,l)&&(u+=y,h+=m),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(p&&(Math.abs(u)<1||!s)||!p&&(Math.abs(h)<1||!s))&&(d=!0),d},am=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GP=function(e){return[e.deltaX,e.deltaY]},qP=function(e){return e&&"current"in e?e.current:e},$Q=function(e,t){return e[0]===t[0]&&e[1]===t[1]},NQ=function(e){return`
303  .block-interactivity-`.concat(e,` {pointer-events: none;}
304  .allow-interactivity-`).concat(e,` {pointer-events: all;}
305`)},OQ=0,Wc=[];function RQ(e){var t=D.useRef([]),r=D.useRef([0,0]),n=D.useRef(),s=D.useState(OQ++)[0],a=D.useState(GD)[0],i=D.useRef(e);D.useEffect(function(){i.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=mH([e.lockRef.current],(e.shards||[]).map(qP),!0).filter(Boolean);return v.forEach(function(k){return k.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=D.useCallback(function(v,k){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var y=am(v),g=r.current,_="deltaX"in v?v.deltaX:g[0]-y[0],w="deltaY"in v?v.deltaY:g[1]-y[1],x,b=v.target,M=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in v&&M==="h"&&b.type==="range")return!1;var S=VP(M,b);if(!S)return!0;if(S?x=M:(x=M==="v"?"h":"v",S=VP(M,b)),!S)return!1;if(!n.current&&"changedTouches"in v&&(_||w)&&(n.current=x),!x)return!0;var j=n.current||x;return IQ(j,k,v,j==="h"?_:w,!0)},[]),c=D.useCallback(function(v){var k=v;if(!(!Wc.length||Wc[Wc.length-1]!==a)){var y="deltaY"in k?GP(k):am(k),g=t.current.filter(function(x){return x.name===k.type&&(x.target===k.target||k.target===x.shadowParent)&&$Q(x.delta,y)})[0];if(g&&g.should){k.cancelable&&k.preventDefault();return}
vendor: 9,245 bytes, lines 305-309
305if(!g){var _=(i.current.shards||[]).map(qP).filter(Boolean).filter(function(x){return x.contains(k.target)}),w=_.length>0?l(k,_[0]):!i.current.noIsolation;w&&k.cancelable&&k.preventDefault()}}},[]),d=D.useCallback(function(v,k,y,g){var _={name:v,delta:k,target:y,should:g,shadowParent:DQ(y)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),p=D.useCallback(function(v){r.current=am(v),n.current=void 0},[]),u=D.useCallback(function(v){d(v.type,GP(v),v.target,l(v,e.lockRef.current))},[]),h=D.useCallback(function(v){d(v.type,am(v),v.target,l(v,e.lockRef.current))},[]);D.useEffect(function(){return Wc.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Uc),document.addEventListener("touchmove",c,Uc),document.addEventListener("touchstart",p,Uc),function(){Wc=Wc.filter(function(v){return v!==a}),document.removeEventListener("wheel",c,Uc),document.removeEventListener("touchmove",c,Uc),document.removeEventListener("touchstart",p,Uc)}},[]);var f=e.removeScrollBar,m=e.inert;return D.createElement(D.Fragment,null,m?D.createElement(a,{styles:NQ(s)}):null,f?D.createElement(MQ,{gapMode:e.gapMode}):null)}function DQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const FQ=pQ(VD,RQ);var QD=D.forwardRef(function(e,t){return D.createElement(Ay,wi({},e,{ref:t,sideCar:FQ}))});QD.classNames=Ay.classNames;var LQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vc=new WeakMap,im=new WeakMap,om={},X_=0,YD=function(e){return e&&(e.host||YD(e.parentNode))},zQ=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=YD(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},BQ=function(e,t,r,n){var s=zQ(t,Array.isArray(e)?e:[e]);om[r]||(om[r]=new WeakMap);var a=om[r],i=[],l=new Set,c=new Set(s),d=function(u){!u||l.has(u)||(l.add(u),d(u.parentNode))};s.forEach(d);var p=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(h){if(l.has(h))p(h);else try{var f=h.getAttribute(n),m=f!==null&&f!=="false",v=(Vc.get(h)||0)+1,k=(a.get(h)||0)+1;Vc.set(h,v),a.set(h,k),i.push(h),v===1&&m&&im.set(h,!0),k===1&&h.setAttribute(r,"true"),m||h.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return p(t),l.clear(),X_++,function(){i.forEach(function(u){var h=Vc.get(u)-1,f=a.get(u)-1;Vc.set(u,h),a.set(u,f),h||(im.has(u)||u.removeAttribute(n),im.delete(u)),f||u.removeAttribute(r)}),X_--,X_||(Vc=new WeakMap,Vc=new WeakMap,im=new WeakMap,om={})}},UQ=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=LQ(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),BQ(n,s,r,"aria-hidden")):function(){return null}},f1="Dialog",[JD,Tae]=ru(f1),[WQ,ei]=JD(f1),ZD=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,l=D.useRef(null),c=D.useRef(null),[d=!1,p]=nu({prop:n,defaultProp:s,onChange:a});return o.jsx(WQ,{scope:t,triggerRef:l,contentRef:c,contentId:Op(),titleId:Op(),descriptionId:Op(),open:d,onOpenChange:p,onOpenToggle:D.useCallback(()=>p(u=>!u),[p]),modal:i,children:r})};ZD.displayName=f1;var XD="DialogTrigger",eF=D.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ei(XD,r),a=Hn(t,s.triggerRef);return o.jsx(Er.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":y1(s.open),...n,ref:a,onClick:Tr(e.onClick,s.onOpenToggle)})});eF.displayName=XD;var m1="DialogPortal",[VQ,tF]=JD(m1,{forceMount:void 0}),rF=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,a=ei(m1,t);return o.jsx(VQ,{scope:t,forceMount:r,children:D.Children.map(n,i=>o.jsx(el,{present:r||a.open,children:o.jsx(q0,{asChild:!0,container:s,children:i})}))})};rF.displayName=m1;var Ng="DialogOverlay",nF=D.forwardRef((e,t)=>{const r=tF(Ng,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=ei(Ng,e.__scopeDialog);return a.modal?o.jsx(el,{present:n||a.open,children:o.jsx(GQ,{...s,ref:t})}):null});nF.displayName=Ng;var GQ=D.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ei(Ng,r);return o.jsx(QD,{as:Hd,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(Er.div,{"data-state":y1(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),oc="DialogContent",sF=D.forwardRef((e,t)=>{const r=tF(oc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=ei(oc,e.__scopeDialog);return o.jsx(el,{present:n||a.open,children:a.modal?o.jsx(qQ,{...s,ref:t}):o.jsx(HQ,{...s,ref:t})})});sF.displayName=oc;var qQ=D.forwardRef((e,t)=>{const r=ei(oc,e.__scopeDialog),n=D.useRef(null),s=Hn(t,r.contentRef,n);return D.useEffect(()=>{const a=n.current;if(a)return UQ(a)},[]),o.jsx(aF,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Tr(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Tr(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:Tr(e.onFocusOutside,a=>a.preventDefault())})}),HQ=D.forwardRef((e,t)=>{const r=ei(oc,e.__scopeDialog),n=D.useRef(!1),s=D.useRef(!1);return o.jsx(aF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;((d=r.triggerRef.current)==null?void 0:d.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),aF=D.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...i}=e,l=ei(oc,r),c=D.useRef(null),d=Hn(t,c);return nQ(),o.jsxs(o.Fragment,{children:[o.jsx(BD,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(py,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":y1(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(KQ,{titleId:l.titleId}),o.jsx(YQ,{contentRef:c,descriptionId:l.descriptionId})]})]})}),g1="DialogTitle",iF=D.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ei(g1,r);return o.jsx(Er.h2,{id:s.titleId,...n,ref:t})});iF.displayName=g1;var oF="DialogDescription",lF=D.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ei(oF,r);return o.jsx(Er.p,{id:s.descriptionId,...n,ref:t})});lF.displayName=oF;var cF="DialogClose",dF=D.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ei(cF,r);return o.jsx(Er.button,{type:"button",...n,ref:t,onClick:Tr(e.onClick,()=>s.onOpenChange(!1))})});dF.displayName=cF;function y1(e){return e?"open":"closed"}var uF="DialogTitleWarning",[Mae,pF]=S8(uF,{contentName:oc,titleName:g1,docsSlug:"dialog"}),KQ=({titleId:e})=>{const t=pF(uF),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
306
307If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
308
309For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return D.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},QQ="DialogDescriptionWarning",YQ=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pF(QQ).contentName}}.`;return D.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},JQ=ZD,ZQ=eF,XQ=rF,hF=nF,fF=sF,mF=iF,gF=lF,eY=dF;const tY=JQ,rY=ZQ,nY=XQ,yF=D.forwardRef(({className:e,...t},r)=>o.jsx(hF,{className:Sn("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));yF.displayName=hF.displayName;const sY=gy("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),vF=D.forwardRef(({side:e="right",className:t,children:r,...n},s)=>o.jsxs(nY,{children:[o.jsx(yF,{}),o.jsxs(fF,{ref:s,className:Sn(sY({side:e}),t),...n,children:[r,o.jsxs(eY,{className:"absolute right-4 top-4 roun
309ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(Y0,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vF.displayName=fF.displayName;const aY=D.forwardRef(({className:e,...t},r)=>o.jsx(mF,{ref:r,className:Sn("text-lg font-semibold text-foreground",e),...t}));aY.displayName=mF.displayName;const iY=D.forwardRef(({className:e,...t},r)=>o.jsx(gF,{ref:r,className:Sn("text-sm text-muted-foreground",e),...t}));iY.displayName=gF.displayName;const Ss={product:{en:"Product","pt-BR":"Produto"},pricing:{en:"Pricing","pt-BR":"Preços"},integrations:{en:"Integrations","pt-BR":"Integrações"},company:{en:"Company","pt-BR":"Empresa"},theJournal:{en:"The Journal","pt-BR":"O Jornal"},logIn:{en:"Log in","pt-BR":"Entrar"},signUp:{en:"Sign up","pt-BR":"Cadastrar"},requestDemo:{en:"Request a Demo","pt-BR":"Solicitar Demo"},startFreeTrial:{en:"Start free trial","pt-BR":"Iniciar teste grátis"}
309,contactUs:{en:"Contact Us","pt-BR":"Fale Conosco"},contactSales:{en:"Contact Sales","pt-BR":"Fale com Vendas"},learnMore:{en:"Learn More","pt-BR":"Saiba Mais"},viewAll:{en:"View All","pt-BR":"Ver Tudo"},getStarted:{en:"Get started","pt-BR":"Começar"},readMore:{en:"Read more","pt-BR":"Leia mais"},subscribe:{en:"Subscribe","pt-BR":"Inscrever-se"},subscribing:{en:"Subscribing...","pt-BR":"Inscrevendo..."},signUpNow:{en:"Sign Up Now","pt-BR":"Cadastre-se Agora"},getYourQuote:{en:"Get Your Quote","pt-BR":"Solicite Sua Cotação"}},Hr={pricing:{en:"Pricing","pt-BR":"Preços"},heading:{en:"Flat Fees. Full Transparency.","pt-BR":"Taxas Fixas. Total Transparência."},subheading:{en:"Simple pricing that scales with your collection. No hidden costs.","pt-BR":"Preços simples que acompanham sua coleção. Sem custos ocultos."},platform:{en:"Platform","pt-BR":"Plataforma"},appraisals:{en:"Appraisals","pt-BR":"Avaliações"},individual:{en:"Individual","pt-BR":"Individual"},personalPlan:{en:"Personal Plan","pt-BR":"Plano Pessoal"},personalPlanDesc:{en:"For Art Owners or Service Providers","pt-BR":"Para Proprietários de Arte ou Prestadores de Serviço."},seatMo:{en:"/seat/mo","pt-BR":"/assento/mês"},teams:{en:"Teams","pt-BR":"Equipes"},teamPackage:{en:"Team Package","pt-BR":"Pacote Equipe"},teamPackageDesc:{en:"Flexibility and scale from day one","pt-BR":"Flexibilidade e escala desde o primeiro dia."},moSeats:{en:"/mo · 5 seats","pt-BR":"/mês · 5 assentos"},bestValue:{en:"Best value","pt-BR":"Melhor valor"},features:{en:["Unlimited data storage","Unlimited Organizations & Workspaces","Unlimited sharing and access","Full platform features"],"pt-BR":["Armazenamento ilimitado","Organizações e Espaços ilimitados","Compartilhamento e acesso ilimitados","Todos os recursos da plataforma"]},addSeats:{en:"Add additional seats anytime","pt-BR":"Adicione assentos adicionais a qualquer momento"},seatTeamMgmt:{en:"Seat & team management","pt-BR":"Gestão de assentos e equipe"},noCreditCard:{en:"No credit card required · 30-day free trial on all plans","pt-BR":"Sem necessidade de cartão · Teste grátis de 30 dias em todos os planos"},everyAppraisalIncludes:{en:"Every appraisal includes","pt-BR":"Cada avaliação inclui"},fmv:{en:"Fair Market Value","pt-BR":"Valor Justo de Mercado"},fmvDesc:{en:"Tax & Estate, Donation, Equitable Distribution.","pt-BR":"Fiscal e Patrimonial, Doação, Distribuição Equitativa."},rrv:{en:"Retail Replacement Value","pt-BR":"Valor de Reposição"},rrvDesc:{en:"Insurance purposes.","pt-BR":"Para fins de seguro."},unlimitedReports:{en:"Unlimited Reports","pt-BR":"Relatórios Ilimitados"},unlimitedReportsDesc:{en:"Generate on demand, anytime.","pt-BR":"Gere sob demanda, a qualquer momento."},volumePricing:{en:"Volume pricing","pt-BR":"Preços por volume"},artworks:{en:"artworks","pt-BR":"obras"},perArtwork:{en:"/artwork","pt-BR":"/obra"},enterpriseRates:{en:"Enterprise and bulk inventory rates available on request.","pt-BR":"Tarifas corporativas e de inventário em massa disponíveis sob consulta."}},oY={heroHeading:{en:"A Structured, Living Artwork Record.","pt-BR":"Um Registro de Obra Estruturado e Vivo."},heroSubheading:{en:"A living system of record for collections and independent, defensible valuations.","pt-BR":"Um sistema de registro vivo para coleções e avaliações independentes e defensáveis."},structuredRecord:{en:"One Platform for Complete Collection Oversight.","pt-BR":"Uma Plataforma para Supervisão Completa da Coleção."},structuredRecordDesc:{en:"Built for structure, transparency, and control.","pt-BR":"Construído para estrutura, transparência e controle."},eachRecordIs:{en:"","pt-BR":""},recordFeatures:{en:["Centralized, secure data sharing across teams, geographies and stakeholders","Version-controlled valuations with complete audit history","Role-based permissions for legal, finance, and curatorial teams","Insurance-ready schedules generated in real time","Exportable, compliance-ready reporting"],"pt-BR":["Supervisão centralizada entre equipes e geografias","Avaliações controladas por versão com histórico completo de auditoria","Permissões baseadas em função para equipes jurídicas, financeiras e curatoriais","Cronogramas prontos para seguros gerados em tempo real","Relatórios exportáveis e prontos para conformidade"]},valuationsForEveryPurpose:{en:"Supporting the full lifecycle of art ownership","pt-BR":"Apoiando o ciclo completo da posse de arte."},valuationsForEveryPurposeDesc:{en:"Purpose-specific appraisal reports, compliant and delivered on demand.","pt-BR":"Relatórios de avaliação específicos, em conformidade e entregues sob demanda."},insurance:{en:"Insurance","pt-BR":"Seguro"},insuranceDesc:{en:"Retail Replacement Value for accurate coverage and streamlined claims.","pt-BR":"Valor de Reposição para cobertura precisa e sinistros simplificados."},taxEstate:{en:"Tax & Estate","pt-BR":"Fiscal e Patrimonial"},taxEstateDesc:{en:"IRS-qualified Fair Market Value for estate planning and tax reporting.","pt-BR":"Valor Justo de Mercado qualificado pelo IRS para planejamento patrimonial e declaração fiscal."}
309,charitableDonation:{en:"Charitable Donation","pt-BR":"Doação Beneficente"},charitableDonationDesc:{en:"IRS-compliant valuations for tax deductions on donated artwork.","pt-BR":"Avaliações em conformidade com o IRS para deduções fiscais de obras doadas."},loanCollateral:{en:"Loan Collateral","pt-BR":"Garantia de Empréstimo"},loanCollateralDesc:{en:"Defensible valuations for art-secured lending and portfolio management.","pt-BR":"Avaliações defensáveis para empréstimos garantidos por arte e gestão de portfólio."},institutionalUse:{en:"Valuations Built for Institutional Use","pt-BR":"Avaliações Construídas para Uso Institucional"},institutionalUseDesc:{en:"Appraisal Bureau provides independent, institutionally defensible valuations embedded within a structured artwork record.","pt-BR":"Appraisal Bureau fornece avaliações independentes e institucionalmente defensáveis integradas em um registro estruturado de obras."},valuationNotStandalone:{en:`Valuation is not a standalone document.
310It is part of durable stewardship infrastructure.`,"pt-BR":`A avaliação não é um documento isolado.
311Faz parte de uma infraestrutura durável de gestão.`},ourFramework:{en:"Our framework","pt-BR":"Nossa estrutura"},frameworkItems:{en:["Structurally separates valuation from advisory and transactional conflicts","Anchors each report within a permanent, version-controlled system","Enables audit and reporting at any time","Withstands scrutiny from insurers, lenders, and regulators"],"pt-BR":["Separa estruturalmente a avaliação de conflitos consultivos e transacionais","Ancora cada relatório em um sistema permanente e controlado por versão","Permite auditoria e relatórios a qualquer momento","Resiste ao escrutínio de seguradoras, credores e reguladores"]},howItWorks:{en:"How it works","pt-BR":"Como funciona"},steps:{en:[{title:"Set up your account",desc:"Create an organization for teams and workspaces for different collections, clients, or projects. Art owners upload artworks and manage inventory with comprehensive tracking and documentation."},{title:"Subscribe artworks to valuations",desc:"Set up appraisal subscriptions on a per-artwork basis. Choose your preferred frequency for valuation updates to keep track of changing market values."},{title:"Generate appraisal reports",desc:"Create USPAP-compliant appraisal reports instantly on demand. Each report comes with a unique ID for tracking purposes and can be easily shared with service providers."},{title:"Share access to service providers",desc:"Securely share collection access with insurers, wealth advisors, tax advisors, and other service providers. Control permission levels to ensure each provider only sees what they need."}],"pt-BR":[{title:"Configure sua conta",desc:"Crie uma organização para equipes e espaços de trabalho para diferentes coleções, clientes ou projetos. Proprietários de arte fazem upload de obras e gerenciam o inventário com rastreamento e documentação abrangentes."},{title:"Inscreva obras em avaliações",desc:"Configure assinaturas de avaliação por obra. Escolha a frequência preferida para atualizações de avaliação e acompanhe as mudanças nos valores de mercado."},{title:"Gere relatórios de avaliação",desc:"Crie relatórios de avaliação compatíveis com USPAP instantaneamente sob demanda. Cada relatório vem com um ID único para rastreamento e pode ser facilmente compartilhado com prestadores de serviço."},{title:"Compartilhe acesso com prestadores",desc:"Compartilhe acesso à coleção de forma segura com seguradoras, consultores de patrimônio, consultores fiscais e outros prestadores de serviço. Controle os níveis de permissão para garantir que cada prestador veja apenas o necessário."}]},readyToGetStarted:{en:"Ready to Get Started?","pt-BR":"Pronto para Começar?"},signUpOrDemo:{en:"Sign up or request a personalized demo","pt-BR":"Cadastre-se ou solicite uma demonstração personalizada"}},lY={heroHeading:{en:"Love your collection—manage it like an asset.","pt-BR":"Ame sua coleção—gerencie-a como um ativo."},missionP1:{en:"Appraisal Bureau is building the valuation infrastru
311cture powering the global art market across insurance, estate planning, lending, donations, and financial reporting. As a neutral third party independent from the buying and selling of art, we leverage technology and institutional expertise to deliver scalable, data-driven valuation solutions for collectors, institutions, and financial stakeholders.","pt-BR":"Appraisal Bureau is building the valuation infrastructure powering the global art market across insurance, estate planning, lending, donations, and financial reporting. As a neutral third party independent from the buying and selling of art, we leverage technology and institutional expertise to deliver scalable, data-driven valuation solutions for collectors, institutions, and financial stakeholders."},missionP2:{en:"Where industries like real estate, legal, and finance have embraced integrated software, the art world remains largely untouched. Appraisal Bureau is changing that—offering a platform customizable for every client, ensuring collections are professionally managed, properly insured, and always valued with confidence.","pt-BR":"Enquanto setores como imobiliário, jurídico e financeiro adotaram software integrado, o mundo da arte permanece praticamente intocado. Appraisal Bureau está mudando isso—oferecendo uma plataforma personalizável para cada cliente, garantindo que as coleções sejam gerenciadas profissionalmente, devidamente seguradas e sempre avaliadas com confiança."},ourLeadership:{en:"Our Leadership","pt-BR":"Nossa Liderança"}}
311,ui={contactUs:{en:"Contact Us","pt-BR":"Fale Conosco"},visitSupport:{en:"Visit our","pt-BR":"Visite nosso"},supportCenter:{en:"Support Center","pt-BR":"Centro de Suporte"},forHelpOrContact:{en:"for help or contact us below.","pt-BR":"para ajuda ou entre em contato abaixo."},sendUsMessage:{en:"Send Us a Message","pt-BR":"Envie-nos uma Mensagem"},email:{en:"Email","pt-BR":"E-mail"},general:{en:"General:","pt-BR":"Geral:"},support:{en:"Support:","pt-BR":"Suporte:"},address:{en:"Address","pt-BR":"Endereço"},phone:{en:"Phone","pt-BR":"Telefone"}},Pi={title:{en:"Security & Trust","pt-BR":"Segurança e Confiança"},securityAt:{en:"Security at Appraisal Bureau","pt-BR":"Segurança no Appraisal Bureau"},securityDesc:{en:"Appraisal Bureau is built with a security-first architecture designed to protect sensitive financial, valuation, and client data. Our platform is supported by a continuously monitored security program aligned with SOC 2 standards.","pt-BR":"Appraisal Bureau é construído com uma arquitetura de segurança em primeiro lugar, projetada para proteger dados financeiros, de avaliação e de clientes sensíveis. Nossa plataforma é suportada por um programa de segurança monitorado continuamente, alinhado com os padrões SOC 2."},infrastructure:{en:"Infrastructure Security","pt-BR":"Segurança de Infraestrutura"},accessControl:{en:"Access Control","pt-BR":"Controle de Acesso"},personnel:{en:"Personnel Management","pt-BR":"Gestão de Pessoal"},monitoring:{en:"Monitoring & Auditability","pt-BR":"Monitoramento e Auditabilidade"},devSecurity:{en:"Development Security","pt-BR":"Segurança de Desenvolvimento"},compliance:{en:"Compliance","pt-BR":"Conformidade"}},_F="/assets/ab-icon-CvGp3CZ1.svg",on=()=>{const e=rl(),[t,r]=D.useState(!1),{language:n,setLanguage:s,isBrazil:a,t:i}=gc(),l=[{to:"/product",label:i(Ss.product)},{to:"/pricing",label:i(Ss.pricing)},{to:"/integrations",label:i(Ss.integrations)},{to:"/company",label:i(Ss.company)},{to:"/thejournal",label:i(Ss.theJournal)}];return o.jsx("nav",{className:"sticky top-0 w-full z-50 font-jakarta bg-white border-b border-gray-100",children:o.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"flex justify-between items-center",style:{height:68},children:[o.jsxs("div",{className:"flex items-center gap-10",children:[o.jsx(Ut,{to:"/",className:"hover:opacity-85 transition-opacity flex items-center","aria-label":"Appraisal Bureau home",children:o.jsx("img",{src:_F,alt:"Appraisal Bureau",className:"h-9 w-9"})}),o.jsx("div",{className:"hidden md:flex items-center gap-8",children:l.map(c=>o.jsx(Ut,{to:c.to,className:`text-sm font-light transition-colors ${e.pathname===c.to?"text-[#220E99]":"text-black hover:text-[#220E99]"}`,children:c.label},c.to))})]}),o.jsxs("div",{className:"hidden md:flex items-center gap-6",children:[o.jsx("a",{href:"https://app.appraisalbureau.com",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-light text-black hover:text-gray-600 transition-colors",children:i(Ss.logIn)}),o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"rounded-full bg-black text-white hover:bg-black/85 h-9 px-5 text-sm font-light",children:i(Ss.signUp)})}),a&&o.jsxs("div",{className:"flex items-center bg-gray-100 rounded-full p-0.5",children:[o.jsx("button",{onClick:()=>s("en"),className:`px-2.5 py-1 rounded-full text-xs font-semibold transition-all ${n==="en"?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:"EN"}),o.jsx("button",{onClick:()=>s("pt-BR"),className:`px-2.5 py-1 rounded-full text-xs font-semibold transition-all ${n==="pt-BR"?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:"PT"})]})]}),o.jsxs("div",{className:"md:hidden flex items-center gap-2",children:[a&&o.jsxs("div",{className:"flex items-center bg-gray-100 rounded-full p-0.5",children:[o.jsx("button",{onClick:()=>s("en"),className:`px-2 py-1 rounded-full text-xs font-semibold transition-all ${n==="en"?"bg-white text-gray-900 shadow-sm":"text-gray-500"}`,children:"EN"}),o.jsx("button",{onClick:()=>s("pt-BR"),className:`px-2 py-1 rounded-full text-xs font-semibold transition-all ${n==="pt-BR"?"bg-white text-gray-900 shadow-sm":"text-gray-500"}`,children:"PT"})]}),o.jsxs(tY,{open:t,onOpenChange:r,children:[o.jsx(rY,{asChild:!0,children:o.jsxs(rr,{variant:"ghost",size:"sm",className:"p-1",children:[o.jsx(wW,{className:"h-6 w-6"}),o.jsx("span",{className:"sr-only",children:"Open menu"})]})}),o.jsx(vF,{side:"right",className:"w-[80%] sm:w-[385px] pt-12",children:o.jsxs("div",{className:"flex flex-col gap-6 px-2",children:[l.map(c=>o.jsx(Ut,{to:c.to,className:`${e.pathname===c.to?"text-[#220E99]":"text-black"} text-lg font-light hover:text-[#220E99] transition-colors`,onClick:()=>r(!1),children:c.label},c.to)),o.jsx(rr,{className:"w-full rounded-full mt-4 bg-brand-red hover:bg-brand-red/90 text-white",asChild:!0,children:o.jsx("a",{href:"https://app.appraisalbureau.com",target:"_blank",rel:"noopener noreferrer",onClick:()=>r(!1),children:i(Ss.logIn)})})]})})]})]})]})})})},fa=D.forwardRef(({className:e,type:t,...r},n)=>o.jsx("input",{type:t,className:Sn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));fa.displayName="Input";function cY(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var v1="Checkbox",[dY,Eae]=ru(v1),[uY,pY]=dY(v1),wF=D.forwardRef((e,t)=>
311{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:d,form:p,...u}=e,[h,f]=D.useState(null),m=Hn(t,w=>f(w)),v=D.useRef(!1),k=h?p||!!h.closest("form"):!0,[y=!1,g]=nu({prop:s,defaultProp:a,onChange:d}),_=D.useRef(y);return D.useEffect(()=>{const w=h==null?void 0:h.form;if(w){const x=()=>g(_.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[h,g]),o.jsxs(uY,{scope:r,state:y,disabled:l,children:[o.jsx(Er.button,{type:"button",role:"checkbox","aria-checked":Wo(y)?"mixed":y,"aria-required":i,"data-state":kF(y),"data-disabled":l?"":void 0,disabled:l,value:c,...u,ref:m,onKeyDown:Tr(e.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:Tr(e.onClick,w=>{g(x=>Wo(x)?!0:!x),k&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})}),k&&o.jsx(hY,{control:h,bubbles:!v.current,name:n,value:c,checked:y,required:i,disabled:l,form:p,style:{transform:"translateX(-100%)"},defaultChecked:Wo(a)?!1:a})]})});wF.displayName=v1;var xF="CheckboxIndicator",bF=D.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,a=pY(xF,r);return o.jsx(el,{present:n||Wo(a.state)||a.state===!0,children:o.jsx(Er.span,{"data-state":kF(a.state),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});bF.displayName=xF;var hY=e=>{const{control:t,checked:r,bubbles:n=!0,defaultChecked:s,...a}=e,i=D.useRef(null),l=cY(r),c=OR(t);D.useEffect(()=>{const p=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(l!==r&&f){const m=new Event("click",{bubbles:n});p.indeterminate=Wo(r),f.call(p,Wo(r)?!1:r),p.dispatchEvent(m)}},[l,r,n]);const d=D.useRef(Wo(r)?!1:r);return o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??d.current,...a,tabIndex:-1,ref:i,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Wo(e){return e==="indeterminate"}function kF(e){return Wo(e)?"indeterminate":e?"checked":"unchecked"}var TF=wF,fY=bF;const MF=D.forwardRef(({className:e,...t},r)=>o.jsx(TF,{ref:r,className:Sn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(fY,{className:Sn("flex items-center justify-center text-current"),children:o.jsx(rb,{className:"h-4 w-4"})})}));MF.displayName=TF.displayName;var mY="Label",EF=D.forwardRef((e,t)=>o.jsx(Er.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));EF.displayName=mY;var SF=EF;const gY=gy("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),vi=D.forwardRef(({className:e,...t},r)=>o.jsx(SF,{ref:r,className:Sn(gY(),e),...t}));vi.displayName=SF.displayName;const yY=async(e,t,r,n)=>{if(!e||!t||!r)return{success:!1,message:"Missing required parameters"};try{const a={fields:[{name:"email",value:e}],context:{pageUri:window.location.href,pageName:document.title}};n&&(a.legalConsentOptions={consent:{consentToProcess:!0,text:"I agree to receive marketing emails from Appraisal Bureau.",communications:[{value:!0,subscriptionTypeId:parseInt(n),text:"I agree to receive newsletter emails."}]}});const i=await fetch(`https://api.hsforms.com/submissions/v3/integration/submit/${t}/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),l=await i.json();return i.ok?{success:!0,message:"Thank you for subscribing!"}:(console.error("HubSpot error:",l),{success:!1,message:l.message||"Failed to subscribe. Please try again."})}catch(s){return console.error("Error submitting to HubSpot:",s),{success:!1,message:"An error occurred. Please try again later."}}},vY="22431995",_Y="9703b052-c1a7-4a89-986a-282f6ef4bf4d",wY="17",yn=()=>{const e=new Date().getFullYear(),[t,r]=D.useState(""),[n,s]=D.useState(!1),[a,i]=D.useState(!1),l=async p=>{if(p.preventDefault(),!t){ha.error("Please enter your email address");return}if(!n){ha.error("Please agree to the privacy policy");return}i(!0);try{const u=await yY(t,vY,_Y,wY);u.success?(ha.success(u.message),r(""),s(!1)):ha.error(u.message)}catch{ha.error("Failed to subscribe. Please try again later.")}finally{i(!1)}},c="text-gray-700 hover:text-[#220E99] transition-colors text-sm font-light",d="text-[11px] uppercase tracking-[0.22em] text-ab-ink font-semibold mb-6";return o.jsx("footer",{className:"bg-white border-t border-gray-200 pt-20 pb-10 font-jakarta",children:o.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-12 gap-10 md:gap-8",children:[o.jsxs("div",{className:"col-span-2 md:col-span-4",children:[o.jsx(Ut,{to:"/",className:"inline-block mb-6",children:o.jsx("img",{src:"/lovable-uploads/e27b1efc-5035-4
311135-947c-b4b733a3d8ff.png",alt:"Appraisal Bureau",className:"h-8",style:{backgroundColor:"transparent"}})}),o.jsx("p",{className:"text-gray-600 text-sm font-light max-w-xs leading-relaxed",children:"The infrastructure for art collection stewardship."}),o.jsxs("div",{className:"flex items-center space-x-5 mt-8",children:[o.jsx("a",{href:"https://twitter.com/appraisalbureau",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-ab-ink transition-colors","aria-label":"X (Twitter)",children:o.jsx("svg",{className:"h-[16px] w-[16px]",fill:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),o.jsx("a",{href:"https://www.linkedin.com/company/appraisal-bureau-inc",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-ab-ink transition-colors","aria-label":"LinkedIn",children:o.jsx("svg",{className:"h-[16px] w-[16px]",fill:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{d:"M20.5 2h-17A1.5 1.5 0 002 3.5v17A1.5 1.5 0 003.5 22h17a1.5 1.5 0 001.5-1.5v-17A1.5 1.5 0 0020.5 2zM8 19H5v-9h3zM6.5 8.25A1.75 1.75 0 118.3 6.5a1.78 1.78 0 01-1.8 1.75zM19 19h-3v-4.74c0-1.42-.6-1.93-1.38-1.93A1.74 1.74 0 0013 14.19a.66.66 0 000 .14V19h-3v-9h2.9v1.3a3.11 3.11 0 012.7-1.4c1.55 0 3.36.86 3.36 3.66z"})})}),o.jsx("a",{href:"https://www.instagram.com/appraisalbureau",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-ab-ink transition-colors","aria-label":"Instagram",children:o.jsx("svg",{className:"h-[16px] w-[16px]",fill:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})})})]})]}),o.jsxs("div",{className:"col-span-1 md:col-span-2",children:[o.jsx("h3",{className:d,children:"Product"}),o.jsxs("ul",{className:"space-y-3.5",children:[o.jsx("li",{children:o.jsx(Ut,{to:"/product",className:c,children:"Overview"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/pricing",className:c,children:"Pricing"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/release-notes",className:c,children:"Changelog"})})]})]}),o.jsxs("div",{className:"col-span-1 md:col-span-2",children:[o.jsx("h3",{className:d,children:"Company"}),o.jsxs("ul",{className:"space-y-3.5",children:[o.jsx("li",{children:o.jsx(Ut,{to:"/company",className:c,children:"Company"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/thejournal",className:c,children:"The Journal"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/careers",className:c,children:"Careers"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/contact",className:c,children:"Contact"})})]})]}),o.jsxs("div",{className:"col-span-1 md:col-span-2",children:[o.jsx("h3",{className:d,children:"Resources"}),o.jsxs("ul",{className:"space-y-3.5",children:[o.jsx("li",{children:o.jsx(Ut,{to:"/support",className:c,children:"Support"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/integrations",className:c,children:"Integrations"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/integrations/claude",className:c,children:"Claude connector"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/integrations/addepar",className:c,children:"Addepar integration"})})]})]}),o.jsxs("div",{className:"col-span-1 md:col-span-2",children:[o.jsx("h3",{className:d,children:"Legal"}),o.jsxs("ul",{className:"space-y-3.5",children:[o.jsx("li",{children:o.jsx(Ut,{to:"/privacy-policy",className:c,children:"Privacy"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/terms-of-service",className:c,children:"Terms"})}),o.jsx("li",{children:o.jsx(Ut,{to:"/security",className:c,children:"Security"})})]})]})]}),o.jsx("div",{className:"mt-20 flex justify-end",children:o.jsxs("form",{onSubmit:l,className:"w-full max-w-sm",children:[o.jsx("h3",{className:d,children:"Newsletter"}),o.jsx("p",{className:"text-gray-600 text-sm font-light mb-4",children:"Curated art market insights, delivered occasionally."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fa,{type:"email",placeholder:"Your email",value:t,onChange:p=>r(p.target.value),disabled:a,className:"h-10 rounded-full border-gray-300 bg-white text-sm font-jakarta focus-visible:ring-0 focus:border-[#220E99]"}),o.jsx(rr,{type:"submit",disabled:a,className:"h-10 rounded-full bg-[#220E99] hover:bg-[#220E99]/90 text-white text-sm font-medium px-5 font-jakarta",children:a?"…":"Subscribe"})]}),o.jsxs("div",{className:"flex items-start gap-2 mt-3",children:[o.jsx(MF,{id:"footer-privacy",checked:n,onCheckedChange:p=>
311s(p),disabled:a,className:"mt-0.5 h-4 w-4 rounded border-gray-300 data-[state=checked]:bg-[#220E99] data-[state=checked]:border-[#220E99]"}),o.jsxs(vi,{htmlFor:"footer-privacy",className:"text-xs text-gray-600 font-light font-jakarta cursor-pointer leading-relaxed",children:["I agree to the"," ",o.jsx(Ut,{to:"/privacy-policy",className:"text-[#220E99] hover:underline",children:"Privacy Policy"}),"."]})]})]})}),o.jsxs("div",{className:"mt-20 pt-8 border-t border-gray-200 flex flex-col sm:flex-row justify-between items-center gap-4",children:[o.jsxs("p",{className:"text-gray-500 text-sm font-light",children:["© ",e," Appraisal Bureau. All rights reserved."]}),o.jsx("p",{className:"text-gray-400 text-sm font-light tracking-wide",children:"v2.0"})]})]})})},xY="/lovable-uploads/9ef3da7c-1084-4042-b68d-c61f7120d548.png",bY="Appraisal Bureau makes art collection management effortless",kY="Appraisal Bureau - Universal Art Dashboard",TY="@lovable_dev",Fn=({title:e="Appraisal Bureau - Universal Art Dashboard",description:t=bY,canonical:r="",image:n=xY,type:s="website",keywords:a=["art collection","appraisal","valuation","art management","fine art insurance"]})=>{const i="https://appraisalbureau.com",l=r?`${i}${r}`:i,c=n.startsWith("http")?n:`${i}${n}`;return o.jsxs(Sd,{children:[o.jsx("title",{children:e}),o.jsx("meta",{name:"description",content:t}),o.jsx("link",{rel:"canonical",href:l}),o.jsx("meta",{name:"keywords",content:a.join(", ")}),o.jsx("meta",{property:"og:url",content:l}),o.jsx("meta",{property:"og:title",content:e}),o.jsx("meta",{property:"og:description",content:t}),o.jsx("meta",{property:"og:image",content:c}),o.jsx("meta",{property:"og:image:alt",content:e}),o.jsx("meta",{property:"og:site_name",content:kY}),o.jsx("meta",{property:"og:type",content:s}),o.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),o.jsx("meta",{name:"twitter:site",content:TY}),o.jsx("meta",{name:"twitter:title",content:e}),o.jsx("meta",{name:"twitter:description",content:t}),o.jsx("meta",{name:"twitter:image",content:c}),o.jsx("meta",{name:"robots",content:"index, follow"})]})},Fp=[{id:"39",title:"The Studio Left Behind: Artists' Estates, Foundations, and the Value of Getting the Value Right",titleHtml:"The Studio Left Behind: Artists' Estates, Foundations, and the Value of <em>Getting the Value Right</em>",excerpt:"Most of the wealth held by artist-endowed foundations is art. Why the financial side of an artist's estate is unlike any other — and why the appraisal sits at the center of it.",date:"2026-09-22",category:"Museums & Philanthropy",slug:"artists-estates-foundations-valuation",image:"/lovable-uploads/lichtenstein-studio.avif",tags:["Estate Planning","Valuations","Philanthropy"],type:"editorial",editionLabel:"Appraisal Bureau News — Ed. 38"},{id:"38",title:"The €1.1 Million Pot of Gold at the End of A Double Rainbow",titleHtml:"The €1.1 Million Pot of Gold at the End of <em>A Double Rainbow</em>",excerpt:"What initially appeared to be a dramatic decline in the value of the Central Bank of Ireland's art collection turned out to be an administrative oversight in its inventory reporting.",date:"2026-08-24",category:"Industry Insights",slug:"double-rainbow-central-bank-valuation",image:"/__l5e/assets-v1/325f8a8a-1604-4f38-9113-fd3898f28b18/double-rainbow-sculpture.jpg",tags:["Valuations","Insurance","Wealth Management","Addepar"],type:"editorial",editionLabel:"Appraisal Bureau News — Ed. 36"},{id:"37",title:"Appraisal Bureau x The Campus: Building a Stronger Art Ecosystem",excerpt:"Appraisal Bureau is proud to partner with and sponsor The Campus, one of the contemporary art world's most ambitious collaborative initiatives — opening this weekend in New York's Hudson Valley.",date:"2026-06-22",category:"Museums & Philanthropy",slug:"appraisal-bureau-the-campus-partnership",image:"/__l5e/assets-v1/ed52d719-69d4-4ed2-9e74-a2d1ab8c4bd1/the-campus-exterior.png",tags:["Partnerships","Exhibitions","Galleries"],type:"editorial",editionLabel:"Appraisal Bureau News — Ed. 35"},{id:"36",title:"Why Responsible AI Adoption Led Us to Testudo",excerpt:"Appraisal Bureau has secured specialized generative AI insurance coverage through Testudo, a Lloyd's of London-backed insurer focused on the risks of AI systems — a milestone in how 
311we approach responsible AI adoption.",date:"2026-06-04",category:"Industry Insights",slug:"responsible-ai-adoption-testudo",image:"/lovable-uploads/testudo-ai-insurance-v2.jpg",tags:["AI","Technology","Industry News"],type:"editorial",editionLabel:"Appraisal Bureau News — Ed. 34"},{id:"35",title:"Neutrality Is the Whole Point",excerpt:"What U.S. tax law and USPAP actually require of an independent appraiser — and why an appraisal is only as valuable as the impartiality behind it.",date:"2026-05-20",category:"Appraisal Standards",slug:"neutrality-is-the-whole-point",image:"/lovable-uploads/neutrality-balance-scale.jpg",tags:["Compliance","USPAP","Industry News"],type:"editorial",editionLabel:"Appraisal Bureau — Practice Note"},{id:"34",title:"Art on the Balance Sheet: A New Integration with Addepar",excerpt:"Appraisal Bureau is now a technology partner of Addepar, the wealth management platform used by leading RIAs, multi-family offices, and private banks. An integration between the two platforms is in development.",date:"2026-04-22",category:"Product & Integrations",slug:"art-on-the-balance-sheet-addepar-integration",image:"/lovable-uploads/addepar-integration-hero.jpg",tags:["Technology","Integrations","Wealth Management"],type:"editorial",editionLabel:"Appraisal Bureau Editorial"},{id:"33",title:"Defying Category: Harmony Korine at ICA Miami",excerpt:"Harmony Korine: Perfect Nonsense, the first major US museum survey dedicated to the artist, opens today at ICA Miami — spanning over 50 works across painting, film, photography, collage, and digital environments.",date:"2026-04-15",category:"Museums & Philanthropy",slug:"defying-category-harmony-korine-ica-miami",image:"/lovable-uploads/korine-portrait-cropped.jpg",tags:["Museums","Exhibitions","AI"],type:"editorial",editionLabel:"Appraisal Bureau News — Ed. 33"},{id:"32",title:"Harmony Korine: From VHS to AI — How the Filmmaker-Turned-Artist Has Made Technology Itself a Medium",excerpt:"Appraisal Bureau is proud to sponsor Harmony Korine: Perfect Nonsense, opening April 15 at ICA Miami — the artist's first major U.S. museum survey spanning over fifty works across three decades of restless invention.",date:"2026-04-08",category:"Museums & Philanthropy",slug:"harmony-korine-from-vhs-to-ai",image:"/lovable-uploads/korine-ica-miami.avif",tags:["Museums","Exhibitions","AI"],type:"editorial",editionLabel:"Appraisal Bureau Editorial"},{id:"30",title:"Inside The Art Basel & UBS Art Market Report 2026: Here's What Matters",excerpt:"Artificial intelligence is identified as a broader driver of global economic growth, but within the art market its impact remains largely infrastructural — improving how data is organized and applied rather than reshaping transactions.",date:"2026-03-18",category:"Industry Insights",slug:"inside-the-art-basel-ubs-art-market-report-2026",image:"/lovable-uploads/art-basel-ubs-2026.png",tags:["AI","Technology","Art Market","Valuations"],type:"editorial",editionLabel:"Appraisal Bureau News"},{id:"31",title:"What the New USPAP Guidance on AI Means for Appraisers",excerpt:"The Appraisal Standards Board's Second Exposure Draft of Advisory Opinion 41 (AO-41) marks an important moment for the valuation industry, directly addressing how appraisers can use AI within assignments.",date:"2026-03-25",category:"Industry Insights",slug:"uspap-ao-41-ai-guidance-appraisers",image:"/lovable-uploads/uspap-ao41-hero.jpg",tags:["Compliance","Industry News"],type:"editorial",editionLabel:"Appraisal Bureau News"},{id:"29",title:"Brazil's Art Market: European Influence, Institutional Identity, and Contemporary Momentum",excerpt:"Brazil's art history is inseparable from Europe — yet distinctly its own. From the colonial period through modernism and into today's contemporary market, Brazilian artists have navigated a persistent dialogue between European influence and local identity.",date:"2026-03-01",category:"Industry Insights",slug:"brazil-art-market-european-influence",image:"/lovable-uploads/lygia-clark-composicao.jpg",tags:["Art Market","Brazil","Valuations"],type:"editorial",editionLabel:"Ap
311praisal Bureau Editorial"},{id:"28",title:"Time Well Spent — The Julia Stoschek Collection Brings Video Art into Focus in Los Angeles",excerpt:"On the evolving significance and quiet power of video art. The arrival of the Julia Stoschek Collection in Los Angeles marks a meaningful expansion of the city's engagement with time-based media.",date:"2026-02-27",category:"Industry Insights",slug:"time-well-spent-julia-stoschek-collection-los-angeles",image:"/lovable-uploads/julia-stoschek-la.webp",tags:["Art Fairs","Frieze","Los Angeles","Video Art"],type:"editorial",editionLabel:"Appraisal Bureau Editorial"},{id:"27",title:"Beyond Data: Auction Results Tell Only Part of the Story",excerpt:"Unprecedented access to auction data has transformed the art market over the past three decades. Yet to treat auction results as the primary valuation tool is to misunderstand how most of the art market actually functions.",date:"2026-02-19",category:"Industry Insights",slug:"beyond-data-auction-results",image:"/lovable-uploads/josh-kline-productivity-gains.jpg",tags:["Art Market","Auctions","Valuations","Data"],type:"editorial"},{id:"26",title:"Sotheby's Adjusts Buyer's Premiums—Again. What It Signals for the Auction Market",excerpt:"Sotheby's has revised its buyer's premium structure globally, increasing the top-end of its lowest pricing tier from 27% to 28% on works hammering up to $2 million in New York.",date:"2026-02-18",category:"Industry Insights",slug:"sothebys-buyers-premium-2026",image:"/lovable-uploads/sothebys-new.jpg",tags:["Art Market","Auctions","Art Finance"],type:"article"},{id:"25",title:"Art Valuations in 2026, Five Predictions for the Year Ahead",excerpt:"As 2025 came to a close, much of the art market was left reflecting on a year that felt, for many, like a holding pattern. By contrast, 2026 is being met with renewed optimism.",date:"2026-01-20",category:"Industry Insights",slug:"art-valuations-2026-predictions",image:"/lovable-uploads/geometric-abstract-bg.jpg",tags:["Art Market","Technology","Valuations","Data"],type:"editorial"},{id:"24",title:"From Miami to Abu Dhabi, Fresh Access Redefines a Revived Market",excerpt:"This December is already a pivotal month for the art market, with Abu Dhabi and Miami emerging as focal points for dialogue around new waves of collecting and the infusion of fresh capital.",date:"2025-12-12",category:"Industry Insights",slug:"miami-abu-dhabi-market-2025",image:"/lovable-uploads/Sothebys-Collector-Week-Abu-Dhabi-1.webp",tags:["Art Market","Art Basel","Auctions"],type:"editorial"},{id:"23",title:"Art (Market) History, Single-Owner Sales Win Big",excerpt:"Single-owner collection sales delivered strong results this fall, with Leonard Lauder's collection at Sotheby's totaling $527.5 million.",date:"2025-11-24",category:"Industry Insights",slug:"art-market-history-single-owner-sales",image:"/lovable-uploads/klimt-elisabeth-lederer-full.jpg",objectPosition:"top",tags:["Art Market","Auctions","Estate Planning"],type:"editorial"},{id:"22",title:"Automating the Trillion-Dollar Shift in Art Wealth",excerpt:"Automation is redefining how art philanthropy works.",date:"2025-11-04",category:"Industry Insights",slug:"automating-trillion-dollar-shift-art-wealth",image:"/lovable-uploads/tech-circuit-arrows.jpg",tags:["Technology","Charitable Donation","Estate Planning","Data"],type:"article"},{id:"19",title:"Digital Art Finds Its Place in the Mainstream Market",excerpt:"Christie's decision to integrate digital art into broader operations reflects how seamlessly digital art has become part of the wider art ecosystem.",date:"2025-10-15",category:"Industry Insights",slug:"digital-art-mainstream-market",image:"/lovable-uploads/cryptopunk-5358.avif",tags:["Technology","NFT","Art Market"],type:"article"},{id:"21",title:"That Big Beautiful Tax Bill & Tech's Role in Fair Valuations",excerpt:"New tax policy changes starting in 2026 will reshape charitable art donations.",date:"2025-07-24",category:"Industry Insights",slug:"tax-bill-tech-fair-valuations",image:"/lovable-uploads/paper-stack-tax-bill.jpg",tags:["Charitable Donation","Estate Planning","Valuations"],type:"article"},{id:"3",title:"From 'If' to 'How'—Conversations about AI in the art market mature",excerpt:"The art market's conversation around AI is evolving from whether it belongs to how frameworks are being developed.",date:"2025-06-15",category:"Industry Insights",slug:"from-if-to-how-ai-art-market",image:"/lovable-uploads/circuit-board-pattern.jpg",tags:["AI","Technology","Data"],type:"article"},{id:"4",title:"A new era for art insurance as Marsh and Appraisal Bureau partner",excerpt:"Appraisal Bureau has partnered with Marsh, the global leader in fine art insurance.",date:"2025-05-20",category:"Industry Insights",slug:"marsh-appraisal-bureau-partnership",image:"/lovable-uploads/ai-circuit-board.jpg",tags:["Insurance","Valuations"],type:"article"},{id:"6",title:"A new book offers an approachable guide to AI in the art market",excerpt:"Author Jo Lawson-Tancred speaks about her new book, 'AI and the Art Market'.",date:"2025-05-10",category:"Industry Insights",slug:"ai-art-market-book",image:"/lovable-uploads/ai-in-the-art-market.avif",tags:["AI","Technology","Data"],type:"article",objectPosition:"center"},{id:"7",title:"Art and Technology: Christie's AI Summit, New York",excerpt:"Christie's New York held a summit delving into the practical and ethical impl
311ications of AI.",date:"2025-05-01",category:"Industry Insights",slug:"christies-ai-summit",image:"/lovable-uploads/christies-panel.jpg",tags:["AI","Technology","Valuations"],type:"article"},{id:"8",title:"Tell me more about donating art",excerpt:"Technical and regulatory requirements for donating art and tax deductions.",date:"2025-04-15",category:"Best Practices",slug:"donating-art-guide",image:"/lovable-uploads/museum-interior.jpg",tags:["Charitable Donation","Estate Planning"],type:"article"},{id:"9",title:"Navigating Value During an Art Market Recalibration",excerpt:"How do you value art during a cooling of the market?",date:"2025-04-01",category:"Industry Insights",slug:"art-market-recalibration",image:"/lovable-uploads/de-la-cruz.webp",tags:["Art Market","Valuations","Data"],type:"article"},{id:"10",title:"Securitization and Art-Backed Debt Offerings",excerpt:"Rebecca Fine speaks about the latest developments in the financialization of art.",date:"2025-03-15",category:"Industry Insights",slug:"art-backed-debt-securitization",image:"/lovable-uploads/art-vault.jpg",type:"article"},{id:"11",title:"Sotheby's Pitches a Bond Secured by Art Collections",excerpt:"Sotheby's announces $700m of asset-backed Notes.",date:"2025-03-01",category:"Industry Insights",slug:"sothebys-art-backed-bond",image:"/lovable-uploads/sothebys-bond.avif",type:"article"},{id:"12",title:"Fabricating solid relationships: An interview with art lawyer, Yayoi Shionoiri",excerpt:"Art lawyer Yayoi Shionoiri speaks about artists and fabricators, intellectual property, and contracts.",date:"2025-02-15",category:"Best Practices",slug:"artist-fabricator-relationships",image:"/lovable-uploads/sculpture-outdoor.jpg",tags:["Legal"],type:"article"},{id:"13",title:"Press: ARTnews — AI Art Valuation Companies Think They Can Give Market Players an Edge",excerpt:"ArtNews explores how the art appraisal industry is evolving with new technology.",date:"2025-02-01",category:"Industry Insights",slug:"artnews-ai-valuation",image:"/lovable-uploads/artnews-appraiser.webp",tags:["Press","AI","Valuations"],type:"article"},{id:"14",title:"Case Study: Neutral Valuations in Equitable Distribution",excerpt:"Appraisal Bureau was retained by a major law firm to value Fine Art in divorce proceedings.",date:"2025-01-20",category:"Best Practices",slug:"neutral-valuations-divorce",image:"/lovable-uploads/courtroom-gavel.jpg",tags:["Valuations","Estate Planning","Legal"],type:"article"},{id:"1",title:"Rethinking the Appraisal Report",excerpt:"How we've reimagined the appraisal report from static PDFs to living valuations.",date:"2025-01-15",category:"Industry Insights",slug:"sample-post-1",image:"/lovable-uploads/paper-stack-reports.jpg",tags:["Technology","Valuations","Data"],type:"article"},{id:"15",title:"Donating Art: IRS requirements and the Form 8283",excerpt:"When fine art is donated to museums, everyone wins.",date:"2025-01-10",category:"Best Practices",slug:"irs-form-8283-guide",image:"/lovable-uploads/irs-form-graphic.jpg",tags:["Charitable Donation","Estate Planning"],type:"article"},{id:"16",title:"On the History of Digital Art: Origins and the Cybernetic Spirit",excerpt:"An exploration of digital art's origins from the mid-20th century cybernetic era.",date:"2025-01-05",category:"Industry Insights",slug:"history-digital-art",image:"/lovable-uploads/cybernetics-tower.webp",tags:["Technology","Art Market"],type:"article"},{id:"5",title:"Appraisal Bureau sponsors innovative exhibition at ICA Miami",excerpt:"Appraisal Bureau was proud to sponsor an ambitious exhibition by Marguerite Humeau at ICA Miami.",date:"2024-12-23",category:"Museums & Philanthropy",slug:"ica-miami-exhibition",image:"/lovable-uploads/marguerite-humeau-exhibition.png",tags:["Art Market"],type:"article"},{id:"17",title:"The Case for Independent Personal Property Appraisers",excerpt:"The field of independent appraising exists to provide neutral and unbiased opinions of value.",date:"2024-12-15",category:"Best Practices",slug:"independent-appraisers-case",image:"/lovable-uploads/open-grass-field.jpg",tags:["Valuations","Insurance"],type:"article"},{id:"18",title:"Breaking down Fractionalized Ownership of Art",excerpt:"Fractional ownership offers access to blue-chip artworks and new investment opportunities.",date:"2024-12-10",category:"Industry Insights",slug:"fractionalized-ownership-art",image:"/lovable-uploads/gold-coin-tree.jpg",tags:["Art Finance","Art Market"],type:"article"},{id:"20",title:"A Conversation with Michael Darling, Co-Founder, Museum Exchange",excerpt:"Appraisal Bureau sat down with Michael Darling to discu
311ss digital art donation platforms.",date:"2023-03-31",category:"Best Practices",slug:"museum-exchange-conversation",image:"/lovable-uploads/michael-darling.jpg",tags:["Charitable Donation","Data"],type:"article"}],HP=()=>{D.useState(""),D.useState(!1),D.useState(!1);const[e,t]=D.useState(!1),r=7,n=Fp.find(i=>i.type==="editorial"),s=Fp.filter(i=>i.type==="editorial"&&i.id!==(n==null?void 0:n.id)).slice(0,4),a=Fp.filter(i=>i.id!==(n==null?void 0:n.id)&&!s.find(l=>l.id===i.id));return o.jsxs(o.Fragment,{children:[o.jsx(Fn,{title:"Blog - Appraisal Bureau",description:"Insights, trends, and best practices in art valuation and collection management from Appraisal Bureau experts.",keywords:["art appraisal blog","collection management insights","art valuation trends","art market news"]}),o.jsxs("div",{className:"min-h-screen bg-white flex flex-col",children:[o.jsx(on,{}),o.jsxs("main",{className:"flex-grow pt-20",children:[o.jsx("section",{className:"bg-white",children:o.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 md:pt-10 pb-6 md:pb-8",children:o.jsx("div",{className:"border-y border-ab-ink py-4 md:py-5",children:o.jsx("h1",{className:"font-newsreader font-light italic text-ab-ink text-center text-3xl md:text-4xl leading-none tracking-tight",children:"The Journal"})})})}),o.jsx("section",{className:"py-14 md:py-20",children:o.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"flex flex-col lg:flex-row gap-0",children:[o.jsx("div",{className:"lg:w-[25%] flex flex-col divide-y divide-gray-200 lg:pr-8 lg:border-r border-gray-200",children:s.map(i=>{var l;return o.jsxs(Ut,{to:`/blog/${i.slug}`,className:"group block py-7 first:pt-0",children:[o.jsx("div",{className:"w-full h-44 overflow-hidden bg-gray-100 mb-4",children:o.jsx("img",{src:i.image,alt:i.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700 contrast-75 brightness-90 saturate-75",style:{objectPosition:i.objectPosition||"center"}})}),o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-gray-400 mb-2",children:i.editionLabel||"Monthly Editorial"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:(l=i.tags)==null?void 0:l.map(c=>o.jsx("span",{className:"inline-block text-[10px] font-light uppercase tracking-[0.18em] text-gray-400",children:c},c))}),o.jsx("h3",{className:"font-newsreader text-lg md:text-xl font-light text-ab-ink leading-snug group-hover:text-[#220E99] transition-colors",dangerouslySetInnerHTML:{__html:i.titleHtml||i.title}})]},i.id)})}),o.jsx("div",{className:"lg:w-[50%] lg:px-10 py-8 lg:py-0 border-y lg:border-y-0 border-gray-200 lg:border-r",children:n&&o.jsxs(Ut,{to:`/blog/${n.slug}`,className:"group block",children:[o.jsx("div",{className:"w-full h-72 md:h-[440px] overflow-hidden bg-gray-100",children:o.jsx("img",{src:n.image,alt:n.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700 contrast-75 brightness-90 saturate-75"})}),o.jsxs("div",{className:"mt-7 text-center max-w-2xl mx-auto",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.25em] text-[#220E99] mb-4",children:n.editionLabel||"Monthly Editorial"}),o.jsx("h2",{className:"font-newsreader text-3xl md:text-4xl lg:text-5xl font-light text-ab-ink leading-[1.1] tracking-tight group-hover:text-[#220E99] transition-colors",dangerouslySetInnerHTML:{__html:n.titleHtml||n.title}}),o.jsx("p",{className:"text-gray-600 font-light text-base md:text-lg mt-5 leading-relaxed",children:n.excerpt}),o.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-gray-400 mt-6",children:new Date(n.date).toLocaleDateString("en-US",{month:"long",year:"numeric"})})]})]})}),o.jsxs("div",{className:"lg:w-[25%] lg:pl-8 pt-8 lg:pt-0",children:[o.jsx("div",{className:"divide-y divide-gray-200",children:(e?a:a.slice(0,r)).map(i=>{var l;return o.jsxs(Ut,{to:`/blog/${i.slug}`,className:"group flex gap-4 items-start py-5 first:pt-0",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[i.type==="editorial"&&o.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-gray-400 block mb-1.5",children:i.editionLabel||"Monthly Editorial"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:(l=i.tags)==null?void 0:l.map(c=>o.jsx("span",{className:"inline-block text-[10px] font-light uppercase tracking-[0.18em] text-gray-400",children:c},c))}),o.jsx("h3",{className:"font-newsreader text-base font-light text-ab-ink leading-snug group-hover:text-[#220E99] transition-colors line-clamp-3",dangerouslySetInnerHTML:{__html:i.titleHtml||i.title}})]}),o.jsx("div",{className:"flex-shrink-0 w-16 h-16 overflow-hidden bg-gray-100",children:o.jsx("img",{src:i.image,alt:i.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700 contrast-75 brightness-90 saturate-75",style:{objectPosition:i.objectPosition||"center"}})})]},i.id)})}),!e&&a.length>r&&o.jsx("button",{onClick:()=>t(!0),className:"mt-6 w-full text-center text-[11px] font-semibold uppercase tracking-[0.22em] text-gray-400 hover:text-[#220E99] transition-colors py-3 border-t border-gray-200",children:"See more ↓"}),e&&o.jsx("button",{onClick:()=>t(!1),className:"mt-6 w-full text-center text-[11px] font-semibold uppercase tracking-[0.22em] text-gray-400 hover:text-[#220E99] transition-colors py-3 border-t border-gray-200",children:"See less ↑"})]})]})})})]}),o.jsx(yn,{})]})]})},MY=()=>{const a="#FF6069",i={x:550,y:410},l=360,c=60,d=18,p=[{text:"INSURANCE",x:570,y:65,align:"right",delay:0},{text:"AUDIT",x:870,y:210,align:"right",delay:1},{text:"TAX & ESTATE",x:880,y:430,align:"right",delay:2},{text:"DEACQUISITION",x:650,y:730,align:"right",delay:3,w:420},{text:"FINANCIAL REPORTING",x:450,y:730,align:"left",delay:4,w:420},{text:"CHARITABLE DONATION",x:400,y:430,align:"left",delay:5,w:380},{text:"LENDING",x:260,y:110,align:"left",delay:6}],u=(_,w)=>`M ${550-_} 410 A ${_} ${w} 0 1 0 ${550+_} 410 A ${_} ${w} 0 1 0 ${550-_} 410`,h=[{d:"M 550 30 A 380 380 0 1 0 550 790 A 380 380 0 1 0 550 30",len:2*Math.PI*380,delay:0}
311,{d:u(380,380*.28),len:2*Math.PI*Math.sqrt((380*380+(380*.28)**2)/2),delay:.6},{d:u(380*.28,380),len:2*Math.PI*Math.sqrt((380*380+(380*.28)**2)/2),delay:1.2},{d:u(380*.45,380),len:2*Math.PI*Math.sqrt((380*380+(380*.45)**2)/2),delay:1.8,rotate:35,dashed:!0},{d:u(380*.5,380),len:2*Math.PI*Math.sqrt((380*380+(380*.5)**2)/2),delay:2.4,rotate:-45,dashed:!0}],f=18,m=18,v=13,k=15,y=[0,1,2,3,4,5,6],g=1.4;return o.jsx("section",{className:"px-4 sm:px-8 my-16 md:my-24",children:o.jsxs("div",{className:"relative overflow-hidden rounded-3xl",style:{background:"radial-gradient(120% 80% at 0% 0%, #491043 0%, transparent 55%), radial-gradient(120% 80% at 100% 100%, #900431 0%, transparent 60%), #270F19"},children:[o.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 opacity-25",style:{backgroundImage:"radial-gradient(circle, #FF6069 1.4px, transparent 1.4px)",backgroundSize:"36px 36px"}}),o.jsx("style",{children:`
312          @keyframes ab-globe-spin {
313            to { transform: rotate(360deg); }
314          }
315
316          /* Draw on once, then stay drawn — globe never goes blank.
317             Each line has its own delay so they appear sequentially,
318             but once drawn they remain visible for the rest of the loop. */
319          @keyframes ab-draw-erase {
320            0%   { stroke-dashoffset: var(--len); }
321            25%  { stroke-dashoffset: 0; }
322            100% { stroke-dashoffset: 0; }
323          }
324
325          /* Connector line — same idea but shorter cycle */
326          @keyframes ab-connector {
327            0%   { stroke-dashoffset: var(--len); opacity: 0.9; }
328            30%  { stroke-dashoffset: 0; opacity: 0.9; }
329            55%  { stroke-dashoffset: 0; opacity: 0.9; }
330            85%  { stroke-dashoffset: calc(-1 * var(--len)); opacity: 0.9; }
331            100% { stroke-dashoffset: calc(-1 * var(--len)); opacity: 0; }
332          }
333
334          /* Label fade in/out — synchronised with its connector */
335          @keyframes ab-label-show {
336            0%, 25%   { opacity: 0; transform: translateY(2px); }
337            35%, 60%  { opacity: 1; transform: translateY(0); }
338            85%, 100% { opacity: 0; transform: translateY(0); }
339          }
340
341          /* Marker dot pop */
342          @keyframes ab-dot-pop {
343            0%, 25%   { opacity: 0; transform: scale(0.6); }
344            35%, 60%  { opacity: 1; transform: scale(1); }
345            85%, 100% { opacity: 0; transform: scale(0.8); }
346          }
347
348          /* Back-of-globe dotted line — fade in once and stay visible. */
349          @keyframes ab-line-fade {
350            0%   { opacity: 0; }
351            25%  { opacity: 0.55; }
352            100% { opacity: 0.55; }
353          }
354
355          /* Marker — burgundy by default; turns white during the "connected"
356             window (line fully drawn to label), then reverts as it retreats.
357             Drives both background-color (HTML pill dot) and fill (SVG circle). */
358          @keyframes ab-marker-pulse {
359            0%, 29%  { background-color: #491043; fill: #491043; }
360            34%, 58% { background-color: #ffffff; fill: #ffffff; }
361            63%, 100%{ background-color: #491043; fill: #491043; }
362          }
363
364          /* SVG marker dot fade — visible only while connector is drawn. */
365          @keyframes ab-dot-fade {
366            0%, 28%  { opacity: 0; }
367            34%, 60% { opacity: 1; }
368            66%, 100%{ opacity: 0; }
369          }
370
371
372
373          @media (prefers-reduced-motion: reduce) {
374            .ab-anim { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
375          }
376        `}),o.jsx("style",{children:y.map((_,w)=>{const x=m,b=q=>(q/x*100).toFixed(2),M=b(_),S=b(_+g),j=b(v),I=b(k);return`
377            @keyframes ab-line-${w} {
378              0%, ${M}% { stroke-dashoffset: var(--len); opacity: 0.95; }
379              ${S}%       { stroke-dashoffset: 0; opacity: 0.95; }
380              ${j}%       { stroke-dashoffset: 0; opacity: 0.95; }
381              ${I}%        { stroke-dashoffset: calc(-1 * var(--len)); opacity: 0.95; }
382              100%              { stroke-dashoffset: calc(-1 * var(--len)); opacity: 0; }
383            }
384            @keyframes ab-pill-${w} {
385              0%, ${M}% { opacity: 0; transform: translateY(2px); }
386              ${S}%       { opacity: 1; transform: translateY(0); }
387              ${j}%       { opacity: 1; transform: translateY(0); }
388              ${I}%        { opacity: 0; transform: translateY(0); }
389              100%              { opacity: 0; }
390            }
391            @keyframes ab-mark-${w} {
392              0%, ${M}% { opacity: 0; fill: #491043; background-color: #491043; }
393              ${S}%       { opacity: 1; fill: #ffffff; background-color: #ffffff; }
394              ${j}%       { opacity: 1; fill: #ffffff; background-color: #ffffff; }
395              ${I}%        { opacity: 0; fill: #491043; background-color: #491043; }
396              100%              { opacity: 0; }
397            }
398          `}).join(`
399`)}),o.jsx("div",{className:"relative z-10 px-8 md:px-16 pt-14 md:pt-20 pb-12 md:pb-16",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 items-start lg:pt-8",children:[o.jsxs("div",{className:"lg:col-span-4 relative z-20",children:[o.jsx("p",{className:"text-[11px] tracking-[0.25em] text-ab-salmon uppercase mb-4",children:"One source of truth"}),o.jsx("h2",{className:"font-newsreader font-light text-white text-5xl md:text-6xl lg:text-7xl xl:text-[80px] leading-[1.02] tracking-tight",children:"Where art connects"}),o.jsx("p",{className:"mt-8 text-white/75 font-extralight text-lg md:text-xl lg:text-2xl max-w-xl leading-snug",children:"Defensible data, ready for the systems that depend on it."})]}),o.jsx("div",{className:"lg:col-span-8 relative min-w-0",children:o.jsxs("div",{className:"relative mx-auto w-full",style:{aspectRatio:"1100 / 820"},children:[o.jsxs("svg",{viewBox:"0 0 1100 820",width:"100%",height:"100%","aria-hidden":"true",preserveAspectRatio:"xMidYMid meet",children:[o.jsx("g",{style:{transformOrigin:"550px 410px",animation:"ab-globe-spin 180s linear infinite"},children:h.map((_,w)=>{const x=Math.round(_.len);return o.jsx("g",{transform:_.rotate?`rotate(${_.rotate} 550 410)`:void 0,children:_.dashed?o.jsx("path",{className:"ab-anim",d:_.d,fill:"none",stroke:a,strokeWidth:.9,strokeLinecap:"round",strokeDasharray:"1.5 5",opacity:0,style:{animation:`ab-line-fade ${f}s ${_.delay}s ease-in-out infinite`}}):o.jsx("path",{className:"ab-anim",d:_.d,fill:"none",stroke:a,strokeWidth:1,strokeLinecap:"round",opacity:.9,style:{"--len":`${x}px`,strokeDasharray:`${x}`,strokeDashoffset:`${x}`,animation:`ab-draw-erase ${f}s ${_.delay}s linear infinite`}})},w)})}),p.map((_,w)=>{const x=_.x-i.x,b=_.y-i.y,M=Math.round(Math.sqrt(x*x+b*b));return o.jsx("line",{className:"ab-anim",x1:i.x,y1:i.y,x2:_.x,y2:_.y,stroke:a,strokeWidth:"0.9",strokeLinecap:"round",style:{"--len":`${M}px`,strokeDasharray:`${M}`,strokeDashoffset:`${M}`,animation:`ab-line-${w} ${m}s linear infinite`}},`line-${_.text}`)}),p.map((_,w)=>o.jsx("circle",{className:"ab-anim",cx:_.x,cy:_.y,r:5,stroke:a,strokeWidth:"1.2",style:{animation:`ab-mark-${w} ${m}s linear infinite`,opacity:0}
399},`dot-${_.text}`)),p.map((_,w)=>{const x=_.w??l,b=_.align==="right"?_.x+d:_.x-d-x,M=_.y-c/2,S=_.align==="right"?"flex-start":"flex-end";return o.jsx("foreignObject",{x:b,y:M,width:x,height:c,className:"ab-anim",style:{animation:`ab-pill-${w} ${m}s linear infinite`,opacity:0,overflow:"visible"},children:o.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:S},children:o.jsx("div",{className:"inline-flex items-center bg-ab-salmon text-ab-burgundy whitespace-nowrap rounded-sm",style:{fontFamily:"Plus Jakarta Sans, sans-serif",padding:"10px 18px"},children:o.jsx("span",{style:{fontSize:20,fontWeight:400,letterSpacing:"0.18em",textTransform:"uppercase",lineHeight:1},children:_.text})})})},`pill-${_.text}`)})]}),o.jsx("img",{src:_F,alt:"Appraisal Bureau",className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10 pointer-events-none",style:{width:"24%",height:"auto",filter:"drop-shadow(0 0 18px rgba(255,96,105,0.45))"}})]})})]})})]})})},du="#CA2344",gr="#1F2937",yr=1.25,EY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[o.jsx("path",{d:"M20 78 A 40 40 0 0 1 100 78",fill:"none",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("path",{d:"M20 78 L 60 78",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("path",{d:"M60 78 L 100 78",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"60",y1:"32",x2:"60",y2:"78",stroke:gr,strokeWidth:yr}),o.jsx("circle",{cx:"60",cy:"48",r:"8",fill:du}),o.jsx("line",{x1:"44",y1:"92",x2:"76",y2:"92",stroke:gr,strokeWidth:yr,strokeLinecap:"round"})]}),SY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[[[22,30],[98,30],[22,90],[98,90],[60,18],[60,102]].map(([e,t],r)=>o.jsxs("g",{children:[o.jsx("line",{x1:e,y1:t,x2:"60",y2:"60",stroke:gr,strokeWidth:yr*.8}),o.jsx("circle",{cx:e,cy:t,r:"3.5",fill:"white",stroke:gr,strokeWidth:yr})]},r)),o.jsx("circle",{cx:"60",cy:"60",r:"10",fill:du})]}),AY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[o.jsx("circle",{cx:"60",cy:"60",r:"40",fill:"none",stroke:gr,strokeWidth:yr}),o.jsx("line",{x1:"60",y1:"20",x2:"60",y2:"28",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"60",y1:"92",x2:"60",y2:"100",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"20",y1:"60",x2:"28",y2:"60",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"92",y1:"60",x2:"100",y2:"60",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"34",y1:"86",x2:"86",y2:"34",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("circle",{cx:"86",cy:"34",r:"5",fill:du}),o.jsx("circle",{cx:"60",cy:"60",r:"3",fill:"white",stroke:gr,strokeWidth:yr})]}),PY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[o.jsx("line",{x1:"28",y1:"22",x2:"92",y2:"22",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"34",y1:"30",x2:"86",y2:"30",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("line",{x1:"42",y1:"36",x2:"42",y2:"92",stroke:gr,strokeWidth:yr}),o.jsx("line",{x1:"60",y1:"36",x2:"60",y2:"92",stroke:gr,strokeWidth:yr}),o.jsx("line",{x1:"78",y1:"36",x2:"78",y2:"92",stroke:gr,strokeWidth:yr}),o.jsx("line",{x1:"34",y1:"98",x2:"86",y2:"98",stroke:gr,strokeWidth:yr,strokeLinecap:"round"}),o.jsx("rect",{x:"24",y:"104",width:"72",height:"6",fill:du})]}),CY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[o.jsx("path",{d:"M30 18 H78 L94 34 V104 H30 Z",fill:"none",stroke:gr,strokeWidth:yr,strokeLinejoin:"round"}),o.jsx("path",{d:"M78 18 V34 H94",fill:"none",stroke:gr,strokeWidth:yr,strokeLinejoin:"round"}),o.jsx("line",{x1:"40",y1:"48",x2:"80",y2:"48",stroke:gr,strokeWidth:yr*.8,strokeLinecap:"round"}),o.jsx("line",{x1:"40",y1:"58",x2:"80",y2:"58",stroke:gr,strokeWidth:yr*.8,strokeLinecap:"round"}),o.jsx("line",{x1:"40",y1:"68",x2:"68",y2:"68",stroke:gr,strokeWidth:yr*.8,strokeLinecap:"round"}),o.jsx("circle",{cx:"78",cy:"92",r:"11",fill:du}),o.jsx("circle",{cx:"78",cy:"92",r:"11",fill:"none",stroke:gr,strokeWidth:yr*.6,strokeDasharray:"1.5 3"})]}),jY=()=>o.jsxs("svg",{viewBox:"0 0 120 120",className:"w-full h-full",children:[o.jsx("rect",{x:"20",y:"22",width:"80",height:"76",fill:"none",stroke:gr,strokeWidth:yr}),o.jsx("rect",{x:"26",y:"28",width:"68",height:"64",fill:"none",stroke:gr,strokeWidth:yr*.
3996}),o.jsx("circle",{cx:"78",cy:"50",r:"8",fill:du}),o.jsx("path",{d:"M26 78 L 46 62 L 60 72 L 78 56 L 94 78",fill:"none",stroke:gr,strokeWidth:yr,strokeLinejoin:"round",strokeLinecap:"round"}),o.jsx("line",{x1:"34",y1:"106",x2:"86",y2:"106",stroke:gr,strokeWidth:yr*.6,strokeLinecap:"round"})]}),IY=[{title:"Radical neutrality",body:"Unbiased, third-party valuations grounded in data and deep industry expertise. The same record everyone can trust.",art:o.jsx(EY,{})},{title:"Seamless control",body:"Every party with the right view — owners, advisors, insurers, fiduciaries — secure by default, in one place.",art:o.jsx(SY,{})},{title:"Human expertise, AI-supported",body:"Deep domain experience at the core, accelerated by AI.",art:o.jsx(AY,{})},{title:"Built to endure",body:"A system of record designed for the full lifecycle of the collection — durable across generations, custodians, and entities.",art:o.jsx(PY,{})},{title:"Defensible documents",body:"USPAP-compliant reports — ready for insurers, estates, and IRS filings.",art:o.jsx(CY,{})},{title:"Driven by love for art",body:"We're in this because we love it as much as you do. Cultural stewardship for the next generation.",art:o.jsx(jY,{})}],$Y={backgroundColor:"#FAFAF7",backgroundImage:`
400    repeating-linear-gradient(45deg, rgba(31,41,55,0.06) 0 1px, transparent 1px 10px),
401    repeating-linear-gradient(-45deg, rgba(31,41,55,0.06) 0 1px, transparent 1px 10px)
402  `},NY=()=>o.jsx("section",{className:"py-20 md:py-28 bg-white",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("h2",{className:"font-newsreader font-normal text-3xl md:text-5xl text-ab-ink tracking-tight mb-12 md:mb-16 whitespace-nowrap",children:"Why we are different"}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-10 gap-y-14",children:IY.map(e=>o.jsxs("div",{className:"group",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-sm transition-all duration-300",style:$Y,children:[o.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 bg-[#CA2344]/0 transition-colors duration-300 group-hover:bg-[#CA2344]/[0.05]"}),o.jsx("div",{className:"absolute inset-2 border border-gray-300/60 pointer-events-none"}),o.jsx("div",{className:"relative h-44 md:h-48 flex items-center justify-center transition-transform duration-300 group-hover:-translate-y-0.5",children:o.jsx("div",{className:"w-28 h-28 md:w-32 md:h-32",children:e.art})})]}),o.jsx("h3",{className:"mt-6 font-newsreader font-normal text-xl md:text-2xl text-ab-ink leading-tight",children:e.title}),o.jsx("p",{className:"mt-3 text-sm text-gray-600 leading-relaxed font-light max-w-sm",children:e.body})]},e.title))})]})}),lm=[{n:"$15B+",label:"Appraised across private, corporate & museum collections"},{n:"25,000+",label:"Charitable donation valuations for tax & estate purposes"},{n:"200,000+",label:"Artworks appraised for insurance coverage"}],OY=4500;function RY(){const[e,t]=D.useState(0);D.useEffect(()=>{const n=setInterval(()=>t(s=>(s+1)%lm.length),OY);return()=>clearInterval(n)},[]);const r=lm[e];return o.jsxs("section",{className:"py-16 md:py-24 bg-ab-ink text-white relative overflow-hidden",children:[o.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(60% 60% at 50% 40%, rgba(255,96,105,0.08) 0%, transparent 70%)"}}),o.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3 mb-10 md:mb-14",children:[o.jsx("span",{className:"block w-1.5 h-1.5 rounded-full bg-ab-salmon"}),o.jsx("p",{className:"text-white/65 text-[11px] tracking-[0.32em] uppercase font-light",children:"Appraisal Bureau by the numbers"}),o.jsx("span",{className:"block w-1.5 h-1.5 rounded-full bg-ab-salmon"})]}),o.jsx("div",{className:"text-center mb-6",children:o.jsxs("span",{className:"font-newsreader italic text-white/40 text-sm tracking-wide",children:[String(e+1).padStart(2,"0")," ",o.jsxs("span",{className:"text-white/25",children:["/ ",String(lm.length).padStart(2,"0")]})]})}),o.jsxs("div",{className:"relative mx-auto max-w-3xl",children:[o.jsx("div",{className:"relative min-h-[160px] md:min-
402h-[210px] flex items-center justify-center text-center",children:o.jsx("div",{className:"absolute inset-0 flex items-center justify-center animate-[abMetricFade_4.5s_ease-in-out_forwards]",children:o.jsx("div",{className:"font-newsreader font-light text-white text-6xl md:text-8xl lg:text-[120px] leading-[0.95] tracking-tight",children:r.n})},e)}),o.jsxs("div",{className:"relative mt-6 flex flex-col items-center",children:[o.jsx("div",{className:"h-px w-16 bg-ab-salmon/40 mb-5"}),o.jsx("p",{className:"animate-[abMetricFade_4.5s_ease-in-out_forwards] text-white/70 text-base md:text-xl font-light text-center leading-relaxed px-4 max-w-md md:max-w-none md:whitespace-nowrap",children:r.label},`cap-${e}`)]})]}),o.jsx("div",{className:"mt-10 flex items-center justify-center gap-3",children:lm.map((n,s)=>o.jsx("button",{onClick:()=>t(s),"aria-label":`Show metric ${s+1}`,className:"group flex items-center",children:o.jsx("span",{className:`block rounded-full transition-all duration-500 ${s===e?"w-3 h-3 bg-ab-salmon ring-2 ring-ab-salmon/30 ring-offset-2 ring-offset-ab-ink":"w-2 h-2 bg-white/20 group-hover:bg-white/45"}`})},s))})]}),o.jsx("style",{children:`
403        @keyframes abMetricFade {
404          0%   { opacity: 0; transform: translateY(10px); }
405          15%  { opacity: 1; transform: translateY(0); }
406          82%  { opacity: 1; transform: translateY(0); }
407          100% { opacity: 0; transform: translateY(-10px); }
408        }
409      `})]})}const DY=()=>o.jsx("section",{className:"py-20 md:py-28 bg-white",children:o.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:"#220E99"}}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold",style:{color:"#220E99"},children:"Loupe — AI Data Ingestion"})]}),o.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-8",children:[o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-4xl md:text-5xl lg:text-6xl leading-[1.05] tracking-tight",children:"Skip the manual data entry"}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[o.jsx("span",{"aria-hidden":"true",className:"block rounded-full shrink-0",style:{width:56,height:56,border:"5px solid #220E99"}}),o.jsxs("span",{style:{fontFamily:'Plus Jakarta Sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontWeight:600,fontSize:50,lineHeight:1,letterSpacing:"-0.03em",color:"#0F172A"},children:["Loupe",o.jsx("sup",{style:{fontSize:"0.22em",fontWeight:500,marginLeft:"0.15em",top:"-2.2em",position:"relative",letterSpacing:"0.05em"},children:"TM"})]})]})]}),o.jsxs("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-3xl",children:[o.jsx("span",{className:"font-normal text-ab-ink",children:"Loupe"})," is Appraisal Bureau's AI-native records layer"]}),o.jsxs("ul",{className:"mt-10 text-[15px] text-gray-700 font-light max-w-3xl",children:[o.jsxs("li",{children:[o.jsx("h3",{className:"mt-6 font-newsreader font-normal text-xl md:text-2xl text-ab-ink leading-tight",children:"Catalogue artworks instantly"}),o.jsx("p",{className:"mt-3 text-sm text-gray-600 leading-relaxed font-light max-w-sm",children:"Imports artworks from invoices, PDFs, and existing inventories with no manual entry required"})]}),o.jsxs("li",{children:[o.jsx("h3",{className:"mt-6 font-newsreader font-normal text-xl md:text-2xl text-ab-ink leading-tight",children:"Automate a live cost-of-ownership ledger for every artwork"}),o.jsx("p",{className:"mt-3 text-sm text-gray-600 leading-relaxed font-light max-w-sm",children:"Reads and uploads shipping, framing, storage & conservation costs while linking supporting documents to each work — organized, searchable, and audit-ready"})]})]}),o.jsx("p",{className:"mt-8 text-xs uppercase tracking-widest text-gray-400",children:"PDF · CSV"})]})}),FY="/assets/hero-home-full-DEFQ4laK.png",LY="/assets/hero-tile-workspace-BfVu-E_X.png",KP=[{src:"/lovable-uploads/6c9fd5
409a7-58a6-448a-a972-665f12e11fd3.png",alt:"MOAL - The Museum of Art + Light",className:"h-8"},{src:"/lovable-uploads/51344da5-2cb0-41c3-89ec-02a439c41423.png",alt:"Swire Properties",className:"h-20"},{src:"/lovable-uploads/5329da5e-4596-46b9-bf18-5aef1c6583a2.png",alt:"ANAT EBGI",className:"h-8"},{src:"/lovable-uploads/c1a7709d-b0dd-4c04-ab43-6f1e494f89c6.png",alt:"ISLAA",className:"h-12"},{src:"/lovable-uploads/46647ecd-6e7e-47b6-9b3b-a97724a218b9.png",alt:"Museum Exchange",className:"h-10"},{src:"/lovable-uploads/394a323e-fe65-4576-b119-422e41c45c6a.png",alt:"Hivemind",className:"h-8"},{src:"/lovable-uploads/5f58aa08-ced9-4261-aa80-88ce0a63d1d9.png",alt:"Oaktree",className:"h-10"},{src:"/lovable-uploads/MBAM-BlocMarque-EN-RGB-Noir_1.png",alt:"Montreal Museum of Fine Arts",className:"h-10"}],zY=()=>{const{language:e,t}=gc(),r=["art collection management","art appraisal","art valuation","fine art insurance","collector dashboard","art portfolio management","art inventory system","art collection software"],n=Fp[0],s=Fp.slice(1,4);return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Appraisal Bureau — Infrastructure for art collection stewardship",description:"A living system of record for art ownership — defensible valuations across the full lifecycle of any collection.",canonical:"/",keywords:r}),o.jsx(Sd,{children:o.jsx("script",{type:"application/ld+json",children:`
410            {
411              "@context": "https://schema.org",
412              "@type": "Organization",
413              "name": "Appraisal Bureau",
414              "url": "https://appraisalbureau.com",
415              "logo": "https://appraisalbureau.com/lovable-uploads/e27b1efc-5035-4135-947c-b4b733a3d8ff.png",
416              "description": "The infrastructure for art collection stewardship."
417            }
418          `})}),o.jsx("div",{className:"text-white text-center py-2.5 px-4 text-[13px] font-light tracking-wide",style:{background:"linear-gradient(90deg, #270F19 0%, #491043 35%, #900431 70%, #CA2344 100%)"},children:o.jsx("div",{className:"max-w-7xl mx-auto flex items-center justify-center gap-3",children:o.jsx("span",{className:"inline-flex items-center gap-3",children:o.jsxs("span",{children:["Appraisal Bureau is now on Claude — ask about your collection in plain language."," ",o.jsx(Ut,{to:"/integrations/claude",className:"underline underline-offset-2 hover:text-white/85 transition-colors ml-1",children:"Learn more →"})]})})})}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-12 md:pt-20 pb-20 md:pb-28 bg-white",children:o.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-16 items-center",children:[o.jsxs("div",{className:"lg:col-span-5",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#CA2344]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#CA2344] font-semibold",children:"Appraisal Bureau 2.0 — Now live"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Powering the art ecosystem"}),o.jsx("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-xl",children:"A living system of record for art ownership — delivering defensible valuations across the full lifecycle of any collection."}),o.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row gap-3 items-start sm:items-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"bg-black hover:bg-black/85 text-white rounded-full px-7 h-12 text-base font-light",children:"Start free trial"})}),o.jsx(Ut,{to:"/product",children:o.jsx(rr,{variant:"outline",className:"rounded-full border border-gray-300 text-black hover:bg-gray-50 hover:text-black px-7 h-12 text-base font-light bg-transparent",children:"See the product"})})]}),o.jsx("p",{className:"mt-6 text-xs uppercase tracking-widest text-gray-400",children:"Sign up today — full access."})]}),o.jsx("div",{className:"lg:col-span-7",children:o.jsxs("div",{className:"relative w-full",children:[o.jsx("div",{className:"relative rounded-xl overflow-hidden bg-white ring-1 ring-gray-200/70",style:{boxShadow:"0 40px 80px -30px rgba(15, 23, 42, 0.28), 0 14px 28px -14px rgba(15, 23, 42, 0.14)"},children:o.jsx("img",{src:FY,alt:"Appraisal Bureau Home dashboard showing inbox, workspaces and fair market values",className:"w-full h-auto block",loading:"eager"})}),o.jsx("div",{className:"absolute -bottom-[12%] -left-[6%] w-[72%] rounded-xl overflow-hidden bg-white ring-1 ring-gray-200/70",style:{boxShadow:"0 30px 60px -20px rgba(15, 23, 42, 0.26), 0 12px 24px -12px rgba(15, 23, 42, 0.16)"},children:o.jsx("img",{src:LY,alt:"New York Collection: 36 works, $22,519,634 fair market value",className:"w-full h-auto block",loading:"eager"})})]})})]})})}),o.jsx(MY,{}),o.jsx("section",{className:"py-10 md:py-14 bg-white border-y border-gray-100",children:o.jsxs("div",{className:"px-4 sm:px-8",children:[o.jsx("p",{className:"text-center text-[11px] uppercase tracking-[0.25em] text-gray-400 mb-6",children:"Trusted by"}),o.jsx("div",{className:"marquee-pause overflow-hidden relative",style:{maskImage:"linear-gradient(to right, transparent, black 8%, black 92%, transparent)",WebkitMaskImage:"linear-gradient(to right, transparent, black 8%, black 92%, transparent)"},children:o.jsx("div",{className:"flex w-max animate-marquee",children:[...KP,...KP].map((a,i)=>o.jsx("div",{className:"flex items-center justify-center h-20 px-10 shrink-0",children:o.jsx("img",{src:a.src,alt:a.alt,className:`${a.className} opacity-60 hover:opacity-90 transition-opacity grayscale hover:grayscale-0 object-contain`})},i))})})]})}),o.jsx(RY,{}),o.jsx(DY,{}),o.jsx(NY,{}),o.jsx("section",{className:"py-20 bg-white border-t border-slate-100",children:o.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center justify-between mb-10",children:[o.jsxs(Ut,{to:"/thejournal",className:"group",children:[o.jsx("h2",{className:"font-newsreader font-normal text-3xl md:text-4xl text-ab-ink tracking-tight group-hover:underline decoration-slate-400 underline-offset-4",children:"The Journal"}),o.jsx("p",{className:"text-slate-400 text-xs tracking-widest uppercase mt-1",children:"By Appraisal Bureau"})]}),o.jsxs(Ut,{to:"/thejournal",className:"group text-slate-400 hover:text-slate-600 text-xs font-semibold uppercase tracking-widest flex items-center gap-2 transition-colors",children:[t(Ss.viewAll),o.jsx(ya,{className:"h-3 w-3 group-hover:translate-x-1 transition-transform"})]})]}),o.jsxs("div",{className:"flex flex-col md:flex-row divide-y md:divide-y-0 md:divide-x divide-slate-100",children:[o.jsxs(Ut,{to:`/blog/${n.slug}`,className:"group md:w-[40%] md:pr-8 py-6 md:py-0 flex flex-col",children:[o.jsx("div",{className:"w-full h-56 overflow-hidden bg-slate-100 mb-4",children:o.jsx("img",{src:n.image,alt:n.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 contrast-75 brightness-105",style:{objectPosition:n.objectPosition||"center"}})}),o.jsx("p",{className:"text-[10px] font-light uppercase tracking-widest text-slate-400 mb-2",children:n.editionLabel||n.category}),o.jsx("h3",{className:"text-base font-light text-ab-ink leading-snug group-hover:underline decoration-slate-400 underline-offset-2",children:n.title}),o.jsx("p",{className:"text-[10px] uppercase tracking-widest text-slate-300 mt-3",children:new Date(n.date).toLocaleDateString("en-US",{month:"long",year:"numeric"})})]}),o.jsx("div",{className:"md:w-[60%] md:pl-8 flex flex-col divide-y divide-slate-100",children:s.map(a=>o.jsxs(Ut,{to:`/blog/${a.slug}`,className:"group flex gap-4 items-start py-6 first:md:pt-0",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-[10px] font-light uppercase tracking-widest text-slate-400 mb-1.5",children:a.editionLabel||a.category}),o.jsx("h3",{className:"text-sm font-light text-ab-ink leading-snug group-hover:underline decoration-slate-400 underline-offset-2 line-clamp-2",children:a.title}),o.jsx("p",{className:"text-[10px] uppercase tracking-widest text-slate-300 mt-2",children:new Date(a.date).toLocaleDateString("en-US",{month:"long",year:"numeric"})})]}),o.jsx("div",{className:"flex-shrink-0 w-20 h-20 overflow-hidden bg-slate-100",children:o.jsx("img",{src:a.image,alt:a.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 contrast-75 brightness-105",style:{objectPosition:a.objectPosition||"center"}})})]},a.id))})]})]})}),o.jsx("section",{className:"relative py-28 md:py-40 bg-white overflow-hidden",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsx("div",{className:"border-t border-b border-gray-200 py-20 md:py-28",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 items-end",children:[o.jsxs("div",{className:"md:col-span-4 md:border-r md:border-gray-200 md:pr-10",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.28em] text-gray-500 font-semibold",children:"Join"})]}),o.jsx("p",{className:"text-sm text-gray-500 font-light leading-relaxed",children:"A 30-day trial with full access to the platform. No credit card. No commitment."})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsxs("h2",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:["Where every",o.jsx("br",{}),"collection"," ","belongs"]}),o.jsxs("div",{className:"mt-10 flex flex-col sm:flex-row gap-6 items-start sm:items-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#1a0b7a] text-white rounded-full px-8 h-12 text-base font-light",children:t(Ss.signUp)})}),o.jsx(Ut,{to:"/contact",className:"text-black underline underline-offset-4 hover:text-gray-600 text-base font-light transition-colors",children:"Talk to our team"})]})]})]})})})})]}),o.jsx(yn,{})]})},BY=()=>{const e=rl();return D.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),o.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},UY=()=>{const[e,t]=D.useState("platform"),{language:r,t:n}=gc(),s=r==="pt-BR"?Hr.features["pt-BR"]:Hr.features.en;return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white text-ab-ink",children:[o.jsx(Fn,{title:"Pricing — Appraisal Bureau",description:"Flat fees and full transparency for c
418ollectors and their stakeholders.",canonical:"/pricing"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-12 md:pb-16 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Pricing"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Flat fees, full transparency"}),o.jsx("p",{className:"mt-8 text-lg md:text-xl text-gray-600 font-light max-w-2xl leading-relaxed",children:n(Hr.subheading)})]})}),o.jsx("section",{className:"pb-12 md:pb-16 bg-white",children:o.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"flex flex-col items-start gap-4",children:[o.jsx("div",{className:"inline-flex items-center bg-gray-100 border border-gray-200 rounded-full p-1.5",children:[{key:"platform",label:n(Hr.platform)},{key:"appraisals",label:n(Hr.appraisals)}].map(a=>{const i=e===a.key;return o.jsx("button",{onClick:()=>t(a.key),className:`px-6 md:px-8 py-2.5 text-sm rounded-full transition-all ${i?"bg-white text-brand-blue shadow-sm":"text-gray-600 hover:text-ab-ink"}`,children:a.label},a.key)})}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:e==="platform"?"Software subscription — manage your collection":"Per-artwork USPAP reports — priced by volume"})]})})}),e==="platform"&&o.jsx("section",{className:"pb-20 md:pb-28 bg-white border-t border-gray-200",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 animate-in fade-in duration-300",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 py-16 md:py-20",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:["01 — ",n(Hr.individual)]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:n(Hr.personalPlan)})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsx("p",{className:"text-base md:text-lg text-gray-600 font-light leading-relaxed mb-8 max-w-xl",children:n(Hr.personalPlanDesc)}),o.jsxs("div",{className:"flex items-baseline gap-2 mb-10",children:[o.jsx("span",{className:"font-newsreader text-5xl md:text-6xl font-light tracking-tight tabular-nums",children:"$50"}),o.jsx("span",{className:"text-sm text-gray-500 font-light",children:n(Hr.seatMo)})]}),o.jsx("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3 mb-10 max-w-2xl",children:[...s,n(Hr.addSeats)].map((a,i)=>o.jsxs("li",{className:"flex gap-3 text-sm font-light leading-relaxed text-gray-700",children:[o.jsx(rb,{className:"h-4 w-4 text-[#220E99] mt-0.5 flex-shrink-0"}),o.jsx("span",{children:a})]},i))}),o.jsxs("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-ab-ink underline underline-offset-4 decoration-1 hover:text-[#220E99] hover:decoration-[#220E99] transition-colors",children:[n(Ss.startFreeTrial)," ",o.jsx(ya,{className:"h-3.5 w-3.5"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 py-16 md:py-20 border-t border-gray-200",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:["02 — ",n(Hr.teams)]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:n(Hr.teamPackage)})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsx("p",{className:"text-base md:text-lg text-gray-600 font-light leading-relaxed mb-8 max-w-xl",children:n(Hr.teamPackageDesc)}),o.jsxs("div",{className:"flex items-baseline gap-2 mb-10",children:[o.jsx("span",{className:"font-newsreader text-5xl md:text-6xl font-light tracking-tight tabular-nums",children:"$125"}),o.jsx("span",{className:"text-sm text-gray-500 font-light",children:n(Hr.moSeats)})]}),o.jsx("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3 mb-10 max-w-2xl",children:[n(Hr.seatTeamMgmt),...s].map((a,i)=>o.jsxs("li",{className:"flex gap-3 text-sm font-light leading-relaxed text-gray-700",children:[o.jsx(rb,{className:"h-4 w-4 text-[#220E99] mt-0.5 flex-shrink-0"}),o.jsx("span",{children:a})]},i))}),o.jsx(rr,{className:"rounded-full bg-[#220E99] hover:bg-[#220E99]/90 text-white px-8 h-11 text-sm font-normal",asChild:!0,children:o.jsxs("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:[n(Ss.startFreeTrial)," ",o.jsx(ya,{className:"h-3.5 w-3.5 ml-2"})]})})]})]}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mt-8",children:n(Hr.noCreditCard)})]})}),e==="appraisals"&&o.jsx("section",{className:"pb-20 md:pb-28 bg-white border-t border-gray-200 animate-in fade-in duration-300",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 py-16 md:py-20 border-b border-gray-200",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"01 — Included"}),o.jsx("h2",{className:"font-newsreader text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:n(Hr.everyAppraisalIncludes)})]}),o.jsx("div",{className:"md:col-span-8 grid grid-cols-1 md:grid-cols-3 gap-0 divide-y md:divide-y-0 md:divide-x divide-gray-200",children:[{title:n(Hr.fmv),desc:n(Hr.fmvDesc)},{title:n(Hr.rrv),desc:n(Hr.rrvDesc)},{title:n(Hr.unlimitedReports),desc:n(Hr.unlimitedReportsDesc)}].map((a,i)=>o.jsxs("div",{className:"py-8 md:py-0 md:px-6 first:md:pl-0 last:md:pr-0",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3 tabular-nums",children:String(i+1).padStart(2,"0")}),o.jsx("h3",{className:"font-newsreader text-2xl text-ab-ink mb-3 tracking-tight",children:a.title}),o.jsx("p",{className:"text-sm text-gray-600 font-light leading-relaxed",children:a.desc})]},i))})]}),o.jsxs("div",{className:"py-16 md:py-24 border-b border-gray-200",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"02 — THE RATE CARD"}),o.jsx("h2",{className:"font-newsreader text-ab-ink text-5xl md:text-6xl leading-[1.05] tracking-tight mb-4",children:"Appraisal pricing"}),o.jsx("p",{className:"text-lg md:text-xl text-gray-500 font-light leading-snug max-w-2xl mb-12",children:"Transparent, volume-based pricing for USPAP-compliant appraisal reports."}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4",children:[{tier:"TIER 01",name:"Essential",size:"1–10 artworks",buyIn:"—",covers:"—",perArtwork:"$500",recommended:!1},{tier:"TIER 02",name:"Standard",size:"11–25 artworks",buyIn:"$5,000",covers:"first 10",perArtwork:"$250",recommended:!1},{tier:"TIER 03",name:"Lifestyle",size:"26–100 artworks",buyIn:"$8,000",covers:"first 25",perArtwork:"$175",recommended:!0},{tier:"TIER 04",name:"Enterprise",size:"101+ artworks",buyIn:"$19,500",covers:"first 100",perArtwork:"$75",recommended:!1}].map(a=>{const i=a.recommended;return o.jsxs("div",{className:`flex flex-col px-6 md:px-8 py-10 md:py-12 border-t border-gray-200 md:border-l md:first:border-l-0 ${i?"bg-brand-blue text-white md:border-t-0 md:-my-10 md:pt-[88px] md:pb-[88px]":""}`,children:[o.jsxs("p",{className:`text-[10px] uppercase tracking-[0.2em] font-semibold mb-5 ${i?"text-white/70":"text-gray-400"}`,children:[a.tier,i&&" / Recommended"]}
418),o.jsx("h3",{className:`font-newsreader text-3xl leading-none mb-2 ${i?"text-white":"text-ab-ink"}`,children:a.name}),o.jsx("p",{className:`text-sm font-light mb-10 ${i?"text-white/80":"text-gray-500"}`,children:a.size}),o.jsxs("div",{className:"space-y-4 text-sm flex-grow",children:[o.jsxs("div",{className:"flex justify-between items-baseline",children:[o.jsx("span",{className:`font-light ${i?"text-white/80":"text-gray-500"}`,children:"Buy-in"}),o.jsx("span",{className:`tabular-nums ${i?"text-white":"text-ab-ink"}`,children:a.buyIn})]}),o.jsxs("div",{className:"flex justify-between items-baseline",children:[o.jsx("span",{className:`font-light ${i?"text-white/80":"text-gray-500"}`,children:"Covers"}),o.jsx("span",{className:i?"text-white":"text-ab-ink",children:a.covers})]}),o.jsxs("div",{className:`flex justify-between items-baseline pt-5 mt-5 border-t ${i?"border-white/20":"border-gray-300"}`,children:[o.jsx("span",{className:`font-light ${i?"text-white/80":"text-gray-500"}`,children:"Then, per artwork"}),o.jsx("span",{className:`font-ne
418wsreader text-3xl tabular-nums ${i?"text-white":"text-brand-blue"}`,children:a.perArtwork})]})]})]},a.name)})}),o.jsx("p",{className:"mt-8 text-sm font-light text-gray-500",children:"*No upper limit on Enterprise; above 500 artworks a custom quote can apply."}),o.jsxs("div",{className:"mt-10 flex flex-wrap gap-4",children:[o.jsx(rr,{className:"rounded-full bg-brand-blue text-white hover:bg-brand-blue/90 h-11 px-6 text-sm font-normal",asChild:!0,children:o.jsxs("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:["Get started ",o.jsx(ya,{className:"h-3.5 w-3.5 ml-2"})]})}),o.jsx(rr,{className:"rounded-full border border-gray-200 text-ab-ink bg-transparent hover:bg-ab-ink hover:text-white h-11 px-6 text-sm font-normal",asChild:!0,children:o.jsxs(Ut,{to:"/contact",children:["Contact Sales ",o.jsx(ya,{className:"h-3.5 w-3.5 ml-2"})]})})]})]})]})})]}),o.jsx(yn,{})]})},WY=1,VY="3f2713fe-5bd0-45a3-af7b-c91e95da1e4c",GY="17cb2d3e-4f29-42b6-944d-08f2733fb079",qY="/__l5e/assets-v1/3f2713fe-5bd0-45a3-af7b-c91e95da1e4c/product-hero-laptop.png",HY="a/v1/17cb2d3e-4f29-42b6-944d-08f2733fb079/3f2713fe-5bd0-45a3-af7b-c91e95da1e4c/product-hero-laptop.png",KY="product-hero-laptop.png",QY=171330,YY="image/png",JY="2026-06-24T14:50:01Z",ZY={version:WY,asset_id:VY,project_id:GY,url:qY,r2_key:HY,original_filename:KY,size:QY,content_type:YY,created_at:JY},XY="/assets/product-artwork-detail-nGo_guWd.png",eJ=ZY.url,po="#CA2344",tJ=()=>{const{t:e}=gc();return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Product — Appraisal Bureau",description:"A living system of record for collections, paired with independent, defensible valuations.",canonical:"/product"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-12 md:pb-16 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:po}}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold",style:{color:po},children:"Platform"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"A living record — for every collection"}),o.jsx("p",{className:"mt-8 text-lg md:text-xl text-gray-500 font-light leading-relaxed max-w-2xl",children:"One platform for documenting, valuing, and reporting on the works you own — built for the way collections actually move."}),o.jsxs("div",{className:"mt-10 flex flex-col sm:flex-row gap-6 items-start sm:items-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"text-white rounded-full px-8 h-12 text-base font-light hover:opacity-90",style:{background:po},children:e(Ss.signUp)})}),o.jsx(Ut,{to:"/contact",className:"text-black underline underline-offset-4 hover:text-gray-600 text-base font-light transition-colors",children:"Talk to our team"})]})]})}),o.jsx("section",{className:"pb-20 md:pb-28 bg-white",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsx("figure",{className:"w-4/5 mx-auto rounded-xl overflow-hidden bg-white ring-1 ring-gray-200/70",style:{boxShadow:"0 40px 80px -30px rgba(15, 23, 42, 0.28), 0 14px 28px -14px rgba(15, 23, 42, 0.14)"},children:o.jsx("img",{src:eJ,alt:"Appraisal Bureau workspace — multi-collection home view",className:"block w-full h-auto"})})})}),o.jsx("section",{className:"py-20 md:py-28 bg-white border-t border-gray-200",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-12",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold mb-3",style:{color:po},children:"The Record"}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:"One Platform for Complete Collection Oversight"})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsx("p",{className:"text-lg text-gray-700 font-light leading-relaxed max-w-2xl",children:"Every artwork, document, and decision in one place — organized for the people who steward the collection and the advisors who support it."}),o.jsx("p",{className:"mt-6 text-lg text-gray-700 font-light leading-relaxed max-w-2xl",children:"Permission-controlled access keeps teams, families, and stakeholders aligned from the same record, with the right visibility for every role."})]})]}),o.jsx("figure",{className:"ml-auto max-w-4xl md:w-3/4 rounded-xl overflow-hidden bg-white ring-1 ring-gray-200/70",style:{boxShadow:"0 40px 80px -30px rgba(15, 23, 42, 0.28), 0 14px 28px -14px rgba(15, 23, 42, 0.14)"},children:o.jsx("img",{src:XY,alt:"Workspace artwork detail — collection navigation, tags, and notes",className:"block w-full h-auto"})})]})}),o.jsx("section",{className:"py-20 md:py-28 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-14",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold mb-3",style:{color:"#220E99"},children:"Loupe"}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight mb-6",children:"Cataloguing, on auto
418pilot"}),o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx("span",{"aria-hidden":"true",className:"block rounded-full shrink-0",style:{width:28,height:28,border:"3px solid #220E99"}}),o.jsxs("span",{style:{fontFamily:'Plus Jakarta Sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontWeight:600,fontSize:28,lineHeight:1,letterSpacing:"-0.03em",color:"#0F172A"},children:["Loupe",o.jsx("sup",{style:{fontSize:"0.22em",fontWeight:500,marginLeft:"0.15em",top:"-2.2em",position:"relative",letterSpacing:"0.05em"},children:"TM"})]})]})]}),o.jsx("div",{className:"md:col-span-8",children:o.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-5 text-[15px] text-gray-700 font-light max-w-3xl",children:["Loupe reads and extracts artworks from documents, inventories, and invoices, and creates artwork entries","It reads cost invoices including shipping, framing, storage, and more, and keeps a running cost ledger for each artwork with invoices attached for audit-ready"].map((t,r)=>o.jsxs("li",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-2 w-1 h-1 rounded-full shrink-0",style:{backgroundColor:"#220E99"}}),o.jsx("span",{children:t})]},r))})})]})})}),o.jsx("section",{className:"py-20 md:py-28 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 items-start",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold mb-3",style:{color:po},children:"Valuations"}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:e(oY.valuationsForEveryPurpose)})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsx("p",{className:"text-lg text-gray-700 font-light leading-relaxed max-w-2xl",children:"Generate audit-ready appraisal reports for the systems art moves through."}),o.jsx("p",{className:"mt-6 text-lg text-gray-700 font-light leading-relaxed max-w-2xl",children:"Appraisal Bureau produces USPAP-compliant valuations built for insurance scheduling, tax and estate reporting, charitable contributions, financial reporting, equitable distribution, art-backed lending, and more."}),o.jsx("p",{className:"mt-6 text-lg text-gray-700 font-light leading-relaxed max-w-2xl",children:"Once values are posted by our team, generate institutionally defensible appraisal reports instantly — standardized, exportable, and ready for insurers, advisors, fiduciaries, auditors, or the IRS."}),o.jsx("ul",{className:"mt-10 grid grid-cols-1 sm:grid-cols-2 gap-x-10 gap-y-4 text-[15px] text-gray-700 font-light max-w-3xl",children:["Insurance scheduling & renewals","Tax & Estate reporting","Charitable contributions","Fair Market Value reporting","Equitable distribution","Art-backed lending"].map((t,r)=>o.jsxs("li",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-2 w-1 h-1 rounded-full shrink-0",style:{backgroundColor:po}}),o.jsx("span",{children:t})]},r))})]})]})})}),o.jsx("section",{className:"py-20 md:py-28 bg-white",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsx("div",{className:"border-t border-b border-gray-200 py-20 md:py-28",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 items-end",children:[o.jsxs("div",{className:"md:col-span-4 md:border-r md:border-gray-200 md:pr-10",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:po}}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.28em] text-gray-500 font-semibold",children:"Join"})]}),o.jsx("p",{className:"text-sm text-gray-500 font-light leading-relaxed",children:"A 30-day trial with full access to the platform. No credit card. No commitment."})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsxs("h2",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:["Where every",o.jsx("br",{}),"collection"," ","belongs"]}),o.jsxs("div",{className:"mt-10 flex flex-col sm:flex-row gap-6 items-start sm:items-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"text-white rounded-full px-8 h-12 text-base font-light hover:opacity-90",style:{background:po},children:e(Ss.signUp)})}),o.jsx(Ut,{to:"/contact",className:"text-black underline underline-offset-4 hover:text-gray-600 text-base font-light transition-colors",children:"Talk to our team"})]})]})]})})})})]}),o.jsx(yn,{})]})},rJ="/assets/caroline-taylor-CmEeSVPk.jpeg",ew=e=>`${e.split(" ")[0].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}@appraisalbureau.com`,rp={name:"Caroline Taylor",role:"CEO & Founder",bio:"With over 20 years of experience in the Contemporary Art markets and more than a decade as a Certified Appraiser of Post-War and Contemporary Art through the Appraisers Association of America, Caroline founded Appraisal Bureau to leverage technology in building scalable, data-driven valuation infrastru
418cture for the global art market. Previously, she held roles at the Deutsche Bank Collection, Phillips, The Metropolitan Museum of Art, and the Felix Gonzalez-Torres Foundation. Caroline holds a BFA in Painting from Pratt Institute and serves on the Chairman's Council and Acquisitions Committee of the Institute of Contemporary Art, Miami, and is a Board Member of Atlanta Contemporary.",linkedin:"https://www.linkedin.com/in/carolinetaylorappraisalbureau/"},nJ=[{name:"Ana Gutierrez-Folch",role:"Director of Appraisals",bio:"Ana is Director of Appraisals at Appraisal Bureau, where she leads appraisal operations and supports valuation projects across fine art and collections management. Prior to joining Appraisal Bureau, she served as Director of Appraisals at Gurr Johns and held leadership roles at Hindman Auctions and other leading art market organizations. She holds an M.A. from Bard Graduate Center and a B.A. in English and American Literature and History of Art and Architecture from Harvard University.",linkedin:"https://www.linkedin.com/in/ana-gutierrez-folch-27a18616/"},{name:"Valeria Díaz Ruiz",role:"Account Executive",bio:"Valeria Díaz Ruiz is an Account Executive at Appraisal Bureau, supporting client engagement, business development, and appraisal projects across the platform. Prior to joining Appraisal Bureau, she held valuation and appraisal roles at Heritage Auctions and Masterworks and worked in gallery operations and sales at David Zwirner and Lisson Gallery. She holds a B.A. in Art History from the University of Miami and has completed USPAP training through the Appraisers Association of America. She is a Candidate for Accredited Membership at the Appraisers Association of America.",linkedin:"https://www.linkedin.com/in/valeria-diaz-ruiz/"},{name:"Natalie Folse",role:"Appraiser",bio:"Natalie Folse is an Appraiser at Appraisal Bureau, supporting appraisal and collection management projects across the platform. Previously, she worked at Christie's in Object Intelligence and at Gagosian Art Advisory, with a focus on Post-War and Contemporary Art. She holds a Master's degree in Arts Administration from the University of New Orleans and a B.A. from Louisiana State University. She is USPAP compliant and an Accredited Member of the Appraisers Association of America.",linkedin:"https://www.linkedin.com/in/natalie-folse-56882653/"},{name:"Anna Greenspan",role:"Appraisal Associate",bio:"Anna Greenspan is an Appraisal Associate at Appraisal Bureau, conducting market research and valuation of Post-War and Contemporary Art across the platform. Previously, she researched 20th-21st Century Fine Art at Gurr Johns and coordinated valuations at Sotheby's. Anna holds a B.A. in Art History and Economics from Bates College. She is USPAP compliant and is a Candidate for Accredited Membership at the Appraisers Association of America.",linkedin:"https://www.linkedin.com/in/anna-greenspan-aaa398173/"},{name:"Jocelyn Campo",role:"Executive Assistant to the Founder & CEO",bio:"Jocelyn Campo is the Executive Assistant to the Founder and CEO at Appraisal Bureau, supporting executive operations, scheduling, and cross-team coordination. Prior to joining Appraisal Bureau, she held research and project management roles at Gurr Johns and gained experience at Gagosian Art Advisory. She holds a B.A. in Art History from McGill University and is USPAP compliant.",linkedin:"https://www.linkedin.com/in/jocelyn-campo/"}],sJ=[{name:"Sébastien Arnaud",role:"Technology Advisor",bio:"Advises on data architecture and AI systems with over a decade in engineering and machine learning. M.S., ESIEE Paris.",linkedin:"https://www.linkedin.com/in/arnaudsj/"}],aJ=()=>{const{t:e}=gc();return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Company — Appraisal Bureau",description:"The team building the infrastructure for art collection stewardship.",canonical:"/company"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Company"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Love your collection — manage it like an asset"})]})}),o.jsx("section",{className:"py-16 md:py-24 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Mission"})}),o.jsx("div",{className:"md:col-span-8 space-y-6 text-lg text-gray-700 font-light leading-relaxed",children:o.jsx("p",{children:e(lY.missionP1)})})]})})}),o.jsx("section",{className:"py-16 md:py-24 bg-white border-t border-gray-200",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-16",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"01 — Leadership"}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:"Our Leadership"})]}),o.jsx("div",{className:"md:col-span-8",children:o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-8 md:gap-10",children:[o.jsx("div",{className:"sm:col-span-5",children:o.jsx("img",{src:rJ,alt:"Caroline Taylor, CEO & Founder of Appraisal Bureau",className:"w-full h-auto object-cover",loading:"lazy"})}),o.jsxs("div",{className:"sm:col-span-7",children:[o.jsxs("div",{className:"flex items-baseline gap-3 mb-3",children:[o.jsx("h3",{className:"font-newsreader text-2xl md:text-3xl font-light text-ab-ink",children:rp.name}),o.jsx("a",{href:rp.linkedin,target:"_blank",rel:"noopener noreferrer","aria-label":`${rp.name} on LinkedIn`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(P_,{size:14})})]}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-500 font-semibold mb-5",children:rp.role}),o.jsx("p",{className:"text-gray-600 font-light leading-relaxed text-sm md:text-base",children:rp.bio})]})]})})]}),o.jsxs("div",{className:"border-t border-gray-200 pt-16",children:[o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-12",children:o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"02 — Appraisal Team"})})}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12 md:gap-10",children:nJ.map(t=>o.jsxs("div",{className:"md:border-r md:border-gray-200 md:last:border-r-0 md:pr-10",children:[o.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[o.jsx("h3",{className:"font-newsreader text-2xl font-light text-ab-ink",children:t.name}),t.linkedin&&o.jsx("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer","aria-label":`${t.name} on LinkedIn`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(P_,{size:14})}),o.jsx("a",{href:`mailto:${ew(t.name)}`,"aria-label":`Email ${t.name}`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(C_,{size:14})})]}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.22em] text-gray-500 font-semibold mb-5",children:t.role}),o.jsx("p",{className:"text-sm text-gray-600 font-light leading-relaxed",children:t.bio})]},t.name))})]}),o.jsxs("div",{className:"border-t border-gray-200 pt-16 mt-16",children:[o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-12",children:o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"03 — Technology Leadership"})})}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12 md:gap-10",children:sJ.map(t=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[o.jsx("h3",{className:"font-newsreader text-2xl font-light text-ab-ink",children:t.name}),o.jsx("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer","aria-label":`${t.name} on LinkedIn`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(P_,{size:14})}),o.jsx("a",{href:`mailto:${ew(t.name)}`,"aria-label":`Email ${t.name}`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(C_,{size:14})})]}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.22em] text-gray-500 font-semibold mb-5",children:t.role}),o.jsx("p",{className:"text-sm text-gray-600 font-light leading-relaxed",children:t.bio})]},t.name))})]}),o.jsxs("div",{className:"border-t border-gray-200 pt-16 mt-16",children:[o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 mb-12",children:o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"04 — Engineering"})})}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12 md:gap-10",children:[{name:"Shreyash Tripathi",role:"Software Engineer"},{name:"Sahil Rawal",role:"Software Engineer"},{name:"Nayan Gajjar",role:"Data & AI Engineer"}].map(t=>o.jsxs("div",{className:"md:border-r md:border-gray-200 md:last:border-r-0 md:pr-10 md:last:pr-0",children:[o.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[o.jsx("h3",{className:"font-newsreader text-2xl font-light text-ab-ink",children:t.name}),o.jsx("a",{href:`mailto:${ew(t.name)}`,"aria-label":`Email ${t.name}`,className:"text-gray-400 hover:text-[#220E99] transition-colors",children:o.jsx(C_,{size:14})})]}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.22em] text-gray-500 font-semibold",children:t.role})]},t.name))})]}),o.jsx("div",{className:"border-t border-gray-200 pt-16 mt-16",children:o.jsx("p",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink leading-relaxed max-w-3xl",children:"Appraisal Bureau is supported by investors and advisors across technology, finance, and the global art market."})})]})})]}),o.jsx(yn,{})]})};var iJ={name:"@lovable.dev/cloud-auth-js",version:"1.1.2",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}},oJ="authorization_response",lJ="/~oauth/initiate",cJ=["https://oauth.lovable.app","https://lovable.dev"],dJ="lovable://oauth-callback",uJ="http://127.0.0.1/iframe-oauth/callback",pJ=500,hJ=12e4;function fJ(e){let t;const r=new Promise(a=>{t=a}),n=a=>
418{if(!e.some(c=>a.origin===c))return;const l=a.data;!l||typeof l!="object"||l.type===oJ&&t(l.response)},s=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:s,messagePromise:r}}function mJ(e){const t=window.screenX!==0||window.screenY!==0||!e,r=t?window.outerWidth*.5:window.screen.width*.5,n=t?window.outerHeight*.5:window.screen.height*.5,s=t?window.screenX+(window.outerWidth-r)/2:(window.screen.width-r)/2,a=t?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:r,height:n,left:s,top:a}}function QP(e,t){return e.state!==t?{error:new Error("State is invalid")}:e.error?e.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(e.error_description??"Sign in failed")}:!e.access_token||!e.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}}function gJ(){const e=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}function yJ(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function vJ(e={}){const t=e.oauthBrokerUrl??lJ,r=e.supportedOAuthOrigins??cJ;async function n(s,a={}){let i=!1;try{i=window.self!==window.top}catch{i=!0}const l=navigator.userAgent,c=/LovableApp\//.test(l),d=!c&&/lovable/i.test(l),p=yJ();let u=a.redirect_uri??window.location.origin;c&&i?u=dJ:d&&i&&(u=uJ);const h=new URLSearchParams({...a.extraParams,provider:s,redirect_uri:u,state:p});if(!i)return window.location.href=`${t}?${h.toString()}`,{error:null,redirected:!0};!c&&!d&&h.set("response_mode","web_message");const f=`${t}?${h.toString()}`,m=d?[...r,window.location.origin]:r,{messagePromise:v,cleanup:k}=fJ(m);let y;if(gJ())y=window.open(f,"_blank");else{const{width:w,height:x,left:b,top:M}=mJ(i);y=window.open(f,"oauth",`width=${w},height=${x},left=${b},top=${M}`)}if(!y&&(c||d)){let w;const x=new Promise((b,M)=>{w=setTimeout(()=>{M(new Error("OAuth timed out waiting for response"))},hJ)});try{const b=await Promise.race([v,x]);return QP(b,p)}catch(b){return{error:b instanceof Error?b:new Error(String(b))}}finally{w&&clearTimeout(w),k()}}if(!y)return k(),{error:new Error("Popup was blocked")};let g;const _=new Promise((w,x)=>{g=setInterval(()=>{y.closed&&(clearInterval(g),x(new Error("Sign in was cancelled")))},pJ)});try{const w=await Promise.race([v,_]);return QP(w,p)}catch(w){return{error:w instanceof Error?w:new Error(String(w))}}finally{clearInterval(g),k(),y==null||y.close()}}return{signInWithOAuth:n}}typeof window<"u"&&(window.__lovable_cloud_auth_js_version=iJ.version);function _J(e={}){return vJ(e)}
418const wJ=_J(),xJ={auth:{signInWithOAuth:async(e,t)=>{const r=await wJ.signInWithOAuth(e,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(r.redirected||r.error)return r;try{await ec.auth.setSession(r.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return r}}};function bJ(e){return!e||!e.startsWith("/")||e.startsWith("//")?"/":e}const kJ=()=>{const[e]=vD(),t=d1(),r=bJ(e.get("next")),[n,s]=D.useState("signin"),[a,i]=D.useState(""),[l,c]=D.useState(""),[d,p]=D.useState(!1);D.useEffect(()=>{ec.auth.getSession().then(({data:f})=>{f.session&&t(r,{replace:!0})})},[t,r]);async function u(f){f.preventDefault(),p(!0);try{if(n==="signin"){const{error:m}=await ec.auth.signInWithPassword({email:a,password:l});if(m)throw m;t(r,{replace:!0})}else{const m=`${window.location.origin}${r}`,{error:v}=await ec.auth.signUp({email:a,password:l,options:{emailRedirectTo:m}});if(v)throw v;ha.success("Check your email to confirm your account.")}}catch(m){ha.error((m==null?void 0:m.message)??"Authentication failed")}finally{p(!1)}}async function h(){p(!0);const f=`${window.location.origin}${r}`,m=await xJ.auth.signInWithOAuth("google",{redirect_uri:f});"error"in m&&m.error&&(p(!1),ha.error(m.error.message??"Google sign-in failed"))}return o.jsxs("div",{className:"min-h-screen flex flex-col font-jakarta",children:[o.jsx(on,{}),o.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-12 bg-gradient-to-b from-white to-brand-light",children:o.jsxs("div",{className:"w-full max-w-md bg-white p-8 rounded-2xl shadow-md",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("h1",{className:"text-3xl font-extrabold mb-2 text-brand-black",children:n==="signin"?"Log in to your account":"Create your account"}),o.jsx("p",{className:"text-brand-gray font-light",children:n==="signin"?"Enter your email to sign in":"Enter your email to get started"})]}),o.jsxs("form",{onSubmit:u,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(vi,{htmlFor:"email",className:"font-bold",children:"Email"}),o.jsx(fa,{id:"email",type:"email",required:!0,placeholder:"[email protected]",value:a,onChange:f=>i(f.target.value),className:"border-brand-medium"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(vi,{htmlFor:"password",className:"font-bold",children:"Password"}),o.jsx(fa,{id:"password",type:"password",required:!0,minLength:6,value:l,onChange:f=>c(f.target.value),className:"border-brand-medium"})]}),o.jsx(rr,{type:"submit",disabled:d,className:"w-full bg-brand-red hover:bg-brand-red/90 text-white font-bold",children:d?"Please wait…":n==="signin"?"LOG IN":"SIGN UP"})]}),o.jsxs("div",{className:"my-4 flex items-center gap-3 text-xs text-brand-gray",children:[o.jsx("div",{className:"flex-1 h-px bg-brand-medium"}),o.jsx("span",{children:"OR"}),o.jsx("div",{className:"flex-1 h-px bg-brand-medium"})]}),o.jsx(rr,{type:"button",variant:"outline",disabled:d,onClick:h,className:"w-full font-bold",children:"Continue with Google"}),o.jsx("div",{className:"text-center text-sm mt-6",children:n==="signin"?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-brand-gray font-light",children:"Don't have an account? "}),o.jsx("button",{type:"button",onClick:()=>s("signup"),className:"text-brand-red hover:underline font-bold",children:"Sign up"})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-brand-gray font-light",children:"Already have an account? "}),o.jsx("button",{type:"button",onClick:()=>s("signin"),className:"text-brand-red hover:underline font-bold",children:"Log in"})]})})]})})]})},YP=[{id:"scope",number:"01",title:"Scope and Updates to this Privacy Policy",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:'This Privacy Policy applies to personal information processed by us, including on our websites, mobile applications, and other online or offline offerings. To make this Privacy Policy easier to read, our websites, mobile applications, and other offerings are collectively called the "Services."'}),o.jsxs("p",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Changes to our Privacy Policy."})," We may revise this Privacy Policy from time to time in our sole discretion. If there are any material changes to this Privacy Policy, we will notify you as required by applicable law. You understand and agree that you will be deemed to have accepted the updated Privacy Policy if you continue to use our Services after the new Privacy Policy takes effect."]}),o.jsxs("p",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Our role."})," Appraisal Bureau is the controller of the personal information described 
418in this Privacy Policy. We engage service providers — including cloud hosting, analytics and artificial intelligence technology providers — to process personal information on our behalf and on our documented instructions. Those providers act as processors, or as service providers under applicable U.S. state privacy laws, and not as independent controllers of the information they process for us."]})]})},{id:"collect",number:"02",title:"Personal Information We Collect",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The categories of personal information we collect depend on how you interact with us, our Services, and the requirements of applicable law. We collect information that you provide to us, information we obtain automatically when you use our Services, and information from other sources such as third-party services and organizations, as described below."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Personal information you provide to us directly"}),o.jsx("p",{children:"We may collect personal information that you provide to us."}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Account creation."})," Name, email, phone, mailing address and other physical addresses, referral source, username, and password."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Purchases."})," Details associated with your purchases, including payment information processed by third-party payment processors. We do not directly collect or store payment card information entered through our Services."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Integration credentials."})," Where you connect a third-party application or assistant to your Appraisal Bureau account, we collect and store the authorization tokens issued for that connection, such as OAuth access and refresh tokens. These allow the connected application to act on your behalf, and you can revoke them at any time."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Your communications with us."}),' Information submitted via our "Contact Us" form, newsletter sign-ups, support requests, or other communications.']}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Interactive features."})," Information you submit through public sharing features."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Conferences and events."})," Information collected when we host or attend events."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Business development."})," Information collected to assess potential business opportunities."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Job applications."})," Application materials, CV, cover letter, and related information."]})]}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Personal information collected automatically"}),o.jsx("p",{children:"We may collect certain information automatically, such as IP address, device identifiers, browser information, approximate location, and information about how you use our Services."}),o.jsx("p",{children:"We, and third parties that provide content or functionality on our Services, may use cookies, pixel tags, and other technologies to collect this information for purposes that are operationally necessary, performance-related, functionality-related, and advertising or targeting-related."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Analytics"}),o.jsx("p",{children:"We use analytics tools — including Google Analytics — to understand how our Services are used and to continually improve them. Our Services may also contain social media buttons whose interactions are governed by the privacy policy of the platform providing them."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Personal information collected from other sources"}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Third-party services and sources."})," We may obtain personal information from app stores, third-party login services, or social networking sites where you have made information available via your privacy settings."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Referrals and charitable donations."})," Tools that allow you to share information about friends and donees. Please only share contact information of people with whom you have a relationship."]})]})]})},{id:"use",number:"03",title:"How We Use Your Personal Information",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"We use your personal information for a variety of business purposes, including to provide our Services, for administrative purposes, and to market our products and Services."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Provide our Services"}),o.jsx("p",{children:"To manage your account, provide access to features, including AI-facilitated workflows, respond to support requests, communicate about your account and policy changes, process job applications, and allow you to register for events."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Administrative purposes"}),o.jsx("p",{children:"To pursue legitimate interests such as direct marketing, research, security, fraud prevention, debugging, auditing, internal quality control, identity verification, and compliance with legal obligations."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Marketing and advertising"}
418),o.jsx("p",{children:'To tailor content and advertisements as permitted by applicable law. If you would like to opt out of the use of your personal information for marketing purposes, contact us as set forth in "Contact Us" below.'}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"With your consent"}),o.jsx("p",{children:"For other purposes that are clearly disclosed to you at the time you provide personal information or with your consent."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"De-identified and aggregated information"}),o.jsx("p",{children:"We may use personal information to create de-identified or aggregated information for analytical and business purposes."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Artificial intelligence and model training"}),o.jsx("p",{children:"We do not use your personal information, your collection records, or the prompts and outputs generated through our AI-facilitated workflows to train foundation models. Our agreements with the artificial intelligence technology providers we engage, including the applicable data processing addendum, prohibit those providers from using that information to train their models."}),o.jsx("p",{children:"Where you choose to connect your Appraisal Bureau account to a third-party assistant under your own account with that provider, what happens to the resulting conversation is governed by your agreement and settings with that provider, not by this Privacy Policy. Protections differ between consumer and commercial plans, and some consumer plans permit the provider to use conversations for model training where the account holder has enabled that setting. We recommend reviewing your provider's privacy settings before connecting."})]})},{id:"disclose",number:"04",title:"How We Disclose Your Personal Information",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"We disclose your personal information to third parties for a variety of business purposes, including to provide our Services, to protect us or others, or in the event of a major business transaction."}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Service providers."})," Third-party vendors that assist with IT support, hosting, payment processing, and customer service."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Business partners."})," Partners with whom we jointly offer products or services, excluding mobile contact information."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Affiliates."})," Our company affiliates for administrative purposes and IT management."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Other users."})," Where our Services allow you to share personal information."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Advertising partners."})," Third-party advertising partners that may use Technologies to deliver personalized advertisements. We do not disclose mobile phone numbers to advertising partners."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"APIs / SDKs."})," Third-party APIs and SDKs that form part of our Services functionality."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Integrations you connect."}
418)," Applications and assistants you authorize to access your Appraisal Bureau account. Information is transmitted only in response to a request you initiate, only to the extent that request requires, and only within the scope of the access your organization and workspace roles already give you."]})]}),o.jsx("p",{children:"We may also disclose information to comply with law enforcement requests, protect rights or safety, enforce policies, or in connection with a merger, acquisition, financing, or sale of assets."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Integrations and artificial intelligence assistants"}),o.jsx("p",{children:"Appraisal Bureau offers integrations that let you connect your account to third-party applications and AI assistants. These connections are established by you, act with your own permissions, and can be disconnected by you at any time. We do not use information accessed through an integration — including your collection records, valuations and appraisal reports — for marketing or advertising purposes, and we do not disclose that information to advertising partners."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Mobile contact information and text messaging"}),o.jsx("p",{children:"We do not share mobile contact information with third parties or affiliates for marketing or promotional purposes. Mobile contact information may be shared with subcontractors that provide support services on our behalf, such as customer service. Text messaging originator opt-in data and consent are not shared with any third party for any purpose."})]})},{id:"rights",number:"05",title:"Your Privacy Choices and Rights",content:o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink",children:"Your privacy choices"}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Email communications."})," Use the unsubscribe link at the bottom of our marketing emails. You will continue to receive transaction-related communications."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Mobile devices."})," Opt out of push notifications and precise location sharing in y
418our device settings. To stop receiving text messages from us, reply STOP to any message; reply HELP for help."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Do Not Track."})," We do not currently respond to DNT signals."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Cookies and personalized advertising."})," Adjust your browser or device preferences to restrict the placement of Technologies."]})]}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Your privacy rights"}),o.jsx("p",{children:'In accordance with applicable law, you may have the right to access and port your personal information, request correction or deletion, restrict or object to certain processing, and withdraw your consent. To exercise these rights, contact us as set forth in "Contact Us" below.'})]})},{id:"security",number:"06",title:"Security of Your Information",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"We take steps to ensure that your information is treated securely and in accordance with this Privacy Policy. No system is 100% secure, and we cannot warrant the security of any information you provide to us."}),o.jsx("p",{children:"By using our Services or providing personal information, you agree that we may communicate with you electronically regarding security, privacy, and administrative issues relating to your use of our Services."})]})},{id:"transfers",number:"07",title:"International Data Transfers",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"All information processed by us may be transferred, processed, and stored anywhere in the world, including the United States. We endeavor to safeguard your information consistent with the requirements of applicable laws."}),o.jsx("p",{children:"If we transfer personal information originating in the European Economic Area, Switzerland, or the United Kingdom to a country that has not been found to provide an adequate level of protection, one of the safeguards we may use is the EU Standard Contractual Clauses."})]})},{id:"retention",number:"08",title:"Retention of Personal Information",content:o.jsx(o.Fragment,{children:o.jsx("p",{children:"We store the personal information we collect for as long as you use our Services, or as necessary to fulfill the purposes for which it was collected, provide our Services, resolve disputes, establish legal defenses, conduct audits, pursue legitimate business purposes, enforce our agreements, and comply with applicable laws."})})},{id:"nevada",number:"09",title:"Supplemental Notice for Nevada Residents",content:o.jsx("p",{children:'Nevada residents have the right to opt out of the sale of certain personal information. Contact us at [email protected] with the subject line "Nevada Do Not Sell Request." We do not currently sell personal information as defined in Nevada Revised Statutes Chapter 603A.'})},{id:"children",number:"10",title:"Children's Information",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The Services are not directed to children under 13, and we do not knowingly collect personal information from children."}),o.jsx("p",{children:"If you believe a child has uploaded personal information to our Services without consent, contact us as described below to have it modified or deleted."})]})},{id:"canada",number:"11",title:"Supplemental Notice for Canada",content:o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Security of your information."})," Files containing your personal information are kept on our servers or those of our service providers, accessible only to employees who require it."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"International transfers."})," Personal information may be accessible to courts and authorities of the United States. Contact us for more information about our policies regarding service providers outside Canada."]})]})},{id:"eea",number:"12",title:"Supplemental Notice for the European Economic Area, Switzerland and the United Kingdom",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"If you are located in the European Economic Area, Switzerland or the United Kingdom, we process your personal information on the following legal bases."}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Performance of a contract."})," To provide the Services you or your organization have engaged us for, including appraisals, platform access and integrations you connect."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Legitimate interests."})," To secure and improve our Services, prevent fraud, conduct internal analytics, and pursue business development, where those interests are not overridden by your rights."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Consent."})," For marketing communications and for any processing we ask you to agree to separately. You may withdraw consent at any time."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"font-medium text-ab-ink",children:"Legal obligation."})," Where processing is necessary to comply with a legal or regulatory requirement to which we are subject."]})]}),o.jsx("p",{children:"You have the right to access, correct, delete, restrict or object to our processing of your personal information, to receive a portable copy, and to lodge a complaint with your local supervisory authority. To exercise any of these rights, contact us as set out in 'Contact Us' below."}),o.jsx("p",{children:'Appraisal Bureau, Inc. is established in the United States. Personal information relating to individuals in the European Economic Area, Switzerland and the United Kingdom is transferred to and processed in the United States, as de
418scribed in "International Data Transfers" above.'})]})},{id:"other",number:"13",title:"Other Provisions",content:o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink",children:"Third-party websites and applications"}),o.jsx("p",{children:"The Services may contain links to other websites and applications that are not controlled by us. We encourage you to read the privacy policies of each website and application with which you interact."}),o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink mt-8",children:"Supervisory authority"}),o.jsx("p",{children:"If your personal information is subject to applicable data protection laws of the EEA, Switzerland, or the UK, you have the right to lodge a complaint with the competent supervisory authority — the EEA Data Protection Authorities, the Swiss FDPIC, or the UK ICO."})]})},{id:"contact",number:"14",title:"Contact Us",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Appraisal Bureau is the controller of the personal information processed under this Privacy Policy. If you have any questions about our privacy practices or to exercise your rights, contact us at:"}),o.jsxs("address",{className:"not-italic font-newsreader text-lg md:text-xl text-ab-ink leading-relaxed mt-6",children:["Appraisal Bureau, Inc.",o.jsx("br",{}),"408 Broadway",o.jsx("br",{}),"Floor 2",o.jsx("br",{}),"New York, NY 10007",o.jsx("br",{}),o.jsx("a",{href:"mailto:[email protected]",className:"text-[#220E99] hover:underline",children:"[email protected]"})]})]})}],TJ=()=>o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Privacy Policy | Appraisal Bureau",description:"How Appraisal Bureau collects, uses, and protects your personal information.",canonical:"/privacy-policy"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Legal"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Privacy Policy"}),o.jsx("p",{className:"mt-8 text-sm uppercase tracking-[0.2em] text-gray-400 font-semibold",children:"Last updated · September 16, 2026"})]})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Introduction"})}),o.jsx("div",{className:"md:col-span-8",children:o.jsx("p",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink leading-relaxed",children:"Appraisal Bureau, Inc. provides valuations of fine art and digital assets for purposes of insurance, equitable distribution, tax and estate planning, charitable donation, and art as collateral. This Privacy Policy is designed to help you understand how we collect, use, process, and share your personal information — and to help you exercise your privacy rights."})})]})})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Contents"})}),o.jsx("div",{className:"md:col-span-8",children:o.jsx("ol",{className:"divide-y divide-gray-200 border-t border-b border-gray-200",children:YP.map(e=>o.jsx("li",{children:o.jsxs("a",{href:`#${e.id}`,className:"flex items-baseline gap-6 py-4 group hover:text-[#220E99] transition-colors",children:[o.jsx("span",{className:"text-xs font-mono text-gray-400 group-hover:text-[#220E99] tabular-nums",children:e.number}),o.jsx("span",{className:"font-newsreader text-lg md:text-xl font-light text-ab-ink group-hover:text-[#220E99]",children:e.title})]})},e.id))})})]})})}),YP.map(e=>o.jsx("section",{id:e.id,className:"py-16 md:py-24 bg-white border-t border-gray-200 scroll-mt-24",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:[e.number," — Section"]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:e.title})]}),o.jsx("div",{className:"md:col-span-8 space-y-5 text-base md:text-lg text-gray-700 font-light leading-relaxed",children:e.content})]})})},e.id))]}),o.jsx(yn,{})]}),Kt=({children:e})=>o.jsx("strong",{className:"font-medium text-ab-ink",children:e}),JP=[{id:"agreement",number:"01",title:"Agreement to Terms",content:o.jsx("p",{children:`By using our Services, you agree to be bound by these Terms. If you don't agree, do not use the Services. If you are accessing and using the Services on behalf of a business, you represent and warrant that you have the authority to bind that entity to these Terms. In that case, "you" and "your" will refer to that business and you will ensure that your employees, end-users and customers comply with the Terms.`})},{id:"privacy",number:"02",title:"Privacy Policy",content:o.jsxs("p",{children:["Please review our ",o.jsx("a",{href:"/privacy-policy",className:"text-[#220E99] hover:underline",children:"Privacy Policy"}),", which also governs your use of the Services, for information on how we 
418collect, use and share your information."]})},{id:"changes",number:"03",title:"Changes to these Terms or the Services",content:o.jsx("p",{children:"We may update the Terms from time to time in our sole discretion. If we do, we'll let you know by posting updated Terms on the Site. If you continue to use the Services after we have posted updated Terms, you accept the changes. Because our Services evolve, we may change or discontinue all or any part of the Services at any time. If you do not accept such changes, you may discontinue your use of the Services and request a refund for prepaid unused Services."})},{id:"who",number:"04",title:"Who May Use the Services",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Your account."})," You may use the Services only if you are 18 or older and capable of forming a binding contract with Appraisal Bureau. Provide accurate, complete and current account information and keep it up to date. Keep your account details and password confidential, and notify us of any unauthorized use."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Authorized users."})," If you are a company or organization, your account and Subscription may let you permit employees, contractors and other authorized personnel to use the Services. You are responsible for all acts or omissions of your Authorized Users and their compliance with these Terms."]})]})},{id:"appraisal",number:"05",title:"Appraisal Services",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Overview."}),' Appraisal Bureau provides appraisal services for fine art, physical property, works of art associated with a digital asset, and other artworks (each, an "Appraised Asset") through proprietary methods. You may purchase appraisal services through the Site or by contacting us. Bespoke appraisal plans are agreed in a separate written estimate letter incorporated by reference.']}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Asset documentation."})," You agree to provide the documentation Appraisal Bureau requires to complete the appraisal. Delays in receipt of documentation may delay completion. You are responsible for ensuring all documentation is accurate and complete."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Appraisal report."})," Each appraisal is subject to all statements, assumptions and limiting conditions set forth in the appraisal report. Your use of the report constitutes acceptance of those Appraisal Conditions, which are incorporated into and form part of these Terms with respect to the appraisal in which they are contained."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Completion."})," Appraisal Bureau's obligations are complete when the valuation has been made available to you. We will be reasonably responsive to legitimate inquiries but will not modify any appraisal report except in our sole good-faith discretion in accordance with industry standards."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Withdrawal."})," Appraisal Bureau may withdraw without penalty if incomplete information was provided, if necessary documentation cannot be supplied, if conditions render the original scope inappropriate, if a conflict of interest arises, or if payment obligations are not met."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Services not provided."})," The fees do not include meetings with persons other than you and your advisors, depositions or testimony before judicial, arbitration or administrative tribunals, or preparation associated with such testimony. Additional services are subject to a separate written agreement."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Testimony in court or other proceedings."})," Engagement under these Terms does not include participation in or preparation for discovery, sworn testimony, or attendance at any judicial, arbitration or administrative proceeding. You will not designate Appraisal Bureau as an expert witness without our prior written consent. If we elect or are compelled to respond to any Legal Inquiry, you will reimburse all related costs at our then-current hourly rate."]})]})},{id:"payment",number:"06",title:"Payment",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"You agree to pay fees for use of the Services as set forth in writing or per Appraisal Bureau's standard rates. A One-Time Payment is required for individual or bundled appraisals. A Subscription requires recurring fees at the cadence determined by your selected plan. Fees are subject to change in our sole discretion with notice prior to the affected Services."}),o.jsxs("p",{children:[o.jsx(Kt,{children:"General."})," You authorize us (or our payment processor) to charge you for each Transaction. You represent that you have the legal r
418ight to use the payment methods provided. All payments are non-refundable and non-transferable except as expressly provided. All fees are payable in U.S. dollars."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Subscriptions."})," By purchasing a Subscription you authorize Appraisal Bureau to initiate recurring non-refundable payments at the cadence of your selected plan, until you cancel."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Cancellation."})," Each Transaction is final. You may cancel a Subscription at any time, effective at the end of the then-current Subscription period; you will not receive a refund for that period. To cancel, email [email protected]."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Pausing your Subscription."})," You may pause your Subscription at any time. While paused, you will not have access to the Services and will not be charged. Subscription Fees may continue to accrue during a pause and will be due upon reactivation."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Taxes."})," All fees do not include sales, use, value-added or other applicable taxes, which are your sole responsibility (excluding taxes based on Appraisal Bureau's net income)."]})]})},{id:"feedback",number:"07",title:"Feedback",content:o.jsx("p",{children:"We appreciate Feedback. If you submit Feedback, you agree that we are free to use it without restriction or compensation."})},{id:"ip",number:"08",title:"Intellectual Property and User Content",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Posting content."}),' Anything you post or make available through the Services (other than Feedback) is "User Content." Appraisal Bureau does not claim ownership of User Content.']}),o.jsxs("p",{children:[o.jsx(Kt,{children:"License to your content."})," By making User Content available through the Services, you grant Appraisal Bureau a non-exclusive, transferable, worldwide, royalty-free license, with the right to sublicense, to use, copy, modify, distribute, publicly display and publicly perform your User Content in connection with operating and providing the Services. We may also derive or aggregate data in anonymized form for any lawful purpose."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Your responsibility."})," You represent and warrant that you have all necessary rights in your User Content and that it does not infringe any third-party rights or violate any law."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Removal."})," You can remove your User Content by deleting it. Some copies may continue to exist on the Services. To the maximum extent permitted by law, we are not responsible for the removal or failure to remove any User Content."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Appraisal Bureau materials."})," Except for the appraisal report, Appraisal Bureau exclusively owns all rights in any software, methodologies, algorithms, tools, processes and materials used or developed in connection with the Services."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Freedom of action."})," Nothing in these Terms restricts our right to perform similar services for any other party."]})]})},{id:"prohibited",number:"09",title:"Prohibited Conduct and Enforcement",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"You agree not to:"}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsx("li",{children:"Post User Content that infringes third-party rights, violates the law, is fraudulent, defamatory, obscene, harassing or threatening, or promotes illegal or harmful activities;"}),o.jsx("li",{children:"Use, mirror or frame the Services or our trademarks without our written consent;"}),o.jsx("li",{children:"Access non-public areas of the Services or attempt to probe, scan or test the vulnerability of any system;"}),o.jsx("li",{children:"Bypass any technological measure implemented to protect the Services;"}),o.jsx("li",{children:"Use any spider, robot, crawler or data-mining tool to access or download content from the Services;"}),o.jsx("li",{children:"Send unsolicited advertising, spam or chain letters;"}),o.jsx("li",{children:"Use the Services for any commercial purpose not permitted by these Terms;"}),o.jsx("li",{children:"Decipher, decompile, disassemble or reverse engineer any of the softw
418are used to provide the Services;"}),o.jsx("li",{children:"Interfere with the access of any user, host or network;"}),o.jsx("li",{children:"Collect personally identifiable information from other users without permission;"}),o.jsx("li",{children:"Impersonate or misrepresent your affiliation with any person or entity;"}),o.jsx("li",{children:"Violate any applicable law or regulation; or encourage any other person to do any of the foregoing."})]}),o.jsx("p",{children:"The restrictions on automated access above do not apply to integrations that Appraisal Bureau makes available and that you have authorized on your own account, including our application programming interfaces and our connectors for third-party applications and AI assistants, when used in accordance with these Terms and any documentation we publish for them."}),o.jsx("p",{children:"We may, but are not obligated to, monitor, remove or disable access to any content that we consider objectionable or in violation of these Terms."})]})},{id:"third-party",number:"10",title:"Third-Party Services and Integrations",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Third-party resources."})," The Services may allow you to access third-party resources. We provide access only as a convenience and are not responsible for those resources. You assume all risk arising from your use of any third-party resources."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Integrations you authorize."})," We offer integrations that let you connect your Appraisal Bureau account to third-party applications and AI assistants. You establish these connections yourself, they operate with the permissions your organization and workspace roles already give you, and you may disconnect them at any time. You are responsible for deciding which third parties to authorize and for the acts and omissions of anyone you grant access to through them."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Third-party terms apply."})," A third party you connect processes your information under its own terms and privacy policy, not ours, and we are not responsible for that processing. Protections vary between consumer and commercial plans of the same service. We recommend reviewing the terms and privacy settings of any service before you connect it."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Availability."})," We may modify, suspend or discontinue any integration at any time, and a third party may do the same with its own service, without liability to you."]})]})},{id:"termination",number:"11",title:"Termination",content:o.jsx("p",{children:"We may suspend or terminate your access to the Services at any time at our sole discretion, with notice via email. You may cancel your account at any time in your account settings. Upon termination, the following Sections will survive: 6 (for amounts owed), 8(b), 8(c), 8(e), 9, 11, and 12 through 19."})},{id:"warranties",number:"12",title:"Your Representations and Warranties",content:o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsx("li",{children:"The works you provide and your obligations under these Terms do not conflict with any other agreement or violate any third-party rights;"}),o.jsx("li",{children:"You will not use Appraisal Bureau's appraisal report or any Appraised Asset for any unlawful purpose or to violate third-party rights;"}),o.jsx("li",{children:'You comply with all "know your customer," anti-money laundering, counter-terrorism financing and sanctions laws applicable to you;'}),o.jsx("li",{children:"You comply with anti-corruption (including the FCPA), anti-money laundering (including the Bank Secrecy Act and USA PATRIOT Act), and economic sanctions laws (including OFAC sanctions and the EAR). You are not located in or controlled by parties subject to Trade Restrictions and will notify Appraisal Bureau if you become so;"}),o.jsx("li",{children:"If using the Services in connection with Digital Assets, you will not use the value of any Digital Asset for capital raising, will not violate securities laws, and acknowledge the inherent risks of cryptographic and blockchain-based systems and the volatility of Digital Asset markets."})]})},{id:"warranty",number:"13",title:"Warranty and Disclaimers",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The express warranties in this Section are in lieu of, and Appraisal Bureau disclaims, all other warranties, express or implied, including any implied warranties of merchantability, fitness for a particular purpose and non-infringement."}),o.jsx("p",{children:'Appraisal Bureau will provide all appraisals in accordance with the Uniform Standards of Professional Appraisal Practice (USPAP). As your sole and exclusive remedy for any breach of this warranty, Appraisal Bureau will, at its option, re-perform the non-conforming Services or refund the fees paid for them. Except as expressly set forth above, the Services are provided "as is," without warranty of any kind. We make no warranty that the Services will meet your requirements or be uninterrupted, secure or error-free.'}),o.jsx("p",{children:"You acknowledge that Appraisal Bureau offers appraisal services but is not a buyer, seller, creator, custodian or insurance broker with respect to any Appraised Asset."}),o.jsx("p",{children:"Appraisal Bureau is not liable for any loss arising from action taken in reliance on material in the Services. You bear full responsibility for verifying the identity, legitimacy and authenticity of any Appraised Asset."}),o.jsx("p",{children:"The Services do not guarantee your compliance with applicable laws, including KYC, AML and sanctions laws. Appraisal Bureau does not provide legal advice; determining the legality, validity and enforceability of your actions is your sole responsibility."})]})},{id:"indemnity",number:"14",title:"Indemnity",content:o.jsx("p",{children:"You will indemnify and hold Appraisal Bureau and its officers, directors, employees and agents harmless from any claims, liabilities, damages and costs (including reasonable legal fees) arising from your access to or use of the Services, your User Content, your violation of these Terms or representations, claims arising from the Appraised Assets or Asset Documentation, gross negligence, fraud or intentional misconduct, or your violation of any law."})},{id:"liability",number:"15",title:"Limitation of Liability",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"To the maximum extent permitted by law, neither Appraisal Bureau nor its service providers will be liable for any incidental, special, exemplary or consequential damages, or for lost profits, lost revenues, lost savings, lost business opportunity, loss of data or goodwill, service interruption, computer damage or system failure, or the cost of substitute services, whether based on warranty, contract, tort, product liability or any other legal theory."}),o.jsx("p",{children:"To the maximum extent permitted by applicable law, Appraisal Bureau's total liability arising from these Terms or the use of the Services will not exceed the amounts you have paid to Appraisal Bureau and Appraisal Bureau has retained in the past three (3) months."}),o.jsx("p",{children:"The exclusions and limitations of damages set forth above are fundamental elements of the basis of the bargain between you and Appraisal Bureau."})]})},{id:"law",number:"16",title:"Governing Law and Forum Choice",content:o.jsx("p",{children:"These Terms are governed by the Federal Arbitration Act and the laws of the State of New York, without regard to its conflict-of-laws provisions. Except as set forth in Section 17, the exclusive jurisdiction for Disputes you and Appraisal Bureau are not required to arbitrate is the state and federal courts located in New York, New York."})},{id:"dispute",number:"17",title:"Dispute Resolution",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Mandatory arbitration."})," Any dispute arising out of or relating to these Terms or the Services will be resolved by binding, individual arbitration and not in a class, representative or consolidated action. The U.S. Federal Arbitration Act governs the interpretation and enforcement of these Terms."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Exceptions."})," Either party may seek to resolve a Dispute in small claims court if it qualifies, and either party retains the right to seek injunctive relief from a court to prevent infringement of intellectual property rights."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Conducting arbitration."})," Arbitration will be conducted by JAMS pursuant to its rules then in effect. Disputes under $250,000 are subject to JAMS's Streamlined Arbitration Rules; all other claims are subject to its Comprehensive Arbitration Rules. Hearings will take place in the county where you live unless we agree otherwise."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Costs."})," Filing, administration and arbitrator fees are governed by the JAMS Rules and JAMS' Consumer Arbitration Minimum Standards."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Injunctive relief."})," The arbitrator may award declaratory or injunctive relief only in favor of the individual party seeking relief."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Class action waiver."})," You and Appraisal Bureau may bring claims against each other only in your or its individual capacity, and not as a plaintiff or class member in any purported class or representative proceeding."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Severability."})," Other than the Class Action Waiver, if any part of these Terms is found invalid or unenforceable, the other parts will remain in effect."]})]})},{id:"general",number:"18",title:"General Terms",content:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx(Kt,{children:"Reservation of rights."})," Appraisal Bureau and its licensors own all right, title and interest in and to the Services, including all intellectual property rights."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Entire agreement."}
418)," These Terms constitute the entire agreement between you and Appraisal Bureau regarding the Services and supersede all prior understandings. You may not assign these Terms without our prior written consent. Appraisal Bureau may freely assign these Terms."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Notices."})," Notices will be given via email or by posting to the Services."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Waiver."})," Our failure to enforce any right or provision is not a waiver of that right or provision."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Force majeure."})," Neither party is responsible for delays in performance (other than payment) due to causes beyond its reasonable control."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Non-solicitation."})," During the term and for twelve (12) months thereafter, you will not solicit for employment any Appraisal Bureau employees or subcontractors who participated in the Services without our prior written approval."]}),o.jsxs("p",{children:[o.jsx(Kt,{children:"Counterparts."})," These Terms may be executed in counterparts, each of which will be deemed an original."]})]})},{id:"contact",number:"19",title:"Contact Information",content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"If you have any questions about these Terms or the Services, please contact us at:"}),o.jsxs("address",{className:"not-italic font-newsreader text-lg md:text-xl text-ab-ink leading-relaxed mt-6",children:["Appraisal Bureau, Inc.",o.jsx("br",{}),"408 Broadway, Floor 2",o.jsx("br",{}),"New York, NY 10007",o.jsx("br",{}),o.jsx("a",{href:"mailto:[email protected]",className:"text-[#220E99] hover:underline",children:"[email protected]"}),o.jsx("br",{}),"+1 (929) 209-6028"]})]})}],MJ=()=>o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Terms of Service | Appraisal Bureau",description:"The terms governing your use of Appraisal Bureau's services.",canonical:"/terms-of-service"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Legal"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Terms of Service"}),o.jsx("p",{className:"mt-8 text-sm uppercase tracking-[0.2em] text-gray-400 font-semibold",children:"Last updated · September 16, 2026"})]})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Introduction"})}),o.jsxs("div",{className:"md:col-span-8 space-y-8",children:[o.jsxs("p",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink leading-relaxed",children:["Please read these Terms and our ",o.jsx("a",{href:"/privacy-policy",className:"text-[#220E99] hover:underline",children:"Privacy Policy"})," carefully — they govern your use of the services accessible via ",o.jsx("a",{href:"https://appraisalbureau.com/",className:"text-[#220E99] hover:underline",target:"_blank",rel:"noopener noreferrer",children:"appraisalbureau.com"})," or otherwise provided by Appraisal Bureau, Inc."]}),o.jsxs("div",{className:"border-l-2 border-[#220E99] pl-6 py-2",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold mb-2",children:"Important notice — U.S. users"}),o.jsx("p",{className:"text-sm md:text-base text-gray-700 font-light leading-relaxed",children:"When you agree to these Terms you are agreeing (with limited exception) to resolve any dispute between you and Appraisal Bureau through binding arbitration rather than 
418in court. Please review Section 17 — Dispute Resolution carefully for details."})]})]})]})})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Contents"})}),o.jsx("div",{className:"md:col-span-8",children:o.jsx("ol",{className:"divide-y divide-gray-200 border-t border-b border-gray-200",children:JP.map(e=>o.jsx("li",{children:o.jsxs("a",{href:`#${e.id}`,className:"flex items-baseline gap-6 py-4 group hover:text-[#220E99] transition-colors",children:[o.jsx("span",{className:"text-xs font-mono text-gray-400 group-hover:text-[#220E99] tabular-nums",children:e.number}),o.jsx("span",{className:"font-newsreader text-lg md:text-xl font-light text-ab-ink group-hover:text-[#220E99]",children:e.title})]})},e.id))})})]})})}),JP.map(e=>o.jsx("section",{id:e.id,className:"py-16 md:py-24 bg-white border-t border-gray-200 scroll-mt-24",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:[e.number," — Section"]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:e.title})]}),o.jsx("div",{className:"md:col-span-8 space-y-5 text-base md:text-lg text-gray-700 font-light leading-relaxed",children:e.content})]})})},e.id))]}),o.jsx(yn,{})]}),Gc=({children:e})=>o.jsx("h3",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mt-10 first:mt-0",children:e}),Ds=({children:e})=>o.jsx("p",{className:"mt-4 text-base font-light text-gray-600 leading-relaxed",children:e}),pn=({children:e})=>o.jsx("li",{className:"text-base font-light text-gray-600 leading-relaxed",children:e}),EJ=()=>{const[e,t]=D.useState(null),r=n=>t(e===n?null:n);return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Careers — Appraisal Bureau",description:"Open roles at Appraisal Bureau. Come work with us.",canonical:"/careers"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Careers"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Come work with us."}),o.jsx("p",{className:"mt-8 text-lg md:text-xl font-light text-gray-600 max-w-2xl leading-relaxed",children:"We're modernizing how art is valued — turning appraisals into a data-driven service for collectors and their stakeholders. Join us early."})]})}),o.jsx("section",{className:"py-16 md:py-24 bg-white border-t border-gray-200",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"flex items-baseline justify-between mb-10",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:"Open Roles"})}),o.jsxs("div",{className:"border-t border-b border-gray-200",children:[o.jsxs("button",{onClick:()=>r("appraiser"),className:"w-full flex items-center justify-between gap-6 py-8 text-left group","aria-expanded":e==="appraiser",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl tracking-tight group-hover:text-[#220E99] transition-colors",children:"Appraiser, Post-War and Contemporary Art"}),o.jsx("p",{className:"mt-2 text-sm font-light text-gray-500",children:"New York, NY · Full-time · $80,000–$90,000 base salary, plus equity and benefits"})]}),o.jsx(uR,{className:`h-5 w-5 shrink-0 text-gray-400 transition-transform duration-200 ${e==="appraiser"?"rotate-180":""}`})]}),e==="appraiser"&&o.jsxs("div",{className:"pb-12 md:pb-16",children:[o.jsx(Gc,{
418children:"About Appraisal Bureau"}),o.jsx(Ds,{children:"Appraisal Bureau is the system of record and valuation infrastructure for art collections, operating at the intersection of art, technology, and finance."}),o.jsx(Ds,{children:"We provide independent, conflict-free valuation and collection management infrastructure for private collectors, family offices, museums, financial institutions, advisors, and other organizations. Our technology brings collection records, market data, and professional appraisal workflows together in a single platform."}),o.jsx(Gc,{children:"The Role"}),o.jsx(Ds,{children:"We are seeking an experienced appraiser of post-war and contemporary art to join our growing appraisal team. This is an opportunity to work with some of the strongest collections of contemporary art globally while practicing appraisal in a fundamentally modern environment. Our appraisers work directly within Appraisal Bureau's proprietary platform, using technology-enabled and AI-supported workflows designed to make research, market analysis, valuation, and report production more efficient and rigorous."}),o.jsx(Ds,{children:"Technology supports the process, while professional expertise and judgment remain at the center of every valuation. The appraiser will research and value contemporary artworks, analyze comparable sales and broader market data, and prepare well-supported, USPAP-compliant appraisal reports across a range of purposes."}),o.jsx(Ds,{children:"The position is particularly well suited to an established appraiser who wants to practice at a high level while working with novel technology and helping shape the next generation of art valuation infrastructure."}
418),o.jsx(Gc,{children:"Responsibilities"}),o.jsxs("ul",{className:"mt-4 space-y-2.5 list-disc pl-5",children:[o.jsx(pn,{children:"Research and value contemporary artworks for fair market value, replacement value, and other appropriate valuation purposes"}),o.jsx(pn,{children:"Prepare rigorous, USPAP-compliant appraisal reports for charitable contributions, estate and tax planning, insurance, lending, financial reporting, and other client needs"}),o.jsx(pn,{children:"Conduct in-depth research into artists, individual works, provenance, exhibition history, literature, and relevant markets"}),o.jsx(pn,{children:"Analyze auction results, gallery and private-market information, comparable sales, and broader market trends"}),o.jsx(pn,{children:"Develop and clearly articulate valuation methodologies and conclusions"}),o.jsx(pn,{children:"Work directly within Appraisal Bureau's platform and utilize our technology-enabled and AI-supported appraisal workflows"}),o.jsx(pn,{children:"Collaborate with clients and the broader Appraisal Bureau team to establish appraisal scope and gather necessary documentation"}),o.jsx(pn,{children:"Manage multiple appraisal projects and deadlines while maintaining a high level of accuracy and attention to detail"}),o.jsx(pn,{children:"Maintain complete research, comparable-sale, and valuation documentation within the Appraisal Bureau platform"}),o.jsx(pn,{children:"Stay current on contemporary art markets, artists, galleries, auction houses, and relevant market developments"}),o.jsx(pn,{children:"Contribute to the continued development of Appraisal Bureau's appraisal methodologies, data, and technology-enabled workflows"})]}
418),o.jsx(Gc,{children:"Qualifications"}),o.jsx(Ds,{children:"Professional fine-art appraisal experience and a strong working knowledge of contemporary art and its markets are required."}),o.jsx(Ds,{children:"Accreditation or certification is required, particularly through the Appraisers Association of America (AAA). Accreditation or certification through the International Society of Appraisers (ISA) or American Society of Appraisers (ASA) will also be considered."}),o.jsx(Ds,{children:"The ideal candidate will also have:"}),o.jsxs("ul",{className:"mt-4 space-y-2.5 list-disc pl-5",children:[o.jsx(pn,{children:"Current USPAP training and a strong understanding of professional appraisal standards"}),o.jsx(pn,{children:"Demonstrated experience valuing contemporary art"}),o.jsx(pn,{children:"Strong knowledge of the primary and secondary art markets"}),o.jsx(pn,{children:"Excellent research, analytical, and writing skills"}),o.jsx(pn,{children:"The ability to evaluate comparable sales and translate complex market information into defensible valuation conclusions"}),o.jsx(pn,{children:"Exceptional attention to detail and a high standard of professional judgment"}),o.jsx(pn,{children:"Strong organizational and project-management skills"}),o.jsx(pn,{children:"Comfort working independently while collaborating closely with a team"}),o.jsx(pn,{children:"Interest in technology and enthusiasm for incorporating new tools and AI-supported workflows into professional appraisal practice"}),o.jsx(pn,{children:"High standards of discretion and confidentiality when working with significant private collections and sensitive financial information"})]}
vendor: 24,487 bytes, line 418
418),o.jsx(Gc,{children:"Location & Compensation"}),o.jsx(Ds,{children:"The position is based in New York City, with a hybrid working arrangement. We are also open to a remote arrangement for an exceptional candidate with the appropriate appraisal experience and credentials."}),o.jsx(Ds,{children:"Base salary is $80,000–$90,000, depending on experience and qualifications. The compensation package also includes equity options, medical, dental and vision insurance, a 401(k) retirement plan, and generous PTO."}),o.jsx(Gc,{children:"Why Appraisal Bureau"}),o.jsx(Ds,{children:"This is an opportunity to join a growing company transforming how art collections are managed and valued. Rather than working across disconnected databases, spreadsheets, research tools, and reports, our appraisers work within a purpose-built technology platform that leverages technology and AI to replace fragmented, legacy systems with modern infrastructure for art valuation."}),o.jsx(Ds,{children:"You will have the opportunity to work on significant contemporary art collections, collaborate with sophisticated collectors and institutions, and help define how professional appraisal practice evolves as better data, software, and AI become part of the field."}),o.jsx(Ds,{children:"Appraisal Bureau is an equal opportunity employer."}),o.jsxs("div",{className:"mt-10",children:[o.jsx("a",{href:"mailto:[email protected]?subject=Application%3A%20Appraiser%2C%20Post-War%20and%20Contemporary%20Art",className:"inline-block",children:o.jsx(rr,{className:"rounded-full bg-black text-white hover:bg-black/85 h-11 px-8 text-sm font-light",children:"Apply for this role"})}),o.jsxs("p",{className:"mt-4 text-sm font-light text-gray-500",children:["Send your resume and a short note to"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-[#220E99] underline underline-offset-4 hover:text-[#1a0b7a] transition-colors",children:"[email protected]"}),"."]})]})]})]}),o.jsxs("p",{className:"mt-12 text-base font-light text-gray-500 leading-relaxed max-w-2xl",children:["If you'd like to be considered for future opportunities, please email"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-[#220E99] underline underline-offset-4 hover:text-[#1a0b7a] transition-colors",children:"[email protected]"}),"."]})]})})]}),o.jsx(yn,{})]})};var $h=e=>e.type==="checkbox",ql=e=>e instanceof Date,vs=e=>e==null;const AF=e=>typeof e=="object";var gn=e=>!vs(e)&&!Array.isArray(e)&&AF(e)&&!ql(e),SJ=e=>gn(e)&&e.target?$h(e.target)?e.target.checked:e.target.value:e,AJ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,PJ=(e,t)=>e.has(AJ(t)),CJ=e=>{const t=e.constructor&&e.constructor.prototype;return gn(t)&&t.hasOwnProperty("isPrototypeOf")},_1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function la(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(_1&&(e instanceof Blob||e instanceof FileList))&&(r||gn(e)))if(t=r?[]:{},!r&&!CJ(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=la(e[n]));else return e;return t}var Py=e=>Array.isArray(e)?e.filter(Boolean):[],fn=e=>e===void 0,dt=(e,t,r)=>{if(!t||!gn(e))return r;const n=Py(t.split(/[,[\].]+?/)).reduce((s,a)=>vs(s)?s:s[a],e);return fn(n)||n===e?fn(e[t])?r:e[t]:n},fi=e=>typeof e=="boolean",w1=e=>/^\w*$/.test(e),PF=e=>Py(e.replace(/["|']|\]/g,"").split(/\.|\[/)),br=(e,t,r)=>{let n=-1;const s=w1(t)?[t]:PF(t),a=s.length,i=a-1;for(;++n<a;){const l=s[n];let c=r;if(n!==i){const d=e[l];c=gn(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(l==="__proto__")return;e[l]=c,e=e[l]}return e};const ZP={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ga={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ci={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};Le.createContext(null);var jJ=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(s,a,{get:()=>{const i=a;return t._proxyFormState[i]!==Ga.all&&(t._proxyFormState[i]=!n||Ga.all),e[i]}});return s},Es=e=>gn(e)&&!Object.keys(e).length,IJ=(e,t,r,n)=>{r(e);const{name:s,...a}=e;return Es(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(i=>t[i]===Ga.all)},qm=e=>Array.isArray(e)?e:[e];function $J(e){const t=Le.useRef(e);t.current=e,Le.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var xi=e=>typeof e=="string",NJ=(e,t,r,n,s)=>xi(e)?(n&&t.watch.add(e),dt(r,e,s)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),dt(r,a))):(n&&(t.watchAll=!0),r),CF=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},XP=e=>({isOnSubmit:!e||e===Ga.onSubmit,isOnBlur:e===Ga.onBlur,isOnChange:e===Ga.onChange,isOnAll:e===Ga.all,isOnTouch:e===Ga.onTouched}),eC=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Lp=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const a=dt(e,s);if(a){const{_f:i,...l}=a;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Lp(l,t))break}else if(gn(l)&&Lp(l,t))break}}};var OJ=(e,t,r)=>{const n=qm(dt(e,r));return br(n,"root",t[r]),br(e,r,n),e},x1=e=>e.type==="file",zi=e=>typeof e=="function",Og=e=>{if(!_1)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hm=e=>xi(e),b1=e=>e.type==="radio",Rg=e=>e instanceof RegExp;const tC={value:!1,isValid:!1},rC={value:!0,isValid:!0};var jF=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!fn(e[0].attributes.value)?fn(e[0].value)||e[0].value===""?rC:{value:e[0].value,isValid:!0}:rC:tC}return tC};const nC={isValid:!1,value:null};var IF=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,nC):nC;function sC(e,t,r="validate"){if(Hm(e)||Array.isArray(e)&&e.every(Hm)||fi(e)&&!e)return{type:r,message:Hm(e)?e:"",ref:t}}var qc=e=>gn(e)&&!Rg(e)?e:{value:e,message:""},aC=async(e,t,r,n,s)=>{const{ref:a,refs:i,required:l,maxLength:c,minLength:d,min:p,max:u,pattern:h,validate:f,name:m,valueAsNumber:v,mount:k,disabled:y}=e._f,g=dt(t,m);if(!k||y)return{};const _=i?i[0]:a,w=U=>{n&&_.reportValidity&&(_.setCustomValidity(fi(U)?"":U||""),_.reportValidity())},x={},b=b1(a),M=$h(a),S=b||M,j=(v||x1(a))&&fn(a.value)&&fn(g)||Og(a)&&a.value===""||g===""||Array.isArray(g)&&!g.length,I=CF.bind(null,m,r,x),q=(U,R,K,H=Ci.maxLength,ee=Ci.minLength)=>{const te=U?R:K;x[m]={type:U?H:ee,message:te,ref:a,...I(U?H:ee,te)}};if(s?!Array.isArray(g)||!g.length:l&&(!S&&(j||vs(g))||fi(g)&&!g||M&&!jF(i).isValid||b&&!IF(i).isValid)){const{value:U,message:R}=Hm(l)?{value:!!l,message:l}:qc(l);if(U&&(x[m]={type:Ci.required,message:R,ref:_,...I(Ci.required,R)},!r))return w(R),x}if(!j&&(!vs(p)||!vs(u))){let U,R;const K=qc(u),H=qc(p);if(!vs(g)&&!isNaN(g)){const ee=a.valueAsNumber||g&&+g;vs(K.value)||(U=ee>K.value),vs(H.value)||(R=ee<H.value)}else{const ee=a.valueAsDate||new Date(g),te=ne=>new Date(new Date().toDateString()+" "+ne),V=a.type=="time",ae=a.type=="week";xi(K.value)&&g&&(U=V?te(g)>te(K.value):ae?g>K.value:ee>new Date(K.value)),xi(H.value)&&g&&(R=V?te(g)<te(H.value):ae?g<H.value:ee<new Date(H.value))}if((U||R)&&(q(!!U,K.message,H.message,Ci.max,Ci.min),!r))return w(x[m].message),x}if((c||d)&&!j&&(xi(g)||s&&Array.isArray(g))){const U=qc(c),R=qc(d),K=!vs(U.value)&&g.length>+U.value,H=!vs(R.value)&&g.length<+R.value;if((K||H)&&(q(K,U.message,R.message),!r))return w(x[m].message),x}if(h&&!j&&xi(g)){const{value:U,message:R}=qc(h);if(Rg(U)&&!g.match(U)&&(x[m]={type:Ci.pattern,message:R,ref:a,...I(Ci.pattern,R)},!r))return w(R),x}if(f){if(zi(f)){const U=await f(g,t),R=sC(U,_);if(R&&(x[m]={...R,...I(Ci.validate,R.message)},!r))return w(R.message),x}else if(gn(f)){let U={};for(const R in f){if(!Es(U)&&!r)break;const K=sC(await f[R](g,t),_,R);K&&(U={...K,...I(R,K.message)},w(K.message),r&&(x[m]=U))}if(!Es(U)&&(x[m]={ref:_,...U},!r))return x}}return w(!0),x};function RJ(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=fn(e)?n++:e[t[n++]];return e}function DJ(e){for(const t in e)if(e.hasOwnProperty(t)&&!fn(e[t]))return!1;return!0}function Nn(e,t){const r=Array.isArray(t)?t:w1(t)?[t]:PF(t),n=r.length===1?e:RJ(e,r),s=r.length-1,a=r[s];return n&&delete n[a],s!==0&&(gn(n)&&Es(n)||Array.isArray(n)&&DJ(n))&&Nn(e,r.slice(0,-1)),e}var tw=()=>{let e=[];return{get observers(){return e},next:s=>{for(const a of e)a.next&&a.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(a=>a!==s)}}),unsubscribe:()=>{e=[]}}},Pb=e=>vs(e)||!AF(e);function Mo(e,t){if(Pb(e)||Pb(t))return e===t;if(ql(e)&&ql(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const a=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(ql(a)&&ql(i)||gn(a)&&gn(i)||Array.isArray(a)&&Array.isArray(i)?!Mo(a,i):a!==i)return!1}}return!0}var $F=e=>e.type==="select-multiple",FJ=e=>b1(e)||$h(e),rw=e=>Og(e)&&e.isConnected,NF=e=>{for(const t in e)if(zi(e[t]))return!0;return!1};function Dg(e,t={}){const r=Array.isArray(e);if(gn(e)||r)for(const n in e)Array.isArray(e[n])||gn(e[n])&&!NF(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Dg(e[n],t[n])):vs(e[n])||(t[n]=!0);return t}function OF(e,t,r){const n=Array.isArray(e);if(gn(e)||n)for(const s in e)Array.isArray(e[s])||gn(e[s])&&!NF(e[s])?fn(t)||Pb(r[s])?r[s]=Array.isArray(e[s])?Dg(e[s],[]):{...Dg(e[s])}:OF(e[s],vs(t)?{}:t[s],r[s]):r[s]=!Mo(e[s],t[s]);return r}var np=(e,t)=>OF(e,t,Dg(t)),RF=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>fn(e)?e:t?e===""?NaN:e&&+e:r&&xi(e)?new Date(e):n?n(e):e;function nw(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return x1(t)?t.files:b1(t)?IF(e.refs).value:$F(t)?[...t.selectedOptions].map(({value:r})=>r):$h(t)?jF(e.refs).value:RF(fn(t.value)?e.ref.value:t.value,e)}var LJ=(e,t,r,n)=>{const s={};for(const a of e){const i=dt(t,a);i&&br(s,a,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},sp=e=>fn(e)?e:Rg(e)?e.source:gn(e)?Rg(e.value)?e.value.source:e.value:e;const iC="AsyncFunction";var zJ=e=>(!e||!e.validate)&&!!(zi(e.validate)&&e.validate.constructor.name===iC||gn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===iC)),BJ=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function oC(e,t,r){const n=dt(e,r);if(n||w1(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const a=s.join("."),i=dt(t,a),l=dt(e,a);if(i&&!Array.isArray(i)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};s.pop()}return{name:r}}var UJ=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,WJ=(e,t)=>!Py(dt(e,t)).length&&Nn(e,t);const VJ={mode:Ga.onSubmit,reValidateMode:Ga.onChange,shouldFocusError:!0};function GJ(e={}){let t={...VJ,...e},r={submitCount:0,isDirty:!1,isLoading:zi(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=gn(t.defaultValues)||gn(t.values)?la(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:la(s),i={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={values:tw(),array:tw(),state:tw()},h=XP(t.mode),f=XP(t.reValidateMode),m=t.criteriaMode===Ga.all,v=Q=>re=>{clearTimeout(d),d=setTimeout(Q,re)},k=async Q=>{if(!e.disabled&&(p.isValid||Q)){const re=t.resolver?Es((await S()).errors):await I(n,!0);re!==r.isValid&&u.state.next({isValid:re})}},y=(Q,re)=>{!e.disabled&&(p.isValidating||p.validatingFields)&&((Q||Array.from(l.mount)).forEach(pe=>{pe&&(re?br(r.validatingFields,pe,re):Nn(r.validatingFields,pe))}),u.state.next({validatingFields:r.validatingFields,isValidating:!Es(r.validatingFields)}))},g=(Q,re=[],pe,Me,Te=!0,me=!0)=>{if(Me&&pe&&!e.disabled){if(i.action=!0,me&&Array.isArray(dt(n,Q))){const Pe=pe(dt(n,Q),Me.argA,Me.argB);Te&&br(n,Q,Pe)}if(me&&Array.isArray(dt(r.errors,Q))){const Pe=pe(dt(r.errors,Q),Me.argA,Me.argB);Te&&br(r.errors,Q,Pe),WJ(r.errors,Q)}if(p.touchedFields&&me&&Array.isArray(dt(r.touchedFields,Q))){const Pe=pe(dt(r.touchedFields,Q),Me.argA,Me.argB);Te&&br(r.touchedFields,Q,Pe)}p.dirtyFields&&(r.dirtyFields=np(s,a)),u.state.next({name:Q,isDirty:U(Q,re),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else br(a,Q,re)},_=(Q,re)=>{br(r.errors,Q,re),u.state.next({errors:r.errors})},w=Q=>{r.errors=Q,u.state.next({errors:r.errors,isValid:!1})},x=(Q,re,pe,Me)=>{const Te=dt(n,Q);if(Te){const me=dt(a,Q,fn(pe)?dt(s,Q):pe);fn(me)||Me&&Me.defaultChecked||re?br(a,Q,re?me:nw(Te._f)):H(Q,me),i.mount&&k()}},b=(Q,re,pe,Me,Te)=>{let me=!1,Pe=!1;const Be={name:Q};if(!e.disabled){const rt=!!(dt(n,Q)&&dt(n,Q)._f&&dt(n,Q)._f.disabled);if(!pe||Me){p.isDirty&&(Pe=r.isDirty,r.isDirty=Be.isDirty=U(),me=Pe!==Be.isDirty);const et=rt||Mo(dt(s,Q),re);Pe=!!(!rt&&dt(r.dirtyFields,Q)),et||rt?Nn(r.dirtyFields,Q):br(r.dirtyFields,Q,!0),Be.dirtyFields=r.dirtyFields,me=me||p.dirtyFields&&Pe!==!et}if(pe){const et=dt(r.touchedFields,Q);et||(br(r.touchedFields,Q,pe),Be.touchedFields=r.touchedFields,me=me||p.touchedFields&&et!==pe)}me&&Te&&u.state.next(Be)}return me?Be:{}},M=(Q,re,pe,Me)=>{const Te=dt(r.errors,Q),me=p.isValid&&fi(re)&&r.isValid!==re;if(e.delayError&&pe?(c=v(()=>_(Q,pe)),c(e.delayError)):(clearTimeout(d),c=null,pe?br(r.errors,Q,pe):Nn(r.errors,Q)),(pe?!Mo(Te,pe):Te)||!Es(Me)||me){const Pe={...Me,...me&&fi(re)?{isValid:re}:{},errors:r.errors,name:Q};r={...r,...Pe},u.state.next(Pe)}},S=async Q=>{y(Q,!0);const re=await t.resolver(a,t.context,LJ(Q||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(Q),re},j=async Q=>{const{errors:re}=await S(Q);if(Q)for(const pe of Q){const Me=dt(re,pe);Me?br(r.errors,pe,Me):Nn(r.errors,pe)}else r.errors=re;return re},I=async(Q,re,pe={valid:!0})=>{for(const Me in Q){const Te=Q[Me];if(Te){const{_f:me,...Pe}=Te;if(me){const Be=l.array.has(me.name),rt=Te._f&&zJ(Te._f);rt&&p.validatingFields&&y([Me],!0);const et=await aC(Te,a,m,t.shouldUseNativeValidation&&!re,Be);if(rt&&p.validatingFields&&y([Me]),et[me.name]&&(pe.valid=!1,re))break;!re&&(dt(et,me.name)?Be?OJ(r.errors,et,me.name):br(r.errors,me.name,et[me.name]):Nn(r.errors,me.name))}!Es(Pe)&&await I(Pe,re,pe)}}return pe.valid},q=()=>{for(const Q of l.unMount){const re=dt(n,Q);re&&(re._f.refs?re._f.refs.every(pe=>!rw(pe)):!rw(re._f.ref))&&de(Q)}l.unMount=new Set},U=(Q,re)=>!e.disabled&&(Q&&re&&br(a,Q,re),!Mo(L(),s)),R=(Q,re,pe)=>NJ(Q,l,{...i.mount?a:fn(re)?s:xi(Q)?{[Q]:re}:re},pe,re),K=Q=>Py(dt(i.mount?a:s,Q,e.shouldUnregister?dt(s,Q,[]):[])),H=(Q,re,pe={})=>{const Me=dt(n,Q);let Te=re;if(Me){const me=Me._f;me&&(!me.disabled&&br(a,Q,RF(re,me)),Te=Og(me.ref)&&vs(re)?"":re,$F(me.ref)?[...me.ref.options].forEach(Pe=>Pe.selected=Te.includes(Pe.value)):me.refs?$h(me.ref)?me.refs.length>1?me.refs.forEach(Pe=>(!Pe.defaultChecked||!Pe.disabled)&&(Pe.checked=Array.isArray(Te)?!!Te.find(Be=>Be===Pe.value):Te===Pe.value)):me.refs[0]&&(me.refs[0].checked=!!Te):me.refs.forEach(Pe=>Pe.checked=Pe.value===Te):x1(me.ref)?me.ref.value="":(me.ref.value=Te,me.ref.type||u.values.next({name:Q,values:{...a}})))}(pe.shouldDirty||pe.shouldTouch)&&b(Q,Te,pe.shouldTouch,pe.shouldDirty,!0),pe.shouldValidate&&ne(Q)},ee=(Q,re,pe)=>{for(const Me in re){const Te=re[Me],me=`${Q}.${Me}`,Pe=dt(n,me);(l.array.has(Q)||gn(Te)||Pe&&!Pe._f)&&!ql(Te)?ee(me,Te,pe):H(me,Te,pe)}},te=(Q,re,pe={})=>{const Me=dt(n,Q),Te=l.array.has(Q),me=la(re);br(a,Q,me),Te?(u.array.next({name:Q,values:{...a}}),(p.isDirty||p.dirtyFields)&&pe.shouldDirty&&u.state.next({name:Q,dirtyFields:np(s,a),isDirty:U(Q,me)})):Me&&!Me._f&&!vs(me)?ee(Q,me,pe):H(Q,me,pe),eC(Q,l)&&u.state.next({...r}),u.values.next({name:i.mount?Q:void 0,values:{...a}})},V=async Q=>{i.mount=!0;const re=Q.target;let pe=re.name,Me=!0;const Te=dt(n,pe),me=()=>re.type?nw(Te._f):SJ(Q),Pe=Be=>{Me=Number.isNaN(Be)||ql(Be)&&isNaN(Be.getTime())||Mo(Be,dt(a,pe,Be))};if(Te){let Be,rt;const et=me(),Ye=Q.type===ZP.BLUR||Q.type===ZP.FOCUS_OUT,Fe=!BJ(Te._f)&&!t.resolver&&!dt(r.errors,pe)&&!Te._f.deps||UJ(Ye,dt(r.touchedFields,pe),r.isSubmitted,f,h),lt=eC(pe,l,Ye);br(a,pe,et),Ye?(Te._f.onBlur&&Te._f.onBlur(Q),c&&c(0)):Te._f.onChange&&Te._f.onChange(Q);const It=b(pe,et,Ye,!1),Qt=!Es(It)||lt;if(!Ye&&u.values.next({name:pe,type:Q.type,values:{...a}}),Fe)return p.isValid&&(e.mode==="onBlur"?Ye&&k():k()),Qt&&u.state.next({name:pe,...lt?{}:It});if(!Ye&&lt&&u.state.next({...r}),t.resolver){const{errors:Gt}=await S([pe]);if(Pe(et),Me){const zr=oC(r.errors,n,pe),hr=oC(Gt,n,zr.name||pe);Be=hr.error,pe=hr.name,rt=Es(Gt)}}else y([pe],!0),Be=(await aC(Te,a,m,t.shouldUseNativeValidation))[pe],y([pe]),Pe(et),Me&&(Be?rt=!1:p.isValid&&(rt=await I(n,!0)));Me&&(Te._f.deps&&ne(Te._f.deps),M(pe,rt,Be,It))}},ae=(Q,re)=>{if(dt(r.errors,re)&&Q.focus)return Q.focus(),1},ne=async(Q,re={})=>{let pe,Me;const Te=qm(Q);if(t.resolver){const me=await j(fn(Q)?Q:Te);pe=Es(me),Me=Q?!Te.some(Pe=>dt(me,Pe)):pe}else Q?(Me=(await Promise.all(Te.map(async me=>{const Pe=dt(n,me);return await I(Pe&&Pe._f?{[me]:Pe}:Pe)}))).every(Boolean),!(!Me&&!r.isValid)&&k()):Me=pe=await I(n);return u.state.next({...!xi(Q)||p.isValid&&pe!==r.isValid?{}:{name:Q},...t.resolver||!Q?{isValid:pe}:{},errors:r.errors}),re.shouldFocus&&!Me&&Lp(n,ae,Q?Te:l.mount),Me},L=Q=>{const re={...i.mount?a:s};return fn(Q)?re:xi(Q)?dt(re,Q):Q.map(pe=>dt(re,pe))},$=(Q,re)=>({invalid:!!dt((re||r).errors,Q),isDirty:!!dt((re||r).dirtyFields,Q),error:dt((re||r).errors,Q),isValidating:!!dt(r.validatingFields,Q),isTouched:!!dt((re||r).touchedFields,Q)}),G=Q=>{Q&&qm(Q).forEach(re=>Nn(r.errors,re)),u.state.next({errors:Q?r.errors:{}})},se=(Q,re,pe)=>{const Me=(dt(n,Q,{_f:{}})._f||{}).ref,Te=dt(r.errors,Q)||{},{ref:me,message:Pe,type:Be,...rt}=Te;br(r.errors,Q,{...rt,...re,ref:Me}),u.state.next({name:Q,errors:r.errors,isValid:!1}),pe&&pe.shouldFocus&&Me&&Me.focus&&Me.focus()},_e=(Q,re)=>zi(Q)?u.values.subscribe({next:pe=>Q(R(void 0,re),pe)}):R(Q,re,!0),de=(Q,re={})=>{for(const pe of Q?qm(Q):l.mount)l.mount.delete(pe),l.array.delete(pe),re.keepValue||(Nn(n,pe),Nn(a,pe)),!re.keepError&&Nn(r.errors,pe),!re.keepDirty&&Nn(r.dirtyFields,pe),!re.keepTouched&&Nn(r.touchedFields,pe),!re.keepIsValidating&&Nn(r.validatingFields,pe),!t.shouldUnregister&&!re.keepDefaultValue&&Nn(s,pe);u.values.next({values:{...a}}),u.state.next({...r,...re.keepDirty?{isDirty:U()}:{}}),!re.keepIsValid&&k()},Ee=({disabled:Q,name:re,field:pe,fields:Me,value:Te})=>{if(fi(Q)&&i.mount||Q){const me=Q?void 0:fn(Te)?nw(pe?pe._f:dt(Me,re)._f):Te;br(a,re,me),b(re,me,!1,!1,!0)}},ze=(Q,re={})=>{let pe=dt(n,Q);const Me=fi(re.disabled)||fi(e.disabled);return br(n,Q,{...pe||{},_f:{...pe&&pe._f?pe._f:{ref:{name:Q}},name:Q,mount:!0,...re}}),l.mount.add(Q),pe?Ee({field:pe,disabled:fi(re.disabled)?re.disabled:e.disabled,name:Q,value:re.value}):x(Q,!0,re.value),{...Me?{disabled:re.disabled||e.disabled}:{},...t.progressive?{required:!!re.required,min:sp(re.min),max:sp(re.max),minLength:sp(re.minLength),maxLength:sp(re.maxLength),pattern:sp(re.pattern)}:{},name:Q,onChange:V,onBlur:V,ref:Te=>{if(Te){ze(Q,re),pe=dt(n,Q);const me=fn(Te.value)&&Te.querySelectorAll&&Te.querySelectorAll("input,select,textarea")[0]||Te,Pe=FJ(me),Be=pe._f.refs||[];if(Pe?Be.find(rt=>rt===me):me===pe._f.ref)return;br(n,Q,{_f:{...pe._f,...Pe?{refs:[...Be.filter(rw),me,...Array.isArray(dt(s,Q))?[{}]:[]],ref:{type:me.type,name:Q}}:{ref:me}}}),x(Q,!1,void 0,me)}else pe=dt(n,Q,{}),pe._f&&(pe._f.mount=!1),(t.shouldUnregister||re.shouldUnregister)&&!(PJ(l.array,Q)&&i.action)&&l.unMount.add(Q)}}},Ke=()=>t.shouldFocusError&&Lp(n,ae,l.mount),ve=Q=>{fi(Q)&&(u.state.next({disabled:Q}),Lp(n,(re,pe)=>{const Me=dt(n,pe);Me&&(re.disabled=Me._f.disabled||Q,Array.isArray(Me._f.refs)&&Me._f.refs.forEach(Te=>{Te.disabled=Me._f.disabled||Q}))},0,!1))},J=(Q,re)=>async pe=>{let Me;pe&&(pe.preventDefault&&pe.preventDefault(),pe.persist&&pe.persist());let Te=la(a);if(u.state.next({isSubmitting:!0}),t.resolver){const{errors:me,values:Pe}=await S();r.errors=me,Te=Pe}else await I(n);if(Nn(r.errors,"root"),Es(r.errors)){u.state.next({errors:{}});try{await Q(Te,pe)}catch(me){Me=me}}else re&&await re({...r.errors},pe),Ke(),setTimeout(Ke);if(u.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Es(r.errors)&&!Me,submitCount:r.submitCount+1,errors:r.errors}),Me)throw Me},ue=(Q,re={})=>{dt(n,Q)&&(fn(re.defaultValue)?te(Q,la(dt(s,Q))):(te(Q,re.defaultValue),br(s,Q,la(re.defaultValue))),re.keepTouched||Nn(r.touchedFields,Q),re.keepDirty||(Nn(r.dirtyFields,Q),r.isDirty=re.defaultValue?U(Q,la(dt(s,Q))):U()),re.keepError||(Nn(r.errors,Q),p.isValid&&k()),u.state.next({...r}))},Y=(Q,re={})=>{const pe=Q?la(Q):s,Me=la(pe),Te=Es(Q),me=Te?s:Me;if(re.keepDefaultValues||(s=pe),!re.keepValues){if(re.keepDirtyValues){const Pe=new Set([...l.mount,...Object.keys(np(s,a))]);for(const Be of Array.from(Pe))dt(r.dirtyFields,Be)?br(me,Be,dt(a,Be)):te(Be,dt(me,Be))}else{if(_1&&fn(Q))for(const Pe of l.mount){const Be=dt(n,Pe);if(Be&&Be._f){const rt=Array.isArray(Be._f.refs)?Be._f.refs[0]:Be._f.ref;if(Og(rt)){const et=rt.closest("form");if(et){et.reset();break}}}}n={}}a=e.shouldUnregister?re.keepDefaultValues?la(s):{}:la(me),u.array.next({values:{...me}}),u.values.next({values:{...me}})}l={mount:re.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!p.isValid||!!re.keepIsValid||!!re.keepDirtyValues,i.watch=!!e.shouldUnregister,u.state.next({submitCount:re.keepSubmitCount?r.submitCount:0,isDirty:Te?!1:re.keepDirty?r.isDirty:!!(re.keepDefaultValues&&!Mo(Q,s)),isSubmitted:re.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Te?{}:re.keepDirtyValues?re.keepDefaultValues&&a?np(s,a):r.dirtyFields:re.keepDefaultValues&&Q?np(s,Q):re.keepDirty?r.dirtyFields:{},touchedFields:re.keepTouched?r.touchedFields:{},errors:re.keepErrors?r.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Se=(Q,re)=>Y(zi(Q)?Q(a):Q,re);return{control:{register:ze,unregister:de,getFieldState:$,handleSubmit:J,setError:se,_executeSchema:S,_getWatch:R,_getDirty:U,_updateValid:k,_removeUnmounted:q,_updateFieldArray:g,_updateDisabledField:Ee,_getFieldArray:K,_reset:Y,_resetDefaultValues:()=>zi(t.defaultValues)&&t.defaultValues().then(Q=>{Se(Q,t.resetOptions),u.state.next({isLoading:!1})}),_updateFormState:Q=>{r={...r,...Q}},_disableForm:ve,_subjects:u,_proxyFormState:p,_setErrors:w,get _fields(){return n},get _formValues(){return a},get _state(){return i},set _state(Q){i=Q},get _defaultValues(){return s},get _names(){return l},set _names(Q){l=Q},get _formState(){return r},set _formState(Q){r=Q},get _options(){return t},set _options(Q){t={...t,...Q}}},trigger:ne,register:ze,handleSubmit:J,watch:_e,setValue:te,getValues:L,reset:Se,resetField:ue,clearErrors:G,unregister:de,setError:se,setFocus:(Q,re={})=>{const pe=dt(n,Q),Me=pe&&pe._f;if(Me){const Te=Me.refs?Me.refs[0]:Me.ref;Te.focus&&(Te.focus(),re.shouldSelect&&Te.select())}},getFieldState:$}}function qJ(e={}){const t=Le.useRef(),r=Le.useRef(),[n,s]=Le.useState({isDirty:!1,isValidating:!1,isLoading:zi(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:zi(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...GJ(e),formState:n});const a=t.current.control;return a._options=e,$J({subject:a._subjects.state,next:i=>{IJ(i,a._proxyFormState,a._updateFormState)&&s({...a._formState})}}),Le.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Le.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==n.isDirty&&a._subjects.state.next({isDirty:i})}},[a,n.isDirty]),Le.useEffect(()=>{e.values&&!Mo(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values,s(i=>({...i}))):a._resetDefaultValues()},[e.values,a]),Le.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),Le.useEffect(()=>
418{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),Le.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),Le.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[n]),t.current.formState=jJ(n,a),t.current}const lC=(e,t,r)=>{if(e&&"reportValidity"in e){const n=dt(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},DF=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?lC(n.ref,r,e):n.refs&&n.refs.forEach(s=>lC(s,r,e))}},HJ=(e,t)=>{t.shouldUseNativeValidation&&DF(e,t);const r={};for(const n in e){const s=dt(t.fields,n),a=Object.assign(e[n]||{},{ref:s&&s.ref});if(KJ(t.names||Object.keys(e),n)){const i=Object.assign({},dt(r,n));br(i,"root",a),br(r,n,i)}else br(r,n,a)}return r},KJ=(e,t)=>e.some(r=>r.startsWith(t+"."));var QJ=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[i]={message:l.message,type:l.code}}else r[i]={message:a,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(u){return e.push(u)})}),t){var c=r[i].types,d=c&&c[n.code];r[i]=CF(i,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},YJ=function(e,t,r){return r===void 0&&(r={}),function(n,s,a){try{return Promise.resolve(function(i,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return a.shouldUseNativeValidation&&DF({},a),{errors:{},values:r.raw?n:d}})}catch(d){return l(d)}return c&&c.then?c.then(void 0,l):c}(0,function(i){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(i))return{values:{},errors:HJ(QJ(i.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw i}))}catch(i){return Promise.reject(i)}}},cC;function He(e,t,r){function n(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);const d=i.prototype,p=Object.keys(d);for(let u=0;u<p.length;u++){const h=p[u];h in l||(l[h]=d[h].bind(l))}}const s=(r==null?void 0:r.Parent)??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function i(l){var c;const d=r!=null&&r.Parent?new a:this;n(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const p of d._zod.deferred)p();return d}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:l=>{var c,d;return r!=null&&r.Parent&&l instanceof r.Parent?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Cd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class FF extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(cC=globalThis).__zod_globalConfig??(cC.__zod_globalConfig={});const k1=globalThis.__zod_globalConfig;function lc(e){return k1}function LF(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function Cb(e,t){return typeof t=="bigint"?t.toString():t}function T1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function M1(e){return e==null}function E1(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const dC=Symbol("evaluating");function Mr(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==dC)return n===void 0&&(n=dC,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function yc(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function nl(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function uC(e){return JSON.stringify(e)}function JJ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zF="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ZJ=T1(()=>{var e;if(k1.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function yh(e){if(Fg(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Fg(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function BF(e){return yh(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const XJ=new Set(["string","number","symbol"]);function Cy(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sl(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function Dt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function eZ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function tZ(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=nl(e._zod.def,{get shape(){const i={};for(const l in t){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(i[l]=r.shape[l])}return yc(this,"shape",i),i},checks:[]});return sl(e,a)}function rZ(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=nl(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const l in t){if(!(l in r.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete i[l]}return yc(this,"shape",i),i},checks:[]});return sl(e,a)}function nZ(e,t){if(!yh(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot over
418write keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=nl(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return yc(this,"shape",a),a}});return sl(e,s)}function sZ(e,t){if(!yh(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=nl(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return yc(this,"shape",n),n}});return sl(e,r)}function aZ(e,t){var n;if((n=e._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=nl(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return yc(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return sl(e,r)}function iZ(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=nl(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(r)for(const d in r){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(c[d]=e?new e({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)c[d]=e?new e({type:"optional",innerType:l[d]}):l[d];return yc(this,"shape",c),c},checks:[]});return sl(t,i)}function oZ(e,t,r){const n=nl(t._zod.def,{get shape(){const s=t._zod.def.shape,a={...s};if(r)for(const i in r){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(a[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)a[i]=new e({type:"nonoptional",innerType:s[i]});return yc(this,"shape",a),a}});return sl(t,n)}function md(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function lZ(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)===!1)return!0;return!1}function UF(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function cm(e){return typeof e=="string"?e:e==null?void 0:e.message}function cc(e,t,r){var c,d,p,u,h,f;const n=e.message?e.message:cm((p=(d=(c=e.inst)==null?void 0:c._zod.def)==null?void 0:d.error)==null?void 0:p.call(d,e))??cm((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??cm((h=r.customError)==null?void 0:h.call(r,e))??cm((f=r.localeError)==null?void 0:f.call(r,e))??"Invalid input",{inst:s,continue:a,input:i,...l}=e;return l.path??(l.path=[]),l.message=n,t!=null&&t.reportInput&&(l.input=i),l}function S1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function vh(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const WF=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Cb,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},VF=He("$ZodError",WF),GF=He("$ZodError",WF,{Parent:Error});function cZ(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function dZ(e,t=r=>r.message){const r={_errors:[]},n=(s,a=[])=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(l=>n({issues:l},[...a,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...a,...i.path]);else{const l=[...a,...i.path];if(l.length===0)r._errors.push(t(i));else{let c=r,d=0;for(;d<l.length;){const p=l[d];d===l.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],d++}}}};return n(e),r}const A1=e=>(t,r,n,s)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new Cd;if(i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(c=>cc(c,a,lc())));throw zF(l,s==null?void 0:s.callee),l}return i.value},P1=e=>async(t,r,n,s)=>{const a=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const l=new((s==null?void 0:s.Err)??e)(i.issues.map(c=>cc(c,a,lc())));throw zF(l,s==null?void 0:s.callee),l}return i.value},jy=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Cd;return a.issues.length?{success:!1,error:new(e??VF)(a.issues.map(i=>cc(i,s,lc())))}:{success:!0,data:a.value}},uZ=jy(GF),Iy=e=>async(t,r,n)=>{const s=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:r,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>cc(i,s,lc())))}:{success:!0,data:a.value}},pZ=Iy(GF),hZ=e=>(t,r,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return A1(e)(t,r,s)},fZ=e=>(t,r,n)=>A1(e)(t,r,n),mZ=e=>async(t,r,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return P1(e)(t,r,s)},gZ=e=>async(t,r,n)=>P1(e)(t,r,n),yZ=e=>(t,r,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return jy(e)(t,r,s)}
vendor: 39,735 bytes, lines 418-481
418,vZ=e=>(t,r,n)=>jy(e)(t,r,n),_Z=e=>async(t,r,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Iy(e)(t,r,s)},wZ=e=>async(t,r,n)=>Iy(e)(t,r,n),xZ=/^[cC][0-9a-z]{6,}$/,bZ=/^[0-9a-z]+$/,kZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TZ=/^[0-9a-vA-V]{20}$/,MZ=/^[A-Za-z0-9]{27}$/,EZ=/^[a-zA-Z0-9_-]{21}$/,SZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,AZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pC=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,PZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jZ(){return new RegExp(CZ,"u")}const IZ=/^(?:(?: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])$/,$Z=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,NZ=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,OZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,RZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qF=/^[A-Za-z0-9_-]*$/,DZ=/^https?$/,FZ=/^\+[1-9]\d{6,14}$/,HF="(?:(?:\\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])))",LZ=new RegExp(`^${HF}$`);function KF(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zZ(e){return new RegExp(`^${KF(e)}$`)}function BZ(e){const t=KF({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${HF}T(?:${n})$`)}const UZ=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},WZ=/^[^A-Z]*$/,VZ=/^[^a-z]*$/,Ei=He("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),GZ=He("$ZodCheckMaxLength",(e,t)=>{var r;Ei.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!M1(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=S1(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),qZ=He("$ZodCheckMinLength",(e,t)=>{var r;Ei.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!M1(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=S1(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),HZ=He("$ZodCheckLengthEquals",(e,t)=>{var r;Ei.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!M1(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,a=s.length;if(a===t.length)return;const i=S1(s),l=a>t.length;n.issues.push({origin:i,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$y=He("$ZodCheckStringFormat",(e,t)=>{var r,n;Ei.init(e,t),e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),KZ=He("$ZodCheckRegex",(e,t)=>{$y.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),QZ=He("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=WZ),$y.init(e,t)}),YZ=He("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=VZ),$y.init(e,t)}),JZ=He("$ZodCheckIncludes",(e,t)=>{Ei.init(e,t);const r=Cy(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),ZZ=He("$ZodCheckStartsWith",(e,t)=>{Ei.init(e,t);const r=new RegExp(`^${Cy(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),XZ=He("$ZodCheckEndsWith",(e,t)=>{Ei.init(e,t);const r=new RegExp(`.*${Cy(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),eX=He("$ZodCheckOverwrite",(e,t)=>{Ei.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class tX{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
419`).filter(i=>i),s=Math.min(...n.map(i=>i.length-i.trimStart().length)),a=n.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(a=>`  ${a}`)];return new t(...r,s.join(`
420`))}}const rX={major:4,minor:4,patch:3},Ln=He("$ZodType",(e,t)=>{var s;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rX;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const i of a._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const a=(l,c,d)=>{let p=md(l),u;for(const h of c){if(h._zod.def.when){if(lZ(l)||!h._zod.def.when(l))continue}else if(p)continue;const f=l.issues.length,m=h._zod.check(l);if(m instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Cd;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,l.issues.length!==f&&(p||(p=md(l,f)))});else{if(l.issues.length===f)continue;p||(p=md(l,f))}}return u?u.then(()=>l):l},i=(l,c,d)=>{if(md(l))return l.aborted=!0,l;const p=a(c,n,d);if(p instanceof Promise){if(d.async===!1)throw new Cd;return p.then(u=>e._zod.parse(u,d))}return e._zod.parse(p,d)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const p=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return p instanceof Promise?p.then(u=>i(u,l,c)):i(p,l,c)}const d=e._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Cd;return d.then(p=>a(p,n,c))}return a(d,n,c)}}Mr(e,"~standard",()=>({validate:a=>{var i;try{const l=uZ(e,a);return l.success?{value:l.data}:{issues:(i=l.error)==null?void 0:i.issues}}catch{return pZ(e,a).then(c=>{var d;return c.success?{value:c.data}:{issues:(d=c.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),C1=He("$ZodString",(e,t)=>{var r;Ln.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??UZ(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Vr=He("$ZodStringFormat",(e,t)=>{$y.init(e,t),C1.init(e,t)}),nX=He("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=AZ),Vr.init(e,t)}),sX=He("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=pC(n))}else t.pattern??(t.pattern=pC());Vr.init(e,t)}),aX=He("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=PZ),Vr.init(e,t)}),iX=He("$ZodURL",(e,t)=>{Vr.init(e,t),e._zod.check=r=>{var n;try{const s=r.value.trim();if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===DZ.source&&!/^https?:\/\//i.test(s)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const a=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),oX=He("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=jZ()),Vr.init(e,t)}),lX=He("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=EZ),Vr.init(e,t)}),cX=He("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xZ),Vr.init(e,t)}),dX=He("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bZ),Vr.init(e,t)}),uX=He("$ZodULID",(e,t)=>{t.pattern??(t.pattern=kZ),Vr.init(e,t)}),pX=He("$ZodXID",(e,t)=>{t.pattern??(t.pattern=TZ),Vr.init(e,t)}),hX=He("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=MZ),Vr.init(e,t)}),fX=He("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=BZ(t)),Vr.init(e,t)}),mX=He("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=LZ),Vr.init(e,t)}),gX=He("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zZ(t)),Vr.init(e,t)}),yX=He("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=SZ),Vr.init(e,t)}),vX=He("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=IZ),Vr.init(e,t),e._zod.bag.format="ipv4"}),_X=He("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$Z),Vr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),wX=He("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=NZ),Vr.init(e,t)}),xX=He("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=OZ),Vr.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[s,a]=n;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function QF(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const bX=He("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=RZ),Vr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{QF(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function kX(e){if(!qF.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return QF(r)}const TX=He("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qF),Vr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{kX(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),MX=He("$ZodE164",(e,t)=>{t.pattern??(t.pattern=FZ),Vr.init(e,t)});function EX(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const SX=He("$ZodJWT",(e,t)=>{Vr.init(e,t),e._zod.check=r=>{EX(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),AX=He("$ZodUnknown",(e,t)=>{Ln.init(e,t),e._zod.parse=r=>r}),PX=He("$ZodNever",(e,t)=>{Ln.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function hC(e,t,r){e.issues.length&&t.issues.push(...UF(r,e.issues)),t.value[r]=e.value}const CX=He("$ZodArray",(e,t)=>{Ln.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const a=[];for(let i=0;i<s.length;i++){const l=s[i],c=t.element._zod.run({value:l,issues:[]},n);c instanceof Promise?a.push(c.then(d=>hC(d,r,i))):hC(c,r,i)}return a.length?Promise.all(a).then(()=>r):r}});function Lg(e,t,r,n,s,a){const i=r in n;if(e.issues.length){if(s&&a&&!i)return;t.issues.push(...UF(r,e.issues))}if(!i&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function YF(e){var n,s,a,i;const t=Object.keys(e.shape);for(const l of t)if(!((i=(a=(s=(n=e.shape)==null?void 0:n[l])==null?void 0:s._zod)==null?void 0:a.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const r=eZ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function JF(e,t,r,n,s,a){const i=[],l=s.keySet,c=s.catchall._zod,d=c.def.type,p=c.optin==="optional",u=c.optout==="optional";for(const h in t){if(h==="__proto__"||l.has(h))continue;if(d==="never"){i.push(h);continue}const f=c.run({value:t[h],issues:[]},n);f instanceof Promise?e.push(f.then(m=>Lg(m,r,h,t,p,u))):Lg(f,r,h,t,p,u)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}const jX=He("$ZodObject",(e,t)=>{Ln.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=T1(()=>YF(t));Mr(e._zod,"propValues",()=>{const l=t.shape,c={};for(const d in l){const p=l[d]._zod;if(p.values){c[d]??(c[d]=new Set);for(const u of p.values)c[d].add(u)}}return c});const s=Fg,a=t.catchall;let i;e._zod.parse=(l,c)=>{i??(i=n.value);const d=l.value;if(!s(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value={};const p=[],u=i.shape;for(const h of i.keys){const f=u[h],m=f._zod.optin==="optional",v=f._zod.optout==="optional",k=f._zod.run({value:d[h],issues:[]},c);k instanceof Promise?p.push(k.then(y=>Lg(y,l,h,d,m,v))):Lg(k,l,h,d,m,v)}return a?JF(p,d,l,c,n.value,e):p.length?Promise.all(p).then(()=>l):l}}),IX=He("$ZodObjectJIT",(e,t)=>{jX.init(e,t);const r=e._zod.parse,n=T1(()=>YF(t)),s=h=>{var _,w;const f=new tX(["shape","payload","ctx"]),m=n.value,v=x=>{const b=uC(x);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};f.write("const input = payload.value;");const k=Object.create(null);let y=0;for(const x of m.keys)k[x]=`key_${y++}`;f.write("const newResult = {};");for(const x of m.keys){const b=k[x],M=uC(x),S=h[x],j=((_=S==null?void 0:S._zod)==null?void 0:_.optin)==="optional",I=((w=S==null?void 0:S._zod)==null?void 0:w.optout)==="optional";f.write(`const ${b} = ${v(x)};`),j&&I?f.write(`
421        if (${b}.issues.length) {
422          if (${M} in input) {
423            payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
424              ...iss,
425              path: iss.path ? [${M}, ...iss.path] : [${M}]
426            })));
427          }
428        }
429        
430        if (${b}.value === undefined) {
431          if (${M} in input) {
432            newResult[${M}] = undefined;
433          }
434        } else {
435          newResult[${M}] = ${b}.value;
436        }
437        
438      `):j?f.write(`
439        if (${b}.issues.length) {
440          payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
441            ...iss,
442            path: iss.path ? [${M}, ...iss.path] : [${M}]
443          })));
444        }
445        
446        if (${b}.value === undefined) {
447          if (${M} in input) {
448            newResult[${M}] = undefined;
449          }
450        } else {
451          newResult[${M}] = ${b}.value;
452        }
453        
454      `):f.write(`
455        const ${b}_present = ${M} in input;
456        if (${b}.issues.length) {
457          payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
458            ...iss,
459            path: iss.path ? [${M}, ...iss.path] : [${M}]
460          })));
461        }
462        if (!${b}_present && !${b}.issues.length) {
463          payload.issues.push({
464            code: "invalid_type",
465            expected: "nonoptional",
466            input: undefined,
467            path: [${M}]
468          });
469        }
470
471        if (${b}_present) {
472          if (${b}.value === undefined) {
473            newResult[${M}] = undefined;
474          } else {
475            newResult[${M}] = ${b}.value;
476          }
477        }
478
479      `)}f.write("payload.value = newResult;"),f.write("return payload;");const g=f.compile();return(x,b)=>g(h,x,b)};let a;const i=Fg,l=!k1.jitless,d=l&&ZJ.value,p=t.catchall;let u;e._zod.parse=(h,f)=>{u??(u=n.value);const m=h.value;return i(m)?l&&d&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(a||(a=s(t.shape)),h=a(h,f),p?JF([],m,h,f,u,e):h):r(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function fC(e,t,r,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const s=e.filter(a=>!md(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(i=>cc(i,n,lc())))}),t)}const $X=He("$ZodUnion",(e,t)=>{Ln.init(e,t),Mr(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Mr(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Mr(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Mr(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>E1(s.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(r)return r(n,s);let a=!1;const i=[];for(const l of t.options){const c=l._zod.run({value:n.value,issues:[]},s);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(l=>fC(l,n,e,s)):fC(i,n,e,s)}}),NX=He("$ZodIntersection",(e,t)=>{Ln.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,a=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,d])=>mC(r,c,d)):mC(r,a,i)}});function jb(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yh(e)&&yh(t)){const r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};for(const a of n){const i=jb(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};s[a]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],a=t[n],i=jb(s,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mC(e,t,r){const n=new Map;let s;for(const l of t.issues)if(l.code==="unrecognized_keys"){s??(s=l);for(const c of l.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(l);for(const l of r.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(l);const a=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length&&s&&e.issues.push({...s,keys:a}),md(e))return e;const i=jb(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const OX=He("$ZodEnum",(e,t)=>{Ln.init(e,t);const r=LF(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>XJ.has(typeof s)).map(s=>typeof s=="string"?Cy(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{const i=s.value;return n.has(i)||s.issues.push({code:"invalid_value",values:r,input:i,inst:e}),s}}),RX=He("$ZodTransform",(e,t)=>{Ln.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new FF(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r.fallback=!0,r));if(s instanceof Promise)throw new Cd;return r.value=s,r.fallback=!0,r}});function gC(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const ZF=He("$ZodOptional",(e,t)=>{Ln.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mr(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${E1(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=r.value,a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(i=>gC(i,s)):gC(a,s)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),DX=He("$ZodExactOptional",(e,t)=>{ZF.init(e,t),Mr(e._zod,"values",()=>t.innerType._zod.values),Mr(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),FX=He("$ZodNullable",(e,t)=>{Ln.init(e,t),Mr(e._zod,"optin",()=>t.innerType._zod.optin),Mr(e._zod,"optout",()=>t.innerType._zod.optout),Mr(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${E1(r.source)}|null)$`):void 0}),Mr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),LX=He("$ZodDefault",(e,t)=>{Ln.init(e,t),e._zod.optin="optional",Mr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>yC(a,t)):yC(s,t)}});function yC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zX=He("$ZodPrefault",(e,t)=>{Ln.init(e,t),e._zod.optin="optional",Mr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),BX=He("$ZodNonOptional",(e,t)=>{Ln.init(e,t),Mr(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>vC(a,e)):vC(s,e)}});function vC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const UX=He("$ZodCatch",(e,t)=>{Ln.init(e,t),e._zod.optin="optional",Mr(e._zod,"optout",()=>t.innerType._zod.optout),Mr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(i=>cc(i,n,lc()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>cc(a,n,lc()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),WX=He("$ZodPipe",(e,t)=>{Ln.init(e,t),Mr(e._zod,"values",()=>t.in._zod.values),Mr(e._zod,"optin",()=>t.in._zod.optin),Mr(e._zod,"optout",()=>t.out._zod.optout),Mr(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(r,n);return a instanceof Promise?a.then(i=>dm(i,t.in,n)):dm(a,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(a=>dm(a,t.out,n)):dm(s,t.out,n)}});function dm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const VX=He("$ZodReadonly",(e,t)=>{Ln.init(e,t),Mr(e._zod,"propValues",()=>t.innerType._zod.propValues),Mr(e._zod,"values",()=>t.innerType._zod.values),Mr(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),Mr(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(_C):_C(s)}});function _C(e){return e.value=Object.freeze(e.value),e}const GX=He("$ZodCustom",(e,t)=>{Ei.init(e,t),Ln.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>wC(a,r,n,e));wC(s,r,n,e)}});function wC(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(vh(s))}}var xC;class qX{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function HX(){return new qX}(xC=globalThis).__zod_globalRegistry??(xC.__zod_globalRegistry=HX());const wp=globalThis.__zod_globalRegistry;function KX(e,t){return new e({type:"string",...Dt(t)})}function QX(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Dt(t)})}function bC(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Dt(t)})}function YX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Dt(t)})}function JX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Dt(t)})}function ZX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Dt(t)})}function XX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Dt(t)})}function eee(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Dt(t)})}function tee(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Dt(t)})}function ree(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Dt(t)})}function nee(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Dt(t)})}function see(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Dt(t)})}function aee(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Dt(t)})}function iee(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Dt(t)})}function oee(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Dt(t)})}function lee(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Dt(t)})}function cee(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Dt(t)})}function dee(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Dt(t)})}function uee(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Dt(t)})}function pee(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Dt(t)})}function hee(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Dt(t)})}function fee(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Dt(t)})}function mee(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Dt(t)})}function gee(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Dt(t)})}function yee(e,t){return new e({type:"string",format:"date",check:"string_format",...Dt(t)})}function vee(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Dt(t)})}function _ee(e,t){return new e({type:"string",format:"duration",check:"string_format",...Dt(t)})}function wee(e){return new e({type:"unknown"})}function xee(e,t){return new e({type:"never",...Dt(t)})}function XF(e,t){return new GZ({check:"max_length",...Dt(t),maximum:e})}function zg(e,t){return new qZ({check:"min_length",...Dt(t),minimum:e})}function eL(e,t){return new HZ({check:"length_equals",...Dt(t),length:e})}function bee(e,t){return new KZ({check:"string_format",format:"regex",...Dt(t),pattern:e})}function kee(e){return new QZ({check:"string_format",format:"lowercase",...Dt(e)})}function Tee(e){return new YZ({check:"string_format",format:"uppercase",...Dt(e)})}function Mee(e,t){return new JZ({check:"string_format",format:"includes",...Dt(t),includes:e})}function Eee(e,t){return new ZZ({check:"string_format",format:"starts_with",...Dt(t),prefix:e})}function See(e,t){return new XZ({check:"string_format",format:"ends_with",...Dt(t),suffix:e})}function uu(e){return new eX({check:"overwrite",tx:e})}function Aee(e){return uu(t=>t.normalize(e))}function Pee(){return uu(e=>e.trim())}function Cee(){return uu(e=>e.toLowerCase())}function jee(){return uu(e=>e.toUpperCase())}function Iee(){return uu(e=>JJ(e))}function $ee(e,t,r){return new e({type:"array",element:t,...Dt(r)})}function Nee(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Dt(r)})}function Oee(e,t){const r=Ree(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(vh(s,n.value,r._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(vh(a))}},e(n.value,n)),t);return r}function Ree(e,t){const r=new Ei({check:"custom",...Dt(t)});return r._zod.check=e,r}function tL(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??wp,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function rs(e,t,r={path:[],schemaPath:[]}){var p,u;var n;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const l=(u=(p=e._zod).toJSONSchema)==null?void 0:u.call(p);if(l)i.schema=l;else{const h={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{const m=i.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,m,h)}const f=e._zod.parent;f&&(i.ref||(i.ref=f),rs(f,t,h),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&ms(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function rL(e,t){var i,l,c,d;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const p of e.seen.entries()){const u=(i=e.metadataRegistry.get(p[0]))==null?void 0:i.id;if(u){const h=n.get(u);if(h&&h!==p[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,p[0])}}const s=p=>{var v;const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const k=(v=e.external.registry.get(p[0]))==null?void 0:v.id,y=e.external.uri??(_=>_);if(k)return{ref:y(k)};const g=p[1].defId??p[1].schema.id??`schema${e.counter++}`;return p[1].defId=g,{defId:g,ref:`${y("__shared")}#/${u}/${g}`}}if(p[1]===r)return{ref:"#"};const f=`#/${u}/`,m=p[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:f+m}},a=p=>{if(p[1].schema.$ref)return;const u=p[1],{ref:h,defId:f}=s(p);u.def={...u.schema},f&&(u.defId=f);const m=u.schema;for(const v in m)delete m[v];m.$ref=h};if(e.cycles==="throw")for(const p of e.seen.entries()){const u=p[1];if(u.cycle)throw new Error(`Cycle detected: #/${(l=u.cycle)==null?void 0:l.join("/")}/<root>
480
481Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of e.seen.entries()){const u=p[1];if(t===p[0]){a(p);continue}if(e.external){const f=(c=e.external.registry.get(p[0]))==null?void 0:c.id;if(t!==p[0]&&f){a(p);continue}}if((d=e.metadataRegistry.get(p[0]))==null?void 0:d.id){a(p);continue}if(u.cycle){a(p);continue}if(u.count>1&&e.reused==="ref"){a(p);continue}}}function nL(e,t){var l,c,d,p;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=u=>{const h=e.seen.get(u);if(h.ref===null)return;const f=h.def??h.schema,m={...f},v=h.ref;if(h.ref=null,v){n(v);const y=e.seen.get(v),g=y.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(g)):Object.assign(f,g),Object.assign(f,m),u._zod.parent===v)for(const w in f)w==="$ref"||w==="allOf"||w in m||delete f[w];if(g.$ref&&y.def)for(const w in f)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(f[w])===JSON.stringify(y.def[w])&&delete f[w]}const k=u._zod.parent;if(k&&k!==v){n(k);const y=e.seen.get(k);if(y!=null&&y.schema.$ref&&(f.$ref=y.schema.$ref,y.def))for(const g in f)g==="$ref"||g==="allOf"||g in y.def&&JSON.stringify(f[g])===JSON.stringify(y.def[g])&&delete f[g]}e.override({zodSchema:u,jsonSchema:f,path:h.path??[]})};for(const u of[...e.seen.entries()].reverse())n(u[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(l=e.external)!=null&&l.uri){const u=(c=e.external.registry.get(t))==null?void 0:c.id;if(!u)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(u)}Object.assign(s,r.def??r.schema);const a=(d=e.metadataRegistry.get(t))==null?void 0:d.id;a!==void 0&&s.id===a&&delete s.id;const i=((p=e.external)==null?void 0:p.defs)??{};for(const u of e.seen.entries()){const h=u[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,i[h.defId]=h.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const u=JSON.parse(JSON.stringify(s));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bg(t,"input",e.processors),output:Bg(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function ms(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ms(n.element,r);if(n.type==="set")return ms(n.valueType,r);if(n.type==="lazy")return ms(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ms(n.innerType,r);if(n.type==="intersection")return ms(n.left,r)||ms(n.right,r);if(n.type==="record"||n.type==="map")return ms(n.keyType,r)||ms(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ms(n.in,r)||ms(n.out,r);if(n.type==="object"){for(const s in n.shape)if(ms(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(ms(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(ms(s,r))return!0;return!!(n.rest&&ms(n.rest,r))}return!1}const Dee=(e,t={})=>r=>{const n=tL({...r,processors:t});return rs(e,n),rL(n,e),nL(n,e)},Bg=(e,t,r={})=>n=>{const{libraryOptions:s,target:a}=n??{},i=tL({...s??{},target:a,io:t,processors:r});return rs(e,i),rL(i,e),nL(i,e)},Fee={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Lee=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:a,maximum:i,format:l,patterns:c,contentEncoding:d}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof i=="number"&&(s.maxLength=i),l&&(s.format=Fee[l]??l,s.format===""&&delete s.format,l==="time"&&delete s.format),d&&(s.contentEncoding=d),c&&c.size>0){const p=[...c];p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},zee=(e,t,r,n)=>{r.not={}},Bee=(e,t,r,n)=>{},Uee=(e,t,r,n)=>{const s=e._zod.def,a=LF(s.entries);a.every(i=>typeof i=="number")&&(r.type="number"),a.every(i=>typeof i=="string")&&(r.type="string"),r.enum=a},Wee=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vee=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gee=(e,t,r,n)=>{const s=r,a=e._zod.def,{minimum:i,maximum:l}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=rs(a.element,t,{...n,path:[...n.path,"items"]})},qee=(e,t,r,n)=>{var d;const s=r,a=e._zod.def;s.type="object",s.properties={};const i=a.shape;for(const p in i)s.properties[p]=rs(i[p],t,{...n,path:[...n.path,"properties",p]});const l=new Set(Object.keys(i)),c=new Set([...l].filter(p=>{const u=a.shape[p]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(s.required=Array.from(c)),((d=a.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=rs(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Hee=(e,t,r,n)=>{const s=e._zod.def,a=s.inclusive===!1,i=s.options.map((l,c)=>rs(l,t,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=i:r.anyOf=i}
vendor: 6,908 bytes, line 481
481,Kee=(e,t,r,n)=>{const s=e._zod.def,a=rs(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=rs(s.right,t,{...n,path:[...n.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(a)?a.allOf:[a],...l(i)?i.allOf:[i]];r.allOf=c},Qee=(e,t,r,n)=>{const s=e._zod.def,a=rs(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Yee=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},Jee=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Zee=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Xee=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},ete=(e,t,r,n)=>{const s=e._zod.def,a=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?s.out:s.in:s.out;rs(i,t,n);const l=t.seen.get(e);l.ref=i},tte=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,r.readOnly=!0},sL=(e,t,r,n)=>{const s=e._zod.def;rs(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},rte=He("ZodISODateTime",(e,t)=>{fX.init(e,t),Jr.init(e,t)});function nte(e){return gee(rte,e)}const ste=He("ZodISODate",(e,t)=>{mX.init(e,t),Jr.init(e,t)});function ate(e){return yee(ste,e)}const ite=He("ZodISOTime",(e,t)=>{gX.init(e,t),Jr.init(e,t)});function ote(e){return vee(ite,e)}const lte=He("ZodISODuration",(e,t)=>{yX.init(e,t),Jr.init(e,t)});function cte(e){return _ee(lte,e)}const dte=(e,t)=>{VF.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>dZ(e,r)},flatten:{value:r=>cZ(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Cb,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Cb,2)}},isEmpty:{get(){return e.issues.length===0}}})},ka=He("ZodError",dte,{Parent:Error}),ute=A1(ka),pte=P1(ka),hte=jy(ka),fte=Iy(ka),mte=hZ(ka),gte=fZ(ka),yte=mZ(ka),vte=gZ(ka),_te=yZ(ka),wte=vZ(ka),xte=_Z(ka),bte=wZ(ka),kC=new WeakMap;function Ny(e,t,r){const n=Object.getPrototypeOf(e);let s=kC.get(n);if(s||(s=new Set,kC.set(n,s)),!s.has(t)){s.add(t);for(const a in r){const i=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const l=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const zn=He("ZodType",(e,t)=>(Ln.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bg(e,"input"),output:Bg(e,"output")}}),e.toJSONSchema=Dee(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>ute(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hte(e,r,n),e.parseAsync=async(r,n)=>pte(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>fte(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>mte(e,r,n),e.decode=(r,n)=>gte(e,r,n),e.encodeAsync=async(r,n)=>yte(e,r,n),e.decodeAsync=async(r,n)=>vte(e,r,n),e.safeEncode=(r,n)=>_te(e,r,n),e.safeDecode=(r,n)=>wte(e,r,n),e.safeEncodeAsync=async(r,n)=>xte(e,r,n),e.safeDecodeAsync=async(r,n)=>bte(e,r,n),Ny(e,"ZodType",{check(...r){const n=this.def;return this.clone(nl(n,{checks:[...n.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return sl(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(mre(r,n))},superRefine(r,n){return this.check(gre(r,n))},overwrite(r){return this.check(uu(r))},optional(){return EC(this)},exactOptional(){return rre(this)},nullable(){return SC(this)},nullish(){return EC(SC(this))},nonoptional(r){return lre(this,r)},array(){return Gte(this)},or(r){return Qte([this,r])},and(r){return Jte(this,r)},transform(r){return AC(this,ere(r))},default(r){return are(this,r)},prefault(r){return ore(this,r)},catch(r){return dre(this,r)},pipe(r){return AC(this,r)},readonly(){return hre(this)},describe(r){const n=this.clone();return wp.add(n,{description:r}),n},meta(...r){if(r.length===0)return wp.get(this);const n=this.clone();return wp.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){var r;return(r=wp.get(e))==null?void 0:r.description},configurable:!0}),e)),aL=He("_ZodString",(e,t)=>{C1.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Lee(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ny(e,"_ZodString",{regex(...n){return this.check(bee(...n))},includes(...n){return this.check(Mee(...n))},startsWith(...n){return this.check(Eee(...n))},endsWith(...n){return this.check(See(...n))},min(...n){return this.check(zg(...n))},max(...n){return this.check(XF(...n))},length(...n){return this.check(eL(...n))},nonempty(...n){return this.check(zg(1,...n))},lowercase(n){return this.check(kee(n))},uppercase(n){return this.check(Tee(n))},trim(){return this.check(Pee())},normalize(...n){return this.check(Aee(...n))},toLowerCase(){return this.check(Cee())},toUpperCase(){return this.check(jee())},slugify(){return this.check(Iee())}})}),kte=He("ZodString",(e,t)=>{C1.init(e,t),aL.init(e,t),e.email=r=>e.check(QX(Tte,r)),e.url=r=>e.check(eee(Mte,r)),e.jwt=r=>e.check(mee(zte,r)),e.emoji=r=>e.check(tee(Ete,r)),e.guid=r=>e.check(bC(TC,r)),e.uuid=r=>e.check(YX(um,r)),e.uuidv4=r=>e.check(JX(um,r)),e.uuidv6=r=>e.check(ZX(um,r)),e.uuidv7=r=>e.check(XX(um,r)),e.nanoid=r=>e.check(ree(Ste,r)),e.guid=r=>e.check(bC(TC,r)),e.cuid=r=>e.check(nee(Ate,r)),e.cuid2=r=>e.check(see(Pte,r)),e.ulid=r=>e.check(aee(Cte,r)),e.base64=r=>e.check(pee(Dte,r)),e.base64url=r=>e.check(hee(Fte,r)),e.xid=r=>e.check(iee(jte,r)),e.ksuid=r=>e.check(oee(Ite,r)),e.ipv4=r=>e.check(lee($te,r)),e.ipv6=r=>e.check(cee(Nte,r)),e.cidrv4=r=>e.check(dee(Ote,r)),e.cidrv6=r=>e.check(uee(Rte,r)),e.e164=r=>e.check(fee(Lte,r)),e.datetime=r=>e.check(nte(r)),e.date=r=>e.check(ate(r)),e.time=r=>e.check(ote(r)),e.duration=r=>e.check(cte(r))});function Hc(e){return KX(kte,e)}const Jr=He("ZodStringFormat",(e,t)=>{Vr.init(e,t),aL.init(e,t)}),Tte=He("ZodEmail",(e,t)=>{aX.init(e,t),Jr.init(e,t)}),TC=He("ZodGUID",(e,t)=>{nX.init(e,t),Jr.init(e,t)}),um=He("ZodUUID",(e,t)=>{sX.init(e,t),Jr.init(e,t)}),Mte=He("ZodURL",(e,t)=>{iX.init(e,t),Jr.init(e,t)}),Ete=He("ZodEmoji",(e,t)=>{oX.init(e,t),Jr.init(e,t)}),Ste=He("ZodNanoID",(e,t)=>{lX.init(e,t),Jr.init(e,t)}),Ate=He("ZodCUID",(e,t)=>{cX.init(e,t),Jr.init(e,t)}),Pte=He("ZodCUID2",(e,t)=>{dX.init(e,t),Jr.init(e,t)}
481),Cte=He("ZodULID",(e,t)=>{uX.init(e,t),Jr.init(e,t)}),jte=He("ZodXID",(e,t)=>{pX.init(e,t),Jr.init(e,t)}),Ite=He("ZodKSUID",(e,t)=>{hX.init(e,t),Jr.init(e,t)}),$te=He("ZodIPv4",(e,t)=>{vX.init(e,t),Jr.init(e,t)}),Nte=He("ZodIPv6",(e,t)=>{_X.init(e,t),Jr.init(e,t)}),Ote=He("ZodCIDRv4",(e,t)=>{wX.init(e,t),Jr.init(e,t)}),Rte=He("ZodCIDRv6",(e,t)=>{xX.init(e,t),Jr.init(e,t)}),Dte=He("ZodBase64",(e,t)=>{bX.init(e,t),Jr.init(e,t)}),Fte=He("ZodBase64URL",(e,t)=>{TX.init(e,t),Jr.init(e,t)}),Lte=He("ZodE164",(e,t)=>{MX.init(e,t),Jr.init(e,t)}),zte=He("ZodJWT",(e,t)=>{SX.init(e,t),Jr.init(e,t)}),Bte=He("ZodUnknown",(e,t)=>{AX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Bee()});function MC(){return wee(Bte)}const Ute=He("ZodNever",(e,t)=>{PX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>zee(e,r,n)});function Wte(e){return xee(Ute,e)}const Vte=He("ZodArray",(e,t)=>{CX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Gee(e,r,n,s),e.element=t.element,Ny(e,"ZodArray",{min(r,n){return this.check(zg(r,n))},nonempty(r){return this.check(zg(1,r))},max(r,n){return this.check(XF(r,n))},length(r,n){return this.check(eL(r,n))},unwrap(){return this.element}})});function Gte(e,t){return $ee(Vte,e,t)}const qte=He("ZodObject",(e,t)=>{IX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>qee(e,r,n,s),Mr(e,"shape",()=>t.shape),Ny(e,"ZodObject",{keyof(){return Zte(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:MC()})},loose(){return this.clone({...this._zod.def,catchall:MC()})},strict(){return this.clone({...this._zod.def,catchall:Wte()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return nZ(this,r)},safeExtend(r){return sZ(this,r)},merge(r){return aZ(this,r)},pick(r){return tZ(this,r)},omit(r){return rZ(this,r)},partial(...r){return iZ(iL,this,r[0])},required(...r){return oZ(oL,this,r[0])}})});function Hte(e,t){const r={type:"object",shape:e??{},...Dt(t)};return new qte(r)}const Kte=He("ZodUnion",(e,t)=>{$X.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Hee(e,r,n,s),e.options=t.options});function Qte(e,t){return new Kte({type:"union",options:e,...Dt(t)})}const Yte=He("ZodIntersection",(e,t)=>{NX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Kee(e,r,n,s)});function Jte(e,t){return new Yte({type:"intersection",left:e,right:t})}const Ib=He("ZodEnum",(e,t)=>{OX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Uee(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const a={};for(const i of n)if(r.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Ib({...t,checks:[],...Dt(s),entries:a})},e.exclude=(n,s)=>{const a={...t.entries};for(const i of n)if(r.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Ib({...t,checks:[],...Dt(s),entries:a})}});function Zte(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ib({type:"enum",entries:r,...Dt(t)})}const Xte=He("ZodTransform",(e,t)=>{RX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Vee(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new FF(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(vh(a,r.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(vh(i))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=s,r.fallback=!0,r)}});function ere(e){return new Xte({type:"transform",transform:e})}const iL=He("ZodOptional",(e,t)=>{ZF.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sL(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function EC(e){return new iL({type:"optional",innerType:e})}const tre=He("ZodExactOptional",(e,t)=>{DX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sL(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function rre(e){return new tre({type:"optional",innerType:e})}const nre=He("ZodNullable",(e,t)=>{FX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Qee(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function SC(e){return new nre({type:"nullable",innerType:e})}const sre=He("ZodDefault",(e,t)=>{LX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Jee(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function are(e,t){return new sre({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():BF(t)}})}const ire=He("ZodPrefault",(e,t)=>{zX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Zee(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function ore(e,t){return new ire({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():BF(t)}})}const oL=He("ZodNonOptional",(e,t)=>{BX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Yee(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function lre(e,t){return new oL({type:"nonoptional",innerType:e,...Dt(t)})}const cre=He("ZodCatch",(e,t)=>{UX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Xee(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dre(e,t){return new cre({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ure=He("ZodPipe",(e,t)=>{WX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ete(e,r,n,s),e.in=t.in,e.out=t.out});function AC(e,t){return new ure({type:"pipe",in:e,out:t})}const pre=He("ZodReadonly",(e,t)=>{VX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>tte(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function hre(e){return new pre({type:"readonly",innerType:e})}const fre=He("ZodCustom",(e,t)=>{GX.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Wee(e,r)});function mre(e,t={}){return Nee(fre,e,t)}function gre(e,t){return Oee(e,t)}const j1=D.forwardRef(({className:e,...t},r)=>o.jsx("textarea",{className:Sn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
481ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));j1.displayName="Textarea";const yre=Hte({firstName:Hc().min(1,"First name is required"),lastName:Hc().min(1,"Last name is required"),email:Hc().email("Please enter a valid email address"),phone:Hc().optional(),company:Hc().optional(),message:Hc().optional()}),vre=()=>{const[e,t]=D.useState(!1),{register:r,handleSubmit:n,formState:{errors:s},reset:a}=qJ({resolver:YJ(yre)}),i=async l=>{t(!0);try{const c="[email protected]",d=`New contact from ${l.firstName} ${l.lastName}`,p=[`Name: ${l.firstName} ${l.lastName}`,`Email: ${l.email}`,l.phone?`Phone: ${l.phone}`:null,l.company?`Company: ${l.company}`:null,"","Message:",l.message||"(no message provided)"].filter(Boolean).join(`
482`),u=`mailto:${c}?subject=${encodeURIComponent(d)}&body=${encodeURIComponent(p)}`;window.location.href=u,ha.success("Opening your email client to send your message to [email protected]."),a()}catch(c){console.error("Form submission error:",c),ha.error("Sorry, there was an error preparing your message. Please email [email protected] directly.")}finally{t(!1)}};return o.jsx("div",{className:"w-full max-w-md mx-auto",children:o.jsxs("form",{onSubmit:n(i),className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"firstName",className:"text-sm font-medium",children:"First Name *"}),o.jsx("div",{className:"mt-1",children:o.jsx(fa,{id:"firstName",...r("firstName"),disabled:e})}),s.firstName&&o.jsx("p",{className:"text-red-600 text-xs mt-1",children:s.firstName.message})]}),o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"lastName",className:"text-sm font-medium",children:"Last Name *"}),o.jsx("div",{className:"mt-1",children:o.jsx(fa,{id:"lastName",...r("lastName"),disabled:e})}),s.lastName&&o.jsx("p",{className:"text-red-600 text-xs mt-1",children:s.lastName.message})]})]}),o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"email",className:"text-sm font-medium",children:"Email Address *"}),o.jsx("div",{className:"mt-1",children:o.jsx(fa,{id:"email",type:"email",...r("email"),disabled:e})}),s.email&&o.jsx("p",{className:"text-red-600 text-xs mt-1",children:s.email.message})]}),o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"phone",className:"text-sm font-medium",children:"Phone Number"}),o.jsx("div",{className:"mt-1",children:o.jsx(fa,{id:"phone",...r("phone"),disabled:e})})]}),o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"company",className:"text-sm font-medium",children:"Company"}),o.jsx(fa,{id:"company",...r("company"),disabled:e})]}),o.jsxs("div",{children:[o.jsx(vi,{htmlFor:"message",className:"text-sm font-medium",children:"Message"}),o.jsx("div",{className:"mt-1",children:o.jsx(j1,{id:"message",...r("message"),className:"min-h-[100px]",disabled:e})}),s.message&&o.jsx("p",{className:"text-red-600 text-xs mt-1",children:s.message.message})]}),o.jsx(rr,{type:"submit",className:"w-full bg-brand-red hover:bg-brand-red/90 text-white",disabled:e,children:e?"Sending...":"Send Message"})]})})},_re=()=>{const{t:e}=gc();return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Contact — Appraisal Bureau",description:"Get in touch with the Appraisal Bureau team.",canonical:"/contact"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:e(ui.contactUs)})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Let's talk about your collection"}),o.jsxs("p",{className:"mt-8 text-lg md:text-xl font-light text-gray-600 max-w-2xl leading-relaxed",children:[e(ui.visitSupport)," ",o.jsx("a",{href:"/support",className:"text-ab-ink underline underline-offset-4 decoration-gray-300 hover:decoration-[#220E99]",children:e(ui.supportCenter)})," ",e(ui.forHelpOrContact)]})]})}),o.jsx("section",{className:"py-16 md:py-24 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsxs("div",{className:"md:col-span-4 space-y-12",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:e(ui.email)}),o.jsxs("ul",{className:"space-y-2 font-light text-ab-ink",children:[o.jsxs("li",{children:[o.jsx("span",{className:"block text-xs text-gray-500 mb-0.5",children:e(ui.general)}),o.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#220E99] transition-colors",children:"[email protected]"})]}),o.jsxs("li",{className:"pt-2",children:[o.jsx("span",{className:"block text-xs text-gray-500 mb-0.5",children:e(ui.support)}),o.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#220E99] transition-colors",children:"[email protected]"})]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:e(ui.phone)}),o.jsx("a",{href:"tel:+19292096028",className:"font-light text-ab-ink hover:text-[#220E99] transition-colors",children:"(929) 209-6028"})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:e(ui.address)}),o.jsxs("address",{className:"not-italic font-light text-ab-ink leading-relaxed",children:["408 Broadway",o.jsx("br",{}),"Floor 2",o.jsx("br",{}),"New York, NY 10007",o.jsx("br",{}),"United States"]})]})]}),o.jsxs("div",{className:"md:col-span-8 md:border-l md:border-gray-200 md:pl-16",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:e(ui.sendUsMessage)}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight mb-10",children:"Tell us a little about what you need"}),o.jsx("div",{className:"max-w-xl",children:o.jsx(vre,{})})]})]})})})]}),o.jsx(yn,{})]})},Km=new Map,Dl=[],wre=(e,t,r)=>{if(t&&typeof t.init=="function"&&typeof t.createInferenceSessionHandler=="function"){const n=Km.get(e);if(n===void 0)Km.set(e,{backend:t,priority:r});else{if(n.priority>r)return;if(n.priority===r&&n.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${r}`)}if(r>=0){const s=Dl.indexOf(e);s!==-1&&Dl.splice(s,1);for(let a=0;a<Dl.length;a++)if(Km.get(Dl[a]).priority<=r){Dl.splice(a,0,e);return}Dl.push(e)}return}throw new TypeError("not a valid backend")},xre=async e=>{const t=Km.get(e);if(!t)return"backend not found.";if(t.initialized)return t.backend;if(t.aborted)return t.error;{const r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(n){return r||(t.error=`${n}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},bre=async e=>{const t=e.executionProviders||[],r=t.map(c=>typeof c=="string"?c:c.name),n=r.length===0?Dl:r;let s;const a=[],i=new Set;for(const c of n){const d=await xre(c);
482typeof d=="string"?a.push({name:c,err:d}):(s||(s=d),s===d&&i.add(c))}if(!s)throw new Error(`no available backend found. ERR: ${a.map(c=>`[${c.name}] ${c.err}`).join(", ")}`);for(const{name:c,err:d}of a)r.includes(c)&&console.warn(`removing requested execution provider "${c}" from session options because it is not available: ${d}`);const l=t.filter(c=>i.has(typeof c=="string"?c:c.name));return[s,new Proxy(e,{get:(c,d)=>d==="executionProviders"?l:Reflect.get(c,d)})]},kre="1.21.0";let PC="warning";const Qa={wasm:{},webgl:{},webgpu:{},versions:{common:kre},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);PC=e}},get logLevel(){return PC}};Object.defineProperty(Qa,"logLevel",{enumerable:!0});const Tre=Qa,Mre=(e,t)=>{const r=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);r.width=e.dims[3],r.height=e.dims[2];const n=r.getContext("2d");if(n!=null){let s,a;(t==null?void 0:t.tensorLayout)!==void 0&&t.tensorLayout==="NHWC"?(s=e.dims[2],a=e.dims[3]):(s=e.dims[3],a=e.dims[2]);const i=(t==null?void 0:t.format)!==void 0?t.format:"RGB",l=t==null?void 0:t.norm;let c,d;l===void 0||l.mean===void 0?c=[255,255,255,255]:typeof l.mean=="number"?c=[l.mean,l.mean,l.mean,l.mean]:(c=[l.mean[0],l.mean[1],l.mean[2],0],l.mean[3]!==void 0&&(c[3]=l.mean[3])),l===void 0||l.bias===void 0?d=[0,0,0,0]:typeof l.bias=="number"?d=[l.bias,l.bias,l.bias,l.bias]:(d=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(d[3]=l.bias[3]));const p=a*s;let u=0,h=p,f=p*2,m=-1;i==="RGBA"?(u=0,h=p,f=p*2,m=p*3):i==="RGB"?(u=0,h=p,f=p*2):i==="RBG"&&(u=0,f=p,h=p*2);for(let v=0;v<a;v++)for(let k=0;k<s;k++){const y=(e.data[u++]-d[0])*c[0],g=(e.data[h++]-d[1])*c[1],_=(e.data[f++]-d[2])*c[2],w=m===-1?255:(e.data[m++]-d[3])*c[3];n.fillStyle="rgba("+y+","+g+","+_+","+w+")",n.fillRect(k,v,1,1)}if("toDataURL"in r)return r.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Ere=(e,t)=>{const r=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let n;if(r!=null){let s,a,i;(t==null?void 0:t.tensorLayout)!==void 0&&t.tensorLayout==="NHWC"?(s=e.dims[2],a=e.dims[1],i=e.dims[3]):(s=e.dims[3],a=e.dims[2],i=e.dims[1]);const l=t!==void 0&&t.format!==void 0?t.format:"RGB",c=t==null?void 0:t.norm;let d,p;c===void 0||c.mean===void 0?d=[255,255,255,255]:typeof c.mean=="number"?d=[c.mean,c.mean,c.mean,c.mean]:(d=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(d[3]=c.mean[3])),c===void 0||c.bias===void 0?p=[0,0,0,0]:typeof c.bias=="number"?p=[c.bias,c.bias,c.bias,c.bias]:(p=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(p[3]=c.bias[3]));const u=a*s;if(t!==void 0&&(t.format!==void 0&&i===4&&t.format!=="RGBA"||i===3&&t.format!=="RGB"&&t.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const h=4;let f=0,m=1,v=2,k=3,y=0,g=u,_=u*2,w=-1;l==="RGBA"?(y=0,g=u,_=u*2,w=u*3):l==="RGB"?(y=0,g=u,_=u*2):l==="RBG"&&(y=0,_=u,g=u*2),n=r.createImageData(s,a);for(let x=0;x<a*s;f+=h,m+=h,v+=h,k+=h,x++)n.data[f]=(e.data[y++]-p[0])*d[0],n.data[m]=(e.data[g++]-p[1])*d[1],n.data[v]=(e.data[_++]-p[2])*d[2],n.data[k]=w===-1?255:(e.data[w++]-p[3])*d[3]}else throw new Error("Can not access image data");return n},sw=(e,t)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(t.height===void 0||t.width===void 0)throw new Error("Image height and width must be defined");if(t.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:r,width:n}=t,s=t.norm??{mean:255,bias:0};let a,i;typeof s.mean=="number"?a=[s.mean,s.mean,s.mean,s.mean]:a=[s.mean[0],s.mean[1],s.mean[2],s.mean[3]??255],typeof s.bias=="number"?i=[s.bias,s.bias,s.bias,s.bias]:i=[s.bias[0],s.bias[1],s.bias[2],s.bias[3]??0];const l=t.format!==void 0?t.format:"RGBA",c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:"RGB",d=r*n,p=c==="RGBA"?new Float32Array(d*4):new Float32Array(d*3);let u=4,h=0,f=1,m=2,v=3,k=0,y=d,g=d*2,_=-1;l==="RGB"&&(u=3,h=0,f=1,m=2,v=-1),c==="RGBA"?_=d*3:c==="RBG"?(k=0,g=d,y=d*2):c==="BGR"&&(g=0,y=d,k=d*2);for(let x=0;x<d;
482x++,h+=u,m+=u,f+=u,v+=u)p[k++]=(e[h]+i[0])/a[0],p[y++]=(e[f]+i[1])/a[1],p[g++]=(e[m]+i[2])/a[2],_!==-1&&v!==-1&&(p[_++]=(e[v]+i[3])/a[3]);return c==="RGBA"?new ma("float32",p,[1,4,r,n]):new ma("float32",p,[1,3,r,n])},Sre=async(e,t)=>{const r=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,n=typeof ImageData<"u"&&e instanceof ImageData,s=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,a=typeof e=="string";let i,l=t??{};const c=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},d=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(r){const p=c();p.width=e.width,p.height=e.height;const u=d(p);if(u!=null){let h=e.height,f=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(h=t.resizedHeight,f=t.resizedWidth),t!==void 0){if(l=t,t.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");l.tensorFormat="RGBA",l.height=h,l.width=f}else l.tensorFormat="RGBA",l.height=h,l.width=f;u.drawImage(e,0,0),i=u.getImageData(0,0,f,h).data}else throw new Error("Can not access image data")}else if(n){let p,u;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(p=t.resizedHeight,u=t.resizedWidth):(p=e.height,u=e.width),t!==void 0&&(l=t),l.format="RGBA",l.height=p,l.width=u,t!==void 0){const h=c();h.width=u,h.height=p;const f=d(h);if(f!=null)f.putImageData(e,0,0),i=f.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(s){if(t===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=c();p.width=e.width,p.height=e.height;const u=d(p);if(u!=null){const h=e.height,f=e.width;return u.drawImage(e,0,0,f,h),i=u.getImageData(0,0,f,h).data,l.height=h,l.width=f,sw(i,l)}else throw new Error("Can not access image data")}else{if(a)return new Promise((p,u)=>{const h=c(),f=d(h);if(!e||!f)return u();const m=new Image;m.crossOrigin="Anonymous",m.src=e,m.onload=()=>{h.width=m.width,h.height=m.height,f.drawImage(m,0,0,h.width,h.height);const v=f.getImageData(0,0,h.width,h.height);l.height=h.height,l.width=h.width,p(sw(v.data,l))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return sw(i,l);throw new Error("Input data provided is not supported - aborted tensor creation")},Are=(e,t)=>{const{width:r,height:n,download:s,dispose:a}=t,i=[1,n,r,4];return new ma({location:"texture",type:"float32",texture:e,dims:i,download:s,dispose:a})},Pre=(e,t)=>{const{dataType:r,dims:n,download:s,dispose:a}=t;return new ma({location:"gpu-buffer",type:r??"float32",gpuBuffer:e,dims:n,download:s,dispose:a})},Cre=(e,t)=>{const{dataType:r,dims:n,download:s,dispose:a}=t;return new ma({location:"ml-tensor",type:r??"float32",mlTensor:e,dims:n,download:s,dispose:a})},jre=(e,t,r)=>new ma({location:"cpu-pinned",type:e,data:t,dims:r??[t.length]}),gd=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Qm=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let CC=!1;const Ire=()=>{if(!CC){CC=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,t=typeof BigUint64Array<"u"&&BigUint64Array.from,r=globalThis.Float16Array,n=typeof r<"u"&&r.from;e&&(gd.set("int64",BigInt64Array),Qm.set(BigInt64Array,"int64")),t&&(gd.set("uint64",BigUint64Array),Qm.set(BigUint64Array,"uint64")),n?(gd.set("float16",r),Qm.set(r,"float16")):gd.set("float16",Uint16Array)}},$re=e=>{let t=1;for(let r=0;r<e.length;r++){const n=e[r];if(typeof n!="number"||!Number.isSafeInteger(n))throw new TypeError(`dims[${r}] must be an integer, got: ${n}`);if(n<0)throw new RangeError(`dims[${r}] must be a non-negative integer, got: ${n}`);t*=n}return t},Nre=(e,t)=>
vendor: 7,066 bytes, line 482
482{switch(e.location){case"cpu":return new ma(e.type,e.data,t);case"cpu-pinned":return new ma({location:"cpu-pinned",data:e.data,type:e.type,dims:t});case"texture":return new ma({location:"texture",texture:e.texture,type:e.type,dims:t});case"gpu-buffer":return new ma({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case"ml-tensor":return new ma({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:t});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let ma=class{constructor(t,r,n){Ire();let s,a;if(typeof t=="object"&&"location"in t)switch(this.dataLocation=t.location,s=t.type,a=t.dims,t.location){case"cpu-pinned":{const l=gd.get(s);if(!l)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(t.data instanceof l))throw new TypeError(`buffer should be of type ${l.name}`);this.cpuData=t.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=t.texture,this.downloader=t.download,this.disposer=t.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=t.gpuBuffer,this.downloader=t.download,this.disposer=t.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=t.mlTensor,this.downloader=t.download,this.disposer=t.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let l,c;if(typeof t=="string")if(s=t,c=n,t==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");l=r}else{const d=gd.get(t);if(d===void 0)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(r)){if(t==="float16"&&d===Uint16Array||t==="uint4"||t==="int4")throw new TypeError(`Creating a ${t} tensor from number array is not supported. Please use ${d.name} as data.`);t==="uint64"||t==="int64"?l=d.from(r,BigInt):l=d.from(r)}else if(r instanceof d)l=r;else if(r instanceof Uint8ClampedArray)if(t==="uint8")l=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(t==="float16"&&r instanceof Uint16Array&&d!==Uint16Array)l=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${s} tensor's data must be type of ${d}`)}else if(c=r,Array.isArray(t)){if(t.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const d=typeof t[0];if(d==="string")s="string",l=t;else if(d==="boolean")s="bool",l=Uint8Array.from(t);else throw new TypeError(`Invalid element type of data array: ${d}.`)}else if(t instanceof Uint8ClampedArray)s="uint8",l=Uint8Array.from(t);else{const d=Qm.get(t.constructor);if(d===void 0)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);s=d,l=t}if(c===void 0)c=[l.length];else if(!Array.isArray(c))throw new TypeError("A tensor's dims must be a number array");a=c,this.cpuData=l,this.dataLocation="cpu"}const i=$re(a);if(this.cpuData&&i!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=a,this.size=i}static async fromImage(t,r){return Sre(t,r)}static fromTexture(t,r){return Are(t,r)}static fromGpuBuffer(t,r){return Pre(t,r)}static fromMLTensor(t,r){return Cre(t,r)}static fromPinnedBuffer(t,r,n){return jre(t,r,n)}toDataURL(t){return Mre(this,t)}toImageData(t){return Ere(this,t)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(t){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,t&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(t){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Nre(this,t)}};const Xc=ma,lL=(e,t)=>{(typeof Qa.trace>"u"?!Qa.wasm.trace:!Qa.trace)||console.timeStamp(`${e}::ORT::${t}`)},cL=(e,t)=>{var s;const r=((s=new Error().stack)==null?void 0:s.split(/\r\n|\r|\n/g))||[];let n=!1;for(let a=0;a<r.length;a++){if(n&&!r[a].includes("TRACE_FUNC")){let i=`FUNC_${e}::${r[a].trim().split(" ")[1]}`;t&&(i+=`::${t}`),lL("CPU",i);return}r[a].includes("TRACE_FUNC")&&(n=!0)}},$b=e=>{(typeof Qa.trace>"u"?!Qa.wasm.trace:!Qa.trace)||cL("BEGIN",e)},Nb=e=>{(typeof Qa.trace>"u"?!Qa.wasm.trace:!Qa.trace)||cL("END",e)};let Ore=class dL{constructor(t){this.handler=t}async run(t,r,n){$b();const s={};let a={};if(typeof t!="object"||t===null||t instanceof Xc||Array.isArray(t))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof r=="object"){if(r===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(r instanceof Xc)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(r)){if(r.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const d of r){if(typeof d!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(d)===-1)throw new RangeError(`'fetches' contains invali
482d output name: ${d}.`);s[d]=null}if(typeof n=="object"&&n!==null)a=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else{let d=!1;const p=Object.getOwnPropertyNames(r);for(const u of this.outputNames)if(p.indexOf(u)!==-1){const h=r[u];(h===null||h instanceof Xc)&&(d=!0,i=!1,s[u]=h)}if(d){if(typeof n=="object"&&n!==null)a=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else a=r}}else if(typeof r<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const d of this.inputNames)if(typeof t[d]>"u")throw new Error(`input '${d}' is missing in 'feeds'.`);if(i)for(const d of this.outputNames)s[d]=null;const l=await this.handler.run(t,s,a),c={};for(const d in l)if(Object.hasOwnProperty.call(l,d)){const p=l[d];p instanceof Xc?c[d]=p:c[d]=new Xc(p.type,p.data,p.dims)}return Nb(),c}async release(){return this.handler.dispose()}static async create(t,r,n,s){$b();let a,i={};if(typeof t=="string"){if(a=t,typeof r=="object"&&r!==null)i=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(a=t,typeof r=="object"&&r!==null)i=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer){const p=t;let u=0,h=t.byteLength;if(typeof r=="object"&&r!==null)i=r;else if(typeof r=="number"){if(u=r,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=t.byteLength-u,typeof n=="number"){if(h=n,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof s=="object"&&s!==null)i=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(typeof n<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof r<"u")throw new TypeError("'options' must be an object.");a=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[l,c]=await bre(i),d=await l.createInferenceSessionHandler(a,c);return Nb(),new dL(d)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const Rre=Ore,Dre=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Rre,TRACE:lL,TRACE_FUNC_BEGIN:$b,TRACE_FUNC_END:Nb,Tensor:Xc,env:Tre,registerBackend:wre},Symbol.toStringTag,{value:"Module"}));/*!
483 * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4
484 * Copyright (c) Microsoft Corporation. All rights reserved.
485 * Licensed under the MIT License.
486 */var I1=Object.defineProperty,Fre=Object.getOwnPropertyDescriptor,Lre=Object.getOwnPropertyNames,zre=Object.prototype.hasOwnProperty,Bre=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Je=(e,t)=>
vendor: 15,635 bytes, line 486
486()=>(e&&(t=e(e=0)),t),pu=(e,t)=>{for(var r in t)I1(e,r,{get:t[r],enumerable:!0})},Ure=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Lre(t))!zre.call(e,s)&&s!==r&&I1(e,s,{get:()=>t[s],enumerable:!(n=Fre(t,s))||n.enumerable});return e},_h=e=>Ure(I1({},"__esModule",{value:!0}),e),ap,ho,Hl,jC,uL,pL=Je(()=>{ap=new Map,ho=[],Hl=(e,t,r)=>{if(t&&typeof t.init=="function"&&typeof t.createInferenceSessionHandler=="function"){let n=ap.get(e);if(n===void 0)ap.set(e,{backend:t,priority:r});else{if(n.priority>r)return;if(n.priority===r&&n.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${r}`)}if(r>=0){let s=ho.indexOf(e);s!==-1&&ho.splice(s,1);for(let a=0;a<ho.length;a++)if(ap.get(ho[a]).priority<=r){ho.splice(a,0,e);return}ho.push(e)}return}throw new TypeError("not a valid backend")},jC=async e=>{let t=ap.get(e);if(!t)return"backend not found.";if(t.initialized)return t.backend;if(t.aborted)return t.error;{let r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(n){return r||(t.error=`${n}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},uL=async e=>{let t=e.executionProviders||[],r=t.map(c=>typeof c=="string"?c:c.name),n=r.length===0?ho:r,s,a=[],i=new Set;for(let c of n){let d=await jC(c);typeof d=="string"?a.push({name:c,err:d}):(s||(s=d),s===d&&i.add(c))}if(!s)throw new Error(`no available backend found. ERR: ${a.map(c=>`[${c.name}] ${c.err}`).join(", ")}`);for(let{name:c,err:d}of a)r.includes(c)&&console.warn(`removing requested execution provider "${c}" from session options because it is not available: ${d}`);let l=t.filter(c=>i.has(typeof c=="string"?c:c.name));return[s,new Proxy(e,{get:(c,d)=>d==="executionProviders"?l:Reflect.get(c,d)})]}}),Wre=Je(()=>{pL()}),hL,Vre=Je(()=>{hL="1.22.0-dev.20250409-89f8206ba4"}),aw,ca,fL=Je(()=>{Vre(),aw="warning",ca={wasm:{},webgl:{},webgpu:{},versions:{common:hL},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);aw=e}},get logLevel(){return aw}},Object.defineProperty(ca,"logLevel",{enumerable:!0})}),Pr,Gre=Je(()=>{fL(),Pr=ca}),mL,gL,qre=Je(()=>{mL=(e,t)=>{let r=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);r.width=e.dims[3],r.height=e.dims[2];let n=r.getContext("2d");if(n!=null){let s,a;(t==null?void 0:t.tensorLayout)!==void 0&&t.tensorLayout==="NHWC"?(s=e.dims[2],a=e.dims[3]):(s=e.dims[3],a=e.dims[2]);let i=(t==null?void 0:t.format)!==void 0?t.format:"RGB",l=t==null?void 0:t.norm,c,d;l===void 0||l.mean===void 0?c=[255,255,255,255]:typeof l.mean=="number"?c=[l.mean,l.mean,l.mean,l.mean]:(c=[l.mean[0],l.mean[1],l.mean[2],0],l.mean[3]!==void 0&&(c[3]=l.mean[3])),l===void 0||l.bias===void 0?d=[0,0,0,0]:typeof l.bias=="number"?d=[l.bias,l.bias,l.bias,l.bias]:(d=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(d[3]=l.bias[3]));let p=a*s,u=0,h=p,f=p*2,m=-1;i==="RGBA"?(u=0,h=p,f=p*2,m=p*3):i==="RGB"?(u=0,h=p,f=p*2):i==="RBG"&&(u=0,f=p,h=p*2);for(let v=0;v<a;v++)for(let k=0;k<s;k++){let y=(e.data[u++]-d[0])*c[0],g=(e.data[h++]-d[1])*c[1],_=(e.data[f++]-d[2])*c[2],w=m===-1?255:(e.data[m++]-d[3])*c[3];n.fillStyle="rgba("+y+","+g+","+_+","+w+")",n.fillRect(k,v,1,1)}if("toDataURL"in r)return r.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},gL=(e,t)=>{let r=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),n;if(r!=null){let s,a,i;(t==null?void 0:t.tensorLayout)!==void 0&&t.tensorLayout==="NHWC"?(s=e.dims[2],a=e.dims[1],i=e.dims[3]):(s=e.dims[3],a=e.dims[2],i=e.dims[1]);let l=t!==void 0&&t.format!==void 0?t.format:"RGB",c=t==null?void 0:t.norm,d,p;c===void 0||c.mean===void 0?d=[255,255,255,255]:typeof c.mean=="number"?d=[c.mean,c.mean,c.mean,c.mean]:(d=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(d[3]=c.mean[3])),c===void 0||c.bias===void 0?p=[0,0,0,0]:typeof c.bias=="number"?p=[c.bias,c.bias,c.bias,c.bias]:(p=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(p[3]=c.bias[3]));let u=a*s;if(t!==void 0&&(t.format!==void 0&&i===4&&t.format!=="RGBA"||i===3&&t.format!=="RGB"&&t.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let h=4,f=0,m=1,v=2,k=3,y=0,g=u,_=u*2,w=-1;l==="RGBA"?(y=0,g=u,_=u*2,w=u*3):l==="RGB"?(y=0,g=u,_=u*2):l==="RBG"&&(y=0,_=u,g=u*2),n=r.createImageData(s,a);for(let x=0;x<a*s;f+=h,m+=h,v+=h,k+=h,x++)n.data[f]=(e.data[y++]-p[0])*d[0],n.data[m]=(e.data[g++]-p[1])*d[1],n.data[v]=(e.data[_++]-p[2])*d[2],n.data[k]=w===-1?255:(e.data[w++]-p[3])*d[3]}else throw new Error("Can not access image data");return n}}),pm,yL,vL,_L,wL,xL,Hre=Je(()=>{$1(),pm=(e,t)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(t.height===void 0||t.width===void 0)throw new Error("Image height and width must be defined");if(t.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:r,width:n}=t,s=t.norm??{mean:255,bias:0},a,i;typeof s.mean=="number"?a=[s.mean,s.mean,s.mean,s.mean]:a=[s.mean[0],s.mean[1],s.mean[2],s.mean[3]??255],typeof s.bias=="number"?i=[s.bias,s.bias,s.bias,s.bias]:i=[s.bias[0],s.bias[1],s.bias[2],s.bias[3]??0];let l=t.format!==void 0?t.format:"RGBA",c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:"RGB",d=r*n,p=c==="RGBA"?new Float32Array(d*4):new Float32Array(d*3),u=4,h=0,f=1,m=2,v=3,k=0,y=d,g=d*2,_=-1;l==="RGB"&&(u=3,h=0,f=1,m=2,v=-1),c==="RGBA"?_=d*3:c==="RBG"?(k=0,g=d,y=d*2):c==="BGR"&&(g=0,y=d,k=d*2);for(let w=0;w<d;w++,h+=u,m+=u,f+=u,v+=u)p[k++]=(e[h]+i[0])/a[0],p[y++]=(e[f]+i[1])/a[1],p[g++]=(e[m]+i[2])/a[2],_!==-1&&v!==-1&&(p[_++]=(e[v]+i[3])/a[3]);return c==="RGBA"?new Vs("float32",p,[1,4,r,n]):new Vs("float32",p,[1,3,r,n])},yL=async(e,t)=>{let r=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,n=typeof ImageData<"u"&&e instanceof ImageData,s=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,a=typeof e=="string",i,l=t??{},c=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},d=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(r){let p=c();p.width=e.width,p.height=e.height;let u=d(p);if(u!=null){let h=e.height,f=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(h=t.resizedHeight,f=t.resizedWidth),t!==void 0){if(l=t,t.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");l.tensorFormat="RGBA",l.height=h,l.width=f}else l.tensorFormat="RGBA",l.height=h,l.width=f;u.drawImage(e,0,0),i=u.getImageData(0,0,f,h).data}else throw new Error("Can not access image data")}else if(n){let p,u;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(p=t.resizedHeight,u=t.resizedWidth):(p=e.height,u=e.width),t!==void 0&&(l=t),l.format="RGBA",l.height=p,l.width=u,t!==void 0){let h=c();h.width=u,h.height=p;let f=d(h);if(f!=null)f.putImageData(e,0,0),i=f.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(s){if(t===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=c();p.width=e.width,p.height=e.height;let u=d(p);if(u!=null){let h=e.height,f=e.width;return u.drawImage(e,0,0,f,h),i=u.getImageData(0,0,f,h).data,l.height=h,l.width=f,pm(i,l)}else throw new Error("Can not access image data")}else{if(a)return new Promise((p,u)=>{let h=c(),f=d(h);if(!e||!f)return u();let m=new Image;m.crossOrigin="Anonymous",m.src=e,m.onload=()=>{h.width=m.width,h.height=m.height,f.drawImage(m,0,0,h.width,h.height);let v=f.getImageData(0,0,h.width,h.height);l.height=h.height,l.width=h.width,p(pm(v.data,l))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return pm(i,l);throw new Error("Input data provided is not supported - aborted tensor creation")},vL=(e,t)=>{let{width:r,height:n,download:s,dispose:a}=t,i=[1,n,r,4];return new Vs({location:"texture",type:"float32",texture:e,dims:i,download:s,dispose:a})},_L=(e,t)=>{let{dataType:r,dims:n,download:s,dispose:a}=t;return new Vs({location:"gpu-buffer",type:r??"float32",gpuBuffer:e,dims:n,download:s,dispose:a})},wL=(e,t)=>{let{dataType:r,dims:n,download:s,dispose:a}=t;return new Vs({location:"ml-tensor",type:r??"float32",mlTensor:e,dims:n,download:s,dispose:a})},xL=(e,t,r)=>new Vs({location:"cpu-pinned",type:e,data:t,dims:r??[t.length]})}),zl,xp,iw,bL,Kre=Je(()=>{zl=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),xp=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),iw=!1,bL=()=>{if(!iw){iw=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,t=typeof BigUint64Array<"u"&&BigUint64Array.from,r=globalThis.Float16Array,n=typeof r<"u"&&r.from;e&&(zl.set("int64",BigInt64Array),xp.set(BigInt64Array,"int64")),t&&(zl.set("uint64",BigUint64Array),xp.set(BigUint64Array,"uint64")),n?(zl.set("float16",r),xp.set(r,"float16")):zl.set("float16",Uint16Array)}}}),kL,TL,Qre=Je(()=>{$1(),kL=e=>{let t=1;for(let r=0;r<e.length;r++){let n=e[r];if(typeof n!="number"||!Number.isSafeInteger(n))throw new TypeError(`dims[${r}] must be an integer, got: ${n}`);if(n<0)throw new RangeError(`dims[${r}] must be a non-negative integer, got: ${n}`);t*=n}return t},TL=(e,t)=>{switch(e.location){case"cpu":return new Vs(e.type,e.data,t);case"cpu-pinned":return new Vs({location:"cpu-pinned",data:e.data,type:e.type,dims:t});case"texture":return new Vs({location:"texture",texture:e.texture,type:e.type,dims:t});case"gpu-buffer":return new Vs({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case"ml-tensor":return new Vs({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:t});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Vs,$1=Je(()=>{qre(),Hre(),Kre(),Qre(),Vs=class{constructor(e,t,r){bL();let n,s;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,n=e.type,s=e.dims,e.location){case"cpu-pinned":{let i=zl.get(n);if(!i)throw new TypeError(`unsupported type "${n}" to create tensor from pinned buffer`);if(!(e.data instanceof i))throw new TypeError(`buffer should be of type ${i.name}`);this.cpuData=e.data;break}case"texture":{if(n!=="float32")throw new TypeError(`unsupported type "${n}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(n!=="float32"&&n!=="float16"&&n!=="int32"&&n!=="int64"&&n!=="uint32"&&n!=="uint8"&&n!=="bool"&&n!=="uint4"&&n!=="int4")throw new TypeError(`unsupported type "${n}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(n!=="float32"&&n!=="float16"&&n!=="int32"&&n!=="int64"&&n!=="uint32"&&n!=="uint64"&&n!=="int8"&&n!=="uint8"&&n!=="bool"&&n!=="uint4"&&n!=="int4")throw new TypeError(`unsupported type "${n}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let i,l;if(typeof e=="string")if(n=e,l=r,e==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");i=t}else{let c=zl.get(e);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e==="float16"&&c===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${c.name} as data.`);e==="uint64"||e==="int64"?i=c.from(t,BigInt):i=c.from(t)}else if(t instanceof c)i=t;else if(t instanceof Uint8ClampedArray)if(e==="uint8")i=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&t instanceof Uint16Array&&c!==Uint16Array)i=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${n} tensor's data must be type of ${c}`)}else if(l=t,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let c=typeof e[0];if(c==="string")n="string",i=e;else if(c==="boolean")n="bool",i=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else if(e instanceof Uint8ClampedArray)n="uint8",i=Uint8Array.from(e);else{let c=xp.get(e.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);n=c,i=e}if(l===void 0)l=[i.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");s=l,this.cpuData=i,this.dataLocation="cpu"}let a=kL(s);if(this.cpuData&&a!==this.cpuData.length&&!((n==="uint4"||n==="int4")&&Math.ceil(a/2)===this.cpuData.length))throw new Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=n,this.dims=s,this.size=a}static async fromImage(e,t){return yL(e,t)}static fromTexture(e,t){return vL(e,t)}static fromGpuBuffer(e,t){return _L(e,t)}static fromMLTensor(e,t){return wL(e,t)}static fromPinnedBuffer(e,t,r){return xL(e,t,r)}toDataURL(e){return mL(this,e)}toImageData(e){return gL(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return TL(this,e)}}}),qa,ML=Je(()=>{$1(),qa=Vs}
486),wh,ow,Xa,_a,EL=Je(()=>{fL(),wh=(e,t)=>{(typeof ca.trace>"u"?!ca.wasm.trace:!ca.trace)||console.timeStamp(`${e}::ORT::${t}`)},ow=(e,t)=>{var s;let r=((s=new Error().stack)==null?void 0:s.split(/\r\n|\r|\n/g))||[],n=!1;for(let a=0;a<r.length;a++){if(n&&!r[a].includes("TRACE_FUNC")){let i=`FUNC_${e}::${r[a].trim().split(" ")[1]}`;t&&(i+=`::${t}`),wh("CPU",i);return}r[a].includes("TRACE_FUNC")&&(n=!0)}},Xa=e=>{(typeof ca.trace>"u"?!ca.wasm.trace:!ca.trace)||ow("BEGIN",e)},_a=e=>{(typeof ca.trace>"u"?!ca.wasm.trace:!ca.trace)||ow("END",e)}}),SL,Yre=Je(()=>{pL(),ML(),EL(),SL=class AL{constructor(t){this.handler=t}async run(t,r,n){Xa();let s={},a={};if(typeof t!="object"||t===null||t instanceof qa||Array.isArray(t))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof r=="object"){if(r===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(r instanceof qa)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(r)){if(r.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(let d of r){if(typeof d!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(d)===-1)throw new RangeError(`'fetches' contains invalid output name: ${d}.`);s[d]=null}if(typeof n=="object"&&n!==null)a=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else{let d=!1,p=Object.getOwnPropertyNames(r);for(let u of this.outputNames)if(p.indexOf(u)!==-1){let h=r[u];(h===null||h instanceof qa)&&(d=!0,i=!1,s[u]=h)}if(d){if(typeof n=="object"&&n!==null)a=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else a=r}}else if(typeof r<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let d of this.inputNames)if(typeof t[d]>"u")throw new Error(`input '${d}' is missing in 'feeds'.`);if(i)for(let d of this.outputNames)s[d]=null;let l=await this.handler.run(t,s,a),c={};for(let d in l)if(Object.hasOwnProperty.call(l,d)){let p=l[d];p instanceof qa?c[d]=p:c[d]=new qa(p.type,p.data,p.dims)}return _a(),c}async release(){return this.handler.dispose()}static async create(t,r,n,s){Xa();let a,i={};if(typeof t=="string"){if(a=t,typeof r=="object"&&r!==null)i=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(a=t,typeof r=="object"&&r!==null)i=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer){let p=t,u=0,h=t.byteLength;if(typeof r=="object"&&r!==null)i=r;else if(typeof r=="number"){if(u=r,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=t.byteLength-u,typeof n=="number"){if(h=n,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof s=="object"&&s!==null)i=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(typeof n<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof r<"u")throw new TypeError("'options' must be an object.");a=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[l,c]=await uL(i),d=await l.createInferenceSessionHandler(a,c);return _a(),new AL(d)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),N1,Jre=Je(()=>{Yre(),N1=SL}),Zre=Je(()=>{}),Xre=Je(()=>{}),ene=Je(()=>{}),tne=Je(()=>{}),PL={};pu(PL,{InferenceSession:()=>N1,TRACE:()=>wh,TRACE_FUNC_BEGIN:()=>Xa,TRACE_FUNC_END:()=>_a,Tensor:()=>qa,env:()=>Pr,registerBackend:()=>Hl});var ti=Je(()=>{Wre(),Gre(),Jre(),ML(),Zre(),Xre(),EL(),ene(),tne()}),O1=Je(()=>{}),CL={};pu(CL,{default:()=>jL});var lw,cw,jL,rne=Je(()=>{var e;R4(),vc(),R1(),lw="ort-wasm-proxy-worker",cw=((e=globalThis.self)==null?void 0:e.name)===lw,cw&&(self.onmessage=t=>{let{type:r,in:n}=t.data;
486try{switch(r){case"init-wasm":D1(n.wasm).then(()=>{tk(n).then(()=>{postMessage({type:r})},s=>{postMessage({type:r,err:s})})},s=>{postMessage({type:r,err:s})});break;case"init-ep":{let{epName:s,env:a}=n;rk(a,s).then(()=>{postMessage({type:r})},i=>{postMessage({type:r,err:i})});break}case"copy-from":{let{buffer:s}=n,a=Kg(s);postMessage({type:r,out:a});break}case"create":{let{model:s,options:a}=n;nk(s,a).then(i=>{postMessage({type:r,out:i})},i=>{postMessage({type:r,err:i})});break}case"release":sk(n),postMessage({type:r});break;case"run":{let{sessionId:s,inputIndices:a,inputs:i,outputIndices:l,options:c}=n;ak(s,a,i,l,new Array(l.length).fill(null),c).then(d=>{d.some(p=>p[3]!=="cpu")?postMessage({type:r,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:r,out:d},ok([...i,...d]))},d=>{postMessage({type:r,err:d})});break}case"end-profiling":ik(n),postMessage({type:r});break;default:}}catch(s){postMessage({type:r,err:s})}}),jL=cw?null:t=>new Worker(t??Ls,{type:"module",name:lw})}),IL={};pu(IL,{default:()=>$L});var dw,uw,$L,IC,nne=Je(()=>{var e,t;uw=(dw=import.meta.url,async function(r={}){var Cc;var n,s,a=r,i=new Promise((T,P)=>{n=T,s=P}),l=typeof window=="object",c=typeof WorkerGlobalScope<"u",d=c&&((Cc=self.name)==null?void 0:Cc.startsWith("em-pthread"));a.mountExternalData=(T,P)=>{T.startsWith("./")&&(T=T.substring(2)),(a.Eb||(a.Eb=new Map)).set(T,P)},a.unmountExternalData=()=>{delete a.Eb};var p=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let u=T=>async(...P)=>{var O;try{if(a.Fb)throw Error("Session already started");let W=a.Fb={dc:P[0],errors:[]},X=await T(...P);if(a.Fb!==W)throw Error("Session mismatch");(O=a.Jb)==null||O.flush();let ge=W.errors;if(0<ge.length){let $e=await Promise.all(ge);if($e=$e.filter(qe=>qe),0<$e.length)throw Error($e.join(`
487`))}return X}finally{a.Fb=null}};a.jsepInit=(T,P)=>{if(T==="webgpu"){[a.Jb,a.Ub,a.Yb,a.Kb,a.Xb,a.jb,a.Zb,a.ac,a.Vb,a.Wb,a.$b]=P;let O=a.Jb;a.jsepRegisterBuffer=(W,X,ge,$e)=>O.registerBuffer(W,X,ge,$e),a.jsepGetBuffer=W=>O.getBuffer(W),a.jsepCreateDownloader=(W,X,ge)=>O.createDownloader(W,X,ge),a.jsepOnCreateSession=W=>{O.onCreateSession(W)},a.jsepOnReleaseSession=W=>{O.onReleaseSession(W)},a.jsepOnRunStart=W=>O.onRunStart(W),a.bc=(W,X)=>{O.upload(W,X)}}else if(T==="webnn"){let O=P[0];[a.nc,a.Nb,a.webnnEnsureTensor,a.Ob,a.webnnDownloadTensor]=P.slice(1),a.webnnReleaseTensorId=a.Nb,a.webnnUploadTensor=a.Ob,a.webnnOnRunStart=W=>O.onRunStart(W),a.webnnOnRunEnd=O.onRunEnd.bind(O),a.webnnRegisterMLContext=(W,X)=>{O.registerMLContext(W,X)},a.webnnOnReleaseSession=W=>{O.onReleaseSession(W)},a.webnnCreateMLTensorDownloader=(W,X)=>O.createMLTensorDownloader(W,X),a.webnnRegisterMLTensor=(W,X,ge,$e)=>O.registerMLTensor(W,X,ge,$e),a.webnnCreateMLContext=W=>O.createMLContext(W),a.webnnRegisterMLConstant=(W,X,ge,$e,qe,nt)=>O.registerMLConstant(W,X,ge,$e,qe,a.Eb,nt),a.webnnRegisterGraphInput=O.registerGraphInput.bind(O),a.webnnIsGraphInput=O.isGraphInput.bind(O),a.webnnCreateTemporaryTensor=O.createTemporaryTensor.bind(O),a.webnnIsInt64Supported=O.isInt64Supported.bind(O)}};let h=()=>{let T=(P,O,W)=>(...X)=>{let ge=jr,$e=O==null?void 0:O();X=P(...X);let qe=O==null?void 0:O();return $e!==qe&&(P=qe,W($e),O=W=null),jr!=ge?new Promise((nt,ct)=>{Os={resolve:nt,reject:ct}}):X};(()=>{for(let P of["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"])a[P]=T(a[P],()=>a[P],O=>a[P]=O)})(),u!==void 0&&(a._OrtRun=u(a._OrtRun),a._OrtRunWithBinding=u(a._OrtRunWithBinding)),h=void 0};a.asyncInit=()=>{h==null||h()};var f,m,v=Object.assign({},a),k=(T,P)=>{throw P},y="";(l||c)&&(c?y=self.location.href:typeof document<"u"&&document.currentScript&&(y=document.currentScript.src),dw&&(y=dw),y=y.startsWith("blob:")?"":y.slice(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1),c&&(m=T=>{var P=new XMLHttpRequest;return P.open("GET",T,!1),P.responseType="arraybuffer",P.send(null),new Uint8Array(P.response)}),f=async T=>{if(L(T))return new Promise((O,W)=>{var X=new XMLHttpRequest;X.open("GET",T,!0),X.responseType="arraybuffer",X.onload=()=>{X.status==200||X.status==0&&X.response?O(X.response):W(X.status)},X.onerror=W,X.send(null)});var P=await fetch(T,{credentials:"same-origin"});if(P.ok)return P.arrayBuffer();throw Error(P.status+" : "+P.url)});var g=console.log.bind(console),_=console.error.bind(console),w=g,x=_;Object.assign(a,v),v=null;var b,M,S,j,I,q,U,R,K,H,ee,te,V,ae=a.wasmBinary,ne=!1,L=T=>T.startsWith("file://");function $(){return b.buffer!=j.buffer&&ue(),j}function G(){return b.buffer!=j.buffer&&ue(),I}function se(){return b.buffer!=j.buffer&&ue(),q}function _e(){return b.buffer!=j.buffer&&ue(),U}function de(){return b.buffer!=j.buffer&&ue(),R}function Ee(){return b.buffer!=j.buffer&&ue(),K}function ze(){return b.buffer!=j.buffer&&ue(),H}function Ke(){return b.buffer!=j.buffer&&ue(),V}if(d){let T=function(P){try{var O=P.data,W=O.Bb;if(W==="load"){let X=[];self.onmessage=ge=>X.push(ge),self.startWorker=()=>{postMessage({Bb:"loaded"});for(let ge of X)T(ge);self.onmessage=T};for(let ge of O.Rb)a[ge]&&!a[ge].proxy||(a[ge]=(...$e)=>{postMessage({Bb:"callHandler",Qb:ge,args:$e})},ge=="print"&&(w=a[ge]),ge=="printErr"&&(x=a[ge]));b=O.kc,ue(),ve(O.lc)}else if(W==="run"){B(O.Ab),Mc(O.Ab,0,0,1,0,0),ks(),Ie(O.Ab),J||(Iu(),J=!0);try{oe(O.fc,O.Hb)}catch(X){if(X!="unwind")throw X}}else O.target!=="setimmediate"&&(W==="checkMailbox"?J&&Qe():W&&(x(`worker: received unknown command ${W}`),x(O)))}catch(X){throw Ec(),X}};var ve,J=!1;x=function(...P){P=P.join(" "),console.error(P)},self.alert=function(...P){postMessage({Bb:"alert",text:P.join(" "),ic:yl()})},self.onunhandledrejection=P=>{throw P.reason||P},self.onmessage=T}function ue(){var T=b.buffer;a.HEAP8=j=new Int8Array(T),a.HEAP16=q=new Int16Array(T),a.HEAPU8=I=new Uint8Array(T),a.HEAPU16=U=new Uint16Array(T),a.HEAP32=R=new Int32Array(T),a.HEAPU32=K=new Uint32Array(T),a.HEAPF32=H=new Float32Array(T),a.HEAPF64=V=new Float64Array(T),a.HEAP64=ee=new BigInt64Array(T),a.HEAPU64=te=new BigUint64Array(T)}function Y(){d?startWorker(a):_t.Ca()}d||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),ue());var Se,Ae=0,Oe=null;function Ne(){if(--Ae==0&&Oe){var T=Oe;Oe=null,T()}}function Q(T){throw x(T="Aborted("+T+")"),ne=!0,T=new WebAssembly.RuntimeError(T+". Build with -sASSERTIONS for more info."),s(T),T}function re(){return{a:{L:Te,Aa:Me,b:Ue,$:Nt,A:pt,pa:ar,X:Sr,Z:Kn,qa:Xs,na:Ta,ga:ea,ma:ri,J:ps,Y:ni,V:$s,oa:Ma,W:si,va:ii,E:gt,Q:ta,O:il,D:ll,u:cl,r:dl,P:oi,z:Z,R:ie,ja:fe,T:st,aa:ot,M:Et,F:er,ia:Ie,sa:Zt,t:cn,Ba:_n,w:wn,o:tn,l:aa,c:na,n:Nh,j:eo,v:Dh,p:Fh,f:Lh,s:zh,m:Bh,e:fu,k:Uh,i:Wh,g:mu,d:Vh,da:gu,ea:qh,fa:vu,ba:_u,ca:ml,N:wu,xa:Kh,ua:Yh,h:xu,C:Jh,G:bu,ta:Qh,x:Si,ra:Zh,U:zy,q:Hh,y:Xh,K:By,S:ef,za:tf,ya:rf,ka:Mu,la:Eu,_:It,B:kc,I:Su,ha:Au,H:Cu,a:b,wa:
vendor: 27,976 bytes, lines 487-492
487Fe}}}var pe={829644:(T,P,O,W,X)=>{if(a===void 0||!a.Eb)return 1;if((T=yt(Number(T>>>0))).startsWith("./")&&(T=T.substring(2)),!(T=a.Eb.get(T)))return 2;if(P=Number(P>>>0),O=Number(O>>>0),W=Number(W>>>0),P+O>T.byteLength)return 3;try{let ge=T.subarray(P,P+O);switch(X){case 0:G().set(ge,W>>>0);break;case 1:a.mc?a.mc(W,ge):a.bc(W,ge);break;default:return 4}return 0}catch{return 4}},830468:(T,P,O)=>{a.Ob(T,G().subarray(P>>>0,P+O>>>0))},830532:()=>a.nc(),830574:T=>{a.Nb(T)},830611:()=>{a.Vb()},830642:()=>{a.Wb()},830671:()=>{a.$b()},830696:T=>a.Ub(T),830729:T=>a.Yb(T),830761:(T,P,O)=>{a.Kb(Number(T),Number(P),Number(O),!0)},830824:(T,P,O)=>{a.Kb(Number(T),Number(P),Number(O))},830881:()=>typeof wasmOffsetConverter<"u",830938:T=>{a.jb("Abs",T,void 0)},830989:T=>{a.jb("Neg",T,void 0)},831040:T=>{a.jb("Floor",T,void 0)},831093:T=>{a.jb("Ceil",T,void 0)},831145:T=>{a.jb("Reciprocal",T,void 0)},831203:T=>{a.jb("Sqrt",T,void 0)},831255:T=>{a.jb("Exp",T,void 0)},831306:T=>{a.jb("Erf",T,void 0)},831357:T=>{a.jb("Sigmoid",T,void 0)},831412:(T,P,O)=>{a.jb("HardSigmoid",T,{alpha:P,beta:O})},831491:T=>{a.jb("Log",T,void 0)},831542:T=>{a.jb("Sin",T,void 0)},831593:T=>{a.jb("Cos",T,void 0)},831644:T=>{a.jb("Tan",T,void 0)},831695:T=>{a.jb("Asin",T,void 0)},831747:T=>{a.jb("Acos",T,void 0)},831799:T=>{a.jb("Atan",T,void 0)},831851:T=>{a.jb("Sinh",T,void 0)},831903:T=>{a.jb("Cosh",T,void 0)},831955:T=>{a.jb("Asinh",T,void 0)},832008:T=>{a.jb("Acosh",T,void 0)},832061:T=>{a.jb("Atanh",T,void 0)},832114:T=>{a.jb("Tanh",T,void 0)},832166:T=>{a.jb("Not",T,void 0)},832217:(T,P,O)=>{a.jb("Clip",T,{min:P,max:O})},832286:T=>{a.jb("Clip",T,void 0)},832338:(T,P)=>{a.jb("Elu",T,{alpha:P})},832396:T=>{a.jb("Gelu",T,void 0)},832448:T=>{a.jb("Relu",T,void 0)},832500:(T,P)=>{a.jb("LeakyRelu",T,{alpha:P})},832564:(T,P)=>{a.jb("ThresholdedRelu",T,{alpha:P})},832634:(T,P)=>{a.jb("Cast",T,{to:P})},832692:T=>{a.jb("Add",T,void 0)},832743:T=>{a.jb("Sub",T,void 0)},832794:T=>{a.jb("Mul",T,void 0)},832845:T=>{a.jb("Div",T,void 0)},832896:T=>{a.jb("Pow",T,void 0)},832947:T=>{a.jb("Equal",T,void 0)},833e3:T=>{a.jb("Greater",T,void 0)},833055:T=>{a.jb("GreaterOrEqual",T,void 0)},833117:T=>{a.jb("Less",T,void 0)},833169:T=>{a.jb("LessOrEqual",T,void 0)},833228:(T,P,O,W,X)=>{a.jb("ReduceMean",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},833403:(T,P,O,W,X)=>{a.jb("ReduceMax",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},833577:(T,P,O,W,X)=>{a.jb("ReduceMin",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},833751:(T,P,O,W,X)=>{a.jb("ReduceProd",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},833926:(T,P,O,W,X)=>{a.jb("ReduceSum",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834100:(T,P,O,W,X)=>{a.jb("ReduceL1",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834273:(T,P,O,W,X)=>{a.jb("ReduceL2",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834446:(T,P,O,W,X)=>{a.jb("ReduceLogSum",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834623:(T,P,O,W,X)=>{a.jb("ReduceSumSquare",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834803:(T,P,O,W,X)=>{a.jb("ReduceLogSumExp",T,{keepDims:!!P,noopWithEmptyAxes:!!O,axes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},834983:T=>{a.jb("Where",T,void 0)},835036:(T,P,O)=>{a.jb("Transpose",T,{perm:P?Array.from(de().subarray(Number(P)>>>0,Number(O)>>>0)):[]})},835160:(T,P,O,W)=>{a.jb("DepthToSpace",T,{blocksize:P,mode:yt(O),format:W?"NHWC":"NCHW"})},835293:(T,P,O,W)=>{a.jb("DepthToSpace",T,{blocksize:P,mode:yt(O),format:W?"NHWC":"NCHW"})},835426:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn,ci)=>{a.jb("ConvTranspose",T,{format:nt?"NHWC":"NCHW",autoPad:P,dilations:[O],group:W,kernelShape:[X],pads:[ge,$e],strides:[qe],wIsConst:()=>!!$()[ct>>>0],outputPadding:$t?Array.from(de().subarray(Number($t)>>>0,Number(Ht)>>>0)):[],outputShape:ur?Array.from(de().subarray(Number(ur)>>>0,Number(xn)>>>0)):[],activation:yt(ci)})},835859:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("ConvTranspose",T,{format:qe?"NHWC":"NCHW",autoPad:P,dilations:Array.from(de().subarray(Number(O)>>>0,2+(Number(O)>>>0)>>>0)),group:W,kernelShape:Array.from(de().subarray(Number(X)>>>0,2+(Number(X)>>>0)>>>0)),pads:Array.from(de().subarray(Number(ge)>>>0,4+(Number(ge)>>>0)>>>0)),strides:Array.from(de().subarray(Number($e)>>>0,2+(Number($e)>>>0)>>>0)),wIsConst:()=>!!$()[nt>>>0],outputPadding:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],outputShape:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[],activation:yt(xn)})},836520:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn,ci)=>{a.jb("ConvTranspose",T,{format:nt?"NHWC":"NCHW",autoPad:P,dilations:[O],group:W,kernelShape:[X],pads:[ge,$e],strides:[qe],wIsConst:()=>!!$()[ct>>>0],outputPadding:$t?Array.from(de().subarray(Number($t)>>>0,Number(Ht)>>>0)):[],outputShape:ur?Array.from(de().subarray(Number(ur)>>>0,Number(xn)>>>0)):[],activation:yt(ci)})},836953:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("ConvTranspose",T,{format:qe?"NHWC":"NCHW",autoPad:P,dilations:Array.from(de().subarray(Number(O)>>>0,2+(Number(O)>>>0)>>>0)),group:W,kernelShape:Array.from(de().subarray(Number(X)>>>0,2+(Number(X)>>>0)>>>0)),pads:Array.from(de().subarray(Number(ge)>>>0,4+(Number(ge)>>>0)>>>0)),strides:Array.from(de().subarray(Number($e)>>>0,2+(Number($e)>>>0)>>>0)),wIsConst:()=>!!$()[nt>>>0],outputPadding:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],outputShape:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[],activation:yt(xn)})},837614:(T,P)=>{a.jb("GlobalAveragePool",T,{format:P?"NHWC":"NCHW"})},837705:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("AveragePool",T,{format:xn?"NHWC":"NCHW",auto_pad:P,ceil_mode:O,count_include_pad:W,storage_order:X,dilations:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[],kernel_shape:qe?Array.from(de().subarray(Number(qe)>>>0,Number(nt)>>>0)):[],pads:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],strides:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[]})},838184:(T,P)=>{a.jb("GlobalAveragePool",T,{format:P?"NHWC":"NCHW"})},838275:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("AveragePool",T,{format:xn?"NHWC":"NCHW",auto_pad:P,ceil_mode:O,count_include_pad:W,storage_order:X,dilations:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[],kernel_shape:qe?Array.from(de().subarray(Number(qe)>>>0,Number(nt)>>>0)):[],pads:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],strides:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[]})},838754:(T,P)=>{a.jb("GlobalMaxPool",T,{format:P?"NHWC":"NCHW"})},838841:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("MaxPool",T,{format:xn?"NHWC":"NCHW",auto_pad:P,ceil_mode:O,count_include_pad:W,storage_order:X,dilations:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[],kernel_shape:qe?Array.from(de().subarray(Number(qe)>>>0,Number(nt)>>>0)):[],pads:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],strides:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[]})},839316:(T,P)=>{a.jb("GlobalMaxPool",T,{format:P?"NHWC":"NCHW"})},839403:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn)=>{a.jb("MaxPool",T,{format:xn?"NHWC":"NCHW",auto_pad:P,ceil_mode:O,count_include_pad:W,storage_order:X,dilations:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[],kernel_shape:qe?Array.from(de().subarray(Number(qe)>>>0,Number(nt)>>>0)):[],pads:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],strides:Ht?Array.from(de().subarray(Number(Ht)>>>0,Number(ur)>>>0)):[]})},839878:(T,P,O,W,X)=>{a.jb("Gemm",T,{alpha:P,beta:O,transA:W,transB:X})},839982:T=>{a.jb("MatMul",T,void 0)},840036:(T,P,O,W)=>{a.jb("ArgMax",T,{keepDims:!!P,selectLastIndex:!!O,axis:W})},840144:(T,P,O,W)=>{a.jb("ArgMin",T,{keepDims:!!P,selectLastIndex:!!O,axis:W})},840252:(T,P)=>{a.jb("Softmax",T,{axis:P})},840315:(T,P)=>{a.jb("Concat",T,{axis:P})},840375:(T,P,O,W,X)=>{a.jb("Split",T,{axis:P,numOutputs:O,splitSizes:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},840531:T=>{a.jb("Expand",T,void 0)},840585:(T,P)=>{a.jb("Gather",T,{axis:Number(P)})},840656:(T,P)=>{a.jb("GatherElements",T,{axis:Number(P)})},840735:(T,P)=>{a.jb("GatherND",T,{batch_dims:Number(P)})},840814:(T,P,O,W,X,ge,$e,qe,nt,ct,$t)=>{a.jb("Resize",T,{antialias:P,axes:O?Array.from(de().subarray(Number(O)>>>0,Number(W)>>>0)):[],coordinateTransformMode:yt(X),cubicCoeffA:ge,excludeOutside:$e,extrapolationValue:qe,keepAspectRatioPolicy:yt(nt),mode:yt(ct),nearestMode:yt($t)})},841176:(T,P,O,W,X,ge,$e)=>{a.jb("Slice",T,{starts:P?Array.from(de().subarray(Number(P)>>>0,Number(O)>>>0)):[],ends:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[],axes:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[]})},841440:T=>{a.jb("Tile",T,void 0)},841492:(T,P,O)=>{a.jb("InstanceNormalization",T,{epsilon:P,format:O?"NHWC":"NCHW"})},841606:(T,P,O)=>{a.jb("InstanceNormalization",T,{epsilon:P,format:O?"NHWC":"NCHW"})},841720:T=>{a.jb("Range",T,void 0)},841773:(T,P)=>{a.jb("Einsum",T,{equation:yt(P)})},841854:(T,P,O,W,X)=>{a.jb("Pad",T,{mode:P,value:O,pads:W?Array.from(de().subarray(Number(W)>>>0,Number(X)>>>0)):[]})},841997:(T,P,O,W,X,ge)=>{a.jb("BatchNormalization",T,{epsilon:P,momentum:O,spatial:!!X,trainingMode:!!W,format:ge?"NHWC":"NCHW"})},842166:(T,P,O,W,X,ge)=>{a.jb("BatchNormalization",T,{epsilon:P,momentum:O,spatial:!!X,trainingMode:!!W,format:ge?"NHWC":"NCHW"})},842335:(T,P,O)=>{a.jb("CumSum",T,{exclusive:Number(P),reverse:Number(O)})},842432:(T,P,O)=>{a.jb("DequantizeLinear",T,{axis:P,blockSize:O})},842522:(T,P,O,W,X)=>{a.jb("GridSample",T,{align_corners:P,mode:yt(O),padding_mode:yt(W),format:X?"NHWC":"NCHW"})},842692:(T,P,O,W,X)=>{a.jb("GridSample",T,{align_corners:P,mode:yt(O),padding_mode:yt(W),format:X?"NHWC":"NCHW"})},842862:(T,P)=>{a.jb("ScatterND",T,{reduction:yt(P)})},842947:(T,P,O,W,X,ge,$e,qe,nt)=>{a.jb("Attention",T,{numHeads:P,isUnidirectional:O,maskFilterValue:W,scale:X,doRotary:ge,qkvHiddenSizes:$e?Array.from(de().subarray(Number(qe)>>>0,Number(qe)+$e>>>0)):[],pastPresentShareBuffer:!!nt})},843219:T=>{a.jb("BiasAdd",T,void 0)},843274:T=>{a.jb("BiasSplitGelu",T,void 0)},843335:T=>{a.jb("FastGelu",T,void 0)},843391:(T,P,O,W,X,ge,$e,qe,nt,ct,$t,Ht,ur,xn,ci,sf)=>{a.jb("Conv",T,{format:Ht?"NHWC":"NCHW",auto_pad:P,dilations:O?Array.from(de().subarray(Number(O)>>>0,Number(W)>>>0)):[],group:X,kernel_shape:ge?Array.from(de().subarray(Number(ge)>>>0,Number($e)>>>0)):[],pads:qe?Array.from(de().subarray(Number(qe)>>>0,Number(nt)>>>0)):[],strides:ct?Array.from(de().subarray(Number(ct)>>>0,Number($t)>>>0)):[],w_is_const:()=>!!$()[Number(ur)>>>0],activation:yt(xn),activation_params:ci?Array.from(ze().subarray(Number(ci)>>>0,Number(sf)>>>0)):[]})},843975:T=>{a.jb("Gelu",T,void 0)},844027:(T,P,O,W,X,ge,$e,qe,nt)=>{a.jb("GroupQueryAttention",T,{numHeads:P,kvNumHeads:O,scale:W,softcap:X,doRotary:ge,rotaryInterleaved:$e,smoothSoftmax:qe,localWindowSize:nt})},844244:(T,P,O,W)=>{a.jb("LayerNormalization",T,{axis:P,epsilon:O,simplified:!!W})},844355:(T,P,O,W)=>{a.jb("LayerNormalization",T,{axis:P,epsilon:O,simplified:!!W})},844466:(T,P,O,W,X,ge)=>{a.jb("MatMulNBits",T,{k:P,n:O,accuracyLevel:W,bits:X,blockSize:ge})},844593:(T,P,O,W,X,ge)=>{a.jb("MultiHeadAttention",T,{numHeads:P,isUnidirectional:O,maskFilterValue:W,scale:X,doRotary:ge})},844752:(T,P)=>{a.jb("QuickGelu",T,{alpha:P})},844816:(T,P,O,W,X)=>{a.jb("RotaryEmbedding",T,{interleaved:!!P,numHeads:O,rotaryEmbeddingDim:W,scale:X})},844955:(T,P,O)=>{a.jb("SkipLayerNormalization",T,{epsilon:P,simplified:!!O})},845057:(T,P,O)=>{a.jb("SkipLayerNormalization",T,{epsilon:P,simplified:!!O})},845159:(T,P,O,W)=>{a.jb("GatherBlockQuantized",T,{gatherAxis:P,quantizeAxis:O,blockSize:W})},845280:T=>{a.Zb(T)},845314:(T,P)=>a.ac(Number(T),Number(P),a.Fb.dc,a.Fb.errors)};function Me(T,P,O){return Yn(async()=>{await a.Xb(Number(T),Number(P),Number(O))})}function Te(){return typeof wasmOffsetConverter<"u"}class me{constructor(P){ce(this,"name","ExitStatus");this.message=`Program terminated with exit(${P})`,this.status=P}}var Pe=T=>{T.terminate(),T.onmessage=()=>{}},Be=[],rt=T=>{Qt.length==0&&(le(),F(Qt[0]));var P=Qt.pop();if(!P)return 6;Gt.push(P),hr[T.Ab]=P,P.Ab=T.Ab;var O={Bb:"run",fc:T.ec,Hb:T.Hb,Ab:T.Ab};return P.postMessage(O,T.Mb),0},et=0,Ye=(T,P,...O)=>{for(var W=2*O.length,X=xl(),ge=Ac(8*W),$e=ge>>>3,qe=0;qe<O.length;qe++){var nt=O[qe];typeof nt=="bigint"?(ee[$e+2*qe]=1n,ee[$e+2*qe+1]=nt):(ee[$e+2*qe]=0n,Ke()[$e+2*qe+1>>>0]=nt)}return T=$u(T,0,W,ge,P),wl(X),T};function Fe(T){if(d)return Ye(0,1,T);if(S=T,!(0<et)){for(var P of Gt)Pe(P);for(P of Qt)Pe(P);Qt=[],Gt=[],hr={},ne=!0}k(0,new me(T))}function lt(T){if(d)return Ye(1,0,T);It(T)}var It=T=>{if(S=T,d)throw lt(T),"unwind";Fe(T)},Qt=[],Gt=[],zr=[],hr={},Tt=T=>{var P=T.Ab;delete hr[P],Qt.push(T),Gt.splice(Gt.indexOf(T),1),T.Ab=0,Nu(P)};function ks(){zr.forEach(T=>T())}var F=T=>new Promise(P=>{T.onmessage=X=>{var ge=(X=X.data).Bb;if(X.Gb&&X.Gb!=yl()){var $e=hr[X.Gb];$e?$e.postMessage(X,X.Mb):x(`Internal error! Worker sent a message "${ge}" to target pthread ${X.Gb}, but that thread no longer exists!`)}else ge==="checkMailbox"?Qe():ge==="spawnThread"?rt(X):ge==="cleanupThread"?Tt(hr[X.hc]):ge==="loaded"?(T.loaded=!0,P(T)):ge==="alert"?alert(`Thread ${X.ic}: ${X.text}`):X.target==="setimmediate"?T.postMessage(X):ge==="callHandler"?a[X.Qb](...X.args):ge&&x(`worker sent an unknown command ${ge}`)},T.onerror=X=>{throw x(`worker sent an error! ${X.filename}:${X.lineno}: ${X.message}`),X};var O,W=[];for(O of[])a.propertyIsEnumerable(O)&&W.push(O);T.postMessage({Bb:"load",Rb:W,kc:b,lc:M})});function le(){var T=new Worker((()=>{let P=URL;return import.meta.url>"file:"&&import.meta.url<"file;"?new P("ort.bundle.min.mjs",import.meta.url):new URL(import.meta.url)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});Qt.push(T)}var B=T=>{ue();var P=Ee()[T+52>>>2>>>0];T=Ee()[T+56>>>2>>>0],Sc(P,P-T),wl(P)},oe=(T,P)=>{et=0,T=Du(T,P),0<et?S=T:_l(T)};class xe{constructor(P){this.Ib=P-24}}function Ue(T,P,O){var W=new xe(T>>>=0);throw P>>>=0,O>>>=0,Ee()[W.Ib+16>>>2>>>0]=0,Ee()[W.Ib+4>>>2>>>0]=P,Ee()[W.Ib+8>>>2>>>0]=O,T}function je(T,P,O,W){return d?Ye(2,1,T,P,O,W):Nt(T,P,O,W)}function Nt(T,P,O,W){if(T>>>=0,O>>>=0,W>>>=0,p===void 0)return 6;var X=[];return d&&X.length===0?je(T,P>>>=0,O,W):(T={ec:O,Ab:T,Hb:W,Mb:X},d?(T.Bb="spawnThread",postMessage(T,X),0):rt(T))}var Xt=typeof TextDecoder<"u"?new TextDecoder:void 0,xt=(T,P=0,O=NaN)=>{var W=(P>>>=0)+O;for(O=P;T[O]&&!(O>=W);)++O;if(16<O-P&&T.buffer&&Xt)return Xt.decode(T.buffer instanceof ArrayBuffer?T.subarray(P,O):T.slice(P,O));for(W="";P<O;){var X=T[P++];if(128&X){var ge=63&T[P++];if((224&X)==192)W+=String.fromCharCode((31&X)<<6|ge);else{var $e=63&T[P++];65536>(X=(240&X)==224?(15&X)<<12|ge<<6|$e:(7&X)<<18|ge<<12|$e<<6|63&T[P++])?W+=String.fromCharCode(X):(X-=65536,W+=String.fromCharCode(55296|X>>10,56320|1023&X))}}else W+=String.fromCharCode(X)}return W},yt=(T,P)=>(T>>>=0)?xt(G(),T,P):"";function pt(T,P,O){return d?Ye(3,1,T,P,O):0}function ar(T,P){if(d)return Ye(4,1,T,P)}var vr=T=>{for(var P=0,O=0;O<T.length;++O){var W=T.charCodeAt(O);127>=W?P++:2047>=W?P+=2:55296<=W&&57343>=W?(P+=4,++O):P+=3}return P},vn=(T,P,O)=>{var W=G();if(P>>>=0,0<O){var X=P;O=P+O-1;for(var ge=0;ge<T.length;++ge){var $e=T.charCodeAt(ge);if(55296<=$e&&57343>=$e&&($e=65536+((1023&$e)<<10)|1023&T.charCodeAt(++ge)),127>=$e){if(P>=O)break;W[P++>>>0]=$e}else{if(2047>=$e){if(P+1>=O)break;W[P++>>>0]=192|$e>>6}else{if(65535>=$e){if(P+2>=O)break;W[P++>>>0]=224|$e>>12}else{if(P+3>=O)break;W[P++>>>0]=240|$e>>18,W[P++>>>0]=128|$e>>12&63}W[P++>>>0]=128|$e>>6&63}W[P++>>>0]=128|63&$e}}W[P>>>0]=0,T=P-X}else T=0;return T};function Sr(T,P){if(d)return Ye(5,1,T,P)}function Kn(T,P,O){if(d)return Ye(6,1,T,P,O)}function Xs(T,P,O){return d?Ye(7,1,T,P,O):0}function Ta(T,P){if(d)return Ye(8,1,T,P)}function ea(T,P,O){if(d)return Ye(9,1,T,P,O)}function ri(T,P,O,W){if(d)return Ye(10,1,T,P,O,W)}function ps(T,P,O,W){if(d)return Ye(11,1,T,P,O,W)}function ni(T,P,O,W){if(d)return Ye(12,1,T,P,O,W)}function $s(T){if(d)return Ye(13,1,T)}function Ma(T,P){if(d)return Ye(14,1,T,P)}function si(T,P,O){if(d)return Ye(15,1,T,P,O)}var ai,Gr,ii=()=>Q(""),An=T=>{for(var P="";G()[T>>>0];)P+=ai[G()[T++>>>0]];return P},Ea={},ns={};function We(T,P,O={}){return function(W,X,ge={}){var $e=X.name;if(!W)throw new Gr(`type "${$e}" must have a positive integer typeid pointer`);if(ns.hasOwnProperty(W)){if(ge.Sb)return;throw new Gr(`Cannot register type '${$e}' twice`)}ns[W]=X,Ea.hasOwnProperty(W)&&(X=Ea[W],delete Ea[W],X.forEach(qe=>qe()))}(T,P,O)}var it=(T,P,O)=>{switch(P){case 1:return O?W=>$()[W>>>0]:W=>G()[W>>>0];case 2:return O?W=>se()[W>>>1>>>0]:W=>_e()[W>>>1>>>0];case 4:return O?W=>de()[W>>>2>>>0]:W=>Ee()[W>>>2>>>0];case 8:return O?W=>ee[W>>>3]:W=>te[W>>>3];default:throw new TypeError(`invalid integer width (${P}): ${T}`)}};function gt(T,P,O){O>>>=0,We(T>>>=0,{name:P=An(P>>>0),fromWireType:W=>W,toWireType:function(W,X){if(typeof X!="bigint"&&typeof X!="number")throw X=X===null?"null":(W=typeof X)=="object"||W==="array"||W==="function"?X.toString():""+X,new TypeError(`Cannot convert "${X}" to ${this.name}`);return typeof X=="number"&&(X=BigInt(X)),X},Cb:ir,readValueFromPointer:it(P,O,P.indexOf("u")==-1),Db:null})}var ir=8;function ta(T,P,O,W){We(T>>>=0,{name:P=An(P>>>0),fromWireType:function(X){return!!X},toWireType:function(X,ge){return ge?O:W},Cb:ir,readValueFromPointer:function(X){return this.fromWireType(G()[X>>>0])},Db:null})}var ra=[],Xr=[];function na(T){9<(T>>>=0)&&--Xr[T+1]==0&&(Xr[T]=void 0,ra.push(T))}var en=T=>{if(!T)throw new Gr("Cannot use deleted val. handle = "+T);return Xr[T]},ln=T=>{switch(T){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let P=ra.pop()||Xr.length;return Xr[P]=T,Xr[P+1]=1,P}};function sa(T){return this.fromWireType(Ee()[T>>>2>>>0])}var Sa={name:"emscripten::val",fromWireType:T=>{var P=en(T);return na(T),P},toWireType:(T,P)=>ln(P),Cb:ir,readValueFromPointer:sa,Db:null};function il(T){return We(T>>>0,Sa)}var ol=(T,P)=>{switch(P){case 4:return function(O){return this.fromWireType(ze()[O>>>2>>>0])};case 8:return function(O){return this.fromWireType(Ke()[O>>>3>>>0])};default:throw new TypeError(`invalid float width (${P}): ${T}`)}};function ll(T,P,O){O>>>=0,We(T>>>=0,{name:P=An(P>>>0),fromWireType:W=>W,toWireType:(W,X)=>X,Cb:ir,readValueFromPointer:ol(P,O),Db:null})}function cl(T,P,O,W,X){if(T>>>=0,O>>>=0,P=An(P>>>0),X===-1&&(X=4294967295),X=qe=>qe,W===0){var ge=32-8*O;X=qe=>qe<<ge>>>ge}var $e=P.includes("unsigned")?function(qe,nt){return nt>>>0}:function(qe,nt){return nt};We(T,{name:P,fromWireType:X,toWireType:$e,Cb:ir,readValueFromPointer:it(P,O,W!==0),Db:null})}function dl(T,P,O){function W(ge){var $e=Ee()[ge>>>2>>>0];return ge=Ee()[ge+4>>>2>>>0],new X($().buffer,ge,$e)}var X=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][P];We(T>>>=0,{name:O=An(O>>>0),fromWireType:W,Cb:ir,readValueFromPointer:W},{Sb:!0})}function oi(T,P){We(T>>>=0,{name:P=An(P>>>0),fromWireType:function(O){for(var W,X=Ee()[O>>>2>>>0],ge=O+4,$e=ge,qe=0;qe<=X;++qe){var nt=ge+qe;qe!=X&&G()[nt>>>0]!=0||($e=yt($e,nt-$e),W===void 0?W=$e:(W+="\0",W+=$e),$e=nt+1)}return Ts(O),W},toWireType:function(O,W){W instanceof ArrayBuffer&&(W=new Uint8Array(W));var X=typeof W=="string";if(!(X||W instanceof Uint8Array||W instanceof Uint8ClampedArray||W instanceof Int8Array))throw new Gr("Cannot pass non-string to std::string");var ge=X?vr(W):W.length,$e=vl(4+ge+1),qe=$e+4;if(Ee()[$e>>>2>>>0]=ge,X)vn(W,qe,ge+1);else if(X)for(X=0;X<ge;++X){var nt=W.charCodeAt(X);if(255<nt)throw Ts($e),new Gr("String has UTF-16 code units that do not fit in 8 bits");G()[qe+X>>>0]=nt}else for(X=0;X<ge;++X)G()[qe+X>>>0]=W[X];return O!==null&&O.push(Ts,$e),$e},Cb:ir,readValueFromPointer:sa,Db(O){Ts(O)}})}var Xi=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ul=(T,P)=>{for(var O=T>>1,W=O+P/2;!(O>=W)&&_e()[O>>>0];)++O;if(32<(O<<=1)-T&&Xi)return Xi.decode(G().slice(T,O));for(O="",W=0;!(W>=P/2);++W){var X=se()[T+2*W>>>1>>>0];if(X==0)break;O+=String.fromCharCode(X)}return O},pl=(T,P,O)=>{if(O??(O=2147483647),2>O)return 0;var W=P;O=(O-=2)<2*T.length?O/2:T.length;for(var X=0;X<O;++X){var ge=T.charCodeAt(X);se()[P>>>1>>>0]=ge,P+=2}return se()[P>>>1>>>0]=0,P-W},hl=T=>2*T.length,li=(T,P)=>{for(var O=0,W="";!(O>=P/4);){var X=de()[T+4*O>>>2>>>0];if(X==0)break;++O,65536<=X?(X-=65536,W+=String.fromCharCode(55296|X>>10,56320|1023&X)):W+=String.fromCharCode(X)}return W},we=(T,P,O)=>{if(P>>>=0,O??(O=2147483647),4>O)return 0;var W=P;O=W+O-4;for(var X=0;X<T.length;++X){var ge=T.charCodeAt(X);if(55296<=ge&&57343>=ge&&(ge=65536+((1023&ge)<<10)|1023&T.charCodeAt(++X)),de()[P>>>2>>>0]=ge,(P+=4)+4>O)break}return de()[P>>>2>>>0]=0,P-W},N=T=>{for(var P=0,O=0;O<T.length;++O){var W=T.charCodeAt(O);55296<=W&&57343>=W&&++O,P+=4}return P};function Z(T,P,O){if(T>>>=0,P>>>=0,O=An(O>>>=0),P===2)var W=ul,X=pl,ge=hl,$e=qe=>_e()[qe>>>1>>>0];else P===4&&(W=li,X=we,ge=N,$e=qe=>Ee()[qe>>>2>>>0]);We(T,{name:O,fromWireType:qe=>{for(var nt,ct=Ee()[qe>>>2>>>0],$t=qe+4,Ht=0;Ht<=ct;++Ht){var ur=qe+4+Ht*P;Ht!=ct&&$e(ur)!=0||($t=W($t,ur-$t),nt===void 0?nt=$t:(nt+="\0",nt+=$t),$t=ur+P)}return Ts(qe),nt},toWireType:(qe,nt)=>{if(typeof nt!="string")throw new Gr(`Cannot pass non-string to C++ string type ${O}`);var ct=ge(nt),$t=vl(4+ct+P);return Ee()[$t>>>2>>>0]=ct/P,X(nt,$t+4,ct+P),qe!==null&&qe.push(Ts,$t),$t},Cb:ir,readValueFromPointer:sa,Db(qe){Ts(qe)}})}function ie(T,P){We(T>>>=0,{Tb:!0,name:P=An(P>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function fe(T){Mc(T>>>0,!c,1,!l,131072,!1),ks()}var ye=T=>{if(!ne)try{if(T(),!(0<et))try{d?_l(S):It(S)}catch(P){P instanceof me||P=="unwind"||k(0,P)}}catch(P){P instanceof me||P=="unwind"||k(0,P)}};function Ie(T){T>>>=0,typeof Atomics.jc=="function"&&(Atomics.jc(de(),T>>>2,T).value.then(Qe),T+=128,Atomics.store(de(),T>>>2,1))}var Qe=()=>{var T=yl();T&&(Ie(T),ye(Ru))};function st(T,P){(T>>>=0)==P>>>0?setTimeout(Qe):d?postMessage({Gb:T,Bb:"checkMailbox"}):(T=hr[T])&&T.postMessage({Bb:"checkMailbox"})}var tt=[];function ot(T,P,O,W,X){for(P>>>=0,W/=2,tt.length=W,O=X>>>0>>>3,X=0;X<W;X++)tt[X]=ee[O+2*X]?ee[O+2*X+1]:Ke()[O+2*X+1>>>0];return(P?pe[P]:nf[T])(...tt)}var Et=()=>{et=0};function er(T){T>>>=0,d?postMessage({Bb:"cleanupThread",hc:T}):Tt(hr[T])}function Zt(T){}var Ar=(T,P)=>{var O=ns[T];if(O===void 0)throw T=Tc(T),O=An(T),Ts(T),new Gr(`${P} has unknown type ${O}`);return O},dr=(T,P,O)=>{var W=[];return T=T.toWireType(W,O),W.length&&(Ee()[P>>>2>>>0]=ln(W)),T};function cn(T,P,O){return P>>>=0,O>>>=0,T=en(T>>>0),P=Ar(P,"emval::as"),dr(P,O,T)}function _n(T,P){return P>>>=0,T=en(T>>>0),(P=Ar(P,"emval::as")).toWireType(null,T)}var Pn=T=>{try{T()}catch(P){Q(P)}},Cn=0,jr=null,Aa=0,fr=[],dn={},Qn={},Ns=0,Os=null,Bn=[];function Yn(T){return function(P){if(!ne){if(Cn===0){var O=!1,W=!1;P((X=0)=>{if(!ne&&(Aa=X,O=!0,W)){Cn=2,Pn(()=>Lu(jr)),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.resume(),X=!1;try{var ge=function(){var nt=de()[jr+8>>>2>>>0];return nt=_t[Qn[nt]],--et,nt()}()}catch(nt){ge=nt,X=!0}var $e=!1;if(!jr){var qe=Os;qe&&(Os=null,(X?qe.reject:qe.resolve)(ge),$e=!0)}if(X&&!$e)throw ge}}),W=!0,O||(Cn=1,jr=function(){var X=vl(65548),ge=X+12;Ee()[X>>>2>>>0]=ge,Ee()[X+4>>>2>>>0]=ge+65536,ge=fr[0];var $e=dn[ge];return $e===void 0&&($e=Ns++,dn[ge]=$e,Qn[$e]=ge),ge=$e,de()[X+8>>>2>>>0]=ge,X}(),typeof MainLoop<"u"&&MainLoop.Pb&&MainLoop.pause(),Pn(()=>Fu(jr)))}else Cn===2?(Cn=0,Pn(zu),Ts(jr),jr=null,Bn.forEach(ye)):Q(`invalid state: ${Cn}`);return Aa}}(P=>{T().then(P)})}function wn(T){return T>>>=0,Yn(async()=>{var P=await en(T);return ln(P)})}var Ir=[];function tn(T,P,O,W){return O>>>=0,W>>>=0,(T=Ir[T>>>0])(null,P=en(P>>>0),O,W)}var rn={},Un=T=>{var P=rn[T];return P===void 0?An(T):P};function aa(T,P,O,W,X){return O>>>=0,W>>>=0,X>>>=0,(T=Ir[T>>>0])(P=en(P>>>0),P[O=Un(O)],W,X)}var fl=()=>typeof globalThis=="object"?globalThis:Function("return this")();function Nh(T){return(T>>>=0)==0?ln(fl()):(T=Un(T),ln(fl()[T]))}var Oh=T=>{var P=Ir.length;return Ir.push(T),P},Rh=(T,P)=>{for(var O=Array(T),W=0;W<T;++W)O[W]=Ar(Ee()[P+4*W>>>2>>>0],"parameter "+W);return O},hu=(T,P)=>Object.defineProperty(P,"name",{value:T});function eo(T,P,O){var W=(P=Rh(T,P>>>0)).shift();T--;var X=`return function (obj, func, destructorsRef, args) {
488`,ge=0,$e=[];O===0&&$e.push("obj");for(var qe=["retType"],nt=[W],ct=0;ct<T;++ct)$e.push("arg"+ct),qe.push("argType"+ct),nt.push(P[ct]),X+=`  var arg${ct} = argType${ct}.readValueFromPointer(args${ge?"+"+ge:""});
489`,ge+=P[ct].Cb;return X+=`  var rv = ${O===1?"new func":"func.call"}(${$e.join(", ")});
490`,W.Tb||(qe.push("emval_returnValue"),nt.push(dr),X+=`  return emval_returnValue(retType, destructorsRef, rv);
491`),qe.push(X+`};
492`),T=function($t){var Ht=Function;if(!(Ht instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof Ht} which is not a function`);var ur=hu(Ht.name||"unknownFunctionName",function(){});return ur.prototype=Ht.prototype,ur=new ur,($t=Ht.apply(ur,$t))instanceof Object?$t:ur}(qe)(...nt),O=`methodCaller<(${P.map($t=>$t.name).join(", ")}) => ${W.name}>`,Oh(hu(O,T))}function Dh(T){return T=Un(T>>>0),ln(a[T])}function Fh(T,P){return P>>>=0,T=en(T>>>0),P=en(P),ln(T[P])}function Lh(T){9<(T>>>=0)&&(Xr[T+1]+=1)}function zh(){return ln([])}function Bh(T){T=en(T>>>0);for(var P=Array(T.length),O=0;O<T.length;O++)P[O]=T[O];return ln(P)}function fu(T){return ln(Un(T>>>0))}function Uh(){return ln({})}function Wh(T){for(var P=en(T>>>=0);P.length;){var O=P.pop();P.pop()(O)}na(T)}function mu(T,P,O){P>>>=0,O>>>=0,T=en(T>>>0),P=en(P),O=en(O),T[P]=O}function Vh(T,P){return P>>>=0,T=(T=Ar(T>>>0,"_emval_take_value")).readValueFromPointer(P),ln(T)}function gu(T,P){T=-9007199254740992>T||9007199254740992<T?NaN:Number(T),P>>>=0,T=new Date(1e3*T),de()[P>>>2>>>0]=T.getUTCSeconds(),de()[P+4>>>2>>>0]=T.getUTCMinutes(),de()[P+8>>>2>>>0]=T.getUTCHours(),de()[P+12>>>2>>>0]=T.getUTCDate(),de()[P+16>>>2>>>0]=T.getUTCMonth(),de()[P+20>>>2>>>0]=T.getUTCFullYear()-1900,de()[P+24>>>2>>>0]=T.getUTCDay(),T=(T.getTime()-Date.UTC(T.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,de()[P+28>>>2>>>0]=T}var yu=T=>T%4==0&&(T%100!=0||T%400==0),wc=[0,31,60,91,121,152,182,213,244,274,305,335],Gh=[0,31,59,90,120,151,181,212,243,273,304,334];function qh(T,P){T=-9007199254740992>T||9007199254740992<T?NaN:Number(T),P>>>=0,T=new Date(1e3*T),de()[P>>>2>>>0]=T.getSeconds(),de()[P+4>>>2>>>0]=T.getMinutes(),de()[P+8>>>2>>>0]=T.getHours(),de()[P+12>>>2>>>0]=T.getDate(),de()[P+16>>>2>>>0]=T.getMonth(),de()[P+20>>>2>>>0]=T.getFullYear()-1900,de()[P+24>>>2>>>0]=T.getDay();var O=(yu(T.getFullYear())?wc:Gh)[T.getMonth()]+T.getDate()-1|0;de()[P+28>>>2>>>0]=O,de()[P+36>>>2>>>0]=-60*T.getTimezoneOffset(),O=new Date(T.getFullYear(),6,1).getTimezoneOffset();var W=new Date(T.getFullYear(),0,1).getTimezoneOffset();T=0|(O!=W&&T.getTimezoneOffset()==Math.min(W,O)),de()[P+32>>>2>>>0]=T}function vu(T){T>>>=0;var P=new Date(de()[T+20>>>2>>>0]+1900,de()[T+16>>>2>>>0],de()[T+12>>>2>>>0],de()[T+8>>>2>>>0],de()[T+4>>>2>>>0],de()[T>>>2>>>0],0),O=de()[T+32>>>2>>>0],W=P.getTimezoneOffset(),X=new Date(P.getFullYear(),6,1).getTimezoneOffset(),ge=new Date(P.getFullYear(),0,1).getTimezoneOffset(),$e=Math.min(ge,X);return 0>O?de()[T+32>>>2>>>0]=+(X!=ge&&$e==W):0<O!=($e==W)&&(X=Math.max(ge,X),P.setTime(P.getTime()+6e4*((0<O?$e:X)-W))),de()[T+24>>>2>>>0]=P.getDay(),O=(yu(P.getFullYear())?wc:Gh)[P.getMonth()]+P.getDate()-1|0,de()[T+28>>
492>2>>>0]=O,de()[T>>>2>>>0]=P.getSeconds(),de()[T+4>>>2>>>0]=P.getMinutes(),de()[T+8>>>2>>>0]=P.getHours(),de()[T+12>>>2>>>0]=P.getDate(),de()[T+16>>>2>>>0]=P.getMonth(),de()[T+20>>>2>>>0]=P.getYear(),T=P.getTime(),BigInt(isNaN(T)?-1:T/1e3)}function _u(T,P,O,W,X,ge,$e){return d?Ye(16,1,T,P,O,W,X,ge,$e):-52}function ml(T,P,O,W,X,ge){if(d)return Ye(17,1,T,P,O,W,X,ge)}var to={},Hh=()=>performance.timeOrigin+performance.now();function wu(T,P){if(d)return Ye(18,1,T,P);if(to[T]&&(clearTimeout(to[T].id),delete to[T]),!P)return 0;var O=setTimeout(()=>{delete to[T],ye(()=>Ou(T,performance.timeOrigin+performance.now()))},P);return to[T]={id:O,qc:P},0}function Kh(T,P,O,W){T>>>=0,P>>>=0,O>>>=0,W>>>=0;var X=new Date().getFullYear(),ge=new Date(X,0,1).getTimezoneOffset();X=new Date(X,6,1).getTimezoneOffset();var $e=Math.max(ge,X);Ee()[T>>>2>>>0]=60*$e,de()[P>>>2>>>0]=+(ge!=X),T=(P=qe=>{var nt=Math.abs(qe);return`UTC${0<=qe?"-":"+"}${String(Math.floor(nt/60)).padStart(2,"0")}${String(nt%60).padStart(2,"0")}`})(ge),P=P(X),X<ge?(vn(T,O,17),vn(P,W,17)):(vn(T,W,17),vn(P,O,17))}var Qh=()=>Date.now();function Yh(T,P,O){return 0<=T&&3>=T?(T===0?T=Date.now():T=performance.timeOrigin+performance.now(),ee[O>>>0>>>3]=BigInt(Math.round(1e6*T)),0):28}var xc=[],gl=(T,P)=>{xc.length=0;for(var O;O=G()[T++>>>0];){var W=O!=105;P+=(W&=O!=112)&&P%8?4:0,xc.push(O==112?Ee()[P>>>2>>>0]:O==106?ee[P>>>3]:O==105?de()[P>>>2>>>0]:Ke()[P>>>3>>>0]),P+=W?8:4}return xc};function xu(T,P,O){return T>>>=0,P=gl(P>>>0,O>>>0),pe[T](...P)}function Jh(T,P,O){return T>>>=0,P=gl(P>>>0,O>>>0),pe[T](...P)}var bu=()=>{};function Si(T,P){return x(yt(T>>>0,P>>>0))}var Zh=()=>{throw et+=1,"unwind"};function zy(){return 4294901760}var Xh=()=>navigator.hardwareConcurrency;function By(){return Q("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function ef(T){T>>>=0;var P=G().length;if(T<=P||4294901760<T)return!1;for(var O=1;4>=O;O*=2){var W=P*(1+.2/O);W=Math.min(W,T+100663296);e:{W=(Math.min(4294901760,65536*Math.ceil(Math.max(T,W)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(W),ue();var X=1;break e}catch{}X=void 0}if(X)return!0}return!1}var ro=()=>(Q("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),no={},ku=T=>{T.forEach(P=>{ro()})};function tf(){var T=Error().stack.toString().split(`
493`);return T[0]=="Error"&&T.shift(),ku(T),no.Lb=ro(),no.cc=T,no.Lb}function rf(T,P,O){if(T>>>=0,P>>>=0,no.Lb==T)var W=no.cc;else(W=Error().stack.toString().split(`
494`))[0]=="Error"&&W.shift(),ku(W);for(var X=3;W[X]&&ro()!=T;)++X;for(T=0;T<O&&W[T+X];++T)de()[P+4*T>>>2>>>0]=ro();return T}var bc,so={},Tu=()=>{if(!bc){var T,P={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:"./this.program"};for(T in so)so[T]===void 0?delete P[T]:P[T]=so[T];var O=[];for(T in P)O.push(`${T}=${P[T]}`);bc=O}return bc};function Mu(T,P){if(d)return Ye(19,1,T,P);T>>>=0,P>>>=0;var O=0;return Tu().forEach((W,X)=>{var ge=P+O;for(X=Ee()[T+4*X>>>2>>>0]=ge,ge=0;ge<W.length;++ge)$()[X++>>>0]=W.charCodeAt(ge);$()[X>>>0]=0,O+=W.length+1}),0}function Eu(T,P){if(d)return Ye(20,1,T,P);T>>>=0,P>>>=0;var O=Tu();Ee()[T>>>2>>>0]=O.length;var W=0;return O.forEach(X=>W+=X.length+1),Ee()[P>>>2>>>0]=W,0}function kc(T){return d?Ye(21,1,T):52}function Su(T,P,O,W){return d?Ye(22,1,T,P,O,W):52}function Au(T,P,O,W){return d?Ye(23,1,T,P,O,W):70}var Pu=[null,[],[]];function Cu(T,P,O,W){if(d)return Ye(24,1,T,P,O,W);P>>>=0,O>>>=0,W>>>=0;for(var X=0,ge=0;ge<O;ge++){var $e=Ee()[P>>>2>>>0],qe=Ee()[P+4>>>2>>>0];P+=8;for(var nt=0;nt<qe;nt++){var ct=G()[$e+nt>>>0],$t=Pu[T];ct===0||ct===10?((T===1?w:x)(xt($t)),$t.length=0):$t.push(ct)}X+=qe}return Ee()[W>>>2>>>0]=X,0}d||function(){for(var T=a.numThreads-1;T--;)le();Be.unshift(()=>{Ae++,function(P){d?P():Promise.all(Qt.map(F)).then(P)}(()=>Ne())})}();for(var ju=Array(256),ao=0;256>ao;++ao)ju[ao]=String.fromCharCode(ao);ai=ju,Gr=a.BindingError=class extends Error{constructor(T){super(T),this.name="BindingError"}}
vendor: 4,764 bytes, line 494
494,a.InternalError=class extends Error{constructor(T){super(T),this.name="InternalError"}},Xr.push(0,1,void 0,1,null,1,!0,1,!1,1),a.count_emval_handles=()=>Xr.length/2-5-ra.length;var _t,nf=[Fe,lt,je,pt,ar,Sr,Kn,Xs,Ta,ea,ri,ps,ni,$s,Ma,si,_u,ml,wu,Mu,Eu,kc,Su,Au,Cu];(async function(){function T(W,X){return _t=W.exports,_t=function(){var ge=_t,$e={};for(let[qe,nt]of Object.entries(ge))$e[qe]=typeof nt=="function"?(...ct)=>{fr.push(qe);try{return nt(...ct)}finally{ne||(fr.pop(),jr&&Cn===1&&fr.length===0&&(Cn=0,et+=1,Pn(Pc),typeof Fibers<"u"&&Fibers.rc()))}}:nt;return $e}(),_t=function(){var ge=_t,$e=nt=>ct=>nt(ct)>>>0,qe=nt=>()=>nt()>>>0;return(ge=Object.assign({},ge)).Da=$e(ge.Da),ge.fb=qe(ge.fb),ge.hb=$e(ge.hb),ge.tb=$e(ge.tb),ge.ub=qe(ge.ub),ge.__cxa_get_exception_ptr=$e(ge.__cxa_get_exception_ptr),ge}(),zr.push(_t.ib),M=X,Ne(),_t}Ae++;var P=re();if(a.instantiateWasm)return new Promise(W=>{a.instantiateWasm(P,(X,ge)=>{T(X,ge),W(X.exports)})});if(d)return new Promise(W=>{ve=X=>{var ge=new WebAssembly.Instance(X,re());W(T(ge,X))}});Se??(Se=a.locateFile?a.locateFile?a.locateFile("ort-wasm-simd-threaded.jsep.wasm",y):y+"ort-wasm-simd-threaded.jsep.wasm":new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",import.meta.url).href);try{var O=await async function(W){var X=Se;if(!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!L(X))try{var ge=fetch(X,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(ge,W)}catch($e){x(`wasm streaming compile failed: ${$e}`),x("falling back to ArrayBuffer instantiation")}return async function($e,qe){try{var nt=await async function(ct){if(!ae)try{var $t=await f(ct);return new Uint8Array($t)}catch{}if(ct==Se&&ae)ct=new Uint8Array(ae);else{if(!m)throw"both async and sync fetching of the wasm failed";ct=m(ct)}return ct}($e);return await WebAssembly.instantiate(nt,qe)}catch(ct){x(`failed to asynchronously prepare wasm: ${ct}`),Q(ct)}}(X,W)}(P);return T(O.instance,O.module)}catch(W){return s(W),Promise.reject(W)}})();var Tc=T=>(Tc=_t.Da)(T),Iu=()=>(Iu=_t.Ea)();a._OrtInit=(T,P)=>(a._OrtInit=_t.Fa)(T,P),a._OrtGetLastError=(T,P)=>(a._OrtGetLastError=_t.Ga)(T,P),a._OrtCreateSessionOptions=(T,P,O,W,X,ge,$e,qe,nt,ct)=>(a._OrtCreateSessionOptions=_t.Ha)(T,P,O,W,X,ge,$e,qe,nt,ct),a._OrtAppendExecutionProvider=(T,P,O,W,X)=>(a._OrtAppendExecutionProvider=_t.Ia)(T,P,O,W,X),a._OrtAddFreeDimensionOverride=(T,P,O)=>(a._OrtAddFreeDimensionOverride=_t.Ja)(T,P,O),a._OrtAddSessionConfigEntry=(T,P,O)=>(a._OrtAddSessionConfigEntry=_t.Ka)(T,P,O),a._OrtReleaseSessionOptions=T=>(a._OrtReleaseSessionOptions=_t.La)(T),a._OrtCreateSession=(T,P,O)=>(a._OrtCreateSession=_t.Ma)(T,P,O),a._OrtReleaseSession=T=>(a._OrtReleaseSession=_t.Na)(T),a._OrtGetInputOutputCount=(T,P,O)=>(a._OrtGetInputOutputCount=_t.Oa)(T,P,O),a._OrtGetInputOutputMetadata=(T,P,O,W)=>(a._OrtGetInputOutputMetadata=_t.Pa)(T,P,O,W),a._OrtFree=T=>(a._OrtFree=_t.Qa)(T),a._OrtCreateTensor=(T,P,O,W,X,ge)=>(a._OrtCreateTensor=_t.Ra)(T,P,O,W,X,ge),a._OrtGetTensorData=(T,P,O,W,X)=>(a._OrtGetTensorData=_t.Sa)(T,P,O,W,X),a._OrtReleaseTensor=T=>(a._OrtReleaseTensor=_t.Ta)(T),a._OrtCreateRunOptions=(T,P,O,W)=>(a._OrtCreateRunOptions=_t.Ua)(T,P,O,W),a._OrtAddRunConfigEntry=(T,P,O)=>(a._OrtAddRunConfigEntry=_t.Va)(T,P,O),a._OrtReleaseRunOptions=T=>(a._OrtReleaseRunOptions=_t.Wa)(T),a._OrtCreateBinding=T=>(a._OrtCreateBinding=_t.Xa)(T),a._OrtBindInput=(T,P,O)=>(a._OrtBindInput=_t.Ya)(T,P,O),a._OrtBindOutput=(T,P,O,W)=>(a._OrtBindOutput=_t.Za)(T,P,O,W),a._OrtClearBoundOutputs=T=>(a._OrtClearBoundOutputs=_t._a)(T),a._OrtReleaseBinding=T=>(a._OrtReleaseBinding=_t.$a)(T),a._OrtRunWithBinding=(T,P,O,W,X)=>(a._OrtRunWithBinding=_t.ab)(T,P,O,W,X),a._OrtRun=(T,P,O,W,X,ge,$e,qe)=>(a._OrtRun=_t.bb)(T,P,O,W,X,ge,$e,qe),a._OrtEndProfiling=T=>(a._OrtEndProfiling=_t.cb)(T),a._JsepOutput=(T,P,O)=>(a._JsepOutput=_t.db)(T,P,O),a._JsepGetNodeName=T=>(a._JsepGetNodeName=_t.eb)(T);var yl=()=>(yl=_t.fb)(),Ts=a._free=T=>(Ts=a._free=_t.gb)(T),vl=a._malloc=T=>(vl=a._malloc=_t.hb)(T),Mc=(T,P,O,W,X,ge)=>(Mc=_t.kb)(T,P,O,W,X,ge),Ec=()=>(Ec=_t.lb)(),$u=(T,P,O,W,X)=>($u=_t.mb)(T,P,O,W,X),Nu=T=>(Nu=_t.nb)(T),_l=T=>(_l=_t.ob)(T),Ou=(T,P)=>(Ou=_t.pb)(T,P),Ru=()=>(Ru=_t.qb)(),Sc=(T,P)=>(Sc=_t.rb)(T,P),wl=T=>(wl=_t.sb)(T),Ac=T=>(Ac=_t.tb)(T),xl=()=>(xl=_t.ub)(),Du=a.dynCall_ii=(T,P)=>(Du=a.dynCall_ii=_t.vb)(T,P),Fu=T=>(Fu=_t.wb)(T),Pc=()=>(Pc=_t.xb)(),Lu=T=>(Lu=_t.yb)(T),zu=()=>(zu=_t.zb)();return a.stackSave=()=>xl(),a.stackRestore=T=>wl(T),a.stackAlloc=T=>Ac(T),a.setValue=function(T,P,O="i8"){switch(O.endsWith("*")&&(O="*"),O){case"i1":case"i8":$()[T>>>0]=P;break;case"i16":se()[T>>>1>>>0]=P;break;case"i32":de()[T>>>2>>>0]=P;break;case"i64":ee[T>>>3]=BigInt(P);break;case"float":ze()[T>>>2>>>0]=P;break;case"double":Ke()[T>>>3>>>
4940]=P;break;case"*":Ee()[T>>>2>>>0]=P;break;default:Q(`invalid type for setValue: ${O}`)}},a.getValue=function(T,P="i8"){switch(P.endsWith("*")&&(P="*"),P){case"i1":case"i8":return $()[T>>>0];case"i16":return se()[T>>>1>>>0];case"i32":return de()[T>>>2>>>0];case"i64":return ee[T>>>3];case"float":return ze()[T>>>2>>>0];case"double":return Ke()[T>>>3>>>0];case"*":return Ee()[T>>>2>>>0];default:Q(`invalid type for getValue: ${P}`)}},a.UTF8ToString=yt,a.stringToUTF8=vn,a.lengthBytesUTF8=vr,function T(){if(0<Ae)Oe=T;else if(d)n(a),Y();else{for(;0<Be.length;)Be.shift()(a);0<Ae?Oe=T:(a.calledRun=!0,ne||(Y(),n(a)))}}(),a.PTR_SIZE=4,i}),$L=uw,IC=(t=(e=globalThis.self)==null?void 0:e.name)==null?void 0:t.startsWith("em-pthread"),IC&&uw()}),pw,Ob,$C,Ls,NL,hm,NC,OC,hw,RC,fw,OL,mw,RL,R1=Je(()=>{O1(),pw=typeof location>"u"?void 0:location.origin,Ob=import.meta.url>"file:"&&import.meta.url<"file;",$C=()=>{{if(Ob){let e=URL;return new URL(new e("ort.bundle.min.mjs",import.meta.url).href,pw).href}return import.meta.url}},Ls=$C(),NL=()=>{if(Ls&&!Ls.startsWith("blob:"))return Ls.substring(0,Ls.lastIndexOf("/")+1)},hm=(e,t)=>{try{let r=t??Ls;return(r?new URL(e,r):new URL(e)).origin===pw}catch{return!1}},NC=(e,t)=>{let r=t??Ls;try{return(r?new URL(e,r):new URL(e)).href}catch{return}},OC=(e,t)=>`${t??"./"}${e}`,hw=async e=>{let t=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(t)},RC=async e=>(await import(e)).default,fw=(rne(),_h(CL)).default,OL=async()=>{if(!Ls)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(hm(Ls))return[void 0,fw()];let e=await hw(Ls);return[e,fw(e)]},mw=(nne(),_h(IL)).default,RL=async(e,t,r)=>{if(!e&&!t&&mw&&Ls&&hm(Ls))return[void 0,mw];{let n="ort-wasm-simd-threaded.jsep.mjs",s=e??NC(n,t),a=r&&s&&!hm(s,t),i=a?await hw(s):s??OC(n,t);return[a?i:void 0,await RC(i)]}}}),gw,fm,ip,yw,DC,FC,LC,D1,kr,vc=Je(()=>{R1(),fm=!1,ip=!1,yw=!1,DC=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},FC=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},LC=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},D1=async e=>{if(fm)return Promise.resolve();if(ip)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(yw)throw new Error("previous call to 'initializeWebAssembly()' failed.");ip=!0;let t=e.initTimeout,r=e.numThreads;if(e.simd!==!1){if(e.simd==="relaxed"){if(!LC())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!FC())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let n=DC();r>1&&!n&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+r+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),e.numThreads=r=1);let s=e.wasmPaths,a=typeof s=="string"?s:void 0,i=s==null?void 0:s.mjs,l=(i==null?void 0:i.href)??i,c=s==null?void 0:s.wasm,d=(c==null?void 0:c.href)??c,p=e.wasmBinary,[u,h]=await RL(l,a,r>1),f=!1,m=[];if(t>0&&m.push(new Promise(v=>{setTimeout(()=>{f=!0,v()},t)})),m.push(new Promise((v,k)=>{let y={numThreads:r};if(p)y.wasmBinary=p;else if(d||a)y.locateFile=g=>d??a+g;else if(l&&l.indexOf("blob:")!==0)y.locateFile=g=>new URL(g,l).href;else if(u){let g=NL();g&&(y.locateFile=_=>g+_)}h(y).then(g=>{ip=!1,fm=!0,gw=g,v(),u&&URL.revokeObjectURL(u)},g=>{ip=!1,yw=!0,k(g)})})),await Promise.race(m),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},kr=()=>{if(fm&&gw)return gw;throw new Error("WebAssembly is not initialized yet.")}}),Va,Ug,pr,F1=Je(()=>{vc(),Va=(e,t)=>{let r=kr(),n=r.lengthBytesUTF8(e)+1,s=r._malloc(n);return r.stringToUTF8(e,s,n),t.push(s),s},Ug=(e,t,r,n)=>{if(typeof e=="object"&&e!==null){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach(([s,a])=>{let i=t?t+s:s;if(typeof a=="object")Ug(a,i+".",r,n);
494else if(typeof a=="string"||typeof a=="number")n(i,a.toString());else if(typeof a=="boolean")n(i,a?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof a}`)})},pr=e=>{let t=kr(),r=t.stackSave();try{let n=t.PTR_SIZE,s=t.stackAlloc(2*n);t._OrtGetLastError(s,s+n);let a=Number(t.getValue(s,n===4?"i32":"i64")),i=t.getValue(s+n,"*"),l=i?t.UTF8ToString(i):"";throw new Error(`${e} ERROR_CODE: ${a}, ERROR_MESSAGE: ${l}`)}finally{t.stackRestore(r)}}}),DL,sne=Je(()=>{vc(),F1(),DL=e=>{let t=kr(),r=0,n=[],s=e||{};try{if((e==null?void 0:e.logSeverityLevel)===void 0)s.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if((e==null?void 0:e.logVerbosityLevel)===void 0)s.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);(e==null?void 0:e.terminate)===void 0&&(s.terminate=!1);let a=0;return(e==null?void 0:e.tag)!==void 0&&(a=Va(e.tag,n)),r=t._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,a),r===0&&pr("Can't create run options."),(e==null?void 0:e.extra)!==void 0&&Ug(e.extra,"",new WeakSet,(i,l)=>{let c=Va(i,n),d=Va(l,n);t._OrtAddRunConfigEntry(r,c,d)!==0&&pr(`Can't set a run config entry: ${i} - ${l}.`)}),[r,n]}catch(a){throw r!==0&&t._OrtReleaseRunOptions(r),n.forEach(i=>t._free(i)),a}}}),zC,BC,UC,op,WC,FL,ane=Je(()=>{vc(),F1(),zC=e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},BC=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},UC=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(r=>(typeof r=="string"?r:r.name)==="webgpu")&&(e.enableMemPattern=!1)},op=(e,t,r,n)=>{let s=Va(t,n),a=Va(r,n);kr()._OrtAddSessionConfigEntry(e,s,a)!==0&&pr(`Can't set a session config entry: ${t} - ${r}.`)},WC=async(e,t,r)=>{for(let n of t){let s=typeof n=="string"?n:n.name,a=[];switch(s){case"webnn":if(s="WEBNN",typeof n!="string"){let p=n==null?void 0:n.deviceType;p&&op(e,"deviceType",p,r)}break;case"webgpu":if(s="JS",typeof n!="string"){let p=n;if(p!=null&&p.preferredLayout){if(p.preferredLayout!=="NCHW"&&p.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${p.preferredLayout}`);op(e,"preferredLayout",p.preferredLayout,r)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${s}`)}let i=Va(s,r),l=a.length,c=0,d=0;if(l>0){c=kr()._malloc(l*kr().PTR_SIZE),r.push(c),d=kr()._malloc(l*kr().PTR_SIZE),r.push(d);for(let p=0;p<l;p++)kr().setValue(c+p*kr().PTR_SIZE,a[p][0],"*"),kr().setValue(d+p*kr().PTR_SIZE,a[p][1],"*")}await kr()._OrtAppendExecutionProvider(e,i,c,d,l)!==0&&pr(`Can't append execution provider: ${s}.`)}},FL=async e=>{let t=kr(),r=0,n=[],s=e||{};UC(s);try{let a=zC(s.graphOptimizationLevel??"all"),i=BC(s.executionMode??"sequential"),l=typeof s.logId=="string"?Va(s.logId,n):0,c=s.logSeverityLevel??2;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log serverity level is not valid: ${c}`);let d=s.logVerbosityLevel??0;if(!Number.isInteger(d)||d<0||d>4)throw new Error(`log verbosity level is not valid: ${d}`);let p=typeof s.optimizedModelFilePath=="string"?Va(s.optimizedModelFilePath,n):0;if(r=t._OrtCreateSessionOptions(a,!!s.enableCpuMemArena,!!s.enableMemPattern,i,!!s.enableProfiling,0,l,c,d,p),r===0&&pr("Can't create session options."),s.executionProviders&&await WC(r,s.executionProviders,n),s.enableGraphCapture!==void 0){if(typeof s.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${s.enableGraphCapture}`);op(r,"enableGraphCapture",s.enableGraphCapture.toString(),n)}
vendor: 5,457 bytes, line 494
494if(s.freeDimensionOverrides)for(let[u,h]of Object.entries(s.freeDimensionOverrides)){if(typeof u!="string")throw new Error(`free dimension override name must be a string: ${u}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let f=Va(u,n);t._OrtAddFreeDimensionOverride(r,f,h)!==0&&pr(`Can't set a free dimension override: ${u} - ${h}.`)}return s.extra!==void 0&&Ug(s.extra,"",new WeakSet,(u,h)=>{op(r,u,h,n)}),[r,n]}catch(a){throw r!==0&&t._OrtReleaseSessionOptions(r)!==0&&pr("Can't release session options."),n.forEach(i=>t._free(i)),a}}}),ed,Di,Bl,L1,Wg,z1,B1,Rb,Mt=Je(()=>{ed=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${e}`)}},Di=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${e}`)}},Bl=(e,t)=>{let r=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],n=typeof t=="number"?t:t.reduce((s,a)=>s*a,1);return r>0?Math.ceil(n*r):void 0},L1=e=>{switch(e){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}},Wg=e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}},z1=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",B1=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Rb=e=>{switch(e){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${e}`)}}}),U1,LL=Je(()=>{O1(),U1=async e=>{if(typeof e=="string"){let t=await fetch(e);if(!t.ok)throw new Error(`failed to load external data file: ${e}`);let r=t.headers.get("Content-Length"),n=r?parseInt(r,10):0;if(n<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let s=t.body.getReader(),a;try{a=new ArrayBuffer(n)}catch(l){if(l instanceof RangeError){let c=Math.ceil(n/65536);a=new WebAssembly.Memory({initial:c,maximum:c}).buffer}else throw l}let i=0;for(;;){let{done:l,value:c}=await s.read();if(l)break;let d=c.byteLength;new Uint8Array(a,i,d).set(c),i+=d}return new Uint8Array(a,0,n)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),VC,GC,qC,HC,W1,KC,Yt,Ji=Je(()=>{Mt(),VC=["V","I","W","E","F"],GC=(e,t)=>{console.log(`[${VC[e]},${new Date().toISOString()}]${t}`)},W1=(e,t)=>{qC=e,HC=t},KC=(e,t)=>{let r=Wg(e),n=Wg(qC);r>=n&&GC(r,typeof t=="function"?t():t)},Yt=(...e)=>{HC&&KC(...e)}}),QC,Yd,Ce,Vg,zL,BL,UL,Rt=Je(()=>{QC=class{static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}},Yd=class{static calcShape(e,t,r=!1){let n=e.length,s=t.length;if(n===0)return t;if(s===0)return e;let a=Math.max(e.length,t.length),i=new Array(a);if(r){if(n<2||s<2)return;let l=QC.calcMatMulShape([e[n-2],e[n-1]],[t[s-2],t[s-1]]);if(l===void 0)return;[i[a-2],i[a-1]]=l}for(let l=r?3:1;l<=a;l++){let c=n-l<0?1:e[n-l],d=s-l<0?1:t[s-l];if(c!==d&&c>1&&d>1)return;let p=Math.max(c,d);if(c&&d)i[a-l]=Math.max(c,d);else{if(p>1)return;i[a-l]=0}}return i}static isValidBroadcast(e,t){let r=e.length,n=t.length;if(r>n)return!1;for(let s=1;s<=r;s++)if(e[r-s]!==1&&e[r-s]!==t[n-s])return!1;return!0}},Ce=class Ym{static size(t){return Ym.getSizeFromDimensionRange(t,0,t.length)}static convertShape(t,r=4){let n=t.length;if(n===0)return[];let s=new Array(n),a=n-1;for(;a>=0;){if(t[a]%r===0){s[a]=t[a]/r;break}if(r%t[a]!==0)throw new Error("cannot convert shape");s[a]=1,r/=t[a],a--}for(a--;a>=0;a--)s[a]=t[a];return s}static sizeFromDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return Ym.getSizeFromDimensionRange(t,r,t.length)}static sizeToDimension(t,r){if(r<0||r>t.length)throw new Error(`invalid dimension of ${r} for sizeToDimension as Tensor has ${t.length} dimensions.`);return Ym.getSizeFromDimensionRange(t,0,r)}static getSizeFromDimensionRange(t,r,n){let s=1;for(let a=r;a<n;a++){if(t[a]<0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 
494negative values in them.");s*=Number(t[a])}return s}static computeStrides(t){let r=t.length;if(r===0)return[];if(r===1)return[1];let n=new Array(r);n[r-1]=1,n[r-2]=t[r-1];for(let s=r-3;s>=0;--s)n[s]=n[s+1]*t[s+1];return n}static normalizeAxis(t,r){if(t<-r&&t>=r)throw new Error("unsupported axis for this operation.");return t<0?t+r:t}static normalizeAxes(t,r){return t.map(n=>this.normalizeAxis(n,r??t.length))}static sortBasedOnPerm(t,r){return r?r.map(n=>t[n]):t.slice().reverse()}static padShape(t,r){let n=t.length;return t.map((s,a)=>s+r[a]+r[a+n])}static areEqual(t,r){return t.length!==r.length?!1:t.every((n,s)=>n===r[s])}},Vg=class bp{static adjustPoolAttributes(t,r,n,s,a,i){if(!t&&n.length!==r.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(t)for(let l=0;l<r.length-2;l++)l>=n.length?n.push(r[l+2]):n[l]=r[l+2];for(let l=0;l<n.length;l++)if(l<s.length){if(s[l]<0)throw new Error("strides should be greater than or equal to 1")}else s.push(1);for(let l=0;l<n.length;l++)if(l<a.length){if(a[l]<0)throw new Error("dilations should be greater than or equal to 1")}else a.push(1);for(let l=0;l<n.length*2;l++)if(l<i.length){if(i[l]<0)throw new Error("pad should be greater than or equal to 1")}else i.push(0);for(let l=0;l<n.length;l++){if(n[l]<=0)throw new Error("kernel shapes need to be greater than 0");if(i[l]>=n[l]||i[l+n.length]>=n[l])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(t,r,n,s,a,i,l){if(l){if(a.length!==2*(t.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(r.length!==t.length-2)throw new Error("length of strides should be the length of data dimensions");if(s.length!==t.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let c=0;c<t.length-2;c++)bp.adjustPadAndReturnShape(t[c+(i?1:2)],r[c],n[c],s[c],a,c,c+t.length-2,l)}}static computePoolOutputShape(t,r,n,s,a,i,l){if(r.length<=0)throw new Error("input shape must be of size greater than 0");let c=[r[0],r[1]];return bp.computeShapeHelper(t,r,c,n,s,a,i,l),c}static computeConvOutputShape(t,r,n,s,a,i,l){if(t.length<=0||r.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");let c=[t[0],r[0]];return bp.computeShapeHelper(!1,t,c,n,s,a,i,l),c}static computeShapeHelper(t,r,n,s,a,i,l,c){if(t)for(let d=0;d<r.length-2;d++)n.push(1);else for(let d=0;d<r.length-2;d++)n.push(bp.adjustPadAndReturnShape(r[d+2],s[d],a[d],i[d],l,d,d+r.length-2,c))}static adjustPadAndReturnShape(t,r,n,s,a,i,l,c){let d=n*(s-1)+1;if(c&&c!=="NOTSET")switch(c){case"VALID":return a[i]=0,a[l]=0,Math.floor((t-d)/r+1);case"SAME_LOWER":case"SAME_UPPER":if(n!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{let p=((t+r-1)/r-1)*r+s-t;return a[i]=Math.floor(c==="SAME_LOWER"?(p+1)/2:p/2),a[l]=p-a[i],Math.floor((t+p-s)/r+1)}default:throw new Error("Unsupported AutoPad type")}else return Math.floor((t+a[i]+a[l]-d)/r+1)}},zL=class{static getShapeOfGemmResult(e,t,r,n,s){if(e.length!==2||r.length!==2)throw new Error("shape need to be of size 2");let a,i,l;t?(a=e[1],i=e[0]):(a=e[0],i=e[1]);let c=-1;if(n?(l=r[0],c=1):(l=r[1],c=0),r[c]!==i)throw new Error("dimension mismatch");if(a<=0||l<=0||i<=0)throw new Error("invalid shape specified");if(s&&!Yd.isValidBroadcast(s,[a,l]))throw new Error("gemm: invalid bias shape for broadcast");return[a,l,i]}},BL=-34028234663852886e22,UL=34028234663852886e22}),V1,WL=Je(()=>{Mt(),V1=(e,t)=>new(L1(t))(e)}),Db,vw,YC,_w,JC,ww,xw,bw,ZC,VL,ine=Je(()=>{Ji(),Db=(e,t=!0)=>{if(e.byteLength%8!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 8 (BigInt).");let r=e.byteLength/8,n=new BigInt64Array(e.buffer,e.byteOffset,r),s=new Int32Array(r);for(let a=0;a<r;a++){let i=n[a];if(i>2147483647n||i<-2147483648n)throw new Error(`Overflow occurred when converting BigInt to Int32 at index ${a}: ${i}`);s[a]=Number(i)}return t?new Uint8Array(s.buffer):s},vw=(e,t=!0)=>{if(e.byteLength%4!==0)throw new Error("Invalid Uint8Array length - must be a multiple of 4 (Int32).");let r=e.byteLength/4,n=new Int32Array(e.buffer,e.byteOffset,r),s=BigInt64Array.from(n,BigInt);return t?new Uint8Array(s.buffer):s},YC=1,_w=()=>YC++,JC=new Map([["float32",32],["float16",16],["int32",32],["uint32",32],["int64",64],["uint64",64],["int8",8],["uint8",8],["int4",4],["uint4",4]]),ww=(e,t)=>{let r=JC.get(e);if(!r)throw new Error("Unsupported data type.");return t.length>0?Math.ceil(t.reduce((n,s)=>n*s)*r/8):0},xw=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:r,tensor:n,dataType:s,shape:a,shouldConvertInt64toInt32:i=!1}=e;this.sessionId=t,this.mlContext=r,this.mlTensor=n,this.dataType=s,this.tensorShape=a,this.shouldConvertInt64toInt32=i}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return ww(this.dataType,this.tensorShape)}destroy(){Yt("verbose",()=>"[WebNN] TensorWrapper.destroy"),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let r=await this.mlContext.readTensor(this.mlTensor),n=vw(new Uint8Array(r));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,r){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===r.length&&this.tensorShape.every((n,s)=>n===r[s])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},bw=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,r,n){let s=t,a=this.tensorManager.getMLContext(e),i=s==="int64"&&!a.opSupportLimits().input.dataTypes.includes("int64");if(i&&(s="int32",Yt("verbose",()=>"[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32")),this.wrapper){if(this.wrapper.canReuseTensor(a,s,r))return this.wrapper.tensor;if(n){if(this.wrapper.byteLength!==ww(s,r))throw new Error("Unable to copy data to tensor with different size.");this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let l=typeof MLTensorUsage>"u"?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,s,r,l,!0,!0,i),n&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=Db(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else Yt("verbose",()=>"Data size does not match tensor size. Releasing tensor."),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){var t,r,n;if(this.activeUpload){let s=(t=this.wrapper)!=null&&t.isInt64ToInt32Converted?vw(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(s):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(s);return}else return s.buffer}if(!this.wrapper)throw new Error("Tensor has not been created.");return e?this.wrapper.read((r=this.wrapper)==null?void 0:r.shouldConvertInt64toInt32,e):this.wrapper.read((n=this.wrapper)==null?void 0:n.shouldConvertInt64toInt32)}},ZC=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw new Error("MLContext not found for session.");return t}reserveTensorId(){let e=_w();return this.tensorTrackersById.set(e,new bw(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,r,n,s){Yt("verbose",()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${r}, shape: ${n}, copyOld: ${s}}`);let a=this.tensorTrackersById.get(t);if(!a)throw new Error("Tensor not found.");return a.ensureTensor(e,r,n,s)}upload(e,t){let r=this.tensorTrackersById.get(e);if(!r)throw new Error("Tensor not found.");r.upload(t)}async download(e,t){Yt("verbose",()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t==null?void 0:t.byteLength}}`);let r=this.tensorTrackersById.get(e);if(!r)throw new Error("Tensor not found.");return r.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,r,n){let s=this.getMLContext(e),a=_w(),i=new xw({sessionId:e,context:s,tensor:t,dataType:r,shape:n});return this.tensorTrackersById.set(a,new bw(this,i)),this.externalTensors.add(i),a}async getCachedTensor(e,t,r,n,s,a,i=!1){let l=this.getMLContext(e);for(let[d,p]of this.freeTensors.entries())if(p.canReuseTensor(l,t,r)){Yt("verbose",()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${r}}`);let u=this.freeTensors.splice(d,1)[0];return u.sessionId=e,u}Yt("verbose",()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${r}}`);let c=await l.createTensor({dataType:t,shape:r,dimensions:r,usage:n,writable:s,readable:a});return new xw({sessionId:e,context:l,tensor:c,dataType:t,shape:r,shouldConvertInt64toInt32:i})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},VL=(...e)=>new ZC(...e)}),mm,XC,GL,one=Je(()=>{Mt(),vc(),WL(),ine(),Ji(),mm=new Map([[1,"float32"],[10,"float16"],[6,"int32"],[12,"uint32"],[7,"int64"],[13,"uint64"],[22,"int4"],[21,"uint4"],[3,"int8"],[2,"uint8"],[9,"uint8"]]),XC=(e,t)=>{if(e===t)return!0;
494if(e===void 0||t===void 0)return!1;let r=Object.keys(e).sort(),n=Object.keys(t).sort();return r.length===n.length&&r.every((s,a)=>s===n[a]&&e[s]===t[s])},GL=class{constructor(e){this.tensorManager=VL(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,W1(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw new Error("No active session");return this.activeSessionId}onRunStart(e){Yt("verbose",()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){Yt("verbose",()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let r of t)Yt("verbose",()=>`[WebNN] releasing temporary tensor {tensorId: ${r}}`),this.tensorManager.releaseTensorId(r);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let r=this.mlContextCache.findIndex(n=>n.gpuDevice===e);if(r!==-1)return this.mlContextCache[r].mlContext;{let n=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:n}),n}}else if(e===void 0){let r=this.mlContextCache.findIndex(n=>n.options===void 0&&n.gpuDevice===void 0);if(r!==-1)return this.mlContextCache[r].mlContext;{let n=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:n}),n}}let t=this.mlContextCache.findIndex(r=>XC(r.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let r=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:r}),r}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let r=this.sessionIdsByMLContext.get(t);r||(r=new Set,this.sessionIdsByMLContext.set(t,r)),r.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let r=this.sessionIdsByMLContext.get(t);if(r.delete(e),r.size===0){this.sessionIdsByMLContext.delete(t);let n=this.mlContextCache.findIndex(s=>s.mlContext===t);n!==-1&&this.mlContextCache.splice(n,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){Yt("verbose",()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,r,n,s){let a=mm.get(r);if(!a)throw new Error(`Unsupported ONNX data type: ${r}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,n,s)}async createTemporaryTensor(e,t,r){Yt("verbose",()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${r}}`);let n=mm.get(t);if(!n)throw new Error(`Unsupported ONNX data type: ${t}`);let s=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,s,n,r,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(s):this.temporarySessionTensorIds.set(e,[s]),s}uploadTensor(e,t){if(!kr().shouldTransferToMLTensor)throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");Yt("verbose",()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let r=await this.tensorManager.download(e);return V1(r,t)}}registerMLTensor(e,t,r,n){let s=mm.get(r);if(!s)throw new Error(`Unsupported ONNX data type: ${r}`);let a=this.tensorManager.registerTensor(e,t,s,n);return Yt("verbose",()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${s}, dimensions: ${n}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,r,n,s,a,i=!1){if(!a)throw new Error("External mounted files are not available.");let l=e;e.startsWith("./")&&(l=e.substring(2));let c=a.get(l);if(!c)throw new Error(`File with name ${l} not found in preloaded files.`);if(t+r>c.byteLength)throw new Error("Out of bounds: data offset and length exceed the external file data size.");let d=c.slice(t,t+r).buffer,p;switch(s.dataType){case"float32":p=new Float32Array(d);break;case"float16":p=typeof Float16Array<"u"&&Float16Array.from?new Float16Array(d):new Uint16Array(d);break;case"int32":p=new Int32Array(d);break;case"uint32":p=new Uint32Array(d);break;case"int64":i?(p=Db(new Uint8Array(d),!1),s.dataType="int32"):p=new BigInt64Array(d);break;case"uint64":p=new BigUint64Array(d);break;case"int8":p=new Int8Array(d);break;case"int4":case"uint4":case"uint8":p=new Uint8Array(d);break;default:throw new Error(`Unsupported data type: ${s.dataType} in creating WebNN Constant from external data.`)}return Yt("verbose",()=>`[WebNN] registerMLConstant {dataType: ${s.dataType}, shape: ${s.shape}}} ${i?"(Note: it was int64 data type and registered to int32 as workaround)":""}`),n.constant(s,p)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let r=this.sessionGraphInputs.get(e);return r?r.includes(t):!1}isInt64Supported(e){var t;return!!((t=this.mlContextBySessionId.get(e))!=null&&t.opSupportLimits().input.dataTypes.includes("int64"))}flush(){}}}),G1=Je(()=>{}),kw,gm,ym,ej,tj,Tw,Fb,rj,qL,lne=Je(()=>{Ji(),G1(),kw=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200
vendor: 8,606 bytes, lines 494-509
494],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),gm=[],ym=e=>Math.ceil(Number(e)/16)*16,ej=e=>{for(let t=0;t<gm.length;t++){let r=gm[t];if(e<=r)return r}return Math.ceil(e/16)*16},tj=1,Tw=()=>tj++,Fb=async(e,t,r,n)=>{let s=ym(r),a=e.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let i=e.getCommandEncoder();e.endComputePass(),i.copyBufferToBuffer(t,0,a,0,s),e.flush(),await a.mapAsync(GPUMapMode.READ);let l=a.getMappedRange();if(n){let c=n();return c.set(new Uint8Array(l,0,r)),c}else return new Uint8Array(l.slice(0,r))}finally{a.destroy()}},rj=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[t]of kw)gm.push(t),this.freeBuffers.set(t,[]),this.freeUniformBuffers.set(t,[]);this.sessionCount=0}upload(e,t){let r=t.buffer,n=t.byteOffset,s=t.byteLength,a=ym(s),i=this.storageCache.get(e);if(!i)throw new Error("gpu data for uploading does not exist");if(Number(i.originalSize)!==s)throw new Error(`inconsistent data size. gpu data size=${i.originalSize}, data size=${s}`);let l=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=l.getMappedRange();new Uint8Array(c).set(new Uint8Array(r,n,s)),l.unmap();let d=this.backend.device.createCommandEncoder();d.copyBufferToBuffer(l,0,i.gpuData.buffer,0,a),this.backend.device.queue.submit([d.finish()]),l.destroy(),Yt("verbose",()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let r=this.storageCache.get(e);if(!r)throw new Error("source gpu data for memcpy does not exist");let n=this.storageCache.get(t);if(!n)throw new Error("destination gpu data for memcpy does not exist");if(r.originalSize!==n.originalSize)throw new Error("inconsistent source and destination gpu data size");let s=ym(r.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(r.gpuData.buffer,0,n.gpuData.buffer,0,s)}registerExternalBuffer(e,t,r){let n;if(r){if(n=r[0],e===r[1])return Yt("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${n}, buffer is the same, skip.`),n;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet.
495             Please use the previous external buffer!`)}else n=Tw();return this.storageCache.set(n,{gpuData:{id:n,type:0,buffer:e},originalSize:t}),Yt("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${n}, registered.`),n}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),Yt("verbose",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let r=ej(e),n,s=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(s||a){let l=(s?this.freeBuffers:this.freeUniformBuffers).get(r);l?l.length>0?n=l.pop():n=this.backend.device.createBuffer({size:r,usage:t}):n=this.backend.device.createBuffer({size:r,usage:t})}else n=this.backend.device.createBuffer({size:r,usage:t});let i={id:Tw(),type:0,buffer:n};return this.storageCache.set(i.id,{gpuData:i,originalSize:Number(e)}),Yt("verbose",()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${i.id}`),i}get(e){var t;return(t=this.storageCache.get(e))==null?void 0:t.gpuData}release(e){let t=typeof e=="bigint"?Number(e):e,r=this.storageCache.get(t);if(!r){if(this.storageCache.size===0)return 0;throw new Error("releasing data does not exist")}return Yt("verbose",()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${r.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(r.gpuData.buffer),r.originalSize}async download(e,t){let r=this.storageCache.get(Number(e));if(!r)throw new Error("data does not exist");await Fb(this.backend,r.gpuData.buffer,r.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let t=kw.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let r=this.freeBuffers.get(e.size)||[];t===void 0||r.length>=t?e.destroy():r.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let r=this.freeUniformBuffers.get(e.size)||[];t===void 0||r.length>=t?e.destroy():r.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(t=>{t.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(t=>{t.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(t=>{t.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(r=>{r.destroy()}),this.capturedPendingBuffers.delete(e)),this.sessionCount-=1,this.sessionCount===0&&(Yt("warning",()=>"[WebGPU] Clearing webgpu buffer cache"),this.storageCache.forEach(r=>{r.gpuData.buffer.destroy()}),this.storageCache=new Map)}},qL=(...e)=>new rj(...e)}),nj,cr,Zr=Je(()=>{nj=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},cr=e=>new nj(e)}),Jd,vm,Dn,cs,vt,Wr,Lb,yd,Yo,mt,lp,De,ut,HL,q1,sj,KL,Ft=Je(()=>{Mt(),Rt(),Jd=64,vm=(e,t)=>{if(t===3)throw new Error("vec3 has same alignment as vec4, use vec4 instead");switch(Number(e)){case 10:return t>1?`vec${t}<f16>`:"f16";case 1:return t>1?`vec${t}<f32>`:"f32";case 6:return t>1?`vec${t}<i32>`:"i32";case 12:return t>1?`vec${t}<u32>`:"u32";case 7:if(t>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2<u32>","i32"];case 13:if(t>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2<u32>","u32"];case 9:if(t!==4)throw new Error("bool must be vec4");return["u32","vec4<bool>"];case 22:return"i32";case 21:return"u32";default:throw new Error(`Unknown data type: ${e}`)}},Dn=(e,t=1)=>{let r=vm(e,t);return typeof r=="string"?r:r[0]},cs=(e,t=1)=>{let r=vm(e,t);return typeof r=="string"?r:r[1]},vt=(...e)=>{let t=[];return e.forEach(r=>{r.length!==0&&t.push({type:12,data:r},{type:12,data:Ce.computeStrides(r)})}),t},Wr=e=>e%4===0?4:e%2===0?2:1,Lb=(e="f32",t,r="0")=>!t||t===1?`${e}(${r})`:`vec${t}<${e}>(${r})`,yd=(e,t,r)=>e==="f32"?r:t===1?`f32(${r})`:`vec${t}<f32>(${r})`,Yo=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,mt=(e,t,r,n)=>e.startsWith("uniforms.")&&r>4?typeof t=="string"?n==="f16"?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:n==="f16"?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:r>1?`${e}[${t}]`:e,lp=(e,t,r,n,s)=>{let a=typeof r=="number",i=a?r:r.length,l=[...new Array(i).keys()],c=i<2?"u32":i<=4?`vec${i}<u32>`:`array<u32, ${i}>`,d=vm(t,s),p=typeof d=="string"?d:d[1],u=typeof d=="string"?d:d[0],h={indices:c,value:p,storage:u,tensor:t},f=L=>typeof L=="string"?L:`${L}u`,m={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},v=a?"uniforms.":"",k=`${v}${e}_shape`,y=`${v}${e}_strides`,g="";for(let L=0;L<i-1;L++)g+=`
496    let dim${L} = current / ${mt(y,L,i)};
497    let rest${L} = current % ${mt(y,L,i)};
498    indices[${L}] = dim${L};
499    current = rest${L};
500    `;g+=`indices[${i-1}] = current;`;let _=i<2?"":`
501  fn o2i_${e}(offset: u32) -> ${h.indices} {
502    var indices: ${h.indices};
503    var current = offset;
504    ${g}
505    return indices;
506  }`,w=L=>(m.offsetToIndices=!0,i<2?L:`o2i_${e}(${L})`),x=[];if(i>=2)for(let L=i-1;L>=0;L--)x.push(`${mt(y,L,i)} * (indices[${L}])`);let b=i<2?"":`
507  fn i2o_${e}(indices: ${h.indices}) -> u32 {
508    return ${x.join("+")};
509  }`,M=L=>(m.indicesToOffset=!0,i<2?L:`i2o_${e}(${L})`),S=(...L)=>i===0?"0u":`${h.indices}(${L.map(f).join(",")})`,j=(L,$)=>i<2?`${L}
509`:`${mt(L,$,i)}`,I=(L,$,G)=>i<2?`${L}=${G};`:`${mt(L,$,i)}=${G};`,q={},U=(L,$)=>{m.broadcastedIndicesToOffset=!0;let G=`${$.name}broadcastedIndicesTo${e}Offset`;if(G in q)return`${G}(${L})`;let se=[];for(let _e=i-1;_e>=0;_e--){let de=$.indicesGet("outputIndices",_e+$.rank-i);se.push(`${j(y,_e)} * (${de} % ${j(k,_e)})`)}return q[G]=`fn ${G}(outputIndices: ${$.type.indices}) -> u32 {
510             return ${se.length>0?se.join("+"):"0u"};
511           }`,`${G}(${L})`},R=(L,$)=>(()=>{if(h.storage===h.value)return`${e}[${L}]=${$};`;if(h.storage==="vec2<u32>"&&h.value==="i32")return`${e}[${L}]=vec2<u32>(u32(${$}), select(0u, 0xFFFFFFFFu, ${$} < 0));`;if(h.storage==="vec2<u32>"&&h.value==="u32")return`${e}[${L}]=vec2<u32>(u32(${$}), 0u);`;if(h.storage==="u32"&&h.value==="vec4<bool>")return`${e}[${L}]=dot(vec4<u32>(0x1, 0x100, 0x10000, 0x1000000), vec4<u32>(${$}));`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),K=L=>(()=>{if(h.storage===h.value)return`${e}[${L}]`;if(h.storage==="vec2<u32>"&&h.value==="i32")return`i32(${e}[${L}].x)`;if(h.storage==="vec2<u32>"&&h.value==="u32")return`u32(${e}[${L}].x)`;if(h.storage==="u32"&&h.value==="vec4<bool>")return`vec4<bool>(bool(${e}[${L}] & 0xFFu), bool(${e}[${L}] & 0xFF00u), bool(${e}[${L}] & 0xFF0000u), bool(${e}[${L}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),H=i<2?"":`
512  fn get_${e}ByIndices(indices: ${h.indices}) -> ${p} {
513    return ${K(`i2o_${e}(indices)`)};
514  }`,ee=i<2?"":(()=>{let L=l.map(G=>`d${G}: u32`).join(", "),$=l.map(G=>`d${G}`).join(", ");return`
515  fn get_${e}(${L}) -> ${p} {
516    return get_${e}ByIndices(${S($)});
517  }`})(),te=(...L)=>{if(L.length!==i)throw new Error(`indices length must be ${i}`);let $=L.map(f).join(",");return i===0?K("0u"):i===1?K($[0]):(m.get=!0,m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}(${$})`)},V=L=>i<2?K(L):(m.getByIndices=!0,m.indicesToOffset=!0,`get_${e}ByIndices(${L})`),ae=i<2?"":`
518  fn set_${e}ByIndices(indices: ${h.indices}, value: ${p}) {
519    ${R(`i2o_${e}(indices)`,"value")}
520  }`,ne=i<2?"":(()=>{let L=l.map(G=>`d${G}: u32`).join(", "),$=l.map(G=>`d${G}`).join(", ");return`
521  fn set_${e}(${L}, value: ${p}) {
522    set_${e}ByIndices(${S($)}, value);
523  }`})();return{impl:()=>{let L=[],$=!1;return m.offsetToIndices&&(L.push(_),$=!0),m.indicesToOffset&&(L.push(b),$=!0),m.broadcastedIndicesToOffset&&(Object.values(q).forEach(G=>L.push(G)),$=!0),m.set&&(L.push(ne),$=!0),m.setByIndices&&(L.push(ae),$=!0),m.get&&(L.push(ee),$=!0),m.getByIndices&&(L.push(H),$=!0),!a&&$&&L.unshift(`const ${k} = ${h.indices}(${r.join(",")});`,`const ${y} = ${h.indices}(${Ce.computeStrides(r).join(",")});`),L.join(`
524`)},type:h,offsetToIndices:w,indicesToOffset:M,broadcastedIndicesToOffset:U,indices:S,indicesGet:j,indicesSet:I,set:(...L)=>{if(L.length!==i+1)throw new Error(`indices length must be ${i}`);let $=L[i];if(typeof $!="string")throw new Error("value must be string");let G=L.slice(0,i).map(f).join(",");return i===0?R("0u",$):i===1?R(G[0],$):(m.set=!0,m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}(${G}, ${$})`)},setByOffset:R,setByIndices:(L,$)=>i<2?R(L,$):(m.setByIndices=!0,m.indicesToOffset=!0,`set_${e}ByIndices(${L}, ${$});`),get:te,getByOffset:K,getByIndices:V,usage:n,name:e,strides:y,shape:k,rank:i}},De=(e,t,r,n=1)=>lp(e,t,r,"input",n),ut=(e,t,r,n=1)=>lp(e,t,r,"output",n),HL=(e,t,r)=>lp(e,t,r,"atomicOutput",1),q1=(e,t,r,n=1)=>lp(e,t,r,"internal",n),sj=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e=="number"?`${e}u`:e}) { return; }`}mainStart(e=Jd){let t=typeof e=="number"?e:e[0],r=typeof e=="number"?1:e[1],n=typeof e=="number"?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||r>this.limits.maxComputeWorkgroupSizeY||n>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${t}, ${r}, ${n}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*r*n>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${t}, ${r}, ${n}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let s=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,a=s?`@builtin(global_invocation_id) global_id : vec3<u32>,
525    @builtin(workgroup_id) workgroup_id : vec3<u32>,
526    @builtin(local_invocation_index) local_idx : u32,
527    @builtin(local_invocation_id) local_id : vec3<u32>`:`@builtin(global_invocation_id) global_id : vec3<u32>,
528                                             @builtin(local_invocation_id) local_id : vec3<u32>,
529    @builtin(local_invocation_index) local_idx : u32,
530    @builtin(workgroup_id) workgroup_id : vec3<u32>,
531    @builtin(num_workgroups) num_workgroups : vec3<u32>`,i=s?`let global_idx = global_id.x;
532         let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] +
533             workgroup_id.y * num_workgroups[0] + workgroup_id.x;
534         let global_idx = workgroup_index * ${t*r*n}u + local_idx;`;return`@compute @workgroup_size(${t}, ${r}, ${n})
535  fn main(${a}) {
536    ${i}
537  `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith("uniforms.")&&this.uniforms.push({name:e.shape.replace("uniforms.",""),type:"u32",length:e.rank}),e.strides.startsWith("uniforms.")&&this.uniforms.push({name:e.strides.replace("uniforms.",""),type:"u32",length:e.rank}))}declareVariable(e,t){if(e.usage==="internal")throw new Error("cannot use internal variable with declareVariable(). use registerInternalVariables() instead.");this.variables.push(e),this.appendVariableUniforms(e);let r=e.usage==="input"?"read":"read_write",n=e.usage==="atomicOutput"?"atomic<i32>":e.type.storage;return`@group(0) @binding(${t}) var<storage, ${r}> ${e.name}: array<${n}>;`}declareVariables(...e){return e.map(t=>this.declareVariable(t,this.variableIndex++)).join(`
538`)}registerInternalVariable(e){if(e.usage!=="internal")throw new Error("cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.");this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(t=>this.registerInternalVariable(t)),this}registerUniform(e,t,r=1){return this.uniforms.push({name:e,type:t,length:r}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return"";let e=[];for(let{name:t,type:r,length:n}of this.uniforms)if(n&&n>4)r==="f16"?e.push(`@align(16) ${t}:array<mat2x4<${r}>, ${Math.ceil(n/8)}>`):e.push(`${t}:array<vec4<${r}>, ${Math.ceil(n/4)}>`);else{let s=n==null||n===1?r:`vec${n}<${r}>`;e.push(`${t}:${s}`)}return`
539      struct Uniforms { ${e.join(", ")} };
540      @group(0) @binding(${this.variableIndex}) var<uniform> uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(`
541`)+this.internalVariables.map(e=>e.impl()).join(`
542`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=t=>[12,10,1,6][["u32","f16","f32","i32"].indexOf(t)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},KL=(e,t)=>new sj(e,t)}),aj,Mw,ij,oj,lj,cj,Qs,QL,YL,al=Je(()=>{Mt(),Rt(),Zr(),Ft(),aj=(e,t)=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(t.length!==0&&t.length!==e[0].dims.length)throw new Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},Mw=(e,t)=>t.length!==0?t:[...new Array(e).keys()].reverse(),ij=(e,t)=>Ce.sortBasedOnPerm(e,Mw(e.length,t)),oj=(e,t,r,n)=>{let s=`fn perm(i: ${n.type.indices}) -> ${r.type.indices} {
543    var a: ${r.type.indices};`;for(let a=0;a<t;
vendor: 5,754 bytes, lines 543-602
543++a)s+=`a[${e[a]}]=i[${a}];`;return s+="return a;}"},lj=(e,t)=>{let r=[],n=[];for(let s=0;s<e.length;++s)e[s]!==1&&r.push(e[s]),e[t[s]]!==1&&n.push(t[s]);return{newShape:r,newPerm:n}},cj=(e,t)=>{let r=0;for(let n=0;n<e.length;++n)if(t[e[n]]!==1){if(e[n]<r)return!1;r=e[n]}return!0},Qs=(e,t)=>{let r=e.dataType,n=e.dims.length,s=Mw(n,t),a=ij(e.dims,s),i=e.dims,l=a,c=n<2||cj(s,e.dims),d;if(c)return d=m=>{let v=De("input",r,i,4),k=ut("output",r,l,4);return`
544  ${m.registerUniform("output_size","u32").declareVariables(v,k)}
545  ${m.mainStart()}
546    ${m.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
547    output[global_idx] = input[global_idx];
548  }`},{name:"TransposeCopy",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let m=Ce.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(m/64/4)},programUniforms:[{type:12,data:Math.ceil(m/4)}]}},getShaderSource:d};let{newShape:p,newPerm:u}=lj(e.dims,s),h=Ce.areEqual(u,[2,3,1]),f=Ce.areEqual(u,[3,1,2]);if(p.length===2||h||f){i=h?[p[0],p[1]*p[2]]:f?[p[0]*p[1],p[2]]:p,l=[i[1],i[0]];let m=16;return d=v=>{let k=De("a",r,i.length),y=ut("output",r,l.length);return`
549  ${v.registerUniform("output_size","u32").declareVariables(k,y)}
550  var<workgroup> tile : array<array<${y.type.value}, ${m+1}>, ${m}>;
551  ${v.mainStart([m,m,1])}
552    let stride = (uniforms.output_shape[1] - 1) / ${m} + 1;
553    let workgroup_id_x = workgroup_index % stride;
554    let workgroup_id_y = workgroup_index / stride;
555    let input_col = workgroup_id_y * ${m}u + local_id.x;
556    let input_row = workgroup_id_x * ${m}u + local_id.y;
557    if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) {
558      tile[local_id.y][local_id.x] = ${k.getByIndices(`${k.type.indices}(input_row, input_col)`)};
559    }
560    workgroupBarrier();
561
562    let output_col = workgroup_id_x * ${m}u + local_id.x;
563    let output_row = workgroup_id_y * ${m}u + local_id.y;
564    if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) {
565      ${y.setByIndices(`${y.type.indices}(output_row, output_col)`,"tile[local_id.x][local_id.y]")}
566    }
567  }`},{name:"TransposeShared",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let v=Ce.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(l[1]/m),y:Math.ceil(l[0]/m)},programUniforms:[{type:12,data:v},...vt(i,l)]}},getShaderSource:d}}return d=m=>{let v=De("a",r,i.length),k=ut("output",r,l.length);return`
568  ${m.registerUniform("output_size","u32").declareVariables(v,k)}
569
570  ${oj(s,n,v,k)}
571
572  ${m.mainStart()}
573    ${m.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
574
575    let indices = ${k.offsetToIndices("global_idx")};
576    let aIndices = perm(indices);
577
578    ${k.setByOffset("global_idx",v.getByIndices("aIndices"))}
579  }`},{name:"Transpose",shaderCache:{hint:`${t}`,inputDependencies:["rank"]},getRunData:()=>{let m=Ce.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...vt(i,l)]}},getShaderSource:d}},QL=(e,t)=>{aj(e.inputs,t.perm),e.compute(Qs(e.inputs[0],t.perm))},YL=e=>cr({perm:e.perm})}),dj,uj,pj,hj,fj,mj,gj,yj,vj,_j,ja,JL,ZL,XL,ez,tz,rz,nz,sz,az,iz,cne=Je(()=>{Mt(),Rt(),Ft(),H1(),al(),dj={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate * candidate",logSumExp:"bestValue + exp(candidate)",l1:"bestValue + abs(candidate)",l2:"bestValue + candidate * candidate",logSum:"bestValue + candidate"},uj={max:"select(bestValue, candidate, candidate > bestValue)",min:"select(bestValue, candidate, candidate < bestValue)",mean:"bestValue + candidate",sum:"bestValue + candidate",prod:"bestValue * candidate",sumSquare:"bestValue + candidate",logSumExp:"bestValue + candidate",l1:"bestValue + candidate",l2:"bestValue + candidate",logSum:"bestValue + candidate"},pj={max:"_A[offset]",min:"_A[offset]",mean:"0",sum:"0",prod:"1",sumSquare:"0",logSumExp:"0",l1:"0",l2:"0",logSum:"0"},hj={max:"bestValue",min:"bestValue",sum:"bestValue",prod:"bestValue",sumSquare:"bestValue",logSumExp:"log(bestValue)",l1:"bestValue",l2:"sqrt(bestValue)",logSum:"log(bestValue)"},fj=(e,t)=>{let r=[];for(let n=t-e;n<t;++n)r.push(n);return r},mj=(e,t)=>{let r=[],n=e.length;for(let a=0;a<n;a++)t.indexOf(a)===-1&&r.push(e[a]);let s=t.map(a=>e[a]);return[r,s]},gj=(e,t)=>{let r=e.length+t.length,n=[],s=0;for(let a=0;a<r;a++)t.indexOf(a)===-1?n.push(e[s++]):n.push(1);return n},yj=(e,t)=>{for(let r=0;r<e.length;++r)if(e[e.length-r-1]!==t-1-r)return!1;return!0},vj=(e,t)=>{let r=[];if(!yj(e,t)){for(let n=0;n<t;++n)e.indexOf(n)===-1&&r.push(n);e.forEach(n=>r.push(n))}return r},_j=(e,t,r,n,s,a,i)=>{let l=r[0].dims,c=Ce.size(a),d=Ce.size(i),p=De("_A",r[0].dataType,l),u=ut("output",s,a),h=64;c===1&&(h=256);let f=`
580          var<workgroup> aBestValues : array<f32, ${h}>;
581       `,m=v=>`
582        ${v.registerUniform("reduceSize","u32").declareVariables(p,u)}
583        ${f}
584        fn DIV_CEIL(a : u32, b : u32) -> u32 {
585          return ((a - 1u) / b + 1u);
586         }
587         ${v.mainStart(h)}
588
589          let outputIndex = global_idx / ${h};
590          let offset = outputIndex * uniforms.reduceSize;
591
592          var bestValue = f32(${pj[n]});
593          let Length = uniforms.reduceSize;
594          for (var k = local_idx; k < Length; k = k + ${h}) {
595           let candidate = f32(${p.getByOffset("offset + k")});
596           bestValue = ${dj[n]};
597          }
598          aBestValues[local_idx] = bestValue;
599          workgroupBarrier();
600
601         var reduceSize = min(Length, ${h}u);
602         for (var currentSize = reduceSize / 2u; reduceSize > 1u;
603             currentSize = reduceSize / 2u) {
604           let interval = DIV_CEIL(reduceSize, 2u);
605           if (local_idx < currentSize) {
606            let candidate = aBestValues[local_idx + interval];
607            bestValue = ${uj[n]};
608            aBestValues[local_idx] = bestValue;
609           }
610           reduceSize = interval;
611           workgroupBarrier();
612         }
613
614         if (local_idx == 0u) {
615          ${u.setByOffset("outputIndex",`${n==="mean"?`${u.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${u.type.storage}(${hj[n]})`}`)};
616         }
617        }`;return{name:e,shaderCache:{hint:`${t};${h}`,inputDependencies:["type"]},getShaderSource:m,getRunData:()=>({outputs:[{dims:a,dataType:s}],dispatchGroup:{x:c},programUniforms:[{type:12,data:d}]})}},ja=(e,t,r,n)=>{let s=e.inputs.length===1?r:zb(e.inputs,r),a=s.axes;a.length===0&&!s.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((f,m)=>m));let i=Ce.normalizeAxes(a,e.inputs[0].dims.length),l=i,c=e.inputs[0],d=vj(l,e.inputs[0].dims.length);d.length>0&&(c=e.compute(Qs(e.inputs[0],d),{inputs:[0],outputs:[-1]})[0],l=fj(l.length,c.dims.length));let[p,u]=mj(c.dims,l),h=p;s.keepDims&&(h=gj(p,i)),e.compute(_j(t,s.cacheKey,[c],n,e.inputs[0].dataType,h,u),{inputs:[c]})},JL=(e,t)=>{ja(e,"ReduceMeanShared",t,"mean")},ZL=(e,t)=>{ja(e,"ReduceL1Shared",t,"l1")},XL=(e,t)=>{ja(e,"ReduceL2Shared",t,"l2")},ez=(e,t)=>{ja(e,"ReduceLogSumExpShared",t,"logSumExp")},tz=(e,t)=>{ja(e,"ReduceMaxShared",t,"max")},rz=(e,t)=>{ja(e,"ReduceMinShared",t,"min")},nz=(e,t)=>{ja(e,"ReduceProdShared",t,"prod")},sz=(e,t)=>{ja(e,"ReduceSumShared",t,"sum")},az=(e,t)=>{ja(e,"ReduceSumSquareShared",t,"sumSquare")},iz=(e,t)=>{ja(e,"ReduceLogSumShared",t,"logSum")}}),Ia,wj,Gg,zb,$a,xj,bj,kj,Tj,Mj,Ej,Sj,Aj,Pj,Cj,Na,oz,lz,cz,dz,uz,pz,hz,fz,mz,gz,H1=Je(()=>{Mt(),Rt(),Zr(),Ft(),cne(),Ia=e=>{if(!e||e.length===0||e.length>2)throw new Error("Reduce op requires 1 or 2 inputs.");if(e.length===2&&e[1].dims.length!==1)throw new Error("Invalid axes input dims.")},wj=e=>["","",`var value = ${e.getByIndices("input_indices")};`,""],Gg=(e,t,r,n,s,a,i=!1,l=!1)=>{let c=[],d=r[0].dims,p=d.length,u=Ce.normalizeAxes(s,p),h=!l&&u.length===0;d.forEach((v,k)=>{h||u.indexOf(k)>=0?i&&c.push(1):c.push(v)});let f=c.length,m=Ce.size(c);return{name:e,shaderCache:t,getShaderSource:v=>{let k=[],y=De("_A",r[0].dataType,p),g=ut("output",a,f),_=n(y,g,u),w=_[2];for(let x=0,b=0;x<p;x++)h||u.indexOf(x)>=0?(i&&b++,w=`for(var j${x}: u32 = 0; j${x} < ${d[x]}; j${x}++) {
618                  ${_[2].includes("last_index")?`let last_index = j${x};`:""}
619                  ${y.indicesSet("input_indices",x,`j${x}`)}
620                  ${w}
621                }`):(k.push(`${y.indicesSet("input_indices",x,g.indicesGet("output_indices",b))};`),b++);return`
622
623        ${v.registerUniform("output_size","u32").declareVariables(y,g)}
624
625        ${v.mainStart()}
626          ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
627          var input_indices: ${y.type.indices};
628          let output_indices = ${g.offsetToIndices("global_idx")};
629
630          ${k.join(`
631`)}
632          ${_[0]}       // init ops for reduce max/min
633          ${_[1]}
634          ${w}
635          ${_[3]}
636          ${_.length===4?g.setByOffset("global_idx","value"):_.slice(4).join(`
637`)}
638        }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...vt(d,c)]})}},zb=(e,t)=>{let r=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(n=>r.push(Number(n))),cr({axes:r,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},$a=(e,t,r,n)=>{let s=e.inputs,a=s.length===1?r:zb(s,r);e.compute(Gg(t,{hint:a.cacheKey,inputDependencies:["rank"]},[s[0]],a.noopWithEmptyAxes&&a.axes.length===0?wj:n,a.axes,s[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},xj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceLogSum",t,(r,n)=>[`var value = ${n.type.storage}(0);`,"",`value += ${r.getByIndices("input_indices")};`,"value = log(value);"])},bj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceL1",t,(r,n)=>[`var value = ${n.type.storage}(0);`,"",`value += abs(${r.getByIndices("input_indices")});`,""])},kj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceL2",t,(r,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,"",`t = ${r.getByIndices("input_indices")}; value += (t * t);`,"value = sqrt(value);"])},Tj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceLogSumExp",t,(r,n)=>[`var value = ${n.type.storage}(0);`,"",`value += exp(${r.getByIndices("input_indices")});`,"value = log(value);"])},Mj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceMax",t,(r,n,s)=>{let a=[];for(let i=0;i<r.rank;i++)(s.indexOf(i)>
vendor: 16,690 bytes, lines 638-773
638=0||s.length===0)&&a.push(r.indicesSet("input_indices",i,0));return[`${a.join(`
639`)}`,`var value = ${r.getByIndices("input_indices")};`,`value = max(value, ${r.getByIndices("input_indices")});`,""]})},Ej=(e,t)=>{Ia(e.inputs),$a(e,"ReduceMean",t,(r,n,s)=>{let a=1;for(let i=0;i<r.rank;i++)(s.indexOf(i)>=0||s.length===0)&&(a*=e.inputs[0].dims[i]);return["var sum = f32(0);","",`sum += f32(${r.getByIndices("input_indices")});`,`let value = ${n.type.value}(sum / ${a});`]})},Sj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceMin",t,(r,n,s)=>{let a=[];for(let i=0;i<r.rank;i++)(s.indexOf(i)>=0||s.length===0)&&a.push(`input_indices[${i}] = 0;`);return[`${a.join(`
640`)}`,`var value = ${r.getByIndices("input_indices")};`,`value = min(value, ${r.getByIndices("input_indices")});`,""]})},Aj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceProd",t,(r,n)=>[`var value = ${n.type.storage}(1);`,"",`value *= ${r.getByIndices("input_indices")};`,""])},Pj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceSum",t,(r,n)=>[`var value = ${n.type.storage}(0);`,"",`value += ${r.getByIndices("input_indices")};`,""])},Cj=(e,t)=>{Ia(e.inputs),$a(e,"ReduceSumSquare",t,(r,n)=>[`var t = ${n.type.value}(0); var value = ${n.type.value}(0);`,"",`t = ${r.getByIndices("input_indices")}; value += t * t;`,""])},Na=(e,t,r)=>{if(t.length===0)return r;let n=1,s=1;for(let a=0;a<t.length;a++)t.indexOf(a)===-1?n*=e[a]:s*=e[a];return s<32&&n>1024},oz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Ej(e,t):JL(e,t)},lz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?bj(e,t):ZL(e,t)},cz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?kj(e,t):XL(e,t)},dz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Tj(e,t):ez(e,t)},uz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Mj(e,t):tz(e,t)},pz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Sj(e,t):rz(e,t)},hz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Aj(e,t):nz(e,t)},fz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Pj(e,t):sz(e,t)},mz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?Cj(e,t):az(e,t)},gz=(e,t)=>{Na(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?xj(e,t):iz(e,t)}}),Ew,yz,vz,Bb,dne=Je(()=>{Mt(),Zr(),H1(),Ew=e=>{if(!e||e.length===0||e.length>2)throw new Error("ArgMinMaxOp op requires 1 or 2 inputs.");if(e[0].dataType!==1)throw new Error("Invalid input type.")},yz=(e,t)=>{Ew(e.inputs);let r=(n,s,a)=>{let i=[];for(let l=0;l<n.rank;l++)(a.indexOf(l)>=0||a.length===0)&&i.push(`input_indices[${l}] = 0;`);return[`${i.join(`
641`)}`,`var value = ${n.getByIndices("input_indices")};
642var best_index : i32 = 0;`,`if (${n.getByIndices("input_indices")} ${t.selectLastIndex>0?"<=":"<"} value) {
643         value = ${n.getByIndices("input_indices")};
644         best_index = i32(last_index);
645       }`,"",s.setByOffset("global_idx","best_index")]};e.compute(Gg("ArgMin",{hint:t.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},vz=(e,t)=>{Ew(e.inputs);let r=(n,s,a)=>{let i=[];for(let l=0;l<n.rank;l++)(a.indexOf(l)>=0||a.length===0)&&i.push(`input_indices[${l}] = 0;`);return[`${i.join(`
646`)}`,`var value = ${n.getByIndices("input_indices")};
647var best_index : i32 = 0;`,`if (${n.getByIndices("input_indices")} ${t.selectLastIndex>0?">=":">"} value) {
648         value = ${n.getByIndices("input_indices")};
649         best_index = i32(last_index);
650       }`,"",s.setByOffset("global_idx","best_index")]};e.compute(Gg("argMax",{hint:t.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],r,[t.axis],7,t.keepDims),{inputs:[0]})},Bb=e=>cr(e)}),jj,_m,Ij,$j,Nj,xh,Oj,_z,K1=Je(()=>{Mt(),Rt(),G1(),Ft(),jj=(e,t)=>{let r=e[0],n=e[1],s=e[2],a=e[3],i=e[4],l=e[5];if(i&&l)throw new Error("Attention cannot have both past and attention_bias");if(r.dims.length!==3)throw new Error('Input "input" must have 3 dimensions');let c=r.dims[0],d=r.dims[1],p=r.dims[2];if(s.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimensions');if(n.dims.length!==2)throw new Error('Input "weights" is expected to have 2 dimensions');if(n.dims[0]!==p)throw new Error("Input 1 dimension 0 should have same length as dimension 2 of input 0");if(s.dims[0]!==n.dims[1])throw new Error('Input "bias" dimension 0 should have same length as dimension 1 of input "weights"');let u=s.dims[0]/3,h=u,f=h;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw new Error("qkv_hidden_sizes attribute should have 3 elements");for(let _ of t.qkvHiddenSizes)if(_%t.numHeads!==0)throw new Error("qkv_hidden_sizes should be divisible by num_heads");u=t.qkvHiddenSizes[0],h=t.qkvHiddenSizes[1],f=t.qkvHiddenSizes[2]}let m=d;if(u!==h)throw new Error("qkv_hidden_sizes first element should be same as the second");if(s.dims[0]!==u+h+f)throw new Error('Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes');let v=0;if(i){if(h!==f)throw new Error('Input "past" expect k_hidden_size == v_hidden_size');if(i.dims.length!==5)throw new Error('Input "past" must have 5 dimensions');if(i.dims[0]!==2)throw new Error('Input "past" first dimension must be 2');if(i.dims[1]!==c)throw new Error('Input "past" second dimension must be batch_size');if(i.dims[2]!==t.numHeads)throw new Error('Input "past" third dimension must be num_heads');if(i.dims[4]!==h/t.numHeads)throw new Error('Input "past" fifth dimension must be k_hidden_size / num_heads');t.pastPresentShareBuffer||(v=i.dims[3])}let k=m+v,y=-1,g=0;if(a)throw new Error("Mask not supported");if(i)throw new Error("past is not supported");if(l){if(l.dims.length!==4)throw new Error('Input "attention_bias" must have 4 dimensions');if(l.dims[0]!==c||l.dims[1]!==t.numHeads||l.dims[2]!==d||l.dims[3]!==k)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:c,sequenceLength:d,pastSequenceLength:v,kvSequenceLength:m,totalSequenceLength:k,maxSequenceLength:y,inputHiddenSize:p,hiddenSize:u,vHiddenSize:f,headSize:Math.floor(u/t.numHeads),vHeadSize:Math.floor(f/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:g,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},_m=(e,t,r)=>t&&e?`
651      let total_sequence_length_input = u32(${t.getByOffset("0")});
652      let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length);
653      let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input;
654      let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input;
655      total_sequence_length = u32(${e==null?void 0:e.getByOffset("batchIdx")}) + 1;
656      var past_sequence_length: u32 = 0;
657      if (is_first_prompt == false) {
658        past_sequence_length = total_sequence_length - sequence_length;
659      }
660       `:`
661    ${r?"let past_sequence_length = uniforms.past_sequence_length":""};
662    let present_sequence_length = total_sequence_length;
663    `,Ij=(e,t,r,n,s,a,i,l)=>{let c=Wr(i?1:a),d=64,p=a/c;p<d&&(d=32);let u=Math.ceil(a/c/d),h=[{type:12,data:t},{type:12,data:r},{type:12,data:n},{type:12,data:s},{type:12,data:p},{type:12,data:u}],f=Dn(e.dataType,c),m=cs(1,c),v=["type"];i&&v.push("type"),l&&v.push("type");let k=y=>{let g=ut("x",e.dataType,e.dims,c),_=[g],w=i?De("seq_lens",i.dataType,i.dims):void 0;w&&_.push(w);let x=l?De("total_sequence_length_input",l.dataType,l.dims):void 0;x&&_.push(x);let b=cs(e.dataType),M=[{name:"batch_size",type:"u32"},{name:"num_heads",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"sequence_length",type:"u32"},{name:"total_sequence_length",type:"u32"},{name:"elements_per_thread",type:"u32"}];return`
664  var<workgroup> thread_max: array<f32, ${d}>;
665  var<workgroup> thread_sum: array<f32, ${d}>;
666  ${y.registerUniforms(M).declareVariables(..._)}
667  ${y.mainStart([d,1,1])}
668    let batchIdx = workgroup_id.z / uniforms.num_heads;
669    let headIdx = workgroup_id.z % uniforms.num_heads;
670    let sequence_length = uniforms.sequence_length;
671    var total_sequence_length = uniforms.total_sequence_length;
672    ${_m(w,x,!1)}
673    let local_offset = local_idx * uniforms.elements_per_thread;
674    let offset = (global_idx / ${d}) * uniforms.total_sequence_length + local_offset;
675    let seq_causal_length = ${i?"u32(past_sequence_length + workgroup_id.y + 1)":"total_sequence_length"};
676    var thread_max_vector = ${m}(-3.402823e+38f);
677    for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) {
678      thread_max_vector = max(${m}(x[offset + i]), thread_max_vector);
679    }
680    thread_max[local_idx] = ${(()=>{switch(c){case 1:return"thread_max_vector";case 2:return"max(thread_max_vector.x, thread_max_vector.y)";case 4:return"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))";default:throw new Error(`Unsupported components: ${c}`)}})()};
681    workgroupBarrier();
682
683    var max_value =  f32(-3.402823e+38f);
684    for (var i = 0u; i < ${d}; i++) {
685      max_value = max(thread_max[i], max_value);
686    }
687
688    var sum_vector = ${m}(0);
689    for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) {
690      sum_vector += exp(${m}(x[offset + i]) - max_value);
691    }
692    thread_sum[local_idx] = ${(()=>{switch(c){case 1:return"sum_vector";case 2:return"sum_vector.x + sum_vector.y";case 4:return"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w";default:throw new Error(`Unsupported components: ${c}`)}})()};
693    workgroupBarrier();
694
695    var sum: f32 = 0;
696    for (var i = 0u; i < ${d}; i++) {
697      sum += thread_sum[i];
698    }
699
700    if (sum == 0) {
701      for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) {
702        x[offset + i] = ${g.type.value}(${b}(1.0) / ${b}(seq_causal_length));
703      }
704    } else {
705      for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) {
706        var f32input = ${m}(x[offset + i]);
707        x[offset + i] = ${g.type.value}(exp(f32input - max_value) / sum);
708      }
709    }
710      ${i?`
711        for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) {
712          x[offset + total_seq_id] = ${g.type.value}(${b}(0));
713        }`:""};
714  }`};return{name:"AttentionProbsSoftmax",shaderCache:{hint:`${d};${f};${c}`,inputDependencies:v},getShaderSource:k,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:s,z:t*r},programUniforms:h})}},$j=(e,t,r,n,s,a,i,l,c)=>{let d=i+a.kvSequenceLength,p=[a.batchSize,a.numHeads,a.sequenceLength,d],u=e>1&&n,h=a.kvNumHeads?a.kvNumHeads:a.numHeads,f=u?[a.batchSize,h,d,a.headSize]:void 0,m=a.nReps?a.nReps:1,v=a.scale===0?1/Math.sqrt(a.headSize):a.scale,k=Wr(a.headSize),y=a.headSize/k,g=12,_={x:Math.ceil(d/g),y:Math.ceil(a.sequenceLength/g),z:a.batchSize*a.numHeads},w=[{type:12,data:a.sequenceLength},{type:12,data:y},{type:12,data:d},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:v},{type:12,data:i},{type:12,data:a.kvSequenceLength},{type:12,data:m}],x=u&&n&&Ce.size(n.dims)>0,b=["type","type"];x&&b.push("type"),s&&b.push("type"),l&&b.push("type"),c&&b.push("type");let M=[{dims:p,dataType:t.dataType,gpuDataType:0}];u&&M.push({dims:f,dataType:t.dataType,gpuDataType:0});let S=j=>{let I=De("q",t.dataType,t.dims,k),q=De("key",r.dataType,r.dims,k),U=[I,q];if(x){let ae=De("past_key",n.dataType,n.dims,k);U.push(ae)}s&&U.push(De("attention_bias",s.dataType,s.dims));let R=l?De("seq_lens",l.dataType,l.dims):void 0;R&&U.push(R);let K=c?De("total_sequence_length_input",c.dataType,c.dims):void 0;K&&U.push(K);let H=ut("output",t.dataType,p),ee=[H];u&&ee.push(ut("present_key",t.dataType,f,k));let te=cs(1,k),V=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"alpha",type:"f32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return`
715  const TILE_SIZE = ${g}u;
716
717  var<workgroup> tileQ: array<${I.type.storage}, ${g*g}>;
718  var<workgroup> tileK: array<${I.type.storage}, ${g*g}>;
719  ${j.registerUniforms(V).declareVariables(...U,...ee)}
720  ${j.mainStart([g,g,1])}
721    // x holds the N and y holds the M
722    let headIdx = workgroup_id.z % uniforms.num_heads;
723    let kvHeadIdx = ${m===1?"headIdx":"headIdx / uniforms.n_reps"};
724    let kv_num_heads = ${m===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"};
725    let batchIdx = workgroup_id.z / uniforms.num_heads;
726    let m = workgroup_id.y * TILE_SIZE;
727    let n = workgroup_id.x * TILE_SIZE;
728    let sequence_length = uniforms.M;
729    var total_sequence_length = uniforms.N;
730    ${_m(R,K,!0)}
731    let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx;
732    let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K;
733    ${x&&u?"let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;":""};
734    let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K;
735    ${u?"let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;":""}
736    var value = ${te}(0);
737    for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {
738      if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) {
739        tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x];
740      }
741      if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) {
742        var idx = TILE_SIZE * local_id.y + local_id.x;
743      ${x&&u?`
744              if (n + local_id.y < past_sequence_length) {
745                tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x];
746              } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) {
747                tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x];
748              }`:`
749          if (n + local_id.y < uniforms.kv_sequence_length) {
750            tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x];
751          }`}
752      ${u?`if (n + local_id.y < present_sequence_length) {
753        present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx];
754      }`:""}
755      }
756      workgroupBarrier();
757
758      for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) {
759          value += ${te}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]);
760      }
761
762      workgroupBarrier();
763    }
764
765    if (global_id.y < uniforms.M && global_id.x < total_sequence_length) {
766      let headOffset = workgroup_id.z * uniforms.M * uniforms.N;
767      let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x;
768      var sum: f32 = ${(()=>{switch(k){case 1:return"value";case 2:return"value.x + value.y";case 4:return"value.x + value.y + value.z + value.w";default:throw new Error(`Unsupported components: ${k}`)}})()};
769        output[outputIdx] = ${H.type.value} (sum * uniforms.alpha) + ${s?"attention_bias[outputIdx]":"0.0"};
770    }
771  }`};return{name:"AttentionProbs",shaderCache:{hint:`${k};${s!==void 0};${n!==void 0};${e}`,inputDependencies:b},getRunData:()=>({outputs:M,dispatchGroup:_,programUniforms:w}),getShaderSource:S}},Nj=(e,t,r,n,s,a,i=void 0,l=void 0)=>{let c=a+s.kvSequenceLength,d=s.nReps?s.nReps:1,p=s.vHiddenSize*d,u=e>1&&n,h=s.kvNumHeads?s.kvNumHeads:s.numHeads,f=u?[s.batchSize,h,c,s.headSize]:void 0,m=[s.batchSize,s.sequenceLength,p],v=12,k={x:Math.ceil(s.vHeadSize/v),y:Math.ceil(s.sequenceLength/v),z:s.batchSize*s.numHeads},y=[{type:12,data:s.sequenceLength},{type:12,data:c},{type:12,data:s.vHeadSize},{type:12,data:s.numHeads},{type:12,data:s.headSize},{type:12,data:p},{type:12,data:a},{type:12,data:s.kvSequenceLength},{type:12,data:d}],g=u&&n&&Ce.size(n.dims)>0,_=["type","type"];g&&_.push("type"),i&&_.push("type"),l&&_.push("type");let w=[{dims:m,dataType:t.dataType,gpuDataType:0}];u&&w.push({dims:f,dataType:t.dataType,gpuDataType:0});let x=b=>{let M=De("probs",t.dataType,t.dims),S=De("v",r.dataType,r.dims),j=[M,S];g&&j.push(De("past_value",n.dataType,n.dims));let I=i?De("seq_lens",i.dataType,i.dims):void 0;i&&j.push(I);let q=l?De("total_sequence_length_input",l.dataType,l.dims):void 0;l&&j.push(q);let U=[ut("output",t.dataType,m)];u&&U.push(ut("present_value",t.dataType,f));let R=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"v_hidden_size",type:"u32"},{name:"past_sequence_length",type:"u32"},{name:"kv_sequence_length",type:"u32"},{name:"n_reps",type:"u32"}];return`
772  const TILE_SIZE = ${v}u;
773  var<workgroup> tileQ: array<${M.type.value}, ${v*v}>;
774  var<workgroup> tileV: array<${M.type.value}, ${v*v}>;
775  ${b.registerUniforms(R).declareVariables(...j,...U)}
776  ${b.mainStart([v,v,1])}
777   let headIdx = workgroup_id.z % uniforms.num_heads;
778   let batchIdx = workgroup_id.z / uniforms.num_heads;
779   let kvHeadIdx = ${d===1?"headIdx":"headIdx / uniforms.n_reps"};
780   let kv_num_heads = ${d===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"};
781   let m = global_id.y;
782   let n = global_id.x;
783   let sequence_length = uniforms.M;
784   var total_sequence_length = uniforms.K;
785   ${_m(I,q,!0)}
786   let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K;
787   let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch
788   ${g&&u?"let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;":""};
789   let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n;
790   ${u?"let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;":""}
791   var value = ${M.type.storage}(0);
792   for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {
793      if (m < uniforms.M && w + local_id.x < uniforms.K) {
794        tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x];
795      }
796      if (n < uniforms.N && w + local_id.y < uniforms.K) {
797        var idx = TILE_SIZE * local_id.y + local_id.x;
798        ${g&&u?`
799        if (w + local_id.y < past_sequence_length) {
800          tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N];
801        } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) {
802          tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N];
803        }
804      `:`
805            if (w + local_id.y < uniforms.kv_sequence_length) {
806              tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N];
807            }`}
808        ${u?`
809            if (w + local_id.y < present_sequence_length) {
810          present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx];
811        }`:""}
812      }
813     workgroupBarrier();
814     for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) {
815       value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x];
816     }
817     workgroupBarrier();
818   }
819
820   // we need to transpose output from BNSH_v to BSND_v
821   if (m < uniforms.M && n < uniforms.N) {
822     let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size
823       + headIdx * uniforms.N + n;
824     output[outputIdx] = value;
825   }
826  }`};return{name:"AttentionScore",shaderCache:{hint:`${n!==void 0};${e}`,inputDependencies:_},getRunData:()=>({outputs:w,dispatchGroup:k,programUniforms:y}),getShaderSource:x}},xh=(e,t,r,n,s,a,i,l,c,d,p=void 0,u=void 0)=>{let h=Math.min(e.outputCount,1+(i?1:0)+(l?1:0)),f=h>1?d.pastSequenceLength:0,m=f+d.kvSequenceLength,v=c&&Ce.size(c.dims)>0?c:void 0,k=[t,r];h>1&&i&&Ce.size(i.dims)>0&&k.push(i),v&&k.push(v),p&&k.push(p),u&&k.push(u);let y=e.compute($j(h,t,r,i,v,d,f,p,u),{inputs:k,outputs:h>1?[-1,1]:[-1]})[0];e.compute(Ij(y,d.batchSize,d.numHeads,f,d.sequenceLength,m,p,u),{inputs:p&&u?[y,p,u]:[y],outputs:[]});let g=[y,n];h>1&&l&&Ce.size(l.dims)>0&&g.push(l),p&&g.push(p),u&&g.push(u),e.compute(Nj(h,y,n,l,d,f,p,u),{inputs:g,outputs:h>1?[0,2]:[0]})},Oj=(e,t)=>{let r=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],n=t.sequenceLength,s=t.inputHiddenSize,a=t.headSize,i=12,l={x:Math.ceil(t.headSize/i),y:Math.ceil(t.sequenceLength/i),z:t.batchSize*t.numHeads},c=[e.inputs[0],e.inputs[1],e.inputs[2]],d=[{type:12,data:n},{type:12,data:s},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}],p=u=>{let h=ut("output_q",c[0].dataType,r),f=ut("output_k",c[0].dataType,r),m=ut("output_v",c[0].dataType,r),v=De("input",c[0].dataType,c[0].dims),k=De("weight",c[1].dataType,c[1].dims),y=De("bias",c[2].dataType,c[2].dims),g=v.type.storage,_=[{name:"M",type:"u32"},{name:"K",type:"u32"},{name:"N",type:"u32"},{name:"num_heads",type:"u32"},{name:"head_size",type:"u32"},{name:"hidden_size",type:"u32"},{name:"ldb",type:"u32"}];return`
827  const TILE_SIZE = ${i}u;
828  var<workgroup> tileInput: array<${g}, ${i*i}>;
829  var<workgroup> tileWeightQ: array<${g}, ${i*i}>;
830  var<workgroup> tileWeightK: array<${g}, ${i*i}>;
831  var<workgroup> tileWeightV: array<${g}, ${i*i}>;
832  ${u.registerUniforms(_).declareVariables(v,k,y,h,f,m)}
833  ${u.mainStart([i,i,1])}
834    let batchIndex = workgroup_id.z / uniforms.num_heads;
835    let headNumber = workgroup_id.z % uniforms.num_heads;
836    let m = global_id.y;
837    let n = global_id.x;
838
839    let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K;
840    let biasOffsetQ = headNumber * uniforms.head_size;
841    let biasOffsetK = uniforms.hidden_size + biasOffsetQ;
842    let biasOffsetV = uniforms.hidden_size + biasOffsetK;
843
844    var valueQ = ${g}(0);
845    var valueK = ${g}(0);
846    var valueV = ${g}(0);
847    for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {
848      if (m < uniforms.M && w + local_id.x < uniforms.K) {
849        tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x];
850      }
851      if (n < uniforms.N && w + local_id.y < uniforms.K) {
852        let offset = n + (w + local_id.y) * uniforms.ldb;
853        tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset];
854        tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset];
855        tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset];
856      }
857      workgroupBarrier();
858      for (var k: u32 = 0u; k<TILE_SIZE && w+k < uniforms.K; k++) {
859        let inputTileOffset = TILE_SIZE * local_id.y + k;
860        let weightTileOffset = TILE_SIZE * k + local_id.x;
861        valueQ += tileInput[inputTileOffset] * tileWeightQ[weightTileOffset];
862        valueK += tileInput[inputTileOffset] * tileWeightK[weightTileOffset];
863        valueV += tileInput[inputTileOffset] * tileWeightV[weightTileOffset];
864      }
865
866      workgroupBarrier();
867    }
868
869    let headOffset = (m * uniforms.N + n) % uniforms.head_size;
870    valueQ += bias[headOffset + biasOffsetQ];
871    valueK += bias[headOffset + biasOffsetK];
872    valueV += bias[headOffset + biasOffsetV];
873
874    let offset = workgroup_id.z * uniforms.M * uniforms.N;
875    if (m < uniforms.M && n < uniforms.N) {
876      let outputIdx = offset + m * uniforms.N + n;
877      output_q[outputIdx] = valueQ;
878      output_k[outputIdx] = valueK;
879      output_v[outputIdx] = valueV;
880    }
881  }`};return e.compute({name:"AttentionPrepare",shaderCache:{inputDependencies:["type","type","type"]},getRunData:()=>({outputs:[{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:r,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:l,programUniforms:d}),getShaderSource:p},{inputs:c,outputs:[-1,-1,-1]})},_z=(e,t)=>{let r=jj(e.inputs,t),[n,s,a]=Oj(e,r);return xh(e,n,s,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],r)}}),Rj,Dj,Fj,wz,une=Je(()=>{ti(),Mt(),Rt(),Zr(),Ft(),Rj=(e,t)=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs");let r=(n,s,a)=>{let i=s.length;if(i!==n.length)throw new Error(`${a}: num dimensions != ${i}`);s.forEach((l,c)=>{if(l!==n[c])throw new Error(`${a}: dim[${c}] do not match`)})};if(e[0].dims.length>1){let n=t.format==="NHWC"?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);r(e[1].dims,n,"Invalid input scale"),r(e[2].dims,n,"Invalid input B"),r(e[3].dims,n,"Invalid input mean"),r(e[4].dims,n,"Invalid input var")}else r(e[1].dims,[1],"Invalid input scale"),r(e[2].dims,[1],"Invalid input B"),r(e[3].dims,[1],"Invalid input mean"),r(e[4].dims,[1],"Invalid input var")},Dj=(e,t)=>{let{epsilon:r,spatial:n,format:s}=t,a=e[0].dims,i=n?Wr(a[a.length-1]):1,l=s==="NHWC"&&a.length>1?i:1,c=Ce.size(a)/i,d=n,p=d?a.length:a,u=De("x",e[0].dataType,e[0].dims,i),h=De("scale",e[1].dataType,e[1].dims,l),f=De("bias",e[2].dataType,e[2].dims,l),m=De("inputMean",e[3].dataType,e[3].dims,l),v=De("inputVar",e[4].dataType,e[4].dims,l),k=ut("y",e[0].dataType,p,i),y=()=>{let _="";if(n)_=`let cOffset = ${a.length===1?"0u":s==="NHWC"?`outputIndices[${a.length-1}] / ${i}`:"outputIndices[1]"};`;else if(s==="NCHW")_=`
882            ${k.indicesSet("outputIndices","0","0")}
883            let cOffset = ${k.indicesToOffset("outputIndices")};`;else{_=`var cIndices = ${h.type.indices}(0);
884                       cIndices[0] = outputIndices[${a.length-1}];`;for(let w=1;w<h.rank;w++)_+=`cIndices[${w}] = outputIndices[${w}];`;_+=`let cOffset = ${h.indicesToOffset("cIndices")};`}return _},g=_=>`
885  const epsilon = ${r};
886  ${_.registerUniform("outputSize","u32").declareVariables(u,h,f,m,v,k)}
887  ${_.mainStart()}
888  ${_.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
889    var outputIndices = ${k.offsetToIndices(`global_idx * ${i}`)};
890    ${y()}
891    let scale = ${h.getByOffset("cOffset")};
892    let bias = ${f.getByOffset("cOffset")};
893    let inputMean = ${m.getByOffset("cOffset")};
894    let inputVar = ${v.getByOffset("cOffset")};
895    let x = ${u.getByOffset("global_idx")};
896    let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias;
897    ${k.setByOffset("global_idx","value")}
898  }`;return{name:"BatchNormalization",shaderCache:{hint:`${t.epsilon}_${t.format}_${n}_${i}`,inputDependencies:d?["rank","type","type","type","type"]:void 0},getShaderSource:g,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d?[{type:12,data:c},...vt(a)]:[{type:12,data:c}]})}},Fj=e=>cr(e),wz=(e,t)=>{let{inputs:r,outputCount:n}=e,s=Fj({...t,outputCount:n});if(Pr.webgpu.validateInputContent&&Rj(r,s),t.trainingMode)throw new Error("BatchNormalization trainingMode is not supported yet.");e.compute(Dj(r,s))}}),Lj,zj,xz,pne=Je(()=>{Rt(),Ft(),Lj=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![320,640,1280].includes(e[0].dims[2]))throw new Error("number of channels should be 320, 640 or 1280");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},zj=e=>{let t=e[0].dims,r=e[0].dims[2],n=Ce.size(t)/4,s=e[0].dataType,a=De("input",s,t,4),i=De("bias",s,[r],4),l=De("residual",s,t,4),c=ut("output",s,t,4);return{name:"BiasAdd",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)}}),getShaderSource:d=>`
899  const channels = ${r}u / 4;
900  ${d.declareVariables(a,i,l,c)}
901
902  ${d.mainStart()}
903    ${d.guardAgainstOutOfBoundsWorkgroupSizes(n)}
904    let value = ${a.getByOffset("global_idx")}
905      + ${i.getByOffset("global_idx % channels")} + ${l.getByOffset("global_idx")};
906    ${c.setByOffset("global_idx","value")}
907  }`}},xz=e=>{Lj(e.inputs),e.compute(zj(e.inputs))}}),Bj,sr,bz,kz,Tz,Mz,Ez,Sz,Az,Pz,Cz,Uj,jz,Iz,$z,Nz,kp,Oz,Jm,Rz,Dz,Fz,Lz,zz,Bz,Uz,Wz,Vz,Gz,qz,Hz,Kz,Qz,Yz,Jz,Sw,Zz,Ub,Wb,Xz,eB,tB,Wj,Vj,rB,Q1=Je(()=>{Mt(),Rt(),Zr(),Ft(),Bj=(e,t,r,n,s,a,i)=>{let l=Math.ceil(t/4),c="";typeof s=="string"?c=`${s}(a)`:c=s("a");let d=De("inputData",r,[l],4),p=ut("outputData",n,[l],4),u=[{name:"vec_size",type:"u32"}];return i&&u.push(...i),`
908      ${e.registerUniforms(u).declareVariables(d,p)}
909
910  ${a??""}
911
912  ${e.mainStart()}
913    ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")}
914
915    let a = ${d.getByOffset("global_idx")};
916    ${p.setByOffset("global_idx",c)}
917  }`},sr=(e,t,r,n,s,a=e.dataType,i,l)=>{let c=[{type:12,data:Math.ceil(Ce.size(e.dims)/4)}];return i&&c.push(...i),{name:t,shaderCache:{hint:s,inputDependencies:["type"]},getShaderSource:d=>Bj(d,Ce.size(e.dims),e.dataType,a,r,n,l),getRunData:d=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(Ce.size(d[0].dims)/64/4)},programUniforms:c})}},bz=e=>{e.compute(sr(e.inputs[0],"Abs","abs"))},kz=e=>{e.compute(sr(e.inputs[0],"Acos","acos"))},Tz=e=>{e.compute(sr(e.inputs[0],"Acosh","acosh"))},Mz=e=>{e.compute(sr(e.inputs[0],"Asin","asin"))},Ez=e=>{e.compute(sr(e.inputs[0],"Asinh","asinh"))},Sz=e=>{e.compute(sr(e.inputs[0],"Atan","atan"))},Az=e=>{e.compute(sr(e.inputs[0],"Atanh","atanh"))},Pz=e=>cr(e),Cz=(e,t)=>{let r;switch(t.to){case 10:r="vec4<f16>";break;case 1:r="vec4<f32>";break;case 12:r="vec4<u32>";break;case 6:r="vec4<i32>";break;case 9:r="vec4<bool>";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}
vendor: 7,877 bytes, lines 917-1000
917e.compute(sr(e.inputs[0],"Cast",r,void 0,t.cacheKey,t.to))},Uj=e=>{let t,r,n=e.length>=2&&e[1].data!==0,s=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=n?e[1].getFloat32Array()[0]:-34028234663852886e22,r=s?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=n?e[1].getUint16Array()[0]:64511,r=s?e[2].getUint16Array()[0]:31743;break;default:throw new Error("Unsupport data type")}return cr({min:t,max:r})},jz=(e,t)=>{let r=t||Uj(e.inputs),n=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"Clip",s=>`clamp(${s}, vec4<${n}>(uniforms.min), vec4<${n}>(uniforms.max))`,void 0,r.cacheKey,void 0,[{type:e.inputs[0].dataType,data:r.min},{type:e.inputs[0].dataType,data:r.max}],[{name:"min",type:n},{name:"max",type:n}]),{inputs:[0]})},Iz=e=>{e.compute(sr(e.inputs[0],"Ceil","ceil"))},$z=e=>{e.compute(sr(e.inputs[0],"Cos","cos"))},Nz=e=>{e.compute(sr(e.inputs[0],"Cosh","cosh"))},kp=e=>cr(e),Oz=(e,t)=>{let r=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"Elu",n=>`elu_vf32(${n})`,`
918  const elu_alpha_ = ${r}(${t.alpha});
919
920  fn elu_f32(a: ${r}) -> ${r} {
921  return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);
922  }
923
924  fn elu_vf32(v: vec4<${r}>) -> vec4<${r}> {
925  return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));
926  }`,t.cacheKey))},Jm=(e="f32")=>`
927const r0: ${e} = 0.3275911;
928const r1: ${e} = 0.254829592;
929const r2: ${e} = -0.284496736;
930const r3: ${e} = 1.421413741;
931const r4: ${e} = -1.453152027;
932const r5: ${e} = 1.061405429;
933
934fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> {
935  let absv = abs(v);
936  let x = 1.0 / (1.0 + r0 * absv);
937  return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));
938}`,Rz=e=>{let t=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"Erf",r=>`erf_vf32(${r})`,Jm(t)))},Dz=e=>{e.compute(sr(e.inputs[0],"Exp","exp"))},Fz=e=>{e.compute(sr(e.inputs[0],"Floor","floor"))},Lz=e=>{let t=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"Gelu",r=>`0.5 * ${r} * (1.0 + erf_vf32(${r} * 0.7071067811865475))`,Jm(t)))},zz=(e,t)=>{let r=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"LeakyRelu",n=>`select(leaky_relu_alpha_ * ${n}, ${n}, ${n} >= vec4<${r}>(0.0))`,`const leaky_relu_alpha_ = ${r}(${t.alpha});`,t.cacheKey))},Bz=e=>{e.compute(sr(e.inputs[0],"Not",t=>`!${t}`))},Uz=e=>{e.compute(sr(e.inputs[0],"Neg",t=>`-${t}`))},Wz=e=>{e.compute(sr(e.inputs[0],"Reciprocal",t=>`1.0/${t}`))},Vz=e=>{let t=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"Relu",r=>`select(vec4<${t}>(0.0), ${r}, ${r} > vec4<${t}>(0.0))`))},Gz=e=>{e.compute(sr(e.inputs[0],"Sigmoid",t=>`(1.0 / (1.0 + exp(-${t})))`))},qz=e=>cr(e),Hz=(e,t)=>{let r=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"HardSigmoid",n=>`max(vec4<${r}>(0.0), min(vec4<${r}>(1.0), ${t.alpha} * ${n} + vec4<${r}>(${t.beta})))`,void 0,t.cacheKey))},Kz=e=>{e.compute(sr(e.inputs[0],"Sin","sin"))},Qz=e=>{e.compute(sr(e.inputs[0],"Sinh","sinh"))},Yz=e=>{e.compute(sr(e.inputs[0],"Sqrt","sqrt"))},Jz=e=>{e.compute(sr(e.inputs[0],"Tan","tan"))},Sw=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,Zz=e=>{e.compute(sr(e.inputs[0],"Tanh",Sw))},Ub=(e="f32")=>`
939const fast_gelu_a: ${e} = 0.5;
940const fast_gelu_b: ${e} = 0.7978845608028654;
941const fast_gelu_c: ${e} = 0.035677408136300125;
942
943fn tanh_v(v: vec4<${e}>) -> vec4<${e}> {
944  return ${Sw("v")};
945}
946`,Wb=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Xz=e=>{let t=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"FastGelu",Wb,Ub(t),void 0,e.inputs[0].dataType))},eB=(e,t)=>{let r=cs(e.inputs[0].dataType);return e.compute(sr(e.inputs[0],"ThresholdedRelu",n=>`select(vec4<${r}>(0.0), ${n}, ${n} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${r}>(${t.alpha});`,t.cacheKey)),0},tB=e=>{e.compute(sr(e.inputs[0],"Log","log"))},Wj=(e,t)=>`
947const alpha = vec4<${e}>(${t});
948const one = ${e}(1.0);
949const zero = ${e}(0.0);
950
951fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> {
952  let v = x *alpha;
953  var x1 : vec4<${e}>;
954  for (var i = 0; i < 4; i = i + 1) {
955    if (v[i] >= zero) {
956      x1[i] = one / (one + exp(-v[i]));
957    } else {
958      x1[i] = one - one / (one + exp(v[i]));
959    }
960  }
961  return x * x1;
962}
963`,Vj=e=>`quick_gelu_impl(${e})`,rB=(e,t)=>{let r=cs(e.inputs[0].dataType);e.compute(sr(e.inputs[0],"QuickGelu",Vj,Wj(r,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),Gj,qj,nB,hne=Je(()=>{Rt(),Ft(),Q1(),Gj=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error("hidden state should be 2560, 5120 or 10240");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},qj=e=>{let t=e[0].dims.slice();t[2]=t[2]/2;let r=De("input",e[0].dataType,e[0].dims,4),n=De("bias",e[0].dataType,[e[0].dims[2]],4),s=ut("output",e[0].dataType,t,4),a=Ce.size(t)/4,i=Dn(e[0].dataType);return{name:"BiasSplitGelu",getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:l=>`
964  const M_SQRT2 = sqrt(2.0);
965  const halfChannels = ${e[0].dims[2]/4/2}u;
966
967  ${l.declareVariables(r,n,s)}
968
969  ${Jm(i)}
970
971  ${l.mainStart()}
972    ${l.guardAgainstOutOfBoundsWorkgroupSizes(a)}
973    let biasIdx = global_idx % halfChannels;
974    let batchIndex = global_idx / halfChannels;
975    let inputOffset = biasIdx + batchIndex * halfChannels * 2;
976    let valueLeft = input[inputOffset] + bias[biasIdx];
977    let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels];
978    let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1);
979
980    ${s.setByOffset("global_idx","valueLeft * geluRight")}
981  }`}},nB=e=>{Gj(e.inputs),e.compute(qj(e.inputs))}}),Hj,Kj,Oa,sB,aB,iB,oB,lB,cB,dB,uB,pB,hB,fne=Je(()=>{Mt(),Rt(),Ft(),Hj=(e,t,r,n,s,a,i,l,c,d,p,u)=>{let h,f;typeof l=="string"?h=f=(g,_)=>`${l}((${g}),(${_}))`:typeof l=="function"?h=f=l:(h=l.scalar,f=l.vector);let m=ut("outputData",p,n.length,4),v=De("aData",c,t.length,4),k=De("bData",d,r.length,4),y;if(s)if(a){let g=Ce.size(t)===1,_=Ce.size(r)===1,w=t.length>0&&t[t.length-1]%4===0,x=r.length>0&&r[r.length-1]%4===0;g||_?y=m.setByOffset("global_idx",f(g?`${v.type.value}(${v.getByOffset("0")}.x)`:v.getByOffset("global_idx"),_?`${k.type.value}(${k.getByOffset("0")}.x)`:k.getByOffset("global_idx"))):y=`
982            let outputIndices = ${m.offsetToIndices("global_idx * 4u")};
983            let offsetA = ${v.broadcastedIndicesToOffset("outputIndices",m)};
984            let offsetB = ${k.broadcastedIndicesToOffset("outputIndices",m)};
985            ${m.setByOffset("global_idx",f(i||w?v.getByOffset("offsetA / 4u"):`${v.type.value}(${v.getByOffset("offsetA / 4u")}[offsetA % 4u])`,i||x?k.getByOffset("offsetB / 4u"):`${k.type.value}(${k.getByOffset("offsetB / 4u")}[offsetB % 4u])`))}
986          `}else y=m.setByOffset("global_idx",f(v.getByOffset("global_idx"),k.getByOffset("global_idx")));else{if(!a)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");let g=(_,w,x="")=>{let b=`aData[indexA${w}][componentA${w}]`,M=`bData[indexB${w}][componentB${w}]`;return`
987            let outputIndices${w} = ${m.offsetToIndices(`global_idx * 4u + ${w}u`)};
988            let offsetA${w} = ${v.broadcastedIndicesToOffset(`outputIndices${w}`,m)};
989            let offsetB${w} = ${k.broadcastedIndicesToOffset(`outputIndices${w}`,m)};
990            let indexA${w} = offsetA${w} / 4u;
991            let indexB${w} = offsetB${w} / 4u;
992            let componentA${w} = offsetA${w} % 4u;
993            let componentB${w} = offsetB${w} % 4u;
994            ${_}[${w}] = ${x}(${h(b,M)});
995          `};p===9?y=`
996            var data = vec4<u32>(0);
997            ${g("data",0,"u32")}
998            ${g("data",1,"u32")}
999            ${g("data",2,"u32")}
1000            ${g("data",3,"u32")}
1001            outputData[global_idx] = dot(vec4<u32>(0x1, 0x100, 0x10000, 0x1000000), vec4<u32>(data));`:y=`
1002            ${g("outputData[global_idx]",0)}
1003            ${g("outputData[global_idx]",1)}
1004            ${g("outputData[global_idx]",2)}
1005            ${g("outputData[global_idx]",3)}
1006          `}return`
1007        ${e.registerUniform("vec_size","u32").declareVariables(v,k,m)}
1008
1009        ${u??""}
1010
1011        ${e.mainStart()}
1012        ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")}
1013        ${y}
1014      }`},Kj=(e,t,r,n,s,a,i=r.dataType)=>{let l=r.dims.map(v=>Number(v)??1),c=n.dims.map(v=>Number(v)??1),d=!Ce.areEqual(l,c),p=l,u=Ce.size(l),h=!1,f=!1,m=[d];if(d){let v=Yd.calcShape(l,c,!1);if(!v)throw new Error("Can't perform binary op on the given tensors");p=v.slice(),u=Ce.size(p);let k=Ce.size(l)===1,y=Ce.size(c)===1,g=l.length>0&&l[l.length-1]%4===0,_=c.length>0&&c[c.length-1]%4===0;m.push(k),m.push(y),m.push(g),m.push(_);let w=1;for(let x=1;x<p.length;x++){let b=l[l.length-x],M=c[c.length-x];if(b===M)w*=b;else break}w%4===0?(f=!0,h=!0):(k||y||g||_)&&(h=!0)}else h=!0;return m.push(h),{name:e,shaderCache:{hint:t+m.map(v=>v.toString()).join("_"),inputDependencies:["rank","rank"]},getShaderSource:v=>Hj(v,l,c,p,h,d,f,s,r.dataType,n.dataType,i,a),getRunData:()=>({outputs:[{dims:p,dataType:i}],dispatchGroup:{x:Math.ceil(u/64/4)},programUniforms:[{type:12,data:Math.ceil(Ce.size(p)/4)},...vt(l,c,p)]})}},Oa=(e,t,r,n,s,a)=>{e.compute(Kj(t,s??"",e.inputs[0],e.inputs[1],r,n,a))},sB=e=>{Oa(e,"Add",(t,r)=>`${t}+${r}`)},aB=e=>{Oa(e,"Div",(t,r)=>`${t}/${r}`)},iB=e=>{Oa(e,"Equal",{scalar:(t,r)=>`u32(${t}==${r})`,vector:(t,r)=>`vec4<u32>(${t}==${r})`},void 0,void 0,9)},oB=e=>{Oa(e,"Mul",(t,r)=>`${t}*${r}`)},lB=e=>{let t=De("input",e.inputs[0].dataType,e.inputs[0].dims).type.value;Oa(e,"Pow",{scalar:(r,n)=>`pow_custom(${r},${n})`,vector:(r,n)=>`pow_vector_custom(${r},${n})`},`
1015    fn pow_custom(a : ${t}, b : ${t}) -> ${t} {
1016      if (b == ${t}(0.0)) {
1017        return ${t}(1.0);
1018      } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) {
1019        return ${t}(pow(f32(a), f32(b))); // NaN
1020      }
1021      return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t==="i32"?"round":""}(pow(f32(abs(a)), f32(b))));
1022    }
1023    fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> {
1024      // TODO: implement vectorized pow
1025      return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w));
1026    }
1027      `)},cB=e=>{Oa(e,"Sub",(t,r)=>`${t}-${r}`)},dB=e=>{Oa(e,"Greater",{scalar:(t,r)=>`u32(${t}>${r})`,vector:(t,r)=>`vec4<u32>(${t}>${r})`},void 0,void 0,9)},uB=e=>{Oa(e,"Less",{scalar:(t,r)=>`u32(${t}<${r})`,vector:(t,r)=>`vec4<u32>(${t}<${r})`},void 0,void 0,9)},pB=e=>{Oa(e,"GreaterOrEqual",{scalar:(t,r)=>`u32(${t}>=${r})`,vector:(t,r)=>`vec4<u32>(${t}>=${r})`},void 0,void 0,9)},hB=e=>{Oa(e,"LessOrEqual",{scalar:(t,r)=>`u32(${t}<=${r})`,vector:(t,r)=>`vec4<u32>(${t}<=${r})`},void 0,void 0,9)}}),Qj,Yj,Jj,Zj,fB,mB,mne=Je(()=>{Mt(),Rt(),Zr(),Ft(),Qj=(e,t)=>{if(!e||e.length<1)throw new Error("too few inputs");let r=0,n=e[r],s=n.dataType,a=n.dims.length;e.forEach((i,l)=>{if(l!==r){if(i.dataType!==s)throw new Error("input tensors should be one type");if(i.dims.length!==a)throw new Error("input tensors should have the same shape");i.dims.forEach((c,d)=>{if(d!==t&&c!==n.dims[d])throw new Error("non concat dimensions must match")})}})},Yj=(e,t)=>`
1028  fn calculateInputIndex(index: u32) -> u32 {
1029    let sizeInConcatAxis = array<u32, ${e}u>(${t});
1030    for (var i: u32 = 0u; i < ${e}; i += 1u ) {
1031      if (index < sizeInConcatAxis[i]) {
1032        return i;
1033      }
1034    }
1035    return ${e}u;
1036  }`,Jj=(e,t)=>{let r=e.length,n=[];for(let s=0;s<r;++s){let a=t.setByOffset("global_idx",e[s].getByIndices("indices"));r===1?n.push(a):s===0?n.push(`if (inputIndex == ${s}u) { ${a} }`):s===r-1?n.push(`else { ${a} }`):n.push(`else if (inputIndex == ${s}) { ${a} }`)}return n.join(`
1037`)},Zj=(e,t,r,n)=>{let s=Ce.size(r),a=new Array(e.length),i=new Array(e.length),l=0,c=[],d=[],p=[{type:12,data:s}];for(let v=0;v<e.length;++v)l+=e[v].dims[t],a[v]=l,d.push(e[v].dims.length),i[v]=De(`input${v}`,n,d[v]),c.push("rank"),p.push({type:12,data:a[v]});for(let v=0;v<e.length;++v)p.push(...vt(e[v].dims));p.push(...vt(r));let u=ut("output",n,r.length),h=u.indicesGet("indices",t),f=Array.from(Array(a.length).keys()).map(v=>`uniforms.sizeInConcatAxis${v}`).join(","),m=v=>`
1038
1039  ${(()=>{v.registerUniform("outputSize","u32");for(let k=0;k<e.length;k++)v.registerUniform(`sizeInConcatAxis${k}`,"u32");return v.declareVariables(...i,u)})()}
1040
1041  ${Yj(a.length,f)}
1042
1043  ${v.mainStart()}
1044    ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
1045
1046    var indices = ${u.offsetToIndices("global_idx")};
1047
1048    let inputIndex = calculateInputIndex(${h});
1049    if (inputIndex != 0u) {
1050      let sizeInConcatAxis = array<u32, ${a.length}u>(${f});
1051      ${h} -= sizeInConcatAxis[inputIndex - 1u];
1052    }
1053
1054    ${Jj(i,u)}
1055  }`;return{name:"Concat",shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:r,dataType:n}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:p}),getShaderSource:m}},fB=(e,t)=>
1055{let r=e.inputs,n=r[0].dims,s=Ce.normalizeAxis(t.axis,n.length);Qj(r,s);let a=n.slice();a[s]=r.reduce((l,c)=>l+(c.dims.length>s?c.dims[s]:0),0);let i=r.filter(l=>Ce.size(l.dims)>0);e.compute(Zj(i,s,a,r[0].dataType),{inputs:i})},mB=e=>cr({axis:e.axis})}),dc,uc,pc,Y1,_c=Je(()=>{Mt(),Rt(),dc=(e,t,r="f32")=>{switch(e.activation){case"Relu":return`value = max(value, ${t}(0.0));`;case"Sigmoid":return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case"Clip":return`value = clamp(value, ${t}(${r}(uniforms.clip_min)), ${t}(${r}(uniforms.clip_max)));`;case"HardSigmoid":return`value = max(${t}(0.0), min(${t}(1.0), ${r}(uniforms.alpha) * value + ${r}(uniforms.beta)));`;case"LeakyRelu":return`value = select(${r}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case"Tanh":return`let e2x = exp(-2.0 * abs(value));
1056              value = sign(value) * (1.0 - e2x) / (1.0 + e2x);
1057        `;case"":return"";default:throw new Error(`Unsupported activation ${e.activation}`)}},uc=(e,t)=>{e.activation==="Clip"?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation==="HardSigmoid"?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation==="LeakyRelu"&&t.push({type:1,data:e.alpha})},pc=(e,t)=>{e.activation==="Clip"?t.push({name:"clip_max",type:"f32"},{name:"clip_min",type:"f32"}):e.activation==="HardSigmoid"?t.push({name:"alpha",type:"f32"},{name:"beta",type:"f32"}):e.activation==="LeakyRelu"&&t.push({name:"alpha",type:"f32"})},Y1=e=>{let t=(e==null?void 0:e.activation)||"";if(t==="HardSigmoid"){let[r,n]=(e==null?void 0:e.activation_params)||[.2,.5];return{activation:t,alpha:r,beta:n}}else if(t==="Clip"){let[r,n]=(e==null?void 0:e.activation_params)||[BL,UL];return{activation:t,clipMax:n,clipMin:r}}else if(t==="LeakyRelu"){let[r]=(e==null?void 0:e.activation_params)||[.01];return{activation:t,alpha:r}}return{activation:t}}}),Vn,gB,J1=Je(()=>{Vn=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${e}-component is not supported.`)}},gB=e=>`
1058      ${e?"value = value + getBiasByOutputCoords(coords);":""}
1059      `}),yB,gne=Je(()=>{yB=e=>`
1060fn getIndexFromCoords4D(coords : vec4<i32>, shape : vec4<i32>) -> i32 {
1061  return dot(coords, vec4<i32>(
1062      shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));
1063}
1064fn getOutputIndexFromCoords(coords : vec4<i32>) -> i32 {
1065  return dot(coords, vec4<i32>(
1066    i32(${e}.x), i32(${e}.y), i32(${e}.z), 1));
1067}
1068`}),zp,Z1,X1=Je(()=>{Mt(),Rt(),Ft(),_c(),zp=(e,t,r,n,s)=>{let a=n-r;return`
1069      ${Array.from({length:r}).map((i,l)=>`
1070      if (${mt(t.shape,l,t.rank)} != 1) {
1071        ${t.indicesSet(e,l,mt(s,l+a,n))}
1072      } else {
1073        ${t.indicesSet(e,l,0)}
1074      }`).join("")}
1075`},Z1=(e,t,r,n,s=!1,a)=>{let i=e[0].dims,l=e[1].dims,c=i[i.length-2],d=l[l.length-1],p=i[i.length-1],u=Wr(d),h=Wr(p),f=Wr(c),m=Ce.size(r)/u/f,v=e.length>2,k=n?n.slice(0,-2):r.slice(0,-2),y=[Ce.size(k),c,d],g=[{type:12,data:m},{type:12,data:c},{type:12,data:d},{type:12,data:p}];uc(t,g),g.push(...vt(k,i,l)),v&&g.push(...vt(e[2].dims)),g.push(...vt(y));let _=w=>{let x=q1("batch_dims",e[0].dataType,k.length),b=De("a",e[0].dataType,i.length,h),M=De("b",e[1].dataType,l.length,u),S=ut("output",e[0].dataType,y.length,u),j=Dn(S.type.tensor),I=dc(t,S.type.value,j),q=[b,M],U="";if(v){let H=s?u:1;q.push(De("bias",e[2].dataType,e[2].dims.length,H)),U=`${s?`value += bias[col / ${H}];`:`value += ${S.type.value}(bias[row + i]);`}`}let R=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"}];pc(t,R);let K=()=>{let H=`var a_data: ${b.type.value};`;for(let ee=0;ee<h;ee++)H+=`
1076              let b_data${ee} = b[(b_offset + (k + ${ee}) * uniforms.N + col) / ${u}];`;for(let ee=0;ee<f;ee++){H+=`a_data = a[(a_offset + (row + ${ee}) * uniforms.K + k) / ${h}];`;for(let te=0;te<h;te++)H+=`
1077            values[${ee}] = fma(${M.type.value}(a_data${h===1?"":`[${te}]`}), b_data${te}, values[${ee}]);
1078`}return H};return`
1079  ${w.registerUniforms(R).registerInternalVariables(x).declareVariables(...q,S)}
1080  ${w.mainStart()}
1081    ${w.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1082    let col = (global_idx % (uniforms.N / ${u})) * ${u};
1083    var index1 = global_idx / (uniforms.N / ${u});
1084    let stride1 = uniforms.M / ${f};
1085    let row = (index1 % stride1) * ${f};
1086    let batch = index1 / stride1;
1087
1088    ${r.length===2?"":`let batch_indices = ${x.offsetToIndices("batch")};`}
1089
1090    var a_indices: ${b.type.indices};
1091    ${zp("a_indices",b,b.rank-2,x.rank,"batch_indices")}
1092    ${b.indicesSet("a_indices",b.rank-2,0)}
1093    ${b.indicesSet("a_indices",b.rank-1,0)}
1094    let a_offset = ${b.indicesToOffset("a_indices")};
1095
1096    var b_indices: ${M.type.indices};
1097    ${zp("b_indices",M,M.rank-2,x.rank,"batch_indices")}
1098    ${M.indicesSet("b_indices",M.rank-2,0)}
1099    ${M.indicesSet("b_indices",M.rank-1,0)}
1100    let b_offset = ${M.indicesToOffset("b_indices")};
1101    var values: array<${S.type.value}, ${f}>;
1102    for (var k: u32 = 0u; k < uniforms.K; k = k + ${h}) {
1103      ${K()}
1104    }
1105    for (var i = 0u; i < ${f}u; i++) {
1106      var value = values[i];
1107      ${U}
1108      ${I}
1109      let cur_indices = ${S.type.indices}(batch, row + i, col);
1110      let offset = ${S.indicesToOffset("cur_indices")};
1111      ${S.setByOffset(`offset / ${u}`,"value")};
1112    }
1113  }
1114  `};return{name:"MatMulNaive",shaderCache:{hint:`${t.activation};${u};${h};${f};${s}`,inputDependencies:v?["rank","rank","rank"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:a?a(r):r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:g}),getShaderSource:_}}
vendor: 9,185 bytes, lines 1114-1319
1114}),Xj,eI,Vb,Aw,tI,Gb,rI,qg,ek=Je(()=>{Mt(),Rt(),Ft(),_c(),X1(),J1(),Xj=(e,t)=>e?`
1115        mm_Asub[inputRow][inputCol] = mm_readA(batch,
1116          kStart + inputRow,
1117          globalRowStart / innerElementSize + inputCol${t?", batchIndices":""});
1118        `:`
1119        mm_Asub[inputRow][inputCol] = mm_readA(batch,
1120          globalRow + innerRow,
1121          kStart / innerElementSize + inputCol${t?", batchIndices":""});
1122        `,eI=(e,t)=>e?`
1123        let ACached0 = mm_Asub[k * innerElementSize][localRow];
1124        let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];
1125        let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];
1126        ${t===3?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"}
1127        for (var i = 0; i < rowPerThread; i = i + 1) {
1128          acc[i] = BCached0 * ACached0[i] + acc[i];
1129          acc[i] = BCached1 * ACached1[i] + acc[i];
1130          acc[i] = BCached2 * ACached2[i] + acc[i];
1131          ${t===3?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"}
1132        }`:`
1133        for (var i = 0; i < rowPerThread; i = i + 1) {
1134          let ACached = mm_Asub[tileRow + i][k];
1135          acc[i] = BCached0 * ACached.x + acc[i];
1136          acc[i] = BCached1 * ACached.y + acc[i];
1137          acc[i] = BCached2 * ACached.z + acc[i];
1138          ${t===3?"":"acc[i] = BCached3 * ACached.w + acc[i];"}
1139        }`,Vb=(e,t,r="f32",n,s=!1,a=32,i=!1,l=32)=>{let c=t[1]*e[1],d=t[0]*e[0],p=s?c:a,u=s?a:c,h=p/t[0],f=a/t[1];if(!((s&&h===4&&e[1]===4||!s&&(h===3||h===4))&&p%t[0]===0&&a%t[1]===0&&e[0]===4))throw new Error(`If transposeA ${s} is true, innerElementSize ${h} and workPerThread[1] ${e[1]} must be 4.
1140      Otherwise, innerElementSize ${h} must be 3 or 4.
1141  tileAWidth ${p} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return`
1142var<workgroup> mm_Asub: array<array<vec${h}<${r}>, ${p/h}>, ${u}>;
1143var<workgroup> mm_Bsub: array<array<vec4<${r}>, ${d/e[0]}>, ${a}>;
1144
1145const rowPerThread = ${e[1]};
1146const colPerThread = ${e[0]};
1147const innerElementSize = ${h};
1148const tileInner = ${a};
1149
1150@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})
1151fn main(@builtin(local_invocation_id) localId : vec3<u32>,
1152        @builtin(global_invocation_id) globalId : vec3<u32>,
1153        @builtin(workgroup_id) workgroupId : vec3<u32>) {
1154  let localRow = i32(localId.y);
1155  let tileRow = localRow * rowPerThread;
1156  let tileCol = i32(localId.x);
1157
1158  let globalRow =i32(globalId.y) * rowPerThread;
1159  let globalCol = i32(globalId.x);
1160  let batch = ${i?"0":"i32(globalId.z)"};
1161  ${n?`let batchIndices = ${n.offsetToIndices("u32(batch)")};`:""}
1162  let globalRowStart = i32(workgroupId.y) * ${c};
1163
1164  let num_tiles = ${i?`${Math.ceil(l/a)}`:"(uniforms.dim_inner - 1) / tileInner + 1"};
1165  var kStart = ${i?`i32(globalId.z) * ${l}`:"0"};
1166
1167  var acc: array<vec4<${r}>, rowPerThread>;
1168
1169  // Loop over shared dimension.
1170  let tileRowB = localRow * ${f};
1171  for (var t = 0; t < num_tiles; t = t + 1) {
1172      // Load one tile of A into local memory.
1173      for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1174          let inputRow = tileRow + innerRow;
1175          let inputCol = tileCol;
1176          ${Xj(s,n)}
1177      }
1178
1179      // Load one tile of B into local memory.
1180      for (var innerRow = 0; innerRow < ${f}; innerRow = innerRow + 1) {
1181          let inputRow = tileRowB + innerRow;
1182          let inputCol = tileCol;
1183          mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${n?", batchIndices":""});
1184      }
1185      kStart = kStart + tileInner;
1186      workgroupBarrier();
1187
1188      // Compute acc values for a single thread.
1189      for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {
1190          let BCached0 = mm_Bsub[k * innerElementSize][tileCol];
1191          let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];
1192          let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];
1193          ${h===3?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"}
1194
1195          ${eI(s,h)}
1196      }
1197
1198      workgroupBarrier();
1199  }
1200
1201  for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1202      mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);
1203  }
1204}`},Aw=(e,t)=>e?`
1205            mm_Asub[inputRow][inputCol] = mm_readA(batch,
1206              kStart + inputRow,
1207              globalRowStart + inputCol${t?", batchIndices":""});
1208            `:`
1209            mm_Asub[inputRow][inputCol] = mm_readA(batch,
1210              globalRowStart + inputRow,
1211              kStart + inputCol${t?", batchIndices":""});
1212            `,tI=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];",Gb=(e,t,r="f32",n,s=!1,a=32,i=!1,l=32,c=!1)=>{let d=e[1]*t[1],p=e[0]*t[0],u=s?d:a,h=s?a:d;if(!(h%t[1]===0&&u%t[0]===0&&a%t[1]===0))throw new Error(`tileAHight ${h} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let f=h/t[1],m=u/t[0],v=a/t[1],k=c?`
1213    let localRow = i32(localId.y);
1214    let localCol = i32(localId.x);
1215    let globalRowStart = i32(workgroupId.y) * ${d};
1216    let globalColStart = i32(workgroupId.x) * ${p};
1217
1218    // Loop over shared dimension.
1219    for (var t = 0; t < num_tiles; t = t + 1) {
1220      // Load one tile of A into local memory.
1221      for (var inputRow = localRow; inputRow < ${h}; inputRow = inputRow + ${t[1]}) {
1222        for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) {
1223          ${Aw(s,n)}
1224        }
1225      }
1226      // Load one tile of B into local memory.
1227      for (var inputRow = localRow; inputRow < ${a}; inputRow = inputRow + ${t[1]}) {
1228            for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${t[0]}) {
1229          mm_Bsub[inputRow][inputCol] = mm_readB(batch,
1230            kStart + inputRow,
1231            globalColStart + inputCol${n?", batchIndices":""});
1232        }
1233      }
1234      kStart = kStart + tileInner;
1235      workgroupBarrier();
1236
1237      // Compute acc values for a single thread.
1238      var BCached : array<${r}, colPerThread>;
1239      for (var k = 0; k < tileInner; k = k + 1) {
1240        for (var inner = 0; inner < colPerThread; inner = inner + 1) {
1241          BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}];
1242        }
1243        for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1244          let ACached = ${s?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`}
1245          for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {
1246            acc[innerRow][innerCol] = acc[innerRow][innerCol] +
1247                ACached * BCached[innerCol];
1248          }
1249        }
1250      }
1251      workgroupBarrier();
1252    }
1253    for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1254      let gRow = globalRowStart + localRow + innerRow * ${t[1]};
1255      for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {
1256        let gCol = globalColStart + localCol + innerCol * ${t[0]};
1257        mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);
1258      }
1259    }
1260    `:`
1261let tileRow = i32(localId.y) * rowPerThread;
1262let tileCol = i32(localId.x) * colPerThread;
1263
1264let globalRow = i32(globalId.y) * rowPerThread;
1265let globalCol = i32(globalId.x) * colPerThread;
1266let globalRowStart = i32(workgroupId.y) * ${d};
1267
1268let tileRowA = i32(localId.y) * ${f};
1269let tileColA = i32(localId.x) * ${m};
1270let tileRowB = i32(localId.y) * ${v};
1271// Loop over shared dimension.
1272for (var t = 0; t < num_tiles; t = t + 1) {
1273  // Load one tile of A into local memory.
1274  for (var innerRow = 0; innerRow < ${f}; innerRow = innerRow + 1) {
1275    for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) {
1276      let inputRow = tileRowA + innerRow;
1277      let inputCol = tileColA + innerCol;
1278      ${Aw(s,n)}
1279    }
1280  }
1281
1282  // Load one tile of B into local memory.
1283  for (var innerRow = 0; innerRow < ${v}; innerRow = innerRow + 1) {
1284    for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {
1285      let inputRow = tileRowB + innerRow;
1286      let inputCol = tileCol + innerCol;
1287      mm_Bsub[inputRow][inputCol] = mm_readB(batch,
1288        kStart + inputRow,
1289        globalCol + innerCol${n?", batchIndices":""});
1290    }
1291  }
1292  kStart = kStart + tileInner;
1293  workgroupBarrier();
1294
1295  // Compute acc values for a single thread.
1296  var BCached : array<${r}, colPerThread>;
1297  for (var k = 0; k < tileInner; k = k + 1) {
1298    for (var inner = 0; inner < colPerThread; inner = inner + 1) {
1299      BCached[inner] = mm_Bsub[k][tileCol + inner];
1300    }
1301
1302    for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1303      ${tI(s)}
1304      for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {
1305        acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];
1306      }
1307    }
1308  }
1309
1310  workgroupBarrier();
1311}
1312
1313for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {
1314  for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {
1315    mm_write(batch, globalRow + innerRow, globalCol + innerCol,
1316        acc[innerRow][innerCol]);
1317  }
1318}
1319`;return`
1320  var<workgroup> mm_Asub : array<array<${r}, ${u}>, ${h}>;
1321  var<workgroup> mm_Bsub : array<array<${r}, ${p}>, ${a}>;
1322  const rowPerThread = ${e[1]};
1323  const colPerThread = ${e[0]};
1324  const tileInner = ${a};
1325
1326@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]})
1327fn main(@builtin(local_invocation_id) localId : vec3<u32>,
1328        @builtin(global_invocation_id) globalId : vec3<u32>,
1329        @builtin(workgroup_id) workgroupId : vec3<u32>) {
1330    let batch = ${i?"0":"i32(globalId.z)"};
1331    ${n?`let batchIndices = ${n.offsetToIndices("u32(batch)")};`:""}
1332    let num_tiles = ${i?`${Math.ceil(l/a)}`:"(uniforms.dim_inner - 1) / tileInner + 1"};
1333    var kStart = ${i?`i32(globalId.z) * ${l}`:"0"};
1334
1335    var acc : array<array<${r}, colPerThread>, rowPerThread>;
1336    ${k}
1337  }
1338`},rI=(e,t,r,n,s=!1)=>{let[a,i,l,c]=n,d=Dn(n[0].type.tensor);return`
1339    fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${Vn(e,d)} {
1340      var value = ${Vn(e,d)}(0.0);
1341      let col = colIn * ${e};
1342      if(row < uniforms.dim_a_outer && col < uniforms.dim_inner)
1343      {
1344        var aIndices: ${i.type.indices};
1345        ${zp("aIndices",i,i.rank-2,a.rank,"batchIndices")}
1346        ${i.indicesSet("aIndices",i.rank-2,"u32(row)")}
1347        ${i.indicesSet("aIndices",i.rank-1,"u32(colIn)")}
1348        value = ${i.getByIndices("aIndices")};
1349      }
1350      return value;
1351    }
1352
1353    fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${Vn(e,d)} {
1354      var value = ${Vn(e,d)}(0.0);
1355      let col = colIn * ${e};
1356      if(row < uniforms.dim_inner && col < uniforms.dim_b_outer)
1357      {
1358        var bIndices: ${l.type.indices};
1359        ${zp("bIndices",l,l.rank-2,a.rank,"batchIndices")}
1360        ${l.indicesSet("bIndices",l.rank-2,"u32(row)")}
1361        ${l.indicesSet("bIndices",l.rank-1,"u32(colIn)")}
1362        value = ${l.getByIndices("bIndices")};
1363      }
1364      return value;
1365    }
1366
1367    fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${Vn(e,d)}) {
1368      let col = colIn * ${e};
1369      if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {
1370        var value = valueIn;
1371        let coords = vec3<i32>(batch, row, colIn);
1372        ${t?`value = value + ${s?"bias[colIn]":`${Vn(e,d)}(bias[row])`};`:""}
1373        ${r}
1374        ${c.setByIndices("vec3<u32>(coords)","value")}
1375      }
1376    }
1377    `},qg=(e,t,r,n,s=!1,a)=>{let i=e[0].dims,l=e[1].dims,c=i.slice(0,-2),d=l.slice(0,-2),p=n?n.slice(0,-2):r.slice(0,-2),u=Ce.size(p),h=i[i.length-2],f=i[i.length-1],m=l[l.length-1],v=f%4===0&&m%4===0,k=h<=8?[4,1,1]:[4,4,1],y=[8,8,1],g=[Math.ceil(m/y[0]/k[0]),Math.ceil(h/y[1]/k[1]),Math.ceil(u/y[2]/k[2])],_=v?4:1,w=[...c,h,f/_],x=w.length,b=[...d,f,m/_],M=b.length,S=[u,h,m/_],j=[{type:6,data:h},{type:6,data:m},{type:6,data:f}];uc(t,j),j.push(...vt(p,w,b));let I=["rank","rank"],q=e.length>2;q&&(j.push(...vt(e[2].dims)),I.push("rank")),j.push(...vt(S));let U=R=>{let K=p.length,H=q1("batchDims",e[0].dataType,K,1),ee=Dn(e[0].dataType),te=De("a",e[0].dataType,x,_),V=De("b",e[1].dataType,M,_),ae=ut("result",e[0].dataType,S.length,_),ne=[te,V];if(q){let _e=s?_:1;ne.push(De("bias",e[2].dataType,e[2].dims.length,_e))}let L=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"}];pc(t,L);let $=Dn(ae.type.tensor),G=dc(t,ae.type.value,$),se=rI(_,q,G,[H,te,V,ae],s);return`
1378  ${R.registerUniforms(L).registerInternalVariables(H).declareVariables(...ne,ae)}
1379  ${se}
1380  ${v?Vb(k,y,ee,H):Gb(k,y,ee,H)}
1381                   `};return{name:"MatMul",shaderCache:{hint:`${k};${t.activation};${v};${s}`,inputDependencies:I},getRunData:()=>({outputs:[{dims:a?a(r):r,dataType:e[0].dataType}],dispatchGroup:{x:g[0],y:g[1],z:g[2]},programUniforms:j}),getShaderSource:U}}}),nI,vB,yne=Je(()=>{Mt(),Ji(),Ft(),_c(),J1(),gne(),ek(),nI=(e,t,r,n,s=!1,a,i=4,l=4,c=4,d="f32")=>{let p=j=>{switch(j){case 1:return"resData = x[xIndex];";case 3:return`resData = vec3<${d}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${j} is not supported.`)}},u=j=>{switch(j){case 1:return"return w[row * i32(uniforms.w_shape[3]) + colIn];";case 4:return"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];";default:throw new Error(`innerElementSize ${j} is not supported.`)}},h=e?`
1382    let coord = vec4<i32>(batch, xRow, xCol, xCh);
1383    `:`
1384    let coord = vec4<i32>(batch, xCh, xRow, xCol);
1385    `,f=e?`
1386    let coords = vec4<i32>(
1387      batch,
1388      row / outWidth,
1389      row % outWidth,
1390      col);
1391    `:`
1392    let coords = vec4<i32>(
1393      batch,
1394      row,
1395      col / outWidth,
1396      col % outWidth);
1397    `,m=e?"i32(uniforms.x_shape[1])":"i32(uniforms.x_shape[2])",v=e?"i32(uniforms.x_shape[2])":"i32(uniforms.x_shape[3])",k=e?"row":"col",y=e?"col":"row",g=`
1398    let inChannels = i32(uniforms.w_shape[2]);
1399    let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"};
1400    let outRow = ${k} / outWidth;
1401    let outCol = ${k} % outWidth;
1402
1403    let WRow = ${y} / (i32(uniforms.w_shape[1]) * inChannels);
1404    let WCol = ${y} / inChannels % i32(uniforms.w_shape[1]);
1405    let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0];
1406    let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1];
1407    let xCh = ${y} % inChannels;
1408    var resData = ${Vn(i,d)}(0.0);
1409    // The bounds checking is always needed since we use it to pad zero for
1410    // the 'same' padding type.
1411    if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${v}) {
1412      ${h}
1413      let xIndex = getIndexFromCoords4D(coord, vec4<i32>(uniforms.x_shape));
1414      ${p(i)}
1415    }
1416    return resData;`,_=e?t&&n?`
1417    let col = colIn * ${i};
1418    ${g}`:`
1419    let col = colIn * ${i};
1420    if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {
1421      ${g}
1422    }
1423    return ${Vn(i,d)}(0.0);`:n&&r?`
1424    let col = colIn * ${i};
1425    ${g}`:`
1426    let col = colIn * ${i};
1427    if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {
1428      ${g}
1429    }
1430    return ${Vn(i,d)}(0.0);`,w=e?n&&r?u(l):`
1431    let col = colIn * ${l};
1432    if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {
1433      ${u(l)}
1434    }
1435    return ${Vn(l,d)}(0.0);`:`
1436    let col = colIn * ${l};
1437    if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) {
1438      ${u(l)}
1439    }
1440    return ${Vn(l,d)}(0.0);`,x=Vn(c,d),b=Vn(e?i:l,d),M=Vn(e?l:i,d),S=dc(a,x,d);return`
1441    fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${b} {
1442      ${e?_:w}
1443    }
1444
1445    fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${M} {
1446      ${e?w:_}
1447    }
1448
1449    fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${x}) {
1450      let col = colIn * ${c};
1451      if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer)
1452      {
1453      var value = valueIn;
1454      let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"};
1455      ${f}
1456      ${gB(s)}
1457      ${S}
1458      setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);
1459      }
1460    }`},vB=(e,t,r,n,s,a,i,l,c)=>{let d=t.format==="NHWC",p=d?e[0].dims[3]:e[0].dims[1],u=r[0],h=d?r[2]:r[3],f=d?r[1]:r[2],m=d?r[3]:r[1],v=d&&(p%4===0||p%3===0)&&m%4===0,k=d?m:h*f,y=d?h*f:m,g=[8,8,1],_=n<=8?[4,1,1]:[4,4,1],w=[Math.ceil(k/g[0]/_[0]),Math.ceil(y/g[1]/_[1]),Math.ceil(u/g[2]/_[2])];Yt("verbose",()=>`[conv2d_mm_webgpu] dispatch = ${w}`);let x=v?d&&p%4!==0?3:4:1,b=g[1]*_[1],M=g[0]*_[0],S=Math.max(g[0]*x,g[1]),j=n%b===0,I=s%M===0,q=a%S===0,U=v?[x,4,4]:[1,1,1],R=[{type:6,data:n},{type:6,data:s},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];uc(t,R),R.push(...vt(e[0].dims,e[1].dims));let K=["rank","rank"];i&&(R.push(...vt(e[2].dims)),K.push("rank")),R.push(...vt(r));let H=ee=>{let te=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"},{name:"pad",type:"i32",length:2},{name:"stride",type:"i32",length:2},{name:"dilation",type:"i32",length:2}];pc(t,te);let V=v?4:1,ae=Dn(e[0].dataType),ne=`
1461      fn setOutputAtIndex(flatIndex : i32, value : ${v?`vec4<${ae}>`:ae}) {
1462        result[flatIndex] = ${v?`vec4<${ae}>`:ae}(value);
1463      }
1464      fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${v?`vec4<${ae}>`:ae}) {
1465        let flatIndex = getOutputIndexFromCoords(vec4<i32>(d0, d1, d2, d3));
1466        setOutputAtIndex(flatIndex ${v?"/ 4":""}, value);
1467      }`,L=De("x",e[0].dataType,e[0].dims.length,x===3?1:x),$=De("w",e[1].dataType,e[1].dims.length,V),G=[L,$],se=ut("result",e[0].dataType,r.length,V);if(i){let _e=De("bias",e[2].dataType,e[2].dims.length,V);G.push(_e),ne+=`
1468        fn getBiasByOutputCoords(coords : vec4<i32>) -> ${v?`vec4<${ae}>`:ae} {
1469          return bias[coords.${d?"w":"y"}${v?"/ 4":""}];
1470        }`}return`
1471        ${yB("uniforms.result_strides")}
1472        //struct Uniforms { xShape : vec4<i32>, wShape : vec4<i32>, outShape : vec4<i32>,
1473        //  outShapeStrides: vec3<i32>, filterDims : vec2<i32>, pad : vec2<i32>, stride : vec2<i32>,
1474        //  dilation : vec2<i32>, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };
1475        ${ee.registerUniforms(te).declareVariables(...G,se)}
1476        ${ne}
1477        ${nI(d,j,I,q,i,t,U[0],U[1],U[2],ae)}
1478        ${v?Vb(_,g,ae,void 0,!d,S):Gb(_,g,ae,void 0,!d,S,!1,void 0,l)}`};return{name:"Conv2DMatMul",shaderCache:{hint:`${t.cacheKey};${x};${v};${j};${I};${q};${b};${M};${S}`,inputDependencies:K},getRunData:()=>({outputs:[{dims:c?c(r):r,dataType:e[0].dataType}],dispatchGroup:{x:w[0],y:w[1],z:w[2]},programUniforms:R}),getShaderSource:H}}}),sI,Pw,cp,aI,Cw,iI,_B,wB,vne=Je(()=>{Mt(),Ji(),Rt(),Ft(),_c(),J1(),sI=e=>{let t=1;for(let r=0;r<e.length;r++)t*=e[r];return t},Pw=e=>typeof e=="number"?[e,e,e]:e,cp=(e,t)=>t<=1?e:e+(e-1)*(t-1),aI=(e,t,r,n=1)=>{let s=cp(t,n);return Math.floor((e[0]*(r-1)-r+s)/2)},Cw=(e,t,r,n,s)=>{s==null&&(s=aI(e,t[0],n[0]));let a=[0,0,0,r];for(let i=0;i<3;i++)e[i]+2*s>=t[i]&&(a[i]=Math.trunc((e[i]-t[i]+2*s)/n[i]+1));return a},iI=(e,t,r,n,s,a,i,l,c,d)=>{let p,u,h,f;if(e==="VALID"&&(e=0),typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=Cw([t,r,n,1],[l,c,d],1,[s,a,i],e);u=m[0],h=m[1],f=m[2]}else if(Array.isArray(e)){if(!e.every((v,k,y)=>v===y[0]))throw Error(`Unsupported padding parameter: ${e}`);p={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=Cw([t,r,n,1],[l,c,d],1,[s,a,i],e[0]);u=m[0],h=m[1],f=m[2]}else if(e==="SAME_UPPER"){u=Math.ceil(t/s),h=Math.ceil(r/a),f=Math.ceil(n/i);
vendor: 4,687 bytes, lines 1478-1529
1478let m=(u-1)*s+l-t,v=(h-1)*a+c-r,k=(f-1)*i+d-n,y=Math.floor(m/2),g=m-y,_=Math.floor(v/2),w=v-_,x=Math.floor(k/2),b=k-x;p={top:_,bottom:w,left:x,right:b,front:y,back:g}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:u,outHeight:h,outWidth:f}},_B=(e,t,r,n,s,a=!1,i="channelsLast")=>{let l,c,d,p,u;if(i==="channelsLast")[l,c,d,p,u]=e;else if(i==="channelsFirst")[l,u,c,d,p]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,,f,m,v]=t,[k,y,g]=Pw(r),[_,w,x]=Pw(n),b=cp(f,_),M=cp(m,w),S=cp(v,x),{padInfo:j,outDepth:I,outHeight:q,outWidth:U}=iI(s,c,d,p,k,y,g,b,M,S),R=a?h*u:h,K=[0,0,0,0,0];return i==="channelsFirst"?K=[l,R,I,q,U]:i==="channelsLast"&&(K=[l,I,q,U,R]),{batchSize:l,dataFormat:i,inDepth:c,inHeight:d,inWidth:p,inChannels:u,outDepth:I,outHeight:q,outWidth:U,outChannels:R,padInfo:j,strideDepth:k,strideHeight:y,strideWidth:g,filterDepth:f,filterHeight:m,filterWidth:v,effectiveFilterDepth:b,effectiveFilterHeight:M,effectiveFilterWidth:S,dilationDepth:_,dilationHeight:w,dilationWidth:x,inShape:e,outShape:K,filterShape:t}},wB=(e,t,r,n,s,a)=>{let i=a==="channelsLast";i?e[0].dims[3]:e[0].dims[1];let l=[64,1,1],c={x:r.map((k,y)=>y)},d=[Math.ceil(sI(c.x.map(k=>r[k]))/l[0]),1,1];Yt("verbose",()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let p=1,u=Ce.size(r),h=[{type:12,data:u},{type:12,data:n},{type:12,data:s},{type:12,data:t.strides},{type:12,data:t.dilations}];uc(t,h),h.push(...vt(e[0].dims,e[1].dims));let f=["rank","rank"],m=e.length===3;m&&(h.push(...vt(e[2].dims)),f.push("rank")),h.push(...vt(r));let v=k=>{let y=[{name:"output_size",type:"u32"},{name:"filter_dims",type:"u32",length:n.length},{name:"pads",type:"u32",length:s.length},{name:"strides",type:"u32",length:t.strides.length},{name:"dilations",type:"u32",length:t.dilations.length}];pc(t,y);let g=1,_=Dn(e[0].dataType),w=De("x",e[0].dataType,e[0].dims.length,p),x=De("W",e[1].dataType,e[1].dims.length,g),b=[w,x],M=ut("result",e[0].dataType,r.length,g),S="";if(m){let q=De("bias",e[2].dataType,e[2].dims.length,g);b.push(q),S+=`
1479        fn getBiasByOutputCoords(coords : array<u32, 5>) -> ${_} {
1480          return bias[${i?mt("coords",4,5):mt("coords",1,5)}];
1481        }`}let j=Vn(p,_),I=dc(t,j,_);return`
1482            ${S}
1483            fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 {
1484              let aIndices = array<u32, 5>(d0, d1, d2, d3, d4);
1485              return ${w.getByIndices("aIndices")};
1486            }
1487            fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 {
1488              let aIndices = array<u32, 5>(d0, d1, d2, d3, d4);
1489              return ${x.getByIndices("aIndices")};
1490            }
1491          ${k.registerUniforms(y).declareVariables(...b,M)}
1492          ${k.mainStart()}
1493          ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1494              let coords = ${M.offsetToIndices("global_idx")};
1495              let batch = ${mt("coords",0,w.rank)};
1496              let d2 = ${i?mt("coords",w.rank-1,w.rank):mt("coords",1,w.rank)};
1497              let xFRCCorner = vec3<u32>(${i?mt("coords",1,w.rank):mt("coords",2,w.rank)},
1498              ${i?mt("coords",2,w.rank):mt("coords",3,w.rank)},
1499              ${i?mt("coords",3,w.rank):mt("coords",4,w.rank)}) * uniforms.strides - uniforms.pads;
1500              let xFCorner = xFRCCorner.x;
1501              let xRCorner = xFRCCorner.y;
1502              let xCCorner = xFRCCorner.z;
1503              let xShapeY = ${i?mt("uniforms.x_shape",1,w.rank):mt("uniforms.x_shape",2,w.rank)};
1504              let xShapeZ = ${i?mt("uniforms.x_shape",2,w.rank):mt("uniforms.x_shape",3,w.rank)};
1505              let xShapeW = ${i?mt("uniforms.x_shape",3,w.rank):mt("uniforms.x_shape",4,w.rank)};
1506              let xShapeU = ${i?mt("uniforms.x_shape",4,w.rank):mt("uniforms.x_shape",1,w.rank)};
1507              let inputDepthNearestVec4 = (xShapeU / 4) * 4;
1508              let inputDepthVec4Remainder = xShapeU % 4;
1509
1510              var value = 0.0;
1511              for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) {
1512                let xF = xFCorner + wF * uniforms.dilations[0];
1513                if (xF < 0 || xF >= xShapeY) {
1514                  continue;
1515                }
1516
1517                for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) {
1518                  let xR = xRCorner + wR * uniforms.dilations[1];
1519                  if (xR < 0 || xR >= xShapeZ) {
1520                    continue;
1521                  }
1522
1523                  for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) {
1524                    let xC = xCCorner + wC * uniforms.dilations[2];
1525                    if (xC < 0 || xC >= xShapeW) {
1526                      continue;
1527                    }
1528
1529                    for (var d1 = 0u;
1529 d1 < inputDepthNearestVec4; d1 += 4) {
1530                      ${i?`let xValues = vec4<f32>(
1531                               getX(batch, xF, xR, xC, d1),
1532                               getX(batch, xF, xR, xC, d1 + 1),
1533                               getX(batch, xF, xR, xC, d1 + 2),
1534                               getX(batch, xF, xR, xC, d1 + 3));
1535                            `:`let xValues = vec4<f32>(
1536                               getX(batch, d1, xF, xR, xC),
1537                               getX(batch, d1 + 1, xF, xR, xC),
1538                               getX(batch, d1 + 2, xF, xR, xC),
1539                               getX(batch, d1 + 3, xF, xR, xC));
1540                            `}
1541                            let wValues = vec4<f32>(
1542                              getW(d2, d1, wF, wR, wC),
1543                              getW(d2, d1 + 1, wF, wR, wC),
1544                              getW(d2, d1 + 2, wF, wR, wC),
1545                              getW(d2, d1 + 3, wF, wR, wC));
1546                      value += dot(xValues, wValues);
1547                    }
1548                    if (inputDepthVec4Remainder == 1) {
1549                        ${i?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4)
1550                          * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC)
1551                          * getW(d2, inputDepthNearestVec4, wF, wR, wC);`}
1552                    } else if (inputDepthVec4Remainder == 2) {
1553                      ${i?`let xValues = vec2<f32>(
1554                        getX(batch, xF, xR, xC, inputDepthNearestVec4),
1555                        getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1));
1556                      `:`let xValues = vec2<f32>(
1557                        getX(batch, inputDepthNearestVec4, xF, xR, xC),
1558                        getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC));
1559                    `}
1560                    let wValues = vec2<f32>(
1561                      getW(d2, inputDepthNearestVec4, wF, wR, wC),
1562                      getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC));
1563                      value += dot(xValues, wValues);
1564                    } else if (inputDepthVec4Remainder == 3) {
1565                      ${i?`let xValues = vec3<f32>(
1566                        getX(batch, xF, xR, xC, inputDepthNearestVec4),
1567                        getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1),
1568                        getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2));
1569                      `:`let xValues = vec3<f32>(
1570                        getX(batch, inputDepthNearestVec4, xF, xR, xC),
1571                        getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC),
1572                        getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC));
1573                    `}
1574                    let wValues = vec3<f32>(
1575                      getW(d2, inputDepthNearestVec4, wF, wR, wC),
1576                      getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC),
1577                      getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC));
1578                      value += dot(xValues, wValues);
1579                    }
1580                  }
1581                }
1582              }
1583              ${m?"value = value + getBiasByOutputCoords(coords)":""};
1584              ${I}
1585              result[global_idx] = f32(value);
1586          }`};return{name:"Conv3DNaive",shaderCache:{hint:`${t.cacheKey};${i};${p};${m}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:h}),getShaderSource:v}}}),xB,bB,_ne=Je(()=>{Mt(),Rt(),Ft(),_c(),xB=(e,t,r,n)=>{let s=e.length>2,a=s?"value += b[output_channel];":"",i=e[0].dims,l=e[1].dims,c=t.format==="NHWC",d=c?r[3]:r[1],p=d/t.group,u=c&&p>=4?Wr(d):1,h=Ce.size(r)/u,f=[{type:12,data:h},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:p}];uc(t,f),f.push(...vt(i,[l[0],l[1],l[2],l[3]/u]));let m=s?["rank","rank","rank"]:["rank","rank"];f.push(...vt([r[0],r[1],r[2],r[3]/u]));let v=k=>{let y=ut("output",e[0].dataType,r.length,u),g=Dn(y.type.tensor),_=dc(t,y.type.value,g),w=De("x",e[0].dataType,i.length),x=De("w",e[1].dataType,l.length,u),b=[w,x];s&&b.push(De("b",e[2].dataType,e[2].dims,u));let M=[{name:"output_size",type:"u32"},{name:"dilations",type:"u32",length:t.dilations.length},{name:"strides",type:"u32",length:2},{name:"pads",type:"u32",length:2},{name:"output_channels_per_group",type:"u32"}];pc(t,M);let S=c?`
1587      for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) {
1588        let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];
1589
1590        if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) {
1591          continue;
1592        }
1593
1594        for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) {
1595          let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];
1596          if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) {
1597            continue;
1598          }
1599
1600          for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) {
1601            let input_channel = in_channel_offset + wInChannel;
1602            let xVal = ${w.get("batch","xHeight","xWidth","input_channel")};
1603            let wVal = ${x.get("wHeight","wWidth","wInChannel","output_channel")};
1604            value += xVal * wVal;
1605          }
1606        }
1607      }
1608      `:`
1609      for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) {
1610        let input_channel = in_channel_offset + wInChannel;
1611        for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) {
1612          let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];
1613
1614          if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) {
1615            continue;
1616          }
1617
1618          for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) {
1619            let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];
1620            if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) {
1621              continue;
1622            }
1623
1624            let xVal = ${w.get("batch","input_channel","xHeight","xWidth")};
1625            let wVal = ${x.get("output_channel","wInChannel","wHeight","wWidth")};
1626            value += xVal * wVal;
1627          }
1628        }
1629      }
1630      `;return`
1631  ${k.registerUniforms(M).declareVariables(...b,y)}
1632
1633  ${k.mainStart()}
1634    ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1635
1636    let outputIndices = ${y.offsetToIndices("global_idx")};
1637    let batch: u32 = outputIndices[0];
1638    let output_channel: u32 = outputIndices[${c?3:1}];
1639    let xRCCorner: vec2<u32> = vec2<u32>(outputIndices[${c?1:2}], outputIndices[${c?2:3}]) * uniforms.strides - uniforms.pads;
1640    let group_id: u32 = output_channel * ${u} / uniforms.output_channels_per_group;
1641    var in_channel_offset = group_id * uniforms.w_shape[${c?2:1}];
1642
1643    var value: ${y.type.value} = ${y.type.value}(0);
1644    ${S}
1645    ${a}
1646    ${_}
1647    ${y.setByOffset("global_idx","value")}
1648  }`};
vendor: 5,244 bytes, lines 1648-1693
1648return{name:"GroupedConv",shaderCache:{hint:`${t.cacheKey}_${u}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:n?n(r):r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:f}),getShaderSource:v}},bB=(e,t,r,n)=>{let s=e.length>2,a=Wr(r[3]),i=Wr(r[2]),l=Ce.size(r)/a/i,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],d=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],p=[r[0],r[1],r[2],r[3]/a],u=[{type:12,data:l},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];uc(t,u),u.push(...vt(c,d,p));let h=(i-1)*t.strides[1]+d[1],f=m=>{let v=ut("output",e[0].dataType,p.length,a),k=Dn(v.type.tensor),y=dc(t,v.type.value,k),g=De("x",e[0].dataType,c.length,a),_=De("w",e[1].dataType,d.length,a),w=[g,_];s&&w.push(De("b",e[2].dataType,e[2].dims,a));let x=s?"value += b[output_channel];":"",b=[{name:"output_size",type:"u32"},{name:"strides",type:"i32",length:2},{name:"pads",type:"i32",length:2}];return pc(t,b),`
1649  ${m.registerUniforms(b).declareVariables(...w,v)}
1650  ${m.mainStart()}
1651    ${m.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1652    let width0 = uniforms.output_shape[3];
1653    let output_channel = global_idx % width0;
1654    var index1 = global_idx / width0;
1655    let width1 = uniforms.output_shape[2] / ${i}u;
1656    let col = (index1 % width1) * ${i}u;
1657    index1 = index1 / width1;
1658    let row = index1 % uniforms.output_shape[1];
1659    let batch = index1 / uniforms.output_shape[1];
1660
1661    let x_corner = vec2<i32>(i32(row), i32(col)) * uniforms.strides - uniforms.pads;
1662
1663    var x_vals: array<${g.type.value}, ${h}>;
1664    var values: array<${v.type.value}, ${i}>;
1665    let input_channel = output_channel;
1666    // Use constant instead of uniform can give better performance for w's height/width.
1667    for (var w_height: u32 = 0u; w_height < ${d[0]}; w_height++) {
1668      let x_height = x_corner.x + i32(w_height);
1669      if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) {
1670        for (var i = 0; i < ${h}; i++) {
1671          let x_width = x_corner.y + i;
1672          if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) {
1673            x_vals[i] = ${g.get("batch","u32(x_height)","u32(x_width)","input_channel")};
1674          } else {
1675            x_vals[i] = ${g.type.value}(0);
1676          }
1677        }
1678        for (var w_width: u32 = 0u; w_width < ${d[1]}; w_width++) {
1679          let w_val = ${_.get("w_height","w_width","0","output_channel")};
1680          for (var i = 0u; i < ${i}u; i++) {
1681            values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]);
1682          }
1683        }
1684      }
1685    }
1686
1687    for (var i = 0u; i < ${i}u; i++) {
1688      var value = values[i];
1689      ${x}
1690      ${y}
1691      ${v.set("batch","row","col + i","output_channel","value")};
1692    }
1693  }`};return{name:"GroupedConv-Vectorize",shaderCache:{hint:`${t.cacheKey};${a};${i};${h};${d[0]};${d[1]}`,inputDependencies:s?["rank","rank","type"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:n?n(r):r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:f}}}),oI,wm,lI,xm,qb,jw,cI,dI,Hb,wne=Je(()=>{Rt(),yne(),vne(),ek(),_ne(),_c(),X1(),al(),oI=(e,t,r,n,s,a)=>{let i=e[0],l=e.slice(a?1:2,a?3:4),c=l.length,d=t[0],p=t.slice(2).map((h,f)=>h+(h-1)*(r[f]-1)),u=l.map((h,f)=>h+n[f]+n[f+c]).map((h,f)=>Math.floor((h-p[f]+s[f])/s[f]));return u.splice(0,0,i),u.splice(a?3:1,0,d),u},wm=[2,3,1,0],lI=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length>5)throw new Error("greater than 5D is not supported");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let r=e[0].dims[t.format==="NHWC"?e[0].dims.length-1:1],n=e[1].dims[1]*t.group;if(r!==n)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");let s=e[0].dims.length-2;if(t.dilations.length!==s)throw new Error(`dilations should be ${s}D`);if(t.strides.length!==s)throw new Error(`strides should be ${s}D`);if(t.pads.length!==s*2)throw new Error(`pads should be ${s*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape")},xm=(e,t)=>{let r=e.kernelShape.slice();r.length<t[1].dims.length-2&&r.push(...Array(t[1].dims.length-2-r.length).fill(0));for(let a=2;a<t[1].dims.length;++a)r[a-2]===0&&(r[a-2]=t[1].dims[a]);let n=e.pads.slice();Vg.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,r,n,e.format==="NHWC",e.autoPad);let s=Object.assign({},e);return Object.assign(s,{kernelShape:r,pads:n}),s},qb=e=>{let t=Y1(e),r=e.format,n=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],s=e.dilations,a=e.group,i=e.kernel_shape,l=e.pads,c=e.strides,d=e.w_is_const();return{autoPad:n,format:r,dilations:s,group:a,kernelShape:i,pads:l,strides:c,wIsConst:d,...t,cacheKey:`${e.format};${t.activation};`}},jw=(e,t,r,n)=>{let s=r.format==="NHWC",a=oI(t[0].dims,t[1].dims,r.dilations,r.pads,r.strides,s);if(r.group!==1){let b=[t[0]];if(s){let M=e.kernelCustomData.wT??e.compute(Qs(t[1],wm),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=M),b.pu
vendor: 5,654 bytes, lines 1693-1711
1693sh(M)}else b.push(t[1]);t.length===3&&b.push(t[2]),!e.adapterInfo.isArchitecture("ampere")&&s&&t[1].dims[0]===r.group&&t[1].dims[1]===1&&r.dilations[0]===1&&r.dilations[1]===1?e.compute(bB(b,r,a,n),{inputs:b}):e.compute(xB(b,r,a,n),{inputs:b});return}let i=t.length===3,l=t[0].dims[s?1:2],c=t[0].dims[s?2:3],d=t[0].dims[s?3:1],p=t[1].dims[2],u=t[1].dims[3],h=a[s?1:2],f=a[s?2:3],m=a[s?3:1],v=s&&p===l&&u===c&&r.pads[0]===0&&r.pads[1]===0;if(v||p===1&&u===1&&r.dilations[0]===1&&r.dilations[1]===1&&r.strides[0]===1&&r.strides[1]===1&&r.pads[0]===0&&r.pads[1]===0){let b=a[0],M,S,j,I=[];if(s){let R=e.kernelCustomData.wT??e.compute(Qs(t[1],wm),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];if(r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=R),v){let K=l*c*d;M=t[0].reshape([1,b,K]),S=R.reshape([1,K,m]),j=[1,b,m]}else M=t[0].reshape([b,l*c,d]),S=R.reshape([1,d,m]),j=[b,h*f,m];I.push(M),I.push(S)}else M=t[0].reshape([b,d,l*c]),S=t[1].reshape([1,m,d]),j=[b,m,h*f],I.push(S),I.push(M);i&&I.push(t[2]);let q=j[2],U=I[0].dims[I[0].dims.length-1];q<8&&U<8?e.compute(Z1(I,r,a,j,s,n),{inputs:I}):e.compute(qg(I,r,a,j,s,n),{inputs:I});return}let k=!0,y=e.kernelCustomData.wT??e.compute(Qs(t[1],wm),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=y);let g=[t[0],y];i&&g.push(t[2]);let _=s?h*f:m,w=s?m:h*f,x=p*u*d;e.compute(vB(g,r,a,_,w,x,i,k,n),{inputs:g})},cI=(e,t)=>{let r=t.format==="NHWC",n=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&n.push(e.inputs[2]);let s=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),i=[1].concat(t.dilations),l=[1].concat(t.kernelShape),c=xm({...t,pads:s,strides:a,dilations:i,kernelShape:l},n);jw(e,n,c,d=>r?[d[0],d[2],d[3]]:[d[0],d[1],d[3]])},dI=(e,t,r)=>{let n=r.format==="NHWC"?"channelsLast":"channelsFirst",s=xm(r,t),a=r.autoPad==="NOTSET"?r.pads:r.autoPad,i=_B(t[0].dims,t[1].dims,r.strides,r.dilations,a,!1,n);e.compute(wB(t,s,i.outShape,[i.filterDepth,i.filterHeight,i.filterWidth],[i.padInfo.front,i.padInfo.top,i.padInfo.left],n))},Hb=(e,t)=>{if(lI(e.inputs,t),e.inputs[0].dims.length===3)cI(e,t);else if(e.inputs[0].dims.length===5)dI(e,e.inputs,t);else{let r=xm(t,e.inputs);jw(e,e.inputs,r)}}}),kB,xne=Je(()=>{Mt(),Ji(),Rt(),Ft(),kB=(e,t,r)=>{let n=e.length>2,s=t.outputShape,a=t.format==="NHWC",i=t.group,l=e[1].dims,c=l[2]/i,d=l[3],p=a?Wr(c):1,u=a&&d===1&&c>=4,h=u?Math.floor(c/4)*4:Math.floor(c/p)*p,f=c-h,m=a?Wr(d):1,v=a?d===1?p:m:1,k=Ce.size(s)/m,y=[Math.ceil(k/64),1,1];Yt("verbose",()=>`[conv2d_backprop_webgpu] dispatch = ${y}`);let g=["rank","rank"],_=[t.strides[0],t.strides[1]],w=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],b=[w[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),w[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],M=[b[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),b[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],S=[{type:12,data:k},{type:12,data:_},{type:12,data:w},{type:12,data:x},{type:12,data:b},{type:6,data:M},{type:12,data:h},{type:12,data:c},{type:12,data:d},...vt(e[0].dims,e[1].dims)];n&&(S.push(...vt(e[2].dims)),g.push("rank")),S.push(...vt(s));let j=I=>{let q=[{name:"output_size",type:"u32"},{name:"strides",type:"u32",length:_.length},{name:"filter_dims",type:"u32",length:w.length},{name:"dilations",type:"u32",length:w.length},{name:"effective_filter_dims",type:"u32",length:b.length},{name:"pads",type:"i32",length:M.length},{name:"input_channels_per_group_int",type:"u32"},{name:"input_channels_per_group",type:"u32"},{name:"output_channels_per_group",type:"u32"}],U=Dn(e[0].dataType),R=a?1:2,K=a?2:3,H=a?3:1,ee=De("W",e[1].dataType,e[1].dims.length,v),te=De("Dy",e[0].dataType,e[0].dims.length,p),V=[te,ee];n&&V.push(De("bias",e[2].dataType,[s[H]].length,m));let ae=ut("result",e[0].dataType,s.length,m),ne=()=>{let G="";if(u)p===4?G+=`
1694        let xValue = ${te.getByOffset("x_offset")};
1695        let wValue = ${ee.getByOffset("w_offset")};
1696        dotProd = dotProd + dot(xValue, wValue);
1697        x_offset += 1u;
1698        w_offset += 1u;`:p===2?G+=`
1699          dotProd = dotProd + dot(vec4<${U}>(${te.getByOffset("x_offset")}, ${te.getByOffset("x_offset + 1u")}), vec4<${U}>(${ee.getByOffset("w_offset")}, ${ee.getByOffset("w_offset + 1u")}));
1700          x_offset += 2u;
1701          w_offset += 2u;`:p===1&&(G+=`
1702          dotProd = dotProd + dot(vec4<${U}>(${te.getByOffset("x_offset")}, ${te.getByOffset("x_offset + 1u")}, ${te.getByOffset("x_offset + 2u")}, ${te.getByOffset("x_offset + 3u")}), vec4<${U}>(${ee.getByOffset("w_offset")}, ${ee.getByOffset("w_offset + 1u")}, ${ee.getByOffset("w_offset + 2u")}, ${ee.getByOffset("w_offset + 3u")}));
1703          x_offset += 4u;
1704          w_offset += 4u;`);else if(G+=`
1705                  let xValue = ${a?te.getByOffset(`${te.indicesToOffset(`${te.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}`):te.get("batch","inputChannel","idyR","idyC")};
1706        `,p===1)G+=`
1707          let w_offset = ${ee.indicesToOffset(`${ee.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)};
1708          let wValue = ${ee.getByOffset(`w_offset / ${v}`)};
1709          dotProd = dotProd + xValue * wValue;`;else for(let se=0;se<p;se++)G+=`
1710            let wValue${se} = ${ee.getByOffset(`${ee.indicesToOffset(`${ee.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel + ${se}, wOutChannel)`)} / ${v}`)};
1711            dotProd = dotProd + xValue[${se}] * wValue${se};`;return G},L=()=>
1711{if(f===0)return"";if(!u)throw new Error(`packInputAs4 ${u} is not true.`);let G="";if(p===1){G+="dotProd = dotProd";for(let se=0;se<f;se++)G+=`
1712            + ${te.getByOffset(`x_offset + ${se}`)} * ${ee.getByOffset(`w_offset + ${se}`)}`;G+=";"}else if(p===2){if(f!==2)throw new Error(`Invalid inputChannelsRemainder ${f}.`);G+=`
1713          let xValue = ${te.getByOffset("x_offset")};
1714          let wValue = ${ee.getByOffset("w_offset")};
1715          dotProd = dotProd + dot(xValue, wValue);`}return G},$=`
1716            let outputIndices = ${ae.offsetToIndices(`global_idx * ${m}`)};
1717            let batch = ${ae.indicesGet("outputIndices",0)};
1718            let d1 = ${ae.indicesGet("outputIndices",H)};
1719            let r = ${ae.indicesGet("outputIndices",R)};
1720            let c = ${ae.indicesGet("outputIndices",K)};
1721            let dyCorner = vec2<i32>(i32(r), i32(c)) - uniforms.pads;
1722            let dyRCorner = dyCorner.x;
1723            let dyCCorner = dyCorner.y;
1724            let groupId = d1 / uniforms.output_channels_per_group;
1725            let wOutChannel = d1 - groupId * uniforms.output_channels_per_group;
1726            // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).
1727            // ? = to be determined. : = across all values in that axis.
1728            var dotProd = ${ae.type.value}(0.0);
1729            var wR: u32 = 0;
1730            if (uniforms.dilations.x == 1) {
1731              // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0
1732              wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner);
1733            }
1734            for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) {
1735              if (wR % uniforms.dilations.x != 0) {
1736                continue;
1737              }
1738              let dyR = (${U}(dyRCorner) + ${U}(wR)) / ${U}(uniforms.strides[0]);
1739              let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x;
1740              if (dyR < 0.0 || dyR >= ${U}(uniforms.Dy_shape[${R}]) || fract(dyR) > 0.0 ||
1741                  wRPerm < 0) {
1742                continue;
1743              }
1744              let idyR: u32 = u32(dyR);
1745              var wC: u32 = 0;
1746              if (uniforms.dilations.y == 1) {
1747                // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0
1748                wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner);
1749              }
1750              for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) {
1751                if (wC % uniforms.dilations.y != 0) {
1752                  continue;
1753                }
1754                let dyC = (${U}(dyCCorner) + ${U}(wC)) / ${U}(uniforms.strides.y);
1755                let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y;
1756                if (dyC < 0.0 || dyC >= ${U}(uniforms.Dy_shape[${K}]) ||
1757                    fract(dyC) > 0.0 || wCPerm < 0) {
1758                  continue;
1759                }
1760                let idyC: u32 = u32(dyC);
1761                var inputChannel = groupId * uniforms.input_channels_per_group;
1762                ${u?`
1763                var x_offset = ${te.indicesToOffset(`${te.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p};
1764                var w_offset = ${ee.indicesToOffset(`${ee.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${v};
1765                  `:""}
1766                for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${u?4:p}) {
1767                  ${ne()}
1768                  inputChannel = inputChannel + ${u?4:p};
1769                }
1770                ${L()}
1771                wC = wC + uniforms.strides.y - 1;
1772              }
1773              wR = wR + uniforms.strides[0] - 1;
1774            }
1775            let value = dotProd${n?` + bias[d1 / ${m}]`:""};
1776            ${ae.setByOffset("global_idx","value")};
1777          `;return`
1778    ${I.registerUniforms(q).declareVariables(...V,ae)}
1779      ${I.mainStart()}
1780      ${I.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")};
1781    ${$}}`};
vendor: 14,735 bytes, lines 1781-1843
1781return{name:"ConvTranspose2D",shaderCache:{hint:`${t.cacheKey};${p}${v}${m}${u}${f}`,inputDependencies:g},getRunData:()=>({dispatchGroup:{x:y[0],y:y[1],z:y[2]},outputs:[{dims:r?r(s):s,dataType:e[0].dataType}],programUniforms:S}),getShaderSource:j}}}),uI,pI,hI,Iw,TB,fI,$w,mI,MB,bne=Je(()=>{xne(),_c(),al(),uI=(e,t,r,n,s,a)=>(e-1)*t+r+(n-1)*s+1-a,pI=(e,t,r,n,s)=>{let a=Math.floor(e/2);t==="SAME_UPPER"?(r[n]=a,r[s]=e-a):t==="SAME_LOWER"&&(r[n]=e-a,r[s]=a)},hI=(e,t,r,n,s,a,i,l,c,d)=>{let p=e.length-2,u=d.length===0;c.length<p&&c.push(...Array(p-c.length).fill(0));let h=e[0],f=t[l?3:1]*s;for(let m=0,v=e.length-p-(l?1:0);m<p;++m,++v){let k=e[v],y=u?k*i[m]:d[m],g=uI(k,i[m],a[m],t[v],r[m],y);pI(g,n,a,m,m+p),u&&d.push(i[m]*(k-1)+c[m]+(t[v]-1)*r[m]+1-a[m]-a[m+p])}d.splice(0,0,h),d.splice(l?3:1,0,f)},Iw=(e,t)=>{let r=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((u,h)=>u*h,1)===0){r.length=0;for(let u=2;u<t[1].dims.length;++u)r.push(t[1].dims[u])}let n=e.format==="NHWC";r.splice(0,0,t[1].dims[0]),r.splice(n?3:1,0,t[1].dims[1]);let s=e.pads.slice(),a=e.outputShape.slice(),i=e.outputPadding.slice(),l=t[0].dims,c=e.dilations.slice();if(c.reduce((u,h)=>u+h,0)===0){let u=t[0].dims.length-2;c=new Array(u).fill(1)}let d=e.strides.slice();if(d.reduce((u,h)=>u+h,0)===0){let u=t[0].dims.length-2;d=new Array(u).fill(1)}hI(l,r,c,e.autoPad,e.group,s,d,n,i,a);let p=Object.assign({},e);return Object.assign(p,{kernelShape:r,pads:s,outputPadding:i,outputShape:a,dilations:c,strides:d}),p},TB=e=>{let t=Y1(e),r=e.format,n=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][typeof e.autoPad>"u"?0:e.autoPad],s=e.dilations,a=e.group,i=e.kernelShape,l=e.pads,c=e.strides,d=e.wIsConst(),p=e.outputPadding,u=e.outputShape;return{autoPad:n,format:r,dilations:s,group:a,kernelShape:i,outputPadding:p,outputShape:u,pads:l,strides:c,wIsConst:d,...t,cacheKey:`${e.format};${t.activation};`}},fI=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error("currently only support 2-dimensional conv");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let r=e[0].dims[t.format==="NHWC"?e[0].dims.length-1:1],n=e[1].dims[0];if(r!==n)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let s=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==s))throw new Error("invalid bias");let a=e[0].dims.length-2;if(t.dilations.reduce((i,l)=>i+l,0)>0&&t.dilations.length!==a)throw new Error(`dilations should be ${a}D`);if(t.strides.reduce((i,l)=>i+l,0)>0&&t.strides.length!==a)throw new Error(`strides should be ${a}D`);if(t.pads.reduce((i,l)=>i+l,0)>0&&t.pads.length!==a*2)throw new Error(`pads should be ${a*2}D`);if(t.outputPadding.length!==a&&t.outputPadding.length!==0)throw new Error(`output_padding should be ${a}D`);if(t.kernelShape.reduce((i,l)=>i+l,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape")},$w=(e,t,r,n)=>{let s=e.kernelCustomData.wT??e.compute(Qs(t[1],[2,3,0,1]),{inputs:[1],outputs:[r.wIsConst?-2:-1]})[0];r.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=s);let a=[t[0],s];t.length===3&&a.push(t[2]),e.compute(kB(a,r,n),{inputs:a})},mI=(e,t)=>{let r=t.format==="NHWC",n=[e.inputs[0].reshape(r?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&n.push(e.inputs[2]);let s=t.kernelShape;(s.length===0||s[0]===0)&&(s=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let i=t.strides;(i.length===0||i[0]===0)&&(i=[1]);let l=t.pads;l.length===0&&(l=[0,0]),l=[0,l[0],0,l[1]],i=[1].concat(i),a=[1].concat(a),s=[1].concat(s);let c=t.outputPadding;c=[0].concat(c);let d=Iw({...t,pads:l,strides:i,dilations:a,kernelShape:s,outputPadding:c},n);$w(e,n,d,p=>r?[p[0],p[2],p[3]]:[p[0],p[1],p[3]])},MB=(e,t)=>{if(fI(e.inputs,t),e.inputs[0].dims.length===3)mI(e,t);else{let r=Iw(t,e.inputs);$w(e,e.inputs,r)}}}),gI,EB,SB,kne=Je(()=>{Mt(),Rt(),Zr(),Ft(),gI=(e,t,r,n)=>{let s=Ce.size(t),a=t.length,i=De("input",e,a),l=ut("output",e,a),c=r.dataType===6?r.getInt32Array()[0]:Number(r.getBigInt64Array()[0]),d=Ce.normalizeAxis(c,a),p=u=>{let h=` i32(${i.indicesGet("inputIndices","uniforms.axis")}) `,f=mt("uniforms.input_shape","uniforms.axis",a),m=n.reverse?h+(n.exclusive?" + 1":""):"0",v=n.reverse?f:h+(n.exclusive?"":" + 1");return`
1782                ${u.registerUniform("outputSize","u32").registerUniform("axis","u32").declareVariables(i,l)}
1783                ${u.mainStart()}
1784                  ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
1785                  var inputIndices = ${l.offsetToIndices("global_idx")};
1786                  var sum = ${l.type.value}(0);
1787                  let first : i32 = ${m};
1788                  let last : i32 = ${v};
1789                  for (var i : i32 = first; i < last; i++) {
1790                    ${i.indicesSet("inputIndices","uniforms.axis","u32(i)")};
1791                    sum = sum + ${i.getByIndices("inputIndices")};
1792                  }
1793                  ${l.setByOffset("global_idx","sum")};
1794                }`};return{name:"CumSum",shaderCache:{hint:n.cacheKey,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:[{type:12,data:s},{type:12,data:d},...vt(t,t)]}),getShaderSource:p}},EB=(e,t)=>{let r=e.inputs[0].dims,n=e.inputs[0].dataType,s=e.inputs[1];e.compute(gI(n,r,s,t),{inputs:[0]})},SB=e=>{let t=e.exclusive===1,r=e.reverse===1;return cr({exclusive:t,reverse:r})}}),yI,vI,_I,AB,PB,Tne=Je(()=>{Mt(),Rt(),Zr(),Ft(),yI=e=>{if(!e||e.length!==1)throw new Error("DepthToSpace requires 1 input.");if(e[0].dims.length!==4)throw new Error("DepthToSpace requires 4D input.")},vI=(e,t,r,n)=>{let s=[];s.push(`fn perm(i: ${n.type.indices}) -> ${r.type.indices} {
1795    var a: ${r.type.indices};`);for(let a=0;a<t;++a)s.push(r.indicesSet("a",e[a],`i[${a}]`));return s.push("return a;}"),s.join(`
1796`)},_I=(e,t)=>{let r,n,s,a,i,l,c=t.format==="NHWC",d=t.blocksize,p=t.mode==="DCR";c?([r,n,s,a]=e.dims,i=p?[r,n,s,d,d,a/d**2]:[r,n,s,a/d**2,d,d],l=p?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([r,n,s,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],i=p?[r,d,d,a/d**2,n,s]:[r,a/d**2,d,d,n,s],l=p?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let u=e.reshape(i),h=u.dims.length,f=e.dataType,m=De("a",f,h),v=ut("output",f,h),k=y=>`
1797  ${y.registerUniform("output_size","u32").declareVariables(m,v)}
1798
1799  ${vI(l,h,m,v)}
1800
1801  ${y.mainStart()}
1802    ${y.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1803
1804    let indices = ${v.offsetToIndices("global_idx")};
1805    let aIndices = perm(indices);
1806
1807    ${v.setByOffset("global_idx",m.getByIndices("aIndices"))}
1808  }`;return{name:"DepthToSpace",shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:["rank"]},getRunData:y=>{let g=c?[r,n*d,s*d,a/d**2]:[r,a/d**2,n*d,s*d],_=Ce.size(g),w=u.dims,x=Ce.sortBasedOnPerm(w,l);return{outputs:[{dims:g,dataType:y[0].dataType}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:[{type:12,data:_},...vt(w,x)]}},getShaderSource:k}},AB=(e,t)=>{yI(e.inputs),e.compute(_I(e.inputs[0],t))},PB=e=>cr({blocksize:e.blocksize,mode:e.mode,format:e.format})}),bm,dp,Nw,wI,xI,bI,kI,Ow,TI,CB,jB,Mne=Je(()=>{Mt(),Rt(),Zr(),Ft(),bm="[a-zA-Z]|\\.\\.\\.",dp="("+bm+")+",Nw="^"+dp+"$",wI="("+dp+",)*"+dp,xI="^"+wI+"$",bI=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let r=this.symbolToIndices.get(e);r===void 0?r=[t]:r.push(t),this.symbolToIndices.set(e,r)}},kI=class{constructor(e,t){var s;this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[r,n]=t.includes("->")?t.split("->",2):[t,""];if(!r.match(RegExp(xI)))throw new Error("Invalid LHS term");if(r.split(",").forEach((a,i)=>{let l=e[i].dims.slice();if(!a.match(RegExp(Nw)))throw new Error("Invalid LHS term");let c=this.processTerm(a,!0,l,i);this.lhs.push(c)}),n==="")n+=[...this.symbolToInfo.entries()].filter(([a,i])=>i.count===1||a==="...").map(([a])=>a).join("");else if(!n.match(RegExp(dp)))throw new Error("Invalid RHS");(s=n.match(RegExp(bm,"g")))==null||s.forEach(a=>{if(a==="...")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let i=this.symbolToInfo.get(a);if(i===void 0)throw new Error("Invalid RHS symbol");this.outputDims.push(i.dimValue)}}),this.rhs=this.processTerm(n,!1,this.outputDims)}addSymbol(e,t,r){let n=this.symbolToInfo.get(e);if(n!==void 0){if(n.dimValue!==t&&n.count!==1)throw new Error("Dimension mismatch");n.count++,n.inputIndices.push(r)}else n={count:1,dimValue:t,inputIndices:[r]};this.symbolToInfo.set(e,n)}processTerm(e,t,r,n=-1){let s=r.length,a=!1,i=[],l=0;if(!e.match(RegExp(Nw))&&!t&&e!=="")throw new Error("Invalid LHS term");let c=e.match(RegExp(bm,"g")),d=new bI(n);return c==null||c.forEach((p,u)=>{if(p==="..."){if(a)throw new Error("Only one ellipsis is allowed per input term");a=!0;let h=s-c.length+1;if(h<0)throw new Error("Ellipsis out of bounds");if(i=r.slice(l,l+h),this.hasEllipsis){if(this.ellipsisDims.length!==i.length||this.ellipsisDims.toString()!==i.toString())throw new Error("Ellipsis dimensions mismatch")}else if(t)this.hasEllipsis=!0,this.ellipsisDims=i;else throw new Error("Ellipsis must be specified in the LHS");for(let f=0;f<i.length;f++){let m=String.fromCharCode(48+f);d.addSymbol(m,u+f),this.addSymbol(m,r[l++],n)}}else d.addSymbol(p,u+(this.hasEllipsis?this.ellipsisDims.length-1:0)),this.addSymbol(p,r[l++],n)}),d}},Ow=e=>e+"_max",TI=(e,t,r,n)=>{let s=e.map(d=>d.length).map((d,p)=>De(`input${p}`,t,d)),a=Ce.size(n),i=ut("output",t,n.length),l=[...r.symbolToInfo.keys()].filter(d=>!r.rhs.symbolToIndices.has(d)),c=d=>{let p=[],u="var prod = 1.0;",h="var sum = 0.0;",f="sum += prod;",m=[],v=[],k=[],y=[],g=r.symbolToInfo.size===r.rhs.symbolToIndices.size;r.symbolToInfo.forEach((w,x)=>{var b;if(r.rhs.symbolToIndices.has(x)){let M=(b=r.rhs.symbolToIndices.get(x))==null?void 0:b[0];M!==void 0&&r.lhs.forEach((S,j)=>{if(w.inputIndices.includes(j)){let I=S.symbolToIndices.get(x);if(I===void 0)throw new Error("Invalid symbol error");I.forEach(q=>{p.push(`${s[j].indicesSet(`input${j}Indices`,q,i.indicesGet("outputIndices",M))}`)})}})}else r.lhs.forEach((M,S)=>{if(w.inputIndices.includes(S)){let j=M.symbolToIndices.get(x);if(j===void 0)throw new Error("Invalid symbol error");j.forEach(I=>{m.push(`${s[S].indicesSet(`input${S}Indices`,I,`${x}`)}`)}),y.push(`prod *= ${s[S].getByIndices(`input${S}Indices`)};`)}}),v.push(`for(var ${x}: u32 = 0; ${x} < uniforms.${Ow(x)}; ${x}++) {`),k.push("}")});let _=g?[...p,`let sum = ${s.map((w,x)=>w.getByIndices(`input${x}Indices`)).join(" * ")};`]:[...p,h,...v,...m,u,...y,f,...k];return`
1809            ${d.registerUniforms(l.map(w=>({name:`${Ow(w)}`,type:"u32"}))).registerUniform("outputSize","u32").declareVariables(...s,i)}
1810
1811            ${d.mainStart()}
1812            ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
1813            var outputIndices = ${i.offsetToIndices("global_idx")};
1814            ${s.map((w,x)=>`var input${x}Indices: ${s[x].type.indices};`).join(`
1815`)}
1816            ${_.join(`
1817`)};
1818            ${i.setByOffset("global_idx","sum")};
1819          }`};return{name:"Einsum",shaderCache:{hint:r.equation,inputDependencies:e.map(()=>"rank")},getRunData:()=>{let d=l.filter(u=>r.symbolToInfo.has(u)).map(u=>{var h;return{type:12,data:((h=r.symbolToInfo.get(u))==null?void 0:h.dimValue)||0}});d.push({type:12,data:a});let p=e.map((u,h)=>[...vt(u)]).reduce((u,h)=>u.concat(h),d);return p.push(...vt(n)),{outputs:[{dims:n,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:p}},getShaderSource:c}},CB=(e,t)=>{let r=new kI(e.inputs,t.equation),n=r.outputDims,s=e.inputs.map((a,i)=>a.dims);e.compute(TI(s,e.inputs[0].dataType,r,n))},jB=e=>{let t=e.equation.replace(/\s+/g,"");return cr({equation:t})}}),MI,Rw,EI,SI,IB,Ene=Je(()=>{Mt(),Rt(),Ft(),MI=e=>{if(!e||e.length!==2)throw new Error("Expand requires 2 input.");let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),n=r.length<t.length?0:r.length-t.length,s=t.length<r.length?0:t.length-r.length;for(;n<r.length&&s<t.length;++n,++s)if(r[n]!==t[s]&&r[n]!==1&&t[s]!==1)throw new Error("Expand requires shape to be broadcastable to input")},Rw=(e,t)=>{let r=e.length-t.length,n=[];for(let s=0;s<r;++s)n.push(e[s]);for(let s=0;s<t.length;++s)n.push(t[s]===1?e[s+r]:t[s]);return n},EI=(e,t)=>e.length>t.length?Rw(e,t):Rw(t,e),SI=e=>{let t=e[0].dims,r=Array.from(e[1].getBigInt64Array(),Number),n=EI(t,r),s=e[0].dataType,a=s===9||Ce.size(t)===1,i=s===9||t.length>0&&t[t.length-1]%4===0?4:1,l=a||n.length>0&&n[n.length-1]%4===0?4:1,c=Math.ceil(Ce.size(n)/l),d=u=>{let h=De("input",s,t.length,i),f=ut("output",s,n.length,l),m;if(s===9){let v=(k,y,g="")=>`
1820          let outputIndices${y} = ${f.offsetToIndices(`outputOffset + ${y}u`)};
1821          let offset${y} = ${h.broadcastedIndicesToOffset(`outputIndices${y}`,f)};
1822          let index${y} = offset${y} / 4u;
1823          let component${y} = offset${y} % 4u;
1824          ${k}[${y}] = ${g}(${h.getByOffset(`index${y}`)}[component${y}]);
1825        `;m=`
1826        let outputOffset = global_idx * ${l};
1827        var data = vec4<u32>(0);
1828        ${v("data",0,"u32")}
1829        ${v("data",1,"u32")}
1830        ${v("data",2,"u32")}
1831        ${v("data",3,"u32")}
1832        ${f.setByOffset("global_idx","data")}
1833      }`}else m=`
1834        let outputIndices = ${f.offsetToIndices(`global_idx * ${l}`)};
1835        let inputOffset = ${h.broadcastedIndicesToOffset("outputIndices",f)};
1836        let data = ${f.type.value}(${h.getByOffset(`inputOffset / ${i}`)});
1837        ${f.setByOffset("global_idx","data")}
1838      }`;return`
1839    ${u.registerUniform("vec_size","u32").declareVariables(h,f)}
1840    ${u.mainStart()}
1841    ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")}
1842    ${m}`},p=[{type:12,data:c},...vt(t,n)];return{name:"Expand",shaderCache:{hint:`${n.length};${i}${l}`,inputDependencies:["rank"]},getShaderSource:d,getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:p})}},IB=e=>{MI(e.inputs),e.compute(SI(e.inputs),{inputs:[0]})}}),AI,$B,Sne=Je(()=>{Mt(),Rt(),Ft(),Q1(),AI=e=>{let t=e[0].dataType,r=Ce.size(e[0].dims),n=Ce.size(e[1].dims),s=n%4===0,a=i=>{let l=De("x",t,[1],4),c=De("bias",t,[1],4),d=ut("y",t,[1],4),p=[{name:"output_vec_size",type:"u32"},{name:"bias_size",type:"u32"}],u=f=>`
1843      let bias${f}_offset: u32 = (global_idx * 4 + ${f}
1843) % uniforms.bias_size;
1844      let bias${f} = ${c.getByOffset(`bias${f}_offset / 4`)}[bias${f}_offset % 4];`,h=s?`
1845      let bias = ${c.getByOffset("global_idx % (uniforms.bias_size / 4)")};`:`${u(0)}${u(1)}${u(2)}${u(3)}
1846      let bias = ${l.type.value}(bias0, bias1, bias2, bias3);`;return`${i.registerUniforms(p).declareVariables(l,c,d)}
1847
1848    ${Ub(cs(t))}
1849
1850    ${i.mainStart(Jd)}
1851      ${i.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_vec_size")}
1852
1853      let x = ${l.getByOffset("global_idx")};
1854      ${h}
1855      let x_in = x + bias;
1856      ${d.setByOffset("global_idx",Wb("x_in"))}
1857    }`};return{name:"FastGeluWithBias",shaderCache:{hint:`${s}`,inputDependencies:["type","type"]},getShaderSource:a,getRunData:i=>({outputs:[{dims:i[0].dims,dataType:i[0].dataType}],programUniforms:[{type:12,data:Math.ceil(r/4)},{type:12,data:n}],dispatchGroup:{x:Math.ceil(r/Jd/4)}})}},$B=e=>{e.inputs.length<2||Ce.size(e.inputs[1].dims)===0?Xz(e):e.compute(AI(e.inputs))}}),PI,CI,NB,OB,Ane=Je(()=>{Mt(),Rt(),Zr(),Ft(),PI=e=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.")},CI=(e,t)=>{let r=e[0].dims,n=e[1].dims,s=r.length,a=Ce.normalizeAxis(t.axis,s),i=r.slice(0);i.splice(a,1,...n);let l=r[a],c=e[0].dataType===9?4:1,d=Math.ceil(Ce.size(i)/c),p=[{type:12,data:d},{type:6,data:l},{type:12,data:a},...vt(e[0].dims,e[1].dims,i)],u=h=>{let f=De("data",e[0].dataType,e[0].dims.length,c),m=De("inputIndices",e[1].dataType,e[1].dims.length),v=ut("output",e[0].dataType,i.length,c),k=g=>{let _=n.length,w=`var indicesIndices${g}  = ${m.type.indices}(0);`;for(let x=0;x<_;x++)w+=`${_>1?`indicesIndices${g}[${x}]`:`indicesIndices${g}`} = ${i.length>1?`outputIndices${g}[uniforms.axis + ${x}]`:`outputIndices${g}`};`;w+=`
1858          var idx${g} = ${m.getByIndices(`indicesIndices${g}`)};
1859          if (idx${g} < 0) {
1860            idx${g} = idx${g} + uniforms.axisDimLimit;
1861          }
1862          var dataIndices${g} : ${f.type.indices};
1863        `;for(let x=0,b=0;x<s;x++)x===a?(w+=`${s>1?`dataIndices${g}[${x}]`:`dataIndices${g}`} = u32(idx${g});`,b+=_):(w+=`${s>1?`dataIndices${g}[${x}]`:`dataIndices${g}`} = ${i.length>1?`outputIndices${g}[${b}]`:`outputIndices${g}`};`,b++);return w},y;if(e[0].dataType===9){let g=(_,w,x="")=>`
1864          let outputIndices${w} = ${v.offsetToIndices(`outputOffset + ${w}u`)};
1865          ${k(w)};
1866          let offset${w} = ${f.indicesToOffset(`dataIndices${w}`)};
1867          let index${w} = offset${w} / 4u;
1868          let component${w} = offset${w} % 4u;
1869          ${_}[${w}] = ${x}(${f.getByOffset(`index${w}`)}[component${w}]);
1870        `;y=`
1871        let outputOffset = global_idx * ${c};
1872        var value = vec4<u32>(0);
1873        ${g("value",0,"u32")}
1874        ${g("value",1,"u32")}
1875        ${g("value",2,"u32")}
1876        ${g("value",3,"u32")}
1877        ${v.setByOffset("global_idx","value")}
1878      `}else y=`
1879      let outputIndices = ${v.offsetToIndices("global_idx")};
1880      ${k("")};
1881      let value = ${f.getByIndices("dataIndices")};
1882      ${v.setByOffset("global_idx","value")};
1883      `;return`
1884      ${h.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(f,m,v)}
1885      ${h.mainStart()}
1886        ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
1887        ${y}
1888      }`};return{name:"Gather",shaderCache:{hint:t.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:p}),getShaderSource:u}},NB=e=>cr({axis:e.axis}),OB=(e,t)=>{let r=e.inputs;PI(r),e.compute(CI(e.inputs,t))}}),jI,RB,DB,Pne=Je(()=>{Mt(),Rt(),Ft(),jI=(e,t,r,n,s,a,i,l,c)=>{let d=[{type:12,data:a},{type:12,data:n},{type:12,data:s},{type:12,data:r},{type:12,data:i},{type:12,data:l},{type:12,data:c}],p=[a];d.push(...vt(t.dims,p));let u=h=>{let f=De("indices_data",t.dataType,t.dims.length),m=ut("input_slice_offsets_data",12,1,1),v=[f,m],k=[{name:"output_size",type:"u32"},{name:"batch_dims",type:"u32"},{name:"input_dims",type:"u32",length:s.length},{name:"sizes_from_slice_dims_data",type:"u32",length:r.length},{name:"num_slices_per_batch",type:"u32"},{name:"input_batch_stride",type:"u32"},{name:"num_slice_dims",type:"u32"}];return`
1889  ${h.registerUniforms(k).declareVariables(...v)}
1890  ${h.mainStart()}
1891    ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1892    let batch_idx = global_idx / uniforms.num_slices_per_batch;
1893    let base_offset = batch_idx * uniforms.input_batch_stride;
1894
1895    let slice_indices_base_offset = global_idx * uniforms.num_slice_dims;
1896    var relative_slice_offset = 0;
1897    for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) {
1898      var index = i32(indices_data[dim_idx + slice_indices_base_offset].x);
1899      let input_dim_idx = uniforms.batch_dims + dim_idx;
1900      if (index < 0) {
1901        ${s.length===1?"index += i32(uniforms.input_dims);":"index += i32(uniforms.input_dims[input_dim_idx]);"}
1902      }
1903      ${r.length===1?"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);":"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);"}
1904    }
1905
1906    input_slice_offsets_data[global_idx] =  base_offset + u32(relative_slice_offset);
1907  }`};return e.compute({name:"computeSliceOffsets",shaderCache:{hint:`${s.length}_${r.length}`,inputDependencies:["rank"]},getRunData:()=>
vendor: 13,297 bytes, lines 1907-2058
1907({outputs:[{dims:p,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:d}),getShaderSource:u},{inputs:[t],outputs:[-1]})[0]},RB=(e,t)=>{let r=e.inputs,n=r[0].dims,s=r[0].dataType,a=r[1].dims,i=a[a.length-1],l=Ce.sizeToDimension(a,a.length-1),c=Ce.sizeFromDimension(n,t.batchDims+i),d=Ce.sizeToDimension(n,t.batchDims),p=Ce.sizeFromDimension(n,t.batchDims),u=l/d,h=new Array(i),f=c;for(let w=0;w<i;++w)h[i-1-w]=f,f*=n[t.batchDims+i-1-w];let m=jI(e,r[1],h,t.batchDims,n,l,u,p,i),v=t.batchDims+i;if(v>n.length)throw new Error("last dimension of indices must not be larger than rank of input tensor");let k=a.slice(0,-1).concat(n.slice(v)),y=Ce.size(k),g=[{type:12,data:y},{type:12,data:c},...vt(r[0].dims,m.dims,k)],_=w=>{let x=De("data",r[0].dataType,r[0].dims.length),b=De("slice_offsets",12,m.dims.length),M=ut("output",r[0].dataType,k.length);return`
1908          ${w.registerUniform("output_size","u32").registerUniform("slice_size","u32").declareVariables(x,b,M)}
1909            ${w.mainStart()}
1910            ${w.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1911          let slice_offset = slice_offsets[global_idx / uniforms.slice_size];
1912          output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size];
1913        }`};e.compute({name:"GatherND",shaderCache:{hint:t.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:k,dataType:s}],dispatchGroup:{x:Math.ceil(y/64)},programUniforms:g}),getShaderSource:_},{inputs:[r[0],m]})},DB=e=>({batchDims:e.batch_dims,cacheKey:""})}),II,$I,FB,LB,Cne=Je(()=>{Mt(),Rt(),Zr(),Ft(),II=(e,t)=>{if(e.length<3||e.length>4)throw new Error("GatherBlockQuantized requires 3 or 4 inputs.");let r=Ce.normalizeAxis(t.quantizeAxis,e[0].dims.length),n=t.blockSize,s=e[0],a=e[2],i=e.length===4?e[3]:void 0;if(a.dims.length!==s.dims.length||!s.dims.map((l,c)=>c===r?Math.ceil(l/n)===a.dims[c]:l===a.dims[c]).reduce((l,c)=>l&&c,!0))throw new Error("Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.");if(i){if(i.dataType!==s.dataType)throw new Error("Zero point must have the same data type as the input tensor.");if(i.dims.length!==a.dims.length||!i.dims.map((l,c)=>l===a.dims[c]).reduce((l,c)=>l&&c,!0))throw new Error("Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.")}},$I=(e,t)=>{let r=e[0].dims,n=e[1].dims,s=r.length,a=Ce.normalizeAxis(t.gatherAxis,s),i=Ce.normalizeAxis(t.quantizeAxis,s),l=r.slice(0);l.splice(a,1,...n);let c=Ce.size(l),d=e[2].dataType,p=e[0].dataType===22,u=[{type:12,data:c},{type:12,data:i},{type:12,data:a},{type:12,data:t.blockSize},...vt(...e.map((f,m)=>f.dims),l)],h=f=>{let m=De("data",e[0].dataType,e[0].dims.length),v=De("inputIndices",e[1].dataType,e[1].dims.length),k=De("scales",e[2].dataType,e[2].dims.length),y=e.length>3?De("zeroPoint",e[3].dataType,e[3].dims.length):void 0,g=ut("output",d,l.length),_=[m,v,k];y&&_.push(y);let w=[{name:"output_size",type:"u32"},{name:"quantize_axis",type:"u32"},{name:"gather_axis",type:"u32"},{name:"block_size",type:"u32"}];return`
1914        ${f.registerUniforms(w).declareVariables(..._,g)}
1915        ${f.mainStart()}
1916        let output_indices = ${g.offsetToIndices("global_idx")};
1917        var indices_indices = ${v.type.indices}(0);
1918        ${n.length>1?`
1919          for (var i: u32 = 0; i < ${n.length}; i++) {
1920            let index = ${g.indicesGet("output_indices","uniforms.gather_axis + i")};
1921            ${v.indicesSet("indices_indices","i","index")};
1922          }`:`indices_indices = ${g.indicesGet("output_indices","uniforms.gather_axis")};`};
1923        var data_indices = ${m.type.indices}(0);
1924        for (var i: u32 = 0; i < uniforms.gather_axis; i++) {
1925          let index = ${g.indicesGet("output_indices","i")};
1926          ${m.indicesSet("data_indices","i","index")};
1927        }
1928        var index_from_indices = ${v.getByIndices("indices_indices")};
1929        if (index_from_indices < 0) {
1930          index_from_indices += ${r[a]};
1931        }
1932        ${m.indicesSet("data_indices","uniforms.gather_axis","u32(index_from_indices)")};
1933        for (var i = uniforms.gather_axis + 1; i < ${l.length}; i++) {
1934          let index = ${g.indicesGet("output_indices",`i + ${n.length} - 1`)};
1935          ${m.indicesSet("data_indices","i","index")};
1936        }
1937        let data_offset = ${m.indicesToOffset("data_indices")};
1938        let data_index = data_offset % 8;
1939        // Convert 4-bit packed data to 8-bit packed data.
1940        let packed_4bit_quantized_data = ${m.getByOffset("data_offset / 8")};
1941        let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f;
1942        let quantized_data_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_quantized_data));
1943        let quantized_data = quantized_data_vec[data_index / 2];
1944        var scale_indices = data_indices;
1945        let quantize_axis_index = ${k.indicesGet("data_indices","uniforms.quantize_axis")} / uniforms.block_size;
1946        ${k.indicesSet("scale_indices","uniforms.quantize_axis","quantize_axis_index")};
1947        var scale = ${k.getByIndices("scale_indices")};
1948        ${y?`
1949              let zero_point_indices = scale_indices;
1950              let zero_point_offset = ${y.indicesToOffset("zero_point_indices")};
1951              let zero_point_index = zero_point_offset % 8;
1952              let packed_4bit_zero_points = ${y.getByOffset("zero_point_offset / 8")};
1953              let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f;
1954              let zero_point_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_zero_points));
1955              let zero_point = zero_point_vec[zero_point_index / 2];`:"var zero_point = 0"};
1956        let dequantized_data = ${cs(d)}(quantized_data - zero_point) * scale;
1957        ${g.setByOffset("global_idx","dequantized_data")};
1958    }`};return{name:"GatherBlockQuantized",shaderCache:{hint:`${t.cacheKey};${e.filter((f,m)=>m!==1).map(f=>f.dims.join("_")).join(";")}`,inputDependencies:Array.from({length:e.length},(f,m)=>"rank")},getRunData:()=>({outputs:[{dims:l,dataType:d}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u}),getShaderSource:h}},FB=(e,t)=>{let r=e.inputs;II(r,t),e.compute($I(e.inputs,t))},LB=e=>cr({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),NI,OI,zB,BB,jne=Je(()=>{Mt(),Rt(),Zr(),Ft(),NI=e=>{if(!e||e.length!==2)throw new Error("GatherElements requires 2 inputs.");if(e[0].dims.length<1)throw new Error("GatherElements requires that the data input be rank >= 1.");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and
1959                     indices input tensors be of same rank.`)},OI=(e,t)=>{let r=e[0].dims,n=e[0].dataType,s=r.length,a=e[1].dims,i=e[1].dataType,l=Ce.normalizeAxis(t.axis,s),c=r[l],d=a.slice(0),p=Ce.size(d),u=De("input",n,s),h=De("indicesInput",i,a.length),f=ut("output",n,d.length),m=[{type:12,data:p},{type:6,data:c},{type:12,data:l}];return m.push(...vt(r,a,d)),{name:"GatherElements",shaderCache:{inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:d,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:m}),getShaderSource:v=>`
1960      ${v.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(u,h,f)}
1961      ${v.mainStart()}
1962      ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
1963
1964      let outputIndices = ${f.offsetToIndices("global_idx")};
1965
1966      var idx = ${h.getByOffset("global_idx")};
1967      if (idx < 0) {
1968        idx = idx + uniforms.axisDimLimit;
1969      }
1970      var inputIndices = ${u.type.indices}(outputIndices);
1971      ${u.indicesSet("inputIndices","uniforms.axis","u32(idx)")};
1972      let value = ${u.getByIndices("inputIndices")};
1973
1974      ${f.setByOffset("global_idx","value")};
1975  }`}},zB=e=>cr({axis:e.axis}),BB=(e,t)=>{let r=e.inputs;NI(r),e.compute(OI(e.inputs,t))}}),RI,DI,UB,WB,Ine=Je(()=>{Mt(),Rt(),Ft(),RI=e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(e.length===3&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")},DI=(e,t)=>{let r=e[0].dims.slice(),n=e[1].dims.slice(),[s,a,i]=zL.getShapeOfGemmResult(r,t.transA,n,t.transB,e.length===3?e[2].dims:void 0),l=[s,a];if(!l)throw new Error("Can't use gemm on the given tensors");let c=16,d=Math.ceil(a/c),p=Math.ceil(s/c),u=!0,h=Ce.size(l),f=[{type:12,data:u?d:h},{type:12,data:s},{type:12,data:a},{type:12,data:i},{type:1,data:t.alpha},{type:1,data:t.beta}],m=["type","type"];e.length===3&&(f.push(...vt(e[2].dims)),m.push("rank")),f.push(...vt(l));let v=y=>{let g="";t.transA&&t.transB?g="value += a[k * uniforms.M + m] * b[n * uniforms.K + k];":t.transA&&!t.transB?g="value += a[k * uniforms.M + m] * b[k * uniforms.N + n];":!t.transA&&t.transB?g="value += a[m * uniforms.K + k] * b[n * uniforms.K + k];":!t.transA&&!t.transB&&(g="value += a[m * uniforms.K + k] * b[k * uniforms.N + n];");let _=t.alpha===1?"":"value *= uniforms.alpha;",w=De("a",e[0].dataType,e[0].dims),x=De("b",e[1].dataType,e[1].dims),b=w.type.value,M=null,S=[w,x];e.length===3&&(M=De("c",e[2].dataType,e[2].dims.length),S.push(M));let j=ut("output",e[0].dataType,l.length);S.push(j);let I=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}];return`
1976  ${y.registerUniforms(I).declareVariables(...S)}
1977
1978  ${y.mainStart()}
1979    ${y.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
1980
1981    let m = global_idx / uniforms.N;
1982    let n = global_idx % uniforms.N;
1983
1984    var value = ${b}(0);
1985    for (var k: u32 = 0u; k < uniforms.K; k++) {
1986      ${g}
1987    }
1988
1989    ${_}
1990    ${M!=null?`let cOffset = ${M.broadcastedIndicesToOffset("vec2(m, n)",j)}; value += ${b}(uniforms.beta) * ${M.getByOffset("cOffset")};`:""}
1991    output[global_idx] = value;
1992  }`},k=y=>{let g=De("a",e[0].dataType,e[0].dims),_=De("b",e[1].dataType,e[1].dims),w=null,x=[g,_];e.length===3&&(w=De("c",e[2].dataType,e[2].dims.length),x.push(w));let b=ut("output",e[0].dataType,l.length);x.push(b);let M=[{name:"num_tile_n",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"},{name:"alpha",type:"f32"},{name:"beta",type:"f32"}],S="",j="";t.transA&&t.transB?(j=`
1993      var col = tile_row_start + local_id.x;
1994      var row = k_start + local_id.y;
1995      if (col < uniforms.M && row < uniforms.K) {
1996        tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col];
1997      } else {
1998        tile_a[local_id.y][local_id.x] = ${g.type.value}(0);
1999      }
2000
2001      col = k_start + local_id.x;
2002      row = tile_col_start + local_id.y;
2003      if (col < uniforms.K && row < uniforms.N) {
2004        tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col];
2005      } else {
2006        tile_b[local_id.y][local_id.x] = ${_.type.value}(0);
2007      }
2008      `,S="value += tile_a[k][local_id.y] * tile_b[local_id.x][k];"):t.transA&&!t.transB?(j=`
2009      var col = tile_row_start + local_id.x;
2010      var row = k_start + local_id.y;
2011      if (col < uniforms.M && row < uniforms.K) {
2012        tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col];
2013      } else {
2014        tile_a[local_id.y][local_id.x] = ${g.type.value}(0);
2015      }
2016
2017      col = tile_col_start + local_id.x;
2018      row = k_start + local_id.y;
2019      if (col < uniforms.N && row < uniforms.K) {
2020        tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col];
2021      } else {
2022        tile_b[local_id.y][local_id.x] = ${_.type.value}(0);
2023      }
2024      `,S="value += tile_a[k][local_id.y] * tile_b[k][local_id.x];"):!t.transA&&t.transB?(j=`
2025      var col = k_start + local_id.x;
2026      var row = tile_row_start + local_id.y;
2027      if (col < uniforms.K && row < uniforms.M) {
2028        tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col];
2029      } else {
2030        tile_a[local_id.y][local_id.x] = ${g.type.value}(0);
2031      }
2032
2033      col = k_start + local_id.x;
2034      row = tile_col_start + local_id.y;
2035      if (col < uniforms.K && row < uniforms.N) {
2036        tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col];
2037      } else {
2038        tile_b[local_id.y][local_id.x] = ${_.type.value}(0);
2039      }
2040      `,S="value += tile_a[local_id.y][k] * tile_b[local_id.x][k];"):!t.transA&&!t.transB&&(j=`
2041      var col = k_start + local_id.x;
2042      var row = tile_row_start + local_id.y;
2043      if (col < uniforms.K && row < uniforms.M) {
2044        tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col];
2045      } else {
2046        tile_a[local_id.y][local_id.x] = ${g.type.value}(0);
2047      }
2048
2049      col = tile_col_start + local_id.x;
2050      row = k_start + local_id.y;
2051      if (col < uniforms.N && row < uniforms.K) {
2052        tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col];
2053      } else {
2054        tile_b[local_id.y][local_id.x] = ${_.type.value}(0);
2055      }
2056      `,S="value += tile_a[local_id.y][k] * tile_b[k][local_id.x];");let I=t.alpha===1?"":"value *= uniforms.alpha;";return`
2057  ${y.registerUniforms(M).declareVariables(...x)}
2058  var<workgroup> tile_a: array<array<${g.type.storage}, ${c}>, ${c}>;
2059  var<workgroup> tile_b: array<array<${_.type.storage}, ${c}>, ${c}>;
2060  ${y.mainStart([c,c,1])}
2061    let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${c};
2062    let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${c};
2063    let num_tiles = (uniforms.K - 1) / ${c} + 1;
2064    var k_start = 0u;
2065    var value = ${b.type.value}(0);
2066    for (var t: u32 = 0u; t < num_tiles; t++) {
2067      ${j}
2068      k_start = k_start + ${c};
2069      workgroupBarrier();
2070
2071      for (var k: u32 = 0u; k < ${c}; k++) {
2072        ${S}
2073      }
2074      workgroupBarrier();
2075    }
2076
2077    ${I}
2078    let m = tile_row_start + local_id.y;
2079    let n = tile_col_start + local_id.x;
2080    ${w!=null?`let cOffset = ${w.broadcastedIndicesToOffset("vec2(m, n)",b)}; value += ${b.type.value}(uniforms.beta) * ${w.getByOffset("cOffset")};`:""}
2081    if (m < uniforms.M && n < uniforms.N) {
2082      output[m * uniforms.N + n] = value;
2083    }
2084  }`};return u?{name:"GemmShared",shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:d*p},programUniforms:f}),getShaderSource:k}:{name:"Gemm",shaderCache:{hint:`${t.cacheKey}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:f}),getShaderSource:v}},UB=e=>{let t=e.transA,r=e.transB,n=e.alpha,s=e.beta;return{transA:t,transB:r,alpha:n,beta:s,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},WB=(e,t)=>{RI(e.inputs),e.compute(DI(e.inputs,t))}}),pi,ji,Pl,Cl,FI,LI,zI,BI,UI,WI,VI,GI,VB,GB,$ne=Je(()=>{Mt(),Rt(),Zr(),Ft(),[pi,ji,Pl,Cl]=[0,1,2,3],FI=e=>{if(e[0].dims.length!==4)throw new Error("only 4-D tensor is supported.");if(e[0].dims.length!==e[1].dims.length)throw new Error("input dimensions must be equal to grid dimensions");if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw new Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw new Error("grid batch size must match input batch size")},LI=`
2085  fn gs_get_cubic_coeffs(x: f32) -> vec4<f32> {
2086    let cubic_alpha = -0.75f;
2087    let x_abs = abs(x);
2088    var coeffs: vec4<f32>;
2089    coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha);
2090    coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1);
2091    coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1);
2092    coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha);
2093    return coeffs;
2094  }
2095`,zI=e=>`
2096  fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} {
2097    var v: vec4<f32>;
2098    var coeffs = gs_get_cubic_coeffs(x);
2099    for (var i = 0; i < 4; i++) {
2100      v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3];
2101    }
2102    coeffs = gs_get_cubic_coeffs(y);
2103    let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]);
2104    return pixel;
2105  }
2106`,BI=e=>`
2107  fn gs_denormalize(n: f32, length: i32) -> f32 {
2108    ${e.alignCorners===0?`
2109    // alignCorners: false => [-1, 1] to [-0.5, length - 0.5]
2110    return ((n + 1.0) * f32(length) - 1.0) / 2.0;
2111    `:`
2112    // alignCorners: true => [-1, 1] to [0, length - 1]
2113    return (n + 1.0) / 2.0 * (f32(length - 1));
2114    `}
2115  }
2116`,UI=e=>`
2117  ${e.paddingMode==="reflection"?`
2118      fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 {
2119        var dx = 0.0;
2120        var fx = f32(x);
2121        let range = x_max - x_min;
2122        if (fx < x_min) {
2123          dx = x_min - fx;
2124          let n = u32(dx / range);
2125          let r = dx - f32(n) * range;
2126          if (n % 2 == 0) {
2127            fx = x_min + r;
2128          } else {
2129            fx = x_max - r;
2130          }
2131        } else if (fx > x_max) {
2132          dx = fx - x_max;
2133          let n = u32(dx / range);
2134          let r = dx - f32(n) * range;
2135          if (n % 2 == 0) {
2136            fx = x_max - r;
2137          } else {
2138            fx = x_min + r;
2139          }
2140        }
2141        return u32(fx);
2142      }`:""}
2143`,WI=(e,t,r)=>`
2144  fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4<f32>) -> ${t} {
2145     var pixel = ${t}(0);
2146     var indices = vec4<u32>(0);
2147     indices[${pi}] = batch;
2148     indices[${ji}] = channel;`+(()=>{switch(r.paddingMode){case"zeros":return`
2149          if (r >= 0 && r < H && c >=0 && c < W) {
2150            indices[${Pl}] = u32(r);
2151            indices[${Cl}] = u32(c);
2152          } else {
2153            return ${t}(0);
2154          }
2155        `;case"border":return`
2156          indices[${Pl}] = u32(clamp(r, 0, H - 1));
2157          indices[${Cl}] = u32(clamp(c, 0, W - 1));
2158        `;case"reflection":return`
2159          indices[${Pl}] = gs_reflect(r, border[1], border[3]);
2160          indices[${Cl}] = gs_reflect(c, border[0], border[2]);
2161        `;default:throw new Error(`padding mode ${r.paddingMode} is not supported`)}})()+`
2162    return ${e.getByIndices("indices")};
2163  }
2164`,VI=(e,t,r)=>(()=>{switch(r.mode){case"nearest":return`
2165          let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${pi}], indices[${ji}], border);
2166        `;case"bilinear":return`
2167          let x1 = i32(floor(x));
2168          let y1 = i32(floor(y));
2169          let x2 = x1 + 1;
2170          let y2 = y1 + 1;
2171
2172          let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${pi}], indices[${ji}], border);
2173          let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${pi}], indices[${ji}], border);
2174          let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${pi}], indices[${ji}], border);
2175          let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${pi}], indices[${ji}], border);
2176
2177          let dx2 = ${t}(f32(x2) - x);
2178          let dx1 = ${t}(x - f32(x1));
2179          let dy2 = ${t}(f32(y2) - y);
2180          let dy1 = ${t}(y - f32(y1));
2181          let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22);
2182        `;case"bicubic":return`
2183          let x0 = i32(floor(x)) - 1;
2184          let y0 = i32(floor(y)) - 1;
2185          var p: mat4x4<${t}>;
2186          for (var h = 0; h < 4; h++) {
2187            for (var w = 0; w < 4; w++) {
2188              p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${pi}], indices[${ji}], border);
2189            }
2190          }
2191
2192          let dx = x - f32(x0 + 1);
2193          let dy = y - f32(y0 + 1);
2194          let result = gs_bicubic_interpolate(p, dx, dy);
2195        `;default:throw new Error(`mode ${r.mode} is not supported`)}})()+`${e.setByOffset("global_idx","result")}`,GI=(e,t)=>{let r=De("x",e[0].dataType,e[0].dims.length),n=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],s=De("grid",e[1].dataType,n.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format==="NHWC"&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[pi,ji,Pl,Cl]=[0,3,1,2]);let i=ut("output",e[0].dataType,a.length),l=r.type.value,c=Ce.size(a),d=[{type:12,data:c},...vt(e[0].dims,n,a)],p=u=>`
2196  ${u.registerUniform("output_size","u32").declareVariables(r,s,i)}
2197  ${LI}
2198  ${zI(l)}
2199  ${BI(t)}
2200  ${UI(t)}
2201  ${WI(r,l,t)}
2202
2203  ${u.mainStart()}
2204    ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2205      let H_in = i32(uniforms.x_shape[${Pl}]);
2206      let W_in = i32(uniforms.x_shape[${Cl}]);
2207
2208      ${t.alignCorners===0?`
2209      let x_min = -0.5;
2210      let x_max = f32(W_in) - 0.5;
2211      let y_min = -0.5;
2212      let y_max = f32(H_in) - 0.5;
2213      `:`
2214      let x_min = 0.0;
2215      let x_max = f32(W_in) - 1.0;
2216      let y_min = 0.0;
2217      let y_max = f32(H_in) - 1.0;
2218      `};
2219      let border = vec4<f32>(x_min, y_min, x_max, y_max);
2220
2221      let indices = ${i.offsetToIndices("global_idx")};
2222      var grid_indices = vec3<u32>(indices[${pi}], indices[${Pl}], indices[${Cl}]);
2223      let nxy = ${s.getByIndices("grid_indices")};
2224      var x = gs_denormalize(f32(nxy[0]), W_in);
2225      var y = gs_denormalize(f32(nxy[1]), H_in);
2226
2227      ${VI(i,l,t)}
2228  }`;return{name:"GridSample",shaderCache:{hint:`${t.cacheKey}`,inputDependencies:["type","type"]},getRunData:u=>{let h=Ce.size(a);return{outputs:[{dims:a,dataType:u[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:d}},getShaderSource:p}},VB=(e,t)=>{FI(e.inputs),e.compute(GI(e.inputs,t))},GB=e=>cr({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),fs,qI,qB,Dw,HI,Tp,HB,KB=Je(()=>{Mt(),Rt(),Zr(),G1(),K1(),Ft(),al(),fs=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,qI=(e,t)=>{let r=e[0],n=fs(e,1),s=fs(e,2),a=fs(e,3),i=fs(e,4),l=fs(e,5),c=fs(e,6),d=fs(e,7);if(r.dims.length!==3&&r.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let p=r.dims[0],u=r.dims[1],h=r.dims.length===3?r.dims[2]:t.numHeads*r.dims[4],f=u,m=0,v=0,k=Math.floor(h/t.numHeads);if(c&&d&&Ce.size(c.dims)&&Ce.size(d.dims)){if(c.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(c.dims[0]!==p||c.dims[1]!==t.numHeads||c.dims[3]!==k)throw new Error('Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)');if(d.dims[0]!==p||d.dims[1]!==t.numHeads||d.dims[3]!==k)throw new Error('Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)');if(c.dims[2]!==d.dims[2])throw new Error('Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)');if(d.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');m=c.dims[2],v=c.dims[2]}else if(c&&Ce.size(c.dims)||d&&Ce.size(d.dims))throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let y;if(n&&Ce.size(n.dims)>0){if(r.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(n.dims.length<3||n.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(r.dims[0]!==n.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(n.dims.length===3){if(n.dims[2]!==r.dims[2])throw new Error('Input "query" and "key" shall have same dim 2 (hidden_size)');y=2,f=n.dims[1]}else if(n.dims.length===5){if(n.dims[2]!==t.numHeads||n.dims[3]!==2||n.dims[4]!==k)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(s)throw new Error('Expect "value" be none when "key" has packed kv format.');y=5,f=n.dims[1]}else{if(n.dims[1]!==t.numHeads||n.dims[3]!==k)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');y=0,f=n.dims[2]}}else{if(r.dims.length!==5)throw new Error('Input "query" is expected to have 5 dimensions when key is empty');if(r.dims[2]!==t.numHeads||r.dims[3]!==3)throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');y=3}if(a&&Ce.size(a.dims)>0){if(a.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimension');
vendor: 9,376 bytes, lines 2228-2276
2228if(n&&n.dims.length===5&&n.dims[3]===2)throw new Error("bias is not allowed for packed kv.")}let g=m+f,_=0;if(i&&Ce.size(i.dims)>0){_=8;let M=i.dims;throw M.length===1?M[0]===p?_=1:M[0]===3*p+2&&(_=3):M.length===2&&M[0]===p&&M[1]===g&&(_=5),_===8?new Error('Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)'):new Error("Mask not supported")}let w=!1,x=h;if(s&&Ce.size(s.dims)>0){if(s.dims.length!==3&&s.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(r.dims[0]!==s.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(s.dims.length===3){if(f!==s.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');x=s.dims[2]}else{if(f!==s.dims[2])throw new Error('Input "key" and "value" shall have the same dim 2 (kv_sequence_length)');x=s.dims[1]*s.dims[3],w=!0}}let b=!1;if(i&&Ce.size(i.dims)>0)throw new Error("Key padding mask is not supported");if(l&&Ce.size(l.dims)>0){if(l.dims.length!==4)throw new Error('Input "attention_bias" is expected to have 4 dimensions');if(l.dims[0]!==p||l.dims[1]!==t.numHeads||l.dims[2]!==u||l.dims[3]!==g)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:p,sequenceLength:u,pastSequenceLength:m,kvSequenceLength:f,totalSequenceLength:g,maxSequenceLength:v,inputHiddenSize:0,hiddenSize:h,vHiddenSize:x,headSize:k,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:_,scale:t.scale,broadcastResPosBias:b,passPastInKv:w,qkvFormat:y}},qB=e=>cr({...e}),Dw=cr({perm:[0,2,1,3]}),HI=(e,t,r,n,s,a,i)=>{let l=[n,s,a],c=Ce.size(l),d=[{type:12,data:c},{type:12,data:i},{type:12,data:a}],p=u=>{let h=ut("qkv_with_bias",t.dataType,l),f=De("qkv",t.dataType,l),m=De("bias",r.dataType,l),v=[{name:"output_size",type:"u32"},{name:"bias_offset",type:"u32"},{name:"hidden_size",type:"u32"}];return`
2229  ${u.registerUniforms(v).declareVariables(f,m,h)}
2230  ${u.mainStart()}
2231    ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2232    let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset;
2233
2234    qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx];
2235  }`};return e.compute({name:"MultiHeadAttentionAddBias",shaderCache:{inputDependencies:["type","type"]},getRunData:()=>({outputs:[{dims:l,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:p},{inputs:[t,r],outputs:[-1]})[0]},Tp=(e,t,r,n,s,a,i,l)=>{let c=a;if(i&&Ce.size(i.dims)>0){if(n===1)throw new Error("AddBiasReshape is not implemented. Please export your model with packed QKV or KV");return c=HI(e,a,i,t,n,r*s,l),c=c.reshape([t,n,r,s]),r===1||n===1?c:e.compute(Qs(c,Dw.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,n,r,s])),r===1||n===1?c:e.compute(Qs(c,Dw.perm),{inputs:[c],outputs:[-1]})[0]},HB=(e,t)=>{let r=qI(e.inputs,t),n=e.inputs[0],s=fs(e.inputs,1),a=fs(e.inputs,2),i=fs(e.inputs,3),l=fs(e.inputs,4),c=fs(e.inputs,5),d=fs(e.inputs,6),p=fs(e.inputs,7);if(n.dims.length===5)throw new Error("Packed QKV is not implemented");if((s==null?void 0:s.dims.length)===5)throw new Error("Packed KV is not implemented");let u=s&&a&&s.dims.length===4&&a.dims.length===4,h=Tp(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,n,i,0);if(u)return xh(e,h,s,a,l,void 0,d,p,c,r);if(!s||!a)throw new Error("key and value must be provided");let f=Tp(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.headSize,s,i,r.hiddenSize),m=Tp(e,r.batchSize,r.numHeads,r.kvSequenceLength,r.vHeadSize,a,i,2*r.hiddenSize);xh(e,h,f,m,l,void 0,d,p,c,r)}}),KI,QI,YI,JI,Kb,QB,YB,JB=Je(()=>{Mt(),Rt(),Zr(),Ft(),KI=e=>{if(!e||e.length<1)throw new Error("too few inputs")},QI=(e,t)=>{let r=[],n=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(s=>r.push(Number(s))),n=r.length),cr({numOutputs:n,axis:t.axis,splitSizes:r})},YI=e=>`
2236fn calculateOutputIndex(index: u32) -> u32 {
2237    for (var i: u32 = 0u; i < ${e}u; i += 1u ) {
2238    if (index < ${mt("uniforms.size_in_split_axis","i",e)}) {
2239        return i;
2240    }
2241    }
2242    return ${e}u;
2243}`,JI=e=>{let t=e.length,r=[];for(let n=0;n<t;++n){let s=e[n].setByIndices("indices","input[global_idx]");t===1?r.push(s):n===0?r.push(`if (output_number == ${n}u) { ${s} }`):n===t-1?r.push(`else { ${s} }`):r.push(`else if (output_number == ${n}) { ${s} }`)}return`
2244      fn writeBufferData(output_number: u32, indices: ${e[0].type.indices}, global_idx: u32) {
2245        ${r.join(`
2246`)}
2247      }`},Kb=(e,t)=>{let r=e[0].dims,n=Ce.size(r),s=e[0].dataType,a=Ce.normalizeAxis(t.axis,r.length),i=new Array(t.numOutputs),l=De("input",s,r.length),c=new Array(t.numOutputs),d=[],p=[],u=0,h=[{type:12,data:n}];for(let m=0;m<t.numOutputs;m++){u+=t.splitSizes[m],c[m]=u;let v=r.slice();v[a]=t.splitSizes[m],p.push(v),i[m]=ut(`output${m}`,s,v.length),d.push({dims:p[m],dataType:e[0].dataType})}h.push({type:12,data:c},...vt(r,...p));let f=m=>`
2248  ${m.registerUniform("input_size","u32").registerUniform("size_in_split_axis","u32",c.length).declareVariables(l,...i)}
2249  ${YI(c.length)}
2250  ${JI(i)}
2251
2252  ${m.mainStart()}
2253    ${m.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.input_size")}
2254
2255    var indices = ${l.offsetToIndices("global_idx")};
2256    var index = ${l.indicesGet("indices",a)};
2257    let output_number = calculateOutputIndex(index);
2258    if (output_number != 0) {
2259      index -= ${mt("uniforms.size_in_split_axis","output_number - 1u",c.length)};
2260      ${l.indicesSet("indices",a,"index")};
2261    }
2262    writeBufferData(output_number, indices, global_idx);
2263  }`;return{name:"Split",shaderCache:{hint:t.cacheKey,inputDependencies:["rank"]},getShaderSource:f,getRunData:()=>({outputs:d,dispatchGroup:{x:Math.ceil(n/64)},programUniforms:h})}},QB=(e,t)=>{KI(e.inputs);let r=e.inputs.length===1?t:QI(e.inputs,t);e.compute(Kb(e.inputs,r),{inputs:[0]})},YB=e=>{let t=e.axis,r=e.splitSizes,n=e.numOutputs<0?r.length:e.numOutputs;if(n!==r.length)throw new Error("numOutputs and splitSizes lengh must be equal");return cr({axis:t,numOutputs:n,splitSizes:r})}}),ZI,Hg,ZB,XB=Je(()=>{Mt(),Rt(),Zr(),Ft(),ZI=(e,t)=>{let[r,n,s,a]=e,{numHeads:i,rotaryEmbeddingDim:l}=t;if(r.dims.length!==3&&r.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${r.dims.length}`);if(!Ce.areEqual(n.dims,[])&&!Ce.areEqual(n.dims,[1])&&n.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${n.dims.length}`);if(s.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${s.dims.length}`);if(a.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!Ce.areEqual(s.dims,a.dims))throw new Error("Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape");if(l>0&&i===0)throw new Error("num_heads must be provided if rotary_embedding_dim is specified");let c=r.dims[0],d=r.dims[r.dims.length-2],p=s.dims[0],u=Ce.sizeFromDimension(r.dims,1)/d,h=l===0?s.dims[1]*2:u/i;if(l>h)throw new Error("rotary_embedding_dim must be less than or equal to head_size");if(n.dims.length===2){if(c!==n.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${n.dims[0]}`);if(d!==n.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${n.dims[1]}`)}if(h/2!==s.dims[1]&&l/2!==s.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${s.dims[1]}`);if(d>p)throw new Error("Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported")},Hg=(e,t)=>{let{interleaved:r,numHeads:n,rotaryEmbeddingDim:s,scale:a}=t,i=e[0].dims[0],l=Ce.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],d=l/c,p=e[2].dims[1],u=s===0?p*2:d/n,h=new Array(i,c,d/u,u-p),f=Ce.computeStrides(h),m=[{type:1,data:a},{type:12,data:h},{type:12,data:f},...e[0].dims.length===3?new Array({type:12,data:[l,d,u,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[l,u,c*u,1]}):[],...vt(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],v=k=>{let y=De("input",e[0].dataType,e[0].dims.length),g=De("position_ids",e[1].dataType,e[1].dims.length),_=De("cos_cache",e[2].dataType,e[2].dims.length),w=De("sin_cache",e[3].dataType,e[3].dims.length),x=ut("output",e[0].dataType,e[0].dims.length);return k.registerUniforms([{name:"scale",type:"f32"},{name:"global_shape",type:"u32",length:h.length},{name:"global_strides",type:"u32",length:f.length},{name:"input_output_strides",type:"u32",length:f.length}]),`
2264        ${k.declareVariables(y,g,_,w,x)}
2265
2266        ${k.mainStart(Jd)}
2267          let half_rotary_emb_dim = uniforms.${_.name}_shape[1];
2268          let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape;
2269          let size = uniforms.global_shape[0] * uniforms.global_strides[0];
2270          ${k.guardAgainstOutOfBoundsWorkgroupSizes("size")}
2271
2272          if (bsnh[3] < half_rotary_emb_dim) {
2273            let position_ids_idx =
2274                ${g.broadcastedIndicesToOffset("bsnh.xy",ut("",g.type.tensor,2))};
2275            let position_id =
2276                u32(${g.getByOffset("position_ids_idx")}) + select(0, bsnh[1], position_ids_idx == 0);
2277            let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${r});
2278            let j = i + select(half_rotary_emb_dim, 1, ${r});
2279            let re = ${y.getByOffset("i")} * ${_.get("position_id","bsnh[3]")} -
2280                ${y.getByOffset("j")} * ${w.get("position_id","bsnh[3]")};
2281            ${x.setByOffset("i","re")}
2282            let im = ${y.getByOffset("i")} * ${w.get("position_id","bsnh[3]")} +
2283                ${y.getByOffset("j")} * ${_.get("position_id","bsnh[3]")};
2284            ${x.setByOffset("j","im")}
2285          } else {
2286            let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim;
2287            ${x.setByOffset("k",y.getByOffset("k"))}
2288          }
2289        }`};return{name:"RotaryEmbedding",shaderCache:{hint:cr({interleaved:r}).cacheKey,inputDependencies:["rank","rank","rank","rank"]},getShaderSource:v,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Ce.size(h)/Jd)},programUniforms:m})}},ZB=(e,t)=>{ZI(e.inputs,t),e.compute(Hg(e.inputs,t))}}),XI,e$,Fw,t$,e4,Nne=Je(()=>{Zr(),Mt(),K1(),KB(),JB(),al(),XB(),Ft(),XI=(e,t)=>{if(t.doRotary&&e.length<=7)throw new Error("cos_cache and sin_cache inputs are required if do_rotary is specified");let r=e[0],n=e[1],s=e[2],a=e[3],i=e[4];if(t.doRotary!==0&&e.length<=7)throw new Error("cos_cast and sin_cache are expected if do_rotary attribute is non-zero");if(t.localWindowSize!==-1)throw new Error("Local attention is not supported");if(t.softcap!==0)throw new Error("Softcap is not supported");if(t.rotaryInterleaved!==0)throw new Error("Rotary interleaved is not supported");if(t.smoothSoftmax)throw new Error("Smooth softmax is not supported");if(r.dims.length!==3&&r.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let l=!1,c=r.dims[0],d=r.dims[1],p=r.dims.length===3?l?r.dims[2]/3:r.dims[2]:t.numHeads*r.dims[4],u=d,h=0,f=!n||n.dims.length===0,m=Math.floor(f?p/(t.numHeads+2*t.kvNumHeads):p/t.numHeads);f&&(p=m*t.numHeads);let v=a&&a.dims.length!==0,k=i&&i.dims.length!==0;if(v&&a.dims.length===4&&a.dims[0]===c&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===m)throw new Error("BSNH pastKey/pastValue is not supported");if(v&&k){if(a.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(i.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');h=a.dims[2]}else if(v||k)throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let y=1;if(n&&n.dims.length>0){if(r.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(n.dims.length<3||n.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(r.dims[0]!==n.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(n.dims.length===3){if(r.dims[2]%n.dims[2]!==0)throw new Error('Dimension 2 of "query" should be a multiple of "key"');u=n.dims[1]}else if(n.dims.length===5){if(n.dims[2]!==t.numHeads||n.dims[3]!==2||n.dims[4]!==m)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(s)throw new Error('Expect "value" be none when "key" has packed kv format.');u=n.dims[1]}else{if(n.dims[1]!==t.numHeads||n.dims[3]!==m)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');u=n.dims[2]}}else{if(r.dims.length!==3&&r.dims.length!==5)throw new Error('Input "query" is expected to have 3 or 5 dimensions when key is empty');if(r.dims.length===5&&(r.dims[2]!==t.numHeads||r.dims[3]!==3))throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');y=3}let g=0,_=!1,w=t.kvNumHeads?m*t.kvNumHeads:p;if(s&&s.dims.length>0){if(s.dims.length!==3&&s.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(r.dims[0]!==s.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(s.dims.length===3){if(u!==s.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');w=s.dims[2]}else{if(u!==s.dims[2])throw new Error('Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)');w=s.dims[1]*s.dims[3],_=!0}}let x=e.length>4?e[5]:void 0;
vendor: 4,312 bytes, lines 2289-2320
2289if(x&&x.dims.length!==1&&x.dims[0]!==c)throw new Error('Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size');return{batchSize:c,sequenceLength:d,pastSequenceLength:h,kvSequenceLength:u,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:p,vHiddenSize:w,headSize:m,vHeadSize:Math.floor(w/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:g,scale:t.scale,broadcastResPosBias:!1,passPastInKv:_,qkvFormat:y}},e$=cr({perm:[0,2,1,3]}),Fw=(e,t,r)=>{let n=t,s=r.kvNumHeads;return t.dims.length===3&&r.kvSequenceLength!==0&&(n=t.reshape([r.batchSize,r.kvSequenceLength,s,r.headSize]),n=e.compute(Qs(n,e$.perm),{inputs:[n],outputs:[-1]})[0]),n},t$=(e,t,r,n)=>{let s=7,a=["type","type"],i=[e*t],l=e*t,c=[{type:12,data:l},{type:12,data:t},{type:12,data:e}],d=p=>{let u=De("seq_lens",r.dataType,r.dims),h=De("total_seq_lens",n.dataType,n.dims),f=ut("pos_ids",s,i),m=[{name:"output_size",type:"u32"},{name:"sequence_length",type:"u32"},{name:"batch_size",type:"u32"}];return`
2290  ${p.registerUniforms(m).declareVariables(u,h,f)}
2291  ${p.mainStart()}
2292    ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2293    let total_sequence_length = u32(${h.getByOffset("0")});
2294    let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length;
2295    let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length;
2296    let batch_idx = global_idx / uniforms.sequence_length;
2297    let sequence_idx = i32(global_idx % uniforms.sequence_length);
2298    var pos_id: i32 = 0;
2299    let seqlen = ${u.getByOffset("batch_idx")};
2300    let total_seqlen = seqlen + 1;
2301    if (is_first_prompt) {
2302      if (sequence_idx < total_seqlen) {
2303        pos_id = sequence_idx;
2304      } else {
2305        pos_id = 1;
2306      }
2307      ${f.setByOffset("global_idx","pos_id")}
2308    } else if (is_subsequent_prompt) {
2309      let past_seqlen = total_seqlen - i32(uniforms.sequence_length);
2310      if (past_seqlen + sequence_idx < total_seqlen) {
2311        pos_id = past_seqlen + sequence_idx;
2312      } else {
2313        pos_id = 1;
2314      }
2315      ${f.setByOffset("global_idx","pos_id")}
2316    } else if (global_idx < uniforms.batch_size) {
2317      ${f.setByOffset("global_idx","seqlen")}
2318    };
2319  }
2320  `};return{name:"GeneratePositionIds",shaderCache:{hint:`${e};${t}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:i,dataType:s}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:c}),getShaderSource:d}},e4=(e,t)=>{var w;let r=XI(e.inputs,t);if(e.inputs[0].dims.length===5)throw new Error("Packed QKV is not implemented");if(((w=e.inputs[1])==null?void 0:w.dims.length)===5)throw new Error("Packed KV is not implemented");let n=e.inputs[0],s=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,i=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,l=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,d=e.inputs.length>5?e.inputs[6]:void 0,p=r.kvNumHeads?r.kvNumHeads:r.numHeads,u=cr({axis:2,numOutputs:3,splitSizes:[r.numHeads*r.headSize,p*r.headSize,p*r.headSize]}),[h,f,m]=!s&&!a?e.compute(Kb([n],u),{inputs:[n],outputs:[-1,-1,-1]}):[n,s,a],v,k;if(t.doRotary){let x=e.compute(t$(r.batchSize,r.sequenceLength,c,d),{inputs:[c,d],outputs:[-1]})[0],b=e.inputs[7],M=e.inputs[8],S=cr({interleaved:t.rotaryInterleaved!==0,numHeads:r.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),j=[h,x,b,M],I=[-1];v=e.compute(Hg(j,S),{inputs:j,outputs:I})[0],j.splice(0,1,f);let q=cr({interleaved:t.rotaryInterleaved!==0,numHeads:r.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});k=e.compute(Hg(j,q),{inputs:j,outputs:I})[0]}let y=Tp(e,r.batchSize,r.numHeads,r.sequenceLength,r.headSize,t.doRotary?v:h,void 0,0),g=Fw(e,t.doRotary?k:f,r),_=Fw(e,m,r);xh(e,y,g,_,void 0,void 0,i,l,void 0,r,c,d)}}),Lw,r$,n$,t4,One=Je(()=>{Mt(),Rt(),al(),Ft(),Lw=(e,t,r,n,s,a,i,l)=>{let c=Wr(a),d=c===1?"f32":`vec${c}f`,p=c===1?"vec2f":`mat2x${c}f`,u=s*i,h=64;u===1&&(h=256);let f=[s,i,a/c],m=[s,i,2],v=["rank","type","type"],k=[];k.push(...vt(f,m));let y=g=>{let _=De("x",t.dataType,3,c),w=De("scale",r.dataType,r.dims),x=De("bias",n.dataType,n.dims),b=ut("output",1,3,2),M=[_,w,x,b];return`
2321  var<workgroup> workgroup_shared : array<${p}, ${h}>;
2322  const workgroup_size = ${h}u;
2323  ${g.declareVariables(...M)}
2324  ${g.mainStart(h)}
2325    let batch = workgroup_index / uniforms.x_shape[1];
2326    let channel = workgroup_index % uniforms.x_shape[1];
2327    let hight = uniforms.x_shape[2];
2328    // initialize workgroup memory
2329    var sum = ${d}(0);
2330    var squared_sum = ${d}(0);
2331    for (var h = local_idx; h < hight; h += workgroup_size) {
2332      let value = ${d}(${_.get("batch","channel","h")});
2333      sum += value;
2334      squared_sum += value * value;
2335    }
2336    workgroup_shared[local_idx] = ${p}(sum, squared_sum);
2337    workgroupBarrier();
2338
2339    for (var currSize = workgroup_size >> 1;  currSize > 0; currSize = currSize >> 1) {
2340      if (local_idx < currSize) {
2341        workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize];
2342      }
2343      workgroupBarrier();
2344    }
2345    if (local_idx == 0) {
2346      let sum_final = ${Yo("workgroup_shared[0][0]",c)} / f32(hight * ${c});
2347      let squared_sum_final = ${Yo("workgroup_shared[0][1]",c)} / f32(hight * ${c});
2348
2349      let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${l}));
2350      let channel_scale = inv_std_dev * f32(scale[channel]);
2351      let channel_shift = f32(bias[channel]) - sum_final * channel_scale;
2352      output[workgroup_index] = vec2f(channel_scale, channel_shift);
2353    }
2354  }`};return e.compute({name:"InstanceNormComputeChannelScaleShift",shaderCache:{hint:`${c};${l};${h}`,inputDependencies:v},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:u},programUniforms:k}),getShaderSource:y},{inputs:[t,r,n],outputs:[-1]})[0]},r$=(e,t,r)=>{let n=t[0].dims,s=n,a=2,i=n[0],l=n[1],c=Ce.sizeFromDimension(n,a),d=Wr(c),p=Ce.size(s)/d,u=Lw(e,t[0],t[1],t[2],i,c,l,r.epsilon),h=[i,l,c/d],f=[i,l],m=["type","none"],v=k=>{let y=De("x",t[0].dataType,h.length,d),g=De("scale_shift",1,f.length,2),_=ut("output",t[0].dataType,h.length,d),w=[y,g,_];return`
2355  ${k.registerUniform("output_size","u32").declareVariables(...w)}
2356  ${k.mainStart()}
2357  ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2358      let outputIndices = ${_.offsetToIndices("global_idx")};
2359      let batch = outputIndices[0];
2360      let channel = outputIndices[1];
2361      let scale_shift = ${g.getByIndices("vec2<u32>(batch, channel)")};
2362      let value = ${y.getByOffset("global_idx")} * ${_.type.value}(scale_shift.x) + ${_.type.value}(scale_shift.y);
2363      ${_.setByOffset("global_idx","value")};
2364  }`};e.compute({name:"InstanceNormalization",shaderCache:{hint:`${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:s,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:[{type:12,data:p},...vt(h,f,h)]}),getShaderSource:v},{inputs:[t[0],u]})},n$=(e,t,r)=>{let n=t[0].dims,s=n,a=n[0],i=n[n.length-1],l=Ce.sizeFromDimension(n,1)/i,c=Wr(i),d=Ce.size(s)/c,p=[{type:12,data:l},{type:12,data:Math.floor(i/c)}],u=["type","type"],h=!1,f=[0,n.length-1];for(let y=0;y<n.length-2;y++)h=h||n[y+1]!==1,f.push(y+1);h=h&&n[n.length-1]!==1;let m=h?e.compute(Qs(e.inputs[0],f),{inputs:[e.inputs[0]],outputs:[-1]})[0]:e.inputs[0].reshape(Array.from({length:n.length},(y,g)=>n[f[g]])),v=Lw(e,m,t[1],t[2],a,l,i,r.epsilon),k=y=>
vendor: 12,639 bytes, lines 2364-2496
2364{let g=Dn(t[0].dataType),_=c===1?"vec2f":`mat${c}x2f`,w=M=>{let S=M===0?"x":"y",j=c===1?"f32":`vec${c}f`;switch(c){case 1:return`${g}(${j}(scale.${S}))`;case 2:return`vec2<${g}>(${j}(scale[0].${S}, scale[1].${S}))`;case 4:return`vec4<${g}>(${j}(scale[0].${S}, scale[1].${S}, scale[2].${S}, scale[3].${S}))`;default:throw new Error(`Not supported compoents ${c}`)}},x=De("input",t[0].dataType,t[0].dims,c),b=ut("output",t[0].dataType,s,c);return`
2365  @group(0) @binding(0) var<storage, read> input : array<${x.type.storage}>;
2366  @group(0) @binding(1) var<storage, read> scale_input : array<${_}>;
2367  @group(0) @binding(2) var<storage, read_write> output : array<${b.type.storage}>;
2368  struct Uniforms {H: u32, C : u32};
2369  @group(0) @binding(3) var<uniform> uniforms: Uniforms;
2370
2371  ${y.mainStart()}
2372    let current_image_number = global_idx / (uniforms.C * uniforms.H);
2373    let current_channel_number = global_idx % uniforms.C;
2374
2375    let scale_offset = current_image_number * uniforms.C + current_channel_number;
2376    let scale = scale_input[scale_offset];
2377    output[global_idx] = fma(input[global_idx], ${w(0)}, ${w(1)});
2378  }`};e.compute({name:"InstanceNormalizationNHWC",shaderCache:{hint:`${c}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:s,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:p}),getShaderSource:k},{inputs:[t[0],v]})},t4=(e,t)=>{t.format==="NHWC"?n$(e,e.inputs,t):r$(e,e.inputs,t)}}),s$,a$,r4,Rne=Je(()=>{Mt(),Rt(),Ft(),s$=e=>{if(!e||e.length<2)throw new Error("layerNorm requires at least 2 inputs.")},a$=(e,t,r)=>{let n=t.simplified,s=e[0].dims,a=e[1],i=!n&&e[2],l=s,c=Ce.normalizeAxis(t.axis,s.length),d=Ce.sizeToDimension(s,c),p=Ce.sizeFromDimension(s,c),u=Ce.size(a.dims),h=i?Ce.size(i.dims):0;if(u!==p||i&&h!==p)throw new Error(`Size of X.shape()[axis:] == ${p}.
2379       Size of scale and bias (if provided) must match this.
2380       Got scale size of ${u} and bias size of ${h}`);let f=[];for(let x=0;x<s.length;++x)x<c?f.push(s[x]):f.push(1);let m=Wr(p),v=["type","type"],k=[{type:12,data:d},{type:1,data:p},{type:12,data:Math.floor(p/m)},{type:1,data:t.epsilon}];i&&v.push("type");let y=r>1,g=r>2,_=x=>{let b=Dn(e[0].dataType),M=[De("x",e[0].dataType,e[0].dims,m),De("scale",a.dataType,a.dims,m)];i&&M.push(De("bias",i.dataType,i.dims,m)),M.push(ut("output",e[0].dataType,l,m)),y&&M.push(ut("mean_data_output",1,f)),g&&M.push(ut("inv_std_output",1,f));let S=[{name:"norm_count",type:"u32"},{name:"norm_size",type:"f32"},{name:"norm_size_vectorized",type:"u32"},{name:"epsilon",type:"f32"}];return`
2381  ${x.registerUniforms(S).declareVariables(...M)}
2382  ${x.mainStart()}
2383    ${x.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.norm_count")}
2384    let offset = global_idx * uniforms.norm_size_vectorized;
2385    var mean_vector = ${Lb("f32",m)};
2386    var mean_square_vector = ${Lb("f32",m)};
2387
2388    for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) {
2389      let value = ${yd(b,m,"x[h + offset]")};
2390      mean_vector += value;
2391      mean_square_vector += value * value;
2392    }
2393    let mean = ${Yo("mean_vector",m)} / uniforms.norm_size;
2394    let inv_std_dev = inverseSqrt(${Yo("mean_square_vector",m)} / uniforms.norm_size ${n?"":"- mean * mean"} + uniforms.epsilon);
2395
2396    for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) {
2397      let f32input = ${yd(b,m,"x[j + offset]")};
2398      let f32scale = ${yd(b,m,"scale[j]")};
2399      output[j + offset] = ${M[0].type.value}((f32input ${n?"":"- mean"}) * inv_std_dev * f32scale
2400        ${i?`+ ${yd(b,m,"bias[j]")}`:""}
2401      );
2402    }
2403
2404    ${y?"mean_data_output[global_idx] = mean":""};
2405    ${g?"inv_std_output[global_idx] = inv_std_dev":""};
2406  }`},w=[{dims:l,dataType:e[0].dataType}];return y&&w.push({dims:f,dataType:1}),g&&w.push({dims:f,dataType:1}),{name:"LayerNormalization",shaderCache:{hint:`${m};${r};${n}`,inputDependencies:v},getRunData:()=>({outputs:w,dispatchGroup:{x:Math.ceil(d/64)},programUniforms:k}),getShaderSource:_}},r4=(e,t)=>{s$(e.inputs),e.compute(a$(e.inputs,t,e.outputCount))}}),i$,n4,Dne=Je(()=>{Rt(),X1(),ek(),i$=e=>{if(!e||e.length!==2)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.")},n4=e=>{i$(e.inputs);let t=Yd.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw new Error("Can't use matmul on the given tensors");let r=t[t.length-1],n=e.inputs[0].dims[e.inputs[0].dims.length-1];if(r<8&&n<8)e.compute(Z1(e.inputs,{activation:""},t));else{let s=t[t.length-2],a=Ce.size(e.inputs[0].dims.slice(0,-2)),i=Ce.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&s===1&&i===1){let l=e.inputs[0].reshape([1,a,n]),c=e.inputs[1].reshape([1,n,r]),d=[1,a,r],p=[l,c];e.compute(qg(p,{activation:""},t,d),{inputs:p})}else e.compute(qg(e.inputs,{activation:""},t))}}}),o$,l$,c$,s4,a4,Fne=Je(()=>{Mt(),Rt(),Zr(),Ft(),o$=(e,t)=>{if(e.length<3||e.length>4)throw new Error("MatMulNBits requires 3 or 4 inputs");let r=e[0],n=r.dims.length;if(r.dims[n-1]!==t.k)throw new Error("The last dim of input shape does not match the k value");let s=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,i=e[1];if(!Ce.areEqual(i.dims,[t.n,s,a]))throw new Error("The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize");let l=e[2].dims;if(Ce.size(l)!==t.n*s)throw new Error("scales input size error.");if(e.length===4){let c=e[3].dims,d=t.bits>4?t.n*s:t.n*Math.floor((s+1)/2);if(Ce.size(c)!==d)throw new Error("zeroPoints input size error.")}},l$=(e,t)=>{let r=e[0].dims,n=r.length,s=r[n-2],a=t.k,i=t.n,l=r.slice(0,n-2),c=Ce.size(l),d=e[1].dims[2]/4,p=e[0].dataType,u=Wr(t.k),h=Wr(d),f=Wr(i),m=l.concat([s,i]),v=s>1&&i/f%2===0?2:1,k=Ce.size(m)/f/v,y=64,g=[],_=[c,s,a/u],w=Ce.convertShape(e[1].dims).slice();w.splice(-1,1,d/h),g.push(...vt(_)),g.push(...vt(w)),g.push(...vt(e[2].dims)),e.length===4&&g.push(...vt(Ce.convertShape(e[3].dims)));let x=[c,s,i/f];g.push(...vt(x));let b=M=>{let S=_.length,j=De("a",e[0].dataType,S,u),I=De("b",12,w.length,h),q=De("scales",e[2].dataType,e[2].dims.length),U=[j,I,q],R=e.length===4?De("zero_points",12,e[3].dims.length):void 0;R&&U.push(R);let K=x.length,H=ut("output",e[0].dataType,K,f),ee=Dn(e[0].dataType),te=(()=>{switch(u){case 1:return`array<${ee}, 8>`;case 2:return`mat4x2<${ee}>`;case 4:return`mat2x4<${ee}>`;default:throw new Error(`${u}-component is not supported.`)}})(),V=()=>{let L=`
2407          // reuse a data
2408            var input_offset = ${j.indicesToOffset(`${j.type.indices}(batch, row, word_offset)`)};
2409            var a_data: ${te};
2410            for (var j: u32 = 0; j < ${8/u}; j++) {
2411              a_data[j] = ${j.getByOffset("input_offset")};
2412              input_offset++;
2413            }
2414          `;for(let $=0;$<f*v;$++)L+=`
2415            b_value = ${h===1?`b${$}_data`:`b${$}_data[i]`};
2416            b_value_lower = unpack4xU8(b_value & b_mask);
2417            b_value_upper = unpack4xU8((b_value >> 4) & b_mask);
2418            b_quantized_values = ${te}(${Array.from({length:4},(G,se)=>`${ee}(b_value_lower[${se}]), ${ee}(b_value_upper[${se}])`).join(", ")});
2419            b_dequantized_values = ${u===1?`${te}(${Array.from({length:8},(G,se)=>`(b_quantized_values[${se}] - ${R?`zero_point${$}`:"zero_point"}) * scale${$}`).join(", ")});`:`(b_quantized_values - ${te}(${Array(8).fill(`${R?`zero_point${$}`:"zero_point"}`).join(",")})) * scale${$};`};
2420            workgroup_shared[local_id.x * ${v} + ${Math.floor($/f)}]${f>1?`[${$%f}]`:""} += ${Array.from({length:8/u},(G,se)=>`${u===1?`a_data[${se}] * b_dequantized_values[${se}]`:`dot(a_data[${se}], b_dequantized_values[${se}])`}`).join(" + ")};
2421          `;return L},ae=()=>{let L=`
2422            var col_index = col * ${f};
2423            ${R?`
2424            let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2;
2425            var zero_point_byte_count: u32;
2426            var zero_point_word_index: u32;
2427            var zero_point_byte_offset: u32;
2428            let zero_point_nibble_offset: u32 = block & 0x1u;
2429            var zero_point_bits_offset: u32;
2430            var zero_point_word: u32;`:`
2431            // The default zero point is 8 for unsigned 4-bit quantization.
2432            let zero_point = ${ee}(8);`}
2433            `;for(let $=0;$<f*v;$++)L+=`
2434            let scale${$} = ${q.getByOffset("col_index * nBlocksPerCol + block")};
2435            ${R?`
2436            zero_point_byte_count = col_index * zero_point_bytes_per_col + (block >> 0x1u);
2437            zero_point_word_index = zero_point_byte_count >> 0x2u;
2438            zero_point_byte_offset = zero_point_byte_count & 0x3u;
2439            zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2);
2440            zero_point_word = ${R.getByOffset("zero_point_word_index")} >> zero_point_bits_offset;
2441            let zero_point${$} = ${ee}((zero_point_word) & 0xFu);`:""}
2442            col_index += 1;`;return L},ne=()=>{let L=`col_index = col * ${f};`;for(let $=0;$<f*v;$++)L+=`
2443            let b${$}_data = ${I.getByIndices(`${I.type.indices}(col_index, block, word)`)};
2444            col_index += 1;`;return L+=`
2445            var b_value: u32;
2446            let b_mask: u32 = 0x0F0F0F0Fu;
2447            var b_value_lower: vec4<u32>;
2448            var b_value_upper: vec4<u32>;
2449            var b_quantized_values: ${te};
2450            var b_dequantized_values: ${te};`,L};return`
2451        var<workgroup> workgroup_shared: array<${H.type.value}, ${v*y}>;
2452        ${M.declareVariables(...U,H)}
2453        ${M.mainStart([y,1,1])}
2454          let output_indices = ${H.offsetToIndices(`(global_idx / ${y}) * ${v}`)};
2455          let col = output_indices[2];
2456          let row = output_indices[1];
2457          let batch = output_indices[0];
2458          let nBlocksPerCol = uniforms.b_shape[1];
2459
2460          for (var block = local_id.x; block < nBlocksPerCol; block += ${y}) {
2461            //process one block
2462            var word_offset: u32 = block * ${t.blockSize/u};
2463            ${ae()}
2464            for (var word: u32 = 0; word < ${d}; word += ${h}) {
2465              ${ne()}
2466              for (var i: u32 = 0; i < ${h}; i++) {
2467                ${V()}
2468                word_offset += ${8/u};
2469              }
2470            }
2471          }
2472          workgroupBarrier();
2473
2474          if (local_id.x < ${v}) {
2475            var output_value: ${H.type.value} = ${H.type.value}(0);
2476            var workgroup_shared_offset: u32 = local_id.x;
2477            for (var b: u32 = 0u; b < ${y}u; b++) {
2478              output_value += workgroup_shared[workgroup_shared_offset];
2479              workgroup_shared_offset += ${v};
2480            }
2481            ${H.setByIndices(`${H.type.indices}(batch, row, col + local_id.x)`,"output_value")};
2482          }
2483        }`};return{name:"MatMulNBits",shaderCache:{hint:`${t.blockSize};${t.bits};${u};${h};${f};${v};${y}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:m,dataType:p}],dispatchGroup:{x:k},programUniforms:g}),getShaderSource:b}},c$=(e,t)=>{let r=e[0].dims,n=r.length,s=r[n-2],a=t.k,i=t.n,l=r.slice(0,n-2),c=Ce.size(l),d=e[1].dims[2]/4,p=e[0].dataType,u=Wr(t.k),h=Wr(d),f=l.concat([s,i]),m=128,v=i%8===0?8:i%4===0?4:1,k=m/v,y=k*h*8,g=y/u,_=y/t.blockSize,w=Ce.size(f)/v,x=[],b=[c,s,a/u],M=Ce.convertShape(e[1].dims).slice();M.splice(-1,1,d/h),x.push(...vt(b)),x.push(...vt(M)),x.push(...vt(e[2].dims)),e.length===4&&x.push(...vt(Ce.convertShape(e[3].dims)));let S=[c,s,i];x.push(...vt(S));let j=I=>{let q=b.length,U=De("a",e[0].dataType,q,u),R=De("b",12,M.length,h),K=De("scales",e[2].dataType,e[2].dims.length),H=[U,R,K],ee=e.length===4?De("zero_points",12,e[3].dims.length):void 0;ee&&H.push(ee);let te=S.length,V=ut("output",e[0].dataType,te),ae=Dn(e[0].dataType),ne=()=>{switch(u){case 1:return`
2484          let a_data0 = vec4<${ae}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]);
2485          let a_data1 = vec4<${ae}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return`
2486          let a_data0 = vec4<${ae}>(sub_a[word_offset], sub_a[word_offset + 1]);
2487          let a_data1 = vec4<${ae}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return`
2488          let a_data0 = sub_a[word_offset];
2489          let a_data1 = sub_a[word_offset + 1];`;default:throw new Error(`${u}-component is not supported.`)}};return`
2490        var<workgroup> sub_a: array<${U.type.value}, ${g}>;
2491        var<workgroup> inter_results: array<array<${V.type.value}, ${k}>, ${v}>;
2492        ${I.declareVariables(...H,V)}
2493        ${I.mainStart([k,v,1])}
2494          let output_indices = ${V.offsetToIndices(`workgroup_index * ${v}`)};
2495          let col = output_indices[2];
2496          let row = output_indices[1];
2497          let batch = output_indices[0];
2498          let n_blocks_per_col = uniforms.b_shape[1];
2499          let num_tiles =  (n_blocks_per_col - 1) / ${_} + 1;
2500
2501          // Loop over shared dimension.
2502          for (var tile: u32 = 0; tile < num_tiles; tile += 1) {
2503            let a_col_start = tile * ${g};
2504            // load one tile A data into shared memory.
2505            for (var a_offset = local_idx; a_offset < ${g}; a_offset += ${m})
2506            {
2507              let a_col = a_col_start + a_offset;
2508              if (a_col < uniforms.a_shape[2])
2509              {
2510                sub_a[a_offset] = ${U.getByIndices(`${U.type.indices}(batch, row, a_col)`)};
2511              } else {
2512                sub_a[a_offset] = ${U.type.value}(0);
2513              }
2514            }
2515            workgroupBarrier();
2516
2517            // each thread process one block
2518            let b_row = col + local_id.y;
2519            let block = tile * ${_} + local_id.x;
2520            ${ee?`
2521            let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2;
2522            let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u);
2523            let zero_point_word_index = zero_point_byte_count >> 0x2u;
2524            let zero_point_byte_offset = zero_point_byte_count & 0x3u;
2525            let zero_point_nibble_offset: u32 = block & 0x1u;
2526            let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2);
2527            let zero_point_word = ${ee.getByOffset("zero_point_word_index")} >> zero_point_bits_offset;
2528            let zero_point = ${ae}((zero_point_word) & 0xFu);`:`
2529            // The default zero point is 8 for unsigned 4-bit quantization.
2530            let zero_point = ${ae}(8);`}
2531            let scale = ${K.getByOffset("b_row * n_blocks_per_col + block")};
2532            let b_data = ${R.getByIndices(`${R.type.indices}(b_row, block, 0)`)};
2533            var word_offset = local_id.x * ${t.blockSize/u};
2534            for (var i: u32 = 0; i < ${h}; i++) {
2535              ${ne()}
2536              let b_value = ${h===1?"b_data":"b_data[i]"};
2537              let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu);
2538              let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu);
2539              let b_quantized_values = mat2x4<${ae}>(${Array.from({length:4},(L,$)=>`${ae}(b_value_lower[${$}]), ${ae}(b_value_upper[${$}])`).join(", ")});
2540              let b_dequantized_values = (b_quantized_values - mat2x4<${ae}>(${Array(8).fill("zero_point").join(",")})) * scale;
2541              inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(L,$)=>`${`dot(a_data${$}, b_dequantized_values[${$}])`}`).join(" + ")};
2542              word_offset += ${8/u};
2543            }
2544            workgroupBarrier();
2545          }
2546
2547          if (local_idx < ${v}) {
2548            var output_value: ${V.type.value} = ${V.type.value}(0);
2549            for (var b = 0u; b < ${k}; b++) {
2550              output_value += inter_results[local_idx][b];
2551            }
2552            if (col + local_idx < uniforms.output_shape[2])
2553            {
2554              ${V.setByIndices(`${V.type.indices}(batch, row, col + local_idx)`,"output_value")}
2555            }
2556          }
2557        }`};return{name:"BlockwiseMatMulNBits32",shaderCache:{hint:`${t.blockSize};${u};${h};${k};${v}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:f,dataType:p}],dispatchGroup:{x:w},programUniforms:x}),getShaderSource:j}},s4=(e,t)=>{o$(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor("intel")&&e.adapterInfo.isArchitecture("gen-12lp")?e.compute(c$(e.inputs,t)):e.compute(l$(e.inputs,t))},a4=e=>cr(e)}),d$,u$,p$,h$,f$,m$,g$,y$,i4,Lne=Je(()=>{Mt(),Rt(),Ft(),d$=e=>{if(!e||e.length<1)throw new Error("Too few inputs");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error("Input type must be float or float16.");if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw new Error("The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].")}},u$=(e,t,r)=>{let n="";for(let s=t-1;s>=0;--s)n+=`
2558            k = i32(${e.indicesGet("indices",s)}) - ${mt("uniforms.pads",s,r)};
2559            if (k < 0) {
2560              break;
2561            }
2562            if (k >= i32(${mt("uniforms.x_shape",s,t)})) {
2563              break;
2564            }
2565            offset += k * i32(${mt("uniforms.x_strides",s,t)}
2565);
2566        `;return`
2567          value = ${e.type.value}(uniforms.constant_value);
2568          for (var i = 0; i < 1; i++) {
2569            var offset = 0;
2570            var k = 0;
2571            ${n}
2572            value = x[offset];
2573          }
2574      `},p$=(e,t,r)=>{let n="";for(let s=t-1;s>=0;--s)n+=`
2575                k = i32(${e.indicesGet("indices",s)}) - ${mt("uniforms.pads",s,r)};
2576                if (k < 0) {
2577                  k = -k;
2578                }
2579                {
2580                  let _2n_1 = 2 * (i32(${mt("uniforms.x_shape",s,t)}) - 1);
2581                  k = k % _2n_1;
2582                  if(k >= i32(${mt("uniforms.x_shape",s,t)})) {
2583                    k = _2n_1 - k;
2584                  }
2585                }
2586                offset += k * i32(${mt("uniforms.x_strides",s,t)});
2587            `;return`
2588              var offset = 0;
2589              var k = 0;
2590              ${n}
2591              value = x[offset];
2592          `},h$=(e,t,r)=>{let n="";for(let s=t-1;s>=0;--s)n+=`
2593                k = i32(${e.indicesGet("indices",s)}) - ${mt("uniforms.pads",s,r)};
2594                if (k < 0) {
2595                  k = 0;
2596                }
2597                if (k >= i32(${mt("uniforms.x_shape",s,t)})) {
2598                  k = i32(${mt("uniforms.x_shape",s,t)}) - 1;
2599                }
2600                offset += k * i32(${mt("uniforms.x_strides",s,t)});
2601            `;return`
2602              var offset = 0;
2603              var k = 0;
2604              ${n}
2605              value = x[offset];
2606          `},f$=(e,t,r)=>{let n="";for(let s=t-1;s>=0;--s)n+=`
2607                k = i32(${e.indicesGet("indices",s)}) - ${mt("uniforms.pads",s,r)};
2608                if (k < 0)  {
2609                  k += i32(${mt("uniforms.x_shape",s,t)}]);
2610                }
2611                if (k >= i32(${mt("uniforms.x_shape",s,t)})) {
2612                  k -= i32(${mt("uniforms.x_shape",s,t)});
2613                }
2614                offset += k * i32(${mt("uniforms.x_strides",s,t)});
2615            `;return`
2616              var offset = 0;
2617              var k = 0;
2618              ${n}
2619              value = x[offset];
2620          `},m$=(e,t,r)=>{switch(r.mode){case 0:return u$(e,t,r.pads.length);case 1:return p$(e,t,r.pads.length);case 2:return h$(e,t,r.pads.length);case 3:return f$(e,t,r.pads.length);default:throw new Error("Invalid mode")}},g$=(e,t)=>{let r=Ce.padShape(e[0].dims.slice(),t.pads),n=e[0].dims,s=Ce.size(r),a=[{type:12,data:s},{type:6,data:t.pads}],i=e.length>=3&&e[2].data;t.mode===0&&a.push({type:i?e[2].dataType:1,data:t.value}),a.push(...vt(e[0].dims,r));let l=["rank"],c=d=>{let p=ut("output",e[0].dataType,r.length),u=De("x",e[0].dataType,n.length),h=u.type.value,f=m$(p,n.length,t),m=[{name:"output_size",type:"u32"},{name:"pads",type:"i32",length:t.pads.length}];return t.mode===0&&m.push({name:"constant_value",type:i?h:"f32"}),`
2621            ${d.registerUniforms(m).declareVariables(u,p)}
2622            ${d.mainStart()}
2623            ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2624
2625            let indices = ${p.offsetToIndices("global_idx")};
2626
2627            var value = ${h}(0);
2628            ${f}
2629            output[global_idx] = value;
2630        }`};return{name:"Pad",shaderCache:{hint:`${t.mode}${i}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Ce.size(r)/64)},programUniforms:a}),getShaderSource:c}},y$=(e,t)=>{if(e.length>1){let r=e[1].getBigInt64Array(),n=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,s=e[0].dims.length,a=new Int32Array(2*s).fill(0);if(e.length>=4){let l=e[3].getBigInt64Array();for(let c=0;c<l.length;c++)a[Number(l[c])]=Number(r[c]),a[Number(l[c])+s]=Number(r[c+l.length])}else r.forEach((l,c)=>a[Number(c)]=Number(l));let i=[];return a.forEach(l=>i.push(l)),{mode:t.mode,value:n,pads:i}}else return t},i4=(e,t)=>{d$(e.inputs);let r=y$(e.inputs,t);e.compute(g$(e.inputs,r),{inputs:[0]})}}),up,zw,Bw,Uw,Ww,v$,_$,Vw,Gw,o4,l4,qw,c4,d4,Hw,u4,p4,h4,f4,zne=Je(()=>{ti(),Mt(),Rt(),Ft(),up=e=>{if(Pr.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error("Pool ops requires 1 input.")},zw=(e,t,r)=>{let n=t.format==="NHWC",s=e.dims.slice();n&&s.splice(1,0,s.pop());let a=Object.hasOwnProperty.call(t,"dilations"),i=t.kernelShape.slice(),l=t.strides.slice(),c=a?t.dilations.slice():[],d=t.pads.slice();Vg.adjustPoolAttributes(r,s,i,l,c,d);let p=Vg.computePoolOutputShape(r,s,l,c,i,d,t.autoPad),u=Object.assign({},t);a?Object.assign(u,{kernelShape:i,strides:l,pads:d,dilations:c,cacheKey:t.cacheKey}):Object.assign(u,{kernelShape:i,strides:l,pads:d,cacheKey:t.cacheKey});let h=p.slice();return h.push(h.splice(1,1)[0]),[u,n?h:p]},Bw=(e,t)=>{let r=t.format==="NHWC",n=Ce.size(e),s=Ce.size(t.kernelShape),a=[{type:12,data:n},{type:12,data:s}],i=[{name:"outputSize",type:"u32"},{name:"kernelSize",type:"u32"}];if(t.kernelShape.length<=2){let l=t.kernelShape[t.kernelShape.length-1],c=t.strides[t.strides.length-1],d=t.pads[t.pads.length/2-1],p=t.pads[t.pads.length-1],u=!!(d+p);a.push({type:12,data:l},{type:12,data:c},{type:12,data:d}
vendor: 4,345 bytes, lines 2630-2710
2630,{type:12,data:p}),i.push({name:"kw",type:"u32"},{name:"sw",type:"u32"},{name:"pwStart",type:"u32"},{name:"pwEnd",type:"u32"});let h=!1;if(t.kernelShape.length===2){let f=t.kernelShape[t.kernelShape.length-2],m=t.strides[t.strides.length-2],v=t.pads[t.pads.length/2-2],k=t.pads[t.pads.length-2];h=!!(v+k),a.push({type:12,data:f},{type:12,data:m},{type:12,data:v},{type:12,data:k}),i.push({name:"kh",type:"u32"},{name:"sh",type:"u32"},{name:"phStart",type:"u32"},{name:"phEnd",type:"u32"})}return[a,i,!0,u,h]}else{if(r)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let l=Ce.computeStrides(t.kernelShape);a.push({type:12,data:l},{type:12,data:t.pads},{type:12,data:t.strides}),i.push({name:"kernelStrides",type:"u32",length:l.length},{name:"pads",type:"u32",length:t.pads.length},{name:"strides",type:"u32",length:t.strides.length});let c=t.pads.reduce((d,p)=>d+p);return[a,i,!!c,!1,!1]}},Uw=(e,t,r,n,s,a,i,l,c,d,p,u)=>{let h=s.format==="NHWC",f=t.type.value,m=ut("output",t.type.tensor,n);if(s.kernelShape.length<=2){let v="",k="",y="",g=r-(h?2:1);if(p?v=`
2631                for (var i: u32 = 0u; i < uniforms.kw; i++) {
2632                  xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i;
2633                  if (xIndices[${g}] < 0 || xIndices[${g}]
2634                      >= uniforms.x_shape[${g}]) {
2635                    pad++;
2636                    continue;
2637                  }
2638                  let x_val = x[${t.indicesToOffset("xIndices")}];
2639                  ${a}
2640                }`:v=`
2641                for (var i: u32 = 0u; i < uniforms.kw; i++) {
2642                  xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i;
2643                  let x_val = x[${t.indicesToOffset("xIndices")}];
2644                  ${a}
2645                }`,s.kernelShape.length===2){let _=r-(h?3:2);u?k=`
2646                for (var j: u32 = 0u; j < uniforms.kh; j++) {
2647                  xIndices[${_}] = indices[${_}] * uniforms.sh - uniforms.phStart + j;
2648                  if (xIndices[${_}] < 0 || xIndices[${_}] >= uniforms.x_shape[${_}]) {
2649                    pad += i32(uniforms.kw);
2650                    continue;
2651                  }
2652              `:k=`
2653                for (var j: u32 = 0u; j < uniforms.kh; j++) {
2654                  xIndices[${_}] = indices[${_}] * uniforms.sh - uniforms.phStart + j;
2655                `,y=`
2656              }
2657            `}return`
2658            ${e.registerUniforms(c).declareVariables(t,m)}
2659
2660            ${e.mainStart()}
2661              ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
2662
2663              let indices = ${m.offsetToIndices("global_idx")};
2664              var xIndices = ${m.offsetToIndices("global_idx")};
2665
2666              var value = ${f}(${l});
2667              var pad = 0;
2668              ${k}
2669              ${v}
2670              ${y}
2671              ${i}
2672
2673              output[global_idx] = value;
2674            }`}else{if(h)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let v=s.kernelShape.length,k=s.pads.length,y="";return d?y=`
2675                if (xIndices[j] >= uniforms.x_shape[j]) {
2676                  pad++;
2677                  isPad = true;
2678                  break;
2679                }
2680              }
2681              if (!isPad) {
2682                let x_val = x[${t.indicesToOffset("xIndices")}];
2683                ${a}
2684              }`:y=`
2685              }
2686              let x_val = x[${t.indicesToOffset("xIndices")}];
2687              ${a}
2688            `,`
2689            ${e.registerUniforms(c).declareVariables(t,m)}
2690
2691            ${e.mainStart()}
2692              ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
2693              let indices = ${m.offsetToIndices("global_idx")};
2694              var xIndices = ${m.offsetToIndices("global_idx")};
2695
2696              var offsets: array<u32, ${v}>;
2697
2698              var value = ${f}(${l});
2699              var pad = 0;
2700              var isPad = false;
2701
2702              for (var i: u32 = 0u; i < uniforms.kernelSize; i++) {
2703                var offset = i;
2704                for (var j = 0u; j < ${v-1}u; j++) {
2705                  offsets[j] = offset / ${mt("uniforms.kernelStrides","j",v)};
2706                  offset -= offsets[j] * ${mt("uniforms.kernelStrides","j",v)};
2707                }
2708                offsets[${v-1}] = offset;
2709
2710                isPad = false;
2711                for (var j = ${r-v}u; j < ${r}u; j++) {
2712                  xIndices[j] = indices[j] * ${mt("uniforms.strides",`j - ${r-v}u`,v)}
2713                    + offsets[j - ${r-v}u] - ${mt("uniforms.pads","j - 2u",k)};
2714                  ${y}
2715              }
2716              ${i}
2717
2718              output[global_idx] = value;
2719            }`}},Ww=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,v$=e=>`${Ww(e)};${e.countIncludePad}`,_$=e=>`${Ww(e)};${e.storageOrder};${e.dilations}`,Vw=e=>({format:e.format,autoPad:["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Gw=(e,t,r,n)=>{let[s,a]=zw(t,n,r),i=De("x",t.dataType,t.dims.length),l=i.type.value,c="value += x_val;",d="";s.countIncludePad?d+=`value /= ${l}(uniforms.kernelSize);`:d+=`value /= ${l}(i32(uniforms.kernelSize) - pad);`;let[p,u,h,f,m]=Bw(a,s);p.push(...vt(t.dims,a));let v=["rank"];return{name:e,shaderCache:{hint:`${n.cacheKey};${h};${f};${m}`,inputDependencies:v},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(Ce.size(a)/64)},programUniforms:p}),getShaderSource:k=>Uw(k,i,t.dims.length,a.length,s,c,d,0,u,h,f,m)}},o4=e=>{let t=e.count_include_pad!==0,r=Vw(e);if(r.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");let n={countIncludePad:t,...r,cacheKey:""};return{...n,cacheKey:v$(n)}},l4=(e,t)=>{up(e.inputs),e.compute(Gw("AveragePool",e.inputs[0],!1,t))},qw={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},c4=e=>{let t=e.format;return{format:t,...qw,cacheKey:t}},d4=(e,t)=>{up(e.inputs),e.compute(Gw("GlobalAveragePool",e.inputs[0],!0,t))},Hw=(e,t,r,n)=>{let[s,a]=zw(t,n,r),i=`
2720      value = max(x_val, value);
2721    `,l="",c=De("x",t.dataType,t.dims.length),d=["rank"],[p,u,h,f,m]=Bw(a,s);return p.push(...vt(t.dims,a)),{name:e,shaderCache:{hint:`${n.cacheKey};${h};${f};${m}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(Ce.size(a)/64)},programUniforms:p}),getShaderSource:v=>Uw(v,c,t.dims.length,a.length,s,i,l,t.dataType===10?-65504:-1e5,u,h,f,m)}},u4=(e,t)=>{up(e.inputs),e.compute(Hw("MaxPool",e.inputs[0],!1,t))},p4=e=>{let t=e.storage_order,r=e.dilations,n=Vw(e);if(t!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(n.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");let s={storageOrder:t,dilations:r,...n,cacheKey:""};return{...s,cacheKey:_$(s)}},h4=e=>{let t=e.format;return{format:t,...qw,cacheKey:t}},f4=(e,t)=>{up(e.inputs),e.compute(Hw("GlobalMaxPool",e.inputs[0],!0,t))}}),w$,x$,m4,g4,Bne=Je(()=>{Mt(),Rt(),Zr(),Ft(),w$=(e,t)=>{if(e.length<2||e.length>3)throw new Error("DequantizeLinear requires 2 or 3 inputs.");if(e.length===3&&e[1].dims===e[2].dims)throw new Error("x-scale and x-zero-point must have the same shape.");if(e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[0].dataType===6&&e.length>2)throw new Error("In the case of dequantizing int32 there is no zero point.");if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw new Error("scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.");if(e.length>2){if(e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[1].dims.length!==e[2].dims.length)throw new Error("scale and zero-point inputs must have the same rank.");if(!e[1].dims.map((r,n)=>r===e[2].dims[n]).reduce((r,n)=>r&&n,!0))throw new Error("scale and zero-point inputs must have the same shape.")}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw new Error("blockSize must be set only for block quantization.");if(!e[1].dims.map((s,a)=>a===t.axis||s===e[0].dims[a]).reduce((s,a)=>s&&a,!0))throw new Error("For block qunatization, scale input shape to match the input shape except for the axis");if(e[1].dims.length!==e[0].dims.length)throw new Error("For block qunatization the scale input rank must be the same as the x rank.");let r=e[0].dims[t.axis],n=e[1].dims[t.axis];if(t.blockSize<Math.ceil(r/n)||t.blockSize>Math.ceil(r/(n-1)-1))throw new Error("blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].")}},x$=(e,t)=>
vendor: 4,419 bytes, lines 2721-2764
2721{let r=Ce.normalizeAxis(t.axis,e[0].dims.length),n=e[0].dataType,s=n===3,a=e[0].dims,i=e[1].dataType,l=Ce.size(a),c=n===3||n===2,d=c?[Math.ceil(Ce.size(e[0].dims)/4)]:e[0].dims,p=e[1].dims,u=e.length>2?e[2]:void 0,h=u?c?[Math.ceil(Ce.size(u.dims)/4)]:u.dims:void 0,f=p.length===0||p.length===1&&p[0]===1,m=f===!1&&p.length===1,v=Wr(l),k=f&&(!c||v===4),y=k?v:1,g=k&&!c?v:1,_=De("input",c?12:n,d.length,g),w=De("scale",i,p.length),x=u?De("zero_point",c?12:n,h.length):void 0,b=ut("output",i,a.length,y),M=[_,w];x&&M.push(x);let S=[d,p];u&&S.push(h);let j=[{type:12,data:l/y},{type:12,data:r},{type:12,data:t.blockSize},...vt(...S,a)],I=q=>{let U=[{name:"output_size",type:"u32"},{name:"axis",type:"u32"},{name:"block_size",type:"u32"}];return`
2722      ${q.registerUniforms(U).declareVariables(...M,b)}
2723      ${q.mainStart()}
2724          ${q.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2725          let output_indices = ${b.offsetToIndices("global_idx")};
2726
2727          // Set input x
2728          ${c?`
2729            let input = ${_.getByOffset("global_idx / 4")};
2730            let x_vec = ${s?"unpack4xI8(input)":"unpack4xU8(input)"};
2731            let x_value = ${y===1?"x_vec[global_idx % 4]":"x_vec"};`:`let x_value = ${_.getByOffset("global_idx")};`};
2732
2733          // Set scale input
2734          ${f?`let scale_value= ${w.getByOffset("0")}`:m?`
2735            let scale_index = ${b.indicesGet("output_indices","uniforms.axis")};
2736            let scale_value= ${w.getByOffset("scale_index")};`:`
2737            var scale_indices: ${w.type.indices} = output_indices;
2738            let index = ${w.indicesGet("scale_indices","uniforms.axis")} / uniforms.block_size;
2739            ${w.indicesSet("scale_indices","uniforms.axis","index")};
2740            let scale_value= ${w.getByIndices("scale_indices")};`};
2741
2742          // Set zero-point input
2743          ${x?f?c?`
2744                let zero_point_input = ${x.getByOffset("0")};
2745                let zero_point_vec =  ${s?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"};
2746                let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${x.getByOffset("0")}`:m?c?`
2747                let zero_point_index = ${b.indicesGet("output_indices","uniforms.axis")};
2748                let zero_point_input = ${x.getByOffset("zero_point_index / 4")};
2749                let zero_point_vec =  ${s?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"};
2750                let zero_point_value = zero_point_vec[zero_point_index % 4]`:`
2751                let zero_point_index = ${b.indicesGet("output_indices","uniforms.axis")};
2752                let zero_point_value = ${x.getByOffset("zero_point_index")};`:c?`
2753                let zero_point_offset = ${w.indicesToOffset("scale_indices")};
2754                let zero_point_input = ${x.getByOffset("zero_point_offset / 4")};
2755                let zero_point_vec = ${s?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"};
2756                let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices("scale_indices")};`:`let zero_point_value = ${c?s?"i32":"u32":_.type.value}(0);`};
2757      // Compute and write output
2758      ${b.setByOffset("global_idx",`${b.type.value}(x_value - zero_point_value) * scale_value`)};
2759      }`};return{name:"DequantizeLinear",shaderCache:{hint:t.cacheKey,inputDependencies:x?["rank","rank","rank"]:["rank","rank"]},getShaderSource:I,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:Math.ceil(l/y/64),y:1,z:1},programUniforms:j})}},m4=(e,t)=>{w$(e.inputs,t),e.compute(x$(e.inputs,t))},g4=e=>cr({axis:e.axis,blockSize:e.blockSize})}),b$,k$,y4,Une=Je(()=>{ti(),Mt(),Ft(),b$=(e,t,r)=>{let n=e===t,s=e<t&&r<0,a=e>t&&r>0;if(n||s||a)throw new Error("Range these inputs' contents are invalid.")},k$=(e,t,r,n)=>{let s=Math.abs(Math.ceil((t-e)/r)),a=[s],i=s,l=[{type:12,data:i},{type:n,data:e},{type:n,data:r},...vt(a)],c=d=>{let p=ut("output",n,a.length),u=p.type.value,h=[{name:"outputSize",type:"u32"},{name:"start",type:u},{name:"delta",type:u}];return`
2760        ${d.registerUniforms(h).declareVariables(p)}
2761        ${d.mainStart()}
2762        ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
2763        output[global_idx] = uniforms.start + ${u}(global_idx) * uniforms.delta;
2764      }`};return{name:"Range",shaderCache:{hint:`${n}`},getShaderSource:c,getRunData:()=>({outputs:[{dims:a,dataType:n}],dispatchGroup:{x:Math.ceil(i/64)}
vendor: 4,308 bytes, lines 2764-2842
2764,programUniforms:l})}},y4=e=>{let t=0,r=0,n=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],r=e.inputs[1].getInt32Array()[0],n=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],r=e.inputs[1].getFloat32Array()[0],n=e.inputs[2].getFloat32Array()[0]),Pr.webgpu.validateInputContent&&b$(t,r,n),e.compute(k$(t,r,n,e.inputs[0].dataType),{inputs:[]})}}),T$,Kw,Qw,M$,v4,_4,Wne=Je(()=>{Mt(),Rt(),Zr(),Ft(),T$=(e,t,r,n)=>{if(e!=="none"&&n!=="i32"&&n!=="u32"&&n!=="f32")throw new Error(`Input ${n} is not supported with reduction ${e}.`);let s=`{
2765                var oldValue = 0;
2766                loop {
2767                  let newValueF32 =`,a=`;
2768                  let newValue = bitcast<i32>(newValueF32);
2769                  let res = atomicCompareExchangeWeak(&${t}, oldValue, newValue);
2770                  if res.exchanged {
2771                    break;
2772                  }
2773                  oldValue = res.old_value;
2774                }
2775              }`;switch(e){case"none":return`${t}=${r};`;case"add":return n==="i32"||n==="u32"?`atomicAdd(&${t}, bitcast<${n}>(${r}));`:`
2776              ${s}bitcast<${n}>(oldValue) + (${r})${a}`;case"max":return n==="i32"||n==="u32"?`atomicMax(&${t}, bitcast<${n}>(${r}));`:`
2777                ${s}max(bitcast<f32>(oldValue), (${r}))${a}`;case"min":return n==="i32"||n==="u32"?`atomicMin(&${t}, bitcast<${n}>(${r}));`:`${s}min(bitcast<${n}>(oldValue), (${r}))${a}`;case"mul":return`${s}(bitcast<${n}>(oldValue) * (${r}))${a}`;default:throw new Error(`Reduction ${e} is not supported.`)}},Kw=(e,t)=>`${e===1?`
2778    let element_count_dim = uniforms.output_strides;
2779    let dim_value = uniforms.output_shape;`:`
2780    let element_count_dim = uniforms.output_strides[${t?"i - indices_start":"i"}];
2781    let dim_value = uniforms.output_shape[${t?"i - indices_start":"i"} + uniforms.last_index_dimension];`}
2782    
2783    if (index >= 0) {
2784      if (index >= i32(dim_value)) {
2785        index = i32(dim_value - 1);
2786      }
2787    } else {
2788      if (index < -i32(dim_value)) {
2789        index = 0;
2790      } else {
2791        index += i32(dim_value);
2792      }
2793    }
2794    data_offset += u32((u32(index) * element_count_dim));`,Qw=(e,t,r)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) {
2795        let value = updates[uniforms.num_updates_elements * ${r?"global_idx":"idx"} + i];
2796        ${T$(e.reduction,"output[data_offset + i]","value",t)}
2797      }`,M$=(e,t)=>{let r=e[0].dims,n=e[1].dims,s=r,a=1,i=Math.ceil(Ce.size(n)/a),l=n[n.length-1],c=Ce.sizeFromDimension(r,l),d=Ce.sizeFromDimension(n,0)/l,p=[{type:12,data:i},{type:12,data:l},{type:12,data:c},...vt(e[1].dims,e[2].dims,s)],u=h=>{let f=De("indices",e[1].dataType,e[1].dims.length),m=De("updates",e[2].dataType,e[2].dims.length,a),v=t.reduction!=="none"&&t.reduction!==""?HL("output",e[0].dataType,s.length):ut("output",e[0].dataType,s.length,a);return`
2798      ${h.registerUniform("output_size","u32").registerUniform("last_index_dimension","u32").registerUniform("num_updates_elements","u32").declareVariables(f,m,v)}
2799      ${h.mainStart()}
2800        ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
2801  var hasDuplicates = false;
2802  if (${t.reduction==="none"}) {
2803    for (var i = 0; i < ${d}; i = i + 1) {
2804      for (var j = i + 1; j < ${d}; j = j + 1) {
2805        var index_i = i32(indices[i].x);
2806        var index_j = i32(indices[j].x);
2807        if (index_i == index_j) {
2808          hasDuplicates = true;
2809          break;
2810        }
2811      }
2812      if (hasDuplicates) {
2813        break;
2814      }
2815    }
2816  }
2817
2818  if (${t.reduction==="none"} && hasDuplicates) {
2819    if (global_idx != 0u) {
2820      return;
2821    }
2822    // Process each index-update pair individually when duplicates exist
2823    for (var idx = 0u; idx < ${d}u; idx++) {
2824      var data_offset = 0u;
2825      for (var i = 0u; i < uniforms.last_index_dimension; i++) {
2826        var index = i32(indices[idx * uniforms.last_index_dimension + i].x);
2827        ${Kw(r.length,!1)}
2828      }
2829      ${Qw(t,v.type.value,!1)}
2830    }
2831    return;
2832  }
2833
2834  var data_offset = 0u;
2835  var indices_start = uniforms.last_index_dimension * global_idx;
2836  var indices_end = indices_start + uniforms.last_index_dimension;
2837  for (var i = indices_start; i < indices_end; i++) {
2838    var index = i32(indices[i].x);
2839    ${Kw(r.length,!0)}
2840  }
2841  ${Qw(t,v.type.value,!0)}
2842  }`};
vendor: 10,717 bytes, lines 2842-2950
2842return{name:"ScatterND",shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:p}),getShaderSource:u}},v4=e=>cr({reduction:e.reduction}),_4=(e,t)=>{e.compute(M$(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),E$,S$,A$,Yw,P$,C$,j$,I$,$$,N$,O$,R$,Jw,D$,F$,L$,z$,B$,w4,x4,Vne=Je(()=>{Mt(),Rt(),Zr(),Ft(),E$=(e,t)=>{if(e.every(r=>r>0||(()=>{throw new Error("Resize requires scales input values to be positive")})),e.length>0){if(t.mode==="linear"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and
2843            one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode==="cubic"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error("Resize requires scales input size to be 2 or 4 for cubic mode")}},S$=(e,t,r)=>{t.every(s=>s>=0&&s<r||(()=>{throw new Error("Resize requires axes input values to be positive and less than rank")}));let n=new Array(r).fill(1);return t.forEach((s,a)=>n[s]=e[a]),n},A$=(e,t,r,n,s,a)=>{let[i,l,c]=r>10?[1,2,3]:[-1,e.length>1?1:-1,-1],d=e[0].dims.length;if(i>0&&e.length>i&&e[i].dims.length>0)e[i].getFloat32Array().forEach(p=>a.push(p));else if(t.coordinateTransformMode==="tf_crop_and_resize")throw new Error("Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize");if(l>0&&e.length>l&&e[l].dims.length===1&&e[l].dims[0]>0){if(e[l].getFloat32Array().forEach(p=>n.push(p)),n.length!==0&&n.length!==d&&r>=18&&n.length!==t.axes.length)throw new Error("Resize requires scales input size to be same as input rank or axes size for opset 18 and up");E$(n,t),t.axes.length>0&&S$(n,t.axes,d).forEach((p,u)=>n[u]=p)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(p=>s.push(Number(p))),s.length!==0&&s.length!==d&&r>=18&&s.length!==t.axes.length))throw new Error("Resize requires sizes input size to be same as input rank or axes size for opset 18 and up");if(t.axes.length>0){if(n.length!==0&&n.length!==t.axes.length)throw new Error('Resize requires "scales" input size to be of axes rank when axes attributes is specified');if(s.length!==0&&s.length!==t.axes.length)throw new Error('Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified')}if(typeof n<"u"&&typeof s<"u"&&n.length>0&&s.length>d)throw new Error("Resize requires only of scales or sizes to be specified")},Yw=(e,t,r,n)=>`
2844  // The whole part and the fractional part are calculated separately due to inaccuracy of floating
2845  // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an
2846  // offset-by-one error later in floor().
2847  let big = (${e}) * (${t});
2848  let whole = ${n}(big / (${r}));
2849  let fract = ${n}(big % (${r})) / ${n}(${r});
2850  return whole + fract;
2851`,P$=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32,
2852     lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case"asymmetric":return`
2853          if (xScale < 1.0 || floor(xScale) != xScale) {
2854            return ${t}(xResized) / ${t}(xScale);
2855          } else {
2856            ${Yw("xResized","lengthOriginal","lengthResized",t)}
2857          }
2858        `;case"pytorch_half_pixel":return`if (lengthResized > 1) {
2859                    return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5;
2860                  } else {
2861                    return 0.0;
2862                  }`;case"tf_half_pixel_for_nn":return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case"align_corners":return`if (lengthResized == 1) {
2863                    return 0.0;
2864                  } else {
2865                    ${Yw("xResized","lengthOriginal - 1","lengthResized - 1",t)}
2866                  }`;case"tf_crop_and_resize":return`if (lengthResized > 1) {
2867                    return ${t}(roiStart) * ${t}(lengthOriginal - 1) +
2868                        (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) /
2869                        ${t}(lengthResized - 1);
2870                  } else {
2871                    return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1);
2872                  }`;case"half_pixel_symmetric":return`const outputWidth = ${t}xScale * ${t}(lengthResized);
2873                  const adjustment = ${t}(lengthResized) / outputWidth;
2874                  const center = ${t}(lengthOriginal) / 2;
2875                  const offset = center * (1 - adjustment);
2876                  return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case"half_pixel":return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+"}",C$=(e,t,r)=>`fn getNearestPixelFromOriginal(xOriginal: ${r}, isDownSample: bool) -> ${r} {`+(()=>{switch(e){case"round_prefer_ceil":return"if (fract(xOriginal) == 0.5) {             return ceil(xOriginal);           } else {             return round(xOriginal);           }";case"floor":return"return floor(xOriginal);";case"ceil":return"return ceil(xOriginal);";case"round_prefer_floor":return"if (fract(xOriginal) == 0.5) {                     return floor(xOriginal);                   } else {                     return round(xOriginal);                   }";case"simple":default:if(t<11)return"if (isDownSample)                     {                       return ceil(xOriginal);                     } else {                       return xOriginal;                     }";throw new Error(`Nearest mode ${e} is not supported`)}})()+"}",j$=(e,t,r)=>{let n=new Array(r).fill(0).concat(new Array(r).fill(1)),s=e.length===0?n:e.slice();return t.length>0?(t.forEach((a,i)=>{n[a]=s[i],n[i+r]=s[t.length+i]}),n):s},I$=(e,t,r,n)=>{let s=[];if(r.length>0)if(n.length>0){if(e.forEach(a=>s.push(a)),Math.max(...n)>e.length)throw new Error("axes is out of bound");n.forEach((a,i)=>s[a]=r[i])}else r.forEach(a=>s.push(a));else{if(t.length===0)throw new Error("Resize requires either scales or sizes.");s=e.map((a,i)=>Math.round(a*t[i]))}return s},$$=(e,t,r)=>{let n=(()=>{switch(r.keepAspectRatioPolicy){case"not_larger":return r.axes.length>0?Math.min(...r.axes.map(a=>t[a]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case"not_smaller":return r.axes.length>0?Math.max(...r.axes.map(a=>t[a]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${r.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let s=e.slice();return r.axes.length>0?(r.axes.forEach(a=>t[a]=n),r.axes.forEach(a=>s[a]=Math.round(e[a]*t[a]))):(t.fill(n,0,t.length),s.forEach((a,i)=>s[i]=Math.round(a*t[i]))),s},N$=(e,t,r,n,s)=>`
2877    fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${r.length}> {
2878      var original_indices: array<${e.type.value}, ${r.length}>;
2879      for (var i:u32 = 0; i < ${r.length}; i++) {
2880        var output_index = ${e.indicesGet("output_indices","i")};
2881        var scale = ${mt("uniforms.scales","i",n)};
2882        var roi_low = ${mt("uniforms.roi","i",s)};
2883        var roi_hi = ${mt("uniforms.roi",`i + ${t.length}`,s)};
2884        if (scale == 1.0) {
2885          original_indices[i] = ${e.type.value}(output_index);
2886        } else {
2887          var input_shape_i = ${mt("uniforms.input_shape","i",t.length)};
2888          var output_shape_i = ${mt("uniforms.output_shape","i",r.length)};
2889          original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,
2890                                                                           input_shape_i, roi_low, roi_hi);
2891        }
2892      }
2893      return original_indices;
2894    }`,O$=(e,t,r,n,s,a,i)=>`
2895    fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {
2896      var input_indices: ${e.type.indices};
2897      for (var i:u32 = 0; i < ${n.length}; i++) {
2898        var output_index = ${t.indicesGet("output_indices","i")};
2899        var input_index: u32;
2900        var scale = ${mt("uniforms.scales","i",s)};
2901        if (scale == 1.0) {
2902          input_index = output_index;
2903        } else {
2904          var roi_low = ${mt("uniforms.roi","i",a)};
2905          var roi_hi = ${mt("uniforms.roi",`i + ${r.length}`,a)};
2906          var input_shape_i = ${mt("uniforms.input_shape","i",r.length)};
2907          var output_shape_i = ${mt("uniforms.output_shape","i",n.length)};
2908          var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,
2909                                                                        input_shape_i, roi_low, roi_hi);
2910          if (!${i} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) {
2911            if (original_idx < 0) {
2912              input_index = 0;
2913            } else if (original_idx > ${t.type.value}(input_shape_i - 1)) {
2914              input_index = input_shape_i - 1;
2915            } else {
2916              input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1));
2917            }
2918          } else {
2919            input_index = u32(original_idx);
2920          }
2921        }
2922        ${e.indicesSet("input_indices","i","input_index")}
2923      }
2924      return input_indices;
2925    }`,R$=(e,t)=>`
2926    fn checkInputIndices(input_indices: ${e.type.indices}) -> bool {
2927      for (var i:u32 = 0; i < ${t.length}; i++) {
2928        var input_index = ${e.indicesGet("input_indices","i")};
2929        if (input_index < 0 || input_index >= ${mt("uniforms.input_shape","i",t.length)}) {
2930          return false;
2931        }
2932      }
2933      return true;
2934    }`,Jw=(e,t,r,n)=>e.rank>n?`
2935    ${e.indicesSet("input_indices",t,"channel")};
2936    ${e.indicesSet("input_indices",r,"batch")};
2937`:"",D$=(e,t,r,n,s)=>{let[a,i,l,c]=r.length===2?[-1,0,1,-1]:[0,2,3,1],d=e.type.value;return`
2938    fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${d} {
2939      var input_indices: ${e.type.indices};
2940      ${e.indicesSet("input_indices",i,`max(0, min(row, ${r[i]} - 1))`)};
2941      ${e.indicesSet("input_indices",l,`max(0, min(col, ${r[l]} - 1))`)};
2942      ${Jw(e,c,a,2)}
2943      return ${e.getByIndices("input_indices")};
2944    }
2945
2946    fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${d} {
2947      var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);
2948      var row:${d} = originalIndices[${i}];
2949      var col:${d} = originalIndices[${l}];
2950      ${n?`if (row < 0 || row > (${r[i]}
vendor: 6,655 bytes, lines 2950-3085
2950 - 1) || col < 0 || col > (${r[l]} - 1)) {
2951        return ${s};
2952      }`:""};
2953      row = max(0, min(row, ${r[i]} - 1));
2954      col = max(0, min(col, ${r[l]} - 1));
2955      var row1: u32 = u32(row);
2956      var col1: u32 = u32(col);
2957      var row2: u32 = u32(row + 1);
2958      var col2: u32 = u32(col + 1);
2959      var channel: u32 = ${r.length>2?`u32(originalIndices[${c}])`:"0"};
2960      var batch: u32 =  ${r.length>2?`u32(originalIndices[${a}])`:"0"};
2961      var x11: ${d} = getInputValue(batch, channel, row1, col1);
2962      var x12: ${d} = getInputValue(batch, channel, row1, col2);
2963      var x21: ${d} = getInputValue(batch, channel, row2, col1);
2964      var x22: ${d} = getInputValue(batch, channel, row2, col2);
2965      var dx1: ${d} = abs(row - ${d}(row1));
2966      var dx2: ${d} = abs(${d}(row2) - row);
2967      var dy1: ${d} = abs(col - ${d}(col1));
2968      var dy2: ${d} = abs(${d}(col2) - col);
2969      if (row1 == row2) {
2970        dx1 = 0.5;
2971        dx2 = 0.5;
2972      }
2973      if (col1 == col2) {
2974        dy1 = 0.5;
2975        dy2 = 0.5;
2976      }
2977      return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1);
2978    }`},F$=(e,t,r,n,s,a,i,l,c,d)=>{let p=r.length===2,[u,h]=p?[0,1]:[2,3],f=e.type.value,m=v=>{let k=v===u?"row":"col";return`
2979      fn ${k}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${f} {
2980        var output_index = ${t.indicesGet("output_indices",v)};
2981        var originalIdx: ${f} = getOriginalCoordinateFromResizedCoordinate(output_index, ${s[v]},
2982        ${n[v]}, ${r[v]}, ${a[v]}, ${a[v]} + ${r.length});
2983        var fractOriginalIdx: ${f} = originalIdx - floor(originalIdx);
2984        var coefs = getCubicInterpolationCoefs(fractOriginalIdx);
2985
2986        if (${l} && (originalIdx < 0 || originalIdx > (${r[v]} - 1))) {
2987          return ${c};
2988        }
2989        var data: array<${f}, 4> = array<${f}, 4>(0.0, 0.0, 0.0, 0.0);
2990        for (var i: i32 = -1; i < 3; i++) {
2991          var ${k}: ${f} = originalIdx + ${f}(i);
2992          if (${k} < 0 || ${k} >= ${r[v]}) {
2993            ${d?`coefs[i + 1] = 0.0;
2994                        continue;`:l?`return ${c};`:`${k} = max(0, min(${k}, ${r[v]} - 1));`};
2995          }
2996        var input_indices_copy: ${e.type.indices} = input_indices;
2997          ${e.indicesSet("input_indices_copy",v,`u32(${k})`)};
2998          data[i + 1] = ${v===u?e.getByIndices("input_indices_copy"):"rowCubicInterpolation(input_indices_copy, output_indices)"};
2999        }
3000        return cubicInterpolation1D(data, coefs);
3001      }`};return`
3002    ${m(u)};
3003    ${m(h)};
3004  fn getCubicInterpolationCoefs(s: ${f}) -> array<${f}, 4> {
3005    var absS = abs(s);
3006    var coeffs: array<${f}, 4> = array<${f}, 4>(0.0, 0.0, 0.0, 0.0);
3007    var oneMinusAbsS: ${f} = 1.0 - absS;
3008    var twoMinusAbsS: ${f} = 2.0 - absS;
3009    var onePlusAbsS: ${f} = 1.0 + absS;
3010    coeffs[0] = ((${i} * onePlusAbsS - 5 * ${i}) * onePlusAbsS + 8 * ${i}) * onePlusAbsS - 4 * ${i};
3011    coeffs[1] = ((${i} + 2) * absS - (${i} + 3)) * absS * absS + 1;
3012    coeffs[2] = ((${i} + 2) * oneMinusAbsS - (${i} + 3)) * oneMinusAbsS * oneMinusAbsS + 1;
3013    coeffs[3] = ((${i} * twoMinusAbsS - 5 * ${i}) * twoMinusAbsS + 8 * ${i}) * twoMinusAbsS - 4 * ${i};
3014    return coeffs;
3015  }
3016
3017  fn cubicInterpolation1D(x: array<${f}, 4>, coefs: array<${f}, 4>) -> ${f} {
3018    var coefsSum: ${f} = coefs[0] + coefs[1] + coefs[2] + coefs[3];
3019    return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum;
3020  }
3021
3022  fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${f} {
3023    var input_indices: ${e.type.indices} = output_indices;
3024    return colCubicInterpolation(input_indices, output_indices);
3025  }
3026    `},L$=(e,t,r,n,s)=>{let[a,i,l,c,d]=r.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],p=e.type.value;return`
3027    fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${p} {
3028      var input_indices: ${e.type.indices};
3029      ${e.indicesSet("input_indices",i,`max(0, min(depth, ${r[i]} - 1))`)};
3030      ${e.indicesSet("input_indices",l,`max(0, min(height, ${r[l]} - 1))`)};
3031      ${e.indicesSet("input_indices",c,`max(0, min(width, ${r[c]} - 1))`)};
3032      ${Jw(e,d,a,3)}
3033      return ${e.getByIndices("input_indices")};
3034    }
3035
3036    fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${p} {
3037      var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);
3038      var depth:${p} = originalIndices[${i}];
3039      var height:${p} = originalIndices[${l}];
3040      var width:${p} = originalIndices[${c}];
3041      ${n?`if (depth < 0 || depth > (${r[i]} - 1) || height < 0 || height > (${r[l]} - 1) || width < 0 || (width > ${r[c]} - 1)) {
3042      return ${s};
3043        }`:""};
3044
3045    depth = max(0, min(depth, ${r[i]} - 1));
3046      height = max(0, min(height, ${r[l]} - 1));
3047      width = max(0, min(width, ${r[c]} - 1));
3048      var depth1: u32 = u32(depth);
3049      var height1: u32 = u32(height);
3050      var width1: u32 = u32(width);
3051      var depth2: u32 = u32(depth + 1);
3052      var height2: u32 = u32(height + 1);
3053      var width2: u32 = u32(width + 1);
3054      var channel: u32 = ${r.length>3?`u32(originalIndices[${d}])`:"0"};
3055      var batch: u32 =  ${r.length>3?`u32(originalIndices[${a}])`:"0"};
3056
3057      var x111: ${p} = getInputValue(batch, channel, depth1, height1, width1);
3058      var x112: ${p} = getInputValue(batch, channel, depth1, height1, width2);
3059      var x121: ${p} = getInputValue(batch, channel, depth1, height2, width1);
3060      var x122: ${p} = getInputValue(batch, channel, depth1, height2, width2);
3061      var x211: ${p} = getInputValue(batch, channel, depth2, height1, width1);
3062      var x212: ${p} = getInputValue(batch, channel, depth2, height1, width2);
3063      var x221: ${p} = getInputValue(batch, channel, depth2, height2, width1);
3064      var x222: ${p} = getInputValue(batch, channel, depth2, height2, width2);
3065      var dx1: ${p} = abs(depth - ${p}(depth1));
3066      var dx2: ${p} = abs(${p}(depth2) - depth);
3067      var dy1: ${p} = abs(height - ${p}(height1));
3068      var dy2: ${p} = abs(${p}(height2) - height);
3069      var dz1: ${p} = abs(width - ${p}(width1));
3070      var dz2: ${p} = abs(${p}(width2) - width);
3071      if (depth1 == depth2) {
3072        dx1 = 0.5;
3073        dx2 = 0.5;
3074      }
3075      if (height1 == height2) {
3076        dy1 = 0.5;
3077        dy2 = 0.5;
3078      }
3079      if (width1 == width2) {
3080        dz1 = 0.5;
3081        dz2 = 0.5;
3082      }
3083      return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 +
3084              x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1);
3085    }`},z$=(e,t,r,n,s,a)=>{let i=e.dims,l=j$(a,t.axes,i.length),c=I$(i,n,s,t.axes),d=n.slice();
vendor: 13,908 bytes, lines 3085-3225
3085n.length===0&&(d=i.map((g,_)=>g===0?1:c[_]/g),t.keepAspectRatioPolicy!=="stretch"&&(c=$$(i,d,t)));let p=ut("output",e.dataType,c.length),u=De("input",e.dataType,i.length),h=Ce.size(c),f=i.length===c.length&&i.every((g,_)=>g===c[_]),m=t.coordinateTransformMode==="tf_crop_and_resize",v=t.extrapolationValue,k=u.type.value,y=g=>`
3086      ${f?"":`
3087      ${P$(t.coordinateTransformMode,k)};
3088      ${(()=>{switch(t.mode){case"nearest":return`
3089              ${R$(u,i)};
3090              ${C$(t.nearestMode,r,k)};
3091              ${O$(u,p,i,c,d.length,l.length,m)};
3092              `;case"linear":return`
3093              ${N$(p,i,c,d.length,l.length)};
3094              ${(()=>{if(i.length===2||i.length===4)return`${D$(u,p,i,m,v)}`;if(i.length===3||i.length===5)return`${L$(u,p,i,m,v)}`;throw Error("Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.")})()};
3095            `;case"cubic":return`
3096            ${(()=>{if(i.length===2||i.length===4)return`${F$(u,p,i,c,d,l,t.cubicCoeffA,m,t.extrapolationValue,t.excludeOutside)}`;throw Error("Cubic mode only supports input dims 2 and 4 are supported in linear mode.")})()};
3097            `;default:throw Error("Invalid resize mode")}})()};
3098      `}
3099      ${g.registerUniform("output_size","u32").registerUniform("scales","f32",d.length).registerUniform("roi","f32",l.length).declareVariables(u,p)}
3100      ${g.mainStart()}
3101        ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
3102        ${f?"output[global_idx] = input[global_idx];":`
3103        let output_indices = ${p.offsetToIndices("global_idx")};
3104        var input_indices: ${u.type.indices};
3105        ${(()=>{switch(t.mode){case"nearest":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices);
3106                if (checkInputIndices(input_indices)) {
3107                  output[global_idx] = ${u.getByIndices("input_indices")};
3108                } else {
3109                  output[global_idx] = ${t.extrapolationValue};
3110                }`;case"linear":return`output[global_idx] = ${i.length===2||i.length===4?"bilinearInterpolation":"trilinearInterpolation"}(output_indices);`;case"cubic":return"output[global_idx] = bicubicInterpolation(output_indices);";default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()};
3111`}
3112      }`;return{name:"Resize",shaderCache:{hint:`${t.cacheKey}|${r}|${d.length>0?t.mode==="cubic"?d:d.length:""}|${s.length>0?s:""}|${l.length>0?l:""}|${f}|${t.mode==="nearest"?i.length:i}`,inputDependencies:["rank"]},getShaderSource:y,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:[{type:12,data:h},{type:1,data:d},{type:1,data:l},...vt(i,c)]})}},B$=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},w4=(e,t)=>{let r=[],n=[],s=[],a=B$(e);if(t.antialias!==0)throw Error("Only default value (0) for Antialias attribute is supported");A$(e.inputs,t,a,r,n,s),e.compute(z$(e.inputs[0],t,a,r,n,s),{inputs:[0]})},x4=e=>{let t=e.antialias,r=e.axes,n=e.coordinateTransformMode,s=e.cubicCoeffA,a=e.excludeOutside!==0,i=e.extrapolationValue,l=e.keepAspectRatioPolicy,c=e.mode,d=e.nearestMode===""?"simple":e.nearestMode;return cr({antialias:t,axes:r,coordinateTransformMode:n,cubicCoeffA:s,excludeOutside:a,extrapolationValue:i,keepAspectRatioPolicy:l,mode:c,nearestMode:d})}}),U$,W$,b4,Gne=Je(()=>{Mt(),Rt(),Ft(),U$=e=>{if(!e||e.length<3)throw new Error("layerNorm requires at least 3 inputs.");let t=e[0],r=e[1],n=e[2];if(t.dataType!==r.dataType||t.dataType!==n.dataType)throw new Error("All inputs must have the same data type");if(t.dims.length!==3&&t.dims.length!==2)throw new Error("Input must be 2D or 3D");if(r.dims.length!==3&&r.dims.length!==2)throw new Error("Skip must be 2D or 3D");let s=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(r.dims[r.dims.length-1]!==s)throw new Error("Skip must have the same hidden size as input");if(r.dims[r.dims.length-2]!==a)throw new Error("Skip must have the same sequence length as input");if(n.dims.length!==1)throw new Error("Gamma must be 1D");if(n.dims[n.dims.length-1]!==s)throw new Error("Gamma must have the same hidden size as input");if(e.length>3){let i=e[3];if(i.dims.length!==1)throw new Error("Beta must be 1D");if(i.dims[i.dims.length-1]!==s)throw new Error("Beta must have the same hidden size as input")}if(e.length>4){let i=e[4];if(i.dims.length!==1)throw new Error("Bias must be 1D");if(i.dims[i.dims.length-1]!==s)throw new Error("Bias must have the same hidden size as input")}},W$=(e,t,r,n)=>{let s=t.simplified,a=e[0].dims,i=Ce.size(a),l=a,c=i,d=a.slice(-1)[0],p=n?a.slice(0,-1).concat(1):[],u=!s&&e.length>3,h=e.length>4,f=n&&r>1,m=n&&r>2,v=r>3,k=64,y=Wr(d),g=[{type:12,data:c},{type:12,data:y},{type:12,data:d},{type:1,data:t.epsilon}],_=x=>{let b=[{name:"output_size",type:"u32"},{name:"components",type:"u32"},{name:"hidden_size",type:"u32"},{name:"epsilon",type:"f32"}],M=[De("x",e[0].dataType,e[0].dims,y),De("skip",e[1].dataType,e[1].dims,y),De("gamma",e[2].dataType,e[2].dims,y)];u&&M.push(De("beta",e[3].dataType,e[3].dims,y)),h&&M.push(De("bias",e[4].dataType,e[4].dims,y)),M.push(ut("output",e[0].dataType,l,y)),f&&M.push(ut("mean_output",1,p)),m&&M.push(ut("inv_std_output",1,p)),v&&M.push(ut("input_skip_bias_sum",e[0].dataType,l,y));let S=Dn(e[0].dataType),j=Dn(1,y);return`
3113
3114      ${x.registerUniforms(b).declareVariables(...M)}
3115      var<workgroup> sum_shared : array<${j}, ${k}>;
3116      var<workgroup> sum_squared_shared : array<${j}, ${k}>;
3117
3118      ${x.mainStart([k,1,1])}
3119        let ix = local_id.x;
3120        let iy = global_id.x / ${k};
3121
3122        let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components;
3123        var stride = hidden_size_vectorized / ${k};
3124        let offset = ix * stride + iy * hidden_size_vectorized;
3125        let offset1d = stride * ix;
3126        if (ix == ${k-1}) {
3127          stride = hidden_size_vectorized - stride * ix;
3128        }
3129        for (var i: u32 = 0; i < stride; i++) {
3130          let skip_value = skip[offset + i];
3131          let bias_value = ${h?"bias[offset1d + i]":S+"(0.0)"};
3132          let input_value = x[offset + i];
3133          let value = input_value + skip_value + bias_value;
3134          ${v?"input_skip_bias_sum[offset + i] = value;":""}
3135          output[offset + i] = value;
3136          let f32_value = ${yd(S,y,"value")};
3137          sum_shared[ix] += f32_value;
3138          sum_squared_shared[ix] += f32_value * f32_value;
3139        }
3140        workgroupBarrier();
3141
3142        var reduce_size : u32 = ${k};
3143        for (var curr_size = reduce_size >> 1;  curr_size > 0; curr_size = reduce_size >> 1) {
3144          reduce_size = curr_size + (reduce_size & 1);
3145          if (ix < curr_size) {
3146            sum_shared[ix] += sum_shared[ix + reduce_size];
3147            sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size];
3148          }
3149          workgroupBarrier();
3150        }
3151
3152        let sum = sum_shared[0];
3153        let square_sum = sum_squared_shared[0];
3154        let mean = ${Yo("sum",y)} / f32(uniforms.hidden_size);
3155        let inv_std_dev = inverseSqrt(${Yo("square_sum",y)} / f32(uniforms.hidden_size) ${s?"":"- mean * mean"} + uniforms.epsilon);
3156        ${f?"mean_output[global_idx] = mean;":""}
3157        ${m?"inv_std_output[global_idx] = inv_std_dev;":""}
3158
3159        for (var i: u32 = 0; i < stride; i++) {
3160          output[offset + i] = (output[offset + i] ${s?"":`- ${S}(mean)`}) *
3161            ${S}(inv_std_dev) * gamma[offset1d + i]
3162            ${u?"+ beta[offset1d + i]":""};
3163        }
3164      }`},w=[{dims:l,dataType:e[0].dataType}];return r>1&&w.push({dims:p,dataType:1}),r>2&&w.push({dims:p,dataType:1}),r>3&&w.push({dims:a,dataType:e[0].dataType}),{name:"SkipLayerNormalization",shaderCache:{hint:`${y};${f};${m};${v}`,inputDependencies:e.map((x,b)=>"type")},getShaderSource:_,getRunData:()=>({outputs:w,dispatchGroup:{x:Math.ceil(c/d)},programUniforms:g})}},b4=(e,t)=>{U$(e.inputs);let r=[0];e.outputCount>1&&r.push(-3),e.outputCount>2&&r.push(-3),e.outputCount>3&&r.push(3),e.compute(W$(e.inputs,t,e.outputCount,!1),{outputs:r})}}),V$,pp,G$,Zw,q$,H$,k4,T4,qne=Je(()=>{Mt(),Rt(),Zr(),Ft(),V$=(e,t)=>{if(!e||e.length<1)throw new Error("too few inputs");if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw new Error("axes, starts and ends must have the same length")}else if(t.starts.length!==t.ends.length)throw new Error("starts and ends must have the same length");e.slice(1).forEach((r,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw new Error(`Input ${n} must be an array of int32 or int64`)})},pp=(e,t)=>{let r=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(n=>r.push(Number(n)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(n=>r.push(Number(n)));else throw new Error(`Input ${t} must be an array of int32 or int64`);return r},G$=(e,t)=>{if(e.length>1){let r=pp(e,1),n=pp(e,2),s=pp(e,3);return s.length===0&&(s=[...Array(e[0].dims.length).keys()]),cr({starts:r,ends:n,axes:s})}else return t},Zw=(e,t,r,n,s)=>{let a=e;return e<0&&(a+=r[n[t]]),s[t]<0?Math.max(0,Math.min(a,r[n[t]]-1)):Math.max(0,Math.min(a,r[n[t]]))},q$=(e,t,r)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} {
3165          var input_indices: ${e.type.indices};
3166          var carry = 0u;
3167          for (var i = ${r.length}; i >= 0; i--) {
3168            let input_shape_i = ${mt("uniforms.input_shape","i",r.length)};
3169            let steps_i = ${mt("uniforms.steps","i",r.length)};
3170            let signs_i = ${mt("uniforms.signs","i",r.length)};
3171            let starts_i = ${mt("uniforms.starts","i",r.length)};
3172            var output_index = ${t.indicesGet("output_indices","i")};
3173            var input_index = output_index * steps_i + starts_i + carry;
3174            carry = input_index / input_shape_i;
3175            input_index = input_index % input_shape_i;
3176            if (signs_i < 0) {
3177              input_index = input_shape_i - input_index - 1u + starts_i;
3178            }
3179            ${e.indicesSet("input_indices","i","input_index")};
3180          }
3181          return input_indices;
3182      }`,H$=(e,t)=>{let r=e[0].dims,n=Ce.size(r),s=t.axes.length>0?Ce.normalizeAxes(t.axes,r.length):[...Array(r.length).keys()],a=pp(e,4);a.forEach(y=>y!==0||(()=>{throw new Error("step cannot be 0")})),a.length===0&&(a=Array(s.length).fill(1));let i=t.starts.map((y,g)=>Zw(y,g,r,s,a)),l=t.ends.map((y,g)=>Zw(y,g,r,s,a));if(s.length!==i.length||s.length!==l.length)throw new Error("start, ends and axes should have the same number of elements");if(s.length!==r.length)for(let y=0;y<r.length;++y)s.includes(y)||(i.splice(y,0,0),l.splice(y,0,r[y]),a.splice(y,0,1));let c=a.map(y=>Math.sign(y));a.forEach((y,g,_)=>{if(y<0){let w=(l[g]-i[g])/y,x=i[g],b=x+w*a[g];i[g]=b,l[g]=x,_[g]=-y}});let d=r.slice(0);s.forEach((y,g)=>{d[y]=Math.ceil((l[y]-i[y])/a[y])});let p={dims:d,dataType:e[0].dataType},u=ut("output",e[0].dataType,d.length),h=De("input",e[0].dataType,e[0].dims.length),f=Ce.size(d),m=[{name:"outputSize",type:"u32"},{name:"starts",type:"u32",length:i.length},{name:"signs",type:"i32",length:c.length},{name:"steps",type:"u32",length:a.length}],v=[{type:12,data:f},{type:12,data:i},{type:6,data:c},{type:12,data:a},...vt(e[0].dims,d)],k=y=>`
3183      ${y.registerUniforms(m).declareVariables(h,u)}
3184        ${q$(h,u,r)}
3185        ${y.mainStart()}
3186          ${y.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")}
3187          let output_indices = ${u.offsetToIndices("global_idx")};
3188          let input_indices = calculateInputIndices(output_indices);
3189          ${u.setByOffset("global_idx",h.getByIndices("input_indices"))}
3190      }`;return{name:"Slice",shaderCache:{hint:`${c.length}_${i.length}_${a.length}`,inputDependencies:["rank"]},getShaderSource:k,getRunData:()=>({outputs:[p],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:v})}},k4=(e,t)=>{V$(e.inputs,t);let r=G$(e.inputs,t);e.compute(H$(e.inputs,r),{inputs:[0]})},T4=e=>{let t=e.starts,r=e.ends,n=e.axes;return cr({starts:t,ends:r,axes:n})}}),K$,Q$,M4,E4,Hne=Je(()=>{Mt(),Rt(),Zr(),al(),Ft(),K$=e=>{if(!e||e.length!==1)throw new Error("Softmax op requires 1 input.")},Q$=(e,t)=>{let r=e.inputs[0],n=r.dims,s=Ce.size(n),a=n.length,i=Ce.normalizeAxis(t.axis,a),l=i<n.length-1,c,d=[];l?(d=Array.from({length:a},(M,S)=>S),d[i]=a-1,d[a-1]=i,c=e.compute(Qs(r,d),{inputs:[r],outputs:[-1]})[0]):c=r;let p=c.dims,u=p[a-1],h=s/u,f=Wr(u),m=u/f,v=64;h===1&&(v=256);let k=(M,S)=>S===4?`max(max(${M}.x, ${M}.y), max(${M}.z, ${M}.w))`:S===2?`max(${M}.x, ${M}.y)`:S===3?`max(max(${M}.x, ${M}.y), ${M}.z)`:M,y=De("x",c.dataType,c.dims,f),g=ut("result",c.dataType,c.dims,f),_=y.type.value,w=Dn(c.dataType)==="f32"?`var threadMax = ${_}(-3.402823e+38f);`:`var threadMax = ${_}(-65504.0h);`,x=M=>`
3191      var<workgroup> rowMaxShared : ${_};
3192      var<workgroup> rowSumShared : ${_};
3193      var<workgroup> threadShared : array<${_}, ${v}>;
3194
3195      fn getValue(row: i32, col: i32, row_stride: i32) -> ${_} {
3196        let index = row * row_stride + col;
3197        return x[index];
3198      }
3199
3200      fn setValue(row: i32, col: i32, row_stride: i32, value: ${_}) {
3201        let index = row * row_stride + col;
3202        result[index] = value;
3203      }
3204      ${M.registerUniform("packedCols","i32").declareVariables(y,g)}
3205      ${M.mainStart(v)}
3206        let gindex = i32(global_idx);
3207        let lindex = i32(local_idx);
3208        const wg = ${v};
3209        let row = gindex / wg;
3210        let cols = uniforms.packedCols;
3211        let row_stride : i32 = uniforms.packedCols;
3212
3213        // find the rows max
3214        ${w}
3215        for (var col = lindex; col < cols; col += wg) {
3216          let value = getValue(row, col, row_stride);
3217          threadMax = max(threadMax, value);
3218        }
3219        if (lindex < cols) {
3220          threadShared[lindex] = threadMax;
3221        }
3222        workgroupBarrier();
3223
3224        var reduceSize = min(cols, wg);
3225        for (var currSize = reduceSize >> 1;  currSize > 0; currSize = reduceSize >> 1) {
3226          reduceSize = currSize + (reduceSize & 1);
3227          if (lindex < currSize) {
3228            threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]);
3229          }
3230          workgroupBarrier();
3231        }
3232        if (lindex == 0) {
3233          rowMaxShared = ${_}(${k("threadShared[0]",f)});
3234        }
3235        workgroupBarrier();
3236
3237        // find the rows sum
3238        var threadSum = ${_}(0.0);
3239        for (var col = lindex; col < cols; col += wg) {
3240          let subExp = exp(getValue(row, col, row_stride) - rowMaxShared);
3241          threadSum += subExp;
3242        }
3243        threadShared[lindex] = threadSum;
3244        workgroupBarrier();
3245
3246        for (var currSize = wg >> 1;  currSize > 0; currSize = currSize >> 1) {
3247          if (lindex < currSize) {
3248            threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize];
3249          }
3250          workgroupBarrier();
3251        }
3252        if (lindex == 0) {
3253          rowSumShared = ${_}(${Yo("threadShared[0]",f)});
3254        }
3255        workgroupBarrier();
3256
3257        // calculate final value for each element in the row
3258        for (var col = lindex; col < cols; col += wg) {
3259          let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared;
3260          setValue(row, col, row_stride, value);
3261        }
3262      }`,b=e.compute({name:"Softmax",shaderCache:{hint:`${f};${v}`,inputDependencies:["type"]},getRunData:()=>({outputs:[{dims:p,dataType:c.dataType}],dispatchGroup:{x:h},programUniforms:[{type:6,data:m}]}),getShaderSource:x},{inputs:[c],outputs:[l?-1:0]})[0];l&&e.compute(Qs(b,d),{inputs:[b]})},M4=(e,t)=>{K$(e.inputs),Q$(e,t)},E4=e=>cr({axis:e.axis})}),Xw,Y$,J$,Z$,S4,Kne=Je(()=>{Mt(),Rt(),Ft(),Xw=e=>Array.from(e.getBigInt64Array(),Number),Y$=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 inputs.");if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error("Tile only support float, float16, int32, and uint32 data types");if(e[1].dataType!==7)throw new Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw new Error("Tile `repeats` input should be 1-D");if(Xw(e[1]).length!==e[0].dims.length)throw new Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},J$=(e,t)=>{let r=[];for(let n=0;n<e.length;++n)r.push(e[n]*t[n]);return r},Z$=(e,t)=>{let r=e[0].dims,n=t??Xw(e[1]),s=J$(r,n),a=Ce.size(s),i=e[0].dataType,l=De("input",i,r.length),c=ut("output",i,s.length),d=p=>`
3263      const inputShape = ${l.indices(...r)};
3264      ${p.registerUniform("output_size","u32").declareVariables(l,c)}
3265      ${p.mainStart()}
3266      ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}
3267      let output_indices = ${c.offsetToIndices("global_idx")};
3268      var input_indices: ${l.type.indices};
3269      for (var i = 0; i < ${r.length}; i++) {
3270        let input_dim_i = ${l.indicesGet("uniforms.input_shape","i")};
3271        let input_dim_value = ${c.indicesGet("output_indices","i")}  % input_dim_i;
3272
3273        ${l.indicesSet("input_indices","i","input_dim_value")}
3274      }
3275      ${c.setByOffset("global_idx",l.getByIndices("input_indices"))}
3276    }`;return{name:"Tile",shaderCache:{hint:`${n}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...vt(e[0].dims,s)]}),getShaderSource:d}},S4=e=>{Y$(e.inputs),e.compute(Z$(e.inputs),{inputs:[0]})}}),X$,eN,A4,Qne=Je(()=>{Mt(),Rt(),Ft(),X$=(e,t,r,n,s)=>{let a=ut("output_data",s,r.length,4),i=De("a_data",t[1].dataType,t[1].dims.length,4),l=De("b_data",t[2].dataType,t[2].dims.length,4),c=De("c_data",t[0].dataType,t[0].dims.length,4),d,p=(u,h,f)=>`select(${h}, ${u}, ${f})`;if(!n)d=a.setByOffset("global_idx",p(i.getByOffset("global_idx"),l.getByOffset("global_idx"),c.getByOffset("global_idx")));else{let u=(h,f,m="")=>{let v=`a_data[index_a${f}][component_a${f}]`,k=`b_data[index_b${f}][component_b${f}]`,y=`bool(c_data[index_c${f}] & (0xffu << (component_c${f} * 8)))`;return`
3277            let output_indices${f} = ${a.offsetToIndices(`global_idx * 4u + ${f}u`)};
3278            let offset_a${f} = ${i.broadcastedIndicesToOffset(`output_indices${f}`,a)};
3279            let offset_b${f} = ${l.broadcastedIndicesToOffset(`output_indices${f}`,a)};
3280            let offset_c${f} = ${c.broadcastedIndicesToOffset(`output_indices${f}`,a)};
3281            let index_a${f} = offset_a${f} / 4u;
3282            let index_b${f} = offset_b${f} / 4u;
3283            let index_c${f} = offset_c${f} / 4u;
3284            let component_a${f} = offset_a${f} % 4u;
3285            let component_b${f} = offset_b${f} % 4u;
3286            let component_c${f} = offset_c${f} % 4u;
3287            ${h}[${f}] = ${m}(${p(v,k,y)});
3288          `};s===9?d=`
3289            var data = vec4<u32>(0);
3290            ${u("data",0,"u32")}
3291            ${u("data",1,"u32")}
3292            ${u("data",2,"u32")}
3293            ${u("data",3,"u32")}
3294            output_data[global_idx] = dot(vec4<u32>(0x1, 0x100, 0x10000, 0x1000000), vec4<u32>(data));`:d=`
3295            ${u("output_data[global_idx]",0)}
3296            ${u("output_data[global_idx]",1)}
3297            ${u("output_data[global_idx]",2)}
3298            ${u("output_data[global_idx]",3)}
3299          `}return`
3300        ${e.registerUniform("vec_size","u32").declareVariables(c,i,l,a)}
3301        ${e.mainStart()}
3302        ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")}
3303        ${d}
3304      }`},eN=e=>{let t=e[1].dims,r=e[2].dims,n=e[0].dims,s=e[1].dataType,a=!(Ce.areEqual(t,r)&&Ce.areEqual(r,n)),i=t,l=Ce.size(t);if(a){let d=Yd.calcShape(Yd.calcShape(t,r,!1),n,!1);if(!d)throw new Error("Can't perform where op on the given tensors");i=d,l=Ce.size(i)}let c=Math.ceil(l/4);return{name:"Where",shaderCache:{inputDependencies:["rank","rank","rank"]},getShaderSource:d=>X$(d,e,i,a,s),getRunData:()=>({outputs:[{dims:i,dataType:s}],dispatchGroup:{x:Math.ceil(l/64/4)},programUniforms:[{type:12,data:c},...vt(n,t,r,i)]})}},A4=e=>{e.compute(eN(e.inputs))}}),P4,Yne=Je(()=>{dne(),K1(),une(),pne(),hne(),fne(),mne(),wne(),bne(),kne(),Tne(),Mne(),Ene(),Sne(),Ane(),Pne(),Cne(),jne(),Ine(),$ne(),Nne(),One(),Rne(),Dne(),Fne(),KB(),Lne(),zne(),Bne(),Une(),Wne(),H1(),Vne(),XB(),Gne(),qne(),Hne(),JB(),Kne(),al(),Q1(),Qne(),P4=new Map([["Abs",[bz]],["Acos",[kz]],["Acosh",[Tz]],["Add",[sB]],["ArgMax",[vz,Bb]],["ArgMin",[yz,Bb]],["Asin",[Mz]],["Asinh",[Ez]],["Atan",[Sz]],["Atanh",[Az]],["Attention",[_z]],["AveragePool",[l4,o4]],["BatchNormalization",[wz]],["BiasAdd",[xz]],["BiasSplitGelu",[nB]],["Cast",[Cz,Pz]],["Ceil",[Iz]],["Clip",[jz]],["Concat",[fB,mB]],["Conv",[Hb,qb]],["ConvTranspose",[MB,TB]],["Cos",[$z]],["Cosh",[Nz]],["CumSum",[EB,SB]],["DepthToSpace",[AB,PB]],["DequantizeLinear",[m4,g4]],["Div",[aB]],["Einsum",[CB,jB]],["Elu",[Oz,kp]],["Equal",[iB]],["Erf",[Rz]],["Exp",[Dz]],["Expand",[IB]],["FastGelu",[$B]],["Floor",[Fz]],["FusedConv",[Hb,qb]],["Gather",[OB,NB]],["GatherElements",[BB,zB]],["GatherBlockQuantized",[FB,LB]],["GatherND",[RB,DB]],["Gelu",[Lz]],["Gemm",[WB,UB]],["GlobalAveragePool",[d4,c4]],["GlobalMaxPool",[f4,h4]],["Greater",[dB]],["GreaterOrEqual",[pB]],["GridSample",[VB,GB]],["GroupQueryAttention",[e4]],["HardSigmoid",[Hz,qz]],["InstanceNormalization",[t4]],["LayerNormalization",[r4]],["LeakyRelu",[zz,kp]],["Less",[uB]],["LessOrEqual",[hB]],["Log",[tB]],["MatMul",[n4]],["MatMulNBits",[s4,a4]],["MaxPool",[u4,p4]],["Mul",[oB]],["MultiHeadAttention",[HB,qB]],["Neg",[Uz]],["Not",[Bz]],["Pad",[i4]],["Pow",[lB]],["QuickGelu",[rB,kp]],["Range",[y4]],["Reciprocal",[Wz]],["ReduceMin",[pz]],["ReduceMean",[oz]],["ReduceMax",[uz]],["ReduceSum",[fz]],["ReduceProd",[hz]],["ReduceL1",[lz]],["ReduceL2",[cz]],["ReduceLogSum",[gz]],["ReduceLogSumExp",[dz]],["ReduceSumSquare",[mz]],["Relu",[Vz]],["Resize",[w4,x4]],["RotaryEmbedding",[ZB]],["ScatterND",[_4,v4]],["Sigmoid",[Gz]],["Sin",[Kz]],["Sinh",[Qz]],["Slice",[k4,T4]],["Ski
3304pLayerNormalization",[b4]],["Split",[QB,YB]],["Sqrt",[Yz]],["Softmax",[M4,E4]],["Sub",[cB]],["Tan",[Jz]],["Tanh",[Zz]],["ThresholdedRelu",[eB,kp]],["Tile",[S4]],["Transpose",[QL,YL]],["Where",[A4]]])}),C4,Jne=Je(()=>{ti(),Ji(),Ft(),C4=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,r,n,s){Xa(e.programInfo.name);let a=this.backend.device,i=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let l=[];for(let d of t)l.push({binding:l.length,resource:{buffer:d.buffer}});for(let d of r)l.push({binding:l.length,resource:{buffer:d.buffer}});s&&l.push({binding:l.length,resource:s});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:l,label:e.programInfo.name});if(this.backend.sessionStatus==="capturing"){let d={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:n};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(d)}i.setPipeline(e.computePipeline),i.setBindGroup(0,c),i.dispatchWorkgroups(...n),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType==="at-passes")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),_a(e.programInfo.name)}dispose(){}build(e,t){Xa(e.name);let r=this.backend.device,n=[];[{feature:"shader-f16",extension:"f16"},{feature:"subgroups",extension:"subgroups"}].forEach(d=>{r.features.has(d.feature)&&n.push(`enable ${d.extension};`)});let s=KL(t,this.backend.device.limits),a=e.getShaderSource(s),i=`${n.join(`
3305`)}
3306${s.additionalImplementations}
3307${a}`,l=r.createShaderModule({code:i,label:e.name});Yt("verbose",()=>`[WebGPU] ${e.name} shader code: ${i}`);let c=r.createComputePipeline({compute:{module:l,entryPoint:"main"},layout:"auto",label:e.name});return _a(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:s.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e=="number"?e:e.x,r=typeof e=="number"?1:e.y||1,n=typeof e=="number"?1:e.z||1,s=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=s&&r<=s&&n<=s)return[t,r,n];let a=t*r*n,i=Math.ceil(Math.sqrt(a));if(i>s){if(i=Math.ceil(Math.cbrt(a)),i>s)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[i,i,i]}else return[i,i,1]}}}),j4={};pu(j4,{WebGpuBackend:()=>I4});var tN,rN,nN,I4,Zne=Je(()=>{ti(),Mt(),Ji(),WL(),lne(),Yne(),Jne(),tN=(e,t)=>{if(t.length!==e.length)throw new Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let r=[];for(let n=0;n<e.length;++n){let s=e[n].dataType;switch(t[n]){case"none":{r.push("");break}case"type":{r.push(`${s}`);break}case"rank":{let a=e[n].dims.length;r.push(`${s};${a}`);break}case"dims":{let a=e[n].dims.join(",");r.push(`${s};${a}`);break}default:throw new Error(`unsupported input dependency: ${t[n]}`)}}return r.join("|")},rN=(e,t,r)=>{var s,a;let n=e.name;return(s=e.shaderCache)!=null&&s.hint&&(n+="["+e.shaderCache.hint+"]"),n+=":"+r+`:${tN(t,((a=e.shaderCache)==null?void 0:a.inputDependencies)??new Array(t.length).fill("dims"))}`,n},nN=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},I4=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus="default",this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error("currentKernelCustomData(): currentKernelId is null. (should not happen)");let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let r=[],n={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:r},s=a=>t.features.has(a)&&r.push(a)&&!0;s("chromium-experimental-timestamp-query-inside-passes")||s("timestamp-query"),s("shader-f16"),s("subgroups"),this.device=await t.requestDevice(n),this.adapterInfo=new nN(t.info||await t.requestAdapterInfo()),this.gpuDataManager=qL(this),this.programManager=new C4(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,W1(e.logLevel,!!e.debug),this.device.onuncapturederror=a=>
vendor: 15,622 bytes, line 3307
3307{a.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${a.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<"u"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType==="at-passes"&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;Xa(),this.endComputePass();let e;this.queryType!=="none"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!=="none"&&e.mapAsync(GPUMapMode.READ).then(()=>{var n;let t=new BigUint64Array(e.getMappedRange()),r=this.pendingQueries.get(e);for(let s=0;s<t.length/2;s++){let a=r[s],i=a.kernelId,l=this.kernels.get(i),c=l.kernelType,d=l.kernelName,p=a.programName,u=a.inputTensorViews,h=a.outputTensorViews,f=t[s*2],m=t[s*2+1];typeof this.queryTimeBase>"u"&&(this.queryTimeBase=f);let v=Number(f-this.queryTimeBase),k=Number(m-this.queryTimeBase);if(!Number.isSafeInteger(v)||!Number.isSafeInteger(k))throw new RangeError("incorrect timestamp range");if((n=this.env.webgpu.profiling)!=null&&n.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:u.map(y=>({dims:y.dims,dataType:Di(y.dataType)})),outputsMetadata:h.map(y=>({dims:y.dims,dataType:Di(y.dataType)})),kernelId:i,kernelType:c,kernelName:d,programName:p,startTime:v,endTime:k});else{let y="";u.forEach((_,w)=>{y+=`input[${w}]: [${_.dims}] | ${Di(_.dataType)}, `});let g="";h.forEach((_,w)=>{g+=`output[${w}]: [${_.dims}] | ${Di(_.dataType)}, `}),console.log(`[profiling] kernel "${i}|${c}|${d}|${p}" ${y}${g}execution time: ${k-v} ns`)}wh("GPU",`${p}::${f}::${m}`)}e.unmap(),this.pendingQueries.delete(e)}),_a()}run(e,t,r,n,s,a){Xa(e.name);let i=[];for(let g=0;g<t.length;++g){let _=t[g].data;if(_===0)continue;let w=this.gpuDataManager.get(_);if(!w)throw new Error(`no GPU data for input: ${_}`);i.push(w)}let{outputs:l,dispatchGroup:c,programUniforms:d}=e.getRunData(t),p=r.length===0?l.map((g,_)=>_):r;if(p.length!==l.length)throw new Error(`Output size ${p.length} must be equal to ${l.length}.`);let u=[],h=[];for(let g=0;g<l.length;++g){if(!Number.isInteger(p[g])||p[g]<-3||p[g]>=a)throw new Error(`Invalid output index: ${p[g]}`);if(p[g]===-3)continue;let _=p[g]===-1,w=p[g]===-2,x=_||w?s(l[g].dataType,l[g].dims):n(p[g],l[g].dataType,l[g].dims);if(u.push(x),x.data===0)continue;let b=this.gpuDataManager.get(x.data);if(!b)throw new Error(`no GPU data for output: ${x.data}`);if(_&&this.temporaryData.push(b),w){let M=this.kernelPersistentData.get(this.currentKernelId);M||(M=[],this.kernelPersistentData.set(this.currentKernelId,M)),M.push(b)}h.push(b)}if(i.length!==t.length||h.length!==u.length){if(h.length===0)return _a(e.name),u;throw new Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let f;if(d){let g=0,_=[];d.forEach(M=>{let S=typeof M.data=="number"?[M.data]:M.data;if(S.length===0)return;let j=M.type===10?2:4,I,q;M.type===10?(q=S.length>4?16:S.length>2?8:S.length*j,I=S.length>4?16:j*S.length):(q=S.length<=2?S.length*j:16,I=16),g=Math.ceil(g/q)*q,_.push(g);let U=M.type===10?8:4;g+=S.length>4?Math.ceil(S.length/U)*I:S.length*j});let w=16;g=Math.ceil(g/w)*w;let x=new ArrayBuffer(g);d.forEach((M,S)=>{let j=_[S],I=typeof M.data=="number"?[M.data]:M.data;if(M.type===6)new Int32Array(x,j,I.length).set(I);else if(M.type===12)new Uint32Array(x,j,I.length).set(I);else if(M.type===10)new Uint16Array(x,j,I.length).set(I);else if(M.type===1)new Float32Array(x,j,I.length).set(I);else throw new Error(`Unsupported uniform type: ${Di(M.type)}`)});let b=this.gpuDataManager.create(g,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(b.buffer,0,x,0,g),this.gpuDataManager.release(b.id),f={offset:0,size:g,buffer:b.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),v=m[1]===1&&m[2]===1,k=rN(e,t,v),y=this.programManager.getArtifact(k);if(y||(y=this.programManager.build(e,m),this.programManager.setArtifact(k,y),Yt("info",()=>`[artifact] key: ${k}, programName: ${e.name}`)),d&&y.uniformVariablesInfo){if(d.length!==y.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${y.uniformVariablesInfo.length}, got ${d.length} in program "${y.programInfo.name}".`);for(let g=0;g<d.length;g++){let _=d[g],w=_.type,x=typeof _.data=="number"?1:_.data.length,[b,M]=y.uniformVariablesInfo[g];if(w!==b||x!==M)throw new Error(`Uniform variable ${g} mismatch: expect type ${b} with size ${M}, got type ${w} with size ${x} in program "${y.programInfo.name}".`)}}if(Yt("info",()=>`[ProgramManager] run "${e.name}" (key=${k}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!=="none"||this.sessionStatus==="capturing"){let g={kernelId:this.currentKernelId,programName:y.programInfo.name,inputTensorViews:t,outputTensorViews:u};this.pendingKernels.push(g),this.sessionStatus==="capturing"&&this.capturedPendingKernels.get(this.currentSessionId).push(g)}return this.programManager.run(y,i,h,m,f),_a(e.name),u}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,r,n){let s=P4.get(e);if(!s)throw new Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:n,kernelEntry:s[0],attributes:[s[1],r]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let r of t)this.gpuDataManager.release(r.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,r){let n=this.kernels.get(e);if(!n)throw new Error(`kernel not created: ${e}`);let s=n.kernelType,a=n.kernelName,i=n.kernelEntry,l=n.attributes;if(this.currentKernelId!==null)throw new Error(`kernel "[${s}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,l[0]&&(l[1]=l[0](l[1]),l[0]=void 0),Yt("info",()=>`[WebGPU] Start to run kernel "[${s}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope("validation"),i(t,l[1]),0}catch(d){return r.push(Promise.resolve(`[WebGPU] Kernel "[${s}] ${a}" failed. ${d}`)),1}finally{c&&r.push(this.device.popErrorScope().then(d=>d?`GPU validation error for kernel "[${s}] ${a}": ${d.message}`:null));for(let d of this.temporaryData)this.gpuDataManager.release(d.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,r,n){let s=this.sessionExternalDataMapping.get(e);s||(s=new Map,this.sessionExternalDataMapping.set(e,s));let a=s.get(t),i=this.gpuDataManager.registerExternalBuffer(r,n,a);return s.set(t,[i,r]),i}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(r=>this.gpuDataManager.unregisterExternalBuffer(r[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw new Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,r){return async()=>{let n=await Fb(this,e,t);return V1(n.buffer,r)}}writeTimestamp(e){this.queryType==="inside-passes"&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType="none",(((e=this.env.webgpu.profiling)==null?void 0:e.mode)==="default"||(typeof this.env.trace>"u"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has("chromium-experimental-timestamp-query-inside-passes")?this.queryType="inside-passes":this.device.features.has("timestamp-query")&&(this.queryType="at-passes"),this.queryType!=="none"&&typeof this.querySet>"u"&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){Yt("info","captureBegin"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus="capturing"}captureEnd(){Yt("info","captureEnd"),this.flush(),this.sessionStatus="default"}replay(){Yt("info","replay"),this.sessionStatus="replaying";let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),r=e.length;this.pendingKernels=[];for(let n=0;n<r;n++){let s=this.getComputePassEncoder(),a=e[n];this.writeTimestamp(this.pendingDispatchNumber*2),s.setPipeline(a.computePipeline),s.setBindGroup(0,a.bindGroup),s.dispatchWorkgroups(...a.dispatchGroup),this.writeTimestamp(this.pendingDispatchNumber*2+1),this.pendingDispatchNumber++,this.queryType!=="none"&&this.pendingKernels.push(t[n]),(this.pendingDispatchNumber>=this.maxDispatchNumber||this.queryType==="at-passes")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus="default"}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),$4={};pu($4,{init:()=>N4});var km,sN,N4,Xne=Je(()=>{Mt(),Ji(),Rt(),one(),km=class O4{constructor(t,r,n,s){this.module=t,this.dataType=r,this.data=n,this.dims=s}getFloat32Array(){if(this.dataType!==1)throw new Error("Invalid data type");let t=Ce.size(this.dims);return t===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,t)}getBigInt64Array(){if(this.dataType!==7)throw new Error("Invalid data type");let t=Ce.size(this.dims);return t===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,t)}getInt32Array(){if(this.dataType!==6)throw new Error("Invalid data type");let t=Ce.size(this.dims);return t===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,t)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw new Error("Invalid data type");let t=Ce.size(this.dims);return t===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,t)}reshape(t){if(Ce.size(t)!==Ce.size(this.dims))throw new Error("Invalid new shape");return new O4(this.module,this.dataType,this.data,t)}},sN=class{constructor(e,t,r){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let n=e.PTR_SIZE,s=r/e.PTR_SIZE,a=n===4?"i32":"i64";this.opKernelContext=Number(e.getValue(n*s++,a));let i=Number(e.getValue(n*s++,a));this.outputCount=Number(e.getValue(n*s++,a)),this.customDataOffset=Number(e.getValue(n*s++,"*")),this.customDataSize=Number(e.getValue(n*s++,a));let l=[];for(let c=0;c<i;c++){let d=Number(e.getValue(n*s++,a)),p=Number(e.getValue(n*s++,"*")),u=Number(e.getValue(n*s++,a)),h=[];for(let f=0;f<u;f++)h.push(Number(e.getValue(n*s++,a)));l.push(new km(e,d,p,h))}this.inputs=l}get kernelCustomData(){return this.backend.currentKernelCustomData}get customDataBuffer(){return this.module.HEAPU8.subarray(this.customDataOffset,this.customDataOffset+this.customDataSize)}compute(e,t){var i;let r=((i=t==null?void 0:t.inputs)==null?void 0:i.map(l=>typeof l=="number"?this.inputs[l]:l))??this.inputs,n=(t==null?void 0:t.outputs)??[],s=(l,c,d)=>new km(this.module,c,this.output(l,d),d),a=(l,c)=>{let d=Bl(l,c);if(!d)throw new Error(`Unsupported data type: ${l}`);let p=d>0?this.backend.gpuDataManager.create(d).id:0;return new km(this.module,l,p,c)};return this.backend.run(e,r,n,s,a,this.outputCount)}output(e,t){let r=this.module.stackSave();try{let n=this.module.PTR_SIZE,s=n===4?"i32":"i64",a=this.module.stackAlloc((1+t.length)*n);this.module.setValue(a,t.length,s);for(let i=0;i<t.length;i++)this.module.setValue(a+n*(i+1),t[i],s);return this.module._JsepOutput(this.opKernelContext,e,a)}catch(n){throw new Error(`Failed to generate kernel's output[${e}] with dims [${t}]. If you are running with pre-allocated output, please make sure the output type/dims are correct. Error: ${n}`)}finally{this.module.stackRestore(r)}}},N4=async(e,t,r,n)=>{let s=t.jsepInit;if(!s)throw new Error("Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.");if(e==="webgpu"){let a=(Zne(),_h(j4)).WebGpuBackend,i=new a;await i.initialize(r,n),s("webgpu",[i,l=>i.alloc(Number(l)),l=>i.free(l),(l,c,d,p=!1)=>{if(p)Yt("verbose",()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(l)}, dst=${Number(c)}, size=${Number(d)}`),i.memcpy(Number(l),Number(c));else{Yt("verbose",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(l)}, gpuDataId=${Number(c)}, size=${Number(d)}`);let u=t.HEAPU8.subarray(Number(l>>>0),Number(l>>>0)+Number(d));i.upload(Number(c),u)}},async(l,c,d)=>{Yt("verbose",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${l}, dataOffset=${c}, size=${d}`),await i.download(Number(l),()=>t.HEAPU8.subarray(Number(c)>>>0,Number(c+d)>>>0))},(l,c,d)=>i.createKernel(l,Number(c),d,t.UTF8ToString(t._JsepGetNodeName(Number(c)))),l=>i.releaseKernel(l),(l,c,d,p)=>{Yt("verbose",()=>`[WebGPU] jsepRun: sessionHandle=${d}, kernel=${l}, contextDataOffset=${c}`);let u=new sN(t,i,Number(c));return i.computeKernel(Number(l),u,p)},()=>i.captureBegin(),()=>i.captureEnd(),()=>i.replay()])}else{let a=new GL(r);s("webnn",[a,()=>a.reserveTensorId(),i=>a.releaseTensorId(i),async(i,l,c,d,p)=>a.ensureTensor(i,l,c,d,p),(i,l)=>{a.uploadTensor(i,l)},async(i,l)=>a.downloadTensor(i,l)])}}}),aN,tk,rk,fo,iN,ex,Kg,nk,sk,tx,ak,ik,ok,R4=Je(()=>{sne(),ane(),Mt(),vc(),F1(),LL(),aN=(e,t)=>{kr()._OrtInit(e,t)!==0&&pr("Can't initialize onnxruntime.")},tk=async e=>{aN(e.wasm.numThreads,Wg(e.logLevel))},rk=async(e,t)=>{var r,n;(n=(r=kr()).asyncInit)==null||n.call(r);{let s=(Xne(),_h($4)).init;if(t==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");let a=e.webgpu.adapter;if(a){if(typeof a.limits!="object"||typeof a.features!="object"||typeof a.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=e.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let l=e.webgpu.forceFallbackAdapter;if(l!==void 0&&typeof l!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${l}"`);
3307if(a=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:l}),!a)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}await s("webgpu",kr(),e,a)}if(t==="webnn"){if(typeof navigator>"u"||!navigator.ml)throw new Error("WebNN is not supported in current environment");await s("webnn",kr(),e)}}},fo=new Map,iN=e=>{let t=kr(),r=t.stackSave();try{let n=t.PTR_SIZE,s=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,s,s+n)!==0&&pr("Can't get session input/output count.");let a=n===4?"i32":"i64";return[Number(t.getValue(s,a)),Number(t.getValue(s+n,a))]}finally{t.stackRestore(r)}},ex=(e,t)=>{let r=kr(),n=r.stackSave(),s=0;try{let a=r.PTR_SIZE,i=r.stackAlloc(2*a);r._OrtGetInputOutputMetadata(e,t,i,i+a)!==0&&pr("Can't get session input/output metadata.");let l=Number(r.getValue(i,"*"));s=Number(r.getValue(i+a,"*"));let c=r.HEAP32[s/4];if(c===0)return[l,0];let d=r.HEAPU32[s/4+1],p=[];for(let u=0;u<d;u++){let h=Number(r.getValue(s+8+u*a,"*"));p.push(h!==0?r.UTF8ToString(h):Number(r.getValue(s+8+(u+d)*a,"*")))}return[l,c,p]}finally{r.stackRestore(n),s!==0&&r._OrtFree(s)}},Kg=e=>{let t=kr(),r=t._malloc(e.byteLength);if(r===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,r),[r,e.byteLength]},nk=async(e,t)=>{var u,h,f,m;let r,n,s=kr();Array.isArray(e)?[r,n]=e:e.buffer===s.HEAPU8.buffer?[r,n]=[e.byteOffset,e.byteLength]:[r,n]=Kg(e);let a=0,i=0,l=0,c=[],d=[],p=[];try{if([i,c]=await FL(t),(t==null?void 0:t.externalData)&&s.mountExternalData){let S=[];for(let j of t.externalData){let I=typeof j=="string"?j:j.path;S.push(U1(typeof j=="string"?j:j.data).then(q=>{s.mountExternalData(I,q)}))}await Promise.all(S)}for(let S of(t==null?void 0:t.executionProviders)??[])if((typeof S=="string"?S:S.name)==="webnn"){if(s.shouldTransferToMLTensor=!1,typeof S!="string"){let j=S,I=j==null?void 0:j.context,q=j==null?void 0:j.gpuDevice,U=j==null?void 0:j.deviceType,R=j==null?void 0:j.powerPreference;I?s.currentContext=I:q?s.currentContext=await s.webnnCreateMLContext(q):s.currentContext=await s.webnnCreateMLContext({deviceType:U,powerPreference:R})}else s.currentContext=await s.webnnCreateMLContext();break}a=await s._OrtCreateSession(r,n,i),(u=s.webgpuOnCreateSession)==null||u.call(s,a),a===0&&pr("Can't create a session."),(h=s.jsepOnCreateSession)==null||h.call(s),s.currentContext&&(s.webnnRegisterMLContext(a,s.currentContext),s.currentContext=void 0,s.shouldTransferToMLTensor=!0);let[v,k]=iN(a),y=!!(t!=null&&t.enableGraphCapture),g=[],_=[],w=[],x=[],b=[];for(let S=0;S<v;S++){let[j,I,q]=ex(a,S);j===0&&pr("Can't get an input name."),d.push(j);let U=s.UTF8ToString(j);g.push(U),w.push(I===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:Di(I),shape:q})}for(let S=0;S<k;S++){let[j,I,q]=ex(a,S+v);j===0&&pr("Can't get an output name."),p.push(j);let U=s.UTF8ToString(j);_.push(U),x.push(I===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:Di(I),shape:q});{if(y&&(t==null?void 0:t.preferredOutputLocation)===void 0){b.push("gpu-buffer");continue}let R=typeof(t==null?void 0:t.preferredOutputLocation)=="string"?t.preferredOutputLocation:((f=t==null?void 0:t.preferredOutputLocation)==null?void 0:f[U])??"cpu";if(R!=="cpu"&&R!=="cpu-pinned"&&R!=="gpu-buffer"&&R!=="ml-tensor")throw new Error(`Not supported preferred output location: ${R}.`);if(y&&R!=="gpu-buffer")throw new Error(`Not supported preferred output location: ${R}. Only 'gpu-buffer' location is supported when enableGraphCapture is true.`);b.push(R)}}let M=null;return b.some(S=>S==="gpu-buffer"||S==="ml-tensor")&&(l=s._OrtCreateBinding(a),l===0&&pr("Can't create IO binding."),M={handle:l,outputPreferredLocations:b,outputPreferredLocationsEncoded:b.map(S=>Rb(S))}),fo.set(a,[a,d,p,M,y,!1]),[a,g,_,w,x]}catch(v){throw d.forEach(k=>s._OrtFree(k)),p.forEach(k=>s._OrtFree(k)),l!==0&&s._OrtReleaseBinding(l)!==0&&pr("Can't release IO binding."),a!==0&&s._OrtReleaseSession(a)!==0&&pr("Can't release session."),v}finally{s._free(r),i!==0&&s._OrtReleaseSessionOptions(i)!==0&&pr("Can't release session options."),c.forEac
vendor: 3,203 bytes, line 3307
3307h(v=>s._free(v)),(m=s.unmountExternalData)==null||m.call(s)}},sk=e=>{var c,d,p;let t=kr(),r=fo.get(e);if(!r)throw new Error(`cannot release session. invalid session id: ${e}`);let[n,s,a,i,l]=r;i&&(l&&t._OrtClearBoundOutputs(i.handle)!==0&&pr("Can't clear bound outputs."),t._OrtReleaseBinding(i.handle)!==0&&pr("Can't release IO binding.")),(c=t.jsepOnReleaseSession)==null||c.call(t,e),(d=t.webnnOnReleaseSession)==null||d.call(t,e),(p=t.webgpuOnReleaseSession)==null||p.call(t,e),s.forEach(u=>t._OrtFree(u)),a.forEach(u=>t._OrtFree(u)),t._OrtReleaseSession(n)!==0&&pr("Can't release session."),fo.delete(e)},tx=async(e,t,r,n,s,a,i=!1)=>{if(!e){t.push(0);return}let l=kr(),c=l.PTR_SIZE,d=e[0],p=e[1],u=e[3],h=u,f,m;if(d==="string"&&(u==="gpu-buffer"||u==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(i&&u!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(u==="gpu-buffer"){let y=e[2].gpuBuffer;m=Bl(ed(d),p);{let g=l.jsepRegisterBuffer;if(!g)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');f=g(n,a,y,m)}}else if(u==="ml-tensor"){let y=e[2].mlTensor;m=Bl(ed(d),p);let g=l.webnnRegisterMLTensor;if(!g)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');f=g(n,y,ed(d),p)}else{let y=e[2];if(Array.isArray(y)){m=c*y.length,f=l._malloc(m),r.push(f);for(let g=0;g<y.length;g++){if(typeof y[g]!="string")throw new TypeError(`tensor data at index ${g} is not a string`);l.setValue(f+g*c,Va(y[g],r),"*")}}else{let g=l.webnnIsGraphInput;if(d!=="string"&&g){let _=l.UTF8ToString(s);if(g(n,_)){let w=ed(d);m=Bl(w,p),h="ml-tensor";let x=l.webnnCreateTemporaryTensor,b=l.webnnUploadTensor;if(!x||!b)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let M=await x(n,w,p);b(M,new Uint8Array(y.buffer,y.byteOffset,y.byteLength)),f=M}else m=y.byteLength,f=l._malloc(m),r.push(f),l.HEAPU8.set(new Uint8Array(y.buffer,y.byteOffset,m),f)}else m=y.byteLength,f=l._malloc(m),r.push(f),l.HEAPU8.set(new Uint8Array(y.buffer,y.byteOffset,m),f)}}let v=l.stackSave(),k=l.stackAlloc(4*p.length);try{p.forEach((g,_)=>l.setValue(k+_*c,g,c===4?"i32":"i64"));let y=l._OrtCreateTensor(ed(d),f,m,k,p.length,Rb(h));y===0&&pr(`Can't create tensor for input/output. session=${n}, index=${a}.`),t.push(y)}finally{l.stackRestore(v)}},ak=async(e,t,r,n,s,a)=>{var q,U,R,K;let i=kr(),l=i.PTR_SIZE,c=fo.get(e);if(!c)throw new Error(`cannot run inference. invalid session id: ${e}`);let d=c[0],p=c[1],u=c[2],h=c[3],f=c[4],m=c[5],v=t.length,k=n.length,y=0,g=[],_=[],w=[],x=[],b=i.stackSave(),M=i.stackAlloc(v*l),S=i.stackAlloc(v*l),j=i.stackAlloc(k*l),I=i.stackAlloc(k*l);try{[y,g]=DL(a);for(let te=0;te<v;te++)await tx(r[te],_,x,e,p[t[te]],t[te],f);for(let te=0;te<k;te++)await tx(s[te],w,x,e,u[n[te]],v+n[te],f);for(let te=0;te<v;te++)i.setValue(M+te*l,_[te],"*"),i.setValue(S+te*l,p[t[te]],"*");for(let te=0;te<k;te++)i.setValue(j+te*l,w[te],"*"),i.setValue(I+te*l,u[n[te]],"*");if(h&&!m){let{handle:te,outputPreferredLocations:V,outputPreferredLocationsEncoded:ae}=h;if(p.length!==v)throw new Error(`input count from feeds (${v}
3307) is expected to be always equal to model's input count (${p.length}).`);for(let ne=0;ne<v;ne++){let L=t[ne];await i._OrtBindInput(te,p[L],_[ne])!==0&&pr(`Can't bind input[${ne}] for session=${e}.`)}for(let ne=0;ne<k;ne++){let L=n[ne];(q=s[ne])!=null&&q[3]?i._OrtBindOutput(te,u[L],w[ne],0)!==0&&pr(`Can't bind pre-allocated output[${ne}] for session=${e}.`):i._OrtBindOutput(te,u[L],0,ae[L])!==0&&pr(`Can't bind output[${ne}] to ${V[ne]} for session=${e}.`)}fo.set(e,[d,p,u,h,f,!0])}(U=i.jsepOnRunStart)==null||U.call(i,d),(R=i.webnnOnRunStart)==null||R.call(i,d);let H;h?H=await i._OrtRunWithBinding(d,h.handle,k,j,y):H=await i._OrtRun(d,S,M,v,I,k,j,y),H!==0&&pr("failed to call OrtRun().");let ee=[];for(let te=0;te<k;te++){let V=Number(i.getValue(j+te*l,"*"));if(V===w[te]){ee.push(s[te]);continue}let ae=i.stackSave(),ne=i.stackAlloc(4*l),L=!1,$,G=0;try{i._OrtGetTensorData(V,ne,ne+l,ne+2*l,ne+3*l)!==0&&pr(`Can't access output tensor data on index ${te}.`);let se=l===4?"i32":"i64",_e=Number(i.getValue(ne,se));G=i.getValue(ne+l,"*");let de=i.getValue(ne+l*2,"*"),Ee=Number(i.getValue(ne+l*3,se)),ze=[];for(let J=0;J<Ee;J++)ze.push(Number(i.getValue(de+J*l,se)));i._OrtFree(de)!==0&&pr("Can't free memory for tensor dims.");let Ke=ze.reduce((J,ue)=>J*ue,1);$=Di(_e);let ve=h==null?void 0:h.outputPreferredLocations[n[te]];if($==="string"){if(ve==="gpu-buffer"||ve==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let J=[];for(let ue=0;ue<Ke;ue++){let Y=i.getValue(G+ue*l,"*"),Se=i.getValue(G+(ue+1)*l,"*"),Ae=ue===Ke-1?void 0:Se-Y;J.push(i.UTF8ToString(Y,Ae))}ee.push([$,ze,J,"cpu"])}else if(ve==="gpu-buffer"&&Ke>0){let J=i.jsepGetBuffer;if(!J)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let ue=J(G),Y=Bl(_e,Ke);if(Y===void 0||!z1($))throw new Error(`Unsupported data type: ${$}`);L=!0,ee.push([$,ze,{gpuBuffer:ue,download:i.jsepCreateDownloader(ue,Y,$),dispose:()=>{i._OrtReleaseTensor(V)!==0&&pr("Can't release tensor.")}},"gpu-buffer"])}else if(ve==="ml-tensor"&&Ke>0){let J=i.webnnEnsureTensor,ue=i.webnnIsInt64Supported;if(!J||!ue)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(Bl(_e,Ke)===void 0||!B1($))throw new Error(`Unsupported data type: ${$}`);if($==="int64"&&!ue(e))throw new Error('preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.');let Y=await J(e,G,_e,ze,!1);L=!0,ee.push([$,ze,{mlTensor:Y,download:i.webnnCreateMLTensorDownloader(G,$),dispose:()=>{i.webnnReleaseTensorId(G),i._OrtReleaseTensor(V)}},"ml-tensor"])}else{let J=L1($),ue=new J(Ke);new Uint8Array(ue.buffer,ue.byteOffset,ue.byteLength).set(i.HEAPU8.subarray(G,G+ue.byteLength)),ee.push([$,ze,ue,"cpu"])}}finally{i.stackRestore(ae),$==="string"&&G&&i._free(G),L||i._OrtReleaseTensor(V),(K=i.webnnOnRunEnd)==null||K.call(i,d)}}return h&&!f&&(i._OrtClearBoundOutputs(h.handle)!==0&&pr("Can't clear bound outputs."),fo.set(e,[d,p,u,h,f,!1])),ee}finally{i.stackRestore(b),_.forEach(H=>i._OrtReleaseTensor(H)),w.forEach(H=>i._OrtReleaseTensor(H)),x.forEach(H=>i._free(H)),y!==0&&i._OrtReleaseRunOptions(y),g.forEach(H=>i._free(H))}},ik=e=>{let t=kr(),r=fo.get(e);if(!r)throw new Error("invalid session id");let n=r[0],s=t._OrtEndProfiling(n);s===0&&pr("Can't get an profile file name."),t._OrtFree(s)},ok=e=>{let t=[];for(let r of e){let n=r[2];!Array.isArray(n)&&"buffer"in n&&t.push(n.buffer)}return t}}),mo,Ms,Kc,hp,fp,Tm,rx,Mm,jl,Il,oN,D4,F4,L4,z4,B4,U4,W4,V4=Je(()=>{ti(),R4(),vc(),R1(),mo=()=>!!Pr.wasm.proxy&&typeof document<"u",Kc=!1,hp=!1,fp=!1,Mm=new Map,jl=(e,t)=>{let r=Mm.get(e);r?r.push(t):Mm.set(e,[t])},Il=()=>{if(Kc||!hp||fp||!Ms)throw new Error("worker not ready")},oN=e=>{switch(e.data.type){case"init-wasm":Kc=!1,e.data.err?(fp=!0,rx[1](e.data.err)):(hp=!0,rx[0]()),Tm&&(URL.revokeObjectURL(Tm),Tm=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let t=Mm.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}}},D4=async()=>{if(!hp){if(Kc)throw new Error("multiple calls to 'initWasm()' detected.");
vendor: 5,118 bytes, lines 3307-3310
3307if(fp)throw new Error("previous call to 'initWasm()' failed.");if(Kc=!0,mo())return new Promise((e,t)=>{Ms==null||Ms.terminate(),OL().then(([r,n])=>{try{Ms=n,Ms.onerror=a=>t(a),Ms.onmessage=oN,rx=[e,t];let s={type:"init-wasm",in:Pr};!s.in.wasm.wasmPaths&&(r||Ob)&&(s.in.wasm.wasmPaths={wasm:new URL("/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",import.meta.url).href}),Ms.postMessage(s),Tm=r}catch(s){t(s)}},t)});try{await D1(Pr.wasm),await tk(Pr),hp=!0}catch(e){throw fp=!0,e}finally{Kc=!1}}},F4=async e=>{if(mo())return Il(),new Promise((t,r)=>{jl("init-ep",[t,r]);let n={type:"init-ep",in:{epName:e,env:Pr}};Ms.postMessage(n)});await rk(Pr,e)},L4=async e=>mo()?(Il(),new Promise((t,r)=>{jl("copy-from",[t,r]);let n={type:"copy-from",in:{buffer:e}};Ms.postMessage(n,[e.buffer])})):Kg(e),z4=async(e,t)=>{if(mo()){if(t!=null&&t.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return Il(),new Promise((r,n)=>{jl("create",[r,n]);let s={type:"create",in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),Ms.postMessage(s,a)})}else return nk(e,t)},B4=async e=>{if(mo())return Il(),new Promise((t,r)=>{jl("release",[t,r]);let n={type:"release",in:e};Ms.postMessage(n)});sk(e)},U4=async(e,t,r,n,s,a)=>{if(mo()){if(r.some(i=>i[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(s.some(i=>i))throw new Error("pre-allocated output tensor is not supported for proxy.");return Il(),new Promise((i,l)=>{jl("run",[i,l]);let c=r,d={type:"run",in:{sessionId:e,inputIndices:t,inputs:c,outputIndices:n,options:a}};Ms.postMessage(d,ok(c))})}else return ak(e,t,r,n,s,a)},W4=async e=>{if(mo())return Il(),new Promise((t,r)=>{jl("end-profiling",[t,r]);let n={type:"end-profiling",in:e};Ms.postMessage(n)});ik(e)}}),nx,lN,G4,ese=Je(()=>{ti(),V4(),Mt(),O1(),LL(),nx=(e,t)=>{switch(e.location){case"cpu":return[e.type,e.dims,e.data,"cpu"];case"gpu-buffer":return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[e.type,e.dims,{mlTensor:e.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${e.location} for ${t()}`)}},lN=e=>{switch(e[3]){case"cpu":return new qa(e[0],e[2],e[1]);case"gpu-buffer":{let t=e[0];if(!z1(t))throw new Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:r,download:n,dispose:s}=e[2];return qa.fromGpuBuffer(r,{dataType:t,dims:e[1],download:n,dispose:s})}case"ml-tensor":{let t=e[0];if(!B1(t))throw new Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:r,download:n,dispose:s}=e[2];return qa.fromMLTensor(r,{dataType:t,dims:e[1],download:n,dispose:s})}default:throw new Error(`invalid data location: ${e[3]}`)}},G4=class{async fetchModelAndCopyToWasmMemory(e){return L4(await U1(e))}async loadModel(e,t){Xa();let r;typeof e=="string"?r=await this.fetchModelAndCopyToWasmMemory(e):r=e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await z4(r,t),_a()}async dispose(){return B4(this.sessionId)}async run(e,t,r){Xa();let n=[],s=[];Object.entries(e).forEach(u=>{let h=u[0],f=u[1],m=this.inputNames.indexOf(h);if(m===-1)throw new Error(`invalid input '${h}'`);n.push(f),s.push(m)});let a=[],i=[];Object.entries(t).forEach(u=>{let h=u[0],f=u[1],m=this.outputNames.indexOf(h);if(m===-1)throw new Error(`invalid output '${h}'`);a.push(f),i.push(m)});let l=n.map((u,h)=>nx(u,()=>`input "${this.inputNames[s[h]]}"`)),c=a.map((u,h)=>u?nx(u,()=>`output "${this.outputNames[i[h]]}"`):null),d=await U4(this.sessionId,s,l,i,c,r),p={};for(let u=0;u<d.length;u++)p[this.outputNames[i[u]]]=a[u]??lN(d[u]);return _a(),p}startProfiling(){}endProfiling(){W4(this.sessionId)}}}),q4={};pu(q4,{OnnxruntimeWebAssemblyBackend:()=>Yb,initializeFlags:()=>Qb,wasmBackend:()=>H4});var Qb,Yb,H4,tse=Je(()=>{ti(),V4(),ese(),Qb=()=>{(typeof Pr.wasm.initTimeout!="number"||Pr.wasm.initTimeout<0)&&(Pr.wasm.initTimeout=0);let e=Pr.wasm.simd;if(typeof e!="boolean"&&e!==void 0&&e!=="fixed"&&e!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),Pr.wasm.simd=!1),typeof Pr.wasm.proxy!="boolean"&&(Pr.wasm.proxy=!1),typeof Pr.wasm.trace!="boolean"&&(Pr.wasm.trace=!1),typeof Pr.wasm.numThreads!="number"||!Number.isInteger(Pr.wasm.numThreads)||Pr.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)Pr.wasm.numThreads=1;else{let t=typeof navigator>"u"?Bre("node:os").cpus().length:navigator.hardwareConcurrency;Pr.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},Yb=class{async init(e){Qb(),await D4(),await F4(e)}async createInferenceSessionHandler(e,t){let r=new G4;return await r.loadModel(e,t),r}},H4=new Yb});ti();ti();ti();var rse="1.22.0-dev.20250409-89f8206ba4",nse=PL;{let e=(tse(),_h(q4)).wasmBackend;Hl("webgpu",e,5),Hl("webnn",e,5),Hl("cpu",e,10),Hl("wasm",e,10)}Object.defineProperty(Pr.versions,"web",{value:rse,enumerable:!0});/**
3308* @license
3309* Copyright 2021 Google LLC. All Rights Reserved.
3310* Licensed under the Apache License, Version 2.0 (the "License");
3311* you may not use this file except in compliance with the License.
3312* You may obtain a copy of the License at
3313*
3314* http://www.apache.org/licenses/LICENSE-2.0
3315*
3316* Unless required by applicable law or agreed to in writing, software
3317* distributed under the License is distributed on an "AS IS" BASIS,
3318* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3319* See the License for the specific language governing permissions and
3320* limitations under the License.
3321* =============================================================================
3322*//**
3323 * @license
3324 * Copyright 2020 Google LLC. All Rights Reserved.
3325 * Licensed under the Apache License, Version 2.0 (the "License");
3326 * you may not use this file except in compliance with the License.
3327 * You may obtain a copy of the License at
3328 *
3329 * http://www.apache.org/licenses/LICENSE-2.0
3330 *
3331 * Unless required by applicable law or agreed to in writing, software
3332 * distributed under the License is distributed on an "AS IS" BASIS,
3333 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3334 * See the License for the specific language governing permissions and
3335 * limitations under the License.
3336 * =============================================================================
3337 *//**
3338 * @license
3339 * Copyright 2019 Google LLC. All Rights Reserved.
3340 * Licensed under the Apache License, Version 2.0 (the "License");
3341 * you may not use this file except in compliance with the License.
3342 * You may obtain a copy of the License at
3343 *
3344 * http://www.apache.org/licenses/LICENSE-2.0
3345 *
3346 * Unless required by applicable law or agreed to in writing, software
3347 * distributed under the License is distributed on an "AS IS" BASIS,
3348 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3349 * See the License for the specific language governing permissions and
3350 * limitations under the License.
3351 * =============================================================================
3352 */const sse=Object.freeze(Object.defineProperty({__proto__:null,get InferenceSession(){return N1},get TRACE(){return wh},get TRACE_FUNC_BEGIN(){return Xa},get TRACE_FUNC_END(){return _a},get Tensor(){return qa},default:nse,get env(){return Pr},get registerBackend(){return Hl}},Symbol.toStringTag,{value:"Module"}));var Ii={},ase={"onnxruntime-common":e=>{e.exports=Dre},"onnxruntime-web":e=>{e.exports=sse},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},
vendor: 38,643 bytes, lines 3352-3360
3352"./node_modules/@huggingface/jinja/dist/index.js":(e,t,r)=>{r.r(t),r.d(t,{Environment:()=>pe,Interpreter:()=>Me,Template:()=>ks,parse:()=>G,tokenize:()=>u});var n=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",NullLiteral:"NullLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndSet:"EndSet",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator",Macro:"Macro",EndMacro:"EndMacro",Break:"Break",Continue:"Continue"}),s=Object.freeze({set:n.Set,for:n.For,in:n.In,is:n.Is,if:n.If,else:n.Else,endset:n.EndSet,endif:n.EndIf,elif:n.ElseIf,endfor:n.EndFor,and:n.And,or:n.Or,not:n.Not,"not in":n.NotIn,macro:n.Macro,endmacro:n.EndMacro,break:n.Break,continue:n.Continue,true:n.BooleanLiteral,false:n.BooleanLiteral,none:n.NullLiteral,True:n.BooleanLiteral,False:n.BooleanLiteral,None:n.NullLiteral}),a=class{constructor(F,le){this.value=F,this.type=le}};function i(F){return/\w/.test(F)}function l(F){return/[0-9]/.test(F)}var c=[["{%",n.OpenStatement],["%}",n.CloseStatement],["{{",n.OpenExpression],["}}",n.CloseExpression],["(",n.OpenParen],[")",n.CloseParen],["{",n.OpenCurlyBracket],["}",n.CloseCurlyBracket],["[",n.OpenSquareBracket],["]",n.CloseSquareBracket],[",",n.Comma],[".",n.Dot],[":",n.Colon],["|",n.Pipe],["<=",n.ComparisonBinaryOperator],[">=",n.ComparisonBinaryOperator],["==",n.ComparisonBinaryOperator],["!=",n.ComparisonBinaryOperator],["<",n.ComparisonBinaryOperator],[">",n.ComparisonBinaryOperator],["+",n.AdditiveBinaryOperator],["-",n.AdditiveBinaryOperator],["*",n.MultiplicativeBinaryOperator],["/",n.MultiplicativeBinaryOperator],["%",n.MultiplicativeBinaryOperator],["=",n.Equals]],d=new Map([["n",`
3353`],["t","	"],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function p(F,le={}){return F.endsWith(`
3354`)&&(F=F.slice(0,-1)),F=F.replace(/{#.*?#}/gs,"{##}"),le.lstrip_blocks&&(F=F.replace(/^[ \t]*({[#%])/gm,"$1")),le.trim_blocks&&(F=F.replace(/([#%]})\n/g,"$1")),F.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function u(F,le={}){var je,Nt,Xt;const B=[],oe=p(F,le);let xe=0;const Ue=xt=>{let yt="";for(;xt(oe[xe]);){if(oe[xe]==="\\"){if(++xe,xe>=oe.length)throw new SyntaxError("Unexpected end of input");const pt=oe[xe++],ar=d.get(pt);if(ar===void 0)throw new SyntaxError(`Unexpected escaped character: ${pt}`);yt+=ar;continue}if(yt+=oe[xe++],xe>=oe.length)throw new SyntaxError("Unexpected end of input")}return yt};e:for(;xe<oe.length;){const xt=(je=B.at(-1))==null?void 0:je.type;if(xt===void 0||xt===n.CloseStatement||xt===n.CloseExpression){let pt="";for(;xe<oe.length&&!(oe[xe]==="{"&&(oe[xe+1]==="%"||oe[xe+1]==="{"));)pt+=oe[xe++];if(pt.length>0){B.push(new a(pt,n.Text));continue}}Ue(pt=>/\s/.test(pt));const yt=oe[xe];if(yt==="-"||yt==="+"){const pt=(Nt=B.at(-1))==null?void 0:Nt.type;if(pt===n.Text||pt===void 0)throw new SyntaxError(`Unexpected character: ${yt}`);switch(pt){case n.Identifier:case n.NumericLiteral:case n.BooleanLiteral:case n.NullLiteral:case n.StringLiteral:case n.CloseParen:case n.CloseSquareBracket:break;default:{++xe;const ar=Ue(l);B.push(new a(`${yt}${ar}`,ar.length>0?n.NumericLiteral:n.UnaryOperator));continue}}}for(const[pt,ar]of c)if(oe.slice(xe,xe+pt.length)===pt){B.push(new a(pt,ar)),xe+=pt.length;continue e}if(yt==="'"||yt==='"'){++xe;const pt=Ue(ar=>ar!==yt);B.push(new a(pt,n.StringLiteral)),++xe;continue}if(l(yt)){const pt=Ue(l);B.push(new a(pt,n.NumericLiteral));continue}if(i(yt)){const pt=Ue(i),ar=Object.hasOwn(s,pt)?s[pt]:n.Identifier;ar===n.In&&((Xt=B.at(-1))==null?void 0:Xt.type)===n.Not?(B.pop(),B.push(new a("not in",n.NotIn))):B.push(new a(pt,ar));continue}throw new SyntaxError(`Unexpected character: ${yt}`)}return B}var h=class{constructor(){ce(this,"type","Statement")}},f=class extends h{constructor(le){super();ce(this,"type","Program");this.body=le}},m=class extends h{constructor(le,B,oe){super();ce(this,"type","If");this.test=le,this.body=B,this.alternate=oe}},v=class extends h{constructor(le,B,oe,xe){super();ce(this,"type","For");this.loopvar=le,this.iterable=B,this.body=oe,this.defaultBlock=xe}},k=class extends h{constructor(){super(...arguments);ce(this,"type","Break")}},y=class extends h{constructor(){super(...arguments);ce(this,"type","Continue")}},g=class extends h{constructor(le,B,oe){super();ce(this,"type","Set");this.assignee=le,this.value=B,this.body=oe}},_=class extends h{constructor(le,B,oe){super();ce(this,"type","Macro");this.name=le,this.args=B,this.body=oe}},w=class extends h{constructor(){super(...arguments);ce(this,"type","Expression")}},x=class extends w{constructor(le,B,oe){super();ce(this,"type","MemberExpression");this.object=le,this.property=B,this.computed=oe}},b=class extends w{constructor(le,B){super();ce(this,"type","CallExpression");this.callee=le,this.args=B}},M=class extends w{constructor(le){super();ce(this,"type","Identifier");this.value=le}},S=class extends w{constructor(le){super();ce(this,"type","Literal");this.value=le}},j=class extends S{constructor(){super(...arguments);ce(this,"type","NumericLiteral")}},I=class extends S{constructor(){super(...arguments);ce(this,"type","StringLiteral")}},q=class extends S{constructor(){super(...arguments);ce(this,"type","BooleanLiteral")}},U=class extends S{constructor(){super(...arguments);ce(this,"type","NullLiteral")}},R=class extends S{constructor(){super(...arguments);ce(this,"type","ArrayLiteral")}},K=class extends S{constructor(){super(...arguments);ce(this,"type","TupleLiteral")}},H=class extends S{constructor(){super(...arguments);ce(this,"type","ObjectLiteral")}},ee=class extends w{constructor(le,B,oe){super();ce(this,"type","BinaryExpression");this.operator=le,this.left=B,this.right=oe}},te=class extends w{constructor(le,B){super();ce(this,"type","FilterExpression");this.operand=le,this.filter=B}},V=class extends w{constructor(le,B){super();ce(this,"type","SelectExpression");this.iterable=le,this.test=B}},ae=class extends w{constructor(le,B,oe){super();ce(this,"type","TestExpression");this.operand=le,this.negate=B,this.test=oe}},ne=class extends w{constructor(le,B){super();ce(this,"type","UnaryExpression");this.operator=le,this.argument=B}},L=class extends w{constructor(le=void 0,B=void 0,oe=void 0){super();ce(this,"type","SliceExpression");this.start=le,this.stop=B,this.step=oe}},$=class extends w{constructor(le,B){super();ce(this,"type","KeywordArgumentExpression");this.key=le,this.value=B}};function G(F){const le=new f([]);let B=0;function oe(We,it){const gt=F[B++];if(!gt||gt.type!==We)throw new Error(`Parser Error: ${it}. ${gt.type} !== ${We}.`);return gt}function xe(){switch(F[B].type){case n.Text:return Nt();case n.OpenStatement:return Xt();case n.OpenExpression:return xt();default:throw new SyntaxError(`Unexpected token type: ${F[B].type}`)}}function Ue(...We){return B+We.length<=F.length&&We.some((it,gt)=>it!==F[B+gt].type)}function je(...We){return B+We.length<=F.length&&We.every((it,gt)=>it===F[B+gt].type)}function Nt(){return new I(oe(n.Text,"Expected text token").value)}function Xt(){oe(n.OpenStatement,"Expected opening statement token");let We;switch(F[B].type){case n.Set:++B,We=yt(),oe(n.CloseStatement,"Expected closing statement token");break;case n.If:++B,We=pt(),oe(n.OpenStatement,"Expected {% token"),oe(n.EndIf,"Expected endif token"),oe(n.CloseStatement,"Expected %} token");break;case n.Macro:++B,We=ar(),oe(n.OpenStatement,"Expected {% token"),oe(n.EndMacro,"Expected endmacro token"),oe(n.CloseStatement,"Expected %} token");break;case n.For:++B,We=vn(),oe(n.OpenStatement,"Expected {% token"),oe(n.EndFor,"Expected endfor token"),oe(n.CloseStatement,"Expected %} token");break;case n.Break:++B,oe(n.CloseStatement,"Expected closing statement token"),We=new k;break;case n.Continue:++B,oe(n.CloseStatement,"Expected closing statement token"),We=new y;break;default:throw new SyntaxError(`Unknown statement type: ${F[B].type}`)}return We}function xt(){oe(n.OpenExpression,"Expected opening expression token");const We=Sr();return oe(n.CloseExpression,"Expected closing expression token"),We}function yt(){var it,gt;const We=Sr();if(je(n.Equals)){++B;const ir=Sr();return new g(We,ir,[])}else{const ir=[];for(oe(n.CloseStatement,"Expected %} token");!(((it=F[B])==null?void 0:it.type)===n.OpenStatement&&((gt=F[B+1])==null?void 0:gt.type)===n.EndSet);){const ta=xe();ir.push(ta)}return oe(n.OpenStatement,"Expected {% token"),oe(n.EndSet,"Expected endset token"),new g(We,null,ir)}}function pt(){var ir,ta,ra,Xr,na,en,ln,sa;const We=Sr();oe(n.CloseStatement,"Expected closing statement token");const it=[],gt=[];for(;!(((ir=F[B])==null?void 0:ir.type)===n.OpenStatement&&(((ta=F[B+1])==null?void 0:ta.type)===n.ElseIf||((ra=F[B+1])==null?void 0:ra.type)===n.Else||((Xr=F[B+1])==null?void 0:Xr.type)===n.EndIf));)it.push(xe());if(((na=F[B])==null?void 0:na.type)===n.OpenStatement&&((en=F[B+1])==null?void 0:en.type)!==n.EndIf)if(++B,je(n.ElseIf))oe(n.ElseIf,"Expected elseif token"),gt.push(pt());else for(oe(n.Else,"Expected else token"),oe(n.CloseStatement,"Expected closing statement token");!(((ln=F[B])==null?void 0:ln.type)===n.OpenStatement&&((sa=F[B+1])==null?void 0:sa.type)===n.EndIf);)gt.push(xe());return new m(We,it,gt)}function ar(){const We=ns();if(We.type!=="Identifier")throw new SyntaxError("Expected identifier following macro statement");const it=Ma();oe(n.CloseStatement,"Expected closing statement token");const gt=[];for(;Ue(n.OpenStatement,n.EndMacro);)gt.push(xe());return new _(We,it,gt)}function vr(We=!1){const it=We?ns:Sr,gt=[it()],ir=je(n.Comma);for(;ir&&(++B,gt.push(it()),!!je(n.Comma)););return ir?new K(gt):gt[0]}function vn(){const We=vr(!0);if(!(We instanceof M||We instanceof K))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${We.type} instead`);oe(n.In,"Expected `in` keyword following loop variable");const it=Sr();oe(n.CloseStatement,"Expected closing statement token");const gt=[];for(;Ue(n.OpenStatement,n.EndFor)&&Ue(n.OpenStatement,n.Else);)gt.push(xe());const ir=[];if(je(n.OpenStatement,n.Else))for(++B,++B,oe(n.CloseStatement,"Expected closing statement token");Ue(n.OpenStatement,n.EndFor);)ir.push(xe());return new v(We,it,gt,ir)}function Sr(){return Kn()}function Kn(){const We=Xs();if(je(n.If)){++B;const it=Xs();if(je(n.Else)){++B;const gt=Xs();return new m(it,[We],[gt])}else return new V(We,it)}return We}function Xs(){let We=Ta();for(;je(n.Or);){const it=F[B];++B;const gt=Ta();We=new ee(it,We,gt)}return We}function Ta(){let We=ea();for(;je(n.And);){const it=F[B];++B;const gt=ea();We=new ee(it,We,gt)}return We}function ea(){let We;for(;je(n.Not);){const it=F[B];++B;const gt=ea();We=new ne(it,gt)}return We??ri()}function ri(){let We=ps();for(;je(n.ComparisonBinaryOperator)||je(n.In)||je(n.NotIn);){const it=F[B];++B;const gt=ps();We=new ee(it,We,gt)}return We}function ps(){let We=ii();for(;je(n.AdditiveBinaryOperator);){const it=F[B];++B;const gt=ii();We=new ee(it,We,gt)}return We}function ni(){const We=Gr(ns());return je(n.OpenParen)?$s(We):We}function $s(We){let it=new b(We,Ma());return it=Gr(it),je(n.OpenParen)&&(it=$s(it)),it}function Ma(){oe(n.OpenParen,"Expected opening parenthesis for arguments list");const We=si();return oe(n.CloseParen,"Expected closing parenthesis for arguments list"),We}function si(){const We=[];for(;!je(n.CloseParen);){let it=Sr();if(je(n.Equals)){if(++B,!(it instanceof M))throw new SyntaxError("Expected identifier for keyword argument");const gt=Sr();it=new $(it,gt)}We.push(it),je(n.Comma)&&++B}return We}function ai(){const We=[];let it=!1;for(;!je(n.CloseSquareBracket);)je(n.Colon)?(We.push(void 0),++B,it=!0):(We.push(Sr()),je(n.Colon)&&(++B,it=!0));if(We.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(it){if(We.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new L(...We)}return We[0]}function Gr(We){for(;je(n.Dot)||je(n.OpenSquareBracket);){const it=F[B];++B;let gt;const ir=it.type!==n.Dot;if(ir)gt=ai(),oe(n.CloseSquareBracket,"Expected closing square bracket");else if(gt=ns(),gt.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");We=new x(We,gt,ir)}return We}function ii(){let We=An();for(;je(n.MultiplicativeBinaryOperator);){const it=F[B];++B;const gt=An();We=new ee(it,We,gt)}return We}function An(){let We=Ea();for(;je(n.Is);){++B;const it=je(n.Not);it&&++B;let gt=ns();if(gt instanceof q?gt=new M(gt.value.toString()):gt instanceof U&&(gt=new M("none")),!(gt instanceof M))throw new SyntaxError("Expected identifier for the test");We=new ae(We,it,gt)}return We}function Ea(){let We=ni();for(;je(n.Pipe);){++B;let it=ns();if(!(it instanceof M))throw new SyntaxError("Expected identifier for the filter");je(n.OpenParen)&&(it=$s(it)),We=new te(We,it)}return We}function ns(){const We=F[B];switch(We.type){case n.NumericLiteral:return++B,new j(Number(We.value));case n.StringLiteral:return++B,new I(We.value);case n.BooleanLiteral:return++B,new q(We.value.toLowerCase()==="true");case n.NullLiteral:return++B,new U(null);case n.Identifier:return++B,new M(We.value);case n.OpenParen:{++B;const it=vr();if(F[B].type!==n.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${F[B].type} instead`);return++B,it}case n.OpenSquareBracket:{++B;const it=[];for(;!je(n.CloseSquareBracket);)it.push(Sr()),je(n.Comma)&&++B;return++B,new R(it)}case n.OpenCurlyBracket:{++B;const it=new Map;for(;!je(n.CloseCurlyBracket);){const gt=Sr();oe(n.Colon,"Expected colon between key and value in object literal");const ir=Sr();it.set(gt,ir),je(n.Comma)&&++B}return++B,new H(it)}default:throw new SyntaxError(`Unexpected token: ${We.type}`)}}for(;B<F.length;)le.body.push(xe());return le}function se(F,le,B=1){le===void 0&&(le=F,F=0);const oe=[];for(let xe=F;xe<le;xe+=B)oe.push(xe);return oe}function _e(F,le,B,oe=1){const xe=Math.sign(oe);xe>=0?(le=(le??(le=0))<0?Math.max(F.length+le,0):Math.min(le,F.length),B=(B??(B=F.length))<0?Math.max(F.length+B,0):Math.min(B,F.length)):(le=(le??(le=F.length-1))<0?Math.max(F.length+le,-1):Math.min(le,F.length-1),B=(B??(B=-1))<-1?Math.max(F.length+B,-1):Math.min(B,F.length-1));const Ue=[];for(let je=le;xe*je<xe*B;je+=oe)Ue.push(F[je]);return Ue}function de(F){return F.replace(/\b\w/g,le=>le.toUpperCase())}var Ee=class extends Error{},ze=class extends Error{},Ke=class{constructor(F=void 0){ce(this,"type","RuntimeValue");ce(this,"value");ce(this,"builtins",new Map);this.value=F}__bool__(){return new ue(!!this.value)}},ve=class extends Ke{constructor(){super(...arguments);ce(this,"type","NumericValue")}},J=class extends Ke{constructor(){super(...arguments);ce(this,"type","StringValue");ce(this,"builtins",new Map([["upper",new Ne(()=>new J(this.value.toUpperCase()))],["lower",new Ne(()=>new J(this.value.toLowerCase()))],["strip",new Ne(()=>new J(this.value.trim()))],["title",new Ne(()=>new J(de(this.value)))],["length",new ve(this.value.length)],["rstrip",new Ne(()=>new J(this.value.trimEnd()))],["lstrip",new Ne(()=>new J(this.value.trimStart()))],["startswith",new Ne(le=>{if(le.length===0)throw new Error("startswith() requires at least one argument");const B=le[0];if(!(B instanceof J))throw new Error("startswith() argument must be a string");return new ue(this.value.startsWith(B.value))})],["endswith",new Ne(le=>{if(le.length===0)throw new Error("endswith() requires at least one argument");const B=le[0];if(!(B instanceof J))throw new Error("endswith() argument must be a string");return new ue(this.value.endsWith(B.value))})],["split",new Ne(le=>{const B=le[0]??new Q;if(!(B instanceof J||B instanceof Q))throw new Error("sep argument must be a string or null");const oe=le[1]??new ve(-1);if(!(oe instanceof ve))throw new Error("maxsplit argument must be a number");let xe=[];if(B instanceof Q){const Ue=this.value.trimStart();for(const{0:je,index:Nt}of Ue.matchAll(/\S+/g)){if(oe.value!==-1&&xe.length>=oe.value&&Nt!==void 0){xe.push(je+Ue.slice(Nt+je.length));break}xe.push(je)}}else{if(B.value==="")throw new Error("empty separator");xe=this.value.split(B.value),oe.value!==-1&&xe.length>oe.value&&xe.push(xe.splice(oe.value).join(B.value))}return new Ae(xe.map(Ue=>new J(Ue)))})]]))}},ue=class extends Ke{constructor(){super(...arguments);ce(this,"type","BooleanValue")}},Y=class extends Ke{constructor(){super(...arguments);ce(this,"type","ObjectValue");ce(this,"builtins",new Map([["get",new Ne(([le,B])=>{if(!(le instanceof J))throw new Error(`Object key must be a string: got ${le.type}`);return this.value.get(le.value)??B??new Q})],["items",new Ne(()=>new Ae(Array.from(this.value.entries()).map(([le,B])=>new Ae([new J(le),B]))))]]))}__bool__(){return new ue(this.value.size>0)}},Se=class extends Y{constructor(){super(...arguments);ce(this,"type","KeywordArgumentsValue")}},Ae=class extends Ke{constructor(){super(...arguments);ce(this,"type","ArrayValue");ce(this,"builtins",new Map([["length",new ve(this.value.length)]]))}__bool__(){return new ue(this.value.length>0)}},Oe=class extends Ae{constructor(){super(...arguments);ce(this,"type","TupleValue")}},Ne=class extends Ke{constructor(){super(...arguments);ce(this,"type","FunctionValue")}},Q=class extends Ke{constructor(){super(...arguments);ce(this,"type","NullValue")}},re=class extends Ke{constructor(){super(...arguments);ce(this,"type","UndefinedValue")}},pe=class{constructor(F){ce(this,"variables",new Map([["namespace",new Ne(F=>{if(F.length===0)return new Y(new Map);if(F.length!==1||!(F[0]instanceof Y))throw new Error("`namespace` expects either zero arguments or a single object argument");return F[0]})]]));ce(this,"tests",new Map([["boolean",F=>F.type==="BooleanValue"],["callable",F=>F instanceof Ne],["odd",F=>{if(F.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${F.type}`);return F.value%2!==0}],["even",F=>{if(F.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${F.type}`);return F.value%2===0}],["false",F=>F.type==="BooleanValue"&&!F.value],["true",F=>F.type==="BooleanValue"&&F.value],["none",F=>F.type==="NullValue"],["string",F=>F.type==="StringValue"],["number",F=>F.type==="NumericValue"],["integer",F=>F.type==="NumericValue"&&Number.isInteger(F.value)],["iterable",F=>F.type==="ArrayValue"||F.type==="StringValue"],["mapping",F=>F.type==="ObjectValue"],["lower",F=>{const le=F.value;return F.type==="StringValue"&&le===le.toLowerCase()}],["upper",F=>{const le=F.value;return F.type==="StringValue"&&le===le.toUpperCase()}],["none",F=>F.type==="NullValue"],["defined",F=>F.type!=="UndefinedValue"],["undefined",F=>F.type==="UndefinedValue"],["equalto",(F,le)=>F.value===le.value],["eq",(F,le)=>F.value===le.value]]));this.parent=F}set(F,le){return this.declareVariable(F,Te(le))}declareVariable(F,le){if(this.variables.has(F))throw new SyntaxError(`Variable already declared: ${F}`);return this.variables.set(F,le),le}setVariable(F,le){return this.variables.set(F,le),le}resolve(F){if(this.variables.has(F))return this;if(this.parent)return this.parent.resolve(F);throw new Error(`Unknown variable: ${F}`)}lookupVariable(F){try{return this.resolve(F).variables.get(F)??new re}catch{return new re}}},Me=class{constructor(F){ce(this,"global");this.global=F??new pe}run(F){return this.evaluate(F,this.global)}evaluateBinaryExpression(F,le){const B=this.evaluate(F.left,le);switch(F.operator.value){case"and":return B.__bool__().value?this.evaluate(F.right,le):B;case"or":return B.__bool__().value?B:this.evaluate(F.right,le)}const oe=this.evaluate(F.right,le);switch(F.operator.value){case"==":return new ue(B.value==oe.value);case"!=":return new ue(B.value!=oe.value)}if(B instanceof re||oe instanceof re)throw new Error("Cannot perform operation on undefined values");if(B instanceof Q||oe instanceof Q)throw new Error("Cannot perform operation on null values");if(B instanceof ve&&oe instanceof ve)switch(F.operator.value){case"+":return new ve(B.value+oe.value);case"-":return new ve(B.value-oe.value);case"*":return new ve(B.value*oe.value);case"/":return new ve(B.value/oe.value);case"%":return new ve(B.value%oe.value);case"<":return new ue(B.value<oe.value);case">":return new ue(B.value>oe.value);case">=":return new ue(B.value>=oe.value);case"<=":return new ue(B.value<=oe.value)}else if(B instanceof Ae&&oe instanceof Ae)switch(F.operator.value){case"+":return new Ae(B.value.concat(oe.value))}else if(oe instanceof Ae){const xe=oe.value.find(Ue=>Ue.value===B.value)!==void 0;switch(F.operator.value){case"in":return new ue(xe);case"not in":return new ue(!xe)}}if(B instanceof J||oe instanceof J)switch(F.operator.value){case"+":return new J(B.value.toString()+oe.value.toString())}if(B instanceof J&&oe instanceof J)switch(F.operator.value){case"in":return new ue(oe.value.includes(B.value));case"not in":return new ue(!oe.value.includes(B.value))}if(B instanceof J&&oe instanceof Y)switch(F.operator.value){case"in":return new ue(oe.value.has(B.value));case"not in":return new ue(!oe.value.has(B.value))}throw new SyntaxError(`Unknown operator "${F.operator.value}" between ${B.type} and ${oe.type}`)}evaluateArguments(F,le){const B=[],oe=new Map;for(const xe of F)if(xe.type==="KeywordArgumentExpression"){const Ue=xe;oe.set(Ue.key.value,this.evaluate(Ue.value,le))}else{if(oe.size>0)throw new Error("Positional arguments must come before keyword arguments");B.push(this.evaluate(xe,le))}return[B,oe]}evaluateFilterExpression(F,le){const B=this.evaluate(F.operand,le);if(F.filter.type==="Identifier"){const oe=F.filter;if(oe.value==="tojson")return new J(me(B));if(B instanceof Ae)switch(oe.value){case"list":return B;case"first":return B.value[0];case"last":return B.value[B.value.length-1];case"length":return new ve(B.value.length);case"reverse":return new Ae(B.value.reverse());case"sort":return new Ae(B.value.sort((xe,Ue)=>{if(xe.type!==Ue.type)throw new Error(`Cannot compare different types: ${xe.type} and ${Ue.type}`);switch(xe.type){case"NumericValue":return xe.value-Ue.value;case"StringValue":return xe.value.localeCompare(Ue.value);default:throw new Error(`Cannot compare type: ${xe.type}`)}}));case"join":return new J(B.value.map(xe=>xe.value).join(""));case"string":return new J(me(B));default:throw new Error(`Unknown ArrayValue filter: ${oe.value}`)}else if(B instanceof J)switch(oe.value){case"length":return new ve(B.value.length);case"upper":return new J(B.value.toUpperCase());case"lower":return new J(B.value.toLowerCase());case"title":return new J(de(B.value));case"capitalize":return new J(B.value.charAt(0).toUpperCase()+B.value.slice(1));case"trim":return new J(B.value.trim());case"indent":return new J(B.value.split(`
3355`).map((xe,Ue)=>Ue===0||xe.length===0?xe:"    "+xe).join(`
3356`));case"join":case"string":return B;default:throw new Error(`Unknown StringValue filter: ${oe.value}`)}else if(B instanceof ve)switch(oe.value){case"abs":return new ve(Math.abs(B.value));default:throw new Error(`Unknown NumericValue filter: ${oe.value}`)}else if(B instanceof Y)switch(oe.value){case"items":return new Ae(Array.from(B.value.entries()).map(([xe,Ue])=>new Ae([new J(xe),Ue])));case"length":return new ve(B.value.size);default:throw new Error(`Unknown ObjectValue filter: ${oe.value}`)}throw new Error(`Cannot apply filter "${oe.value}" to type: ${B.type}`)}else if(F.filter.type==="CallExpression"){const oe=F.filter;if(oe.callee.type!=="Identifier")throw new Error(`Unknown filter: ${oe.callee.type}`);const xe=oe.callee.value;if(xe==="tojson"){const[,Ue]=this.evaluateArguments(oe.args,le),je=Ue.get("indent")??new Q;if(!(je instanceof ve||je instanceof Q))throw new Error("If set, indent must be a number");return new J(me(B,je.value))}else if(xe==="join"){let Ue;if(B instanceof J)Ue=Array.from(B.value);else if(B instanceof Ae)Ue=B.value.map(xt=>xt.value);else throw new Error(`Cannot apply filter "${xe}" to type: ${B.type}`);const[je,Nt]=this.evaluateArguments(oe.args,le),Xt=je.at(0)??Nt.get("separator")??new J("");if(!(Xt instanceof J))throw new Error("separator must be a string");return new J(Ue.join(Xt.value))}if(B instanceof Ae){switch(xe){case"selectattr":case"rejectattr":{const Ue=xe==="selectattr";if(B.value.some(pt=>!(pt instanceof Y)))throw new Error(`\`${xe}\` can only be applied to array of objects`);if(oe.args.some(pt=>pt.type!=="StringLiteral"))throw new Error(`arguments of \`${xe}\` must be strings`);const[je,Nt,Xt]=oe.args.map(pt=>this.evaluate(pt,le));let xt;if(Nt){const pt=le.tests.get(Nt.value);if(!pt)throw new Error(`Unknown test: ${Nt.value}`);xt=pt}else xt=(...pt)=>pt[0].__bool__().value;const yt=B.value.filter(pt=>{const ar=pt.value.get(je.value),vr=ar?xt(ar,Xt):!1;return Ue?vr:!vr});return new Ae(yt)}case"map":{const[,Ue]=this.evaluateArguments(oe.args,le);if(Ue.has("attribute")){const je=Ue.get("attribute");if(!(je instanceof J))throw new Error("attribute must be a string");const Nt=Ue.get("default"),Xt=B.value.map(xt=>{if(!(xt instanceof Y))throw new Error("items in map must be an object");return xt.value.get(je.value)??Nt??new re});return new Ae(Xt)}else throw new Error("`map` expressions without `attribute` set are not currently supported.")}}throw new Error(`Unknown ArrayValue filter: ${xe}`)}else if(B instanceof J){switch(xe){case"indent":{const[Ue,je]=this.evaluateArguments(oe.args,le),Nt=Ue.at(0)??je.get("width")??new ve(4);if(!(Nt instanceof ve))throw new Error("width must be a number");const Xt=Ue.at(1)??je.get("first")??new ue(!1),xt=Ue.at(2)??je.get("blank")??new ue(!1),yt=B.value.split(`
3357`),pt=" ".repeat(Nt.value),ar=yt.map((vr,vn)=>!Xt.value&&vn===0||!xt.value&&vr.length===0?vr:pt+vr);return new J(ar.join(`
3358`))}}throw new Error(`Unknown StringValue filter: ${xe}`)}else throw new Error(`Cannot apply filter "${xe}" to type: ${B.type}`)}throw new Error(`Unknown filter: ${F.filter.type}`)}evaluateTestExpression(F,le){const B=this.evaluate(F.operand,le),oe=le.tests.get(F.test.value);if(!oe)throw new Error(`Unknown test: ${F.test.value}`);const xe=oe(B);return new ue(F.negate?!xe:xe)}evaluateUnaryExpression(F,le){const B=this.evaluate(F.argument,le);switch(F.operator.value){case"not":return new ue(!B.value);default:throw new SyntaxError(`Unknown operator: ${F.operator.value}`)}}evalProgram(F,le){return this.evaluateBlock(F.body,le)}evaluateBlock(F,le){let B="";for(const oe of F){const xe=this.evaluate(oe,le);xe.type!=="NullValue"&&xe.type!=="UndefinedValue"&&(B+=xe.value)}return new J(B)}evaluateIdentifier(F,le){return le.lookupVariable(F.value)}evaluateCallExpression(F,le){const[B,oe]=this.evaluateArguments(F.args,le);oe.size>0&&B.push(new Se(oe));const xe=this.evaluate(F.callee,le);if(xe.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${xe.type}`);return xe.value(B,le)}evaluateSliceExpression(F,le,B){if(!(F instanceof Ae||F instanceof J))throw new Error("Slice object must be an array or string");const oe=this.evaluate(le.start,B),xe=this.evaluate(le.stop,B),Ue=this.evaluate(le.step,B);if(!(oe instanceof ve||oe instanceof re))throw new Error("Slice start must be numeric or undefined");if(!(xe instanceof ve||xe instanceof re))throw new Error("Slice stop must be numeric or undefined");if(!(Ue instanceof ve||Ue instanceof re))throw new Error("Slice step must be numeric or undefined");return F instanceof Ae?new Ae(_e(F.value,oe.value,xe.value,Ue.value)):new J(_e(Array.from(F.value),oe.value,xe.value,Ue.value).join(""))}evaluateMemberExpression(F,le){const B=this.evaluate(F.object,le);let oe;if(F.computed){if(F.property.type==="SliceExpression")return this.evaluateSliceExpression(B,F.property,le);oe=this.evaluate(F.property,le)}else oe=new J(F.property.value);let xe;if(B instanceof Y){if(!(oe instanceof J))throw new Error(`Cannot access property with non-string: got ${oe.type}`);xe=B.value.get(oe.value)??B.builtins.get(oe.value)}else if(B instanceof Ae||B instanceof J)if(oe instanceof ve)xe=B.value.at(oe.value),B instanceof J&&(xe=new J(B.value.at(oe.value)));else if(oe instanceof J)xe=B.builtins.get(oe.value);else throw new Error(`Cannot access property with non-string/non-number: got ${oe.type}`);else{if(!(oe instanceof J))throw new Error(`Cannot access property with non-string: got ${oe.type}`);xe=B.builtins.get(oe.value)}return xe instanceof Ke?xe:new re}evaluateSet(F,le){const B=F.value?this.evaluate(F.value,le):this.evaluateBlock(F.body,le);if(F.assignee.type==="Identifier"){const oe=F.assignee.value;le.setVariable(oe,B)}else if(F.assignee.type==="MemberExpression"){const oe=F.assignee,xe=this.evaluate(oe.object,le);if(!(xe instanceof Y))throw new Error("Cannot assign to member of non-object");if(oe.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");xe.value.set(oe.property.value,B)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(F.assignee)}`);return new Q}evaluateIf(F,le){const B=this.evaluate(F.test,le);return this.evaluateBlock(B.__bool__().value?F.body:F.alternate,le)}evaluateFor(F,le){const B=new pe(le);let oe,xe;if(F.iterable.type==="SelectExpression"){const xt=F.iterable;xe=this.evaluate(xt.iterable,B),oe=xt.test}else xe=this.evaluate(F.iterable,B);if(!(xe instanceof Ae))throw new Error(`Expected iterable type in for loop: got ${xe.type}`);const Ue=[],je=[];for(let xt=0;xt<xe.value.length;++xt){const yt=new pe(B),pt=xe.value[xt];let ar;if(F.loopvar.type==="Identifier")ar=vr=>vr.setVariable(F.loopvar.value,pt);else if(F.loopvar.type==="TupleLiteral"){const vr=F.loopvar;if(pt.type!=="ArrayValue")throw new Error(`Cannot unpack non-iterable type: ${pt.type}`);const vn=pt;if(vr.value.length!==vn.value.length)throw new Error(`Too ${vr.value.length>vn.value.length?"few":"many"} items to unpack`);ar=Sr=>{for(let Kn=0;Kn<vr.value.length;++Kn){if(vr.value[Kn].type!=="Identifier")throw new Error(`Cannot unpack non-identifier type: ${vr.value[Kn].type}`);Sr.setVariable(vr.value[Kn].value,vn.value[Kn])}}}else throw new Error(`Invalid loop variable(s): ${F.loopvar.type}`);oe&&(ar(yt),!this.evaluate(oe,yt).__bool__().value)||(Ue.push(pt),je.push(ar))}let Nt="",Xt=!0;for(let xt=0;xt<Ue.length;++xt){const yt=new Map([["index",new ve(xt+1)],["index0",new ve(xt)],["revindex",new ve(Ue.length-xt)],["revindex0",new ve(Ue.length-xt-1)],["first",new ue(xt===0)],["last",new ue(xt===Ue.length-1)],["length",new ve(Ue.length)],["previtem",xt>0?Ue[xt-1]:new re],["nextitem",xt<Ue.length-1?Ue[xt+1]:new re]]);B.setVariable("loop",new Y(yt)),je[xt](B);try{const pt=this.evaluateBlock(F.body,B);Nt+=pt.value}catch(pt){if(pt instanceof ze)continue;if(pt instanceof Ee)break;throw pt}Xt=!1}if(Xt){const xt=this.evaluateBlock(F.defaultBlock,B);Nt+=xt.value}return new J(Nt)}evaluateMacro(F,le){return le.setVariable(F.name.value,new Ne((B,oe)=>{var je;const xe=new pe(oe);B=B.slice();let Ue;((je=B.at(-1))==null?void 0:je.type)==="KeywordArgumentsValue"&&(Ue=B.pop());for(let Nt=0;Nt<F.args.length;++Nt){const Xt=F.args[Nt],xt=B[Nt];if(Xt.type==="Identifier"){const yt=Xt;if(!xt)throw new Error(`Missing positional argument: ${yt.value}`);xe.setVariable(yt.value,xt)}else if(Xt.type==="KeywordArgumentExpression"){const yt=Xt,pt=xt??(Ue==null?void 0:Ue.value.get(yt.key.value))??this.evaluate(yt.value,xe);xe.setVariable(yt.key.value,pt)}else throw new Error(`Unknown argument type: ${Xt.type}`)}return this.evaluateBlock(F.body,xe)})),new Q}evaluate(F,le){if(F===void 0)return new re;switch(F.type){case"Program":return this.evalProgram(F,le);case"Set":return this.evaluateSet(F,le);case"If":return this.evaluateIf(F,le);case"For":return this.evaluateFor(F,le);case"Macro":return this.evaluateMacro(F,le);case"Break":throw new Ee;case"Continue":throw new ze;case"NumericLiteral":return new ve(Number(F.value));case"StringLiteral":return new J(F.value);case"BooleanLiteral":return new ue(F.value);case"NullLiteral":return new Q(F.value);case"ArrayLiteral":return new Ae(F.value.map(B=>this.evaluate(B,le)));case"TupleLiteral":return new Oe(F.value.map(B=>this.evaluate(B,le)));case"ObjectLiteral":{const B=new Map;for(const[oe,xe]of F.value){const Ue=this.evaluate(oe,le);if(!(Ue instanceof J))throw new Error(`Object keys must be strings: got ${Ue.type}`);B.set(Ue.value,this.evaluate(xe,le))}return new Y(B)}case"Identifier":return this.evaluateIdentifier(F,le);case"CallExpression":return this.evaluateCallExpression(F,le);case"MemberExpression":return this.evaluateMemberExpression(F,le);case"UnaryExpression":return this.evaluateUnaryExpression(F,le);case"BinaryExpression":return this.evaluateBinaryExpression(F,le);case"FilterExpression":return this.evaluateFilterExpression(F,le);case"TestExpression":return this.evaluateTestExpression(F,le);default:throw new SyntaxError(`Unknown node type: ${F.type}`)}}};function Te(F){switch(typeof F){case"number":return new ve(F);case"string":return new J(F);case"boolean":return new ue(F);case"undefined":return new re;case"object":return F===null?new Q:Array.isArray(F)?new Ae(F.map(Te)):new Y(new Map(Object.entries(F).map(([le,B])=>[le,Te(B)])));case"function":return new Ne((le,B)=>{const oe=F(...le.map(xe=>xe.value))??null;return Te(oe)});default:throw new Error(`Cannot convert to runtime value: ${F}`)}}function me(F,le,B){const oe=B??0;switch(F.type){case"NullValue":case"UndefinedValue":return"null";case"NumericValue":case"StringValue":case"BooleanValue":return JSON.stringify(F.value);case"ArrayValue":case"ObjectValue":{const xe=le?" ".repeat(le):"",Ue=`
3359`+xe.repeat(oe),je=Ue+xe;if(F.type==="ArrayValue"){const Nt=F.value.map(Xt=>me(Xt,le,oe+1));return le?`[${je}${Nt.join(`,${je}`)}${Ue}]`:`[${Nt.join(", ")}]`}else{const Nt=Array.from(F.value.entries()).map(([Xt,xt])=>{const yt=`"${Xt}": ${me(xt,le,oe+1)}`;return le?`${je}${yt}`:yt});return le?`{${Nt.join(",")}${Ue}}`:`{${Nt.join(", ")}}`}}default:throw new Error(`Cannot convert to JSON: ${F.type}`)}}var Pe=`
3360`,Be="{%- ",rt=" -%}",et={MultiplicativeBinaryOperator:2,AdditiveBinaryOperator:1,ComparisonBinaryOperator:0};function Ye(F,le="	"){const B=typeof le=="number"?" ".repeat(le):le;return lt(F.body,0,B).replace(/\n$/,"")}function Fe(...F){return Be+F.join(" ")+rt}function lt(F,le,B){return F.map(oe=>It(oe,le,B)).join(Pe)}function It(F,le,B){const oe=B.repeat(le);switch(F.type){case"Program":return lt(F.body,le,B);case"If":return Qt(F,le,B);case"For":return Gt(F,le,B);case"Set":return zr(F,le,B);case"Macro":return hr(F,le,B);case"Break":return oe+Fe("break");case"Continue":return oe+Fe("continue");default:return oe+"{{- "+Tt(F)+" -}}"}}function Qt(F,le,B){const oe=B.repeat(le),xe=[];let Ue=F;for(;Ue&&(xe.push({test:Ue.test,body:Ue.body}),Ue.alternate.length===1&&Ue.alternate[0].type==="If");)Ue=Ue.alternate[0];let je=oe+Fe("if",Tt(xe[0].test))+Pe+lt(xe[0].body,le+1,B);for(let Nt=1;Nt<xe.length;Nt++)je+=Pe+oe+Fe("elif",Tt(xe[Nt].test))+Pe+lt(xe[Nt].body,le+1,B);return Ue&&Ue.alternate.length>0&&(je+=Pe+oe+Fe("else")+Pe+lt(Ue.alternate,le+1,B)),je+=Pe+oe+Fe("endif"),je}function Gt(F,le,B){const oe=B.repeat(le);let xe="";if(F.iterable.type==="SelectExpression"){const je=F.iterable;xe=`${Tt(je.iterable)} if ${Tt(je.test)}`}else xe=Tt(F.iterable);let Ue=oe+Fe("for",Tt(F.loopvar),"in",xe)+Pe+lt(F.body,le+1,B);return F.defaultBlock.length>0&&(Ue+=Pe+oe+Fe("else")+Pe+lt(F.defaultBlock,le+1,B)),Ue+=Pe+oe+Fe("endfor"),Ue}function zr(F,le,B){const oe=B.repeat(le),xe=Tt(F.assignee),Ue=F.value?Tt(F.value):"",je=oe+Fe("set",`${xe}${F.value?" = "+Ue:""}`);return F.body.length===0?je:je+Pe+lt(F.body,le+1,B)+Pe+oe+Fe("endset")}function hr(F,le,B){const oe=B.repeat(le),xe=F.args.map(Tt).join(", ");return oe+Fe("macro",`${F.name.value}(${xe})`)+Pe+lt(F.body,le+1,B)+Pe+oe+Fe("endmacro")}function Tt(F,le=-1){switch(F.type){case"Identifier":return F.value;case"NullLiteral":return"none";case"NumericLiteral":case"BooleanLiteral":return`${F.value}`;case"StringLiteral":return JSON.stringify(F.value);case"BinaryExpression":{const B=F,oe=et[B.operator.type]??0,xe=Tt(B.left,oe),Ue=Tt(B.right,oe+1),je=`${xe} ${B.operator.value} ${Ue}`;return oe<le?`(${je})`:je}case"UnaryExpression":{const B=F;return B.operator.value+(B.operator.value==="not"?" ":"")+Tt(B.argument,1/0)}case"LogicalNegationExpression":return`not ${Tt(F.argument,1/0)}`;case"CallExpression":{const B=F,oe=B.args.map(xe=>Tt(xe,-1)).join(", ");return`${Tt(B.callee,-1)}(${oe})`}case"MemberExpression":{const B=F;let oe=Tt(B.object,-1);B.object.type!=="Identifier"&&(oe=`(${oe})`);let xe=Tt(B.property,-1);return!B.computed&&B.property.type!=="Identifier"&&(xe=`(${xe})`),B.computed?`${oe}[${xe}]`:`${oe}.${xe}`}case"FilterExpression":{const B=F,oe=Tt(B.operand,1/0);return B.filter.type==="CallExpression"?`${oe} | ${Tt(B.filter,-1)}`:`${oe} | ${B.filter.value}`}case"SelectExpression":{const B=F;return`${Tt(B.iterable,-1)} | select(${Tt(B.test,-1)})`}case"TestExpression":{const B=F;return`${Tt(B.operand,-1)} is${B.negate?" not":""} ${B.test.value}`}case"ArrayLiteral":case"TupleLiteral":{const B=F.value.map(xe=>Tt(xe,-1)),oe=F.type==="ArrayLiteral"?"[]":"()";return`${oe[0]}${B.join(", ")}${oe[1]}`}case"ObjectLiteral":return`{ ${Array.from(F.value.entries()).map(([oe,xe])=>`${Tt(oe,-1)}: ${Tt(xe,-1)}`).join(", ")} }`;case"SliceExpression":{const B=F,oe=B.start?Tt(B.start,-1):"",xe=B.stop?Tt(B.stop,-1):"",Ue=B.step?`:${Tt(B.step,-1)}`:"";return`${oe}:${xe}${Ue}`}case"KeywordArgumentExpression":{const B=F;return`${B.key.value}=${Tt(B.value,-1)}`}case"If":{const B=F,oe=Tt(B.test,-1),xe=Tt(B.body[0],0),Ue=Tt(B.alternate[0],-1);return`${xe} if ${oe} else ${Ue}`}default:throw new Error(`Unknown expression type: ${F.type}`)}}var ks=class{constructor(F){ce(this,"parsed");const le=u(F,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=G(le)}render(F){const le=new pe;if(le.set("false",!1),le.set("true",!0),le.set("raise_exception",xe=>{throw new Error(xe)}),le.set("range",se),F)for(const[xe,Ue]of Object.entries(F))le.set(xe,Ue);return new Me(le).run(this.parsed).value}format(F){return Ye(this.parsed,(F==null?void 0:F.indent)||"	")}}},
3360"./src/backends/onnx.js":(e,t,r)=>{var n;r.r(t),r.d(t,{Tensor:()=>l.Tensor,createInferenceSession:()=>k,deviceToExecutionProviders:()=>m,isONNXProxy:()=>_,isONNXTensor:()=>y});var s=r("./src/env.js"),a=r("?2ce3"),i=r("onnxruntime-web"),l=r("onnxruntime-common");const c=Object.freeze({auto:null,gpu:null,cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:{name:"webnn",deviceType:"cpu"},"webnn-npu":{name:"webnn",deviceType:"npu"},"webnn-gpu":{name:"webnn",deviceType:"gpu"},"webnn-cpu":{name:"webnn",deviceType:"cpu"}}),d=[];let p,u;const h=Symbol.for("onnxruntime");if(h in globalThis)u=globalThis[h];else if(s.apis.IS_NODE_ENV){switch(u=a??(n||(n=r.t(a,2))),process.platform){case"win32":d.push("dml");break;case"linux":process.arch==="x64"&&d.push("cuda");break}d.push("cpu"),p=["cpu"]}else u=i,s.apis.IS_WEBNN_AVAILABLE&&d.push("webnn-npu","webnn-gpu","webnn-cpu","webnn"),s.apis.IS_WEBGPU_AVAILABLE&&d.push("webgpu"),d.push("wasm"),p=["wasm"];const f=u.InferenceSession;function m(w=null){if(!w)return p;switch(w){case"auto":return d;case"gpu":return d.filter(x=>["webgpu","cuda","dml","webnn-gpu"].includes(x))}if(d.includes(w))return[c[w]??w];throw new Error(`Unsupported device: "${w}". Should be one of: ${d.join(", ")}.`)}let v=null;async function k(w,x,b){v&&await v;const M=f.create(w,x);v??(v=M);const S=await M;return S.config=b,S}function y(w){return w instanceof u.Tensor}const g=u==null?void 0:u.env;g!=null&&g.wasm&&(!(typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope)&&!g.wasm.wasmPaths&&(g.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${s.env.version}/dist/`),g.wasm.proxy=!1),g!=null&&g.webgpu&&(g.webgpu.powerPreference="high-performance");function _(){var w;return(w=g==null?void 0:g.wasm)==null?void 0:w.proxy}s.env.backends.onnx=g},
3360"./src/base/feature_extraction_utils.js":(e,t,r)=>{r.r(t),r.d(t,{FeatureExtractor:()=>i,validate_audio_inputs:()=>l});var n=r("./src/utils/constants.js"),s=r("./src/utils/generic.js"),a=r("./src/utils/hub.js");class i extends s.Callable{constructor(d){super(),this.config=d}static async from_pretrained(d,p){const u=await(0,a.getModelJSON)(d,n.FEATURE_EXTRACTOR_NAME,!0,p);return new this(u)}}function l(c,d){var p;if(!(c instanceof Float32Array||c instanceof Float64Array))throw new Error(`${d} expects input to be a Float32Array or a Float64Array, but got ${((p=c==null?void 0:c.constructor)==null?void 0:p.name)??typeof c} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},
3360"./src/base/image_processors_utils.js":(e,t,r)=>{r.r(t),r.d(t,{ImageProcessor:()=>w,center_to_corners_format:()=>u,post_process_instance_segmentation:()=>_,post_process_object_detection:()=>h,post_process_panoptic_segmentation:()=>g,post_process_semantic_segmentation:()=>f});var n=r("./src/utils/generic.js"),s=r("./src/utils/tensor.js"),a=r("./src/utils/maths.js");r("./src/utils/image.js");var i=r("./src/utils/core.js"),l=r("./src/utils/hub.js"),c=r("./src/utils/constants.js");function d(x,b,M=0,S=null){const j=x/b;let I=(0,a.bankers_round)(j)*b;return S!==null&&I>S&&(I=Math.floor(j)*b),I<M&&(I=Math.ceil(j)*b),I}function p([x,b],M){return[Math.max(Math.floor(x/M),1)*M,Math.max(Math.floor(b/M),1)*M]}function u([x,b,M,S]){return[x-M/2,b-S/2,x+M/2,b+S/2]}function h(x,b=.5,M=null,S=!1){const j=x.logits,I=x.pred_boxes,[q,U,R]=j.dims;if(M!==null&&M.length!==q)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let K=[];for(let H=0;H<q;++H){let ee=M!==null?M[H]:null,te={boxes:[],classes:[],scores:[]},V=j[H],ae=I[H];for(let ne=0;ne<U;++ne){let L=V[ne],$=[],G;if(S){G=L.sigmoid().data;for(let se=0;se<G.length;++se)G[se]>b&&$.push(se)}else{let se=(0,a.max)(L.data)[1];if(se===R-1||(G=(0,a.softmax)(L.data),G[se]<b))continue;$.push(se)}for(const se of $){let _e=ae[ne].data;_e=u(_e),ee!==null&&(_e=_e.map((de,Ee)=>de*ee[(Ee+1)%2])),te.boxes.push(_e),te.classes.push(se),te.scores.push(G[se])}}K.push(te)}return K}function f(x,b=null){const M=x.logits,S=M.dims[0];if(b!==null&&b.length!==S)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const j=[];for(let I=0;I<S;++I){const q=b!==null?b[I]:null;let U=M[I];q!==null&&(U=(0,s.interpolate)(U,q,"bilinear",!1));const[R,K]=q??U.dims.slice(-2),H=new s.Tensor("int32",new Int32Array(R*K),[R,K]),ee=U[0].data,te=H.data;for(let ne=1;ne<U.dims[0];++ne){const L=U[ne].data;for(let $=0;$<L.length;++$)L[$]>ee[$]&&(ee[$]=L[$],te[$]=ne)}const V=new Array(U.dims[0]);for(let ne=0;ne<te.length;++ne){const L=te[ne];V[L]=L}const ae=V.filter(ne=>ne!==void 0);j.push({segmentation:H,labels:ae})}return j}function m(x,b,M,S){const j=[],I=[],q=[];for(let U=0;U<x.dims[0];++U){const R=x[U],K=b[U],H=(0,a.max)(R.data)[1];if(H===S)continue;const te=(0,a.softmax)(R.data)[H];te>M&&(j.push(K),I.push(te),q.push(H))}return[j,I,q]}function v(x,b,M,S=.5,j=.8){const I=[];let q=0,U=0;const R=b[M].data;for(let H=0;H<x.length;++H)x[H]===M&&(I.push(H),++q),R[H]>=S&&++U;let K=q>0&&U>0;return K&&(K=q/U>j),[K,I]}function k(x,b,M,S,j,I=null,q=null){const[U,R]=q??x[0].dims,K=new s.Tensor("int32",new Int32Array(U*R),[U,R]),H=[];if(q!==null)for(let ne=0;ne<x.length;++ne)x[ne]=(0,s.interpolate)(x[ne],q,"bilinear",!1);const ee=new Int32Array(x[0].data.length),te=new Float32Array(x[0].data.length);for(let ne=0;ne<x.length;++ne){let L=b[ne];const $=x[ne].data;for(let G=0;G<$.length;++G)$[G]*=L,$[G]>te[G]&&(ee[G]=ne,te[G]=$[G])}let V=0;const ae=K.data;for(let ne=0;ne<M.length;++ne){const L=M[ne],[$,G]=v(ee,x,ne,S,j);if($){++V;for(const se of G)ae[se]=V;H.push({id:V,label_id:L,score:b[ne]})}}return[K,H]}function y(x,b,M=28,S=56*56,j=14*14*4*1280){if(x<M||b<M)throw new Error(`height:${x} or width:${b} must be larger than factor:${M}`);if(Math.max(x,b)/Math.min(x,b)>200)throw new Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(x,b)/Math.min(x,b)}`);let I=Math.round(x/M)*M,q=Math.round(b/M)*M;if(I*q>j){const U=Math.sqrt(x*b/j);I=Math.floor(x/U/M)*M,q=Math.floor(b/U/M)*M}else if(I*q<S){const U=Math.sqrt(S/(x*b));I=Math.ceil(x*U/M)*M,q=Math.ceil(b*U/M)*M}return[I,q]}function g(x,b=.5,M=.5,S=.8,j=null,I=null){j===null&&(console.warn("`label_ids_to_fuse` unset. No instance will be fused."),j=new Set);const q=x.class_queries_logits??x.logits,R=(x.masks_queries_logits??x.pred_masks).sigmoid();let[K,H,ee]=q.dims;if(ee-=1,I!==null&&I.length!==K)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let te=[];for(let V=0;V<K;++V){let ae=I!==null?I[V]:null,ne=q[V],L=R[V],[$,G,se]=m(ne,L,b,ee);if(se.length===0){let[Ee,ze]=ae??L.dims.slice(-2),Ke=new s.Tensor("int32",new Int32Array(Ee*ze).fill(-1),[Ee,ze]);te.push({segmentation:Ke,segments_info:[]});continue}let[_e,de]=k($,G,se,M,S,j,ae);te.push({segmentation:_e,segments_info:de})}return te}function _(x,b=.5,M=null){throw new Error("`post_process_instance_segmentation` is not yet implemented.")}class w extends n.Callable{constructor(b){super(),this.image_mean=b.image_mean??b.mean,this.image_std=b.image_std??b.std,this.resample=b.resample??2,this.do_rescale=b.do_rescale??!0,this.rescale_factor=b.rescale_factor??1/255,this.do_normalize=b.do_normalize,this.do_thumbnail=b.do_thumbnail,this.size=b.size??b.image_size,this.do_resize=b.do_resize??this.size!==void 0,this.size_divisibility=b.size_divisibility??b.size_divisor,this.do_center_crop=b.do_center_crop,this.crop_size=b.crop_size,this.do_convert_rgb=b.do_convert_rgb??!0,this.do_crop_margin=b.do_crop_margin,this.pad_size=b.pad_size,this.do_pad=b.do_pad,this.min_pixels=b.min_pixels,this.max_pixels=b.max_pixels,this.do_pad&&!this.pad_size&&this.size&&this.size.width!==void 0&&this.size.height!==void 0&&(this.pad_size=this.size),this.do_flip_channel_order=b.do_flip_channel_order??!1,this.config=b}
3360async thumbnail(b,M,S=2){const j=b.height,I=b.width,q=M.height,U=M.width;let R=Math.min(j,q),K=Math.min(I,U);return R===j&&K===I?b:(j>I?K=Math.floor(I*R/j):I>j&&(R=Math.floor(j*K/I)),await b.resize(K,R,{resample:S}))}async crop_margin(b,M=200){const S=b.clone().grayscale(),j=(0,a.min)(S.data)[0],q=(0,a.max)(S.data)[0]-j;if(q===0)return b;const U=M/255;let R=S.width,K=S.height,H=0,ee=0;const te=S.data;for(let V=0;V<S.height;++V){const ae=V*S.width;for(let ne=0;ne<S.width;++ne)(te[ae+ne]-j)/q<U&&(R=Math.min(R,ne),K=Math.min(K,V),H=Math.max(H,ne),ee=Math.max(ee,V))}return b=await b.crop([R,K,H,ee]),b}pad_image(b,M,S,{mode:j="constant",center:I=!1,constant_values:q=0}={}){const[U,R,K]=M;let H,ee;if(typeof S=="number"?(H=S,ee=S):S==="square"?H=ee=Math.max(U,R):(H=S.width,ee=S.height),H!==R||ee!==U){const te=new Float32Array(H*ee*K);if(Array.isArray(q))for(let ne=0;ne<te.length;++ne)te[ne]=q[ne%K];else q!==0&&te.fill(q);const[V,ae]=I?[Math.floor((H-R)/2),Math.floor((ee-U)/2)]:[0,0];for(let ne=0;ne<U;++ne){const L=(ne+ae)*H,$=ne*R;for(let G=0;G<R;++G){const se=(L+G+V)*K,_e=($+G)*K;for(let de=0;de<K;++de)te[se+de]=b[_e+de]}}if(j==="symmetric"){if(I)throw new Error("`center` padding is not supported when `mode` is set to `symmetric`.");const ne=U-1,L=R-1;for(let $=0;$<ee;++$){const G=$*H,se=(0,i.calculateReflectOffset)($,ne)*R;for(let _e=0;_e<H;++_e){if($<U&&_e<R)continue;const de=(G+_e)*K,Ee=(se+(0,i.calculateReflectOffset)(_e,L))*K;for(let ze=0;ze<K;++ze)te[de+ze]=b[Ee+ze]}}}b=te,M=[ee,H,K]}return[b,M]}rescale(b){for(let M=0;M<b.length;++M)b[M]=this.rescale_factor*b[M]}get_resize_output_image_size(b,M){const[S,j]=b.size;let I,q;if(this.do_thumbnail){const{height:U,width:R}=M;I=Math.min(U,R)}else Number.isInteger(M)?(I=M,q=this.config.max_size??I):M!==void 0&&(I=M.shortest_edge,q=M.longest_edge);if(I!==void 0||q!==void 0){const U=I===void 0?1:Math.max(I/S,I/j),R=S*U,K=j*U,H=q===void 0?1:Math.min(q/R,q/K);let ee=Math.floor(Number((R*H).toFixed(2))),te=Math.floor(Number((K*H).toFixed(2)));return this.size_divisibility!==void 0&&([ee,te]=p([ee,te],this.size_divisibility)),[ee,te]}else if(M!==void 0&&M.width!==void 0&&M.height!==void 0){let U=M.width,R=M.height;if(this.config.keep_aspect_ratio&&this.config.ensure_multiple_of){let K=R/j,H=U/S;Math.abs(1-H)<Math.abs(1-K)?K=H:H=K,R=d(K*j,this.config.ensure_multiple_of),U=d(H*S,this.config.ensure_multiple_of)}return[U,R]}else{if(this.size_divisibility!==void 0)return p([S,j],this.size_divisibility);if(this.min_pixels!==void 0&&this.max_pixels!==void 0){const U=this.config.patch_size*this.config.merge_size;return y(j,S,U,this.min_pixels,this.max_pixels)}else throw new Error(`Could not resize image due to unsupported \`this.size\` option in config: ${JSON.stringify(M)}`)}}async resize(b){const[M,S]=this.get_resize_output_image_size(b,this.size);return await b.resize(M,S,{resample:this.resample})}async preprocess(b,{do_normalize:M=null,do_pad:S=null,do_convert_rgb:j=null,do_convert_grayscale:I=null,do_flip_channel_order:q=null}={}){this.do_crop_margin&&(b=await this.crop_margin(b));const[U,R]=b.size;if(j??this.do_convert_rgb?b=b.rgb():I&&(b=b.grayscale()),this.do_resize&&(b=await this.resize(b)),this.do_thumbnail&&(b=await this.thumbnail(b,this.size,this.resample)),this.do_center_crop){let V,ae;Number.isInteger(this.crop_size)?(V=this.crop_size,ae=this.crop_size):(V=this.crop_size.width,ae=this.crop_size.height),b=await b.center_crop(V,ae)}const K=[b.height,b.width];let H=Float32Array.from(b.data),ee=[b.height,b.width,b.channels];if(this.do_rescale&&this.rescale(H),M??this.do_normalize){let V=this.image_mean;Array.isArray(this.image_mean)||(V=new Array(b.channels).fill(V));let ae=this.image_std;if(Array.isArray(this.image_std)||(ae=new Array(b.channels).fill(V)),V.length!==b.channels||ae.length!==b.channels)throw new Error(`When set to arrays, the length of \`image_mean\` (${V.length}) and \`image_std\` (${ae.length}) must match the number of channels in the image (${b.channels}).`);for(let ne=0;ne<H.length;ne+=b.channels)for(let L=0;L<b.channels;++L)H[ne+L]=(H[ne+L]-V[L])/ae[L]}if(S??this.do_pad){if(this.pad_size)[H,ee]=this.pad_image(H,[b.height,b.width,b.channels],this.pad_size);else if(this.size_divisibility){const[V,ae]=p([ee[1],ee[0]],this.size_divisibility);[H,ee]=this.pad_image(H,ee,{width:V,height:ae})}}if(q??this.do_flip_channel_order){if(ee[2]!==3)throw new Error("Flipping channel order is only supported for RGB images.");for(let V=0;V<H.length;V+=3){const ae=H[V];H[V]=H[V+2],H[V+2]=ae}}const te=new s.Tensor("float32",H,ee).permute(2,0,1);return{original_size:[R,U],reshaped_input_size:K,pixel_values:te}}
3360async _call(b,...M){Array.isArray(b)||(b=[b]);const S=await Promise.all(b.map(I=>this.preprocess(I)));return{pixel_values:(0,s.stack)(S.map(I=>I.pixel_values),0),original_sizes:S.map(I=>I.original_size),reshaped_input_sizes:S.map(I=>I.reshaped_input_size)}}static async from_pretrained(b,M){const S=await(0,l.getModelJSON)(b,c.IMAGE_PROCESSOR_NAME,!0,M);return new this(S)}}},
3360"./src/base/processing_utils.js":(e,t,r)=>{r.r(t),r.d(t,{Processor:()=>i});var n=r("./src/utils/constants.js"),s=r("./src/utils/generic.js"),a=r("./src/utils/hub.js");class i extends s.Callable{constructor(c,d){super(),this.config=c,this.components=d}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(c,d={}){if(!this.tokenizer)throw new Error("Unable to apply chat template without a tokenizer.");return this.tokenizer.apply_chat_template(c,{tokenize:!1,...d})}batch_decode(...c){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.batch_decode(...c)}decode(...c){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.decode(...c)}async _call(c,...d){for(const p of[this.image_processor,this.feature_extractor,this.tokenizer])if(p)return p(c,...d);throw new Error("No image processor, feature extractor, or tokenizer found.")}static async from_pretrained(c,d){const[p,u]=await Promise.all([this.uses_processor_config?(0,a.getModelJSON)(c,n.PROCESSOR_NAME,!0,d):{},Promise.all(this.classes.filter(h=>h in this).map(async h=>{const f=await this[h].from_pretrained(c,d);return[h.replace(/_class$/,""),f]})).then(Object.fromEntries)]);return new this(p,u)}}ce(i,"classes",["image_processor_class","tokenizer_class","feature_extractor_class"]),ce(i,"uses_processor_config",!1)},
3360"./src/configs.js":(e,t,r)=>{r.r(t),r.d(t,{AutoConfig:()=>d,PretrainedConfig:()=>c,getKeyValueShapes:()=>l});var n=r("./src/utils/core.js"),s=r("./src/utils/hub.js");async function a(p,u){return await(0,s.getModelJSON)(p,"config.json",!0,u)}function i(p){const u={};let h={};switch(p.model_type){case"llava":case"paligemma":case"gemma3":case"florence2":case"llava_onevision":case"idefics3":case"ultravox":case"smolvlm":h=i(p.text_config);break;case"moondream1":h=i(p.phi_config);break;case"musicgen":h=i(p.decoder);break;case"multi_modality":h=i(p.language_config);break;case"gpt2":case"gptj":case"jais":case"codegen":case"gpt_bigcode":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="n_embd";break;case"gpt_neox":case"stablelm":case"opt":case"falcon":u.num_heads="num_attention_heads",u.num_layers="num_hidden_layers",u.hidden_size="hidden_size";break;case"llama":case"olmo":case"olmo2":case"mobilellm":case"granite":case"cohere":case"mistral":case"starcoder2":case"qwen2":case"qwen2_vl":case"phi":case"phi3":case"phi3_v":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.hidden_size="hidden_size",u.num_attention_heads="num_attention_heads";break;case"qwen3":case"gemma":case"gemma2":case"gemma3_text":case"glm":case"helium":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.dim_kv="head_dim";break;case"openelm":u.num_heads="num_kv_heads",u.num_layers="num_transformer_layers",u.dim_kv="head_dim";break;case"gpt_neo":case"donut-swin":u.num_heads="num_heads",u.num_layers="num_layers",u.hidden_size="hidden_size";break;case"bloom":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="hidden_size";break;case"mpt":u.num_heads="n_heads",u.num_layers="n_layers",u.hidden_size="d_model";break;case"exaone":u.num_heads="num_key_value_heads",u.num_layers="num_layers",u.dim_kv="head_dim",u.num_attention_heads="num_attention_heads";break;case"t5":case"mt5":case"longt5":u.num_decoder_layers="num_decoder_layers",u.num_decoder_heads="num_heads",u.decoder_dim_kv="d_kv",u.num_encoder_layers="num_layers",u.num_encoder_heads="num_heads",u.encoder_dim_kv="d_kv";break;case"bart":case"mbart":case"marian":case"whisper":case"lite-whisper":case"m2m_100":case"blenderbot":case"blenderbot-small":case"florence2_language":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="d_model",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="d_model";break;case"speecht5":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="hidden_size",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="hidden_size";break;case"trocr":u.num_encoder_layers=u.num_decoder_layers="decoder_layers",u.num_encoder_heads=u.num_decoder_heads="decoder_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="d_model";break;case"musicgen_decoder":u.num_encoder_layers=u.num_decoder_layers="num_hidden_layers",u.num_encoder_heads=u.num_decoder_heads="num_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"moonshine":u.num_decoder_layers="decoder_num_hidden_layers",u.num_decoder_heads="decoder_num_key_value_heads",u.num_encoder_layers="encoder_num_hidden_layers",u.num_encoder_heads="encoder_num_key_value_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"vision-encoder-decoder":const m=i(p.decoder),v="num_decoder_layers"in m,k=(0,n.pick)(p,["model_type","is_encoder_decoder"]);return v?(k.num_decoder_layers=m.num_decoder_layers,k.num_decoder_heads=m.num_decoder_heads,k.decoder_hidden_size=m.decoder_hidden_size,k.num_encoder_layers=m.num_encoder_layers,k.num_encoder_heads=m.num_encoder_heads,k.encoder_hidden_size=m.encoder_hidden_size):(k.num_layers=m.num_layers,k.num_heads=m.num_heads,k.hidden_size=m.hidden_size),k}const f={...h,...(0,n.pick)(p,["model_type","multi_query","is_encoder_decoder"])};for(const m in u)f[m]=p[u[m]];return f}function l(p,{prefix:u="past_key_values",batch_size:h=1}={}){const f={},m=p.normalized_config;if(m.is_encoder_decoder&&"num_encoder_heads"in m&&"num_decoder_heads"in m){const v=m.encoder_dim_kv??m.encoder_hidden_size/m.num_encoder_heads,k=m.decoder_dim_kv??m.decoder_hidden_size/m.num_decoder_heads,y=[h,m.num_encoder_heads,0,v],g=[h,m.num_decoder_heads,0,k];for(let _=0;_<m.num_decoder_layers;++_)f[`${u}.${_}.encoder.key`]=y,f[`${u}.${_}.encoder.value`]=y,f[`${u}.${_}.decoder.key`]=g,f[`${u}.${_}.decoder.value`]=g}else{const v=m.num_heads,k=m.num_layers,y=m.dim_kv??m.hidden_size/(m.num_attention_heads??v);if(m.model_type==="falcon"){const g=[h*v,0,y];for(let _=0;_<k;++_)f[`${u}.${_}.key`]=g,f[`${u}.${_}.value`]=g}else if(m.multi_query){const g=[h*v,0,2*y];for(let _=0;_<k;++_)f[`${u}.${_}.key_value`]=g}else if(m.model_type==="bloom"){const g=[h*v,y,0],_=[h*v,0,y];for(let w=0;w<k;++w)f[`${u}.${w}.key`]=g,f[`${u}.${w}.value`]=_}else if(m.model_type==="openelm")for(let g=0;g<k;++g){const _=[h,v[g],0,y];f[`${u}.${g}.key`]=_,f[`${u}.${g}.value`]=_}else{const g=[h,v,0,y];for(let _=0;_<k;++_)f[`${u}.${_}.key`]=g,f[`${u}.${_}.value`]=g}}return f}class c{constructor(u){ce(this,"model_type",null);ce(this,"is_encoder_decoder",!1);ce(this,"max_position_embeddings");ce(this,"transformers.js_config");Object.assign(this,u),this.normalized_config=i(this)}static async from_pretrained(u,{progress_callback:h=null,config:f=null,cache_dir:m=null,local_files_only:v=!1,revision:k="main"}={}){f&&!(f instanceof c)&&(f=new c(f));const y=f??await a(u,{progress_callback:h,config:f,cache_dir:m,local_files_only:v,revision:k});return new this(y)}}class d{static async from_pretrained(...u){return c.from_pretrained(...u)}}},
3360"./src/env.js":(e,t,r)=>{var S,j;r.r(t),r.d(t,{apis:()=>k,env:()=>b});var n=r("?569f"),s=r("?3f59"),a=r("?154a");const i="3.5.1",l=typeof window<"u"&&typeof window.document<"u",c=typeof self<"u"&&((S=self.constructor)==null?void 0:S.name)==="DedicatedWorkerGlobalScope",d=typeof self<"u"&&"caches"in self,p=typeof navigator<"u"&&"gpu"in navigator,u=typeof navigator<"u"&&"ml"in navigator,h=typeof process<"u",f=h&&((j=process==null?void 0:process.release)==null?void 0:j.name)==="node",m=!M(n),v=!M(s),k=Object.freeze({IS_BROWSER_ENV:l,IS_WEBWORKER_ENV:c,IS_WEB_CACHE_AVAILABLE:d,IS_WEBGPU_AVAILABLE:p,IS_WEBNN_AVAILABLE:u,IS_PROCESS_AVAILABLE:h,IS_NODE_ENV:f,IS_FS_AVAILABLE:m,IS_PATH_AVAILABLE:v}),y=m&&v;let g="./";if(y){const I=Object(import.meta).url;I?g=s.dirname(s.dirname(a.fileURLToPath(I))):typeof __dirname<"u"&&(g=s.dirname(__dirname))}const _=y?s.join(g,"/.cache/"):null,w="/models/",x=y?s.join(g,w):w,b={version:i,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!(l||c),localModelPath:x,useFS:m,useBrowserCache:d,useFSCache:m,cacheDir:_,useCustomCache:!1,customCache:null};function M(I){return Object.keys(I).length===0}},
3360"./src/generation/configuration_utils.js":(e,t,r)=>{r.r(t),r.d(t,{GenerationConfig:()=>s});var n=r("./src/utils/core.js");class s{constructor(i){ce(this,"max_length",20);ce(this,"max_new_tokens",null);ce(this,"min_length",0);ce(this,"min_new_tokens",null);ce(this,"early_stopping",!1);ce(this,"max_time",null);ce(this,"do_sample",!1);ce(this,"num_beams",1);ce(this,"num_beam_groups",1);ce(this,"penalty_alpha",null);ce(this,"use_cache",!0);ce(this,"temperature",1);ce(this,"top_k",50);ce(this,"top_p",1);ce(this,"typical_p",1);ce(this,"epsilon_cutoff",0);ce(this,"eta_cutoff",0);ce(this,"diversity_penalty",0);ce(this,"repetition_penalty",1);ce(this,"encoder_repetition_penalty",1);ce(this,"length_penalty",1);ce(this,"no_repeat_ngram_size",0);ce(this,"bad_words_ids",null);ce(this,"force_words_ids",null);ce(this,"renormalize_logits",!1);ce(this,"constraints",null);ce(this,"forced_bos_token_id",null);ce(this,"forced_eos_token_id",null);ce(this,"remove_invalid_values",!1);ce(this,"exponential_decay_length_penalty",null);ce(this,"suppress_tokens",null);ce(this,"streamer",null);ce(this,"begin_suppress_tokens",null);ce(this,"forced_decoder_ids",null);ce(this,"guidance_scale",null);ce(this,"num_return_sequences",1);ce(this,"output_attentions",!1);ce(this,"output_hidden_states",!1);ce(this,"output_scores",!1);ce(this,"return_dict_in_generate",!1);ce(this,"pad_token_id",null);ce(this,"bos_token_id",null);ce(this,"eos_token_id",null);ce(this,"encoder_no_repeat_ngram_size",0);ce(this,"decoder_start_token_id",null);ce(this,"generation_kwargs",{});Object.assign(this,(0,n.pick)(i,Object.getOwnPropertyNames(this)))}}},
vendor: 5,367 bytes, line 3360
3360"./src/generation/logits_process.js":(e,t,r)=>{r.r(t),r.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>y,ForcedBOSTokenLogitsProcessor:()=>c,ForcedEOSTokenLogitsProcessor:()=>d,LogitsProcessor:()=>a,LogitsProcessorList:()=>l,LogitsWarper:()=>i,MinLengthLogitsProcessor:()=>m,MinNewTokensLengthLogitsProcessor:()=>v,NoBadWordsLogitsProcessor:()=>k,NoRepeatNGramLogitsProcessor:()=>h,RepetitionPenaltyLogitsProcessor:()=>f,SuppressTokensAtBeginLogitsProcessor:()=>p,TemperatureLogitsWarper:()=>g,TopKLogitsWarper:()=>w,TopPLogitsWarper:()=>_,WhisperTimeStampLogitsProcessor:()=>u});var n=r("./src/utils/generic.js");r("./src/utils/tensor.js");var s=r("./src/utils/maths.js");class a extends n.Callable{_call(b,M){throw Error("`_call` should be implemented in a subclass")}}class i extends n.Callable{_call(b,M){throw Error("`_call` should be implemented in a subclass")}}class l extends n.Callable{constructor(){super(),this.processors=[]}push(b){this.processors.push(b)}extend(b){this.processors.push(...b)}_call(b,M){let S=M;for(const j of this.processors)S=j(b,S);return S}[Symbol.iterator](){return this.processors.values()}}class c extends a{constructor(b){super(),this.bos_token_id=b}_call(b,M){for(let S=0;S<b.length;++S)if(b[S].length===1){const j=M[S].data;j.fill(-1/0),j[this.bos_token_id]=0}return M}}class d extends a{constructor(b,M){super(),this.max_length=b,this.eos_token_id=Array.isArray(M)?M:[M]}_call(b,M){for(let S=0;S<b.length;++S)if(b[S].length===this.max_length-1){const j=M[S].data;j.fill(-1/0);for(const I of this.eos_token_id)j[I]=0}return M}}class p extends a{constructor(b,M){super(),this.begin_suppress_tokens=b,this.begin_index=M}_call(b,M){for(let S=0;S<b.length;++S)if(b[S].length===this.begin_index){const j=M[S].data;for(const I of this.begin_suppress_tokens)j[I]=-1/0}return M}}class u extends a{constructor(b,M){super(),this.eos_token_id=Array.isArray(b.eos_token_id)?b.eos_token_id[0]:b.eos_token_id,this.no_timestamps_token_id=b.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=M.length,M.at(-1)===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=b.max_initial_timestamp_index}_call(b,M){for(let S=0;S<b.length;++S){const j=M[S].data;if(j[this.no_timestamps_token_id]=-1/0,b[S].length===this.begin_index-1){j.fill(-1/0),j[this.timestamp_begin]=0;continue}const I=b[S].slice(this.begin_index),q=I.length>=1&&I[I.length-1]>=this.timestamp_begin,U=I.length<2||I[I.length-2]>=this.timestamp_begin;if(q&&(U?j.subarray(this.timestamp_begin).fill(-1/0):j.subarray(0,this.eos_token_id).fill(-1/0)),b[S].length===this.begin_index&&this.max_initial_timestamp_index!==null){const ee=this.timestamp_begin+this.max_initial_timestamp_index;j.subarray(ee+1).fill(-1/0)}const R=(0,s.log_softmax)(j),K=Math.log(R.subarray(this.timestamp_begin).map(Math.exp).reduce((ee,te)=>ee+te)),H=(0,s.max)(R.subarray(0,this.timestamp_begin))[0];K>H&&j.subarray(0,this.timestamp_begin).fill(-1/0)}return M}}class h extends a{constructor(b){super(),this.no_repeat_ngram_size=b}getNgrams(b){const M=b.length,S=[];for(let I=0;I<M+1-this.no_repeat_ngram_size;++I){const q=[];for(let U=0;U<this.no_repeat_ngram_size;++U)q.push(b[I+U]);S.push(q.map(Number))}const j=new Map;for(const I of S){const q=I.slice(0,I.length-1),U=JSON.stringify(q),R=j.get(U)??[];R.push(I[I.length-1]),j.set(U,R)}return j}getGeneratedNgrams(b,M){const S=M.slice(M.length+1-this.no_repeat_ngram_size,M.length);return b.get(JSON.stringify(S.map(Number)))??[]}calcBannedNgramTokens(b){const M=[];if(b.length+1<this.no_repeat_ngram_size)return M;{const S=this.getNgrams(b);return this.getGeneratedNgrams(S,b)}}_call(b,M){for(let S=0;S<b.length;++S){const j=M[S].data,I=this.calcBannedNgramTokens(b[S]);for(const q of I)j[q]=-1/0}return M}}class f extends a{constructor(b){super(),this.penalty=b}_call(b,M){for(let S=0;S<b.length;++S){const j=M[S].data;for(const I of new Set(b[S])){const q=Number(I);j[q]<0?j[q]*=this.penalty:j[q]/=this.penalty}}return M}}class m extends a{constructor(b,M){super(),this.min_length=b,this.eos_token_id=Array.isArray(M)?M:[M]}_call(b,M){for(let S=0;S<b.length;++S)if(b[S].length<this.min_length){const j=M[S].data;for(const I of this.eos_token_id)j[I]=-1/0}return M}}class v extends a{constructor(b,M,S){super(),this.prompt_length_to_skip=b,this.min_new_tokens=M,this.eos_token_id=Array.isArray(S)?S:[S]}_call(b,M){for(let S=0;S<b.length;++S)if(b[S].length-this.prompt_length_to_skip<this.min_new_tokens){const I=M[S].data;for(const q of this.eos_token_id)I[q]=-1/0}return M}}class k extends a{constructor(b,M){super(),this.bad_words_ids=b,this.eos_token_id=Array.isArray(M)?M:[M]}_call(b,M){for(let S=0;S<b.length;++S){const j=M[S].data,I=b[S];for(const q of this.bad_words_ids){if(I.length<q.length-1)continue;let U=!0;for(let R=1;R<=q.length-1;++R)if(q.at(-R-1)!=I.at(-R)){U=!1;break}U&&(j[q.at(-1)]=-1/0)}}return M}}class y extends a{constructor(b){if(super(),b<=1)throw new Error(`Require guidance scale >1 to use the classifier free guidance processor, got guidance scale ${b}.`);this.guidance_scale=b}_call(b,M){if(M.dims[0]!==2*b.length)throw new Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${M.dims[
33600]} for the logits and ${b.length} for the input ids.`);const S=b.length,j=M.slice([0,S],null),I=M.slice([S,M.dims[0]],null);for(let q=0;q<I.data.length;++q)I.data[q]+=(j.data[q]-I.data[q])*this.guidance_scale;return I}}class g extends i{constructor(b){super(),this.temperature=b}_call(b,M){const S=M.data;for(let j=0;j<S.length;++j)S[j]/=this.temperature;return M}}class _ extends i{constructor(b,{filter_value:M=-1/0,min_tokens_to_keep:S=1}={}){if(super(),b<0||b>1)throw new Error(`\`top_p\` must be a float > 0 and < 1, but is ${b}`);if(!Number.isInteger(S)||S<1)throw new Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${S}`);this.top_p=b,this.filter_value=M,this.min_tokens_to_keep=S}}class w extends i{constructor(b,{filter_value:M=-1/0,min_tokens_to_keep:S=1}={}){if(super(),!Number.isInteger(b)||b<0)throw new Error(`\`top_k\` must be a positive integer, but is ${b}`);this.top_k=Math.max(b,S),this.filter_value=M}}},
vendor: 1,583 bytes, line 3360
3360"./src/generation/logits_sampler.js":(e,t,r)=>{r.r(t),r.d(t,{LogitsSampler:()=>i});var n=r("./src/utils/generic.js"),s=r("./src/utils/tensor.js"),a=r("./src/utils/maths.js");r("./src/generation/configuration_utils.js");class i extends n.Callable{constructor(u){super(),this.generation_config=u}async _call(u){return this.sample(u)}async sample(u){throw Error("sample should be implemented in subclasses.")}getLogits(u,h){let f=u.dims.at(-1),m=u.data;if(h===-1)m=m.slice(-f);else{let v=h*f;m=m.slice(v,v+f)}return m}randomSelect(u){let h=0;for(let m=0;m<u.length;++m)h+=u[m];let f=Math.random()*h;for(let m=0;m<u.length;++m)if(f-=u[m],f<=0)return m;return 0}static getSampler(u){if(u.do_sample)return new c(u);if(u.num_beams>1)return new d(u);if(u.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${u.num_return_sequences}.`);return new l(u)}}class l extends i{async sample(u){const h=(0,a.max)(u.data)[1];return[[BigInt(h),0]]}}class c extends i{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[f,m]=await(0,s.topk)(u,h),v=(0,a.softmax)(f.data);return Array.from({length:this.generation_config.num_beams},()=>{const k=this.randomSelect(v);return[m.data[k],Math.log(v[k])]})}}class d extends i{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[f,m]=await(0,s.topk)(u,h),v=(0,a.softmax)(f.data);return Array.from({length:this.generation_config.num_beams},(k,y)=>[m.data[y],Math.log(v[y])])}}},
3360"./src/generation/stopping_criteria.js":(e,t,r)=>{r.r(t),r.d(t,{EosTokenCriteria:()=>l,InterruptableStoppingCriteria:()=>c,MaxLengthCriteria:()=>i,StoppingCriteria:()=>s,StoppingCriteriaList:()=>a});var n=r("./src/utils/generic.js");class s extends n.Callable{_call(p,u){throw Error("StoppingCriteria needs to be subclassed")}}class a extends n.Callable{constructor(){super(),this.criteria=[]}push(p){this.criteria.push(p)}extend(p){p instanceof a?p=p.criteria:p instanceof s&&(p=[p]),this.criteria.push(...p)}_call(p,u){const h=new Array(p.length).fill(!1);for(const f of this.criteria){const m=f(p,u);for(let v=0;v<h.length;++v)h[v]||(h[v]=m[v])}return h}[Symbol.iterator](){return this.criteria.values()}}class i extends s{constructor(p,u=null){super(),this.max_length=p,this.max_position_embeddings=u}_call(p){return p.map(u=>u.length>=this.max_length)}}class l extends s{constructor(p){super(),Array.isArray(p)||(p=[p]),this.eos_token_id=p}_call(p,u){return p.map(h=>{const f=h.at(-1);return this.eos_token_id.some(m=>f==m)})}}class c extends s{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(p,u){return new Array(p.length).fill(this.interrupted)}}},
3360"./src/generation/streamers.js":(e,t,r)=>{r.r(t),r.d(t,{BaseStreamer:()=>i,TextStreamer:()=>c,WhisperTextStreamer:()=>d});var n=r("./src/utils/core.js"),s=r("./src/tokenizers.js"),a=r("./src/env.js");class i{put(u){throw Error("Not implemented")}end(){throw Error("Not implemented")}}const l=a.apis.IS_PROCESS_AVAILABLE?p=>process.stdout.write(p):p=>console.log(p);class c extends i{constructor(u,{skip_prompt:h=!1,callback_function:f=null,token_callback_function:m=null,skip_special_tokens:v=!0,decode_kwargs:k={},...y}={}){super(),this.tokenizer=u,this.skip_prompt=h,this.callback_function=f??l,this.token_callback_function=m,this.decode_kwargs={skip_special_tokens:v,...k,...y},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(u){var k;if(u.length>1)throw Error("TextStreamer only supports batch size of 1");const h=this.next_tokens_are_prompt;if(h&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;const f=u[0];(k=this.token_callback_function)==null||k.call(this,f),this.token_cache=(0,n.mergeArrays)(this.token_cache,f);const m=this.tokenizer.decode(this.token_cache,this.decode_kwargs);let v;h||m.endsWith(`
3361`)?(v=m.slice(this.print_len),this.token_cache=[],this.print_len=0):m.length>0&&(0,s.is_chinese_char)(m.charCodeAt(m.length-1))?(v=m.slice(this.print_len),this.print_len+=v.length):(v=m.slice(this.print_len,m.lastIndexOf(" ")+1),this.print_len+=v.length),this.on_finalized_text(v,!1)}end(){let u;this.token_cache.length>0?(u=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):u="",this.next_tokens_are_prompt=!0,this.on_finalized_text(u,!0)}on_finalized_text(u,h){var f,m;u.length>0&&((f=this.callback_function)==null||f.call(this,u)),h&&this.callback_function===l&&a.apis.IS_PROCESS_AVAILABLE&&((m=this.callback_function)==null||m.call(this,`
3362`))}}class d extends c{constructor(u,{skip_prompt:h=!1,callback_function:f=null,token_callback_function:m=null,on_chunk_start:v=null,on_chunk_end:k=null,on_finalize:y=null,time_precision:g=.02,skip_special_tokens:_=!0,decode_kwargs:w={}}={}){super(u,{skip_prompt:h,skip_special_tokens:_,callback_function:f,token_callback_function:m,decode_kwargs:w}),this.timestamp_begin=u.timestamp_begin,this.on_chunk_start=v,this.on_chunk_end=k,this.on_finalize=y,this.time_precision=g,this.waiting_for_timestamp=!1}put(u){var f,m;if(u.length>1)throw Error("WhisperTextStreamer only supports batch size of 1");const h=u[0];if(h.length===1){const v=Number(h[0])-this.timestamp_begin;if(v>=0){const k=v*this.time_precision;this.waiting_for_timestamp?(f=this.on_chunk_end)==null||f.call(this,k):(m=this.on_chunk_start)==null||m.call(this,k),this.waiting_for_timestamp=!this.waiting_for_timestamp,u=[[]]}}return super.put(u)}end(){var u;super.end(),(u=this.on_finalize)==null||u.call(this)}}},
3362"./src/models.js":(e,t,r)=>{r.r(t),r.d(t,{ASTForAudioClassification:()=>Wh,ASTModel:()=>Uh,ASTPreTrainedModel:()=>fu,AlbertForMaskedLM:()=>ie,AlbertForQuestionAnswering:()=>Z,AlbertForSequenceClassification:()=>N,AlbertModel:()=>we,AlbertPreTrainedModel:()=>li,AutoModel:()=>qv,AutoModelForAudioClassification:()=>XE,AutoModelForAudioFrameClassification:()=>tS,AutoModelForAudioTextToText:()=>dS,AutoModelForCTC:()=>ZE,AutoModelForCausalLM:()=>BE,AutoModelForDepthEstimation:()=>aS,AutoModelForDocumentQuestionAnswering:()=>rS,AutoModelForImageClassification:()=>GE,AutoModelForImageFeatureExtraction:()=>lS,AutoModelForImageMatting:()=>nS,AutoModelForImageSegmentation:()=>qE,AutoModelForImageTextToText:()=>cS,AutoModelForImageToImage:()=>sS,AutoModelForMaskGeneration:()=>JE,AutoModelForMaskedLM:()=>UE,AutoModelForNormalEstimation:()=>iS,AutoModelForObjectDetection:()=>QE,AutoModelForPoseEstimation:()=>oS,AutoModelForQuestionAnswering:()=>WE,AutoModelForSemanticSegmentation:()=>HE,AutoModelForSeq2SeqLM:()=>DE,AutoModelForSequenceClassification:()=>OE,AutoModelForSpeechSeq2Seq:()=>FE,AutoModelForTextToSpectrogram:()=>LE,AutoModelForTextToWaveform:()=>zE,AutoModelForTokenClassification:()=>RE,AutoModelForUniversalSegmentation:()=>KE,AutoModelForVision2Seq:()=>VE,AutoModelForXVector:()=>eS,AutoModelForZeroShotObjectDetection:()=>YE,BartForConditionalGeneration:()=>dr,BartForSequenceClassification:()=>cn,BartModel:()=>Ar,BartPretrainedModel:()=>Zt,BaseModelOutput:()=>Ae,BeitForImageClassification:()=>y2,BeitModel:()=>g2,BeitPreTrainedModel:()=>cv,BertForMaskedLM:()=>Q,BertForQuestionAnswering:()=>Me,BertForSequenceClassification:()=>re,BertForTokenClassification:()=>pe,BertModel:()=>Ne,BertPreTrainedModel:()=>Oe,BlenderbotForConditionalGeneration:()=>Qn,BlenderbotModel:()=>dn,BlenderbotPreTrainedModel:()=>fr,BlenderbotSmallForConditionalGeneration:()=>Bn,BlenderbotSmallModel:()=>Os,BlenderbotSmallPreTrainedModel:()=>Ns,BloomForCausalLM:()=>Lk,BloomModel:()=>Fk,BloomPreTrainedModel:()=>Jy,CLIPModel:()=>Zh,CLIPPreTrainedModel:()=>Si,CLIPSegForImageSegmentation:()=>Au,CLIPSegModel:()=>Su,CLIPSegPreTrainedModel:()=>kc,CLIPTextModel:()=>zy,CLIPTextModelWithProjection:()=>Xh,CLIPVisionModel:()=>By,CLIPVisionModelWithProjection:()=>ef,CamembertForMaskedLM:()=>pt,CamembertForQuestionAnswering:()=>vn,CamembertForSequenceClassification:()=>ar,CamembertForTokenClassification:()=>vr,CamembertModel:()=>yt,CamembertPreTrainedModel:()=>xt,CausalLMOutput:()=>bl,CausalLMOutputWithPast:()=>R5,ChineseCLIPModel:()=>bc,ChineseCLIPPreTrainedModel:()=>rf,ClapAudioModelWithProjection:()=>yM,ClapModel:()=>mM,ClapPreTrainedModel:()=>pf,ClapTextModelWithProjection:()=>gM,CodeGenForCausalLM:()=>Ac,CodeGenModel:()=>wl,CodeGenPreTrainedModel:()=>Sc,CohereForCausalLM:()=>_k,CohereModel:()=>vk,CoherePreTrainedModel:()=>Uy,ConvBertForMaskedLM:()=>ks,ConvBertForQuestionAnswering:()=>B,ConvBertForSequenceClassification:()=>F,ConvBertForTokenClassification:()=>le,ConvBertModel:()=>Tt,ConvBertPreTrainedModel:()=>hr,ConvNextForImageClassification:()=>uT,ConvNextModel:()=>dT,ConvNextPreTrainedModel:()=>Tv,ConvNextV2ForImageClassification:()=>hT,ConvNextV2Model:()=>pT,ConvNextV2PreTrainedModel:()=>Mv,DFineForObjectDetection:()=>C2,DFineModel:()=>P2,DFinePreTrainedModel:()=>mv,DPTForDepthEstimation:()=>q2,DPTModel:()=>G2,DPTPreTrainedModel:()=>xv,DacDecoderModel:()=>aE,DacDecoderOutput:()=>rE,DacEncoderModel:()=>sE,DacEncoderOutput:()=>tE,DacModel:()=>nE,DacPreTrainedModel:()=>_f,DebertaForMaskedLM:()=>Xs,DebertaForQuestionAnswering:()=>ri,DebertaForSequenceClassification:()=>Ta,DebertaForTokenClassification:()=>ea,DebertaModel:()=>Kn,DebertaPreTrainedModel:()=>Sr,DebertaV2ForMaskedLM:()=>$s,DebertaV2ForQuestionAnswering:()=>ai,DebertaV2ForSequenceClassification:()=>Ma,DebertaV2ForTokenClassification:()=>si,DebertaV2Model:()=>ni,DebertaV2PreTrainedModel:()=>ps,DecisionTransformerModel:()=>FM,DecisionTransformerPreTrainedModel:()=>DM,DeiTForImageClassification:()=>O2,DeiTModel:()=>N2,DeiTPreTrainedModel:()=>yv,DepthAnythingForDepthEstimation:()=>K2,DepthAnythingPreTrainedModel:()=>H2,DepthProForDepthEstimation:()=>X2,DepthProPreTrainedModel:()=>Z2,DetrForObjectDetection:()=>_2,DetrForSegmentation:()=>dv,DetrModel:()=>v2,DetrObjectDetectionOutput:()=>uv,DetrPreTrainedModel:()=>af,DetrSegmentationOutput:()=>w2,Dinov2ForImageClassification:()=>mT,Dinov2Model:()=>fT,Dinov2PreTrainedModel:()=>Ev,Dinov2WithRegistersForImageClassification:()=>yT,Dinov2WithRegistersModel:()=>gT,Dinov2WithRegistersPreTrainedModel:()=>Sv,DistilBertForMaskedLM:()=>We,DistilBertForQuestionAnswering:()=>ns,DistilBertForSequenceClassification:()=>An,DistilBertForTokenClassification:()=>Ea,DistilBertModel:()=>ii,DistilBertPreTrainedModel:()=>Gr,DonutSwinModel:()=>cT,DonutSwinPreTrainedModel:()=>lT,EfficientNetForImageClassification:()=>TM,EfficientNetModel:()=>kM,EfficientNetPreTrainedModel:()=>
3362Dv,ElectraForMaskedLM:()=>Ue,ElectraForQuestionAnswering:()=>Xt,ElectraForSequenceClassification:()=>je,ElectraForTokenClassification:()=>Nt,ElectraModel:()=>xe,ElectraPreTrainedModel:()=>oe,EsmForMaskedLM:()=>ir,EsmForSequenceClassification:()=>ta,EsmForTokenClassification:()=>ra,EsmModel:()=>gt,EsmPreTrainedModel:()=>it,ExaoneForCausalLM:()=>X,ExaoneModel:()=>W,ExaonePreTrainedModel:()=>O,FalconForCausalLM:()=>fM,FalconModel:()=>hM,FalconPreTrainedModel:()=>Nv,FastViTForImageClassification:()=>a2,FastViTModel:()=>s2,FastViTPreTrainedModel:()=>sv,Florence2ForConditionalGeneration:()=>Kh,Florence2PreTrainedModel:()=>wu,GLPNForDepthEstimation:()=>oT,GLPNModel:()=>iT,GLPNPreTrainedModel:()=>kv,GPT2LMHeadModel:()=>ju,GPT2Model:()=>Cu,GPT2PreTrainedModel:()=>Pu,GPTBigCodeForCausalLM:()=>Ru,GPTBigCodeModel:()=>Ou,GPTBigCodePreTrainedModel:()=>_l,GPTJForCausalLM:()=>Nu,GPTJModel:()=>$u,GPTJPreTrainedModel:()=>Ec,GPTNeoForCausalLM:()=>yl,GPTNeoModel:()=>Iu,GPTNeoPreTrainedModel:()=>Tc,GPTNeoXForCausalLM:()=>Mc,GPTNeoXModel:()=>vl,GPTNeoXPreTrainedModel:()=>Ts,Gemma2ForCausalLM:()=>kk,Gemma2Model:()=>bk,Gemma2PreTrainedModel:()=>Vy,Gemma3ForCausalLM:()=>Mk,Gemma3Model:()=>Tk,Gemma3PreTrainedModel:()=>Gy,GemmaForCausalLM:()=>xk,GemmaModel:()=>wk,GemmaPreTrainedModel:()=>Wy,GlmForCausalLM:()=>P,GlmModel:()=>T,GlmPreTrainedModel:()=>Cc,GraniteForCausalLM:()=>yk,GraniteModel:()=>sf,GranitePreTrainedModel:()=>ci,GroundingDinoForObjectDetection:()=>_T,GroundingDinoPreTrainedModel:()=>vT,GroupViTModel:()=>n2,GroupViTPreTrainedModel:()=>r2,HeliumForCausalLM:()=>zu,HeliumModel:()=>Lu,HeliumPreTrainedModel:()=>Pc,HieraForImageClassification:()=>D2,HieraModel:()=>R2,HieraPreTrainedModel:()=>vv,HubertForCTC:()=>QT,HubertForSequenceClassification:()=>YT,HubertModel:()=>KT,HubertPreTrainedModel:()=>b5,IJepaForImageClassification:()=>Hk,IJepaModel:()=>qk,IJepaPreTrainedModel:()=>tv,Idefics3ForConditionalGeneration:()=>gl,Idefics3PreTrainedModel:()=>xc,ImageMattingOutput:()=>pS,JAISLMHeadModel:()=>nf,JAISModel:()=>_t,JAISPreTrainedModel:()=>ao,JinaCLIPModel:()=>Tu,JinaCLIPPreTrainedModel:()=>so,JinaCLIPTextModel:()=>Mu,JinaCLIPVisionModel:()=>Eu,LiteWhisperForConditionalGeneration:()=>yu,LlamaForCausalLM:()=>Fu,LlamaModel:()=>Du,LlamaPreTrainedModel:()=>xl,LlavaForConditionalGeneration:()=>ml,LlavaOnevisionForConditionalGeneration:()=>to,LlavaPreTrainedModel:()=>_u,LongT5ForConditionalGeneration:()=>tt,LongT5Model:()=>st,LongT5PreTrainedModel:()=>Qe,M2M100ForConditionalGeneration:()=>PT,M2M100Model:()=>AT,M2M100PreTrainedModel:()=>Cv,MBartForCausalLM:()=>Aa,MBartForConditionalGeneration:()=>Cn,MBartForSequenceClassification:()=>jr,MBartModel:()=>Pn,MBartPreTrainedModel:()=>_n,MPNetForMaskedLM:()=>ol,MPNetForQuestionAnswering:()=>dl,MPNetForSequenceClassification:()=>ll,MPNetForTokenClassification:()=>cl,MPNetModel:()=>il,MPNetPreTrainedModel:()=>Sa,MT5ForConditionalGeneration:()=>er,MT5Model:()=>Et,MT5PreTrainedModel:()=>ot,MarianMTModel:()=>ST,MarianModel:()=>ET,MarianPreTrainedModel:()=>Pv,MaskFormerForInstanceSegmentation:()=>aT,MaskFormerModel:()=>sT,MaskFormerPreTrainedModel:()=>bv,MaskedLMOutput:()=>Wn,Metric3DForDepthEstimation:()=>tT,Metric3DPreTrainedModel:()=>eT,Metric3Dv2ForDepthEstimation:()=>nT,Metric3Dv2PreTrainedModel:()=>rT,MgpstrForSceneTextRecognition:()=>WM,MgpstrModelOutput:()=>BM,MgpstrPreTrainedModel:()=>UM,MimiDecoderModel:()=>eE,MimiDecoderOutput:()=>JM,MimiEncoderModel:()=>XM,MimiEncoderOutput:()=>YM,MimiModel:()=>ZM,MimiPreTrainedModel:()=>vf,MistralForCausalLM:()=>dM,MistralModel:()=>cM,MistralPreTrainedModel:()=>Iv,MobileBertForMaskedLM:()=>en,MobileBertForQuestionAnswering:()=>sa,MobileBertForSequenceClassification:()=>ln,MobileBertModel:()=>na,MobileBertPreTrainedModel:()=>Xr,MobileLLMForCausalLM:()=>qe,MobileLLMModel:()=>$e,MobileLLMPreTrainedModel:()=>ge,MobileNetV1ForImageClassification:()=>EM,MobileNetV1ForSemanticSegmentation:()=>SM,MobileNetV1Model:()=>MM,MobileNetV1PreTrainedModel:()=>ff,MobileNetV2ForImageClassification:()=>PM,MobileNetV2ForSemanticSegmentation:()=>CM,MobileNetV2Model:()=>AM,MobileNetV2PreTrainedModel:()=>mf,MobileNetV3ForImageClassification:()=>IM,MobileNetV3ForSemanticSegmentation:()=>$M,MobileNetV3Model:()=>jM,MobileNetV3PreTrainedModel:()=>gf,MobileNetV4ForImageClassification:()=>OM,MobileNetV4ForSemanticSegmentation:()=>RM,MobileNetV4Model:()=>NM,MobileNetV4PreTrainedModel:()=>yf,MobileViTForImageClassification:()=>c2,MobileViTModel:()=>l2,MobileViTPreTrainedModel:()=>av,MobileViTV2ForImageClassification:()=>u2,MobileViTV2Model:()=>d2,MobileViTV2PreTrainedModel:()=>iv,ModelOutput:()=>Se,ModernBertForMaskedLM:()=>Pe,ModernBertForSequenceClassification:()=>Be,ModernBertForTokenClassification:()=>rt,ModernBertModel:()=>me,ModernBertPreTrainedModel:()=>Te,Moondream1ForConditionalGeneration:()=>Hh,MoonshineForConditionalGeneration:()=>qh,MoonshineModel:()=>Gh,MoonshinePreTrainedModel:()=>wc,MptForCausalLM:()=>Bk,MptModel:()=>zk,MptPreTrainedModel:()=>Zy,MultiModalityCausalLM:()=>zM,MultiModalityPreTrainedModel:()=>LM,MusicgenForCausalLM:()=>E5,MusicgenForConditionalGeneration:()=>Lv,MusicgenModel:()=>M5,MusicgenPreTrainedModel:()=>Fv,NomicBertModel:()=>Ye,NomicBertPreTrainedModel:()=>et,OPTForCausalLM:()=>Wk,OPTModel:()=>Uk,OPTPreTrainedModel:()=>Xy,Olmo2ForCausalLM:()=>xn,Olmo2Model:()=>ur,Olmo2PreTrainedModel:()=>Ht,OlmoForCausalLM:()=>$t,OlmoModel:()=>ct,OlmoPreTrainedModel:()=>nt,OpenELMForCausalLM:()=>Sk,OpenELMModel:()=>Ek,OpenELMPreTrainedModel:()=>qy,OwlViTForObjectDetection:()=>h2,OwlViTModel:()=>p2,OwlViTPreTrainedModel:()=>ov,Owlv2ForObjectDetection:()=>m2,Owlv2Model:()=>f2,Owlv2PreTrainedModel:()=>lv,PaliGemmaForConditionalGeneration:()=>Yh,PaliGemmaPreTrainedModel:()=>Qh,PatchTSMixerForPrediction:()=>HM,PatchTSMixerModel:()=>qM,PatchTSMixerPreTrainedModel:()=>Bv,PatchTSTForPrediction:()=>GM,PatchTSTModel:()=>VM,PatchTSTPreTrainedModel:()=>zv,Phi3ForCausalLM:()=>Dk,Phi3Model:()=>Rk,Phi3PreTrainedModel:()=>Yy,Phi3VForCausalLM:()=>bu,Phi3VPreTrainedModel:()=>Jh,PhiForCausalLM:()=>Ok,PhiModel:()=>Nk,PhiPreTrainedModel:()=>Qy,PreTrainedModel:()=>Y,PretrainedMixin:()=>nr,PvtForImageClassification:()=>Jk,PvtModel:()=>Yk,PvtPreTrainedModel:()=>rv,PyAnnoteForAudioFrameClassification:()=>OT,PyAnnoteModel:()=>NT,PyAnnotePreTrainedModel:()=>jv,QuestionAnsweringModelOutput:()=>ss,Qwen2ForCausalLM:()=>Pk,Qwen2Model:()=>Ak,Qwen2PreTrainedModel:()=>Hy,Qwen2VLForConditionalGeneration:()=>$k,Qwen2VLPreTrainedModel:()=>Ik,Qwen3ForCausalLM:()=>jk,Qwen3Model:()=>Ck,Qwen3PreTrainedModel:()=>Ky,RFDetrForObjectDetection:()=>S2,RFDetrModel:()=>E2,RFDetrObjectDetectionOutput:()=>A2,RFDetrPreTrainedModel:()=>fv,RTDetrForObjectDetection:()=>b2,RTDetrModel:()=>x2,RTDetrObjectDetectionOutput:()=>Bu,RTDetrPreTrainedModel:()=>
3362pv,RTDetrV2ForObjectDetection:()=>T2,RTDetrV2Model:()=>k2,RTDetrV2ObjectDetectionOutput:()=>M2,RTDetrV2PreTrainedModel:()=>hv,ResNetForImageClassification:()=>L2,ResNetModel:()=>F2,ResNetPreTrainedModel:()=>_v,RoFormerForMaskedLM:()=>It,RoFormerForQuestionAnswering:()=>zr,RoFormerForSequenceClassification:()=>Qt,RoFormerForTokenClassification:()=>Gt,RoFormerModel:()=>lt,RoFormerPreTrainedModel:()=>Fe,RobertaForMaskedLM:()=>Ir,RobertaForQuestionAnswering:()=>Un,RobertaForSequenceClassification:()=>tn,RobertaForTokenClassification:()=>rn,RobertaModel:()=>wn,RobertaPreTrainedModel:()=>Yn,SamImageSegmentationOutput:()=>MT,SamModel:()=>TT,SamPreTrainedModel:()=>kT,SapiensForDepthEstimation:()=>Y2,SapiensForNormalEstimation:()=>J2,SapiensForSemanticSegmentation:()=>Q2,SapiensPreTrainedModel:()=>lf,SegformerForImageClassification:()=>_M,SegformerForSemanticSegmentation:()=>wM,SegformerModel:()=>T5,SegformerPreTrainedModel:()=>hf,Seq2SeqLMOutput:()=>O5,SequenceClassifierOutput:()=>Ot,SiglipModel:()=>no,SiglipPreTrainedModel:()=>ro,SiglipTextModel:()=>ku,SiglipVisionModel:()=>tf,SmolVLMForConditionalGeneration:()=>xu,SnacDecoderModel:()=>lE,SnacEncoderModel:()=>oE,SnacModel:()=>iE,SnacPreTrainedModel:()=>wf,SpeechT5ForSpeechToText:()=>sM,SpeechT5ForTextToSpeech:()=>aM,SpeechT5HifiGan:()=>iM,SpeechT5Model:()=>k5,SpeechT5PreTrainedModel:()=>uf,SqueezeBertForMaskedLM:()=>ul,SqueezeBertForQuestionAnswering:()=>hl,SqueezeBertForSequenceClassification:()=>pl,SqueezeBertModel:()=>Xi,SqueezeBertPreTrainedModel:()=>oi,StableLmForCausalLM:()=>bM,StableLmModel:()=>xM,StableLmPreTrainedModel:()=>Rv,Starcoder2ForCausalLM:()=>pM,Starcoder2Model:()=>uM,Starcoder2PreTrainedModel:()=>$v,StyleTextToSpeech2Model:()=>nM,StyleTextToSpeech2PreTrainedModel:()=>rM,Swin2SRForImageSuperResolution:()=>V2,Swin2SRModel:()=>W2,Swin2SRPreTrainedModel:()=>wv,SwinForImageClassification:()=>B2,SwinForSemanticSegmentation:()=>U2,SwinModel:()=>z2,SwinPreTrainedModel:()=>of,T5ForConditionalGeneration:()=>Ie,T5Model:()=>ye,T5PreTrainedModel:()=>fe,TableTransformerForObjectDetection:()=>I2,TableTransformerModel:()=>j2,TableTransformerObjectDetectionOutput:()=>$2,TableTransformerPreTrainedModel:()=>gv,TokenClassifierOutput:()=>jn,TrOCRForCausalLM:()=>lM,TrOCRPreTrainedModel:()=>oM,UltravoxModel:()=>QM,UltravoxPreTrainedModel:()=>KM,UniSpeechForCTC:()=>LT,UniSpeechForSequenceClassification:()=>zT,UniSpeechModel:()=>FT,UniSpeechPreTrainedModel:()=>cf,UniSpeechSatForAudioFrameClassification:()=>VT,UniSpeechSatForCTC:()=>UT,UniSpeechSatForSequenceClassification:()=>WT,UniSpeechSatModel:()=>BT,UniSpeechSatPreTrainedModel:()=>Uu,ViTForImageClassification:()=>Gk,ViTMAEModel:()=>Xk,ViTMAEPreTrainedModel:()=>Zk,ViTMSNForImageClassification:()=>t2,ViTMSNModel:()=>e2,ViTMSNPreTrainedModel:()=>nv,ViTModel:()=>Vk,ViTPreTrainedModel:()=>ev,VisionEncoderDecoderModel:()=>vu,VitMatteForImageMatting:()=>o2,VitMattePreTrainedModel:()=>i2,VitPoseForPoseEstimation:()=>Qk,VitPosePreTrainedModel:()=>Kk,VitsModel:()=>Ov,VitsModelOutput:()=>hS,VitsPreTrainedModel:()=>vM,Wav2Vec2BertForCTC:()=>qT,Wav2Vec2BertForSequenceClassification:()=>HT,Wav2Vec2BertModel:()=>GT,Wav2Vec2BertPreTrainedModel:()=>df,Wav2Vec2ForAudioFrameClassification:()=>$T,Wav2Vec2ForCTC:()=>jT,Wav2Vec2ForSequenceClassification:()=>IT,Wav2Vec2Model:()=>CT,Wav2Vec2PreTrainedModel:()=>io,WavLMForAudioFrameClassification:()=>tM,WavLMForCTC:()=>ZT,WavLMForSequenceClassification:()=>XT,WavLMForXVector:()=>eM,WavLMModel:()=>JT,WavLMPreTrainedModel:()=>jc,WeSpeakerResNetModel:()=>DT,WeSpeakerResNetPreTrainedModel:()=>RT,WhisperForConditionalGeneration:()=>gu,WhisperModel:()=>Vh,WhisperPreTrainedModel:()=>mu,XLMForQuestionAnswering:()=>hu,XLMForSequenceClassification:()=>Oh,XLMForTokenClassification:()=>Rh,XLMModel:()=>fl,XLMPreTrainedModel:()=>aa,XLMRobertaForMaskedLM:()=>Fh,XLMRobertaForQuestionAnswering:()=>Bh,XLMRobertaForSequenceClassification:()=>Lh,XLMRobertaForTokenClassification:()=>zh,XLMRobertaModel:()=>Dh,XLMRobertaPreTrainedModel:()=>eo,XLMWithLMHeadModel:()=>Nh,XVectorOutput:()=>
3362uS,YolosForObjectDetection:()=>xT,YolosModel:()=>wT,YolosObjectDetectionOutput:()=>bT,YolosPreTrainedModel:()=>Av});var n=r("./src/configs.js"),s=r("./src/backends/onnx.js"),a=r("./src/utils/dtypes.js"),i=r("./src/utils/generic.js"),l=r("./src/utils/core.js"),c=r("./src/utils/hub.js"),d=r("./src/utils/constants.js"),p=r("./src/generation/logits_process.js"),u=r("./src/generation/configuration_utils.js"),h=r("./src/utils/tensor.js"),f=r("./src/utils/image.js"),m=r("./src/utils/maths.js"),v=r("./src/generation/stopping_criteria.js"),k=r("./src/generation/logits_sampler.js"),y=r("./src/env.js"),g=r("./src/models/whisper/generation_whisper.js"),_=r("./src/models/whisper/common_whisper.js");const w={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},x=new Map,b=new Map,M=new Map;async function S(A,C,z){var In;let he=((In=z.config)==null?void 0:In["transformers.js_config"])??{},ke=z.device??he.device;ke&&typeof ke!="string"&&(ke.hasOwnProperty(C)?ke=ke[C]:(console.warn(`device not specified for "${C}". Using the default device.`),ke=null));const be=ke??(y.apis.IS_NODE_ENV?"cpu":"wasm"),Re=(0,s.deviceToExecutionProviders)(be),Ge=he.device_config??{};Ge.hasOwnProperty(be)&&(he={...he,...Ge[be]});let Ze=z.dtype??he.dtype;if(typeof Ze!="string"&&(Ze&&Ze.hasOwnProperty(C)?Ze=Ze[C]:(Ze=a.DEFAULT_DEVICE_DTYPE_MAPPING[be]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${C}". Using the default dtype (${Ze}) for this device (${be}).`))),Ze===a.DATA_TYPES.auto){let Bt=he.dtype;typeof Bt!="string"&&(Bt=Bt==null?void 0:Bt[C]),Bt&&Bt!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(Bt)?Ze=Bt:Ze=a.DEFAULT_DEVICE_DTYPE_MAPPING[be]??a.DATA_TYPES.fp32}const at=Ze;if(a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(at)){if(at===a.DATA_TYPES.fp16&&be==="webgpu"&&!await(0,a.isWebGpuFp16Supported)())throw new Error(`The device (${be}) does not support fp16.`)}else throw new Error(`Invalid dtype: ${at}. Should be one of: ${Object.keys(a.DATA_TYPES).join(", ")}`);const bt=he.kv_cache_dtype,At=bt?typeof bt=="string"?bt:bt[at]??"float32":void 0;if(At&&!["float32","float16"].includes(At))throw new Error(`Invalid kv_cache_dtype: ${At}. Should be one of: float32, float16`);const wt={dtype:at,kv_cache_dtype:At,device:be},zt=a.DEFAULT_DTYPE_SUFFIX_MAPPING[at],St=`${C}${zt}.onnx`,Lt=`${z.subfolder??""}/${St}`,ft={...z.session_options};ft.executionProviders??(ft.executionProviders=Re);const qt=he.free_dimension_overrides;qt?ft.freeDimensionOverrides??(ft.freeDimensionOverrides=qt):be.startsWith("webnn")&&!ft.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${be}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);const _r=y.apis.IS_NODE_ENV&&y.env.useFSCache,$r=(0,c.getModelFile)(A,Lt,!0,z,_r),qr=z.use_external_data_format??he.use_external_data_format;let Br=[];if(qr){let Bt;typeof qr=="object"?qr.hasOwnProperty(St)?Bt=qr[St]:qr.hasOwnProperty(C)?Bt=qr[C]:Bt=!1:Bt=qr;const bn=+Bt;if(bn>c.MAX_EXTERNAL_DATA_CHUNKS)throw new Error(`The number of external data chunks (${bn}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let Rs=0;Rs<bn;++Rs){const kl=`${St}_data${Rs===0?"":"_"+Rs}`,hs=`${z.subfolder??""}/${kl}`;Br.push(new Promise(async(ia,xf)=>{const Tl=await(0,c.getModelFile)(A,hs,!0,z,_r);ia(Tl instanceof Uint8Array?{path:kl,data:Tl}:kl)}))}}else ft.externalData!==void 0&&(Br=ft.externalData.map(async Bt=>{if(typeof Bt.data=="string"){const bn=await(0,c.getModelFile)(A,Bt.data,!0,z);return{...Bt,data:bn}}return Bt}));if(Br.length>0){const Bt=await Promise.all(Br);y.apis.IS_NODE_ENV||(ft.externalData=Bt)}if(be==="webgpu"){const Bt=(0,n.getKeyValueShapes)(z.config,{prefix:"present"});if(Object.keys(Bt).length>0&&!(0,s.isONNXProxy)()){const bn={};for(const Rs in Bt)bn[Rs]="gpu-buffer";ft.preferredOutputLocation=bn}}return{buffer_or_path:await $r,session_options:ft,session_config:wt}}
3362async function j(A,C,z){return Object.fromEntries(await Promise.all(Object.keys(C).map(async he=>{const{buffer_or_path:ke,session_options:be,session_config:Re}=await S(A,C[he],z),Ge=await(0,s.createInferenceSession)(ke,be,Re);return[he,Ge]})))}async function I(A,C,z){return Object.fromEntries(await Promise.all(Object.keys(C).map(async he=>{const ke=await(0,c.getModelJSON)(A,C[he],!1,z);return[he,ke]})))}function q(A,C){const z=Object.create(null),he=[];for(const Re of A.inputNames){const Ge=C[Re];if(!(Ge instanceof h.Tensor)){he.push(Re);continue}z[Re]=(0,s.isONNXProxy)()?Ge.clone():Ge}if(he.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${he.join(", ")}.`);const ke=Object.keys(C).length,be=A.inputNames.length;if(ke>be){let Re=Object.keys(C).filter(Ge=>!A.inputNames.includes(Ge));console.warn(`WARNING: Too many inputs were provided (${ke} > ${be}). The following inputs will be ignored: "${Re.join(", ")}".`)}return z}let U=Promise.resolve();async function R(A,C){const z=q(A,C);try{const he=Object.fromEntries(Object.entries(z).map(([Re,Ge])=>[Re,Ge.ort_tensor])),ke=()=>A.run(he),be=await(y.apis.IS_BROWSER_ENV||y.apis.IS_WEBWORKER_ENV?U=U.then(ke):ke());return K(be)}catch(he){const ke=Object.fromEntries(Object.entries(z).map(([be,Re])=>{const Ge={type:Re.type,dims:Re.dims,location:Re.location};return Ge.location!=="gpu-buffer"&&(Ge.data=Re.data),[be,Ge]}));throw console.error(`An error occurred during model execution: "${he}".`),console.error("Inputs given to model:",ke),he}}function K(A){for(let C in A)(0,s.isONNXTensor)(A[C])?A[C]=new h.Tensor(A[C]):typeof A[C]=="object"&&K(A[C]);return A}function H(A){if(A instanceof h.Tensor)return A;if(A.length===0)throw Error("items must be non-empty");if(Array.isArray(A[0])){if(A.some(C=>C.length!==A[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new h.Tensor("int64",BigInt64Array.from(A.flat().map(C=>BigInt(C))),[A.length,A[0].length])}else return new h.Tensor("int64",BigInt64Array.from(A.map(C=>BigInt(C))),[1,A.length])}function ee(A){return new h.Tensor("bool",[A],[1])}async function te(A,C){let{encoder_outputs:z,input_ids:he,decoder_input_ids:ke,...be}=C;if(!z){const Ge=(0,l.pick)(C,A.sessions.model.inputNames);z=(await V(A,Ge)).last_hidden_state}return be.input_ids=ke,be.encoder_hidden_states=z,A.sessions.decoder_model_merged.inputNames.includes("encoder_attention_mask")&&(be.encoder_attention_mask=C.attention_mask),await ne(A,be,!0)}async function V(A,C){const z=A.sessions.model,he=(0,l.pick)(C,z.inputNames);if(z.inputNames.includes("inputs_embeds")&&!he.inputs_embeds){if(!C.input_ids)throw new Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");he.inputs_embeds=await A.encode_text({input_ids:C.input_ids})}if(z.inputNames.includes("token_type_ids")&&!he.token_type_ids){if(!he.input_ids)throw new Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");he.token_type_ids=(0,h.zeros_like)(he.input_ids)}if(z.inputNames.includes("pixel_mask")&&!he.pixel_mask){if(!he.pixel_values)throw new Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");const ke=he.pixel_values.dims;he.pixel_mask=(0,h.ones)([ke[0],ke[2],ke[3]])}return await R(z,he)}async function ae(A,C){const z=await A.encode(C);return await A.decode(z)}async function ne(A,C,z=!1){const he=A.sessions[z?"decoder_model_merged":"model"],{past_key_values:ke,...be}=C;if(he.inputNames.includes("use_cache_branch")&&(be.use_cache_branch=ee(!!ke)),he.inputNames.includes("position_ids")&&be.attention_mask&&!be.position_ids){const Ge=["paligemma","gemma3_text","gemma3"].includes(A.config.model_type)?1:0;be.position_ids=ze(be,ke,Ge)}A.addPastKeyValues(be,ke);const Re=(0,l.pick)(be,he.inputNames);return await R(he,Re)}
vendor: 1,165 bytes, line 3362
3362function L({modality_token_id:A,inputs_embeds:C,modality_features:z,input_ids:he,attention_mask:ke}){const be=he.tolist().map(at=>at.reduce((bt,At,wt)=>(At==A&&bt.push(wt),bt),[])),Re=be.reduce((at,bt)=>at+bt.length,0),Ge=z.dims[0];if(Re!==Ge)throw new Error(`Number of tokens and features do not match: tokens: ${Re}, features ${Ge}`);let Ze=0;for(let at=0;at<be.length;++at){const bt=be[at],At=C[at];for(let wt=0;wt<bt.length;++wt)At[bt[wt]].data.set(z[Ze++].data)}return{inputs_embeds:C,attention_mask:ke}}function $({image_token_id:A,inputs_embeds:C,image_features:z,input_ids:he,attention_mask:ke}){return L({modality_token_id:A,inputs_embeds:C,modality_features:z,input_ids:he,attention_mask:ke})}function G({audio_token_id:A,inputs_embeds:C,audio_features:z,input_ids:he,attention_mask:ke}){return L({modality_token_id:A,inputs_embeds:C,modality_features:z,input_ids:he,attention_mask:ke})}async function se(A,{encode_function:C,merge_function:z,modality_input_name:he,modality_output_name:ke,input_ids:be=null,attention_mask:Re=null,position_ids:Ge=null,inputs_embeds:Ze=null,past_key_values:at=null,generation_config:bt=null,logits_processor:At=null,...wt}
3362){const zt=wt[he];if(!Ze){if(Ze=await A.encode_text({input_ids:be,...wt}),zt&&be.dims[1]!==1){const Lt=await C({[he]:zt,...wt});({inputs_embeds:Ze,attention_mask:Re}=z({[ke]:Lt,inputs_embeds:Ze,input_ids:be,attention_mask:Re}))}else if(at&&zt&&be.dims[1]===1){const Lt=be.dims[1],ft=Object.values(at)[0].dims.at(-2);Re=(0,h.cat)([(0,h.ones)([be.dims[0],ft]),Re.slice(null,[Re.dims[1]-Lt,Re.dims[1]])],1)}}if(!Ge&&A.config.model_type==="qwen2_vl"){const{image_grid_thw:Lt,video_grid_thw:ft}=wt;[Ge]=A.get_rope_index(be,Lt,ft,Re)}return await ne(A,{inputs_embeds:Ze,past_key_values:at,attention_mask:Re,position_ids:Ge,generation_config:bt,logits_processor:At},!0)}async function _e(A,C){return await se(A,{...C,modality_input_name:"audio_values",modality_output_name:"audio_features",encode_function:A.encode_audio.bind(A),merge_function:A._merge_input_ids_with_audio_features.bind(A)})}async function de(A,C){return await se(A,{...C,modality_input_name:"pixel_values",modality_output_name:"image_features",encode_function:A.encode_image.bind(A),merge_function:A._merge_input_ids_with_image_features.bind(A)})}function Ee(A,C=0){const[z,he]=A.dims,ke=A.data,be=new BigInt64Array(ke.length);for(let Re=0;Re<z;++Re){const Ge=Re*he;let Ze=BigInt(C);for(let at=0;at<he;++at){const bt=Ge+at;ke[bt]===0n?be[bt]=BigInt(1):(be[bt]=Ze,Ze+=ke[bt])}}return{data:be,dims:A.dims}}function ze(A,C=null,z=0){const{input_ids:he,inputs_embeds:ke,attention_mask:be}=A,{data:Re,dims:Ge}=Ee(be,z);let Ze=new h.Tensor("int64",Re,Ge);if(C){const at=-(he??ke).dims.at(1);Ze=Ze.slice(null,[at,null])}return Ze}function Ke(A,C,z,he){if(z.past_key_values){const ke=Object.values(z.past_key_values)[0].dims.at(-2),{input_ids:be,attention_mask:Re}=z;if(!(Re&&Re.dims[1]>be.dims[1])){if(ke<be.dims[1])z.input_ids=be.slice(null,[ke,null]);else if(A.config.image_token_index!=null&&be.data.some(Ge=>Ge==A.config.image_token_index)){const Ge=A.config.num_image_tokens;if(!Ge)throw new Error("`num_image_tokens` is missing in the model configuration.");const Ze=be.dims[1]-(ke-Ge);z.input_ids=be.slice(null,[-Ze,null]),z.attention_mask=(0,h.ones)([1,ke+Ze])}}}return z}function ve(A,C,z,he){return z.past_key_values&&(C=C.map(ke=>[ke.at(-1)])),{...z,decoder_input_ids:H(C)}}function J(A,...C){return A.config.is_encoder_decoder?ve(A,...C):Ke(A,...C)}function ue(A,C,z,he){const ke=!!z.past_key_values;return he.guidance_scale!==null&&he.guidance_scale>1&&(ke?z.input_ids=(0,h.cat)([z.input_ids,z.input_ids],0):(z.input_ids=(0,h.cat)([z.input_ids,(0,h.full_like)(z.input_ids,BigInt(he.pad_token_id))],0),z.attention_mask=(0,h.cat)([z.attention_mask,(0,h.full_like)(z.attention_mask,0n)],0))),(ke||!z.pixel_values)&&(z.pixel_values=(0,h.full)([0,0,3,384,384],1)),ke&&(z.images_seq_mask=new h.Tensor("bool",new Array(1).fill(!0).fill(!1,0,1),[1,1]),z.images_emb_mask=new h.Tensor("bool",new Array(0).fill(!1),[1,1,0])),z}class Y extends i.Callable{constructor(z,he,ke){super();ce(this,"main_input_name","input_ids");ce(this,"forward_params",["input_ids","attention_mask"]);this.config=z,this.sessions=he,this.configs=ke;const be=M.get(this.constructor),Re=x.get(be);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,Re){case w.DecoderOnly:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=Ke;break;case w.Seq2Seq:case w.Vision2Seq:case w.Musicgen:this.can_generate=!0,this._forward=te,this._prepare_inputs_for_generation=ve;break;case w.EncoderDecoder:this._forward=te;break;case w.ImageTextToText:this.can_generate=!0,this._forward=de,this._prepare_inputs_for_generation=J;break;case w.AudioTextToText:this.can_generate=!0,this._forward=_e,this._prepare_inputs_for_generation=J;break;case w.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=J;break;case w.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=ue;break;case w.AutoEncoder:this._forward=ae;break;default:this._forward=V;break}this.can_generate&&this.forward_params.push("past_key_values"),this.custom_config=this.config["transformers.js_config"]??{}}async dispose(){var he;const z=[];for(const ke of Object.values(this.sessions))(he=ke==null?void 0:ke.handler)!=null&&he.dispose&&z.push(ke.handler.dispose());return await Promise.all(z)}static async from_pretrained(z,{progress_callback:he=null,config:ke=null,cache_dir:be=null,local_files_only:Re=!1,revision:Ge="main",model_file_name:Ze=null,subfolder:at="onnx",device:bt=null,dtype:At=null,use_external_data_format:wt=null,session_options:zt={}}={}){let St={progress_callback:he,config:ke,cache_dir:be,local_files_only:Re,revision:Ge,model_file_name:Ze,subfolder:at,device:bt,dtype:At,use_external_data_format:wt,session_options:zt};
3362const Lt=M.get(this),ft=x.get(Lt);ke=St.config=await n.AutoConfig.from_pretrained(z,St);let qt;if(ft===w.DecoderOnly)qt=await Promise.all([j(z,{model:St.model_file_name??"model"},St),I(z,{generation_config:"generation_config.json"},St)]);else if(ft===w.Seq2Seq||ft===w.Vision2Seq)qt=await Promise.all([j(z,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},St),I(z,{generation_config:"generation_config.json"},St)]);else if(ft===w.MaskGeneration)qt=await Promise.all([j(z,{model:"vision_encoder",prompt_encoder_mask_decoder:"prompt_encoder_mask_decoder"},St)]);else if(ft===w.EncoderDecoder)qt=await Promise.all([j(z,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},St)]);else if(ft===w.ImageTextToText){const _r={embed_tokens:"embed_tokens",vision_encoder:"vision_encoder",decoder_model_merged:"decoder_model_merged"};ke.is_encoder_decoder&&(_r.model="encoder_model"),qt=await Promise.all([j(z,_r,St),I(z,{generation_config:"generation_config.json"},St)])}else if(ft===w.AudioTextToText){const _r={embed_tokens:"embed_tokens",audio_encoder:"audio_encoder",decoder_model_merged:"decoder_model_merged"};qt=await Promise.all([j(z,_r,St),I(z,{generation_config:"generation_config.json"},St)])}else if(ft===w.Musicgen)qt=await Promise.all([j(z,{model:"text_encoder",decoder_model_merged:"decoder_model_merged",encodec_decode:"encodec_decode"},St),I(z,{generation_config:"generation_config.json"},St)]);else if(ft===w.MultiModality)qt=await Promise.all([j(z,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"language_model",lm_head:"lm_head",gen_head:"gen_head",gen_img_embeds:"gen_img_embeds",image_decode:"image_decode"},St),I(z,{generation_config:"generation_config.json"},St)]);else if(ft===w.Phi3V)qt=await Promise.all([j(z,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"model",vision_encoder:"vision_encoder"},St),I(z,{generation_config:"generation_config.json"},St)]);else if(ft===w.AutoEncoder)qt=await Promise.all([j(z,{encoder_model:"encoder_model",decoder_model:"decoder_model"},St)]);else{if(ft!==w.EncoderOnly){const _r=Lt??(ke==null?void 0:ke.model_type);_r!=="custom"&&console.warn(`Model type for '${_r}' not found, assuming encoder-only architecture. Please report this at ${d.GITHUB_ISSUE_URL}.`)}qt=await Promise.all([j(z,{model:St.model_file_name??"model"},St)])}return new this(ke,...qt)}async _call(z){return await this.forward(z)}async forward(z){return await this._forward(this,z)}get generation_config(){var z;return((z=this.configs)==null?void 0:z.generation_config)??null}_get_logits_warper(z){const he=new p.LogitsProcessorList;return z.temperature!==null&&z.temperature!==1&&he.push(new p.TemperatureLogitsWarper(z.temperature)),z.top_k!==null&&z.top_k!==0&&he.push(new p.TopKLogitsWarper(z.top_k)),z.top_p!==null&&z.top_p<1&&he.push(new p.TopPLogitsWarper(z.top_p)),he}_get_logits_processor(z,he,ke=null){const be=new p.LogitsProcessorList;if(z.repetition_penalty!==null&&z.repetition_penalty!==1&&be.push(new p.RepetitionPenaltyLogitsProcessor(z.repetition_penalty)),z.no_repeat_ngram_size!==null&&z.no_repeat_ngram_size>0&&be.push(new p.NoRepeatNGramLogitsProcessor(z.no_repeat_ngram_size)),z.bad_words_ids!==null&&be.push(new p.NoBadWordsLogitsProcessor(z.bad_words_ids,z.eos_token_id)),z.min_length!==null&&z.eos_token_id!==null&&z.min_length>0&&be.push(new p.MinLengthLogitsProcessor(z.min_length,z.eos_token_id)),z.min_new_tokens!==null&&z.eos_token_id!==null&&z.min_new_tokens>0&&be.push(new p.MinNewTokensLengthLogitsProcessor(he,z.min_new_tokens,z.eos_token_id)),z.forced_bos_token_id!==null&&be.push(new p.ForcedBOSTokenLogitsProcessor(z.forced_bos_token_id)),z.forced_eos_token_id!==null&&be.push(new p.ForcedEOSTokenLogitsProcessor(z.max_length,z.forced_eos_token_id)),z.begin_suppress_tokens!==null){const Re=he>1||z.forced_bos_token_id===null?he:he+1;be.push(new p.SuppressTokensAtBeginLogitsProcessor(z.begin_suppress_tokens,Re))}return z.guidance_scale!==null&&z.guidance_scale>1&&be.push(new p.ClassifierFreeGuidanceLogitsProcessor(z.guidance_scale)),ke!==null&&be.extend(ke),be}_prepare_generation_config(z,he,ke=u.GenerationConfig){const be={...this.config};for(const Ge of["decoder","generator","text_config"])Ge in be&&Object.assign(be,be[Ge]);const Re=new ke(be);return Object.assign(Re,this.generation_config??{}),z&&Object.assign(Re,z),he&&Object.assign(Re,(0,l.pick)(he,Object.getOwnPropertyNames(Re))),Re}_get_stopping_criteria(z,he=null){const ke=new v.StoppingCriteriaList;return z.max_length!==null&&ke.push(new v.MaxLengthCriteria(z.max_length,this.config.max_position_embeddings??null)),z.eos_token_id!==null&&ke.push(new v.EosTokenCriteria(z.eos_token_id)),he&&ke.extend(he),ke}_validate_model_class(){if(!this.can_generate){const z=[Vv,Gv,Wv,Uv],he=M.get(this.constructor),ke=new Set,be=this.config.model_type;for(const Ge of z){const Ze=Ge.get(be);Ze&&ke.add(Ze[0])}let Re=`The current model class (${he}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw ke.size>0&&(Re+=` Please use the following class instead: ${[...ke].join(", ")}`),Error(Re)}}prepare_inputs_for_generation(...z){return this._prepare_inputs_for_generation(this,...z)}_update_model_kwargs_for_generation({generated_input_ids:z,outputs:he,model_inputs:ke,is_encoder_decoder:be}){return ke.past_key_values=this.getPastKeyValues(he,ke.past_key_values),ke.input_ids=new h.Tensor("int64",z.flat(),[z.length,1]),be||(ke.attention_mask=(0,h.cat)([ke.attention_mask,(0,h.ones)([ke.attention_mask.dims[
33620],1])],1)),ke.position_ids=null,ke}_prepare_model_inputs({inputs:z,bos_token_id:he,model_kwargs:ke}){const be=(0,l.pick)(ke,this.forward_params),Re=this.main_input_name;if(Re in be){if(z)throw new Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else be[Re]=z;return{inputs_tensor:be[Re],model_inputs:be,model_input_name:Re}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:z,model_inputs:he,model_input_name:ke,generation_config:be}){if(this.sessions.model.inputNames.includes("inputs_embeds")&&!he.inputs_embeds&&"_prepare_inputs_embeds"in this){const{input_ids:Ge,pixel_values:Ze,attention_mask:at,...bt}=he,At=await this._prepare_inputs_embeds(he);he={...bt,...(0,l.pick)(At,["inputs_embeds","attention_mask"])}}let{last_hidden_state:Re}=await V(this,he);if(be.guidance_scale!==null&&be.guidance_scale>1)Re=(0,h.cat)([Re,(0,h.full_like)(Re,0)],0),"attention_mask"in he&&(he.attention_mask=(0,h.cat)([he.attention_mask,(0,h.zeros_like)(he.attention_mask)],0));else if(he.decoder_input_ids){const Ge=H(he.decoder_input_ids).dims[0];if(Ge!==Re.dims[0]){if(Re.dims[0]!==1)throw new Error(`The encoder outputs have a different batch size (${Re.dims[0]}) than the decoder inputs (${Ge}).`);Re=(0,h.cat)(Array.from({length:Ge},()=>Re),0)}}return he.encoder_outputs=Re,he}_prepare_decoder_input_ids_for_generation({batch_size:z,model_input_name:he,model_kwargs:ke,decoder_start_token_id:be,bos_token_id:Re,generation_config:Ge}){let{decoder_input_ids:Ze,...at}=ke;if(!(Ze instanceof h.Tensor)){if(Ze)Array.isArray(Ze[0])||(Ze=Array.from({length:z},()=>Ze));else if(be??(be=Re),this.config.model_type==="musicgen")Ze=Array.from({length:z*this.config.decoder.num_codebooks},()=>[be]);else if(Array.isArray(be)){if(be.length!==z)throw new Error(`\`decoder_start_token_id\` expcted to have length ${z} but got ${be.length}`);Ze=be}else Ze=Array.from({length:z},()=>[be]);Ze=H(Ze)}return ke.decoder_attention_mask=(0,h.ones_like)(Ze),{input_ids:Ze,model_inputs:at}}async generate({inputs:z=null,generation_config:he=null,logits_processor:ke=null,stopping_criteria:be=null,streamer:Re=null,...Ge}){this._validate_model_class(),he=this._prepare_generation_config(he,Ge);let{inputs_tensor:Ze,model_inputs:at,model_input_name:bt}=this._prepare_model_inputs({inputs:z,model_kwargs:Ge});const At=this.config.is_encoder_decoder;At&&("encoder_outputs"in at||(at=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:Ze,model_inputs:at,model_input_name:bt,generation_config:he})));let wt;At?{input_ids:wt,model_inputs:at}=this._prepare_decoder_input_ids_for_generation({batch_size:at[bt].dims.at(0),model_input_name:bt,model_kwargs:at,decoder_start_token_id:he.decoder_start_token_id,bos_token_id:he.bos_token_id,generation_config:he}):wt=at[bt];let zt=wt.dims.at(-1);he.max_new_tokens!==null&&(he.max_length=zt+he.max_new_tokens);const St=this._get_logits_processor(he,zt,ke),Lt=this._get_stopping_criteria(he,be),ft=at[bt].dims.at(0),qt=k.LogitsSampler.getSampler(he),_r=new Array(ft).fill(0),$r=wt.tolist();Re&&Re.put($r);let qr,Br={};for(;;){if(at=this.prepare_inputs_for_generation($r,at,he),qr=await this.forward(at),he.output_attentions&&he.return_dict_in_generate){const hs=this.getAttentions(qr);for(const ia in hs)ia in Br||(Br[ia]=[]),Br[ia].push(hs[ia])}const Bt=qr.logits.slice(null,-1,null),bn=St($r,Bt),Rs=[];for(let hs=0;hs<bn.dims.at(0);++hs){const ia=bn[hs],xf=await qt(ia);for(const[Tl,bf]of xf){const kf=BigInt(Tl);_r[hs]+=bf,$r[hs].push(kf),Rs.push([kf]);break}}if(Re&&Re.put(Rs),Lt($r).every(hs=>hs))break;at=this._update_model_kwargs_for_generation({generated_input_ids:Rs,outputs:qr,model_inputs:at,is_encoder_decoder:At})}Re&&Re.end();const un=this.getPastKeyValues(qr,at.past_key_values,!0),In=new h.Tensor("int64",$r.flat(),[$r.length,$r[0].length]);if(he.return_dict_in_generate)return{sequences:In,past_key_values:un,...Br};for(const Bt of Object.values(qr))Bt.location==="gpu-buffer"&&Bt.dispose();return In}getPastKeyValues(z,he,ke=!1){const be=Object.create(null);for(const Re in z)if(Re.startsWith("present")){const Ge=Re.replace("present","past_key_values"),Ze=Re.includes("encoder");if(Ze&&he?be[Ge]=he[Ge]:be[Ge]=z[Re],he&&(!Ze||ke)){const at=he[Ge];at.location==="gpu-buffer"&&at.dispose()}}return be}getAttentions(z){const he={};for(const ke of["cross_attentions","encoder_attentions","decoder_attentions"])for(const be in z)be.startsWith(ke)&&(ke in he||(he[ke]=[]),he[ke].push(z[be]));return he}addPastKeyValues(z,he){var ke,be,Re;if(he)Object.assign(z,he);else{const Ge=this.sessions.decoder_model_merged??this.sessions.model,Ze=((ke=Ge==null?void 0:Ge.config)==null?void 0:ke.kv_cache_dtype)??"float32",at=Ze==="float16"?new h.DataTypeMap.float16:[],bt=((Re=(be=z[this.main_input_name]??z.attention_mask)==null?void 0:be.dims)==null?void 0:Re[0])??1,At=(0,n.getKeyValueShapes)(this.config,{batch_size:bt});for(const wt in At)z[wt]=new h.Tensor(Ze,at,At[wt])}}async encode_image({pixel_values:z}){const he=(await R(this.sessions.vision_encoder,{pixel_values:z})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${he.dims[1]}).`),this.config.num_image_tokens=he.dims[1]),he}async encode_text({input_ids:z}){return(await R(this.sessions.embed_tokens,{input_ids:z})).inputs_embeds}async encode_audio({audio_values:z}){return(await R(this.sessions.audio_encoder,{audio_values:z})).audio_features}}class Se{}class Ae extends Se{constructor({last_hidden_state:C,hidden_states:z=null,attentions:he=null}){super(),this.last_hidden_state=C,this.hidden_states=z,this.attentions=he}}class Oe extends Y{}class Ne extends Oe{}class Q extends Oe{async _call(C){return new Wn(await super._call(C))}}class re extends Oe{async _call(C){return new Ot(await super._call(C))}}class pe extends Oe{async _call(C){return new jn(await super._call(C))}}class Me extends Oe{async _call(C){return new ss(await super._call(C))}}class Te extends Y{}class me extends Te{}class Pe extends Te{async _call(C){return new Wn(await super._call(C))}}class Be extends Te{async _call(C){return new Ot(await super._call(C))}}class rt extends Te{async _call(C){return new jn(await super._call(C))}}class et extends Y{}class Ye extends et{}class Fe extends Y{}class lt extends Fe{}class It extends Fe{async _call(C){return new Wn(await super._call(C))}}class Qt extends Fe{async _call(C){return new Ot(await super._call(C))}}class Gt extends Fe{async _call(C){return new jn(await super._call(C))}}class zr extends Fe{async _call(C){return new ss(await super._call(C))}}class hr extends Y{}class Tt extends hr{}class ks extends hr{async _call(C){return new Wn(await super._call(C))}}class F extends hr{async _call(C){return new Ot(await super._call(C))}}class le extends hr{async _call(C){return new jn(await super._call(C))}}class B extends hr{async _call(C){return new ss(await super._call(C))}}class oe extends Y{}class xe extends oe{}class Ue extends oe{async _call(C){return new Wn(await super._call(C))}}class je extends oe{async _call(C){return new Ot(await super._call(C))}}class Nt extends oe{async _call(C){return new jn(await super._call(C))}}class Xt extends oe{async _call(C){return new ss(await super._call(C))}}class xt extends Y{}class yt extends xt{}class pt extends xt{async _call(C){return new Wn(await super._call(C))}}class ar extends xt{async _call(C){return new Ot(await super._call(C))}}class vr extends xt{async _call(C){return new jn(await super._call(C))}}class vn extends xt{async _call(C){return new ss(await super._call(C))}}class Sr extends Y{}class Kn extends Sr{}class Xs extends Sr{async _call(C){return new Wn(await super._call(C))}}class Ta extends Sr{async _call(C){return new Ot(await super._call(C))}}class ea extends Sr{async _call(C){return new jn(await super._call(C))}}class ri extends Sr{async _call(C){return new ss(await super._call(C))}}class ps extends Y{}class ni extends ps{}class $s extends ps{async _call(C){return new Wn(await super._call(C))}}class Ma extends ps{async _call(C){return new Ot(await super._call(C))}}class si extends ps{async _call(C){return new jn(await super._call(C))}}class ai extends ps{async _call(C){return new ss(await super._call(C))}}class Gr extends Y{}class ii extends Gr{}class An extends Gr{async _call(C){return new Ot(await super._call(C))}}class Ea extends Gr{async _call(C){return new jn(await super._call(C))}}class ns extends Gr{async _call(C){return new ss(await super._call(C))}}class We extends Gr{async _call(C){return new Wn(await super._call(C))}}class it extends Y{}class gt extends it{}class ir extends it{async _call(C){return new Wn(await super._call(C))}}class ta extends it{async _call(C){return new Ot(await super._call(C))}}class ra extends it{async _call(C){return new jn(await super._call(C))}}class Xr extends Y{}class na extends Xr{}class en extends Xr{async _call(C){return new Wn(await super._call(C))}}class ln extends Xr{async _call(C){return new Ot(await super._call(C))}}class sa extends Xr{async _call(C){return new ss(await super._call(C))}}class Sa extends Y{}class il extends Sa{}class ol extends Sa{async _call(C){return new Wn(await super._call(C))}}class ll extends Sa{async _call(C){return new Ot(await super._call(C))}}class cl extends Sa{async _call(C){return new jn(await super._call(C))}}class dl extends Sa{async _call(C){return new ss(await super._call(C))}}class oi extends Y{}class Xi extends oi{}class ul extends oi{async _call(C){return new Wn(await super._call(C))}}class pl extends oi{async _call(C){return new Ot(await super._call(C))}}class hl extends oi{async _call(C){return new ss(await super._call(C))}}class li extends Y{}class we extends li{}class N extends li{async _call(C){return new Ot(await super._call(C))}}class Z extends li{async _call(C){return new ss(await super._call(C))}}class ie extends li{async _call(C){return new Wn(await super._call(C))}}class fe extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class ye extends fe{}class Ie extends fe{}class Qe extends Y{}class st extends Qe{}class tt extends Qe{}class ot extends Y{}class Et extends ot{}class er extends ot{}class Zt extends Y{}class Ar extends Zt{}class dr extends Zt{}class cn extends Zt{async _call(C){return new Ot(await super._call(C))}}class _n extends Y{}class Pn extends _n{}class Cn extends _n{}class jr extends _n{async _call(C){return new Ot(await super._call(C))}}class Aa extends _n{}class fr extends Y{}class dn extends fr{}class Qn extends fr{}class Ns extends Y{}class Os extends Ns{}class Bn extends Ns{}class Yn extends Y{}class wn extends Yn{}class Ir extends Yn{async _call(C){return new Wn(await super._call(C))}}class tn extends Yn{async _call(C){return new Ot(await super._call(C))}}class rn extends Yn{async _call(C){return new jn(await super._call(C))}}class Un extends Yn{async _call(C){return new ss(await super._call(C))}}class aa extends Y{}class fl extends aa{}class Nh extends aa{async _call(C){return new Wn(await super._call(C))}}class Oh extends aa{async _call(C){return new Ot(await super._call(C))}}class Rh extends aa{async _call(C){return new jn(await super._call(C))}}class hu extends aa{async _call(C){return new ss(await super._call(C))}}class eo extends Y{}class Dh extends eo{}class Fh extends eo{async _call(C){return new Wn(await super._call(C))}}class Lh extends eo{async _call(C){return new Ot(await super._call(C))}}class zh extends eo{async _call(C){return new jn(await super._call(C))}}class Bh extends eo{async _call(C){return new ss(await super._call(C))}}class fu extends Y{}class Uh extends fu{}class Wh extends fu{}class mu extends Y{constructor(){super(...arguments);ce(this,"requires_attention_mask",!1);
3362ce(this,"main_input_name","input_features");ce(this,"forward_params",["input_features","attention_mask","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class Vh extends mu{}class gu extends mu{_prepare_generation_config(C,z){return super._prepare_generation_config(C,z,g.WhisperGenerationConfig)}_retrieve_init_tokens(C){const z=[C.decoder_start_token_id];let he=C.language;const ke=C.task;if(C.is_multilingual){he||(console.warn("No language specified - defaulting to English (en)."),he="en");const Re=`<|${(0,_.whisper_language_to_code)(he)}|>`;z.push(C.lang_to_id[Re]),z.push(C.task_to_id[ke??"transcribe"])}else if(he||ke)throw new Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!C.return_timestamps&&C.no_timestamps_token_id&&z.at(-1)!==C.no_timestamps_token_id?z.push(C.no_timestamps_token_id):C.return_timestamps&&z.at(-1)===C.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),z.pop()),z.filter(be=>be!=null)}async generate({inputs:C=null,generation_config:z=null,logits_processor:he=null,stopping_criteria:ke=null,...be}){z=this._prepare_generation_config(z,be);const Re=be.decoder_input_ids??this._retrieve_init_tokens(z);if(z.return_timestamps&&(he??(he=new p.LogitsProcessorList),he.push(new p.WhisperTimeStampLogitsProcessor(z,Re))),z.begin_suppress_tokens&&(he??(he=new p.LogitsProcessorList),he.push(new p.SuppressTokensAtBeginLogitsProcessor(z.begin_suppress_tokens,Re.length))),z.return_token_timestamps){if(!z.alignment_heads)throw new Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");z.task==="translate"&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),z.output_attentions=!0,z.return_dict_in_generate=!0}const Ge=await super.generate({inputs:C,generation_config:z,logits_processor:he,decoder_input_ids:Re,...be});return z.return_token_timestamps&&(Ge.token_timestamps=this._extract_token_timestamps(Ge,z.alignment_heads,z.num_frames)),Ge}_extract_token_timestamps(C,z,he=null,ke=.02){if(!C.cross_attentions)throw new Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");he==null&&console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let be=this.config.median_filter_width;be===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),be=7);const Re=C.cross_attentions,Ge=Array.from({length:this.config.decoder_layers},(Lt,ft)=>(0,h.cat)(Re.map(qt=>qt[ft]),2)),Ze=(0,h.stack)(z.map(([Lt,ft])=>{if(Lt>=Ge.length)throw new Error(`Layer index ${Lt} is out of bounds for cross attentions (length ${Ge.length}).`);return he?Ge[Lt].slice(null,ft,null,[0,he]):Ge[Lt].slice(null,ft)})).transpose(1,0,2,3),[at,bt]=(0,h.std_mean)(Ze,-2,0,!0),At=Ze.clone();for(let Lt=0;Lt<At.dims[0];++Lt){const ft=At[Lt];for(let qt=0;qt<ft.dims[0];++qt){const _r=ft[qt],$r=at[Lt][qt][0].data,qr=bt[Lt][qt][0].data;for(let Br=0;Br<_r.dims[0];++Br){let un=_r[Br].data;for(let In=0;In<un.length;++In)un[In]=(un[In]-qr[In])/$r[In];un.set((0,m.medianFilter)(un,be))}}}
3362const wt=[(0,h.mean)(At,1)],zt=C.sequences.dims,St=new h.Tensor("float32",new Float32Array(zt[0]*zt[1]),zt);for(let Lt=0;Lt<zt[0];++Lt){const ft=wt[Lt].neg().squeeze_(0),[qt,_r]=(0,m.dynamic_time_warping)(ft.tolist()),$r=Array.from({length:qt.length-1},(un,In)=>qt[In+1]-qt[In]),qr=(0,l.mergeArrays)([1],$r).map(un=>!!un),Br=[];for(let un=0;un<qr.length;++un)qr[un]&&Br.push(_r[un]*ke);St[Lt].data.set(Br,1)}return St}}class yu extends gu{}class wc extends Y{constructor(){super(...arguments);ce(this,"requires_attention_mask",!1);ce(this,"main_input_name","input_values");ce(this,"forward_params",["input_values","decoder_input_ids","past_key_values"])}}class Gh extends wc{}class qh extends wc{}class vu extends Y{constructor(){super(...arguments);ce(this,"main_input_name","pixel_values");ce(this,"forward_params",["pixel_values","decoder_input_ids","encoder_hidden_states","past_key_values"])}}class _u extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","pixel_values","position_ids","past_key_values"])}}class ml extends _u{_merge_input_ids_with_image_features({inputs_embeds:C,image_features:z,input_ids:he,attention_mask:ke}){const be=this.config.image_token_index,Ge=he.tolist().map(wt=>wt.findIndex(zt=>zt==be)),Ze=Ge.every(wt=>wt===-1),at=Ge.every(wt=>wt!==-1);if(!Ze&&!at)throw new Error("Every input should contain either 0 or 1 image token.");if(Ze)return{inputs_embeds:C,attention_mask:ke};const bt=[],At=[];for(let wt=0;wt<Ge.length;++wt){const zt=Ge[wt],St=C[wt],Lt=z[wt],ft=ke[wt];bt.push((0,h.cat)([St.slice([0,zt]),Lt,St.slice([zt+1,St.dims[0]])],0)),At.push((0,h.cat)([ft.slice([0,zt]),(0,h.ones)([Lt.dims[0]]),ft.slice([zt+1,ft.dims[0]])],0))}return{inputs_embeds:(0,h.stack)(bt,0),attention_mask:(0,h.stack)(At,0)}}}class to extends ml{}class Hh extends ml{}class wu extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","inputs_embeds","attention_mask","pixel_values","encoder_outputs","decoder_input_ids","decoder_inputs_embeds","decoder_attention_mask","past_key_values"]);ce(this,"main_input_name","inputs_embeds")}}class Kh extends wu{_merge_input_ids_with_image_features({inputs_embeds:C,image_features:z,input_ids:he,attention_mask:ke}){return{inputs_embeds:(0,h.cat)([z,C],1),attention_mask:(0,h.cat)([(0,h.ones)(z.dims.slice(0,2)),ke],1)}}async _prepare_inputs_embeds({input_ids:C,pixel_values:z,inputs_embeds:he,attention_mask:ke}){if(!C&&!z)throw new Error("Either `input_ids` or `pixel_values` should be provided.");let be,Re;return C&&(be=await this.encode_text({input_ids:C})),z&&(Re=await this.encode_image({pixel_values:z})),be&&Re?{inputs_embeds:he,attention_mask:ke}=this._merge_input_ids_with_image_features({inputs_embeds:be,image_features:Re,input_ids:C,attention_mask:ke}):he=be||Re,{inputs_embeds:he,attention_mask:ke}}async forward({input_ids:C,pixel_values:z,attention_mask:he,decoder_input_ids:ke,decoder_attention_mask:be,encoder_outputs:Re,past_key_values:Ge,inputs_embeds:Ze,decoder_inputs_embeds:at}){if(Ze||({inputs_embeds:Ze,attention_mask:he}=await this._prepare_inputs_embeds({input_ids:C,pixel_values:z,inputs_embeds:Ze,attention_mask:he})),!Re){let{last_hidden_state:wt}=await V(this,{inputs_embeds:Ze,attention_mask:he});Re=wt}if(!at){if(!ke)throw new Error("Either `decoder_input_ids` or `decoder_inputs_embeds` should be provided.");at=await this.encode_text({input_ids:ke})}return await ne(this,{inputs_embeds:at,attention_mask:be,encoder_attention_mask:he,encoder_hidden_states:Re,past_key_values:Ge},!0)}}class Qh extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","pixel_values","position_ids","past_key_values"])}}class Yh extends Qh{_merge_input_ids_with_image_features(C){const z=C.image_features.dims.at(-1),he=C.image_features.view(-1,z);return $({image_token_id:this.config.image_token_index,...C,image_features:he})}}class xc extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","pixel_values","pixel_attention_mask","position_ids","past_key_values"])}}class gl extends xc{async encode_image({pixel_values:C,pixel_attention_mask:z}){return(await R(this.sessions.vision_encoder,{pixel_values:C,pixel_attention_mask:z})).image_features}_merge_input_ids_with_image_features(C){const z=C.image_features.dims.at(-1),he=C.image_features.view(-1,z);return $({image_token_id:this.config.image_token_id,...C,image_features:he})}}class xu extends gl{}class Jh extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","inputs_embeds","attention_mask","position_ids","pixel_values","image_sizes","past_key_values"])}}class bu extends Jh{async forward({input_ids:C=null,attention_mask:z=null,pixel_values:he=null,image_sizes:ke=null,position_ids:be=null,inputs_embeds:Re=null,past_key_values:Ge=null,generation_config:Ze=null,logits_processor:at=null,...bt}){if(!Re){let wt;if(he&&C.dims[1]!==1){if(!ke)throw new Error("`image_sizes` must be provided when `pixel_values` is provided.");({image_features:wt}=await R(this.sessions.vision_encoder,{pixel_values:he,image_sizes:ke}))}
vendor: 4,085 bytes, line 3362
3362else{const zt=this.config.normalized_config.hidden_size;wt=new h.Tensor("float32",[],[0,zt])}({inputs_embeds:Re}=await R(this.sessions.prepare_inputs_embeds,{input_ids:C,image_features:wt}))}return await ne(this,{inputs_embeds:Re,past_key_values:Ge,attention_mask:z,position_ids:be,generation_config:Ze,logits_processor:at},!1)}}class Si extends Y{}class Zh extends Si{}class zy extends Si{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"text_model"})}}class Xh extends Si{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"text_model"})}}class By extends Si{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"vision_model"})}}class ef extends Si{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"vision_model"})}}class ro extends Y{}class no extends ro{}class ku extends ro{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"text_model"})}}class tf extends Si{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"vision_model"})}}class rf extends Y{}class bc extends rf{}class so extends Y{}class Tu extends so{async forward(C){const z=!C.input_ids,he=!C.pixel_values;if(z&&he)throw new Error("Either `input_ids` or `pixel_values` should be provided.");if(z&&(C.input_ids=(0,h.ones)([C.pixel_values.dims[0],1])),he){const{image_size:at}=this.config.vision_config;C.pixel_values=(0,h.full)([0,3,at,at],0)}const{text_embeddings:ke,image_embeddings:be,l2norm_text_embeddings:Re,l2norm_image_embeddings:Ge}=await super.forward(C),Ze={};return z||(Ze.text_embeddings=ke,Ze.l2norm_text_embeddings=Re),he||(Ze.image_embeddings=be,Ze.l2norm_image_embeddings=Ge),Ze}}class Mu extends so{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"text_model"})}}class Eu extends so{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"vision_model"})}}class kc extends Y{}class Su extends kc{}class Au extends kc{}class Pu extends Y{}class Cu extends Pu{}class ju extends Pu{}class ao extends Y{}class _t extends ao{}class nf extends ao{}class Tc extends Y{}class Iu extends Tc{}class yl extends Tc{}class Ts extends Y{}class vl extends Ts{}class Mc extends Ts{}class Ec extends Y{}class $u extends Ec{}class Nu extends Ec{}class _l extends Y{}class Ou extends _l{}class Ru extends _l{}class Sc extends Y{}class wl extends Sc{}class Ac extends Sc{}class xl extends Y{}class Du extends xl{}class Fu extends xl{}class Pc extends Y{}class Lu extends Pc{}class zu extends Pc{}class Cc extends Y{}class T extends Cc{}class P extends Cc{}class O extends Y{}class W extends O{}class X extends O{}class ge extends Y{}class $e extends ge{}class qe extends ge{}class nt extends Y{}class ct extends nt{}class $t extends nt{}class Ht extends Y{}class ur extends Ht{}class xn extends Ht{}class ci extends Y{}class sf extends ci{}class yk extends ci{}class Uy extends Y{}class vk extends Uy{}class _k extends Uy{}class Wy extends Y{}class wk extends Wy{}class xk extends Wy{}class Vy extends Y{}class bk extends Vy{}class kk extends Vy{}class Gy extends Y{}class Tk extends Gy{}class Mk extends Gy{}class qy extends Y{}class Ek extends qy{}class Sk extends qy{}class Hy extends Y{}class Ak extends Hy{}class Pk extends Hy{}class Ky extends Y{}class Ck extends Ky{}class jk extends Ky{}class Ik extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","position_ids","past_key_values","pixel_values","image_grid_thw"])}}class $k extends Ik{get_rope_index(C,z,he,ke){const{vision_config:be,image_token_id:Re,video_token_id:Ge,vision_start_token_id:Ze}=this.config,at=be.spatial_merge_size??2,bt=[];if(z||he){let At=C.tolist();ke||(ke=(0,h.ones_like)(C));const wt=ke.tolist(),zt=Array.from({length:3},_r=>
3362Array.from({length:C.dims[0]},$r=>Array.from({length:C.dims[1]},qr=>1))),St=z?z.tolist():[],Lt=he?he.tolist():[];let ft=0,qt=0;for(let _r=0;_r<At.length;++_r){const $r=At[_r].filter((Nr,kn)=>wt[_r][kn]==1),Br=$r.reduce((Nr,kn,oo)=>(kn==Ze&&Nr.push(oo),Nr),[]).map(Nr=>$r[Nr+1]),un=Br.filter(Nr=>Nr==Re).length,In=Br.filter(Nr=>Nr==Ge).length;let Bt=[],bn=0,Rs=un,kl=In;for(let Nr=0;Nr<Br.length;++Nr){const kn=$r.findIndex((El,Pa)=>Pa>bn&&El==Re),oo=$r.findIndex((El,Pa)=>Pa>bn&&El==Ge),Ml=Rs>0&&kn!==-1?kn:$r.length+1,$c=kl>0&&oo!==-1?oo:$r.length+1;let Tf,Hv,Kv,Qv;Ml<$c?([Hv,Kv,Qv]=St[ft],++ft,--Rs,Tf=Ml):([Hv,Kv,Qv]=Lt[qt],++qt,--kl,Tf=$c);const[D5,Yv,Mf]=[Number(Hv),Math.floor(Number(Kv)/at),Math.floor(Number(Qv)/at)],Jv=Tf-bn,fS=Bt.length>0?(0,m.max)(Bt.at(-1))[0]+1:0;Bt.push(Array.from({length:3*Jv},(El,Pa)=>fS+Pa%Jv));const Zv=Jv+fS,Ef=D5*Yv*Mf,F5=Array.from({length:Ef},(El,Pa)=>Zv+Math.floor(Pa/(Yv*Mf))),L5=Array.from({length:Ef},(El,Pa)=>Zv+Math.floor(Pa/Mf)%Yv),z5=Array.from({length:Ef},(El,Pa)=>Zv+Pa%Mf);Bt.push([F5,L5,z5].flat()),bn=Tf+Ef}if(bn<$r.length){const Nr=Bt.length>0?(0,m.max)(Bt.at(-1))[0]+1:0,kn=$r.length-bn;Bt.push(Array.from({length:3*kn},(oo,Ml)=>Nr+Ml%kn))}const hs=Bt.reduce((Nr,kn)=>Nr+kn.length,0),ia=new Array(hs);let xf=0;for(let Nr=0;Nr<3;++Nr)for(let kn=0;kn<Bt.length;++kn){const oo=Bt[kn],Ml=oo.length/3;for(let $c=Nr*Ml;$c<(Nr+1)*Ml;++$c)ia[xf++]=oo[$c]}let Tl=0;const bf=wt[_r];for(let Nr=0;Nr<bf.length;++Nr)if(bf[Nr]==1){for(let kn=0;kn<3;++kn)zt[kn][_r][Nr]=ia[kn*hs/3+Tl];++Tl}const kf=(0,m.max)(ia)[0];bt.push(kf+1-At[_r].length)}return[new h.Tensor("int64",zt.flat(1/0),[3,C.dims[0],C.dims[1]]),new h.Tensor("int64",bt,[bt.length,1])]}else if(ke){const{data:At,dims:wt}=Ee(ke),zt=BigInt64Array.from({length:3*At.length},(Lt,ft)=>At[ft%At.length]),St=Array.from({length:wt[0]},(Lt,ft)=>(0,m.max)(At.subarray(wt[1]*ft,wt[1]*(ft+1)))[0]+1n+BigInt(wt[1]));return[new h.Tensor("int64",zt,[3,...wt]),new h.Tensor("int64",St,[St.length,1])]}else{const[At,wt]=C.dims,zt=BigInt64Array.from({length:3*At*wt},(St,Lt)=>BigInt(Math.floor(Lt%wt/At)));return[new h.Tensor("int64",zt,[3,...C.dims]),(0,h.zeros)([At,1])]}}async encode_image({pixel_values:C,image_grid_thw:z}){return(await R(this.sessions.vision_encoder,{pixel_values:C,grid_thw:z})).image_features}_merge_input_ids_with_image_features(C){return $({image_token_id:this.config.image_token_id,...C})}prepare_inputs_for_generation(C,z,he){if(z.attention_mask&&!z.position_ids)if(!z.past_key_values)[z.position_ids,z.rope_deltas]=this.get_rope_index(z.input_ids,z.image_grid_thw,z.video_grid_thw,z.attention_mask);else{z.pixel_values=null;const ke=BigInt(Object.values(z.past_key_values)[0].dims.at(-2)),be=z.rope_deltas.map(Re=>ke+Re);z.position_ids=(0,h.stack)([be,be,be],0)}return z}}class Qy extends Y{}class Nk extends Qy{}class Ok extends Qy{}class Yy extends Y{}class Rk extends Yy{}class Dk extends Yy{}class Jy extends Y{}class Fk extends Jy{}class Lk extends Jy{}class Zy extends Y{}class zk extends Zy{}class Bk extends Zy{}class Xy extends Y{}class Uk extends Xy{}class Wk extends Xy{}class ev extends Y{}class Vk extends ev{}class Gk extends ev{async _call(C){return new Ot(await super._call(C))}}class tv extends Y{}class qk extends tv{}class Hk extends tv{async _call(C){return new Ot(await super._call(C))}}class Kk extends Y{}class Qk extends Kk{}class rv extends Y{}class Yk extends rv{}class Jk extends rv{async _call(C){return new Ot(await super._call(C))}}class Zk extends Y{}class Xk extends Zk{}class nv extends Y{}class e2 extends nv{}class t2 extends nv{async _call(C){return new Ot(await super._call(C))}}class r2 extends Y{}class n2 extends r2{}class sv extends Y{}class s2 extends sv{}class a2 extends sv{async _call(C){return new Ot(await super._call(C))}}class i2 extends Y{}class o2 extends i2{async _call(C){return new pS(await super._call(C))}}class av extends Y{}class l2 extends av{}class c2 extends av{async _call(C){return new Ot(await super._call(C))}}class iv extends Y{}class d2 extends iv{}class u2 extends iv{async _call(C){return new Ot(await super._call(C))}}class ov extends Y{}class p2 extends ov{}class h2 extends ov{}class lv extends Y{}class f2 extends lv{}class m2 extends lv{}class cv extends Y{}class g2 extends cv{}class y2 extends cv{async _call(C){return new Ot(await super._call(C))}}class af extends Y{}class v2 extends af{}class _2 extends af{async _call(C){return new uv(await super._call(C))}}class dv extends af{async _call(C){return new w2(await super._call(C))}}class uv extends Se{constructor({logits:C,pred_boxes:z}){super(),this.logits=C,this.pred_boxes=z}}class w2 extends Se{constructor({logits:C,pred_boxes:z,pred_masks:he}){super(),this.logits=C,this.pred_boxes=z,this.pred_masks=he}}class pv extends Y{}class x2 extends pv{}class b2 extends pv{async _call(C){return new Bu(await super._call(C))}}class Bu extends Se{constructor({logits:C,pred_boxes:z}){super(),this.logits=C,this.pred_boxes=z}}class hv extends Y{}class k2 extends hv{}class T2 extends hv{async _call(C){return new M2(await super._call(C))}}class M2 extends Bu{}class fv extends Y{}class E2 extends fv{}class S2 extends fv{async _call(C){return new A2(await super._call(C))}}class A2 extends Bu{}class mv extends Y{}class P2 extends mv{}class C2 extends mv{async _call(C){return new Bu(await super._call(C))}}class gv extends Y{}class j2 extends gv{}class I2 extends gv{async _call(C){return new $2(await super._call(C))}}class $2 extends uv{}class yv extends Y{}class N2 extends yv{}class O2 extends yv{async _call(C){return new Ot(await super._call(C))}}class vv extends Y{}class R2 extends vv{}class D2 extends vv{async _call(C){return new Ot(await super._call(C))}}class _v extends Y{}class F2 extends _v{}class L2 extends _v{async _call(C){return new Ot(await super._call(C))}}class of extends Y{}class z2 extends of{}class B2 extends of{async _call(C){return new Ot(await super._call(C))}}class U2 extends of{}class wv extends Y{}class W2 extends wv{}class V2 extends wv{}class xv extends Y{}class G2 extends xv{}class q2 extends xv{}class H2 extends Y{}class K2 extends H2{}class lf extends Y{}class Q2 extends lf{}class Y2 extends lf{}class J2 extends lf{}class Z2 extends Y{}class X2 extends Z2{}class eT extends Y{}class tT extends eT{}class rT extends Y{}class nT extends rT{}class bv extends Y{}class sT extends bv{}class aT extends bv{}class kv extends Y{}class iT extends kv{}class oT extends kv{}class lT extends Y{}class cT extends lT{}class Tv extends Y{}class dT extends Tv{}class uT extends Tv{async _call(C){return new Ot(await super._call(C))}}class Mv extends Y{}class pT extends Mv{}class hT extends Mv{async _call(C){return new Ot(await super._call(C))}}class Ev extends Y{}
vendor: 14,202 bytes, line 3362
3362class fT extends Ev{}class mT extends Ev{async _call(C){return new Ot(await super._call(C))}}class Sv extends Y{}class gT extends Sv{}class yT extends Sv{async _call(C){return new Ot(await super._call(C))}}class vT extends Y{}class _T extends vT{}class Av extends Y{}class wT extends Av{}class xT extends Av{async _call(C){return new bT(await super._call(C))}}class bT extends Se{constructor({logits:C,pred_boxes:z}){super(),this.logits=C,this.pred_boxes=z}}class kT extends Y{}class TT extends kT{async get_image_embeddings({pixel_values:C}){return await V(this,{pixel_values:C})}async forward(C){if((!C.image_embeddings||!C.image_positional_embeddings)&&(C={...C,...await this.get_image_embeddings(C)}),!C.input_labels&&C.input_points){const he=C.input_points.dims.slice(0,-1),ke=he.reduce((be,Re)=>be*Re,1);C.input_labels=new h.Tensor("int64",new BigInt64Array(ke).fill(1n),he)}const z={image_embeddings:C.image_embeddings,image_positional_embeddings:C.image_positional_embeddings};return C.input_points&&(z.input_points=C.input_points),C.input_labels&&(z.input_labels=C.input_labels),C.input_boxes&&(z.input_boxes=C.input_boxes),await R(this.sessions.prompt_encoder_mask_decoder,z)}async _call(C){return new MT(await super._call(C))}}class MT extends Se{constructor({iou_scores:C,pred_masks:z}){super(),this.iou_scores=C,this.pred_masks=z}}class Pv extends Y{}class ET extends Pv{}class ST extends Pv{}class Cv extends Y{}class AT extends Cv{}class PT extends Cv{}class io extends Y{}class CT extends io{}class jT extends io{async _call(C){return new bl(await super._call(C))}}class IT extends io{async _call(C){return new Ot(await super._call(C))}}class $T extends io{async _call(C){return new jn(await super._call(C))}}class jv extends Y{}class NT extends jv{}class OT extends jv{async _call(C){return new jn(await super._call(C))}}class RT extends Y{}class DT extends RT{}class cf extends Y{}class FT extends cf{}class LT extends cf{async _call(C){return new bl(await super._call(C))}}class zT extends cf{async _call(C){return new Ot(await super._call(C))}}class Uu extends Y{}class BT extends Uu{}class UT extends Uu{async _call(C){return new bl(await super._call(C))}}class WT extends Uu{async _call(C){return new Ot(await super._call(C))}}class VT extends Uu{async _call(C){return new jn(await super._call(C))}}class df extends Y{}class GT extends df{}class qT extends df{async _call(C){return new bl(await super._call(C))}}class HT extends df{async _call(C){return new Ot(await super._call(C))}}class b5 extends Y{}class KT extends io{}class QT extends io{async _call(C){return new bl(await super._call(C))}}class YT extends io{async _call(C){return new Ot(await super._call(C))}}class jc extends Y{}class JT extends jc{}class ZT extends jc{async _call(C){return new bl(await super._call(C))}}class XT extends jc{async _call(C){return new Ot(await super._call(C))}}class eM extends jc{async _call(C){return new uS(await super._call(C))}}class tM extends jc{async _call(C){return new jn(await super._call(C))}}class rM extends Y{}class nM extends rM{}class uf extends Y{}class k5 extends uf{}class sM extends uf{}class aM extends uf{async generate_speech(C,z,{threshold:he=.5,minlenratio:ke=0,maxlenratio:be=20,vocoder:Re=null}={}){const Ge={input_ids:C},{encoder_outputs:Ze,encoder_attention_mask:at}=await V(this,Ge),bt=Ze.dims[1]/this.config.reduction_factor,At=Math.floor(bt*be),wt=Math.floor(bt*ke),zt=this.config.num_mel_bins;let St=[],Lt=null,ft=null,qt=0;for(;;){++qt;const qr=ee(!!ft);let Br;ft?Br=ft.output_sequence_out:Br=new h.Tensor("float32",new Float32Array(zt),[1,1,zt]);let un={use_cache_branch:qr,output_sequence:Br,encoder_attention_mask:at,speaker_embeddings:z,encoder_hidden_states:Ze};this.addPastKeyValues(un,Lt),ft=await R(this.sessions.decoder_model_merged,un),Lt=this.getPastKeyValues(ft,Lt);const{prob:In,spectrum:Bt}=ft;if(St.push(Bt),qt>=wt&&(Array.from(In.data).filter(bn=>bn>=he).length>0||qt>=At))break}const _r=(0,h.cat)(St),{waveform:$r}=await R(Re.sessions.model,{spectrogram:_r});return{spectrogram:_r,waveform:$r}}}class iM extends Y{constructor(){super(...arguments);ce(this,"main_input_name","spectrogram")}}class oM extends Y{}class lM extends oM{}class Iv extends Y{}class cM extends Iv{}class dM extends Iv{}class $v extends Y{}class uM extends $v{}class pM extends $v{}class Nv extends Y{}class hM extends Nv{}class fM extends Nv{}class pf extends Y{}class mM extends pf{}class gM extends pf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"text_model"})}}class yM extends pf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"audio_model"})}}class vM extends Y{}class Ov extends vM{async _call(C){return new hS(await super._call(C))}}class hf extends Y{}class T5 extends hf{}class _M extends hf{}class wM extends hf{}class Rv extends Y{}class xM extends Rv{}class bM extends Rv{}class Dv extends Y{}class kM extends Dv{}class TM extends Dv{async _call(C){return new Ot(await super._call(C))}}class Fv extends Y{}class M5 extends Fv{}class E5 extends Fv{}class Lv extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}_apply_and_filter_by_delay_pattern_mask(z){const[he,ke]=z.dims,be=this.config.decoder.num_codebooks,Re=ke-be;let Ge=0;for(let bt=0;bt<z.size;++bt){if(z.data[bt]===this.config.decoder.pad_token_id)continue;const At=bt%ke,wt=Math.floor(bt/ke)%be,zt=At-wt;zt>0&&zt<=Re&&(z.data[Ge++]=z.data[bt])}const Ze=Math.floor(he/be),at=Ge/(Ze*be);return new h.Tensor(z.type,z.data.slice(0,Ge),[Ze,be,at])}prepare_inputs_for_generation(z,he,ke){let be=structuredClone(z);for(let Ge=0;Ge<be.length;++Ge)for(let Ze=0;Ze<be[Ge].length;++Ze)Ge%this.config.decoder.num_codebooks>=Ze&&(be[Ge][Ze]=BigInt(this.config.decoder.pad_token_id));return ke.guidance_scale!==null&&ke.guidance_scale>1&&(be=be.concat(be)),super.prepare_inputs_for_generation(be,he,ke)}async generate(z){const he=await super.generate(z),ke=this._apply_and_filter_by_delay_pattern_mask(he).unsqueeze_(0),{audio_values:be}=await R(this.sessions.encodec_decode,{audio_codes:ke});return be}}class ff extends Y{}class MM extends ff{}class EM extends ff{async _call(C){return new Ot(await super._call(C))}}class SM extends ff{}class mf extends Y{}class AM extends mf{}class PM extends mf{async _call(C){return new Ot(await super._call(C))}}class CM extends mf{}class gf extends Y{}class jM extends gf{}class IM extends gf{async _call(C){return new Ot(await super._call(C))}}class $M extends gf{}class yf extends Y{}class NM extends yf{}class OM extends yf{async _call(C){return new Ot(await super._call(C))}}class RM extends yf{}class DM extends Y{}class FM extends DM{}class LM extends Y{}class zM extends LM{constructor(...z){super(...z);ce(this,"forward_params",["input_ids","pixel_values","images_seq_mask","images_emb_mask","attention_mask","position_ids","past_key_values"]);this._generation_mode="text"}async forward(z){const he=this._generation_mode??"text";let ke;if(he==="text"||!z.past_key_values){const at=this.sessions.prepare_inputs_embeds,bt=(0,l.pick)(z,at.inputNames);ke=await R(at,bt)}else{const at=this.sessions.gen_img_embeds,bt=(0,l.pick)({image_ids:z.input_ids},at.inputNames);ke=await R(at,bt)}const be={...z,...ke},Re=await ne(this,be),Ge=this.sessions[he==="text"?"lm_head":"gen_head"];if(!Ge)throw new Error(`Unable to find "${Ge}" generation head`);const Ze=await R(Ge,(0,l.pick)(Re,Ge.inputNames));return{...ke,...Re,...Ze}}async generate(z){return this._generation_mode="text",super.generate(z)}async generate_images(z){this._generation_mode="image";const he=(z.inputs??z[this.main_input_name]).dims[1],be=(await super.generate(z)).slice(null,[he,null]),Re=this.sessions.image_decode,{decoded_image:Ge}=await R(Re,{generated_tokens:be}),Ze=Ge.add_(1).mul_(255/2).clamp_(0,255).to("uint8"),at=[];for(const bt of Ze){const At=f.RawImage.fromTensor(bt);at.push(At)}return at}}class BM extends Se{constructor({char_logits:C,bpe_logits:z,wp_logits:he}){super(),this.char_logits=C,this.bpe_logits=z,this.wp_logits=he}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class UM extends Y{}class WM extends UM{async _call(C){return new BM(await super._call(C))}}class zv extends Y{}class VM extends zv{}class GM extends zv{}class Bv extends Y{}class qM extends Bv{}class HM extends Bv{}class KM extends Y{constructor(){super(...arguments);ce(this,"forward_params",["input_ids","attention_mask","position_ids","audio_values","past_key_values"])}}class QM extends KM{_merge_input_ids_with_audio_features(C){const z=C.audio_features.dims.at(-1),he=C.audio_features.view(-1,z);return G({audio_token_id:this.config.ignore_index,...C,audio_features:he})}}class vf extends Y{constructor(){super(...arguments);ce(this,"main_input_name","input_values");ce(this,"forward_params",["input_values"])}}class YM extends Se{constructor({audio_codes:C}){super(),this.audio_codes=C}}class JM extends Se{constructor({audio_values:C}){super(),this.audio_values=C}}class ZM extends vf{async encode(C){return new YM(await R(this.sessions.encoder_model,C))}async decode(C){return new JM(await R(this.sessions.decoder_model,C))}}class XM extends vf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"encoder_model"})}}class eE extends vf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"decoder_model"})}}class _f extends Y{constructor(){super(...arguments);ce(this,"main_input_name","input_values");ce(this,"forward_params",["input_values"])}}class tE extends Se{constructor({audio_codes:C}){super(),this.audio_codes=C}}class rE extends Se{constructor({audio_values:C}){super(),this.audio_values=C}}class nE extends _f{async encode(C){return new tE(await R(this.sessions.encoder_model,C))}async decode(C){return new rE(await R(this.sessions.decoder_model,C))}}class sE extends _f{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"encoder_model"})}}class aE extends _f{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"decoder_model"})}}class wf extends Y{constructor(){super(...arguments);ce(this,"main_input_name","input_values");ce(this,"forward_params",["input_values"])}}class iE extends wf{async encode(C){return await R(this.sessions.encoder_model,C)}async decode(C){return await R(this.sessions.decoder_model,C)}}class oE extends wf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"encoder_model"})}}class lE extends wf{static async from_pretrained(C,z={}){return super.from_pretrained(C,{...z,model_file_name:z.model_file_name??"decoder_model"})}}class nr{static async from_pretrained(C,{progress_callback:z=null,config:he=null,cache_dir:ke=null,local_files_only:be=!1,revision:Re="main",model_file_name:Ge=null,subfolder:Ze="onnx",device:at=null,dtype:bt=null,use_external_data_format:At=null,session_options:wt={}}={}){const zt={progress_callback:z,config:he,cache_dir:ke,local_files_only:be,revision:Re,model_file_name:Ge,subfolder:Ze,device:at,dtype:bt,use_external_data_format:At,session_options:wt};if(zt.config=await n.AutoConfig.from_pretrained(C,zt),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);const St=zt.config.model_type;for(const Lt of this.MODEL_CLASS_MAPPINGS){let ft=Lt.get(St);if(!ft){for(const qt of Lt.values())if(qt[0]===St){ft=qt;break}if(!ft)continue}return await ft[1].from_pretrained(C,zt)}if(this.BASE_IF_FAIL)return NE.has(St)||console.warn(`Unknown model class "${St}", attempting to construct from base class.`),await Y.from_pretrained(C,zt);throw Error(`Unsupported model type: ${St}`)}}ce(nr,"MODEL_CLASS_MAPPINGS",null),ce(nr,"BASE_IF_FAIL",!1);const S5=new Map([["bert",["BertModel",Ne]],["modernbert",["ModernBertModel",me]],["nomic_bert",["NomicBertModel",Ye]],["roformer",["RoFormerModel",lt]],["electra",["ElectraModel",xe]],["esm",["EsmModel",gt]],["convbert",["ConvBertModel",Tt]],["camembert",["CamembertModel",yt]],["deberta",["DebertaModel",Kn]],["deberta-v2",["DebertaV2Model",ni]],["mpnet",["MPNetModel",il]],["albert",["AlbertModel",we]],["distilbert",["DistilBertModel",ii]],["roberta",["RobertaModel",wn]],["xlm",["XLMModel",fl]],["xlm-roberta",["XLMRobertaModel",Dh]],["clap",["ClapModel",mM]],["clip",["CLIPModel",Zh]],["clipseg",["CLIPSegModel",Su]],["chinese_clip",["ChineseCLIPModel",bc]],["siglip",["SiglipModel",no]],["jina_clip",["JinaCLIPModel",Tu]],["mobilebert",["MobileBertModel",na]],["squeezebert",["SqueezeBertModel",Xi]],["wav2vec2",["Wav2Vec2Model",CT]],["wav2vec2-bert",["Wav2Vec2BertModel",GT]],["unispeech",["UniSpeechModel",FT]],["unispeech-sat",["UniSpeechSatModel",BT]],["hubert",["HubertModel",KT]],["wavlm",["WavLMModel",JT]],["audio-spectrogram-transformer",["ASTModel",Uh]],["vits",["VitsModel",Ov]],["pyannote",["PyAnnoteModel",NT]],["wespeaker-resnet",["WeSpeakerResNetModel",DT]],["detr",["DetrModel",v2]],["rt_detr",["RTDetrModel",x2]],["rt_detr_v2",["RTDetrV2Model",k2]],["rf_detr",["RFDetrModel",E2]],["d_fine",["DFineModel",P2]],["table-transformer",["TableTransformerModel",j2]],["vit",["ViTModel",Vk]],["ijepa",["IJepaModel",qk]],["pvt",["PvtModel",Yk]],["vit_msn",["ViTMSNModel",e2]],["vit_mae",["ViTMAEModel",Xk]],["groupvit",["GroupViTModel",n2]],["fastvit",["FastViTModel",s2]],["mobilevit",["MobileViTModel",l2]],["mobilevitv2",["MobileViTV2Model",d2]],["owlvit",["OwlViTModel",p2]],["owlv2",["Owlv2Model",f2]],["beit",["BeitModel",g2]],["deit",["DeiTModel",N2]],["hiera",["HieraModel",R2]],["convnext",["ConvNextModel",dT]],["convnextv2",["ConvNextV2Model",pT]],["dinov2",["Dinov2Model",fT]],["dinov2_with_registers",["Dinov2WithRegistersModel",gT]],["resnet",["ResNetModel",F2]],["swin",["SwinModel",z2]],["swin2sr",["Swin2SRModel",W2]],["donut-swin",["DonutSwinModel",cT]],["yolos",["YolosModel",wT]],["dpt",["DPTModel",G2]],["glpn",["GLPN
3362Model",iT]],["hifigan",["SpeechT5HifiGan",iM]],["efficientnet",["EfficientNetModel",kM]],["decision_transformer",["DecisionTransformerModel",FM]],["patchtst",["PatchTSTForPrediction",VM]],["patchtsmixer",["PatchTSMixerForPrediction",qM]],["mobilenet_v1",["MobileNetV1Model",MM]],["mobilenet_v2",["MobileNetV2Model",AM]],["mobilenet_v3",["MobileNetV3Model",jM]],["mobilenet_v4",["MobileNetV4Model",NM]],["maskformer",["MaskFormerModel",sT]],["mgp-str",["MgpstrForSceneTextRecognition",WM]],["style_text_to_speech_2",["StyleTextToSpeech2Model",nM]]]),A5=new Map([["t5",["T5Model",ye]],["longt5",["LongT5Model",st]],["mt5",["MT5Model",Et]],["bart",["BartModel",Ar]],["mbart",["MBartModel",Pn]],["marian",["MarianModel",ET]],["whisper",["WhisperModel",Vh]],["m2m_100",["M2M100Model",AT]],["blenderbot",["BlenderbotModel",dn]],["blenderbot-small",["BlenderbotSmallModel",Os]]]),P5=new Map([["mimi",["MimiModel",ZM]],["dac",["DacModel",nE]],["snac",["SnacModel",iE]]]),C5=new Map([["bloom",["BloomModel",Fk]],["jais",["JAISModel",_t]],["gpt2",["GPT2Model",Cu]],["gptj",["GPTJModel",$u]],["gpt_bigcode",["GPTBigCodeModel",Ou]],["gpt_neo",["GPTNeoModel",Iu]],["gpt_neox",["GPTNeoXModel",vl]],["codegen",["CodeGenModel",wl]],["llama",["LlamaModel",Du]],["exaone",["ExaoneModel",W]],["olmo",["OlmoModel",ct]],["olmo2",["Olmo2Model",ur]],["mobilellm",["MobileLLMModel",$e]],["granite",["GraniteModel",sf]],["cohere",["CohereModel",vk]],["gemma",["GemmaModel",wk]],["gemma2",["Gemma2Model",bk]],["gemma3_text",["Gemma3Model",Tk]],["helium",["HeliumModel",Lu]],["glm",["GlmModel",T]],["openelm",["OpenELMModel",Ek]],["qwen2",["Qwen2Model",Ak]],["qwen3",["Qwen3Model",Ck]],["phi",["PhiModel",Nk]],["phi3",["Phi3Model",Rk]],["mpt",["MptModel",zk]],["opt",["OPTModel",Uk]],["mistral",["MistralModel",cM]],["starcoder2",["Starcoder2Model",uM]],["falcon",["FalconModel",hM]],["stablelm",["StableLmModel",xM]]]),Uv=new Map([["speecht5",["SpeechT5ForSpeechToText",sM]],["whisper",["WhisperForConditionalGeneration",gu]],["lite-whisper",["LiteWhisperForConditionalGeneration",yu]],["moonshine",["MoonshineForConditionalGeneration",qh]]]),cE=new Map([["speecht5",["SpeechT5ForTextToSpeech",aM]]]),dE=new Map([["vits",["VitsModel",Ov]],["musicgen",["MusicgenForConditionalGeneration",Lv]]]),uE=new Map([["bert",["BertForSequenceClassification",re]],["modernbert",["ModernBertForSequenceClassification",Be]],["roformer",["RoFormerForSequenceClassification",Qt]],["electra",["ElectraForSequenceClassification",je]],["esm",["EsmForSequenceClassification",ta]],["convbert",["ConvBertForSequenceClassification",F]],["camembert",["CamembertForSequenceClassification",ar]],["deberta",["DebertaForSequenceClassification",Ta]],["deberta-v2",["DebertaV2ForSequenceClassification",Ma]],["mpnet",["MPNetForSequenceClassification",ll]],["albert",["AlbertForSequenceClassification",N]],["distilbert",["DistilBertForSequenceClassification",An]],["roberta",["RobertaForSequenceClassification",tn]],["xlm",["XLMForSequenceClassification",Oh]],["xlm-roberta",["XLMRobertaForSequenceClassification",Lh]],["bart",["BartForSequenceClassification",cn]],["mbart",["MBartForSequenceClassification",jr]],["mobilebert",["MobileBertForSequenceClassification",ln]],["squeezebert",["SqueezeBertForSequenceClassification",pl]]]),pE=new Map([["bert",["BertForTokenClassification",pe]],["modernbert",["ModernBertForTokenClassification",rt]],["roformer",["RoFormerForTokenClassification",Gt]],["electra",["ElectraForTokenClassification",Nt]],["esm",["EsmForTokenClassification",ra]],["convbert",["ConvBertForTokenClassification",le]],["camembert",["CamembertForTokenClassification",vr]],["deberta",["DebertaForTokenClassification",ea]],["deberta-v2",["DebertaV2ForTokenClassification",si]],["mpnet",["MPNetForTokenClassification",cl]],["distilbert",["DistilBertForTokenClassification",Ea]],["roberta",["RobertaForTokenClassification",rn]],["xlm",["XLMForTokenClassification",Rh]],["xlm-roberta",["XLMRobertaForTokenClassification",zh]]]),Wv=new Map([["t5",["T5ForConditionalGeneration",Ie]],["longt5",["LongT5ForConditionalGeneration",tt]],["mt5",["MT5ForConditionalGeneration",er]],["bart",["BartForConditionalGeneration",dr]],["mbart",["MBartForConditionalGeneration",Cn]],["marian",["MarianMTModel",ST]],["m2m_100",["M2M100ForConditionalGeneration",PT]],["blenderbot",["BlenderbotForConditionalGeneration",Qn]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",Bn]]]),Vv=new Map([["bloom",["BloomForCausalLM",Lk]],["gpt2",["GPT2LMHeadModel",ju]],["jais",["JAISLMHeadModel",nf]],["gptj",["GPTJForCausalLM",Nu]],["gpt_bigcode",["GPTBigCodeForCausalLM",Ru]],["gpt_neo",["GPTNeoForCausalLM",yl]],["gpt_neox",["GPTNeoXFor
3362CausalLM",Mc]],["codegen",["CodeGenForCausalLM",Ac]],["llama",["LlamaForCausalLM",Fu]],["exaone",["ExaoneForCausalLM",X]],["olmo",["OlmoForCausalLM",$t]],["olmo2",["Olmo2ForCausalLM",xn]],["mobilellm",["MobileLLMForCausalLM",qe]],["granite",["GraniteForCausalLM",yk]],["cohere",["CohereForCausalLM",_k]],["gemma",["GemmaForCausalLM",xk]],["gemma2",["Gemma2ForCausalLM",kk]],["gemma3_text",["Gemma3ForCausalLM",Mk]],["helium",["HeliumForCausalLM",zu]],["glm",["GlmForCausalLM",P]],["openelm",["OpenELMForCausalLM",Sk]],["qwen2",["Qwen2ForCausalLM",Pk]],["qwen3",["Qwen3ForCausalLM",jk]],["phi",["PhiForCausalLM",Ok]],["phi3",["Phi3ForCausalLM",Dk]],["mpt",["MptForCausalLM",Bk]],["opt",["OPTForCausalLM",Wk]],["mbart",["MBartForCausalLM",Aa]],["mistral",["MistralForCausalLM",dM]],["starcoder2",["Starcoder2ForCausalLM",pM]],["falcon",["FalconForCausalLM",fM]],["trocr",["TrOCRForCausalLM",lM]],["stablelm",["StableLmForCausalLM",bM]],["phi3_v",["Phi3VForCausalLM",bu]]]),j5=new Map([["multi_modality",["MultiModalityCausalLM",zM]]]),hE=new Map([["bert",["BertForMaskedLM",Q]],["modernbert",["ModernBertForMaskedLM",Pe]],["roformer",["RoFormerForMaskedLM",It]],["electra",["ElectraForMaskedLM",Ue]],["esm",["EsmForMaskedLM",ir]],["convbert",["ConvBertForMaskedLM",ks]],["camembert",["CamembertForMaskedLM",pt]],["deberta",["DebertaForMaskedLM",Xs]],["deberta-v2",["DebertaV2ForMaskedLM",$s]],["mpnet",["MPNetForMaskedLM",ol]],["albert",["AlbertForMaskedLM",ie]],["distilbert",["DistilBertForMaskedLM",We]],["roberta",["RobertaForMaskedLM",Ir]],["xlm",["XLMWithLMHeadModel",Nh]],["xlm-roberta",["XLMRobertaForMaskedLM",Fh]],["mobilebert",["MobileBertForMaskedLM",en]],["squeezebert",["SqueezeBertForMaskedLM",ul]]]),fE=new Map([["bert",["BertForQuestionAnswering",Me]],["roformer",["RoFormerForQuestionAnswering",zr]],["electra",["ElectraForQuestionAnswering",Xt]],["convbert",["ConvBertForQuestionAnswering",B]],["camembert",["CamembertForQuestionAnswering",vn]],["deberta",["DebertaForQuestionAnswering",ri]],["deberta-v2",["DebertaV2ForQuestionAnswering",ai]],["mpnet",["MPNetForQuestionAnswering",dl]],["albert",["AlbertForQuestionAnswering",Z]],["distilbert",["DistilBertForQuestionAnswering",ns]],["roberta",["RobertaForQuestionAnswering",Un]],["xlm",["XLMForQuestionAnswering",hu]],["xlm-roberta",["XLMRobertaForQuestionAnswering",Bh]],["mobilebert",["MobileBertForQuestionAnswering",sa]],["squeezebert",["SqueezeBertForQuestionAnswering",hl]]]),Gv=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",vu]],["idefics3",["Idefics3ForConditionalGeneration",gl]],["smolvlm",["SmolVLMForConditionalGeneration",xu]]]),mE=new Map([["llava",["LlavaForConditionalGeneration",ml]],["llava_onevision",["LlavaOnevisionForConditionalGeneration",to]],["moondream1",["Moondream1ForConditionalGeneration",Hh]],["florence2",["Florence2ForConditionalGeneration",Kh]],["qwen2-vl",["Qwen2VLForConditionalGeneration",$k]],["idefics3",["Idefics3ForConditionalGeneration",gl]],["smolvlm",["SmolVLMForConditionalGeneration",xu]],["paligemma",["PaliGemmaForConditionalGeneration",Yh]]]),gE=new Map([["ultravox",["UltravoxModel",QM]]]),I5=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",vu]]]),yE=new Map([["vit",["ViTForImageClassification",Gk]],["ijepa",["IJepaForImageClassification",Hk]],["pvt",["PvtForImageClassification",Jk]],["vit_msn",["ViTMSNForImageClassification",t2]],["fastvit",["FastViTForImageClassification",a2]],["mobilevit",["MobileViTForImageClassification",c2]],["mobilevitv2",["MobileViTV2ForImageClassification",u2]],["beit",["BeitForImageClassification",y2]],["deit",["DeiTForImageClassification",O2]],["hiera",["HieraForImageClassification",D2]],["convnext",["ConvNextForImageClassification",uT]],["convnextv2",["ConvNextV2ForImageClassification",hT]],["dinov2",["Dinov2ForImageClassification",mT]],["dinov2_with_registers",["Dinov2WithRegistersForImageClassification",yT]],["resnet",["ResNetForImageClassification",L2]],["swin",["SwinForImageClassification",B2]],["segformer",["SegformerForImageClassification",_M]],["efficientnet",["EfficientNetForImageClassification",TM]],["mobilenet_v1",["MobileNetV1ForImageClassification",EM]],["mobilenet_v2",["MobileNetV2ForImageClassification",PM]],["mobilenet_v3",["MobileNetV3ForImageClassification",IM]],["mobilenet_v4",["MobileNetV4ForImageClassification",OM]]]),vE=new Map([["detr",["DetrForObjectDetection",_2]],["rt_detr",["RTDetrForObjectDetection",b2]],["rt_detr_v2",["RTDetrV2ForOb
3362jectDetection",T2]],["rf_detr",["RFDetrForObjectDetection",S2]],["d_fine",["DFineForObjectDetection",C2]],["table-transformer",["TableTransformerForObjectDetection",I2]],["yolos",["YolosForObjectDetection",xT]]]),_E=new Map([["owlvit",["OwlViTForObjectDetection",h2]],["owlv2",["Owlv2ForObjectDetection",m2]],["grounding-dino",["GroundingDinoForObjectDetection",_T]]]),Ic=new Map([["detr",["DetrForSegmentation",dv]],["clipseg",["CLIPSegForImageSegmentation",Au]]]),wE=new Map([["segformer",["SegformerForSemanticSegmentation",wM]],["sapiens",["SapiensForSemanticSegmentation",Q2]],["swin",["SwinForSemanticSegmentation",U2]],["mobilenet_v1",["MobileNetV1ForSemanticSegmentation",SM]],["mobilenet_v2",["MobileNetV2ForSemanticSegmentation",CM]],["mobilenet_v3",["MobileNetV3ForSemanticSegmentation",$M]],["mobilenet_v4",["MobileNetV4ForSemanticSegmentation",RM]]]),xE=new Map([["detr",["DetrForSegmentation",dv]],["maskformer",["MaskFormerForInstanceSegmentation",aT]]]),bE=new Map([["sam",["SamModel",TT]]]),kE=new Map([["wav2vec2",["Wav2Vec2ForCTC",jT]],["wav2vec2-bert",["Wav2Vec2BertForCTC",qT]],["unispeech",["UniSpeechForCTC",LT]],["unispeech-sat",["UniSpeechSatForCTC",UT]],["wavlm",["WavLMForCTC",ZT]],["hubert",["HubertForCTC",QT]]]),TE=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",IT]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",HT]],["unispeech",["UniSpeechForSequenceClassification",zT]],["unispeech-sat",["UniSpeechSatForSequenceClassification",WT]],["wavlm",["WavLMForSequenceClassification",XT]],["hubert",["HubertForSequenceClassification",YT]],["audio-spectrogram-transformer",["ASTForAudioClassification",Wh]]]),ME=new Map([["wavlm",["WavLMForXVector",eM]]]),EE=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",VT]],["wavlm",["WavLMForAudioFrameClassification",tM]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",$T]],["pyannote",["PyAnnoteForAudioFrameClassification",OT]]]),SE=new Map([["vitmatte",["VitMatteForImageMatting",o2]]]),$5=new Map([["patchtst",["PatchTSTForPrediction",GM]],["patchtsmixer",["PatchTSMixerForPrediction",HM]]]),AE=new Map([["swin2sr",["Swin2SRForImageSuperResolution",V2]]]),PE=new Map([["dpt",["DPTForDepthEstimation",q2]],["depth_anything",["DepthAnythingForDepthEstimation",K2]],["glpn",["GLPNForDepthEstimation",oT]],["sapiens",["SapiensForDepthEstimation",Y2]],["depth_pro",["DepthProForDepthEstimation",X2]],["metric3d",["Metric3DForDepthEstimation",tT]],["metric3dv2",["Metric3Dv2ForDepthEstimation",nT]]]),CE=new Map([["sapiens",["SapiensForNormalEstimation",J2]]]),jE=new Map([["vitpose",["VitPoseForPoseEstimation",Qk]]]),IE=new Map([["clip",["CLIPVisionModelWithProjection",ef]],["siglip",["SiglipVisionModel",tf]],["jina_clip",["JinaCLIPVisionModel",Eu]]]),$E=[[S5,w.EncoderOnly],[A5,w.EncoderDecoder],[C5,w.DecoderOnly],[P5,w.AutoEncoder],[uE,w.EncoderOnly],[pE,w.EncoderOnly],[Wv,w.Seq2Seq],[Uv,w.Seq2Seq],[Vv,w.DecoderOnly],[j5,w.MultiModality],[hE,w.EncoderOnly],[fE,w.EncoderOnly],[Gv,w.Vision2Seq],[mE,w.ImageTextToText],[gE,w.AudioTextToText],[yE,w.EncoderOnly],[Ic,w.EncoderOnly],[xE,w.EncoderOnly],[wE,w.EncoderOnly],[SE,w.EncoderOnly],[$5,w.EncoderOnly],[AE,w.EncoderOnly],[PE,w.EncoderOnly],[CE,w.EncoderOnly],[jE,w.EncoderOnly],[vE,w.EncoderOnly],[_E,w.EncoderOnly],[bE,w.MaskGeneration],[kE,w.EncoderOnly],[TE,w.EncoderOnly],[cE,w.Seq2Seq],[dE,w.EncoderOnly],[ME,w.EncoderOnly],[EE,w.EncoderOnly],[IE,w.EncoderOnly]];for(const[A,C]of $E)for(const[z,he]of A.values())x.set(z,C),M.set(he,z),b.set(z,he);const N5=[["MusicgenForConditionalGeneration",Lv,w.Musicgen],["Phi3VForCausalLM",bu,w.Phi3V],["CLIPTextModelWithProjection",Xh,w.EncoderOnly],["SiglipTextModel",ku,w.EncoderOnly],["JinaCLIPTextModel",Mu,w.EncoderOnly],["ClapTextModelWithProjection",gM,w.EncoderOnly],["ClapAudioModelWithProjection",yM,w.EncoderOnly],["DacEncoderModel",sE,w.EncoderOnly],["DacDecoderModel",aE,w.EncoderOnly],["MimiEncoderModel",XM,w.EncoderOnly],["MimiDecoderModel",eE,w.EncoderOnly],["SnacEncoderModel",oE,w.EncoderOnly],["SnacDecoderModel",lE,w.EncoderOnly]];for(const[A,C,z]of N5)x.set(A,z),M.set(C,A),b.set(A,C);const NE=new Map([["modnet",Ic],["birefnet",Ic],["isnet",Ic],["ben",Ic]]);for(const[A,C]of NE.entries())C.set(A,["PreTrainedModel",Y]),x.set(A,w.EncoderOnly),M.set(Y,A),b.set(A,Y);class qv extends nr{}ce(qv,"MODEL_CLASS_MAPPINGS",$E.map(C=>C[0])),ce(qv,"BASE_IF_FAIL",!0);class OE extends nr{}ce(OE,"MODEL_CLASS_MAPPINGS",[uE]);class RE extends nr{}ce(RE,"MODEL_CLASS_MAPPINGS",[pE]);class DE extends nr{}ce(DE,"MODEL_CLASS_MAPPINGS",[Wv]);class FE extends nr{}ce(FE,"MODEL_CLASS_MAPPINGS",[Uv]);class LE extends nr{}ce(LE,"MODEL_CLASS_MAPPINGS",[cE]);class zE extends nr{}ce(zE,"MODEL_CLASS_MAPPINGS",[dE]);class BE extends nr{}ce(BE,"MODEL_CLASS_MAPPINGS",[Vv]);class UE extends nr{}ce(UE,"MODEL_CLASS_MAPPINGS",[hE]);class WE extends nr{}ce(WE,"MODEL_CLASS_MAPPINGS",[fE]);class VE extends nr{}ce(VE,"MODEL_CLASS_MAPPINGS",[Gv]);class GE extends nr{}ce(GE,"MODEL_CLASS_MAPPINGS",[yE]);class qE extends nr{}ce(qE,"MODEL_CLASS_MAPPINGS",[Ic]);class HE extends nr{}ce(HE,"MODEL_CLASS_MAPPINGS",[wE]);class KE extends nr{}ce(KE,"MODEL_CLASS_MAPPINGS",[xE]);class QE extends nr{}ce(QE,"MODEL_CLASS_MAPPINGS",[vE]);class YE extends nr{}ce(YE,"MODEL_CLASS_MAPPINGS",[_E]);class JE extends nr{}ce(JE,"MODEL_CLASS_MAPPINGS",[bE]);class ZE extends nr{}ce(ZE,"MODEL_CLASS_MAPPINGS",[kE]);class XE extends nr{}ce(XE,"MODEL_CLASS_MAPPINGS",[TE]);class eS extends nr{}ce(eS,"MODEL_CLASS_MAPPINGS",[ME]);class tS extends nr{}ce(tS,"MODEL_CLASS_MAPPINGS",[EE]);class rS extends nr{}ce(rS,"MODEL_CLASS_MAPPINGS",[I5]);
3362class nS extends nr{}ce(nS,"MODEL_CLASS_MAPPINGS",[SE]);class sS extends nr{}ce(sS,"MODEL_CLASS_MAPPINGS",[AE]);class aS extends nr{}ce(aS,"MODEL_CLASS_MAPPINGS",[PE]);class iS extends nr{}ce(iS,"MODEL_CLASS_MAPPINGS",[CE]);class oS extends nr{}ce(oS,"MODEL_CLASS_MAPPINGS",[jE]);class lS extends nr{}ce(lS,"MODEL_CLASS_MAPPINGS",[IE]);class cS extends nr{}ce(cS,"MODEL_CLASS_MAPPINGS",[mE]);class dS extends nr{}ce(dS,"MODEL_CLASS_MAPPINGS",[gE]);class O5 extends Se{constructor({logits:C,past_key_values:z,encoder_outputs:he,decoder_attentions:ke=null,cross_attentions:be=null}){super(),this.logits=C,this.past_key_values=z,this.encoder_outputs=he,this.decoder_attentions=ke,this.cross_attentions=be}}class Ot extends Se{constructor({logits:C,...z}){super(),this.logits=C;const he=Object.values(z);he.length>0&&(this.attentions=he)}}class uS extends Se{constructor({logits:C,embeddings:z}){super(),this.logits=C,this.embeddings=z}}class jn extends Se{constructor({logits:C}){super(),this.logits=C}}class Wn extends Se{constructor({logits:C}){super(),this.logits=C}}class ss extends Se{constructor({start_logits:C,end_logits:z}){super(),this.start_logits=C,this.end_logits=z}}class bl extends Se{constructor({logits:C}){super(),this.logits=C}}class R5 extends Se{constructor({logits:C,past_key_values:z}){super(),this.logits=C,this.past_key_values=z}}class pS extends Se{constructor({alphas:C}){super(),this.alphas=C}}class hS extends Se{constructor({waveform:C,spectrogram:z}){super(),this.waveform=C,this.spectrogram=z}}},
vendor: 1,115 bytes, line 3362
3362"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,t,r)=>{r.r(t),r.d(t,{ASTFeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var s=r("./src/utils/audio.js");class a extends n.FeatureExtractor{constructor(l){super(l);const c=this.config.sampling_rate,d=(0,s.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(c/2),c,null,"kaldi",!0);this.mel_filters=d,this.window=(0,s.window_function)(400,"hann",{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(l,c){return(0,s.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:c,transpose:!0})}async _call(l){(0,n.validate_audio_inputs)(l,"ASTFeatureExtractor");const c=await this._extract_fbank_features(l,this.config.max_length);if(this.config.do_normalize){const d=this.std*2,p=c.data;for(let u=0;u<p.length;++u)p[u]=(p[u]-this.mean)/d}return{input_values:c.unsqueeze_(0)}}}},
3362"./src/models/auto/feature_extraction_auto.js":(e,t,r)=>{r.r(t),r.d(t,{AutoFeatureExtractor:()=>i});var n=r("./src/utils/constants.js"),s=r("./src/utils/hub.js");r("./src/base/feature_extraction_utils.js");var a=r("./src/models/feature_extractors.js");class i{static async from_pretrained(c,d={}){const p=await(0,s.getModelJSON)(c,n.FEATURE_EXTRACTOR_NAME,!0,d),u=p.feature_extractor_type,h=a[u];if(!h)throw new Error(`Unknown feature_extractor_type: '${u}'. Please report this at ${n.GITHUB_ISSUE_URL}.`);return new h(p)}}},
3362"./src/models/auto/image_processing_auto.js":(e,t,r)=>{r.r(t),r.d(t,{AutoImageProcessor:()=>l});var n=r("./src/utils/constants.js"),s=r("./src/utils/hub.js"),a=r("./src/base/image_processors_utils.js"),i=r("./src/models/image_processors.js");class l{static async from_pretrained(d,p={}){const u=await(0,s.getModelJSON)(d,n.IMAGE_PROCESSOR_NAME,!0,p),h=u.image_processor_type??u.feature_extractor_type;let f=i[h];return f||(h!==void 0&&console.warn(`Image processor type '${h}' not found, assuming base ImageProcessor. Please report this at ${n.GITHUB_ISSUE_URL}.`),f=a.ImageProcessor),new f(u)}}},
vendor: 953 bytes, line 3362
3362"./src/models/auto/processing_auto.js":(e,t,r)=>{r.r(t),r.d(t,{AutoProcessor:()=>d});var n=r("./src/utils/constants.js"),s=r("./src/utils/hub.js"),a=r("./src/base/processing_utils.js"),i=r("./src/models/processors.js"),l=r("./src/models/image_processors.js"),c=r("./src/models/feature_extractors.js");class d{static async from_pretrained(u,h={}){const f=await(0,s.getModelJSON)(u,n.IMAGE_PROCESSOR_NAME,!0,h),{image_processor_type:m,feature_extractor_type:v,processor_class:k}=f;if(k&&i[k])return i[k].from_pretrained(u,h);if(!m&&!v)throw new Error("No `image_processor_type` or `feature_extractor_type` found in the config.");const y={};if(m){const _=l[m];if(!_)throw new Error(`Unknown image_processor_type: '${m}'.`);y.image_processor=new _(f)}if(v){const _=l[v];if(_)y.image_processor=new _(f);else{const w=c[v];if(!w)throw new Error(`Unknown feature_extractor_type: '${v}'.`);y.feature_extractor=new w(f)}}const g={};return new a.Processor(g,y)}}},
3362"./src/models/beit/image_processing_beit.js":(e,t,r)=>{r.r(t),r.d(t,{BeitFeatureExtractor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3362"./src/models/bit/image_processing_bit.js":(e,t,r)=>{r.r(t),r.d(t,{BitImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3362"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,t,r)=>{r.r(t),r.d(t,{ChineseCLIPFeatureExtractor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3362"./src/models/clap/feature_extraction_clap.js":(e,t,r)=>{r.r(t),r.d(t,{ClapFeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var s=r("./src/utils/audio.js");class a extends n.FeatureExtractor{constructor(l){super(l),this.mel_filters=(0,s.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,"htk"),this.mel_filters_slaney=(0,s.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,"slaney","slaney"),this.window=(0,s.window_function)(this.config.fft_window_size,"hann")}async _get_input_mel(l,c,d,p){let u;const h=l.length-c;if(h>0)if(d==="rand_trunc"){const f=Math.floor(Math.random()*(h+1));l=l.subarray(f,f+c),u=await this._extract_fbank_features(l,this.mel_filters_slaney,this.config.nb_max_samples)}else throw new Error(`Truncation strategy "${d}" not implemented`);else{if(h<0){let f=new Float64Array(c);if(f.set(l),p==="repeat")for(let m=l.length;m<c;m+=l.length)f.set(l.subarray(0,Math.min(l.length,c-m)),m);else if(p==="repeatpad")for(let m=l.length;m<-h;m+=l.length)f.set(l,m);l=f}if(d==="fusion")throw new Error(`Truncation strategy "${d}" not implemented`);u=await this._extract_fbank_features(l,this.mel_filters_slaney,this.config.nb_max_samples)}return u.unsqueeze_(0)}async _extract_fbank_features(l,c,d=null){return(0,s.spectrogram)(l,this.window,this.config.fft_window_size,this.config.hop_length,{power:2,mel_filters:c,log_mel:"dB",max_num_frames:d,do_pad:!1,transpose:!0})}async _call(l,{max_length:c=null}={}){return(0,n.validate_audio_inputs)(l,"ClapFeatureExtractor"),{input_features:(await this._get_input_mel(l,c??this.config.nb_max_samples,this.config.truncation,this.config.padding)).unsqueeze_(0)}}}},
3362"./src/models/clip/image_processing_clip.js":(e,t,r)=>{r.r(t),r.d(t,{CLIPFeatureExtractor:()=>a,CLIPImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3362"./src/models/convnext/image_processing_convnext.js":(e,t,r)=>{r.r(t),r.d(t,{ConvNextFeatureExtractor:()=>a,ConvNextImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{constructor(l){super(l),this.crop_pct=this.config.crop_pct??224/256}async resize(l){var d;const c=(d=this.size)==null?void 0:d.shortest_edge;if(c===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(c<384){const p=Math.floor(c/this.crop_pct),[u,h]=this.get_resize_output_image_size(l,{shortest_edge:p});l=await l.resize(u,h,{resample:this.resample}),l=await l.center_crop(c,c)}else l=await l.resize(c,c,{resample:this.resample});return l}}class a extends s{}},
3362"./src/models/dac/feature_extraction_dac.js":(e,t,r)=>{r.r(t),r.d(t,{DacFeatureExtractor:()=>s});var n=r("./src/models/encodec/feature_extraction_encodec.js");class s extends n.EncodecFeatureExtractor{}},
3362"./src/models/deit/image_processing_deit.js":(e,t,r)=>{r.r(t),r.d(t,{DeiTFeatureExtractor:()=>a,DeiTImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
vendor: 1,154 bytes, line 3362
3362"./src/models/detr/image_processing_detr.js":(e,t,r)=>{r.r(t),r.d(t,{DetrFeatureExtractor:()=>i,DetrImageProcessor:()=>a});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");class a extends n.ImageProcessor{async _call(c){const d=await super._call(c),p=[d.pixel_values.dims[0],64,64],u=(0,s.full)(p,1n);return{...d,pixel_mask:u}}post_process_object_detection(...c){return(0,n.post_process_object_detection)(...c)}post_process_panoptic_segmentation(...c){return(0,n.post_process_panoptic_segmentation)(...c)}post_process_instance_segmentation(...c){return(0,n.post_process_instance_segmentation)(...c)}}class i extends a{}},"./src/models/donut/image_processing_donut.js":(e,t,r)=>{r.r(t),r.d(t,{DonutFeatureExtractor:()=>a,DonutImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{pad_image(l,c,d,p={}){const[u,h,f]=c;let m=this.image_mean;Array.isArray(this.image_mean)||(m=new Array(f).fill(m));let v=this.image_std;Array.isArray(v)||(v=new Array(f).fill(m));const k=m.map((y,g)=>-y/v[g]);return super.pad_image(l,c,d,{center:!0,constant_values:k,...p})}}class a extends s{}},
3362"./src/models/dpt/image_processing_dpt.js":(e,t,r)=>{r.r(t),r.d(t,{DPTFeatureExtractor:()=>a,DPTImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3362"./src/models/efficientnet/image_processing_efficientnet.js":(e,t,r)=>{r.r(t),r.d(t,{EfficientNetImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{constructor(i){super(i),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(l=>l*l))}}},
3362"./src/models/encodec/feature_extraction_encodec.js":(e,t,r)=>{r.r(t),r.d(t,{EncodecFeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js"),s=r("./src/utils/tensor.js");class a extends n.FeatureExtractor{async _call(l){(0,n.validate_audio_inputs)(l,"EncodecFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const c=this.config.feature_size;if(l.length%c!==0)throw new Error(`The length of the audio data must be a multiple of the number of channels (${c}).`);const d=[1,c,l.length/c];return{input_values:new s.Tensor("float32",l,d)}}}},
3362"./src/models/feature_extractors.js":(e,t,r)=>{r.r(t),r.d(t,{ASTFeatureExtractor:()=>n.ASTFeatureExtractor,ClapFeatureExtractor:()=>a.ClapFeatureExtractor,DacFeatureExtractor:()=>i.DacFeatureExtractor,EncodecFeatureExtractor:()=>s.EncodecFeatureExtractor,ImageFeatureExtractor:()=>v.ImageProcessor,MoonshineFeatureExtractor:()=>l.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>c.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>p.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>h.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>f.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>m.WhisperFeatureExtractor});var n=r("./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"),s=r("./src/models/encodec/feature_extraction_encodec.js"),a=r("./src/models/clap/feature_extraction_clap.js"),i=r("./src/models/dac/feature_extraction_dac.js"),l=r("./src/models/moonshine/feature_extraction_moonshine.js"),c=r("./src/models/pyannote/feature_extraction_pyannote.js"),d=r("./src/models/seamless_m4t/feature_extraction_seamless_m4t.js"),p=r("./src/models/snac/feature_extraction_snac.js"),u=r("./src/models/speecht5/feature_extraction_speecht5.js"),h=r("./src/models/wav2vec2/feature_extraction_wav2vec2.js"),f=r("./src/models/wespeaker/feature_extraction_wespeaker.js"),m=r("./src/models/whisper/feature_extraction_whisper.js"),v=r("./src/base/image_processors_utils.js")},
3362"./src/models/florence2/processing_florence2.js":(e,t,r)=>{r.r(t),r.d(t,{Florence2Processor:()=>i});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");class i extends n.Processor{constructor(c,d){super(c,d);const{tasks_answer_post_processing_type:p,task_prompts_without_inputs:u,task_prompts_with_input:h}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(p??{})),this.task_prompts_without_inputs=new Map(Object.entries(u??{})),this.task_prompts_with_input=new Map(Object.entries(h??{})),this.regexes={quad_boxes:/(.+?)<loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)>/gm,bboxes:/([^<]+)?<loc_(\d+)><loc_(\d+)><loc_(\d+)><loc_(\d+)>/gm},this.size_per_bin=1e3}construct_prompts(c){typeof c=="string"&&(c=[c]);const d=[];for(const p of c)if(this.task_prompts_without_inputs.has(p))d.push(this.task_prompts_without_inputs.get(p));else{for(const[u,h]of this.task_prompts_with_input)if(p.includes(u)){d.push(h.replaceAll("{input}",p).replaceAll(u,""));break}d.length!==c.length&&d.push(p)}return d}post_process_generation(c,d,p){const u=this.tasks_answer_post_processing_type.get(d)??"pure_text";c=c.replaceAll("<s>","").replaceAll("</s>","");let h;switch(u){case"pure_text":h=c;break;case"description_with_bboxes":case"bboxes":case"phrase_grounding":case"ocr":const f=u==="ocr"?"quad_boxes":"bboxes",m=c.matchAll(this.regexes[f]),v=[],k=[];for(const[y,g,..._]of m)v.push(g?g.trim():v.at(-1)??""),k.push(_.map((w,x)=>(Number(w)+.5)/this.size_per_bin*p[x%2]));h={labels:v,[f]:k};break;default:throw new Error(`Task "${d}" (of type "${u}") not yet implemented.`)}return{[d]:h}}async _call(c,d=null,p={}){if(!c&&!d)throw new Error("Either text or images must be provided");const u=await this.image_processor(c,p),h=d?this.tokenizer(d,p):{};return{...u,...h}}}ce(i,"tokenizer_class",a.AutoTokenizer),ce(i,"image_processor_class",s.AutoImageProcessor)},
3362"./src/models/glpn/image_processing_glpn.js":(e,t,r)=>{r.r(t),r.d(t,{GLPNFeatureExtractor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3362"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,t,r)=>{r.r(t),r.d(t,{GroundingDinoImageProcessor:()=>a});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");class a extends n.ImageProcessor{async _call(l){const c=await super._call(l),d=c.pixel_values.dims,p=(0,s.ones)([d[0],d[2],d[3]]);return{...c,pixel_mask:p}}}},
3362"./src/models/grounding_dino/processing_grounding_dino.js":(e,t,r)=>{r.r(t),r.d(t,{GroundingDinoProcessor:()=>c});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js"),i=r("./src/base/image_processors_utils.js");function l(d,p){const h=d.dims.at(-1)-1,f=d.tolist();f.fill(!1,0,1),f.fill(!1,h);const m=p.tolist();return f.map((v,k)=>v?k:null).filter(v=>v!==null).map(v=>m[v])}class c extends n.Processor{async _call(p,u,h={}){const f=p?await this.image_processor(p,h):{};return{...u?this.tokenizer(u,h):{},...f}}post_process_grounded_object_detection(p,u,{box_threshold:h=.25,text_threshold:f=.25,target_sizes:m=null}={}){const{logits:v,pred_boxes:k}=p,y=v.dims[0];if(m!==null&&m.length!==y)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const g=v.dims.at(1),_=v.sigmoid(),w=_.max(-1).tolist(),x=k.tolist().map(M=>M.map(S=>(0,i.center_to_corners_format)(S))),b=[];for(let M=0;M<y;++M){const S=m!==null?m[M]:null;S!==null&&(x[M]=x[M].map(R=>R.map((K,H)=>K*S[(H+1)%2])));const j=w[M],I=[],q=[],U=[];for(let R=0;R<g;++R){const K=j[R];if(K<=h)continue;const H=x[M][R],ee=_[M][R];I.push(K),U.push(H);const te=l(ee.gt(f),u[M]);q.push(te)}b.push({scores:I,boxes:U,labels:this.batch_decode(q)})}return b}}ce(c,"tokenizer_class",a.AutoTokenizer),ce(c,"image_processor_class",s.AutoImageProcessor)},
3362"./src/models/idefics3/image_processing_idefics3.js":(e,t,r)=>{r.r(t),r.d(t,{Idefics3ImageProcessor:()=>a});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");class a extends n.ImageProcessor{constructor(l){super(l),this.do_image_splitting=l.do_image_splitting??!0,this.max_image_size=l.max_image_size}get_resize_for_vision_encoder(l,c){let[d,p]=l.dims.slice(-2);const u=p/d;return p>=d?(p=Math.ceil(p/c)*c,d=Math.floor(p/u),d=Math.ceil(d/c)*c):(d=Math.ceil(d/c)*c,p=Math.floor(d*u),p=Math.ceil(p/c)*c),{height:d,width:p}}async _call(l,{do_image_splitting:c=null,return_row_col_info:d=!1}={}){let p;if(!Array.isArray(l))p=[[l]];else{if(l.length===0||!l[0])throw new Error("No images provided.");Array.isArray(l[0])?p=l:p=[l]}let u=[],h=[],f=[];const m=[],v=[];for(const M of p){let S=await Promise.all(M.map(q=>this.preprocess(q)));m.push(...S.map(q=>q.original_size)),v.push(...S.map(q=>q.reshaped_input_size)),S.forEach(q=>q.pixel_values.unsqueeze_(0));const{longest_edge:j}=this.max_image_size;let I;if(c??this.do_image_splitting){let q=new Array(S.length),U=new Array(S.length);I=await Promise.all(S.map(async(R,K)=>{const H=this.get_resize_for_vision_encoder(R.pixel_values,j),ee=await(0,s.interpolate_4d)(R.pixel_values,{size:[H.height,H.width]}),{frames:te,num_splits_h:V,num_splits_w:ae}=await this.split_image(ee,this.max_image_size);return q[K]=V,U[K]=ae,(0,s.cat)(te,0)})),h.push(q),f.push(U)}else{const q=[j,j];I=await Promise.all(S.map(U=>(0,s.interpolate_4d)(U.pixel_values,{size:q}))),h.push(new Array(S.length).fill(0)),f.push(new Array(S.length).fill(0))}u.push((0,s.cat)(I,0))}const k=u.length,[y,g,_,w]=u[0].dims;let x,b;if(k===1)x=u[0].unsqueeze_(0),b=(0,s.full)([k,y,_,w],!0);else{const M=Math.max(...u.map(I=>I.dims.at(0)));b=(0,s.full)([k,M,_,w],!0);const S=b.data,j=M*_*w;for(let I=0;I<k;++I){const q=u[I].dims[0];if(q<M){u[I]=(0,s.cat)([u[I],(0,s.full)([M-q,g,_,w],0)],0);const U=I*j+q*_*w,R=(I+1)*j;S.fill(!1,U,R)}}x=(0,s.stack)(u,0)}return{pixel_values:x,pixel_attention_mask:b,original_sizes:m,reshaped_input_sizes:v,...d?{rows:h,cols:f}:{}}}async split_image(l,{longest_edge:c}){const d=c,p=c,u=[],[h,f]=l.dims.slice(-2);let m=0,v=0;if(h>d||f>p){m=Math.ceil(h/d),v=Math.ceil(f/p);const k=Math.ceil(h/m),y=Math.ceil(f/v);for(let w=0;w<m;++w)for(let x=0;x<v;++x){let b,M,S,j;w===m-1?(M=h-k,j=h):(M=w*k,j=(w+1)*k),x===v-1?(b=f-y,S=f):(b=x*y,S=(x+1)*y);const I=[M,b],q=[j,S],U=await(0,s.slice)(l,I,q,[2,3]);u.push(U)}const g=d,_=p;(h!==g||f!==_)&&(l=await(0,s.interpolate_4d)(l,{size:[g,_]}))}return u.push(l),{frames:u,num_splits_h:m,num_splits_w:v}}}},
3362"./src/models/idefics3/processing_idefics3.js":(e,t,r)=>{r.r(t),r.d(t,{Idefics3Processor:()=>p});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");r("./src/utils/image.js");var i=r("./src/utils/core.js");function l(u,h,f,m,v,k){let y="";for(let g=0;g<h;++g){for(let _=0;_<f;++_)y+=m+`<row_${g+1}_col_${_+1}>`+v.repeat(u);y+=`
3363`}return y+=`
3364${m}${k}`+v.repeat(u)+`${m}`,y}function c(u,h,f,m){return`${h}${m}`+f.repeat(u)+`${h}`}function d(u,h,f,m,v,k){return u===0&&h===0?c(f,m,v,k):l(f,u,h,m,v,k)}class p extends n.Processor{constructor(){super(...arguments);ce(this,"fake_image_token","<fake_token_around_image>");ce(this,"image_token","<image>");ce(this,"global_img_token","<global-img>")}async _call(f,m=null,v={}){v.return_row_col_info??(v.return_row_col_info=!0);let k;m&&(k=await this.image_processor(m,v)),Array.isArray(f)||(f=[f]);const y=k.rows??[new Array(f.length).fill(0)],g=k.cols??[new Array(f.length).fill(0)],_=this.config.image_seq_len,w=[],x=[];for(let M=0;M<f.length;++M){const S=f[M],j=y[M],I=g[M];w.push((0,i.count)(S,this.image_token));const q=j.map((K,H)=>d(K,I[H],_,this.fake_image_token,this.image_token,this.global_img_token)),U=S.split(this.image_token);if(U.length===0)throw new Error("The image token should be present in the text.");let R=U[0];for(let K=0;K<q.length;++K)R+=q[K]+U[K+1];x.push(R)}return{...this.tokenizer(x),...k}}}ce(p,"image_processor_class",s.AutoImageProcessor),ce(p,"tokenizer_class",a.AutoTokenizer),ce(p,"uses_processor_config",!0)},
3364"./src/models/image_processors.js":(e,t,r)=>{r.r(t),r.d(t,{BeitFeatureExtractor:()=>n.BeitFeatureExtractor,BitImageProcessor:()=>s.BitImageProcessor,CLIPFeatureExtractor:()=>i.CLIPFeatureExtractor,CLIPImageProcessor:()=>i.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>a.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>l.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>l.ConvNextImageProcessor,DPTFeatureExtractor:()=>u.DPTFeatureExtractor,DPTImageProcessor:()=>u.DPTImageProcessor,DeiTFeatureExtractor:()=>c.DeiTFeatureExtractor,DeiTImageProcessor:()=>c.DeiTImageProcessor,DetrFeatureExtractor:()=>d.DetrFeatureExtractor,DetrImageProcessor:()=>d.DetrImageProcessor,DonutFeatureExtractor:()=>p.DonutFeatureExtractor,DonutImageProcessor:()=>p.DonutImageProcessor,EfficientNetImageProcessor:()=>h.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>f.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>v.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>y.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>g.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>_.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>w.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>w.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>x.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>x.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>b.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>b.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>M.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>M.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>S.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>S.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>j.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>j.MobileViTImageProcessor,NougatImageProcessor:()=>I.NougatImageProcessor,OwlViTFeatureExtractor:()=>U.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>U.OwlViTImageProcessor,Owlv2ImageProcessor:()=>q.Owlv2ImageProcessor,Phi3VImageProcessor:()=>R.Phi3VImageProcessor,PvtImageProcessor:()=>K.PvtImageProcessor,Qwen2VLImageProcessor:()=>H.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>ee.RTDetrImageProcessor,SamImageProcessor:()=>te.SamImageProcessor,SegformerFeatureExtractor:()=>V.SegformerFeatureExtractor,SegformerImageProcessor:()=>V.SegformerImageProcessor,SiglipImageProcessor:()=>ae.SiglipImageProcessor,SmolVLMImageProcessor:()=>ne.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>L.Swin2SRImageProcessor,VLMImageProcessor:()=>k.VLMImageProcessor,ViTFeatureExtractor:()=>$.ViTFeatureExtractor,ViTImageProcessor:()=>$.ViTImageProcessor,VitMatteImageProcessor:()=>G.VitMatteImageProcessor,VitPoseImageProcessor:()=>se.VitPoseImageProcessor,YolosFeatureExtractor:()=>_e.YolosFeatureExtractor,YolosImageProcessor:()=>_e.YolosImageProcessor});var n=r("./src/models/beit/image_processing_beit.js"),s=r("./src/models/bit/image_processing_bit.js"),a=r("./src/models/chinese_clip/image_processing_chinese_clip.js"),i=r("./src/models/clip/image_processing_clip.js"),l=r("./src/models/convnext/image_processing_convnext.js"),c=r("./src/models/deit/image_processing_deit.js"),d=r("./src/models/detr/image_processing_detr.js"),p=r("./src/models/donut/image_processing_donut.js"),u=r("./src/models/dpt/image_processing_dpt.js"),h=r("./src/models/efficientnet/image_processing_efficientnet.js"),f=r("./src/models/glpn/image_processing_glpn.js"),m=r("./src/models/grounding_dino/image_processing_grounding_dino.js"),v=r("./src/models/idefics3/image_processing_idefics3.js"),k=r("./src/models/janus/image_processing_janus.js"),y=r("./src/models/jina_clip/image_processing_jina_clip.js"),g=r("./src/models/llava_onevision/image_processing_llava_onevision.js"),_=r("./src/models/mask2former/image_processing_mask2former.js"),w=r("./src/models/maskformer/image_processing_maskformer.js"),x=r("./src/models/mobilenet_v1/image_processing_mobilenet_v1.js"),b=r("./src/models/mobilenet_v2/image_processing_mobilenet_v2.js"),M=r("./src/models/mobilenet_v3/image_processing_mobilenet_v3.js"),S=r("./src/models/mobilenet_v4/image_processing_mobilenet_v4.js"),j=r("./src/models/mobilevit/image_processing_mobilevit.js"),I=r("./src/models/nougat/image_processing_nougat.js"),q=r("./src/models/owlv2/image_processing_owlv2.js"),U=r("./src/models/owlvit/image_processing_owlvit.js"),R=r("./src/models/phi3_v/image_processing_phi3_v.js"),K=r("./src/models/pvt/image_processing_pvt.js"),H=r("./src/models/qwen2_vl/image_processing_qwen2_vl.js"),ee=r("./src/models/rt_detr/image_processing_rt_detr.js"),te=r("./src/models/sam/image_processing_sam.js"),V=r("./src/models/segformer/image_processing_segformer.js"),ae=r("./src/models/siglip/image_processing_siglip.js"),ne=r("./src/models/smolvlm/image_processing_smolvlm.js"),L=r("./src/models/swin2sr/image_processing_swin2sr.js"),$=r("./src/models/vit/image_processing_vit.js"),G=r("./src/models/vitmatte/image_processing_vitmatte.js"),se=r("./src/models/vitpose/image_processing_vitpose.js"),_e=r("./src/models/yolos/image_processing_yolos.js")},
3364"./src/models/janus/image_processing_janus.js":(e,t,r)=>{r.r(t),r.d(t,{VLMImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{constructor(i){super({do_pad:!0,pad_size:{width:i.image_size,height:i.image_size},...i}),this.constant_values=this.config.background_color.map(l=>l*this.rescale_factor)}pad_image(i,l,c,d){return super.pad_image(i,l,c,{constant_values:this.constant_values,center:!0,...d})}}},
vendor: 1,931 bytes, line 3364
3364"./src/models/janus/processing_janus.js":(e,t,r)=>{r.r(t),r.d(t,{VLChatProcessor:()=>d});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js"),i=r("./src/utils/core.js"),l=r("./src/utils/tensor.js"),c=r("./src/utils/image.js");class d extends n.Processor{constructor(u,h){super(u,h),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(u,{images:h=null,chat_template:f="default"}={}){h?Array.isArray(h)||(h=[h]):h=await Promise.all(u.filter(I=>I.images).flatMap(I=>I.images).map(I=>c.RawImage.read(I)));const m=this.tokenizer,v=m.apply_chat_template(u,{tokenize:!1,add_generation_prompt:!0,chat_template:f}),k=I=>m.encode(I,{add_special_tokens:!1}),y=v.split(this.image_tag),g=y.length-1;if(h.length!==g)throw new Error(`Number of images provided (${h.length}) does not match number of "${this.image_tag}" image tags (${g})`);const[_,w,x]=m.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]);let b=k(y[0]),M=new Array(b.length).fill(!1);for(let I=1;I<y.length;++I){const q=new Array(this.num_image_tokens).fill(_),U=k(y[I]);b=(0,i.mergeArrays)(b,[w],q,[x],U);const R=new Array(this.num_image_tokens).fill(!0);M=(0,i.mergeArrays)(M,[!1],R,[!1],new Array(U.length).fill(!1))}const S=[1,b.length],j={input_ids:new l.Tensor("int64",b,S),attention_mask:new l.Tensor("int64",new Array(b.length).fill(1),S),images_seq_mask:new l.Tensor("bool",M,S),images_emb_mask:new l.Tensor("bool",new Array(g*this.num_image_tokens).fill(!0),[1,g,this.num_image_tokens])};if(h&&h.length>0){const I=await this.image_processor(h);return I.pixel_values.unsqueeze_(0),{...j,...I}}return j}}ce(d,"image_processor_class",s.AutoImageProcessor),ce(d,"tokenizer_class",a.AutoTokenizer),ce(d,"uses_processor_config",!0)},
3364"./src/models/jina_clip/image_processing_jina_clip.js":(e,t,r)=>{r.r(t),r.d(t,{JinaCLIPImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{constructor(i){const{resize_mode:l,fill_color:c,interpolation:d,size:p,...u}=i,h=l==="squash"?{width:p,height:p}:l==="shortest"?{shortest_edge:p}:{longest_edge:p},f=d==="bicubic"?3:2;super({...u,size:h,resample:f,do_center_crop:!0,crop_size:p,do_normalize:!0})}}},
3364"./src/models/jina_clip/processing_jina_clip.js":(e,t,r)=>{r.r(t),r.d(t,{JinaCLIPProcessor:()=>i});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");class i extends n.Processor{async _call(c=null,d=null,p={}){if(!c&&!d)throw new Error("Either text or images must be provided");const u=c?this.tokenizer(c,p):{},h=d?await this.image_processor(d,p):{};return{...u,...h}}}ce(i,"tokenizer_class",a.AutoTokenizer),ce(i,"image_processor_class",s.AutoImageProcessor)},
3364"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,t,r)=>{r.r(t),r.d(t,{LlavaOnevisionImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3364"./src/models/mask2former/image_processing_mask2former.js":(e,t,r)=>{r.r(t),r.d(t,{Mask2FormerImageProcessor:()=>s});var n=r("./src/models/maskformer/image_processing_maskformer.js");class s extends n.MaskFormerImageProcessor{}},
3364"./src/models/maskformer/image_processing_maskformer.js":(e,t,r)=>{r.r(t),r.d(t,{MaskFormerFeatureExtractor:()=>a,MaskFormerImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_panoptic_segmentation(...l){return(0,n.post_process_panoptic_segmentation)(...l)}post_process_instance_segmentation(...l){return(0,n.post_process_instance_segmentation)(...l)}}class a extends s{}},
vendor: 1,963 bytes, line 3364
3364"./src/models/mgp_str/processing_mgp_str.js":(e,t,r)=>{r.r(t),r.d(t,{MgpstrProcessor:()=>c});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js"),i=r("./src/utils/maths.js");const l={char:["char_decode",1],bpe:["bpe_decode",2],wp:["wp_decode",102]};class c extends n.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(p,u){if(!l.hasOwnProperty(u))throw new Error(`Format ${u} is not supported.`);const[h,f]=l[u],m=this[h].bind(this),[v,k]=p.dims,y=[],g=[],_=p.tolist();for(let x=0;x<v;++x){const b=_[x],M=[],S=[];for(let I=1;I<k;++I){const[q,U]=(0,i.max)((0,i.softmax)(b[I]));if(S.push(q),U==f)break;M.push(U)}const j=S.length>0?S.reduce((I,q)=>I*q,1):0;g.push(M),y.push(j)}return[m(g),y]}char_decode(p){return this.char_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}bpe_decode(p){return this.bpe_tokenizer.batch_decode(p)}wp_decode(p){return this.wp_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}batch_decode([p,u,h]){const[f,m]=this._decode_helper(p,"char"),[v,k]=this._decode_helper(u,"bpe"),[y,g]=this._decode_helper(h,"wp"),_=[],w=[];for(let x=0;x<f.length;++x){const[b,M]=(0,i.max)([m[x],k[x],g[x]]);_.push([f[x],v[x],y[x]][M]),w.push(b)}return{generated_text:_,scores:w,char_preds:f,bpe_preds:v,wp_preds:y}}static async from_pretrained(...p){const u=await super.from_pretrained(...p),h=await a.AutoTokenizer.from_pretrained("Xenova/gpt2"),f=await a.AutoTokenizer.from_pretrained("Xenova/bert-base-uncased");return u.components={image_processor:u.image_processor,char_tokenizer:u.tokenizer,bpe_tokenizer:h,wp_tokenizer:f},u}async _call(p,u=null){const h=await this.image_processor(p);return u&&(h.labels=this.tokenizer(u).input_ids),h}}ce(c,"tokenizer_class",a.AutoTokenizer),ce(c,"image_processor_class",s.AutoImageProcessor)},
3364"./src/models/mobilenet_v1/image_processing_mobilenet_v1.js":(e,t,r)=>{r.r(t),r.d(t,{MobileNetV1FeatureExtractor:()=>a,MobileNetV1ImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3364"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,t,r)=>{r.r(t),r.d(t,{MobileNetV2FeatureExtractor:()=>a,MobileNetV2ImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3364"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,t,r)=>{r.r(t),r.d(t,{MobileNetV3FeatureExtractor:()=>a,MobileNetV3ImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3364"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,t,r)=>{r.r(t),r.d(t,{MobileNetV4FeatureExtractor:()=>a,MobileNetV4ImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3364"./src/models/mobilevit/image_processing_mobilevit.js":(e,t,r)=>{r.r(t),r.d(t,{MobileViTFeatureExtractor:()=>a,MobileViTImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3364"./src/models/moonshine/feature_extraction_moonshine.js":(e,t,r)=>{r.r(t),r.d(t,{MoonshineFeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js"),s=r("./src/utils/tensor.js");class a extends n.FeatureExtractor{async _call(l){(0,n.validate_audio_inputs)(l,"MoonshineFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const c=[1,l.length];return{input_values:new s.Tensor("float32",l,c)}}}},
3364"./src/models/moonshine/processing_moonshine.js":(e,t,r)=>{r.r(t),r.d(t,{MoonshineProcessor:()=>i});var n=r("./src/models/auto/feature_extraction_auto.js"),s=r("./src/tokenizers.js"),a=r("./src/base/processing_utils.js");class i extends a.Processor{async _call(c){return await this.feature_extractor(c)}}ce(i,"tokenizer_class",s.AutoTokenizer),ce(i,"feature_extractor_class",n.AutoFeatureExtractor)},
3364"./src/models/nougat/image_processing_nougat.js":(e,t,r)=>{r.r(t),r.d(t,{NougatImageProcessor:()=>s});var n=r("./src/models/donut/image_processing_donut.js");class s extends n.DonutImageProcessor{}},
3364"./src/models/owlv2/image_processing_owlv2.js":(e,t,r)=>{r.r(t),r.d(t,{Owlv2ImageProcessor:()=>s});var n=r("./src/models/owlvit/image_processing_owlvit.js");class s extends n.OwlViTImageProcessor{}},
3364"./src/models/owlvit/image_processing_owlvit.js":(e,t,r)=>{r.r(t),r.d(t,{OwlViTFeatureExtractor:()=>a,OwlViTImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_object_detection(...l){return(0,n.post_process_object_detection)(...l)}}class a extends s{}},
3364"./src/models/owlvit/processing_owlvit.js":(e,t,r)=>{r.r(t),r.d(t,{OwlViTProcessor:()=>i});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");class i extends n.Processor{}ce(i,"tokenizer_class",a.AutoTokenizer),ce(i,"image_processor_class",s.AutoImageProcessor)},
3364"./src/models/paligemma/processing_paligemma.js":(e,t,r)=>{r.r(t),r.d(t,{PaliGemmaProcessor:()=>c});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");const i="<image>";function l(d,p,u,h,f){return`${h.repeat(u*f)}${p}${d}
3365`}class c extends n.Processor{async _call(p,u=null,h={}){u||(console.warn("You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."),u=""),Array.isArray(p)||(p=[p]),Array.isArray(u)||(u=[u]);const f=this.tokenizer.bos_token,m=this.image_processor.config.image_seq_length;let v;u.some(g=>g.includes(i))?v=u.map(g=>{const _=g.replaceAll(i,i.repeat(m)),w=_.lastIndexOf(i),x=w===-1?0:w+i.length;return _.slice(0,x)+f+_.slice(x)+`
3366`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `<image>` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),v=u.map(g=>l(g,f,m,i,p.length)));const k=this.tokenizer(v,h);return{...await this.image_processor(p,h),...k}}}ce(c,"tokenizer_class",a.AutoTokenizer),ce(c,"image_processor_class",s.AutoImageProcessor),ce(c,"uses_processor_config",!1)},
3366"./src/models/phi3_v/image_processing_phi3_v.js":(e,t,r)=>{r.r(t),r.d(t,{Phi3VImageProcessor:()=>p});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");const a=336,i=[2,3],{ceil:l,floor:c,sqrt:d}=Math;class p extends n.ImageProcessor{constructor(h){super({...h,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=h.num_crops}calc_num_image_tokens_from_image_size(h,f){const{num_img_tokens:m}=this.config;return c((c(f/a)*c(h/a)+1)*m+1+(c(f/a)+1)*d(m))}get_resize_output_image_size(h,f){const m=this._num_crops,[v,k]=h.size;let y=v/k,g=1;for(;g*Math.ceil(g/y)<=m;)g+=1;g-=1;const _=Math.floor(g*336),w=Math.floor(_/y);return[_,w]}pad_image(h,f,m,v={}){const[k,y]=f,g=a*l(k/a),_=a*l(y/a),w=[1,1,1].map((x,b)=>(x-this.image_mean[b])/this.image_std[b]);return super.pad_image(h,f,{width:_,height:g},{center:!0,constant_values:w,...v})}async _call(h,{num_crops:f=null}={}){if(this._num_crops=f??(f=this.config.num_crops),f<4||d(f)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(h)||(h=[h]);const m=h.length,v=await Promise.all(h.map(M=>this.preprocess(M))),k=v.map(M=>M.original_size),y=v.map(M=>M.reshaped_input_size),g=[];for(const{pixel_values:M}of v){M.unsqueeze_(0);const[S,j]=M.dims.slice(-2),I=await(0,s.interpolate_4d)(M,{size:[a,a],mode:"bicubic"});if(f>0){const q=[],U=d(f),R=c(j/U),K=c(S/U);for(let ee=0;ee<U;++ee)for(let te=0;te<U;++te){let V,ae,ne,L;ee===U-1?(ae=S-K,L=S):(ae=ee*K,L=(ee+1)*K),te===U-1?(V=j-R,ne=j):(V=te*R,ne=(te+1)*R);const $=[ae,V],G=[L,ne],se=await(0,s.slice)(M,$,G,i);q.push(se)}const H=await(0,s.interpolate_4d)((0,s.cat)(q,0),{size:[a,a],mode:"bicubic"});g.push((0,s.cat)([I,H],0))}else g.push(I)}const _=(0,s.stack)(g,0),w=y.map(M=>M.map(S=>a*l(S/a))),x=new s.Tensor("int64",w.flat(),[m,2]),b=w.map(([M,S])=>this.calc_num_image_tokens_from_image_size(S,M));return{pixel_values:_,original_sizes:k,reshaped_input_sizes:y,image_sizes:x,num_img_tokens:b}}}},
3366"./src/models/phi3_v/processing_phi3_v.js":(e,t,r)=>{r.r(t),r.d(t,{Phi3VProcessor:()=>c});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");r("./src/utils/image.js");const i="<|image|>",l=/<\|image_\d+\|>/g;class c extends n.Processor{async _call(p,u=null,{padding:h=!0,truncation:f=!0,num_crops:m=null}={}){Array.isArray(p)||(p=[p]);let v,k;if(u){k=await this.image_processor(u,{num_crops:m});const{num_img_tokens:y}=k,g=p.map((w,x)=>w.split(l).join(i.repeat(y[x])));v=this.tokenizer(g,{padding:h,truncation:f});const _=this.tokenizer.model.convert_tokens_to_ids([i])[0];v.input_ids.map_(w=>w==_?-w:w)}else v=this.tokenizer(p);return{...v,...k}}}ce(c,"image_processor_class",s.AutoImageProcessor),ce(c,"tokenizer_class",a.AutoTokenizer)},
3366"./src/models/processors.js":(e,t,r)=>{r.r(t),r.d(t,{Florence2Processor:()=>n.Florence2Processor,GroundingDinoProcessor:()=>s.GroundingDinoProcessor,Idefics3Processor:()=>a.Idefics3Processor,JinaCLIPProcessor:()=>l.JinaCLIPProcessor,MgpstrProcessor:()=>c.MgpstrProcessor,MoonshineProcessor:()=>d.MoonshineProcessor,OwlViTProcessor:()=>p.OwlViTProcessor,PaliGemmaProcessor:()=>h.PaliGemmaProcessor,Phi3VProcessor:()=>u.Phi3VProcessor,PyAnnoteProcessor:()=>f.PyAnnoteProcessor,Qwen2VLProcessor:()=>m.Qwen2VLProcessor,SamProcessor:()=>v.SamProcessor,SmolVLMProcessor:()=>k.SmolVLMProcessor,SpeechT5Processor:()=>y.SpeechT5Processor,UltravoxProcessor:()=>g.UltravoxProcessor,VLChatProcessor:()=>i.VLChatProcessor,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>w.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>x.WhisperProcessor});var n=r("./src/models/florence2/processing_florence2.js"),s=r("./src/models/grounding_dino/processing_grounding_dino.js"),a=r("./src/models/idefics3/processing_idefics3.js"),i=r("./src/models/janus/processing_janus.js"),l=r("./src/models/jina_clip/processing_jina_clip.js"),c=r("./src/models/mgp_str/processing_mgp_str.js"),d=r("./src/models/moonshine/processing_moonshine.js"),p=r("./src/models/owlvit/processing_owlvit.js"),u=r("./src/models/phi3_v/processing_phi3_v.js"),h=r("./src/models/paligemma/processing_paligemma.js"),f=r("./src/models/pyannote/processing_pyannote.js"),m=r("./src/models/qwen2_vl/processing_qwen2_vl.js"),v=r("./src/models/sam/processing_sam.js"),k=r("./src/models/smolvlm/processing_smolvlm.js"),y=r("./src/models/speecht5/processing_speecht5.js"),g=r("./src/models/ultravox/processing_ultravox.js"),_=r("./src/models/wav2vec2/processing_wav2vec2.js"),w=r("./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js"),x=r("./src/models/whisper/processing_whisper.js")},
3366"./src/models/pvt/image_processing_pvt.js":(e,t,r)=>{r.r(t),r.d(t,{PvtImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
vendor: 947 bytes, line 3366
3366"./src/models/pyannote/feature_extraction_pyannote.js":(e,t,r)=>{r.r(t),r.d(t,{PyAnnoteFeatureExtractor:()=>i});var n=r("./src/base/feature_extraction_utils.js"),s=r("./src/utils/tensor.js"),a=r("./src/utils/maths.js");class i extends n.FeatureExtractor{async _call(c){(0,n.validate_audio_inputs)(c,"PyAnnoteFeatureExtractor"),c instanceof Float64Array&&(c=new Float32Array(c));const d=[1,1,c.length];return{input_values:new s.Tensor("float32",c,d)}}samples_to_frames(c){return(c-this.config.offset)/this.config.step}post_process_speaker_diarization(c,d){const p=d/this.samples_to_frames(d)/this.config.sampling_rate,u=[];for(const h of c.tolist()){const f=[];let m=-1;for(let v=0;v<h.length;++v){const k=(0,a.softmax)(h[v]),[y,g]=(0,a.max)(k),[_,w]=[v,v+1];g!==m?(m=g,f.push({id:g,start:_,end:w,score:y})):(f.at(-1).end=w,f.at(-1).score+=y)}u.push(f.map(({id:v,start:k,end:y,score:g})=>({id:v,start:k*p,end:y*p,confidence:g/(y-k)})))}return u}}},
3366"./src/models/pyannote/processing_pyannote.js":(e,t,r)=>{r.r(t),r.d(t,{PyAnnoteProcessor:()=>a});var n=r("./src/base/processing_utils.js"),s=r("./src/models/pyannote/feature_extraction_pyannote.js");class a extends n.Processor{async _call(l){return await this.feature_extractor(l)}post_process_speaker_diarization(...l){return this.feature_extractor.post_process_speaker_diarization(...l)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}ce(a,"feature_extractor_class",s.PyAnnoteFeatureExtractor)},
3366"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,t,r)=>{r.r(t),r.d(t,{Qwen2VLImageProcessor:()=>a});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");class a extends n.ImageProcessor{async _call(l,...c){const{pixel_values:d,original_sizes:p,reshaped_input_sizes:u}=await super._call(l,...c);let h=d;const{temporal_patch_size:f,merge_size:m,patch_size:v}=this.config;h.dims[0]===1&&(h=(0,s.cat)(Array.from({length:f},()=>h),0));const k=h.dims[0]/f,y=h.dims[1],g=Math.floor(h.dims[2]/v),_=Math.floor(h.dims[3]/v),w=h.view(k,f,y,Math.floor(g/m),m,v,Math.floor(_/m),m,v).permute(0,3,6,4,7,2,1,5,8).view(k*g*_,y*f*v*v),x=new s.Tensor("int64",[k,g,_],[1,3]);return{pixel_values:w,image_grid_thw:x,original_sizes:p,reshaped_input_sizes:u}}}},
3366"./src/models/qwen2_vl/processing_qwen2_vl.js":(e,t,r)=>{r.r(t),r.d(t,{Qwen2VLProcessor:()=>i});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js"),a=r("./src/tokenizers.js");r("./src/utils/image.js");class i extends n.Processor{async _call(c,d=null,...p){Array.isArray(c)||(c=[c]);let u,h;if(d&&(u=await this.image_processor(d),h=u.image_grid_thw),h){let m=this.image_processor.config.merge_size**2,v=0;const k=h.tolist();c=c.map(y=>{for(;y.includes("<|image_pad|>");){const g=Number(k[v++].reduce((_,w)=>_*w,1n));y=y.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(g/m)))}return y.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(c),...u}}}ce(i,"image_processor_class",s.AutoImageProcessor),ce(i,"tokenizer_class",a.AutoTokenizer)},
3366"./src/models/rt_detr/image_processing_rt_detr.js":(e,t,r)=>{r.r(t),r.d(t,{RTDetrImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_object_detection(...i){return(0,n.post_process_object_detection)(...i)}}},
vendor: 2,261 bytes, line 3366
3366"./src/models/sam/image_processing_sam.js":(e,t,r)=>{r.r(t),r.d(t,{SamImageProcessor:()=>i});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/core.js"),a=r("./src/utils/tensor.js");class i extends n.ImageProcessor{reshape_input_points(c,d,p,u=!1){c=structuredClone(c);let h=(0,s.calculateDimensions)(c);if(h.length===3)u||(h=[1,...h]),c=[c];else if(h.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let f=0;f<c.length;++f){let m=d[f],v=p[f],k=[v[0]/m[0],v[1]/m[1]];for(let y=0;y<c[f].length;++y)for(let g=0;g<c[f][y].length;++g)for(let _=0;_<c[f][y][g].length;++_)c[f][y][g][_]*=k[_%2]}return new a.Tensor("float32",Float32Array.from(c.flat(1/0)),h)}add_input_labels(c,d){let p=(0,s.calculateDimensions)(c);if(p.length===2)p=[1,...p],c=[c];else if(p.length!==3)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");if(p.some((u,h)=>u!==d.dims[h]))throw Error(`The first ${p.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new a.Tensor("int64",c.flat(1/0).map(BigInt),p)}async _call(c,{input_points:d=null,input_labels:p=null,input_boxes:u=null}={}){const h=await super._call(c);if(d&&(h.input_points=this.reshape_input_points(d,h.original_sizes,h.reshaped_input_sizes)),p){if(!h.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");h.input_labels=this.add_input_labels(p,h.input_points)}return u&&(h.input_boxes=this.reshape_input_points(u,h.original_sizes,h.reshaped_input_sizes,!0)),h}async post_process_masks(c,d,p,{mask_threshold:u=0,binarize:h=!0,pad_size:f=null}={}){const m=[];f=f??this.pad_size;const v=[f.height,f.width];for(let k=0;k<d.length;++k){const y=d[k],g=p[k];let _=await(0,a.interpolate_4d)(c[k],{mode:"bilinear",size:v});if(_=_.slice(null,null,[0,g[0]],[0,g[1]]),_=await(0,a.interpolate_4d)(_,{mode:"bilinear",size:y}),h){const w=_.data,x=new Uint8Array(w.length);for(let b=0;b<w.length;++b)w[b]>u&&(x[b]=1);_=new a.Tensor("bool",x,_.dims)}m.push(_)}return m}generate_crop_boxes(c,d,{crop_n_layers:p=0,overlap_ratio:u=512/1500,points_per_crop:h=32,crop_n_points_downscale_factor:f=1}={}){}}},
3366"./src/models/sam/processing_sam.js":(e,t,r)=>{r.r(t),r.d(t,{SamProcessor:()=>a});var n=r("./src/base/processing_utils.js"),s=r("./src/models/auto/image_processing_auto.js");class a extends n.Processor{async _call(...l){return await this.image_processor(...l)}post_process_masks(...l){return this.image_processor.post_process_masks(...l)}reshape_input_points(...l){return this.image_processor.reshape_input_points(...l)}}ce(a,"image_processor_class",s.AutoImageProcessor)},
vendor: 1,891 bytes, line 3366
3366"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,t,r)=>{r.r(t),r.d(t,{SeamlessM4TFeatureExtractor:()=>i});var n=r("./src/base/feature_extraction_utils.js"),s=r("./src/utils/tensor.js"),a=r("./src/utils/audio.js");class i extends n.FeatureExtractor{constructor(c){super(c);const d=this.config.sampling_rate,p=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(d/2),d,null,"kaldi",!0);this.mel_filters=p,this.window=(0,a.window_function)(400,"povey",{periodic:!1})}async _extract_fbank_features(c,d){return c=c.map(p=>p*32768),(0,a.spectrogram)(c,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:d,transpose:!0})}async _call(c,{padding:d=!0,pad_to_multiple_of:p=2,do_normalize_per_mel_bins:u=!0,return_attention_mask:h=!0}={}){(0,n.validate_audio_inputs)(c,"SeamlessM4TFeatureExtractor");let f=await this._extract_fbank_features(c,this.config.max_length);if(u){const[x,b]=f.dims,M=f.data;for(let S=0;S<b;++S){let j=0;for(let R=0;R<x;++R)j+=M[R*b+S];const I=j/x;let q=0;for(let R=0;R<x;++R)q+=(M[R*b+S]-I)**2;q/=x-1;const U=Math.sqrt(q+1e-7);for(let R=0;R<x;++R){const K=R*b+S;M[K]=(M[K]-I)/U}}}let m;if(d){const[x,b]=f.dims,M=f.data,S=x%p;if(S>0){const j=new Float32Array(b*(x+S));j.set(M),j.fill(this.config.padding_value,M.length);const I=x+S;f=new s.Tensor(f.type,j,[I,b]),h&&(m=new s.Tensor("int64",new BigInt64Array(I),[1,I]),m.data.fill(1n,0,x))}}const[v,k]=f.dims,y=this.config.stride;if(v%y!==0)throw new Error(`The number of frames (${v}) must be a multiple of the stride (${y}).`);const _=f.view(1,Math.floor(v/y),k*y),w={input_features:_};if(h){const x=_.dims[1],b=new BigInt64Array(x);if(m){const M=m.data;for(let S=1,j=0;S<v;S+=y,++j)b[j]=M[S]}else b.fill(1n);w.attention_mask=new s.Tensor("int64",b,[1,x])}return w}}},
3366"./src/models/segformer/image_processing_segformer.js":(e,t,r)=>{r.r(t),r.d(t,{SegformerFeatureExtractor:()=>a,SegformerImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_semantic_segmentation(...l){return(0,n.post_process_semantic_segmentation)(...l)}}class a extends s{}},
3366"./src/models/siglip/image_processing_siglip.js":(e,t,r)=>{r.r(t),r.d(t,{SiglipImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}},
3366"./src/models/smolvlm/image_processing_smolvlm.js":(e,t,r)=>{r.r(t),r.d(t,{SmolVLMImageProcessor:()=>n.Idefics3ImageProcessor});var n=r("./src/models/idefics3/image_processing_idefics3.js")},
3366"./src/models/smolvlm/processing_smolvlm.js":(e,t,r)=>{r.r(t),r.d(t,{SmolVLMProcessor:()=>n.Idefics3Processor});var n=r("./src/models/idefics3/processing_idefics3.js")},
3366"./src/models/snac/feature_extraction_snac.js":(e,t,r)=>{r.r(t),r.d(t,{SnacFeatureExtractor:()=>s});var n=r("./src/models/dac/feature_extraction_dac.js");class s extends n.DacFeatureExtractor{}},
3366"./src/models/speecht5/feature_extraction_speecht5.js":(e,t,r)=>{r.r(t),r.d(t,{SpeechT5FeatureExtractor:()=>s});var n=r("./src/base/feature_extraction_utils.js");class s extends n.FeatureExtractor{}},
3366"./src/models/speecht5/processing_speecht5.js":(e,t,r)=>{r.r(t),r.d(t,{SpeechT5Processor:()=>i});var n=r("./src/base/processing_utils.js"),s=r("./src/tokenizers.js"),a=r("./src/models/auto/feature_extraction_auto.js");class i extends n.Processor{async _call(c){return await this.feature_extractor(c)}}ce(i,"tokenizer_class",s.AutoTokenizer),ce(i,"feature_extractor_class",a.AutoFeatureExtractor)},
vendor: 1,283 bytes, line 3366
3366"./src/models/swin2sr/image_processing_swin2sr.js":(e,t,r)=>{r.r(t),r.d(t,{Swin2SRImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{pad_image(i,l,c,d={}){const[p,u,h]=l;return super.pad_image(i,l,{width:u+(c-u%c)%c,height:p+(c-p%c)%c},{mode:"symmetric",center:!1,constant_values:-1,...d})}}},"./src/models/ultravox/processing_ultravox.js":(e,t,r)=>{r.r(t),r.d(t,{UltravoxProcessor:()=>i});var n=r("./src/models/auto/feature_extraction_auto.js"),s=r("./src/tokenizers.js"),a=r("./src/base/processing_utils.js");class i extends a.Processor{async _call(c,d=null,p={}){if(Array.isArray(c))throw new Error("Batched inputs are not supported yet.");let u={};if(d){const f=d.length,{input_features:m}=await this.feature_extractor(d,{...p,max_length:f}),v=Math.round(f/this.config.encoder_ds_factor+1e-4),k=1+Math.ceil(v/this.config.stack_factor);u.audio_token_len=[k],u.audio_values=m;const y=this.config.audio_placeholder;if(!c.includes(y))throw new Error(`The input text does not contain the image token ${y}.`);c=c.replaceAll(y,y.repeat(k))}return{...this.tokenizer(c,{add_special_tokens:!1,...p}),...u}}}ce(i,"tokenizer_class",s.AutoTokenizer),ce(i,"feature_extractor_class",n.AutoFeatureExtractor),ce(i,"uses_processor_config",!0)},
3366"./src/models/vit/image_processing_vit.js":(e,t,r)=>{r.r(t),r.d(t,{ViTFeatureExtractor:()=>a,ViTImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{}class a extends s{}},
3366"./src/models/vitmatte/image_processing_vitmatte.js":(e,t,r)=>{r.r(t),r.d(t,{VitMatteImageProcessor:()=>a});var n=r("./src/base/image_processors_utils.js"),s=r("./src/utils/tensor.js");class a extends n.ImageProcessor{async _call(l,c){Array.isArray(l)||(l=[l]),Array.isArray(c)||(c=[c]);const d=await Promise.all(l.map(h=>this.preprocess(h))),p=await Promise.all(c.map(h=>this.preprocess(h,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,s.stack)(d.map((h,f)=>(0,s.cat)([h.pixel_values,p[f].pixel_values],0)),0),original_sizes:d.map(h=>h.original_size),reshaped_input_sizes:d.map(h=>h.reshaped_input_size)}}}},
vendor: 764 bytes, line 3366
3366"./src/models/vitpose/image_processing_vitpose.js":(e,t,r)=>{r.r(t),r.d(t,{VitPoseImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_pose_estimation(i,l,{threshold:c=null}={}){const d=i.tolist(),[p,u,h,f]=i.dims,m=[];for(let v=0;v<p;++v){const k=d[v],y=l[v],g=[];for(let _=0;_<y.length;++_){const w=y[_],x=[],b=[],M=[],S=w.at(-2)/f,j=w.at(-1)/h;for(let I=0;I<k.length;++I){let[q,U]=[0,0],R=0,K=-1/0;const H=k[I];for(let te=0;te<H.length;++te){const V=H[te];for(let ae=0;ae<V.length;++ae){const ne=V[ae];R+=ne,K=Math.max(K,ne),q+=(ae+.5)*ne,U+=te*ne}}if(c!=null&&K<c)continue;const ee=[S*q/R,j*U/R];x.push(ee),M.push(I),b.push(K)}g.push({bbox:w,scores:b,labels:M,keypoints:x})}m.push(g)}return m}}},
3366"./src/models/wav2vec2/feature_extraction_wav2vec2.js":(e,t,r)=>{r.r(t),r.d(t,{Wav2Vec2FeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js"),s=r("./src/utils/tensor.js");class a extends n.FeatureExtractor{_zero_mean_unit_var_norm(l){const d=l.reduce((u,h)=>u+h,0)/l.length,p=l.reduce((u,h)=>u+(h-d)**2,0)/l.length;return l.map(u=>(u-d)/Math.sqrt(p+1e-7))}async _call(l){(0,n.validate_audio_inputs)(l,"Wav2Vec2FeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));let c=l;this.config.do_normalize&&(c=this._zero_mean_unit_var_norm(c));const d=[1,c.length];return{input_values:new s.Tensor("float32",c,d),attention_mask:new s.Tensor("int64",new BigInt64Array(c.length).fill(1n),d)}}}},
3366"./src/models/wav2vec2/processing_wav2vec2.js":(e,t,r)=>{r.r(t),r.d(t,{Wav2Vec2Processor:()=>i});var n=r("./src/tokenizers.js"),s=r("./src/models/auto/feature_extraction_auto.js"),a=r("./src/base/processing_utils.js");class i extends a.Processor{async _call(c){return await this.feature_extractor(c)}}ce(i,"tokenizer_class",n.AutoTokenizer),ce(i,"feature_extractor_class",s.AutoFeatureExtractor)},
3366"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(e,t,r)=>{r.r(t),r.d(t,{Wav2Vec2ProcessorWithLM:()=>i});var n=r("./src/tokenizers.js"),s=r("./src/models/auto/feature_extraction_auto.js"),a=r("./src/base/processing_utils.js");class i extends a.Processor{async _call(c){return await this.feature_extractor(c)}}ce(i,"tokenizer_class",n.AutoTokenizer),ce(i,"feature_extractor_class",s.AutoFeatureExtractor)},
vendor: 1,199 bytes, line 3366
3366"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,t,r)=>{r.r(t),r.d(t,{WeSpeakerFeatureExtractor:()=>a});var n=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var s=r("./src/utils/audio.js");class a extends n.FeatureExtractor{constructor(l){super(l);const c=this.config.sampling_rate,d=(0,s.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(c/2),c,null,"kaldi",!0);this.mel_filters=d,this.window=(0,s.window_function)(400,"hamming",{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(l){return l=l.map(c=>c*32768),(0,s.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(l){(0,n.validate_audio_inputs)(l,"WeSpeakerFeatureExtractor");const c=(await this._extract_fbank_features(l)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const d=c.mean(1).data,p=c.data,[u,h,f]=c.dims;for(let m=0;m<u;++m){const v=m*h*f,k=m*f;for(let y=0;y<h;++y){const g=v+y*f;for(let _=0;_<f;++_)p[g+_]-=d[k+_]}}}return{input_features:c}}}},
3366"./src/models/whisper/common_whisper.js":(e,t,r)=>{r.r(t),r.d(t,{WHISPER_LANGUAGE_MAPPING:()=>s,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>a,whisper_language_to_code:()=>i});const n=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],s=new Map(n),a=new Map([...n.map(([l,c])=>[c,l]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function i(l){l=l.toLowerCase();let c=a.get(l);if(c===void 0){const d=l.match(/^<\|([a-z]{2})\|>$/);if(d&&(l=d[1]),s.has(l))c=l;else{const u=l.length===2?s.keys():s.values();throw new Error(`Language "${l}" is not supported. Must be one of: ${JSON.stringify(Array.from(u))}`)}}return c}},
3366"./src/models/whisper/feature_extraction_whisper.js":(e,t,r)=>{r.r(t),r.d(t,{WhisperFeatureExtractor:()=>i});var n=r("./src/base/feature_extraction_utils.js");r("./src/utils/tensor.js");var s=r("./src/utils/audio.js"),a=r("./src/utils/maths.js");class i extends n.FeatureExtractor{constructor(c){var d;super(c),(d=this.config).mel_filters??(d.mel_filters=(0,s.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,s.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(c){const d=await(0,s.spectrogram)(c,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:Math.min(Math.floor(c.length/this.config.hop_length),this.config.nb_max_frames)}),p=d.data,u=(0,a.max)(p)[0];for(let h=0;h<p.length;++h)p[h]=(Math.max(p[h],u-8)+4)/4;return d}async _call(c,{max_length:d=null}={}){(0,n.validate_audio_inputs)(c,"WhisperFeatureExtractor");let p;const u=d??this.config.n_samples;return c.length>u?(c.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),p=c.slice(0,u)):(p=new Float32Array(u),p.set(c)),{input_features:(await this._extract_fbank_features(p)).unsqueeze_(0)}}}},
3366"./src/models/whisper/generation_whisper.js":(e,t,r)=>{r.r(t),r.d(t,{WhisperGenerationConfig:()=>s});var n=r("./src/generation/configuration_utils.js");class s extends n.GenerationConfig{constructor(){super(...arguments);ce(this,"return_timestamps",null);ce(this,"return_token_timestamps",null);ce(this,"num_frames",null);ce(this,"alignment_heads",null);ce(this,"task",null);ce(this,"language",null);ce(this,"no_timestamps_token_id",null);ce(this,"prompt_ids",null);ce(this,"is_multilingual",null);ce(this,"lang_to_id",null);ce(this,"task_to_id",null);ce(this,"max_initial_timestamp_index",1)}}},
3366"./src/models/whisper/processing_whisper.js":(e,t,r)=>{r.r(t),r.d(t,{WhisperProcessor:()=>i});var n=r("./src/models/auto/feature_extraction_auto.js"),s=r("./src/tokenizers.js"),a=r("./src/base/processing_utils.js");class i extends a.Processor{async _call(c){return await this.feature_extractor(c)}}ce(i,"tokenizer_class",s.AutoTokenizer),ce(i,"feature_extractor_class",n.AutoFeatureExtractor)},
3366"./src/models/yolos/image_processing_yolos.js":(e,t,r)=>{r.r(t),r.d(t,{YolosFeatureExtractor:()=>a,YolosImageProcessor:()=>s});var n=r("./src/base/image_processors_utils.js");class s extends n.ImageProcessor{post_process_object_detection(...l){return(0,n.post_process_object_detection)(...l)}}class a extends s{}},
3366"./src/ops/registry.js":(e,t,r)=>{r.r(t),r.d(t,{TensorOpRegistry:()=>c});var n=r("./src/backends/onnx.js"),s=r("./src/utils/tensor.js"),a=r("./src/env.js");const i=a.apis.IS_BROWSER_ENV||a.apis.IS_WEBWORKER_ENV,l=async(d,p,u)=>{const h=await(0,n.createInferenceSession)(new Uint8Array(d),p);let f=Promise.resolve();return async m=>{const v=(0,n.isONNXProxy)(),k=Object.fromEntries(Object.entries(m).map(([g,_])=>[g,(v?_.clone():_).ort_tensor])),y=await(f=i?f.then(()=>h.run(k)):h.run(k));return Array.isArray(u)?u.map(g=>new s.Tensor(y[g])):new s.Tensor(y[u])}};class c{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=l([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=l([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=l([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=l([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=l([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=l([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=l([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=l([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}ce(c,"session_options",{})},
3366"./src/pipelines.js":(e,t,r)=>{r.r(t),r.d(t,{AudioClassificationPipeline:()=>U,AutomaticSpeechRecognitionPipeline:()=>K,BackgroundRemovalPipeline:()=>V,DepthEstimationPipeline:()=>_e,DocumentQuestionAnsweringPipeline:()=>$,FeatureExtractionPipeline:()=>I,FillMaskPipeline:()=>_,ImageClassificationPipeline:()=>ee,ImageFeatureExtractionPipeline:()=>q,ImageSegmentationPipeline:()=>te,ImageToImagePipeline:()=>se,ImageToTextPipeline:()=>H,ObjectDetectionPipeline:()=>ne,Pipeline:()=>v,QuestionAnsweringPipeline:()=>g,SummarizationPipeline:()=>x,Text2TextGenerationPipeline:()=>w,TextClassificationPipeline:()=>k,TextGenerationPipeline:()=>S,TextToAudioPipeline:()=>G,TokenClassificationPipeline:()=>y,TranslationPipeline:()=>b,ZeroShotAudioClassificationPipeline:()=>R,ZeroShotClassificationPipeline:()=>j,ZeroShotImageClassificationPipeline:()=>ae,ZeroShotObjectDetectionPipeline:()=>L,pipeline:()=>ze});var n=r("./src/tokenizers.js"),s=r("./src/models.js"),a=r("./src/models/auto/processing_auto.js");r("./src/base/processing_utils.js");var i=r("./src/utils/generic.js"),l=r("./src/utils/core.js"),c=r("./src/utils/maths.js"),d=r("./src/utils/audio.js"),p=r("./src/utils/tensor.js"),u=r("./src/utils/image.js");async function h(ve){return Array.isArray(ve)||(ve=[ve]),await Promise.all(ve.map(J=>u.RawImage.read(J)))}async function f(ve,J){return Array.isArray(ve)||(ve=[ve]),await Promise.all(ve.map(ue=>typeof ue=="string"||ue instanceof URL?(0,d.read_audio)(ue,J):ue instanceof Float64Array?new Float32Array(ue):ue))}function m(ve,J){J&&(ve=ve.map(Oe=>Oe|0));const[ue,Y,Se,Ae]=ve;return{xmin:ue,ymin:Y,xmax:Se,ymax:Ae}}class v extends i.Callable{constructor({task:J,model:ue,tokenizer:Y=null,processor:Se=null}){super(),this.task=J,this.model=ue,this.tokenizer=Y,this.processor=Se}async dispose(){await this.model.dispose()}}class k extends v{constructor(J){super(J)}async _call(J,{top_k:ue=1}={}){const Y=this.tokenizer(J,{padding:!0,truncation:!0}),Se=await this.model(Y),Ae=this.model.config.problem_type==="multi_label_classification"?Q=>Q.sigmoid():Q=>new p.Tensor("float32",(0,c.softmax)(Q.data),Q.dims),Oe=this.model.config.id2label,Ne=[];for(const Q of Se.logits){const re=Ae(Q),pe=await(0,p.topk)(re,ue),Me=pe[0].tolist(),me=pe[1].tolist().map((Pe,Be)=>({label:Oe?Oe[Pe]:`LABEL_${Pe}`,score:Me[Be]}));ue===1?Ne.push(...me):Ne.push(me)}return Array.isArray(J)||ue===1?Ne:Ne[0]}}class y extends v{constructor(J){super(J)}async _call(J,{ignore_labels:ue=["O"]}={}){const Y=Array.isArray(J),Se=this.tokenizer(Y?J:[J],{padding:!0,truncation:!0}),Oe=(await this.model(Se)).logits,Ne=this.model.config.id2label,Q=[];for(let re=0;re<Oe.dims[0];++re){const pe=Se.input_ids[re],Me=Oe[re],Te=[];for(let me=0;me<Me.dims[0];++me){const Pe=Me[me],Be=(0,c.max)(Pe.data)[1],rt=Ne?Ne[Be]:`LABEL_${Be}`;if(ue.includes(rt))continue;const et=this.tokenizer.decode([pe[me].item()],{skip_special_tokens:!0});if(et==="")continue;const Ye=(0,c.softmax)(Pe.data);Te.push({entity:rt,score:Ye[Be],index:me,word:et})}Q.push(Te)}return Y?Q:Q[0]}}class g extends v{constructor(J){super(J)}async _call(J,ue,{top_k:Y=1}={}){const Se=this.tokenizer(J,{text_pair:ue,padding:!0,truncation:!0}),{start_logits:Ae,end_logits:Oe}=await this.model(Se),Ne=Se.input_ids.tolist(),Q=Se.attention_mask.tolist(),re=this.tokenizer.all_special_ids,pe=[];for(let Me=0;Me<Ae.dims[0];++Me){const Te=Ne[Me],me=Te.findIndex(Fe=>Fe==this.tokenizer.sep_token_id);Q[Me].map((Fe,lt)=>Fe==1&&(lt===0||lt>me&&re.findIndex(It=>It==Te[lt])===-1));const Pe=Ae[Me].tolist(),Be=Oe[Me].tolist();for(let Fe=1;Fe<Pe.length;++Fe)(Q[Me]==0||Fe<=me||re.findIndex(lt=>lt==Te[Fe])!==-1)&&(Pe[Fe]=-1/0,Be[Fe]=-1/0);const rt=(0,c.softmax)(Pe).map((Fe,lt)=>[Fe,lt]),et=(0,c.softmax)(Be).map((Fe,lt)=>[Fe,lt]);rt[0][0]=0,et[0][0]=0;const Ye=(0,l.product)(rt,et).filter(Fe=>Fe[0][1]<=Fe[1][1]).map(Fe=>[Fe[0][1],Fe[1][1],Fe[0][0]*Fe[1][0]]).sort((Fe,lt)=>lt[2]-Fe[2]);for(let Fe=0;Fe<Math.min(Ye.length,Y);++Fe){const[lt,It,Qt]=Ye[Fe],Gt=Te.slice(lt,It+1),zr=this.tokenizer.decode(Gt,{skip_special_tokens:!0});pe.push({answer:zr,score:Qt})}}return Y===1?pe[0]:pe}}class _ extends v{constructor(J){super(J)}async _call(J,{top_k:ue=5}={}){const Y=this.tokenizer(J,{padding:!0,truncation:!0}
3366),{logits:Se}=await this.model(Y),Ae=[],Oe=Y.input_ids.tolist();for(let Ne=0;Ne<Oe.length;++Ne){const Q=Oe[Ne],re=Q.findIndex(Pe=>Pe==this.tokenizer.mask_token_id);if(re===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const pe=Se[Ne][re],Me=await(0,p.topk)(new p.Tensor("float32",(0,c.softmax)(pe.data),pe.dims),ue),Te=Me[0].tolist(),me=Me[1].tolist();Ae.push(me.map((Pe,Be)=>{const rt=Q.slice();return rt[re]=Pe,{score:Te[Be],token:Number(Pe),token_str:this.tokenizer.decode([Pe]),sequence:this.tokenizer.decode(rt,{skip_special_tokens:!0})}}))}return Array.isArray(J)?Ae:Ae[0]}}class w extends v{constructor(ue){super(ue);ce(this,"_key","generated_text")}async _call(ue,Y={}){Array.isArray(ue)||(ue=[ue]),this.model.config.prefix&&(ue=ue.map(re=>this.model.config.prefix+re));const Se=this.model.config.task_specific_params;Se&&Se[this.task]&&Se[this.task].prefix&&(ue=ue.map(re=>Se[this.task].prefix+re));const Ae=this.tokenizer,Oe={padding:!0,truncation:!0};let Ne;this instanceof b&&"_build_translation_inputs"in Ae?Ne=Ae._build_translation_inputs(ue,Oe,Y):Ne=Ae(ue,Oe);const Q=await this.model.generate({...Ne,...Y});return Ae.batch_decode(Q,{skip_special_tokens:!0}).map(re=>({[this._key]:re}))}}class x extends w{constructor(ue){super(ue);ce(this,"_key","summary_text")}}class b extends w{constructor(ue){super(ue);ce(this,"_key","translation_text")}}function M(ve){return Array.isArray(ve)&&ve.every(J=>"role"in J&&"content"in J)}class S extends v{constructor(J){super(J)}async _call(J,ue={}){let Y=!1,Se=!1,Ae;if(typeof J=="string")Ae=J=[J];else if(Array.isArray(J)&&J.every(me=>typeof me=="string"))Y=!0,Ae=J;else{if(M(J))J=[J];else if(Array.isArray(J)&&J.every(M))Y=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");Se=!0,Ae=J.map(me=>this.tokenizer.apply_chat_template(me,{tokenize:!1,add_generation_prompt:!0}))}const Oe=ue.add_special_tokens??!1,Ne=Se?!1:ue.return_full_text??!0;this.tokenizer.padding_side="left";const Q=this.tokenizer(Ae,{add_special_tokens:Oe,padding:!0,truncation:!0}),re=await this.model.generate({...Q,...ue}),pe=this.tokenizer.batch_decode(re,{skip_special_tokens:!0});let Me;!Ne&&Q.input_ids.dims.at(-1)>0&&(Me=this.tokenizer.batch_decode(Q.input_ids,{skip_special_tokens:!0}).map(me=>me.length));const Te=Array.from({length:J.length},me=>[]);for(let me=0;me<pe.length;++me){const Pe=Math.floor(me/re.dims[0]*J.length);Me&&(pe[me]=pe[me].slice(Me[Pe])),Te[Pe].push({generated_text:Se?[...J[Pe],{role:"assistant",content:pe[me]}]:pe[me]})}return!Y&&Te.length===1?Te[0]:Te}}class j extends v{constructor(J){super(J),this.label2id=Object.fromEntries(Object.entries(this.model.config.label2id).map(([ue,Y])=>[ue.toLowerCase(),Y])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(J,ue,{hypothesis_template:Y="This example is {}.",multi_label:Se=!1}={}){const Ae=Array.isArray(J);Ae||(J=[J]),Array.isArray(ue)||(ue=[ue]);const Oe=ue.map(re=>Y.replace("{}",re)),Ne=Se||ue.length===1,Q=[];for(const re of J){const pe=[];for(const me of Oe){const Pe=this.tokenizer(re,{text_pair:me,padding:!0,truncation:!0}),Be=await this.model(Pe);Ne?pe.push([Be.logits.data[this.contradiction_id],Be.logits.data[this.entailment_id]]):pe.push(Be.logits.data[this.entailment_id])}const Te=(Ne?pe.map(me=>(0,c.softmax)(me)[1]):(0,c.softmax)(pe)).map((me,Pe)=>[me,Pe]).sort((me,Pe)=>Pe[0]-me[0]);Q.push({sequence:re,labels:Te.map(me=>ue[me[1]]),scores:Te.map(me=>me[0])})}return Ae?Q:Q[0]}}class I extends v{constructor(J){super(J)}async _call(J,{pooling:ue="none",normalize:Y=!1,quantize:Se=!1,precision:Ae="binary"}={}){const Oe=this.tokenizer(J,{padding:!0,truncation:!0}),Ne=await this.model(Oe);let Q=Ne.last_hidden_state??Ne.logits??Ne.token_embeddings;if(ue!=="none")if(ue==="mean")Q=(0,p.mean_pooling)(Q,Oe.attention_mask);else if(ue==="cls")Q=Q.slice(null,0);else throw Error(`Pooling method '${ue}' not supported.`);return Y&&(Q=Q.normalize(2,-1)),Se&&(Q=(0,p.quantize_embeddings)(Q,Ae)),Q}}class q extends v{constructor(J){super(J)}async _call(J,{pool:ue=null}={}){const Y=await h(J),{pixel_values:Se}=await this.processor(Y),Ae=await this.model({pixel_values:Se});let Oe;if(ue){if(!("pooler_output"in Ae))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Oe=Ae.pooler_output}else Oe=Ae.last_hidden_state??Ae.logits??Ae.image_embeds;return Oe}}class U extends v{constructor(J){super(J)}async _call(J,{top_k:ue=5}={}){const Y=this.processor.feature_extractor.config.sampling_rate,Se=await f(J,Y),Ae=this.model.config.id2label,Oe=[];for(const Ne of Se){const Q=await this.processor(Ne),pe=(await this.model(Q)).logits[0],Me=await(0,p.topk)(new p.Tensor("float32",(0,c.softmax)(pe.data),pe.dims),ue),Te=Me[0].tolist(),Pe=Me[1].tolist().map((Be,rt)=>({label:Ae?Ae[Be]:`LABEL_${Be}`,score:Te[rt]}));Oe.push(Pe)}return Array.isArray(J)?Oe:Oe[0]}}class R extends v{constructor(J){super(J)}async _call(J,ue,{hypothesis_template:Y="This is a sound of {}."}={}){const Se=!Array.isArray(J);Se&&(J=[J]);const Ae=ue.map(pe=>Y.replace("{}",pe)),Oe=this.tokenizer(Ae,{padding:!0,truncation:!0}
3366),Ne=this.processor.feature_extractor.config.sampling_rate,Q=await f(J,Ne),re=[];for(const pe of Q){const Me=await this.processor(pe),Te=await this.model({...Oe,...Me}),me=(0,c.softmax)(Te.logits_per_audio.data);re.push([...me].map((Pe,Be)=>({score:Pe,label:ue[Be]})))}return Se?re[0]:re}}class K extends v{constructor(J){super(J)}async _call(J,ue={}){switch(this.model.config.model_type){case"whisper":case"lite-whisper":return this._call_whisper(J,ue);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(J,ue);case"moonshine":return this._call_moonshine(J,ue);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(J,ue){ue.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),ue.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const Y=!Array.isArray(J);Y&&(J=[J]);const Se=this.processor.feature_extractor.config.sampling_rate,Ae=await f(J,Se),Oe=[];for(const Ne of Ae){const Q=await this.processor(Ne),pe=(await this.model(Q)).logits[0],Me=[];for(const me of pe)Me.push((0,c.max)(me.data)[1]);const Te=this.tokenizer.decode(Me);Oe.push({text:Te})}return Y?Oe[0]:Oe}async _call_whisper(J,ue){const Y=ue.return_timestamps??!1,Se=ue.chunk_length_s??0,Ae=ue.force_full_sequences??!1;let Oe=ue.stride_length_s??null;const Ne={...ue};Y==="word"&&(Ne.return_token_timestamps=!0,Ne.return_timestamps=!1);const Q=!Array.isArray(J);Q&&(J=[J]);const re=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,pe=this.processor.feature_extractor.config.hop_length,Me=this.processor.feature_extractor.config.sampling_rate,Te=await f(J,Me),me=[];for(const Pe of Te){let Be=[];if(Se>0){if(Oe===null)Oe=Se/6;else if(Se<=Oe)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Ye=Me*Se,Fe=Me*Oe,lt=Ye-2*Fe;let It=0;for(;;){const Qt=It+Ye,Gt=Pe.subarray(It,Qt),zr=await this.processor(Gt),hr=It===0,Tt=Qt>=Pe.length;if(Be.push({stride:[Gt.length,hr?0:Fe,Tt?0:Fe],input_features:zr.input_features,is_last:Tt}),Tt)break;It+=lt}}else Be=[{stride:[Pe.length,0,0],input_features:(await this.processor(Pe)).input_features,is_last:!0}];for(const Ye of Be){Ne.num_frames=Math.floor(Ye.stride[0]/pe);const Fe=await this.model.generate({inputs:Ye.input_features,...Ne});Y==="word"?(Ye.tokens=Fe.sequences.tolist()[0],Ye.token_timestamps=Fe.token_timestamps.tolist()[0].map(lt=>(0,c.round)(lt,2))):Ye.tokens=Fe[0].tolist(),Ye.stride=Ye.stride.map(lt=>lt/Me)}const[rt,et]=this.tokenizer._decode_asr(Be,{time_precision:re,return_timestamps:Y,force_full_sequences:Ae});me.push({text:rt,...et})}return Q?me[0]:me}async _call_moonshine(J,ue){const Y=!Array.isArray(J);Y&&(J=[J]);const Se=this.processor.feature_extractor.config.sampling_rate,Ae=await f(J,Se),Oe=[];for(const Ne of Ae){const Q=await this.processor(Ne),re=Math.floor(Ne.length/Se)*6,pe=await this.model.generate({max_new_tokens:re,...ue,...Q}),Me=this.processor.batch_decode(pe,{skip_special_tokens:!0})[0];Oe.push({text:Me})}return Y?Oe[0]:Oe}}class H extends v{constructor(J){super(J)}async _call(J,ue={}){const Y=Array.isArray(J),Se=await h(J),{pixel_values:Ae}=await this.processor(Se),Oe=[];for(const Ne of Ae){Ne.dims=[1,...Ne.dims];const Q=await this.model.generate({inputs:Ne,...ue}),re=this.tokenizer.batch_decode(Q,{skip_special_tokens:!0}).map(pe=>({generated_text:pe.trim()}));Oe.push(re)}return Y?Oe:Oe[0]}}class ee extends v{constructor(J){super(J)}async _call(J,{top_k:ue=5}={}){const Y=await h(J),{pixel_values:Se}=await this.processor(Y),Ae=await this.model({pixel_values:Se}),Oe=this.model.config.id2label,Ne=[];for(const Q of Ae.logits){const re=await(0,p.topk)(new p.Tensor("float32",(0,c.softmax)(Q.data),Q.dims),ue),pe=re[0].tolist(),Te=re[1].tolist().map((me,Pe)=>({label:Oe?Oe[me]:`LABEL_${me}`,score:pe[Pe]}));Ne.push(Te)}return Array.isArray(J)?Ne:Ne[0]}}class te extends v{constructor(J){super(J),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(J,{threshold:ue=.5,mask_threshold:Y=.5,overlap_mask_area_threshold:Se=.8,label_ids_to_fuse:Ae=null,target_sizes:Oe=null,subtask:Ne=null}={}){if(Array.isArray(J)&&J.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const re=await h(J),pe=re.map(Ye=>[Ye.height,Ye.width]),Me=await this.processor(re),{inputNames:Te,outputN
3366ames:me}=this.model.sessions.model;if(!Te.includes("pixel_values")){if(Te.length!==1)throw Error(`Expected a single input name, but got ${Te.length} inputs: ${Te}.`);const Ye=Te[0];if(Ye in Me)throw Error(`Input name ${Ye} already exists in the inputs.`);Me[Ye]=Me.pixel_values}const Pe=await this.model(Me);let Be=null;if(Ne!==null)Be=this.subtasks_mapping[Ne];else if(this.processor.image_processor){for(const[Ye,Fe]of Object.entries(this.subtasks_mapping))if(Fe in this.processor.image_processor){Be=this.processor.image_processor[Fe].bind(this.processor.image_processor),Ne=Ye;break}}const rt=this.model.config.id2label,et=[];if(Ne)if(Ne==="panoptic"||Ne==="instance"){const Ye=Be(Pe,ue,Y,Se,Ae,Oe??pe)[0],Fe=Ye.segmentation;for(const lt of Ye.segments_info){const It=new Uint8ClampedArray(Fe.data.length);for(let Gt=0;Gt<Fe.data.length;++Gt)Fe.data[Gt]===lt.id&&(It[Gt]=255);const Qt=new u.RawImage(It,Fe.dims[1],Fe.dims[0],1);et.push({score:lt.score,label:rt[lt.label_id],mask:Qt})}}else if(Ne==="semantic"){const{segmentation:Ye,labels:Fe}=Be(Pe,Oe??pe)[0];for(const lt of Fe){const It=new Uint8ClampedArray(Ye.data.length);for(let Gt=0;Gt<Ye.data.length;++Gt)Ye.data[Gt]===lt&&(It[Gt]=255);const Qt=new u.RawImage(It,Ye.dims[1],Ye.dims[0],1);et.push({score:null,label:rt[lt],mask:Qt})}}else throw Error(`Subtask ${Ne} not supported.`);else{const Fe=Pe[me[0]];for(let lt=0;lt<pe.length;++lt){const It=pe[lt],Qt=Fe[lt];Qt.data.some(zr=>zr<-1e-5||zr>1+1e-5)&&Qt.sigmoid_();const Gt=await u.RawImage.fromTensor(Qt.mul_(255).to("uint8")).resize(It[1],It[0]);et.push({label:null,score:null,mask:Gt})}}return et}}class V extends te{constructor(J){super(J)}async _call(J,ue={}){if(Array.isArray(J)&&J.length!==1)throw Error("Background removal pipeline currently only supports a batch size of 1.");const Se=await h(J),Ae=await super._call(J,ue);return Se.map((Ne,Q)=>{const re=Ne.clone();return re.putAlpha(Ae[Q].mask),re})}}class ae extends v{constructor(J){super(J)}async _call(J,ue,{hypothesis_template:Y="This is a photo of {}"}={}){const Se=Array.isArray(J),Ae=await h(J),Oe=ue.map(Te=>Y.replace("{}",Te)),Ne=this.tokenizer(Oe,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:Q}=await this.processor(Ae),re=await this.model({...Ne,pixel_values:Q}),pe=this.model.config.model_type==="siglip"?Te=>Te.sigmoid().data:Te=>(0,c.softmax)(Te.data),Me=[];for(const Te of re.logits_per_image){const Pe=[...pe(Te)].map((Be,rt)=>({score:Be,label:ue[rt]}));Pe.sort((Be,rt)=>rt.score-Be.score),Me.push(Pe)}return Se?Me:Me[0]}}class ne extends v{constructor(J){super(J)}async _call(J,{threshold:ue=.9,percentage:Y=!1}={}){const Se=Array.isArray(J);if(Se&&J.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const Ae=await h(J),Oe=Y?null:Ae.map(me=>[me.height,me.width]),{pixel_values:Ne,pixel_mask:Q}=await this.processor(Ae),re=await this.model({pixel_values:Ne,pixel_mask:Q}),pe=this.processor.image_processor.post_process_object_detection(re,ue,Oe),Me=this.model.config.id2label,Te=pe.map(me=>me.boxes.map((Pe,Be)=>({score:me.scores[Be],label:Me[me.classes[Be]],box:m(Pe,!Y)})));return Se?Te:Te[0]}}class L extends v{constructor(J){super(J)}async _call(J,ue,{threshold:Y=.1,top_k:Se=null,percentage:Ae=!1}={}){const Oe=Array.isArray(J),Ne=await h(J),Q=this.tokenizer(ue,{padding:!0,truncation:!0}),re=await this.processor(Ne),pe=[];for(let Me=0;Me<Ne.length;++Me){const Te=Ne[Me],me=Ae?null:[[Te.height,Te.width]],Pe=re.pixel_values[Me].unsqueeze_(0),Be=await this.model({...Q,pixel_values:Pe});let rt;if("post_process_grounded_object_detection"in this.processor){const et=this.processor.post_process_grounded_object_detection(Be,Q.input_ids,{box_threshold:Y,text_threshold:Y,target_sizes:me})[0];rt=et.boxes.map((Ye,Fe)=>({score:et.scores[Fe],label:et.labels[Fe],box:m(Ye,!Ae)}))}else{const et=this.processor.image_processor.post_process_object_detection(Be,Y,me,!0)[0];rt=et.boxes.map((Ye,Fe)=>({score:et.scores[Fe],label:ue[et.classes[Fe]],box:m(Ye,!Ae)}))}rt.sort((et,Ye)=>Ye.score-et.score),Se!==null&&(rt=rt.slice(0,Se)),pe.push(rt)}return Oe?pe:pe[0]}}class $ extends v{constructor(J){super(J)}async _call(J,ue,Y={}){const Se=(await h(J))[0],{pixel_values:Ae}=await this.processor(Se),Oe=`<s_docvqa><s_question>${ue}</s_question><s_answer>`,Ne=this.tokenizer(Oe,{add_special_tokens:!1,padding:!0,truncation:!0}
vendor: 6,024 bytes, line 3366
3366).input_ids,Q=await this.model.generate({inputs:Ae,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:Ne,...Y}),pe=this.tokenizer.batch_decode(Q)[0].match(/<s_answer>(.*?)<\/s_answer>/);let Me=null;return pe&&pe.length>=2&&(Me=pe[1].trim()),[{answer:Me}]}}class G extends v{constructor(ue){super(ue);ce(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=ue.vocoder??null}async _call(ue,{speaker_embeddings:Y=null}={}){return this.processor?this._call_text_to_spectrogram(ue,{speaker_embeddings:Y}):this._call_text_to_waveform(ue)}async _call_text_to_waveform(ue){const Y=this.tokenizer(ue,{padding:!0,truncation:!0}),{waveform:Se}=await this.model(Y),Ae=this.model.config.sampling_rate;return new d.RawAudio(Se.data,Ae)}async _call_text_to_spectrogram(ue,{speaker_embeddings:Y}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await s.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:"fp32"})),(typeof Y=="string"||Y instanceof URL)&&(Y=new Float32Array(await(await fetch(Y)).arrayBuffer())),Y instanceof Float32Array)Y=new p.Tensor("float32",Y,[1,Y.length]);else if(!(Y instanceof p.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:Se}=this.tokenizer(ue,{padding:!0,truncation:!0}),{waveform:Ae}=await this.model.generate_speech(Se,Y,{vocoder:this.vocoder}),Oe=this.processor.feature_extractor.config.sampling_rate;return new d.RawAudio(Ae.data,Oe)}}class se extends v{constructor(J){super(J)}async _call(J){const ue=await h(J),Y=await this.processor(ue),Se=await this.model(Y),Ae=[];for(const Oe of Se.reconstruction){const Ne=Oe.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");Ae.push(u.RawImage.fromTensor(Ne))}return Ae.length>1?Ae:Ae[0]}}class _e extends v{constructor(J){super(J)}async _call(J){const ue=await h(J),Y=await this.processor(ue),{predicted_depth:Se}=await this.model(Y),Ae=[];for(let Oe=0;Oe<ue.length;++Oe){const Ne=Se[Oe],[Q,re]=Ne.dims.slice(-2),[pe,Me]=ue[Oe].size,Te=(await(0,p.interpolate_4d)(Ne.view(1,1,Q,re),{size:[Me,pe],mode:"bilinear"})).view(Me,pe),me=Te.min().item(),Pe=Te.max().item(),Be=Te.sub(me).div_(Pe-me).mul_(255).to("uint8").unsqueeze(0),rt=u.RawImage.fromTensor(Be);Ae.push({predicted_depth:Te,depth:rt})}return Ae.length>1?Ae:Ae[0]}}const de=Object.freeze({"text-classification":{tokenizer:n.AutoTokenizer,pipeline:k,model:s.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:n.AutoTokenizer,pipeline:y,model:s.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:n.AutoTokenizer,pipeline:g,model:s.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:n.AutoTokenizer,pipeline:_,model:s.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:n.AutoTokenizer,pipeline:x,model:s.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:n.AutoTokenizer,pipeline:b,model:s.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:n.AutoTokenizer,pipeline:w,model:s.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:n.AutoTokenizer,pipeline:S,model:s.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:n.AutoTokenizer,pipeline:j,model:s.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:U,model:s.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:n.AutoTokenizer,pipeline:R,model:s.AutoModel,processor:a.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:n.AutoTokenizer,pipeline:K,model:[s.AutoModelForSpeechSeq2Seq,s.AutoModelForCTC],processor:a.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:n.AutoTokenizer,pipeline:G,model:[s.AutoModelForTextToWaveform,s.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:n.AutoTokenizer,pipeline:H,model:s.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:ee,model:s.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:te,model:[s.AutoModelForImageSegmentation,s.AutoModelForSemanticSegmentation,s.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"background-removal":{pipeline:V,model:[s.AutoModelForImageSegmentation,s.AutoModelForSemanticSegmentation,s.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:"Xenova/modnet"},type:"image"},"zero-shot-image-classification":{tokenizer:n.AutoTokenizer,pipeline:ae,model:s.AutoModel,processor:a.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:ne,model:s.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:n.AutoTokenizer,pipeline:L,model:s.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:n.AutoTokenizer,pipeline:$,model:s.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:"Xenova/d
3366onut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:se,model:s.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:_e,model:s.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:n.AutoTokenizer,pipeline:I,model:s.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:q,model:[s.AutoModelForImageFeatureExtraction,s.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),Ee=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function ze(ve,J=null,{progress_callback:ue=null,config:Y=null,cache_dir:Se=null,local_files_only:Ae=!1,revision:Oe="main",device:Ne=null,dtype:Q=null,subfolder:re="onnx",use_external_data_format:pe=null,model_file_name:Me=null,session_options:Te={}}={}){ve=Ee[ve]??ve;const me=de[ve.split("_",1)[0]];if(!me)throw Error(`Unsupported pipeline: ${ve}. Must be one of [${Object.keys(de)}]`);J||(J=me.default.model,console.log(`No model specified. Using default model: "${J}".`));const Pe={progress_callback:ue,config:Y,cache_dir:Se,local_files_only:Ae,revision:Oe,device:Ne,dtype:Q,subfolder:re,use_external_data_format:pe,model_file_name:Me,session_options:Te},Be=new Map([["tokenizer",me.tokenizer],["model",me.model],["processor",me.processor]]),rt=await Ke(Be,J,Pe);rt.task=ve,(0,l.dispatchCallback)(ue,{status:"ready",task:ve,model:J});const et=me.pipeline;return new et(rt)}async function Ke(ve,J,ue){const Y=Object.create(null),Se=[];for(const[Ae,Oe]of ve.entries()){if(!Oe)continue;let Ne;Array.isArray(Oe)?Ne=new Promise(async(Q,re)=>{var Me,Te;let pe;for(const me of Oe){if(me===null){Q(null);return}try{Q(await me.from_pretrained(J,ue));return}catch(Pe){if((Me=Pe.message)!=null&&Me.includes("Unsupported model type"))pe=Pe;else if((Te=Pe.message)!=null&&Te.includes("Could not locate file"))pe=Pe;else{re(Pe);return}}}re(pe)}):Ne=Oe.from_pretrained(J,ue),Y[Ae]=Ne,Se.push(Ne)}await Promise.all(Se);for(const[Ae,Oe]of Object.entries(Y))Y[Ae]=await Oe;return Y}},
3366"./src/tokenizers.js":(e,t,r)=>{r.r(t),r.d(t,{AlbertTokenizer:()=>Xt,AutoTokenizer:()=>li,BartTokenizer:()=>ni,BertTokenizer:()=>Nt,BlenderbotSmallTokenizer:()=>dl,BlenderbotTokenizer:()=>cl,BloomTokenizer:()=>ai,CLIPTokenizer:()=>Sa,CamembertTokenizer:()=>Xs,CodeGenTokenizer:()=>sa,CodeLlamaTokenizer:()=>An,CohereTokenizer:()=>pl,ConvBertTokenizer:()=>vn,DebertaTokenizer:()=>pt,DebertaV2Tokenizer:()=>ar,DistilBertTokenizer:()=>Kn,ElectraTokenizer:()=>ea,EsmTokenizer:()=>gt,FalconTokenizer:()=>We,GPT2Tokenizer:()=>ps,GPTNeoXTokenizer:()=>it,GemmaTokenizer:()=>ta,Grok1Tokenizer:()=>ra,HerbertTokenizer:()=>vr,LlamaTokenizer:()=>ii,M2M100Tokenizer:()=>en,MBart50Tokenizer:()=>Ma,MBartTokenizer:()=>$s,MPNetTokenizer:()=>ns,MarianTokenizer:()=>ol,MgpstrTokenizer:()=>hl,MobileBertTokenizer:()=>xt,NllbTokenizer:()=>na,NougatTokenizer:()=>Xi,PreTrainedTokenizer:()=>je,Qwen2Tokenizer:()=>ir,RoFormerTokenizer:()=>Sr,RobertaTokenizer:()=>si,SiglipTokenizer:()=>il,SpeechT5Tokenizer:()=>oi,SqueezeBertTokenizer:()=>yt,T5Tokenizer:()=>ri,TokenizerModel:()=>q,VitsTokenizer:()=>ul,Wav2Vec2CTCTokenizer:()=>ll,WhisperTokenizer:()=>ln,XLMRobertaTokenizer:()=>Ea,XLMTokenizer:()=>Ta,is_chinese_char:()=>_});var n=r("./src/utils/generic.js"),s=r("./src/utils/core.js"),a=r("./src/utils/hub.js"),i=r("./src/utils/maths.js"),l=r("./src/utils/tensor.js"),c=r("./src/utils/data-structures.js"),d=r("./node_modules/@huggingface/jinja/dist/index.js"),p=r("./src/models/whisper/common_whisper.js");async function u(we,N){const Z=await Promise.all([(0,a.getModelJSON)(we,"tokenizer.json",!0,N),(0,a.getModelJSON)(we,"tokenizer_config.json",!0,N)]);return N.legacy!==null&&(Z[1].legacy=N.legacy),Z}function h(we,N){const Z=[];let ie=0;for(const fe of we.matchAll(N)){const ye=fe[0];ie<fe.index&&Z.push(we.slice(ie,fe.index)),ye.length>0&&Z.push(ye),ie=fe.index+ye.length}return ie<we.length&&Z.push(we.slice(ie)),Z}function f(we,N=!0){if(we.Regex!==void 0){let Z=we.Regex.replace(/\\([#&~])/g,"$1");for(const[ie,fe]of j)Z=Z.replaceAll(ie,fe);return new RegExp(Z,"gu")}else if(we.String!==void 0){const Z=(0,s.escapeRegExp)(we.String);return new RegExp(N?Z:`(${Z})`,"gu")}else return console.warn("Unknown pattern type:",we),null}function m(we){return new Map(Object.entries(we))}function v(we){const N=we.dims;switch(N.length){case 1:return we.tolist();case 2:if(N[0]!==1)throw new Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return we.tolist()[0];default:throw new Error(`Expected tensor to have 1-2 dimensions, got ${N.length}.`)}}function k(we){return we.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function y(we){return we.replace(new RegExp("\\p{M}","gu"),"")}function g(we){return y(we.toLowerCase())}function _(we){return we>=19968&&we<=40959||we>=13312&&we<=19903||we>=131072&&we<=173791||we>=173824&&we<=177983||we>=177984&&we<=178207||we>=178208&&we<=183983||we>=63744&&we<=64255||we>=194560&&we<=195103}function w(we,N,Z){const ie=[];let fe=0;for(;fe<we.length;){if(ie.push(we[fe]),(N.get(we[fe])??Z)!==Z){++fe;continue}for(;++fe<we.length&&(N.get(we[fe])??Z)===Z;)N.get(ie.at(-1))!==Z&&(ie[ie.length-1]+=we[fe])}return ie}function x(we){return we.match(/\S+/g)||[]}const b="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",M=new RegExp(`^[${b}]+$`,"gu"),S=".,!?…。,、।۔،",j=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"],[` ?[^(\\s|[${S}])]+`,` ?[^\\s${S}]+`]]);class I{constructor(N){this.content=N.content,this.id=N.id,this.single_word=N.single_word??!1,this.lstrip=N.lstrip??!1,this.rstrip=N.rstrip??!1,this.special=N.special??!1,this.normalized=N.normalized??null}}class q extends n.Callable{constructor(N){super(),this.config=N,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(N,...Z){switch(N.type){case"WordPiece":return new U(N);case"Unigram":return new R(N,...Z);case"BPE":return new ee(N);default:if(N.vocab)return Array.isArray(N.vocab)?new R(N,...Z):typeof N.vocab=="object"&&N.continuing_subword_prefix&&N.unk_token?new U(N):new te(N,...Z);throw new Error(`Unknown TokenizerModel type: ${N.type}`)}}_call(N){return N=this.encode(N),this.fuse_unk&&(N=w(N,this.tokens_to_ids,this.unk_token_id)),N}encode(N){throw Error("encode should be implemented in subclass.")}convert_tokens_to_ids(N){return N.map(Z=>this.tokens_to_ids.get(Z)??this.unk_token_id)}convert_ids_to_tokens(N){return N.map(Z=>this.vocab[Z]??this.unk_token)}}class U extends q{constructor(N){super(N),this.tokens_to_ids=m(N.vocab),this.unk_token_id=this.tokens_to_ids.get(N.unk_token),this.unk_token=N.unk_token,this.max_input_chars_per_word=N.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[Z,ie]of this.tokens_to_ids)this.vocab[ie]=Z}encode(N){const Z=[];for(const ie of N){const fe=[...ie];if(fe.length>this.max_input_chars_per_word){Z.push(this.unk_token);continue}let ye=!1,Ie=0;const Qe=[];for(;Ie<fe.length;){let st=fe.length,tt=null;for(;Ie<st;){let ot=fe.slice(Ie,st).join("");if(Ie>0&&(ot=this.config.continuing_subword_prefix+ot),this.tokens_to_ids.has(ot)){tt=ot;break}--st}if(tt===null){ye=!0;break}Qe.push(tt),Ie=st}ye?Z.push(this.unk_token):Z.push(...Qe)}return Z}}class R extends q{constructor(N,Z){super(N);const ie=N.vocab.length;this.vocab=new Array(ie),this.scores=new Array(ie);for(let fe=0;fe<ie;++fe)[this.vocab[fe],this.scores[fe]]=N.vocab[fe];this.unk_token_id=N.unk_id,this.unk_token=this.vocab[N.unk_id],this.tokens_to_ids=new Map(this.vocab.map((fe,ye)=>[fe,ye])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=Z.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,i.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(N){const Z=N.chars,ie=1;let fe=0;for(;fe<Z.length;){let ye=!1;const Ie=Z.slice(fe).join(""),Qe=this.trie.commonPrefixSearch(Ie);for(const st of Qe){const tt=this.tokens_to_ids.get(st),ot=this.scores[tt],Et=(0,s.len)(st);N.insert(fe,Et,ot,tt),!ye&&Et===ie&&(ye=!0)}ye||N.insert(fe,ie,this.unk_score,this.unk_token_id),fe+=ie}}tokenize(N){const Z=new c.TokenLattice(N,this.bos_token_id,this.eos_token_id);return this.populateNodes(Z),Z.tokens()}encode(N){const Z=[];for(const ie of N){const fe=this.tokenize(ie);Z.push(...fe)}return Z}}const K=(()=>{const we=[...Array.from({length:94},(fe,ye)=>ye+33),...Array.from({length:12},(fe,ye)=>ye+161),...Array.from({length:82},(fe,ye)=>ye+174)],N=we.slice();let Z=0;for(let fe=0;fe<256;++fe)we.includes(fe)||(we.push(fe),N.push(256+Z),Z+=1);const ie=N.map(fe=>String.fromCharCode(fe));return Object.fromEntries(we.map((fe,ye)=>[fe,ie[ye]]))})(),H=(0,s.reverseDictionary)(K);class ee extends q{constructor(N){super(N),this.tokens_to_ids=m(N.vocab),this.unk_token_id=this.tokens_to_ids.get(N.unk_token),this.unk_token=N.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[ie,fe]of this.tokens_to_ids)this.vocab[fe]=ie;const Z=Array.isArray(N.merges[0]);this.merges=Z?N.merges:N.merges.map(ie=>ie.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((ie,fe)=>[JSON.stringify(ie),fe])),this.end_of_word_suffix=N.end_of_word_suffix,this.continuing_subword_suffix=N.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(N){if(N.length===0)return[];const Z=this.cache.get(N);if(Z!==void 0)return Z;const ie=Array.from(N);this.end_of_word_suffix&&(ie[ie.length-1]+=this.end_of_word_suffix);let fe=[];if(ie.length>1){const ye=new c.PriorityQueue((st,tt)=>st.score<tt.score);let Ie={token:ie[0],bias:0,prev:null,next:null},Qe=Ie;for(let st=1;st<ie.length;++st){const tt={bias:st/ie.length,token:ie[st],prev:Qe,next:null};Qe.next=tt,this._add_node(ye,Qe),Qe=tt}for(;!ye.isEmpty();){const st=ye.pop();if(st.deleted||!st.next||st.next.deleted)continue;if(st.deleted=!0,st.next.deleted=!0,st.prev){const ot={...st.prev};st.prev.deleted=!0,st.prev=ot,ot.prev?ot.prev.next=ot:Ie=ot}const tt={token:st.token+st.next.token,bias:st.bias,prev:st.prev,next:st.next.next};tt.prev?(tt.prev.next=tt,this._add_node(ye,tt.prev)):Ie=tt,tt.next&&(tt.next.prev=tt,this._add_node(ye,tt))}for(let st=Ie;st!==null;st=st.next)fe.push(st.token)}else fe=ie;if(this.continuing_subword_suffix)for(let ye=0;ye<fe.length-1;++ye)fe[ye]+=this.continuing_subword_suffix;return N.length<this.max_length_to_cache&&this.cache.put(N,fe),fe}_add_node(N,Z){const ie=this.bpe_ranks.get(JSON.stringify([Z.token,Z.next.token]));ie!==void 0&&(Z.score=ie+Z.bias,N.push(Z))}encode(N){const Z=[];
3366for(const ie of N){if(this.ignore_merges&&this.tokens_to_ids.has(ie)){Z.push(ie);continue}const fe=this.bpe(ie);for(const ye of fe)if(this.tokens_to_ids.has(ye))Z.push(ye);else if(this.byte_fallback){const Ie=Array.from(this.text_encoder.encode(ye)).map(Qe=>`<0x${Qe.toString(16).toUpperCase().padStart(2,"0")}>`);Ie.every(Qe=>this.tokens_to_ids.has(Qe))?Z.push(...Ie):Z.push(this.unk_token)}else Z.push(this.unk_token)}return Z}}class te extends q{constructor(N,Z){super(N),this.tokens_to_ids=m(Z.target_lang?N.vocab[Z.target_lang]:N.vocab),this.bos_token=Z.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=Z.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=Z.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=Z.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[ie,fe]of this.tokens_to_ids)this.vocab[fe]=ie}encode(N){return N}}class V extends n.Callable{constructor(N){super(),this.config=N}static fromConfig(N){if(N===null)return null;switch(N.type){case"BertNormalizer":return new ve(N);case"Precompiled":return new Tt(N);case"Sequence":return new Ke(N);case"Replace":return new ae(N);case"NFC":return new L(N);case"NFD":return new $(N);case"NFKC":return new G(N);case"NFKD":return new se(N);case"Strip":return new _e(N);case"StripAccents":return new de(N);case"Lowercase":return new Ee(N);case"Prepend":return new ze(N);default:throw new Error(`Unknown Normalizer type: ${N.type}`)}}normalize(N){throw Error("normalize should be implemented in subclass.")}_call(N){return this.normalize(N)}}class ae extends V{normalize(N){const Z=f(this.config.pattern);return Z===null?N:N.replaceAll(Z,this.config.content)}}class ne extends V{constructor(){super(...arguments);ce(this,"form")}normalize(Z){return Z=Z.normalize(this.form),Z}}class L extends ne{constructor(){super(...arguments);ce(this,"form","NFC")}}class $ extends ne{constructor(){super(...arguments);ce(this,"form","NFD")}}class G extends ne{constructor(){super(...arguments);ce(this,"form","NFKC")}}class se extends ne{constructor(){super(...arguments);ce(this,"form","NFKD")}}class _e extends V{normalize(N){return this.config.strip_left&&this.config.strip_right?N=N.trim():(this.config.strip_left&&(N=N.trimStart()),this.config.strip_right&&(N=N.trimEnd())),N}}class de extends V{normalize(N){return N=y(N),N}}class Ee extends V{normalize(N){return N=N.toLowerCase(),N}}class ze extends V{normalize(N){return N=this.config.prepend+N,N}}class Ke extends V{constructor(N){super(N),this.normalizers=N.normalizers.map(Z=>V.fromConfig(Z))}normalize(N){return this.normalizers.reduce((Z,ie)=>ie.normalize(Z),N)}}class ve extends V{_tokenize_chinese_chars(N){const Z=[];for(let ie=0;ie<N.length;++ie){const fe=N[ie],ye=fe.charCodeAt(0);_(ye)?(Z.push(" "),Z.push(fe),Z.push(" ")):Z.push(fe)}return Z.join("")}stripAccents(N){return N.normalize("NFD").replace(new RegExp("\\p{Mn}","gu"),"")}_is_control(N){switch(N){case"	":case`
3367`:case"\r":return!1;default:return new RegExp("^\\p{Cc}|\\p{Cf}|\\p{Co}|\\p{Cs}$","u").test(N)}}_clean_text(N){const Z=[];for(const ie of N){const fe=ie.charCodeAt(0);fe===0||fe===65533||this._is_control(ie)||(/^\s$/.test(ie)?Z.push(" "):Z.push(ie))}return Z.join("")}normalize(N){return this.config.clean_text&&(N=this._clean_text(N)),this.config.handle_chinese_chars&&(N=this._tokenize_chinese_chars(N)),this.config.lowercase?(N=N.toLowerCase(),this.config.strip_accents!==!1&&(N=this.stripAccents(N))):this.config.strip_accents&&(N=this.stripAccents(N)),N}}class J extends n.Callable{static fromConfig(N){if(N===null)return null;switch(N.type){case"BertPreTokenizer":return new ue(N);case"Sequence":return new ks(N);case"Whitespace":return new F(N);case"WhitespaceSplit":return new le(N);case"Metaspace":return new zr(N);case"ByteLevel":return new Y(N);case"Split":return new Se(N);case"Punctuation":return new Ae(N);case"Digits":return new Oe(N);case"Replace":return new B(N);default:throw new Error(`Unknown PreTokenizer type: ${N.type}`)}}pre_tokenize_text(N,Z){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(N,Z){return(Array.isArray(N)?N.map(ie=>this.pre_tokenize_text(ie,Z)):this.pre_tokenize_text(N,Z)).flat()}_call(N,Z){return this.pre_tokenize(N,Z)}}class ue extends J{constructor(N){super(),this.pattern=new RegExp(`[^\\s${b}]+|[${b}]`,"gu")}pre_tokenize_text(N,Z){return N.trim().match(this.pattern)||[]}}class Y extends J{constructor(N){super(),this.config=N,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=K,this.text_encoder=new TextEncoder}pre_tokenize_text(N,Z){return this.add_prefix_space&&!N.startsWith(" ")&&(N=" "+N),(this.use_regex?N.match(this.pattern)||[]:[N]).map(fe=>Array.from(this.text_encoder.encode(fe),ye=>this.byte_encoder[ye]).join(""))}}class Se extends J{constructor(N){super(),this.config=N,this.pattern=f(this.config.pattern,this.config.invert)}pre_tokenize_text(N,Z){var ie;return this.pattern===null?[]:this.config.invert?N.match(this.pattern)||[]:((ie=this.config.behavior)==null?void 0:ie.toLowerCase())==="removed"?N.split(this.pattern).filter(fe=>fe):h(N,this.pattern)}}class Ae extends J{constructor(N){super(),this.config=N,this.pattern=new RegExp(`[^${b}]+|[${b}]+`,"gu")}pre_tokenize_text(N,Z){return N.match(this.pattern)||[]}}class Oe extends J{constructor(N){super(),this.config=N;const Z=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(Z,"gu")}pre_tokenize_text(N,Z){return N.match(this.pattern)||[]}}class Ne extends n.Callable{constructor(N){super(),this.config=N}static fromConfig(N){if(N===null)return null;switch(N.type){case"TemplateProcessing":return new pe(N);case"ByteLevel":return new Me(N);case"RobertaProcessing":return new re(N);case"BertProcessing":return new Q(N);case"Sequence":return new Te(N);default:throw new Error(`Unknown PostProcessor type: ${N.type}`)}}post_process(N,...Z){throw Error("post_process should be implemented in subclass.")}_call(N,...Z){return this.post_process(N,...Z)}}class Q extends Ne{constructor(N){super(N),this.cls=N.cls[0],this.sep=N.sep[0]}post_process(N,Z=null,{add_special_tokens:ie=!0}={}){ie&&(N=(0,s.mergeArrays)([this.cls],N,[this.sep]));let fe=new Array(N.length).fill(0);if(Z!==null){const ye=ie&&this instanceof re?[this.sep]:[],Ie=ie?[this.sep]:[];N=(0,s.mergeArrays)(N,ye,Z,Ie),fe=(0,s.mergeArrays)(fe,new Array(Z.length+ye.length+Ie.length).fill(1))}return{tokens:N,token_type_ids:fe}}}class re extends Q{}class pe extends Ne{constructor(N){super(N),this.single=N.single,this.pair=N.pair}post_process(N,Z=null,{add_special_tokens:ie=!0}={}){const fe=Z===null?this.single:this.pair;let ye=[],Ie=[];for(const Qe of fe)"SpecialToken"in Qe?ie&&(ye.push(Qe.SpecialToken.id),Ie.push(Qe.SpecialToken.type_id)):"Sequence"in Qe&&(Qe.Sequence.id==="A"?(ye=(0,s.mergeArrays)(ye,N),Ie=(0,s.mergeArrays)(Ie,new Array(N.length).fill(Qe.Sequence.type_id
3367))):Qe.Sequence.id==="B"&&(ye=(0,s.mergeArrays)(ye,Z),Ie=(0,s.mergeArrays)(Ie,new Array(Z.length).fill(Qe.Sequence.type_id))));return{tokens:ye,token_type_ids:Ie}}}class Me extends Ne{post_process(N,Z=null){return Z&&(N=(0,s.mergeArrays)(N,Z)),{tokens:N}}}class Te extends Ne{constructor(N){super(N),this.processors=N.processors.map(Z=>Ne.fromConfig(Z))}post_process(N,Z=null,ie={}){let fe;for(const ye of this.processors)if(ye instanceof Me)N=ye.post_process(N).tokens,Z&&(Z=ye.post_process(Z).tokens);else{const Ie=ye.post_process(N,Z,ie);N=Ie.tokens,fe=Ie.token_type_ids}return{tokens:N,token_type_ids:fe}}}class me extends n.Callable{constructor(N){super(),this.config=N,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=N.trim_offsets}static fromConfig(N){if(N===null)return null;switch(N.type){case"WordPiece":return new Ye(N);case"Metaspace":return new hr(N);case"ByteLevel":return new Fe(N);case"Replace":return new Pe(N);case"ByteFallback":return new Be(N);case"Fuse":return new rt(N);case"Strip":return new et(N);case"Sequence":return new It(N);case"CTC":return new lt(N);case"BPEDecoder":return new Qt(N);default:throw new Error(`Unknown Decoder type: ${N.type}`)}}_call(N){return this.decode(N)}decode(N){return this.decode_chain(N).join("")}decode_chain(N){throw Error("`decode_chain` should be implemented in subclass.")}}class Pe extends me{decode_chain(N){const Z=f(this.config.pattern);return Z===null?N:N.map(ie=>ie.replaceAll(Z,this.config.content))}}class Be extends me{constructor(N){super(N),this.text_decoder=new TextDecoder}decode_chain(N){const Z=[];let ie=[];for(const fe of N){let ye=null;if(fe.length===6&&fe.startsWith("<0x")&&fe.endsWith(">")){const Ie=parseInt(fe.slice(3,5),16);isNaN(Ie)||(ye=Ie)}if(ye!==null)ie.push(ye);else{if(ie.length>0){const Ie=this.text_decoder.decode(Uint8Array.from(ie));Z.push(Ie),ie=[]}Z.push(fe)}}if(ie.length>0){const fe=this.text_decoder.decode(Uint8Array.from(ie));Z.push(fe),ie=[]}return Z}}class rt extends me{decode_chain(N){return[N.join("")]}}class et extends me{constructor(N){super(N),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(N){return N.map(Z=>{let ie=0;for(let ye=0;ye<this.start&&Z[ye]===this.content;++ye){ie=ye+1;continue}let fe=Z.length;for(let ye=0;ye<this.stop;++ye){const Ie=Z.length-ye-1;if(Z[Ie]===this.content){fe=Ie;continue}else break}return Z.slice(ie,fe)})}}class Ye extends me{constructor(N){super(N),this.cleanup=N.cleanup}decode_chain(N){return N.map((Z,ie)=>(ie!==0&&(Z.startsWith(this.config.prefix)?Z=Z.replace(this.config.prefix,""):Z=" "+Z),this.cleanup&&(Z=k(Z)),Z))}}class Fe extends me{constructor(N){super(N),this.byte_decoder=H,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(N){const Z=N.join(""),ie=new Uint8Array([...Z].map(ye=>this.byte_decoder[ye]));return this.text_decoder.decode(ie)}decode_chain(N){const Z=[];let ie=[];for(const fe of N)this.added_tokens.find(ye=>ye.content===fe)!==void 0?(ie.length>0&&(Z.push(this.convert_tokens_to_string(ie)),ie=[]),Z.push(fe)):ie.push(fe);return ie.length>0&&Z.push(this.convert_tokens_to_string(ie)),Z}}class lt extends me{constructor(N){super(N),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(N){if(N.length===0)return"";const Z=[N[0]];for(let ye=1;ye<N.length;++ye)N[ye]!==Z.at(-1)&&Z.push(N[ye]);let fe=Z.filter(ye=>ye!==this.pad_token).join("");return this.cleanup&&(fe=k(fe).replaceAll(this.word_delimiter_token," ").trim()),fe}decode_chain(N){return[this.convert_tokens_to_string(N)]}}class It extends me{constructor(N){super(N),this.decoders=N.decoders.map(Z=>me.fromConfig(Z))}decode_chain(N){return this.decoders.reduce((Z,ie)=>ie.decode_chain(Z),N)}}class Qt extends me{constructor(N){super(N),this.suffix=this.config.suffix}decode_chain(N){return N.map((Z,ie)=>Z.replaceAll(this.suffix,ie===N.length-1?"":" "))}}class Gt extends me{decode_chain(N){let Z="";for(let ie=1;ie<N.length;ie+=2)Z+=N[ie];return[Z]}}class zr extends J{constructor(N){super(),this.addPrefixSpace=N.add_prefix_space,this.replacement=N.replacement,this.strRep=N.str_rep||this.replacement,this.prepend_scheme=N.prepend_scheme??"always"}pre_tokenize_text(N,{section_index:Z=void 0}={}){let ie=N.replaceAll(" ",this.strRep);return this.addPrefixSpace&&!ie.startsWith(this.replacement)&&(this.prepend_scheme==="always"||this.prepend_scheme==="first"&&Z===0)&&(ie=this.strRep+ie),[ie]}}class hr extends me{constructor(N){super(N),this.addPrefixSpace=N.add_prefix_space,this.replacement=N.replacement}decode_chain(N){const Z=[];for(let ie=0;ie<N.length;++ie){let fe=N[ie].replaceAll(this.replacement," ");this.addPrefixSpace&&ie==0&&fe.startsWith(" ")&&(fe=fe.substring(1)),Z.push(fe)}return Z}}
3367class Tt extends V{constructor(N){super(N),this.charsmap=N.precompiled_charsmap}normalize(N){return N=N.replace(/[\u0001-\u0008\u000B\u000E-\u001F\u007F\u008F\u009F]/gm,""),N=N.replace(/[\u0009\u000A\u000C\u000D\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u2581\u3000\uFEFF\uFFFD]/gm," "),N.includes("~")?N=N.split("~").map(ie=>ie.normalize("NFKC")).join("~"):N=N.normalize("NFKC"),N}}class ks extends J{constructor(N){super(),this.tokenizers=N.pretokenizers.map(Z=>J.fromConfig(Z))}pre_tokenize_text(N,Z){return this.tokenizers.reduce((ie,fe)=>fe.pre_tokenize(ie,Z),[N])}}class F extends J{constructor(N){super()}pre_tokenize_text(N,Z){return N.match(/\w+|[^\w\s]+/g)||[]}}class le extends J{constructor(N){super()}pre_tokenize_text(N,Z){return x(N)}}class B extends J{constructor(N){super(),this.config=N,this.pattern=f(this.config.pattern),this.content=this.config.content}pre_tokenize_text(N,Z){return this.pattern===null?[N]:[N.replaceAll(this.pattern,this.config.content)]}}const oe=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function xe(we,N,Z,ie){for(const fe of Object.keys(we)){const ye=N-we[fe].length,Ie=Z(fe),Qe=new Array(ye).fill(Ie);we[fe]=ie==="right"?(0,s.mergeArrays)(we[fe],Qe):(0,s.mergeArrays)(Qe,we[fe])}}function Ue(we,N){for(const Z of Object.keys(we))we[Z].length=N}class je extends n.Callable{constructor(Z,ie){super();ce(this,"return_token_type_ids",!1);ce(this,"padding_side","right");this._tokenizer_config=ie,this.normalizer=V.fromConfig(Z.normalizer),this.pre_tokenizer=J.fromConfig(Z.pre_tokenizer),this.model=q.fromConfig(Z.model,ie),this.post_processor=Ne.fromConfig(Z.post_processor),this.decoder=me.fromConfig(Z.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const fe of Z.added_tokens){const ye=new I(fe);this.added_tokens.push(ye),this.model.tokens_to_ids.set(ye.content,ye.id),this.model.vocab[ye.id]=ye.content,ye.special&&(this.special_tokens.push(ye.content),this.all_special_ids.push(ye.id))}if(this.additional_special_tokens=ie.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_splitter=new c.DictionarySplitter(this.added_tokens.map(fe=>fe.content)),this.added_tokens_map=new Map(this.added_tokens.map(fe=>[fe.content,fe])),this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken("bos_token"),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken("eos_token"),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=ie.model_max_length,this.remove_space=ie.remove_space,this.clean_up_tokenization_spaces=ie.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=ie.do_lowercase_and_remove_accent??!1,ie.padding_side&&(this.padding_side=ie.padding_side),this.legacy=!1,this.chat_template=ie.chat_template??null,Array.isArray(this.chat_template)){const fe=Object.create(null);for(const{name:ye,template:Ie}of this.chat_template){if(typeof ye!="string"||typeof Ie!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');fe[ye]=Ie}this.chat_template=fe}this._compiled_template_cache=new Map}getToken(...Z){for(const ie of Z){const fe=this._tokenizer_config[ie];if(fe)if(typeof fe=="object"){if(fe.__type==="AddedToken")return fe.content;throw Error(`Unknown token: ${fe}`)}else return fe}return null}static async from_pretrained(Z,{progress_callback:ie=null,config:fe=null,cache_dir:ye=null,local_files_only:Ie=!1,revision:Qe="main",legacy:st=null}={}){const tt=await u(Z,{progress_callback:ie,config:fe,cache_dir:ye,local_files_only:Ie,revision:Qe,legacy:st});return new this(...tt)}_call(Z,{text_pair:ie=null,add_special_tokens:fe=!0,padding:ye=!1,truncation:Ie=null,max_length:Qe=null,return_tensor:st=!0,return_token_type_ids:tt=null}={}){const ot=Array.isArray(Z);let Et;if(ot){if(Z.length===0)throw Error("text array must be non-empty");if(ie!==null){if(Array.isArray(ie)){if(Z.length!==ie.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");Et=Z.map((Zt,Ar)=>this._encode_plus(Zt,{text_pair:ie[Ar],add_special_tokens:fe,return_token_type_ids:tt}))}else Et=Z.map(Zt=>this._encode_plus(Zt,{add_special_tokens:fe,return_token_type_ids:tt}))}else{if(Z==null)throw Error("text may not be null or undefined");if(Array.isArray(ie))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");Et=[this._encode_plus(Z,{text_pair:ie,add_special_tokens:fe,return_token_type_ids:tt})]}if(Qe===null?Qe=this.model_max_length:Ie===null&&(ye===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),Qe
3367=this.model_max_length):ye===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),Ie=!0)),ye===!0&&(Qe=Math.min((0,i.max)(Et.map(Zt=>Zt.input_ids.length))[0],Qe??1/0)),Qe=Math.min(Qe,this.model_max_length??1/0),ye||Ie)for(let Zt=0;Zt<Et.length;++Zt)Et[Zt].input_ids.length!==Qe&&(Et[Zt].input_ids.length>Qe?Ie&&Ue(Et[Zt],Qe):ye&&xe(Et[Zt],Qe,Ar=>Ar==="input_ids"?this.pad_token_id:0,this.padding_side));const er={};if(st){if(!(ye&&Ie)&&Et.some(Ar=>{var dr;for(const cn of Object.keys(Ar))if(Ar[cn].length!==((dr=Et[0][cn])==null?void 0:dr.length))return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const Zt=[Et.length,Et[0].input_ids.length];for(const Ar of Object.keys(Et[0]))er[Ar]=new l.Tensor("int64",BigInt64Array.from(Et.flatMap(dr=>dr[Ar]).map(BigInt)),Zt)}else{for(const Zt of Object.keys(Et[0]))er[Zt]=Et.map(Ar=>Ar[Zt]);if(!ot)for(const Zt of Object.keys(er))er[Zt]=er[Zt][0]}return er}_encode_text(Z){if(Z===null)return null;const ie=this.added_tokens_splitter.split(Z);for(let ye=0;ye<ie.length;++ye){const Ie=this.added_tokens_map.get(ie[ye]);Ie&&(Ie.lstrip&&ye>0&&(ie[ye-1]=ie[ye-1].trimEnd()),Ie.rstrip&&ye<ie.length-1&&(ie[ye+1]=ie[ye+1].trimStart()))}return ie.flatMap((ye,Ie)=>{if(ye.length===0)return[];if(this.added_tokens_map.has(ye))return[ye];if(this.remove_space===!0&&(ye=ye.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(ye=g(ye)),this.normalizer!==null&&(ye=this.normalizer(ye)),ye.length===0)return[];const Qe=this.pre_tokenizer!==null?this.pre_tokenizer(ye,{section_index:Ie}):[ye];return this.model(Qe)})}_encode_plus(Z,{text_pair:ie=null,add_special_tokens:fe=!0,return_token_type_ids:ye=null}={}){const{tokens:Ie,token_type_ids:Qe}=this._tokenize_helper(Z,{pair:ie,add_special_tokens:fe}),st=this.model.convert_tokens_to_ids(Ie),tt={input_ids:st,attention_mask:new Array(st.length).fill(1)};return(ye??this.return_token_type_ids)&&Qe&&(tt.token_type_ids=Qe),tt}_tokenize_helper(Z,{pair:ie=null,add_special_tokens:fe=!1}={}){const ye=this._encode_text(Z),Ie=this._encode_text(ie);return this.post_processor?this.post_processor(ye,Ie,{add_special_tokens:fe}):{tokens:(0,s.mergeArrays)(ye??[],Ie??[])}}tokenize(Z,{pair:ie=null,add_special_tokens:fe=!1}={}){return this._tokenize_helper(Z,{pair:ie,add_special_tokens:fe}).tokens}encode(Z,{text_pair:ie=null,add_special_tokens:fe=!0,return_token_type_ids:ye=null}={}){return this._encode_plus(Z,{text_pair:ie,add_special_tokens:fe,return_token_type_ids:ye}).input_ids}batch_decode(Z,ie={}){return Z instanceof l.Tensor&&(Z=Z.tolist()),Z.map(fe=>this.decode(fe,ie))}decode(Z,ie={}){if(Z instanceof l.Tensor&&(Z=v(Z)),!Array.isArray(Z)||Z.length===0||!(0,s.isIntegralNumber)(Z[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(Z,ie)}decode_single(Z,{skip_special_tokens:ie=!1,clean_up_tokenization_spaces:fe=null}){let ye=this.model.convert_ids_to_tokens(Z);ie&&(ye=ye.filter(Qe=>!this.special_tokens.includes(Qe)));let Ie=this.decoder?this.decoder(ye):ye.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(Ie=Ie.replaceAll(this.decoder.end_of_word_suffix," "),ie&&(Ie=Ie.trim())),(fe??this.clean_up_tokenization_spaces)&&(Ie=k(Ie)),Ie}get_chat_template({chat_template:Z=null,tools:ie=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const fe=this.chat_template;if(Z!==null&&Object.hasOwn(fe,Z))Z=fe[Z];else if(Z===null)if(ie!==null&&"tool_use"in fe)Z=fe.tool_use;else if("default"in fe)Z=fe.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(fe).sort()}.`)}else if(Z===null)if(this.chat_template)Z=this.chat_template;else throw Error("Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating");return Z}apply_chat_template(Z,{tools:ie=null,documents:fe=null,chat_template:ye=null,add_generation_prompt:Ie=!1,tokenize:Qe=!0,padding:st=!1,truncation:tt=!1,max_length:ot=null,return_tensor:Et=!0,return_dict:er=!1,tokenizer_kwargs:Zt={},...Ar}={}){if(ye=this.get_chat_template({chat_template:ye,tools:ie}),typeof ye!="string")throw Error(`chat_template must be a string, but got ${typeof ye}`);let dr=this._compiled_template_cache.get(ye);dr===void 0&&(dr=new d.Template(ye),this._compiled_template_cache.set(ye,dr));const cn=Object.create(null);for(const Pn of oe){const Cn=this.getToken(Pn);Cn&&(cn[Pn]=Cn)}const _n=dr.render({messages:Z,add_generation_prompt:Ie,tools:ie,documents:fe,...cn,...Ar});if(Qe){const Pn=this._call(_n,{add_special_tokens:!1,padding:st,truncation:tt,max_length:ot,return_tensor:Et,...Zt});return er?Pn:Pn.input_ids}return _n}}class Nt extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class Xt extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class xt extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class yt extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class pt extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class ar extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class vr extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class vn extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class Sr extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class Kn extends je{}class Xs extends je{}class Ta extends je{constructor(Z,ie){super(Z,ie);ce(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class ea extends je{constructor(){super(...arguments);ce(this,"return_token_type_ids",!0)}}class ri extends je{}class ps extends je{}class ni extends je{}class $s extends je{constructor(N,Z){super(N,Z),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(ie=>this.languageRegex.test(ie)),this.lang_to_token=ie=>ie}_build_translation_inputs(N,Z,ie){return Xr(this,N,Z,ie)}}class Ma extends $s{}class si extends je{}class ai extends je{}const Gr="▁";class ii extends je{constructor(Z,ie){super(Z,ie);ce(this,"padding_side","left");this.legacy=ie.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new zr({replacement:Gr,add_prefix_space:!0,prepend_scheme:"first"}))}
vendor: 5,109 bytes, line 3367
3367_encode_text(Z){if(Z===null)return null;if(this.legacy||Z.length===0)return super._encode_text(Z);let ie=super._encode_text(Gr+Z.replaceAll(Gr," "));return ie.length>1&&ie[0]===Gr&&this.special_tokens.includes(ie[1])&&(ie=ie.slice(1)),ie}}class An extends je{}class Ea extends je{}class ns extends je{}class We extends je{}class it extends je{}class gt extends je{}class ir extends je{}class ta extends je{}class ra extends je{}function Xr(we,N,Z,ie){if(!("language_codes"in we)||!Array.isArray(we.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in we)||!(we.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in we)||typeof we.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const fe=ie.src_lang,ye=ie.tgt_lang;if(!we.language_codes.includes(ye))throw new Error(`Target language code "${ye}" is not valid. Must be one of: {${we.language_codes.join(", ")}}`);if(fe!==void 0){if(!we.language_codes.includes(fe))throw new Error(`Source language code "${fe}" is not valid. Must be one of: {${we.language_codes.join(", ")}}`);for(const Ie of we.post_processor.config.single)if("SpecialToken"in Ie&&we.languageRegex.test(Ie.SpecialToken.id)){Ie.SpecialToken.id=we.lang_to_token(fe);break}}return ie.forced_bos_token_id=we.model.convert_tokens_to_ids([we.lang_to_token(ye)])[0],we._call(N,Z)}class na extends je{constructor(N,Z){super(N,Z),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(ie=>this.languageRegex.test(ie)),this.lang_to_token=ie=>ie}_build_translation_inputs(N,Z,ie){return Xr(this,N,Z,ie)}}class en extends je{constructor(N,Z){super(N,Z),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(ie=>this.languageRegex.test(ie)).map(ie=>ie.slice(2,-2)),this.lang_to_token=ie=>`__${ie}__`}_build_translation_inputs(N,Z,ie){return Xr(this,N,Z,ie)}}class ln extends je{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(N,{return_timestamps:Z=!1,return_language:ie=!1,time_precision:fe=null,force_full_sequences:ye=!0}={}){if(fe===null)throw Error("Must specify time_precision");let Ie=null;const Qe=Z==="word";function st(){return{language:Ie,timestamp:[null,null],text:""}}const tt=[];let ot=st(),Et=0;const er=this.timestamp_begin,Ar=er+1500;let dr=[],cn=[],_n=!1,Pn=null;const Cn=new Set(this.all_special_ids);for(const fr of N){const dn=fr.tokens,Qn=Qe?fr.token_timestamps:null;let Ns=null,Os=er;if("stride"in fr){const[wn,Ir,tn]=fr.stride;if(Et-=Ir,Pn=wn-tn,Ir&&(Os=Ir/fe+er),tn)for(let rn=dn.length-1;rn>=0;--rn){const Un=Number(dn[rn]);if(Un>=er){if(Ns!==null&&(Un-er)*fe<Pn)break;Ns=Un}}}let Bn=[],Yn=[];for(let wn=0;wn<dn.length;++wn){const Ir=Number(dn[wn]);if(Cn.has(Ir)){const tn=this.decode([Ir]),rn=p.WHISPER_LANGUAGE_MAPPING.get(tn.slice(2,-2));if(rn!==void 0){if(Ie!==null&&rn!==Ie&&!Z){dr.push(Bn);const Un=this.findLongestCommonSequence(dr)[0],aa=this.decode(Un);ot.text=aa,tt.push(ot),dr=[],Bn=[],ot=st()}Ie=ot.language=rn}}else if(Ir>=er&&Ir<=Ar){const tn=(Ir-er)*fe+Et,rn=(0,i.round)(tn,2);if(Ns!==null&&Ir>=Ns)_n=!0;else if(_n||dr.length>0&&Ir<Os)_n=!1;else if(ot.timestamp[0]===null)ot.timestamp[0]=rn;else if(rn!==ot.timestamp[0]){ot.timestamp[1]=rn,dr.push(Bn),Qe&&cn.push(Yn);const[Un,aa]=this.findLongestCommonSequence(dr,cn),fl=this.decode(Un);ot.text=fl,Qe&&(ot.words=this.collateWordTimestamps(Un,aa,Ie)),tt.push(ot),dr=[],Bn=[],cn=[],Yn=[],ot=st()}}else if(Bn.push(Ir),Qe){let tn=(0,i.round)(Qn[wn]+Et,2),rn;if(wn+1<Qn.length){rn=(0,i.round)(Qn[wn+1]+Et,2);const Un=this.decode([Ir]);M.test(Un)&&(rn=(0,i.round)(Math.min(tn+fe,rn),2))}else rn=null;Yn.push([tn,rn])}}if("stride"in fr){const[wn,Ir,tn]=fr.stride;Et+=wn-tn}Bn.length>0?(dr.push(Bn),Qe&&cn.push(Yn)):dr.every(wn=>wn.length===0)&&(ot=st(),dr=[],Bn=[],cn=[],Yn=[])}if(dr.length>0){if(ye&&Z)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[fr,dn]=this.findLongestCommonSequence(dr,cn),Qn=this.decode(fr);ot.text=Qn,Qe&&(ot.words=this.collateWordTimestamps(fr,dn,Ie)),tt.push(ot)}let jr=Object.create(null);const Aa=tt.map(fr=>fr.text).join("");if(Z||ie){for(let fr=0;fr<tt.length;++fr){const dn=tt[fr];Z||delete dn.timestamp,ie||delete dn.language}if(Qe){const fr=[];for(const dn of tt)for(const Qn of dn.words)fr.push(Qn);jr={chunks:fr}}else jr={chunks:tt}}return[Aa,jr]}findLongestCommonSequence(N,Z=null){let ie=N[0],fe=ie.length,ye=[];const Ie=Array.isArray(Z)&&Z.length>0;let Qe=Ie?[]:null,st=Ie?Z[0]:null;for(let tt=1;tt<N.length;++tt){const ot=N[tt];let Et=0,er=[fe,fe,0,0];const Zt=ot.length;for(let jr=1;jr<fe+Zt;++jr){const Aa=Math.max(0,fe-jr),fr=Math.min(fe,fe+Zt-jr),dn=ie.slice(Aa,fr),Qn=Math.max(0,jr-fe),Ns=Math.min(Zt,jr),Os=ot.
3367slice(Qn,Ns);if(dn.length!==Os.length)throw new Error("There is a bug within whisper `decode_asr` function, please report it. Dropping to prevent bad inference.");let Bn;Ie?Bn=dn.filter((Ir,tn)=>Ir===Os[tn]&&st[Aa+tn]<=Z[tt][Qn+tn]).length:Bn=dn.filter((Ir,tn)=>Ir===Os[tn]).length;const Yn=jr/1e4,wn=Bn/jr+Yn;Bn>1&&wn>Et&&(Et=wn,er=[Aa,fr,Qn,Ns])}const[Ar,dr,cn,_n]=er,Pn=Math.floor((dr+Ar)/2),Cn=Math.floor((_n+cn)/2);ye.push(...ie.slice(0,Pn)),ie=ot.slice(Cn),fe=ie.length,Ie&&(Qe.push(...st.slice(0,Pn)),st=Z[tt].slice(Cn))}return ye.push(...ie),Ie?(Qe.push(...st),[ye,Qe]):[ye,[]]}collateWordTimestamps(N,Z,ie){const[fe,ye,Ie]=this.combineTokensIntoWords(N,ie),Qe=[];for(let st=0;st<fe.length;++st){const tt=Ie[st];Qe.push({text:fe[st],timestamp:[Z[tt.at(0)][0],Z[tt.at(-1)][1]]})}return Qe}combineTokensIntoWords(N,Z,ie=`"'“¡¿([{-`,fe=`"'.。,,!!??::”)]}、`){Z=Z??"english";let ye,Ie,Qe;return["chinese","japanese","thai","lao","myanmar"].includes(Z)?[ye,Ie,Qe]=this.splitTokensOnUnicode(N):[ye,Ie,Qe]=this.splitTokensOnSpaces(N),this.mergePunctuations(ye,Ie,Qe,ie,fe)}decode(N,Z){let ie;return Z!=null&&Z.decode_with_timestamps?(N instanceof l.Tensor&&(N=v(N)),ie=this.decodeWithTimestamps(N,Z)):ie=super.decode(N,Z),ie}decodeWithTimestamps(N,Z){const ie=(Z==null?void 0:Z.time_precision)??.02,fe=Array.from(this.all_special_ids).at(-1)+1;let ye=[[]];for(let Ie of N)if(Ie=Number(Ie),Ie>=fe){const Qe=((Ie-fe)*ie).toFixed(2);ye.push(`<|${Qe}|>`),ye.push([])}else ye[ye.length-1].push(Ie);return ye=ye.map(Ie=>typeof Ie=="string"?Ie:super.decode(Ie,Z)),ye.join("")}splitTokensOnUnicode(N){const Z=this.decode(N,{decode_with_timestamps:!0}),ie="�",fe=[],ye=[],Ie=[];let Qe=[],st=[],tt=0;for(let ot=0;ot<N.length;++ot){const Et=N[ot];Qe.push(Et),st.push(ot);const er=this.decode(Qe,{decode_with_timestamps:!0});(!er.includes(ie)||Z[tt+er.indexOf(ie)]===ie)&&(fe.push(er),ye.push(Qe),Ie.push(st),Qe=[],st=[],tt+=er.length)}return[fe,ye,Ie]}splitTokensOnSpaces(N){const[Z,ie,fe]=this.splitTokensOnUnicode(N),ye=[],Ie=[],Qe=[],st=new RegExp(`^[${b}]$`,"gu");for(let tt=0;tt<Z.length;++tt){const ot=Z[tt],Et=ie[tt],er=fe[tt],Zt=Et[0]>=this.model.tokens_to_ids.get("<|endoftext|>"),Ar=ot.startsWith(" "),dr=ot.trim(),cn=st.test(dr);if(Zt||Ar||cn||ye.length===0)ye.push(ot),Ie.push(Et),Qe.push(er);else{const _n=ye.length-1;ye[_n]+=ot,Ie[_n].push(...Et),Qe[_n].push(...er)}}return[ye,Ie,Qe]}mergePunctuations(N,Z,ie,fe,ye){const Ie=structuredClone(N),Qe=structuredClone(Z),st=structuredClone(ie);let tt=Ie.length-2,ot=Ie.length-1;for(;tt>=0;)Ie[tt].startsWith(" ")&&fe.includes(Ie[tt].trim())?(Ie[ot]=Ie[tt]+Ie[ot],Qe[ot]=(0,s.mergeArrays)(Qe[tt],Qe[ot]),st[ot]=(0,s.mergeArrays)(st[tt],st[ot]),Ie[tt]="",Qe[tt]=[],st[tt]=[]):ot=tt,--tt;for(tt=0,ot=1;ot<Ie.length;)!Ie[tt].endsWith(" ")&&ye.includes(Ie[ot])?(Ie[tt]+=Ie[ot],Qe[tt]=(0,s.mergeArrays)(Qe[tt],Qe[ot]),st[tt]=(0,s.mergeArrays)(st[tt],st[ot]),Ie[ot]="",Qe[ot]=[],st[ot]=[]):tt=ot,++ot;return[Ie.filter(Et=>Et),Qe.filter(Et=>Et.length>0),st.filter(Et=>Et.length>0)]}}class sa extends je{}class Sa extends je{}class il extends je{}class ol extends je{constructor(N,Z){super(N,Z),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(ie=>this.languageRegex.test(ie)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(N){if(N===null)return null;const[Z,...ie]=N.trim().split(this.languageRegex);if(ie.length===0)return super._encode_text(Z);if(ie.length===2){const[fe,ye]=ie;return this.supported_language_codes.includes(fe)||console.warn(`Unsupported language code "${fe}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,s.mergeArrays)([fe],super._encode_text(ye))}}}class ll extends je{}class cl extends je{}class dl extends je{}class oi extends je{}class Xi extends je{}class ul extends je{constructor(N,Z){super(N,Z),this.decoder=new Gt({})}}class pl extends je{}class hl extends je{}class li{static async from_pretrained(N,{progress_callback:Z=null,config:ie=null,cache_dir:fe=null,local_files_only:ye=!1,revision:Ie="main",legacy:Qe=null}={}){var er;
3367const[st,tt]=await u(N,{progress_callback:Z,config:ie,cache_dir:fe,local_files_only:ye,revision:Ie,legacy:Qe}),ot=((er=tt.tokenizer_class)==null?void 0:er.replace(/Fast$/,""))??"PreTrainedTokenizer";let Et=this.TOKENIZER_CLASS_MAPPING[ot];return Et||(console.warn(`Unknown tokenizer class "${ot}", attempting to construct from base class.`),Et=je),new Et(st,tt)}}ce(li,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:ri,DistilBertTokenizer:Kn,CamembertTokenizer:Xs,DebertaTokenizer:pt,DebertaV2Tokenizer:ar,BertTokenizer:Nt,HerbertTokenizer:vr,ConvBertTokenizer:vn,RoFormerTokenizer:Sr,XLMTokenizer:Ta,ElectraTokenizer:ea,MobileBertTokenizer:xt,SqueezeBertTokenizer:yt,AlbertTokenizer:Xt,GPT2Tokenizer:ps,BartTokenizer:ni,MBartTokenizer:$s,MBart50Tokenizer:Ma,RobertaTokenizer:si,WhisperTokenizer:ln,CodeGenTokenizer:sa,CLIPTokenizer:Sa,SiglipTokenizer:il,MarianTokenizer:ol,BloomTokenizer:ai,NllbTokenizer:na,M2M100Tokenizer:en,LlamaTokenizer:ii,CodeLlamaTokenizer:An,XLMRobertaTokenizer:Ea,MPNetTokenizer:ns,FalconTokenizer:We,GPTNeoXTokenizer:it,EsmTokenizer:gt,Wav2Vec2CTCTokenizer:ll,BlenderbotTokenizer:cl,BlenderbotSmallTokenizer:dl,SpeechT5Tokenizer:oi,NougatTokenizer:Xi,VitsTokenizer:ul,Qwen2Tokenizer:ir,GemmaTokenizer:ta,Grok1Tokenizer:ra,CohereTokenizer:pl,MgpstrTokenizer:hl,PreTrainedTokenizer:je})},
3367"./src/utils/audio.js":(e,t,r)=>{r.r(t),r.d(t,{RawAudio:()=>U,hamming:()=>h,hanning:()=>u,mel_filter_bank:()=>_,read_audio:()=>d,spectrogram:()=>S,window_function:()=>j});var n=r("./src/utils/hub.js"),s=r("./src/utils/maths.js"),a=r("./src/utils/core.js"),i=r("./src/env.js"),l=r("?7a2c"),c=r("./src/utils/tensor.js");async function d(R,K){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const H=await(await(0,n.getFile)(R)).arrayBuffer(),ee=new AudioContext({sampleRate:K});typeof K>"u"&&console.warn(`No sampling rate provided, using default of ${ee.sampleRate}Hz.`);const te=await ee.decodeAudioData(H);let V;if(te.numberOfChannels===2){const ae=Math.sqrt(2),ne=te.getChannelData(0),L=te.getChannelData(1);V=new Float32Array(ne.length);for(let $=0;$<te.length;++$)V[$]=ae*(ne[$]+L[$])/2}else V=te.getChannelData(0);return V}function p(R,K){if(R<1)return new Float64Array;if(R===1)return new Float64Array([1]);const H=1-K,ee=2*Math.PI/(R-1),te=new Float64Array(R);for(let V=0;V<R;++V)te[V]=K-H*Math.cos(V*ee);return te}function u(R){return p(R,.5)}function h(R){return p(R,.54)}const f={htk:R=>2595*Math.log10(1+R/700),kaldi:R=>1127*Math.log(1+R/700),slaney:(R,K=1e3,H=15,ee=27/Math.log(6.4))=>R>=K?H+Math.log(R/K)*ee:3*R/200};function m(R,K="htk"){const H=f[K];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(ee=>H(ee))}const v={htk:R=>700*(10**(R/2595)-1),kaldi:R=>700*(Math.exp(R/1127)-1),slaney:(R,K=1e3,H=15,ee=Math.log(6.4)/27)=>R>=H?K*Math.exp(ee*(R-H)):200*R/3};function k(R,K="htk"){const H=v[K];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof R=="number"?H(R):R.map(ee=>H(ee))}function y(R,K){const H=Float64Array.from({length:K.length-1},(ae,ne)=>K[ne+1]-K[ne]),ee=Array.from({length:R.length},()=>new Array(K.length));for(let ae=0;ae<R.length;++ae){const ne=ee[ae];for(let L=0;L<K.length;++L)ne[L]=K[L]-R[ae]}const te=K.length-2,V=Array.from({length:te},()=>new Array(R.length));for(let ae=0;ae<R.length;++ae){const ne=ee[ae];for(let L=0;L<te;++L){const $=-ne[L]/H[L],G=ne[L+2]/H[L+1];V[L][ae]=Math.max(0,Math.min($,G))}}return V}function g(R,K,H){const ee=(K-R)/(H-1);return Float64Array.from({length:H},(te,V)=>R+ee*V)}function _(R,K,H,ee,te,V=null,ae="htk",ne=!1){if(V!==null&&V!=="slaney")throw new Error('norm must be one of null or "slaney"');if(R<2)throw new Error(`Require num_frequency_bins: ${R} >= 2`);if(H>ee)throw new Error(`Require min_frequency: ${H} <= max_frequency: ${ee}`);const L=m(H,ae),$=m(ee,ae),G=g(L,$,K+2);let se=k(G,ae),_e;if(ne){const Ee=te/((R-1)*2);_e=m(Float64Array.from({length:R},(ze,Ke)=>Ke*Ee),ae),se=G}else _e=g(0,Math.floor(te/2),R);const de=y(_e,se);if(V!==null&&V==="slaney")for(let Ee=0;Ee<K;++Ee){const ze=de[Ee],Ke=2/(se[Ee+2]-se[Ee]);for(let ve=0;ve<R;++ve)ze[ve]*=Ke}return de}function w(R,K,H){const ee=new R.constructor(R.length+K+H),te=R.length-1;for(let V=0;V<R.length;++V)ee[K+V]=R[V];for(let V=1;V<=K;++V)ee[K-V]=R[(0,a.calculateReflectOffset)(V,te)];for(let V=1;V<=H;++V)ee[te+K+V]=R[(0,a.calculateReflectOffset)(te-V,te)];return ee}function x(R,K,H,ee,te){if(H<=0)throw new Error("reference must be greater than zero");if(ee<=0)throw new Error("min_value must be greater than zero");H=Math.max(ee,H);const V=Math.log10(H);for(let ae=0;ae<R.length;++ae)R[ae]=K*Math.log10(Math.max(ee,R[ae])-V);if(te!==null){if(te<=0)throw new Error("db_range must be greater than zero");const ae=(0,s.max)(R)[0]-te;for(let ne=0;ne<R.length;++ne)R[ne]=Math.max(R[ne],ae)}return R}function b(R,K=1,H=1e-5,ee=null){return x(R,20,K,H,ee)}function M(R,K=1,H=1e-10,ee=null){return x(R,10,K,H,ee)}async function S(R,K,H,ee,{fft_length:te=null,power:V=1,center:ae=!0,pad_mode:ne="reflect",onesided:L=!0,preemphasis:$=null,mel_filters:G=null,mel_floor:se=1e-10,log_mel:_e=null,reference:de=1,min_value:Ee=1e-10,db_range:ze=null,remove_dc_offset:Ke=null,min_num_frames:ve=null,max_num_frames:J=null,do_pad:ue=!0,transpose:Y=!1}={}){const Se=K.length;if(te===null&&(te=H),H>te)throw Error(`frame_length (${H}) may not be larger than fft_length (${te})`);if(Se!==H)throw new Error(`Length of the window (${Se}) must equal frame_length (${H})`);if(ee<=0)throw new Error("hop_length must be greater than zero");if(V===null&&G!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(ae){if(ne!=="reflect")throw new Error(`pad_mode="${ne}" not implemented yet.`);const rt=Math.floor((te-1)/2)+1;R=w(R,rt,rt)}let Ae=Math.floor(1+Math.floor((R.length-H)/ee));ve!==null&&Ae<ve&&(Ae=ve);const Oe=L?Math.floor(te/2)+1:te;let Ne=Ae,Q=Ae;J!==null&&(J>Ae?ue&&(Q=J):Q=Ne=J);const re=new s.FFT(te),pe=new Float64Array(te),Me=new Float64Array(re.outputBufferSize),Te=new Float32Array(Oe*Q);for(let rt=0;rt<Ne;++rt){const et=rt*ee,Ye=Math.min(R.length-et,H);Ye!==H&&pe.fill(0,0,H);for(let Fe=0;Fe<Ye;++Fe)pe[Fe]=R[et+Fe];if(Ke){let Fe=0;for(let It=0;It<Ye;++It)Fe+=pe[It];const lt=Fe/Ye;for(let It=0;It<Ye;++It)pe[It]-=lt}if($!==null){for(let Fe=Ye-1;Fe>=1;--Fe)pe[Fe]-=$*pe[Fe-1];pe[0]*=1-$}for(let Fe=0;Fe<K.length;++Fe)pe[Fe]*=K[Fe];re.realTransform(Me,pe);for(let Fe=0;Fe<Oe;++Fe){const lt=Fe<<1;Te[Fe*Q+rt]=Me[lt]**2+Me[lt+1]**2}}if(V!==null&&V!==2){const rt=2/V;for(let et=0;et<Te.length;++et)Te[et]**=rt}const me=G.length;let Pe=await(0,c.matmul)(new c.Tensor("float32",G.flat(),[me,Oe]),new c.Tensor("float32",Te,[Oe,Q]));Y&&(Pe=Pe.transpose(1,0));const Be=Pe.data;for(let rt=0;rt<Be.length;++rt)Be[rt]=Math.max(se,Be[rt]);if(V!==null&&_e!==null){const rt=Math.min(Be.length,Ne*me);switch(_e){case"log":for(let et=0;et<rt;++et)Be[et]=Math.log(Be[et]);break;case"log10":for(let et=0;et<rt;++et)Be[et]=Math.log10(Be[et]);break;case"dB":if(V===1)b(Be,de,Ee,ze);else if(V===2)M(Be,de,Ee,ze);else throw new Error(`Cannot use log_mel option '${_e}' with power ${V}`);break;default:throw new Error(`log_mel must be one of null, 'log', 'log10' or 'dB'. Got '${_e}'`)}}return Pe}function j(R,K,{periodic:H=!0,frame_length:ee=null,center:te=!0}={}){const V=H?R+1:R;let ae;switch(K){case"boxcar":ae=new Float64Array(V).fill(1);break;case"hann":case"hann_window":ae=u(V);break;case"hamming":ae=h(V);break;case"povey":ae=u(V).map(ne=>Math.pow(ne,.85));break;default:throw new Error(`Unknown window type ${K}.`)}if(H&&(ae=ae.subarray(0,R)),ee===null)return ae;if(R>ee)throw new Error(`Length of the window (${R}) may not be larger than frame_length (${ee})`);return ae}function I(R,K){let H=44;const ee=new ArrayBuffer(H+R.length*4),te=new DataView(ee);q(te,0,"RIFF"),te.setUint32(4,36+R.length*4,!0),q(te,8,"WAVE"),q(te,12,"fmt "),te.setUint32(16,16,!0),te.setUint16(20,3,!0),te.setUint16(22,1,!0),te.setUint32(24,K,!0),te.setUint32(28,K*4,!0),te.setUint16(32,4,!0),te.setUint16(34,32,!0),q(te,36,"data"),te.setUint32(40,R.length*4,!0);for(let V=0;V<R.length;++V,H+=4)te.setFloat32(H,R[V],!0);return ee}function q(R,K,H){for(let ee=0;ee<H.length;++ee)R.setUint8(K+ee,H.charCodeAt(ee))}class U{constructor(K,H){this.audio=K,this.sampling_rate=H}toWav(){return I(this.audio,this.sampling_rate)}toBlob(){const K=this.toWav();return new Blob([K],{type:"audio/wav"})}async save(K){let H;
3367if(i.apis.IS_BROWSER_ENV){if(i.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save a file from a Web Worker.");H=a.saveBlob}else if(i.apis.IS_FS_AVAILABLE)H=async(ee,te)=>{let V=await te.arrayBuffer();l.writeFileSync(ee,Buffer.from(V))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await H(K,this.toBlob())}}},
3367"./src/utils/constants.js":(e,t,r)=>{r.r(t),r.d(t,{CHAT_TEMPLATE_NAME:()=>c,CONFIG_NAME:()=>s,FEATURE_EXTRACTOR_NAME:()=>a,GENERATION_CONFIG_NAME:()=>d,GITHUB_ISSUE_URL:()=>n,IMAGE_PROCESSOR_NAME:()=>i,PROCESSOR_NAME:()=>l});const n="https://github.com/huggingface/transformers.js/issues/new/choose",s="config.json",a="preprocessor_config.json",i=a,l="processor_config.json",c="chat_template.json",d="generation_config.json"},
3367"./src/utils/core.js":(e,t,r)=>{r.r(t),r.d(t,{calculateDimensions:()=>d,calculateReflectOffset:()=>f,count:()=>y,dispatchCallback:()=>n,escapeRegExp:()=>a,isIntegralNumber:()=>l,isNullishDimension:()=>c,isTypedArray:()=>i,len:()=>k,mergeArrays:()=>u,pick:()=>v,pop:()=>p,product:()=>h,reverseDictionary:()=>s,saveBlob:()=>m});function n(g,_){g&&g(_)}function s(g){return Object.fromEntries(Object.entries(g).map(([_,w])=>[w,_]))}function a(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(g){var _,w,x;return((x=(w=(_=g==null?void 0:g.prototype)==null?void 0:_.__proto__)==null?void 0:w.constructor)==null?void 0:x.name)==="TypedArray"}function l(g){return Number.isInteger(g)||typeof g=="bigint"}function c(g){return g==null||g===-1}function d(g){const _=[];let w=g;for(;Array.isArray(w);)_.push(w.length),w=w[0];return _}function p(g,_,w=void 0){const x=g[_];if(x!==void 0)return delete g[_],x;if(w===void 0)throw Error(`Key ${_} does not exist in object.`);return w}function u(...g){return Array.prototype.concat.apply([],g)}function h(...g){return g.reduce((_,w)=>_.flatMap(x=>w.map(b=>[x,b])))}function f(g,_){return Math.abs((g+_)%(2*_)-_)}function m(g,_){const w=URL.createObjectURL(_),x=document.createElement("a");x.href=w,x.download=g,x.click(),x.remove(),URL.revokeObjectURL(w)}function v(g,_){return Object.assign({},..._.map(w=>{if(g[w]!==void 0)return{[w]:g[w]}}))}function k(g){let _=0;for(const w of g)++_;return _}function y(g,_){let w=0;for(const x of g)x===_&&++w;return w}},
3367"./src/utils/data-structures.js":(e,t,r)=>{r.r(t),r.d(t,{CharTrie:()=>s,DictionarySplitter:()=>c,LRUCache:()=>d,PriorityQueue:()=>n,TokenLattice:()=>i});class n{constructor(u=(f,m)=>f>m,h=1/0){this._heap=[],this._comparator=u,this._maxSize=h}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...u){return this.extend(u)}extend(u){for(const h of u)if(this.size<this._maxSize)this._heap.push(h),this._siftUp();else{const f=this._smallest();this._comparator(h,this._heap[f])&&(this._heap[f]=h,this._siftUpFrom(f))}return this.size}pop(){const u=this.peek(),h=this.size-1;return h>0&&this._swap(0,h),this._heap.pop(),this._siftDown(),u}replace(u){const h=this.peek();return this._heap[0]=u,this._siftDown(),h}_parent(u){return(u+1>>>1)-1}_left(u){return(u<<1)+1}_right(u){return u+1<<1}_greater(u,h){return this._comparator(this._heap[u],this._heap[h])}_swap(u,h){const f=this._heap[u];this._heap[u]=this._heap[h],this._heap[h]=f}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(u){for(;u>0&&this._greater(u,this._parent(u));)this._swap(u,this._parent(u)),u=this._parent(u)}_siftDown(){let u=0;for(;this._left(u)<this.size&&this._greater(this._left(u),u)||this._right(u)<this.size&&this._greater(this._right(u),u);){const h=this._right(u)<this.size&&this._greater(this._right(u),this._left(u))?this._right(u):this._left(u);this._swap(u,h),u=h}}_smallest(){return 2**Math.floor(Math.log2(this.size))-1}}class s{constructor(){this.root=a.default()}extend(u){for(const h of u)this.push(h)}push(u){let h=this.root;for(const f of u){let m=h.children.get(f);m===void 0&&(m=a.default(),h.children.set(f,m)),h=m}h.isLeaf=!0}*commonPrefixSearch(u){let h=this.root;if(h===void 0)return;let f="";for(const m of u){if(f+=m,h=h.children.get(m),h===void 0)return;h.isLeaf&&(yield f)}}}class a{constructor(u,h){this.isLeaf=u,this.children=h}static default(){return new a(!1,new Map)}}class i{constructor(u,h,f){this.chars=Array.from(u),this.len=this.chars.length,this.bosTokenId=h,this.eosTokenId=f,this.nodes=[],this.beginNodes=Array.from({length:this.len+1},()=>[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const m=new l(this.bosTokenId,0,0,0,0),v=new l(this.eosTokenId,1,this.len,0,0);this.nodes.push(m.clone()),this.nodes.push(v.clone()),this.beginNodes[this.len].push(v),this.endNodes[0].push(m)}insert(u,h,f,m){const v=this.nodes.length,k=new l(m,v,u,h,f);this.beginNodes[u].push(k),this.endNodes[u+h].push(k),this.nodes.push(k)}viterbi(){const u=this.len;let h=0;for(;h<=u;){if(this.beginNodes[h].length==0)return[];for(let y of this.beginNodes[h]){y.prev=null;let g=0,_=null;for(let w of this.endNodes[h]){const x=w.backtraceScore+y.score;(_===null||x>g)&&(_=w.clone(),g=x)}if(_!==null)y.prev=_,y.backtraceScore=g;else return[]}++h}const f=[],v=this.beginNodes[u][0].prev;if(v===null)return[];let k=v.clone();for(;k.prev!==null;)f.push(k.clone()),k=k.clone().prev.clone();return f.reverse(),f}piece(u){return this.chars.slice(u.pos,u.pos+u.length).join("")}tokens(){return this.viterbi().map(h=>this.piece(h))}tokenIds(){return this.viterbi().map(h=>h.tokenId)}}class l{constructor(u,h,f,m,v){this.tokenId=u,this.nodeId=h,this.pos=f,this.length=m,this.score=v,this.prev=null,this.backtraceScore=0}clone(){const u=new l(this.tokenId,this.nodeId,this.pos,this.length,this.score);return u.prev=this.prev,u.backtraceScore=this.backtraceScore,u}}class c{constructor(u){this.trie=this._buildTrie(u)}_buildTrie(u){var f;const h=Object.create(null);for(const m of u){let v=h;for(let k=0;k<m.length;++k)v=v[f=m[k]]??(v[f]=Object.create(null));v.end=m}return h}split(u){const h=[],f=u.length;let m=0,v=0;for(;v<f;){let k=this.trie,y=null,g=v;for(;g<f&&(k=k[u[g]]);)k.end&&(y=k.end),++g;y?(v>m&&h.push(u.slice(m,v)),h.push(y),v+=y.length,m=v):++v}return m<f&&h.push(u.slice(m)),h}}class d{constructor(u){this.capacity=u,this.cache=new Map}get(u){if(!this.cache.has(u))return;const h=this.cache.get(u);return this.cache.delete(u),this.cache.set(u,h),h}put(u,h){this.cache.has(u)&&this.cache.delete(u),this.cache.set(u,h),this.cache.size>this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}},
3367"./src/utils/devices.js":(e,t,r)=>{r.r(t),r.d(t,{DEVICE_TYPES:()=>n});const n=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},
3367"./src/utils/dtypes.js":(e,t,r)=>{r.r(t),r.d(t,{DATA_TYPES:()=>i,DEFAULT_DEVICE_DTYPE_MAPPING:()=>l,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>c,isWebGpuFp16Supported:()=>a});var n=r("./src/env.js"),s=r("./src/utils/devices.js");const a=function(){let d;return async function(){if(d===void 0)if(!n.apis.IS_WEBGPU_AVAILABLE)d=!1;else try{d=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{d=!1}return d}}(),i=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),l=Object.freeze({[s.DEVICE_TYPES.wasm]:i.q8}),c=Object.freeze({[i.fp32]:"",[i.fp16]:"_fp16",[i.int8]:"_int8",[i.uint8]:"_uint8",[i.q8]:"_quantized",[i.q4]:"_q4",[i.q4f16]:"_q4f16",[i.bnb4]:"_bnb4"})},
3367"./src/utils/generic.js":(e,t,r)=>{r.r(t),r.d(t,{Callable:()=>n});const n=class{constructor(){let s=function(...a){return s._call(...a)};return Object.setPrototypeOf(s,new.target.prototype)}_call(...s){throw Error("Must implement _call method in subclass")}}},
3367"./src/utils/hub.js":(e,t,r)=>{r.r(t),r.d(t,{MAX_EXTERNAL_DATA_CHUNKS:()=>l,getFile:()=>f,getModelFile:()=>g,getModelJSON:()=>_});var n=r("?7a2c"),s=r("?a42a"),a=r("./src/env.js"),i=r("./src/utils/core.js");const l=100,c={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class d{constructor(M){if(this.filePath=M,this.headers=new Headers,this.exists=n.existsSync(M),this.exists){this.status=200,this.statusText="OK";let S=n.statSync(M);this.headers.set("content-length",S.size.toString()),this.updateContentType();const j=n.createReadStream(M);this.body=new ReadableStream({start(I){j.on("data",q=>I.enqueue(q)),j.on("end",()=>I.close()),j.on("error",q=>I.error(q))},cancel(){j.destroy()}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const M=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",c[M]??"application/octet-stream")}clone(){let M=new d(this.filePath);return M.exists=this.exists,M.status=this.status,M.statusText=this.statusText,M.headers=new Headers(this.headers),M}async arrayBuffer(){return(await n.promises.readFile(this.filePath)).buffer}async blob(){const M=await n.promises.readFile(this.filePath);return new Blob([M],{type:this.headers.get("content-type")})}async text(){return await n.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function p(b,M=null,S=null){let j;try{j=new URL(b)}catch{return!1}return!(M&&!M.includes(j.protocol)||S&&!S.includes(j.hostname))}const u=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function h(b){return!(!u.test(b)||b.includes("..")||b.includes("--")||b.endsWith(".git")||b.endsWith(".ipynb"))}async function f(b){var M;if(a.env.useFS&&!p(b,["http:","https:","blob:"]))return new d(b instanceof URL?b.protocol==="file:"?b.pathname:b.toString():b);if(typeof process<"u"&&((M=process==null?void 0:process.release)==null?void 0:M.name)==="node"){const S=!!(Ii!=null&&Ii.TESTING_REMOTELY),j=a.env.version,I=new Headers;if(I.set("User-Agent",`transformers.js/${j}; is_ci/${S};`),p(b,["http:","https:"],["huggingface.co","hf.co"])){const U=(Ii==null?void 0:Ii.HF_TOKEN)??(Ii==null?void 0:Ii.HF_ACCESS_TOKEN);U&&I.set("Authorization",`Bearer ${U}`)}return fetch(b,{headers:I})}else return fetch(b)}const m={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function v(b,M,S){if(!S)return null;const j=m[b]??`Error (${b}) occurred while trying to load file`;throw Error(`${j}: "${M}".`)}class k{constructor(M){this.path=M}async match(M){let S=s.join(this.path,M),j=new d(S);if(j.exists)return j}async put(M,S,j=void 0){let I=s.join(this.path,M);try{const q=S.headers.get("Content-Length"),U=parseInt(q??"0");let R=0;await n.promises.mkdir(s.dirname(I),{recursive:!0});const K=n.createWriteStream(I),H=S.body.getReader();for(;;){const{done:ee,value:te}=await H.read();if(ee)break;await new Promise((ae,ne)=>{K.write(te,L=>{if(L){ne(L);return}ae()})}),R+=te.length;const V=U?R/U*100:0;j==null||j({progress:V,loaded:R,total:U})}K.close()}catch(q){try{await n.promises.unlink(I)}catch{}throw q}}}async function y(b,...M){for(let S of M)try{let j=await b.match(S);if(j)return j}catch{continue}}async function g(b,M,S=!0,j={},I=!1){if(!a.env.allowLocalModels){if(j.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!a.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,i.dispatchCallback)(j.progress_callback,{status:"initiate",name:b,file:M});let q;if(!q&&a.env.useCustomCache){if(!a.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!a.env.customCache.match||!a.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");q=a.env.customCache}if(!q&&a.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{q=await caches.open("transformers-cache")}catch(se){console.warn("An error occurred while opening the browser cache:",se)}}if(!q&&a.env.useFSCache){if(!a.apis.IS_FS_AVAILABLE)throw Error("File System Cache is not available in this environment.");q=new k(j.cache_dir??a.env.cacheDir)}const U=j.revision??"main",R=x(b,M),K=h(b),H=K?x(a.env.localModelPath,R):R,ee=x(a.env.remoteHost,a.env.remotePathTemplate.replaceAll("{model}",b).replaceAll("{revision}",encodeURIComponent(U)),M);let te;const V=q instanceof k?U==="main"?R:x(b,U,M):ee;let ae=!1,ne;q&&(ne=await y(q,H,V));const L=ne!==void 0;if(ne===void 0){if(a.env.allowLocalModels)if(p(R,["http:","https:"])){if(j.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${R}.`);if(!a.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${R}.`)}else try{ne=await f(H),te=H}catch(_e){console.warn(`Unable to load from local path "${H}": "${_e}"`)}if(ne===void 0||ne.status===404){if(j.local_files_only||!a.env.allowRemoteModels){if
3367(S)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${H}".`);return null}if(!K)throw Error(`Local file missing at "${H}" and download aborted due to invalid model ID "${b}".`);if(ne=await f(ee),ne.status!==200)return v(ne.status,ee,S);te=V}ae=q&&typeof Response<"u"&&ne instanceof Response&&ne.status===200}(0,i.dispatchCallback)(j.progress_callback,{status:"download",name:b,file:M});let $;if(!(a.apis.IS_NODE_ENV&&I)){let se;j.progress_callback?L&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(se=new Uint8Array(await ne.arrayBuffer()),(0,i.dispatchCallback)(j.progress_callback,{status:"progress",name:b,file:M,progress:100,loaded:se.length,total:se.length})):se=await w(ne,_e=>{(0,i.dispatchCallback)(j.progress_callback,{status:"progress",name:b,file:M,..._e})}):se=new Uint8Array(await ne.arrayBuffer()),$=se}if(ae&&te&&await q.match(te)===void 0&&($?await q.put(te,new Response($,{headers:ne.headers})).catch(se=>{console.warn(`Unable to add response to browser cache: ${se}.`)}):await q.put(te,ne,j.progress_callback)),(0,i.dispatchCallback)(j.progress_callback,{status:"done",name:b,file:M}),$){if(!a.apis.IS_NODE_ENV&&I)throw new Error("Cannot return path in a browser environment.");return $}if(ne instanceof d)return ne.filePath;const G=await(q==null?void 0:q.match(te));if(G instanceof d)return G.filePath;if(G instanceof Response)return new Uint8Array(await G.arrayBuffer());if(typeof G=="string")return G;throw new Error("Unable to get model file path or buffer.")}async function _(b,M,S=!0,j={}){const I=await g(b,M,S,j,!1);if(I===null)return{};const U=new TextDecoder("utf-8").decode(I);return JSON.parse(U)}async function w(b,M){const S=b.headers.get("Content-Length");S===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let j=parseInt(S??"0"),I=new Uint8Array(j),q=0;const U=b.body.getReader();async function R(){const{done:K,value:H}=await U.read();if(K)return;const ee=q+H.length;if(ee>j){j=ee;const V=new Uint8Array(j);V.set(I),I=V}I.set(H,q),q=ee;const te=q/j*100;return M({progress:te,loaded:q,total:j}),R()}return await R(),I}function x(...b){return b=b.map((M,S)=>(S&&(M=M.replace(new RegExp("^/"),"")),S!==b.length-1&&(M=M.replace(new RegExp("/$"),"")),M)),b.join("/")}},
vendor: 8,092 bytes, line 3367
3367"./src/utils/image.js":(e,t,r)=>{r.r(t),r.d(t,{RawImage:()=>m,load_image:()=>v});var n=r("./src/utils/core.js"),s=r("./src/utils/hub.js"),a=r("./src/env.js"),i=r("./src/utils/tensor.js"),l=r("?2b25");let c,d,p;const u=a.apis.IS_BROWSER_ENV||a.apis.IS_WEBWORKER_ENV;if(u)c=(k,y)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(k,y)},p=self.createImageBitmap,d=self.ImageData;else if(l)p=async k=>{const g=(await k.metadata()).channels,{data:_,info:w}=await k.rotate().raw().toBuffer({resolveWithObject:!0}),x=new m(new Uint8ClampedArray(_),w.width,w.height,w.channels);return g!==void 0&&g!==w.channels&&x.convert(g),x};else throw new Error("Unable to load image processing library.");const h={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},f=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class m{constructor(y,g,_,w){this.data=y,this.width=g,this.height=_,this.channels=w}get size(){return[this.width,this.height]}static async read(y){if(y instanceof m)return y;if(typeof y=="string"||y instanceof URL)return await this.fromURL(y);if(y instanceof Blob)return await this.fromBlob(y);if(typeof HTMLCanvasElement<"u"&&y instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&y instanceof OffscreenCanvas)return this.fromCanvas(y);throw new Error(`Unsupported input type: ${typeof y}`)}static fromCanvas(y){if(!u)throw new Error("fromCanvas() is only supported in browser environments.");const _=y.getContext("2d").getImageData(0,0,y.width,y.height).data;return new m(_,y.width,y.height,4)}static async fromURL(y){const g=await(0,s.getFile)(y);if(g.status!==200)throw new Error(`Unable to read image from "${y}" (${g.status} ${g.statusText})`);const _=await g.blob();return this.fromBlob(_)}static async fromBlob(y){if(u){const g=await p(y),_=c(g.width,g.height).getContext("2d");return _.drawImage(g,0,0),new this(_.getImageData(0,0,g.width,g.height).data,g.width,g.height,4)}else{const g=l(await y.arrayBuffer());return await p(g)}}static fromTensor(y,g="CHW"){if(y.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${y.dims.length} dimensions.`);if(g==="CHW")y=y.transpose(1,2,0);else if(g!=="HWC")throw new Error(`Unsupported channel format: ${g}`);if(!(y.data instanceof Uint8ClampedArray||y.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${y.type}`);switch(y.dims[2]){case 1:case 2:case 3:case 4:return new m(y.data,y.dims[1],y.dims[0],y.dims[2]);default:throw new Error(`Unsupported number of channels: ${y.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const y=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let g=0,_=0;g<this.data.length;g+=this.channels){const w=this.data[g],x=this.data[g+1],b=this.data[g+2];y[_++]=Math.round(.2989*w+.587*x+.114*b)}break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this._update(y,this.width,this.height,1)}rgb(){if(this.channels===3)return this;const y=new Uint8ClampedArray(this.width*this.height*3);switch(this.channels){case 1:for(let g=0,_=0;g<this.data.length;++g)y[_++]=this.data[g],y[_++]=this.data[g],y[_++]=this.data[g];break;case 4:for(let g=0,_=0;g<this.data.length;g+=4)y[_++]=this.data[g],y[_++]=this.data[g+1],y[_++]=this.data[g+2];break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this._update(y,this.width,this.height,3)}rgba(){if(this.channels===4)return this;const y=new Uint8ClampedArray(this.width*this.height*4);switch(this.channels){case 1:for(let g=0,_=0;g<this.data.length;++g)y[_++]=this.data[g],y[_++]=this.data[g],y[_++]=this.data[g],y[_++]=255;break;case 3:for(let g=0,_=0;g<this.data.length;g+=3)y[_++]=this.data[g],y[_++]=this.data[g+1],y[_++]=this.data[g+2],y[_++]=255;break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this._update(y,this.width,this.height,4)}putAlpha(y){if(y.width!==this.width||y.height!==this.height)throw new Error(`Expected mask size to be ${this.width}x${this.height}, but got ${y.width}x${y.height}`);if(y.channels!==1)throw new Error(`Expected mask to have 1 channel, but got ${y.channels}`);const g=this.data,_=y.data,w=this.width*this.height;if(this.channels===3){const x=new Uint8ClampedArray(w*4);for(let b=0,M=0,S=0;b<w;++b)x[S++]=g[M++],x[S++]=g[M++],x[S++]=g[M++],x[S++]=_[b];return this._update(x,this.width,this.height,4)}else if(this.channels===4){for(let x=0;x<w;++x)g[4*x+3]=_[x];return this}throw new Error(`Expected image to have 3 or 4 channels, but got ${this.channels}`)}async resize(y,g,{resample:_=2}={}){if(this.width===y&&this.height===g)return this;let w=h[_]??_;const x=(0,n.isNullishDimension)(y),b=(0,n.isNullishDimension)(g);if(x&&b)return this;if(x?y=g/this.height*this.width:b&&(g=y/this.width*this.height),u){const M=this.channels,S=this.toCanvas(),j=c(y,g).getContext("2d");return j.drawImage(S,0,0,y,g),new m(j.getImageData(0,0,y,g).data,y,g,4).convert(M)}else{let M=this.toSharp();switch(w){case"box":case"hamming":(w==="box"||w==="hamming")&&(console.warn(`Resampling method ${w} is not yet supported. Using bilinear instead.`),w="bilinear");case"nearest":case"bilinear":case"bicubic":M=M.affine([y/this.width,0,0,g/this.height],{interpolator:w});break;case"lanczos":M=M.resize({width:y,height:g,fit:"fill",kernel:"lanczos3"});break;default:throw new Error(`Resampling method ${w} is not supported.`)}return await p(M)}}async pad([y,g,_,w]){if(y=Math.max(y,0),g=Math.max(g,0),_=Math.max(_,0),w=Math.max(w,0),y===0&&g===0&&_===0&&w===0)return this;if(u){const x=this.channels,b=this.toCanvas(),M=this.width+y+g,S=this.height+_+w,j=c(M,S).getContext("2d");return j.drawImage(b,0,0,this.width,this.height,y,_,this.width,this.height),new m(j.getImageData(0,0,M,S).data,M,S,4).convert(x)}else{const x=this.toSharp().extend({left:y,right:g,top:_,bottom:w});return await p(x)}}async crop([y,g,_,w]){if(y=Math.max(y,0),g=Math.max(g,0),_=Math.min(_,this.width-1),w=Math.min(w,this.height-1),y===0&&g===0&&_===this.width-1&&w===this.height-1)return this;const x=_-y+1,b=w-g+1;if(u){const M=this.channels,S=this.toCanvas(),j=c(x,b).getContext("2d");return j.drawImage(S,y,g,x,b,0,0,x,b),new m(j.getImageData(0,0,x,b).data,x,b,4).convert(M)}else{const M=this.toSharp().extract({left:y,top:g,width:x,height:b});return await p(M)}}async center_crop(y,g){if(this.width===y&&this.height===g)return this;const _=(this.width-y)/2,w=(this.height-g)/2;if(u){const x=this.channels,b=this.toCanvas(),M=c(y,g).getContext("2d");let S=0,j=0,I=0,q=0;return _>=0?S=_:I=-_,w>=0?j=w:q=-w,M.drawImage(b,S,j,y,g,I,q,y,g),new m(M.getImageData(0,0,y,g).data,y,g,4).convert(x)}else{let x=this.toSharp();if(_>=0&&w>=0)x=x.extract({left:Math.floor(_),top:Math.floor(w),width:y,height:g});else if(_<=0&&w<=0){const b=Math.floor(-w),M=Math.floor(-_);x=x.extend({top:b,left:M,right:y-this.width-M,bottom:g-this.height-b})}else{let b=[0,0],M=0;w<0?(b[0]=Math.floor(-w),b[1]=g-this.height-b[0]):M=Math.floor(w);let S=[0,0],j=0;_<0?(S[0]=Math.floor(-_),S[1]=y-this.width-S[0]):j=Math.floor(_),x=x.extend({top:b[0],bottom:b[1],left:S[0],right:S[1]}).extract({left:j,top:M,width:y,height:g})}return await p(x)}}async toBlob(y="image/png",g=1){if(!u)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:y,quality:g})}toTensor(y="CHW"){let g=new i.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(y!=="HWC")if(y==="CHW")g=g.permute(2,0,1);else throw new Error(`Unsupported channel format: ${y}`);return g}toCanvas(){if(!u)throw new Error("toCanvas() is only supported in browser environments.");const y=this.clone().rgba(),g=c(y.width,y.height),_=new d(y.data,y.width,y.height);return g.getContext("2d").putImageData(_,0,0),g}split(){const{data:y,width:g,height:_,channels:w}=this,x=y.constructor,b=y.length/w,M=Array.from({length:w},()=>new x(b));for(let S=0;S<b;
3367++S){const j=w*S;for(let I=0;I<w;++I)M[I][S]=y[j+I]}return M.map(S=>new m(S,g,_,1))}_update(y,g,_,w=null){return this.data=y,this.width=g,this.height=_,w!==null&&(this.channels=w),this}clone(){return new m(this.data.slice(),this.width,this.height,this.channels)}convert(y){if(this.channels===y)return this;switch(y){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(y){if(u){if(a.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const g=y.split(".").pop().toLowerCase(),_=f.get(g)??"image/png",w=await this.toBlob(_);(0,n.saveBlob)(y,w)}else{if(a.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(y);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(u)throw new Error("toSharp() is only supported in server-side environments.");return l(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const v=m.read.bind(m)},
vendor: 8,533 bytes, line 3367
3367"./src/utils/maths.js":(e,t,r)=>{r.r(t),r.d(t,{FFT:()=>v,bankers_round:()=>g,cos_sim:()=>c,dot:()=>l,dynamic_time_warping:()=>_,interpolate_data:()=>n,log_softmax:()=>i,magnitude:()=>d,max:()=>u,medianFilter:()=>k,min:()=>p,permute_data:()=>s,round:()=>y,softmax:()=>a});function n(w,[x,b,M],[S,j],I="bilinear",q=!1){const U=j/M,R=S/b,K=new w.constructor(S*j*x),H=b*M,ee=S*j;for(let te=0;te<S;++te)for(let V=0;V<j;++V){const ae=te*j+V,ne=(V+.5)/U-.5,L=(te+.5)/R-.5;let $=Math.floor(ne),G=Math.floor(L);const se=Math.min($+1,M-1),_e=Math.min(G+1,b-1);$=Math.max($,0),G=Math.max(G,0);const de=ne-$,Ee=L-G,ze=(1-de)*(1-Ee),Ke=de*(1-Ee),ve=(1-de)*Ee,J=de*Ee,ue=G*M,Y=_e*M,Se=ue+$,Ae=ue+se,Oe=Y+$,Ne=Y+se;for(let Q=0;Q<x;++Q){const re=Q*H;K[Q*ee+ae]=ze*w[re+Se]+Ke*w[re+Ae]+ve*w[re+Oe]+J*w[re+Ne]}}return K}function s(w,x,b){const M=new Array(b.length),S=new Array(b.length);for(let q=b.length-1,U=1;q>=0;--q)S[q]=U,M[q]=x[b[q]],U*=M[q];const j=b.map((q,U)=>S[b.indexOf(U)]),I=new w.constructor(w.length);for(let q=0;q<w.length;++q){let U=0;for(let R=x.length-1,K=q;R>=0;--R)U+=K%x[R]*j[R],K=Math.floor(K/x[R]);I[U]=w[q]}return[I,M]}function a(w){const x=u(w)[0],b=w.map(j=>Math.exp(j-x)),M=b.reduce((j,I)=>j+I,0);return b.map(j=>j/M)}function i(w){const x=u(w)[0];let b=0;for(let j=0;j<w.length;++j)b+=Math.exp(w[j]-x);const M=Math.log(b);return w.map(j=>j-x-M)}function l(w,x){let b=0;for(let M=0;M<w.length;++M)b+=w[M]*x[M];return b}function c(w,x){const b=l(w,x),M=d(w),S=d(x);return b/(M*S)}function d(w){return Math.sqrt(w.reduce((x,b)=>x+b*b,0))}function p(w){if(w.length===0)throw Error("Array must not be empty");let x=w[0],b=0;for(let M=1;M<w.length;++M)w[M]<x&&(x=w[M],b=M);return[x,b]}function u(w){if(w.length===0)throw Error("Array must not be empty");let x=w[0],b=0;for(let M=1;M<w.length;++M)w[M]>x&&(x=w[M],b=M);return[x,b]}function h(w){return w>0&&(w&w-1)===0}class f{constructor(x){if(this.size=x|0,this.size<=1||!h(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=x<<1,this.table=new Float64Array(this.size*2);for(let M=0;M<this.table.length;M+=2){const S=Math.PI*M/this.size;this.table[M]=Math.cos(S),this.table[M+1]=-Math.sin(S)}let b=0;for(let M=1;this.size>M;M<<=1)++b;this._width=b%2===0?b-1:b,this._bitrev=new Int32Array(1<<this._width);for(let M=0;M<this._bitrev.length;++M){this._bitrev[M]=0;for(let S=0;S<this._width;S+=2){const j=this._width-S-2;this._bitrev[M]|=(M>>>S&3)<<j}}}createComplexArray(){return new Float64Array(this._csize)}fromComplexArray(x,b){const M=b||new Array(x.length>>>1);for(let S=0;S<x.length;S+=2)M[S>>>1]=x[S];return M}toComplexArray(x,b){const M=b||this.createComplexArray();for(let S=0;S<M.length;S+=2)M[S]=x[S>>>1],M[S+1]=0;return M}transform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._transform4(x,b,1)}realTransform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._realTransform4(x,b,1)}inverseTransform(x,b){if(x===b)throw new Error("Input and output buffers must be different");this._transform4(x,b,-1);for(let M=0;M<x.length;++M)x[M]/=this.size}_transform4(x,b,M){const S=this._csize;let I=1<<this._width,q=S/I<<1,U,R;const K=this._bitrev;if(q===4)for(U=0,R=0;U<S;U+=q,++R){const ee=K[R];this._singleTransform2(b,x,U,ee,I)}else for(U=0,R=0;U<S;U+=q,++R){const ee=K[R];this._singleTransform4(b,x,U,ee,I,M)}const H=this.table;for(I>>=2;I>=2;I>>=2){q=S/I<<1;const ee=q>>>2;for(U=0;U<S;U+=q){const te=U+ee-1;for(let V=U,ae=0;V<te;V+=2,ae+=I){const ne=V,L=ne+ee,$=L+ee,G=$+ee,se=x[ne],_e=x[ne+1],de=x[L],Ee=x[L+1],ze=x[$],Ke=x[$+1],ve=x[G],J=x[G+1],ue=H[ae],Y=M*H[ae+1],Se=de*ue-Ee*Y,Ae=de*Y+Ee*ue,Oe=H[2*ae],Ne=M*H[2*ae+1],Q=ze*Oe-Ke*Ne,re=ze*Ne+Ke*Oe,pe=H[3*ae],Me=M*H[3*ae+1],Te=ve*pe-J*Me,me=ve*Me+J*pe,Pe=se+Q,Be=_e+re,rt=se-Q,et=_e-re,Ye=Se+Te,Fe=Ae+me,lt=M*(Se-Te),It=M*(Ae-me);x[ne]=Pe+Ye,x[ne+1]=Be+Fe,x[L]=rt+It,x[L+1]=et-lt,x[$]=Pe-Ye,x[$+1]=Be-Fe,x[G]=rt-It,x[G+1]=et+lt}}}}_singleTransform2(x,b,M,S,j){const I=x[S],q=x[S+1],U=x[S+j],R=x[S+j+1];b[M]=I+U,b[M+1]=q+R,b[M+2]=I-U,b[M+3]=q-R}_singleTransform4(x,b,M,S,j,I){const q=j*2,U=j*3,R=x[S],K=x[S+1],H=x[S+j],ee=x[S+j+1],te=x[S+q],V=x[S+q+1],ae=x[S+U],ne=x[S+U+1],L=R+te,$=K+V,G=R-te,se=K-V,_e=H+ae,de=ee+ne,Ee=I*(H-ae),ze=I*(ee-ne);b[M]=L+_e,b[M+1]=$+de,b[M+2]=G+ze,b[M+3]=se-Ee,b[M+4]=L-_e,b[M+5]=$-de,b[M+6]=G-ze,b[M+7]=se+Ee}_realTransform4(x,b,M){const S=this._csize;let I=1<<this._width,q=S/I<<1,U,R;const K=this._bitrev;if(q===4)for(U=0,R=0;U<S;U+=q,++R){const te=K[R];this._singleRealTransform2(b,x,U,te>>>1,I>>>1)}else for(U=0,R=0;U<S;U+=q,++R){const te=K[R];this._singleRealTransform4(b,x,U,te>>>1,I>>>1,M)}const H=this.table;for(I>>=2;I>=2;I>>=2){q=S/I<<1;const te=q>>>1,V=te>>>1,ae=V>>>1;for(U=0;U<S;U+=q)for(let ne=0,L=0;ne<=ae;ne+=2,L+=I){const $=U+ne,G=$+V,se=G+V,_e=se+V,de=x[$],Ee=x[$+1],ze=x[G],Ke=x[G+1],ve=x[se],J=x[se+1],ue=x[_e],Y=x[_e+1],Se=de,Ae=Ee,Oe=H[L],Ne=M*H[L+1],Q=ze*Oe-Ke*Ne,re=ze*Ne+Ke*Oe,pe=H[2*L],Me=M*H[2*L+1],Te=ve*pe-J*Me,me=ve*Me+J*pe,Pe=H[3*L],Be=M*H[3*L+1],rt=ue*Pe-Y*Be,et=ue*Be+Y*Pe,Ye=Se+Te,Fe=Ae+me,lt=Se-Te,It=Ae-me,Qt=Q+rt,Gt=re+et,zr=M*(Q-rt),hr=M*(re-et);if(x[$]=Ye+Qt,x[$+1]=Fe+Gt,x[G]=lt+hr,x[G+1]=It-zr,ne===0){x[se]=Ye-Qt,x[se+1]=Fe-Gt;continue}if(ne===ae)continue;const Tt=U+V-ne,ks=U+te-ne;x[Tt]=lt-M*hr,x[Tt+1]=-It-M*zr,x[ks]=Ye-M*Qt,x[ks+1]=-Fe+M*Gt}}const ee=S>>>1;for(let te=2;te<ee;te+=2)x[S-te]=x[te],x[S-te+1]=-x[te+1]}_singleRealTransform2(x,b,M,S,j){const I=x[S],q=x[S+j];b[M]=I+q,b[M+1]=0,b[M+2]=I-q,b[M+3]=0}_singleRealTransform4(x,b,M,S,j,I){const q=j*2,U=j*3,R=x[S],K=x[S+j],H=x[S+q],ee=x[S+U],te=R+H,V=R-H,ae=K+ee,ne=I*(K-ee);b[M]=te+ae,b[M+1]=0,b[M+2]=V,b[M+3]=-ne,b[M+4]=te-ae,b[M+5]=0,b[M+6]=V,b[M+7]=ne}}class m{constructor(x){const b=2*(x-1),M=2*(2*x-1),S=2**Math.ceil(Math.log2(M));this.bufferSize=S,this._a=b;const j=new Float64Array(M),I=new Float64Array(S);this._chirpBuffer=new Float64Array(S),this._buffer1=new Float64Array(S),this._buffer2=new Float64Array(S),this._outBuffer1=new Float64Array(S),this._outBuffer2=new Float64Array(S);const q=-2*Math.PI/x,U=Math.cos(q),R=Math.sin(q);for(let K=0;K<M>>1;++K){const H=(K+1-x)**2/2,ee=Math.sqrt(U**2+R**2)**H,te=H*Math.atan2(R,U),V=2*K;j[V]=ee*Math.cos(te),j[V+1]=ee*Math.sin(te),I[V]=j[V],I[V+1]=-j[V+1]}this._slicedChirpBuffer=j.subarray(b,M),this._f=new f(S>>1),this._f.transform(this._chirpBuffer,I)}_transform(x,b,M){const S=this._buffer1,j=this._buffer2,I=this._outBuffer1,q=this._outBuffer2,U=this._chirpBuffer,R=this._slicedChirpBuffer,K=this._a;if(M)for(let H=0;H<R.length;H+=2){const ee=H+1,te=H>>1,V=b[te];S[H]=V*R[H],S[ee]=V*R[ee]}else for(let H=0;H<R.length;H+=2){const ee=H+1;S[H]=b[H]*R[H]-b[ee]*R[ee],S[ee]=b[H]*R[ee]+b[ee]*R[H]}this._f.transform(I,S);for(let H=0;H<U.length;H+=2){const ee=H+1;j[H]=I[H]*U[H]-I[ee]*U[ee],j[ee]=I[H]*U[ee]+I[ee]*U[H]}this._f.inverseTransform(q,j);for(let H=0;H<q.length;H+=2){const ee=q[H+K],te=q[H+K+1],V=R[H],ae=R[H+1];x[H]=ee*V-te*ae,x[H+1]=ee*ae+te*V}}transform(x,b){this._transform(x,b,!1)}realTransform(x,b){this._transform(x,b,!0)}}class v{constructor(x){this.fft_length=x,this.isPowerOfTwo=h(x),this.isPowerOfTwo?(this.fft=new f(x),this.outputBufferSize=2*x):(this.fft=new m(x),this.outputBufferSize=this.fft.bufferSize)}realTransform(x,b){this.fft.realTransform(x,b)}transform(x,b){this.fft.transform(x,b)}}function k(w,x){if(x%2===0||x<=0)throw new Error("Window size must be a positive odd number");const b=new w.constructor(w.length),M=new w.constructor(x),S=Math.floor(x/2);for(let j=0;j<w.length;++j){let I=0;for(let q=-S;q<=S;++q){let U=j+q;U<0?U=Math.abs(U):U>=w.length&&(U=2*(w.length-1)-U),M[I++]=w[U]}M.sort(),b[j]=M[S]}return b}function y(w,x){const b=Math.pow(10,x);return Math.round(w*b)/b}function g(w){const x=Math.round(w);return Math.abs(w)%1===.5?x%2===0?x:x-1:x}function _(w){const x=w.length,b=w[0].length,M=[x+1,b+1],S=Array.from({length:M[0]},()=>Array(M[1]).fill(1/0));S[0][0]=0;const j=Array.from({length:M[0]},()=>Array(M[1]).fill(-1));for(let K=1;K<M[1];++K)for(let H=1;H<M[0];++H){const ee=S[H-1][K-1],te=S[H-1][K],V=S[H][K-1];let ae,ne;ee<te&&ee<V?(ae=ee,ne=0):te<ee&&te<V?(ae=te,ne=1):(ae=V,ne=2),S[H][K]=w[H-1][K-1]+ae,j[H][K]=ne}for(let K=0;K<M[1];++K)j[0][K]=2;for(let K=0;K<M[0];++K)j[K][0]=1;let I=x,q=b,U=[],R=[];for(;I>0||q>0;)switch(U.push(I-1),R.push(q-1),j[I][q]){case 0:--I,--q;break;case 1:--I;break;case 2:--q;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${I}, ${q}]. Please file a bug report.`)}return U.reverse(),R.reverse(),[U,R]}},
3367"./src/utils/tensor.js":(e,t,r)=>{r.r(t),r.d(t,{DataTypeMap:()=>i,Tensor:()=>l,cat:()=>b,full:()=>R,full_like:()=>K,interpolate:()=>p,interpolate_4d:()=>u,layer_norm:()=>g,matmul:()=>h,mean:()=>I,mean_pooling:()=>y,ones:()=>H,ones_like:()=>ee,permute:()=>d,quantize_embeddings:()=>ne,rand:()=>ae,rfft:()=>f,slice:()=>k,stack:()=>M,std_mean:()=>j,topk:()=>m,zeros:()=>te,zeros_like:()=>V});var n=r("./src/utils/maths.js"),s=r("./src/backends/onnx.js"),a=r("./src/ops/registry.js");const i=Object.freeze({float32:Float32Array,float16:typeof Float16Array<"u"?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class l{constructor(...$){ce(this,"ort_tensor");return(0,s.isONNXTensor)($[0])?this.ort_tensor=$[0]:this.ort_tensor=new s.Tensor($[0],$[1],$[2]),new Proxy(this,{get:(G,se)=>{if(typeof se=="string"){let _e=Number(se);if(Number.isInteger(_e))return G._getitem(_e)}return G[se]},set:(G,se,_e)=>G[se]=_e})}get dims(){return this.ort_tensor.dims}set dims($){this.ort_tensor.dims=$}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[$,...G]=this.dims;if(G.length>0){const se=G.reduce((_e,de)=>_e*de);for(let _e=0;_e<$;++_e)yield this._subarray(_e,se,G)}else yield*this.data}_getitem($){const[G,...se]=this.dims;if($=x($,G),se.length>0){const _e=se.reduce((de,Ee)=>de*Ee);return this._subarray($,_e,se)}else return new l(this.type,[this.data[$]],se)}indexOf($){const G=this.data;for(let se=0;se<G.length;++se)if(G[se]==$)return se;return-1}_subarray($,G,se){const _e=$*G,de=($+1)*G,Ee="subarray"in this.data?this.data.subarray(_e,de):this.data.slice(_e,de);return new l(this.type,Ee,se)}item(){const $=this.data;if($.length!==1)throw new Error(`a Tensor with ${$.length} elements cannot be converted to Scalar`);return $[0]}tolist(){return c(this.data,this.dims)}sigmoid(){return this.clone().sigmoid_()}sigmoid_(){const $=this.data;for(let G=0;G<$.length;++G)$[G]=1/(1+Math.exp(-$[G]));return this}map($){return this.clone().map_($)}map_($){const G=this.data;for(let se=0;se<G.length;++se)G[se]=$(G[se],se,G);return this}mul($){return this.clone().mul_($)}mul_($){const G=this.data;for(let se=0;se<G.length;++se)G[se]*=$;return this}div($){return this.clone().div_($)}div_($){const G=this.data;for(let se=0;se<G.length;++se)G[se]/=$;return this}add($){return this.clone().add_($)}add_($){const G=this.data;for(let se=0;se<G.length;++se)G[se]+=$;return this}sub($){return this.clone().sub_($)}sub_($){const G=this.data;for(let se=0;se<G.length;++se)G[se]-=$;return this}clone(){return new l(this.type,this.data.slice(),this.dims.slice())}slice(...$){const G=[],se=[];for(let ve=0;ve<this.dims.length;++ve){let J=$[ve];if(J==null)se.push([0,this.dims[ve]]),G.push(this.dims[ve]);else if(typeof J=="number")J=x(J,this.dims[ve],ve),se.push([J,J+1]);else if(Array.isArray(J)&&J.length===2){let[ue,Y]=J;
3367if(ue=ue===null?0:x(ue,this.dims[ve],ve,!1),Y=Y===null?this.dims[ve]:x(Y,this.dims[ve],ve,!1),ue>Y)throw new Error(`Invalid slice: ${J}`);const Se=[Math.max(ue,0),Math.min(Y,this.dims[ve])];se.push(Se),G.push(Se[1]-Se[0])}else throw new Error(`Invalid slice: ${J}`)}const _e=se.map(([ve,J])=>J-ve),de=_e.reduce((ve,J)=>ve*J),Ee=this.data,ze=new Ee.constructor(de),Ke=this.stride();for(let ve=0;ve<de;++ve){let J=0;for(let ue=_e.length-1,Y=ve;ue>=0;--ue){const Se=_e[ue];J+=(Y%Se+se[ue][0])*Ke[ue],Y=Math.floor(Y/Se)}ze[ve]=Ee[J]}return new l(this.type,ze,G)}permute(...$){return d(this,$)}transpose(...$){return this.permute(...$)}sum($=null,G=!1){return this.norm(1,$,G)}norm($="fro",G=null,se=!1){if($==="fro")$=2;else if(typeof $=="string")throw Error(`Unsupported norm: ${$}`);const _e=this.data,de=(ve,J)=>ve+J**$;if(G===null){const ve=_e.reduce(de,0)**(1/$);return new l(this.type,[ve],[])}const[Ee,ze,Ke]=S(de,this,G,se);if($!==1)for(let ve=0;ve<ze.length;++ve)ze[ve]=ze[ve]**(1/$);return new l(Ee,ze,Ke)}normalize_($=2,G=1){G=x(G,this.dims.length);const se=this.norm($,G,!0),_e=this.data,de=se.data;for(let Ee=0;Ee<_e.length;++Ee){let ze=0;for(let Ke=this.dims.length-1,ve=Ee,J=1;Ke>=0;--Ke){const ue=this.dims[Ke];
3367if(Ke!==G){const Y=ve%ue;ze+=Y*J,J*=this.dims[Ke]}ve=Math.floor(ve/ue)}_e[Ee]/=de[ze]}return this}normalize($=2,G=1){return this.clone().normalize_($,G)}stride(){return q(this.dims)}squeeze($=null){return new l(this.type,this.data,_(this.dims,$))}squeeze_($=null){return this.dims=_(this.dims,$),this}unsqueeze($=null){return new l(this.type,this.data,w(this.dims,$))}unsqueeze_($=null){return this.dims=w(this.dims,$),this}flatten_($=0,G=-1){G=(G+this.dims.length)%this.dims.length;let se=this.dims.slice(0,$),_e=this.dims.slice($,G+1),de=this.dims.slice(G+1);return this.dims=[...se,_e.reduce((Ee,ze)=>Ee*ze,1),...de],this}flatten($=0,G=-1){return this.clone().flatten_($,G)}view(...$){let G=-1;for(let _e=0;_e<$.length;++_e)if($[_e]===-1){if(G!==-1)throw new Error("Only one dimension can be inferred");G=_e}const se=this.data;if(G!==-1){const _e=$.reduce((de,Ee,ze)=>ze!==G?de*Ee:de,1);$[G]=se.length/_e}return new l(this.type,se,$)}neg_(){const $=this.data;for(let G=0;G<$.length;++G)$[G]=-$[G];return this}neg(){return this.clone().neg_()}gt($){const G=new Uint8Array(this.data.length),se=this.data;for(let _e=0;_e<se.length;++_e)G[_e]=se[_e]>$?1:0;return new l("bool",G,this.dims)}lt($){const G=new Uint8Array(this.data.length),se=this.data;for(let _e=0;_e<se.length;++_e)G[_e]=se[_e]<$?1:0;return new l("bool",G,this.dims)}clamp_($,G){const se=this.data;for(let _e=0;_e<se.length;++_e)se[_e]=Math.min(Math.max(se[_e],$),G);return this}clamp($,G){return this.clone().clamp_($,G)}round_(){const $=this.data;for(let G=0;G<$.length;++G)$[G]=Math.round($[G]);return this}round(){return this.clone().round_()}mean($=null,G=!1){return I(this,$,G)}min($=null,G=!1){if($===null){const Ee=(0,n.min)(this.data)[0];return new l(this.type,[Ee],[])}const[se,_e,de]=S((Ee,ze)=>Math.min(Ee,ze),this,$,G,1/0);return new l(se,_e,de)}max($=null,G=!1){if($===null){const Ee=(0,n.max)(this.data)[0];return new l(this.type,[Ee],[])}const[se,_e,de]=S((Ee,ze)=>Math.max(Ee,ze),this,$,G,-1/0);return new l(se,_e,de)}argmin($=null,G=!1){if($!==null)throw new Error("`dim !== null` not yet implemented.");const se=(0,n.min)(this.data)[1];return new l("int64",[BigInt(se)],[])}argmax($=null,G=!1){if($!==null)throw new Error("`dim !== null` not yet implemented.");const se=(0,n.max)(this.data)[1];return new l("int64",[BigInt(se)],[])}to($){if(this.type===$)return this;if(!i.hasOwnProperty($))throw new Error(`Unsupported type: ${$}`);let G;const se=["int64","uint64"].includes(this.type),_e=["int64","uint64"].includes($);return se&&!_e?G=Number:!se&&_e&&(G=BigInt),new l($,i[$].from(this.data,G),this.dims)}}function c(L,$){const G=L.length,se=$.reduce((de,Ee)=>de*Ee);if(G!==se)throw Error(`cannot reshape array of size ${G} into shape (${$})`);let _e=L;for(let de=$.length-1;de>=0;de--)_e=_e.reduce((Ee,ze)=>{let Ke=Ee[Ee.length-1];return Ke.length<$[de]?Ke.push(ze):Ee.push([ze]),Ee},[[]]);return _e[0]}function d(L,$){const[G,se]=(0,n.permute_data)(L.data,L.dims,$);return new l(L.type,G,se)}function p(L,[$,G],se="bilinear",_e=!1){const de=L.dims.at(-3)??1,Ee=L.dims.at(-2),ze=L.dims.at(-1);let Ke=(0,n.interpolate_data)(L.data,[de,Ee,ze],[$,G],se,_e);return new l(L.type,Ke,[de,$,G])}async function u(L,{size:$=null,mode:G="bilinear"}={}){if(L.dims.length!==4)throw new Error("`interpolate_4d` currently only supports 4D input.");if(!$)throw new Error("`interpolate_4d` requires a `size` argument.");let se;if($.length===2)se=[...L.dims.slice(0,2),...$];else if($.length===3)se=[L.dims[0],...$];else if($.length===4)se=$;else throw new Error("`size` must be of length 2, 3, or 4.");let _e;if(G==="nearest")_e=await a.TensorOpRegistry.nearest_interpolate_4d;else if(G==="bilinear")_e=await a.TensorOpRegistry.bilinear_interpolate_4d;else if(G==="bicubic")_e=await a.TensorOpRegistry.bicubic_interpolate_4d;else throw new Error(`Unsupported mode: ${G}`);const de=new l("int64",new BigInt64Array(se.map(BigInt)),[se.length]);return await _e({x:L,s:de})}async function h(L,$){return await(await a.TensorOpRegistry.matmul)({a:L,b:$})}async function f(L,$){return await(await a.TensorOpRegistry.rfft)({x:L,a:$})}async function m(L,$){const G=await a.TensorOpRegistry.top_k;return $==null?$=L.dims.at(-1):$=Math.min($,L.dims.at(-1)),await G({x:L,k:new l("int64",[BigInt($)],[1])})}const v=L=>new l("int64",L,[L.length]);async function k(L,$,G,se,_e){return await(await a.TensorOpRegistry.slice)({x:L,s:v($),e:v(G),a:v(se),t:v(_e??new Array(se.length).fill(1))})}function y(L,$){const G=L.data,se=$.data,_e=[L.dims[0],L.dims[2]],de=new G.constructor(_e[0]*_e[1]),[Ee,ze,Ke]=L.dims;let ve=0;for(let J=0;J<Ee;++J){const ue=J*Ke*ze;for(let Y=0;Y<Ke;++Y){let Se=0,Ae=0;const Oe=J*ze,Ne=ue+Y;for(let re=0;re<ze;++re){const pe=Number(se[Oe+re]);Ae+=pe,Se+=G[Ne+re*Ke]*pe}const Q=Se/Ae;de[ve++]=Q}}return new l(L.type,de,_e)}function g(L,$,{eps:G=1e-5}={}){if(L.dims.length!==2)throw new Error("`layer_norm` currently only supports 2D input.");const[se,_e]=L.dims;if($.length!==1&&$[0]!==_e)throw new Error("`normalized_shape` must be a 1D array with shape `[input.dims[1]]`.");const[de,Ee]=j(L,1,0,!0),ze=de.data,Ke=Ee.data,ve=L.data,J=new ve.constructor(ve.length);for(let ue=0;ue<se;++ue){const Y=ue*_e;for(let Se=0;Se<_e;++Se){const Ae=Y+Se;J[Ae]=(ve[Ae]-Ke[ue])/(ze[ue]+G)}}return new l(L.type,J,L.dims)}function _(L,$){return L=L.slice(),$===null?L=L.filter(G=>G!==1):typeof $=="number"?L[$]===1&&L.splice($,1):Array.isArray($)&&(L=L.filter((G,se)=>G!==1||!$.includes(se))),L}function w(L,$){return $=x($,L.length+1),L=L.slice(),L.splice($,0,1),L}function x(L,$,G=null,se=!0){if(L<-$||L>=$){if(se)throw new Error(`IndexError: index ${L} is out of bounds for dimension${G===null?"":" "+G} with size ${$}`);return L<-$?0:$}return L<0&&(L=(L%$+$)%$),L}function b(L,$=0){$=x($,L[0].dims.length);const G=L[0].dims.slice();G[$]=L.reduce((Ee,ze)=>Ee+ze.dims[$],0);const se=G.reduce((Ee,ze)=>Ee*ze,1),_e=new L[0].data.constructor(se),de=L[0].type;if($===0){let Ee=0;for(const ze of L){const Ke=ze.data;_e.set(Ke,Ee),Ee+=Ke.length}}else{let Ee=0;for(let ze=0;ze<L.length;++ze){const{data:Ke,dims:ve}=L[ze];for(let J=0;J<Ke.length;++J){let ue=0;for(let Y=ve.length-1,Se=J,Ae=1;Y>=0;--Y){const Oe=ve[Y];let Ne=Se%Oe;Y===$&&(Ne+=Ee),ue+=Ne*Ae,Ae*=G[Y],Se=Math.floor(Se/Oe)}_e[ue]=Ke[J]}Ee+=ve[$]}}return new l(de,_e,G)}function M(L,$=0){return b(L.map(G=>G.unsqueeze($)),$)}function S(L,$,G=null,se=!1,_e=null){const de=$.data,Ee=$.dims;G=x(G,Ee.length);const ze=Ee.slice();ze[G]=1;const Ke=new de.constructor(de.length/Ee[G]);_e!==null&&Ke.fill(_e);for(let ve=0;ve<de.length;++ve){let J=0;for(let ue=Ee.length-1,Y=ve,Se=1;ue>=0;--ue){const Ae=Ee[ue];if(ue!==G){const Oe=Y%Ae;J+=Oe*Se,Se*=ze[ue]}Y=Math.floor(Y/Ae)}Ke[J]=L(Ke[J],de[ve],ve,J)}
vendor: 2,081 bytes, line 3367
3367return se||ze.splice(G,1),[$.type,Ke,ze]}function j(L,$=null,G=1,se=!1){const _e=L.data,de=L.dims;if($===null){const Se=_e.reduce((Q,re)=>Q+re,0)/_e.length,Ae=Math.sqrt(_e.reduce((Q,re)=>Q+(re-Se)**2,0)/(_e.length-G)),Oe=new l(L.type,[Se],[]);return[new l(L.type,[Ae],[]),Oe]}$=x($,de.length);const Ee=I(L,$,se),ze=Ee.data,[Ke,ve,J]=S((Y,Se,Ae,Oe)=>Y+(Se-ze[Oe])**2,L,$,se);for(let Y=0;Y<ve.length;++Y)ve[Y]=Math.sqrt(ve[Y]/(de[$]-G));return[new l(Ke,ve,J),Ee]}function I(L,$=null,G=!1){const se=L.dims,_e=L.data;if($===null){const Ke=_e.reduce((ve,J)=>ve+J,0);return new l(L.type,[Ke/_e.length],[])}$=x($,se.length);const[de,Ee,ze]=S((Ke,ve)=>Ke+ve,L,$,G);if(se[$]!==1)for(let Ke=0;Ke<Ee.length;++Ke)Ee[Ke]/=se[$];return new l(de,Ee,ze)}function q(L){const $=new Array(L.length);for(let G=L.length-1,se=1;G>=0;--G)$[G]=se,se*=L[G];return $}function U(L,$,G,se){const _e=L.reduce((de,Ee)=>de*Ee,1);return new l(G,new se(_e).fill($),L)}function R(L,$){let G,se;if(typeof $=="number")G="float32",se=Float32Array;else if(typeof $=="bigint")G="int64",se=BigInt64Array;else if(typeof $=="boolean")G="bool",se=Uint8Array;else throw new Error(`Unsupported data type: ${typeof $}`);return U(L,$,G,se)}function K(L,$){return R(L.dims,$)}function H(L){return U(L,1n,"int64",BigInt64Array)}function ee(L){return H(L.dims)}function te(L){return U(L,0n,"int64",BigInt64Array)}function V(L){return te(L.dims)}function ae(L){const $=L.reduce((G,se)=>G*se,1);return new l("float32",Float32Array.from({length:$},()=>Math.random()),L)}function ne(L,$){if(L.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(L.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes($))throw new Error("The precision must be either 'binary' or 'ubinary'");const G=$==="binary",se=G?"int8":"uint8",_e=G?Int8Array:Uint8Array,de=L.data,Ee=new _e(de.length/8);for(let ze=0;ze<de.length;++ze){const Ke=de[ze]>0?1:0,ve=Math.floor(ze/8),J=ze%8;Ee[ve]|=Ke<<7-J,G&&J===0&&(Ee[ve]-=128)}return new l(se,Ee,[L.dims[0],L.dims[1]/8])}},
3367"./src/utils/video.js":(e,t,r)=>{r.r(t),r.d(t,{RawVideo:()=>i,RawVideoFrame:()=>a,load_video:()=>l});var n=r("./src/utils/image.js"),s=r("./src/env.js");class a{constructor(d,p){this.image=d,this.timestamp=p}}class i{constructor(d,p){d.length>0&&d[0]instanceof n.RawImage&&(d=d.map((u,h)=>new a(u,(h+1)/(d.length+1)*p))),this.frames=d,this.duration=p}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function l(c,{num_frames:d=null,fps:p=null}={}){if(!s.apis.IS_BROWSER_ENV)throw new Error("`load_video` is currently only supported in browser environments.");if(d==null&&p==null)throw new Error("Either num_frames or fps must be provided.");const u=[],h=document.createElement("video");if(h.crossOrigin="anonymous",h.muted=!0,typeof c=="string")h.src=c;else if(c instanceof Blob)h.src=URL.createObjectURL(c);else if(c instanceof HTMLVideoElement)h.src=c.src;else throw new Error("Invalid URL or video element provided.");if(await new Promise(_=>h.onloadedmetadata=_),h.seekable.start(0)===h.seekable.end(0)){const w=await(await fetch(h.src)).blob();h.src=URL.createObjectURL(w),await new Promise(x=>h.onloadedmetadata=x)}const f=h.duration;let m,v;d!=null?(m=d,v=d===1?0:f/(d-1)):(v=1/p,m=Math.floor(f/v));let k=[];for(let _=0;_<m;++_)k.push(d===1?f/2:_*v);const y=document.createElement("canvas");y.width=h.videoWidth,y.height=h.videoHeight;const g=y.getContext("2d",{willReadFrequently:!0});for(const _ of k){h.currentTime=_,await new Promise(M=>{h.onseeked=M}),g.drawImage(h,0,0,y.width,y.height);const w=g.getImageData(0,0,y.width,y.height),x=new n.RawImage(w.data,y.width,y.height,4),b=new a(x,_);u.push(b)}return h.remove(),new i(u,f)}}
3367},cN={};function or(e){var t=cN[e];if(t!==void 0)return t.exports;var r=cN[e]={exports:{}};return ase[e](r,r.exports,or),r.exports}(()=>{var e=Object.getPrototypeOf?r=>Object.getPrototypeOf(r):r=>r.__proto__,t;or.t=function(r,n){if(n&1&&(r=this(r)),n&8||typeof r=="object"&&r&&(n&4&&r.__esModule||n&16&&typeof r.then=="function"))return r;var s=Object.create(null);or.r(s);var a={};t=t||[null,e({}),e([]),e(e)];for(var i=n&2&&r;typeof i=="object"&&!~t.indexOf(i);i=e(i))Object.getOwnPropertyNames(i).forEach(l=>a[l]=()=>r[l]);return a.default=()=>r,or.d(s,a),s}})();or.d=(e,t)=>{for(var r in t)or.o(t,r)&&!or.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})};or.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);or.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var E={};(()=>{/*!*****************************!*\
3368  !*** ./src/transformers.js ***!
3369  \*****************************/or.r(E),or.d(E,{ASTFeatureExtractor:()=>u.ASTFeatureExtractor,ASTForAudioClassification:()=>r.ASTForAudioClassification,ASTModel:()=>r.ASTModel,ASTPreTrainedModel:()=>r.ASTPreTrainedModel,AlbertForMaskedLM:()=>r.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>r.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>r.AlbertForSequenceClassification,AlbertModel:()=>r.AlbertModel,AlbertPreTrainedModel:()=>r.AlbertPreTrainedModel,AlbertTokenizer:()=>n.AlbertTokenizer,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>s.AutoConfig,AutoFeatureExtractor:()=>h.AutoFeatureExtractor,AutoImageProcessor:()=>v.AutoImageProcessor,AutoModel:()=>r.AutoModel,AutoModelForAudioClassification:()=>r.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>r.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>r.AutoModelForAudioTextToText,AutoModelForCTC:()=>r.AutoModelForCTC,AutoModelForCausalLM:()=>r.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>r.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>r.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>r.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>r.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>r.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>r.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>r.AutoModelForImageTextToText,AutoModelForImageToImage:()=>r.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>r.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>r.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>r.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>r.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>r.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>r.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>r.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>r.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>r.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>r.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>r.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>r.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>r.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>r.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>r.AutoModelForVision2Seq,AutoModelForXVector:()=>r.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>r.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>g.AutoProcessor,AutoTokenizer:()=>n.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>r.BartForConditionalGeneration,BartForSequenceClassification:()=>r.BartForSequenceClassification,BartModel:()=>r.BartModel,BartPretrainedModel:()=>r.BartPretrainedModel,BartTokenizer:()=>n.BartTokenizer,BaseModelOutput:()=>r.BaseModelOutput,BaseStreamer:()=>_.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>
3369r.BeitForImageClassification,BeitModel:()=>r.BeitModel,BeitPreTrainedModel:()=>r.BeitPreTrainedModel,BertForMaskedLM:()=>r.BertForMaskedLM,BertForQuestionAnswering:()=>r.BertForQuestionAnswering,BertForSequenceClassification:()=>r.BertForSequenceClassification,BertForTokenClassification:()=>r.BertForTokenClassification,BertModel:()=>r.BertModel,BertPreTrainedModel:()=>r.BertPreTrainedModel,BertTokenizer:()=>n.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>r.BlenderbotForConditionalGeneration,BlenderbotModel:()=>r.BlenderbotModel,BlenderbotPreTrainedModel:()=>r.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>r.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>r.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>r.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>n.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>n.BlenderbotTokenizer,BloomForCausalLM:()=>r.BloomForCausalLM,BloomModel:()=>r.BloomModel,BloomPreTrainedModel:()=>r.BloomPreTrainedModel,BloomTokenizer:()=>n.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>r.CLIPModel,CLIPPreTrainedModel:()=>r.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>r.CLIPSegForImageSegmentation,CLIPSegModel:()=>r.CLIPSegModel,CLIPSegPreTrainedModel:()=>r.CLIPSegPreTrainedModel,CLIPTextModel:()=>r.CLIPTextModel,CLIPTextModelWithProjection:()=>r.CLIPTextModelWithProjection,CLIPTokenizer:()=>n.CLIPTokenizer,CLIPVisionModel:()=>r.CLIPVisionModel,CLIPVisionModelWithProjection:()=>r.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>r.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>r.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>r.CamembertForSequenceClassification,CamembertForTokenClassification:()=>r.CamembertForTokenClassification,CamembertModel:()=>r.CamembertModel,CamembertPreTrainedModel:()=>r.CamembertPreTrainedModel,CamembertTokenizer:()=>n.CamembertTokenizer,CausalLMOutput:()=>r.CausalLMOutput,CausalLMOutputWithPast:()=>r.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>r.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>r.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>r.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>u.ClapFeatureExtractor,ClapModel:()=>r.ClapModel,ClapPreTrainedModel:()=>r.ClapPreTrainedModel,ClapTextModelWithProjection:()=>r.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>r.CodeGenForCausalLM,CodeGenModel:()=>r.CodeGenModel,CodeGenPreTrainedModel:()=>r.CodeGenPreTrainedModel,CodeGenTokenizer:()=>n.CodeGenTokenizer,CodeLlamaTokenizer:()=>n.CodeLlamaTokenizer,CohereForCausalLM:()=>r.CohereForCausalLM,CohereModel:()=>r.CohereModel,CoherePreTrainedModel:()=>r.CoherePreTrainedModel,CohereTokenizer:()=>n.CohereTokenizer,ConvBertForMaskedLM:()=>r.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>r.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>r.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>r.ConvBertForTokenClassification,ConvBertModel:()=>r.ConvBertModel,ConvBertPreTrainedModel:()=>r.ConvBertPreTrainedModel,ConvBertTokenizer:()=>n.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>r.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>r.ConvNextModel,ConvNextPreTrainedModel:()=>r.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>r.ConvNextV2ForImageClassification,ConvNextV2Model:()=>r.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>r.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>r.DFineForObjectDetection,DFineModel:()=>r.DFineModel,DFinePreTrainedModel:()=>r.DFinePreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>r.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>r.DPTModel,DPTPreTrainedModel:()=>r.DPTPreTrainedModel,DacDecoderModel:()=>r.DacDecoderModel,DacDecoderOutput:()=>r.DacDecoderOutput,DacEncoderModel:()=>r.DacEncoderModel,DacEncoderOutput:()=>r.DacEncoderOutput,DacFeatureExtractor:()=>u.DacFeatureExtractor,DacModel:()=>r.DacModel,DacPreTrainedModel:()=>r.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>r.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>r.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>r.DebertaForSequenceClassification,DebertaForTokenClassification:()=>r.DebertaForTokenClassification,DebertaModel:()=>r.DebertaModel,DebertaPreTrainedModel:()=>r.DebertaPreTrainedModel,DebertaTokenizer:()=>n.DebertaTokenizer,DebertaV2ForMaskedLM:()=>r.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>r.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>r.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>r.DebertaV2ForTokenClassification,DebertaV2Model:()=>r.DebertaV2Model,DebertaV2PreTrainedModel:()=>r.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>n.DebertaV2Tokenizer,DecisionTransformerModel:()=>r.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>r.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>r.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>r.DeiTModel,DeiTPreTrainedModel:()=>r.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>r.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>r.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>r.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>r.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>r.DetrForObjectDetection,DetrForSegmentation:()=>r.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>r.DetrModel,DetrObjectDetectionOutput:()=>r.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>r.DetrPreTrainedModel,DetrSegmentationOutput:()=>r.DetrSegmentationOutput,Dinov2ForImageClassification:()=>r.Dinov2ForImageClassification,Dinov2Model:()=>r.Dinov2Model,Dinov2PreTrainedModel:()=>r.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>r.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>r.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>r.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>r.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>r.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>r.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>r.DistilBertForTokenClassification,DistilBertModel:()=>r.DistilBertModel,DistilBertPreTrainedModel:()=>r.DistilBertPreTrainedModel,DistilBertTokenizer:()=>n.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>r.DonutSwinModel,DonutSwinPreTrainedModel:()=>r.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>r.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>r.EfficientNetModel,EfficientNetPreTrainedModel:()=>
3369r.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>r.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>r.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>r.ElectraForSequenceClassification,ElectraForTokenClassification:()=>r.ElectraForTokenClassification,ElectraModel:()=>r.ElectraModel,ElectraPreTrainedModel:()=>r.ElectraPreTrainedModel,ElectraTokenizer:()=>n.ElectraTokenizer,EncodecFeatureExtractor:()=>u.EncodecFeatureExtractor,EosTokenCriteria:()=>w.EosTokenCriteria,EsmForMaskedLM:()=>r.EsmForMaskedLM,EsmForSequenceClassification:()=>r.EsmForSequenceClassification,EsmForTokenClassification:()=>r.EsmForTokenClassification,EsmModel:()=>r.EsmModel,EsmPreTrainedModel:()=>r.EsmPreTrainedModel,EsmTokenizer:()=>n.EsmTokenizer,ExaoneForCausalLM:()=>r.ExaoneForCausalLM,ExaoneModel:()=>r.ExaoneModel,ExaonePreTrainedModel:()=>r.ExaonePreTrainedModel,FFT:()=>d.FFT,FalconForCausalLM:()=>r.FalconForCausalLM,FalconModel:()=>r.FalconModel,FalconPreTrainedModel:()=>r.FalconPreTrainedModel,FalconTokenizer:()=>n.FalconTokenizer,FastViTForImageClassification:()=>r.FastViTForImageClassification,FastViTModel:()=>r.FastViTModel,FastViTPreTrainedModel:()=>r.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>p.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>r.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>r.Florence2PreTrainedModel,Florence2Processor:()=>y.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>r.GLPNForDepthEstimation,GLPNModel:()=>r.GLPNModel,GLPNPreTrainedModel:()=>r.GLPNPreTrainedModel,GPT2LMHeadModel:()=>r.GPT2LMHeadModel,GPT2Model:()=>r.GPT2Model,GPT2PreTrainedModel:()=>r.GPT2PreTrainedModel,GPT2Tokenizer:()=>n.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>r.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>r.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>r.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>r.GPTJForCausalLM,GPTJModel:()=>r.GPTJModel,GPTJPreTrainedModel:()=>r.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>r.GPTNeoForCausalLM,GPTNeoModel:()=>r.GPTNeoModel,GPTNeoPreTrainedModel:()=>r.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>r.GPTNeoXForCausalLM,GPTNeoXModel:()=>r.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>r.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>n.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>r.Gemma2ForCausalLM,Gemma2Model:()=>r.Gemma2Model,Gemma2PreTrainedModel:()=>r.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>r.Gemma3ForCausalLM,Gemma3Model:()=>r.Gemma3Model,Gemma3PreTrainedModel:()=>r.Gemma3PreTrainedModel,GemmaForCausalLM:()=>r.GemmaForCausalLM,GemmaModel:()=>r.GemmaModel,GemmaPreTrainedModel:()=>r.GemmaPreTrainedModel,GemmaTokenizer:()=>n.GemmaTokenizer,GlmForCausalLM:()=>r.GlmForCausalLM,GlmModel:()=>r.GlmModel,GlmPreTrainedModel:()=>r.GlmPreTrainedModel,GraniteForCausalLM:()=>r.GraniteForCausalLM,GraniteModel:()=>r.GraniteModel,GranitePreTrainedModel:()=>r.GranitePreTrainedModel,Grok1Tokenizer:()=>n.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>r.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>r.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>y.GroundingDinoProcessor,GroupViTModel:()=>r.GroupViTModel,GroupViTPreTrainedModel:()=>r.GroupViTPreTrainedModel,HeliumForCausalLM:()=>r.HeliumForCausalLM,HeliumModel:()=>r.HeliumModel,HeliumPreTrainedModel:()=>r.HeliumPreTrainedModel,HerbertTokenizer:()=>n.HerbertTokenizer,HieraForImageClassification:()=>r.HieraForImageClassification,HieraModel:()=>r.HieraModel,HieraPreTrainedModel:()=>r.HieraPreTrainedModel,HubertForCTC:()=>r.HubertForCTC,HubertForSequenceClassification:()=>r.HubertForSequenceClassification,HubertModel:()=>r.HubertModel,HubertPreTrainedModel:()=>r.HubertPreTrainedModel,IJepaForImageClassification:()=>r.IJepaForImageClassification,IJepaModel:()=>r.IJepaModel,IJepaPreTrainedModel:()=>r.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>r.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>r.Idefics3PreTrainedModel,Idefics3Processor:()=>
3369y.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>u.ImageFeatureExtractor,ImageMattingOutput:()=>r.ImageMattingOutput,ImageProcessor:()=>f.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>w.InterruptableStoppingCriteria,JAISLMHeadModel:()=>r.JAISLMHeadModel,JAISModel:()=>r.JAISModel,JAISPreTrainedModel:()=>r.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>r.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>r.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>y.JinaCLIPProcessor,JinaCLIPTextModel:()=>r.JinaCLIPTextModel,JinaCLIPVisionModel:()=>r.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>r.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>r.LlamaForCausalLM,LlamaModel:()=>r.LlamaModel,LlamaPreTrainedModel:()=>r.LlamaPreTrainedModel,LlamaTokenizer:()=>n.LlamaTokenizer,LlavaForConditionalGeneration:()=>r.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>r.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>r.LlavaPreTrainedModel,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>r.LongT5ForConditionalGeneration,LongT5Model:()=>r.LongT5Model,LongT5PreTrainedModel:()=>r.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>r.M2M100ForConditionalGeneration,M2M100Model:()=>r.M2M100Model,M2M100PreTrainedModel:()=>r.M2M100PreTrainedModel,M2M100Tokenizer:()=>n.M2M100Tokenizer,MBart50Tokenizer:()=>n.MBart50Tokenizer,MBartForCausalLM:()=>r.MBartForCausalLM,MBartForConditionalGeneration:()=>r.MBartForConditionalGeneration,MBartForSequenceClassification:()=>r.MBartForSequenceClassification,MBartModel:()=>r.MBartModel,MBartPreTrainedModel:()=>r.MBartPreTrainedModel,MBartTokenizer:()=>n.MBartTokenizer,MPNetForMaskedLM:()=>r.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>r.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>r.MPNetForSequenceClassification,MPNetForTokenClassification:()=>r.MPNetForTokenClassification,MPNetModel:()=>r.MPNetModel,MPNetPreTrainedModel:()=>r.MPNetPreTrainedModel,MPNetTokenizer:()=>n.MPNetTokenizer,MT5ForConditionalGeneration:()=>r.MT5ForConditionalGeneration,MT5Model:()=>r.MT5Model,MT5PreTrainedModel:()=>r.MT5PreTrainedModel,MarianMTModel:()=>r.MarianMTModel,MarianModel:()=>r.MarianModel,MarianPreTrainedModel:()=>r.MarianPreTrainedModel,MarianTokenizer:()=>n.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>r.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>r.MaskFormerModel,MaskFormerPreTrainedModel:()=>r.MaskFormerPreTrainedModel,MaskedLMOutput:()=>r.MaskedLMOutput,MaxLengthCriteria:()=>w.MaxLengthCriteria,Metric3DForDepthEstimation:()=>r.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>r.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>r.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>r.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>r.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>r.MgpstrModelOutput,MgpstrPreTrainedModel:()=>r.MgpstrPreTrainedModel,MgpstrProcessor:()=>y.MgpstrProcessor,MgpstrTokenizer:()=>n.MgpstrTokenizer,MimiDecoderModel:()=>r.MimiDecoderModel,MimiDecoderOutput:()=>r.MimiDecoderOutput,MimiEncoderModel:()=>r.MimiEncoderModel,MimiEncoderOutput:()=>r.MimiEncoderOutput,MimiModel:()=>r.MimiModel,MimiPreTrainedModel:()=>r.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>r.MistralForCausalLM,MistralModel:()=>r.MistralModel,MistralPreTrainedModel:()=>r.MistralPreTrainedModel,MobileBertForMaskedLM:()=>r.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>r.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>r.MobileBertForSequenceClassification,MobileBertModel:()=>r.MobileBertModel,MobileBertPreTrainedModel:()=>r.MobileBertPreTrainedModel,MobileBertTokenizer:()=>n.MobileBertTokenizer,MobileLLMForCausalLM:()=>r.MobileLLMForCausalLM,MobileLLMModel:()=>r.MobileLLMModel,MobileLLMPreTrainedModel:()=>r.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>r.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>r.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>r.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>r.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>r.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>r.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>r.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>r.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>r.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>r.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>r.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>r.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>r.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>r.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>r.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>r.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>r.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>r.MobileViTModel,MobileViTPreTrainedModel:()=>r.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>r.MobileViTV2ForImageClassification,MobileViTV2Model:()=>r.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>r.MobileViTV2PreTrainedModel,ModelOutput:()=>r.ModelOutput,ModernBertForMaskedLM:()=>r.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>r.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>r.ModernBertForTokenClassification,ModernBertModel:()=>r.ModernBertModel,ModernBertPreTrainedModel:()=>r.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>r.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>u.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>r.MoonshineForConditionalGeneration,MoonshineModel:()=>r.MoonshineModel,MoonshinePreTrainedModel:()=>r.MoonshinePreTrainedModel,MoonshineProcessor:()=>y.MoonshineProcessor,MptForCausalLM:()=>r.MptForCausalLM,MptModel:()=>r.MptModel,MptPreTrainedModel:()=>
3369r.MptPreTrainedModel,MultiModalityCausalLM:()=>r.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>r.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>r.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>r.MusicgenForConditionalGeneration,MusicgenModel:()=>r.MusicgenModel,MusicgenPreTrainedModel:()=>r.MusicgenPreTrainedModel,NllbTokenizer:()=>n.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>r.NomicBertModel,NomicBertPreTrainedModel:()=>r.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>n.NougatTokenizer,OPTForCausalLM:()=>r.OPTForCausalLM,OPTModel:()=>r.OPTModel,OPTPreTrainedModel:()=>r.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>r.Olmo2ForCausalLM,Olmo2Model:()=>r.Olmo2Model,Olmo2PreTrainedModel:()=>r.Olmo2PreTrainedModel,OlmoForCausalLM:()=>r.OlmoForCausalLM,OlmoModel:()=>r.OlmoModel,OlmoPreTrainedModel:()=>r.OlmoPreTrainedModel,OpenELMForCausalLM:()=>r.OpenELMForCausalLM,OpenELMModel:()=>r.OpenELMModel,OpenELMPreTrainedModel:()=>r.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>r.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>r.OwlViTModel,OwlViTPreTrainedModel:()=>r.OwlViTPreTrainedModel,OwlViTProcessor:()=>y.OwlViTProcessor,Owlv2ForObjectDetection:()=>r.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>r.Owlv2Model,Owlv2PreTrainedModel:()=>r.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>r.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>r.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>y.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>r.PatchTSMixerForPrediction,PatchTSMixerModel:()=>r.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>r.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>r.PatchTSTForPrediction,PatchTSTModel:()=>r.PatchTSTModel,PatchTSTPreTrainedModel:()=>r.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>r.Phi3ForCausalLM,Phi3Model:()=>r.Phi3Model,Phi3PreTrainedModel:()=>r.Phi3PreTrainedModel,Phi3VForCausalLM:()=>r.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>r.Phi3VPreTrainedModel,Phi3VProcessor:()=>y.Phi3VProcessor,PhiForCausalLM:()=>r.PhiForCausalLM,PhiModel:()=>r.PhiModel,PhiPreTrainedModel:()=>r.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PreTrainedModel:()=>r.PreTrainedModel,PreTrainedTokenizer:()=>n.PreTrainedTokenizer,PretrainedConfig:()=>s.PretrainedConfig,PretrainedMixin:()=>r.PretrainedMixin,Processor:()=>k.Processor,PvtForImageClassification:()=>r.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>r.PvtModel,PvtPreTrainedModel:()=>r.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>u.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>r.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>r.PyAnnoteModel,PyAnnotePreTrainedModel:()=>r.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>
3369y.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>r.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>r.Qwen2ForCausalLM,Qwen2Model:()=>r.Qwen2Model,Qwen2PreTrainedModel:()=>r.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>n.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>r.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>r.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>y.Qwen2VLProcessor,Qwen3ForCausalLM:()=>r.Qwen3ForCausalLM,Qwen3Model:()=>r.Qwen3Model,Qwen3PreTrainedModel:()=>r.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>r.RFDetrForObjectDetection,RFDetrModel:()=>r.RFDetrModel,RFDetrObjectDetectionOutput:()=>r.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>r.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>r.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>r.RTDetrModel,RTDetrObjectDetectionOutput:()=>r.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>r.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>r.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>r.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>r.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>r.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>i.RawImage,RawVideo:()=>l.RawVideo,RawVideoFrame:()=>l.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>r.ResNetForImageClassification,ResNetModel:()=>r.ResNetModel,ResNetPreTrainedModel:()=>r.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>r.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>r.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>r.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>r.RoFormerForTokenClassification,RoFormerModel:()=>r.RoFormerModel,RoFormerPreTrainedModel:()=>r.RoFormerPreTrainedModel,RoFormerTokenizer:()=>n.RoFormerTokenizer,RobertaForMaskedLM:()=>
3369r.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>r.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>r.RobertaForSequenceClassification,RobertaForTokenClassification:()=>r.RobertaForTokenClassification,RobertaModel:()=>r.RobertaModel,RobertaPreTrainedModel:()=>r.RobertaPreTrainedModel,RobertaTokenizer:()=>n.RobertaTokenizer,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>r.SamImageSegmentationOutput,SamModel:()=>r.SamModel,SamPreTrainedModel:()=>r.SamPreTrainedModel,SamProcessor:()=>y.SamProcessor,SapiensForDepthEstimation:()=>r.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>r.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>r.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>r.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>u.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>r.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>r.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>r.SegformerModel,SegformerPreTrainedModel:()=>r.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>r.Seq2SeqLMOutput,SequenceClassifierOutput:()=>r.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>r.SiglipModel,SiglipPreTrainedModel:()=>r.SiglipPreTrainedModel,SiglipTextModel:()=>r.SiglipTextModel,SiglipTokenizer:()=>n.SiglipTokenizer,SiglipVisionModel:()=>r.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>r.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>y.SmolVLMProcessor,SnacDecoderModel:()=>r.SnacDecoderModel,SnacEncoderModel:()=>r.SnacEncoderModel,SnacFeatureExtractor:()=>u.SnacFeatureExtractor,SnacModel:()=>r.SnacModel,SnacPreTrainedModel:()=>r.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>r.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>r.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>r.SpeechT5HifiGan,SpeechT5Model:()=>r.SpeechT5Model,SpeechT5PreTrainedModel:()=>r.SpeechT5PreTrainedModel,SpeechT5Processor:()=>y.SpeechT5Processor,SpeechT5Tokenizer:()=>n.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>r.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>r.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>r.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>r.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>r.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>n.SqueezeBertTokenizer,StableLmForCausalLM:()=>r.StableLmForCausalLM,StableLmModel:()=>r.StableLmModel,StableLmPreTrainedModel:()=>r.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>r.Starcoder2ForCausalLM,Starcoder2Model:()=>r.Starcoder2Model,Starcoder2PreTrainedModel:()=>r.Starcoder2PreTrainedModel,StoppingCriteria:()=>w.StoppingCriteria,StoppingCriteriaList:()=>w.StoppingCriteriaList,StyleTextToSpeech2Model:()=>r.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>r.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>r.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>r.Swin2SRModel,Swin2SRPreTrainedModel:()=>r.Swin2SRPreTrainedModel,SwinForImageClassification:()=>r.SwinForImageClassification,SwinForSemanticSegmentation:()=>r.SwinForSemanticSegmentation,SwinModel:()=>r.SwinModel,SwinPreTrainedModel:()=>r.SwinPreTrainedModel,T5ForConditionalGeneration:()=>r.T5ForConditionalGeneration,T5Model:()=>r.T5Model,T5PreTrainedModel:()=>r.T5PreTrainedModel,T5Tokenizer:()=>n.T5Tokenizer,TableTransformerForObjectDetection:()=>r.TableTransformerForObjectDetection,TableTransformerModel:()=>r.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>r.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>r.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>_.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>r.TokenClassifierOutput,TokenizerModel:()=>n.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>r.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>r.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>r.UltravoxModel,UltravoxPreTrainedModel:()=>r.UltravoxPreTrainedModel,UltravoxProcessor:()=>y.UltravoxProcessor,UniSpeechForCTC:()=>r.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>r.UniSpeechForSequenceClassification,UniSpeechModel:()=>r.UniSpeechModel,UniSpeechPreTrainedModel:()=>r.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>r.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>r.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>r.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>r.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>r.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>y.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>r.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>r.ViTMAEModel,ViTMAEPreTrainedModel:()=>r.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>r.ViTMSNForImageClassification,ViTMSNModel:()=>r.ViTMSNModel,ViTMSNPreTrainedModel:()=>r.ViTMSNPreTrainedModel,ViTModel:()=>r.ViTModel,ViTPreTrainedModel:()=>r.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>r.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>r.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>r.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>r.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>r.VitPosePreTrainedModel,VitsModel:()=>r.VitsModel,VitsModelOutput:()=>r.VitsModelOutput,VitsPreTrainedModel:()=>r.VitsPreTrainedModel,VitsTokenizer:()=>n.VitsTokenizer,Wav2Vec2BertForCTC:()=>r.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>r.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>r.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>r.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>n.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>u.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>r.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>r.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>r.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>r.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>r.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>y.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>y.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>r.WavLMForAudioFrameClassification,WavLMForCTC:()=>r.WavLMForCTC,WavLMForSequenceClassification:()=>r.WavLMForSequenceClassification,WavLMForXVector:()=>r.WavLMForXVector,WavLMModel:()=>r.WavLMModel,WavLMPreTrainedModel:()=>r.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>u.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>r.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>r.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>u.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>r.WhisperForConditionalGeneration,WhisperModel:()=>r.WhisperModel,WhisperPreTrainedModel:()=>r.WhisperPreTrainedModel,WhisperProcessor:()=>y.WhisperProcessor,WhisperTextStreamer:()=>_.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>n.WhisperTokenizer,XLMForQuestionAnswering:()=>r.XLMForQuestionAnswering,XLMForSequenceClassification:()=>r.XLMForSequenceClassification,XLMForTokenClassification:()=>r.XLMForTokenClassification,XLMModel:()=>r.XLMModel,XLMPreTrainedModel:()=>r.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>r.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>r.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>r.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>r.XLMRobertaForTokenClassification,XLMRobertaModel:()=>r.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>r.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>
3369n.XLMRobertaTokenizer,XLMTokenizer:()=>n.XLMTokenizer,XLMWithLMHeadModel:()=>r.XLMWithLMHeadModel,XVectorOutput:()=>r.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>r.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>r.YolosModel,YolosObjectDetectionOutput:()=>r.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>r.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>d.bankers_round,cat:()=>c.cat,cos_sim:()=>d.cos_sim,dot:()=>d.dot,dynamic_time_warping:()=>d.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getKeyValueShapes:()=>s.getKeyValueShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>d.interpolate_data,is_chinese_char:()=>n.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>i.load_image,load_video:()=>l.load_video,log_softmax:()=>d.log_softmax,magnitude:()=>d.magnitude,matmul:()=>c.matmul,max:()=>d.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>d.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>d.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>d.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>d.round,slice:()=>c.slice,softmax:()=>d.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=or("./src/env.js"),t=or("./src/pipelines.js"),r=or("./src/models.js"),n=or("./src/tokenizers.js"),s=or("./src/configs.js"),a=or("./src/utils/audio.js"),i=or("./src/utils/image.js"),l=or("./src/utils/video.js"),c=or("./src/utils/tensor.js"),d=or("./src/utils/maths.js"),p=or("./src/base/feature_extraction_utils.js"),u=or("./src/models/feature_extractors.js"),h=or("./src/models/auto/feature_extraction_auto.js"),f=or("./src/base/image_processors_utils.js"),m=or("./src/models/image_processors.js"),v=or("./src/models/auto/image_processing_auto.js"),k=or("./src/base/processing_utils.js"),y=or("./src/models/processors.js"),g=or("./src/models/auto/processing_auto.js"),_=or("./src/generation/streamers.js"),w=or("./src/generation/stopping_criteria.js"),x=or("./src/generation/logits_process.js")})();E.ASTFeatureExtractor;E.ASTForAudioClassification;E.ASTModel;E.ASTPreTrainedModel;E.AlbertForMaskedLM;E.AlbertForQuestionAnswering;E.AlbertForSequenceClassification;E.AlbertModel;E.AlbertPreTrainedModel;E.AlbertTokenizer;E.AudioClassificationPipeline;E.AutoConfig;E.AutoFeatureExtractor;E.AutoImageProcessor;E.AutoModel;E.AutoModelForAudioClassification;E.AutoModelForAudioFrameClassification;E.AutoModelForAudioTextToText;E.AutoModelForCTC;E.AutoModelForCausalLM;E.AutoModelForDepthEstimation;E.AutoModelForDocumentQuestionAnswering;E.AutoModelForImageClassification;E.AutoModelForImageFeatureExtraction;E.AutoModelForImageMatting;E.AutoModelForImageSegmentation;E.AutoModelForImageTextToText;E.AutoModelForImageToImage;E.AutoModelForMaskGeneration;E.AutoModelForMaskedLM;E.AutoModelForNormalEstimation;E.AutoModelForObjectDetection;E.AutoModelForPoseEstimation;E.AutoModelForQuestionAnswering;E.AutoModelForSemanticSegmentation;E.AutoModelForSeq2SeqLM;E.AutoModelForSequenceClassification;E.AutoModelForSpeechSeq2Seq;E.AutoModelForTextToSpectrogram;E.AutoModelForTextToWaveform;E.AutoModelForTokenClassification;E.AutoModelForUniversalSegmentation;E.AutoModelForVision2Seq;E.AutoModelForXVector;E.AutoModelForZeroShotObjectDetection;E.AutoProcessor;E.AutoTokenizer;E.AutomaticSpeechRecognitionPipeline;
3369E.BackgroundRemovalPipeline;E.BartForConditionalGeneration;E.BartForSequenceClassification;E.BartModel;E.BartPretrainedModel;E.BartTokenizer;E.BaseModelOutput;E.BaseStreamer;E.BeitFeatureExtractor;E.BeitForImageClassification;E.BeitModel;E.BeitPreTrainedModel;E.BertForMaskedLM;E.BertForQuestionAnswering;E.BertForSequenceClassification;E.BertForTokenClassification;E.BertModel;E.BertPreTrainedModel;E.BertTokenizer;E.BitImageProcessor;E.BlenderbotForConditionalGeneration;E.BlenderbotModel;E.BlenderbotPreTrainedModel;E.BlenderbotSmallForConditionalGeneration;E.BlenderbotSmallModel;E.BlenderbotSmallPreTrainedModel;E.BlenderbotSmallTokenizer;E.BlenderbotTokenizer;E.BloomForCausalLM;E.BloomModel;E.BloomPreTrainedModel;E.BloomTokenizer;E.CLIPFeatureExtractor;E.CLIPImageProcessor;E.CLIPModel;E.CLIPPreTrainedModel;E.CLIPSegForImageSegmentation;E.CLIPSegModel;E.CLIPSegPreTrainedModel;E.CLIPTextModel;E.CLIPTextModelWithProjection;E.CLIPTokenizer;E.CLIPVisionModel;E.CLIPVisionModelWithProjection;E.CamembertForMaskedLM;E.CamembertForQuestionAnswering;E.CamembertForSequenceClassification;E.CamembertForTokenClassification;E.CamembertModel;E.CamembertPreTrainedModel;E.CamembertTokenizer;E.CausalLMOutput;E.CausalLMOutputWithPast;E.ChineseCLIPFeatureExtractor;E.ChineseCLIPModel;E.ChineseCLIPPreTrainedModel;E.ClapAudioModelWithProjection;E.ClapFeatureExtractor;E.ClapModel;E.ClapPreTrainedModel;E.ClapTextModelWithProjection;E.ClassifierFreeGuidanceLogitsProcessor;E.CodeGenForCausalLM;E.CodeGenModel;E.CodeGenPreTrainedModel;E.CodeGenTokenizer;E.CodeLlamaTokenizer;E.CohereForCausalLM;E.CohereModel;E.CoherePreTrainedModel;E.CohereTokenizer;E.ConvBertForMaskedLM;E.ConvBertForQuestionAnswering;E.ConvBertForSequenceClassification;E.ConvBertForTokenClassification;E.ConvBertModel;E.ConvBertPreTrainedModel;E.ConvBertTokenizer;E.ConvNextFeatureExtractor;E.ConvNextForImageClassification;E.ConvNextImageProcessor;E.ConvNextModel;E.ConvNextPreTrainedModel;E.ConvNextV2ForImageClassification;E.ConvNextV2Model;E.ConvNextV2PreTrainedModel;E.DFineForObjectDetection;E.DFineModel;E.DFinePreTrainedModel;E.DPTFeatureExtractor;E.DPTForDepthEstimation;E.DPTImageProcessor;E.DPTModel;E.DPTPreTrainedModel;E.DacDecoderModel;E.DacDecoderOutput;E.DacEncoderModel;E.DacEncoderOutput;E.DacFeatureExtractor;E.DacModel;E.DacPreTrainedModel;E.DataTypeMap;E.DebertaForMaskedLM;E.DebertaForQuestionAnswering;E.DebertaForSequenceClassification;E.DebertaForTokenClassification;E.DebertaModel;E.DebertaPreTrainedModel;E.DebertaTokenizer;E.DebertaV2ForMaskedLM;E.DebertaV2ForQuestionAnswering;E.DebertaV2ForSequenceClassification;E.DebertaV2ForTokenClassification;E.DebertaV2Model;E.DebertaV2PreTrainedModel;E.DebertaV2Tokenizer;E.DecisionTransformerModel;E.DecisionTransformerPreTrainedModel;E.DeiTFeatureExtractor;E.DeiTForImageClassification;E.DeiTImageProcessor;E.DeiTModel;E.DeiTPreTrainedModel;E.DepthAnythingForDepthEstimation;E.DepthAnythingPreTrainedModel;E.DepthEstimationPipeline;E.DepthProForDepthEstimation;E.DepthProPreTrainedModel;E.DetrFeatureExtractor;E.DetrForObjectDetection;E.DetrForSegmentation;E.DetrImageProcessor;E.DetrModel;E.DetrObjectDetectionOutput;E.DetrPreTrainedModel;E.DetrSegmentationOutput;E.Dinov2ForImageClassification;E.Dinov2Model;E.Dinov2PreTrainedModel;E.Dinov2WithRegistersForImageClassification;E.Dinov2WithRegistersModel;E.Dinov2WithRegistersPreTrainedModel;E.DistilBertForMaskedLM;E.DistilBertForQuestionAnswering;E.DistilBertForSequenceClassification;E.DistilBertForTokenClassification;E.DistilBertModel;E.DistilBertPreTrainedModel;E.DistilBertTokenizer;E.DocumentQuestionAnsweringPipeline;E.DonutFeatureExtractor;E.DonutImageProcessor;E.DonutSwinModel;E.DonutSwinPreTrainedModel;E.EfficientNetForImageClassification;E.EfficientNetImageProcessor;E.EfficientNetModel;E.EfficientNetPreTrainedModel;
3369E.ElectraForMaskedLM;E.ElectraForQuestionAnswering;E.ElectraForSequenceClassification;E.ElectraForTokenClassification;E.ElectraModel;E.ElectraPreTrainedModel;E.ElectraTokenizer;E.EncodecFeatureExtractor;E.EosTokenCriteria;E.EsmForMaskedLM;E.EsmForSequenceClassification;E.EsmForTokenClassification;E.EsmModel;E.EsmPreTrainedModel;E.EsmTokenizer;E.ExaoneForCausalLM;E.ExaoneModel;E.ExaonePreTrainedModel;E.FFT;E.FalconForCausalLM;E.FalconModel;E.FalconPreTrainedModel;E.FalconTokenizer;E.FastViTForImageClassification;E.FastViTModel;E.FastViTPreTrainedModel;E.FeatureExtractionPipeline;E.FeatureExtractor;E.FillMaskPipeline;E.Florence2ForConditionalGeneration;E.Florence2PreTrainedModel;E.Florence2Processor;E.ForcedBOSTokenLogitsProcessor;E.ForcedEOSTokenLogitsProcessor;E.GLPNFeatureExtractor;E.GLPNForDepthEstimation;E.GLPNModel;E.GLPNPreTrainedModel;E.GPT2LMHeadModel;E.GPT2Model;E.GPT2PreTrainedModel;E.GPT2Tokenizer;E.GPTBigCodeForCausalLM;E.GPTBigCodeModel;E.GPTBigCodePreTrainedModel;E.GPTJForCausalLM;E.GPTJModel;E.GPTJPreTrainedModel;E.GPTNeoForCausalLM;E.GPTNeoModel;E.GPTNeoPreTrainedModel;E.GPTNeoXForCausalLM;E.GPTNeoXModel;E.GPTNeoXPreTrainedModel;E.GPTNeoXTokenizer;E.Gemma2ForCausalLM;E.Gemma2Model;E.Gemma2PreTrainedModel;E.Gemma3ForCausalLM;E.Gemma3Model;E.Gemma3PreTrainedModel;E.GemmaForCausalLM;E.GemmaModel;E.GemmaPreTrainedModel;E.GemmaTokenizer;E.GlmForCausalLM;E.GlmModel;E.GlmPreTrainedModel;E.GraniteForCausalLM;E.GraniteModel;E.GranitePreTrainedModel;E.Grok1Tokenizer;E.GroundingDinoForObjectDetection;E.GroundingDinoImageProcessor;E.GroundingDinoPreTrainedModel;E.GroundingDinoProcessor;E.GroupViTModel;E.GroupViTPreTrainedModel;E.HeliumForCausalLM;E.HeliumModel;E.HeliumPreTrainedModel;E.HerbertTokenizer;E.HieraForImageClassification;E.HieraModel;E.HieraPreTrainedModel;E.HubertForCTC;E.HubertForSequenceClassification;E.HubertModel;E.HubertPreTrainedModel;E.IJepaForImageClassification;E.IJepaModel;E.IJepaPreTrainedModel;E.Idefics3ForConditionalGeneration;E.Idefics3ImageProcessor;E.Idefics3PreTrainedModel;E.Idefics3Processor;E.ImageClassificationPipeline;E.ImageFeatureExtractionPipeline;E.ImageFeatureExtractor;E.ImageMattingOutput;E.ImageProcessor;E.ImageSegmentationPipeline;E.ImageToImagePipeline;E.ImageToTextPipeline;E.InterruptableStoppingCriteria;E.JAISLMHeadModel;E.JAISModel;E.JAISPreTrainedModel;E.JinaCLIPImageProcessor;E.JinaCLIPModel;E.JinaCLIPPreTrainedModel;E.JinaCLIPProcessor;E.JinaCLIPTextModel;E.JinaCLIPVisionModel;E.LiteWhisperForConditionalGeneration;E.LlamaForCausalLM;E.LlamaModel;E.LlamaPreTrainedModel;E.LlamaTokenizer;E.LlavaForConditionalGeneration;E.LlavaOnevisionForConditionalGeneration;E.LlavaOnevisionImageProcessor;E.LlavaPreTrainedModel;E.LogitsProcessor;E.LogitsProcessorList;E.LogitsWarper;E.LongT5ForConditionalGeneration;E.LongT5Model;E.LongT5PreTrainedModel;E.M2M100ForConditionalGeneration;E.M2M100Model;E.M2M100PreTrainedModel;E.M2M100Tokenizer;E.MBart50Tokenizer;E.MBartForCausalLM;E.MBartForConditionalGeneration;E.MBartForSequenceClassification;E.MBartModel;E.MBartPreTrainedModel;E.MBartTokenizer;E.MPNetForMaskedLM;E.MPNetForQuestionAnswering;E.MPNetForSequenceClassification;E.MPNetForTokenClassification;E.MPNetModel;E.MPNetPreTrainedModel;E.MPNetTokenizer;E.MT5ForConditionalGeneration;E.MT5Model;E.MT5PreTrainedModel;E.MarianMTModel;E.MarianModel;E.MarianPreTrainedModel;E.MarianTokenizer;E.Mask2FormerImageProcessor;E.MaskFormerFeatureExtractor;E.MaskFormerForInstanceSegmentation;E.MaskFormerImageProcessor;E.MaskFormerModel;E.MaskFormerPreTrainedModel;E.MaskedLMOutput;E.MaxLengthCriteria;E.Metric3DForDepthEstimation;E.Metric3DPreTrainedModel;E.Metric3Dv2ForDepthEstimation;E.Metric3Dv2PreTrainedModel;E.MgpstrForSceneTextRecognition;E.MgpstrModelOutput;E.MgpstrPreTrainedModel;E.MgpstrProcessor;E.MgpstrTokenizer;E.MimiDecoderModel;E.MimiDecoderOutput;E.MimiEncoderModel;E.MimiEncoderOutput;E.MimiModel;E.MimiPreTrainedModel;E.MinLengthLogitsProcessor;E.MinNewTokensLengthLogitsProcessor;E.MistralForCausalLM;E.MistralModel;E.MistralPreTrainedModel;E.MobileBertForMaskedLM;E.MobileBertForQuestionAnswering;E.MobileBertForSequenceClassification;E.MobileBertModel;E.MobileBertPreTrainedModel;E.MobileBertTokenizer;E.MobileLLMForCausalLM;E.MobileLLMModel;E.MobileLLMPreTrainedModel;E.MobileNetV1FeatureExtractor;E.MobileNetV1ForImageClassification;E.MobileNetV1ForSemanticSegmentation;E.MobileNetV1ImageProcessor;E.MobileNetV1Model;E.MobileNetV1PreTrainedModel;E.MobileNetV2FeatureExtractor;E.MobileNetV2ForImageClassification;E.MobileNetV2ForSemanticSegmentation;E.MobileNetV2ImageProcessor;E.MobileNetV2Model;E.MobileNetV2PreTrainedModel;E.MobileNetV3FeatureExtractor;E.MobileNetV3ForImageClassification;E.MobileNetV3ForSemanticSegmentation;E.MobileNetV3ImageProcessor;E.MobileNetV3Model;E.MobileNetV3PreTrainedModel;E.MobileNetV4FeatureExtractor;E.MobileNetV4ForImageClassification;E.MobileNetV4ForSemanticSegmentation;E.MobileNetV4ImageProcessor;E.MobileNetV4Model;E.MobileNetV4PreTrainedModel;E.MobileViTFeatureExtractor;E.MobileViTForImageClassification;E.MobileViTImageProcessor;E.MobileViTModel;E.MobileViTPreTrainedModel;E.MobileViTV2ForImageClassification;E.MobileViTV2Model;E.MobileViTV2PreTrainedModel;E.ModelOutput;E.ModernBertForMaskedLM;E.ModernBertForSequenceClassification;E.ModernBertForTokenClassification;E.ModernBertModel;E.ModernBertPreTrainedModel;E.Moondream1ForConditionalGeneration;E.MoonshineFeatureExtractor;E.MoonshineForConditionalGeneration;E.MoonshineModel;E.MoonshinePreTrainedModel;E.MoonshineProcessor;E.MptForCausalLM;E.MptModel;E.MptPreTrainedModel;E.MultiModalityCausalLM;E.MultiModalityPreTrainedModel;E.MusicgenForCausalLM;E.MusicgenForConditionalGeneration;E.MusicgenModel;E.MusicgenPreTrainedModel;E.NllbTokenizer;E.NoBadWordsLogitsProcessor;E.NoRepeatNGramLogitsProcessor;E.NomicBertModel;E.NomicBertPreTrainedModel;E.NougatImageProcessor;E.NougatTokenizer;E.OPTForCausalLM;E.OPTModel;E.OPTPreTrainedModel;E.ObjectDetectionPipeline;E.Olmo2ForCausalLM;E.Olmo2Model;E.Olmo2PreTrainedModel;E.OlmoForCausalLM;E.OlmoModel;E.OlmoPreTrainedModel;E.OpenELMForCausalLM;E.OpenELMModel;E.OpenELMPreTrainedModel;E.OwlViTFeatureExtractor;E.OwlViTForObjectDetection;
3369E.OwlViTImageProcessor;E.OwlViTModel;E.OwlViTPreTrainedModel;E.OwlViTProcessor;E.Owlv2ForObjectDetection;E.Owlv2ImageProcessor;E.Owlv2Model;E.Owlv2PreTrainedModel;E.PaliGemmaForConditionalGeneration;E.PaliGemmaPreTrainedModel;E.PaliGemmaProcessor;E.PatchTSMixerForPrediction;E.PatchTSMixerModel;E.PatchTSMixerPreTrainedModel;E.PatchTSTForPrediction;E.PatchTSTModel;E.PatchTSTPreTrainedModel;E.Phi3ForCausalLM;E.Phi3Model;E.Phi3PreTrainedModel;E.Phi3VForCausalLM;E.Phi3VImageProcessor;E.Phi3VPreTrainedModel;E.Phi3VProcessor;E.PhiForCausalLM;E.PhiModel;E.PhiPreTrainedModel;E.Pipeline;E.PreTrainedModel;E.PreTrainedTokenizer;E.PretrainedConfig;E.PretrainedMixin;E.Processor;E.PvtForImageClassification;E.PvtImageProcessor;E.PvtModel;E.PvtPreTrainedModel;E.PyAnnoteFeatureExtractor;E.PyAnnoteForAudioFrameClassification;E.PyAnnoteModel;E.PyAnnotePreTrainedModel;E.PyAnnoteProcessor;E.QuestionAnsweringModelOutput;E.QuestionAnsweringPipeline;E.Qwen2ForCausalLM;E.Qwen2Model;E.Qwen2PreTrainedModel;E.Qwen2Tokenizer;E.Qwen2VLForConditionalGeneration;E.Qwen2VLImageProcessor;E.Qwen2VLPreTrainedModel;E.Qwen2VLProcessor;E.Qwen3ForCausalLM;E.Qwen3Model;E.Qwen3PreTrainedModel;E.RFDetrForObjectDetection;E.RFDetrModel;E.RFDetrObjectDetectionOutput;E.RFDetrPreTrainedModel;E.RTDetrForObjectDetection;E.RTDetrImageProcessor;E.RTDetrModel;E.RTDetrObjectDetectionOutput;E.RTDetrPreTrainedModel;E.RTDetrV2ForObjectDetection;E.RTDetrV2Model;E.RTDetrV2ObjectDetectionOutput;E.RTDetrV2PreTrainedModel;E.RawAudio;E.RawImage;E.RawVideo;E.RawVideoFrame;E.RepetitionPenaltyLogitsProcessor;E.ResNetForImageClassification;E.ResNetModel;E.ResNetPreTrainedModel;E.RoFormerForMaskedLM;E.RoFormerForQuestionAnswering;E.RoFormerForSequenceClassification;E.RoFormerForTokenClassification;E.RoFormerModel;E.RoFormerPreTrainedModel;E.RoFormerTokenizer;E.RobertaForMaskedLM;E.RobertaForQuestionAnswering;E.RobertaForSequenceClassification;E.RobertaForTokenClassification;E.RobertaModel;E.RobertaPreTrainedModel;E.RobertaTokenizer;E.SamImageProcessor;E.SamImageSegmentationOutput;E.SamModel;E.SamPreTrainedModel;E.SamProcessor;E.SapiensForDepthEstimation;E.SapiensForNormalEstimation;E.SapiensForSemanticSegmentation;E.SapiensPreTrainedModel;E.SeamlessM4TFeatureExtractor;E.SegformerFeatureExtractor;E.SegformerForImageClassification;E.SegformerForSemanticSegmentation;E.SegformerImageProcessor;E.SegformerModel;E.SegformerPreTrainedModel;E.Seq2SeqLMOutput;E.SequenceClassifierOutput;E.SiglipImageProcessor;E.SiglipModel;E.SiglipPreTrainedModel;E.SiglipTextModel;E.SiglipTokenizer;E.SiglipVisionModel;E.SmolVLMForConditionalGeneration;E.SmolVLMImageProcessor;E.SmolVLMProcessor;E.SnacDecoderModel;E.SnacEncoderModel;E.SnacFeatureExtractor;E.SnacModel;E.SnacPreTrainedModel;E.SpeechT5FeatureExtractor;E.SpeechT5ForSpeechToText;E.SpeechT5ForTextToSpeech;E.SpeechT5HifiGan;E.SpeechT5Model;E.SpeechT5PreTrainedModel;E.SpeechT5Processor;E.SpeechT5Tokenizer;E.SqueezeBertForMaskedLM;E.SqueezeBertForQuestionAnswering;E.SqueezeBertForSequenceClassification;E.SqueezeBertModel;E.SqueezeBertPreTrainedModel;E.SqueezeBertTokenizer;E.StableLmForCausalLM;E.StableLmModel;E.StableLmPreTrainedModel;E.Starcoder2ForCausalLM;E.Starcoder2Model;E.Starcoder2PreTrainedModel;E.StoppingCriteria;E.StoppingCriteriaList;E.StyleTextToSpeech2Model;E.StyleTextToSpeech2PreTrainedModel;E.SummarizationPipeline;E.SuppressTokensAtBeginLogitsProcessor;E.Swin2SRForImageSuperResolution;E.Swin2SRImageProcessor;E.Swin2SRModel;E.Swin2SRPreTrainedModel;E.SwinForImageClassification;E.SwinForSemanticSegmentation;E.SwinModel;E.SwinPreTrainedModel;E.T5ForConditionalGeneration;E.T5Model;E.T5PreTrainedModel;E.T5Tokenizer;E.TableTransformerForObjectDetection;E.TableTransformerModel;E.TableTransformerObjectDetectionOutput;E.TableTransformerPreTrainedModel;E.TemperatureLogitsWarper;E.Tensor;E.Text2TextGenerationPipeline;E.TextClassificationPipeline;E.TextGenerationPipeline;E.TextStreamer;E.TextToAudioPipeline;E.TokenClassificationPipeline;E.TokenClassifierOutput;E.TokenizerModel;E.TopKLogitsWarper;E.TopPLogitsWarper;E.TrOCRForCausalLM;E.TrOCRPreTrainedModel;E.TranslationPipeline;E.UltravoxModel;E.UltravoxPreTrainedModel;E.UltravoxProcessor;E.UniSpeechForCTC;E.UniSpeechForSequenceClassification;E.UniSpeechModel;E.UniSpeechPreTrainedModel;E.UniSpeechSatForAudioFrameClassification;E.UniSpeechSatForCTC;E.UniSpeechSatForSequenceClassification;E.UniSpeechSatModel;E.UniSpeechSatPreTrainedModel;E.VLChatProcessor;E.VLMImageProcessor;E.ViTFeatureExtractor;E.ViTForImageClassification;E.ViTImageProcessor;E.ViTMAEModel;E.ViTMAEPreTrainedModel;E.ViTMSNForImageClassification;E.ViTMSNModel;E.ViTMSNPreTrainedModel;E.ViTModel;E.ViTPreTrainedModel;E.VisionEncoderDecoderModel;E.VitMatteForImageMatting;E.VitMatteImageProcessor;E.VitMattePreTrainedModel;E.VitPoseForPoseEstimation;E.VitPoseImageProcessor;E.VitPosePreTrainedModel;
3369E.VitsModel;E.VitsModelOutput;E.VitsPreTrainedModel;E.VitsTokenizer;E.Wav2Vec2BertForCTC;E.Wav2Vec2BertForSequenceClassification;E.Wav2Vec2BertModel;E.Wav2Vec2BertPreTrainedModel;E.Wav2Vec2CTCTokenizer;E.Wav2Vec2FeatureExtractor;E.Wav2Vec2ForAudioFrameClassification;E.Wav2Vec2ForCTC;E.Wav2Vec2ForSequenceClassification;E.Wav2Vec2Model;E.Wav2Vec2PreTrainedModel;E.Wav2Vec2Processor;E.Wav2Vec2ProcessorWithLM;E.WavLMForAudioFrameClassification;E.WavLMForCTC;E.WavLMForSequenceClassification;E.WavLMForXVector;E.WavLMModel;E.WavLMPreTrainedModel;E.WeSpeakerFeatureExtractor;E.WeSpeakerResNetModel;E.WeSpeakerResNetPreTrainedModel;E.WhisperFeatureExtractor;E.WhisperForConditionalGeneration;E.WhisperModel;E.WhisperPreTrainedModel;E.WhisperProcessor;E.WhisperTextStreamer;E.WhisperTimeStampLogitsProcessor;E.WhisperTokenizer;E.XLMForQuestionAnswering;E.XLMForSequenceClassification;E.XLMForTokenClassification;E.XLMModel;E.XLMPreTrainedModel;E.XLMRobertaForMaskedLM;E.XLMRobertaForQuestionAnswering;E.XLMRobertaForSequenceClassification;E.XLMRobertaForTokenClassification;E.XLMRobertaModel;E.XLMRobertaPreTrainedModel;E.XLMRobertaTokenizer;E.XLMTokenizer;E.XLMWithLMHeadModel;E.XVectorOutput;E.YolosFeatureExtractor;E.YolosForObjectDetection;E.YolosImageProcessor;E.YolosModel;E.YolosObjectDetectionOutput;E.YolosPreTrainedModel;E.ZeroShotAudioClassificationPipeline;E.ZeroShotClassificationPipeline;E.ZeroShotImageClassificationPipeline;E.ZeroShotObjectDetectionPipeline;E.bankers_round;E.cat;E.cos_sim;E.dot;E.dynamic_time_warping;var K4=E.env;E.full;E.full_like;E.getKeyValueShapes;E.hamming;E.hanning;E.interpolate;E.interpolate_4d;E.interpolate_data;E.is_chinese_char;E.layer_norm;E.load_image;E.load_video;E.log_softmax;E.magnitude;E.matmul;E.max;E.mean;E.mean_pooling;E.medianFilter;E.mel_filter_bank;E.min;E.ones;E.ones_like;E.permute;E.permute_data;var ise=E.pipeline;E.quantize_embeddings;E.rand;E.read_audio;E.rfft;E.round;E.slice;E.softmax;E.spectrogram;E.stack;E.std_mean;E.topk;E.window_function;E.zeros;E.zeros_like;K4.allowLocalModels=!1;K4.useBrowserCache=!1;const Qc=1024;function ose(e,t,r){let n=r.naturalWidth,s=r.naturalHeight;return n>Qc||s>Qc?(n>s?(s=Math.round(s*Qc/n),n=Qc):(n=Math.round(n*Qc/s),s=Qc),e.width=n,e.height=s,t.drawImage(r,0,0,n,s),!0):(e.width=n,e.height=s,t.drawImage(r,0,0),!1)}const lse=async e=>{try{console.log("Starting background removal process...");const t=await ise("image-segmentation","Xenova/segformer-b0-finetuned-ade-512-512",{device:"webgpu"}),r=document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("Could not get canvas context");const s=ose(r,n,e);console.log(`Image ${s?"was":"was not"} resized. Final dimensions: ${r.width}x${r.height}`);const a=r.toDataURL("image/jpeg",.8);console.log("Image converted to base64"),console.log("Processing with segmentation model...");const i=await t(a);if(console.log("Segmentation result:",i),!i||!Array.isArray(i)||i.length===0||!i[0].mask)throw new Error("Invalid segmentation result");const l=document.createElement("canvas");l.width=r.width,l.height=r.height;const c=l.getContext("2d");if(!c)throw new Error("Could not get output canvas context");c.drawImage(r,0,0);const d=c.getImageData(0,0,l.width,l.height),p=d.data;for(let u=0;u<i[0].mask.data.length;u++){const h=Math.round((1-i[0].mask.data[u])*255);p[u*4+3]=h}return c.putImageData(d,0,0),console.log("Mask applied successfully"),new Promise((u,h)=>{l.toBlob(f=>{f?(console.log("Successfully created final blob"),u(f)):h(new Error("Failed to create blob"))},"image/png",1)})}catch(t){throw console.error("Error removing background:",t),t}},cse=e=>new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=r,n.src=URL.createObjectURL(e)}),dse=()=>{const[e,t]=D.useState(!1),[r,n]=D.useState(null),[s,a]=D.useState(null),i=D.useRef(null),l=async d=>{var h;const p=(h=d.target.files)==null?void 0:h[0];if(!p)return;const u=URL.createObjectURL(p);n(u),a(null);try{t(!0),console.log("Loading image...");const f=await cse(p);console.log("Image loaded, removing background...");const m=await lse(f);
3369console.log("Background removed successfully");const v=URL.createObjectURL(m);a(v)}catch(f){console.error("Error processing image:",f),alert("Error processing image. Please try again.")}finally{t(!1)}},c=()=>{if(s){const d=document.createElement("a");d.href=s,d.download="logo-no-background.png",document.body.appendChild(d),d.click(),document.body.removeChild(d)}};return o.jsxs("div",{className:"max-w-4xl mx-auto p-6 bg-white rounded-lg shadow-lg",children:[o.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:"Background Remover"}),o.jsxs("div",{className:"mb-6",children:[o.jsx("input",{ref:i,type:"file",accept:"image/*",onChange:l,className:"hidden"}),o.jsxs(rr,{onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"w-full",disabled:e,children:[o.jsx(AW,{className:"mr-2 h-4 w-4"}),"Upload Image"]})]}),e&&o.jsxs("div",{className:"text-center mb-6",children:[o.jsx(vW,{className:"h-8 w-8 animate-spin mx-auto mb-2"}),o.jsx("p",{children:"Processing image... This may take a moment."})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[r&&o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Original"}),o.jsx("div",{className:"border rounded-lg p-4 bg-gray-50",children:o.jsx("img",{src:r,alt:"Original",className:"max-w-full h-auto mx-auto"})})]}),s&&o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Processed"}),o.jsx("div",{className:"border rounded-lg p-4 bg-gray-50",children:o.jsx("img",{src:s,alt:"Processed",className:"max-w-full h-auto mx-auto",style:{backgroundColor:"transparent"}})}),o.jsxs(rr,{onClick:c,className:"w-full mt-4",children:[o.jsx(fW,{className:"mr-2 h-4 w-4"}),"Download Result"]})]})]})]})},use=()=>o.jsxs("div",{className:"min-h-screen flex flex-col",children:[o.jsx(on,{}),o.jsx("main",{className:"flex-grow pt-20 pb-16",children:o.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Logo Background Remover"}),o.jsx("p",{className:"text-gray-600",children:"Upload your logo image to remove the background and get a clean transparent version."})]}),o.jsx(dse,{})]})}),o.jsx(yn,{})]});var lk="Collapsible",[pse,Q4]=ru(lk),[hse,ck]=pse(lk),Y4=D.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:a,onOpenChange:i,...l}=e,[c=!1,d]=nu({prop:n,defaultProp:s,onChange:i});return o.jsx(hse,{scope:r,disabled:a,contentId:Op(),open:c,onOpenToggle:D.useCallback(()=>d(p=>!p),[d]),children:o.jsx(Er.div,{"data-state":uk(c),"data-disabled":a?"":void 0,...l,ref:t})})});Y4.displayName=lk;var J4="CollapsibleTrigger",Z4=D.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=ck(J4,r);return o.jsx(Er.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":uk(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:Tr(e.onClick,s.onOpenToggle)})});Z4.displayName=J4;var dk="CollapsibleContent",X4=D.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=ck(dk,e.__scopeCollapsible);return o.jsx(el,{present:r||s.open,children:({present:a})=>o.jsx(fse,{...n,ref:t,present:a})})});X4.displayName=dk;var fse=D.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...a}=e,i=ck(dk,r),[l,c]=D.useState(n),d=D.useRef(null),p=Hn(t,d),u=D.useRef(0),h=u.current,f=D.useRef(0),m=f.current,v=i.open||l,k=D.useRef(v),y=D.useRef();return D.useEffect(()=>{const g=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(g)},[]),qi(()=>{const g=d.current;if(g){y.current=y.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const _=g.getBoundingClientRect();u.current=_.height,f.current=_.width,k.current||(g.style.transitionDuration=y.current.transitionDuration,g.style.animationName=y.current.animationName),c(n)}},[i.open,n]),o.jsx(Er.div,{"data-state":uk(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...a,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:v&&s})});function uk(e){return e?"open":"closed"}var mse=Y4,gse=Z4,yse=X4,vse=D.createContext(void 0);function _se(e){const t=D.useContext(vse);return e||t||"ltr"}var Zi="Accordion",wse=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pk,xse,bse]=F3(Zi),[Oy,Aae]=ru(Zi,[bse,Q4]),hk=Q4(),e5=Le.forwardRef((e,t)=>
3369{const{type:r,...n}=e,s=n,a=n;return o.jsx(pk.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?o.jsx(Ese,{...a,ref:t}):o.jsx(Mse,{...s,ref:t})})});e5.displayName=Zi;var[t5,kse]=Oy(Zi),[r5,Tse]=Oy(Zi,{collapsible:!1}),Mse=Le.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:a=!1,...i}=e,[l,c]=nu({prop:r,defaultProp:n,onChange:s});return o.jsx(t5,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:c,onItemClose:Le.useCallback(()=>a&&c(""),[a,c]),children:o.jsx(r5,{scope:e.__scopeAccordion,collapsible:a,children:o.jsx(n5,{...i,ref:t})})})}),Ese=Le.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...a}=e,[i=[],l]=nu({prop:r,defaultProp:n,onChange:s}),c=Le.useCallback(p=>l((u=[])=>[...u,p]),[l]),d=Le.useCallback(p=>l((u=[])=>u.filter(h=>h!==p)),[l]);return o.jsx(t5,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:d,children:o.jsx(r5,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(n5,{...a,ref:t})})})}),[Sse,Ry]=Oy(Zi),n5=Le.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:a="vertical",...i}=e,l=Le.useRef(null),c=Hn(l,t),d=xse(r),u=_se(s)==="ltr",h=Tr(e.onKeyDown,f=>{var S;if(!wse.includes(f.key))return;const m=f.target,v=d().filter(j=>{var I;return!((I=j.ref.current)!=null&&I.disabled)}),k=v.findIndex(j=>j.ref.current===m),y=v.length;if(k===-1)return;f.preventDefault();let g=k;const _=0,w=y-1,x=()=>{g=k+1,g>w&&(g=_)},b=()=>{g=k-1,g<_&&(g=w)};switch(f.key){case"Home":g=_;break;case"End":g=w;break;case"ArrowRight":a==="horizontal"&&(u?x():b());break;case"ArrowDown":a==="vertical"&&x();break;case"ArrowLeft":a==="horizontal"&&(u?b():x());break;case"ArrowUp":a==="vertical"&&b();break}const M=g%y;(S=v[M].ref.current)==null||S.focus()});return o.jsx(Sse,{scope:r,disabled:n,direction:s,orientation:a,children:o.jsx(pk.Slot,{scope:r,children:o.jsx(Er.div,{...i,"data-orientation":a,ref:c,onKeyDown:n?void 0:h})})})}),Qg="AccordionItem",[Ase,fk]=Oy(Qg),s5=Le.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...s}=e,a=Ry(Qg,r),i=kse(Qg,r),l=hk(r),c=Op(),d=n&&i.value.includes(n)||!1,p=a.disabled||e.disabled;return o.jsx(Ase,{scope:r,open:d,disabled:p,triggerId:c,children:o.jsx(mse,{"data-orientation":a.orientation,"data-state":d5(d),...l,...s,ref:t,disabled:p,open:d,onOpenChange:u=>{u?i.onItemOpen(n):i.onItemClose(n)}})})});s5.displayName=Qg;var a5="AccordionHeader",i5=Le.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=Ry(Zi,r),a=fk(a5,r);return o.jsx(Er.h3,{"data-orientation":s.orientation,"data-state":d5(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});i5.displayName=a5;var Jb="AccordionTrigger",o5=Le.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}
3369=e,s=Ry(Zi,r),a=fk(Jb,r),i=Tse(Jb,r),l=hk(r);return o.jsx(pk.ItemSlot,{scope:r,children:o.jsx(gse,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:a.triggerId,...l,...n,ref:t})})});o5.displayName=Jb;var l5="AccordionContent",c5=Le.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=Ry(Zi,r),a=fk(l5,r),i=hk(r);return o.jsx(yse,{role:"region","aria-labelledby":a.triggerId,"data-orientation":s.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});c5.displayName=l5;function d5(e){return e?"open":"closed"}var Pse=e5,Cse=s5,jse=i5,u5=o5,p5=c5;const mk=Pse,Dy=D.forwardRef(({className:e,...t},r)=>o.jsx(Cse,{ref:r,className:Sn("border-b",e),...t}));Dy.displayName="AccordionItem";const Fy=D.forwardRef(({className:e,children:t,...r},n)=>o.jsx(jse,{className:"flex",children:o.jsxs(u5,{ref:n,className:Sn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,o.jsx(uR,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Fy.displayName=u5.displayName;const Ly=D.forwardRef(({className:e,children:t,...r},n)=>o.jsx(p5,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:o.jsx("div",{className:Sn("pb-4 pt-0",e),children:t})}));Ly.displayName=p5.displayName;const h5=[{q:"What is an insurance valuation for fine art?",a:"An insurance valuation determines the retail replacement value of an artwork—the cost to replace it with a comparable item at current market pricing. This figure ensures your policy reflects the true cost of replacement in the event of loss, damage, or theft."},{q:"How often should I update my art insurance valuation?",a:"We recommend recurring valuations on an annual or biennial basis. Art market values shift frequently, and outdated valuations can leave your collection significantly underinsured or result in inflated premiums."},{q:"What standard does Appraisal Bureau follow for insurance appraisals?",a:"All valuations are issued in compliance with USPAP (Uniform Standards of Professional Appraisal Practice) and include transparent methodology, appraiser credentials, and comparable market evidence."},{q:"Can I share my valuation directly with my insurance broker?",a:"Yes. Our platform includes secure sharing functionality that allows you to grant your broker direct access to your valuation reports—no manual document handling required."},{q:"What is the difference between replacement value and fair market value?",a:"Replacement value reflects the retail cost to replace an item with a comparable one in the current market. Fair market value (FMV) is the price a willing buyer and seller would agree upon. Insurance policies typically require replacement value."},{q:"Does Appraisal Bureau work with my existing insurance provider?",a:"Appraisal Bureau reports are accepted by all major fine art insurance carriers. We also have a direct integration with Marsh, a global leader in fine art coverage, for streamlined quoting."}],Ise={"@context":"https://schema.org","@type":"FAQPage",mainEntity:h5.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))},$se=()=>o.jsxs("div",{className:"min-h-screen flex flex-col",children:[o.jsx(Fn,{title:"Insurance Valuations for Art Collections | Appraisal Bureau",description:"Accurate, recurring insurance valuations for fine art and collectibles. USPAP-compliant replacement value reports shared securely with your broker. Updated on your schedule.",canonical:"/insurance-valuations",keywords:["art insurance valuation","fine art insurance appraisal","replacement value appraisal","USPAP compliant valuation","art collection insurance","insurance appraisal report","recurring art valuation"]}),o.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(Ise)}}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow pt-20",children:[o.jsx("section",{className:"bg-gradient-to-br from-[#220E99]/5 via-white to-[#59D89B]/5 py-20 md:py-32",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[o.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 mb-6 tracking-tight",children:["Insurance Valuations",o.jsx("br",{}),"That Stay Current"]}),o.jsx("p",{className:"text-xl md:text-2xl text-gray-600 mb-8",children:"Retail Replacement Value issued by Appraisal Bureau, combining proprietary technology with expert analysis—delivered on a recurring basis and shared securely with your insurance broker."}),o.jsx("p",{className:"text-lg text-gray-600 mb-10 max-w-2xl mx-auto",children:"USPAP-compliant. Updated on your schedule."}),o.jsx("div",{className:"flex justify-center",children:o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsxs(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg",children:["Sign up",o.jsx(ya,{className:"ml-2 h-5 w-5"})]})})})]})})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"text-center mb-20",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-6 tracking-tight",children:"Why Insurance Valuations Matter"}),o.jsx("p",{className:"text-lg text-gray-400 font-light",children:"Protect your collection with accurate, up-to-date coverage"})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 lg:gap-8",children:[{icon:EW,title:"Prevent Underinsurance",desc:"Market values shift. Recurring valuations ensure your coverage keeps pace with your collection's worth.",color:"#220E99"},{icon:mW,title:"Streamline Claims",desc:"Compliant, well-documented reports with full audit trails accelerate the settlement process.",color:"#59D89B"},{icon:SW,title:"USPAP-Compliant Reports",desc:"Generate insurance appraisal reports on demand, built on transparent methodology and appraiser credentials.",color:"#220E99"},{icon:pR,title:"Accepted Everywhere",desc:"Reports accepted by all major fine art insurance carriers, with direct integration for streamlined quoting.",color:"#59D89B"}].map((e,t)=>o.jsxs("div",{className:"group text-center",children:[o.jsx("div",{className:"w-14 h-14 border rounded-full flex items-center justify-center mx-auto mb-6 transition-colors duration-300",style:{borderColor:`${e.color}20`},children:o.jsx(e.icon,{className:"h-6 w-6 transition-colors duration-300",style:{color:`${e.color}B3`}})}
3369),o.jsx("h3",{className:"text-base font-medium text-gray-800 mb-3",children:e.title}),o.jsx("p",{className:"text-sm text-gray-400 font-light leading-relaxed",children:e.desc})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"What's Included"})}),o.jsx("div",{className:"space-y-6",children:["Current replacement value backed by comparable market evidence","Valuations issued by appraisers with industry-leading credentials, supported by proprietary technology","USPAP-compliant Appraisal Reports","Digital report management with secure storage and on-demand access","Secure sharing with your insurance broker through the platform","Recurring valuation updates on your schedule"].map((e,t)=>o.jsxs("div",{className:"flex items-start group",children:[o.jsx("div",{className:"w-5 h-5 rounded-full border border-gray-300 flex items-center justify-center mr-4 mt-0.5 flex-shrink-0 group-hover:border-[#220E99] transition-colors duration-300",children:o.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-300 group-hover:bg-[#220E99] transition-colors duration-300"})}),o.jsx("span",{className:"text-base text-gray-500 font-light leading-relaxed group-hover:text-gray-700 transition-colors duration-300",children:e})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-16 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-10",children:o.jsx("h2",{className:"text-2xl md:text-3xl font-light text-gray-900 tracking-tight",children:"Trusted by Leading Insurers"})}),o.jsxs("div",{className:"group relative",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-gray-50 to-transparent rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),o.jsx("div",{className:"relative p-8 rounded-2xl border border-gray-100 hover:border-gray-200 transition-all duration-300 bg-white hover:shadow-md",children:o.jsxs("div",{className:"flex items-start gap-6",children:[o.jsx("div",{className:"flex-shrink-0 w-24 h-12 flex items-center justify-center",children:o.jsx("img",{src:"/lovable-uploads/a35a8ca0-67e8-4c04-902d-2a6df35cae2b.png",alt:"Marsh",className:"h-6 object-contain opacity-70 group-hover:opacity-100 transition-opacity"})}),o.jsx("div",{className:"flex-1",children:o.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Appraisal Bureau is proud to partner with Marsh, the global leader in art insurance. Our clients have access to the most competitive rates and comprehensive coverage available in the market."})})]})})]}),o.jsx("div",{className:"text-center mt-8",children:o.jsx("a",{href:"mailto:[email protected]?subject=Marsh%20Insurance%20Quote%20Request",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-3",children:"Get Your Quote"})})})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"Frequently Asked Questions"})}),o.jsx(mk,{type:"single",collapsible:!0,className:"w-full space-y-3",children:h5.map((e,t)=>o.jsxs(Dy,{value:`item-${t}`,className:"border-b border-gray-100 pb-3",children:[o.jsx(Fy,{className:"text-left hover:no-underline py-4",children:o.jsx("span",{className:"text-base font-normal text-gray-800 pr-4",children:e.q})}),o.jsx(Ly,{className:"text-gray-500 leading-relaxed text-sm pb-4",children:e.a})]},t))})]})}),o.jsx("section",{className:"py-20 bg-white",children:o.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6 text-gray-900",children:"Ready to Protect Your Collection?"}),o.jsx("p",{className:"text-lg mb-8 text-gray-500 font-light",children:"Get started or contact our team to learn more"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg font-semibold",children:"Sign up"})}),o.jsx(Ut,{to:"/contact",children:o.jsx(rr,{variant:"outline",className:"border-2 border-gray-300 text-gray-900 hover:border-[#220E99] hover:text-[#220E99] rounded-full px-8 py-6 text-lg",children:"Contact Us"})})]})]})})]}),o.jsx(yn,{})]}),f5=[{q:"When does the IRS require a qualified appraisal for artwork?",a:"The IRS requires a qualified appraisal for any individual item or group of similar items claimed at a value exceeding $5,000 on a tax return. This applies to estate settlements, charitable donations, and gift tax filings."},{q:"What is Fair Market Value (FMV) and how is it determined?",a:"Fair Market Value is the price at which property w
3369ould change hands between a willing buyer and a willing seller, both having reasonable knowledge of the relevant facts. Appraisal Bureau determines FMV through comparable sales analysis, market data, and expert judgment."},{q:"What is a date-of-death valuation?",a:"A date-of-death valuation establishes the fair market value of artwork as of the date of the owner's death. This retroactive valuation is required for estate tax reporting and inheritance distribution."},{q:"Can Appraisal Bureau handle estate valuations with many artworks?",a:"Yes. Our platform is built for portfolio-level management, allowing efficient valuation of entire collections with structured metadata, audit trails, and consolidated reporting."},{q:"What qualifies someone as a 'qualified appraiser' under IRS rules?",a:"A qualified appraiser must meet IRS education and experience requirements, hold relevant professional designations, and regularly perform appraisals for compensation. All Appraisal Bureau appraisers meet or exceed these standards."},{q:"How long are tax and estate valuations valid?",a:"For charitable donation deductions, the appraisal must be conducted no earlier than 60 days before the donation and no later than the due date of the return. For estates, the valuation date is typically the date of death or the alternate valuation date."}],Nse={"@context":"https://schema.org","@type":"FAQPage",mainEntity:f5.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))},Ose=()=>o.jsxs("div",{className:"min-h-screen flex flex-col",children:[o.jsx(Fn,{title:"Tax & Estate Valuations for Art Collections | Appraisal Bureau",description:"IRS-compliant Fair Market Value appraisals for estate planning, charitable donations, and tax reporting. Qualified valuations issued by the Appraisal Bureau team.",canonical:"/tax-estate-valuations",keywords:["art estate valuation","fair market value appraisal","IRS art appraisal","estate planning art","charitable donation appraisal","tax valuation fine art","qualified appraisal art","date of death valuation"]}),o.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(Nse)}}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow pt-20",children:[o.jsx("section",{className:"bg-gradient-to-br from-[#220E99]/5 via-white to-[#BC0439]/5 py-20 md:py-32",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[o.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 mb-6 tracking-tight",children:"Tax & Estate Valuations Built for Compliance"}),o.jsx("p",{className:"text-xl md:text-2xl text-gray-600 mb-8",children:"IRS-qualified Fair Market Value appraisals for estate planning, equitable distribution, charitable giving, and tax reporting."}),o.jsx("p",{className:"text-lg text-gray-600 mb-10 max-w-2xl mx-auto",children:"Issued by Appraisal Bureau, combining proprietary technology with expert analysis. Every requirement met."}),o.jsx("div",{className:"flex justify-center",children:o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsxs(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg",children:["Sign up",o.jsx(ya,{className:"ml-2 h-5 w-5"})]})})})]})})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"text-center mb-20",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-6 tracking-tight",children:"When You Need a Qualified Appraisal"}),o.jsx("p",{className:"text-lg text-gray-400 font-light",children:"Common scenarios requiring IRS-compliant valuations"})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 lg:gap-8",children:[{icon:MW,title:"Estate Settlements",desc:"Establish FMV for probate, inheritance, and equitable distribution among heirs.",color:"#220E99"},{icon:gW,title:"Charitable Donations",desc:"IRS-qualified appraisals required for tax deductions on donated artwork.",color:"#BC0439"},{icon:mR,title:"Equitable Distribution",desc:"Establish accurate valuations for fair asset division in divorce and separation proceedings.",color:"#220E99"},{icon:pR,title:"Date-of-Death Valuations",desc:"Retroactive valuations reflecting market conditions at a specific date.",color:"#BC0439"}].map((e,t)=>o.jsxs("div",{className:"group text-center",children:[o.jsx("div",{className:"w-14 h-14 border rounded-full flex items-center justify-center mx-auto mb-6 transition-colors duration-300",style:{borderColor:`${e.color}20`},children:o.jsx(e.icon,{className:"h-6 w-6 transition-colors duration-300",style:{color:`${e.color}B3`}})}
3369),o.jsx("h3",{className:"text-base font-medium text-gray-800 mb-3",children:e.title}),o.jsx("p",{className:"text-sm text-gray-400 font-light leading-relaxed",children:e.desc})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"What's Included"})}),o.jsx("div",{className:"space-y-6",children:["Fair Market Value determination backed by comparable sales data","USPAP and IRS-compliant reporting that is defensible and fully supported","Qualified appraiser credentials meeting IRS requirements","Date-specific valuations for estate, gift, or donation purposes","Digital report management with secure access and on-demand availability","Unlimited report generation from valid valuations"].map((e,t)=>o.jsxs("div",{className:"flex items-start group",children:[o.jsx("div",{className:"w-5 h-5 rounded-full border border-gray-300 flex items-center justify-center mr-4 mt-0.5 flex-shrink-0 group-hover:border-[#220E99] transition-colors duration-300",children:o.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-300 group-hover:bg-[#220E99] transition-colors duration-300"})}),o.jsx("span",{className:"text-base text-gray-500 font-light leading-relaxed group-hover:text-gray-700 transition-colors duration-300",children:e})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"Frequently Asked Questions"})}),o.jsx(mk,{type:"single",collapsible:!0,className:"w-full space-y-3",children:f5.map((e,t)=>o.jsxs(Dy,{value:`item-${t}`,className:"border-b border-gray-100 pb-3",children:[o.jsx(Fy,{className:"text-left hover:no-underline py-4",children:o.jsx("span",{className:"text-base font-normal text-gray-800 pr-4",children:e.q})}),o.jsx(Ly,{className:"text-gray-500 leading-relaxed text-sm pb-4",children:e.a})]},t))})]})}),o.jsx("section",{className:"py-20 bg-white",children:o.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6 text-gray-900",children:"Plan with Confidence"}),o.jsx("p",{className:"text-lg mb-8 text-gray-500 font-light",children:"Get started or contact our team to learn more"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg font-semibold",children:"Sign up"})}),o.jsx(Ut,{to:"/contact",children:o.jsx(rr,{variant:"outline",className:"border-2 border-gray-300 text-gray-900 hover:border-[#220E99] hover:text-[#220E99] rounded-full px-8 py-6 text-lg",children:"Contact Us"})})]})]})})]}),o.jsx(yn,{})]}),m5=[{q:"What is an art-backed loan?",a:"An art-backed loan uses fine art or collectibles as collateral to secure financing. Lenders require independent valuations to assess the loan-to-value ratio and manage risk throughout the life of the loan."},{q:"Why do lenders require independent valuations?",a:"Independent valuations ensure the collateral assessment is free from conflicts of interest. Appraisal Bureau has no market participation—ensuring complete neutrality and trust from both lenders and borrowers."},{q:"How often should collateral valuations be updated?",a:"Most lenders require recurring valuations—typically annually or semi-annually—to monitor market movement and ensure the loan-to-value ratio remains within acceptable parameters."},{q:"What methodology does Appraisal Bureau use for collateral valuations?",a:"We determine Fair Market Value using comparable sales analysis, market data, and expert judgment, all in compliance with USPAP standards. Our reports include full methodology disclosure and appraiser credentials."},{q:"Can both the borrower and lender access the valuation?",a:"Yes. Our platform provides secure, role-based access so both parties can view reports, track valuation history, and manage documentation in one place."},{q:"Does Appraisal Bureau support portfolio-level collateral assessments?",a:"Absolutely. We handle multi-asset loan structures with consolidated portfolio reporting, recurring updates on lender-defined schedules, and complete audit trails for every valuation."}],Rse={"@context":"https://schema.org","@type":"FAQPage",mainEntity:m5.map(e=>
3369({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))},Dse=()=>o.jsxs("div",{className:"min-h-screen flex flex-col",children:[o.jsx(Fn,{title:"Loan Collateral Valuations for Art | Appraisal Bureau",description:"Independent art valuations for art-backed lending. Trusted by lenders and collectors for collateral assessment, loan-to-value analysis, and ongoing portfolio monitoring.",canonical:"/loan-collateral-valuations",keywords:["art-backed lending","art collateral valuation","art loan appraisal","loan-to-value art","art finance valuation","collateral assessment fine art","art-secured lending"]}),o.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(Rse)}}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow pt-20",children:[o.jsx("section",{className:"bg-gradient-to-br from-[#220E99]/5 via-white to-[#30A8C4]/5 py-20 md:py-32",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[o.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold text-gray-900 mb-6 tracking-tight",children:"Collateral Valuations for Art‑Backed Lending"}),o.jsx("p",{className:"text-xl md:text-2xl text-gray-600 mb-8",children:"Independent, market-reflective valuations trusted by lenders and collectors for collateral assessment and portfolio monitoring."}),o.jsx("p",{className:"text-lg text-gray-600 mb-10 max-w-2xl mx-auto",children:"Issued by the Appraisal Bureau team using proprietary technology and expert analysis. No market participation—complete neutrality."}),o.jsx("div",{className:"flex justify-center",children:o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsxs(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg",children:["Sign up",o.jsx(ya,{className:"ml-2 h-5 w-5"})]})})})]})})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"text-center mb-20",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-6 tracking-tight",children:"Why Collateral Valuations Matter"}),o.jsx("p",{className:"text-lg text-gray-400 font-light",children:"Trusted by lenders and borrowers alike"})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 lg:gap-8",children:[{icon:yW,title:"Loan Origination",desc:"Establish baseline values for art-backed loan structuring and approval.",color:"#220E99"},{icon:mR,title:"Risk Mitigation",desc:"Independent valuations give lenders confidence in collateral quality.",color:"#30A8C4"},{icon:TW,title:"Ongoing Monitoring",desc:"Recurring valuations track market movement and flag material changes.",color:"#220E99"},{icon:_W,title:"Independence & Trust",desc:"No market participation ensures complete neutrality in every valuation.",color:"#30A8C4"}].map((e,t)=>o.jsxs("div",{className:"group text-center",children:[o.jsx("div",{className:"w-14 h-14 border rounded-full flex items-center justify-center mx-auto mb-6 transition-colors duration-300",style:{borderColor:`${e.color}20`},children:o.jsx(e.icon,{className:"h-6 w-6 transition-colors duration-300",style:{color:`${e.color}B3`}})}),o.jsx("h3",{className:"text-base font-medium text-gray-800 mb-3",children:e.title}),o.jsx("p",{className:"text-sm text-gray-400 font-light leading-relaxed",children:e.desc})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"What's Included"})}),o.jsx("div",{className:"space-y-6",children:["Fair Market Value determination with comparable sales analysis","USPAP-compliant methodology and qualified appraiser credentials","Portfolio-level reporting for multi-asset loan structures","Recurring valuation updates on lender-defined schedules","Secure platform access for both borrower and lender","Digital report management with secure storage and on-demand access"].map((e,t)=>o.jsxs("div",{className:"flex items-start group",children:[o.jsx("div",{className:"w-5 h-5 rounded-full border border-gray-300 flex items-center justify-center mr-4 mt-0.5 flex-shrink-0 group-hover:border-[#220E99] transition-colors duration-300",children:o.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-300 group-hover:bg-[#220E99] transition-colors duration-300"})}),o.jsx("span",{className:"text-base text-gray-500 font-light leading-relaxed group-hover:text-gray-700 transition-colors duration-300",children:e})]},t))})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-16 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-10",children:o.jsx("h2",{className:"text-2xl md:text-3xl font-light text-gray-900 tracking-tight",children:"Trusted by Leading Art Finance Firms"})}),o.jsxs("a",{href:"https://www.athena-art.com",target:"_blank",rel:"noopener noreferrer",className:"group relative block",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-gray-50 to-transparent roun
3369ded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),o.jsx("div",{className:"relative p-8 rounded-2xl border border-gray-100 hover:border-gray-200 transition-all duration-300 bg-white hover:shadow-md",children:o.jsxs("div",{className:"flex items-start gap-6",children:[o.jsx("div",{className:"flex-shrink-0 w-24 h-12 flex items-center justify-center",children:o.jsx("img",{src:"/lovable-uploads/5f9dd0a7-9ae3-46b8-ac59-86288604e7f5.png",alt:"Athena Art Finance",className:"h-16 object-contain opacity-70 group-hover:opacity-100 transition-opacity"})}),o.jsx("div",{className:"flex-1",children:o.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Since 2015, Athena Art Finance has been the premier independent global art finance company. Athena's loan products are collateralized by high value paintings and sculptures."})})]})})]})]})}),o.jsx("div",{className:"max-w-xl mx-auto px-4",children:o.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent"})}),o.jsx("section",{className:"py-24 bg-white",children:o.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsx("div",{className:"text-center mb-16",children:o.jsx("h2",{className:"text-3xl md:text-4xl font-light text-gray-900 mb-4 tracking-tight",children:"Frequently Asked Questions"})}),o.jsx(mk,{type:"single",collapsible:!0,className:"w-full space-y-3",children:m5.map((e,t)=>o.jsxs(Dy,{value:`item-${t}`,className:"border-b border-gray-100 pb-3",children:[o.jsx(Fy,{className:"text-left hover:no-underline py-4",children:o.jsx("span",{className:"text-base font-normal text-gray-800 pr-4",children:e.q})}),o.jsx(Ly,{className:"text-gray-500 leading-relaxed text-sm pb-4",children:e.a})]},t))})]})}),o.jsx("section",{className:"py-20 bg-white",children:o.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[o.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6 text-gray-900",children:"Leverage Artwork with Confidence"}),o.jsx("p",{className:"text-lg mb-8 text-gray-500 font-light",children:"Get started or contact our team to learn more"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[o.jsx("a",{href:"https://app.appraisalbureau.com/register",target:"_blank",rel:"noopener noreferrer",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#220E99]/90 text-white rounded-full px-8 py-6 text-lg font-semibold",children:"Sign up"})}),o.jsx(Ut,{to:"/contact",children:o.jsx(rr,{variant:"outline",className:"border-2 border-gray-300 text-gray-900 hover:border-[#220E99] hover:text-[#220E99] rounded-full px-8 py-6 text-lg",children:"Contact Us"})})]})]})})]}),o.jsx(yn,{})]}),Fse={"artists-estates-foundations-valuation":{title:"The Studio Left Behind: Artists' Estates, Foundations, and the Value of Getting the Value Right",titleHtml:"The Studio Left Behind: Artists' Estates, Foundations, and the Value of <em>Getting the Value Right</em>",subtitle:"Most of the wealth held by artist-endowed foundations is art. Why the financial side of an artist's estate is unlike any other — and why the appraisal sits at the center of it.",type:"editorial",date:"2026-09-22",category:"Museums & Philanthropy",editionLabel:"Appraisal Bureau News — Ed. 38",image:"/lovable-uploads/lichtenstein-studio.avif",creditLine:"Roy Lichtenstein working on <em>Reflections on Senorita</em> (1990) in his Washington Street studio around 1989. Artwork © Estate of Roy Lichtenstein. Photograph © Bob Adelman",content:`
3370      <p><em><strong>Appraisal Bureau is proud to sponsor "An Evening for AEF Leaders: Reflections on Artists, Legacy, &amp; Philanthropy," presented by the Artist-Endowed Foundations Initiative (AEFI), a program of the Aspen Institute, in New York on September 24, 2026.</strong></em></p>
3371
3372      <p style="margin-top: 32px;">This week, leaders of artist-endowed foundations gather in New York for an invitation-only evening presented by the Aspen Institute's AEFI and hosted by Sikkema Malloy Jenkins, featuring artist Vik Muniz, founder of Rio de Janeiro's Escola Vidigal, in conversation with Rocío Aranda-Alvarado, Senior Program Officer for Creativity &amp; Free Expression at the Ford Foundation. We are glad to support the conversation. The questions at its center — what an artist leaves behind, who stewards it, and how it serves the public — are ones we work on every day, often starting with a deceptively simple question: what is it worth?</p>
3373
3374      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">A field built on art assets</h2>
3375
3376      <p style="margin-top: 24px;">Artist-endowed foundations are private foundations created by an artist, a surviving spouse, or heirs to hold the artist's assets for charitable and educational purposes: investments, art collections, ar
3376chives, intellectual property, and real estate such as studios and residences. The foundations of Helen Frankenthaler, Keith Haring, Roy Lichtenstein, Joan Mitchell, Gordon Parks, Robert Rauschenberg, and Andy Warhol are part of this field.</p>
3377
3378      <p style="margin-top: 32px;">It has grown quickly. AEFI's most recent national study identified 433 artist-endowed foundations, more than 40 percent of them created within the prior fifteen years. Between 2011 and 2015, the field's assets rose 120 percent to $7.66 billion, three times the growth rate of foundations nationally. Seventy percent of those assets, $5.37 billion, were art. Most of the wealth in this field, in other words, is something that has to be appraised.</p>
3379
3380      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">The artist's paradox: taxed at market value, deductible at cost</h2>
3381
3382      <p style="margin-top: 24px;">Artists are treated unusually under the U.S. tax code. An artist who donates their own work during their lifetime can deduct only what it cost to make, for a painting little more than paint and canvas. When the artist dies, the same works are included in the estate at full fair market value.</p>
3383
3384      <p style="margin-top: 32px;">The rule dates to the Tax Reform Act of 1969. The proposed fix, the Artist-Museum Partnership Act, has passed the Senate repeatedly but never the House. The practical result is that many artists die holding large inventories, which become the estate's largest and least liquid asset and, frequently, the core endowment of a foundation.</p>
3385
3386      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">A changed tax backdrop in 2026</h2>
3387
3388      <p style="margin-top: 24px;">Under the One Big Beautiful Bill Act, the federal estate and gift tax exemption rose to $15 million per individual on January 1, 2026, indexed for inflation from 2027. Above that threshold, federal rates reach 40 percent, and many states add their own estate or inheritance taxes.</p>
3389
3390      <p style="margin-top: 32px;">A higher exemption does not make valuation less important. An established artist's studio can exceed $15 million on its own. Date-of-death values set the heirs' cost basis and the starting value of any works that pass to a foundation, and with interest rates still elevated relative to historical lows, the economics of installment sales, GRATs, and charitable lead trusts all depend on a defensible number.</p>
3391
3392      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Why a studio is worth less than the sum of its parts</h2>
3393
3394      <p style="margin-top: 24px;">The central valuation concept for artists' estates is the blockage discount. Each work may have its own fair market value based on comparable sales, but the market may not be able to absorb an entire inventory at those values. Release too much too quickly and demand is overwhelmed, prices soften, and the artist's market can be damaged for years. The IRS recognizes the concept and treats it largely as a question of time: how long an orderly sale would take, and what it costs to hold the inventory in the meantime.</p>
3395
3396      <p style="margin-top: 32px;">The case law shows both how much the discount matters and how often it is disputed. Georgia O'Keeffe's executors claimed a 75 percent discount on roughly 400 works individually valued at nearly $73 million. In the David Smith case, the court rejected a 75 percent discount but also refused to value the sculptures as if the rest of the inventory did not exist. In the Warhol estate, the court settled on an average of about 25 percent, a result that has been criticized for underweighting how long it would take to sell tens of thousands of works.</p>
3397
3398      <p style="margin-top: 32px;">The lesson is consistent: a discount must be tied to evidence about the particular artist, works, and market. A blanket percentage will not hold. What holds is a report that lets the estate, its advisors, and the IRS trace the conclusion from the inventory, through the market data, to the financial model — supported by good records of the artist's sales history.</p>
3399
3400      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">The IRS is paying attention</h2>
3401
3402      <p style="margin-top: 24px;">When an audited return includes a single work appraised at $50,000 or more, the case must be referred to the IRS's Art Appraisal Services for possible review by the C
3402ommissioner's Art Advisory Panel, a group of museum directors, curators, and dealers who assess values without knowing the taxpayer or the purpose of the appraisal. The pattern has been consistent for decades: values are adjusted down on charitable donations and up on estate and gift returns. In 2014, the last year the figures were reported separately, estate and gift values under review were raised 23 percent, while charitable values were cut 55 percent.</p>
3403
3404      <p style="margin-top: 32px;">For significant works, estates can seek certainty in advance through an IRS Statement of Value, available for items appraised at $50,000 or more.</p>
3405
3406      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Valuation doesn't end when the foundation begins</h2>
3407
3408      <p style="margin-top: 24px;">For foundation leaders, the need for reliable valuation continues long after the estate closes. Non-operating private foundations must distribute roughly 5 percent of the fair market value of their non-charitable-use assets each year, so how a foundation classifies and values its art holdings — works held for eventual sale versus works used for exhibitions, loans, and study — flows directly into its payout. Current, well-documented values also support sales and gifts to museums, insurance, loans, and board decisions about what to keep, place, or sell.</p>
3409
3410      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">The 2026 market context</h2>
3411
3412      <p style="margin-top: 24px;">Estates have driven much of this year's auction strength, with single-owner sales making up a far larger share of New York auction value than their late-2010s average. At the same time, the gallery sector is under pressure, with a number of dealers downsizing or closing this year. New models are filling the gap: younger galleries are taking on estates, drawn by the relative price stability of a finite body of work, and artist management firms are taking on the slow work of archives, scholarship, and long-term legacy planning. Every one of these partners needs a reliable inventory and value baseline to work from, and so does every foundation board deciding how quickly to bring work to market.</p>
3413
3414      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Where the appraisal fits</h2>
3415
3416      <p style="margin-top: 24px;">For an artist's estate or foundation, the appraisal is not a formality at the end of the process. It is the document that:</p>
3417
3418      <ul style="margin-top: 24px; padding-left: 28px; list-style: disc;">
3419        <li style="margin-top: 8px;">sets estate tax liability and the heirs' basis;</li>
3420        <li style="margin-top: 8px;">supports, or undermines, a blockage discount;</li>
3421        <li style="margin-top: 8px;">goes before the IRS Art Advisory Panel if a return is audited;</li>
3422        <li style="margin-top: 8px;">underpins foundation payout, insurance, loans, and gifts to institutions; and</li>
3423        <li style="margin-top: 8px;">shows executors and boards what can be sold, when, and at what cost to the artist's market.</li>
3424      </ul>
3425
3426      <p style="margin-top: 32px;">The best time to start is before it is needed. Artists and their advisors who keep current inventories, sales records, and periodic valuations give their executors and future foundation boards a defensible starting point. Estates that begin from scratch after a death are working against both the filing deadline and the market.</p>
3427
3428      <p style="margin-top: 32px;">We look forward to continuing this conversation with AEF leaders in New York this week.</p>
3429
3430      <p style="margin-top: 48px;"><em>Appraisal Bureau works with executors, estate attorneys, artist-endowed foundations, and families on date-of-death valuations, blockage analysis, foundation asset valuation, and inventory management. This article is general information and not tax or legal advice.</em></p>
3431
3432      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Sources</h2>
3433
3434      <ol style="margin-top: 24px; padding-left: 24px; list-style: decimal; font-size: 15px; line-height: 1.6; color: #64748b;">
3435        <li style="margin-top: 10px;">The Aspen Institute, Artist-Endowed Foundations Initiative. "An Evening for AEF Leaders: Reflections on Artists, Legacy, &amp; Philanthropy," New York, September 24, 2026. <a href="https://www.aspeninstitute.org/events/an-evening-for-aef-leaders-reflections-on-artists-legacy-philanthropy-ny-2026/" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">aspeninstitute.org</a></li>
3436        <li style="margin-top: 10px;">Christine J. Vincent, <em>The Artist as Philanthropist: Strengthening the Next Generation of Artist-Endowed Foundations — Study Report Supplement 2018</em> (Washington, DC: The Aspen Institute, 2019), reporting 2015 data. <a href="https://www.aspeninstitute.org/wp-content/uploads/2025/05/aefi-2018-supplement-exec-summary.pdf" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">Executive summary</a></li>
3437        <li style="margin-top: 10px;">The Aspen Institute, "The Artist-Endowed Foundation Field is Experiencing Transformational Growth, Aspen Institute Research Reveals." <a href="https://www.aspeninstitute.org/news/artist-endowed-foundation-growth/" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">aspeninstitute.org</a></li>
3438        <li style="margin-top: 10px;">Internal Revenue Code §170(e)(1)(A) (limitation on charitable deductions for ordinary income property, including works donated by the artist who created them); Tax Reform Act of 1969, Pub. L. 91-172.</li>
3439        <li style="margin-top: 10px;">Internal Revenue Code §2031 and Treas. Reg. §20.2031-1(b) (inclusion of property in the gross estate at fair market value).</li>
3440        <li style="margin-top: 10px;">One Big Beautiful Bill Act, Pub. L. 119-21 (2025), amending Internal Revenue Code §2010(c) (basic exclusion amount of $15 million beginning January 1, 2026, indexed for inflation thereafter).</li>
3441        <li style="margin-top: 10px;"><em>Estate of O'Keeffe v. Commissioner</em>, T.C. Memo. 1992-210.</li>
3442        <li style="margin-top: 10px;"><em>Estate of David Smith v. Commissioner</em>, 57 T.C. 650 (1972).</li>
3443        <li style="margin-top: 10px;"><em>Matter of Warhol</em>, 165 Misc. 2d 726 (N.Y. Sur. Ct. 1995).</li>
3444        <li style="margin-top: 10px;">Internal Revenue Manual 4.48.2, "Valuation Assistance for Cases Involving Works of Art," and 4.25.12, "Valuation Assistance." <a href="https://www.irs.gov/irm/part4/irm_04-048-002" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">irs.gov</a></li>
3445        <li style="margin-top: 10px;">
3445Rev. Proc. 96-15 (Statements of Value for art appraised at $50,000 or more); Internal Revenue Manual 8.18.1. <a href="https://www.irs.gov/irm/part8/irm_08-018-001" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">irs.gov</a></li>
3446        <li style="margin-top: 10px;">Center for Art Law, "Spotlight: IRS Art Advisory Panel," citing the Art Advisory Panel's 2014 Annual Summary Report. <a href="https://itsartlaw.org/spotlight/spotlight-irs-art-advisory-panel/" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">itsartlaw.org</a></li>
3447        <li style="margin-top: 10px;">Internal Revenue Code §4942 (minimum distribution requirement for private non-operating foundations).</li>
3448      </ol>
3449    `},"double-rainbow-central-bank-valuation":{title:"The €1.1 Million Pot of Gold at the End of A Double Rainbow",titleHtml:"The €1.1 Million Pot of Gold at the End of <em>A Double Rainbow</em>",subtitle:"",type:"editorial",date:"2026-08-24",category:"Industry Insights",editionLabel:"Appraisal Bureau News — Ed. 36",image:"/__l5e/assets-v1/325f8a8a-1604-4f38-9113-fd3898f28b18/double-rainbow-sculpture.jpg",creditLine:"Eva Rothschild, <em>A Double Rainbow</em>, 2022. Installed at The Central Bank of Ireland.",content:`
3450      <p>What initially appeared to be a dramatic decline in the value of the Central Bank of Ireland's art collection turned out to be an administrative oversight in its inventory reporting. First reported by the Irish Independent, artworks held at the central bank's Dockland Campus and Sandyford locations were excluded from the collection's 2024 appraisal, resulting in a €1,076,600 undervaluation.</p>
3451
3452      <p style="margin-top: 32px;">A spokesperson told Appraisal Bureau that the 2021 net realizable value was €2,056,880 versus €926,770 in 2024. The more recent valuation has been corrected to reflect a value of €2,003,370. The spokesperson added that this was "due to an administrative error," and that "a correction will be placed in next year's accounts."</p>
3453
3454      <p style="margin-top: 32px;">Overlooked works included Eva Rothschild's monumental public sculpture <em>A Double Rainbow</em> (2022), which was purchased for €320,000 in 2019. The sculpture was valued at €500,000 in a December 2021 appraisal conducted as the artwork was being produced. Due to delays related to the Covid-19 pandemic, Rothschild's sculpture reportedly cost the central bank more than €616,000 once it was installed in 2022 after accounting for storage and professional fees.</p>
3455
3456      <div style="margin-top: 56px; margin-bottom: 8px; display: flex; justify-content: center;">
3457        <iframe src="https://www.instagram.com/p/CZunVn2oq_D/embed" width="100%" height="700" frameborder="0" scrolling="no" allowtransparency="true" style="max-width: 540px; border: none; overflow: hidden;" loading="lazy" title="Instagram post by Eva Rothschild"></iframe>
3458      </div>
3459
3460      <p style="margin-top: 32px;">While the incomplete report caused an accounting review and embarrassing headlines for the central bank, for private collectors the impact of such an error could be profoundly wide-reaching. Insurance claims, lending decisions, and tax reporting can be impacted by incomplete valuations. For family offices and wealth managers, inaccurate collection management may also present an incomplete picture of a collection's total net worth.</p>
3461
3462      <p style="margin-top: 32px;">The most recent UBS and Art Basel Survey of Art Collecting from 2025 reported that wealthy individuals dedicate approximately 20 percent of their net worth to fine art, an increase from 15 percent in 2024. Given fine art's growing importance to an individual's broader wealth portfolio, new tools are emerging to ensure regular, comprehensive assessments of a collector's holdings.</p>
3463
3464      <p style="margin-top: 32px;">This month, Appraisal Bureau announced a new integration with <a href="/integrations">Addepar</a>, a portfolio management platform used by the world's leading wealth advisors, including UBS. In the industry-leading partnership, substantiated object valuations from Appraisal Bureau flow directly into the Addepar environment, allowing art to be tracked alongside equities, private investments, real estate, and other major asset classes.</p>
3465
3466      <p style="margin-top: 32px;">Art valuations are part of a holistic approach to planning wealth, which makes visibility into portfolio reviews, risk assessments, and succession plans more important across categories. For advisors, this means that art is no longer able to sit in a separate reporting silo. For collectors, partnerships between the art and finance sectors generate added confidence that their most personal art assets are managed with the same rigor as other investments.</p>
3467
3468      <p style="margin-top: 32px;">For all, integrations that create reporting visibility and transparency mean that unsettling valuation errors will soon prove to be a thing of the past.</p>
3469    `}
3469,"appraisal-bureau-the-campus-partnership":{title:"Appraisal Bureau x The Campus: Building a Stronger Art Ecosystem",subtitle:"Appraisal Bureau is proud to partner with and sponsor The Campus, one of the contemporary art world's most ambitious collaborative initiatives.",type:"editorial",date:"2026-06-22",category:"Museums & Philanthropy",editionLabel:"Appraisal Bureau News — Ed. 35",image:"/__l5e/assets-v1/ed52d719-69d4-4ed2-9e74-a2d1ab8c4bd1/the-campus-exterior.png",content:`
3470      <p>The <a href="https://www.thecampusupstate.com/" target="_blank" rel="noopener noreferrer" style="color: inherit; text-decoration: underline;">Campus</a> was founded by six leading contemporary galleries — Bortolami, James Cohan, kaufmann repetto, Anton Kern, Andrew Kreps, and kurimanzutto. This year, the project expands internationally with the inclusion of eight UK galleries: Thomas Dane Gallery, Emalin, Herald St &amp; Gordon Robichaux, Hollybush Gardens, Lisson, Pippy Houldsworth Gallery, Modern Art, and Vigo Gallery.</p>
3471
3472      <div style="margin-top: 40px; margin-bottom: 8px; padding: 24px 28px; border: 1px solid #e2e8f0; background: #fafafa;">
3473        <p style="font-size: 11px; text-transform: uppercase; letter-spacing: 0.25em; color: #64748b; margin-bottom: 14px;">Opening Weekend</p>
3474        <p style="font-family: 'Newsreader', serif; font-weight: 300; font-size: 22px; line-height: 1.35; color: #1a1a1a; margin: 0;">The Campus, Hudson Valley, New York</p>
3475        <p style="margin-top: 16px; font-size: 15px; color: #334155;">June 27, 11am – 5pm<br/>June 28, 12 – 5pm</p>
3476      </div>
3477
3478
3479      <p style="margin-top: 32px;">The participating galleries have invited an exceptional group of artists — including Hurvin Anderson, Vamba Bility, Ibrahim El-Salahi, Roe Ethridge, John Giorno, Oliver Lee Jackson, Sarah Lucas, Tony Oursler, Clare Rojas, Tschabalala Self, Naama Tsabar, Francis Upritchard, Pae White, Qualeasha Wood, and many others — for the third edition of The Campus.</p>
3480
3481      <p style="margin-top: 32px;">Set within the former Ockawamick School in New York's Hudson Valley, The Campus reimagines an abandoned mid-century educational complex as a dynamic platform for contemporary art. Spanning more than 35 classrooms, corridors, a gymnasium, and expansive outdoor grounds, the project is an unprecedented collaboration between its six founding contemporary art galleries.</p>
3482
3483      <figure style="margin-top: 56px; margin-bottom: 8px;">
3484        <img src="/__l5e/assets-v1/0233c9e7-28ac-4456-bfef-0efa94ae24b3/the-campus-gymnasium.png" alt="Installation view inside the gymnasium at The Campus, 2025" style="width: 100%; height: auto; display: block;" loading="lazy" />
3485        <figcaption style="margin-top: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: #94a3b8;">Installation View, The Campus, 2025</figcaption>
3486      </figure>
3487
3488      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Building a Stronger Art Ecosystem Through Collaboration</h2>
3489
3490      <p style="margin-top: 24px;">At its core, The Campus is a testament to the power of collaboration. By bringing together galleries that would traditionally operate independently, the initiative creates opportunities that extend far beyond a single exhibition. It encourages the exchange of ideas, broadens audiences, and strengthens the network of relationships that supports the contemporary art market.</p>
3491
3492      <p style="margin-top: 32px;">That belief in collaboration is one of the reasons Appraisal Bureau is proud to support the project. While our organizations serve different roles within the art world, we share a common interest in fostering a healthy, sustainable ecosystem for all participants.</p>
3493
3494      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">Stewardship Beyond the Exhibition</h2>
3495
3496      <p style="margin-top: 24px;">The Campus creates new opportunities for artists, galleries, and collectors to connect through ambitious exhibitions and shared experiences. Appraisal Bureau helps support what happens after discovery, providing collection management and valuation infrastru
3496cture that connects the art market with adjacent industries including insurance, lending, wealth management, and estate planning.</p>
3497
3498      <p style="margin-top: 32px;">As the art market continues to evolve, initiatives like The Campus demonstrate that some of the most meaningful progress happens when organizations come together around a shared vision. We are honored to support this year's opening and look forward to celebrating the galleries, artists, and audiences who continue to make this remarkable project possible.</p>
3499
3500      <p style="margin-top: 32px;">Members of the Appraisal Bureau team will be attending throughout the opening weekend, and we look forward to seeing many of our clients, colleagues, and friends there.</p>
3501
3502      <div style="margin-top: 64px; padding-top: 32px; border-top: 1px solid #e2e8f0;">
3503        <p style="font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: #94a3b8; margin-bottom: 16px;">About The Campus</p>
3504        <p style="font-size: 15px; color: #475569; line-height: 1.7;">The Campus is a collaborative exhibition initiative in New York's Hudson Valley, founded by Bortolami, James Cohan, kaufmann repetto, Anton Kern, Andrew Kreps, and kurimanzutto. Housed within the former Ockawamick School, the project brings together leading galleries, artists, and audiences through ambitious exhibitions and shared programming.</p>
3505      </div>
3506    `},"responsible-ai-adoption-testudo":{title:"Why Responsible AI Adoption Led Us to Testudo",subtitle:"Securing specialized generative AI insurance coverage — a milestone in how we approach responsible AI adoption.",type:"editorial",date:"2026-06-04",category:"Industry Insights",editionLabel:"Appraisal Bureau News — Ed. 34",image:"/lovable-uploads/testudo-ai-insurance-v2.jpg",content:`
3507      <p>At Appraisal Bureau, we spend a lot of time thinking about the future of valuation services, and the headline of that future is artificial intelligence.</p>
3508
3509      <p style="margin-top: 32px;">AI is no longer a futuristic concept or experimental technology. It is already reshaping how businesses operate, how information is processed, and how professional services are delivered across nearly every industry.</p>
3510
3511      <p style="margin-top: 32px;">The impact on valuation services is already profound. At Appraisal Bureau, we use generative AI and emerging agentic workflows to help streamline operations, organize complex valuation-related information, automate repetitive processes, and improve efficiency across our platform. The opportunities are significant — not only for speed and scale, but for creating better experiences for clients and more effective tools for valuation professionals.</p>
3512
3513      <p style="margin-top: 32px;">But as AI becomes more deeply integrated into real businesses, another conversation is emerging alongside the excitement: risk.</p>
3514
3515      <p style="margin-top: 32px;">Questions surrounding hallucinated outputs, intellectual property exposure, data handling, regulatory uncertainty, and liability tied to AI-generated information are becoming increasingly important as businesses move beyond simple AI tools and begin deploying agentic workflows capable of taking actions, making recommendations, and influencing operational decisions.</p>
3516
3517      <p style="margin-top: 32px;">That's beginning to change.</p>
3518
3519      <p style="margin-top: 32px;">Recently, Appraisal Bureau secured specialized generative AI insurance coverage through <a href="https://www.testudo.co/" target="_blank" rel="noopener noreferrer" style="color: inherit; text-decoration: underline;"><strong>Testudo</strong></a>, a Lloyd's of London-backed insurer focused specifically on risks associated with AI systems and generative technologies.</p>
3520
3521      <p style="margin-top: 32px;">The process was remarkably straightforward. Working through our existing broker, we completed a short proposal form and received a quote without requiring access to our proprietary systems or te
3521chnical integrations.</p>
3522
3523      <p style="margin-top: 32px;">For us, obtaining this coverage was an important milestone and a reflection of how seriously we approach responsible AI adoption.</p>
3524
3525      <p style="margin-top: 32px;">Historically, insurance markets have often been one of the clearest signals that a technology is maturing. Cybersecurity followed a similar trajectory years ago. As businesses became increasingly digital, cyber insurance evolved alongside them to address new operational risks.</p>
3526
3527      <p style="margin-top: 32px;">Generative AI is now entering that same phase.</p>
3528
3529      <p style="margin-top: 32px;">The emergence of companies like Testudo reflects a broader shift already underway: AI risk is becoming a defined category that businesses, insurers, regulators, and clients are actively preparing for. As organizations adopt AI across critical workflows, they deserve greater certainty around how emerging risks are managed and transferred.</p>
3530
3531      <blockquote style="margin-top: 48px; padding: 32px 40px; border-left: 2px solid #220E99; background: #fafafa; font-family: 'Newsreader', serif; font-weight: 300; font-size: 22px; line-height: 1.45; color: #1a1a1a;">
3532        "Appraisal Bureau is exactly the kind of client we built Testudo for: a company deploying AI that wants certainty and best-in-class AI insurance coverage. We're here to enable responsible AI adoption — because serious enterprises like Appraisal Bureau need appropriate insurance to innovate with confidence."
3533        <span style="display: block; margin-top: 20px; font-family: inherit; font-size: 13px; text-transform: uppercase; letter-spacing: 0.15em; color: #64748b;">— George Lewin-Smith, Co-Founder &amp; CEO, Testudo</span>
3534      </blockquote>
3535
3536      <p style="margin-top: 48px;">For Appraisal Bureau, this ultimately comes down to trust.</p>
3537
3538      <p style="margin-top: 32px;">Our clients rely on us to manage sensitive information, valuable collections, and important valuation-related records. As we continue integrating new technologies into our platform, we believe it's essential to approach AI with both ambition and responsibility — and can now innovate with greater confidence with this new coverage in place.</p>
3539
3540      <p style="margin-top: 32px;">We are extremely optimistic about what AI makes possible. We are equally serious about building responsibly around it.</p>
3541
3542      <p style="margin-top: 32px;">Securing specialized AI insurance coverage is one small part of that commitment — and one more step toward helping our clients move confidently into the future alongside us.</p>
3543    `},"neutrality-is-the-whole-point":{title:"Neutrality Is the Whole Point",subtitle:"What U.S. tax law and USPAP actually require of an independent appraiser — and why an appraisal is only as valuable as the impartiality behind it.",type:"editorial",date:"2026-05-20",category:"Appraisal Standards • Practice Note",editionLabel:"Appraisal Bureau — Practice Note",image:"/lovable-uploads/neutrality-balance-scale.jpg",content:`
3544      <p>A quiet shift is underway in the art market: dealers, private-sale galleries, and art-finance advisory firms are beginning to bring appraisal work in-house. On its face this looks like a vote of confidence in the profession. But it raises a question worth answering plainly, because the answer is the entire foundation of what we do: what does the law actually require of an appraiser's independence?</p>
3545
3546      <p style="margin-top: 32px;">The short version is that neutrality is not a courtesy or a marketing claim. For any appraisal that will be used on a U.S. tax return, it is a set of specific, enforceable requirements — and several of them speak directly to who an appraiser may, and may not, work for.</p>
3547
3548      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">1. The standard the IRS adopts is USPAP</h2>
3549
3550      <p style="margin-top: 24px;">When a taxpayer claims a deduction for donated property worth more than $5,000, the Internal Revenue Code requires a "qualified appraisal" prepared by a "qualified appraiser." <em>(IRC § 170(f)(11)(C)–(D))</em></p>
3551
3552      <p style="margin-top: 32px;">Treasury regulations define a qualified appraisal as one prepared "in accordance with generally accepted appraisal standards" — and then define that phrase to mean, in the regulation's own words, "the substance and principles of the Uniform Standards of Professional Appraisal Practice, as developed by the Appraisal Standards Board of the Appraisal Foundation." <em>(Treas. Reg. § 1.170A-17(a)(1)–(2))</em></p>
3553
3554      <p style="margin-top: 32px;">USPAP, in turn, is built on the Ethics Rule, which requires the appraiser to perform every assignment "with impartiality, objectivity, and independence, and without accommodation of personal interests," and prohibits performing an assignment "with bias." Independence is therefore not a soft professional aspiration sitting alongside the federal rules — it is incorporated into them.</p>
3555
3556      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">2. Who is a "qualified appraiser" — and who is disqualified</h2>
3557
3558      <p style="margin-top: 24px;">The regulation defines a qualified appraiser as an individual with verifiable education and experience in valuing the relevant type of property — generally completed coursew
3558ork plus two or more years of experience, or a recognized designation from a professional appraiser organization. <em>(Treas. Reg. § 1.170A-17(b)(1)–(2))</em></p>
3559
3560      <p style="margin-top: 32px;">But credentials are only half the test. The same regulation lists, by category, the people who cannot serve as the qualified appraiser for a given property, no matter how well qualified on paper <em>(Treas. Reg. § 1.170A-17(b)(5))</em>:</p>
3561
3562      <ul style="margin-top: 24px; padding-left: 24px; list-style-type: disc;">
3563        <li style="margin-top: 12px;">The donor of the property, or the donee receiving it.</li>
3564        <li style="margin-top: 12px;">A party to the transaction in which the donor acquired the property — expressly including "the individual who sold, exchanged, or gave the property to the donor, or any individual who acted as an agent" for that sale or gift. <strong>In plain terms: the dealer who sold the piece cannot also appraise it.</strong></li>
3565        <li style="margin-top: 12px;">Anyone related to, or employed by, any of those persons, or married to such a person <em>(§ 1.170A-17(b)(5)(v)(A)–(B))</em>.</li>
3566        <li style="margin-top: 12px;">An independent contractor "regularly used as an appraiser" by the donor, donee, or selling party who "does not perform a majority of his or her appraisals for others during the taxable year" <em>(§ 1.170A-17(b)(5)(v)(C))</em> — the captive-appraiser provision.</li>
3567      </ul>
3568
3569      <p style="margin-top: 32px;">That last category is the one to read twice. An appraiser who works substantially for a single dealer or fund — rather than for a broad base of independent clients — can fall outside the definition of a qualified appraiser for that firm's property by operation of the regulation itself.</p>
3570
3571      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">3. The fee cannot depend on the value</h2>
3572
3573      <p style="margin-top: 24px;">Neutrality is also enforced through compensation. A qualified appraisal's fee "cannot be based to any extent on the appraised value of the property"; a fee is treated as prohibited if any part of it turns on the value the IRS ultimately allows. <em>(Treas. Reg. § 1.170A-17(a)(9))</em> An individual who accepts such a fee is, by definition, not a qualified appraiser. <em>(§ 1.170A-17(b)(5)(i))</em></p>
3574
3575      <p style="margin-top: 32px;">USPAP reaches the same result through its Ethics Rule, which bars accepting an assignment contingent on "the reporting of a predetermined result," a direction in value, or an amount tied to the value conclusion. A percentage-of-value arrangement — common on the dealing side of the market — is incompatible with an independent appraisal.</p>
3576
3577      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">4. The appraiser personally carries the penalty</h2>
3578
3579      <p style="margin-top: 24px;">These rules have teeth, and they point at the appraiser individually. Every qualified appraisal must contain the appraiser's signed declaration acknowledging that a substantial or gross valuation misstatement "may subject me to a penalty under section 6695A." <em>(Treas. Reg. § 1.170A-17(a)(3)(vi))</em></p>
3580
3581      <p style="margin-top: 32px;">Under IRC § 6695A, an appraiser who prepares an appraisal knowing it will be used on a return is penalized when the claimed value produces a substantial valuation misstatement (claimed value 150% or more of the correct amount) or a gross valuation misstatement (200% or more); for estate and gift tax, the trigger is a value of 65% or less of the correct figure. The penalty is the greater of $1,000 or 10% of the underpayment attributable to the misstatement, capped at 125% of the gross income the appraiser received for the appraisal. <em>(IRC § 6695A(a)–(b); see also IRM 20.1.12)</em></p>
3582
3583      <p style="margin-top: 32px;">There is a defense — no penalty applies if the appraiser establishes that the value was "more likely than not" correct <em>(IRC § 6695A(c))</em> — but the structure is telling: the regulator placed the liability on the person signing the opinion, precisely because that person is supposed to answer to no one but the evidence.</p>
3584
3585      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">5. Why the in-house question matters</h2>
3586
3587      <p style="margin-top: 24px;">Read together, these authorities describe an appraiser whose loyalty runs to the valuation, not to a transaction. That is 
3587why a dealer or advisory firm employing its own appraiser sits in a structurally awkward position. An in-house appraiser valuing property the firm is selling, buying, consigning, or lending against may be disqualified outright as a "party to the transaction," as an employee of one, or as a captive appraiser under § 1.170A-17(b)(5) — and even where a technical exception applies, the IRS, lenders, and courts heavily discount a value produced inside the interested party's own walls.</p>
3588
3589      <p style="margin-top: 32px;">Form 8283, the IRS substantiation form the appraiser must sign, makes the point in black and white: the appraiser declares under penalty that they are not the donor, the donee, a party to the acquisition, or employed by or related to any of them. <strong>The license does not travel with the credential; it travels with the independence.</strong></p>
3590
3591      <h2 style="margin-top: 56px; font-family: 'Newsreader', serif; font-weight: 300; font-size: 28px; line-height: 1.2;">The bottom line</h2>
3592
3593      <p style="margin-top: 24px;">A USPAP designation is necessary, but it is not what makes an appraisal usable. What makes it usable is that the person who signed it had no stake in the answer — a condition the Code, the Treasury regulations, USPAP, and Form 8283 each independently require. When evaluating any appraisal — or any appraiser — the first question is not "Are they qualified?" It is "Whom do they work for?"</p>
3594
3595      <p style="margin-top: 32px;">Appraisal Bureau is all-in on modernizing this industry by leveraging technology — but technology is a tool in service of judgment, never a substitute for it. We are human in the loop on every assignment. A certified appraiser takes personal liability for each valuation, and every valuation is reviewed by multiple appraisers before it leaves our hands — always. Independence and accountability are not the things we automate away; they are the things our technology is built to reinforce.</p>
3596
3597      <p style="margin-top: 32px;">The answer to "whom do they work for" is, and has to be, no one but the evidence.</p>
3598
3599      <div style="margin-top: 64px; padding-top: 32px; border-top: 1px solid #e2e8f0;">
3600        <p style="font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: #94a3b8; margin-bottom: 16px;">Authorities Cited</p>
3601        <ul style="padding-left: 0; list-style-type: none; font-size: 14px; color: #475569;">
3602          <li style="margin-top: 12px;">26 U.S.C. § 170(f)(11) — substantiation requirement for noncash charitable contributions.</li>
3603          <li style="margin-top: 12px;">26 C.F.R. § 1.170A-17 — qualified appraisal and qualified appraiser (standards, disqualified persons, prohibited fees, declaration).</li>
3604          <li style="margin-top: 12px;">26 U.S.C. § 6695A — penalties for substantial and gross valuation misstatements attributable to incorrect appraisals.</li>
3605          <li style="margin-top: 12px;">Uniform Standards of Professional Appraisal Practice (USPAP), Ethics Rule — Conduct, impartiality, objectivity, independence, and prohibition on bias and contingent assignments.</li>
3606          <li style="margin-top: 12px;">IRS Form 8283, Section B appraiser declaration.</li>
3607        </ul>
3608        <p style="margin-top: 24px; font-size: 12px; font-style: italic; color: #94a3b8;">This note is general information about appraisal standards and is not legal or tax advice.</p>
3609      </div>
3610    `},"art-on-the-balance-sheet-addepar-integration":{title:"Art on the Balance Sheet",subtitle:"A New Integration with Addepar",type:"editorial",date:"2026-04-22",category:"Product & Integrations",editionLabel:"",image:"",content:`
3611      <div style="margin-bottom: 48px;">
3612        <img src="/lovable-uploads/addepar-logo.png" alt="Addepar" style="max-width: 220px; display: block;" />
3613      </div>
3614
3615      <p>Art has historically been one of the hardest asset classes for RIAs and family offices to steward inside a unified reporting system. Values move, documentation is scattered across appraisers, galleries, and storage facilities, and a single collection can simultaneously touch insurance, tax, estate, and philanthropic planning. For most advisors, fine art still lives outside the primary platform — tracked in standalone spreadsheets, PDFs, and email threads.</p>
3616
3617      <p style="margin-top: 32px;">Appraisal Bureau is now a technology partner of <strong>Addepar</strong>, the wealth management platform used by leading registered investment advisors, multi-family offices, private banks, and institutional investors to unify reporting across every asset on a client's balance sheet — public equities, private funds, real estate, and alternatives. An integration between the two platforms is in development and is expected to go live by the end of Q2 2026.</p>
3618
3619      <p style="margin-top: 32px;">When live, high-level collection data will push from Appraisal Bureau into the Addepar environment, giving advisors visibility into art as an asset class alongside the rest of a client's portfolio. Collectors can also choose to grant their advisors direct access to their workspace on the Appraisal Bureau platform for deeper context on individual works. The two-layer structure is deliberate: advisors can track the art asset inside their comprehensive reporting environment, while sensitive artwork-level data — provenance, condition, documentation — stays private at the collector's discretion.</p>
3620
3621      <p style="margin-top: 32px;">The effect is that advisors can stop reconstructing the picture from scratch each cycle and begin treating art the way they treat every other line on the balance sheet: continuously, defensibly, and in full context. It is a small piece of a broader shift already underway across wealth management — art moving from an occasional appraisal artifact to a continuously maintained, auditable asset.</p>
3622    `}
3622,"defying-category-harmony-korine-ica-miami":{title:"Defying Category: Harmony Korine at ICA Miami",subtitle:"",type:"article",date:"2026-04-15",category:"Museums & Philanthropy",editionLabel:"Appraisal Bureau News — Ed. 33",image:"/lovable-uploads/korine-portrait.avif",fullHeight:!0,creditLine:"Harmony Korine. Photo: Rob Mckeever. Courtesy Gagosian Gallery.",content:`
3623      <p>"Institutions today have a responsibility not simply to validate established categories, but to create space for artists whose work resists them," says <strong>Alex Gartenfeld, Artistic Director of the Institute of Contemporary Art Miami</strong>.</p>
3624
3625      <p style="margin-top: 32px;">It is within this context that <em>Harmony Korine: Perfect Nonsense</em>, the first major US museum survey dedicated to the artist, opens today at ICA Miami. The exhibition offers a rare, expansive look at a practice that has consistently moved between cinema, painting, and emerging technologies, resisting easy classification at every turn.</p>
3626
3627      <p style="margin-top: 32px;">Best known for writing the screenplay for the now-iconic film <em>Kids</em> (1995), Korine has spent the past three decades building a body of work that interrogates youth culture, marginality, and the instability of images themselves. Bringing together more than 50 works across painting, film, photography, collage, and digital environments, <em>Perfect Nonsense</em> foregrounds the continuity of his process rather than the boundaries between media. Early works, marked by raw, diaristic fragments and childlike drawings, sit alongside recent experiments that employ iPhones, digital compositing, and gaming engines, revealing an artist consistently preoccupied with how images are constructed, distorted, and circulated.</p>
3628
3629      <p style="margin-top: 32px;">
3629"This survey is especially timely because, while Harmony Korine's films have received significant critical attention, his work across mediums has never before been considered holistically in a US museum," says Alex Gartenfeld.</p>
3630
3631      <p style="margin-top: 32px;">He adds that: "ICA Miami is particularly suited to tell this story because we are able to present it within the context of Miami, where Korine has lived and worked for many years, and which has deeply informed his practice. Looking across three decades of work, it becomes clear that his films, paintings, and virtual environments are part of a unified practice that anticipated many of the conditions of contemporary image culture."</p>
3632
3633      <p style="margin-top: 32px;">The transitional ethos of his work echoes the iterative processes of generative systems, where images are layered, distorted, and reconstituted. This is evident in works such as <em>Chex</em> (2011–14) and <em>Fazer</em> (2015), where Korine experiments with "psychedelic effects and escape." These works reflect the sensory overload of contemporary media culture and invite audiences to consider how imagery is produced and consumed today, a preoccupation he also drives through his experimental media company <strong>EDGLRD</strong>.</p>
3634
3635      <p style="margin-top: 32px;">That Korine's work has been readily embraced by esteemed art institutions (he has also exhibited at Centre Pompidou in Paris in 2017, and the Stedelijk Museum voor Actuele Kunst or S.M.A.K) is testament to the growing ability of the art world to support exploratory approaches.</p>
3636
3637      <p style="margin-top: 32px;">To learn more, visit the <a href="https://icamiami.org" target="_blank" rel="noopener noreferrer" style="color: #3b82f6; text-decoration: underline;">Institute of Contemporary Art, Miami</a>. Major support for <em>Harmony Korine: Perfect Nonsense</em> is provided by <strong>Appraisal Bureau</strong> and <strong>HAUSER & WIRTH</strong>. The exhibition is organized by the Institute of Contemporary Art, Miami, and curated by Alex Gartenfeld, Irma and Norman Braman Artistic Director, and Gean Moreno, Director of the Art + Research Center, with research assistance from Donna Honarpisheh, Associate Curator, Art + Research Center at ICA Miami.</p>
3638    `},"harmony-korine-from-vhs-to-ai":{title:"Harmony Korine: From VHS to AI",subtitle:"How the Filmmaker-Turned-Artist Has Made Technology Itself a Medium",type:"editorial",date:"2026-04-08",category:"Museums & Philanthropy",editionLabel:"Appraisal Bureau Editorial",image:"/lovable-uploads/korine-ica-miami.avif",content:`
3639      <p>Appraisal Bureau is proud to sponsor <em>Harmony Korine: Perfect Nonsense</em>, opening April 15 at ICA Miami — the artist's first major U.S. museum survey. Spanning over fifty works across painting, photography, collage, drawing, film, and virtual environments, the exhibition traces three decades of restless invention from one of American culture's most unpredictable figures. It is a rare opportunity to see the full arc of an artist who has consistently refused to settle into any single form.</p>
3640
3641      <p style="margin-top: 32px;">Korine first appeared on the scene in the mid-1990s when, at just nineteen, he wrote the screenplay for Larry Clark's <em>Kids</em> (1995) — a film that shocked audiences with its raw, almost documentary-like immediacy. He followed it by directing <em>Gummo</em> (1997), which wove together 35mm, Super 8, Polaroids, and found VHS footage into something that felt less like a movie and more like a hallucination stitched from discarded media. Even then, the choice of format was never incidental. Korine understood that the grain, the glitch, and the degradation of an image carried their own emotional charge.</p>
3642
3643      <div style="margin-top: 48px; margin-bottom: 48px;">
3644        <img src="/lovable-uploads/aggro-drift-still.avif" alt="Still from AGGRO DR1FT, 2023" style="width: 100%; display: block;" />
3645        <p style="text-align: center; font-style: italic; color: #94a3b8; font-size: 13px; margin-top: 10px;">Still from <em>AGGRO DR1FT</em>
3645, 2023. Courtesy: © Harmony Korine and EDGLRD</p>
3646      </div>
3647
3648      <p style="margin-top: 32px;">That conviction only deepened over the following decade. With <em>Trash Humpers</em> (2009), Korine deliberately shot on VHS at a moment when the rest of the industry was racing toward digital clarity. "There was a strange beauty in the analog," he said at the time. "You almost have to squint to see things through the grain and the mist." The lo-fi texture wasn't nostalgia — it was a statement about how the apparatus of image-making shapes what we feel when we look. His paintings, meanwhile, developed a parallel logic: working from iPhone photographs that he digitally manipulated before translating them into oil on canvas, Korine built a practice he calls "mistakism," embracing error, improvisation, and the productive friction between screens and surfaces.</p>
3649
3650      <p style="margin-top: 32px;">Since relocating to Miami in 2015, Korine has pushed further still. In 2022, he founded EDGLRD (pronounced "edgelord"), a creative studio that operates at the intersection of film, gaming, fashion, and generative technology. Its first major project, <em>AGGRO DR1FT</em> (2023), premiered at the Venice Film Festival: an eighty-minute fever dream starring Travis Scott, shot entirely through thermal-imaging cameras sourced from NASA and then processed through layers of VFX and AI. The result looked like nothing cinema had produced before — part surveillance feed, part video game, part painting. EDGLRD has since partnered with Runway, a leading generative AI company, in a first-look deal that gives the studio access to cutting-edge AI tools across its films, immersive projects, and brand work. For Korine, artificial intelligence is not a shortcut but the latest in a long line of machines whose textures and limitations become the raw material of art.</p>
3651
3652      <div style="margin-top: 48px; margin-bottom: 48px;">
3653        <img src="/lovable-uploads/korine-revelator-maximus.webp" alt="Harmony Korine, REVELATOR MAXIMUS, 2023" style="width: 100%; display: block;" />
3654        <p style="text-align: center; font-style: italic; color: #94a3b8; font-size: 13px; margin-top: 10px;">Harmony Korine, <em>REVELATOR MAXIMUS</em>, 2023, oil on canvas, 62 × 93 cm. Courtesy: © Harmony Korine and Hauser & Wirth; photo: Keith Lubow</p>
3655      </div>
3656
3657      <p style="margin-top: 32px;"><em>Perfect Nonsense</em> arrives at a moment when questions about technology and artistic authorship are everywhere — but Korine has been asking them for thirty years, long before they became fashionable. From photocopied zines to thermal lenses to generative models, his work suggests that the most interesting art doesn't just use new tools; it listens to what they sound like when they break. The exhibition is on view at ICA Miami from April 15 through October 4, 2026.</p>
3658
3659      <p style="margin-top: 32px; font-style: italic; color: #64748b;">Major support for "Harmony Korine: Perfect Nonsense" is provided by Appraisal Bureau and HAUSER & WIRTH. Additional support is provided by Molly & Omer Tiroche.</p>
3660    `},"uspap-ao-41-ai-guidance-appraisers":{title:"What the New USPAP Guidance on AI Means for Appraisers",subtitle:"AI in Appraisal: The Appraisal Foundation Sets the Standard with AO-41",type:"article",date:"2026-03-25",category:"Industry Insights",editionLabel:"Appraisal Bureau News",image:"/lovable-uploads/uspap-ao41-hero.jpg",content:`
3661      <div style="text-align: center; margin-bottom: 40px;"><img src="/lovable-uploads/taf-logo.svg" alt="The Appraisal Foundation" style="max-width: 240px; margin: 0 auto;" /></div>
3662
3663      <p>The Appraisal Standards Board's Second Exposure Draft of Advisory Opinion 41 (AO-41) marks an important moment for the valuation industry.</p>
3664
3665      <p style="margin-top: 32px;">For the first time, USPAP directly addresses how appraisers can use modern technology, including artificial intelligence, within appraisal assignments. The message is clear. Technology is not only permitted, it is expected. Just as importantly, responsibility remains entirely with the appraiser.</p>
3666
3667      <p style="margin-top: 32px;">At Appraisal Bureau, this is exactly the future we have been building toward.</p>
3668
3669      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Technology is a Tool, Not the Appraiser</h2>
3670
3671      <p style="margin-top: 16px;">
3671AO-41 reinforces a foundational principle. Tools can assist, but they do not produce appraisal results. Appraisers do.</p>
3672
3673      <p style="margin-top: 32px;">This distinction matters.</p>
3674
3675      <p style="margin-top: 32px;">As technology becomes more powerful, there is a growing temptation to treat outputs from models, databases, or AI systems as conclusions. AO-41 explicitly rejects that approach. Any output must be evaluated, validated, and ultimately adopted or rejected by the appraiser.</p>
3676
3677      <p style="margin-top: 32px;">Appraisal Bureau is designed around this principle. We do not replace the appraiser. We structure, support, and accelerate the appraisal process while preserving full professional judgment.</p>
3678
3679      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Understanding Technology Without Overcomplicating It</h2>
3680
3681      <p style="margin-top: 16px;">One of the most helpful clarifications in AO-41 is around competency.</p>
3682
3683      <p style="margin-top: 32px;">Appraisers are not expected to build or fully understand the technical architecture of advanced tools. However, they are expected to understand what a tool does, recognize its limitations, and evaluate whether its output is credible.</p>
3684
3685      <p style="margin-top: 32px;">This is where thoughtful product design matters.</p>
3686
3687      <p style="margin-top: 32px;">Appraisal Bureau prioritizes transparency and control. Every valuation is grounded in a clear methodology, with outputs that can be interpreted, tested, and supported without relying on black-box systems.</p>
3688
3689      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A Higher Standard for Data and Confidentiality</h2>
3690
3691      <p style="margin-top: 16px;">AO-41 places strong emphasis on confidentiality, especially when using AI systems.</p>
3692
3693      <p style="margin-top: 32px;">Appraisers must ensure that client data is protected and not exposed through third-party tools. If that cannot be guaranteed, the tool should not be used.</p>
3694
3695      <p style="margin-top: 32px;">We built Appraisal Bureau with this responsibility in mind. Our infrastructure supports secure, compliant workflows so that client data remains protected and handled with care at every step.</p>
3696
3697      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Documentation is No Longer Optional</h2>
3698
3699      <p style="margin-top: 16px;">Another key takeaway from AO-41 is the importance of record keeping.</p>
3700
3701      <p style="margin-top: 32px;">When technology is used in developing an appraisal, appraisers must retain sufficient documentation to show what data was used, how outputs were generated, and how those outputs informed their conclusions.</p>
3702
3703      <p style="margin-top: 32px;">This is part of producing credible assignment results.</p>
3704
3705      <p style="margin-top: 32px;">Appraisal Bureau embeds this directly into the workflow. Inputs, outputs, and supporting rationale are captured systematically, creating a clear and defensible audit trail aligned with USPAP expectations.</p>
3706
3707      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A Clear Direction for the Industry</h2>
3708
3709      <p style="margin-top: 16px;">AO-41 does not introduce new rules. It clarifies how existing USPAP principles apply in a modern environment.</p>
3710
3711      <p style="margin-top: 32px;">The direction is unmistakable. Technology will play a central role in appraisal practice. Appraisers must remain in control. Credibility, transparency, and judgment are essential.</p>
3712
3713      <p style="margin-top: 32px;">This is the model Appraisal Bureau supports.</p>
3714
3715      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Looking Ahead</h2>
3716
3717      <p style="margin-top: 16px;">As the industry evolves, the firms that succeed will combine modern infrastructure with professional rigor.</p>
3718
3719      <p style="margin-top: 32px;">AO-41 validates this approach.</p>
3720
3721      <p style="margin-top: 32px;">At Appraisal Bureau, we are building a technology-enabled appraisal platform that delivers high-quality, USPAP-compliant valuations at scale, without compromising the standards that define the profession.</p>
3722
3723      <p style="margin-top: 48px;"><a href="https://appraisalfoundation.sharefile.com/share/view/s5f16fbc3ee744cb5aa7cd268e46986ee?skipNativeCheck=true" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;
3723 color: #475569;">Read the full Second Exposure Draft of Advisory Opinion 41 (AO-41) here.</a></p>
3724    `},"inside-the-art-basel-ubs-art-market-report-2026":{title:"Inside The Art Basel & UBS Art Market Report 2026: Here's What Matters",subtitle:"Appraisal Bureau News — Ed. 32",type:"editorial",date:"2026-03-18",category:"Industry Insights",editionLabel:"Appraisal Bureau News",image:"/lovable-uploads/art-basel-ubs-2026.png",content:`
3725
3726
3727
3728      <p style="margin-top: 32px;">The Art Basel & UBS Art Market Report is out, and the takeaway is not that the art market is back. It is that it has changed.</p>
3729
3730      <p style="margin-top: 32px;">Yes, global sales rose 4% to $59.6 billion, marking a return to growth after two years of contraction. But focusing on that headline misses the more important shift underway. This is not a market snapping back into place. It is one recalibrating in real time, and doing so unevenly.</p>
3731
3732      <p style="margin-top: 32px;">"This year's data points to something more consequential than a return to growth. It reflects a sector adjusting to new economic realities, refining its models, and strengthening its foundations for the long term," notes Art Basel's CEO, Noah Horowitz, in the report's forward.</p>
3733
3734      <p style="margin-top: 32px;">This is not a comeback. It is a reset.</p>
3735
3736      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A narrower kind of growth</h2>
3737
3738      <p style="margin-top: 16px;">The clearest signal is where the growth is coming from. The rebound is being driven decisively at the top end, with public auction sales rising 9% and the strongest activity concentrated in works priced above $10 million.</p>
3739
3740      <p style="margin-top: 32px;">Capital is still active, but it is increasingly concentrated, flowing toward the most established artists and the most recognizable names. By contrast, dealer sales rose just 2%, and private sales declined by 5%, reinforcing the sense that momentum is not evenly distributed.</p>
3741
3742      <p style="margin-top: 32px;">At the same time, the cost of doing business continues to rise. Dealer operating costs increased by an average of 5%, with the sharpest gains in shipping and logistics, art fairs, and travel. Margins are tightening at the exact moment the market is becoming more selective.</p>
3743
3744      <p style="margin-top: 32px;">The result is a market that is technically expanding, but structurally narrowing. Strength at the top is masking pressure in the middle.</p>
3745
3746      <p style="margin-top: 32px;">At the same time, one of the dominant narratives of the past several years is beginning to unwind. The idea that the art market had permanently shifted online no longer holds. Online sales have retreated to 15% of total market value, their lowest level since 2019, while art fairs now account for 35% of dealer sales.</p>
3747
3748      <p style="margin-top: 32px;">This is less a reversal than a clarification. At the highest levels of the market, relationships, trust, and physical experience remain central to how transactions happen. Technology has not disappeared, but it has settled into a supporting role.</p>
3749
3750      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">AI as infrastructure, not marketplace</h2>
3751
3752      <p style="margin-top: 16px;">Artificial intelligence is identified in the report as a broader driver of global economic growth, alongside easing monetary policy and continued innovation. Within the art market, however, its impact remains largely infrastructural. It is beginning to influence how data is organized, analyzed, and applied, improving efficiency and supporting more informed decision-making, rather than reshaping how transactions occur.</p>
3753
3754      <p style="margin-top: 32px;">The report also points to increasing regulatory attention around AI in art. From August 2026, galleries, auction houses, and platforms will be required to clearly label artworks that have been artificially generated or manipulated, addressing concerns around authorship and misattribution. At the same time, artists are gaining stronger rights to prevent their work from being used in AI training, and in many jurisdictions, purely AI-generated 
3754works may not qualify for full copyright protection, with implications for value and resale.</p>
3755
3756      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A more complex global backdrop</h2>
3757
3758      <p style="margin-top: 16px;">Overlaying all of this is a more complex and increasingly restrictive global backdrop. Geopolitics is no longer a distant context but an active force shaping the flow of art.</p>
3759
3760      <p style="margin-top: 32px;">The United States, United Kingdom, and China continue to dominate, accounting for 76% of global sales, but cross-border trade remains below pre-pandemic levels. In the U.S., imports are down significantly from 2019 levels, and exports have also declined.</p>
3761
3762      <p style="margin-top: 32px;">Tariffs, regulatory friction, and shifting trade policies are making it more difficult to move artworks internationally. For a market that has long depended on the seamless movement of objects and capital, this introduces a new kind of constraint.</p>
3763
3764      <p style="margin-top: 32px;">The global art market is not disappearing, but it is becoming more fragmented, more regional, and more operationally complex.</p>
3765
3766      <p style="margin-top: 32px;">Looking forward, the most consequential shift may not yet be fully visible in the data. More than $80 trillion in wealth is expected to transfer between generations in the coming decades. That transition is already beginning to influence collecting behavior, with younger buyers approaching the market in a more research-driven and values-oriented way.</p>
3767
3768      <p style="margin-top: 32px;">Taken together, the picture that emerges is not one of simple recovery. It is a market stabilizing under new conditions. It is more concentrated, more selective, and more disciplined than it has been in recent years.</p>
3769
3770      <p style="margin-top: 32px;">What looked like a temporary slowdown now appears, in hindsight, to have been a turning point.</p>
3771
3772      <p style="margin-top: 48px;"><a href="https://theartmarket.artbasel.com/" target="_blank" rel="noopener noreferrer" style="text-decoration: underline; color: #475569;">Read the full Art Basel & UBS Art Market Report here.</a></p>
3773    `},"brazil-art-market-european-influence":{title:"Brazil's Art Market: European Influence, Institutional Identity, and Contemporary Momentum",subtitle:"Appraisal Bureau Editorial",type:"editorial",date:"2026-03-01",category:"Industry Insights",image:"/lovable-uploads/lygia-clark-composicao.jpg",creditLine:"Lygia Clark, Composição, 1953, Coleção MAM São Paulo",content:`
3774      <p><strong>Brazil's art history is inseparable from Europe — yet distinctly its own.</strong></p>
3775
3776      <p style="margin-top: 32px;">From the colonial period through modernism and into today's contemporary market, Brazilian artists have navigated a persistent dialogue between European influence and local identity. That tension continues to shape both institutional collections and the commercial ecosystem.</p>
3777
3778      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Colonial Foundations and European Academic Training</h2>
3779
3780      <p style="margin-top: 16px;">Brazil's formal artistic institutions were established under Portuguese rule, and for much of the 18th and 19th centuries, artistic production aligned with European academic standards.</p>
3781
3782      <p style="margin-top: 32px;">The founding of the Imperial Academy of Fine Arts in Rio de Janeiro in 1816 — influenced by the French Artistic Mission — formalized European academic aesthetics in Brazil. Many early Brazilian artists trained in Paris or Rome, absorbing classical techniques and compositional traditions.</p>
3783
3784      <p style="margin-top: 32px;">Even as national identity began to emerge as a theme, European standards remained the benchmark for legitimacy and institutional recognition.</p>
3785
3786      <p style="margin-top: 32px;">These early structures shaped how Brazilian art was documented, categorized, and historically validated — systems that continue to influence valuation frameworks today.</p>
3787
3788      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Modernism: Integration Rather Than Rejection</h2>
3789
3790      <p style="margin-top: 16px;">Brazilian modernism in the early 20th century did not reject Europe — it reinterpreted it.</p>
3791
3792      <p style="margin-top: 32px;">The 1922 Week of Modern Art in São Paulo marked a turning point. Artists such as Tarsila do Amaral and Anita Malfatti drew heavily from European avant-garde movements — Cubism, Surrealism, Expressionism — while incorporating Brazilian subject matter, folklore, and landscape.</p>
3793
3794      <p style="margin-top: 32px;">Many leading figures studied or lived in Paris. Their careers reflect a pattern that continues today: Brazilian artists engage internationally while maintaining strong local narratives.</p>
3795
3796      <p style="margin-top: 32px;">European influence did not disappear. It became embedded within Brazil's own artistic language.</p>
3797
3798      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Postwar Abstraction and Global Dialogue</h2>
3799
3800      <p style="margin-top: 16px;">By the mid-20th century, movements such as Concrete and Neo-Concrete art positioned Brazil within global abstraction discourse.</p>
3801
3802      <p style="margin-top: 32px;">Artists like Lygia Clark and Hélio Oiticica participated in conversations shaping international contemporary practice. Brazil was no longer peripheral — it was contributing to the evolution of global art movements.</p>
3803
3804      <p style="margin-top: 32px;">Yet institutional validation often continued to pass through Europe and the United States, reinfor
3804cing cross-border market dynamics that still define the contemporary landscape.</p>
3805
3806      <div style="margin-top: 48px; margin-bottom: 48px;">
3807        <img src="/lovable-uploads/helio-oiticica-metaesquema.jpg" alt="Hélio Oiticica, Metaesquema, 1958" style="width: 100%; height: auto;" />
3808        <p style="text-align: center; font-style: italic; font-size: 12px; color: #94a3b8; margin-top: 8px;">Hélio Oiticica, Metaesquema, 1958, Coleção MAM São Paulo</p>
3809      </div>
3810
3811      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">The Contemporary Landscape: Local Strength, International Circulation</h2>
3812
3813      <p style="margin-top: 16px;">Today, São Paulo serves as the primary commercial and institutional center of Brazil's art market. Brazilian artists regularly exhibit in European institutions, participate in international fairs, and maintain representation abroad.</p>
3814
3815      <p style="margin-top: 32px;">Market pricing frequently reflects global comparables, and demand often circulates between Brazil, Europe, and the United States.</p>
3816
3817      <p style="margin-top: 32px;">Within this ecosystem, galleries play a critical role in connecting local production to international platforms.</p>
3818
3819      <p style="margin-top: 32px;"><a href="https://gomideco.com.br/en/" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">Gomide & Co</a>, based in São Paulo, is one such example. The gallery represents historically significant and contemporary artists while actively engaging with international institutions and collectors. Its programming reflects Brazil's dual identity — rooted in national history yet operating within a global contemporary framework.</p>
3820
3821      <p style="margin-top: 32px;">This interplay between local depth and international integration defines the structure of Brazil's art market today.</p>
3822
3823      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A Market Defined by Cross-Border Dynamics</h2>
3824
3825      <p style="margin-top: 16px;">The Brazilian art market is characterized by:</p>
3826
3827      <ul style="margin-top: 16px; margin-left: 24px; list-style-type: disc;">
3828        <li style="margin-top: 8px;">Strong institutional programming</li>
3829        <li style="margin-top: 8px;">International gallery participation</li>
3830        <li style="margin-top: 8px;">Euro- and dollar-denominated comparables</li>
3831        <li style="margin-top: 8px;">Currency sensitivity</li>
3832        <li style="margin-top: 8px;">Cross-border collector engagement</li>
3833      </ul>
3834
3835      <p style="margin-top: 32px;">For collectors, corporations, and institutions, this creates a nuanced valuation environment.</p>
3836
3837      <p style="margin-top: 32px;">Comparables may originate in European auctions. Liquidity may depend on international demand. Insurance values may reflect replacement costs outside Brazil.</p>
3838
3839      <p style="margin-top: 32px;">Brazilian art operates within a global system — even when rooted locally.</p>
3840
3841      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Stewardship in a Global Context</h2>
3842
3843      <p style="margin-top: 16px;">Brazil's art ecosystem has matured into a structurally sophisticated market, deeply integrated with Europe and the broader international art infrastructure.</p>
3844
3845      <p style="margin-top: 32px;">For collection stewards, this has practical implications:</p>
3846
3847      <ul style="margin-top: 16px; margin-left: 24px; list-style-type: disc;">
3848        <li style="margin-top: 8px;">Cross-border exhibition loans</li>
3849        <li style="margin-top: 8px;">Insurance documentation aligned with international standards</li>
3850        <li style="margin-top: 8px;">Valuations that consider both local and global comparables</li>
3851        <li style="margin-top: 8px;">Estate planning for multinational families</li>
3852        <li style="margin-top: 8px;">Portfolio management across currencies</li>
3853      </ul>
3854
3855      <p style="margin-top: 32px;">Brazilian art is not isolated. It exists within an interconnected global framework — historically shaped by Europe and still influenced by it today.</p>
3856
3857      <p style="margin-top: 32px;">Understanding that structural relationship is essential to responsible collection stewardship.</p>
3858    `},"time-well-spent-julia-stoschek-collection-los-angeles":{title:"Time Well Spent — The Julia Stoschek Collection Brings Video Art into Focus in Los Angeles",subtitle:"On the evolving significance and quiet power of video art",date:"2026-02-27",category:"Industry Insights",image:"/lovable-uploads/julia-stoschek-la.webp",creditLine:"Julia Stoschek Collection, Los Angeles. Photo courtesy LA Times",content:`
3859      <p><strong>The arrival of the Julia Stoschek Collection in Los Angeles this week marks a meaningful expansion of the city's engagement with time-based media. Known for its rigorous focus on video and performance-based works, the collection brings a curatorial clarity that feels both disciplined and quietly ambitious.</strong></p>
3860
3861      <p style="margin-top: 32px;">What stands out immediately is the intentionality of the exhibition design. The pacing between works, the use of space, and the careful calibration of light and sound create an environment that encourages sustained attention—something increasingly rare in contemporary viewing contexts. Rather than overwhelming the viewer, the exhibition unfolds with restraint, allowing each piece to assert its own rhythm.</p>
3862
3863      <p style="margin-top: 32px;">The exhibition brings together a compelling range of artists working at the forefront of video as a primary medium. Works by Ed Atkins, Arthur Jafa, and Wu Tsang anchor the presentation, each offering distinct approaches to image-making, narrative, and emotional register. Atkins' digitally rendered figures lean into existential unease and hyper-mediated identity, while Jafa's work carries a visceral, almost cinematic intensity that collapses personal and collective histories. Tsang, by contrast, introduces a more fluid and poetic sensibility, blurring boundaries between performance, language, and moving image.</p>
3864
3865      <p style="margin-top: 32px;">Across these works, there is a notable confidence in duration, narrative fragmentation, and emotional ambiguity. Several pieces lean into slowness and repetition, rewarding patience and reinforcing the idea that value in video art often emerges over time, not instantaneously. This temporal demand feels particularly resonant in Los Angeles, a city built on moving image yet often oriented toward speed and consumption.</p>
3866
3867      <p style="margin-top: 32px;">There is also a strong sense of institutional maturity. The exhibition does not attempt to over-explain or over-contextualize. Instead, it trusts the viewer—positioning the audience not as passive consumers, but as active participants in meaning-making. This curatorial stance aligns with a broader shift in how serious collections are presenting time-based media: less didactic, more experiential.</p>
3868
3869      <p style="margin-top: 32px;">For Los Angeles, the presence of the Julia Stoschek Collection feels especially relevant. As a city deeply tied to film, production, and image culture, LA has long had an implicit relationship to video—yet exhibitions like this make that c
3869onnection explicit, reframing video art not as adjacent to cinema, but as a critical and independent form within contemporary practice.</p>
3870
3871      <p style="margin-top: 32px;">Overall, the exhibition is a compelling reminder that video art, when presented with care and conviction, can command the same depth of engagement—and market relevance—as more traditional forms. It signals not just a moment for Los Angeles, but a continued maturation of time-based media within the broader art ecosystem.</p>
3872    `},"beyond-data-auction-results":{title:"Beyond Data: Auction Results Tell Only Part of the Story",subtitle:"Appraisal Bureau News — Ed. 31",type:"editorial",date:"2026-02-19",category:"Industry Insights",image:"/lovable-uploads/josh-kline-productivity-gains.jpg",creditLine:"Josh Kline, Productivity Gains (Brandon/Accountant), 2016, Solomon R. Guggenheim Museum, © Josh Kline",content:`
3873      <p><strong>Unprecedented access to auction data has transformed the art market over the past three decades. The proliferation of databases, analytic tools, and sector reports has made it easier than ever for collectors to identify the latest hammer price for a work that interests them.</strong></p>
3874
3875      <p style="margin-top: 32px;">Yet to treat auction results as the primary valuation tool is to misunderstand how most of the art market actually functions.</p>
3876
3877      <p style="margin-top: 32px;">Auctions are highly visible, but they account for only a minority share of total art market transactions — with much of the market occurring through private channels, galleries, and other direct relationships that never appear in aggregated auction databases. According to the Art Basel & UBS Art Market Report 2025, private sales conducted by auction houses rose 14% year-on-year to approximately $4.4 billion, while public auction sales fell by around 25% over the same period. The majority of the market transacts outside the public auction room entirely.</p>
3878
3879      <p style="margin-top: 32px;">Auction data also reflects a very specific type of transaction: works resold publicly, often under competitive pressure and during moments of heightened liquidity. Results are shaped by timing, marketing budgets, guarantees, third-party bidding arrangements, and broader economic sentiment. A single outlier result — unusually high or low — can distort perceptions of an artist's market for years.</p>
3880
3881      <p style="margin-top: 32px;">Auction houses primarily handle artists with established secondary markets. Emerging artists, whose markets are built through galleries, are often absent from these datasets. This omission matters. The Art Basel & UBS report notes that 50% of fine art dealers operate exclusively in the primary market, with a further 41% active in both primary and secondary markets.</p>
3882
3883
3884
3885
3886      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Beyond the Public Record</h2>
3887
3888      <p style="margin-top: 16px;">One way to understand the limits of auction data is to look at artists whose institutional presence far outweighs their public resale record.</p>
3889
3890      <p style="margin-top: 32px;">Josh Kline, whose work is held by the Whitney Museum of American Art, Museum of Modern Art, Solomon R. Guggenheim Museum and The Metropolitan Museum of Art, has had only 12 works appear at auction, and only three in the past three years. His highest realized auction price is $37,500. Yet his primary-market retail activity is significantly stronger, and in 2024 he joined Lisson Gallery — one of the most important international galleries. The public auction record captures only a narrow snapshot of his market.</p>
3891
3892      <p style="margin-top: 32px;">A similar pattern appears with Lauren Halsey and Woody De Othello — both widely collected by major museums and both with limited auction histories that underrepresent their broader market activity.</p>
3893
3894      <p style="margin-top: 32px;">In each case, auction data reflects occasional resale activity, not the fuller context in which value is being built.</p>
3895
3896      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Data as Disruptor</h2>
3897
3898      <p style="margin-top: 16px;">The dominance of auction data, however, is not accidental. When Artnet launched its auction price database in 1990, it fundamentally reshaped the industry. As Melanie Gerlis observed last summer, the ability to aggregate historic price data coincided with — and helped fuel — the rise of art as an investment category. For the first time, an opaque market could be charted, graphed, and compared. A generation of advisors, lenders, and funds built the
3898ir models around these numbers.</p>
3899
3900      <p style="margin-top: 32px;">But what was disruptive in 1990 is less defensible in 2026.</p>
3901
3902      <p style="margin-top: 32px;">Public auction data was never comprehensive — it captured only resales — yet it was treated as a sufficiently reliable proxy for the broader market. Today, when individual auction prices can be surfaced instantly through search engines and increasingly synthesised by AI tools into compelling narratives, aggregation alone is no longer differentiation. Information is abundant. Context is scarce.</p>
3903
3904      <p style="margin-top: 32px;">Meanwhile, the market itself has become more fragmented. Works are transacted privately, through galleries, advisory channels, private auctions, online platforms, and increasingly through networks that leave little public trace. Pooling auction results with gallery data does not necessarily account for how value is built over time.</p>
3905
3906      <p style="margin-top: 32px;">Primary market sales operate in entirely different conditions. Galleries carefully place works with collectors and institutions, maintaining pricing strategies designed to support long-term value rather than short-term spectacle. These transactions are future-looking. Institutional validation and upcoming exhibitions do influence future price growth. At the same time, conversations around the forthcoming "great wealth transfer" suggest that collecting tastes may shift radically from past patterns.</p>
3907
3908      <p style="margin-top: 32px;">Understanding these forces before works reach the auction room is increasingly crucial.</p>
3909
3910      <p style="margin-top: 32px;">The growth of data has undoubtedly reduced opacity. But public data has not produced a universally reliable formula for valuation. In a market where far more than half of transactions are private and information is increasingly flattened by AI tools, meaningful valuation depends not on visibility — but on context.</p>
3911    `},"sothebys-buyers-premium-2026":{title:"Sotheby's Adjusts Buyer's Premiums—Again. What It Signals for the Auction Market",subtitle:"Appraisal Bureau News — Ed. 30",date:"2026-02-18",category:"Industry Insights",content:`
3912      <p>Sotheby's has revised its buyer's premium structure globally, increasing the top-end of its lowest pricing tier from 27% to 28% on works hammering up to $2 million in New York. The mid-tier remains at 22% but now applies to works between $2 million and $8 million, while the 15% rate on works above $8 million is unchanged. The adjustment closely tracks Christie's September 2025 increase to 27% on works up to $1.5 million, suggesting renewed alignment among major houses after a period of experimentation.</p>
3913
3914      <p style="margin-top: 24px;">This move is particularly notable given Sotheby's short-lived 2024 attempt to implement a simplified flat 20% buyer's premium (with 10% on works over $6 million), offset by higher consignor fees. That restructuring, designed to create pricing clarity and shift revenue toward sellers, was reversed within a year after proving unattractive to consignors. The current return to a tiered system—and the modest upward pressure on lower-tier fees—signals that auction houses remain highly sensitive to seller psychology while leaning on consistent demand at lower price points.</p>
3915
3916      <p style="margin-top: 24px;">Phillips, by contrast, has taken a different approach, offering reduced buyer's fees to bidders who place binding written bids at least 48 hours before a sale—an incentive model rather than a straight percentage increase. Across the board, however, the direction is clear: fee revenue is being carefully optimized as auction houses navigate a softer global market. For collectors, insurers, and lenders, these shifts matter—not simply as transaction costs, but as components of total acquisition value that influence insured value, financing thresholds, and long-term portfolio strategy.</p>
3917    `},"art-valuations-2026-predictions":{title:"Art Valuations in 2026, Five Predictions for the Year Ahead",subtitle:"Ap
3917praisal Bureau News — Ed. 30",type:"editorial",date:"2026-01-20",category:"Industry Insights",image:"/lovable-uploads/geometric-abstract-bg.jpg",content:`
3918      <p><strong>As 2025 came to a close, much of the art market was left reflecting on a year that felt, for many, like a holding pattern. There was no dramatic collapse, but rising costs, softening values, and persistent talk of "corrections" weighed on confidence and activity alike.</strong></p>
3919
3920      <p style="margin-top: 32px;">By contrast, 2026 is being met with renewed optimism. For valuations in particular, that optimism appears well placed. As the market continues to professionalize, transparency is no longer a peripheral ideal but a structural expectation — not only around price, but around how artworks are tracked, valued, and understood as financial assets over time.</p>
3921
3922      <p style="margin-top: 32px;">Advances in technology are beginning to connect information that has historically lived in silos, creating a clearer, more current picture of collections and the risks attached to them.</p>
3923
3924      <p style="margin-top: 32px;">Below are five of our predictions for the year ahead.</p>
3925
3926      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">1. Transparency will become a competitive advantage</h2>
3927
3928      <p style="margin-top: 16px;">For decades, opacity has been an accepted feature of the art market. In 2026, it will increasingly be seen as a liability. Collectors, advisors, lenders, and insurers alike are placing greater value on clarity: where an artwork is, how it is valued, how often that valuation is updated, and what data underpins it.</p>
3929
3930      <p style="margin-top: 32px;">Rather than relying on fragmented records or static reports, stakeholders are moving toward systems that offer a clearer, more current view of collections as active assets. Transparency will not eliminate subjectivity, but it will raise the baseline of accountability.</p>
3931
3932      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">2. Location and movement will become part of valuation transparency</h2>
3933
3934      <p style="margin-top: 16px;">In 2026, valuation will increasingly account for more than price alone. Where an artwork is located, how it moves, and how that information is maintained will become central to how risk is assessed.</p>
3935
3936      <p style="margin-top: 32px;">Technologies enabling real-time visibility into artwork locations already exist. What has been missing is integration — the ability for that data to feed directly into valuations and onward into regulated insurance and financial markets.</p>
3937
3938      <p style="margin-top: 32px;">That gap is now closing. As location intelligence becomes embedded in valuation workflows, insurers and financial stakeholders will gain a more current, defensible view of risk. This will enable more efficient capital deployment and shift the market away from static disclosures toward living, continuously updated records.</p>
3939
3940      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">3. Digital pricing intelligence will improve as estimates narrow</h2>
3941
3942      <p style="margin-top: 16px;">The growing availability and reliability of online pricing intelligence will continue to influence how estimates are formed and defended. Historically, wide estimate spreads reflected both volatility and the inherent subjectivity of appraisals. As data quality improves and analytical tools mature, those ranges are likely to tighten for works and artists with sufficient transactional depth.</p>
3943
3944      <p style="margin-top: 32px;">In 2026, valuations will increasingly reflect live market conditions rather than lagging benchmarks or infrequent updates. As transactional data, market signals, and generative technologies are better combined, pricing will respond more dynamically to demand, particularly for artists with active secondary markets. This does not signal the end of expert judgment, but rather its evolution, supported by deeper, more current evidence.</p>
3945
3946      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">4. Financialization will demand precision, not just opinion</h2>
3947
3948      <p style="margin-top: 16px;">As art continues to be used more actively in financial contexts—whether for lending, guarantees, estate planning, or structured ownership—valuation standards will continue to rise.</p>
3949
3950      <p style="margin-top: 32px;">Lenders, insurers, and regulators are no longer satisfied with valuations that cannot be clearly explained, documented, and revisited. In 2026, defensibility will matter as much as the number itself. This will drive demand for valuations that are more frequent, more transparent in methodology, and more closely aligned with practices seen in other asset classes.</p>
3951
3952      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">
39525. Efficiency will separate infrastructure from noise</h2>
3953
3954      <p style="margin-top: 16px;">Digital tools are now embedded across the art world, but the sheer number of platforms has created new friction. In the year ahead, value will increasingly accrue to integrated infrastructure rather than isolated point solutions.</p>
3955
3956      <p style="margin-top: 32px;">Systems that reduce duplication, centralize information, and allow data to flow seamlessly between valuation, collection management, and risk assessment will become essential, not optional. Efficiency, in this context, is not about speed alone, but about coherence.</p>
3957
3958      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Looking ahead</h2>
3959
3960      <p style="margin-top: 16px;">If 2025 was about resilience, 2026 will be about refinement. The art market is not becoming less complex, but it is becoming more accountable.</p>
3961
3962      <p style="margin-top: 32px;">As transparency extends beyond pricing to include how artworks are tracked, valued, and contextualized within broader financial systems, valuations will increasingly support more efficient capital allocation and broader market participation. This evolution does not diminish expertise — it strengthens it, grounding judgment in clearer, more complete information.</p>
3963    `},"miami-abu-dhabi-market-2025":{title:"From Miami to Abu Dhabi, Fresh Access Redefines a Revived Market",subtitle:"Monthly Editorial",type:"editorial",date:"2025-12-12",category:"Industry Insights",content:`
3964      <p><strong>This December is already a pivotal month for the art market, with Abu Dhabi and Miami emerging as focal points for dialogue around new waves of collecting. While the two cities operate in different cultural and commercial ecosystems, together they signal a broader transformation: the infusion of fresh capital and new ways of working in the buying and experiencing of art.</strong></p>
3965
3966      <p style="margin-top: 32px;"><strong>Art Basel Miami Beach 2025</strong> [December 5-7] underscored how technology and digital engagement are reshaping the collector experience. The fair's new digital-art section, <strong>Zero 10</strong>, sponsored by NFT marketplace OpenSea, aimed to attract crypto-native buyers and encourage appreciation of digital works among traditional buyers. As Artnet's Naomi Rea observes, this is part of a wider market recalibration, one where galleries and fairs are no longer solely catering to "old money" collectors aligned with legacy institutions. Instead, they are designing experiences for a younger, digitally fluent audience ready to invest across both physical and virtual categories. CNBC also reported on strong attendance and sales during the run of the fair.</p>
3967
3968      <div style="text-align: center; margin-top: 32px; margin-bottom: 32px;">
3969        <img src="/lovable-uploads/ABMB22THUMB.jpg" alt="Art Basel Miami Beach 2025" style="max-width: 100%; width: 100%; height: auto; margin: 0 auto; display: block;" />
3970      </div>
3971
3972      <p style="margin-top: 32px;"><strong>Abu Dhabi</strong>, by contrast, showcased the appeal of spectacle and luxury as conduits for attracting new collector wealth. <strong>Sotheby's</strong> inaugural Collectors Week [December 2-5] on Saadiyat Island reported $133 million in sales across jewelery, handbags, cars, and real estate, underlining a robust appetite for high-end assets. While no art was sold in the main auctions, the event included exhibitions such as the "Icons" show, which brought together around $500 million worth of works previously sold by the auction house, including Banksy's self-shredding <em>Girl with Balloon</em>, along with a program of talks and masterclasses.</p>
3973
3974      <p style="margin-top: 32px;">The strategic timing alongside the Abu Dhabi Grand Prix and the opening of the Zayed National Museum reflected the emirate's broader ambitions to position itself on the global cultural stage.</p>
3975
3976      <div style="text-align: center; margin-top: 32px; margin-bottom: 32px;">
3977        <img src="/lovable-uploads/Sothebys-Collector-Week-Abu-Dhabi-1.webp" alt="Sotheby's Collectors Week Abu Dhabi" style="max-width: 100%; width: 100%; height: auto; margin: 0 auto; display: block;" />
3978      </div>
3979
3980      <p style="margin-top: 32px;">Both moments in the calendar demonstrate an art market evolving to meet collectors where they are, digitally, socially, and experientially, with experiments in hybrid sales models, cross-category events, and educational programming evident from both galleries and Sotheby's retail-forward strategy. Today, attracting new collectors is not just about selling art but about creating experiences, building understanding, and leveraging technology to forge meaningful, personalized connections to works.</p>
3981
3982      <p style="margin-top: 32px;">The importance of balancing innovation with long-term cultural infrastru
3982cture also comes through. Miami's <strong>Pérez Art Museum</strong>, <strong>Rubell Museum</strong>, <strong>ICA Miami</strong>, and the thriving <strong>Wynwood Arts District</strong> have become internationally recognized art destinations, supported by Art Basel's presence in the city since 2002.</p>
3983
3984      <p style="margin-top: 32px;">Abu Dhabi's $6 billion investment into its cultural quarter, including the newly opened <strong>Zayed National Museum</strong>, the <strong>Louvre Abu Dhabi</strong>, and a <strong>Guggenheim</strong> due to open next year is no small sidenote.</p>
3985
3986      <p style="margin-top: 32px;">And the stakes are high. Looking back, Art Basel Miami Beach 2024 is reported to have generated $547 million in economic activity for the region, with more than 286 galleries from 38 countries in attendance, and 2025 was forecast to bring in $565 million. No doubt with comparable aspirations, Abu Dhabi's sovereign wealth fund invested $1 billion into Sotheby's in 2024.</p>
3987
3988      <p style="margin-top: 32px;">Glamour and sun aside, behind the sparkle and celebrations, strong sales and clear signals showed the art market's evolution in action.</p>
3989    `},"art-market-history-single-owner-sales":{title:"Art (Market) History, Single-Owner Sales Win Big",subtitle:"Appraisal Bureau News — Ed. 28",type:"editorial",date:"2025-11-24",category:"Industry Insights",content:`
3990      <p><strong>This fall's marquee auctions arrived in a market still finding its footing. With pricing cooling and global trade conditions in flux, all eyes turned to New York's sales for a sense of direction, and single-owner sales delivered.</strong></p>
3991
3992      <p style="margin-top: 32px;">Single-owner collection sales have always held a certain magnetism and ability to lift the narrative and allure of artworks. At <strong>Sotheby's</strong> on November 18, the white-glove evening sale of <strong>Leonard Lauder's</strong> collection totaled $527.5 million (including fees), driving the evening to $706 million overall. Its centerpiece, <strong>Gustav Klimt's</strong> <em>Bildnis Elisabeth Lederer</em>, realized $236.4 million, the highest price for any modern artwork sold at auction and a record for the artist.</p>
3993
3994      <div style="text-align: center; margin-top: 32px; margin-bottom: 32px;">
3995        <img src="/lovable-uploads/klimt-elisabeth-lederer.jpg" alt="Gustav Klimt, Bildnis of Elisabeth Lederer, 1914-1915" style="max-width: 400px; width: 100%; height: auto; margin: 0 auto; display: block;" />
3996        <p style="margin-top: 12px; font-style: italic; color: #64748b; font-size: 14px;">Gustav Klimt, Bildnis of Elisabeth Lederer, 1914-1915. Photo: courtesy of Sotheby's New York</p>
3997      </div>
3998
3999      <p style="margin-top: 32px;">Across town, <strong>Christie's</strong> 21st Century evening sale achieved $123.6 million, with 19 works from the <strong>Stefan Edlis</strong> and <strong>Gael Neeson</strong> collection outperforming expectations to reach $49.2 million. <strong>Warhol's</strong> <em>The Last Supper</em> led those lots at $8.1 million, coming in just above its high estimate.</p>
4000
4001      <p style="margin-top: 32px;">These weren't just successful sales. They were reminders of what happens when a collection has been thoughtfully built and passed along with intention. Stewardship isn't paperwork. It's the long arc of decisions that give a collection cohesion and identity—decisions that echo years or even decades later.</p>
4002
4003      <div style="text-align: center; margin-top: 32px; margin-bottom: 32px;">
4004        <img src="/lovable-uploads/warhol-last-supper.png" alt="Andy Warhol, The Last Supper, 1986" style="max-width: 500px; width: 100%; height: auto; margin: 0 auto; display: block;" />
4005        <p style="margin-top: 12px; font-style: italic; color: #64748b; font-size: 14px;">Andy Warhol, The Last Supper, 1986. Photo: courtesy of Christie's New York</p>
4006      </div>
4007
4008      <p style="margin-top: 32px;">And that arc now matters more than ever.</p>
4009
4010      <p style="margin-top: 32px;">The industry is navigating a new, structurally significant shift: the generational wealth transfer. The 17th edition of the <strong>
4010<a href="https://www.deloitte.com/lu/en/services/financial-advisory/research/art-finance-report.html" target="_blank" rel="noopener noreferrer" style="color: #1F1AB9; text-decoration: underline;">Deloitte Private Art and Finance Conference</a></strong> earlier this month revealed new data suggesting almost $31 trillion will shift hands, including an estimated $1 trillion of art and collectibles shifting ownership. As <strong>Forbes</strong> concisely articulated: "If it's all disorganized, or some of it has been invested in a niche market, this could be a real challenge for wealth managers."</p>
4011
4012      <p style="margin-top: 32px;">This shift isn't theoretical, it's already happening. Quietly, privately, and at a scale the art market has never experienced before. And here's the hard truth the industry is finally saying out loud: Most collections aren't ready for this transfer. Not because the art isn't good—because the information around it isn't. The stories haven't been recorded, archives aren't centralized (or don't exist at all) and valuations are outdated. Without preparation, stewardship can dissolve in a single generation.</p>
4013
4014      <p style="margin-top: 32px;">So how can families and advisors stay ahead? As estates become more complex and tastes evolve, robust documentation, clear provenance, and centralized records are no longer optional—they are strategic imperatives. They're what enable smooth transfers, informed estate planning, and the preservation of value over time.</p>
4015
4016      <p style="margin-top: 32px;">Tastes may change and markets may move, but one constant remains: clarity and current valuations are essential when a collection is about to change hands.</p>
4017    `},"automating-trillion-dollar-shift-art-wealth":{title:"Automating the Trillion-Dollar Shift in Art Wealth",subtitle:"Appraisal Bureau News Ed. 27",date:"2025-11-04",category:"Industry Insights",image:"/lovable-uploads/tech-circuit-arrows.jpg",content:`
4018      <p><strong>Automation is redefining how art philanthropy works.</strong></p>
4019
4020      <p style="margin-top: 32px;">The art world is entering a new era—one defined by transparency, participation, and efficiency. As Millennials and Gen Z emerge as the next generation of collectors and donors, expectations for how giving should work are fundamentally changing. This is a generation that values measurable impact over prestige, clarity over opacity, and digital tools over legacy paperwork.</p>
4021
4022      <p style="margin-top: 32px;">That shift is happening against a historic backdrop. According to the <strong><a href="https://www.deloitte.com/lu/en/services/financial-advisory/research/art-finance-report.html" target="_blank" rel="noopener noreferrer" style="color: #1F1AB9; text-decoration: underline;">2025 Deloitte Private and ArtTactic Art & Finance Report</a></strong>, nearly $1 trillion in art and collectibles is expected to change hands over the next decade, as a massive global wealth transfer reshapes the art and finance ecosystem. As markets stagnate and collector values evolve, the report notes that transparency, inclusivity, and purpose are emerging as the defining priorities for this new generation of wealth holders.</p>
4023
4024      <p style="margin-top: 32px;">Together, these forces are re-engineering how art is valued, managed, and—critically—given.</p>
4025
4026      <p style="margin-top: 32px;">In <strong>Art Basel's</strong> recent article <strong><a href="https://www.artbasel.com/stories/philanthropy-millennials-gen-z?lang=en" target="_blank" rel="noopener noreferrer" style="color: #1F1AB9; text-decoration: underline;">"Why millennials and Gen Z are rewriting the rules of arts philanthropy,"</a></strong> journalist <strong>Anny Shaw</strong> captures this cultural pivot: younger patrons want to see the results of their giving, not just have their names on a plaque. That demand for accountability is reshaping how the art ecosystem—from museums to marketplaces—approaches philanthropy.</p>
4027
4028      <p style="margin-top: 32px;">But one of the greatest friction points in cultural giving has remained untouched: the appraisal process.</p>
4029
4030      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">The Hidden Bottleneck in Art Philanthropy</h2>
4031
4032      <p style="margin-top: 16px;">Donating art to a museum or nonprofit has long been a bureaucratic ordeal. Each gift requires a qualified appraisal, IRS Form 8283, donor and donee signatures, and compliant documentation—all of which often take weeks and thousands of dollars in professional time to complete. Even for experienced collectors and curators, the process is opaque, paper-heavy, and error-prone. For smaller museums and donors, it can be outright prohibitive.</p>
4033
4034      <p style="margin-top: 32px;">That administrative burden has quietly limited participation in one of the most important forms of cultural philanthropy: the donation of art itself.</p>
4035
4036      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">
4036Automation as Infrastructure for Giving</h2>
4037
4038      <p style="margin-top: 16px;"><strong>Appraisal Bureau</strong> has launched Non-Cash Charitable Donation Appraisals on our platform, eliminating this friction through full automation. From an artwork's portfolio page, donors can now:</p>
4039
4040      <ul style="margin-top: 16px; margin-left: 24px; list-style-type: disc;">
4041        <li style="margin-top: 8px;">Generate a USPAP-compliant appraisal and IRS Form 8283 automatically</li>
4042        <li style="margin-top: 8px;">Invite donees to sign digitally via DocuSign integration</li>
4043        <li style="margin-top: 8px;">Track and archive every signature and submission in a secure audit trail</li>
4044        <li style="margin-top: 8px;">Download finalized, tax-ready PDFs—within minutes, not weeks</li>
4045      </ul>
4046
4047      <p style="margin-top: 32px;">This is more than streamlining paperwork. It is a re-architecture of the philanthropic pipeline itself—where compliance, transparency, and participation are built into the software layer.</p>
4048
4049      <p style="margin-top: 32px;">By reducing a multi-week process to a few clicks, Appraisal Bureau opens access to a new category of donors—those who want to give art, but don't have the administrative infrastru
4049cture to navigate the old system. The result: museums receive donations faster, collectors generate documentation instantly, and philanthropy becomes scalable.</p>
4050
4051      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">A System Shift</h2>
4052
4053      <p style="margin-top: 16px;">Automation in this context doesn't remove expertise—it multiplies its impact. Every automated appraisal follows the same compliance rigor as a manually produced report, but at a fraction of the time and cost. This is how digital infrastructure unlocks social infrastructure: by making participation efficient, not exclusive.</p>
4054
4055      <p style="margin-top: 32px;">In an era where the <strong>American Alliance of Museums</strong> reports that many U.S. museums face stagnant or declining donor bases, efficiency isn't a luxury—it's a lifeline. By transforming donation appraisals from bespoke paperwork into a standardized workflow, Appraisal Bureau is enabling the next wave of cultural giving: one defined by accountability, access, and scale.</p>
4056
4057      <h2 style="font-size: 24px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">From Complexity to Clarity</h2>
4058
4059      <p style="margin-top: 16px;">The next chapter of art philanthropy won't be written in spreadsheets or PDF attachments—it will be powered by automation.</p>
4060    `},"tax-bill-tech-fair-valuations":{title:"That Big Beautiful Tax Bill & Tech's Role in Fair Valuations for the Donation Ecosystem",subtitle:"Appraisal Bureau News Ed. 25",date:"2025-07-24",category:"Industry Insights",image:"/lovable-uploads/paper-stack-tax-bill.jpg",content:`
4061      <p>New tax policy changes will affect how charitable art donations are treated under U.S. tax law. Starting in 2026, taxpayers who itemize deductions will only be able to deduct charitable contributions that exceed 0.5% of their adjusted gross income (AGI)—a newly introduced floor that disqualifies smaller donations from deduction eligibility. For those in the top income bracket, the tax benefit of itemized deductions—including charitable contributions—will be capped at 35%, rather than the full 37% previously aligned with their marginal tax rate.</p>
4062
4063      <p style="margin-top: 32px;">These changes reflect a broader push for fairness and consistency in the tax system—particularly in areas vulnerable to subjective or biased assessments. While not directly aimed at the art market, they spotlight a long-standing issue within it: the lack of transparent and neutral valuation standards. This moment presents an opportunity to advance more defensible appraisal practices that benefit all stakeholders—including donors, museums, artists, and the public.</p>
4064
4065      <p style="margin-top: 32px;">These changes were introduced as part of a broader tax package by President Trump and Republican lawmakers, commonly referred to as the <strong>'One Big Beautiful Bill.'</strong> The sweeping legislation includes reforms to Social Security taxes, food benefits, and state and local tax deductions (commonly known as SALT), and also reshapes how charitable contributions—such as art donations—are treated for tax purposes.</p>
4066
4067      <p style="margin-top: 32px;">The idea that some art donors have used overly generous or biased appraisals to claim deductions far beyond the true value of their contributions is supported by evidence. Unlike publicly traded assets such as stocks or real estate, art has historically lacked a universally accepted pricing mechanism. Valuations depend on factors such as market demand, provenance, rarity, and—until recently—subjective human opinion. Compounding the issue is the long-standing industry practice in which appraisers often also act as dealers, introducing inherent conflicts of interest. This complexity has long left space for inconsistency and potential abuse.</p>
4068
4069      <p style="margin-top: 32px;">In 2023, for example, the <strong>Internal Revenue Service</strong> announced that 60 audits related to art donations uncovered $5 million in tax adjustments due to improper valuations.</p>
4070
4071      <p style="margin-top: 32px;">Neutral, data-driven appraisal systems eliminate these issues, providing clarity and protecting the integrity of both donations and the institutions that depend on them. Museums, particularly smaller institutions, often rely on such donations to expand their collections and increase public access to art. Approximately 150,000 artworks are donated annually in the U.S. alone. By championing transparent and defensible valuations, the art community can continue to nurture these relationships and ensure that donations remain an attractive, trusted option for collectors.</p>
4072
4073      <p style="margin-top: 32px;">Technology is already driving progress in this area. <strong>Appraisal Bureau's</strong> AI-supported model, for example, leverages historical auction results, private sales data, market trends, and macroeconomic factors to deliver objective, evidence-based assessments. This technology removes conflict by eliminating 'opinionated' valuations that open the door to compromised appraisals. Widespread adoption of such tools reinforce trust, encourage continued philanthropy, and strengthen the overall ecosystem.</p>
4074
4075      <p style="margin-top: 32px;">The art world has long thrived on a delicate balance of public and private support. While tax policies may prompt short-term volatility, a system built on trust and transparency offers the best path to sustaining this equilibrium.</p>
4076    `},"museum-exchange-conversation":{title:"A Conversation with Michael Darling, Co-Founder, Museum Exchange",subt
4076itle:"March 31, 2023",date:"2023-03-31",category:"Best Practices",content:`
4077      <p>As the valuation partner of <strong>Museum Exchange</strong>, the first digital art platform for art donations, <strong>Appraisal Bureau</strong> specializes in the appraisals necessary for philanthropic giving and art collection legacy planning. We've highlighted key components of best practices, filing for a tax deduction, and sat down with <strong>Michael Darling</strong>, Co-Founder of Museum Exchange, to discuss the tools their platform uniquely offers patrons and museums alike.</p>
4078
4079      <div style="text-align: center; margin-top: 32px; margin-bottom: 32px;">
4080        <img src="/lovable-uploads/michael-darling.jpg" alt="Michael Darling, Co-Founder, Museum Exchange" style="max-width: 200px; width: 100%; height: auto; margin: 0 auto; display: block;" />
4081        <p style="margin-top: 12px; font-style: italic; color: #64748b; font-size: 14px;">Michael Darling, Co-Founder, Museum Exchange. Photo by Maria Ponce.</p>
4082      </div>
4083
4084      <p style="margin-top: 32px;"><strong>Can you tell us how Museum Exchange came about and how you came to be involved?</strong></p>
4085
4086      <p style="margin-top: 16px;">The idea [of the exchange] was a Covid baby really. The co-founders had been exploring ways to improve the functioning of the art world and brought the idea of a model in which donors and their works were matched with museums and suitable collections, through an online platform.</p>
4087
4088      <p style="margin-top: 16px;">When we first spoke, I'd been working at the <strong>Museum of Contemporary Art Chicago</strong> for about 10 years and the idea resonated with some of the challenges I'd been coming up against within curatorial roles. There's a real challenge in deciding which donations to accept - is it the right artist, the right work, the right time for the collection? You have to be conscious of the relationship with the art market, with many keen to legitimize the work (and price) of a work by placing it in an institution. There's a lot of overconsumption and production and the beauty of this platform is that it metabolizes this.</p>
4089
4090      <p style="margin-top: 32px;"><strong>So, you joined the team in 2021 and you've been actively developing the network and catalogue of works available for donation, since. What sort of impact can you see the platform having?</strong></p>
4091
4092      <p style="margin-top: 16px;">Well, in two years we've placed more than 500 pieces, with about a 70% success rate. And what's exciting is the breadth and range of institutions and not-for-profit organizations we are seeing sign up, including regional collections, university holdings and libraries. It's really opening up opportunities for works to be placed and for a greater diversity of artists to be represented. When we recently visited the expanded <strong>Museum of Contemporary Art San Diego</strong>, they had three works on view that came from Museum Exchange-one of which was an early work by African American sculptor, <strong>Richard Hunt</strong>. It is rewarding to have a role in placing a greater representation of artists in key collections.</p>
4093
4094      <p style="margin-top: 16px;">On a pragmatic level, it's also really benefitting museums, which tend to be resource and time-strapped, with a process that can be slow and complex. We centralize the process and can link them up with specialists, like Appraisal Bureau, to help move things forward smoothly. Museums can browse the recent catalogues every three months and pay an annual subscription once getting successful donations, and the fee is based on their operative turnover. Donors pay fees once there's a successful match.</p>
4095
4096      <p style="margin-top: 16px;">There's also a lot of data and information being gathered, which is fascinating - I don't think anyone was systematically logging the relationship between donors and museums before.</p>
4097
4098      <p style="margin-top: 32px;"><strong>That's a lot of objects in two years. Is this a sign that the art world is finally embracing the digital, and shaking up some of its oldest processes?</strong></p>
4099
4100      <p style="margin-top: 16px;">There's certainly growing confidence throughout the market, both on the donor and museum side, in seeing and making decisions over digital reproductions of works rather than 
4100in person. Nevertheless, there's still a lot of analog in the process (of donating artworks), and digital platforms tend to be used more as a means to jumpstart the process.</p>
4101
4102      <p style="margin-top: 32px;"><strong>So, there's no risk of undermining the value of a relationship between donor and institution by digitizing the process?</strong></p>
4103
4104      <p style="margin-top: 16px;">No, it's still very relationship orientated, the systems may be quicker but, ultimately, the decisions are based on the (pretty slow moving) pace of human relations.</p>
4105
4106      <p style="margin-top: 32px;"><strong>What's next for Museum Exchange?</strong></p>
4107
4108      <p style="margin-top: 16px;">We definitely want to grow but we recognize that the main motivator for donors in North America and Canada (where Museum Exchange works from) is tax, so that baseline condition has to exist in the places we work. In terms of expansion then, it's more with an eye towards the genre and age of the artworks we register, moving beyond Modern and Contemporary.</p>
4109
4110      <h3 style="font-size: 20px; font-weight: bold; margin-top: 48px; margin-bottom: 16px;">Charitable Donation Appraisals</h3>
4111
4112      <p style="margin-top: 16px;">There are many nuances in the donation appraisal process - the IRS Form 8283 is an art unto itself. We've highlighted some key points of Charitable Donation appraisals below, and we are always available to answer further questions.</p>
4113
4114      <ul style="margin-top: 16px; margin-left: 24px; list-style-type: disc;">
4115        <li style="margin-top: 8px;">A Qualified Appraisal and Form 8283 are required for donations over $5,000.</li>
4116        <li style="margin-top: 8px;">The Appraisal may be issued no more than 60 days ahead of the transfer of property, or anytime after, up until the donor's tax filing deadline.</li>
4117        <li style="margin-top: 8px;">Charitable Donation appraisals rely on Fair Market Value.</li>
4118      </ul>
4119    `},"digital-art-mainstream-market":{title:"Digital Art Finds Its Place in the Mainstream Market",subtitle:"Appraisal Bureau News Ed. 26",date:"2025-10-15",category:"Industry Insights",content:`
4120      <p><strong>Christie's</strong> recent decision to fold its dedicated digital art department into its broader operations has reignited conversation among art market commentators. For some, it marks not a retreat, but a reflection of how seamlessly digital art has become part of the wider art ecosystem.</p>
4121
4122      <p style="margin-top: 32px;">The excitement that surrounded digital art in 2021 marked a defining moment for the medium. <strong>Beeple's</strong> <em>Everydays: The First 5000 Days</em>, which sold at Christie's for $69.3 million, propelled digital creation and ownership into the heart of art market discourse. That period of exploration and experimentation helped establish the foundation for today's more mature, integrated digital art market.</p>
4123
4124      <p style="margin-top: 32px;">As with any emerging market, the initial surge of speculative activity gave way to a period of stabilization. By 2024, trading volumes in art NFTs had normalized under $200 million, as institutions like <strong>Sotheby's</strong> and <strong>Christie's</strong> evolved their models—integrating digital works into broader contemporary categories. In practice, this represents not decline, but the normalization of digital art as a recognized collecting category.</p>
4125
4126      <p style="margin-top: 32px;">Importantly, this transition is not a sign of digital art's weakness, but of its endurance. Christie's has reiterated its ongoing commitment to presenting digital works as part of its core contemporary offerings—an acknowledgment that digital art now stands on equal footing with other mediums.</p>
4127
4128      <div style="text-align: center; margin-top: 40px; margin-bottom: 40px;">
4129        <img src="/lovable-uploads/cryptopunk-5358.avif" alt="CryptoPunk #5358" style="max-width: 400px; width: 100%; height: auto; margin: 0 auto; display: block;" />
4130        <p style="margin-top: 12px; font-style: italic; color: #64748b; font-size: 14px;">CryptoPunk #5358, one of 10,000 in the iconic NFT collection created by Larva Labs in 2017.</p>
4131      </div>
4132
4133      <p style="margin-top: 32px;">Indeed, this broader realignment positions NFTs and A.I.-generated 
4133works not as novelties, but as established forms within the continuum of art history—sharing space with painting, sculpture, and photography. As <strong>LiveArt</strong> aptly noted in a recent post (picked up by <strong>Artnet</strong>), 'Congrats to NFTs on graduating from "digital collectible" to "serious art that belongs in a museum."'</p>
4134
4135      <p style="margin-top: 32px;">This trajectory mirrors the evolution of other once-segregated collecting categories. For instance, in 2017 Sotheby's folded contemporary Latin American works into its main contemporary sales — a move that signals how these works are regarded alongside global post-war and contemporary art.</p>
4136
4137      <p style="margin-top: 32px;">Digital art may generate fewer speculative headlines today, but that steadiness signals something more important: longevity. Its integration into the mainstream market may prove to be the most meaningful milestone yet—solidifying its legitimacy and establishing a durable foundation for continued innovation and growth.</p>
4138    `},"fractionalized-ownership-art":{title:"Breaking down Fractionalized Ownership of Art",subtitle:"",date:"2024-12-10",category:"Industry Insights",image:"/lovable-uploads/gold-coin-tree.jpg",content:`
4139      <h2 style="font-size: 24px; font-weight: bold; margin-top: 32px; margin-bottom: 16px;">Fractionalized Ownership of Art: Benefits and Insights</h2>
4140      
4141      <p>There has been a proliferation of new platforms and vehicles offering fractional ownership in recent years, but the concept of multiple owners of a work of art is not new. Since the late 2000s, models have been growing in numbers, while broader dialogue and appreciation of art as an investment has accelerated.</p>
4142
4143      <h3 style="font-size: 20px; font-weight: bold; margin-top: 32px; margin-bottom: 16px;">What are the benefits of Fractional Ownership?</h3>
4144
4145      <h4 style="font-size: 18px; font-weight: bold; margin-top: 32px; margin-bottom: 12px;">A way to increase access and bring new collectors to the market</h4>
4146
4147      <p style="margin-top: 16px;">Fractional ownership fundamentally offers access to owning blue-chip artworks, which has historically been challenging in a market that closely controls who owns what. "We are seeing a huge influx of people and institutions entering this investment space," says <strong>Rebecca Fine</strong>, a founder of <strong>Athena Art Finance</strong>, whose parent company, fintech platform <strong>Yieldstreet</strong>, offers access to investments in highly vetted diversified collections of blue-chip modern and contemporary artworks. "Investors who aren't already invested in art have massive appetite for exposure to blue-chip art because of its strong performance, historically low correlation to the stock market and as a hedge against inflation." With investments as low as $15,000 investors get access to art collections worth many, many millions of dollars.</p>
4148
4149      <h4 style="font-size: 18px; font-weight: bold; margin-top: 32px; margin-bottom: 12px;">A more transparent way of working</h4>
4150
4151      <p style="margin-top: 16px;">This is not just about returns on investment but about access to a market which has traditionally been a closed network of participants. An open, more transparent ownership model, adjoined with the fact that many of the new models perform in FCA and SEC regulatory systems, is reassuring to many investors. Where Blockchain is being used to secure and exchange assets, there may also be an additional opportunity for transparency.</p>
4152
4153      <h4 style="font-size: 18px; font-weight: bold; margin-top: 32px; margin-bottom: 12px;">A flexible way of diversifying assets</h4>
4154
4155      <p style="margin-top: 16px;">In addition to being able to enjoy ownership in an asset which may typically be out of reach, fractional ownership also offers investors a means to spread their interests more widely across numerous markets. Flexibility and the ease with which shares can be liquidated may vary, but on a fundamental level it is likely to be easier than shifting an entire Warhol at short notice. Choosing the right artworks is key to the success of the investment. "To maximize returns, we acquire only exceptional examples of each artist's most iconic imagery, from the most important period of their careers." According to Fine, investment decisions are heavily informed by Athena's lending experience and proprietary data analytics. Yieldstreet obtains independent third-party appraisals before they acquire each artwork to ensure they are buying at or below fair market value.</p>
4156
4157      <p style="margin-top: 32px;">As always, not all funds are created equal. The track record of the platform or investment manager is crucial as the art market speaks a different language than financial markets. Yieldstreet, which plans to launch its fifth diversified Art Equity Fund later this summer, reports a weighted average growth of more than 25% since acquisition of the artworks, based on year end independent third-party appraisals.</p>
4158    `},"independent-appraisers-case":{title:"The Case for Independent Personal Property Appraisers",subtitle:"",date:"2024-12-15",category:"Best Practices",image:"/lovable-uploads/open-grass-field.jpg",content:`
4159      <p>The field of independent appraising exists to provide a neutral and unbiased opinion of value. The use cases include insurance, collateral loan, charitable donation (IRS income tax deduction) - the appraisal is the basis for the underlying financial liability or obligation. Qualified Appraisers adhere to the ethics and standards put forth in the <strong>Uniform Standards of Professional Appraisal Practice</strong>, which is adopted by Congress and the IRS. USPAP is governed by <strong>The Appraisal Foundation</strong>, an independent organization established in 1987 by the US government that receives federal funding and is empowered by Congress to establish standards for the appraisal field. Appraisers are further trained by centralized organizations such as the <strong>Appraisers Association of America</strong>, who require continuing education and renewal of USPAP training every two years to retain one's standing. There is no 'license' to be an appraiser, but rather one must be compliant to relevant governing bodies. The status of 'Accredited' or 'Certified' applies to the field of one's expertise, for example, I am Certified in Post-War, Contemporary and Emerging Art at the Appraiser's Association of America. The appraiser's credentials and experience within a specific field is mandatory to support the validation of the appraisal.</p>
4160      
4161      <p style="margin-top: 32px;">With limited regulation in the art world, it is crucial to understand if an appraiser has interest in or bias to appraised property. From a high level it is very straightforward, auction houses are in the auction business and are motivated by consignments. A dealer has interest in sales and the market for particular artists. Lenders profit from interest rates on money loaned against collateral property. If an organization has established a valuation on an object of art, has financial interest on the loan against it, and further stake on what the property may sell for, it is very hard to see where ethical lines are drawn.</p>
4162      
4163      <p style="margin-top: 32px;">In addition to conflicts of interest on business services, the label of 'appraisal' or 'valuation' may be mistakenly applied to estimates of value that are not compliant to USPAP. For example, if a gallery issues an insurance appraisal of $1,000,000 USD for a painting recently sold to a client, are they reporting their prior sales activity with the property to comply with the USPAP three year disclosure rule, which states the appraiser must disclose any services regarding the subject property, not limited to appraising it? Probably not. If the insurance value of the painting is more than the transacted amount in the sale of the property, what is used for evidentiary support of the valuation that excludes the gallery's interest in that particular market?</p>
4164      
4165      <p style="margin-top: 32px;">The case of <strong>Estate of Kollsman vs Commissioner</strong> in 2019 illustrates the potential risk of auction house appraisals. A US tax court rejected an appraisal written by a major auction house on the basis of bias and lack of objective evidence. The client then sought out an additional appraisal meeting USPAP standards to rectify the situation.</p>
4166      
4167      <p style="margin-top: 32px;">Centralized, neutral data and reporting is the keystone for responsible and compliant management of personal property assets. <strong>Appraisal Bureau</strong> is built on this foundational core value as our practice is strictly limited to data analysis and valuation. We do not participate in sales, advisory or consulting of any kind. In addition to our industry credentials, our proprietary technology further supports human expertise and opinion. Our appraisal co-pilot of machine learning and centralized algorithms measures and reconciles activities across various markets and verifies artworks, allowing us to reduce days of work to a few seconds. We will continue to report on our technology developments, stay tuned to AB Editorial.</p>
4168    `},"history-digital-art":{title:"On (Some of) the History of Digital Art: Origins, the Cybernetic Spirit, and Changing Viewership",subtitle:"By Sophie Cianfarani, Appraisal Intern, Appraisal Bureau",date:"2025-01-05",category:"Industry Insights",image:"/lovable-uploads/cybernetics-tower.webp",content:`
4169      <p>Art historians hold varied views on the origins of digital art. Roboticists might trace its inception to antiquity, viewing early robots as digital art's forebears. Some locate digital art's origin in the 19th century with the jacquard loom's punch card system, an automated system of control that greatly influenced early computer development. In this exploration, I begin with the mid-20th century––an era distinguished by funding for te
4169chnological advancements because of the Second World War.</p>
4170      
4171      <p style="margin-top: 32px;">World War II resulted in technological developments and catalyzed discourses around Information Theory, Artificial Intelligence, Communication Theory, and Systems Theory (Charlie Gere, "Cybernetic Era," in Digital Culture). Cybernetics, derived from the Greek word "kybernētēs," meaning steersman, was a term coined by mathematician <strong>Norbert Wiener</strong> in the mid-1940s. Cybernetics is the science of control and communication. Cybernetics considers communication as a system in which a living being or machine imparts a message onto another living being or machine, which returns a message related to the input, or original message (Norbert Wiener, "Cybernetics in History"). The cybernetic framework laid the foundation for responsive, reactive art that responds to its environment.</p>
4172      
4173      <p style="margin-top: 32px;"><strong>Nicholas Schöffer's</strong> Cybernetic Tower, St. Cloud, 1955 is an early example of an artist's embrace of cybernetics. This tower produced various colored lights and musical sounds based on environmental data such as wind, noise and light levels, and humidity. The tower's musical compositions and light displays on color projectors were all influenced by environmental conditions. Unlike mechanical devices, where the range of possible outcomes is predetermined, the feedback of cybernetic machines depends on the machine's environment, making the work more responsive. Artist <strong>Roy Ascott</strong>, in his book <em>Telematic Embrace: Visionary Theories of Art, Technology, and Consciousness</em>, recognized that modern art, even without directly creating cybernetic systems, embodies the essence of cybernetics by embracing the unpredictable nature of outcomes.</p>
4174      
4175      <p style="margin-top: 32px;"><strong>Kenneth Knowlton</strong> and <strong>Leon Harmon</strong>, two engineers at Bell Laboratories with access to new technologies, created a series of images in 1966 called <em>Studies in Perception</em>. <em>Computer Nude</em> was an image within this series that began with a photo negative of the choreographer <strong>Deborah Hay</strong>. The negative was scanned using BEFLIX (a computer animation language created by Knowlton), converting the image into a series of small pixels with varying gray levels (Zabet Paterson, Peripheral Vision: Bell Labs, the S-C 4020, and the Origins of Computer Art). From up close, the work is only pixels, from afar the image could be taken in as a whole, thus depending on the viewer to investigate different forms of the work by changing their position.</p>
4176      
4177      <p style="margin-top: 32px;"><strong>Harold Cohen's</strong> 1973 work, <em>AARON</em>, is a computer program that uses artificial intelligence to perpetually generate new creations. AARON is considered a collaborative tool for human-made art, as it was designed with the purpose of exploring the formal elements of drawing and painting. Programmed in 1973, AARON continues to produce new works, reaching no final form.</p>
4178      
4179      <p style="margin-top: 32px;">Expanded cinema in the 1980s and 1990s gave viewers a participatory role in cinema, allowing viewers to interact with the screen and change the narrative. Similarly, Internet artists of the 1990s created works with branching narratives in which viewers had the agency to choose the way they interact with a piece. Many artists used the interface of the internet to allude to the body's interface, skin; <strong>Mariela Yeregui's</strong> 1998 work, <em>Epithelia</em>, for instance, uses the internet as a material to explore the concept of the body and constructs a network of references to bodies that users explore through text, pictures, videos, and hyperlinks.</p>
4180      
4181      <p style="margin-top: 32px;">In the 21st century, digital art continues to grow, yet challenges present themselves when preserving works of digital media, such as documentation efforts and the migration of hardware and software into newer platforms. It c
4181an also be difficult to establish the authenticity of a digital work, yet non-fungible tokens present digital artists with a sales mechanism that offers a trackable lineage of ownership (though it remains important to consider the material consequences of blockchain technologies and to engage with energy efficient processes of data verification). Like early cybernetic artists, digital artists continue to recontextualize new technologies. <strong>Rafael Lozano-Hemmer's</strong> 2019 work <em>Remote Pulse</em>, for instance, uses biometric technologies used for surveillance to enable a work that allows a user on each side of the U.S./Mexico border to feel each other's heartbeat.</p>
4182      
4183      <p style="margin-top: 32px;">In line with the legacy of cybernetics, the final form of digital art is often unpredictable, and, in some cases, as seen in Cohen's AARON or Lozano-Hemmer's Remote Pulse, achieving a definitive final form is not the goal. However, this unpredictability is not unique to digital art alone; it is a characteristic shared by art across various media. Computer Nude echoes the aesthetics of pointillism paintings that continuously evolve based on the viewer's position. Further, works from centuries ago are not exactly as they were originally, as painting pigments change over time and materials wear down. Digital media provides a unique opportunity for artists and viewers to actively participate in shaping an artwork's evolution.</p>
4184      
4185      <p style="margin-top: 32px; font-style: italic;"><strong>Sophie Cianfarani</strong> is a recent graduate of Cornell University, earning a degree in the History of Art. She joins Appraisal Bureau as an Appraisal Intern with previous experience working for curatorial and art advisory firms, as well as Cornell's Mui Ho Fine Arts Library.</p>
4186    `},"irs-form-8283-guide":{title:"IRS Form 8283: Requirements for Donating Art and Non-Cash Assets",date:"2025-01-10",image:"/lovable-uploads/irs-form-graphic.jpg",content:`
4187      <p>When fine art is donated to museums, everyone wins. Museums acquire new artwork, the donor receives a tax deduction, and the artist benefits from the prestigious institutional destination of the work (also a safe haven from the art markets). The US is privileged to have this system that has helped build the collections of many of the world's best museums.</p>
4188      
4189      <p style="margin-top: 32px;">But, there is always the opportunity for abuse. As such the IRS has a specific set of protocols one must follow to receive tax benefits for artworks valued more than $5,000.</p>
4190      
4191      <p style="margin-top: 32px;"><strong>Qualified Appraisal and Qualified Appraiser</strong></p>
4192      
4193      <p style="margin-top: 32px;">The IRS defines a Qualified Appraisal as a document that meets a strict set of standards and is issued by a Qualified Appraiser. The appraisal must meet the relevant qualifications of Regulations section 1.170A-17(A), be issued no more than 60 days before the date of property transfer, and not involve any prohibitive fees.</p>
4194      
4195      <p style="margin-top: 32px;">The Qualified Appraisal must be compliant to the <strong>Uniform Standards of Professional Appraisal Practice (USPAP)</strong> and the Appraiser must meet requirements including designation from a recognized professional appraisal association relevant to the subject property, such as the <strong>Appraiser's Association of America</strong>. There are additional restrictions around who may issue the appraisal, for example if the appraiser was party to the transaction in which the donor acquired the artwork being donated. If the donor acquired a painting from an art dealer, neither the dealer nor any employees of the dealer are qualified to write the appraisal.</p>
4196      
4197      <p style="margin-top: 32px;">A full list of requirements, restrictions and penalties is <a href="https://www.irs.gov/publications/p561" target="_blank" rel="noopener noreferrer" className="text-[#1F1AB9] underline">here</a>.</p>
4198      
4199      <p style="margin-top: 32px;"><strong>Form 8283</strong></p>
4200      
4201      <p style="margin-top: 32px;">The Form 8283, which accompanies the appraisal, must be signed and acknowledged by both the Qualified Appraiser who issued the appraisal, and the donee. The donee must also confirm on the 8283 that the artwork qualifies as related use property consistent with the mission of the institution. For example, the artwork is used as an artwork in a public art collection relevant to the donated property. A separate 8283 must be filed for each medium of artwork donated. If a collection of sculptures, paintings and photographs are donated to a museum, the appraisal would require three 8283s.</p>
4202      
4203      <p style="margin-top: 32px;">If the donee sells or otherwise disposes of the property within three years after the date of transfer, the donee must file a Form 8282 notifying the IRS. In this case, if more than $5,000 is profited on the sale, an IRS audit may be triggered and the donor may lose the original tax deduction. The use rule will also come back into play as the IRS will examine what the property was used for, and why it was sold. In order to further prevent abuse, the donor must have owned the donated property for more than one year prior to donation in order to receive a deduction with an appreciated value over the original acquisition cost. If donated within one year, the appraised value is limited to the lesser of Fair Market Value or cost.</p>
4204      
4205      <p style="margin-top: 32px;">The IRS regularly updates the requirements and restrictions of Noncash Charitable Donations. It is crucial to hire a Qualified Appraiser with no bias or interest in the property to ensure a smooth tax filing.</p>
4206    `},"neutral-valuations-divorce":{title:"Case Study: Neutral Valuations in Equitable Distribution",subtitle:"Ap
4206praisal Bureau News",date:"2025-01-20",category:"Best Practices",image:"/lovable-uploads/courtroom-gavel.jpg",content:`
4207      <p><strong>Appraisal Bureau</strong> was recently retained by a major international law firm to value Fine Art jointly owned by a couple seeking division of assets in divorce proceedings.</p>
4208      
4209      <p style="margin-top: 32px;">The collection of more than 500 artworks, holding significant material value, was originally appraised by a major auction house. The judge presiding over the case requested the mid range of the auction estimate to be used for the official valuation. Generally, artworks consigned to auction are given a low and a high estimate, which is a strategic range relevant to the auction, and not necessarily an indication of Fair Market Value. For example, a low estimate significantly below Fair Market Value for desirable property attracts buyers to place bids in hopes of a good deal. Top quality artworks often sell for well above their high estimate, and after bidding is finalized the auction house adds a buyer's premium which starts at approximately 25%. To that end, the hammer estimate without premium has little correlation to true Fair Market Value. Furthermore, the auction estimate reflects secondary market consideration only, and would not necessarily support primary market data.</p>
4210      
4211      <p style="margin-top: 32px;">Without knowledge of the previous auction house appraisal, Appraisal Bureau was hired first to value a selection of the art collection. With a neutral survey of both primary and secondary markets, Appraisal Bureau's report came in significantly higher than the auction house report. A second report of additional artworks showed the same results. In a market of little to no regulation, access to complete data and neutrality are crucial.</p>
4212    `},"artnews-ai-valuation":{title:"Press: ARTnews: AI Art Valuation Companies Think They Can Give Market Players an Edge",subtitle:"Appraisal Bureau News",date:"2025-02-01",category:"Industry Insights",content:`
4213      <p><strong>ArtNews</strong> recently published an article exploring how the art appraisal industry is evolving in response to new technology, shifting market needs, and increasing demand for transparency. The piece covers a range of perspectives on the current state of appraisals — from traditional methods to emerging digital platforms.</p>
4214      
4215      <p style="margin-top: 32px;"><strong>Appraisal Bureau</strong> was featured in the article, highlighting our founding principals of neutrality and transparency.</p>
4216      
4217      <p style="margin-top: 32px;">Read the full article <a href="https://www.artnews.com/art-news/market/ai-art-valuations-tech-companies-market-1234714997/" target="_blank" rel="noopener noreferrer" style="color: #1F1AB9; text-decoration: underline;">here</a>.</p>
4218    `},"artist-fabricator-relationships":{title:"Fabricating solid relationships: An interview with art lawyer, Yayoi Shionoiri",subtitle:"Art lawyer, Yayoi Shionoiri, speaks to art market journalist Riah Pryor, about the complex relationship between artists and fabricators",date:"2025-02-15",category:"Best Practices",image:"/lovable-uploads/sculpture-outdoor.jpg",content:`
4219      <p style="margin-top: 32px;"><strong>You've been working with artists for years on many issues, including on the relationship between artists and fabricators. Has this always been an area of interest for you, or is it an issue you feel is of increasing importance?</strong></p>
4220      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4221      
4222      <p>Both. The relationship between artists and the production of their works has been a consideration of the Western art trade for years; the challenges that have surfaced, for example, with certain Degas editions, confirm the significance of understanding the relationship between artists and those fabricating their works-both in the artists' lifetime and posthumously.</p>
4223      
4224      <p style="margin-top: 32px;">There remains a growing need to appreciate the nuances surrounding these relationships, in part, be
4224cause they are often bespoke, and, in part, because the nature, process and materials of artwork are varied and continue to evolve.</p>
4225      
4226      <p style="margin-top: 32px;"><strong>What are the fundamental issues we're touching on here then?</strong></p>
4227      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4228      
4229      <p>The intellectual property of the artwork and the physical ownership of the fabricated property, where both inherently belong to the artist, regardless of how large a role the fabricator plays in its physical realization – or possibly with technological advances – digital realization.</p>
4230      
4231      <p style="margin-top: 32px;"><strong>That seems quite straightforward, in the sense that the artist is commissioning a fabricator to deliver services. But, often with art installations you can see that the so-called 'fabricators', or technicians, have actually played quite a key role in the development of the artwork itself. Some of these technicians might consider themselves artists or creative professionals in their own right.</strong></p>
4232      
4233      <p style="margin-top: 32px;"><strong>So how are we delineating between 'fabricator' and 'collaborator'? And would the latter have a 'right' to the work?</strong></p>
4234      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4235      
4236      <p>These situations come up more recently when there is a group of experts that contribute specific skills to an overall project or artwork. While the final artwork is by the artist, there are a growing number of instances where the artist credits the creative contributions of others who were involved in bringing their vision to life, whether producing elements or sourcing materials. That doesn't change the artist's copyright ownership in and property ownership of the artwork, but it does go further to recognise the more collaborative artistic processes we often see today.</p>
4237      
4238      <p style="margin-top: 32px;"><strong>So where can it go wrong?</strong></p>
4239      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4240      
4241      <p>Where clarity of roles and communication falls short. And this is not as unusual as you'd think, particularly given that artists often work through their ideas as a process, rather than engage fabricators with clearly delineated roles from the outset.</p>
4242      
4243      <p style="margin-top: 32px;">I have also found that some art forms, notably sculpture, can pose more challenges than mediums with preconceived formats and methods, such as printing, because of the varied output possible with sculpture that guides the complexities of the arrangement.</p>
4244      
4245      <p style="margin-top: 32px;"><strong>I guess the next question then, is how can artists ensure it doesn't go wrong?</strong></p>
4246      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4247      
4248      <p>As ever, contracts are key, including, for example, measures for the return of moulds to an artist upon their notice to the fabricator, or to trigger a discussion with the estate upon the artist's passing on next steps for those moulds, and the outlining of artist intent, to support the completion of an edition of works, in the event that numbered copies within an edition take time to be produced.</p>
4249      
4250      <p style="margin-top: 32px;"><strong>We often hear of the importance of contracts and expanding opportunities to record artwork details on blockchain or advanced platforms, but a lot of the art world still likes to make agreements over a handshake. Is that going to change?</strong></p>
4251      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4252      
4253      <p>It has started to. The take-up of new technology in certain areas of the art world has been impressive and really demonstrates the trade's readiness to speed up efficiency of data collecting. But I'm also conscious that some areas of the art world are taking a bit longer to acclimate.</p>
4254    `},"sothebys-art-backed-bond":{title:"Sotheby's Pitches a Bond Secured by Art Collections and a Museum Plays the Auction Game",subtitle:"Sotheby's announces new backed security, but what is so new about it?",date:"2025-03-01",category:"Industry Insights",image:"/lovable-uploads/sothebys-bond.avif",content:`
4255      <p>With New York's major Modern, Post-war, and Contemporary May sales around the corner, all eyes are on the big-ticket items ready to hit the block, with <strong>Jean-Michel Basquiat</strong> topping the list at both Sotheby's and Christie's. This year, <strong>Sotheby's Financial Services</strong> is pinning a little more on the work of the artist (alongside a selection of other blue-chip names, including Warhol and Rembrandt) thanks to the auction giant's recent announcement of $700m of asset-backed Notes, which closed this week, on April 23.</p>
4256      
4257      <p style="margin-top: 32px;">Those familiar with the art sector's increasing professionalization and financialization will already be comfortable with the concept of loans linked to artworks. So, how does Sotheby's ArtFi Master Trust differ? And what does it signal for the art market more broadly?</p>
4258      
4259      <p style="margin-top: 32px;"><strong>More than a loan</strong></p>
4260      
4261      <p style="margin-top: 32px;">Fundamentally, Sotheby's latest scheme differs from pre-existing art loans (which are offered by several private banks and specialist lenders) because, rather than loaning against art works, it securitizes against loans, which are backed by artworks.</p>
4262      
4263      <p style="margin-top: 32px;">
4263This shifts the level and spread of risk at play. In a traditional art loan, if the borrower fails to make payments, the lender can seize the collateral to recover the borrowed amount. Individuals and businesses often opt for this to gain short-term liquidity while retaining the use of their assets.</p>
4264      
4265      <p style="margin-top: 32px;">Conversely, securitization is a financial process where a variety of debts (including loans) are pooled together and then repackaged into interest-bearing securities which, in turn, are sold to investors. The cash flow from the underlying loans provides the return to the investors (as with mortgages and student loans).</p>
4266      
4267      <p style="margin-top: 32px;">The two models establish different relationship structures, with the latter not just between borrower and lender, but instead introducing investors into the mix.</p>
4268      
4269      <p style="margin-top: 32px;">Of course, the new scheme also introduces familiarities to traditional art loans, with paperwork including the usual disclaimers around the valuation of artworks and with many of the works in question remaining in storage (albeit some specialist art finance firms do allow works to remain on display or go on loan).</p>
4270      
4271      <p style="margin-top: 32px;"><strong>A new financial vehicle for the future</strong></p>
4272      
4273      <p style="margin-top: 32px;">So how will the new approach be received? That the auction house's owner, <strong>Patrick Drahi</strong>, has a significant background in financial packaging has perhaps lessened any 'surprise' over such a move.</p>
4274      
4275      <p style="margin-top: 32px;">To date, interest is there, and the investment appears to be supported by key players in the market, notably Barclays, BNP Paribas and Morgan Stanley, according to the <strong>Financial Times</strong>.</p>
4276      
4277      <p style="margin-top: 32px;">A press release from the auction house stated that 'Morningstar DBRS is expected to rate the four classes of Notes at closing with the senior-most class expected to receive the highly coveted AAA (sf) rating,' adding that 'This highly successful transaction, which saw strong demand from institutional investors resulting in a significant upsize to the transaction, will help further our mission of unlocking the power of our clients' collections through the delivery of innovative financial solutions.'</p>
4278      
4279      <p style="margin-top: 32px;">Perhaps another interesting statement it makes on the market's future direction is the fact that NFTs are reportedly not included within the works available on the scheme.</p>
4280      
4281      <p style="margin-top: 32px;">Institutions are also turning to innovative financial strategies to support both acquisition goals and operational bottom lines. This month, the <strong>Toledo Museum of Art</strong> in Ohio announced that it has been placing guarantees at auction houses as a means to raise income. According to a report from Artnet, the cultural institution has been placing deals on works it has a 'genuine interest' in so if they are outbid, they still generate income, with almost $500k raised this year.</p>
4282      
4283      <p style="margin-top: 32px;">"The beauty of it is that they win either way. They get a work of art they want to buy or they make some money. That's creative thinking. And we just need more and more of that," said <strong>The Museum of Modern Art's Director, Glenn Lowry</strong>, according to the same Artnet article.</p>
4284      
4285      <p style="margin-top: 32px;">Regardless of the long-term success of either Toledo's or Sotheby's latest financial ventures, it is perhaps Lowry's sentiment which signifies the best approach to developing the market's relationship with financial structures going forward.</p>
4286    `},"art-backed-debt-securitization":{title:"How Securitization and Art-Backed Debt Offerings Present New Ways to Invest in the Art Market",subtitle:"CEO of Athena Art Finance, Rebecca Fine, speaks to journalist Riah Pryor about the latest developments in the financialization of art",date:"2025-03-15",category:"Industry Insights",content:`
4287      <p style="margin-top: 32px;"><strong>Since we last spoke, Sotheby's announced a securitization backed by its art loan portfolio. How does it work and how is it 'new'?</strong></p>
4288      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4289      
4290      <p>This is the first securitization of an art loan portfolio, and it is the first time a credit rating agency has rated such a product. Securitization is a way for companies to find new sources of funding and to move assets off their balance sheet (much sooner than waiting for the underlying loans to be repaid). Through a complicated process, involving many parties, a pool of loans is converted into a tradable security, which is divided into tranches of interest-bearing securities with different risk-return properties and different yields. The least risky tranche has the first rights to the income generated by the underlying loans, and the riskiest tranche has the last claim on that income. Bear in mind, <strong>Sotheby's Financial Services'</strong> product is only available to institutional investors at this point.</p>
4291      
4292      <p style="margin-top: 32px;"><strong>What is the significance of all of this for the market more broadly, and what can we expect to happen next?</strong></p>
4293      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4294      
4295      <p>The concept of using art as collateral for a loan is not itself new: several private banks, auction houses and specialty finance companies (including <strong>Athena Art Finance</strong>) have offered lending programs for many decades. But the private banks and auction houses aren't really making pure-play art finance loans (auction houses are trying to drive consignments and banks are lending against their clients' financial portfolios, not their art collections). And regardless of who makes the loans, for the companies that fund the loans, the loans are not very liquid (because lenders have to wait for the borrowers to repay the debt).</p>
4296      
4297      <p style="margin-top: 32px;">
4297However, when art loans receive a rating from a rating agency, such as the case with the Sotheby's Financial Services' securitization, they are deemed suitable investments for institutional investors, like pension funds, endowments, insurance companies, which invest in institutional private debt deals. Dividing the portfolio into tranches, each of which has a different level of risk associated with it, enables investors to buy at different prices. And those tradable securities are much more liquid than the original loans were on Sotheby's balance sheet.</p>
4298      
4299      <p style="margin-top: 32px;"><strong>Do you see the increasing breadth of art-debt investment offerings as a sign that demand is on the rise?</strong></p>
4300      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4301      
4302      <p>Yes, this art-adjacent securitization is attracting a lot of attention outside of the artworld. And demand is high. After announcing, Sotheby's Financial Services upsized the issuance from $500m to $700m. Institutional asset managers who are hungry for new investments are eager to diversify their holdings and art-backed loan portfolios is a novel investment category, and is largely uncorrelated to financial markets, public equities or other traditional asset classes.</p>
4303    `},"art-market-recalibration":{title:"Navigating Value During an Art Market Recalibration",subtitle:"How do you value art during a cooling of the market?",date:"2025-04-01",category:"Industry Insights",content:`
4304      <p>Amid its coverage of the recent sale of over 200 works from the collection of Miami art collector and patron, <strong>Rosa de la Cruz</strong> [Christie's, New York, May 14], <strong>The Art Newspaper</strong> noted the art markets to be 'in the middle of a recalibration.' Indeed, the auction's total of $34.4M, while comfortably within its $25.8M to $37.9M presale estimate, contrasts sharply to the $100m figure the collection was reported to be worth a decade prior (as noted in this Artnet article).</p>
4305      
4306      <p style="margin-top: 32px;">Such moments this season have supported broader debate around whether landmark shifts demonstrate changing buyer tastes (including as part of generational wealth transfer) and the impact of socioeconomic forces. What remains clear is that the nuances and complexities of valuing art are deepened in a cooling market.</p>
4307      
4308      <p style="margin-top: 32px;"><strong>Consistency amongst fluidity</strong></p>
4309      
4310      <p style="margin-top: 32px;">The 'cooling' of a market is generally understood as a decrease in buying activity, lower volumes of transactions, lower prices fetched, and is typically linked to broader economic downturns, shocks (i.e., pandemics or wars) changing tastes, and internal dynamics, such as the over-saturation of certain art categories. In times of inflation, tangible assets like art can become more attractive as a hedge against currency devaluation. Appreciating these multiple factors, and how they interact, is key to informed valuation.</p>
4311      
4312      <p style="margin-top: 32px;">With a downturn in enthusiasm, collectors, investors and appraisers are required to take a more strategic approach. When prices drop or stabilize after a period of rapid growth, liquidity can become an issue. Collectors might hesitate to sell, waiting for a market rebound, while buyers may be more cautious in an attempt to seek lower-risk investments.</p>
4313      
4314      <p style="margin-top: 32px;">In terms of valuations, there are some reliable constants. Provenance and a well-documented lineage may contribute to assurance over the artwork's authenticity and significance. The quality and condition of the artwork also continue their prime position, while works that resonate culturally or emotionally with collectors may similarly maintain value within market fluctuations.</p>
4315      
4316      <p style="margin-top: 32px;">Evaluating the artist's market performance over time is crucial. Artists with a consistent track record of sales, critical acclaim, and representation by reputable galleries are likely to hold their value better during market downtur
4316ns. Analyzing auction records, gallery sales, and the frequency of exhibitions provide insight into an artist's market stability. During a cooling market, emerging artists or those without a substantial market history might well see more significant price fluctuations</p>
4317      
4318      <p style="margin-top: 32px;"><strong>A Closer Look</strong></p>
4319      
4320      <p style="margin-top: 32px;">Leveraging an objective opinion on market dynamics is critical. As a data-driven company, <strong>Appraisal Bureau</strong> exclusively offers valuations and does not participate in sales or transactions, ensuring complete neutrality - an approach that demonstrates the vital need for a growing professionalism and financial infrastructure in the art markets.</p>
4321      
4322      <p style="margin-top: 32px;">And finally, patience may well prove the most valuable asset in a cooling market. Sellers waiting for the right moment to list their artwork to avoid significant losses could well mitigate the risks associated with market volatility. Buyers may take advantage of lower prices and invest in high-quality pieces with the potential for long-term appreciation.</p>
4323    `},"donating-art-guide":{title:"Tell me more about donating art",subtitle:"Technical and regulatory requirements for donating art and tax deductions",date:"2025-04-15",category:"Best Practices",content:`
4324      <p>When fine art is donated to museums, everyone wins. Museums acquire new artwork, the donor receives a tax deduction, and the artist benefits from the prestigious institutional destination of the work (also a safe haven from the art markets). The US is privileged to have this system that has helped build the collections of many of the world's best museums. But, there is always the opportunity for abuse. As such, the IRS has a specific set of protocols one must follow to receive tax benefits for artworks valued more than $5,000.</p>
4325      
4326      <p style="margin-top: 32px;">Here are some of the guidelines regarding charitable donations of artwork:</p>
4327      
4328      <p style="margin-top: 32px;"><strong>Qualified Appraisal and Qualified Appraiser</strong></p>
4329      
4330      <p style="margin-top: 32px;">The IRS defines a Qualified Appraisal as a document that meets a strict set of standards as outlined in Regulations section 1.170A-17(A) and is issued by a Qualified Appraiser. Don't worry — our appraisals meet all of these requirements, and then some. The appraisal must be issued no more than 60 days before the date of property transfer. This is automatically accounted for in our software to ensure you won't accidentally have the artwork appraised too soon.</p>
4331      
4332      <p style="margin-top: 32px;">The Qualified Appraisal must be compliant to the Uniform Standards of Professional Appraisal Practice (USPAP) and the Appraiser must meet requirements including designation from a recognized professional appraisal association relevant to the subject property, such as the Appraiser's Association of America (AAA). Our team of appraisers is always up-to-date on the latest training from the field and maintain the highest credentials from AAA.</p>
4333      
4334      <p style="margin-top: 32px;">We are proud of our neutrality, which means that <strong>Appraisal Bureau</strong> never participates in sales of art or market activity of any kind — going beyond the minimum requirements of USPAP and the IRS to ensure third-party, unconflicted and accurate valuations.</p>
4335      
4336      <p style="margin-top: 32px;"><strong>Form 8283</strong></p>
4337      
4338      <p style="margin-top: 32px;">The Form 8283, which accompanies the appraisal, must be signed by both Appraisal Bureau and the donee institution. The donee must also confirm that the artwork qualifies as "related use property" consistent with the mission of the institution. A tiny but important detail is that a separate 8283 must be filed for each medium of artwork donated. If a collection of sculptures, paintings and photographs are donated to a museum, the appraisal would require three 8283s.</p>
4339      
4340      <p style="margin-top: 32px;">Another noteworthy requirement is that the donor must have owned the donated property for more than one year prior to donation in order to receive a deduction with an appreciated value over the original acquisition cost. If donated within one year, the appraised value is limited to the lesser of Fair Market Value or cost.</p>
4341      
4342      <p style="margin-top: 32px;">If the donee sells or otherwise disposes of the property within three years after the date of transfer, the donee must file a Form 8282 notifying the IRS. In this case, if more than $5,000 is profited on the sale, an IRS audit may be triggered and the donor may lose the original tax deduction. The use rule will also come back into play as the IRS will examine what the property was used for, and why it was sold.</p>
4343      
4344      <p style="margin-top: 32px;">Appraisal Bureau handles all of these minute complexities and ensures that you have everything you need for tax filing season.</p>
4345      
4346      <p style="margin-top: 32px;">For help finding the right institution for your artwork donation, reach out to our partner <strong>Museum Exchange</strong>!</p>
4347    `},"christies-ai-summit":{title:"Art and Technology: Innovations and Implications of AI in the Art Market, Christie's, New York",subtitle:"Ap
4347praisal Bureau News",date:"2025-05-01",category:"Industry Insights",content:`
4348      <p>As London welcomes the global art market, all eyes are on the sales results coming out of Frieze Art Fair (October 9–13) and the capital's evening auctions. However, it is also the growing role of technology attracting attention, driving new discussions and partnerships across the art sector. Last week <strong>Christie's New York</strong> held a summit delving into the practical and ethical implications of artificial intelligence (AI). Though initial focus was on Trusts and Estates, the conversation evolved to address broader benefits of the technology, such as operational optimization and workflow automation. <strong>Caroline Taylor</strong>, Founder of <strong>Appraisal Bureau</strong>, spoke on the panel <em>Art and Technology: Innovations and Implications of AI in the Art Market</em> alongside <strong>Marcus Fox</strong>, Global Managing Director, 20th and 21st Century Art Department, Christie's, and <strong>Drew Watson</strong>, Head of Art Services, Bank of America, moderated by <strong>Devang Thakkar</strong>, Global Head of Christie's Ventures. Meanwhile, this week will see the second edition of The Art Business Conference's Art Market 2050 held at London's RIBA building, with panels poised to explore the sector's long-term future.</p>
4349      
4350      <div style="display: flex; justify-content: center; margin: 32px 0;">
4351        <img src="/lovable-uploads/christies-panel.jpg" alt="Art and Technology panel at Christie's New York" style="max-width: 75%; height: auto;" />
4352      </div>
4353      <p style="text-align: center; font-style: italic; color: #64748b; font-size: 15px; margin-top: -16px; margin-bottom: 32px;">Art and Technology: Innovations and Implications of AI in the Art Market panel discussion: Caroline Taylor, Founder & CEO, Appraisal Bureau, Marcus Fox, Global Managing Director, 20th and 21st Century Art Department, Christie's, and Drew Watson, Head of Art Services, Bank of America, moderated by Devang Thakkar, Global Head of Christie's Ventures</p>
4354      
4355      <p style="margin-top: 32px;">The use of artificial intelligence is increasingly being explored in all its facets, with emerging confidence apparent in its ability to help lift the veil of opacity in the markets, inform strategy and streamline administrative burdens (particularly as regulatory obligations continue to increase). With wider financial services and insurance industries embracing automated analysis, the art market could clearly benefit from aligning itself with emerging technologies.</p>
4356      
4357      <p style="margin-top: 32px;">Appraisal Bureau's software, launching October 15 (initially on a invitation-only basis), proves a prime example of such an embrace. While few are arguing that the role of humans in reviewing data findings is fully obsolete as data in the art sector remains asymmetric, the software allows for a significantly faster, more reliable service which automatically aligns with the stringent needs of insurers and service providers.</p>
4358      
4359      <p style="margin-top: 32px;">So, what's next? Discussions across auction rooms and conference panels this month have never felt more innovative, when it comes to technological advance. From enabling the trade to better meet its requirements under regulations, notably due diligence legislation, to the promise of automation absorbing points of friction in current processes, the opportunity for the sector to benefit from technology is huge. Perhaps more heartening however, as auction and fair results globally continue to stall, is the optimism apparent in the room. It may still be a rocky road, but at least the view will be clearer.</p>
4360    `},"ai-art-market-book":{title:"A new book offers an approachable guide to AI in the art market",subtitle:"Author Jo Lawson-Tancred, speaks to art market journalist Riah Pryor about her new book, 'AI and the Art Market'",author:"Riah Pryor",date:"2025-05-10",category:"Industry Insights",content:`
4361      <div style="display: flex; justify-content: center; margin: 0 0 32px 0;">
4362        <img src="/lovable-uploads/ai-in-the-art-market.avif" alt="AI in the Art Market book cover" style="max-width: 320px; height: auto;" />
4363      </div>
4364      <p><em>'AI in the Art Market'</em> is a new book by <strong>Jo Lawson-Tancred</strong>, offering an approachable introduction to AI for art-market professionals. Here, the author is in conversation with journalist <strong>Riah Pryor</strong>.</p>
4365      <hr style="margin: 24px 0; border: none; border-top: 1px solid #e2e8f0;" />
4366
4367      <p style="margin-top: 32px;"><strong>Your book aims to give an accessible overview to the emerging relationship between AI and the art sector. How easy was it to offer analysis on such a fluid and fast-moving subject?</strong></p>
4368      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4369      
4370      <p>It's obviously a rapidly moving area for development, but the book is more of a reflection of developments to date, rather than trying to be anything too speculative. The first half, in particular, reflects on key moments in the history of AI in the market–such as the launch of the price databases which proved this pivotal moment in terms of transparency and providing confidence to buyers; the development of NFTs, which began to bridge Web3 with the art trade more holistically; alongside the emergence of digital art communities, which almost began to function externally to the traditional art market as we know it.</p>
4371      
4372      <p style="margin-top: 32px;"><strong>Do you think NFTs helped pave the way for the sale of AI in the art market?</strong></p>
4373      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4374      
4375      <p>To some degree, yes. NFTs laid the groundwork for AI art by creating a buzz around digital art and uncovering potential new collectors on Web3 that some traditional art market players like galleries and auction houses are now trying to target. For example, Christie's dedicated their 3.0 platform for the sale of NFTs. While the market for digital art needs more time to develop, who would have thought five years ago that today Christie's would be regularly offering AI-generated artworks? Nobody was taking digital art very seriously then.</p>
4376      
4377      <p style="margin-top: 32px;"><strong>I noticed that you quoted Appraisal Bureau's Founder, Caroline Taylor, as saying 'It was clear to me that some technology needed to be used in this sector.' Is it fair to say that the art market has been slow to embrace advancing digital technologies?</strong></p>
4378      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4379      
4380      <p>The art market has historically been slow to adopt digital innovation, but it's often with good reason. Tech developers can be quick to announce 'revolutionary' developments, sometimes before the realities of the platforms are tested against the complexities and subtleties of the sector. Early attempts to use AI to 'prove' authenticity (or otherwise), for example, quite quickly demonstrated the need to integrate new tools with thorough contextual understanding.</p>
4381      
4382      <p style="margin-top: 32px;"><strong>Is that the main challenge with the market's widespread adoption of AI?</strong></p>
4383      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4384      
4385      <p>The complexity of the market is clearly a challenge. A better bridging of the gap between developers and professionals from the market is key to future success.</p>
4386      
4387      <p style="margin-top: 32px;"><strong>And the opportunities?</strong></p>
4388      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4389      
4390      <p>There is a real opportunity to open up the art world a bit more. C
4390ollectors and a broader set of buyers could feel confident engaging in a market where there was greater transparency and, for businesses, there could be a greater ability to boost efficiency. The quality and depth of data could also be revolutionary, as could the ability to create opportunities for more neutral valuations and analysis, with platforms, including <strong>Appraisal Bureau</strong>.</p>
4391      
4392      <p style="margin-top: 32px; font-style: italic;">'AI in the Art Market' by <strong>Jo Lawson-Tancred</strong> is the first book to offer an approachable introduction to AI for art-market professionals. Published by Lund Humphries and now available.</p>
4393    `},"ica-miami-exhibition":{title:"Appraisal Bureau sponsors innovative exhibition at ICA Miami",subtitle:"",date:"2024-12-23",category:"Museums & Philanthropy",content:`
4394      <p>As Art Basel Miami Beach and its surrounding footprint took over Miami this December, marking a vibrant close to the season, Appraisal Bureau was proud to sponsor an ambitious exhibition by the France-born, London based artist <strong>Marguerite Humeau</strong>. The show, held at the city's prestigious <strong>Institute of Contemporary Art (ICA)</strong>, will run until March 30, 2025, and is the first major presentation of the artist's work in the United States.</p>
4395      
4396      <p style="margin-top: 32px;">Entitled <em>Marguerite Humeau: *sk*/ey-</em>, the immersive installation offers a provocative exploration of a future where conventional notions of materiality and temporality are radically reimagined and confronts pressing themes such as post-human existence. The displays' speculative forms, informed by the looming threat of climate change, propose a mode of living that is as thought-provoking as it is unsettling.</p>
4397      
4398      <p style="margin-top: 32px;">"Visitors have been enthralled with Humeau's surrealist and haunting immersive installation," says <strong>Alex Gartenfeld</strong>, ICA Miami Artistic Director, who co-curated the display along with ICA Miami Curator, <strong>Stephanie Seidel</strong>. He adds that "The reception to the exhibition has been outstanding, and we are thrilled to present the first museum exhibition of Humeau's work, continuing ICA Miami's history of providing these first institutional platforms for important rising artists."</p>
4399      
4400      <div style="display: flex; justify-content: center; margin: 32px 0;">
4401        <img src="/lovable-uploads/marguerite-humeau-exhibition.png" alt="Installation view of Marguerite Humeau exhibition at ICA Miami" style="max-width: 75%; height: auto;" />
4402      </div>
4403      <p style="text-align: center; font-style: italic; color: #64748b; font-size: 15px; margin-top: -16px; margin-bottom: 32px;">Installation view: "Marguerite Humeau: *sk*/ey-" at the Institute of Contemporary Art, Miami, Dec 3, 2024 – Mar 30, 2025. Photo: Oriol Tarridas.</p>
4404      
4405      <p style="margin-top: 32px;">The exhibition's opening coincided with the 22nd edition of Art Basel Miami Beach. This year, over 20 international art fairs took place alongside the main fair, in a now heavily anticipated annual whirlwind of activity.</p>
4406      
4407      <p style="margin-top: 32px;">Notable offerings during the fair included Picasso's <em>Couple with a Cup</em>, 1969, for $30 million at Acquavella Gallery, contributing to the growing sense of optimism that appears to be cautiously unfolding. Such buoyancy is welcomed following a year in which the sector was faced with a degree of market correction in auction rooms across the globe, amidst a broader platform of global economic recession and political instability.</p>
4408      
4409      <p style="margin-top: 32px;">That both the UK and the US now have settled into political systems could well be behind the boosted energy going into 2025, while growing confidence in the positive role that technology plays in the efficiency and transparency of the sector also looks to be a surefire trend as we move into the next 12 months.</p>
4410    `},"marsh-appraisal-bureau-partnership":{title:"A new era for art insurance as Marsh and Appraisal Bureau partner",subtitle:"Ap
4410praisal Bureau News",date:"2025-05-20",category:"Industry Insights",image:"/lovable-uploads/ai-circuit-board.jpg",content:`
4411      <p>Appraisal Bureau has partnered with Marsh, the global leader in fine art insurance, to bring our clients access to industry-leading coverage at highly competitive premiums. Through this integration, clients can request a custom quote from Marsh directly within their Appraisal Bureau account. Artwork details and insured values are shared with Marsh and automatically updated, enabling seamless risk assessment and ensuring policies reflect the most accurate valuations.</p>
4412      
4413      <div style="display: flex; justify-content: center; margin: 32px 0;">
4414        <img src="/lovable-uploads/charlie-horrell.jpg" alt="Charlie Horrell, Head of Fine Art and Luxury Brands at Marsh" style="max-width: 270px; height: auto;" />
4415      </div>
4416      <p style="text-align: center; font-style: italic; color: #64748b; font-size: 15px; margin-top: -16px; margin-bottom: 32px;">Charlie Horrell, Head of Fine Art and Luxury Brands, Marsh</p>
4417      
4418      <p style="margin-top: 32px;"><strong>Head of Fine Art & Luxury Brands</strong> at <strong>Marsh</strong>, <strong>Charlie Horrell</strong>, speaks to art market journalist <strong>Riah Pryor</strong> about innovation in the sector, including their recent partnership with Appraisal Bureau.</p>
4419      
4420      <p style="margin-top: 32px;"><strong>Could I start by asking for an introduction to Marsh and your department?</strong></p>
4421      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4422      
4423      <p>Absolutely, so I lead the fine arts and luxury brands team within Marsh. We help clients better understand and manage the potential risks for their collections. We're lucky enough to enjoy a substantial size of the market and to work with a wide range of clients in the art and luxury world. The scope of a fine art policy has broadened massively in recent years. You only need to look at what happened throughout COVID, with the increased value in memorabilia and sneakers etc, to understand the constant change at the forefront of the sector.</p>
4424      
4425      <p style="margin-top: 32px;">We have focused on putting together substantial facilities and processes to also try and make the whole process as easy as possible for our clients, which I think is where our partnership with Appraisal Bureau fits so well.</p>
4426      
4427      <p style="margin-top: 32px;"><strong>So how did your work with Appraisal Bureau come about?</strong></p>
4428      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4429      
4430      <p>It leads back to our commitment to innovation which aligns quite naturally with the ambition of Caroline [Taylor/CEO and Founder of Appraisal Bureau]. Marsh, for example, was the first broker to place a pure NFT policy in the market and so we've been at the forefront of digital art valuations, and Appraisal Bureau quite quickly demonstrated their ability to support this area as well.</p>
4431      
4432      <p style="margin-top: 32px;">We'd also noticed that a lot of clients really didn't seem confident about knowing where to get their art appraised and were almost put off by some of the traditional processes, or the idea that a company would be expected to carry out an extensive, in person review of an entire collection. Being able to offer a process which was clear, efficient and built trust offered us a really strong way to add value for clients.</p>
4433      
4434      <p style="margin-top: 32px;"><strong>You mention a desire from the market for greater speed and transparency, what are the inefficiencies and challenges art insurance has historically faced?</strong></p>
4435      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4436      
4437      <p>As you know, the art world is still very traditional. Someone coming along, like Appraisal Bureau, and offering something that can speed up the process and make it more accessible is a real shift. A lot of art is covered under broader contents or property policies and it's important to try and guide clients, so they can get more clarity around what can be offered and achieved in our market.</p>
4438      
4439      <p style="margin-top: 32px;">A lot of people also assume they would need to go to an auctioneer for valuations and are sometimes reluctant to do that because they would be handing over a lot of their data, so I think the feeling of a neutral platform is significant.</p>
4440      
4441      <p style="margin-top: 32px;"><strong>I think it's fair to say that the art trade has also historically been fairly cautious in adopting technological innovation. Do you feel this is shifting?</strong></p>
4442      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4443      
4444      <p>Yes, I think so. The art market is largely unregulated, so it remains slightly behind the times in many ways. But I do think that people are really adapting to the use of digital to boost speed and trust at the moment. What we're trying to do is to make sure that we're doing our part from the insurance perspective, particularly by our clients using Appraisal Bureau or our Balance Facility. Balance is a market leading placement facility which rewards clients for sustainable movements with premium savings, and we have the ability to place up to $2B of coverage with agreement of only three insurers. You also have to consider the demographic of an art buyer these days. It's massively different from even a decade ago, it's a completely different generation of art buyers. I think just because of that, it will naturally move things along.</p>
4445      
4446      <p style="margin-top: 32px;"><strong>How do you see this technology changing the way insurance companies evaluate and price r
4446isk in the art market?</strong></p>
4447      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4448      
4449      <p>At the moment, everyone is exploring the potential of AI, we have all this at our fingertips and insurers are happy to utilize this if it can offer more clarity towards valuations in line with market trends. Ascertaining the correct limit of indemnity is vital, as the basis of valuation under an art policy is the scheduled, or agreed value.</p>
4450      
4451      <p style="margin-top: 32px;">That said, if a client was to sustain a total loss and haven't had their collection valued for a number of years, they could easily be underinsured. Considering the fluctuations in values over the last few years, we suspect that many collections are not fully covered. By teaming up with Appraisal Bureau, art collection valuations are regularly updated so we know appropriate coverage is in place.</p>
4452      
4453      <p style="margin-top: 32px;"><strong>Is there risk in introducing a system that uses valuations without seeing artworks in-real-life?</strong></p>
4454      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4455      
4456      <p>Looking at the range of clients we cover and the vast collections that we represent, it would never be practical to offer in person inspections for every item. You would end up with an appraiser living on site!</p>
4457      
4458      <p style="margin-top: 32px;">There won't be a solution for everyone and every work, but as a key element in what Appraisal Bureau can offer it provides a much more cost-effective solution.</p>
4459      
4460      <p style="margin-top: 32px;"><strong>What kind of feedback have you received from clients or insurers about using the platform during the insurance process?</strong></p>
4461      <hr style="margin: 16px 0; border: none; border-top: 1px solid #e2e8f0;" />
4462      
4463      <p>The feedback has been very positive from clients and insurers. Being able to quickly offer full information of all artworks in one place and recurring, up-to-date appraisals, provides faster premium quotations. And I just think that a lot of insurers feel that this innovation is needed.</p>
4464      
4465      <p style="margin-top: 32px;"><a href="/contact" className="text-[#1F1AB9] underline">Learn more about Appraisal Bureau and Marsh</a></p>
4466    `},"from-if-to-how-ai-art-market":{title:"From 'If' to 'How'—Conversations about AI in the art market mature",subtitle:"Ed. 24 of Appraisal Bureau News",date:"2025-06-15",category:"Industry Insights",image:"/lovable-uploads/circuit-board-pattern.jpg",content:`
4467      <p>The art market's conversation around artificial intelligence is evolving. Once dominated by speculation as to whether AI belonged in the industry at all, this week's media coverage suggests a clear pivot: the debate is no longer if AI has a place in the art world—but how the frameworks and models are being developed, notably around valuations.</p>
4468      
4469      <p style="margin-top: 32px;">In last week's <a href="https://www.ft.com/content/9517682a-4703-4640-9471-41ad28f54c0d" target="_blank" rel="noopener noreferrer">Financial Times</a>, art market commentator <strong>Melanie Gerlis</strong> highlighted the role that <strong>Appraisal Bureau</strong> is playing in driving new approaches to valuation in the sector. (A pdf version of the article is <a href="#" target="_blank" rel="noopener noreferrer">here</a> for non-FT subscribers). "It is not 'ask ChatGPT' the value of my art," Gerlis quotes of Appraisal Bureau's founder, <strong>Caroline Taylor</strong>, who instead explains how machine learning "can process millions of data points instantly, then sort, clean and label the information." This model, she emphasized, was built under supervision of human appraisers with years of market experience.</p>
4470      
4471      <div style="display: flex; justify-content: center; margin: 32px 0;">
4472        <img src="/lovable-uploads/rashid-johnson-red-painting.jpg" alt="Rashid Johnson's Anxious Red Painting September 24th" style="max-width: 75%; height: auto;" />
4473      </div>
4474      <p style="text-align: center; font-style: italic; color: #64748b; font-size: 15px; margin-top: -16px; margin-bottom: 32px;">Rashid Johnson's 'Anxious Red Painting September 24th' sold for $1,391,000 at Phillips New York's modern and contemporary sale last May; AI suggests that Johnson's 'Red' paintings sell better than his 'Blue' ones</p>
4475      
4476      <p>The article landed in the same month that Artnet's Naomi Rea explored challenges being made to more 'traditional' modes of pricing in the sector. Both articles reflect a market that is opening up to new tools aimed at solving old problems.</p>
4477      
4478      <p style="margin-top: 32px;">These discussions are playing out alongside significant legal and ethical developments. The high-profile trial between b
4478illionaire Ron Perelman and insurance companies over artworks he claims to have lost their 'oomph' following a fire is tackling challenging questions of subjectivity and opinion, whilst a high-stakes U.S. trial against Getty Images began this month, with allegations of unauthorized use of artists' work to train AI systems.</p>
4479      
4480      <p>The latter in particular underscores the need for ethical frameworks in how data is sourced and deployed, a key reason Taylor stresses best practices in data privacy and security at Appraisal Bureau.</p>
4481      
4482      <p style="margin-top: 32px;">The shift toward AI mirrors patterns seen in other industries. Real estate's widespread adoption of Zillow, which uses AI to assess property values serves as a precedent for how data-driven tools can reshape legacy sectors. In the art world, where margins are tightening and overheads rising, accessible options are increasingly attractive. Subscriptions to platforms like Appraisal Bureau are significantly more efficient and cost-effective than traditional services.</p>
4483      
4484      <p style="margin-top: 32px;">And the growing consensus—from more traditional professionals to new collectors—is clear: if time and money can be recouped without sacrificing expertise or integrity, that's a win for everyone.</p>
4485    `},"sample-post-1":{title:"Rethinking the Appraisal Report",subtitle:"How Appraisal Reports work on Appraisal Bureau",date:"2025-01-15",category:"Industry Insights",image:"/lovable-uploads/paper-stack-reports.jpg",content:`
4486      <p>For decades, the art world has relied on a static, manual format for appraisals — PDF documents built from scratch, unique to a moment in time, and disconnected from any broader system of record. Every valuation meant hiring someone new, repeating the same steps, and paying again, even when little had changed.</p>
4487      
4488      <p style="margin-top: 32px;">At Appraisal Bureau, we've reimagined the appraisal report from the ground up.</p>
4489      
4490      <p style="margin-top: 32px;">Traditional appraisal reports are created manually — often in Word or Google Docs — and finalized as PDFs that are difficult to search, update, or reuse. The process is slow, inconsistent, and entirely one-off. Once the report is delivered, the underlying data, comps, and assumptions typically disappear with it.</p>
4491      
4492      <p style="margin-top: 32px;"><strong>We saw a better way.</strong></p>
4493      
4494      <p style="margin-top: 32px;">Appraisal Bureau reports are built differently. They combine machine intelligence with human oversight — using proprietary technology, internal databases, and verified public data to generate appraisals that are consistent, defensible, and dynamic.</p>
4495      
4496      <p style="margin-top: 32px;">Each report is backed by a stored valuation record that includes:</p>
4497      
4498      <ul>
4499        <li>Comparable sales</li>
4500        <li>Market trends</li>
4501        <li>Purpose-specific adjustments</li>
4502        <li>Any assumptions or limitations made at the time of issue</li>
4503      </ul>
4504      
4505      <p style="margin-top: 32px;">This means every report is reproducible, auditable, and ready to evolve as conditions change, while maintaining USPAP, IRS and regulatory compliance.</p>
4506      
4507      <p style="margin-top: 32px;">When you're ready to generate a report, the process is simple. Just select the artwork, choose the purpose — such as insurance, estate planning, or financial reporting — and click Generate. Our system pulls the relevant data and generates a formatted appraisal in seconds.</p>
4508      
4509      <p style="margin-top: 32px;">This isn't just automation for speed — it's structure for quality. By tying each report to a clear valuation purpose, we ensure that every document is appropriate for its intended use and compliant with relevant standards.</p>
4510      
4511      <p style="margin-top: 32px;">With Appraisal Bureau, you're not buying a one-time document. You're subscribing to value — and to an always-on infrastructure for reporting.</p>
4512      
4513      <p style="margin-top: 32px;">Your team can generate reports as often as needed. Reports can be updated over time, adapted for new purposes, and downloaded or shared instantly.</p>
4514      
4515      <p style="margin-top: 32px;">This model supports:</p>
4516      
4517      <ul>
4518        <li>Real-time decisions</li>
4519        <li>Institutional record-keeping</li>
4520        <li>Scalable operations across collections, estates, and client portfolios</li>
4521      </ul>
4522      
4523      <p style="margin-top: 32px;">No more version control issues. No more delays. No more paying twice for the same information.</p>
4524      
4525      <p style="margin-top: 32px;">Art valuation doesn't have to be a black box — or a bottleneck. By combining technology with the judgment of experienced appraisers, we're building a system that respects the nuance of the category while making it faster, more transparent, and far more useful.</p>
4526      
4527      <p style="margin-top: 32px;">Appraisal reports are no longer artifacts. They're tools — and they're only a click away.</p>
4528    `}
4528,"sample-post-2":{title:"Another Sample Post",subtitle:"Sample subtitle",date:"2025-01-10",category:"Best Practices",image:"/lovable-uploads/f105cd8c-1da0-4cb4-a8e0-f66f4c018408.png",content:`
4529      <p>Another sample blog post content. Replace this with your actual content.</p>
4530      
4531      <h2>Getting Started</h2>
4532      <p>Your content goes here...</p>
4533    `}},dN=()=>{const{slug:e}=hq(),t=e?Fse[e]:null,[r,n]=D.useState(0);if(D.useEffect(()=>{const i=()=>{const l=window.scrollY,c=document.documentElement.scrollHeight-window.innerHeight,d=c>0?l/c*100:0;n(Math.min(100,Math.max(0,d)))};return window.addEventListener("scroll",i,{passive:!0}),()=>window.removeEventListener("scroll",i)},[]),!t)return o.jsxs(o.Fragment,{children:[o.jsx(on,{}),o.jsx("div",{className:"min-h-screen bg-white pt-32 pb-20",children:o.jsxs("div",{className:"max-w-4xl mx-auto px-4 text-center",children:[o.jsx("h1",{className:"text-4xl font-bold text-slate-900 mb-4",children:"Post Not Found"}),o.jsx(Ut,{to:"/thejournal",children:o.jsx(rr,{children:"Back to The Journal"})})]})}),o.jsx(yn,{})]});const s=new Date(t.date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),a=t.content.replace(/(<p[^>]*>)(\s*)(<strong>)?(\s*)([A-Z])/,(i,l,c,d,p,u)=>{const h=`<span class="drop-cap-letter">${u}</span>`;return d?`${l}${c}${d}${p}${h}`:`${l}${c}${p}${h}`});return o.jsxs(o.Fragment,{children:[o.jsx(Fn,{title:`${t.title} - Appraisal Bureau`,description:t.excerpt||t.title}),o.jsx("div",{className:"fixed top-0 left-0 z-[100] h-[2px] bg-foreground transition-all duration-150 ease-out",style:{width:`${r}%`}}),o.jsxs("div",{className:"min-h-screen bg-white flex flex-col",children:[o.jsx(on,{}),o.jsx("main",{className:"flex-grow pt-20",children:o.jsxs("article",{className:"py-12 md:py-20",children:[o.jsx("div",{className:"max-w-[720px] mx-auto px-6 mb-10",children:o.jsxs(Ut,{to:"/thejournal",className:"inline-flex items-center gap-1.5 text-slate-400 hover:text-slate-600 transition-colors text-xs tracking-wide",children:[o.jsx(jA,{className:"h-3 w-3"}),"The Journal"]})}),o.jsxs("header",{className:"max-w-[680px] mx-auto px-6 mb-12",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-400 mb-3",children:t.type==="editorial"?"Editorial":t.category||"Article"}),o.jsx("p",{className:"text-[11px] uppercase tracking-[0.15em] text-slate-400 mb-5",children:s}),o.jsx("h1",{className:"article-headline text-[2rem] md:text-[2.6rem] leading-[1.18] tracking-[-0.02em] text-[#1a1a1a] mb-4",dangerouslySetInnerHTML:{__html:t.titleHtml||t.title}}),t.editionLabel&&o.jsx("p",{className:"article-deck text-lg md:text-xl text-slate-400 leading-[1.65] mb-5 italic",children:t.editionLabel}),t.subtitle&&o.jsx("p",{className:"article-deck text-lg md:text-xl text-slate-500 leading-[1.65] mb-5",children:t.subtitle}),o.jsxs("p",{className:"text-xs uppercase tracking-[0.12em] text-slate-400",children:["By ",t.author||"Appraisal Bureau Editorial"]})]}),t.image&&o.jsxs("div",{className:"max-w-[820px] mx-auto px-6 mb-14",children:[o.jsxs("div",{className:"relative overflow-hidden",children:[o.jsx("img",{src:t.image,alt:t.title,className:`w-full ${t.fullHeight?"object-contain":"object-cover"}`,style:{...t.fullHeight?{}:{maxHeight:"500px"},objectPosition:t.objectPosition||"center",filter:"grayscale(15%) contrast(1.04)"}}),o.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04] mix-blend-overlay",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,backgroundSize:"120px"}})]}),t.creditLine&&o.jsx("p",{className:"mt-3 text-center text-sm text-slate-400",dangerouslySetInnerHTML:{__html:t.creditLine}})]}),o.jsxs("div",{className:"max-w-[680px] mx-auto px-6",children:[o.jsx("div",{className:"article-body prose max-w-none",dangerouslySetInnerHTML:{__html:a}}),o.jsxs("div",{className:"mt-20 pt-10 border-t border-slate-200",children:[o.jsxs("div",{className:"mb-8",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-slate-400 mb-3",children:"About Appraisal Bureau"}),o.jsx("p",{className:"text-sm text-slate-500 leading-[1.75] max-w-[520px]",children:"Appraisal Bureau is the art market's valuation and reporting infrastru
4533cture — unifying appraisals, collection management, and compliance for collectors, institutions, advisors, and stakeholders."})]}),o.jsxs(Ut,{to:"/thejournal",className:"inline-flex items-center gap-1.5 text-slate-400 hover:text-slate-600 transition-colors text-xs tracking-wide",children:[o.jsx(jA,{className:"h-3 w-3"}),"Back to The Journal"]})]})]})]})}),o.jsx(yn,{})]}),o.jsx("style",{children:`
4534        @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&display=swap');
4535
4536        .article-headline {
4537          font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
4538          font-weight: 400;
4539        }
4540
4541        .article-deck {
4542          font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
4543          font-style: italic;
4544          font-weight: 400;
4545        }
4546
4547        /* Drop cap */
4548        .drop-cap-letter {
4549          float: left;
4550          font-family: 'Playfair Display', Georgia, serif;
4551          font-size: 4.4rem;
4552          line-height: 0.76;
4553          padding-right: 0.1em;
4554          padding-top: 0.06em;
4555          color: #1a1a1a;
4556          font-weight: 400;
4557        }
4558
4559        /* Body prose */
4560        .article-body p {
4561          color: #2a2a2a;
4562          font-size: 17px;
4563          line-height: 1.88;
4564          margin-bottom: 1.75rem;
4565        }
4566
4567        /* H2 editorial style */
4568        .article-body h2 {
4569          font-family: 'Playfair Display', Georgia, serif !important;
4570          font-weight: 400 !important;
4571          font-size: 1.35rem !important;
4572          color: #1a1a1a !important;
4573          margin-top: 3.5rem !important;
4574          margin-bottom: 1.25rem !important;
4575          letter-spacing: -0.01em;
4576          position: relative;
4577          padding-top: 2.5rem;
4578        }
4579
4580        .article-body h2::before {
4581          content: '';
4582          position: absolute;
4583          top: 0;
4584          left: 0;
4585          width: 2rem;
4586          height: 1px;
4587          background-color: #cbd5e1;
4588        }
4589
4590        /* H3 */
4591        .article-body h3 {
4592          font-family: 'Playfair Display', Georgia, serif !important;
4593          font-weight: 400 !important;
4594          font-size: 1.1rem !important;
4595          color: #1a1a1a !important;
4596          margin-top: 2.5rem !important;
4597          margin-bottom: 1rem !important;
4598        }
4599
4600        /* Pull quotes via blockquote */
4601        .article-body blockquote {
4602          border: none;
4603          border-left: 2px solid #1a1a1a;
4604          margin: 3.5rem 0;
4605          padding: 0.25rem 0 0.25rem 2rem;
4606          background: none;
4607        }
4608
4609        .article-body blockquote p {
4610          font-family: 'Playfair Display', Georgia, serif !important;
4611          font-size: 1.35rem !important;
4612          line-height: 1.65 !important;
4613          color: #1a1a1a !important;
4614          font-style: italic;
4615          margin-bottom: 0 !important;
4616        }
4617
4618        /* Images */
4619        .article-body img {
4620          display: block;
4621          margin: 2.5rem auto !important;
4622          max-width: 100%;
4623          height: auto;
4624        }
4625
4626        /* Strong */
4627        .article-body strong {
4628          color: #1a1a1a;
4629          font-weight: 600;
4630        }
4631
4632        /* Links */
4633        .article-body a {
4634          color: #220E99;
4635          text-decoration: none;
4636        }
4637        .article-body a:hover {
4638          text-decoration: underline;
4639        }
4640
4641        /* HR */
4642        .article-body hr {
4643          border: none;
4644          border-top: 1px solid #e2e8f0;
4645          margin: 3.5rem 0;
4646        }
4647
4648        /* Lists */
4649        .article-body ul {
4650          list-style: disc;
4651          padding-left: 1.5rem;
4652          margin: 1.5rem 0;
4653        }
4654
4655        .article-body li {
4656          color: #2a2a2a;
4657          font-size: 17px;
4658          line-height: 1.88;
4659          margin-bottom: 0.5rem;
4660        }
4661      `})]})},g5=[{id:"prod-2026-09-16-artwork-location",label:"Platform",date:"September 16, 2026",title:"Production Release — Artwork Location",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"An artwork's location is no longer a single line of free text — it can now be recorded as a city, building, floor and room, and every move an artwork makes is kept as a history that can be read back from the artwork page."})})})},{id:"prod-2026-09-16-location-detail-fields",label:"Platform",date:"September 16, 2026",title:"Production Release — Location Detail Fields",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Artworks gained four optional location details: city, building, floor and room."}),o.jsx("li",{children:"The existing location field is unchanged and still holds whatever it holds today; the new details sit alongside it rather than replacing it."}),o.jsx("li",{children:"All five are optional and independent — an artwork can carry only the old free-text location, only the new details, or any mix of them."}),o.jsx("li",{children:'Floor is recorded as text rather than a 
4661number, so labels such as "Ground", "Mezzanine" or "2B" are kept exactly as entered.'}),o.jsx("li",{children:"Saved searches, the workspace location list, the artwork export and location grouping in reports continue to work from the existing location field, so nothing that relies on it changes."})]})})},{id:"prod-2026-09-16-location-history",label:"Platform",date:"September 16, 2026",title:"Production Release — Location History",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Every change to an artwork's location is now recorded, so it is possible to see each place an artwork has been held and when it moved."}),o.jsx("li",{children:"Each entry is a complete record of the location at that moment — city, building, floor and room together — not just the field that was edited, so an entry can be read on its own."}),o.jsx("li",{children:"Each entry shows when the move was recorded and who made it. Changes made by an import or a scheduled process are recorded without a person's name."}),o.jsx("li",{children:"An artwork created with a location starts its history with that location, so the first place it was held is never lost."}),o.jsx("li",{children:"For artworks that already existed, the location they were in is captured the first time they are moved, so their history starts from where they actually were rather than from the new location."}),o.jsx("li",{children:"Saving an artwork without changing its location adds nothing to the history, so repeated saves do not clutter the trail."}),o.jsx("li",{children:"Changes made anywhere are recorded the same way — the artwork page, an appraiser's edit, an import or an administrative change."}),o.jsx("li",{children:"Clearing a location is recorded as a change in its own right."}),o.jsx("li",{children:"Archiving an artwork leaves its history untouched and still readable; deleting an artwork deletes its location history with it, leaving nothing behind."})]})})},{id:"prod-2026-09-16-artwork-condition",label:"Platform",date:"September 16, 2026",title:"Production Release — Artwork Condition",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Condition summary, report date and examiner name are recorded on the artwork itself, alongside the full condition report."}),o.jsx("li",{children:"Artwork condition gained a Critical level, in addition to Poor, Fair, Good and Excellent."})]})})},{id:"prod-2026-09-09-loupe",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Expanded Loupe beyond invoices — it now reads condition reports, past appraisals, installation instructions, conservation reports and certificates of authenticity, attaches them to the artworks they describe, and can copy their details onto the artwork record."})})})},{id:"prod-2026-09-09-loupe-document-types",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: New Document Types",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Loupe now recognises five further document types and files them against an existing artwork instead of creating a new one."}),o.jsx("li",{children:"Condition reports, past appraisals, installation instructions, conservation reports and certificates of authenticity are each captured as their own record with their full set of details, not as free text."}),o.jsx("li",{children:"A single document can be attached to more than one artwork — useful for a certificate or condition report covering a multi-part work."}),o.jsx("li",{children:"Every attached document stays linked to its original file, which can be opened from the artwork page."}),o.jsx("li",{children:"The artwork page shows each type in its own section, loaded only when needed."})]})})},{id:"prod-2026-09-09-loupe-review",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Review Before Saving",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Extracted details are presented as a form rather than being saved automatically."}),o.jsx("li",{children:"Every field can be edited, corrected or filled 
4661in by hand before saving, including fields the AI could not find."}),o.jsx("li",{children:"Only the values shown on screen at the point of saving are stored, so what the user sees is what gets recorded."}),o.jsx("li",{children:"Documents are checked against the workspace and the user's access before anything is attached."})]})})},{id:"prod-2026-09-09-loupe-condition-reports",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Condition Reports on the Artwork",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Condition summary, report date and examiner name are now recorded on the artwork itself, alongside the full report."}),o.jsx("li",{children:"Artwork condition gained a Critical level, in addition to Poor, Fair, Good and Excellent."}),o.jsx("li",{children:"Applying a condition report to its artworks is optional and off by default — the artwork changes only when the user asks for it."}),o.jsx("li",{children:"Details the report does not carry are left alone, so a partial report never clears existing artwork information."})]})})},{id:"prod-2026-09-09-loupe-installation",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Installation Instructions",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Crate and artwork dimensions are now captured as measured figures with a unit, replacing free-text dimensions."}),o.jsx("li",{children:"Crate dimensions can be copied to the artwork's packaging measurements and uncrated dimensions to the artwork's own measurements, on request."}),o.jsx("li",{children:"A dimension set is copied only when height, width and unit are all present; incomplete figures are skipped rather than partly written."}),o.jsx("li",{children:"The user is shown what will be replaced before confirming, since copying dimensions overwrites the existing values."})]})})},{id:"prod-2026-09-09-loupe-coa-verification",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Certificate of Authenticity Verification",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Certificates are now checked against the artwork they claim to certify, and the result is reported field by field."}),o.jsx("li",{children:"A certificate uploaded from an artwork page is verified against that artwork automatically."}),o.jsx("li",{children:"A certificate uploaded from the workspace page is matched against the workspace and returns up to five ranked candidate artworks for the appraiser to choose from."}),o.jsx("li",{children:"Choosing a different artwork re-runs the verification against it, so the comparison always reflects the artwork on screen."}),o.jsx("li",{children:"Each compared field reports whether it agreed, the certificate's value, the artwork's value and how closely they matched, making a mismatched certificate visible immediately."})]})})},{id:"prod-2026-09-09-loupe-coa-apply",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Applying Certificate Details to the Artwork",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Certificate details can be copied onto the artwork on request: title, artist, medium, dimensions, year of creation, edition and provenance."}),o.jsx("li",{children:"The artist is matched to an existing artist record where one exists, and created where it does not."}),o.jsx("li",{children:"Edition type, number and size are combined into a single edition entry on the artwork."}),o.jsx("li",{children:"Dimensions are copied only from measured figures, never guessed from descriptive text, so an artwork's measurements cannot be corrupted by an unclear certificate."}),o.jsx("li",{children:"Details that describe the certificate itself — issuer, certificate number, signatures, stamps and authentication method — stay on the certificate and are never written to the artwork."}),o.jsx("li",{children:"Empty certificate fields are skipped, so a partial certificate never blanks out artwork data."})]})})},{id:"prod-2026-09-09-loupe-valuation-safeguards",label:"Platform",date:"September 9, 2026",title:"Production Release — Loupe: Valuation Safeguards",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Artworks with a delivered valuation remain protected: title, medium, year, edition and dimensions cannot be overwritten by a document sync."}),o.jsx("li",{children:"Only artist and provenance can be applied to an artwork that already has a delivered valuation."}),o.jsx("li",{children:"A blocked request is refused before anything is written, so an artwork is never left partly updated."})]})})},{id:"prod-2026-08-03-appraiser-mode",label:"Platform",date:"August 3, 2026",title:"v2.1 — Appraiser Mode (August 3, 2026)",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Introduced Appraiser Mode — a dedicated workspace for Appraisal Bureau appraisers covering intake, valuation, peer review, and delivery of valuation reports."})})})},{id:"prod-2026-08-03-valuation-request-queue",label:"Platform",date:"August 3, 2026",title:"Production Release — Valuation Request Queue",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Valuation requests are now created automatically instead of appraisers starting valuations manually."}),o.jsx("li",{children:"Requests are raised when a one-time purchase is paid and when a subscription valuation cycle is approaching."}),o.jsx("li",{children:"Artworks submitted together are grouped into a single batch request; individually purchased artworks arrive as individual requests."}),o.jsx("li",{children:"Subscription requests are raised ahead of the due date so appraisers have lead time to prepare."}),o.jsx("li",{children:"Added an appraiser intake queue with pending requests, artwork details, workspace, and the requesting customer."}),o.jsx("li",{children:"Customers can now view their valuation requests from within their workspace."})]})})}
4661,{id:"prod-2026-08-03-admin-appraiser-controls",label:"Platform",date:"August 3, 2026",title:"Production Release — Admin Appraiser Controls",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Introduced the Admin Appraiser designation with additional oversight and administrative capability."}),o.jsx("li",{children:"Admin Appraisers assign incoming valuation requests to appraisers, replacing the earlier first-come acceptance model."}),o.jsx("li",{children:"Added a team workload view so Admin Appraisers can see how work is distributed across the team."}),o.jsx("li",{children:"Admin Appraisers can manually assign an organisation to a specific appraiser."}),o.jsx("li",{children:"Added a searchable, paginated view of all organisations with their assigned appraiser."}),o.jsx("li",{children:"Admin Appraisers can see all customers across the platform, while other appraisers see only their assigned organisations."}),o.jsx("li",{children:"Admin Appraisers can create on-demand valuation batches for any organisation."})]})})},{id:"prod-2026-08-03-two-appraiser-review",label:"Platform",date:"August 3, 2026",title:"Production Release — Two-Appraiser Review Workflow",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Every valuation now moves through a structured review flow: In Progress → Awaiting Review → Approved → Delivered."}),o.jsx("li",{children:"A second appraiser must be selected before a valuation can be submitted for review, and cannot be the same person as the first appraiser."}),o.jsx("li",{children:"Only the second appraiser can approve a valuation or send it back for changes."}),o.jsx("li",{children:"Review notes are required when a valuation is sent back for changes."}),o.jsx("li",{children:"Only the first appraiser can submit for review and deliver the final report."}),o.jsx("li",{children:"Valuation figures are locked once a valuation is under review or approved, and unlock again if changes are requested."}),o.jsx("li",{children:"Customers continue to see only their existing valuation states — the internal review flow is not exposed to them."})]})})},{id:"prod-2026-08-03-batch-valuations",label:"Platform",date:"August 3, 2026",title:"Production Release — Batch Valuations",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added on-demand batch valuations so an appraiser can value multiple artworks together."}),o.jsx("li",{children:"Shared values, market conditions, and comparable sales can be applied across an entire batch in one action, with per-artwork overrides still available."}),o.jsx("li",{children:"Batches can be partially valued by selecting specific artworks within the batch."}),o.jsx("li",{children:"Batch status now moves in a single, consistent step, with the overall batch state derived from its artworks."}),o.jsx("li",{children:"All artworks in a batch must be fully valued before the batch can be submitted for review."}),o.jsx("li",{children:"Batch view now shows shared values and clearly flags fields that differ between artworks."})]})})},{id:"prod-2026-08-03-ai-comparable-sales",label:"Platform",date:"August 3, 2026",title:"Production Release — AI Comparable Sales",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Comparable sales matching now runs automatically when a valuation is created, returning suggested comparables, suggested values, and supporting notes for appraiser review."}),o.jsx("li",{children:"Appraisers can review suggested comparables, approve the ones they want to use, and re-run matching on demand."}),o.jsx("li",{children:"Approved comparables can be used to populate the valuation figures."}),o.jsx("li",{children:"Edited notes can be reset back to the AI-generated version."}),o.jsx("li",{children:"Appraisers now choose which of the approved comparables appear in the printed report, so supporting research can be broader than what is published."}),o.jsx("li",{children:"Delivery requires a minimum number of comparables in the report once a valuation crosses the configured value threshold."}),o.jsx("li",{children:"Comparables are frozen once a valuation is delivered."}),o.jsx("li",{children:"Approved comparable images are now stored with the sale record."})]})})},{id:"prod-2026-08-03-comparable-sales-upload",label:"Platform",date:"August 3, 2026",title:"Production Release — Comparable Sales Upload (Loupe)",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Appraisers can now upload comparable-sale documents and have them read automatically, with progress and completion status shown in notifications."}),o.jsx("li",{children:"Extracted comparables can be reviewed and then added to the comparable-sales library in one action."}),o.jsx("li",{children:"Added duplicate protection so the same document cannot be added twice."}),o.jsx("li",{children:"Extraction now captures artwork images, medium category, size units, sale year, and auction estimates."}),o.jsx("li",{children:"Improved handling of single-name artists during document ingestion."})]})})},{id:"prod-2026-08-03-market-analysis",label:"Platform",date:"August 3, 2026",title:"Production Release — Market Analysis & Data Sources",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a global market condition generated per quarter by the AI engine, reviewable and editable by appraisers before it is saved."}),o.jsx("li",{children:"Market conditions can be filtered by quarter."}),o.jsx("li",{children:"A custom market condition can be attached to an individual valuation."}),o.jsx("li",{children:"Added an artist explorer search."}),o.jsx("li",{children:"Added a unified comparable-sales data source with filters for source, medium, year, price, dimensions, category, sale year, and images."})]})})},{id:"prod-2026-08-03-appraiser-qualifications",label:"Platform",date:"August 3, 2026",title:"Production Release — Appraiser Qualifications & Report Signing",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Appraisers now maintain their own qualification profile — summary, specialisations, education, and professional affiliations — used directly in the report."}
4661),o.jsx("li",{children:"Added external consultant appraisers as a reusable directory that can be attached to a valuation and credited in the report."}),o.jsx("li",{children:"Qualifications and consultant profiles now require Admin Appraiser approval before they can be used, with submit, approve, and reject steps."}),o.jsx("li",{children:"Admin Appraisers are notified whenever a profile is submitted for approval."}),o.jsx("li",{children:"Editing an approved profile sends it back for re-approval."}),o.jsx("li",{children:"Delivery is blocked until the signing appraiser's qualifications are approved, and Admin Appraisers are notified when an approval is holding up a delivery."}),o.jsx("li",{children:"Appraisers can upload a signature and designation, which appears on the report certification page."}),o.jsx("li",{children:"The delivering appraiser now selects a signing appraiser, and the report shows only that appraiser's qualifications."}),o.jsx("li",{children:"The non-signing appraiser is now credited in the certification page contribution paragraph."})]})})},{id:"prod-2026-08-03-appraiser-dashboard",label:"Platform",date:"August 3, 2026",title:"Production Release — Appraiser Dashboard & Notifications",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added an appraiser dashboard with a work summary, assigned valuations, items awaiting sign-off, and a valuations list."}),o.jsx("li",{children:"Completed work for the week is now reported as batches and individual valuations."}),o.jsx("li",{children:"Valuations list can be sorted by organisation name and shows the artwork image."}),o.jsx("li",{children:"Appraisers can view past delivered valuations for an artwork."}),o.jsx("li",{children:"New-request and due-soon notifications now go to Admin Appraisers and the assigned appraiser."})]})})},{id:"prod-2026-08-03-appraiser-messaging",label:"Platform",date:"August 3, 2026",title:"Production Release — Appraiser Messaging",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a private message thread on each valuation between the first and second appraiser."}),o.jsx("li",{children:"Includes in-app notifications, unread counts, and read-state syncing."})]})})},{id:"prod-2026-08-03-other-improvements",label:"Dev & Infra",date:"August 3, 2026",title:"Production Release — Other Improvements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Subscriptions now bill immediately and anchor future cycles to the valuation effective date."}),o.jsx("li",{children:"Delivery payment checks are skipped for appraiser-created on-demand valuations that have no linked request."}),o.jsx("li",{children:"Subscription skipping is now available to appraisers."}),o.jsx("li",{children:"Added pagination across appraiser list endpoints."}),o.jsx("li",{children:"Valuation-ready emails now include a dashboard link and support centre link, and no longer show valuation figures — only artwork title and artist."}),o.jsx("li",{children:"Various fixes to request grouping, appraiser name display, effective-date validation lead time, and support for longer artwork notes."})]})})},{id:"prod-2026-07-27-addepar-integration",label:"Integrations",date:"July 27, 2026",title:"Production Release — Addepar Integration",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Added a full integration that syncs collection valuations from Appraisal Bureau into Addepar, the wealth-management platform. Once a client connects their Addepar firm, appraised fair-market values flow automatically into an Addepar portfolio as investment positions and refresh on a nightly schedule."})})})},{id:"prod-2026-07-27-valuation-sync",label:"Platform",date:"July 27, 2026",title:"Production Release — Automated Valuation Sync",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added per-category valuation sync that posts collection FMV totals to Addepar as mark-to-market positions, broken down by medium category."}),o.jsx("li",{children:"Only delivered appraisals contribute to synced values, so in-progress or draft work never appears in a client's portfolio."}
4661),o.jsx("li",{children:"Added multi-currency support that converts non-USD appraisals through a live FX layer before posting."}),o.jsx("li",{children:`Added a custom "# of Artworks" attribute that publishes each category's artwork count alongside its value.`}),o.jsx("li",{children:"Valuation dates are clamped to the current day so future-dated appraisals no longer post future values that were hidden in as-of-today reports."})]})})},{id:"prod-2026-07-27-divestment",label:"Platform",date:"July 27, 2026",title:"Production Release — Divestment Handling",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added automatic transfer-out when every artwork in a category drops to zero (sold, deleted, or moved out): the position is zeroed with a transfer-out transaction and a $0 valuation snapshot, and the artwork count is reset."}),o.jsx("li",{children:"Added self-healing behaviour that resumes normal valuation posting on the same position if a category reappears later."})]})})},{id:"prod-2026-07-27-onboarding",label:"Integrations",date:"July 27, 2026",title:"Production Release — Connection & Onboarding",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a guided OAuth2 connection flow:"}),o.jsx("li",{children:"Generate consent URL → Authorize in Addepar → Exchange tokens → Provision portfolio → Sync active."}),o.jsx("li",{children:"Added the ability to select which workspaces are included in a client's sync."}),o.jsx("li",{children:"Added the ability to update sync configuration and disconnect an Addepar connection at any time."}),o.jsx("li",{children:"Added entity browsing that defaults to financial accounts so clients can pick the correct portfolio account during setup."})]})})},{id:"prod-2026-07-27-operations",label:"Dev & Infra",date:"July 27, 2026",title:"Production Release — Reliability & Operations",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a nightly sync scheduled daily across all active connected organisations."}),o.jsx("li",{children:"Added manual sync with dry-run support so a sync can be previewed without writing to Addepar."}),o.jsx("li",{children:"Added an idempotent pipeline with self-healing entity mappings and cleanup to keep Appraisal Bureau and Addepar consistent."}),o.jsx("li",{children:"Added retry logic, rate limiting, and cold-start warmup for reliable communication with the Addepar API."}),o.jsx("li",{children:"Added inbound webhook support with HMAC validation, plus health and status endpoints."}),o.jsx("li",{children:"Added a full sync-history audit log capturing status, counts, currencies used, duration, and errors for every run."})]})})},{id:"prod-2026-07-27-improvements",label:"Dev & Infra",date:"July 27, 2026",title:"Production Release — Other Improvements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a two-layer FX rate cache (in-memory → database → external rate API) for fast, resilient currency conversion."}),o.jsx("li",{children:"Cleaned up Addepar entity naming by stripping internal category prefixes when creating investment entities."})]})})},{id:"v2.0-valuation-tracking",label:"Platform",date:"May 12, 2026",title:"v2.0 — On-Demand Valuation Tracking & Subscription Alerts",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added in-app and email reminders for valuations due within the next 2 weeks."}),o.jsx("li",{children:"Reminder milestones now trigger at 14, 7, 3, and 1 day before the due date."})]})})},{id:"v2.0-loupe-invoices",label:"Platform",date:"May 12, 2026",title:"v2.0 — Loupe: AI Invoice Processing",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added end-to-e
4661nd invoice upload and AI extraction for artwork, shipping, storage, and framing invoices."}),o.jsx("li",{children:"Artwork invoices can automatically create artworks with acquisition data."}),o.jsx("li",{children:"Other invoice types support fuzzy-matched artwork linking or manual attachment."}),o.jsx("li",{children:"Cost entries are automatically added to artworks."}),o.jsx("li",{children:"Added CSV upload, image upload, document attachments, and integrated add-artwork flow from report detail pages."})]})})},{id:"v2.0-inbox-dashboard",label:"Platform",date:"May 12, 2026",title:"v2.0 — Inbox & Dashboard Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added new Inbox activity logs for artwork updates, valuation status, reports, and access changes."}),o.jsx("li",{children:"Added dashboard inbox feed and full paginated Inbox page."}),o.jsx("li",{children:"Updated navbar with dynamic page titles and redesigned notification experience."}),o.jsx("li",{children:"Improved workspace and members cards with cleaner layouts and activity visibility."})]})})},{id:"v2.0-ui-revamp",label:"Platform",date:"May 12, 2026",title:"v2.0 — UI Revamp",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Redesigned sidebar, navbar, workspace overview, artwork pages, portfolio, reports, valuation history, insurance, and billing pages."}),o.jsx("li",{children:"Added a new report detail layout with stats strip and inline access management."}),o.jsx("li",{children:"Introduced a refreshed dark-themed public/authentication experience."}),o.jsx("li",{children:"Added AB branding to login and registration pages."}),o.jsx("li",{children:"Standardised artwork dimensions display using the H × W × D format with support for framed, crate, and multi-part dimensions."})]})})},{id:"v2.0-onboarding",label:"Platform",date:"May 12, 2026",title:"v2.0 — Onboarding & Organization Management",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Introduced a new guided onboarding flow:"}),o.jsx("li",{children:"Setup Organization → Invite Team → Create Workspace → Dashboard"}),o.jsx("li",{children:"Added organisation switcher, new organisation settings pages, role management, ownership transfer, and delete organisation functionality."}),o.jsx("li",{children:"Organisation selection is now persisted locally and restored automatically."})]})})},{id:"v2.0-settings-email",label:"Platform",date:"May 12, 2026",title:"v2.0 — Settings & Email Updates",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Redesigned profile settings page with improved editing experience and preferences management."}),o.jsx("li",{children:"Merged security settings into the profile page."}),o.jsx("li",{children:"Updated base email templates with refreshed design and improved copy."})]})})},{id:"v2.0-other",label:"Dev & Infra",date:"May 12, 2026",title:"v2.0 — Other Improvements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added referral support in registration flow."}
4661),o.jsx("li",{children:"Added quantity field support in item forms."}),o.jsx("li",{children:"Added reusable saved market conditions in valuation sessions."}),o.jsx("li",{children:"Improved localStorage/session cleanup handling."}),o.jsx("li",{children:"Updated i18n keys for report detail pages (en and pt-BR)."})]})})},{id:"v1.3.11-reports",label:"Reports",date:"March 20, 2026",title:"v1.3.11 — Report Customization with Market Context",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"We've introduced the ability to incorporate client-specific market condition commentary directly into valuation reports. This is layered alongside our standardized quarterly market analysis, preserving consistency while enabling tailored insights where needed."})})})},{id:"v1.3.11-valuations",label:"Platform",date:"March 20, 2026",title:"v1.3.11 — Valuation Lifecycle Management",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"To ensure timely delivery and renewal of valuations, we've implemented a structured notification system:"}),o.jsx("li",{children:"Pre-due reminders at 14, 7, 3, and 1 day intervals"}),o.jsxs("li",{children:["Expiry alerts aligned to valuation type:",o.jsxs("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[o.jsx("li",{children:"FMV (6 months)"}),o.jsx("li",{children:"RRV (12 months)"})]})]}),o.jsx("li",{children:"This creates a more proactive and predictable valuation workflow for both appraisers and clients."})]})})},{id:"v1.3.11-system",label:"Dev & Infra",date:"March 20, 2026",title:"v1.3.11 — System & Communication Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"We've streamlined notification infrastructure and improved clarity across all automated communications:"}),o.jsx("li",{children:"Standardized email formatting and updated support access"}),o.jsx("li",{children:"Consolidated appraiser communications into a centralized inbox"}),o.jsx("li",{children:"Improved reliability and consistency of outbound system notifications"})]})})},{id:"v1.3.7-trial",label:"Platform",date:"February 9, 2026",title:"v1.3.7 — 30-Day Free Trial & Annual Billing Discount",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Introduced a 30-day free trial for new client registrations to allow full platform access before committing to a paid plan."}),o.jsx("li",{children:"Added a discounted annual billing option for clients who choose to pay 12 months upfront, offering cost savings compared to monthly billing."}),o.jsx("li",{children:o.jsx("strong",{children:"Updated pricing options"})}),o.jsx("li",{children:"1 seat: $540 annually (12 Months)"}),o.jsx("li",{children:"5-seat team bundle: $1,350 annually (12 Months)"})]})})},{id:"v1.3.7-data",label:"Dev & Infra",date:"February 9, 2026",title:"v1.3.7 — Data, Schema, and API",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added a Trial History table to track trial access and usage per user."}),o.jsxs("li",{children:["Introduced a ",o.jsx("code",{className:"bg-gray-100 px-1 rounded text-sm",children:"billing_period"})," field in the SubscriptionUser table to identify the active billing cycle (e.g., monthly or annual)."]}),o.jsxs("li",{children:["Added a ",o.jsx("code",{className:"bg-gray-100 px-1 rounded text-sm",children:"subscription_skip_type"})," field to the User table with enumerations: ADMIN_GRANTED (trial or access granted manually by an admin) and AUTO_TRIAL (trial access granted automatically during signup)."]})]})})},{id:"v1.3.6-pdf",label:"Reports",date:"February 6, 2026",title:"v1.3.6 — Mobile & Multi-Item PDF Export Fixes",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Fixed an issue where PDF exports from the Portfolio page failed on mobile devices, resulting in incorrect or unusable output."}),o.jsx("li",{children:"Resolved inconsistencies in multi-artwork PDF exports, ensuring a consistent number of artworks per page."})]})})},{id:"v1.3.6-mobile",label:"Platform",date:"February 6, 2026",title:"v1.3.6 — Mobile Portfolio Me
4661nu Layout Fix",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Fixed an issue on mobile devices where the menu bar overlapped the first artwork on the Portfolio page."})})})},{id:"v1.3.6-provenance",label:"Platform",date:"February 6, 2026",title:"v1.3.6 — Provenance Data Layout Alignment Fix",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Updated the artwork detail layout to align Provenance data with the right-hand data column, consistent with other artwork fields."})})})},{id:"v1.3.4-reports",label:"Reports",date:"January 6, 2026",title:"v1.3.4 — Reporting & PDFs",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added valuation examination dates to appraiser mode reports."}),o.jsx("li",{children:"Ensured reports generate correctly when artworks are selected across multiple workspaces."}),o.jsx("li",{children:"Improved handling of oversized Deed of Gift PDFs with clearer error messaging."}),o.jsx("li",{children:"Incorporated feedback and refinements to Charitable Donation reports."}),o.jsx("li",{children:"Improved dimension display formatting for artworks in reports."})]})})},{id:"v1.3.4-appraisal",label:"Appraiser",date:"January 6, 2026",title:"v1.3.4 — Appraisal Workflow",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Improved appraisal selection logic for greater consistency and accuracy."}),o.jsx("li",{children:"Enabled retroactive valuation requests where required."}),o.jsx("li",{children:"Added support for retroactive charitable donation dates."}),o.jsx("li",{children:"Display effective / requested valuation dates consistently across workflows."})]})})},{id:"v1.3.4-notifications",label:"Platform",date:"January 6, 2026",title:"v1.3.4 — Notifications & Tracking",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added notifications for appraisers when a one-time valuation is purchased."}),o.jsx("li",{children:"Notifications point to the associated item or workspace."})]})})},{id:"v1.3.4-portfolio",label:"Portfolio",date:"January 6, 2026",title:"v1.3.4 — Portfolio & Search",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Added a keyword search bar to the portfolio page for faster filtering."})})})},{id:"v1.3.4-comps",label:"Valuation Engine",date:"January 6, 2026",title:"v1.3.4 — Comparable Sales & Market Data",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Improved image handling for comparable sales."}),o.jsx("li",{children:"Enabled editing of comparable sales entries."})]})})},{id:"v1.3.4-security",label:"Dev & Infra",date:"January 6, 2026",title:"v1.3.4 — Platform & Security",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Updated the Next.js version to address a security vulnerability."}),o.jsx("li",{children:"General performance and stability improvements across valuation and reporting workflows."})]})})},{id:"v1.3.3-reports",label:"Reports",date:"December 11, 2025",title:"v1.3.3 — Reporting & PDFs",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Optimized export PDF so reports reliably download."}),o.jsx("li",{children:"Updated date formatting on IRS Form 8283."}),o.jsx("li",{children:"Made edits and refinements to Charitable Donation PDF reports."})]})})},{id:"v1.3.3-inventory",label:"Platform",date:"December 11, 2025",title:"v1.3.3 — Inventory & Export",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Enabled exporting of inventory together with associated valuations."})})})},{id:"v1.3.3-notifications",label:"Platform",date:"December 11, 2025",title:"v1.3.3 — Notifications & Communications",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Corrected email confirmation UI issues."}),o.jsx("li",{children:"Updated the text content in one-time valuation purchase emails."})]})})},{id:"v1.3.1-appraiser",label:"Appraiser",date:"October 31, 2025",title:"v1.3.1 — Appraiser Mode Upgrades",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Appraiser stats endpoint and UI (rc2 → rc3)."}),o.jsx("li",{children:"Sales table fixes and visibility scoped."}),o.jsx("li",{children:"Edit valuation: notes + add comparable sales."}),o.jsx("li",{children:"Appraisers can update item data without full permission validation where intended."})]})})},{id:"v1.3.1-valuation",label:"Valuation Engine",date:"October 31, 2025",title:"v1.3.1 — Valuation Workflow and UX",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:'Continued terminology unification to "valuation".'}),o.jsx("li",{children:"Currency formatting improvements."}),o.jsx("li",{children:"Wording updates on valuation pages."})]})})},{id:"v1.3.1-artists",label:"Platform",date:"October 31, 2025",title:"v1.3.1 — Artists and Items",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Edit published artists."}),o.jsx("li",{children:"Appraiser item inspect refactor."})]})})},{id:"v1.3.1-fixes",label:"Platform",date:"October 31, 2025",title:"v1.3.1 — Fixes and Quality",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Portfolio and appraiser routes, thumbnails, and layout polish."}),o.jsx("li",{children:"On-demand appraisal session handling."}),o.jsx("li",{children:"Backend: refactor default valuation-related settings."}),o.jsx("li",{children:"Backend: document generation handling regression refactor."})]})})},{id:"v1.3.1-dev",label:"Dev & Infra",date:"October 31, 2025",title:"v1.3.1 — Internal / DevEx",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Seeds and tests updated for appraiser flows."}),o.jsx("li",{children:"Housekeeping on migrations and archived artifacts."})]})})},{id:"v1.3.0-valuation",label:"Valuation Engine",date:"October 15, 2025",title:"v1.3.0 — Valuation Model Deprecation",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"We've streamlined how valuations work within the platform:"}),o.jsx("li",{children:"Valuation fields are now fully integrated into Appraisals, and the separate Valuation model has been deprecated."}),o.jsx("li",{children:'Email templates have been updated to use consistent "valuation" terminology.'})]})})},{id:"v1.3.0-onetime",label:"Appraiser",date:"October 15, 2025",title:"v1.3.0 — One-Time Appraisals",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Backend updates n
4661ow support:"}),o.jsx("li",{children:"Compatibility with bulk dialogs and the item-appraisals UI."}),o.jsx("li",{children:"Use of past effective dates where required."})]})})},{id:"v1.3.0-docusign",label:"Platform",date:"October 15, 2025",title:"v1.3.0 — DocuSign Integration",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Enhanced e-signature experience:"}),o.jsx("li",{children:"Added webhooks, backend updates, and frontend improvements."}),o.jsx("li",{children:"Signatures are now fully automated for donees, streamlining the charitable donation process."}),o.jsx("li",{children:"Users track the signature status in-app and receive auto notifications."})]})})},{id:"v1.3.0-donations",label:"Platform",date:"October 15, 2025",title:"v1.3.0 — Charitable Donations",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Expanded support for IRS Form 8283 workflows:"}),o.jsx("li",{children:"Added new 8283 fields and a Deed of Gift modal."}),o.jsx("li",{children:"Donation year now inferred automatically from the donation date."}),o.jsx("li",{children:"Improved donation pages, pricing parity with the website, and PDF output."}),o.jsx("li",{children:"General logic and performance enhancements throughout the donation flow."})]})})},{id:"v1.3.0-appraiser",label:"Appraiser",date:"October 15, 2025",title:"v1.3.0 — Appraiser Mode Foundations",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Building the next layer of professional tools:"}),o.jsx("li",{children:"Added Comparable Sales field and Appraiser Search functionality."}),o.jsx("li",{children:"Introduced Appraiser cards and board view."}),o.jsx("li",{children:"New Market Conditions entity with full CRUD support."}),o.jsx("li",{children:"Reports automatically attach the closest market conditions."}),o.jsx("li",{children:"Display effective date alongside FMV/RRV in report documents."})]})})},{id:"v1.3.0-safety",label:"Platform",date:"October 15, 2025",title:"v1.3.0 — Safety Rails",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Added new safeguards for data integrity and compliance:"}),o.jsx("li",{children:"Prevent report generation for Appraisals over $50k without 3 comparable sales."}),o.jsx("li",{children:"Added frontend validation for high-value appraisals."})]})})},{id:"v1.3.0-data",label:"Dev & Infra",date:"October 15, 2025",title:"v1.3.0 — Data, Schema, and API",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Upgraded relevant fields to bigint where appropriate."}),o.jsx("li",{children:"Extended Cycles API to support purchased artworks."}),o.jsx("li",{children:"Deduplicated draft artists on bulk create; improved in-memory slug handling."})]})})},{id:"v1.3.0-integrations",label:"Platform",date:"October 15, 2025",title:"v1.3.0 — Integrations and Platform",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Fixed Sentry middleware to capture API errors in production."}),o.jsx("li",{children:"Added FullStory analytics on the frontend."}),o.jsx("li",{children:"Image gallery improvements: reorder, set primary image, and fix URL handling."})]})})},{id:"v1.3.0-ux",label:"Platform",date:"October 15, 2025",title:"v1.3.0 — UX and Copy",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Wording improvements to donation flow and attestation checkbox."}),o.jsx("li",{children:"Faster portfolio thumbnail loading; layout fixes for long item names."}),o.jsx("li",{children:"Auto-refresh invoice status on appraisal cards."}),o.jsx("li",{children:"Workspaces now sorted alphabetically."}),o.jsx("li",{children:"Currency formatting applied consistently across the UI."})]})})},{id:"v1.3.0-dev",label:"Dev & Infra",date:"October 15, 2025",title:"v1.3.0 — Internal / Developer Experience",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Archived executed migrations for cleaner trees."}),o.jsx("li",{children:"Added seeds for artists, workspaces, and items to improve local testing."}),o.jsx("li",{children:"Transaction wrapping for item uploads; fixed Jest connection error."}),o.jsx("li",{children:"Refactored serializers and added leap-case test coverage."})]})})},{id:"v1.2.0-artwork",label:"Platform",date:"August 4, 2025",title:"v1.2.0 — Artwork Dataset Refactor",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"We've improved how artworks and artists are managed. Artists can now be edited directly, and the system better handles data consistency."})})})},{id:"v1.2.0-bulk",label:"Platform",date:"August 4, 2025",title:"v1.2.0 — Smarter Bulk Actions",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:'Implemented bulk operations like archive, restore, and delete, with improved "Select All" functionality.'}),o.jsx("li",{children:"Implemented bulk Subscription to Artwork for grouped appraisal requests."})]})})},{id:"v1.2.0-ui",label:"Platform",date:"August 4, 2025",title:"v1.2.0 — UI and Navigation Improvements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Portfolio navigation now remembers your page, filters, and sorting when returning from an artwork."}),o.jsx("li",{children:"Artwork detail view allows direct navigation to next or previous artworks without losing filters."})]})})},{id:"v1.2.0-email",label:"Platform",date:"August 4, 2025",title:"v1.2.0 — Email Templates & Minor Changes",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsx("li",{children:"Enhanced email templates, minor corrections, bullet point styling."})})})},{id:"v1.2.0-infra",label:"Dev & Infra",date:"August 4, 2025",title:"v1.2.0 — Infrastru
4661cture and Performance",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Finalized Sentry integration for improved error tracking."}),o.jsx("li",{children:"Optimized backend lambdas for faster processing."}),o.jsx("li",{children:"Completed migration of the frontend to Vercel for better stability and speed."})]})})},{id:"v0.2.5-bulk-actions",label:"Access & Sharing",date:"April 4, 2025",title:"v0.2.5 — Bulk Actions & Access Management",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk access request handling:"})," Accept, reject, or block multiple access requests in one action."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Access request UI updates:"})," Requests are now grouped by requester. Pagination has been removed for easier management."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved access control enforcement:"})," Restricted actions are now disabled based on user role (e.g. CW users)."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Workspace Access Management:"})," Access panel now auto-lists organization members—manual email input no longer required."]})]})})},{id:"v0.2.5-uploads",label:"Platform",date:"April 4, 2025",title:"v0.2.5 — Bulk Uploads & Sharing",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Resolved large upload timeouts:"})," Bulk uploads with 200+ files now complete reliably."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved CSV handling:"})," More flexible field support. Better error handling for malformed or incomplete data."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk item sharing:"})," Share multiple items from the Portfolio via the AccessItem component. Supports role-based permissions."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Better sharing UX:"})," Visual and interaction improvements to sharing flow."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Fixed item/image match issues:"})," Logic improved to ensure image files correctly match their items."]})]})})},{id:"v0.2.5-ui",label:"Platform",date:"April 4, 2025",title:"v0.2.5 — Portfolio, Dashboard & UI Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Refined layout & navigation:"})," Updated sidebar, navbar, and dashboard pagination."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Visual upgrades:"})," Sharper styling and improved theming across key UI areas."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Branding & workflow updates:"})," Clearer upload instructions. Improved component naming and structure."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Public-facing improvements:"})," Organization logos now display on public pages and during registration."]})]})})},{id:"v0.2.5-docs",label:"Reports",date:"April 4, 2025",title:"v0.2.5 — Document Generation & Reporting",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"500 error resolved:"})," Fixes a crash when generating documents with incomplete data."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Pagination fix:"})," Single document views now paginate correctly."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Visual templating complete:"})," Template structure finalized for custom and appraiser reports."]})]})})},{id:"v0.2.5-payments",label:"Platform",date:"April 4, 2025",title:"v0.2.5 — Subscription & Payment Systems",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Updated customer mapping:"})," SubscriptionArtwork now updates customerId in Stripe."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Conditional payment method display:"})," Payment methods now show or hide based on context."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Nested data fix:"})," PaymentMethod request structure now accepts nested fields without error."]})]})})},{id:"v0.2.5-appraiser",label:"Appraiser",date:"April 4, 2025",title:"v0.2.5 — Appraiser Platform Updates",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Improved appraisal endpoints:"})," getAppraisals now excludes delivered appraisals. Delivered appraisals moved to a separate paginated endpoint."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Appraiser layout components:"})," New authenticated layout tailored for appraiser workflows."]})]})})},{id:"v0.2.5-system",label:"Dev & Infra",date:"April 4, 2025",title:"v0.2.5 — System Enhancements & Dev Tools",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Schema updates:"})," Text fields now support longer inputs."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Relational filter fix:"})," Resolved operator/non-operator logic issues in nested filters."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Initial CSV template support:"})," Basic CSV templates now available for bulk workflows."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Logo image handling:"})," Improved async upload support for organization logos."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Templating system groundwork:"})," Foundation laid for custom PDF and visual templating."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Registration improvements:"})," New users must now provide address and required fields at sign-up."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved sorting:"})," Enabled sorting on shared table components."]})]})})},{id:"v0.2.4-valuation",label:"Valuation Engine",date:"March 10, 2025",title:"v0.2.4 — Valuation & Appraiser Mode",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Appraiser artwork comparable sales:"})," Introduced a dedicated section with common table and modal for managing artwork comparable sales in appraiser mode."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Validation improvements:"})," Appraisers are warned if they submit valuations without linked artwork comparable sales."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved item fetch and endpoints:"})," Optimized logic for fetching items in appraiser mode."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk appraisal submission:"})," Implemented /appraisals/bulk POST endpoint for faster on-demand mode workflows."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Deprecated appraisal statuses:"})," COMPLETED status has been deprecated for consistency."]})]})})},{id:"v0.2.4-items",label:"Platform",date:"March 10, 2025",title:"v0.2.4 — Items, Documents & Archival",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Prevented deletion:"})," Items and documents now use a .status enum (PUBLISHED, ARCHIVED) instead of hard deletes."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Archive & restore endpoints:"})," New /archive and /restore endpoints let users safely archive and unarchive items and documents."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Document improvements:"})," Documents are now populated when fetching items. Improved layout."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk report enhancements:"}),' Added "Select All" for bulk report generation. Improved Generate Report button layout.']}),o.jsxs("li",{children:[o.jsx("strong",{children:"Report validation:"})," Mailing address is now validated."]})]})})},{id:"v0.2.4-dashboard",label:"Portfolio",date:"March 10, 2025",title:"v0.2.4 — Dashboard & Portfolio",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"New portfolio grid view:"})," A new grid layout is now available for Portfolio items."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved dashboard interactivity:"})," Linked dataset images, made collections/tags clickable, and added empty-state placeholders."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Layout polish:"})," Improved single item page layout and dashboard workflow cards, including mobile views."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Filters and autocomplete:"})," Refined portfolio filters and unified autocomplete for artist and artwork fields."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk item tagging:"})," Users can now apply tags to multiple items at once directly from the Portfolio view."]})]})})},{id:"v0.2.4-access",label:"Access & Sharing",date:"March 10, 2025",title:"v0.2.4 — Acce
4661ss & Organization",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Improved access request views:"})," Displayed organization names and organization ID. Sent requests are now shown in a dedicated section."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Batched email logic:"})," Bulk access-granted emails are now batched to avoid spamming recipients."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved organization display:"})," Access responses and request pages now show cleaned-up org names."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Skipping cross-org checks:"})," Internal access organizations are no longer blocked by cross-org checks."]})]})})},{id:"v0.2.4-layout",label:"Platform",date:"March 10, 2025",title:"v0.2.4 — App Layout, Navigation & Styling",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Breadcrumb and nav consistency:"})," Standardized breadcrumb navigation across authenticated views."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Renaming for clarity:"}),' Renamed "portfolio" to "workspace" in several UI elements. Standardized naming across components.']}),o.jsxs("li",{children:[o.jsx("strong",{children:"Sidebar & layout tweaks:"})," Removed sidebar logo link when no workspace is selected. Synced theme toggle with system preferences."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Responsive design fixes:"})," Fixed layout issues on large screens. Improved SubscriptionArtwork UI and details view."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Autocomplete improvements:"})," Improved support and unification of artist/artwork autocomplete across filters and forms."]})]})})},{id:"v0.2.4-backend",label:"Dev & Infra",date:"March 10, 2025",title:"v0.2.4 — Backend & Infrastructure",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"TanStack Query:"})," Integrated React Query for notifications"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"React compiler:"})," Enabled for improved performance"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Timezone handling:"})," UTC now enforced; dayjs no longer adapts to local time"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Upload improvements:"})," Generalized S3 upload method; fixed filename display and ZIP handling"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Database:"})," Added connection pooling and retry logic to avoid SQL timeouts"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Security:"})," Prevented auth token injection on auth routes"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Deprecations:"})," Removed legacy ArtworkComparables schema; cleaned up hardcoded date logic"]})]})})},{id:"v0.2.3-bulk-actions",label:"Access & Sharing",date:"February 3, 2025",title:"v0.2.3 — Bulk Actions & Access Management",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk access request handling:"})," You can now accept, reject, or block multiple access requests at once from a single view."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Access request UI updates:"})," Requests are now grouped by requester, and pagination has been removed for easier management."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved access control enforcement:"})," Restricted actions are now disabled in the UI based on role (e.g. CW users)."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Workspace Access Management:"})," The access panel now auto-lists organization members—no more manual email input."]})]})})},{id:"v0.2.3-uploads",label:"Platform",date:"February 3, 2025",title:"v0.2.3 — Bulk Uploads & Sharing",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Resolved large upload timeouts:"})," Bulk uploads with 200+ files now process reliably without timeout errors."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved CSV handling:"})," More flexible field support and error tolerance during bulk item imports."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Bulk item sharing:"})," Fully implemented! Share multiple items from Portfolio using role-based permissions via the AccessItem component."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Better sharing UX:"})," Visual and interaction updates improve clarity and flow across all bulk sharing actions."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Fixed item/image match issues:"})," Resolved logic bugs that caused incorrect matches during item-image pairing."]})]})})},{id:"v0.2.3-ui",label:"Platform",date:"February 3, 2025",title:"v0.2.3 — Portfolio, Dashboard & UI Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Refined layout & navigation:"})," Updated sidebar structure, navbar layout, and dashboard pagination for a cleaner user experience."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Visual upgrades:"}
4661)," Sharper visuals across dashboards and key UI components, with styling updates and theme fixes throughout."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Branding & workflow updates:"})," Improved bulk upload instructions, component naming, and workflow clarity across pages."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Public-facing improvements:"})," Added support for organization logos on public pages and registration views."]})]})})},{id:"v0.2.3-docs",label:"Reports",date:"February 3, 2025",title:"v0.2.3 — Document Generation & Reporting",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"500 error resolved:"})," Addressed a rare crash when generating documents with incomplete or invalid data."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Pagination fix:"})," Single document views now paginate correctly."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Visual templating complete:"})," Finalized the design structure for upcoming templated reports and custom document layouts."]})]})})},{id:"v0.2.3-payments",label:"Platform",date:"February 3, 2025",title:"v0.2.3 — Subscription & Payment Systems",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Conditional payment method display:"})," Payment method components now render only when appropriate."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Nested data fix:"})," PaymentMethod request bodies now process nested fields correctly."]})]})})},{id:"v0.2.3-appraiser",label:"Appraiser",date:"February 3, 2025",title:"v0.2.3 — Appraiser Platform Updates",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Improved appraisal endpoints:"})," getAppraisals now excludes delivered appraisals; delivered ones are moved to a paginated endpoint."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Appraiser layout components:"})," Introduced authenticated layouts specific to appraiser workflows for a more tailored experience."]})]})})},{id:"v0.2.3-system",label:"Dev & Infra",date:"February 3, 2025",title:"v0.2.3 — System Enhancements & Dev Tools",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Schema updates:"})," Text fields now support longer inputs across key entities."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Relational filter fix:"})," Resolved operator/non-operator logic error in nested filters."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Initial CSV template support:"})," Early logic introduced for generating pre-filled CSVs for bulk workflows."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Logo image handling:"})," Async upload handling improved for branding images during setup."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Templating system groundwork:"})," Early structure implemented for future visual and PDF templates."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Registration improvements:"})," Address and required fields now collected during user onboarding."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved sorting:"})," Enabled sortable columns across shared table components."]})]})})},{id:"v0.2.3-stability",label:"Platform",date:"February 3, 2025",title:"v0.2.3 — Stability & Cleanup",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"Resolved workspace switching error and removed deprecated store-side error setters"}),o.jsx("li",{children:"Addressed theme and layout inconsistencies across pages"}),o.jsx("li",{children:"Minor visual, UX, and interaction-level improvements"}),o.jsx("li",{children:"Updated dependency handling and async flow fixes in core components"})]})})},{id:"v0.2.0-dev",label:"Dev & Infra",date:"December 2, 2024",title:"v0.2.0 — Dev & Infra Updates",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsx("li",{children:"CI/CD configured for Next.js"}),o.jsx("li",{children:"Provider context introduced"}),o.jsx("li",{children:"Clients summary view added"}),o.jsx("li",{children:"Prettier + ESLint config updated"}),o.jsx("li",{children:"Redirect and route logic simplified"}),o.jsx("li",{children:"Change methods converted to POST"}),o.jsx("li",{children:"GitHub PR template added"})]})})},{id:"v0.2.0-quality",label:"Platform",date:"December 2, 2024",title:"v0.2.0 — Quality-of-Life Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Clear state on logout:"})," Zustand store is now fully cleared on sign-out, improving session hygiene."]}
4661),o.jsxs("li",{children:[o.jsx("strong",{children:"Title click = home:"})," Clicking the site title now returns you to the dashboard."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Streamlined entity access endpoint:"})," Simplified the backend call structure for managing access."]})]})})},{id:"v0.2.0-nav",label:"Platform",date:"December 2, 2024",title:"v0.2.0 — Navigation & Experience",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"New layout system:"})," Fully responsive design across devices."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved redirects:"})," Cleaned up routing behavior for providers, workspaces, and title navigation."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Appraiser mode:"})," Early pages in place for appraiser-specific workflows."]})]})})},{id:"v0.2.0-access",label:"Access & Sharing",date:"December 2, 2024",title:"v0.2.0 — Access & Sharing Improvements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Refactored sharing logic:"})," Share, accept, and reject flows have been rebuilt for clarity and reliability."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved access management:"})," More granular controls across organization and workspace settings."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Block/unblock requests:"})," Admins can now manage access requests more effectively with new block/unblock tools."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Public access routes:"})," Added support for email confirmation, password reset, and resending invites."]})]})})},{id:"v0.2.0-portfolio",label:"Portfolio",date:"December 2, 2024",title:"v0.2.0 — Portfolio & Item Features",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"New Portfolio table:"})," Introduced a responsive, MUI-based table with bulk actions for managing items at scale."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Single item views:"})," Created detailed item pages with placeholders for notes, attachments, tags, and artwork data."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Editable item details:"})," Users can now directly update object information from the item view."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Image support:"})," Enhanced image handling and display across single item pages."]})]})})},{id:"v0.2.0-platform",label:"Platform",date:"December 2, 2024",title:"v0.2.0 — Platform Foundations",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Initial platform setup:"})," Core structure now supports workspaces, items, and user access flows."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Workspace logic expanded:"})," Steps for workspace setup are in place, and workspace types are now computed automatically."]})]})})},{id:"v0.1.3-bulk",label:"Platform",date:"December 1, 2024",title:"v0.1.3 — Bulk Upload Stability",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsxs("li",{children:[o.jsx("strong",{children:"Image assignment fix:"})," Resolved an issue where images were not consistently linking to the correct items during bulk uploads. All uploaded media now maps accurately based on the filenames in your CSV."]})})})},{id:"v0.1.2-bulk",label:"Platform",date:"November 30, 2024",title:"v0.1.2 — Bulk Upload Flexibility",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"ZIP file now optional:"})," You can now upload bulk CSV files without attaching a ZIP of images. This is useful for data-only imports or when image files are being handled separately."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Images column can be empty:"})," The images column in your CSV no longer needs to be populated. Empty fields won't block the upload process, allowing more flexible workflows."]})]})})},{id:"v0.1.1-workspace",label:"Platform",date:"November 28, 2024",title:"v0.1.1 — Workspace Creation Improvement",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsxs("li",{children:[o.jsx("strong",{children:"Auto-populated organization:"})," When creating a new workspace, the associated organization is now automatically pre-filled based on your account. This reduces setup time and prevents configuration errors."]})})})},{id:"v0.1.1-aws",label:"Platform",date:"November 28, 2024",title:"v0.1.1 — AWS Deployment Support",content:o.jsx("div",{children:o.jsx("ul",{className:"list-disc pl-5 space-y-2",children:o.jsxs("li",{children:[o.jsx("strong",{children:"Example AWS config added:"})," A sample configuration file is now included to guide AWS environment setup. This is ideal for teams deploying the platform in private cloud or hybrid environments."]})})})},{id:"v0.1.0",label:"Valuation Engine",date:"November 12, 2024",title:"v0.1.0 — Valuation Engine Updates",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Smarter comp selection:"})," Enhanced logic now surfaces more relevant market comparables based on object metadata, condition, and provenance."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Improved category precision:"})," Specialty and high-value segments now benefit from finer-tuned valuation profiles."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Faster processing:"})," Optimized backend architecture reduces turnaround time for valuation results across the platform."]})]})})},{id:"v0.1.0-search",label:"Search & Filters",date:"November 12, 2024",title:"v0.1.0 — Saved Search Filters",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Custom filters:"})," Save filters by artist, medium, creation date, or risk rating."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Persistent across sessions:"})," Your saved searches are always available when you return."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Ideal for repeat reviews:"})," Great for insurance underwriters, collection managers, and anyone tracking specific segments over time."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Supports underwriting workflows:"})," Quickly return to risk-specific searches to assist with quoting and client onboarding."]})]})})},{id:"v0.1.0-reports",label:"Reports",date:"November 12, 2024",title:"v0.1.0 — On-Demand Report Generation",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Instant PDFs:"})," Download valuation reports directly from object and collection views."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Always current:"})," Reports reflect the most recent data and valuation status at the time of download."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Presentation-ready:"})," Formatted for easy sharing with clients, insurers, or other stakeholders."]})]})})},{id:"v0.1.0-performance",label:"Performance",date:"November 12, 2024",title:"v0.1.0 — Performance & Usability Enhancements",content:o.jsx("div",{children:o.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Faster load times:"})," Up to 40% improvement across search, collection, and object detail views."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Image handling upgrades:"})," Smoother upload and rendering for large or high-res media."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Multi-account access:"})," Seamlessly switch between client views without logging out."]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Interface polish:"})," Subtle layout refinements for improved navigation—especially on mobile and tablet."]})]})})}],Lse=["All Posts",...Array.from(new Set(g5.map(e=>e.label)))],zse=()=>{const[e,t]=D.useState(""),[r,n]=D.useState("All Posts"),s=g5.filter(a=>{const i=!e||a.title.toLowerCase().includes(e.toLowerCase())||a.label.toLowerCase().includes(e.toLowerCase()),l=r==="All Posts"||a.label===r;return i&&l});return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Changelog — Appraisal Bureau",description:"Stay up to date with the latest product updates, improvements, and new features from Appraisal Bureau.",canonical:"/release-notes"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Changelog"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"What's new"}),o.jsx("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-2xl",children:"Product updates, improvements, and new features from the Appraisal Bureau team."})]})}),o.jsx("section",{className:"border-t border-gray-200 bg-white",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16 md:py-20",children:o.jsxs("div",{className:"flex flex-col md:flex-row gap-12 md:gap-16",children:[o.jsx("aside",{className:"md:w-56 shrink-0",children:o.jsxs("div",{className:"sticky top-28",children:[o.jsxs("div",{className:"relative mb-8",children:[o.jsx(hR,{className:"absolute left-0 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}
4661),o.jsx(fa,{placeholder:"Search",value:e,onChange:a=>t(a.target.value),className:"pl-7 bg-transparent border-0 border-b border-gray-200 rounded-none focus-visible:ring-0 focus-visible:border-[#220E99] text-sm font-light placeholder:text-gray-400"})]}),o.jsx("p",{className:"text-[11px] font-semibold tracking-[0.22em] uppercase text-gray-400 mb-5",children:"Filter"}),o.jsx("ul",{className:"space-y-1",children:Lse.map(a=>{const i=r===a;return o.jsx("li",{children:o.jsx("button",{onClick:()=>n(a),className:`w-full text-left py-1.5 text-sm font-light transition-colors ${i?"text-[#220E99]":"text-gray-500 hover:text-ab-ink"}`,children:a})},a)})})]})}),o.jsx("div",{className:"flex-1 min-w-0",children:s.length===0?o.jsx("p",{className:"text-gray-400 text-center py-16 font-light",children:"No updates found."}):o.jsx("div",{className:"divide-y divide-gray-200",children:s.map(a=>o.jsxs("article",{className:"py-12 first:pt-0",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[o.jsx("span",{className:"text-[11px] font-semibold tracking-[0.22em] uppercase text-[#220E99]",children:a.label}),o.jsx("span",{className:"h-px flex-1 bg-gray-200"}),o.jsx("span",{className:"text-xs text-gray-400 font-light tracking-wide",children:a.date})]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-2xl md:text-3xl leading-tight tracking-tight mb-5",children:a.title}),o.jsx("div",{className:"prose prose-gray max-w-none text-gray-700 font-light prose-p:font-light prose-li:font-light prose-headings:font-newsreader prose-headings:font-light prose-headings:text-ab-ink",children:a.content})]},a.id))})})]})})})]}),o.jsx(yn,{})]})},y5=D.createContext(null),Bse=({children:e})=>{const t=D.useRef(null);return o.jsx(y5.Provider,{value:t,children:e})},v5=()=>{const e=D.useContext(y5);if(!e)throw new Error("useChatWidget must be used within ChatProvider");return e},_5=[{id:"create-organization",category:"Getting Started",title:"Create Your Organization",summary:"An Organization represents the core account structure for managing your collection.",content:`An Organization represents the core account structure. A single user can create unlimited Organizations, each with its own users and workspaces.
4662
4663Organizations typically represent individual collectors, corporate collections, family offices, institutions, museums, etc. Art Advisors may set up an Organization with a Workspace for each of their clients.
4664
4665## Permission Levels
4666
4667Each Organization has two permission levels:
4668
4669- **Administrators:** Full access, including organization settings, user management, and the ability to see values
4670- **Members:** Can access the Organization but cannot change settings
4671
4672**Note:** Only Administrators can view appraised values and manage Appraisal Reports.`},{id:"set-up-workspaces",category:"Getting Started",title:"Set Up Workspaces",summary:"Create unlimited Workspaces within each Organization to manage distinct projects, clients, or business units.",content:`Within each Organization, you can create unlimited Workspaces to manage distinct projects, clients, or business units.
4673
4674## Key Things to Know
4675
4676- Workspaces are created by Organization Administrators
4677- Users must be added to each Workspace individually, even if they already belong to the Organization
4678- A single user can belong to many Workspaces across multiple Organizations
4679
4680## Workspace Permissions
4681
4682- **Viewer:** Access to basic cataloguing details, restricted from valuation data
4683- **Editor:** All Viewer access, plus ability to upload/edit artwork data, view appraised values, and generate Appraisal Reports
4684- **Manager:** All Editor access, plus full access to Workspace settings
4685
4686Only Workspace Managers and Editors can see valuation figures and appraisal documents.
4687
4688## Account Policy
4689
4690- If you are removed from an Organization and are not a member of any other Organization, your account will be deleted after 30 days. This action is not reversible.
4691- If you are removed from a Workspace, you will still retain access to the Organization, but will no longer see artworks or valuations in that Worksp
4691ace.`},{id:"upload-artworks",category:"Getting Started",title:"Upload Artworks",summary:"Learn how to upload single or multiple artworks to your Workspace portfolio.",content:`Artworks are uploaded at the Workspace level, so ensure you're in the correct Workspace before adding items.
4692
4693## 1. Upload a Single Artwork
4694
4695From the Dashboard or Portfolio Page, click **"Add Artwork"** and follow the prompts to manually input metadata and upload images.
4696
4697## 2. Upload Multiple Artworks
4698
4699- From the **"Add Artwork"** button, select **"+ Multiple Artworks"**
4700- Download the provided CSV template with defined fields and examples
4701- Fill out the template using a consistent naming convention
4702- Name your image files to match the artwork names in the CSV exactly
4703- Zip your images and upload both the CSV and image zip
4704
4705If there are any errors (e.g., mismatches or missing fields), you'll receive messages to correct them.
4706
4707## 3. Archive or Delete Artworks
4708
4709- **To Archive:** Use the "Archive" button on an individual artwork page, or select multiple from Portfolio and choose bulk "Archive". Archived artworks can be restored at any time by toggling **"Show Archived"** in Portfolio view.
4710- **To Delete:** Choose "Delete" on an artwork page to permanently remove it. This action is irreversible.`},{id:"subscribe-valuations",category:"Valuations",title:"Subscribe to Valuations",summary:"Set up valuation subscriptions for your artworks including FMV, RRV, and more.",content:`Valuation subscriptions are per artwork and include:
4711
4712- **Fair Market Value (FMV)**
4713- **Retail Replacement Value (RRV)**
4714
4715## Choose Your Frequency
4716
4717- Yearly
4718- Semi-Annually
4719- Quarterly
4720
4721## Use Cases
4722
4723These values serve multiple purposes including:
4724
4725- Insurance
4726- Financial Reporting
4727- Collateral Loans
4728- Charitable Donation
4729- Acquisition / Potential Sale
4730- Tax & Estate Planning
4731
4732Once subscribed and a delivery date is selected, your valuation is underway. You'll be notified by email once your appraisal is ready to view. Anyone with access to the artworks will receive the automated notification.`},{id:"view-valuations",category:"Valuations",title:"View Valuations",summary:"Understand valuation validity periods and how to check appraisal status.",content:`On each artwork's page, you'll see the date of the **Last Appraisal** for that artwork.
4733
4734## Validity Periods
4735
4736- **FMV** is valid for **6 months**
4737- **RRV** is valid for **1 year**
4738
4739**Note:** You may only generate Appraisal Reports for artworks with valid appraised values. If you generate a report with multiple works, any without valid valuations will not be included in the report.`},{id:"generate-reports",category:"Reports",title:"How to Generate Appraisal Reports",summary:"Generate, download and share USPAP-compliant Appraisal Reports on demand.",content:`Appraisal Bureau makes it easy to generate professional appraisal reports on demand — whether for one artwork or hundreds at once.
4740
4741## 1. Before You Start
4742
4743Your artwork must have a valid valuation already delivered:
4744
4745- **FMV** reports are valid for **6 months**
4746- **RRV** reports are valid for **1 year**
4747
4748If your valuation has expired, request a new appraisal directly from the artwork page.
4749
4750## 2. Generate for a Single Artwork
4751
4752- Navigate to the Artwork page
4753- Click **"Generate Report"**
4754- Confirm or update the Requestor, Owner, and mailing address
4755- Click **Generate** — the report will be created in seconds
4756
4757## 3. Generate in Bulk
4758
4759- Go to the **Portfolio** page
4760- Use filters or tags to narrow down artworks
4761- Select individually or click **Select All**
4762- Click **"Generate Report"** and confirm the same details
4763
4764## 4. Where to Find Your Reports
4765
4766All reports appear in the **Reports** tab where you can:
4767
4768- View each report
4769- Download a PDF copy
4770- Share the report with another user
4771
4772**Note:** Sharing a report does not give access to the artwork or its valuation — only to the specific PDF document.`},{id:"adding-people",category:"Access & Sharing",title:"Adding People to Your Organizations and Workspaces",summary:"Invite team members and manage access for art owners and service providers.",content:`Both Art Owners and Service Providers can manage team members by inviting them to their organizations or workspaces.
4773
4774## Step 1: User Account Setup
4775
4776Before someone can be added, they must first create a user account on the platform.
4777
4778## Step 2: Sending an Invitation
4779
4780An **Admin** within the organization can send an invitation to the user.
4781
4782## Step 3: Accepting an Invitation
4783
4784The invited user will:
4785
4786- Navigate to the **Invitations** tab in the left-hand navigation bar
4787- Go to **Organizations** to view pending invitations
4788- Choose to **Accept**, **Reject**, or **Block** the invitation
4789
4790The same process applies for Workspace invitations.
4791
4792## Super Admin Settings
4793
4794A Super Admin may configure an organization so that when members are added, they are automatically added to specific workspaces — ensuring smooth onboarding across teams.`},{id:"sharing-artwork-service-providers",category:"Access & Sharing",title:"Sharing Artwork Access to Service Providers",summary:"Share artworks with service providers for insurance, loans, portfolio management and more.",content:`Art Owners can easily share artworks with Service Providers for management of insurance coverage, loans, portfolio management and more.
4795
4796## How to Share Artworks
4797
4798Artworks can be shared in two ways:
4799
4800- **From the Portfolio Page:** Select one or more artworks and click the **Share** button
4801- **From an Individual Artwork Page:** Navigate to the specific artwork and click **Share**
4802
4803## Selecting a Service Provider
4804
4805- Begin typing the organization name of the provider
4806- If they have an account, their name will auto-populate in the dropdown
4807- Select the organization
4808- Enter the email address of your contact within that organization
4809- Choose the desired level of access
4810
4811## Receiving and Managing Invitations
4812
4813Service Providers can manage shared artworks by clicking **Invitations** in the left-hand navigation bar. From there, they may:
4814
4815- **Accept** the shared artwork
4816- **Reject** the invitation
4817- **Block** further sharing from that Art Owner`},{id:"using-tags",category:"Getting Started",title:"How to Use Tags in Appraisal Bureau",summary:"Create and manage Tags to organize your artworks with flexible, searchable labels.",content:`Tags are a flexible way to organize your artworks. They work similarly to Gmail labels and can be used for curatorial lists, shipping groups, internal notes, or thematic categories.
4818
4819Each tag has two data fields:
4820
4821- **Attribute** (or Category) — such as Color, Theme, or Exhibition
4822- **Detail** — such as Red, Floral, or Art Basel 2025
4823
4824## 1. What Tags Are Used For
4825
4826- Grouping works for curatorial or exhibition planning
4827- Creating internal filters (e.g., Needs Review, Hold for Consignment)
4828- Organizing artworks for shipping or logistics
4829- Adding metadata such as medium, style, or condition
4830- Tagging thematic elements like Color: Blue or Subject: Portrait
4831
4832## 2. How to Tag Artworks
4833
4834**In bulk** (from the Portfolio page):
4835
4836- Select one or more artworks
4837- Click the **"Tag"** icon at the top
4838- Choose an existing tag or create a new one with both Attribute and Detail fields
4839
4840**Individually:**
4841
4842- Open the Artwork record
4843- Click **"+ Tag"**
4844- Select or create a tag
4845
4846## 3. How to Manage Tags
4847
4848From the Dashboard, click **"Manage Tags"** to:
4849
4850- Turn tags **ON** or **OFF** (OFF tags are hidden but not deleted)
4851- Edit the Attribute or Detail of a tag
4852- Delete a tag entirely (removes it from all artworks)
4853
4854**Tip:** If you're not ready to delete a tag but don't want it to display, just turn it OFF.`},{id:"loupe-overview",category:"Loupe",title:"What is Loupe?",summary:"Loupe is the AI data ingestion engine that turns any document into structured artwork and cost data.",content:`Loupe is the AI data ingestion engine inside Appraisal Bureau. Drop in any type of document — artwork invoices, shipping receipts, framing quotes, storage statements, conservation reports, condition reports and more — and Loupe parses the relevant data, attaches the original PDF, and routes it to the right place in your portfolio.
4855
4856## What Loupe Does
4857
4858- Reads any document type (PDF, image, scan)
4859- Extracts the relevant metadata automatically
4860- Creates new artwork pages from artwork invoices
4861- Matches cost invoices to existing artworks
4862- Attaches the original document to the artwork record for audit
4863
4864## Where to Find It
4865
4866Loupe is available from your Workspace dashboard under **"Upload"** or by dragging files directly into the inbox. You can upload up to **100 files per batch**.`},{id:"loupe-artwork-invoices",category:"Loupe",title:"Ingesting artwork invoices with Loupe",summary:"Loupe reads artwork invoices and automatically creates a complete artwork page with images and metadata.",content:`When you upload an artwork invoice, Loupe identifies it as an acquisition document and creates a new artwork page in y
4866our Workspace.
4867
4868## What Gets Extracted
4869
4870- Title, artist, year, medium and dimensions
4871- Edition information (if applicable)
4872- Acquisition price and currency
4873- Seller, gallery, or auction house
4874- Acquisition date
4875- Any images included on the invoice
4876
4877## Review Before Publishing
4878
4879Each extracted artwork lands in your **Inbox** for review. You can confirm the data, edit any field, add additional images, and then publish the artwork to your portfolio.
4880
4881The original invoice is automatically attached to the artwork's documents tab for future reference.`},{id:"loupe-cost-invoices",category:"Loupe",title:"Matching cost invoices to artworks",summary:"Loupe matches shipping, framing, storage and conservation invoices to the right artwork — or asks you when it can't.",content:`Loupe also handles **cost invoices** — any document representing an ongoing expense related to your collection.
4882
4883## Supported Cost Types
4884
4885- Shipping and transport
4886- Framing
4887- Storage
4888- Conservation and restoration
4889- Installation and de-installation
4890- Photography
4891- Insurance premiums
4892
4893## How Matching Works
4894
4895- If the invoice references a specific artwork (by title, artist, or inventory number), Loupe matches it automatically to that artwork
4896- If the invoice covers multiple works, Loupe splits and matches each line item
4897- If no artwork title is detected, Loupe **flags the invoice for manual matching** — it will appear in your Inbox with a prompt to select the relevant artwork
4898
4899## What Gets Attached
4900
4901- The parsed cost (amount, currency, date, vendor, category)
4902- The original PDF invoice, attached to the artwork's documents tab
4903
4904Once matched, the cost flows into the **Ongoing Costs** section of the artwork page.`},{id:"ongoing-costs",category:"Loupe",title:"Tracking ongoing costs per artwork",summary:"Every cost ingested by Loupe is aggregated into the Ongoing Costs section on each artwork page.",content:`Every cost invoice that Loupe ingests — shipping, framing, storage, conservation, and more — is aggregated into the **Ongoing Costs** section on the relevant artwork page.
4905
4906## What You'll See
4907
4908- A running total of all costs incurred for the artwork
4909- A breakdown by category (shipping, framing, storage, etc.)
4910- A timeline of individual transactions with dates and vendors
4911- A link to the original PDF invoice for each entry
4912
4913## Why It Matters
4914
4915Ongoing costs help you understand the **true total cost of ownership** for each work — useful for insurance, resale planning, tax basis calculations, and overall portfolio reporting.
4916
4917Costs are also rolled up at the Workspace level so you can see aggregate spend across your entire collection.`},{id:"export-pdf-csv",category:"Reports",title:"How to Export PDFs and CSVs from Your Portfolio",summary:"Export artwork data as CSV or PDF files for sharing, record-keeping, or internal reference.",content:`Appraisal Bureau allows you to export artwork data from your Portfolio in just a few clicks. These exports are **not appraisal reports** — they are simple data exports, useful for sharing, record-keeping, or internal reference.
4918
4919You can export selected artworks as either a **CSV** file or a **PDF** summary.
4920
4921## 1. Exporting from the Portfolio Page
4922
4923- Navigate to your **Portfolio Page**
4924- Use filters or tags to narrow down your view (optional)
4925- Select the artworks you want to export using the checkboxes, or click the top-left checkbox to **Select All**
4926- Click **"Export"**
4927
4928## 2. Choose Export Format and Content
4929
4930- Choose your export format: **CSV** or **PDF**
4931- Select the fields and data you'd like to include in the export
4932- For example: title, artist, dimensions, medium, valuation date, etc.
4933
4934**Note:** CSV exports **do not include images** — only structured data fields. If you need images included, use the PDF export option instead.
4935
4936## 3. Download and Share
4937
4938Once your export is ready, it will download to your device automatically.`},{id:"getting-started-overview",category:"Getting Started",title:"How to create your first workspace",summary:"Learn how to set up your workspace and start managing your collection.",content:`## Getting Started
4939
4940- Log in to your Appraisal Bureau account
4941- Click **"Create Workspace"** from the dashboard
4942- Enter your organization name and workspace type
4943- Your workspace will be created automatically with default settings
4944
4945Once created, you can begin adding artworks and inviting team members.`},{id:"bulk-upload",category:"Getting Started",title:"How to bulk upload items",summary:"Upload multiple items at once using CSV files and ZIP image archives.",content:`## Steps to Bulk Upload
4946
4947- Navigate to your workspace and select **"Bulk Upload"**
4948- Prepare a CSV file with your item data
4949- Optionally attach a ZIP file with images
4950- The images column in your CSV can be left empty if you're doing a data-only import
4951
4952**Tip:** Make sure image filenames in the ZIP match the names referenced in your CSV for automatic pairing.`},{id:"sp-create-organization",category:"Service Providers",title:"Create Your Organization (Service Providers)",summary:"Set up your Organization as an insurer, financial firm, wealth manager, lender, or other service provider.",content:`An Organization represents the core account structure for service providers.
4953
4954Organizations typically represent companies such as insurers, financial firms, wealth managers, lenders, and other third-party service providers.
4955
4956## Permission Levels
4957
4958- **Administrators:** Full access, including organization settings, user management, and the ability to see values
4959- **Members:** Can access the Organization but cannot change settings
4960
4961**Note:** Only Administrators can view appraised values — this applies to both Owners and Providers.`},{id:"sp-set-up-workspaces",category:"Service Providers",title:"Set Up Workspaces (Service Providers)",summary:"Create and manage Workspaces to organize projects, clients, or business units as a service provider.",content:`Within each Organization, you can create unlimited Workspaces.
4962
4963## Key Things to Know
4964
4965- Workspaces are created by Organization Administrators
4966- Users must be added to each Workspace individually
4967- A single user can belong to many Workspaces across multiple Organizations
4968
4969## Workspace Permissions
4970
4971- **Viewer:** Access to basic cataloguing details, restricted from valuation data
4972- **Editor:** All Viewer access, view appraised values and export inventories
4973- **Manager:** All Editor access, plus full access to Workspace settings
4974
4975## Account Policy
4976
4977- If removed from an Organization with no other memberships, your account will be deleted after 30 days
4978- If removed from a Workspace, you retain Organization access but lose Workspace data visibility`},{id:"sp-view-valuations",category:"Service Providers",title:"View Valuations (Service Providers)",summary:"How service providers can view current valuations on client portfolios and individual artworks.",content:`With appropriate permissions, you may view current valuations on the **Portfolio Page** for each client, or granular data on each artwork's page.
4979
4980## Validity Periods
4981
4982- **FMV** is valid for **6 months**
4983- **RRV** is valid for **1 year**`},{id:"sp-appraisal-reports",category:"Service Providers",title:"Appraisal Reports (Service Providers)",summary:"Understand how service providers access and export appraisal reports and client portfolios.",content:`Service Providers **cannot generate** Appraisal Reports. Art owners must generate reports, which may then be shared to Service Providers.
4984
4985## What You Can Do
4986
4987- Reports are attached to each artwork page included in that report
4988- Download **CSV** and **PDF** files of client portfolios by clicking **"Export"** on the Portfolio Page of each client`},{id:"sp-adding-people",category:"Service Providers",title:"Adding People (Service Providers)",summary:"Invite team members to your service provider organization and workspaces.",content:`## Step 1: User Account Setup
4989
4990Before someone can be added, they must first create a user account on the platform.
4991
4992## Step 2: Sending an Invitation
4993
4994An **Admin** within the organization can send an invitation.
4995
4996## Step 3: Accepting an Invitation
4997
4998The invited user will:
4999
5000- Navigate to the **Invitations** tab
5001- Go to **Organizations** to view pending invitations
5002- Choose to **Accept**, **Reject**, or **Block** the invitation
5003
5004The same process applies for Workspace invitations.
5005
5006## Super Admin Settings
5007
5008A Super Admin may configure automatic workspace assignment when members are added — ensuring smooth onboarding across teams.`},{id:"valuations",category:"Valuations",title:"Understanding valuation types",summary:"Learn about Fair Market Value, Replacement Value, and other valuation methods.",content:`Appraisal Bureau supports multiple valuation types:
5009
5010- **Fair Market Value (FMV)** — commonly used for charitable donations
5011- **Replacement/Reproduction Value (RRV)** — used for insurance coverage
5012
5013Each type serves different purposes depending on your needs.`},{id:"reports",category:"Reports",title:"Generating and downloading reports",summary:"Create PDF reports for your valuations and portfolio.",content:`## How to Generate Reports
5014
5015- From any item or Portfolio view, click **"Generate Report"** to create a PDF
5016- Reports reflect the most current data and can be downloaded instantly
5017- For bulk reports, use the **"Select All"** option in Portfolio view
5018
5019All generated reports are stored in the **Reports** tab for easy access.`},{id:"charitable-donations",category:"Charitable Donations",title:"IRS Form 8283 and charitable donations",summary:"How Appraisal Bureau supports your charitable donation workflows.",content:`Our platform automates IRS Form 8283 workflows for charitable donations.
5020
5021## Key Features
5022
5023- Donation year is automatically inferred from the donation date
5024- **DocuSign** integration allows automated e-signatures for donees
5025- Track signature status directly in-app
5026
5027Appraisal Bureau handles the compliance requirements so you can focus on the donation process.`},{id:"charitable-donations-faq",category:"Charitable Donations",title:"Fine Art Donations and IRS Appraisals FAQ",summary:"Common questions about charitable art donations, IRS requirements, and tax deductions.",content:`## What qualifies as a charitable donation of fine art for tax purposes?
5028
5029A donation of artwork to a qualified 501(c)(3) organization may be tax-deductible if the gift is completed during the tax year and transferred without receiving anything of value in return.
5030
5031If the artwork is used by the charity in a manner related to its mission (for example, a museum displaying the work), the donor may generally deduct the full fair market value. If the use is unrelated, the deduction may be limited to the donor's cost basis.
5032
5033## When do I need a qualified appraisal for donated artwork?
5034
5035If the claimed value of donated artwork exceeds **$5,000**, the IRS requires a qualified appraisal prepared by a qualified appraiser. The appraisal must meet IRS standards and be completed no earlier than 60 days before the donation and no later than the tax filing date.
5036
5037If the claimed value of the artwork is **$20,000 or more**, the full appraisal must be attached to the tax return.
5038
5039## What is IRS Form 8283 and when must it be filed?
5040
5041Form 8283 is required when claiming a deduction for non-cash charitable contributions exceeding **$500**.
5042
5043For artwork valued over **$5,000**:
5044
5045- Section B of Form 8283 must be completed.
5046- The form must be signed by:
5047- The donor
5048- The qualified appraiser
5049- The donee organization
5050
5051## How is the fair market value (FMV) of artwork determined?
5052
5053Fair market value is the price a willing buyer and willing seller would agree upon, with both parties having reasonable knowledge of relevant facts and neither being under pressure to buy or sell.
5054
5055For artwork, FMV is typically determined using comparable sales, market data, and other relevant valuation factors consistent with IRS guidelines.
5056
5057## What documentation do I need to support a fine art donation deduction?
5058
5059You should retain the following:
5060
5061- A **qualified appraisal** (for items over $5,000)
5062- A completed and signed **Form 8283** (for items over $500)
5063- A written **acknowledgment** from the donee organization (required for donations of $250 or more)
5064
5065These records must be kept in case of IRS review.
5066
5067## Are there limits on charitable deductions for donated artwork?
5068
5069Yes. Deductions for appreciated artwork donated to public charities are generally limited to **30% of your adjusted gross income (AGI)**.
5070
5071However, charitable deduction limits can vary between **20% and 60%** of AGI depending on:
5072
5073- The type of asset donated
5074- The type of charitable organization
5075- Whether the property is appreciated or ordinary income property
5076
5077Any excess amount may typically be carried forward for up to five additional tax years.
5078
5079## What is the "related use" rule for donated artwork?
5080
5081The IRS allows a deduction at full fair market value only if the artwork is used in a way that relates to the charity's mission.
5082
5083Examples:
5084
5085- A museum displaying or studying the artwork → related use → full FMV deduction
5086- A charity selling the artwork for fundraising → unrelated use → deduction may be limited to cost basis
5087
5088## What happens if the charity sells or disposes of the artwork?
5089
5090If the charity sells, exchanges, or otherwise disposes of the donated artwork within three years of the donation, it must file **IRS Form 8282**.
5091
5092This filing notifies the IRS and the donor and may affect the donor's deduction if the original claim depended on related use.
5093
5094## How does Appraisal Bureau simplify the donation and appraisal process?
5095
5096Appraisal Bureau automates:
5097
5098- Qualified appraisal generation
5099- IRS Form 8283 preparation
5100- Signature collection
5101- Donation status tracking
5102
5103All required documentation is stored securely in one place, helping donors and organizations stay compliant with IRS requirements.`},{id:"sharing",category:"Access & Sharing",title:"Sharing items and managing access",summary:"Learn how to share items with team members and control permissions.",content:`## How to Share
5104
5105- Share individual items or bulk-share from **Portfolio** view
5106- Access is role-based — assign **view**, **edit**, or **admin** permissions
5107- Organization members are auto-listed in the access panel for easy selection
5108
5109## Permission Levels
5110
5111- **View:** Can see artwork details and documents
5112- **Edit:** Can modify artwork data and metadata
5113- **Admin:** Full access including sharing and settings`},{id:"subscription",category:"Billing",title:"Subscription plans and billing",summary:"Information about pricing, free trials, and annual discounts.",content:`## Plans & Pricing
5114
5115- New clients receive a **30-day free trial** with full platform access
5116- Annual billing offers a discount compared to monthly billing
5117
5118## Available Plans
5119
5120- **1-seat plan:** $540/year
5121- **5-seat team bundle:** $1,350/year
5122
5123Contact us for custom enterprise pricing or volume discounts.`}],Use=["All",...Array.from(new Set(_5.map(e=>e.category)))],Wse=()=>{const[e,t]=D.useState(""),[r,n]=D.useState("All"),[s,a]=D.useState(null),[i,l]=D.useState(""),c=v5(),d=()=>{var u;i.trim()&&((u=c.current)==null||u.sendExternalMessage(i.trim()),l(""))},p=D.useMemo(()=>_5.filter(u=>{const h=!e||u.title.toLowerCase().includes(e.toLowerCase())||u.summary.toLowerCase().includes(e.toLowerCase())||u.content.toLowerCase().includes(e.toLowerCase())||u.category.toLowerCase().includes(e.toLowerCase()),f=r==="All"||u.category===r;return h&&f}),[e,r]);return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Help & Support | Appraisal Bureau",description:"Find answers to common questions about Appraisal Bureau. Browse help articles or search for specific topics.",canonical:"/support"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:"Support Center"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"How can we help?"}),o.jsx("p",{className:"mt-8 text-lg md:text-xl font-light text-gray-600 max-w-2xl leading-relaxed",children:"Search our help articles, browse by category, or ask our assistant a question below."}),o.jsx("div",{className:"mt-10 max-w-2xl",children:o.jsxs("div",{className:"relative",children:[o.jsx(hR,{className:"absolute left-0 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}
5123),o.jsx(fa,{placeholder:"Search articles...",value:e,onChange:u=>t(u.target.value),className:"pl-8 h-12 text-base bg-transparent border-0 border-b border-gray-300 rounded-none shadow-none focus-visible:ring-0 focus-visible:border-[#220E99] placeholder:text-gray-400"})]})}),o.jsxs("div",{className:"mt-8 max-w-2xl",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:"Ask the assistant"}),o.jsxs("div",{className:"flex gap-3 items-end",children:[o.jsx(j1,{value:i,onChange:u=>l(u.target.value),placeholder:"Type your question here...",className:"flex-1 min-h-[52px] max-h-[140px] bg-white border border-gray-200 text-sm resize-none rounded-lg focus-visible:ring-1 focus-visible:ring-[#220E99] focus-visible:border-[#220E99]",onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),d())}}),o.jsx(rr,{onClick:d,disabled:!i.trim(),className:"rounded-full bg-[#220E99] hover:bg-[#220E99]/90 text-white h-11 px-5 text-sm font-normal shrink-0",children:o.jsx(fR,{className:"h-4 w-4"})})]})]})]})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsxs("aside",{className:"md:col-span-3",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-5",children:"Categories"}),o.jsx("ul",{className:"space-y-1",children:Use.map(u=>{const h=r===u;return o.jsx("li",{children:o.jsx("button",{onClick:()=>n(u),className:`w-full text-left py-2 text-sm font-light transition-colors ${h?"text-[#220E99]":"text-gray-600 hover:text-ab-ink"}`,children:u})},u)})})]}),o.jsxs("div",{className:"md:col-span-9 md:border-l md:border-gray-200 md:pl-16",children:[o.jsxs("div",{className:"flex items-baseline justify-between mb-8",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:r==="All"?"All Articles":r}),o.jsxs("p",{className:"text-xs text-gray-500 font-light",children:[p.length," ",p.length===1?"article":"articles"]})]}),p.length===0?o.jsxs("div",{className:"text-center py-16",children:[o.jsx(hW,{className:"h-10 w-10 text-gray-300 mx-auto mb-4"}),o.jsx("p",{className:"text-gray-500 font-light",children:"No articles found. Try a different search term."})]}):o.jsx("ul",{className:"border-t border-gray-200",children:p.map(u=>{const h=s===u.id;return o.jsxs("li",{className:"border-b border-gray-200",children:[o.jsxs("button",{onClick:()=>a(h?null:u.id),className:"w-full flex items-start justify-between gap-6 py-6 text-left group","aria-expanded":h,children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-2",children:u.category}),o.jsx("h3",{className:"font-newsreader font-light text-ab-ink text-xl md:text-2xl leading-snug tracking-tight group-hover:text-[#220E99] transition-colors",children:u.title}),o.jsx("p",{className:"mt-2 text-sm text-gray-600 font-light leading-relaxed",children:u.summary})]}),o.jsx("span",{className:"flex-shrink-0 w-9 h-9 rounded-full border border-gray-300 flex items-center justify-center text-gray-500 group-hover:border-[#220E99] group-hover:text-[#220E99] transition-colors mt-1",children:h?o.jsx(bW,{size:16}):o.jsx(kW,{size:16})})]}),h&&o.jsx("div",{className:"pb-8 max-w-3xl animate-in fade-in duration-200",children:o.jsxs("div",{className:"space-y-4",children:[u.image&&o.jsx("img",{src:u.image,alt:u.title,className:"w-full max-w-lg rounded-lg border border-gray-200"}),u.content.split(`
5124
5125`).map((f,m)=>f.startsWith("## ")?o.jsx("h4",{className:"font-newsreader text-lg font-light text-ab-ink pt-3",children:f.replace("## ","")},m):f.startsWith("- ")?o.jsx("ul",{className:"space-y-2 list-none",children:f.split(`
5126`).map((v,k)=>o.jsxs("li",{className:"text-base text-ab-ink font-light leading-relaxed pl-5 relative",children:[o.jsx("span",{className:"absolute left-0 top-[0.7em] w-2 h-px bg-gray-400"}),o.jsx("span",{dangerouslySetInnerHTML:{__html:v.replace(/^- /,"").replace(/\*\*(.+?)\*\*/g,"<strong class='font-medium text-ab-ink'>$1</strong>")}})]},k))},m):o.jsx("p",{className:"text-base text-ab-ink font-light leading-relaxed",children:o.jsx("span",{dangerouslySetInnerHTML:{__html:f.replace(/\*\*(.+?)\*\*/g,"<strong class='font-medium text-ab-ink'>$1</strong>")}})},m))]})})]},u.id)})})]})]})})})]}),o.jsx(yn,{})]})},Vse=1,Gse="2eaaa150-87f6-4a62-8ead-d6b0db795fc3",qse="17cb2d3e-4f29-42b6-944d-08f2733fb079",Hse="/__l5e/assets-v1/2eaaa150-87f6-4a62-8ead-d6b0db795fc3/soc2-type2-badge.png",Kse="a/v1/17cb2d3e-4f29-42b6-944d-08f2733fb079/2eaaa150-87f6-4a62-8ead-d6b0db795fc3/soc2-type2-badge.png",Qse="soc2-type2-badge.png",Yse=10538,Jse="image/png",Zse="2026-06-15T20:31:15Z",Xse={version:Vse,asset_id:Gse,project_id:qse,url:Hse,r2_key:Kse,original_filename:Qse,size:Yse,content_type:Jse,created_at:Zse},eae=()=>{const{language:e,t}=gc(),r=e==="pt-BR",n=[{id:"compliance",number:"01",title:t(Pi.compliance),content:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start gap-6",children:[o.jsx("img",{src:Xse.url,alt:"SOC 2 Type 2 Certified",className:"h-24 flex-shrink-0"}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink",children:"SOC 2 Type 2 Certified"}),o.jsx("p",{children:r?"A Appraisal Bureau concluiu com sucesso seu exame SOC 2 Type 2, conduzido pela Sensiba. Isso confirma que nossos controles de segurança atendem aos Critérios de Serviços de Confiança do AICPA e operam de forma eficaz ao longo do tempo, validando tanto o design quanto a eficácia operacional dos sistemas que protegem os dados de nossos clientes.":"Appraisal Bureau has successfully completed its SOC 2 Type 2 examination, conducted by Sensiba. This confirms that our security controls meet the AICPA's Trust Services Criteria and operate effectively over time, validating both the design and operating effectiveness of the systems that protect our clients' data."}),o.jsx("p",{children:r?"O escopo inclui segurança, disponibilidade e confidencialidade, abrangendo infraestrutura, controles de acesso, gestão de pessoal, operações de desenvolvimento e monitoramento contínuo.":"The scope includes security, availability, and confidentiality, covering infrastru
5126cture, access controls, personnel management, development operations, and continuous monitoring."})]})]}),o.jsx("p",{children:r?"Appraisal Bureau mantém um programa de segurança alinhado com os Critérios de Serviços de Confiança SOC 2, suportado por monitoramento contínuo de controles e validação através do Drata.":"Appraisal Bureau maintains a security program aligned with SOC 2 Trust Services Criteria, supported by continuous control monitoring, automated evidence collection, and ongoing validation through Drata."}),o.jsx("p",{children:r?"Nossa abordagem é simples: a segurança é aplicada continuamente, não verificada periodicamente.":"Our approach is simple: security is continuously enforced, not periodically checked."})]})},{id:"infrastructure",number:"02",title:t(Pi.infrastructure),content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:r?"Nossos sistemas são hospedados na Amazon Web Services (AWS) em ambientes isolados protegidos por controles de rede. Todos os dados são criptografados em trânsito usando TLS e em repouso usando criptografia gerenciada pela AWS.":"Our systems are hosted on Amazon Web Services (AWS) within isolated environments protected by network-level controls. All data is encrypted in transit using TLS and at rest using AWS-managed encryption."}),o.jsx("p",{children:r?"Monitoramos continuamente o desempenho do sistema e a integridade da infraestrutura usando alertas automatizados, garantindo detecção e resposta rápidas a anomalias.":"We continuously monitor system performance and infrastructure health using automated alerts, ensuring rapid detection and response to anomalies."})]})},{id:"access",number:"03",title:t(Pi.accessControl),content:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:r?"Aplicamos controles de acesso rigorosos em todos os sistemas:":"We enforce strict access controls across all systems:"}),o.jsxs("ul",{className:"space-y-3 list-none pl-0",children:[o.jsxs("li",{children:[o.jsxs("strong",{className:"font-medium text-ab-ink",children:[r?"Autenticação multifator (MFA)":"Multi-factor authentication (MFA)","."]})," ",r?"Obrigatória para todos os sistemas internos e acessos privilegiados.":"Required for all internal systems and privileged access."]}),o.jsxs("li",{children:[o.jsxs("strong",{className:"font-medium text-ab-ink",children:[r?"Acesso baseado em funções":"Role-based access","."]})," ",r?"Garante que os usuários tenham acesso apenas ao necessário.":"Ensures users only have access to what is necessary."]}),o.jsxs("li",{children:[o.jsxs("strong",{className:"font-medium text-ab-ink",children:[r?"Acesso vinculado":"Verified personnel","."]})," ",r?"Todo acesso ao sistema é vinculado a pessoal verificado.":"All system access is tied to verified personnel."]})]})]})},{id:"monitoring",number:"04",title:t(Pi.monitoring),content:o.jsx("p",{children:r?"Nosso ambiente é monitorado continuamente usando ferramentas automatizadas de conformidade e segurança, incluindo Drata. Todas as ações críticas são registradas e auditáveis.":"Our environment is continuously monitored using automated compliance and security tooling, including Drata. All critical actions are logged and auditable."})},{id:"dev",number:"05",title:t(Pi.devSecurity),content:o.jsx("p",{children:r?"Todo o código é gerenciado em ambientes controlados com acesso de escrita restrito. As alterações são rastreadas e atribuíveis a indivíduos específicos.":"All code is managed in controlled environments with restricted write access. Changes are tracked and attributable to specific individuals."})},{id:"insurance",number:"06",title:r?"Seguro":"Insurance",content:o.jsx("p",{children:r?o.jsxs(o.Fragment,{children:["Além de nossas apólices de seguro tradicionais (responsabilidade profissional, responsabilidade geral e cibernética), a Appraisal Bureau também possui cobertura especializada da"," ",o.jsx("a",{href:"https://www.testudo.co/",target:"_blank",rel:"noopener noreferrer",className:"text-ab-ink underline underline-offset-4 hover:text-[#220E99]",children:"Testudo"}),", uma seguradora apoiada pela Lloyd's of London, para trabalhos baseados em IA generativa e ag
5126êntica — permitindo-nos inovar com responsabilidade e confiança."]}):o.jsxs(o.Fragment,{children:["In addition to our traditional insurance policies (professional liability, general liability, and cyber), Appraisal Bureau is also covered by"," ",o.jsx("a",{href:"https://www.testudo.co/",target:"_blank",rel:"noopener noreferrer",className:"text-ab-ink underline underline-offset-4 hover:text-[#220E99]",children:"Testudo"}),", a Lloyd's of London-backed insurer, for generative and agentic AI-based work — allowing us to innovate responsibly and with confidence."]})})}];return o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:`${t(Pi.title)} | Appraisal Bureau`,description:"Learn about Appraisal Bureau's security practices, data protection, and commitment to SOC 2 standards.",canonical:"/security"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-[#220E99] font-semibold",children:r?"Segurança":"Security"})]}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:t(Pi.title)})]})}),o.jsx("section",{className:"py-16 md:py-20 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold",children:r?"Visão geral":"Overview"})}),o.jsxs("div",{className:"md:col-span-8 space-y-6",children:[o.jsx("p",{className:"font-newsreader text-xl md:text-2xl font-light text-ab-ink leading-relaxed",children:t(Pi.securityAt)}),o.jsx("p",{className:"text-base md:text-lg text-gray-700 font-light leading-relaxed",children:t(Pi.securityDesc)})]})]})})}),n.map(s=>o.jsx("section",{id:s.id,className:"py-16 md:py-24 bg-white border-t border-gray-200 scroll-mt-24",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16",children:[o.jsxs("div",{className:"md:col-span-4",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.25em] text-gray-400 font-semibold mb-3",children:[s.number," — ",r?"Seção":"Section"]}),o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl leading-tight tracking-tight",children:s.title})]}),o.jsx("div",{className:"md:col-span-8 space-y-5 text-base md:text-lg text-gray-700 font-light leading-relaxed",children:s.content})]})})},s.id))]}),o.jsx(yn,{})]})},w5="/assets/addepar-logo-dwRnIMls.png",uN=()=>o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Integrations — Appraisal Bureau",description:"Appraisal Bureau integrations bring defensible art valuations into the platforms collectors and their stakeholders already use.",canonical:"/integrations",keywords:["Addepar art integration","art valuation API","wealth platform art integration"]}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold text-primary",children:"Integrations"})]}),o.jsxs("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:["Valuations that move"," ",o.jsx("span",{className:"font-light text-ab-ink not-italic",children:"where they're needed"})]}),o.jsx("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-3xl",children:"A single defensible record of value, available inside the platforms collectors and their stakeholders rely on."})]})}),o.jsx("section",{className:"py-16 md:py-24 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8",children:[o.jsxs("div",{className:"group border border-gray-200 p-8 lg:p-10 bg-white transition-colors hover:border-gray-300",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 mb-6",children:[o.jsx("div",{className:"font-newsreader font-light text-ab-ink text-3xl tracking-tight",children:"Claude"}),o.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] font-semibold px-2.5 py-1 rounded-full text-primary-foreground bg-primary shrink-0",children:"Now live"})]}),o.jsx("p",{className:"text-gray-600 font-light leading-relaxed",children:"Ask about your collection in plain language. Appraisal Bureau connects to Claude as a custom connector with read-only access to the collections you can already see in the platform. Claude reads your records and sets them against public market data — it never changes anything."}),o.jsx("div",{className:"mt-8 pt-6 border-t border-gray-100",children:o.jsxs(Ut,{to:"/integrations/claude",className:"text-sm text-gray-500 hover:text-black inline-flex items-center gap-1.5",children:["Read the documentation",o.jsx(ya,{className:"h-3.5 w-3.5"})]})})]}),o.jsxs("div",{className:"group border border-gray-200 p-8 lg:p-10 bg-white transition-colors hover:border-gray-300",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 mb-6",children:[o.jsx("img",{src:w5,alt:"Addepar",className:"h-7 md:h-8 w-auto"}),o.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] font-semibold px-2.5 py-1 rounded-full text-primary-foreground bg-primary shrink-0",children:"Now live"})]}),o.jsx("p",{className:"text-gray-600 font-light leading-relaxed",children:"Appraisal Bureau is a technology partner of Addepar, the wealth platform used by leading advisors, family offices and private banks. High-level collection data pushes from Appraisal Bureau into Addepar so advisors can track art as an asset class alongside the rest of a client's balance sheet — while sensitive artwork-level data stays private at the collector's discretion."}),o.jsxs("div",{className:"mt-8 pt-6 border-t border-gray-100 flex flex-wrap items-center gap-5 text-sm",children:[o.jsxs("a",{href:"https://integrations.addepar.com/product/appraisal-bureau",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-black inline-flex items-center gap-1.5",children:["Visit Addepar",o.jsx(ya,{className:"h-3.5 w-3.5"})]}),o.jsxs(Ut,{to:"/integrations/addepar",className:"text-gray-500 hover:text-black inline-flex items-center gap-1.5",children:["Read the documentation",o.jsx(ya,{className:"h-3.5 w-3.5"})]})]})]})]})})}),o.jsx("section",{className:"py-24 md:py-32 bg-white border-t border-gray-200",children:o.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-16 items-end",children:[o.jsxs("div",{className:"md:col-span-4 md:border-r md:border-gray-200 md:pr-10",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#220E99]"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.28em] text-gray-500 font-semibold",children:"For platforms"})]}),o.jsx("p",{className:"text-sm text-gray-500 font-light leading-relaxed",children:"Wealth platforms, custodians, insurers, lenders, and registries — bring defensible art valuations into your product."})]}),o.jsxs("div",{className:"md:col-span-8",children:[o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-4xl md:text-5xl lg:text-6xl leading-[1.05] tracking-tight",children:"Want to embed us?"}),o.jsxs("p",{className:"mt-6 text-lg text-gray-600 font-light leading-relaxed max-w-2xl",children:["We offer custom APIs to our technology partners.",o.jsx("br",{}),"Surface defensible art valuations natively inside your platform — without rebuilding the infrastru
5126cture behind them."]}),o.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row gap-6 items-start sm:items-center",children:[o.jsx(Ut,{to:"/contact",children:o.jsx(rr,{className:"bg-[#220E99] hover:bg-[#1a0b7a] text-white rounded-full px-8 h-12 text-base font-light",children:"Get in touch"})}),o.jsx("a",{href:"mailto:[email protected]",className:"text-black underline underline-offset-4 hover:text-gray-600 text-base font-light transition-colors",children:"[email protected]"})]})]})]})})})]}),o.jsx(yn,{})]}),tae=["What is the total appraised value of the New York residence collection?","Have any comparable works by this artist sold at auction recently?","What are the most historically relevant artworks in my collection?","Which works have not been appraised in the last three years?","Do we have anything with no current valuation for insurance?","Which artists are we most concentrated in by value?","Show me the five largest increases in value since acquisition.","What did we pay for the Ruscha, and what is it worth now?","Where is the Calder currently located?"],rae=[{title:"Understand the collection",body:"Portfolio and value breakdowns by artist, medium and collection; top-valued works; largest gains and losses; acquisition cost against current value; coverage gaps; where each work is."},{title:"Read appraisals and reports",body:"Appraisal history for any work, upcoming valuation schedules, and the contents of reports your appraiser has already delivered."},{title:"Find the detail",body:"Search across works, open the documents attached to a work, and pull up artwork images."},{title:"Set it in market context",body:"Research recent public auction results, compare them against what you hold, and flag works whose value may have moved since they were last appraised — with a recommendation to have them looked at again."}],go=({title:e,children:t})=>o.jsx("section",{className:"border-t border-gray-200 py-16 md:py-24",children:o.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-12 md:gap-12 lg:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl tracking-tight",children:e})}),o.jsx("div",{className:"md:col-span-8 text-gray-600 font-light leading-relaxed",children:t})]})})}),nae=()=>o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Claude Integration — Appraisal Bureau",description:"Appraisal Bureau is now in Claude's connector directory. Add it in a click and ask about your collection in plain language. Read-only — Claude reads your records, it never changes them.",canonical:"/integrations/claude"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold text-primary",children:"Integrations"})]}),o.jsx("p",{className:"mb-5 text-[11px] uppercase tracking-[0.25em] font-semibold text-gray-500",children:"Now available in Claude's connector directory"}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Your collection, in conversation"}),o.jsx("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-3xl",children:"Connect your Appraisal Bureau account to Claude and ask about your collection in plain language. Claude reads your records, sets them against public market data, and suggests where a work may be worth a fresh look."})]})}),o.jsx(go,{title:"What it does",children:o.jsxs("div",{className:"space-y-5",children:[o.jsx("p",{children:"Claude is an AI assistant from Anthropic. Connecting Appraisal Bureau gives it live read access to the collections you can already see in the platform: artworks, valuations, appraisal history, reports, locations and acquisition records. It reads that data to answer your questions, and can set it alongside public market research."}),o.jsx("p",{children:"Nothing is copied into Claude or stored there. Every answer is read from your account at the moment you ask."})]})}),o.jsxs(go,{title:"What you can ask",children:[o.jsx("div",{className:"divide-y divide-gray-200 border-y border-gray-200 bg-gray-50",children:tae.map(e=>o.jsxs("blockquote",{className:"px-5 py-4 text-ab-ink font-light",children:["“",e,"”"]},e))}),o.jsx("p",{className:"mt-7",children:"Claude can set your records against the wider market — looking up recent public auction results, noting where a work's value may have moved since it was last appraised, and recommending that it be looked at again. What it does not do is write the appraisal. A valuation is a signed professional opinion, and it comes from your appraiser in the Appraisal Bureau app."})]}),o.jsx(go,{title:"What Claude can do",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-10 gap-y-10",children:rae.map(e=>o.jsxs("div",{className:"border-t border-gray-200 pt-5",children:[o.jsx("h3",{className:"text-ab-ink font-semibold text-base",children:e.title}),o.jsx("p",{className:"mt-2",children:e.body})]},e.title))})}),o.jsx(go,{title:"What it will not do",children:o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-ab-ink font-semibold",children:"It cannot change anything."}),o.jsx("p",{className:"mt-2",children:"The connector is read-only. It cannot add, edit, archive or delete a work, upload an image, generate or sign a report, or import a list. Adding to and editing your collection happens in the Appraisal Bureau app, where the file picker, validation and audit trail are."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-ab-ink font-semibold",children:"It respects your permissions."}),o.jsx("p",{className:"mt-2",children:"The connector acts as you. Organization and workspace roles carry through exactly as they do in the platform. Connecting Claude does not widen anyone's access, and it cannot reach a collection you could not already open."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-ab-ink font-semibold",children:"It cannot share, invite, or send anything."}),o.jsx("p",{className:"mt-2",children:"The connector has no ability to email anyone, grant a person access to a collection, change a colleague's role, or push data to another system. Those actions stay in the Appraisal Bureau platform, where a person does them deliberately."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-ab-ink font-semibold",children:"It never exposes Appraisal Bureau's comparable sales database."}),o.jsx("p",{className:"mt-2",children:"The full database that underpins our valuations is not available through the connector. Associated comparable sales are visible within delivered appraisal reports, and Claude can describe the reasoning behind a valuation and cite public auction results, but the underlying comps database stays where it belongs."})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-ab-ink font-semibold",children:"It only sees published works."}),o.jsx("p",{className:"mt-2",children:"Claude sees the works that are published in your Ap
5126praisal Bureau account. Anything still in draft or archived in the app will not appear in an answer."})]})]})}),o.jsx(go,{title:"Before you start",children:o.jsxs("ul",{className:"space-y-3 list-disc pl-5 marker:text-primary",children:[o.jsx("li",{children:"An Appraisal Bureau account with access to at least one collection."}),o.jsx("li",{children:"A Claude account. Individuals can add the connector on any plan; organization-wide deployment requires Claude Team or Enterprise."})]})}),o.jsxs(go,{title:"Set it up",children:[o.jsx("p",{children:"Appraisal Bureau is listed in Claude's connector directory, so you can add it from inside Claude without entering a server address."}),o.jsxs("div",{className:"mt-10",children:[o.jsx("h3",{className:"font-newsreader font-light text-ab-ink text-2xl tracking-tight",children:"For yourself"}),o.jsxs("ol",{className:"mt-5 space-y-3 list-decimal pl-5 marker:text-primary",children:[o.jsx("li",{children:"In Claude, open Customize → Connectors."}),o.jsx("li",{children:"Browse the directory and find Appraisal Bureau."}),o.jsx("li",{children:"Click Connect."}),o.jsx("li",{children:"Sign in with your Appraisal Bureau credentials and approve the connection."}),o.jsx("li",{children:"Enable the connector in a conversation, then try one of the questions above to confirm it is working."})]})]}),o.jsxs("div",{className:"mt-12 border-t border-gray-200 pt-10",children:[o.jsx("h3",{className:"font-newsreader font-light text-ab-ink text-2xl tracking-tight",children:"For your organization"}),o.jsx("p",{className:"mt-4",children:"On Claude Team and Enterprise, an owner can enable the connector once for everyone, so colleagues do not each add it themselves."}),o.jsxs("ol",{className:"mt-5 space-y-3 list-decimal pl-5 marker:text-primary",children:[o.jsx("li",{children:"An Owner opens Organization settings → Connectors."}),o.jsx("li",{children:"Find Appraisal Bureau in the directory and enable it for the organization."}),o.jsx("li",{children:"Review the available tools — all of them are read-only, so Claude can run them without prompting for each one."}),o.jsx("li",{children:"Each colleague then signs in with their own Appraisal Bureau account. Their own roles apply — enabling the connector organization-wide does not pool access."})]}),o.jsx("p",{className:"mt-7",children:"On Team plans, members who cannot enable connectors themselves will see a Request button, which sends the connector to an administrator to approve."})]}),o.jsxs("div",{className:"mt-12 border-t border-gray-200 pt-10",children:[o.jsx("h3",{className:"font-newsreader font-light text-ab-ink text-2xl tracking-tight",children:"Adding it manually"}),o.jsx("p",{className:"mt-4",children:"If you need to connect to a specific server address — for example during testing — Appraisal Bureau can still be added as a custom connector. In Claude, open Customize → Connectors, choose Add custom connector, and enter:"}),o.jsx("div",{className:"mt-6 p-3 bg-gray-50 border border-gray-200 rounded-sm inline-block",children:o.jsx("code",{className:"font-mono text-sm text-gray-700 select-all",children:"https://mcp.appraisalbureau.com/mcp"})})]})]}),o.jsx(go,{title:"Data and privacy",children:o.jsxs("div",{className:"space-y-5",children:[o.jsx("p",{children:"When you ask Claude a question, the data needed to answer it is sent from your Appraisal Bureau account to Anthropic to generate the response. Anthropic processes it as the assistant provider under its own terms. Nothing is sent until you ask, and only what the question needs is sent."}),o.jsx("p",{children:"Appraisal Bureau does not receive or store your Claude conversations, and we never use your collection data for advertising or to train models."}),o.jsx("p",{children:"What happens to a conversation inside Claude is governed by your own agreement and settings with Anthropic rather than by us. Protections differ between consumer and commercial plans, so it is worth reviewing your privacy settings there before connecting."}),o.jsxs("p",{children:["Our handling of your information is described in the"," ",o.jsx(Ut,{to:"/privacy-policy",className:"text-ab-ink underline underline-offset-4 hover:text-gray-600 transition-colors",children:"Appraisal Bureau Privacy Policy"}),"."]})]})}),o.jsx(go,{title:"Support",children:o.jsxs("p",{children:["Questions, or something not behaving as de
5126scribed — email"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-black underline underline-offset-4 hover:text-gray-600 transition-colors",children:"[email protected]"}),"."]})})]}),o.jsx(yn,{})]}),sae=[["Value","Aggregate fair market value, summed across works"],["Currency","USD, normalised from the appraisal's native currency"],["Grouping","One total per medium category: painting, sculpture, photography, works on paper, and the rest"],["Source","Delivered appraisals only. Works in progress and unappraised works are excluded"],["Destination","A valuation snapshot on the corresponding art entity in your Addepar portfolio"],["Scope","The whole organization, or a single collection if you restrict the run"]],aae=[["Direction","Appraisal Bureau → Addepar, one way"],["Data","Aggregate fair market value in USD, by medium category"],["Granularity","Per-category art entities; no item-level detail"],["Source","Delivered appraisals only"],["Scope","Firm level, optionally filtered to one collection"],["Frequency","Nightly, plus on demand"],["Transmission","API"]],$l=({title:e,children:t})=>o.jsx("section",{className:"border-t border-gray-200 py-16 md:py-24",children:o.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:o.jsxs("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-12 md:gap-12 lg:gap-16",children:[o.jsx("div",{className:"md:col-span-4",children:o.jsx("h2",{className:"font-newsreader font-light text-ab-ink text-3xl md:text-4xl tracking-tight",children:e})}),o.jsx("div",{className:"md:col-span-8 text-gray-600 font-light leading-relaxed",children:t})]})})}),iae=()=>o.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[o.jsx(Fn,{title:"Addepar Integration — Appraisal Bureau",description:"Push current appraised art values into Addepar alongside every other asset class.",canonical:"/integrations/addepar"}),o.jsx(on,{}),o.jsxs("main",{className:"flex-grow",children:[o.jsx("section",{className:"pt-20 md:pt-28 pb-16 md:pb-20 bg-white",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),o.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-semibold text-primary",children:"Integrations"})]}),o.jsx("img",{src:w5,alt:"Addepar",className:"h-7 md:h-8 w-auto mb-8"}),o.jsx("h1",{className:"font-newsreader font-light text-ab-ink text-5xl md:text-6xl lg:text-7xl leading-[1.02] tracking-tight",children:"Art, on the balance sheet"}),o.jsx("p",{className:"mt-6 text-lg md:text-xl text-gray-600 font-light leading-relaxed max-w-3xl",children:"In most portfolios art is either missing entirely or carried at a number set years ago. This integration puts current appraised values into Addepar, so the collection is reported on the same basis as every other asset."})]})}
5126),o.jsx($l,{title:"How it works",children:o.jsxs("div",{className:"space-y-5",children:[o.jsx("p",{children:"The sync runs one way: from Appraisal Bureau into Addepar. We never read your Addepar portfolio, and nothing in Addepar changes anything on our side."}),o.jsx("p",{children:"When a sync runs, we take every artwork in the organization with a delivered appraisal, total the fair market values by medium category, convert to USD, and post those totals to Addepar as valuation snapshots on per-category art entities."}),o.jsx("blockquote",{className:"mt-9 border-l-2 border-primary pl-6 font-newsreader text-2xl md:text-3xl leading-snug text-ab-ink tracking-tight",children:"“Addepar receives category totals, not an inventory. Your advisor sees that the collection holds $8.9M in paintings; they do not see which paintings.”"})]})}),o.jsx($l,{title:"What gets sent",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full min-w-[560px] border-collapse text-left",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-gray-300 text-ab-ink",children:[o.jsx("th",{className:"w-1/3 py-3 pr-6 text-xs uppercase tracking-[0.18em] font-semibold",children:"Field"}),o.jsx("th",{className:"py-3 text-xs uppercase tracking-[0.18em] font-semibold",children:"Detail"})]})}),o.jsx("tbody",{children:sae.map(([e,t])=>o.jsxs("tr",{className:"border-b border-gray-200 align-top",children:[o.jsx("th",{scope:"row",className:"py-4 pr-6 text-ab-ink font-semibold",children:e}),o.jsx("td",{className:"py-4",children:t})]},e))})]})})}),o.jsxs($l,{title:"What does not get sent",children:[o.jsx("p",{children:"This is the part worth reading closely if you are deciding whether to let a valuation provider write into your system of record."}),o.jsxs("ul",{className:"mt-7 space-y-5 list-disc pl-5 marker:text-primary",children:[o.jsxs("li",{children:[o.jsx("strong",{className:"text-ab-ink font-semibold",children:"No item-level records."})," No titles, no artists, no dimensions, no individual values. Addepar receives category totals."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"text-ab-ink font-semibold",children:"No images."})," Photography of the works never leaves the platform."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"text-ab-ink font-semibold",children:"No comparable sales."})," The evidence behind each valuation stays in Appraisal Bureau."]}),o.jsxs("li",{children:[o.jsx("strong",{className:"text-ab-ink font-semibold",children:"No provenance, condition or location data."})," None of it is part of the payload."]})]})]}),o.jsx($l,{title:"Specification",children:o.jsxs("dl",{className:"border-y border-gray-200",children:[aae.map(([e,t])=>o.jsxs("div",{className:"grid grid-cols-1 gap-2 border-b border-gray-200 py-4 last:border-b-0 sm:grid-cols-3 sm:gap-6",children:[o.jsx("dt",{className:"text-[11px] uppercase tracking-[0.18em] text-gray-500 font-semibold",children:e}),o.jsx("dd",{className:"text-ab-ink sm:col-span-2",children:t})]},e)),o.jsxs("div",{className:"grid grid-cols-1 gap-2 border-t border-gray-200 py-4 sm:grid-cols-3 sm:gap-6",children:[o.jsx("dt",{className:"text-[11px] uppercase tracking-[0.18em] text-gray-500 font-semibold",children:"Authentication"}),o.jsx("dd",{className:"sm:col-span-2",children:"OAuth. You sign in with your own Addepar credentials and approve the connection; Appraisal Bureau receives an authorization token and never sees or stores your Addepar password."})]})]})}),o.jsx($l,{title:"Requirements",children:o.jsxs("ul",{className:"space-y-3 list-disc pl-5 marker:text-primary",children:[o.jsx("li",{children:"An active Appraisal Bureau account."}),o.jsx("li",{children:"An Addepar account."})]})}),o.jsxs($l,{title:"Running a sync",children:[o.jsxs("div",{className:"space-y-5",children:[o.jsx("p",{children:"The integration syncs every night. Any valuation delivered during the day, and any change to the inventory behind it, is picked up in the next run — so the figures in Addepar stay current without anyone remembering to press a button."}),o.jsx("p",{children:"You can also run a sync on demand from the Appraisal Bureau platform when you need values updated immediately, typically after a round of appraisals is delivered or ahead of a client review."})]}),o.jsxs("div",{className:"mt-12 border-t border-gray-200 pt-10",children:[o.jsx("h3",{className:"font-newsreader font-light text-ab-ink text-2xl tracking-tight",children:"What happens next"}),o.jsx("p",{className:"mt-4",children:"An on-demand sync runs in the background rather than blocking you, and you are notified in the platform when it finishes. If a sync is already running for your organization, a second one is refused rather than queued — wait for the first to complete."})]})]}),o.jsxs($l,{title:"Support",children:[o.jsxs("p",{children:["To set up the integration or ask about the data model, email"," ",o.jsx("a",{href:"mailto:[email protected]",className:"text-black underline underline-offset-4 hover:text-gray-600 transition-colors",children:"[email protected]"}),"."]}),o.jsxs("a",{href:"https://integrations.addepar.com/product/appraisal-bureau",target:"_blank",rel:"noopener noreferrer",className:"mt-6 text-gray-500 hover:text-black inline-flex items-center gap-1.5 text-sm",children:["Visit Addepar",o.jsx(ya,{className:"h-3.5 w-3.5"})]})]})]}),o.jsx(yn,{})]});function sx(){return ec.auth.oauth}const oae=()=>{var u;const[e]=vD(),t=e.get("authorization_id")??"",[r,n]=D.useState(null),[s,a]=D.useState(null),[i,l]=D.use
5126State(!1);D.useEffect(()=>{let h=!0;return(async()=>{if(!t){a("Missing authorization_id");return}const{data:f}=await ec.auth.getSession();if(!f.session){const y=window.location.pathname+window.location.search;window.location.href="/login?next="+encodeURIComponent(y);return}const{data:m,error:v}=await sx().getAuthorizationDetails(t);if(!h)return;if(v){a(v.message);return}const k=(m==null?void 0:m.redirect_url)??(m==null?void 0:m.redirect_to);if(k&&!(m!=null&&m.client)){window.location.href=k;return}n(m)})(),()=>{h=!1}},[t]);async function c(h){l(!0);const{data:f,error:m}=h?await sx().approveAuthorization(t):await sx().denyAuthorization(t);if(m){l(!1),a(m.message);return}const v=(f==null?void 0:f.redirect_url)??(f==null?void 0:f.redirect_to);if(!v){l(!1),a("No redirect returned by the authorization server.");return}window.location.href=v}if(s)return o.jsx("main",{className:"min-h-screen flex items-center justify-center px-4 py-12 bg-white",children:o.jsxs("div",{className:"max-w-md w-full",children:[o.jsx("h1",{className:"font-newsreader text-2xl text-ab-ink mb-3",children:"Authorization error"}),o.jsx("p",{className:"text-gray-600 font-light",children:s})]})});if(!r)return o.jsx("main",{className:"min-h-screen flex items-center justify-center px-4 py-12 bg-white",children:o.jsx("p",{className:"text-gray-500 font-light",children:"Loading…"})});const d=((u=r.client)==null?void 0:u.name)??"an application",p=r.scopes??(r.scope?r.scope.split(/\s+/).filter(Boolean):[]);return o.jsx("main",{className:"min-h-screen flex items-center justify-center px-4 py-12 bg-white",children:o.jsxs("div",{className:"max-w-md w-full",children:[o.jsxs("h1",{className:"font-newsreader text-3xl text-ab-ink mb-4 leading-tight",children:["Connect ",d," to Appraisal Bureau"]}),o.jsxs("p",{className:"text-gray-600 font-light mb-6",children:["This lets ",d," use Appraisal Bureau as you. It does not bypass Appraisal Bureau's permissions or backend policies."]}),p.length>0&&o.jsxs("div",{className:"mb-6 border-t border-gray-200 pt-4",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-[0.2em] text-gray-500 mb-2",children:"Requested permissions"}),o.jsx("ul",{className:"text-sm text-gray-700 space-y-1 font-light",children:p.map(h=>o.jsxs("li",{children:["· ",h]},h))})]}),r.redirect_uri&&o.jsxs("p",{className:"text-xs text-gray-500 mb-6 break-all",children:["Redirects to: ",r.redirect_uri]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx(rr,{disabled:i,onClick:()=>c(!0),className:"flex-1 bg-[#220E99] hover:bg-[#1a0b7a] text-white rounded-full h-11 font-light",children:"Approve"}),o.jsx(rr,{disabled:i,onClick:()=>c(!1),variant:"outline",className:"flex-1 rounded-full h-11 font-light",children:"Cancel"})]})]})})},lae="https://liedziqwqjrifamddcro.supabase.co/functions/v1/chat-transcripts",Em=e=>new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}),cae=()=>{const[e,t]=D.useState(""),[r,n]=D.useState(!1),[s,a]=D.useState(null),i=async c=>{if(c.preventDefault(),!(!e.trim()||r)){n(!0);try{const d=await fetch(lae,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxpZWR6aXF3cWpyaWZhbWRkY3JvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc0MDExOTIsImV4cCI6MjA5Mjk3NzE5Mn0.iNrgvaKm3VOby7RGwDAmM4zDB7IthFzlHztLwkkw2ls"},body:JSON.stringify({password:e})}),p=await d.json();if(!d.ok)throw new Error((p==null?void 0:p.error)||"Could not load transcripts.");a(p.conversations??[])}catch(d){ha.error(d.message||"Something went wrong.")}finally{n(!1)}}},l=()=>{if(!s)return;const c=[["Conversation","Started","Time","Speaker","Message","Where"]];s.forEach((h,f)=>{h.messages.forEach(m=>{c.push([String(s.length-f),Em(h.startedAt),Em(m.createdAt),m.role==="user"?"Visitor":"Assistant",m.content,h.pagePath??""])})});const d=c.map(h=>h.map(f=>`"${String(f).replace(/"/g,'""')}"`).join(",")).join(`
5127`),p=URL.createObjectURL(new Blob([d],{type:"text/csv"})),u=document.createElement("a");u.href=p,u.download=`help-chat-transcripts-${new Date().toISOString().slice(0,10)}.csv`,u.click(),URL.revokeObjectURL(p)};return o.jsxs("div",{className:"min-h-screen bg-white text-ab-ink",children:[o.jsxs(Sd,{children:[o.jsx("title",{children:"Help Chat Transcripts — Appraisal Bureau"}),o.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),o.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-20",children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.2em] text-primary flex items-center gap-2 mb-6",children:[o.jsx("span",{className:"h-1 w-1 rounded-full bg-primary inline-block"}),"Internal"]}
5127),o.jsx("h1",{className:"font-newsreader text-4xl md:text-5xl font-light tracking-tight mb-4",children:"Help chat transcripts"}),o.jsx("p",{className:"text-gray-600 font-light max-w-2xl mb-12",children:"Every conversation visitors have with the help chat, newest first."}),!s&&o.jsxs("form",{onSubmit:i,className:"max-w-sm space-y-4 border-t border-gray-200 pt-8",children:[o.jsxs("label",{className:"block text-sm text-gray-600 font-light",children:["Password",o.jsx("input",{type:"password",value:e,onChange:c=>t(c.target.value),className:"mt-2 w-full border border-gray-200 rounded-md px-3 py-2 text-sm focus:outline-none focus:border-primary",autoFocus:!0})]}),o.jsx("button",{type:"submit",disabled:r||!e.trim(),className:"text-sm px-5 py-2.5 rounded-md bg-primary text-primary-foreground disabled:opacity-40",children:r?"Loading…":"View transcripts"})]}),s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 pt-8 mb-10",children:[o.jsxs("p",{className:"text-sm text-gray-600 font-light",children:[s.length," conversation",s.length===1?"":"s"]}),s.length>0&&o.jsx("button",{onClick:l,className:"text-sm underline text-ab-ink hover:text-primary",children:"Download as spreadsheet"})]}),s.length===0&&o.jsx("p",{className:"text-gray-600 font-light",children:"No conversations recorded yet. New help chats will appear here."}),o.jsx("div",{className:"space-y-14",children:s.map((c,d)=>o.jsxs("article",{className:"border-t border-gray-200 pt-6",children:[o.jsxs("header",{className:"flex flex-wrap gap-x-6 gap-y-1 text-xs text-gray-500 font-light mb-5",children:[o.jsxs("span",{className:"text-ab-ink",children:["Conversation ",s.length-d]}),o.jsx("span",{children:Em(c.startedAt)}),o.jsxs("span",{children:[c.messages.length," messages"]}),c.pagePath&&o.jsx("span",{children:c.pagePath})]}),o.jsx("div",{className:"space-y-5",children:c.messages.map((p,u)=>o.jsxs("div",{children:[o.jsxs("p",{className:"text-[11px] uppercase tracking-[0.18em] text-gray-400 mb-1",children:[p.role==="user"?"Visitor":"Assistant"," · ",Em(p.createdAt)]}),o.jsx("p",{className:"text-sm text-gray-700 font-light whitespace-pre-wrap leading-relaxed",children:p.content})]},u))})]},c.sessionId))})]})]})]})},pN="ab-chat-session-id";function dae(){try{const e=sessionStorage.getItem(pN);if(e)return e;const t=crypto.randomUUID();return sessionStorage.setItem(pN,t),t}catch{return crypto.randomUUID()}}const uae="https://liedziqwqjrifamddcro.supabase.co/functions/v1/chat";function pae(e){return e.replace(/^## (.+)$/gm,'<h4 class="font-semibold text-sm mt-3 mb-1">$1</h4>').replace(/^### (.+)$/gm,'<h5 class="font-semibold text-sm mt-2 mb-1">$1</h5>').replace(/\*\*(.+?)\*\*/g,'<strong class="font-semibold">$1</strong>').replace(/^[\*\-] (.+)$/gm,'<li class="ml-4 list-disc">$1</li>').replace(/((?:<li[^>]*>.*?<\/li>\s*)+)/g,'<ul class="my-1.5 space-y-0.5">$1</ul>').replace(/\n\n/g,'</p><p class="mt-2">').replace(/\n/g,"<br/>").replace(/^(.+)/,"<p>$1</p>").replace(/<p><\/p>/g,"")}const x5=D.forwardRef((e,t)=>{var f;const[r,n]=D.useState(!1),[s,a]=D.useState([]),[i,l]=D.useState(""),[c,d]=D.useState(!1),p=D.useRef(null);D.useEffect(()=>{var m;(m=p.current)==null||m.scrollIntoView({behavior:"smooth"})},[s]);const u=D.useCallback(async m=>{var k,y,g;let v="";try{const _=await fetch(uae,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxpZWR6aXF3cWpyaWZhbWRkY3JvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc0MDExOTIsImV4cCI6MjA5Mjk3NzE5Mn0.iNrgvaKm3VOby7RGwDAmM4zDB7IthFzlHztLwkkw2ls"},body:JSON.stringify({messages:m,sessionId:dae(),source:"widget",pagePath:window.location.pathname})});if(!_.ok){const M=await _.json().catch(()=>({}));throw new Error(M.error||"Failed to get response")}if(!_.body)throw new Error("No response stream");const w=_.body.getReader(),x=new TextDecoder;let b="";for(;;){const{done:M,value:S}=await w.read();if(M)break;b+=x.decode(S,{stream:!0});let j;for(;(j=b.indexOf(`
5128`))!==-1;){let I=b.slice(0,j);if(b=b.slice(j+1),I.endsWith("\r")&&(I=I.slice(0,-1)),I.startsWith(":")||I.trim()===""||!I.startsWith("data: "))continue;const q=I.slice(6).trim();if(q==="[DONE]")break;try{const R=(g=(y=(k=JSON.parse(q).choices)==null?void 0:k[0])==null?void 0:y.delta)==null?void 0:g.content;if(R){v+=R;const K=v;a(H=>{const ee=H[H.length-1];return(ee==null?void 0:ee.role)==="assistant"?H.map((te,V)=>V===H.length-1?{...te,content:K}:te):[...H,{role:"assistant",content:K}]})}}catch{b=I+`
5129`+b;break}}}}catch(_){console.error("Chat error:",_),ha.error(_.message||"Something went wrong. Please try again.")}},[]),h=D.useCallback(async m=>{const v=m||i.trim();if(!v||c)return;const k={role:"user",content:v},y=[...s,k];a(y),m||l(""),d(!0),await u(y),d(!1)},[i,c,s,u]);return D.useImperativeHandle(t,()=>({sendExternalMessage:m=>{n(!0),setTimeout(()=>{const v={role:"user",content:m};a(k=>{const y=[...k,v];return d(!0),u(y).then(()=>d(!1)),y})},100)}}),[u]),o.jsxs(o.Fragment,{children:[!r&&o.jsx("button",{onClick:()=>
5129n(!0),className:"fixed bottom-6 right-6 z-50 h-14 w-14 rounded-full bg-brand-red text-white shadow-lg hover:bg-brand-red/90 transition-all flex items-center justify-center","aria-label":"Open chat",children:o.jsx(xW,{className:"h-6 w-6"})}),r&&o.jsxs("div",{className:"fixed bottom-6 right-6 z-50 w-[380px] max-w-[calc(100vw-2rem)] h-[500px] max-h-[calc(100vh-6rem)] bg-white rounded-2xl shadow-2xl border border-gray-200 flex flex-col overflow-hidden font-jakarta",children:[o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100 bg-[#F6F6F7]",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-bold text-brand-black",children:"Support Chat"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask us anything"})]}),o.jsx("button",{onClick:()=>n(!1),className:"p-1 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Close chat",children:o.jsx(Y0,{className:"h-5 w-5 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-3",children:[s.length===0&&o.jsxs("div",{className:"text-center text-muted-foreground text-sm py-8",children:[o.jsx("p",{className:"font-medium text-brand-black mb-1",children:"Hi there! 👋"}),o.jsx("p",{children:"How can we help you today?"})]}),s.map((m,v)=>o.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:m.role==="user"?o.jsx("div",{className:"max-w-[80%] rounded-2xl rounded-br-md px-4 py-2.5 text-sm leading-relaxed bg-brand-red text-white",children:m.content}):o.jsx("div",{className:"max-w-[80%] rounded-2xl rounded-bl-md px-4 py-2.5 text-sm leading-relaxed bg-[#F6F6F7] text-brand-black chat-markdown",dangerouslySetInnerHTML:{__html:pae(m.content)}})},v)),c&&((f=s[s.length-1])==null?void 0:f.role)!=="assistant"&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"bg-[#F6F6F7] rounded-2xl rounded-bl-md px-4 py-2.5 text-sm text-muted-foreground",children:"Thinking…"})}),o.jsx("div",{ref:p})]}),o.jsx("div",{className:"px-4 py-3 border-t border-gray-100",children:o.jsxs("form",{onSubmit:m=>{m.preventDefault(),h()},className:"flex gap-2",children:[o.jsx(fa,{value:i,onChange:m=>l(m.target.value),placeholder:"Type your question...",className:"flex-1 border-gray-200 text-sm",disabled:c}),o.jsx(rr,{type:"submit",size:"icon",disabled:c||!i.trim(),className:"bg-brand-red hover:bg-brand-red/90 shrink-0",children:o.jsx(fR,{className:"h-4 w-4"})})]})})]})]})});x5.displayName="ChatWidget";const hae=new R9,fae=()=>{const e=v5();return o.jsxs(Oq,{children:[o.jsx(hH,{}),o.jsxs(Sq,{children:[o.jsx(xr,{path:"/",element:o.jsx(zY,{})}),o.jsx(xr,{path:"/pricing",element:o.jsx(UY,{})}),o.jsx(xr,{path:"/product",element:o.jsx(tJ,{})}),o.jsx(xr,{path:"/company",element:o.jsx(aJ,{})}),o.jsx(xr,{path:"/login",element:o.jsx(kJ,{})}),o.jsx(xr,{path:"/privacy-policy",element:o.jsx(TJ,{})}),o.jsx(xr,{path:"/terms-of-service",element:o.jsx(MJ,{})}),o.jsx(xr,{path:"/careers",element:o.jsx(EJ,{})}),o.jsx(xr,{path:"/contact",element:o.jsx(_re,{})}),o.jsx(xr,{path:"/background-removal",element:o.jsx(use,{})}),o.jsx(xr,{path:"/insurance-valuations",element:o.jsx($se,{})}),o.jsx(xr,{path:"/tax-estate-valuations",element:o.jsx(Ose,{})}),o.jsx(xr,{path:"/loan-collateral-valuations",element:o.jsx(Dse,{})}),o.jsx(xr,{path:"/blog",element:o.jsx(HP,{})}),o.jsx(xr,{path:"/thejournal",element:o.jsx(HP,{})}),o.jsx(xr,{path:"/blog/:slug",element:o.jsx(dN,{})}),o.jsx(xr,{path:"/thejournal/:slug",element:o.jsx(dN,{})}),o.jsx(xr,{path:"/release-notes",element:o.jsx(zse,{})}),o.jsx(xr,{path:"/support",element:o.jsx(Wse,{})}),o.jsx(xr,{path:"/security",element:o.jsx(eae,{})}),o.jsx(xr,{path:"/integrations",element:o.jsx(uN,{})}),o.jsx(xr,{path:"/integrations/claude",element:o.jsx(nae,{})}),o.jsx(xr,{path:"/integrations/addepar",element:o.jsx(iae,{})}),o.jsx(xr,{path:"/partners",element:o.jsx(uN,{})}),o.jsx(xr,{path:"/internal/support",element:o.jsx(cae,{})}),o.jsx(xr,{path:"/.lovable/oauth/consent",element:o.jsx(oae,{})}),o.jsx(xr,{path:"*",element:o.jsx(BY,{})})]}),o.jsx(x5,{ref:e})]})},mae=()=>o.jsx(F9,{client:hae,children:o.jsx(hd,{children:o.jsx(h9,{children:o.jsxs(K7,{children:[o.jsx(dV,{}),o.jsx(LV,{}),o.jsx(Bse,{children:o.jsx(fae,{})})]})})})}),gae=document.head,gk=document.createElement("link");gk.rel="stylesheet";gk.href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;700;800&display=swap";gae.appendChild(gk);O3(document.getElementById("root")).render(o.jsx(Le.StrictMode,{children:o.jsx(mae,{})}));

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.