ventures: refresh havre from havre-open

This commit is contained in:
github-actions[bot] committed 2026-10-19 02:54:33 +00:00
1 parent 4051f9df2d
commit 86e598bd72
11 files changed
+222

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
openvenice by nikshepsvn, MIT License: https://github.com/nikshepsvn/openvenice
Built into Havre at /open/ from commit d983874a79810edaffb85721911630af29d09d95, unchanged.
@@ -0,0 +1 @@
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:"Inter", "InterVariable", system-ui, sans-serif;--font-mono:"JetBrains Mono", "SF Mono", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-300:oklch(82.3% .12 346.018);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-3xl:48rem;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--leading-loose:2;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg-base:#0a0a0c;--color-text-primary:#ffffffeb;--color-accent:#6ee7d3;--color-accent-soft:#6ee7d329}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:iLine truncated
@@ -0,0 +1,52 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workflows-view-xQJlxU4f.js","assets/workflow-engine-ClbuiuAZ.js","assets/workflow-engine-BZV40eAE.css","assets/playground-view-COPXwfh8.js"])))=>i.map(i=>d[i]);
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function u(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();function nf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var uc={exports:{}},Ba={};var Tp;function N1(){if(Tp)return Ba;Tp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(u,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:c}}return Ba.Fragment=l,Ba.jsx=a,Ba.jsxs=a,Ba}var Ap;function O1(){return Ap||(Ap=1,uc.exports=N1()),uc.exports}var p=O1(),sc={exports:{}},be={};var _p;function z1(){if(_p)return be;_p=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function C(M,G,E){this.props=M,this.context=G,this.refs=T,this.updater=E||k}C.prototype.isReactComponent={},C.prototype.setState=function(M,G){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,G,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function H(){}H.prototype=C.prototype;function O(M,G,E){this.props=M,this.context=G,this.refs=T,this.updater=E||k}var X=O.prototype=new H;X.constructor=O,_(X,C.prototype),X.isPureReactComponent=!0;var J=Array.isArray;function R(){}var $={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function ie(M,G,E){var re=E.ref;return{$$typeof:n,type:M,key:G,ref:re!==void 0?re:null,props:E}}function U(M,G){return ie(M.type,G,M.props)}function le(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function Z(M){var G={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(E){return G[E]})}var me=/\/+/g;function se(M,G){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):G.toString(36)}function K(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(R,R):(M.status="pending",M.then(function(G){M.status==="pending"&&(M.status="fulfilled",M.value=G)},function(G){M.status==="pending"&&(M.status="rejected",M.reason=G)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function D(M,G,E,re,ne){var ue=typeof M;(ue==="undefined"||ue==="boolean")&&(M=null);var xe=!1;if(M===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(M.$$typeof){case n:case l:xe=!0;break;case x:return xe=M._init,D(xe(M._payload),G,E,re,ne)}}if(xe)return ne=ne(M),xe=re===""?"."+se(M,0):re,J(ne)?(E="",xe!=null&&(E=xe.replace(me,"$&/")+"/"),D(ne,G,E,"",function(Tt){return Tt})):ne!=null&&(le(ne)&&(ne=U(ne,E+(ne.key==null||M&&M.key===ne.key?"":(""+ne.key).replace(me,"$&/")+"/")+xe)),G.push(ne)),1;xe=0;var He=re===""?".":re+":";if(J(M))for(var Me=0;Me<M.length;Me++)re=M[Me],ue=He+se(re,Me),xe+=D(re,G,E,ue,ne);else if(Me=S(M),typeof Me=="function")for(M=Me.call(M),Me=0;!(re=M.next()).done;)re=re.value,ue=He+se(re,Me++),xe+=D(re,G,E,ue,ne);else if(ue==="object"){if(typeof M.then=="function")return D(K(M),G,E,re,ne);throw G=String(M),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return xe}function W(M,G,E){if(M==null)return M;var re=[],ne=0;return D(M,re,"","",function(ue){return G.call(E,ue,ne++)}),re}function oe(M){if(M._status===-1){var G=M._result;G=G(),G.then(function(E){(M._status===0||M._status===-1)&&(M._status=1,M._result=E)},function(E){(M._status===0||M._status===-1)&&(M._status=2,MLine truncated
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+bt+e+Ji}var ve=!1;function gn(e,t){if(!e||ve)return"";ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(V){var q=V}Reflect.construct(e,[],P)}else{try{P.call()}catch(V){q=V}e.call(P.prototype)}}else{try{throw Error()}catch(V){q=V}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(V){if(V&&q&&typeof V.stack=="string")return[V.stack,q.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=r.DetermineComponentFrameRoot(),v=h[0],w=h[1];if(v&&w){var A=v.split(`
`),B=w.split(`
`);for(o=r=0;r<A.length&&!A[r].includes("DetermineComponentFrameRoot");)r++;for(;o<B.length&&!B[o].includes("DetermineComponentFrameRoot");)o++;if(r===A.length||o===B.length)for(r=A.length-1,o=B.length-1;1<=r&&0<=o&&A[r]!==B[o];)o--;for(;1<=r&&0<=o;r--,o--)if(A[r]!==B[o]){if(r!==1||o!==1)do if(r--,o--,0>o||A[r]!==B[o]){var F=`
`+A[r].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=r&&0<=o);break}}}finally{ve=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?on(i):""}function tr(e,t){switch(e.tag){case 26:case 27:case 5:return on(e.type);case 16:return on("Lazy");case 13:return e.child!==t&&t!==null?on("Suspense Fallback"):on("Suspense");case 19:return on("SuspenseList");case 0:case 15:return gn(e.type,!1);case 11:return gn(e.type.render,!1);case 1:return gn(e.type,!0);case 31:return on("Activity");default:return""}}function nr(e){try{var t="",i=null;do t+=tr(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}var Pi=Object.prototype.hasOwnProperty,Wi=n.unstable_scheduleCallback,Il=n.unstable_cancelCallback,Yu=n.unstable_shouldYield,Iu=n.unstable_requestPaint,St=n.unstable_now,Xu=n.unstable_getCurrentPriorityLevel,Y=n.unstable_ImmediatePriority,ae=n.unstable_UserBlockingPriority,ye=n.unstable_NormalPriority,je=n.unstable_LowPriority,Be=n.unstable_IdlePriority,Bt=n.log,En=n.unstable_setDisableYieldValue,wt=null,ut=null;function At(e){if(typeof Bt=="function"&&En(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(wt,e)}catch{}}var Ye=Math.clz32?Math.clz32:yx,In=Math.log,cn=Math.LN2;function yx(e){return e>>>=0,e===0?32:31-(In(e)/cn|0)|0}var ir=256,lr=262144,ar=4194304;function wi(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rr(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var o=0,h=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~h,r!==0?o=wi(r):(v&=w,v!==0?o=wi(v):i||(i=w&~e,i!==0&&(o=wi(i))))):(w=r&~h,w!==0?o=wi(w):v!==0?o=wi(v):i||(i=r&~e,i!==0&&(o=wi(i)))),o===0?0:t!==0&&t!==o&&(t&h)===0&&(h=o&-o,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:o}function Xl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nf(){var e=ar;return ar<<=1,(ar&62914560)===0&&(ar=4194304),e}function Ku(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Kl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vx(e,t,i,r,o,h){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var w=e.entanglements,A=e.expirationTimes,B=e.hiddenUpdates;for(i=v&~i;0<i;){var F=31-Ye(i),P=1<<F;w[F]=0,A[F]=-1;var q=B[F];if(q!==null)for(B[F]=null,F=0;F<q.length;F++){var V=q[F];V!==null&&(V.lane&=-536870913)}i&=~P}r!==0&&Of(e,r,0),h!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=h&~(v&~t))}function Of(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function zf(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Ye(i),o=1<<r;o&t|e[r]&t&&(e[r]|=t),i&=~o}}function Df(e,t){var i=t&-t;return i=(i&42)!==0?1:Zu(i),(i&(e.suspendedLanes|t))!==0?0:i}function Zu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ju(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rf(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:bp(e.type))}function Lf(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var Xn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Xn,_t="__reactProps$"+Xn,$i="__reactContainer$"+Xn,Pu="__reactEvents$"+Xn,bx="__reactListeners$"+Xn,Sx="__reactHandles$"+Xn,Uf="__reactResources$"+Xn,Zl="__reactMarker$"+Xn;function Wu(e){delete e[ht],delete e[_t],delete e[Pu],delete e[bx],delete e[Sx]}function el(e){var t=e[ht];if(t)return t;for(var i=e.parentNode;i;){if(t=i[$i]||i[ht]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=lp(e);e!==null;){if(i=e[ht])return i;e=lp(e)}return t}e=i,i=e.parentNode}return null}function tl(e){if(e=e[ht]||e[$i]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Jl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function nl(e){var t=e[Uf];return t||(t=e[Uf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[Zl]=!0}var Bf=new Set,Hf={};function ki(e,t){il(e,t),il(e+"Capture",t)}function il(e,t){for(Hf[e]=t,e=0;e<t.length;e++)Bf.add(t[e])}var wx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218 Line truncated
`).replace($0,"")}function Km(e,t){return t=Xm(t),Xm(e)===t}function Ge(e,t,i,r,o,h){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||al(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&al(e,""+r);break;case"className":sr(e,"class",r);break;case"tabIndex":sr(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":sr(e,i,r);break;case"style":Kf(e,r,h);break;case"data":if(t!=="object"){sr(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=cr(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(i==="formAction"?(t!=="input"&&Ge(e,t,"name",o.name,o,null),Ge(e,t,"formEncType",o.formEncType,o,null),Ge(e,t,"formMethod",o.formMethod,o,null),Ge(e,t,"formTarget",o.formTarget,o,null)):(Ge(e,t,"encType",o.encType,o,null),Ge(e,t,"method",o.method,o,null),Ge(e,t,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=cr(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=jn);break;case"onScroll":r!=null&&Ae("scroll",e);break;case"onScrollEnd":r!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(u(61));if(i=r.__html,i!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=cr(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),ur(e,"popover",r);break;case"xlinkActuate":Cn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Cn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Cn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Cn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Cn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Cn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ur(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Tx.get(i)||i,ur(e,i,r))}}function Go(e,t,i,r,o,h){switch(i){case"style":Kf(e,r,h);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(u(61));if(i=r.__html,i!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=i}}break;case"children":typeof r=="string"?al(e,r):(typeof r=="number"||typeof r=="bigint")&&al(e,""+r);break;case"onScroll":r!=null&&Ae("scroll",e);break;case"onScrollEnd":r!=null&&Ae("scrollend",e);break;case"onClick":r!=null&&(e.onclick=jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
`);l.push(u),l.push("")}return l.join(`
`)}const Pv="https://api.venice.ai/api/v1",Wv=new Set([408,425,429,500,502,503,504]),$v=2;class Ou extends Error{status;code;suggestedPrompt;constructor(l,a,u,s){super(l),this.name="VeniceAPIError",this.status=a,this.code=u,this.suggestedPrompt=s}}function eb(){const n=pn.getState().apiKey;if(!n)throw new Ou('API key not set. Click "API Key" in the header to connect.',401);return n}const Pp=n=>new Promise(l=>setTimeout(l,n));function Wp(n,l){if(l){const u=Number(l);if(Number.isFinite(u)&&u>0)return Math.min(u*1e3,3e4)}const a=500*2**n;return a+Math.random()*a*.25}async function tb(n){let l=`HTTP ${n.status}`,a,u;try{const s=await n.json();l=s.error?.message??l,a=s.error?.code,u=s.error?.suggested_prompt}catch{}return new Ou(l,n.status,a,u)}async function hf(n,l){const{stream:a,noAuth:u,retries:s=$v,...c}=l,f=new Headers(c.headers);u||f.set("Authorization",`Bearer ${eb()}`),c.body&&typeof c.body=="string"&&f.set("Content-Type","application/json");let d;for(let g=0;g<=s;g++)try{const m=await fetch(`${Pv}${n}`,{...c,headers:f});if(m.ok)return m;if(!Wv.has(m.status)||g===s)throw await tb(m);try{await m.arrayBuffer()}catch{}await Pp(Wp(g,m.headers.get("Retry-After")));continue}catch(m){if(d=m,m instanceof Ou||m instanceof DOMException&&m.name==="AbortError")throw m;if(g===s)break;await Pp(Wp(g))}throw d instanceof Error?d:new Ou("Network error",0)}async function Gn(n,l={}){const a=await hf(n,l);return l.stream?a.body:a.json()}async function nb(n,l,a={}){return(await hf(n,{method:"POST",body:l,signal:a.signal})).json()}async function Hu(n,l,a={}){return(await hf(n,{method:"POST",body:JSON.stringify(l),signal:a.signal})).blob()}function Ki(n){return ay({queryKey:["models",n],queryFn:()=>Gn(`/models${n?`?type=${n}`:""}`,{noAuth:!0}),staleTime:300*1e3,select:l=>l.data.filter(a=>!a.model_spec?.offline).sort((a,u)=>a.id.localeCompare(u.id))})}function ib(){const n=Ki("video"),l=[];if(n.data){const a=new Map;for(const u of n.data){const s=u.model_spec?.constraints;if(!s)continue;const c=u.model_spec?.name||u.id,f=c.toLowerCase();a.has(f)||a.set(f,{name:c,sets:u.model_spec?.model_sets||[]});const d=a.get(f);s.model_type==="text-to-video"?d.textModel=u:s.model_type==="image-to-video"&&(d.imageModel=u);const g=u.model_spec?.model_sets||[];for(const m of g)d.sets.includes(m)||d.sets.push(m)}l.push(...a.values())}return{...n,groups:l}}function bi({value:n,onChange:l,options:a,placeholder:u="Select...",searchable:s=!1,className:c}){const[f,d]=Q.useState(!1),[g,m]=Q.useState(""),x=Q.useRef(null),y=Q.useRef(null);Q.useEffect(()=>{const k=_=>{x.current&&!x.current.contains(_.target)&&d(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]),Q.useEffect(()=>{f&&s&&y.current?.focus()},[f,s]);const b=Q.useMemo(()=>g?a.filter(k=>k.label.toLowerCase().includes(g.toLowerCase())):a,[a,g]),S=a.find(k=>k.value===n)?.label||u;return p.jsxs("div",{ref:x,className:Ee("relative",c),children:[p.jsxs("button",{onClick:()=>{const k=!f;d(k),k||m("")},className:Ee("w-full flex items-center justify-between gap-2 bg-transparent border border-white/[0.06] rounded-md px-2.5 py-1.5 text-[15px] hover:border-white/[0.12] transition-colors outline-none",f&&"border-white/[0.15]"),children:[p.jsx("span",{className:Ee("truncate text-[15px]",n?"text-white/70":"text-white/20"),children:S}),p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:Ee("shrink-0 text-white/20 transition-transform duration-150",f&&"rotate-180"),children:p.jsx("path",{d:"M2.5 3.75L5 6.25L7.5 3.75"})})]}),f&&p.jsxs("div",{className:"absolute z-50 w-full mt-0.5 bg-[#0e0e0e] border border-white/[0.08] rounded-lg shadow-2xl shadow-black/50 animate-scale-in overflow-hidden",children:[s&&p.jsx("div",{className:"p-1 border-b border-white/[0.04]",children:p.jsx("input",{ref:y,value:g,onChange:k=>m(k.target.value),placeholder:"Search...",className:"w-full bg-white/[0.03] rounded px-2 py-1 text-[15px] text-white/70 outline-none placeholder:text-white/12"})}),p.jsx("div",{className:"max-h-60 overflow-y-auto p-0.5",children:b.length===0?p.jsx("div",{className:"px-2.5 py-2.5 text-[14px] text-white/15 text-center",children:"No results"}):b.map(k=>p.jsx("button",{onClick:()=>{l(k.value),d(!1)},className:Ee("w-full text-left px-3 py-[6px] text-[15px] rounded transition-colors",k.value===n?"bg-white/[0.07] text-white/80":"text-white/40 hover:bg-white/[0.04] hover:text-white/70"),children:k.label},k.value))})]})]})}function lb({className:n}){return p.jsxs("svg",{className:Ee("animate-spin h-3.5 w-3.5",n),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function Ce({children:n,htmlFor:l,hint:a}){return p.jsxs("div",{className:"flex Line truncated
`).split(`
`);s=m.pop()??"";for(const x of m){const y=[];for(const S of x.split(`
`))if(!(!S||S.startsWith(":"))&&S.startsWith("data:")){const k=S.slice(5);y.push(k.startsWith(" ")?k.slice(1):k)}if(y.length===0)continue;const b=y.join(`
`);if(b==="[DONE]")return;try{yield JSON.parse(b)}catch{}}}}finally{l.signal&&l.signal.removeEventListener("abort",c);try{a.releaseLock()}catch{}}}function mb(){const n=Q.useRef(null),{addMessage:l,appendToLastAssistant:a,appendReasoningToLastAssistant:u,deleteMessage:s,setStreaming:c,isStreaming:f,veniceParams:d,systemPrompt:g,temperature:m,topP:x,maxTokens:y,createConversation:b}=Ct(),S=Q.useCallback(async(C,H,O)=>{const X=Ct.getState().conversations.find(ee=>ee.id===C);if(!X)return;const J=X.messages.filter(ee=>typeof ee.content=="string"?ee.content!=="":!0);g.trim()&&J.unshift({role:"system",content:g.trim()});const $=await Gn("/chat/completions",{method:"POST",body:JSON.stringify({model:H,messages:J,stream:!0,temperature:m,top_p:x,max_tokens:y,venice_parameters:d}),stream:!0,signal:O.signal});for await(const ee of db($,{signal:O.signal})){const ie=ee.choices[0]?.delta;ie?.content&&a(C,ie.content),ie?.reasoning_content&&u(C,ie.reasoning_content)}},[a,u,d,g,m,x,y]),k=Q.useCallback(async(C,H,O)=>{let X=Ct.getState().activeConversationId;X||(X=b(H));let J;O&&O.length>0?J={role:"user",content:[{type:"text",text:C},...O.map(ee=>({type:"image_url",image_url:{url:ee}}))]}:J={role:"user",content:C},l(X,J),l(X,{role:"assistant",content:""}),c(!0);const R=new AbortController;n.current=R;try{await S(X,H,R)}catch($){if($ instanceof DOMException&&$.name==="AbortError")return;const ee=$ instanceof Error?$.message:"Unknown error";a(X,`
[Error: ${ee}]`)}finally{c(!1),n.current=null}},[l,a,b,c,S]),_=Q.useCallback(async C=>{const H=Ct.getState().activeConversationId;if(!H)return;const O=Ct.getState().conversations.find(R=>R.id===H);if(!O)return;const X=O.messages.length-1;O.messages[X]?.role==="assistant"&&s(H,X),l(H,{role:"assistant",content:""}),c(!0);const J=new AbortController;n.current=J;try{await S(H,C,J)}catch(R){if(R instanceof DOMException&&R.name==="AbortError")return;const $=R instanceof Error?R.message:"Unknown error";a(H,`
[Error: ${$}]`)}finally{c(!1),n.current=null}},[l,a,s,c,S]),T=Q.useCallback(()=>{n.current?.abort(),c(!1)},[c]);return{send:k,stop:T,regenerate:_,isStreaming:f}}function pb(n,l){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const gb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xb={};function $p(n,l){return(xb.jsx?yb:gb).test(n)}const vb=/[ \t\n\f\r]/g;function bb(n){return typeof n=="object"?n.type==="text"?eg(n.value):!1:eg(n)}function eg(n){return n.replace(vb,"")===""}class Pa{constructor(l,a,u){this.normal=a,this.property=l,u&&(this.space=u)}}Pa.prototype.normal={};Pa.prototype.property={};Pa.prototype.space=void 0;function cy(n,l){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new Pa(a,u,l)}function Yc(n){return n.toLowerCase()}class Ut{constructor(l,a){this.attribute=a,this.property=l}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let Sb=0;const ke=Zi(),rt=Zi(),Ic=Zi(),te=Zi(),Ke=Zi(),Ql=Zi(),It=Zi();function Zi(){return 2**++Sb}const Xc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:rt,commaOrSpaceSeparated:It,commaSeparated:Ql,number:te,overloadedBoolean:Ic,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),pc=Object.keys(Xc);class df extends Ut{constructor(l,a,u,s){let c=-1;if(super(l,a),tg(this,"space",s),typeof u=="number")for(;++c<pc.length;){const f=pc[c];tg(this,pc[c],(u&Xc[f])===Xc[f])}}}df.prototype.defined=!0;function tg(n,l,a){a&&(n[l]=a)}function Fl(n){const l={},a={};for(const[u,s]of Object.entries(n.properties)){const c=new df(u,n.transform(n.attributes||{},u),s,n.space);n.mustUseProperty&&n.mustUseProperty.includes(u)&&(c.mustUseProperty=!0),l[u]=c,a[Yc(u)]=u,a[Yc(c.attribute)]=u}return new Pa(l,a,n.space)}const fy=Fl({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:te,ariaColIndex:te,ariaColSpan:te,ariaControls:Ke,ariaCurrent:null,ariaDescribedBy:Ke,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Ke,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Ke,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ke,ariaLevel:te,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Ke,ariaPlaceholder:null,ariaPosInSet:te,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Ke,ariaRowCount:te,ariaRowIndex:te,ariaRowSpan:te,ariaSelected:rt,ariaSetSize:te,ariaSort:null,ariaValueMax:te,ariaValueMin:te,ariaValueNow:te,ariaValueText:null,role:null},transform(n,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function hy(n,l){return l in n?n[l]:l}function dy(n,l){return hy(n,l.toLowerCase())}const wb=Fl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ql,acceptCharset:Ke,accessKey:Ke,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Ke,autoFocus:ke,autoPlay:ke,blocking:Ke,capture:null,charSet:null,checked:ke,cite:null,className:Ke,cols:te,colSpan:null,content:null,contentEditable:rt,controls:ke,controlsList:Ke,coords:te|Ql,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Ic,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Ke,height:te,hidden:Ic,high:te,href:null,hrefLang:null,htmlFor:Ke,httpEquiv:Ke,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Ke,itemRef:Ke,itemScope:ke,itemType:Ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:te,manifest:null,max:null,maxLength:te,media:null,method:null,min:null,minLength:te,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd Line truncated
`,m="/",x="*",y="",b="comment",S="declaration";function k(T,C){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];C=C||{};var H=1,O=1;function X(se){var K=se.match(l);K&&(H+=K.length);var D=se.lastIndexOf(g);O=~D?se.length-D:O+se.length}function J(){var se={line:H,column:O};return function(K){return K.position=new R(se),ie(),K}}function R(se){this.start=se,this.end={line:H,column:O},this.source=C.source}R.prototype.content=T;function $(se){var K=new Error(C.source+":"+H+":"+O+": "+se);if(K.reason=se,K.filename=C.source,K.line=H,K.column=O,K.source=T,!C.silent)throw K}function ee(se){var K=se.exec(T);if(K){var D=K[0];return X(D),T=T.slice(D.length),K}}function ie(){ee(a)}function U(se){var K;for(se=se||[];K=le();)K!==!1&&se.push(K);return se}function le(){var se=J();if(!(m!=T.charAt(0)||x!=T.charAt(1))){for(var K=2;y!=T.charAt(K)&&(x!=T.charAt(K)||m!=T.charAt(K+1));)++K;if(K+=2,y===T.charAt(K-1))return $("End of comment missing");var D=T.slice(2,K-2);return O+=2,X(D),T=T.slice(K),O+=2,se({type:b,comment:D})}}function Z(){var se=J(),K=ee(u);if(K){if(le(),!ee(s))return $("property missing ':'");var D=ee(c),W=se({type:S,property:_(K[0].replace(n,y)),value:D?_(D[0].replace(n,y)):y});return ee(f),W}}function me(){var se=[];U(se);for(var K;K=Z();)K!==!1&&(se.push(K),U(se));return se}return ie(),me()}function _(T){return T?T.replace(d,y):y}return gc=k,gc}var lg;function zb(){if(lg)return Ul;lg=1;var n=Ul&&Ul.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.default=a;const l=n(Ob());function a(u,s){let c=null;if(!u||typeof u!="string")return c;const f=(0,l.default)(u),d=typeof s=="function";return f.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:x}=g;d?s(m,x,g):x&&(c=c||{},c[m]=x)}),c}return Ul}var Qa={},ag;function Db(){if(ag)return Qa;ag=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,u=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(m){return!m||a.test(m)||n.test(m)},f=function(m,x){return x.toUpperCase()},d=function(m,x){return"".concat(x,"-")},g=function(m,x){return x===void 0&&(x={}),c(m)?m:(m=m.toLowerCase(),x.reactCompat?m=m.replace(s,d):m=m.replace(u,d),m.replace(l,f))};return Qa.camelCase=g,Qa}var Va,rg;function Rb(){if(rg)return Va;rg=1;var n=Va&&Va.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},l=n(zb()),a=Db();function u(s,c){var f={};return!s||typeof s!="string"||(0,l.default)(s,function(d,g){d&&g&&(f[(0,a.camelCase)(d,c)]=g)}),f}return u.default=u,Va=u,Va}var Lb=Rb();const Ub=nf(Lb),yy=xy("end"),pf=xy("start");function xy(n){return l;function l(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function Bb(n){const l=pf(n),a=yy(n);if(l&&a)return{start:l,end:a}}function Ya(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ug(n.position):"start"in n||"end"in n?ug(n):"line"in n||"column"in n?Kc(n):""}function Kc(n){return sg(n&&n.line)+":"+sg(n&&n.column)}function ug(n){return Kc(n&&n.start)+"-"+Kc(n&&n.end)}function sg(n){return n&&typeof n=="number"?n:1}class vt extends Error{constructor(l,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",c={},f=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof l=="string"?s=l:!c.cause&&l&&(f=!0,s=l.message,c.cause=l),!c.ruleId&&!c.source&&typeof u=="string"){const g=u.indexOf(":");g===-1?c.ruleId=u:(c.source=u.slice(0,g),c.ruleId=u.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Ya(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=f&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const gf={}.hasOwnProperty,Hb=new Map,qb=/[A-Z]/g,Qb=new Set(["table","tbody","thead","tfoot","tr"]),Vb=new Set(["td","th"]),vy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gb(n,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||vo Line truncated
`;break}case-3:{f=`\r
`;break}case-2:{f=l?" ":" ";break}case-1:{if(!l&&s)continue;f=" ";break}default:f=String.fromCharCode(c)}s=c===-2,u.push(f)}return u.join("")}function PS(n){const u={constructs:Ey([XS,...(n||{}).extensions||[]]),content:s(h2),defined:[],document:s(m2),flow:s(OS),lazy:{},string:s(RS),text:s(LS)};return u;function s(c){return f;function f(d){return KS(u,c,d)}}}function WS(n){for(;!_y(n););return n}const xg=/[\0\t\n\r]/g;function $S(){let n=1,l="",a=!0,u;return s;function s(c,f,d){const g=[];let m,x,y,b,S;for(c=l+(typeof c=="string"?c.toString():new TextDecoder(f||void 0).decode(c)),y=0,l="",a&&(c.charCodeAt(0)===65279&&y++,a=void 0);y<c.length;){if(xg.lastIndex=y,m=xg.exec(c),b=m&&m.index!==void 0?m.index:c.length,S=c.charCodeAt(b),!m){l=c.slice(y);break}if(S===10&&y===b&&u)g.push(-3),u=void 0;else switch(u&&(g.push(-5),u=void 0),y<b&&(g.push(c.slice(y,b)),n+=b-y),S){case 0:{g.push(65533),n++;break}case 9:{for(x=Math.ceil(n/4)*4,g.push(-2);n++<x;)g.push(-1);break}case 10:{g.push(-4),n=1;break}default:u=!0,n=1}y=b+1}return d&&(u&&g.push(-5),l&&g.push(l),g.push(null)),g}}const ew=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tw(n){return n.replace(ew,nw)}function nw(n,l,a){if(l)return l;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),c=s===120||s===88;return Cy(a.slice(c?2:1),c?16:10)}return bf(a)||n}const Ry={}.hasOwnProperty;function iw(n,l,a){return l&&typeof l=="object"&&(a=l,l=void 0),lw(a)(WS(PS(a).document().write($S()(n,l,!0))))}function lw(n){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Pi),autolinkProtocol:ie,autolinkEmail:ie,atxHeading:c(ve),blockQuote:c(Tt),characterEscape:ie,characterReference:ie,codeFenced:c(sn),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:c(sn,f),codeText:c(bt,f),codeTextData:ie,data:ie,codeFlowValue:ie,definition:c(Ji),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:c(on),hardBreakEscape:c(gn),hardBreakTrailing:c(gn),htmlFlow:c(tr,f),htmlFlowData:ie,htmlText:c(tr,f),htmlTextData:ie,image:c(nr),label:f,link:c(Pi),listItem:c(Il),listItemValue:b,listOrdered:c(Wi,y),listUnordered:c(Wi),paragraph:c(Yu),reference:E,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:c(ve),strong:c(Iu),thematicBreak:c(Xu)},exit:{atxHeading:g(),atxHeadingSequence:J,autolink:g(),autolinkEmail:Me,autolinkProtocol:He,blockQuote:g(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:ue,characterReference:xe,codeFenced:g(T),codeFencedFence:_,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:U,codeIndented:g(C),codeText:g(K),codeTextData:U,data:U,definition:g(),definitionDestinationString:X,definitionLabelString:H,definitionTitleString:O,emphasis:g(),hardBreakEscape:g(Z),hardBreakTrailing:g(Z),htmlFlow:g(me),htmlFlowData:U,htmlText:g(se),htmlTextData:U,image:g(W),label:de,labelText:oe,lineEnding:le,link:g(D),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:re,resourceDestinationString:j,resourceTitleString:M,resource:G,setextHeading:g(ee),setextHeadingLineSequence:$,setextHeadingText:R,strong:g(),thematicBreak:g()}};Ly(l,(n||{}).mdastExtensions||[]);const a={};return u;function u(Y){let ae={type:"root",children:[]};const ye={stack:[ae],tokenStack:[],config:l,enter:d,exit:m,buffer:f,resume:x,data:a},je=[];let Be=-1;for(;++Be<Y.length;)if(Y[Be][1].type==="listOrdered"||Y[Be][1].type==="listUnordered")if(Y[Be][0]==="enter")je.push(Be);else{const Bt=je.pop();Be=s(Y,Bt,Be)}for(Be=-1;++Be<Y.length;){const Bt=l[Y[Be][0]];Ry.call(Bt,Y[Be][1].type)&&Bt[Y[Be][1].type].call(Object.assign({sliceSerialize:Y[Be][2].sliceSerialize},ye),Y[Be][1])}if(ye.tokenStack.length>0){const Bt=ye.tokenStack[ye.tokenStack.length-1];(Bt[1]||vg).call(ye,void 0,Bt[0])}for(ae.position={start:yi(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:yi(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<l.transforms.length;)ae=l.transforms[Be](ae)||ae;return ae}function s(Y,ae,ye){let je=ae-1,Be=-1,Bt=!1,En,wt,ut,At;for(;++je<=ye;){const Ye=Y[je];switch(Ye[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ye[0]==="enter"?Be++:Be--,At=void 0;break}case"lineEndingBlank":{Ye[0]==="enter"&&(En&&!At&&!Be&&!ut&&(ut=je),At=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:At=void 0}if(!Be&&Ye[0]==="enter"&&Ye[1].type==="listItemPrefix"||Be===-1&&Ye[0]==="exit"&&(Ye[1].type==="listUnordered"||Ye[1].type==="listOrdered")){if(En){let In=je;for(wt=void 0;In--;){const cn=Y[In];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;wt&&(Y[wt][1].type="lineEndingBlank",Bt=!0),cn[1].type="lineEnding",wt=In}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[Line truncated
`}]}function ow(n,l){const a=l.value?l.value+`
`:"",u={},s=l.lang?l.lang.split(/\s+/):[];s.length>0&&(u.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return l.meta&&(c.data={meta:l.meta}),n.patch(l,c),c=n.applyData(l,c),c={type:"element",tagName:"pre",properties:{},children:[c]},n.patch(l,c),c}function cw(n,l){const a={type:"element",tagName:"del",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function fw(n,l){const a={type:"element",tagName:"em",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function hw(n,l){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(l.identifier).toUpperCase(),s=Yl(u.toLowerCase()),c=n.footnoteOrder.indexOf(u);let f,d=n.footnoteCounts.get(u);d===void 0?(d=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=c+1,d+=1,n.footnoteCounts.set(u,d);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(l,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return n.patch(l,m),n.applyData(l,m)}function dw(n,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function mw(n,l){if(n.options.allowDangerousHtml){const a={type:"raw",value:l.value};return n.patch(l,a),n.applyData(l,a)}}function Uy(n,l){const a=l.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+u}];const s=n.all(l),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function pw(n,l){const a=String(l.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Uy(n,l);const s={src:Yl(u.url||""),alt:l.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const c={type:"element",tagName:"img",properties:s,children:[]};return n.patch(l,c),n.applyData(l,c)}function gw(n,l){const a={src:Yl(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(l,u),n.applyData(l,u)}function yw(n,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};n.patch(l,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(l,u),n.applyData(l,u)}function xw(n,l){const a=String(l.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Uy(n,l);const s={href:Yl(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const c={type:"element",tagName:"a",properties:s,children:n.all(l)};return n.patch(l,c),n.applyData(l,c)}function vw(n,l){const a={href:Yl(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"a",properties:a,children:n.all(l)};return n.patch(l,u),n.applyData(l,u)}function bw(n,l,a){const u=n.all(l),s=a?Sw(a):By(l),c={},f=[];if(typeof l.checked=="boolean"){const x=u[0];let y;x&&x.type==="element"&&x.tagName==="p"?y=x:(y={type:"element",tagName:"p",properties:{},children:[]},u.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<u.length;){const x=u[d];(s||d!==0||x.type!=="element"||x.tagName!=="p")&&f.push({type:"text",value:`
`}),x.type==="element"&&x.tagName==="p"&&!s?f.push(...x.children):f.push(x)}const g=u[u.length-1];g&&(s||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
`});const m={type:"element",tagName:"li",properties:c,children:f};return n.patch(l,m),n.applyData(l,m)}function Sw(n){let l=!1;if(n.type==="list"){l=n.spread||!1;const a=n.children;let u=-1;for(;!l&&++u<a.length;)l=By(a[u])}return l}function By(n){const l=n.spread;return l??n.children.length>1}function ww(n,l){const a={},u=n.all(l);let s=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++s<u.length;){const f=u[s];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:l.ordered?"ol":"ul",properties:a,children:n.wrap(u,!0)};return n.patch(l,c),n.applyData(l,c)}function kw(n,l){const a={type:"element",tagName:"p",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function Ew(n,l){const a={type:"root",children:n.wrap(n.all(l))};return n.patch(l,a),n.applyData(l,a)}function Cw(n,l){const a={type:"element",tagName:"strong",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function jw(n,l){const a=n.all(l),u=a.shift(),s=[];if(u){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([u],!0)};n.patch(l.children[0],f),s.push(f)}if(a.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},d=pf(l.children[1]),g=yy(l.children[l.children.length-1]);d&&g&&(f.position={start:d,end:g}),s.push(f)}const c={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(l,c),n.applyData(l,c)}function Tw(n,l,a){const u=a?a.children:void 0,c=(u?u.indexOf(l):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,d=f?f.length:l.children.length;let g=-1;const m=[];for(;++g<d;){const y=l.children[g],b={},S=f?f[g]:void 0;S&&(b.align=S);let k={type:"element",tagName:c,properties:b,children:[]};y&&(k.children=n.all(y),n.patch(y,k),k=n.applyData(y,k)),m.push(k)}const x={type:"element",tagName:"tr",properties:{},children:n.wrap(m,!0)};return n.patch(l,x),n.applyData(l,x)}function Aw(n,l){const a={type:"element",tagName:"td",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}const bg=9,Sg=32;function _w(n){const l=String(n),a=/\r?\n|\r/g;let u=a.exec(l),s=0;const c=[];for(;u;)c.push(wg(l.slice(s,u.index),s>0,!0),u[0]),s=u.index+u[0].length,u=a.exec(l);return c.push(wg(l.slice(s),s>0,!1)),c.join("")}function wg(n,l,a){let u=0,s=n.length;if(l){let c=n.codePointAt(u);for(;c===bg||c===Sg;)u++,c=n.codePointAt(u)}if(a){let c=n.codePointAt(s-1);for(;c===bg||c===Sg;)s--,c=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function Mw(n,l){const a={type:"text",value:_w(String(l.value))};return n.patch(l,a),n.applyData(l,a)}function Nw(n,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(l,a),n.applyData(l,a)}const Ow={blockquote:uw,break:sw,code:ow,delete:cw,emphasis:fw,footnoteReference:hw,heading:dw,html:mw,imageReference:pw,image:gw,inlineCode:yw,linkReference:xw,link:vw,listItem:bw,list:ww,paragraph:kw,root:Ew,strong:Cw,table:jw,tableCell:Aw,tableRow:Tw,text:Mw,thematicBreak:Nw,toml:Su,yaml:Su,definition:Su,footnoteDefinition:Su};function Su(){}const Hy=-1,Vu=0,Xa=1,Ru=2,wf=3,kf=4,Ef=5,Cf=6,qy=7,Qy=8,kg=typeof self=="object"?self:globalThis,zw=(n,l)=>{const a=(s,c)=>(n.set(c,s),s),u=s=>{if(n.has(s))return n.get(s);const[c,f]=l[s];switch(c){case Vu:case Hy:return a(f,s);case Xa:{const d=a([],s);for(const g of f)d.push(u(g));return d}case Ru:{const d=a({},s);for(const[g,m]of f)d[u(g)]=u(m);return d}case wf:return a(new Date(f),s);case kf:{const{source:d,flags:g}=f;return a(new RegExp(d,g),s)}case Ef:{const d=a(new Map,s);for(const[g,m]of f)d.set(u(g),u(m));return d}case Cf:{const d=a(new Set,s);for(const g of f)d.add(u(g));return d}case qy:{const{name:d,message:g}=f;return a(new kg[d](g),s)}case Qy:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:d}=new Uint8Array(f);return a(new DataView(d),f)}}return a(new kg[c](f),s)};return u},Eg=n=>zw(new Map,n)(0),Bl="",{toString:Dw}={},{keys:Rw}=Object,Fa=n=>{const l=typeof n;if(l!=="object"||!n)return[Vu,l];const a=Dw.call(n).slice(8,-1);switch(a){case"Array":return[Xa,Bl];case"Object":return[Ru,Bl];case"Date":return[wf,Bl];case"RegExp":return[kf,Bl];case"Map":return[Ef,Bl];case"Set":return[Cf,Bl];case"DataView":return[Xa,a]}return a.includes("Array")?[Xa,a]:a.includes("Error")?[qy,a]:[Ru,a]},wu=([n,l])=>n===Vu&&(l==="function"||l==="symbol"),Lw=(n,l,a,u)=>{const s=(f,d)=>{const g=u.push(f)-1;return a.set(d,g),g},c=f=>{if(a.has(f))return a.get(f);let[d,g]=Fa(f);switch(d){case Vu:{let x=f;switch(g){case"bigint":d=Qy,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+g);x=null;break;case"undefined":return s([Hy],f)}return s([d,x],f)}case Xa:{if(g){let b=f;return g==="DataView"?b=new Uint8Array(f.buffer):g==="ArrayBuffer"&&(b=new Uint8Array( Line truncated
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(d,!0)},{type:"text",value:`
`}]}}const Gu=(function(n){if(n==null)return Gw;if(typeof n=="function")return Fu(n);if(typeof n=="object")return Array.isArray(n)?qw(n):Qw(n);if(typeof n=="string")return Vw(n);throw new Error("Expected function, string, or object as test")});function qw(n){const l=[];let a=-1;for(;++a<n.length;)l[a]=Gu(n[a]);return Fu(u);function u(...s){let c=-1;for(;++c<l.length;)if(l[c].apply(this,s))return!0;return!1}}function Qw(n){const l=n;return Fu(a);function a(u){const s=u;let c;for(c in n)if(s[c]!==l[c])return!1;return!0}}function Vw(n){return Fu(l);function l(a){return a&&a.type===n}}function Fu(n){return l;function l(a,u,s){return!!(Fw(a)&&n.call(this,a,typeof u=="number"?u:void 0,s||void 0))}}function Gw(){return!0}function Fw(n){return n!==null&&typeof n=="object"&&"type"in n}const Vy=[],Yw=!0,Pc=!1,Iw="skip";function Gy(n,l,a,u){let s;typeof l=="function"&&typeof a!="function"?(u=a,a=l):s=l;const c=Gu(s),f=u?-1:1;d(n,void 0,[])();function d(g,m,x){const y=g&&typeof g=="object"?g:{};if(typeof y.type=="string"){const S=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(g.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=Vy,k,_,T;if((!l||c(g,m,x[x.length-1]||void 0))&&(S=Xw(a(g,x)),S[0]===Pc))return S;if("children"in g&&g.children){const C=g;if(C.children&&S[0]!==Iw)for(_=(u?C.children.length:-1)+f,T=x.concat(C);_>-1&&_<C.children.length;){const H=C.children[_];if(k=d(H,_,T)(),k[0]===Pc)return k;_=typeof k[1]=="number"?k[1]:_+f}}return S}}}function Xw(n){return Array.isArray(n)?n:typeof n=="number"?[Yw,n]:n==null?Vy:[n]}function jf(n,l,a,u){let s,c,f;typeof l=="function"&&typeof a!="function"?(c=void 0,f=l,s=a):(c=l,f=a,s=u),Gy(n,c,d,s);function d(g,m){const x=m[m.length-1],y=x?x.children.indexOf(g):void 0;return f(g,y,x)}}const Wc={}.hasOwnProperty,Kw={};function Zw(n,l){const a=l||Kw,u=new Map,s=new Map,c=new Map,f={...Ow,...a.handlers},d={all:m,applyData:Pw,definitionById:u,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:f,one:g,options:a,patch:Jw,wrap:$w};return jf(n,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const y=x.type==="definition"?u:s,b=String(x.identifier).toUpperCase();y.has(b)||y.set(b,x)}}),d;function g(x,y){const b=x.type,S=d.handlers[b];if(Wc.call(d.handlers,b)&&S)return S(d,x,y);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in x){const{children:_,...T}=x,C=Lu(T);return C.children=d.all(x),C}return Lu(x)}return(d.options.unknownHandler||Ww)(d,x,y)}function m(x){const y=[];if("children"in x){const b=x.children;let S=-1;for(;++S<b.length;){const k=d.one(b[S],x);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=jg(k.value)),!Array.isArray(k)&&k.type==="element")){const _=k.children[0];_&&_.type==="text"&&(_.value=jg(_.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function Jw(n,l){n.position&&(l.position=Bb(n))}function Pw(n,l){let a=l;if(n&&n.data){const u=n.data.hName,s=n.data.hChildren,c=n.data.hProperties;if(typeof u=="string")if(a.type==="element")a.tagName=u;else{const f="children"in a?a.children:[a];a={type:"element",tagName:u,properties:{},children:f}}a.type==="element"&&c&&Object.assign(a.properties,Lu(c)),"children"in a&&a.children&&s!==null&&s!==void 0&&(a.children=s)}return a}function Ww(n,l){const a=l.data||{},u="value"in l&&!(Wc.call(a,"hProperties")||Wc.call(a,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:n.all(l)};return n.patch(l,u),n.applyData(l,u)}function $w(n,l){const a=[];let u=-1;for(l&&a.push({type:"text",value:`
`});++u<n.length;)u&&a.push({type:"text",value:`
`}),a.push(n[u]);return l&&n.length>0&&a.push({type:"text",value:`
`}),a}function jg(n){let l=0,a=n.charCodeAt(l);for(;a===9||a===32;)l++,a=n.charCodeAt(l);return n.slice(l)}function Tg(n,l){const a=Zw(n,l),u=a.one(n,void 0),s=Hw(a),c=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
`},s),c}function ek(n,l){return n&&"run"in n?async function(a,u){const s=Tg(a,{file:u,...l});await n.run(s,u)}:function(a,u){return Tg(a,{file:u,...n||l})}}function Ag(n){if(n)throw n}var bc,_g;function tk(){if(_g)return bc;_g=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):l.call(m)==="[object Array]"},c=function(m){if(!m||l.call(m)!=="[object Object]")return!1;var x=n.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&n.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!x&&!y)return!1;var b;for(b in m);return typeof b>"u"||n.call(m,b)},f=function(m,x){a&&x.name==="__proto__"?a(m,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):m[x.name]=x.newValue},d=function(m,x){if(x==="__proto__")if(n.call(m,x)){if(u)return u(m,x).value}else return;return m[x]};return bc=function g(){var m,x,y,b,S,k,_=arguments[0],T=1,C=arguments.length,H=!1;for(typeof _=="boolean"&&(H=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});T<C;++T)if(m=arguments[T],m!=null)for(x in m)y=d(_,x),b=d(m,x),_!==b&&(H&&b&&(c(b)||(S=s(b)))?(S?(S=!1,k=y&&s(y)?y:[]):k=y&&c(y)?y:{},f(_,{name:x,newValue:g(H,k,b)})):typeof b<"u"&&f(_,{name:x,newValue:b}));return _},bc}var nk=tk();const Sc=nf(nk);function $c(n){if(typeof n!="object"||n===null)return!1;const l=Object.getPrototypeOf(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function ik(){const n=[],l={run:a,use:u};return l;function a(...s){let c=-1;const f=s.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);d(null,...s);function d(g,...m){const x=n[++c];let y=-1;if(g){f(g);return}for(;++y<s.length;)(m[y]===null||m[y]===void 0)&&(m[y]=s[y]);s=m,x?lk(x,d)(...m):f(null,...m)}}function u(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return n.push(s),l}}function lk(n,l){let a;return u;function u(...f){const d=n.length>f.length;let g;d&&f.push(s);try{g=n.apply(this,f)}catch(m){const x=m;if(d&&a)throw x;return s(x)}d||(g&&g.then&&typeof g.then=="function"?g.then(c,s):g instanceof Error?s(g):c(g))}function s(f,...d){a||(a=!0,l(f,...d))}function c(f){s(null,f)}}const Sn={basename:ak,dirname:rk,extname:uk,join:sk,sep:"/"};function ak(n,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');$a(n);let a=0,u=-1,s=n.length,c;if(l===void 0||l.length===0||l.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(c){a=s+1;break}}else u<0&&(c=!0,u=s+1);return u<0?"":n.slice(a,u)}if(l===n)return"";let f=-1,d=l.length-1;for(;s--;)if(n.codePointAt(s)===47){if(c){a=s+1;break}}else f<0&&(c=!0,f=s+1),d>-1&&(n.codePointAt(s)===l.codePointAt(d--)?d<0&&(u=s):(d=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function rk(n){if($a(n),n.length===0)return".";let l=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){l=a;break}}else u||(u=!0);return l<0?n.codePointAt(0)===47?"/":".":l===1&&n.codePointAt(0)===47?"//":n.slice(0,l)}function uk(n){$a(n);let l=n.length,a=-1,u=0,s=-1,c=0,f;for(;l--;){const d=n.codePointAt(l);if(d===47){if(f){u=l+1;break}continue}a<0&&(f=!0,a=l+1),d===46?s<0?s=l:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||a<0||c===0||c===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function sk(...n){let l=-1,a;for(;++l<n.length;)$a(n[l]),n[l]&&(a=a===void 0?n[l]:a+"/"+n[l]);return a===void 0?".":ok(a)}function ok(n){$a(n);const l=n.codePointAt(0)===47;let a=ck(n,!l);return a.length===0&&!l&&(a="."),a.length>0&&n.codePointAt(n.length-1)===47&&(a+="/"),l?"/"+a:a}function ck(n,l){let a="",u=0,s=-1,c=0,f=-1,d,g;for(;++f<=n.length;){if(f<n.length)d=n.codePointAt(f);else{if(d===47)break;d=47}if(d===47){if(!(s===f-1||c===1))if(s!==f-1&&c===2){if(a.length<2||u!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",u=0):(a=a.slice(0,g),u=a.length-1-a.lastIndexOf("/")),s=f,c=0;continue}}else if(a.length>0){a="",u=0,s=f,c=0;continue}}l&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,c=0}else d===46&&c>-1?c++:c=-1}return a}function $a(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const fk={cwd:hk};function hk(){return"/"}function ef(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function dk(n){if(typeof n=="string")n=new URL(n);else if(!ef(n)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(n.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return mk(n)}function mk(n){if(n.hostname!==""){consLine truncated
`:" ")+c.indentLines(c.containerFlow(u,d.current()),l?Ky:iE))),m(),g}}function iE(n,l,a){return l===0?n:Ky(n,l,a)}function Ky(n,l,a){return(a?"":" ")+n}const lE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zy.peek=oE;function aE(){return{canContainEols:["delete"],enter:{strikethrough:uE},exit:{strikethrough:sE}}}function rE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lE}],handlers:{delete:Zy}}}function uE(n){this.enter({type:"delete",children:[]},n)}function sE(n){this.exit(n)}function Zy(n,l,a,u){const s=a.createTracker(u),c=a.enter("strikethrough");let f=s.move("~~");return f+=a.containerPhrasing(n,{...s.current(),before:f,after:"~"}),f+=s.move("~~"),c(),f}function oE(){return"~"}function cE(n){return n.length}function fE(n,l){const a=l||{},u=(a.align||[]).concat(),s=a.stringLength||cE,c=[],f=[],d=[],g=[];let m=0,x=-1;for(;++x<n.length;){const _=[],T=[];let C=-1;for(n[x].length>m&&(m=n[x].length);++C<n[x].length;){const H=hE(n[x][C]);if(a.alignDelimiters!==!1){const O=s(H);T[C]=O,(g[C]===void 0||O>g[C])&&(g[C]=O)}_.push(H)}f[x]=_,d[x]=T}let y=-1;if(typeof u=="object"&&"length"in u)for(;++y<m;)c[y]=Lg(u[y]);else{const _=Lg(u);for(;++y<m;)c[y]=_}y=-1;const b=[],S=[];for(;++y<m;){const _=c[y];let T="",C="";_===99?(T=":",C=":"):_===108?T=":":_===114&&(C=":");let H=a.alignDelimiters===!1?1:Math.max(1,g[y]-T.length-C.length);const O=T+"-".repeat(H)+C;a.alignDelimiters!==!1&&(H=T.length+H+C.length,H>g[y]&&(g[y]=H),S[y]=H),b[y]=O}f.splice(1,0,b),d.splice(1,0,S),x=-1;const k=[];for(;++x<f.length;){const _=f[x],T=d[x];y=-1;const C=[];for(;++y<m;){const H=_[y]||"";let O="",X="";if(a.alignDelimiters!==!1){const J=g[y]-(T[y]||0),R=c[y];R===114?O=" ".repeat(J):R===99?J%2?(O=" ".repeat(J/2+.5),X=" ".repeat(J/2-.5)):(O=" ".repeat(J/2),X=O):X=" ".repeat(J)}a.delimiterStart!==!1&&!y&&C.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||y)&&C.push(" "),a.alignDelimiters!==!1&&C.push(O),C.push(H),a.alignDelimiters!==!1&&C.push(X),a.padding!==!1&&C.push(" "),(a.delimiterEnd!==!1||y!==m-1)&&C.push("|")}k.push(a.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
`)}function hE(n){return n==null?"":String(n)}function Lg(n){const l=typeof n=="string"?n.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}function dE(n,l,a,u){const s=a.enter("blockquote"),c=a.createTracker(u);c.move("> "),c.shift(2);const f=a.indentLines(a.containerFlow(n,c.current()),mE);return s(),f}function mE(n,l,a){return">"+(a?"":" ")+n}function pE(n,l){return Ug(n,l.inConstruct,!0)&&!Ug(n,l.notInConstruct,!1)}function Ug(n,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let u=-1;for(;++u<l.length;)if(n.includes(l[u]))return!0;return!1}function Bg(n,l,a,u){let s=-1;for(;++s<a.unsafe.length;)if(a.unsafe[s].character===`
`&&pE(a.stack,a.unsafe[s]))return/[ \t]/.test(u.before)?"":" ";return`\\
`}function gE(n,l){const a=String(n);let u=a.indexOf(l),s=u,c=0,f=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;u!==-1;)u===s?++c>f&&(f=c):c=1,s=u+l.length,u=a.indexOf(l,s);return f}function yE(n,l){return!!(l.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function xE(n){const l=n.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function vE(n,l,a,u){const s=xE(a),c=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(yE(n,a)){const y=a.enter("codeIndented"),b=a.indentLines(c,bE);return y(),b}const d=a.createTracker(u),g=s.repeat(Math.max(gE(c,s)+1,3)),m=a.enter("codeFenced");let x=d.move(g);if(n.lang){const y=a.enter(`codeFencedLang${f}`);x+=d.move(a.safe(n.lang,{before:x,after:" ",encode:["`"],...d.current()})),y()}if(n.lang&&n.meta){const y=a.enter(`codeFencedMeta${f}`);x+=d.move(" "),x+=d.move(a.safe(n.meta,{before:x,after:`
`,encode:["`"],...d.current()})),y()}return x+=d.move(`
`),c&&(x+=d.move(c+`
`)),x+=d.move(g),m(),x}function bE(n,l,a){return(a?"":" ")+n}function Af(n){const l=n.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function SE(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let d=a.enter("label");const g=a.createTracker(u);let m=g.move("[");return m+=g.move(a.safe(a.associationId(n),{before:m,after:"]",...g.current()})),m+=g.move("]: "),d(),!n.url||/[\0- \u007F]/.test(n.url)?(d=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(n.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(d=a.enter("destinationRaw"),m+=g.move(a.safe(n.url,{before:m,after:n.title?" ":`
`,...g.current()}))),d(),n.title&&(d=a.enter(`title${c}`),m+=g.move(" "+s),m+=g.move(a.safe(n.title,{before:m,after:s,...g.current()})),m+=g.move(s),d()),f(),m}function wE(n){const l=n.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function Ja(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Uu(n,l,a){const u=Vl(n),s=Vl(l);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jy.peek=kE;function Jy(n,l,a,u){const s=wE(a),c=a.enter("emphasis"),f=a.createTracker(u),d=f.move(s);let g=f.move(a.containerPhrasing(n,{after:s,before:d,...f.current()}));const m=g.charCodeAt(0),x=Uu(u.before.charCodeAt(u.before.length-1),m,s);x.inside&&(g=Ja(m)+g.slice(1));const y=g.charCodeAt(g.length-1),b=Uu(u.after.charCodeAt(0),y,s);b.inside&&(g=g.slice(0,-1)+Ja(y));const S=f.move(s);return c(),a.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+g+S}function kE(n,l,a){return a.options.emphasis||"*"}function EE(n,l){let a=!1;return jf(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,Pc}),!!((!n.depth||n.depth<3)&&vf(n)&&(l.options.setext||a))}function CE(n,l,a,u){const s=Math.max(Math.min(6,n.depth||1),1),c=a.createTracker(u);if(EE(n,a)){const x=a.enter("headingSetext"),y=a.enter("phrasing"),b=a.containerPhrasing(n,{...c.current(),before:`
`,after:`
`});return y(),x(),b+`
`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
`))+1))}const f="#".repeat(s),d=a.enter("headingAtx"),g=a.enter("phrasing");c.move(f+" ");let m=a.containerPhrasing(n,{before:"# ",after:`
`,...c.current()});return/^[\t ]/.test(m)&&(m=Ja(m.charCodeAt(0))+m.slice(1)),m=m?f+" "+m:f,a.options.closeAtx&&(m+=" "+f),g(),d(),m}Py.peek=jE;function Py(n){return n.value||""}function jE(){return"<"}Wy.peek=TE;function Wy(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let d=a.enter("label");const g=a.createTracker(u);let m=g.move("![");return m+=g.move(a.safe(n.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),d(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(d=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(n.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(d=a.enter("destinationRaw"),m+=g.move(a.safe(n.url,{before:m,after:n.title?" ":")",...g.current()}))),d(),n.title&&(d=a.enter(`title${c}`),m+=g.move(" "+s),m+=g.move(a.safe(n.title,{before:m,after:s,...g.current()})),m+=g.move(s),d()),m+=g.move(")"),f(),m}function TE(){return"!"}$y.peek=AE;function $y(n,l,a,u){const s=n.referenceType,c=a.enter("imageReference");let f=a.enter("label");const d=a.createTracker(u);let g=d.move("![");const m=a.safe(n.alt,{before:g,after:"]",...d.current()});g+=d.move(m+"]["),f();const x=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(n),{before:g,after:"]",...d.current()});return f(),a.stack=x,c(),s==="full"||!m||m!==y?g+=d.move(y+"]"):s==="shortcut"?g=g.slice(0,-1):g+=d.move("]"),g}function AE(){return"!"}ex.peek=_E;function ex(n,l,a){let u=n.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++c<a.unsafe.length;){const f=a.unsafe[c],d=a.compilePattern(f);let g;if(f.atBreak)for(;g=d.exec(u);){let m=g.index;u.charCodeAt(m)===10&&u.charCodeAt(m-1)===13&&m--,u=u.slice(0,m)+" "+u.slice(g.index+1)}}return s+u+s}function _E(){return"`"}function tx(n,l){const a=vf(n);return!!(!l.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(a===n.url||"mailto:"+a===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}nx.peek=ME;function nx(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);let d,g;if(tx(n,a)){const x=a.stack;a.stack=[],d=a.enter("autolink");let y=f.move("<");return y+=f.move(a.containerPhrasing(n,{before:y,after:">",...f.current()})),y+=f.move(">"),d(),a.stack=x,y}d=a.enter("link"),g=a.enter("label");let m=f.move("[");return m+=f.move(a.containerPhrasing(n,{before:m,after:"](",...f.current()})),m+=f.move("]("),g(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(g=a.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(a.safe(n.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(g=a.enter("destinationRaw"),m+=f.move(a.safe(n.url,{before:m,after:n.title?" ":")",...f.current()}))),g(),n.title&&(g=a.enter(`title${c}`),m+=f.move(" "+s),m+=f.move(a.safe(n.title,{before:m,after:s,...f.current()})),m+=f.move(s),g()),m+=f.move(")"),d(),m}function ME(n,l,a){return tx(n,a)?"<":"["}ix.peek=NE;function ix(n,l,a,u){const s=n.referenceType,c=a.enter("linkReference");let f=a.enter("label");const d=a.createTracker(u);let g=d.move("[");const m=a.containerPhrasing(n,{before:g,after:"]",...d.current()});g+=d.move(m+"]["),f();const x=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(n),{before:g,after:"]",...d.current()});return f(),a.stack=x,c(),s==="full"||!m||m!==y?g+=d.move(y+"]"):s==="shortcut"?g=g.slice(0,-1):g+=d.move("]"),g}function NE(){return"["}function _f(n){const l=n.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function OE(n){const l=_f(n),a=n.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function zE(n){const l=n.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function lx(n){const l=n.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function DE(n,l,a,u){const s=a.enter("list"),c=a.bulletCurrent;let f=n.ordered?zE(a):_f(a);const d=n.ordered?f==="."?")":".":OE(a);let g=l&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const x=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),lx(a)===f&&x){let y=-1;for(;++y<n.chilLine truncated
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:f,tableCell:g,tableRow:d}};function f(S,k,_,T){return m(x(S,_,T),S.align)}function d(S,k,_,T){const C=y(S,_,T),H=m([C]);return H.slice(0,H.indexOf(`
`))}function g(S,k,_,T){const C=_.enter("tableCell"),H=_.enter("phrasing"),O=_.containerPhrasing(S,{...T,before:c,after:c});return H(),C(),O}function m(S,k){return fE(S,{align:k,alignDelimiters:u,padding:a,stringLength:s})}function x(S,k,_){const T=S.children;let C=-1;const H=[],O=k.enter("table");for(;++C<T.length;)H[C]=y(T[C],k,_);return O(),H}function y(S,k,_){const T=S.children;let C=-1;const H=[],O=k.enter("tableRow");for(;++C<T.length;)H[C]=g(T[C],S,k,_);return O(),H}function b(S,k,_){let T=rx.inlineCode(S,k,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function WE(){return{exit:{taskListCheckValueChecked:qg,taskListCheckValueUnchecked:qg,paragraph:eC}}}function $E(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tC}}}function qg(n){const l=this.stack[this.stack.length-2];l.type,l.checked=n.type==="taskListCheckValueChecked"}function eC(n){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const u=a.children[0];if(u&&u.type==="text"){const s=l.children;let c=-1,f;for(;++c<s.length;){const d=s[c];if(d.type==="paragraph"){f=d;break}}f===a&&(u.value=u.value.slice(1),u.value.length===0?a.children.shift():a.position&&u.position&&typeof u.position.start.offset=="number"&&(u.position.start.column++,u.position.start.offset++,a.position.start=Object.assign({},u.position.start)))}}this.exit(n)}function tC(n,l,a,u){const s=n.children[0],c=typeof n.checked=="boolean"&&s&&s.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",d=a.createTracker(u);c&&d.move(f);let g=rx.listItem(n,l,a,{...u,...d.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(x){return x+f}}function nC(){return[Dk(),tE(),aE(),YE(),WE()]}function iC(n){return{extensions:[Rk(),nE(n),rE(),PE(n),$E()]}}const lC={tokenize:cC,partial:!0},ux={tokenize:fC,partial:!0},sx={tokenize:hC,partial:!0},ox={tokenize:dC,partial:!0},aC={tokenize:mC,partial:!0},cx={name:"wwwAutolink",tokenize:sC,previous:hx},fx={name:"protocolAutolink",tokenize:oC,previous:dx},Yn={name:"emailAutolink",tokenize:uC,previous:mx},kn={};function rC(){return{text:kn}}let qi=48;for(;qi<123;)kn[qi]=Yn,qi++,qi===58?qi=65:qi===91&&(qi=97);kn[43]=Yn;kn[45]=Yn;kn[46]=Yn;kn[95]=Yn;kn[72]=[Yn,fx];kn[104]=[Yn,fx];kn[87]=[Yn,cx];kn[119]=[Yn,cx];function uC(n,l,a){const u=this;let s,c;return f;function f(y){return!tf(y)||!mx.call(u,u.previous)||Mf(u.events)?a(y):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),d(y))}function d(y){return tf(y)?(n.consume(y),d):y===64?(n.consume(y),g):a(y)}function g(y){return y===46?n.check(aC,x,m)(y):y===45||y===95||xt(y)?(c=!0,n.consume(y),g):x(y)}function m(y){return n.consume(y),s=!0,g}function x(y){return c&&s&&jt(u.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),l(y)):a(y)}}function sC(n,l,a){const u=this;return s;function s(f){return f!==87&&f!==119||!hx.call(u,u.previous)||Mf(u.events)?a(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(lC,n.attempt(ux,n.attempt(sx,c),a),a)(f))}function c(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),l(f)}}function oC(n,l,a){const u=this;let s="",c=!1;return f;function f(y){return(y===72||y===104)&&dx.call(u,u.previous)&&!Mf(u.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),s+=String.fromCodePoint(y),n.consume(y),d):a(y)}function d(y){if(jt(y)&&s.length<5)return s+=String.fromCodePoint(y),n.consume(y),d;if(y===58){const b=s.toLowerCase();if(b==="http"||b==="https")return n.consume(y),g}return a(y)}function g(y){return y===47?(n.consume(y),c?m:(c=!0,g)):a(y)}function m(y){return y===null||Du(y)||Xe(y)||Xi(y)||qu(y)?a(y):n.attempt(ux,n.attempt(sx,x),a)(y)}function x(y){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),l(y)}}function cC(n,l,a){let u=0;return s;function s(f){return(f===87||f===119)&&u<3?(u++,n.consume(f),s):f===46&&u===3?(n.consume(f),c):a(f)}function c(f){return f===null?a(f):l(f)}}function fC(n,l,a){let u,s,c;return f;function f(m){return m===46||m===95?n.check(ox,g,d)(m):m===null||Xe(m)||Xi(m)||m!==45&&qu(m)?g(m):(c=!0,n.consume(m),f)}function d(m){return m===95?u=!0:(s=u,u=void 0),n.consume(m),f}function g(m){return s||u||!c?a(m):l(m)}}function hC(n,l){let a=0,u=0;return s;function s(f){return f===40?(a++,n.consume(f),s):f===41&&u<a?c(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(ox,l,c)(f):f===null||Xe(f)||Xi(f)?l(f):(n.consume(f),s)}function c(f){return f===41&&u++,n.consume(f),s}}function dC(n,l,a){return u;function u(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(n.consume(d),u):d===38?(n.consume(d),c):d===93?(n.consume(d),s):d===60||d===null||Xe(d)||Xi(d)?l(d):a(d)}function s(d){return d===null||d===40||d===91||Xe(d)||Xi(d)?l(d):u(d)}function c(d){return jt(d)?f(d):a(d)}function f(d){re Line truncated
`)?p.jsx("code",{className:l,...a,children:n}):p.jsxs("div",{className:"relative group/code",children:[s&&p.jsx("div",{className:"absolute top-0 left-0 px-3 py-1.5 text-[13px] text-white/15 font-mono uppercase tracking-wider select-none",children:s}),p.jsx("button",{onClick:()=>{navigator.clipboard.writeText(c),d(!0),setTimeout(()=>d(!1),1500)},className:"absolute top-1.5 right-1.5 px-2 py-1 text-[13px] font-medium text-white/15 hover:text-white/40 bg-white/[0.03] hover:bg-white/[0.06] rounded-md transition-all opacity-0 group-hover/code:opacity-100",children:f?"Copied":"Copy"}),p.jsx("code",{className:l,...a,children:n})]})}function QC(n){if(typeof n=="string")return{text:n,images:[]};let l="";const a=[];for(const u of n)u.type==="text"&&u.text&&(l+=u.text),u.type==="image_url"&&u.image_url?.url&&a.push(u.image_url.url);return{text:l,images:a}}function VC({message:n,onCopy:l,onDelete:a,onRegenerate:u}){const[s,c]=Q.useState(!1),[f,d]=Q.useState(!1),[g,m]=Q.useState(!1),x=n.role==="user",{text:y,images:b}=QC(n.content),S=()=>{navigator.clipboard.writeText(y),d(!0),l(),setTimeout(()=>d(!1),1500)},k=p.jsxs("div",{className:`flex items-center gap-0.5 h-6 transition-opacity duration-150 ${s?"opacity-100":"opacity-0"}`,children:[p.jsx(Oc,{label:f?"Copied":"Copy",onClick:S,children:f?p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M20 6L9 17l-5-5"})}):p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),p.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})}),!x&&u&&p.jsx(Oc,{label:"Regenerate",onClick:u,children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M1 4v6h6"}),p.jsx("path",{d:"M3.51 15a9 9 0 102.13-9.36L1 10"})]})}),p.jsx(Oc,{label:"Delete",onClick:a,children:p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})})})]});return x?p.jsx("div",{className:"flex justify-end",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:p.jsxs("div",{className:"flex items-end gap-1.5 max-w-[78%]",children:[k,p.jsxs("div",{className:"bg-white/[0.07] border border-white/[0.05] rounded-2xl rounded-br-md px-4 py-2.5 shadow-sm",children:[b.length>0&&p.jsx("div",{className:"flex gap-1.5 mb-2",children:b.map((_,T)=>p.jsx("img",{src:_,alt:`Attachment ${T+1}`,className:"h-24 rounded-lg border border-white/[0.06]"},T))}),p.jsx("div",{className:"text-white/95 text-[15.5px] leading-relaxed whitespace-pre-wrap break-words",children:y})]})]})}):p.jsxs("div",{className:"flex gap-3",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-white/95 to-white/75 flex items-center justify-center shrink-0 mt-0.5 shadow-sm",children:p.jsx("svg",{viewBox:"0 0 32 32",width:"14",height:"14",fill:"none",children:p.jsxs("g",{fill:"#0a0a0c",children:[p.jsx("rect",{x:"6.2",y:"7.5",width:"1.6",height:"18",rx:"0.8",transform:"rotate(-42 6.2 7.5)"}),p.jsx("rect",{x:"24.2",y:"6.3",width:"1.6",height:"18",rx:"0.8",transform:"rotate(42 24.2 6.3)"}),p.jsx("polygon",{points:"7.2,8.8 3.8,7.2 4.5,5.5 8.5,7.2"}),p.jsx("polygon",{points:"24.8,8.8 28.2,7.2 27.5,5.5 23.5,7.2"}),p.jsx("rect",{x:"14.3",y:"14.3",width:"3.4",height:"3.4",rx:"0.4",transform:"rotate(45 16 16)"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"1.7",fill:"#fff"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"1.7",fill:"#fff"}),p.jsx("path",{d:"M16 5.5L12.5 8.5V12.5L16 10.5L19.5 12.5V8.5Z"})]})})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[n.reasoning_content&&p.jsxs("div",{className:"mb-2",children:[p.jsxs("button",{onClick:()=>m(!g),className:"flex items-center gap-1.5 text-[14px] text-white/20 hover:text-white/35 transition-colors mb-1",children:[p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:Ee("transition-transform duration-150",g&&"rotate-90"),children:p.jsx("path",{d:"M3.5 2L6.5 5L3.5 8"})}),"Thinking"]}),g&&p.jsx("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded-lg px-3 py-2 text-[15px] text-white/30 leading-relaxed whitespace-pre-wrap animate-fade-in max-h-60 overflow-y-auto",children:n.reasoning_content})]}),y?p.jsx("div",{className:"prose-venice text-[15.5px] leading-relaxed text-white/85",children:p.jsx(Ck,{remarkPlugins:[UC],urlTransform:HC,components:{code:qC,a:({href:_,childre Line truncated
${n.stack}`:""]})]}),p.jsxs("div",{className:"flex gap-2 justify-center",children:[p.jsx("button",{onClick:l,className:"px-4 py-2 text-[14px] font-medium bg-white text-black rounded-md hover:bg-white/90 transition-colors",children:"Try again"}),p.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-[14px] font-medium border border-white/[0.1] text-white/60 hover:text-white/80 hover:border-white/[0.2] rounded-md transition-colors",children:"Reload page"})]})]})})}const C5={info:"border-white/[0.08] bg-[#111]",success:"border-green-500/30 bg-green-500/[0.06]",error:"border-red-500/30 bg-red-500/[0.06]"},j5={info:"text-white/75",success:"text-green-200/85",error:"text-red-200/85"};function T5(){const n=ql(a=>a.toasts),l=ql(a=>a.dismiss);return n.length===0?null:p.jsx("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm pointer-events-none",role:"region","aria-live":"polite","aria-label":"Notifications",children:n.map(a=>p.jsx("div",{role:a.variant==="error"?"alert":"status",className:Ee("pointer-events-auto rounded-lg border px-3.5 py-2.5 shadow-xl shadow-black/60 backdrop-blur-md animate-scale-in",C5[a.variant]),children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:Ee("text-[13.5px] font-medium",j5[a.variant]),children:a.title}),a.description&&p.jsx("div",{className:"text-[12.5px] text-white/45 mt-0.5 leading-relaxed break-words",children:a.description}),a.action&&p.jsx("button",{onClick:()=>{a.action?.onClick(),l(a.id)},className:"mt-1.5 text-[12.5px] font-medium text-white/70 hover:text-white underline underline-offset-2",children:a.action.label})]}),p.jsx("button",{onClick:()=>l(a.id),"aria-label":"Dismiss notification",className:"text-white/25 hover:text-white/60 transition-colors p-0.5 -m-0.5 shrink-0 rounded focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/30",children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})},a.id))})}const A5=Q.lazy(()=>ry(()=>import("./workflows-view-xQJlxU4f.js"),__vite__mapDeps([0,1,2])).then(n=>({default:n.WorkflowsView})));function _5(){return p.jsx(Q.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-[12px] text-white/30",children:"Loading workflows…"}),children:p.jsx(A5,{})})}const M5=Q.lazy(()=>ry(()=>import("./playground-view-COPXwfh8.js"),__vite__mapDeps([3,1,2])).then(n=>({default:n.PlaygroundView})));function N5(){return p.jsx(Q.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-[12px] text-white/30",children:"Loading playground…"}),children:p.jsx(M5,{})})}const O5={chat:IC,image:l5,audio:c5,music:m5,video:v5,embeddings:k5,workflows:_5,playground:N5},Xg=["chat","image","audio","music","video","embeddings","workflows","playground"];function z5(){const n=pn(g=>g.hasEncrypted&&!g.apiKey),[l,a]=Q.useState(n),[u,s]=Q.useState(!1),c=un(g=>g.activeTab),f=un(g=>g.setActiveTab),d=O5[c];return Q.useEffect(()=>{const g=m=>{if(!(m.metaKey||m.ctrlKey))return;if(m.key==="n"){m.preventDefault(),f("chat"),s(!1),Ct.getState().setActiveConversation(null);return}const y=parseInt(m.key,10);if(y>=1&&y<=Xg.length){m.preventDefault(),f(Xg[y-1]),s(!1);return}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[f]),p.jsxs("div",{className:"flex h-[100dvh] w-screen overflow-hidden",children:[u&&p.jsx("button",{"aria-label":"Close menu",className:"md:hidden fixed inset-0 z-30 bg-black/60 backdrop-blur-sm animate-fade-in",onClick:()=>s(!1)}),p.jsx(Kv,{mobileOpen:u,onMobileClose:()=>s(!1)}),p.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p.jsx(fb,{onOpenApiKey:()=>a(!0),onOpenMobileSidebar:()=>s(!0)}),p.jsx("main",{className:"flex-1 min-h-0 overflow-hidden",children:p.jsx(gx,{children:p.jsx(d,{})},c)})]}),p.jsx(hb,{open:l,onClose:()=>a(!1)}),p.jsx(T5,{})]})}const D5=new cv({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});window.addEventListener("unhandledrejection",n=>{console.error("[unhandledrejection]",n.reason)});q1.createRoot(document.getElementById("root")).render(p.jsx(Q.StrictMode,{children:p.jsx(gx,{children:p.jsx(fv,{client:D5,children:p.jsx(z5,{})})})}));export{un as A,lf as B,nf as C,U1 as D,Hu as E,nv as Q,vu as R,bi as S,Gl as a,Zg as b,Ee as c,iy as d,hv as e,pv as f,Nv as g,vv as h,gv as i,p as j,yv as k,Et as l,Sv as m,ot as n,Xp as o,xv as p,Bu as q,Q as r,Mu as s,Vi as t,Ki as u,uy as v,cf as w,sy as x,Gn as y,pn as z};
@@ -0,0 +1,84 @@
import{a as ne,n as V,s as re,b as oe,Q as Z,d as ie,e as ae,f as le,r as b,h as ce,i as de,k as ue,l as pe,m as B,o as he,p as me,q as fe,v as ge,w as xe,x as we,y as F,u as be,g as U,z as ye,A as D,j as r,c as R,t as Q}from"./index-CfrUZ43_.js";import{g as ve,N as C,h as ke,H as J,P as z,R as je,b as Ne,c as Se,a as _e,i as Re,B as $e,e as Oe,C as Te,u as L,v as Ce,f as Ee}from"./workflow-engine-ClbuiuAZ.js";function H(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function Pe(e,t,n){const s=e.slice(0);return s[t]=n,s}var Me=class extends ne{#n;#e;#r;#o;#t;#s;#i;#a;#l;#c=[];constructor(e,t,n){super(),this.#n=e,this.#o=n,this.#r=[],this.#t=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(e=>{e.subscribe(t=>{this.#h(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#o=t,V.batch(()=>{const n=this.#t,s=this.#p(this.#r);s.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const o=s.map(p=>p.observer),i=o.map(p=>p.getCurrentResult()),a=n.length!==o.length,l=o.some((p,h)=>p!==n[h]),d=a||l,x=d?!0:i.some((p,h)=>{const w=this.#e[h];return!w||!re(p,w)});!d&&!x||(d&&(this.#c=s,this.#t=o),this.#e=i,this.hasListeners()&&(d&&(H(n,o).forEach(p=>{p.destroy()}),H(o,n).forEach(p=>{p.subscribe(h=>{this.#h(p,h)})})),this.#m()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(e=>e.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(e,t){const n=this.#p(e),s=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=n.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>this.#u(i??s,t,o),()=>this.#d(s,n)]}#d(e,t){return t.map((n,s)=>{const o=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,i=>{t.forEach(a=>{a.observer.trackProp(i)})})})}#u(e,t,n){if(t){const s=this.#l,o=n!==void 0&&s!==void 0&&(s.length!==n.length||n.some((i,a)=>i!==s[a]));return(!this.#s||this.#e!==this.#a||o||t!==this.#i)&&(this.#i=t,this.#a=this.#e,n!==void 0&&(this.#l=n),this.#s=oe(this.#s,t(e))),this.#s}return e}#p(e){const t=new Map;this.#t.forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=t.get(o);i?i.push(s):t.set(o,[s])});const n=[];return e.forEach(s=>{const o=this.#n.defaultQueryOptions(s),a=t.get(o.queryHash)?.shift()??new Z(this.#n,o);n.push({defaultedQueryOptions:o,observer:a})}),n}#h(e,t){const n=this.#t.indexOf(e);n!==-1&&(this.#e=Pe(this.#e,n,t),this.#m())}#m(){if(this.hasListeners()){const e=this.#s,t=this.#d(this.#e,this.#c),n=this.#u(t,this.#o?.combine);e!==n&&V.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}};function Ae({queries:e,...t},n){const s=ie(),o=ae(),i=le(),a=b.useMemo(()=>e.map(m=>{const u=s.defaultQueryOptions(m);return u._optimisticResults=o?"isRestoring":"optimistic",u}),[e,s,o]);a.forEach(m=>{ce(m);const u=s.getQueryCache().get(m.queryHash);de(m,i,u)}),ue(i);const[l]=b.useState(()=>new Me(s,a,t)),[d,x,p]=l.getOptimisticResult(a,t.combine),h=!o&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(m=>h?l.subscribe(V.batchCalls(m)):pe,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(a,t)},[a,t,l]);const y=d.some((m,u)=>B(a[u],m))?d.flatMap((m,u)=>{const g=a[u];if(g&&B(g,m)){const N=new Z(s,g);return he(g,N,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const $=d.find((m,u)=>{const g=a[u];return g&&me({result:m,errorResetBoundary:i,throwOnError:g.throwOnError,query:s.getQueryCache().get(g.queryHash),suspense:g.suspense})});if($?.error)throw $.error;return x(p())}const S=fe()(ge((e,t)=>({messages:[],draft:{nodes:[],edges:[]},linkedWorkflowId:null,isThinking:!1,runResults:{},isRunning:!1,addMessage:n=>e(s=>({messages:[...s.messages,n]})),updateMessage:(n,s)=>e(o=>({messages:o.messages.map(i=>i.id===n?{...i,...s}:i)})),setThinking:n=>e({isThinking:n}),applyAgentPatches:n=>{const{nodes:s,edges:o}=t().draft,i=ve({nodes:s,edges:o},n);return e({draft:{nodes:i.nodes,edges:i.edges},runResults:{}}),i},resetDraft:()=>e({draft:{nodes:[],edges:[]},runResults:{},linkedWorkflowId:null}),clearConversation:()=>e({messages:[],draft:{nodes:[],edges:[]},runResults:{},linkedWorkflowId:null}),setRunResults:n=>e({runResults:n}),updateRunNode:(n,s)=>e(o=>({runResults:{...o.runResults,[n]:{...o.runResults[n],...s}}})),setIsRunning:n=>e({isRunning:n}),clearResults:()=>e({runResults:{}}),loadWorkflow:(n,s,o)=>e({draft:{nodes:s,edges:o},linkedWorkflowId:n,runResults:{},messages:[]}),unlinkWorkflow:()=>e({linkedWorkflowId:null})}),{name:"venice-playground",version:1,storage:xe(()=>we()),partialize:e=>({messages:e.messages.slice(-40),draft:e.draft,linkedWorkflowId:e.linkedWorkflowId})})),We=["text","image","tts","music","video"];function q(e){return e?e.data.filter(t=>!t.model_spec?.offline).map(t=>t.id).sort():[]}function qe(){const e=Ae({queries:We.map(s=>({queryKey:["models",s],queryFn:()=>F(`/models?type=${s}`,{noAuth:!0}),staleTime:3e5}))}),t={text:qLine truncated
`);return`- ${e.type} (${e.label}) | input=${e.input} output=${e.output}
${e.description}${t?`
params:
${t}`:""}`}).join(`
`)}function Fe(e){if(!e)return"";const t=[];return e.text.length&&t.push(`chat: ${e.text.join(", ")}`),e.image.length&&t.push(`imageGen: ${e.image.join(", ")}`),e.tts.length&&t.push(`tts: ${e.tts.join(", ")}`),e.music.length&&t.push(`music: ${e.music.join(", ")}`),e.video.length&&t.push(`video: ${e.video.join(", ")}`),t.length===0?"":`
Available models per node type (use ONLY these ids; pick the one that best matches the user's intent or use the default if no preference):
${t.map(n=>`- ${n}`).join(`
`)}`}const Be=`You are a workflow designer for OpenVenice. You help the user author visual workflows that chain Venice AI models.
You have these node types available:
${Ue()}
You respond by emitting patches to mutate the current draft workflow. Each patch is one of:
- {"op":"add_node","nodeType":"<type>","id":"optional_id","params":{...}} — add a new node
- {"op":"set_params","id":"<node_id>","params":{...}} — update a node's params
- {"op":"connect","source":"<node_id>","target":"<node_id>"} — connect two nodes
- {"op":"disconnect","id":"<edge_id>"} — remove an edge
- {"op":"remove_node","id":"<node_id>"} — remove a node
- {"op":"clear"} — remove all nodes and edges
RULES:
1. Every response MUST be a single valid JSON object, nothing before or after. Do not wrap in markdown fences.
2. Schema: {"say": string, "patches": Array<Patch>}.
3. "say" is a short (1–3 sentences) narration of what you just did or a question to the user.
4. When building a new workflow from scratch, start with {"op":"clear"} then add nodes top-to-bottom and connect them.
5. Always assign explicit ids when adding multiple nodes in one turn so you can reference them in connect patches.
6. Workflows need at least one textInput (or a generation node with a self-contained prompt) and an output node at the end.
7. Use {{input}} inside a node's prompt to place upstream text precisely, or leave prompt empty to append input after.
8. Keep to the param names and enum values listed above. Omit params to accept defaults.
9. If the user just asks a question, respond with a "say" and an empty "patches" array.
10. Do not narrate patches you aren't emitting. Do not produce commentary outside the JSON.
Example response:
{"say":"I built a pipeline that researches a topic, summarizes it, and narrates the summary.","patches":[{"op":"clear"},{"op":"add_node","nodeType":"textInput","id":"in","params":{"inputText":"Quantum computing progress in 2025"}},{"op":"add_node","nodeType":"chat","id":"research","params":{"prompt":"Research this topic thoroughly.","webSearch":"on"}},{"op":"add_node","nodeType":"chat","id":"summary","params":{"prompt":"Summarize into 5 bullet points.","temperature":0.3}},{"op":"add_node","nodeType":"tts","id":"narrate","params":{"voice":"af_sky"}},{"op":"add_node","nodeType":"output","id":"out"},{"op":"connect","source":"in","target":"research"},{"op":"connect","source":"research","target":"summary"},{"op":"connect","source":"summary","target":"narrate"},{"op":"connect","source":"narrate","target":"out"}]}`;function Qe(e){return Be+Fe(e)}function Je(e){if(e.nodes.length===0)return"Current draft is empty.";const t=e.nodes.map(s=>{const o=[],i=s.data;for(const a of C[s.data.nodeType]?.params??[]){const l=i[a.name];if(l!==void 0&&l!==""&&l!==null){const d=typeof l=="string"?l.length>60?l.slice(0,60)+"…":l:JSON.stringify(l);o.push(`${a.name}=${d}`)}}return` - ${s.id} [${s.data.nodeType}] ${o.join(" ")}`}),n=e.edges.map(s=>` - ${s.id}: ${s.source} → ${s.target}`);return`Current draft:
Nodes:
${t.join(`
`)}
Edges:
${n.join(`
`)||" (none)"}`}function ze(e){const t=e.trim(),n=t.match(/```(?:json)?\s*([\s\S]*?)```/);if(n)return n[1].trim();const s=t.indexOf("{"),o=t.lastIndexOf("}");return s!==-1&&o!==-1&&o>s?t.slice(s,o+1):t}function He(e){if(!e||typeof e!="object")return!1;const t=e;if(typeof t.op!="string"||!Ve.has(t.op))return!1;switch(t.op){case"clear":return!0;case"add_node":return typeof t.nodeType=="string"&&t.nodeType in C;case"remove_node":case"disconnect":return typeof t.id=="string"&&t.id.length>0;case"set_params":return typeof t.id=="string"&&t.id.length>0&&typeof t.params=="object"&&t.params!==null;case"move_node":return typeof t.id=="string"&&typeof t.position=="object"&&t.position!==null;case"connect":return typeof t.source=="string"&&typeof t.target=="string"&&t.source!==t.target}return!1}function Ye(e,t){const n=C[e];if(!n)return{};const s=new Set(["model","prompt",...n.params.map(i=>i.name)]),o={};for(const[i,a]of Object.entries(t))s.has(i)&&(o[i]=a);return o}function Y(e){const t=ze(e);let n;try{n=JSON.parse(t)}catch{return{say:"",patches:[],invalidPatches:0}}const s=typeof n.say=="string"?n.say:"",o=Array.isArray(n.patches)?n.patches:[],i=[];let a=0;for(const l of o){if(!He(l)){a++;continue}l.op==="add_node"&&l.params?i.push({...l,params:Ye(l.nodeType,l.params)}):(l.op,i.push(l))}return{say:s,patches:i,invalidPatches:a}}async function K(e){const t={model:e.model,messages:e.messages,temperature:e.temperature,max_tokens:4096};return e.useResponseFormat&&(t.response_format={type:"json_object"}),(await F("/chat/completions",{method:"POST",body:JSON.stringify(t),signal:e.signal})).choices[0]?.message?.content??""}async function Ke({userMessage:e,draft:t,history:n,catalog:s,model:o,capabilities:i,signal:a}){const l=o,d=i?.supportsResponseSchema===!0,x=[{role:"system",content:Qe(s)},...n.map(w=>({role:w.role,content:w.content})),{role:"user",content:`${Je(t)}
User: ${e}
Reply with a single JSON object: {"say": "...", "patches": [...]}. No prose, no markdown fences.`}],p=await K({model:l,messages:x,temperature:.3,useResponseFormat:d,signal:a}),h=Y(p);if(h.patches.length===0&&!h.say&&p.length>0){const w=[...x,{role:"assistant",content:p},{role:"user",content:'That was not valid JSON. Reply again with ONLY a single JSON object matching {"say": string, "patches": Patch[]}. No commentary, no fences.'}];try{const y=await K({model:l,messages:w,temperature:0,useResponseFormat:d,signal:a});return Y(y)}catch{}}return h}const Ge=Object.keys(C),Xe=[{type:"function",function:{name:"clear",description:"Remove all nodes and edges. Use when starting a fresh workflow.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"add_node",description:'Add a node to the canvas. Returns the assigned id (use it for connect calls). For "params": include only the fields you want to set; defaults apply otherwise. Use {{input}} inside any prompt field to inject upstream text.',parameters:{type:"object",properties:{node_type:{type:"string",enum:Ge,description:"The kind of node to add."},id:{type:"string",description:"Optional explicit id. If omitted, a uuid is generated. Use this id in subsequent connect/set_params calls."},params:{type:"object",description:"Node-specific params (model, prompt, temperature, etc). See system prompt for the full schema per node type.",additionalProperties:!0}},required:["node_type"],additionalProperties:!1}}},{type:"function",function:{name:"connect",description:"Connect two nodes (data flows from source to target).",parameters:{type:"object",properties:{source:{type:"string",description:"Source node id."},target:{type:"string",description:"Target node id."}},required:["source","target"],additionalProperties:!1}}},{type:"function",function:{name:"set_params",description:"Update params on an existing node. Merged with current params.",parameters:{type:"object",properties:{id:{type:"string"},params:{type:"object",additionalProperties:!0}},required:["id","params"],additionalProperties:!1}}},{type:"function",function:{name:"remove_node",description:"Remove a node and all its connected edges.",parameters:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1}}},{type:"function",function:{name:"pick_model",description:"Get a recommended model id for a node type, optionally biased by preference. Use this BEFORE add_node if unsure which id to use — you will get back an id you can pass directly.",parameters:{type:"object",properties:{node_type:{type:"string",enum:["chat","imageGen","tts","music","video"]},prefer:{type:"string",enum:["fast","best","web","reasoning","uncensored"],description:"'fast' = cheap & quick (default), 'best' = highest quality, 'web' = native web search, 'reasoning' = chain-of-thought, 'uncensored' = no refusals."}},required:["node_type"],additionalProperties:!1}}},{type:"function",function:{name:"ask_user",description:'Pause the build to ask the user a clarifying question (e.g., "Vertical (9:16) or square (1:1)?"). The build will resume on their reply.',parameters:{type:"object",properties:{question:{type:"string"}},required:["question"],additionalProperties:!1}}},{type:"function",function:{name:"done",description:"Signal the workflow is complete. Provide a one-sentence summary of what you built for the user.",parameters:{type:"object",properties:{summary:{type:"string"}},required:["summary"],additionalProperties:!1}}}];function Ze(){return Object.values(C).map(e=>{const t=e.params.map(n=>{const s=[`${n.name}: ${n.type}${n.required?" (required)":""}`];return n.default!==void 0&&n.default!==""&&s.push(`default=${JSON.stringify(n.default)}`),n.enumValues&&s.push(`one of [${n.enumValues.filter(Boolean).join(", ")}]`),(n.min!==void 0||n.max!==void 0)&&s.push(`range ${n.min??"-"}..${n.max??"-"}`),` - ${s.join(" — ")}`}).join(`
`);return`- ${e.type} (${e.label}) | input=${e.input} output=${e.output}
${e.description}${t?`
params:
${t}`:""}`}).join(`
`)}const et=`You are a workflow designer for OpenVenice. You build visual workflows that chain Venice AI models by calling tools.
Available node types:
${Ze()}
How you work:
1. Use the provided tools — never reply with prose-only when actions are needed.
2. For a fresh build, call clear() first, then add_node(...) for each step, then connect(source, target) edges, then done(summary).
3. Always assign explicit ids when adding nodes (e.g., id="research", "script", "video"), so you can reference them in connect/set_params calls.
4. **Templates**: Inside any prompt/inputText field, use {{input}} to inject the concatenated text from upstream parents. There is no {{node_id}} syntax — referencing other nodes by name does NOT work. Each node only sees {{input}} = its parents' outputs joined.
5. **No placeholder content**: write inputText fields with realistic example content the user will likely keep, not "Enter the topic here".
6. **Model ids must come from the live Venice catalog** — DO NOT guess names like "suno-v3" or "runway-gen-2". When in doubt, call pick_model({node_type, prefer}) FIRST and use its returned id. add_node will reject unknown model ids and tell you to call pick_model.
7. **Cost & speed**: prefer fast cheap chat models (qwen3-next-80b, mistral-small-3-2-24b-instruct, zai-org-glm-4.7). Only escalate to claude-opus or qwen-thinking when the task explicitly demands top reasoning. Use pick_model with prefer="fast" by default, "best" for premium quality, "web" for native search, "reasoning" for analysis-heavy tasks.
8. **Web search**: only useful on chat nodes whose model has supportsWebSearch. pick_model({node_type:"chat", prefer:"web"}) returns a good one.
9. **For social-video / reel requests**: canonical shape is textInput → chat(research, web) → chat(script) → video (9:16, 1080p, 5-10s) → output. For music: add a SEPARATE branch (textInput → music → output) — DO NOT connect music nodes to video nodes; they can't compose into a single AV file from this engine. Each modality gets its own output.
10. If the request is ambiguous (which platform? which style?), call ask_user with one specific question.
11. End every successful build with done(summary).
Workflows must terminate at an output node (or the user won't see results). Multiple branches with their own outputs are fine and encouraged for multi-modal results.`,G=16;function tt(e){if(e.nodes.length===0)return"Current draft is empty.";const t=e.nodes.map(s=>` - ${s.id} [${s.data.nodeType}]`).join(`
`),n=e.edges.map(s=>` - ${s.source} → ${s.target}`).join(`
`)||" (none)";return`Current draft:
Nodes:
${t}
Edges:
${n}`}function st(e,t,n){const s=n.catalog;return s?e==="chat"?s.text.includes(t):e==="imageGen"?s.image.includes(t):e==="tts"?s.tts.includes(t):e==="music"?s.music.includes(t):e==="video"?s.video.includes(t):!0:!0}function nt(e,t,n){const s=n.catalog;if(!s)return;if(e==="chat"){const i=n.agentModels??[];if(i.length===0)return s.text[0];const a=i.map(l=>{let d=0;const x=l.capabilities;return t==="web"&&(d+=x.supportsWebSearch?100:0),t==="reasoning"&&(d+=x.supportsReasoning?100:0),t==="uncensored"&&(d+=l.uncensored?100:0),t==="best"&&(l.traits.includes("most_intelligent")&&(d+=80),l.contextTokens&&l.contextTokens>=2e5&&(d+=20)),(t==="fast"||!t)&&(x.supportsReasoning&&(d-=30),l.traits.includes("function_calling_default")&&(d+=50),l.recommended&&(d+=30)),x.supportsResponseSchema&&(d+=10),d-=l.tier*5,{id:l.id,score:d}});return a.sort((l,d)=>d.score-l.score),a[0]?.id}return(e==="imageGen"?s.image:e==="tts"?s.tts:e==="music"?s.music:e==="video"?s.video:[])[0]}function rt(e){if(!e)return{};try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}function ot(e,t,n){try{switch(e){case"clear":return n.applyPatch({op:"clear"}),{ok:!0};case"add_node":{const s=t.node_type;if(!s||!(s in C))return{error:`Unknown node_type: ${String(s)}`};const o=typeof t.id=="string"&&t.id||U(),i=typeof t.params=="object"&&t.params!==null?t.params:{},a=i.model;if(typeof a=="string"&&a.length>0&&!st(s,a,n))return{error:`Unknown model '${a}' for ${s}. Call pick_model({node_type:'${s==="chat"?"chat":s}'}) to get a valid id, then retry add_node with that id.`};const l=C[s],d=new Set(["model","prompt",...l.params.map(h=>h.name)]),x={};for(const[h,w]of Object.entries(i))d.has(h)&&(x[h]=w);for(const h of l.params)if(h.enumValues&&x[h.name]!==void 0){const w=x[h.name];if(typeof w=="boolean"){x[h.name]=w?h.enumValues.includes("on")?"on":h.enumValues[0]:h.enumValues.includes("off")?"off":"";continue}if(typeof w!="string"||!h.enumValues.includes(w))return{error:`Invalid value for ${s}.${h.name}: ${JSON.stringify(w)}. Must be one of [${h.enumValues.filter(Boolean).join(", ")}].`}}const p=n.applyPatch({op:"add_node",nodeType:s,id:o,params:x});return"error"in p?{error:p.error}:{ok:!0,id:p.id??o}}case"connect":{const s=String(t.source??""),o=String(t.target??"");if(!s||!o)return{error:"Both source and target are required."};const i=n.applyPatch({op:"connect",source:s,target:o});return"error"in i?{error:i.error}:{ok:!0,edge_id:i.edge_id}}case"set_params":{const s=String(t.id??""),o=typeof t.params=="object"&&t.params!==null?t.params:{},i=n.applyPatch({op:"set_params",id:s,params:o});return"error"in i?{error:i.error}:{ok:!0}}case"remove_node":{const s=String(t.id??""),o=n.applyPatch({op:"remove_node",id:s});return"error"in o?{error:o.error}:{ok:!0}}case"pick_model":{const s=String(t.node_type??""),o=typeof t.prefer=="string"?t.prefer:void 0,i=nt(s,o,n);return i?{ok:!0,model:i}:{error:`No model available for ${s}`}}case"ask_user":return{ok:!0,message:String(t.question??"")};case"done":return{ok:!0,message:String(t.summary??"Done.")}}return{error:`Unknown tool: ${e}`}}catch(s){return{error:s instanceof Error?s.message:"Tool failed"}}}async function it(e){const t=[{role:"system",content:et},...e.history.map(o=>o.role==="user"?{role:"user",content:o.content}:{role:"assistant",content:o.content}),{role:"user",content:`${tt(e.draft)}
User request: ${e.userMessage}`}];let n=0,s=!1;for(let o=0;o<G;o++){if(e.signal?.aborted)throw new DOMException("Aborted","AbortError");const a=(await F("/chat/completions",{method:"POST",body:JSON.stringify({model:e.model,messages:t,temperature:.2,max_tokens:4096,tools:Xe,tool_choice:"auto"}),signal:e.signal})).choices[0]?.message;if(!a)return{say:"Empty response from agent.",tool_calls:n,asked_user:!1};t.push({role:"assistant",content:a.content??null,tool_calls:a.tool_calls});const l=a.tool_calls??[];if(l.length===0)return{say:(a.content||"").trim()||`Made ${n} edit${n===1?"":"s"}.`,tool_calls:n,asked_user:!1};let d=null,x=!1;for(const p of l){const h=p.function?.name??"",w=rt(p.function?.arguments),y=ot(h,w,e);n++,e.onStep?.({tool:h,args:w,result:y}),t.push({role:"tool",tool_call_id:p.id,content:JSON.stringify(y)}),h==="done"?d=y.message??"Done.":h==="ask_user"&&(d=y.message??"Need clarification.",x=!0)}if(d!==null)return s=x,{say:d,tool_calls:n,asked_user:s}}return{say:`Stopped after ${G} iterations and ${n} edits — let me know if it needs adjusting.`,tool_calls:n,asked_user:!1}}const at=["Build a workflow that makes a 9:16 reel using web search to research the topic, then writes a script and generates the video","Research a topic with web search, summarize into 5 bullets, and narrate it as audio","Turn a concept into a vivid image prompt, then generate the image","Write a short song with lyrics, then generate it as music"];function lt(e){const t=!("error"in e.result)||!e.result.error,n=e.args;switch(e.tool){case"clear":return{tool:e.tool,summary:"Cleared canvas",ok:t};case"add_node":{const s=e.result.id,o=String(n.node_type??"?");return{tool:e.tool,summary:t?`Added ${o}${s?` "${s}"`:""}`:`Failed to add ${o}: ${e.result.error}`,ok:t}}case"connect":{const s=String(n.source??""),o=String(n.target??"");return{tool:e.tool,summary:t?`Connected ${s} → ${o}`:`Connect failed (${s} → ${o}): ${e.result.error}`,ok:t}}case"set_params":return{tool:e.tool,summary:t?`Updated params on ${String(n.id??"")}`:`set_params failed: ${e.result.error}`,ok:t};case"remove_node":return{tool:e.tool,summary:t?`Removed ${String(n.id??"")}`:`remove failed: ${e.result.error}`,ok:t};case"pick_model":{const s=e.result.model;return{tool:e.tool,summary:t?`Picked ${s} for ${String(n.node_type??"")}`:"pick_model failed",ok:t}}case"ask_user":return{tool:e.tool,summary:"Awaiting your reply",ok:t};case"done":return{tool:e.tool,summary:"Finished",ok:t};default:return{tool:e.tool,summary:e.tool,ok:t}}}function ct(){const{messages:e,draft:t,isThinking:n,addMessage:s,updateMessage:o,setThinking:i,applyAgentPatches:a}=S(),l=ye(f=>f.apiKey!==null),d=D(f=>f.playgroundAgentModel)||te,{catalog:x}=qe(),{models:p}=ee(),h=p.find(f=>f.id===d)?.capabilities,[w,y]=b.useState(""),[$,m]=b.useState(null),u=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{u.current?.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[e,n]);const N=async f=>{const T=f.trim();if(!T||n)return;if(!l){m("Connect your Venice API key first.");return}m(null),y("");const P={id:U(),role:"user",content:T},E={id:U(),role:"assistant",content:"",pending:!0,activity:[]};s(P),s(E),i(!0),g.current?.abort();const A=new AbortController;g.current=A;const I=e.filter(O=>!O.pending&&!O.error).slice(-10).map(O=>({role:O.role,content:O.content}));try{if(h?.supportsFunctionCalling===!0){const k=[],W=await it({userMessage:T,draft:t,history:I,catalog:x,agentModels:p,model:d,capabilities:h,signal:A.signal,applyPatch:c=>{try{const j=S.getState().draft,v=ke({nodes:j.nodes,edges:j.edges},c);return S.setState({draft:{nodes:v.nodes,edges:v.edges}}),{ok:!0,id:v.addedNodeId,edge_id:v.addedEdgeId}}catch(j){return{error:j instanceof Error?j.message:"Patch failed"}}},onStep:c=>{k.push(lt(c)),o(E.id,{activity:[...k]})}});o(E.id,{content:W.say||"Done.",activity:k,pending:!1})}else{const k=await Ke({userMessage:T,draft:t,history:I,catalog:x,model:d,capabilities:h,signal:A.signal});let W;try{k.patches.length>0&&a(k.patches)}catch(v){W=v instanceof Error?v.message:"Failed to apply patches"}const c=k.invalidPatches>0?` (${k.invalidPatches} invalid patch${k.invalidPatches===1?"":"es"} ignored)`:"",j=k.patches.length===0&&!k.say?"The agent returned an unparseable response. Try a different model from the picker above, or simplify the request.":k.say||(k.patches.length>0?"Updated the workflow.":"");o(E.id,{content:j+c,patches:k.patches,error:W,pending:!1})}}catch(O){if(A.signal.aborted)o(E.id,{content:"",error:"Cancelled",pending:!1});else{const k=O instanceof Error?O.message:"Agent request failed";o(E.id,{content:"",error:k,pending:!1})}}finally{i(!1),g.current=null}},_=()=>{g.current?.abort()};return r.jsxs("div",{className:"flex flex-col h-full bg-[#0c0c10]",children:[r.jsx("div",{ref:u,className:"flex-1 overflow-y-auto px-4 py-4",children:e.length===0?r.jsxs("div",{className:"flex flex-col gap-3 pt-8",children:[r.jsx("div",{className:"text-[15px] text-white/85 font-semibold mb-1",children:"What should I build Line truncated
`)}),N.errors.length===0&&N.warnings.length>0&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400/70 shrink-0",title:N.warnings.map(c=>c.message).join(`
`)}),m&&r.jsx("span",{className:"text-[12px] text-green-400/70 truncate",children:m})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("button",{onClick:a,disabled:!_||t,className:"text-white/25 hover:text-white/55 transition-colors p-1.5 disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset canvas",children:r.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"})})}),r.jsx("button",{onClick:T,disabled:!f,className:R("flex items-center gap-1.5 text-[13px] font-medium px-2.5 py-1 rounded-md transition-colors",f?"bg-green-500/20 text-green-300 border border-green-500/30 hover:bg-green-500/30":"bg-white/[0.05] text-white/25 border border-white/[0.06] cursor-not-allowed"),title:N.errors.length>0?N.errors.map(c=>c.message).join(`
`):"Run the workflow inline",children:t?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-2.5 h-2.5 border-2 border-green-300/60 border-t-transparent rounded-full animate-spin"}),r.jsx("span",{className:"hidden sm:inline",children:"Running…"})]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),"Run"]})}),r.jsx("button",{onClick:E,disabled:!_||t,className:R("text-[13px] px-2.5 py-1 rounded-md border border-white/[0.08] transition-colors",_&&!t?"text-white/60 hover:border-white/[0.15] hover:text-white/85":"text-white/20 opacity-40 cursor-not-allowed"),title:g?`Update "${g.name}"`:"Save as new workflow",children:g?"Update":"Save"}),g&&r.jsx("button",{onClick:A,disabled:!_||t,className:"text-white/35 hover:text-white/65 transition-colors p-1.5 disabled:opacity-30 disabled:cursor-not-allowed",title:"Save as a new workflow",children:r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2"}),r.jsx("path",{d:"M7 21h12a2 2 0 002-2V9"})]})}),r.jsxs("button",{onClick:I,disabled:!_||t,className:R("flex items-center gap-1.5 text-[13px] font-medium px-2.5 py-1 rounded-md transition-colors",_&&!t?"bg-white text-black hover:bg-white/90":"bg-white/[0.05] text-white/30 cursor-not-allowed"),title:"Open in Workflows tab",children:[r.jsx("span",{className:"hidden md:inline",children:"Open in Workflows"}),r.jsx("span",{className:"md:hidden",children:"Open"}),r.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:r.jsx("path",{d:"M7 17L17 7M7 7h10v10"})})]})]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:r.jsx(ft,{nodes:e.nodes,edges:e.edges})})]})]})}export{yt as PlaygroundView};
@@ -0,0 +1 @@
.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{strokLine truncated
@@ -0,0 +1,11 @@
import{B as Ir,C as ba,R as _a,D as Ea,r as D,j as A,g as An,q as Sa,v as Na,w as Ca,x as Ma,y as it,E as ka}from"./index-CfrUZ43_.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ia={value:()=>{}};function Jt(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new zt(n)}function zt(e){this._=e}function Aa(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}zt.prototype=Jt.prototype={constructor:zt,on:function(e,t){var n=this._,o=Aa(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=$a(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=wo(n[r],e.name,t);else if(t==null)for(r in n)n[r]=wo(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function $a(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function wo(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Ia,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var $n="http://www.w3.org/1999/xhtml";const vo={svg:"http://www.w3.org/2000/svg",xhtml:$n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function en(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),vo.hasOwnProperty(t)?{space:vo[t],local:e}:e}function Pa(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(n,e)}}function Ta(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ar(e){var t=en(e);return(t.local?Ta:Pa)(t)}function Da(){}function Xn(e){return e==null?Da:function(){return this.querySelector(e)}}function Ra(e){typeof e!="function"&&(e=Xn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),c,u,d=0;d<s;++d)(c=i[d])&&(u=e.call(c,c.__data__,d,i))&&("__data__"in c&&(u.__data__=c.__data__),a[d]=u);return new ue(o,this._parents)}function za(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ha(){return[]}function $r(e){return e==null?Ha:function(){return this.querySelectorAll(e)}}function La(e){return function(){return za(e.apply(this,arguments))}}function Oa(e){typeof e=="function"?e=La(e):e=$r(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,u=0;u<a;++u)(c=s[u])&&(o.push(e.call(c,c.__data__,u,s)),r.push(c));return new ue(o,r)}function Pr(e){return function(){return this.matches(e)}}function Tr(e){return function(t){return t.matches(e)}}var Va=Array.prototype.find;function Ba(e){return function(){return Va.call(this.children,e)}}function Fa(){return this.firstElementChild}function ja(e){return this.select(e==null?Fa:Ba(typeof e=="function"?e:Tr(e)))}var Wa=Array.prototype.filter;function Xa(){return Array.from(this.children)}function Ya(e){return function(){return Wa.call(this.children,e)}}function Za(e){return this.selectAll(e==null?Xa:Ya(typeof e=="function"?e:Tr(e)))}function qa(e){typeof e!="function"&&(e=Pr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&a.push(c);return new ue(o,this._parents)}function Dr(e){return new Array(e.length)}function Ga(){return new ue(this._enter||this._groups.map(Dr),this._parents)}function Bt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bt.prototype={constructor:Bt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ua(e){return function(){return e}}function Ka(e,t,n,o,r,i){for(var s=0,a,c=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Bt(e,i[s]);for(;s<c;++s)(a=t[s])&&(r[s]=a)}function Qa(e,t,n,o,r,i,s){var a,c,u=new Map,d=t.length,l=i.lenLine truncated
`).replace(`
`,`
+`).split(`
`)),d=u.reduce((l,f)=>l.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return D.useEffect(()=>{const c=t?.target??ar,u=t?.actInsideInputWithModifier??!0;if(e!==null){const d=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!u)&&xi(h))return!1;const m=ur(h.code,a);if(i.current.add(h[m]),cr(s,i.current,!1)){const w=h.composedPath?.()?.[0]||h.target,y=w?.nodeName==="BUTTON"||w?.nodeName==="A";t.preventDefault!==!1&&(r.current||!y)&&h.preventDefault(),o(!0)}},l=h=>{const g=ur(h.code,a);cr(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",d),c?.addEventListener("keyup",l),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c?.removeEventListener("keydown",d),c?.removeEventListener("keyup",l),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function cr(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function ur(e,t){return t.includes(e)?"code":"key"}const Lf=()=>{const e=re();return D.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),c=eo(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:c}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-c},d=n.snapGrid??r,l=n.snapToGrid??i;return St(u,o,l,d)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=Ut(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function Vi(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const c of s)Of(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Of(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Bi(e,t){return Vi(e,t)}function Fi(e,t){return Vi(e,t)}function Ae(e,t){return{id:e,type:"select",selected:t}}function Be(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Ae(i.id,s)))}return o}function lr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function dr(e){return{id:e.id,type:"remove"}}const fr=e=>cd(e),Vf=e=>li(e);function ji(e){return D.forwardRef(e)}const Bf=typeof window<"u"?D.useLayoutEffect:D.useEffect;function hr(e){const[t,n]=D.useState(BigInt(0)),[o]=D.useState(()=>Ff(()=>n(r=>r+BigInt(1))));return Bf(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Ff(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wi=D.createContext(null);function jf({children:e}){const t=re(),n=D.useCallback(a=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:l,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let m=c;for(const y of a)m=typeof y=="function"?y(m):y;let w=lr({items:m,lookup:f});for(const y of g.values())w=y(w);d&&u(m),w.length>0?l?.(w):h&&window.requestAnimationFrame(()=>{const{fitViewQu Line truncated
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}gs.displayName="MiniMap";const eg=D.memo(gs),kp=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Ip={[Ke.Line]:"right",[Ke.Handle]:"bottom-right"};function Ap({nodeId:e,position:t,variant:n=Ke.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:l=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:m,onResize:w,onResizeEnd:y}){const b=Zi(),p=typeof e=="string"?e:b,x=re(),S=D.useRef(null),_=n===Ke.Handle,N=J(D.useCallback(kp(_&&h),[_,h]),oe),P=D.useRef(null),T=t??Ip[n];D.useEffect(()=>{if(!(!S.current||!p))return P.current||(P.current=af({domNode:S.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:I,transform:R,snapGrid:H,snapToGrid:v,nodeOrigin:C,domNode:E}=x.getState();return{nodeLookup:I,transform:R,snapGrid:H,snapToGrid:v,nodeOrigin:C,paneDomNode:E}},onChange:(I,R)=>{const{triggerNodeChanges:H,nodeLookup:v,parentLookup:C,nodeOrigin:E}=x.getState(),k=[],M={x:I.x,y:I.y},$=v.get(p);if($&&$.expandParent&&$.parentId){const z=$.origin??E,O=I.width??$.measured.width??0,L=I.height??$.measured.height??0,j={id:$.id,parentId:$.parentId,rect:{width:O,height:L,...mi({x:I.x??$.position.x,y:I.y??$.position.y},{width:O,height:L},$.parentId,v,z)}},F=so([j],v,C,E);k.push(...F),M.x=I.x?Math.max(z[0]*O,I.x):void 0,M.y=I.y?Math.max(z[1]*L,I.y):void 0}if(M.x!==void 0&&M.y!==void 0){const z={id:p,type:"position",position:{...M}};k.push(z)}if(I.width!==void 0&&I.height!==void 0){const O={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};k.push(O)}for(const z of R){const O={...z,type:"position"};k.push(O)}H(k)},onEnd:({width:I,height:R})=>{const H={id:p,type:"dimensions",resizing:!1,dimensions:{width:I,height:R}};x.getState().triggerNodeChanges([H])}})),P.current.update({controlPosition:T,boundaries:{minWidth:a,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:l,resizeDirection:f,onResizeStart:m,onResize:w,onResizeEnd:y,shouldResize:g}),()=>{P.current?.destroy()}},[T,a,c,u,d,l,m,w,y,g]);const V=T.split("-");return A.jsx("div",{className:ie(["react-flow__resize-control","nodrag",...V,n,o]),ref:S,style:{...r,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Ap);const $p=["off","on","auto"],Pp=["16:9","9:16","1:1","4:3","3:4"],Tp=["","5s","10s"],Dp=["","720p","1080p"],Rp=["mp3","opus","aac","flac","wav"],We={textInput:{type:"textInput",label:"Input",description:"Static text provided by the user. Starting point of a workflow.",input:"none",output:"text",params:[{name:"inputText",type:"text",description:"The text value.",required:!0,default:""}]},output:{type:"output",label:"Output",description:"Displays whatever its upstream node produced. Accepts any kind.",input:"text",output:"none",params:[]},chat:{type:"chat",label:"LLM",description:"Run a Venice chat completion. Accepts upstream text as context.",input:"text",output:"text",params:[{name:"model",type:"string",description:"Venice chat model id.",required:!0,default:"llama-3.3-70b"},{name:"prompt",type:"text",description:"Instruction. Use {{input}} to position upstream text, or leave empty to append.",required:!0,default:""},{name:"temperature",type:"number",description:"Sampling temperature.",default:.7,min:0,max:2},{name:"maxTokens",type:"number",description:"Max output tokens.",default:4096,min:64,max:32768},{name:"webSearch",type:"enum",description:"Enable Venice web search.",default:"off",enumValues:$p}]},imageGen:{type:"imageGen",label:"Image Gen",description:"Generate an image from a text prompt.",input:"text",output:"image",params:[{name:"model",type:"string",description:"Venice image model id.",required:!0,default:"z-image-turbo"},{name:"prompt",type:"text",description:"Image prompt. Use {{input}} to position upstream text.",required:!0,default:""},{name:"negativePrompt",type:"string",description:"What to avoid.",default:""},{name:"steps",type:"number",description:"Denoising steps.",default:20,min:1,max:50},{name:"width",type:"number",description:"Image width in pixels.",default:1024,min:256,max:2048},{name:"height",type:"number",description:"Image height in pixels.",default:1024,min:256,max:2048},{name:"style",type:"string",description:"Style preset name.",default:""},{name:"hideWatermark",type:"boolean",description:"Omit watermark if allowed.",default:!0}]},tts:{type:"tts",label:"Text to Speech",description:"Narrate text into speech audio.",input:"text",output:"audio",params:[{name:"model",type:"string",description:"TTS model id.",required:!0,default:"tts-kokoro"},{name:"prompt",type:"text",description:"Text to speak. Use {{input}} to position upstream text.",default:""},{name:"voice",type:"string",description:"Voice id.",default:"af_sky"},{name:"speed",type:"number",description:"Playback speed.",default:1,min:.25,max:4},{name:"responseForma Line truncated
`)}function rt(e,t){return e?e.includes("{{input}}")?e.replace(/\{\{input\}\}/g,t):t?`${e}
${t}`:e:t}async function kr({path:e,id:t,getStatus:n,getResult:o,getError:r,signal:i}){for(let s=0;s<Mr;s++){if(i?.aborted)throw new DOMException("Aborted","AbortError");await new Promise((u,d)=>{const l=setTimeout(u,Cr);i?.addEventListener("abort",()=>{clearTimeout(l),d(new DOMException("Aborted","AbortError"))},{once:!0})});const a=await it(e,{method:"POST",body:JSON.stringify({id:t}),signal:i}),c=n(a).toLowerCase();if(c==="completed"){const u=o(a);if(u)return u;throw new Error("Completed but no output URL returned")}if(c==="failed")throw new Error(r(a)??"Generation failed")}throw new Error(`Generation timed out after ${Mr*Cr/1e3}s`)}async function Zp(e,t,n){const o=e.data;switch(o.nodeType){case"textInput":return o.inputText??"";case"output":return t;case"chat":{const r=rt(o.prompt,t);return(await it("/chat/completions",{method:"POST",body:JSON.stringify({model:o.model||"llama-3.3-70b",messages:[{role:"user",content:r}],temperature:o.temperature??.7,max_tokens:o.maxTokens??4096,venice_parameters:{enable_web_search:o.webSearch??"off"}}),signal:n})).choices[0]?.message?.content??""}case"imageGen":{const r=rt(o.prompt,t),i={model:o.model||"z-image-turbo",prompt:r,negative_prompt:o.negativePrompt||void 0,steps:o.steps??20,style_preset:o.style||void 0,width:o.width??1024,height:o.height??1024,hide_watermark:o.hideWatermark??!0};o.aspectRatio&&(i.aspect_ratio=o.aspectRatio);const a=(await it("/image/generate",{method:"POST",body:JSON.stringify(i),signal:n})).images[0],c=typeof a=="string"?a:a.b64_json;return`[image:data:${c.startsWith("/9j/")?"image/jpeg":c.startsWith("iVBOR")?"image/png":c.startsWith("UklGR")?"image/webp":"image/png"};base64,${c}]`}case"tts":{const r=rt(o.prompt,t),i=await ka("/audio/speech",{model:o.model||"tts-kokoro",input:r,voice:o.voice||"af_sky",speed:o.speed??1,response_format:o.responseFormat||"mp3"},{signal:n});return`[audio:${URL.createObjectURL(i)}]`}case"music":{const r=rt(o.prompt,t),i={model:o.model||"stable-audio",prompt:r,duration_seconds:o.duration??30,force_instrumental:o.instrumental??!1};o.lyrics&&(i.lyrics_prompt=o.lyrics);const s=await it("/audio/queue",{method:"POST",body:JSON.stringify(i),signal:n});return`[audio:${await kr({path:"/audio/retrieve",id:s.queue_id,getStatus:c=>c.status,getResult:c=>c.audio_url,getError:c=>c.error,signal:n})}]`}case"video":{const r=rt(o.prompt,t),i={model:o.model||"wan-2.1",prompt:r,aspect_ratio:o.videoAspectRatio||"16:9"};o.videoDuration&&(i.duration=o.videoDuration),o.videoResolution&&(i.resolution=o.videoResolution);const s=await it("/video/queue",{method:"POST",body:JSON.stringify(i),signal:n}),a=s.queue_id||s.id||"";return`[video:${await kr({path:"/video/retrieve",id:a,getStatus:u=>u.status,getResult:u=>u.video_url,getError:u=>u.error,signal:n})}]`}}}async function ng(e,t,n){const o=typeof n=="function"?{onUpdate:n}:n,{signal:r,onUpdate:i}=o,s=Wp({nodes:e,edges:t});if(!s.ok){const d=s.errors[0];throw new In(d?.message??"Workflow has validation errors.",d?.nodeId)}const a=Xp(e,t);if(!a)throw new In("Workflow contains a cycle.");const c=new Map,u=new Map(e.map(d=>[d.id,d]));for(const d of a){if(r?.aborted)return;await Promise.all(d.map(async l=>{const f=u.get(l);if(f){i(l,{status:"running",output:void 0,error:void 0});try{const h=Yp(l,t,c),g=await Zp(f,h,r);c.set(l,g);const m=We[f.data.nodeType]?.output;i(l,{status:"done",output:g,outputKind:m&&m!=="none"?m:void 0})}catch(h){if(h instanceof DOMException&&h.name==="AbortError")throw i(l,{status:"error",error:"Cancelled"}),h;const g=h instanceof Error?h.message:"Unknown error";throw i(l,{status:"error",error:g}),new In(g,l)}}}))}}export{Qp as B,Jp as C,Kt as H,eg as M,We as N,X as P,np as R,ao as a,Up as b,Kp as c,Sd as d,ke as e,ng as f,Fp as g,Bp as h,Gp as i,tg as u,Wp as v};
@@ -0,0 +1 @@
import{r as h,j as e,c as w,u as F,S as _,g as E,t as M}from"./index-CfrUZ43_.js";import{u as y,a as R,H as O,P as S,R as z,b as H,c as $,d as U,i as Y,B as K,e as q,C as J,M as Q,f as X}from"./workflow-engine-ClbuiuAZ.js";function Z(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"22 12 16 12 14 15 10 9 8 12 2 12"})})}function ee(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}function te(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}function oe(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),e.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})}function ne(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9 18V5l12-2v13"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}function se(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"23 7 16 12 23 17 23 7"}),e.jsx("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2"})]})}function ie(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M8 12h8M12 8v8"})]})}const re={textInput:void 0,output:void 0,chat:"text",imageGen:"image",tts:"tts",music:"music",video:"video"},ae={textInput:{label:"Input",Icon:Z,color:"border-blue-500/30",hasInput:!1,hasOutput:!0},chat:{label:"LLM",Icon:ee,color:"border-purple-500/30",hasInput:!0,hasOutput:!0},imageGen:{label:"Image Gen",Icon:te,color:"border-pink-500/30",hasInput:!0,hasOutput:!0},tts:{label:"Text to Speech",Icon:oe,color:"border-green-500/30",hasInput:!0,hasOutput:!0},music:{label:"Music Gen",Icon:ne,color:"border-yellow-500/30",hasInput:!0,hasOutput:!0},video:{label:"Video Gen",Icon:se,color:"border-orange-500/30",hasInput:!0,hasOutput:!0},output:{label:"Output",Icon:ie,color:"border-white/20",hasInput:!0,hasOutput:!1}},x="nodrag bg-white/[0.03] border border-white/[0.06] rounded px-1.5 py-0.5 text-[12px] text-white/40 outline-none",L="nodrag w-full bg-white/[0.03] border border-white/[0.06] rounded-md px-2 py-1 text-[13px] text-white/60 outline-none placeholder:text-white/15";function le({nodeType:s,value:t,onChange:i}){const o=re[s],{data:c}=F(o),p=c?.map(u=>({value:u.id,label:u.model_spec?.name||u.id}))??[];return e.jsx("div",{className:"nodrag",children:e.jsx(_,{value:t,onChange:i,options:p,searchable:!0,placeholder:"Select model...",className:"w-full [&_button]:!py-1 [&_button]:!text-[13px] [&_button]:!px-2"})})}function de({id:s,data:t}){const i=ae[t.nodeType],o=y(n=>n.runResults[s]),{setNodes:c}=R(),[p,u]=h.useState(!1),r=h.useCallback(n=>{c(m=>m.map(g=>g.id===s?{...g,data:{...g.data,...n}}:g))},[s,c]),a=h.useCallback(()=>{c(n=>n.filter(m=>m.id!==s))},[s,c]);return e.jsxs("div",{className:w("rounded-xl border-2 bg-[#111] shadow-xl min-w-[300px] max-w-[340px]",i.color,o?.status==="running"&&"ring-2 ring-white/20 animate-pulse",o?.status==="done"&&"ring-2 ring-green-500/30",o?.status==="error"&&"ring-2 ring-red-500/30"),children:[i.hasInput&&e.jsx(O,{type:"target",position:S.Top,className:"!w-3 !h-3 !bg-white/30 !border-2 !border-[#111]"}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.06]",children:[e.jsx("span",{className:"text-white/30",children:e.jsx(i.Icon,{})}),e.jsx("span",{className:"text-[14px] font-medium text-white/60",children:i.label}),o?.status==="running"&&e.jsx("span",{className:"text-[12px] text-white/30 ml-auto mr-1",children:"Running..."}),o?.status==="done"&&e.jsx("span",{className:"text-[12px] text-green-400/60 ml-auto mr-1",children:"Done"}),o?.status==="error"&&e.jsx("span",{className:"text-[12px] text-red-400/60 ml-auto mr-1",children:"Error"}),!o?.status&&e.jsx("span",{className:"ml-auto"}),e.jsx("button",{onClick:a,className:"nodrag text-white/10 hover:text-red-400/60 transition-colors p-0.5",title:"Delete node",children:e.jsxs("svg",{widLine truncated
+23
View File
@@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<rect width="32" height="32" rx="7" fill="#0a0a0a"/>
<g fill="white">
<rect x="6.2" y="7.5" width="1.6" height="18" rx="0.8" transform="rotate(-42 6.2 7.5)"/>
<rect x="24.2" y="6.3" width="1.6" height="18" rx="0.8" transform="rotate(42 24.2 6.3)"/>
<polygon points="7.2,8.8 3.8,7.2 4.5,5.5 8.5,7.2"/>
<polygon points="24.8,8.8 28.2,7.2 27.5,5.5 23.5,7.2"/>
<rect x="14.3" y="14.3" width="3.4" height="3.4" rx="0.4" transform="rotate(45 16 16)"/>
<circle cx="9.2" cy="24.5" r="4"/>
<circle cx="9.2" cy="24.5" r="1.7" fill="#0a0a0a"/>
<circle cx="9.2" cy="22.9" r="0.9" fill="#0a0a0a"/>
<circle cx="9.2" cy="26.1" r="0.9" fill="#0a0a0a"/>
<circle cx="7.6" cy="24.5" r="0.9" fill="#0a0a0a"/>
<circle cx="10.8" cy="24.5" r="0.9" fill="#0a0a0a"/>
<circle cx="22.8" cy="24.5" r="4"/>
<circle cx="22.8" cy="24.5" r="1.7" fill="#0a0a0a"/>
<circle cx="22.8" cy="22.9" r="0.9" fill="#0a0a0a"/>
<circle cx="22.8" cy="26.1" r="0.9" fill="#0a0a0a"/>
<circle cx="21.2" cy="24.5" r="0.9" fill="#0a0a0a"/>
<circle cx="24.4" cy="24.5" r="0.9" fill="#0a0a0a"/>
<path d="M16 5.5L12.5 8.5V12.5L16 10.5L19.5 12.5V8.5Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+28
View File
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#0a0a0a" />
<meta name="color-scheme" content="dark" />
<meta name="description" content="OpenVenice — a clean, hackable, open-source web UI for the Venice AI API. Chat, images, audio, music, video, embeddings, and visual workflows." />
<meta property="og:title" content="OpenVenice" />
<meta property="og:description" content="A customizable, open-source frontend for the Venice AI API." />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; connect-src 'self' https://api.venice.ai blob: data:; img-src 'self' data: blob: https:; media-src 'self' blob: https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self';"
/>
<title>OpenVenice — clean UI for the Venice AI API</title>
<link rel="icon" type="image/svg+xml" href="/open/favicon.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
<script type="module" crossorigin src="/open/assets/index-CfrUZ43_.js"></script>
<link rel="stylesheet" crossorigin href="/open/assets/index-BNadRIK3.css">
</head>
<body class="bg-zinc-950 text-zinc-100 antialiased">
<div id="root"></div>
</body>
</html>
+1
View File
@@ -23,6 +23,7 @@ done
node tools/cast.mjs # cast/index.js, the harbor's own as the module the page imports, from cast/*.havre.json
node tools/pages.mjs # c/ (a page and a V3 card for each of them, and the list) and sitemap.txt, from the same cards
node --test tests/*.test.mjs
sh tools/open.sh # open/, openvenice at /open/ for testing
if [ -z "${PW_MODULE:-}" ]; then
PW_MODULE=$(find "${HOME:-/root}/.npm/_npx" -path '*/node_modules/playwright-core/index.mjs' 2>/dev/null | head -1 || true)
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
# tools/open.sh: build openvenice (https://github.com/nikshepsvn/openvenice, MIT) into open/, served at /open/.
# Pinned to one commit; bump OV_REF to take a newer one. Run by tools/build.sh. Needs git, node 20+ and npm.
set -eu
cd "$(dirname "$0")/.."
OV_REF=d983874a79810edaffb85721911630af29d09d95
src=$(mktemp -d)
git clone -q https://github.com/nikshepsvn/openvenice "$src"
git -C "$src" checkout -q "$OV_REF"
(cd "$src" && npm ci --silent --no-audit --no-fund >/dev/null && npx vite build --base=/open/ >/dev/null)
rm -rf open
cp -R "$src/dist" open
cat > open/LICENSE.txt <<EOF
openvenice by nikshepsvn, MIT License: https://github.com/nikshepsvn/openvenice
Built into Havre at /open/ from commit $OV_REF, unchanged.
EOF
rm -rf "$src"
echo "open/: openvenice @ $OV_REF ($(find open -type f | wc -l | tr -d ' ') files)"