fix(ui): stabilize workplace chat scrolling
This commit is contained in:
1 parent
4e7aa75ba5
commit
4bc18dcd27
46 files changed
+5937
-1258
No files matched your search
@@ -0,0 +1,155 @@
|
||||
import{g as ca,r as H3}from"./phaser-DFK5Ua9d.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ug={exports:{}},Dc={};var _k;function F3(){if(_k)return Dc;_k=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Dc.Fragment=t,Dc.jsx=n,Dc.jsxs=n,Dc}var kk;function V3(){return kk||(kk=1,ug.exports=F3()),ug.exports}var u=V3(),dg={exports:{}},St={};var Sk;function U3(){if(Sk)return St;Sk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function b(G,J,P){this.props=G,this.context=J,this.refs=S,this.updater=P||v}b.prototype.isReactComponent={},b.prototype.setState=function(G,J){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,J,"setState")},b.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function w(){}w.prototype=b.prototype;function j(G,J,P){this.props=G,this.context=J,this.refs=S,this.updater=P||v}var N=j.prototype=new w;N.constructor=j,k(N,b.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function D(G,J,P){var K=P.ref;return{$$typeof:e,type:G,key:J,ref:K!==void 0?K:null,props:P}}function M(G,J){return D(G.type,J,G.props)}function A(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function $(G){var J={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(P){return J[P]})}var W=/\/+/g;function B(G,J){return typeof G=="object"&&G!==null&&G.key!=null?$(""+G.key):J.toString(36)}function V(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(R,R):(G.status="pending",G.then(function(J){G.status==="pending"&&(G.status="fulfilled",G.value=J)},function(J){G.status==="pending"&&(G.status="rejected",G.reason=J)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function H(G,J,P,K,ee){var te=typeof G;(te==="undefined"||te==="boolean")&&(G=null);var ie=!1;if(G===null)ie=!0;else switch(te){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(G.$$typeof){case e:case t:ie=!0;break;case h:return ie=G._init,H(ie(G._payload),J,P,K,ee)}}if(ie)return ee=ee(G),ie=K===""?"."+B(G,0):K,O(ee)?(P="",ie!=null&&(P=ie.replace(W,"$&/")+"/"),H(ee,J,P,"",function(oe){return oe})):ee!=null&&(A(ee)&&(ee=M(ee,P+(ee.key==null||G&&G.key===ee.key?"":(""+ee.key).replace(W,"$&/")+"/")+ie)),J.push(ee)),1;ie=0;var se=K===""?".":K+":";if(O(G))for(var de=0;de<G.length;de++)K=G[de],te=se+B(K,de),ie+=H(K,J,P,te,ee);else if(de=x(G),typeof de=="function")for(G=de.call(G),de=0;!(K=G.next()).done;)K=K.value,te=se+B(K,de++),ie+=H(K,J,P,te,ee);else if(te==="object"){if(typeof G.then=="function")return H(V(G),J,P,K,ee);throw J=String(G),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return ie}function U(G,J,P){if(G==null)return G;var K=[],ee=0;return H(G,K,"","",function(te){return J.call(P,te,ee++)}),K}function Y(G){if(G._status===-1){var J=G._result;J=J(),J.then(function(P){(G._status===0||G._status===-1)&&(G._status=1,G._result=P)},function(P){(G._status===0||G._status===-1)&&(G._status=2,G._result=P)}),G._status===-1&&(G._status=0,G._result=J)}if(G._status===1)return G._reLine truncated
|
||||
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+Ee+s+Ie}var Ge=!1;function Ue(s,l){if(!s||Ge)return"";Ge=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(l){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(_e){var xe=_e}Reflect.construct(s,[],Te)}else{try{Te.call()}catch(_e){xe=_e}s.call(Te.prototype)}}else{try{throw Error()}catch(_e){xe=_e}(Te=s())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(_e){if(_e&&xe&&typeof _e.stack=="string")return[_e.stack,xe.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=y.DetermineComponentFrameRoot(),F=E[0],X=E[1];if(F&&X){var re=F.split(`
|
||||
`),ye=X.split(`
|
||||
`);for(_=y=0;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;for(;_<ye.length&&!ye[_].includes("DetermineComponentFrameRoot");)_++;if(y===re.length||_===ye.length)for(y=re.length-1,_=ye.length-1;1<=y&&0<=_&&re[y]!==ye[_];)_--;for(;1<=y&&0<=_;y--,_--)if(re[y]!==ye[_]){if(y!==1||_!==1)do if(y--,_--,0>_||re[y]!==ye[_]){var we=`
|
||||
`+re[y].replace(" at new "," at ");return s.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",s.displayName)),we}while(1<=y&&0<=_);break}}}finally{Ge=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Be(f):""}function at(s,l){switch(s.tag){case 26:case 27:case 5:return Be(s.type);case 16:return Be("Lazy");case 13:return s.child!==l&&l!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Ue(s.type,!1);case 11:return Ue(s.type.render,!1);case 1:return Ue(s.type,!0);case 31:return Be("Activity");default:return""}}function Pt(s){try{var l="",f=null;do l+=at(s,f),f=s,s=s.return;while(s);return l}catch(y){return`
|
||||
Error generating stack: `+y.message+`
|
||||
`+y.stack}}var wt=Object.prototype.hasOwnProperty,Ct=e.unstable_scheduleCallback,pe=e.unstable_cancelCallback,$e=e.unstable_shouldYield,et=e.unstable_requestPaint,tt=e.unstable_now,pt=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,He=e.unstable_IdlePriority,jt=e.log,an=e.unstable_setDisableYieldValue,ke=null,Oe=null;function We(s){if(typeof jt=="function"&&an(s),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(ke,s)}catch{}}var Ze=Math.clz32?Math.clz32:Yt,qe=Math.log,ut=Math.LN2;function Yt(s){return s>>>=0,s===0?32:31-(qe(s)/ut|0)|0}var Nn=256,ln=262144,Ln=4194304;function lt(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function In(s,l,f){var y=s.pendingLanes;if(y===0)return 0;var _=0,E=s.suspendedLanes,F=s.pingedLanes;s=s.warmLanes;var X=y&134217727;return X!==0?(y=X&~E,y!==0?_=lt(y):(F&=X,F!==0?_=lt(F):f||(f=X&~s,f!==0&&(_=lt(f))))):(X=y&~E,X!==0?_=lt(X):F!==0?_=lt(F):f||(f=y&~s,f!==0&&(_=lt(f)))),_===0?0:l!==0&&l!==_&&(l&E)===0&&(E=_&-_,f=l&-l,E>=f||E===32&&(f&4194048)!==0)?l:_}function Et(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Dt(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 Ye(){var s=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),s}function nt(s){for(var l=[],f=0;31>f;f++)l.push(s);return l}function Qt(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function _n(s,l,f,y,_,E){var F=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var X=s.entanglements,re=s.expirationTimes,ye=s.hiddenUpdates;for(f=F&~f;0<f;){var we=31-Ze(f),Te=1<<we;X[we]=0,re[we]=-1;var xe=ye[we];if(xe!==null)for(ye[we]=null,we=0;we<xe.length;we++){var _e=xe[we];_e!==null&&(_e.lane&=-536870913)}f&=~Te}y!==0&&Tt(s,y,0),E!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=E&~(F&~l))}function Tt(s,l,f){s.pendingLanes|=l,s.suspendedLanes&=~l;var y=31-Ze(l);s.entangledLanes|=l,s.entanglements[y]=s.entanglements[y]|1073741824|f&261930}function er(s,l){var f=s.entangledLanes|=l;for(s=s.entanglements;f;){var y=31-Ze(f),_=1<<y;_&l|s[y]&l&&(s[y]|=l),f&=~_}}function Tn(s,l){var f=l&-l;return f=(f&42)!==0?1:ht(f),(f&(s.suspendedLanes|l))!==0?0:f}function ht(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function tr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function mn(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:pk(s.type))}function cn(s,l){var f=U.p;try{return U.p=s,l()}finally{U.p=f}}var Fn=Math.random().toString(36).slice(2),Jt="__reactFiber$"+Fn,Vt="__reactProps$"+Fn,Vn="__reactContainer$"+Fn,Un="__reactEvents$"+Fn,Re="__reactListeners$"+Fn,bt="__reactHandles$"+Fn,Cn="__reactResources$"+Fn,vr="__reactMarker$"+Fn;function Mn(s){delete s[Jt],delete s[Vt],delete s[Un],delete s[Re],delete s[bt]}function _t(s){var l=s[Jt];if(l)return l;for(var f=s.parentNode;f;){if(l=f[Vn]||f[Jt]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(s=Q_(s);s!==null;){if(f=s[Jt])return f;s=Q_(s)}return l}s=f,f=s.parentNode}return null}function wr(s){if(s=s[Jt]||s[Vn]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function fr(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function Xt(s){var l=s[Cn];return l||(l=s[Cn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ut(s){s[vr]=!0}var hn=new Set,qn={};function gt(s,l){Gn(s,l),Gn(s+"Capture",l)}function Gn(s,l){for(qn[s]=l,s=0;s<l.length;s++)hn.add(l[s])}var mr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u2
Line truncated
|
||||
`).replace(c3,"")}function F_(s,l){return l=H_(l),H_(s)===l}function Sn(s,l,f,y,_,E){switch(f){case"children":typeof y=="string"?l==="body"||l==="textarea"&&y===""||dt(s,y):(typeof y=="number"||typeof y=="bigint")&&l!=="body"&&dt(s,""+y);break;case"className":kt(s,"class",y);break;case"tabIndex":kt(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":kt(s,f,y);break;case"style":qt(s,y,E);break;case"data":if(l!=="object"){kt(s,"data",y);break}case"src":case"href":if(y===""&&(l!=="a"||f!=="href")){s.removeAttribute(f);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(f);break}y=Vr(""+y),s.setAttribute(f,y);break;case"action":case"formAction":if(typeof y=="function"){s.setAttribute(f,"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 E=="function"&&(f==="formAction"?(l!=="input"&&Sn(s,l,"name",_.name,_,null),Sn(s,l,"formEncType",_.formEncType,_,null),Sn(s,l,"formMethod",_.formMethod,_,null),Sn(s,l,"formTarget",_.formTarget,_,null)):(Sn(s,l,"encType",_.encType,_,null),Sn(s,l,"method",_.method,_,null),Sn(s,l,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(f);break}y=Vr(""+y),s.setAttribute(f,y);break;case"onClick":y!=null&&(s.onclick=Pr);break;case"onScroll":y!=null&&Ht("scroll",s);break;case"onScrollEnd":y!=null&&Ht("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(f=y.__html,f!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}f=Vr(""+y),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(f,""+y):s.removeAttribute(f);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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":y===!0?s.setAttribute(f,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(f,y):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(f,y):s.removeAttribute(f);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(f):s.setAttribute(f,y);break;case"popover":Ht("beforetoggle",s),Ht("toggle",s),Kt(s,"popover",y);break;case"xlinkActuate":Wn(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Wn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Wn(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Wn(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Wn(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Wn(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Wn(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Wn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Wn(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Kt(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=en.get(f)||f,Kt(s,f,y))}}function Gh(s,l,f,y,_,E){switch(f){case"style":qt(s,y,E);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(f=y.__html,f!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof y=="string"?dt(s,y):(typeof y=="number"||typeof y=="bigint")&&dt(s,""+y);break;case"onScroll":y!=null&&Ht("scroll",s);break;case"onScrollEnd":y!=null&&Ht("scrollend",s);break;case"onClick":y!=null&&(s.onclick=Pr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
`),se=p.map(([de,oe])=>` [${de}, ${oe}],`).join(`
|
||||
`);return`const MAP_STR: string[] = [
|
||||
${ie}
|
||||
]
|
||||
|
||||
const SEATS: [number, number][] = [
|
||||
${se}
|
||||
]`})(),J=()=>R(te=>Math.min(te+.25,3)),P=()=>R(te=>Math.max(te-.25,.5)),K=m.flat().filter(te=>te===1).length,ee=m.flat().filter(te=>te===0).length;return u.jsxs("div",{className:"collision-editor",children:[u.jsxs("div",{className:"ce-toolbar",children:[u.jsxs("div",{className:"ce-toolbar-group",children:[u.jsx("span",{className:"ce-title",children:"Map Editor"}),u.jsx("select",{className:"ce-office-select",value:a,onChange:te=>A(te.target.value),children:i.map(te=>u.jsx("option",{value:te.id,children:te.name},te.id))})]}),u.jsxs("div",{className:"ce-toolbar-group",children:[u.jsxs("button",{className:`ce-mode-btn ${x==="wall"?"active wall":""}`,onClick:()=>v("wall"),children:[u.jsx("span",{className:"ce-mode-dot wall"})," Wall"]}),u.jsxs("button",{className:`ce-mode-btn ${x==="floor"?"active floor":""}`,onClick:()=>v("floor"),children:[u.jsx("span",{className:"ce-mode-dot floor"})," Floor"]}),u.jsxs("button",{className:`ce-mode-btn ${x==="seat"?"active seat":""}`,onClick:()=>v("seat"),children:[u.jsx("span",{className:"ce-mode-dot seat"})," Seat"]})]}),u.jsxs("div",{className:"ce-toolbar-group",children:[u.jsx("button",{className:"ce-btn",onClick:P,children:"-"}),u.jsxs("span",{className:"ce-zoom-label",children:[Math.round(O*100),"%"]}),u.jsx("button",{className:"ce-btn",onClick:J,children:"+"}),u.jsx("button",{className:`ce-btn${L?" active":""}`,onClick:()=>I(te=>!te),children:"Grid"})]}),u.jsxs("div",{className:"ce-toolbar-group",children:[u.jsx("button",{className:`ce-btn apply${j?" success":""}`,onClick:Y,children:j?"Applied":"Apply"}),u.jsx("button",{className:`ce-btn${b?" active":""}`,onClick:Q,children:"Export"}),u.jsx("button",{className:"ce-btn danger",onClick:q,children:"Reset"})]}),u.jsxs("div",{className:"ce-toolbar-group ce-stats",children:[u.jsxs("span",{children:["Walls: ",K]}),u.jsxs("span",{children:["Floor: ",ee]}),u.jsxs("span",{children:["Seats: ",p.length]})]})]}),u.jsxs("div",{className:"ce-body",children:[u.jsx("div",{className:"ce-canvas-wrap",style:{overflow:"auto"},children:u.jsx("canvas",{ref:t,style:{width:D*T*O,height:M*T*O,imageRendering:"pixelated",cursor:x==="seat"?"crosshair":"cell"},onMouseDown:V,onMouseMove:H,onMouseUp:U,onMouseLeave:U})}),b&&u.jsxs("div",{className:"ce-export-panel",children:[u.jsxs("div",{className:"ce-export-header",children:[u.jsx("span",{children:"Export — copy to source code"}),u.jsx("button",{className:"ce-btn",onClick:()=>navigator.clipboard.writeText(G),children:"Copy"})]}),u.jsx("textarea",{className:"ce-export-textarea",value:G,readOnly:!0,rows:20})]})]})]})}let n4=0;function xr(e,t,n={}){return{event_id:`test-${++n4}`,type:e,agent_id:t,data:n,timestamp:Date.now()/1e3}}function Bn(e){return new Promise(t=>setTimeout(t,e))}async function r4(e){const t=[],n=e.getScene();if(!n)return t.push({name:"scene-ready",pass:!1,detail:"OfficeScene not initialized"}),t;console.log("%c[EventTest] Starting full event test suite (multi-office)...","color: #6366f1; font-weight: bold");for(const A of[...n.agents.keys()])n.removeAgent(A);await Bn(100);const r=Zn();t.push({name:"offices-loaded",pass:r.length>=3,detail:`${r.length} offices loaded: ${r.map(A=>A.name).join(", ")}`});const i=["agent-A","agent-B","agent-C","agent-D","agent-E","agent-F"];for(const A of i)e.pushEvent(xr("agent_active",A));await Bn(300);const o=new Set;let a=!1;for(const A of i){const $=n.getAgent(A);$&&$.seatId&&(o.has($.seatId)&&(a=!0),o.add($.seatId))}t.push({name:"desk-assignment-unique",pass:!a&&o.size===i.length,detail:`Assigned ${o.size} unique seats to ${i.length} agents. IDs: [${[...o].join(", ")}]`});const c=i.every(A=>n.getAgent(A)?.officeId!=null);t.push({name:"agents-have-officeId",pass:c,detail:i.map(A=>`${A}=${n.getAgent(A)?.officeId}`).join(", ")}),e.pushEvent(xr("tool_start","agent-A",{tool_name:"shell"})),await Bn(200);const d=n.getAgent("agent-A");t.push({name:"tool_start-state",pass:d.isActive===!0&&d.currentTool==="shell",detail:`isActive=${d.isActive}, currentTool=${d.currentTool}`}),e.pushEvent(xr("tool_done","agent-A",{tool_name:"shell"})),await Bn(100),t.push({name:"tool_done-celebrate",pass:d.agentState==="celebrate",detail:`state=${d.agentState}`});for(let A=0;A<20&&d.agentState==="celebrate";A++)await Bn(500);t.push({name:"celebrate-to-idle",pass:d.agentState!=="celebrate",detail:`state=${d.agentState}`}),e.pushEvent(xr("waiting","agent-B")),await Bn(200);const m=n.getAgent("agent-B");t.push({name:"waiting-state",pass:m.isActive===!1&&(m.agentState==="walk"||m.agentState==="idle"||m.agentState==="coffee"),detail:`isActive=${m.isActive}, state=${m.agentState}`}),e.pushEvent(xr("reflect_start","agent-C")),await Bn(200);const h=n.getAgent("agent-C");t.push({name:"reflect_start-state",pass:h.currentTool==="Reflect"&&(h.agentState==="walk"||h.agentState==="reflect"),detail:`currentTool=${h.currentTool}, state=${h.agentState}`}),e.pushEvent(xr("reflect_done","agent-C")),await Bn(100),t.push({name:"reflect_done-celebrate",pass:h.agentState==="celebrate",detail:`staLine truncated
|
||||
font-size: .6rem;
|
||||
font-weight: bold;
|
||||
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(i),o=!1,i}return a.updateDeps=c=>{r=c},a}function Zk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const p4=(e,t)=>Math.abs(e-t)<1.01,h4=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Qk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},g4=e=>e,y4=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},x4=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:c,height:d}=a;t({width:Math.round(c),height:Math.round(d)})};if(i(Qk(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(a=>{const c=()=>{const d=a[0];if(d?.borderBoxSize){const m=d.borderBoxSize[0];if(m){i({width:m.inlineSize,height:m.blockSize});return}}i(Qk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Jk={passive:!0},eS=typeof window>"u"?!0:"onscrollend"in window,v4=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&eS?()=>{}:h4(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=h=>()=>{const{horizontal:p,isRtl:g}=e.options;i=p?n.scrollLeft*(g&&-1||1):n.scrollTop,o(),t(i,h)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,Jk);const m=e.options.useScrollendEvent&&eS;return m&&n.addEventListener("scrollend",d,Jk),()=>{n.removeEventListener("scroll",c),m&&n.removeEventListener("scrollend",d)}},b4=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},_4=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const a=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class k4{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const a=()=>{const c=o.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:g4,rangeExtractor:y4,onChange:()=>{},measureElement:b4,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Wa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}
Line truncated
|
||||
The error may be correlated with this previous error:
|
||||
${te.current.stack}
|
||||
|
||||
`),Ee}Qf(()=>{te.current=void 0,P.current=void 0,G.current=de});const oe=C.useMemo(()=>C.createElement(S,{...de,ref:D}),[D,S,de]);return C.useMemo(()=>v?C.createElement(A.Provider,{value:q},oe):oe,[A,oe,q])}const R=C.memo(N);if(R.WrappedComponent=S,R.displayName=N.displayName=w,d){const I=C.forwardRef(function(M,A){return C.createElement(R,{...M,reactReduxForwardedRef:A})});return I.displayName=w,I.WrappedComponent=S,Hx(I,S)}return Hx(R,S)}}var gE=oD;function aD(e){const{children:t,context:n,serverState:r,store:i}=e,o=C.useMemo(()=>{const d=mE(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),a=C.useMemo(()=>i.getState(),[i]);Qf(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),a!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,a]);const c=n||hE;return C.createElement(c.Provider,{value:o},t)}var lD=aD,cD="Invariant failed";function uD(e,t){throw new Error(cD)}var $i=function(t){var n=t.top,r=t.right,i=t.bottom,o=t.left,a=r-o,c=i-n,d={top:n,right:r,bottom:i,left:o,width:a,height:c,x:o,y:n,center:{x:(r+o)/2,y:(i+n)/2}};return d},$v=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},CS=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},dD=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Eg={top:0,right:0,bottom:0,left:0},Hv=function(t){var n=t.borderBox,r=t.margin,i=r===void 0?Eg:r,o=t.border,a=o===void 0?Eg:o,c=t.padding,d=c===void 0?Eg:c,m=$i($v(n,i)),h=$i(CS(n,a)),p=$i(CS(h,d));return{marginBox:m,borderBox:$i(n),paddingBox:h,contentBox:p,margin:i,border:a,padding:d}},Ci=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var i=Number(n);return isNaN(i)&&uD(),i},fD=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Jf=function(t,n){var r=t.borderBox,i=t.border,o=t.margin,a=t.padding,c=dD(r,n);return Hv({borderBox:c,border:i,margin:o,padding:a})},em=function(t,n){return n===void 0&&(n=fD()),Jf(t,n)},yE=function(t,n){var r={top:Ci(n.marginTop),right:Ci(n.marginRight),bottom:Ci(n.marginBottom),left:Ci(n.marginLeft)},i={top:Ci(n.paddingTop),right:Ci(n.paddingRight),bottom:Ci(n.paddingBottom),left:Ci(n.paddingLeft)},o={top:Ci(n.borderTopWidth),right:Ci(n.borderRightWidth),bottom:Ci(n.borderBottomWidth),left:Ci(n.borderLeftWidth)};return Hv({borderBox:t,margin:r,padding:i,border:o})},xE=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return yE(n,r)},vu=function(t){var n=[],r=null,i=function(){for(var a=arguments.length,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return i.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},i};function tm(){return tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tm.apply(null,arguments)}function vE(e,t){}vE.bind(null,"warn");vE.bind(null,"error");function bo(){}function mD(e,t){return{...e,...t}}function Ii(e,t,n){const r=t.map(i=>{const o=mD(n,i.options);return e.addEventListener(i.eventName,i.fn,o),function(){e.removeEventListener(i.eventName,i.fn,o)}});return function(){r.forEach(o=>{o()})}}const pD="Invariant failed";class nm extends Error{}nm.prototype.toString=function(){return this.message};function ze(e,t){throw new nm(pD)}let hD=class extends It.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=bo,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof nm&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=Ii(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof nm){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}};const gD=`
|
||||
Press space bar to start a drag.
|
||||
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
||||
Some screen readers may require you to be in focus mode or to use your pass through key
|
||||
`,rm=e=>e+1,yD=e=>`
|
||||
You have lifted an item in position ${rm(e.source.index)}
|
||||
`,bE=(e,t)=>{const n=e.droppableId===t.droppableId,r=rm(e.index),i=rm(t.index);return n?`
|
||||
You have moved the item from position ${r}
|
||||
to position ${i}
|
||||
`:`
|
||||
You have moved the item from position ${r}
|
||||
in list ${e.droppableId}
|
||||
to list ${t.droppableId}
|
||||
in position ${i}
|
||||
`},_E=(e,t,n)=>t.droppableId===n.droppableId?`
|
||||
The item ${e}
|
||||
has been combined with ${n.draggableId}`:`
|
||||
The item ${e}
|
||||
in list ${t.droppableId}
|
||||
has been combined with ${n.draggableId}
|
||||
in list ${n.droppableId}
|
||||
`,xD=e=>{const t=e.destination;if(t)return bE(e.source,t);const n=e.combine;return n?_E(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},jS=e=>`
|
||||
The item has returned to its starting position
|
||||
of ${rm(e.index)}
|
||||
`,vD=e=>{if(e.reason==="CANCEL")return`
|
||||
Movement cancelled.
|
||||
${jS(e.source)}
|
||||
`;const t=e.destination,n=e.combine;return t?`
|
||||
You have dropped the item.
|
||||
${bE(e.source,t)}
|
||||
`:n?`
|
||||
You have dropped the item.
|
||||
${_E(e.draggableId,e.source,n)}
|
||||
`:`
|
||||
The item has been dropped while not over a drop area.
|
||||
${jS(e.source)}
|
||||
`},Of={dragHandleUsageInstructions:gD,onDragStart:yD,onDragUpdate:xD,onDragEnd:vD};function bD(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function kE(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!bD(e[n],t[n]))return!1;return!0}function tn(e,t){const n=C.useState(()=>({inputs:t,result:e()}))[0],r=C.useRef(!0),i=C.useRef(n),a=r.current||!!(t&&i.current.inputs&&kE(t,i.current.inputs))?i.current:{inputs:t,result:e()};return C.useEffect(()=>{r.current=!1,i.current=a},[a]),a.result}function rt(e,t){return tn(()=>e,t)}const Sr={x:0,y:0},Tr=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),ui=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),_o=(e,t)=>e.x===t.x&&e.y===t.y,Bl=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),ra=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},bu=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),ES=(e,t)=>Math.min(...t.map(n=>bu(e,n))),SE=e=>t=>({x:e(t.x),y:e(t.y)});var _D=(e,t)=>{const n=$i({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const Bu=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),NS=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],kD={top:0,right:0,bottom:0,left:0},SD=(e,t)=>t?Bu(e,t.scroll.diff.displacement):e,wD=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,CD=(e,t)=>t&&t.shouldClipSubject?_D(t.pageMarginBox,e):$i(e);var bl=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=SD(e.marginBox,r),o=wD(i,n,t),a=CD(o,r);return{page:e,withPlaceholder:t,active:a}},Fv=(e,t)=>{e.frame||ze();const n=e.frame,r=ui(t,n.scroll.initial),i=Bl(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},a=bl({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:a}};function kr(e,t=kE){let n=null;function r(...i){if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;const o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}const wE=kr(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),CE=kr(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Pm=kr(e=>Object.values(e)),jD=kr(e=>Object.values(e));var $l=kr((e,t)=>jD(t).filter(r=>e===r.descriptor.droppableId).sort((r,i)=>r.descriptor.index-i.descriptor.index));function Vv(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Bm(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var $m=kr((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),ED=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled||!Vv(i))return null;function a(x){const v={type:"COMBINE",combine:{draggableId:x,droppableId:n.descriptor.id}};return{...i,at:v}}const c=i.displaced.all,d=c.length?c[0]:null;if(e)return d?a(d):null;const m=$m(t,r);if(!d){if(!m.length)return null;const x=m[m.length-1];return a(x.descriptor.id)}const h=m.findIndex(x=>x.descriptor.id===d);h===-1&&ze();const p=h-1;if(p<0)return null;const g=m[p];return a(g.descriptor.id)},Hl=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const jE={point:Sr,value:0},_u={invisible:{},visible:{},all:[]},ND={displaced:_u,displacedBy:jE,at:null};var Ti=(e,t)=>n=>e<=n&&n<=t,EE=e=>{const t=Ti(e.top,e.bottom),n=Ti(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),a=n(r.left)||n(r.right);if(o&&a)return!0;const d=r.top<e.top&&r.bottom>e.bottom,m=r.left<e.left&&r.right>e.right;return d&&m?!0:d&&a||m&&o}},ID=e=>{const t=Ti(e.top,e.bottom),n=Ti(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Uv={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},NE={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var TD=e=>t=>{const n=Ti(t.top,t.bottom),r=Ti(t.left,t.right);return i=>e===Uv?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)};const RD=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:Sr;return Bu(e,n)},AD=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,MD=(e,t,n)=>n(t)(e),qv=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?RD(e,t):e;return AD(o,t,i)&&MD(o,n,i)},DD=e=>qv({...e,isVisibleThroughFrameFn:EE}),IE=e=>qv({...e,isVisibleThroughFrameFn:ID}),OD=e=>qv({...e,isVisibleThroughFrameFn:TD(e.destination.axis)}),LD=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return o?o.shouldAnimate:!0};function zD(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return $i($v(n,r))}function ku({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,la
Line truncated
|
||||
cursor: -webkit-grab;
|
||||
cursor: grab;
|
||||
`;return{selector:t(kl.contextId),styles:{always:`
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
touch-action: manipulation;
|
||||
`,resting:c,dragging:PL,dropAnimating:c}}})(),r=(()=>{const c=`
|
||||
transition: ${lu.outOfTheWay};
|
||||
`;return{selector:t(Gx.contextId),styles:{dragging:c,dropAnimating:c,userCancel:c}}})(),i={selector:t(LL.contextId),styles:{always:"overflow-anchor: none;"}},a=[r,n,i,{selector:"body",styles:{dragging:`
|
||||
cursor: grabbing;
|
||||
cursor: -webkit-grabbing;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
overflow-anchor: none;
|
||||
`}}];return{always:Bc(a,"always"),resting:Bc(a,"resting"),dragging:Bc(a,"dragging"),dropAnimating:Bc(a,"dropAnimating"),userCancel:Bc(a,"userCancel")}};const fi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect,Ag=()=>{const e=document.querySelector("head");return e||ze(),e},FS=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function $L(e,t){const n=tn(()=>BL(e),[e]),r=C.useRef(null),i=C.useRef(null),o=rt(kr(p=>{const g=i.current;g||ze(),g.textContent=p}),[]),a=rt(p=>{const g=r.current;g||ze(),g.textContent=p},[]);fi(()=>{!r.current&&!i.current||ze();const p=FS(t),g=FS(t);return r.current=p,i.current=g,p.setAttribute(`${_l}-always`,e),g.setAttribute(`${_l}-dynamic`,e),Ag().appendChild(p),Ag().appendChild(g),a(n.always),o(n.resting),()=>{const x=v=>{const k=v.current;k||ze(),Ag().removeChild(k),v.current=null};x(r),x(i)}},[t,a,o,n.always,n.resting,e]);const c=rt(()=>o(n.dragging),[o,n.dragging]),d=rt(p=>{if(p==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),m=rt(()=>{i.current&&o(n.resting)},[o,n.resting]);return tn(()=>({dragging:c,dropping:d,resting:m}),[c,d,m])}function nN(e,t){return Array.from(e.querySelectorAll(t))}var rN=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Fm(e){return e instanceof rN(e).HTMLElement}function HL(e,t){const n=`[${kl.contextId}="${e}"]`,r=nN(document,n);if(!r.length)return null;const i=r.find(o=>o.getAttribute(kl.draggableId)===t);return!i||!Fm(i)?null:i}function FL(e){const t=C.useRef({}),n=C.useRef(null),r=C.useRef(null),i=C.useRef(!1),o=rt(function(g,x){const v={id:g,focus:x};return t.current[g]=v,function(){const S=t.current;S[g]!==v&&delete S[g]}},[]),a=rt(function(g){const x=HL(e,g);x&&x!==document.activeElement&&x.focus()},[e]),c=rt(function(g,x){n.current===g&&(n.current=x)},[]),d=rt(function(){r.current||i.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const g=n.current;g&&a(g)}))},[a]),m=rt(function(g){n.current=null;const x=document.activeElement;x&&x.getAttribute(kl.draggableId)===g&&(n.current=g)},[]);return fi(()=>(i.current=!0,function(){i.current=!1;const g=r.current;g&&cancelAnimationFrame(g)}),[]),tn(()=>({register:o,tryRecordFocus:m,tryRestoreFocusRecorded:d,tryShiftRecord:c}),[o,m,d,c])}function VL(){const e={draggables:{},droppables:{}},t=[];function n(p){return t.push(p),function(){const x=t.indexOf(p);x!==-1&&t.splice(x,1)}}function r(p){t.length&&t.forEach(g=>g(p))}function i(p){return e.draggables[p]||null}function o(p){const g=i(p);return g||ze(),g}const a={register:p=>{e.draggables[p.descriptor.id]=p,r({type:"ADDITION",value:p})},update:(p,g)=>{const x=e.draggables[g.descriptor.id];x&&x.uniqueId===p.uniqueId&&(delete e.draggables[g.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:p=>{const g=p.descriptor.id,x=i(g);x&&p.uniqueId===x.uniqueId&&(delete e.draggables[g],e.droppables[p.descriptor.droppableId]&&r({type:"REMOVAL",value:p}))},getById:o,findById:i,exists:p=>!!i(p),getAllByType:p=>Object.values(e.draggables).filter(g=>g.descriptor.type===p)};function c(p){return e.droppables[p]||null}function d(p){const g=c(p);return g||ze(),g}const m={register:p=>{e.droppables[p.descriptor.id]=p},unregister:p=>{const g=c(p.descriptor.id);g&&p.uniqueId===g.uniqueId&&delete e.droppables[p.descriptor.id]},getById:d,findById:c,exists:p=>!!c(p),getAllByType:p=>Object.values(e.droppables).filter(g=>g.descriptor.type===p)};function h(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:m,subscribe:n,clean:h}}function UL(){const e=tn(VL,[]);return C.useEffect(()=>function(){e.clean()},[e]),e}var n0=It.createContext(null),sm=()=>{const e=document.body;return e||ze(),e};const qL={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},GL=e=>`rfd-announcement-${e}`;function WL(e){const t=tn(()=>GL(e),[e]),n=C.useRef(null);return C.useEffect(function(){const o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),tm(o.style,qL),sm().appendChild(o),function(){setTimeout(function(){const d=sm();d.contains(o)&&d.removeChild(o),o===n.current&&(n.current=null)})}},[t]),rt(i=>{const o=n.current;if(o){o.textContent=i;return}},[])}const YL={separator:"::"};function r0(e,t=YL){const n=It.useId();return tn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function XL({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function KL({contextId:e,text:t}){const n=r0("hidden-text",{separator:"-"}),r=tn(()=>XL({contextId:e,uniqueId:n}),[n,e]);return C.useEffect(function(){const o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",sm().appendChild(o),function(){const c=sm();c.contains(o)&&c.removeChild(o)}},[r,t]),r}var Vm=It.c
Line truncated
|
||||
`,m="/",h="*",p="",g="comment",x="declaration";function v(S,b){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];b=b||{};var w=1,j=1;function N(B){var V=B.match(t);V&&(w+=V.length);var H=B.lastIndexOf(d);j=~H?B.length-H:j+B.length}function O(){var B={line:w,column:j};return function(V){return V.position=new R(B),D(),V}}function R(B){this.start=B,this.end={line:w,column:j},this.source=b.source}R.prototype.content=S;function L(B){var V=new Error(b.source+":"+w+":"+j+": "+B);if(V.reason=B,V.filename=b.source,V.line=w,V.column=j,V.source=S,!b.silent)throw V}function I(B){var V=B.exec(S);if(V){var H=V[0];return N(H),S=S.slice(H.length),V}}function D(){I(n)}function M(B){var V;for(B=B||[];V=A();)V!==!1&&B.push(V);return B}function A(){var B=O();if(!(m!=S.charAt(0)||h!=S.charAt(1))){for(var V=2;p!=S.charAt(V)&&(h!=S.charAt(V)||m!=S.charAt(V+1));)++V;if(V+=2,p===S.charAt(V-1))return L("End of comment missing");var H=S.slice(2,V-2);return j+=2,N(H),S=S.slice(V),j+=2,B({type:g,comment:H})}}function $(){var B=O(),V=I(r);if(V){if(A(),!I(i))return L("property missing ':'");var H=I(o),U=B({type:x,property:k(V[0].replace(e,p)),value:H?k(H[0].replace(e,p)):p});return I(a),U}}function W(){var B=[];M(B);for(var V;V=$();)V!==!1&&(B.push(V),M(B));return B}return D(),W()}function k(S){return S?S.replace(c,p):p}return Hg=v,Hg}var ow;function gz(){if(ow)return Ka;ow=1;var e=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=n;const t=e(hz());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:m,value:h}=d;c?i(m,h,d):h&&(o=o||{},o[m]=h)}),o}return Ka}var Vc={},aw;function yz(){if(aw)return Vc;aw=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},a=function(m,h){return h.toUpperCase()},c=function(m,h){return"".concat(h,"-")},d=function(m,h){return h===void 0&&(h={}),o(m)?m:(m=m.toLowerCase(),h.reactCompat?m=m.replace(i,c):m=m.replace(r,c),m.replace(t,a))};return Vc.camelCase=d,Vc}var Uc,lw;function xz(){if(lw)return Uc;lw=1;var e=Uc&&Uc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(gz()),n=yz();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,Uc=r,Uc}var vz=xz();const bz=ca(vz),IN=TN("end"),c0=TN("start");function TN(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _z(e){const t=c0(e),n=IN(e);if(t&&n)return{start:t,end:n}}function cu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?cw(e.position):"start"in e||"end"in e?cw(e):"line"in e||"column"in e?Zx(e):""}function Zx(e){return uw(e&&e.line)+":"+uw(e&&e.column)}function cw(e){return Zx(e&&e.start)+"-"+Zx(e&&e.end)}function uw(e){return e&&typeof e=="number"?e:1}class zr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=cu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.column=void 0;zr.prototype.line=void 0;zr.prototype.ancestors=void 0;zr.prototype.cause=void 0;zr.prototype.fatal=void 0;zr.prototype.place=void 0;zr.prototype.ruleId=void 0;zr.prototype.source=void 0;const u0={}.hasOwnProperty,kz=new Map,Sz=/[A-Z]/g,wz=new Set(["table","tbody","thead","tfoot","tr"]),Cz=new Set(["td","th"]),RN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.j
Line truncated
|
||||
`;break}case-3:{a=`\r
|
||||
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function DB(e){const r={constructs:LN([TB,...(e||{}).extensions||[]]),content:i(Xz),defined:[],document:i(Zz),flow:i(hB),lazy:{},string:i(xB),text:i(vB)};return r;function i(o){return a;function a(c){return RB(r,o,c)}}}function OB(e){for(;!HN(e););return e}const bw=/[\0\t\n\r]/g;function LB(){let e=1,t="",n=!0,r;return i;function i(o,a,c){const d=[];let m,h,p,g,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(bw.lastIndex=p,m=bw.exec(o),g=m&&m.index!==void 0?m.index:o.length,x=o.charCodeAt(g),!m){t=o.slice(p);break}if(x===10&&p===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<g&&(d.push(o.slice(p,g)),e+=g-p),x){case 0:{d.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,d.push(-2);e++<h;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=g+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const zB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PB(e){return e.replace(zB,BB)}function BB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return zN(n.slice(o?2:1),o?16:10)}return p0(n)||e}const WN={}.hasOwnProperty;function $B(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HB(n)(OB(DB(n).document().write(LB()(e,t,!0))))}function HB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wt),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(Ge),blockQuote:o(oe),characterEscape:D,characterReference:D,codeFenced:o(Ne),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Ne,a),codeText:o(Ee,a),codeTextData:D,data:D,codeFlowValue:D,definition:o(Ie),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Be),hardBreakEscape:o(Ue),hardBreakTrailing:o(Ue),htmlFlow:o(at,a),htmlFlowData:D,htmlText:o(at,a),htmlTextData:D,image:o(Pt),label:a,link:o(wt),listItem:o(pe),listItemValue:g,listOrdered:o(Ct,p),listUnordered:o(Ct),paragraph:o($e),reference:P,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ge),strong:o(et),thematicBreak:o(pt)},exit:{atxHeading:d(),atxHeadingSequence:O,autolink:d(),autolinkEmail:de,autolinkProtocol:se,blockQuote:d(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:te,characterReference:ie,codeFenced:d(S),codeFencedFence:k,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:M,codeIndented:d(b),codeText:d(V),codeTextData:M,data:M,definition:d(),definitionDestinationString:N,definitionLabelString:w,definitionTitleString:j,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(W),htmlFlowData:M,htmlText:d(B),htmlTextData:M,image:d(U),label:Q,labelText:Y,lineEnding:A,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:K,resourceDestinationString:q,resourceTitleString:G,resource:J,setextHeading:d(I),setextHeadingLineSequence:L,setextHeadingText:R,strong:d(),thematicBreak:d()}};YN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(me){let be={type:"root",children:[]};const Me={stack:[be],tokenStack:[],config:t,enter:c,exit:m,buffer:a,resume:h,data:n},Fe=[];let He=-1;for(;++He<me.length;)if(me[He][1].type==="listOrdered"||me[He][1].type==="listUnordered")if(me[He][0]==="enter")Fe.push(He);else{const jt=Fe.pop();He=i(me,jt,He)}for(He=-1;++He<me.length;){const jt=t[me[He][0]];WN.call(jt,me[He][1].type)&&jt[me[He][1].type].call(Object.assign({sliceSerialize:me[He][2].sliceSerialize},Me),me[He][1])}if(Me.tokenStack.length>0){const jt=Me.tokenStack[Me.tokenStack.length-1];(jt[1]||_w).call(Me,void 0,jt[0])}for(be.position={start:mo(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:mo(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)be=t.transforms[He](be)||be;return be}function i(me,be,Me){let Fe=be-1,He=-1,jt=!1,an,ke,Oe,We;for(;++Fe<=Me;){const Ze=me[Fe];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?He++:He--,We=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(an&&!We&&!He&&!Oe&&(Oe=Fe),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!He&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||He===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(an){let qe=Fe;for(ke=void 0;qe--;){const ut=me[qe];if(ut[1].type==="lineEnding"||ut[1].type==="lineEndingBlank"){if(ut[0]==="exit")continue;ke&&(me[ke][1].type="lineEndingBlank",jt=!0),ut[1].type="lineEnding",ke=qe}else if(!(ut[1].type==="linePrefix"||ut[1].type==="blockQuotePrefix"||ut[1].type==="blockQuotePrefixWhitespace"Line truncated
|
||||
`}]}function GB(e,t){const n=t.value?t.value+`
|
||||
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function WB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Vl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function KB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XN(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function QB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XN(e,t);const i={src:Vl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function JB(e,t){const n={src:Vl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function e9(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function t9(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XN(e,t);const i={href:Vl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function n9(e,t){const n={href:Vl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function r9(e,t,n){const r=e.all(t),i=n?i9(n):KN(t),o={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const h=r[c];(i||c!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
||||
`}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
||||
`});const m={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,m),e.applyData(t,m)}function i9(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=KN(n[r])}return t}function KN(e){const t=e.spread;return t??e.children.length>1}function s9(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function o9(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a9(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function l9(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c9(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=c0(t.children[1]),d=IN(t.children[t.children.length-1]);c&&d&&(a.position={start:c,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function u9(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let d=-1;const m=[];for(;++d<c;){const p=t.children[d],g={},x=a?a[d]:void 0;x&&(g.align=x);let v={type:"element",tagName:o,properties:g,children:[]};p&&(v.children=e.all(p),e.patch(p,v),v=e.applyData(p,v)),m.push(v)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,h),e.applyData(t,h)}function d9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const kw=9,Sw=32;function f9(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(ww(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(ww(t.slice(i),i>0,!1)),o.join("")}function ww(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===kw||o===Sw;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===kw||o===Sw;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function m9(e,t){const n={type:"text",value:f9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function p9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const h9={blockquote:UB,break:qB,code:GB,delete:WB,emphasis:YB,footnoteReference:XB,heading:KB,html:ZB,imageReference:QB,image:JB,inlineCode:e9,linkReference:t9,link:n9,listItem:r9,list:s9,paragraph:o9,root:a9,strong:l9,table:c9,tableCell:d9,tableRow:u9,text:m9,thematicBreak:p9,toml:cf,yaml:cf,definition:cf,footnoteDefinition:cf};function cf(){}const ZN=-1,Xm=0,du=1,dm=2,g0=3,y0=4,x0=5,v0=6,QN=7,JN=8,Cw=typeof self=="object"?self:globalThis,g9=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Xm:case ZN:return n(a,i);case du:{const c=n([],i);for(const d of a)c.push(r(d));return c}case dm:{const c=n({},i);for(const[d,m]of a)c[r(d)]=r(m);return c}case g0:return n(new Date(a),i);case y0:{const{source:c,flags:d}=a;return n(new RegExp(c,d),i)}case x0:{const c=n(new Map,i);for(const[d,m]of a)c.set(r(d),r(m));return c}case v0:{const c=n(new Set,i);for(const d of a)c.add(r(d));return c}case QN:{const{name:c,message:d}=a;return n(new Cw[c](d),i)}case JN:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new Cw[o](a),i)};return r},jw=e=>g9(new Map,e)(0),Za="",{toString:y9}={},{keys:x9}=Object,Gc=e=>{const t=typeof e;if(t!=="object"||!e)return[Xm,t];const n=y9.call(e).slice(8,-1);switch(n){case"Array":return[du,Za];case"Object":return[dm,Za];case"Date":return[g0,Za];case"RegExp":return[y0,Za];case"Map":return[x0,Za];case"Set":return[v0,Za];case"DataView":return[du,n]}return n.includes("Array")?[du,n]:n.includes("Error")?[QN,n]:[dm,n]},uf=([e,t])=>e===Xm&&(t==="function"||t==="symbol"),v9=(e,t,n,r)=>{const i=(a,c)=>{const d=r.push(a)-1;return n.set(c,d),d},o=a=>{if(n.has(a))return n.get(a);let[c,d]=Gc(a);switch(c){case Xm:{let h=a;switch(d){case"bigint":c=JN,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);h=null;break;case"undefined":return i([ZN],a)}return i([c,h],a)}case du:{if(d){let g=a;return d==="DataView"?g=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
||||
`}]}}const Km=(function(e){if(e==null)return j9;if(typeof e=="function")return Zm(e);if(typeof e=="object")return Array.isArray(e)?S9(e):w9(e);if(typeof e=="string")return C9(e);throw new Error("Expected function, string, or object as test")});function S9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Km(e[n]);return Zm(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function w9(e){const t=e;return Zm(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function C9(e){return Zm(t);function t(n){return n&&n.type===e}}function Zm(e){return t;function t(n,r,i){return!!(E9(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function j9(){return!0}function E9(e){return e!==null&&typeof e=="object"&&"type"in e}const eI=[],N9=!0,ev=!1,I9="skip";function tI(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Km(i),a=r?-1:1;c(e,void 0,[])();function c(d,m,h){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=eI,v,k,S;if((!t||o(d,m,h[h.length-1]||void 0))&&(x=T9(n(d,h)),x[0]===ev))return x;if("children"in d&&d.children){const b=d;if(b.children&&x[0]!==I9)for(k=(r?b.children.length:-1)+a,S=h.concat(b);k>-1&&k<b.children.length;){const w=b.children[k];if(v=c(w,k,S)(),v[0]===ev)return v;k=typeof v[1]=="number"?v[1]:k+a}}return x}}}function T9(e){return Array.isArray(e)?e:typeof e=="number"?[N9,e]:e==null?eI:[e]}function b0(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),tI(e,o,c,i);function c(d,m){const h=m[m.length-1],p=h?h.children.indexOf(d):void 0;return a(d,p,h)}}const tv={}.hasOwnProperty,R9={};function A9(e,t){const n=t||R9,r=new Map,i=new Map,o=new Map,a={...h9,...n.handlers},c={all:m,applyData:D9,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:M9,wrap:L9};return b0(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();p.has(g)||p.set(g,h)}}),c;function d(h,p){const g=h.type,x=c.handlers[g];if(tv.call(c.handlers,g)&&x)return x(c,h,p);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in h){const{children:k,...S}=h,b=fm(S);return b.children=c.all(h),b}return fm(h)}return(c.options.unknownHandler||O9)(c,h,p)}function m(h){const p=[];if("children"in h){const g=h.children;let x=-1;for(;++x<g.length;){const v=c.one(g[x],h);if(v){if(x&&g[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=Nw(v.value)),!Array.isArray(v)&&v.type==="element")){const k=v.children[0];k&&k.type==="text"&&(k.value=Nw(k.value))}Array.isArray(v)?p.push(...v):p.push(v)}}}return p}}function M9(e,t){e.position&&(t.position=_z(e))}function D9(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,fm(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function O9(e,t){const n=t.data||{},r="value"in t&&!(tv.call(n,"hProperties")||tv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function L9(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
||||
`});++r<e.length;)r&&n.push({type:"text",value:`
|
||||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
||||
`}),n}function Nw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Iw(e,t){const n=A9(e,t),r=n.one(e,void 0),i=k9(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
||||
`},i),o}function z9(e,t){return e&&"run"in e?async function(n,r){const i=Iw(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Iw(n,{file:r,...e||t})}}function Tw(e){if(e)throw e}var qg,Rw;function P9(){if(Rw)return qg;Rw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var h=e.call(m,"constructor"),p=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!h&&!p)return!1;var g;for(g in m);return typeof g>"u"||e.call(m,g)},a=function(m,h){n&&h.name==="__proto__"?n(m,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):m[h.name]=h.newValue},c=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(r)return r(m,h).value}else return;return m[h]};return qg=function d(){var m,h,p,g,x,v,k=arguments[0],S=1,b=arguments.length,w=!1;for(typeof k=="boolean"&&(w=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<b;++S)if(m=arguments[S],m!=null)for(h in m)p=c(k,h),g=c(m,h),k!==g&&(w&&g&&(o(g)||(x=i(g)))?(x?(x=!1,v=p&&i(p)?p:[]):v=p&&o(p)?p:{},a(k,{name:h,newValue:d(w,v,g)})):typeof g<"u"&&a(k,{name:h,newValue:g}));return k},qg}var B9=P9();const Gg=ca(B9);function nv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $9(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...i);function c(d,...m){const h=e[++o];let p=-1;if(d){a(d);return}for(;++p<i.length;)(m[p]===null||m[p]===void 0)&&(m[p]=i[p]);i=m,h?H9(h,c)(...m):a(null,...m)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function H9(e,t){let n;return r;function r(...a){const c=e.length>a.length;let d;c&&a.push(i);try{d=e.apply(this,a)}catch(m){const h=m;if(c&&n)throw h;return i(h)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...c){n||(n=!0,t(a,...c))}function o(a){i(null,a)}}const es={basename:F9,dirname:V9,extname:U9,join:q9,sep:"/"};function F9(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function V9(e){if(Vu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function U9(e){Vu(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function q9(...e){let t=-1,n;for(;++t<e.length;)Vu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":G9(n)}function G9(e){Vu(e);const t=e.codePointAt(0)===47;let n=W9(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function W9(e,t){let n="",r=0,i=-1,o=0,a=-1,c,d;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else c===46&&o>-1?o++:o=-1}return n}function Vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Y9={cwd:X9};function X9(){return"/"}function rv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function K9(e){if(typeof e=="string")e=new URL(e);else if(!rv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Z9(e)}function Z9(e){if(e.hostname!==""){consLine truncated
|
||||
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?sI:H$))),m(),d}}function H$(e,t,n){return t===0?e:sI(e,t,n)}function sI(e,t,n){return(n?"":" ")+e}const F$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];oI.peek=W$;function V$(){return{canContainEols:["delete"],enter:{strikethrough:q$},exit:{strikethrough:G$}}}function U$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:F$}],handlers:{delete:oI}}}function q$(e){this.enter({type:"delete",children:[]},e)}function G$(e){this.exit(e)}function oI(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function W$(){return"~"}function Y$(e){return e.length}function X$(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Y$,o=[],a=[],c=[],d=[];let m=0,h=-1;for(;++h<e.length;){const k=[],S=[];let b=-1;for(e[h].length>m&&(m=e[h].length);++b<e[h].length;){const w=K$(e[h][b]);if(n.alignDelimiters!==!1){const j=i(w);S[b]=j,(d[b]===void 0||j>d[b])&&(d[b]=j)}k.push(w)}a[h]=k,c[h]=S}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<m;)o[p]=Pw(r[p]);else{const k=Pw(r);for(;++p<m;)o[p]=k}p=-1;const g=[],x=[];for(;++p<m;){const k=o[p];let S="",b="";k===99?(S=":",b=":"):k===108?S=":":k===114&&(b=":");let w=n.alignDelimiters===!1?1:Math.max(1,d[p]-S.length-b.length);const j=S+"-".repeat(w)+b;n.alignDelimiters!==!1&&(w=S.length+w+b.length,w>d[p]&&(d[p]=w),x[p]=w),g[p]=j}a.splice(1,0,g),c.splice(1,0,x),h=-1;const v=[];for(;++h<a.length;){const k=a[h],S=c[h];p=-1;const b=[];for(;++p<m;){const w=k[p]||"";let j="",N="";if(n.alignDelimiters!==!1){const O=d[p]-(S[p]||0),R=o[p];R===114?j=" ".repeat(O):R===99?O%2?(j=" ".repeat(O/2+.5),N=" ".repeat(O/2-.5)):(j=" ".repeat(O/2),N=j):N=" ".repeat(O)}n.delimiterStart!==!1&&!p&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||p)&&b.push(" "),n.alignDelimiters!==!1&&b.push(j),b.push(w),n.alignDelimiters!==!1&&b.push(N),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||p!==m-1)&&b.push("|")}v.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return v.join(`
|
||||
`)}function K$(e){return e==null?"":String(e)}function Pw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Z$(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Q$);return i(),a}function Q$(e,t,n){return">"+(n?"":" ")+e}function J$(e,t){return Bw(e,t.inConstruct,!0)&&!Bw(e,t.notInConstruct,!1)}function Bw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $w(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
||||
`&&J$(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||||
`}function e7(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function t7(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function n7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function r7(e,t,n,r){const i=n7(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(t7(e,n)){const p=n.enter("codeIndented"),g=n.indentLines(o,i7);return p(),g}const c=n.createTracker(r),d=i.repeat(Math.max(e7(o,i)+1,3)),m=n.enter("codeFenced");let h=c.move(d);if(e.lang){const p=n.enter(`codeFencedLang${a}`);h+=c.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${a}`);h+=c.move(" "),h+=c.move(n.safe(e.meta,{before:h,after:`
|
||||
`,encode:["`"],...c.current()})),p()}return h+=c.move(`
|
||||
`),o&&(h+=c.move(o+`
|
||||
`)),h+=c.move(d),m(),h}function i7(e,t,n){return(n?"":" ")+e}function k0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function s7(e,t,n,r){const i=k0(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
||||
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),a(),m}function o7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Nu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mm(e,t,n){const r=jl(e),i=jl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}aI.peek=a7;function aI(e,t,n,r){const i=o7(n),o=n.enter("emphasis"),a=n.createTracker(r),c=a.move(i);let d=a.move(n.containerPhrasing(e,{after:i,before:c,...a.current()}));const m=d.charCodeAt(0),h=mm(r.before.charCodeAt(r.before.length-1),m,i);h.inside&&(d=Nu(m)+d.slice(1));const p=d.charCodeAt(d.length-1),g=mm(r.after.charCodeAt(0),p,i);g.inside&&(d=d.slice(0,-1)+Nu(p));const x=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},c+d+x}function a7(e,t,n){return n.options.emphasis||"*"}function l7(e,t){let n=!1;return b0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ev}),!!((!e.depth||e.depth<3)&&m0(e)&&(t.options.setext||n))}function c7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(l7(e,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
|
||||
`,after:`
|
||||
`});return p(),h(),g+`
|
||||
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
||||
`))+1))}const a="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");o.move(a+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
||||
`,...o.current()});return/^[\t ]/.test(m)&&(m=Nu(m.charCodeAt(0))+m.slice(1)),m=m?a+" "+m:a,n.options.closeAtx&&(m+=" "+a),d(),c(),m}lI.peek=u7;function lI(e){return e.value||""}function u7(){return"<"}cI.peek=d7;function cI(e,t,n,r){const i=k0(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),m+=d.move(")"),a(),m}function d7(){return"!"}uI.peek=f7;function uI(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const m=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=h,o(),i==="full"||!m||m!==p?d+=c.move(p+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function f7(){return"!"}dI.peek=m7;function dI(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],c=n.compilePattern(a);let d;if(a.atBreak)for(;d=c.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return i+r+i}function m7(){return"`"}function fI(e,t){const n=m0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}mI.peek=p7;function mI(e,t,n,r){const i=k0(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let c,d;if(fI(e,n)){const h=n.stack;n.stack=[],c=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),c(),n.stack=h,p}c=n.enter("link"),d=n.enter("label");let m=a.move("[");return m+=a.move(n.containerPhrasing(e,{before:m,after:"](",...a.current()})),m+=a.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=a.move("<"),m+=a.move(n.safe(e.url,{before:m,after:">",...a.current()})),m+=a.move(">")):(d=n.enter("destinationRaw"),m+=a.move(n.safe(e.url,{before:m,after:e.title?" ":")",...a.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=a.move(" "+i),m+=a.move(n.safe(e.title,{before:m,after:i,...a.current()})),m+=a.move(i),d()),m+=a.move(")"),c(),m}function p7(e,t,n){return fI(e,n)?"<":"["}pI.peek=h7;function pI(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=h,o(),i==="full"||!m||m!==p?d+=c.move(p+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function h7(){return"["}function S0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function g7(e){const t=S0(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function y7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function hI(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function x7(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?y7(n):S0(n);const c=e.ordered?a==="."?")":".":g7(n);let d=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),hI(n)===a&&h){let p=-1;for(;++p<e.chilLine truncated
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:d,tableRow:c}};function a(x,v,k,S){return m(h(x,k,S),x.align)}function c(x,v,k,S){const b=p(x,k,S),w=m([b]);return w.slice(0,w.indexOf(`
|
||||
`))}function d(x,v,k,S){const b=k.enter("tableCell"),w=k.enter("phrasing"),j=k.containerPhrasing(x,{...S,before:o,after:o});return w(),b(),j}function m(x,v){return X$(x,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function h(x,v,k){const S=x.children;let b=-1;const w=[],j=v.enter("table");for(;++b<S.length;)w[b]=p(S[b],v,k);return j(),w}function p(x,v,k){const S=x.children;let b=-1;const w=[],j=v.enter("tableRow");for(;++b<S.length;)w[b]=d(S[b],x,v,k);return j(),w}function g(x,v,k){let S=yI.inlineCode(x,v,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function L7(){return{exit:{taskListCheckValueChecked:Fw,taskListCheckValueUnchecked:Fw,paragraph:P7}}}function z7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:B7}}}function Fw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function P7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const c=i[o];if(c.type==="paragraph"){a=c;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function B7(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(a);let d=yI.listItem(e,t,n,{...r,...c.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(h){return h+a}}function $7(){return[x$(),B$(),V$(),I7(),L7()]}function H7(e){return{extensions:[v$(),$$(e),U$(),O7(e),z7()]}}const F7={tokenize:Y7,partial:!0},xI={tokenize:X7,partial:!0},vI={tokenize:K7,partial:!0},bI={tokenize:Z7,partial:!0},V7={tokenize:Q7,partial:!0},_I={name:"wwwAutolink",tokenize:G7,previous:SI},kI={name:"protocolAutolink",tokenize:W7,previous:wI},Bs={name:"emailAutolink",tokenize:q7,previous:CI},cs={};function U7(){return{text:cs}}let Yo=48;for(;Yo<123;)cs[Yo]=Bs,Yo++,Yo===58?Yo=65:Yo===91&&(Yo=97);cs[43]=Bs;cs[45]=Bs;cs[46]=Bs;cs[95]=Bs;cs[72]=[Bs,kI];cs[104]=[Bs,kI];cs[87]=[Bs,_I];cs[119]=[Bs,_I];function q7(e,t,n){const r=this;let i,o;return a;function a(p){return!iv(p)||!CI.call(r,r.previous)||w0(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return iv(p)?(e.consume(p),c):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(V7,h,m)(p):p===45||p===95||Lr(p)?(o=!0,e.consume(p),d):h(p)}function m(p){return e.consume(p),i=!0,d}function h(p){return o&&i&&Fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function G7(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!SI.call(r,r.previous)||w0(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(F7,e.attempt(xI,e.attempt(vI,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function W7(e,t,n){const r=this;let i="",o=!1;return a;function a(p){return(p===72||p===104)&&wI.call(r,r.previous)&&!w0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Fr(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),o?m:(o=!0,d)):n(p)}function m(p){return p===null||um(p)||En(p)||ia(p)||Wm(p)?n(p):e.attempt(xI,e.attempt(vI,h),n)(p)}function h(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Y7(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function X7(e,t,n){let r,i,o;return a;function a(m){return m===46||m===95?e.check(bI,d,c)(m):m===null||En(m)||ia(m)||m!==45&&Wm(m)?d(m):(o=!0,e.consume(m),a)}function c(m){return m===95?r=!0:(i=r,r=void 0),e.consume(m),a}function d(m){return i||r||!o?n(m):t(m)}}function K7(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(bI,t,o)(a):a===null||En(a)||ia(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function Z7(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),i):c===60||c===null||En(c)||ia(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||En(c)||ia(c)?t(c):r(c)}function o(c){return Fr(c)?a(c):n(c)}function a(c){re
Line truncated
|
||||
`),m=d.length>kH,h=m?d.length-ry*2:0,p=C.useCallback(()=>{navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),1500)},[a]);return u.jsxs("div",{className:"code-block-wrap",children:[u.jsxs("div",{className:"code-block-header",children:[u.jsxs("span",{className:"code-block-lang",children:[c||"code",m?` (${d.length} lines)`:""]}),u.jsx("button",{className:"code-block-copy",onClick:p,children:n?u.jsxs(u.Fragment,{children:[u.jsx(Pl,{})," ",u.jsx("span",{children:"Copied"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Dm,{})," ",u.jsx("span",{children:"Copy"})]})})]}),u.jsx("pre",{children:u.jsx("code",{className:e,children:m&&!i?u.jsxs(u.Fragment,{children:[d.slice(0,ry).join(`
|
||||
`)+`
|
||||
`,u.jsxs("span",{className:"code-block-omitted",onClick:()=>o(!0),children:["... +",h," lines (click to expand)"]}),`
|
||||
`+d.slice(-ry).join(`
|
||||
`)]}):a})}),m&&i&&u.jsxs("button",{className:"code-block-collapse-btn",onClick:()=>o(!1),children:["Collapse (",d.length," lines)"]})]})}const wH={code({className:e,children:t,...n}){return e?.startsWith("language-")?u.jsx(SH,{className:e,children:t}):u.jsx("code",{className:e,...n,children:t})}},CH=3e3,jH=60,iy=800;function Uw(e){if(e.length>CH)return!0;let t=0;for(let n=0;n<e.length;n++)if(e[n]===`
|
||||
`&&++t>=jH)return!0;return!1}function EH(e){const t=e.lastIndexOf(`
|
||||
`,iy);return e.slice(0,t>iy/2?t:iy)}const _r=It.memo(function({content:t,className:n="msg-content-agent",collapseMode:r="auto"}){const i=r!=="never"&&Uw(t),[o,a]=C.useState(i);C.useEffect(()=>{a(r!=="never"&&Uw(t))},[r,t]);const c=o?EH(t):t,d=t.split(`
|
||||
`).length,m=t.length;return u.jsxs("div",{className:n,children:[u.jsx(l$,{remarkPlugins:[_H],components:wH,children:c}),i&&o&&u.jsxs("button",{className:"msg-collapse-toggle",onClick:()=>a(!1),children:["Show more (",d," lines, ",(m/1e3).toFixed(1),"k chars)"]}),i&&!o&&u.jsx("button",{className:"msg-collapse-toggle",onClick:()=>a(!0),children:"Show less"})]})}),qw={native:"OpenOPC Native",codex:"Codex",claude_code:"Claude Code",cursor:"Cursor",opencode:"OpenCode"},Iu="codex",sy="native",NH=["codex","native","claude_code","cursor","opencode"],IH=["native","codex","claude_code","cursor","opencode"];function jI(e){if(!e)return{kind:"fallback"};if(e.kind==="employee"){const t=String(e.id??e.employee_id??"").trim();return t?{kind:"employee",id:t}:{kind:"fallback"}}if(e.kind==="template"){const t=String(e.id??e.template_id??"").trim();return t?{kind:"template",id:t}:{kind:"fallback"}}return{kind:"fallback"}}function EI(e){const t=jI(e);return t.kind==="fallback"?"fallback:":`${t.kind}:${t.id??""}`}function TH(e,t,n){const r=String(e.role_id??"").trim(),i=String(e.role_label??"").trim(),o=`${r} ${i} ${e.role_responsibility??""}`.toLowerCase(),a=new Set((e.same_role_employee_ids??[]).map(m=>String(m??"").trim()).filter(Boolean)),c=t.map(m=>{const h=String(m.employee_id??"").trim(),p=String(m.employee_name??h).trim()||h,g=String(m.role_id??"").trim(),x=String(m.category??"").trim(),v=[g,x].filter(Boolean).join(" · ")||h;return{kind:"employee",id:h,name:p,subtitle:v,category:x,searchText:`${h} ${p} ${g} ${x} ${(m.domains??[]).join(" ")} ${(m.tags??[]).join(" ")}`.toLowerCase(),rank:a.has(h)||g===r?0:2}}).filter(m=>m.id).sort((m,h)=>m.rank-h.rank||m.name.localeCompare(h.name)),d=n.map(m=>{const h=String(m.template_id??"").trim(),p=String(m.template_name??h).trim()||h,g=String(m.category??"").trim(),x=[g,h].filter(Boolean).join(" · ")||h,v=`${h} ${p} ${g} ${(m.domains??[]).join(" ")} ${(m.tags??[]).join(" ")}`.toLowerCase(),k=o.split(/[^a-z0-9]+/).filter(S=>S.length>=3).reduce((S,b)=>S+(v.includes(b)?1:0),0);return{kind:"template",id:h,name:p,subtitle:x,category:g,searchText:v,rank:k}}).filter(m=>m.id).sort((m,h)=>h.rank-m.rank||m.name.localeCompare(h.name));return[...c,...d,{kind:"fallback",id:"",name:"Fallback role-only",subtitle:"No employee override",category:"fallback",searchText:"fallback role only no employee override"}]}function RH(e,t){const n=EI(t);return e.find(r=>`${r.kind}:${r.id}`===n)??e[0]}function AH(e,t){const n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?!0:n.every(r=>e.searchText.includes(r))}function MH(e){return e.map(t=>{const n=String(t.role_id??"").trim(),r=String(t.existing_employee?.employee_id??"").trim(),i=String(t.candidate?.template_id??"").trim(),o=r?{kind:"employee",id:r}:i?{kind:"template",id:i}:{kind:"fallback"};return{role_id:n,role_label:t.role_labels?.[0]??n,role_responsibility:"",default_selection:o,same_role_employee_ids:t.existing_employee_ids??[],fallback_available:!0,default_agent:t.default_agent??Iu,selected_agent:t.selected_agent??t.default_agent??Iu,default_source:"recruitment"}}).filter(t=>t.role_id)}function DH(e,t){return t.kind==="template"&&e?.candidate?.template_id===t.id?e.candidate.proposed_name||e.candidate.template_name||t.name:t.kind==="employee"&&e?.existing_employee?.employee_id===t.id&&e.existing_employee.employee_name||t.name}function Gw(e,t){const n={},r=e.staffing_selections??{};for(const i of t){const o=String(i.role_id??"").trim();o&&(n[o]=jI(r[o]??i.default_selection))}return n}function Ww(e,t){const n=e.recruitment_role_agents??{},r={};for(const i of t){const o=String(i.role_id??"").trim();o&&(r[o]=n[o]??i.selected_agent??i.default_agent??Iu)}return r}function OH(e){return!!(String(e.checkpoint_response_message_id??"").trim()||String(e.checkpoint_responded_at??"").trim()||String(e.checkpoint_reply_kind??"").trim())}const LH=It.memo(function({meta:t,onReply:n,responded:r}){const i=t.proposals??[],o=C.useMemo(()=>{const D={};for(const M of i){const A=String(M.role_id??"").trim();A&&(D[A]=M)}return D},[i]),a=C.useMemo(()=>t.staffing_roles?.length?t.staffing_roles:MH(i),[t.staffing_roles,i]),c=t.staffing_pool?.employees??[],d=t.staffing_pool?.templates??[],m=t.recruitment_rationales??[],h=C.useMemo(()=>{const D={};for(const M of a){const A=String(M.role_id??"").trim();A&&(D[A]=TH(M,c,d))}return D},[c,a,d]),[p,g]=C.useState({}),[x,v]=C.useState(""),[k,S]=C.useState(()=>Gw(t,a)),[b,w]=C.useState(()=>Ww(t,a)),[j,N]=C.useState(t.recruitment_agent??sy),O=r;C.useEffect(()=>{!O||!OH(t)||(S(Gw(t,a)),w(Ww(t,a)),N(t.recruitment_agent??sy))},[O,t,a]),C.useEffect(()=>{N(t.recruitment_agent??sy)},[t.recruitment_agent]);const R=C.useCallback(D=>{const M=String(t.checkpoint_id??"").trim();if(!M)throw new Error("Recruitment checkpoint reply requires checkpoint_id metadata.");const A=String(t.checkpoint_type??"").trim();return{response_to_checkpoint_id:M,response_to_checkpoint_type:A||"company_recruitment_confirmation",checkpoint_reply_kind:D,staffin
Line truncated
|
||||
`).map(t=>t.trim()).find(Boolean)??e}function YH(e){switch(e){case"timeout":case"timed_out":case"expired":return"Expired";case"stale":case"invalid":return"Inactive";case"cancelled":case"canceled":return"Cancelled";case"resolved":return"Resolved";default:return"Responded"}}const Qw=It.memo(function({meta:t,onReply:n,responded:r}){const i=r,o=String(t.checkpoint_status??"").trim().toLowerCase(),a=YH(o),c=String(t.prompt??t.summary??""),d=C.useMemo(()=>c.split(`
|
||||
`).map(O=>O.trim()).filter(Boolean),[c]),m=WH(c).replace(/^\[[^\]]+\]\s*/,"")||"Action Required",h=d.slice(1).join(`
|
||||
`).trim(),p=String(t.summary??"").trim(),g=(t.options??[]).filter(O=>!!O?.id),x=C.useMemo(()=>(t.active_subagents??[]).filter(O=>!!O&&typeof O=="object"),[t.active_subagents]),v=C.useMemo(()=>(t.permission_requests??[]).filter(O=>!!O&&typeof O=="object"),[t.permission_requests]),k=String(t.worktree_path??"").trim(),S=x.length>0||v.length>0||!!k,[b,w]=C.useState(""),j=!!b&&!i;C.useEffect(()=>{if(!j)return;const O=window.setTimeout(()=>w(""),GH);return()=>window.clearTimeout(O)},[j,b]);const N=C.useCallback(O=>{i||j||(w(O.id),n(O.label||O.id))},[i,j,n]);return u.jsxs("div",{className:"ckpt-panel ckpt-escalation",children:[u.jsxs("div",{className:"ckpt-header",children:[u.jsx("div",{className:"ckpt-icon ckpt-icon-escalation",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M8 1.5L14.5 13H1.5L8 1.5Z"}),u.jsx("path",{d:"M8 5.5V9"}),u.jsx("circle",{cx:"8",cy:"11.5",r:"0.75",fill:"currentColor",stroke:"none"})]})}),u.jsx("div",{className:"ckpt-title",children:m}),u.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:String(t.escalation_type??"decision_needed").replace(/_/g," ")}),i&&u.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:a})]}),p&&p!==m&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Summary"}),u.jsx(_r,{content:p,className:"ckpt-markdown"})]}),h&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Request"}),u.jsx(_r,{content:h,className:"ckpt-markdown"})]}),S&&u.jsxs("details",{className:"ckpt-runtime-details",children:[u.jsx("summary",{children:"Runtime State"}),u.jsxs("div",{className:"ckpt-runtime-body",children:[k&&u.jsxs("div",{children:["Worktree: ",u.jsx("code",{children:k})]}),x.length>0&&u.jsxs("div",{children:["Active subagents: ",x.length]}),v.length>0&&u.jsxs("div",{children:["Pending permission records: ",v.length]})]})]}),!i&&g.length>0&&u.jsx("div",{className:"ckpt-actions ckpt-escalation-actions",children:g.map(O=>u.jsx("button",{className:`ckpt-btn ${O.id.includes("deny")?"ckpt-btn-deny":"ckpt-btn-approve"}${j?" ckpt-btn-submitting":""}`,onClick:()=>N(O),disabled:j,children:j&&b===O.id?"Submitting…":O.label||O.id},O.id))}),j&&u.jsx("div",{className:"ckpt-escalation-hint",children:"Decision sent — waiting for server confirmation…"}),!i&&t.default_action&&u.jsxs("div",{className:"ckpt-escalation-hint",children:["Default on timeout: ",u.jsx("code",{children:t.default_action})]})]})});function XH(e){return e.split(`
|
||||
`).map(t=>t.trim()).find(Boolean)??e}function KH(e){switch(e){case"ignored":return"Ignored";case"timeout":case"timed_out":case"expired":return"Expired";case"stale":case"invalid":return"Inactive";case"superseded":return"Superseded";case"cancelled":case"canceled":return"Cancelled";case"resolved":return"Resolved";default:return"Responded"}}const ZH=It.memo(function({meta:t,onReply:n,responded:r}){const i=r,[o,a]=C.useState(""),[c,d]=C.useState(null),m=String(t.checkpoint_status??"").trim().toLowerCase(),h=KH(m),p=String(t.prompt??t.summary??"").trim(),x=`${String(t.work_item_projection_title??XH(p)??"Human Review").trim()||"Human Review"} (for self-evolution)`,v=String(t.summary??"").trim(),k=C.useMemo(()=>(t.active_subagents??[]).filter(I=>!!I&&typeof I=="object"),[t.active_subagents]),S=C.useMemo(()=>(t.permission_requests??[]).filter(I=>!!I&&typeof I=="object"),[t.permission_requests]),b=String(t.worktree_path??"").trim(),w=k.length>0||S.length>0||!!b,j=i||c!==null,N=C.useCallback((I,D="")=>{const M=String(t.checkpoint_id??"").trim();if(!M)throw new Error("Delivery self-evolution reply requires checkpoint_id metadata.");const A={response_to_checkpoint_id:M,response_to_checkpoint_type:"company_delivery_feedback",checkpoint_reply_kind:I};return(I==="approve"||I==="feedback")&&(A.self_evolution_trigger=!0,A.human_feedback_text=D),A},[t.checkpoint_id]),O=C.useCallback(()=>{if(j)return;const I=N("approve");d("approve"),n("I fully agree with this delivery.",I)},[j,N,n]),R=C.useCallback(()=>{const I=o.trim();if(j||!I)return;const D=N("feedback",I);d("feedback"),n(I,D),a("")},[j,N,o,n]),L=C.useCallback(()=>{if(j)return;const I=N("ignore");d("ignore"),n("Ignore this self-evolution review.",I)},[j,N,n]);return u.jsxs("div",{className:"ckpt-panel ckpt-delivery-feedback",children:[u.jsxs("div",{className:"ckpt-header",children:[u.jsx("div",{className:"ckpt-icon ckpt-icon-user-input",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M8 1.5L14 5v4.5c0 2.25-1.8 4.25-6 5-4.2-.75-6-2.75-6-5V5L8 1.5Z"}),u.jsx("path",{d:"M5.5 8.25L7.25 10l3.25-4"})]})}),u.jsx("div",{className:"ckpt-title",children:x}),u.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:String(t.feedback_scope??"final").replace(/_/g," ")}),i&&u.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:h})]}),v&&v!==x&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Summary"}),u.jsx(_r,{content:v,className:"ckpt-markdown"})]}),p&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Review Request"}),u.jsx(_r,{content:p,className:"ckpt-markdown"})]}),w&&u.jsxs("details",{className:"ckpt-runtime-details",children:[u.jsx("summary",{children:"Runtime State"}),u.jsxs("div",{className:"ckpt-runtime-body",children:[b&&u.jsxs("div",{children:["Worktree: ",u.jsx("code",{children:b})]}),k.length>0&&u.jsxs("div",{children:["Active subagents: ",k.length]}),S.length>0&&u.jsxs("div",{children:["Pending permission records: ",S.length]})]})]}),!i&&u.jsxs("div",{className:"ckpt-actions ckpt-actions-inline-feedback",children:[u.jsx("button",{className:"ckpt-btn ckpt-btn-approve",onClick:O,disabled:j,children:"Fully Agree"}),u.jsx("button",{className:"ckpt-btn ckpt-btn-cancel",onClick:L,disabled:j,children:"Ignore"}),u.jsx("textarea",{className:"ckpt-feedback-input ckpt-feedback-inline-input",placeholder:"Feedback for self-evolution...",value:o,onChange:I=>a(I.target.value),disabled:j,rows:2}),u.jsx("button",{className:"ckpt-btn ckpt-btn-feedback",onClick:R,disabled:j||!o.trim(),children:"Send Feedback"})]})]})}),mf="__other__",QH=["A","B","C"];function ts(e){return String(e??"").trim()}function JH(e,t){const n=ts(e.question),r=ts(e.header);if(!n&&!r)return null;const i=(e.options??[]).slice(0,3).map((o,a)=>({id:ts(o.id)||String.fromCharCode(97+a),label:ts(o.label),description:ts(o.description)})).filter(o=>o.label);return{id:ts(e.id)||`question_${t+1}`,header:r,question:n||r,options:i,allow_freeform:e.allow_freeform!==!1,required:e.required!==!1}}const eF=It.memo(function({meta:t,onReply:n,responded:r}){const[i,o]=C.useState(""),[a,c]=C.useState({}),d=r,m=String(t.work_item_projection_title??t.work_item_projection_id??"Input Needed").trim()||"Input Needed",h=String(t.summary??"").trim(),p=String(t.prompt??"").trim(),g=String(t.context_note??"").trim(),x=String(t.resume_hint??"").trim(),v=C.useMemo(()=>(t.questions??[]).map(U=>String(U).trim()).filter(Boolean),[t.questions]),k=C.useMemo(()=>(t.input_questions??[]).map((U,Y)=>JH(U,Y)).filter(U=>U!==null),[t.input_questions]),S=k.some(U=>(U.options??[]).length>0),b=C.useMemo(()=>(t.required_fields??[]).map(U=>String(U).trim()).filter(Boolean),[t.required_fields]),w=C.useMemo(()=>(t.active_subagents??[]).filter(U=>!!U&&typeof U=="object"),[t.active_subagents]),j=C.useMemo((
Line truncated
|
||||
`),{user_input_answers:U})},[a,B,k,d,n]);return u.jsxs("div",{className:"ckpt-panel ckpt-user-input",children:[u.jsxs("div",{className:"ckpt-header",children:[u.jsx("div",{className:"ckpt-icon ckpt-icon-user-input",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M3 3.5h10v6H6.5L3 13V3.5Z"}),u.jsx("path",{d:"M5.5 6h5"}),u.jsx("path",{d:"M5.5 8h3.5"})]})}),u.jsx("div",{className:"ckpt-title",children:m}),u.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:"awaiting input"}),d&&u.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:"Responded"})]}),h&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Summary"}),u.jsx(_r,{content:h,className:"ckpt-markdown"})]}),p&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Request"}),u.jsx(_r,{content:p,className:"ckpt-markdown"})]}),S?u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Questions"}),u.jsx("div",{className:"ckpt-choice-list",children:k.map(U=>{const Y=a[U.id]??{freeformText:""},Q=U.options??[],q=U.allow_freeform!==!1,G=q&&(Q.length===0||Y.selectedOptionId===mf);return u.jsxs("div",{className:"ckpt-choice-question",children:[U.header&&u.jsx("div",{className:"ckpt-question-header",children:U.header}),u.jsx(_r,{content:U.question,className:"ckpt-markdown"}),Q.length>0&&u.jsxs("div",{className:"ckpt-choice-grid",children:[Q.map((J,P)=>{const K=Y.selectedOptionId===J.id;return u.jsxs("button",{className:`ckpt-choice-option${K?" is-selected":""}`,onClick:()=>A(U.id,J.id),children:[u.jsx("span",{className:"ckpt-choice-letter",children:QH[P]??"?"}),u.jsxs("span",{className:"ckpt-choice-copy",children:[u.jsx("span",{className:"ckpt-choice-label",children:J.label}),J.description&&u.jsx("span",{className:"ckpt-choice-desc",children:J.description})]})]},J.id)}),q&&u.jsxs("button",{className:`ckpt-choice-option${Y.selectedOptionId===mf?" is-selected":""}`,onClick:()=>A(U.id,mf),children:[u.jsx("span",{className:"ckpt-choice-letter",children:"D"}),u.jsxs("span",{className:"ckpt-choice-copy",children:[u.jsx("span",{className:"ckpt-choice-label",children:"Other"}),u.jsx("span",{className:"ckpt-choice-desc",children:"Enter a custom answer"})]})]})]}),G&&u.jsx("textarea",{className:"ckpt-feedback-input ckpt-other-field",placeholder:"Type your answer...",value:Y.freeformText,onChange:J=>$(U.id,J.target.value),rows:3})]},U.id)})})]}):v.length>0&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Questions"}),u.jsx("ul",{className:"ckpt-task-list",children:v.map(U=>u.jsx("li",{children:U},U))})]}),b.length>0&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Required Fields"}),u.jsx("div",{className:"ckpt-task-tags",children:b.map(U=>u.jsx("span",{className:"ckpt-field-tag",children:U},U))})]}),g&&u.jsxs("div",{className:"ckpt-section",children:[u.jsx("div",{className:"ckpt-section-title",children:"Context"}),u.jsx(_r,{content:g,className:"ckpt-markdown ckpt-markdown-muted"})]}),x&&u.jsx("div",{className:"ckpt-escalation-hint",children:x}),M&&u.jsxs("details",{className:"ckpt-runtime-details",children:[u.jsx("summary",{children:"Runtime State"}),u.jsxs("div",{className:"ckpt-runtime-body",children:[O&&u.jsxs("div",{children:["Requester: ",u.jsx("code",{children:O})]}),L&&u.jsxs("div",{children:["Work item: ",u.jsx("code",{children:L})]}),R&&u.jsxs("div",{children:["Task: ",u.jsx("code",{children:R})]}),I&&u.jsxs("div",{children:["Seat: ",u.jsx("code",{children:I})]}),N&&u.jsxs("div",{children:["Worktree: ",u.jsx("code",{children:N})]}),w.length>0&&u.jsxs("div",{children:["Active subagents: ",w.length]}),j.length>0&&u.jsxs("div",{children:["Pending permission records: ",j.length]})]})]}),!d&&u.jsxs("div",{className:"ckpt-feedback-area",children:[S?null:u.jsx("textarea",{className:"ckpt-feedback-input",placeholder:"Reply with the missing input to continue...",value:i,onChange:U=>o(U.target.value),rows:3}),u.jsx("div",{className:"ckpt-feedback-btns",children:u.jsx("button",{className:"ckpt-btn ckpt-btn-approve",onClick:S?H:V,disabled:S?!B:!i.trim(),children:"Send Reply"})})]})]})}),ov={todo:"To do",in_progress:"In progress",in_review:"In review",done:"Done"};function ay(e,t){if(t&&t in ov)return t;switch(e){case"active":return"in_progress";case"waiting":return"in_review";case"done":return"done";case"failed":return"done";case"pending":return"todo";default:return"todo"}}function pf(e){return ov[e]??ov.todo}const Jw={active:0,waiting:1,failed:2,done:3,pending:4};function tF(e){if(e.length===0)return"pending";let t=e[0],n=Jw[t]??99;for(const r of e){const i=Jw[r]??99;i<n&&(t=r,n=i)}return t}const nF={native:"Native",codex:"Codex",claude_code:"Claude Code",cursor
Line truncated
|
||||
`)[0].slice(0,140),tone:"danger"};const o=t.match(/^\[Company:([^\]]+)\]\s*(.+)$/);if(o){const d=o[1].split("::"),m=d[0]||"company",h=o[2].trim(),p=h.toLowerCase(),g=p.includes("completed")||p.includes("done")?"success":p.includes("blocked")||p.includes("failed")?"warning":"info";return{kind:"company_event",label:`${m.toUpperCase()} · ${d[1]??""}`.replace(/ · $/,""),summary:h,tone:g}}const a=t.match(/^(Review needed|Status digest|Blocked|Completion):\s*(.+)$/i);if(a){const d=a[1].replace(/\b\w/g,h=>h.toUpperCase()),m=fu(a[2]);return{kind:"company_event",label:d,summary:m,tone:/^Blocked$/i.test(a[1])?"warning":"info"}}const c=t.match(/^NO_DELEGATION_JUSTIFICATION:\s*(.+)$/i);return c?{kind:"company_event",label:"Delegation check",summary:fu(c[1]).slice(0,180),tone:"info"}:null}function AF(e,t){const{isCompanyRuntime:n,detailMode:r}=t;if(!n||r==="full"||vl(e.metadata))return null;const i=MI(e.content);if(!i)return null;const o=e.sender==="system"||e.metadata?.type==="system",a=i.kind==="company_event"||e.content.startsWith("[Company:");return!o&&!a?null:{msg:e,classification:i}}function MF(e,t={}){const{isCompanyRuntime:n=!1,detailMode:r="summary"}=t,i=[];let o=[],a=0;const c=new Set,d=new Set,m=()=>{if(o.length===0)return;const h=o[0].msg;i.push({kind:"ops-bundle",id:`ops:${yo(h)}`,timestamp:h.timestamp,events:o,sortOrder:a}),o=[]};return e.forEach((h,p)=>{const g=p*2+1,x=AF(h,{isCompanyRuntime:n,detailMode:r});if(x){o.length===0&&(a=g),o.push(x);return}const v=r==="summary"?AI(h.content):null;if(v){const k=[h.sender,Math.round(h.timestamp/1e3),v.kind,fu(v.summary||v.acceptanceSummary||"").slice(0,500),v.verdict??"",v.deliverables.map(S=>`${S.name}:${S.path}`).join("|").slice(0,800)].join("");if(c.has(k))return;c.add(k)}if(r==="summary"&&!vl(h.metadata)){const k=fu(_F(h.content)).slice(0,1200);if(k){const S=kF(h)?["result",k].join(""):[h.sender,Math.round(h.timestamp/1e3),k].join("");if(d.has(S))return;d.add(S)}}m(),i.push({kind:"message",id:yo(h),timestamp:h.timestamp,msg:h,sortOrder:g})}),m(),i}const DF=It.memo(function({msg:t,showDate:n,dateStr:r,classification:i}){const[o,a]=C.useState(!1),c=t.content.trim()!==`[${i.label}] ${i.summary}`.trim()&&t.content.trim().length>i.summary.length+4;return u.jsxs("div",{children:[n&&u.jsx("div",{className:"msg-date-sep",children:u.jsx("span",{children:r})}),u.jsxs("div",{className:`msg-ops-row msg-ops-tone-${i.tone}${o?" expanded":""}`,onClick:c?()=>a(d=>!d):void 0,role:c?"button":void 0,tabIndex:c?0:-1,children:[u.jsx("span",{className:"msg-ops-dot","aria-hidden":"true"}),u.jsx("span",{className:"msg-ops-label",children:i.label}),i.summary&&u.jsx("span",{className:"msg-ops-summary",title:i.summary,children:i.summary}),u.jsx("span",{className:"msg-ops-time",title:zs(t.timestamp),children:Co(t.timestamp)}),c&&u.jsx("span",{className:`msg-ops-chevron${o?" open":""}`,"aria-hidden":"true",children:u.jsx(ss,{down:o})})]}),c&&o&&u.jsx("div",{className:"msg-ops-details",children:u.jsx("pre",{className:"msg-ops-details-pre",children:t.content})})]})}),OF=It.memo(function({events:t,showDate:n,dateStr:r}){const[i,o]=C.useState(!1);if(t.length===0)return null;const a=t[0].msg,c=t[t.length-1].msg,d=t.reduce((p,g)=>{const x=g.classification.kind==="company_event"?"company":g.classification.kind.startsWith("external")?"runtime":"delegation";return p[x]=(p[x]??0)+1,p},{}),m=Object.entries(d).map(([p,g])=>`${g} ${p}`).join(" · "),h=`${t.length} technical event${t.length===1?"":"s"} hidden`;return u.jsxs("div",{children:[n&&u.jsx("div",{className:"msg-date-sep",children:u.jsx("span",{children:r})}),u.jsxs("button",{type:"button",className:`msg-ops-bundle${i?" expanded":""}`,onClick:()=>o(p=>!p),title:`${zs(a.timestamp)} - ${zs(c.timestamp)}`,children:[u.jsx("span",{className:"msg-ops-bundle-dot"}),u.jsx("span",{className:"msg-ops-bundle-title",children:h}),u.jsx("span",{className:"msg-ops-bundle-summary",children:m}),u.jsx("span",{className:"msg-ops-bundle-time",children:Co(a.timestamp)}),u.jsx("span",{className:"msg-ops-bundle-chevron",children:u.jsx(ss,{down:i})})]}),i&&u.jsx("div",{className:"msg-ops-bundle-details",children:t.map(({msg:p,classification:g})=>u.jsxs("div",{className:`msg-ops-bundle-event msg-ops-tone-${g.tone}`,children:[u.jsx("span",{className:"msg-ops-dot"}),u.jsx("span",{className:"msg-ops-label",children:g.label}),u.jsx("span",{className:"msg-ops-summary",children:g.summary}),u.jsx("span",{className:"msg-ops-time",title:zs(p.timestamp),children:Co(p.timestamp)})]},p.id))})]})});function LF(e){return e.kind==="review"?`Review · ${e.verdict?e.verdict.replace(/_/g," "):"review"}`:e.kind==="report"?"Report":"Update"}const zF=It.memo(function({msg:t,payload:n,showDate:r,dateStr:i,isCopied:o,onCopy:a}){const c=RI(t.sender==="system"?t.senderName||"OPC":t.sender),d=t.senderDeleted?"[Deleted]":t.senderName,m=LF(n),h=n.summary||n.acceptanceSummary||m;return u.jsxs("div",{children:[r&&u.jsx("div",{className:"msg-date-sep",children:u.jsx("span",{children:i})}),u.
Line truncated
|
||||
|
||||
Set up at least one role before running a task.
|
||||
|
||||
Go to Org tab now?`)&&n?.(),!1;if(a.length>1&&!c)return confirm(`Your organization has multiple top-level roles but no final decider selected.
|
||||
|
||||
Choose one final decider in the Org tab before running a task.
|
||||
|
||||
Go to Org tab now?`)&&n?.(),!1;const d=[],m=new Set(r.map(x=>x.role_id));o.runtimeTeams.filter(x=>x.member_role_ids.some(v=>m.has(v))||x.manager_role_id&&m.has(x.manager_role_id)).length===0&&d.push("No runtime teams defined — the system will auto-generate from your roles");const p=new Set(i.map(x=>x.role_id)),g=r.filter(x=>!p.has(x.role_id));if(g.length>0){const x=g.map(v=>v.name).join(", ");d.push(`${g.length} role(s) have no employees: ${x}`)}return d.length>0?confirm(`Before running this task:
|
||||
|
||||
`+d.map(x=>"• "+x).join(`
|
||||
`)+`
|
||||
|
||||
Run anyway?`):!0}function hV(e){if(!e)return!1;const t=Gm(e);return!!(t.projectRun?.run_id||t.runtimeTeams.length>0||t.runtimeSeats.length>0)}function gV(e,t){return e?e.execMode==="company"||e.execMode==="org"||e.execMode==="custom"?"summary":"full":"summary"}function yy(e,t=0){if(!e)return!1;const n=String(e.execMode??"").trim().toLowerCase();return t>0||!!e.isCompanyRuntime||!!e.roleWorkItems||!!e.executorRoleWorkItems||n==="company"||n==="org"||n==="custom"}function xC(e){return String(e?.originTaskId??e?.taskId??"").trim()||null}function yV({boardColor:e,title:t,onCommit:n}){const[r,i]=C.useState(!1),[o,a]=C.useState(t),c=C.useRef(null);C.useEffect(()=>{r||a(t)},[t,r]);const d=C.useCallback(()=>{const h=o.trim();h&&h!==t?n(h):a(t),i(!1)},[o,t,n]),m=C.useCallback(()=>{a(t),i(!0),setTimeout(()=>c.current?.select(),0)},[t]);return u.jsx("div",{className:"board-selector",children:u.jsx("div",{className:"board-tabs",children:u.jsxs("span",{className:"board-tab active board-tab-editable",style:{"--board-color":e},children:[u.jsx("span",{className:"board-tab-dot",style:{background:e}}),r?u.jsx("input",{ref:c,className:"board-tab-title-input",value:o,onChange:h=>a(h.target.value),onBlur:d,onKeyDown:h=>{h.key==="Enter"&&d(),h.key==="Escape"&&(a(t),i(!1))}}):u.jsx("span",{className:"board-tab-title",onClick:m,title:"Click to edit session title",children:t})]})})})}function xV({boardStore:e,agents:t,officeMap:n,execMode:r,companyProfile:i,taskPreferredAgent:o,chatStore:a,sessionStore:c,projectId:d,onRunTask:m,onCreateTask:h,onMoveTask:p,onCreateSession:g,onSessionSend:x,onSecretarySend:v,onDeleteSession:k,onTitleChange:S,onSessionConfigChange:b,onSessionTaskAgentChange:w,onContinueInNewChat:j,onSessionStop:N,onSessionResume:O,onSessionComplete:R,onLoadSessionDetail:L,onOpenExecutionPanel:I,onCollabSync:D,orgInfoData:M,onNavigateToOrg:A,recoveryStatus:$,onRecoveryResume:W,onRecoveryCancel:B,commsState:V,commsMessage:H,onCommsRefresh:U,onCommsReadMessage:Y,savedOrgsList:Q,activeSavedOrg:q,onSavedOrgsList:G,onSavedOrgLoad:J}){const{sessions:P,activeSessionId:K,activeSession:ee}=c,{markRead:te}=a,[ie,se]=C.useState("collapsed"),{width:de,isResizing:oe,handleMouseDown:Ne}=fV({initialWidth:380,minWidth:300,maxWidth:600,onCollapse:()=>se("collapsed")}),[Ee,Ie]=C.useState("chat"),[Be,Ge]=C.useState(null),[Ue,at]=C.useState({kind:"activity"}),[Pt,wt]=C.useState([]),[Ct,pe]=C.useState(!1),[$e,et]=C.useState({}),tt=C.useRef(L),pt=C.useRef(P),me=C.useRef(a.getChannelMessages),be=C.useRef({scope:null,active:new Set,child:null}),Me=C.useRef(new Set),Fe=C.useRef(0);pt.current=P,me.current=a.getChannelMessages;const He=r==="company"||r==="org"||r==="custom",jt=`secretary:${d}`,an=`activity:${d}`,ke=C.useMemo(()=>Be?P.find(ue=>ue.taskId===Be)??null:null,[P,Be]),Oe=C.useMemo(()=>Ue.kind!=="task-detail"?null:e.tasks.find(ue=>ue.id===Ue.taskId)??null,[Ue,e.tasks]),We=C.useMemo(()=>{const ue=qm(Oe);return ue?P.find(Se=>Se.taskId===ue||Se.runtimeTaskId===ue||Se.executionTurnId===ue)??null:null},[P,Oe]),Ze=C.useMemo(()=>We?a.getChannelMessages(We.channelId):[],[a.messages,a.getChannelMessages,We]),qe=C.useMemo(()=>Df(ee,P),[P,ee]),ut=C.useMemo(()=>Xf(ee,P),[P,ee]),Yt=C.useMemo(()=>Kf(ee,[...ut,...qe]),[ee,qe,ut]);C.useEffect(()=>{tt.current=L},[L]);const Nn=C.useCallback((ue,Se,Pe="summary")=>{const ae=tt.current;if(!ae||!ue)return;const ve=Fe.current,Le=pt.current.find(un=>un.taskId===ue)?.channelId,vt=Se&&Le&&Se.channelId!==Le?me.current(Le).find(un=>Wf(un,Pe)):Se,ct=[ve,ue,Pe,vt?.timestamp??"latest",vt?.id??""].join("|");if(Me.current.has(ct))return;Me.current.add(ct),et(un=>un[ue]?un:{...un,[ue]:!0});let dt;try{dt=ae(ue,{limit:mV,beforeCreatedAt:vt?.timestamp,beforeMessageId:vt?.id,detailLevel:Pe})}catch{Me.current.delete(ct),Fe.current===ve&&(et(zn=>zn[ue]?{...zn,[ue]:!1}:zn),be.current.active.delete(`${ue}:${Pe}`),be.current.child===ue&&(be.current.child=null));return}return Promise.resolve(dt).catch(()=>{Fe.current===ve&&(be.current.active.delete(`${ue}:${Pe}`),be.current.child===ue&&(be.current.child=null))}).finally(()=>{if(Me.current.delete(ct),Fe.current!==ve)return;const un=`${ve}|${ue}|`;[...Me.current.keys()].some(qt=>qt.startsWith(un))||et(qt=>qt[ue]?{...qt,[ue]:!1}:qt)})},[]),ln=C.useCallback(ue=>!!$e[ue],[$e]);C.useLayoutEffect(()=>{Fe.current+=1,Me.current.clear(),be.current={scope:null,active:new Set,child:null},et({})},[d]),C.useEffect(()=>()=>{Fe.current+=1,Me.current.clear()},[]),C.useEffect(()=>{Be&&!ke&&Ge(null)},[Be,ke]),C.useEffect(()=>{Ue.kind==="task-detail"&&!Oe&&at({kind:"activity"})},[Ue,Oe]);const Ln=C.useRef(null);C.useEffect(()=>{if(!We){Ln.current=null;return}Ln.current!==We.taskId&&(Ln.current=We.taskId,Nn(We.taskId,void 0,"full"))},[We,Nn]),C.useEffect(()=>{if(!Be){be.current.child=null;return}be.current.child!==Be&&(be.current.child=Be,Nn(Be,void 0,"full"))},[Be,Nn]),C.useEffect(()=>{if(!K){be.current.scope=null,be.current.active.clear();return}be.current.scope!==K&&(be.current.scope=K,be.current.
Line truncated
|
||||
`).replace(/\r/g,`
|
||||
`).split(`
|
||||
`).map(i=>i.trimEnd()).join(`
|
||||
`).replace(/\n{3,}/g,`
|
||||
|
||||
`).trim(),n=bV(t),r=n.split(/\n{2,}/).map(i=>i.trim()).filter(Boolean);return r.length>1&&/^Verification:\s/i.test(r[r.length-1])?r.slice(0,-1).join(`
|
||||
|
||||
`).trim():n}function bV(e){const t=String(e||"").trim(),n=t.match(/^\*\*(.{8,160}?)\*\*:\s+([\s\S]+)$/);if(n){const a=n[2].trim();if(a.length>=80)return a}const r=t.indexOf(": ");if(r<8||r>160)return t;const i=t.slice(0,r).replace(/\*/g,"").trim(),o=t.slice(r+2).trim();return o.length<80||!/[A-Za-z\u4e00-\u9fff]/.test(i)||/^(https?|file)$/i.test(i)?t:o}function El(e){const t=Pi(e),n=new Set,r=typeof t.checkpoint_type=="string"?t.checkpoint_type.trim():"",i=typeof t.checkpoint_id=="string"?t.checkpoint_id.trim():"";for(const o of[e.id,typeof t.ui_message_id=="string"?t.ui_message_id:"",r&&i?`checkpoint:${r}:${i}`:""]){const a=String(o??"").trim();a&&n.add(a)}return n}function sl(e){return new Set([...El(e)].map(t=>`${e.channelId}\0${t}`))}function _V(e){return e.startsWith("checkpoint:")}function cr(e){return typeof e.timestamp=="number"?e.timestamp:0}function cv(e){return String(e.id??"").startsWith("msg-")}function PI(e){return!cv(e)}function bC(e){const t={};for(const n of e){if(!PI(n))continue;const r=cr(n);r>(t[n.channelId]??0)&&(t[n.channelId]=r)}return t}function kV(e,t,n){return n<=(e[t]??0)?e:{...e,[t]:n}}function SV(e,t){const n={};for(const r of e){if(!PI(r)||r.sender==="user")continue;const i=t[r.channelId]??0;cr(r)<=i||(n[r.channelId]=(n[r.channelId]??0)+1)}return n}function _C(e){const t=String(e.sender??"").trim().toLowerCase(),n=Pi(e),r=typeof n.role=="string"?n.role.trim().toLowerCase():"";return t==="user"||r==="user"?"user":"assistant"}function kC(e){const t=Pi(e),n=String(e.sender??"").trim().toLowerCase();let r=0;const i=BI(e);return i&&(r+=1e3+i),t.source==="engine"&&(r+=100),n&&n!=="system"&&(r+=20),n&&!["assistant","system","user"].includes(n)&&(r+=5),e.replyToId&&(r+=2),r+=Math.min(Object.keys(t).length,10),r}function SC(e){return String(Pi(e).source??"").trim().toLowerCase()==="engine"}function BI(e){const t=Pi(e),n=String(t.transcript_kind??"").trim();if(n)return vC[n]??0;const r=String(t.kind??"").trim();return vC[r]??0}function Nl(e){return BI(e)>0}function $I(e,t){if(e.channelId!==t.channelId)return!1;const n=El(e),r=El(t);for(const i of n)if(r.has(i))return!0;return!1}function hm(e,t){if($I(e,t))return!0;if(e.channelId!==t.channelId||_C(e)!==_C(t)||pm(e.content)!==pm(t.content))return!1;const n=Nl(e)&&Nl(t);if(!n&&String(e.replyToId??"")!==String(t.replyToId??"")||!(SC(e)||SC(t)))return!1;const r=cr(e),i=cr(t);return!(!n&&r&&i&&Math.abs(r-i)>E0)}function gm(e,t,n=!1){let r=e,i=t;const o=cv(e),a=cv(t);o!==a?(r=o?t:e,i=o?e:t):(n||kC(t)>kC(e))&&(r=t,i=e);const c=[];for(const j of[i.mentions,r.mentions])for(const N of j??[])c.includes(N)||c.push(N);const d=El(e),m=El(t);let h="";for(const j of d)if(m.has(j)&&!_V(j)){h=j;break}const p=pm(r.content),g=p&&p===pm(i.content)?p:r.content,x=String(Pi(e).checkpoint_id??"").trim(),v=String(Pi(t).checkpoint_id??"").trim(),k=!!x&&x===v,S=Nl(e)&&Nl(t),b=S?String(Pi(e).ui_timeline_id??Pi(t).ui_timeline_id??Lv(e)).trim():"",w={...Pi(i),...Pi(r)};return b&&(w.ui_timeline_id=b),{...i,...r,...h?{id:h}:{},content:g,metadata:w,mentions:c,timestamp:k||S?cr(e)||cr(t):cr(r)||cr(i)}}function wC(e){const t=[],n=new Map;for(const r of[...e].sort((i,o)=>cr(i)-cr(o))){const i=sl(r);let o=-1,a=!1;for(const d of i){const m=n.get(d);if(m!==void 0){o=m,a=t[m].id===r.id;break}}if(o===-1){const d=cr(r),m=Nl(r);for(let h=t.length-1;h>=0;h--){const p=cr(t[h]);if(!m&&d>0&&p>0&&d-p>E0)break;if(hm(t[h],r)){o=h;break}}}const c=o===-1?t.length:o;o===-1?t.push(r):t[o]=gm(t[o],r,a);for(const d of sl(t[c]))n.has(d)||n.set(d,c)}return t}function wV(e,t){const n=[...e],r=new Map;n.forEach((i,o)=>{for(const a of sl(i))r.set(a,o)});for(const i of[...t].sort((o,a)=>cr(o)-cr(a))){let o=-1;for(const a of sl(i)){const c=r.get(a);if(c!==void 0){o=c;break}}if(o<0){for(let a=n.length-1;a>=0;a-=1)if(hm(n[a],i)){o=a;break}}if(o<0)o=n.length,n.push(i);else{const a=n[o];n[o]=gm(a,i,a.id===i.id)}for(const a of sl(i))r.set(a,o);for(const a of sl(n[o]))r.set(a,o)}return n.sort((i,o)=>cr(i)===cr(o)?i.id.localeCompare(o.id):cr(i)-cr(o))}function CV(e,t){switch(t.type){case"SET":return t.channels;case"CLEAR":return[];case"ADD":return e.some(n=>n.id===t.channel.id)?e:[...e,t.channel];case"REMOVE":return e.filter(n=>n.id!==t.channelId);case"REMOVE_PARTICIPANT":return e.map(n=>({...n,participants:n.participants.filter(r=>r!==t.agentId)}));default:return e}}function jV(e,t){switch(t.type){case"SET":{const n=wC(t.messages);if(e.length===0)return n;const r=e.filter(i=>typeof i.id=="string"&&i.id.startsWith("msg-")&&!n.some(o=>hm(i,o)));return r.length===0?n:wC([...n,...r])}case"CLEAR":return[];case"ADD":{const n=cr(t.message);El(t.message);let r=!1;for(let i=e.length-1;i>=0;i--){const o=cr(e[i]);if(!r&&n>0&&o>0&&n-o>E0&&(r=!0),$I(e[i],t.message)){const a=[...e];return a[i]=gm(e[i],t.message,e[i].id===t.message.id),a}if((Nl(t.message)||!r)&&hm(e[i],t.message)){const a=[...e];return a[i]=gm(e[i],t.message),a}}return[...e,t.message]}case"MERGE":return t.messages.length===0?e:wV(e,t.messages);case"MARK_
Line truncated
|
||||
${t}`:`${e}${t}`}function NV(e,t){const n=e.trim().replace(/\s+/g," ");return n?n.length>120?`${n.slice(0,120).trimEnd()}...`:n:t||"Thinking"}function IV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,summary:typeof e.summary=="string"?e.summary:"",detail:typeof e.detail=="string"&&e.detail?e.detail:void 0,turnId:typeof e.turnId=="string"&&e.turnId?e.turnId:void 0,itemId:typeof e.itemId=="string"&&e.itemId?e.itemId:void 0,streamId:typeof e.streamId=="string"&&e.streamId?e.streamId:void 0,toolCallId:typeof e.toolCallId=="string"&&e.toolCallId?e.toolCallId:void 0,permissionGroupKey:typeof e.permissionGroupKey=="string"&&e.permissionGroupKey?e.permissionGroupKey:void 0,seq:typeof e.seq=="number"&&Number.isFinite(e.seq)?e.seq:void 0,executionMode:typeof e.executionMode=="string"&&e.executionMode?e.executionMode:void 0}}function ym(e){const t=e.itemId||e.streamId;return t?`${e.type}:${e.turnId??""}:${t}`:e.toolCallId&&(e.type==="tool_call"||e.type==="autonomy")?`${e.type}:${e.turnId??""}:${e.toolCallId}`:e.permissionGroupKey&&e.type==="autonomy"?`${e.type}:${e.turnId??""}:${e.permissionGroupKey}`:""}function TV(e,t){const n=ym(e),r=ym(t);return n&&r?n===r:t.timestamp-e.timestamp>Qm||e.type!==t.type?!1:e.type==="thinking"||e.type==="assistant"?!0:e.type==="tool_call"?e.summary===t.summary:!1}function RV(e,t){return t.timestamp-e.timestamp<=Qm&&e.type===t.type&&e.summary===t.summary&&(e.detail??"")===(t.detail??"")}function AV(e,t){if(e.type==="thinking"||e.type==="assistant"){const n=uv(e.detail??"",t.detail??"","thinking");return{timestamp:e.timestamp,type:e.type,summary:NV(n,t.summary||e.summary),detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}if(e.type==="tool_call"){const n=uv(e.detail??"",t.detail??"","tool_call");return{timestamp:e.timestamp,type:"tool_call",summary:t.summary||e.summary,detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}return t}function HI(e,t,n=100){const r=IV(t),i=ym(r),o=i?[...e].reverse().findIndex(d=>ym(d)===i):-1,a=o>=0?e.length-1-o:e.length-1,c=e[a];return c?i&&o>=0&&typeof c.seq=="number"&&typeof r.seq=="number"&&r.seq<=c.seq?e:RV(c,r)?ml([...e.slice(0,a),c,...e.slice(a+1)],n):TV(c,r)?ml([...e.slice(0,a),AV(c,r),...e.slice(a+1)],n):ml([...e,r],n):[r]}function FI(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,r)=>HI(n,r,t),[])}function MV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,workItemProjectionId:typeof e.workItemProjectionId=="string"&&e.workItemProjectionId?e.workItemProjectionId:void 0,workItemTurnType:typeof e.workItemTurnType=="string"&&e.workItemTurnType?e.workItemTurnType:void 0,workItemProjectionTitle:typeof e.workItemProjectionTitle=="string"&&e.workItemProjectionTitle?e.workItemProjectionTitle:void 0,runtimeTaskId:typeof e.runtimeTaskId=="string"&&e.runtimeTaskId?e.runtimeTaskId:void 0,executionTurnId:typeof e.executionTurnId=="string"&&e.executionTurnId?e.executionTurnId:void 0,roleName:typeof e.roleName=="string"&&e.roleName?e.roleName:void 0,detail:typeof e.detail=="string"&&e.detail?e.detail:void 0}}function VI(e,t){return e.type===t.type&&(e.workItemProjectionId??"")===(t.workItemProjectionId??"")&&(e.workItemTurnType??"")===(t.workItemTurnType??"")&&(e.workItemProjectionTitle??"")===(t.workItemProjectionTitle??"")&&(e.executionTurnId??e.runtimeTaskId??"")===(t.executionTurnId??t.runtimeTaskId??"")&&(e.roleName??"")===(t.roleName??"")}function DV(e,t){return t.timestamp-e.timestamp<=Qm&&VI(e,t)&&(e.type==="thinking"||e.type==="tool_call")}function OV(e,t){return VI(e,t)&&(e.detail??"")===(t.detail??"")&&t.timestamp-e.timestamp<=Qm}function LV(e,t){const n=t.type==="tool_call"?"tool_call":"thinking";return{...e,...t,timestamp:t.timestamp,detail:uv(e.detail??"",t.detail??"",n)||void 0}}function UI(e,t,n=100){const r=MV(t),i=e[e.length-1];return i?OV(i,r)?ml([...e.slice(0,-1),{...i,timestamp:r.timestamp}],n):DV(i,r)?ml([...e.slice(0,-1),LV(i,r)],n):ml([...e,r],n):[r]}function qI(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,r)=>UI(n,r,t),[])}function dv(e){const t=String(e??"").trim().toLowerCase();return t==="company"?"company":t==="org"||t==="custom"?"org":"task"}function zV(e){return String(e??"").trim().toLowerCase()==="custom"?"custom":"corporate"}function GI(e){const t=String(e.execMode??"").trim().toLowerCase(),n=String(e.companyProfile??"").trim().toLowerCase(),r=String(e.orgId??"").trim(),o=t.length>0?dv(t):n==="custom"||r?"org":dv(t);return o==="org"?{...e,execMode:"org",companyProfile:"custom",orgId:r||void 0}:o==="company"?{...e,execMode:"company"
Line truncated
|
||||
`)),[D,M]=C.useState(!1),A=C.useRef(e.role_id);C.useEffect(()=>{A.current!==e.role_id&&(A.current=e.role_id,d(e.name),h(e.responsibility),g(e.reports_to),v(e.icon??null),S(new Set(e.can_spawn)),w(new Set(e.tools)),N(e.runtime_policy?.execution_strategy??"auto"),R(e.preferred_external_agent??null),I((e.prompt_refs??[]).join(`
|
||||
`)),M(!1))},[e]);const $=C.useRef({}),W=C.useRef(null),B=C.useRef(e.role_id);C.useEffect(()=>{B.current=e.role_id},[e.role_id]);const V=C.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=null);const oe=$.current;$.current={},Object.keys(oe).length!==0&&i(B.current,oe)},[i]),H=C.useCallback(oe=>{r||($.current={...$.current,...oe},W.current&&clearTimeout(W.current),W.current=setTimeout(V,500))},[V,r]);C.useEffect(()=>()=>{W.current&&(clearTimeout(W.current),W.current=null);const oe=$.current;Object.keys(oe).length>0&&($.current={},i(B.current,oe))},[i]);const U=oe=>{d(oe),H({name:oe})},Y=oe=>{h(oe),H({responsibility:oe})},Q=oe=>{g(oe),H({reports_to:oe})},q=oe=>{v(oe),H({icon:oe})},G=oe=>{N(oe),H({execution_strategy:oe})},J=oe=>{R(oe),H({preferred_external_agent:oe})},P=oe=>{I(oe);const Ne=oe.split(`
|
||||
`).map(Ee=>Ee.trim()).filter(Boolean);H({prompt_refs:Ne})},K=oe=>{const Ne=new Set(k);Ne.has(oe)?Ne.delete(oe):Ne.add(oe),S(Ne),H({can_spawn:Array.from(Ne)})},ee=oe=>{const Ne=new Set(b);Ne.has(oe)?Ne.delete(oe):Ne.add(oe),w(Ne),H({tools:Array.from(Ne)})},te=C.useMemo(()=>t.filter(oe=>oe.role_id!==e.role_id),[t,e.role_id]),ie=C.useMemo(()=>n.filter(oe=>(oe.role_ids?.length?oe.role_ids:[oe.role_id]).includes(e.role_id)).length,[n,e.role_id]),se=C.useMemo(()=>L.split(`
|
||||
`).filter(oe=>oe.trim()).length,[L]),de=()=>{if(!D){M(!0);return}V(),o(e.role_id)};return u.jsxs("aside",{className:"ri-panel","aria-label":`Inspector for role ${e.name}`,children:[u.jsxs("header",{className:"ri-panel-header",children:[u.jsx("img",{src:Uu(x),alt:"",className:"ri-panel-icon"}),u.jsxs("div",{className:"ri-panel-title-wrap",children:[u.jsx("h3",{className:"ri-panel-title",children:c||"(unnamed)"}),u.jsx("code",{className:"ri-panel-id",children:e.role_id})]}),u.jsx("button",{className:"btn btn-ghost btn-sm ri-panel-close",onClick:a,title:"Close (Esc)",children:"✕"})]}),u.jsxs("div",{className:"ri-panel-body",children:[u.jsxs(Qa,{title:"Identity",defaultExpanded:!0,children:[u.jsx(ji,{label:"Name",children:u.jsx("input",{className:"ri-text-input",value:c,onChange:oe=>U(oe.target.value),disabled:r})}),u.jsx(ji,{label:"Responsibility",children:u.jsx("textarea",{className:"ri-textarea",rows:3,value:m,onChange:oe=>Y(oe.target.value),disabled:r})}),u.jsx(ji,{label:"Icon",children:u.jsx(cU,{value:x,onChange:q,readOnly:r})})]}),u.jsxs(Qa,{title:"Hierarchy",defaultExpanded:!0,children:[u.jsx(ji,{label:"Reports to",children:u.jsxs("select",{className:"ri-select",value:p,onChange:oe=>Q(oe.target.value),disabled:r,children:[u.jsx("option",{value:"owner",children:"You (Owner)"}),te.map(oe=>u.jsx("option",{value:oe.role_id,children:oe.name},oe.role_id))]})}),u.jsx(ji,{label:"Can delegate to",children:u.jsx(uU,{allIds:te.map(oe=>oe.role_id),labelFor:oe=>te.find(Ne=>Ne.role_id===oe)?.name??oe,selected:k,onToggle:K,readOnly:r})}),u.jsx(ji,{label:"Employees assigned",children:u.jsx("span",{className:"ri-meta-value",children:ie})})]}),u.jsx(Qa,{title:`Tools (${b.size})`,children:u.jsx(dU,{tools:b,onToggle:ee,readOnly:r})}),u.jsx(Qa,{title:`Prompts (${se})`,children:u.jsx(ji,{label:"Prompt refs / inline",children:u.jsx("textarea",{className:"ri-textarea ri-textarea-mono",rows:5,placeholder:"One prompt ref or inline instruction per line",value:L,onChange:oe=>P(oe.target.value),disabled:r})})}),u.jsxs(Qa,{title:"Runtime policy",children:[u.jsx(ji,{label:"Execution strategy",children:u.jsx("div",{className:"ri-radio-group",children:aU.map(oe=>u.jsxs("label",{className:"ri-radio",title:oe.hint,children:[u.jsx("input",{type:"radio",name:`exec-strategy-${e.role_id}`,value:oe.value,checked:j===oe.value,onChange:()=>G(oe.value),disabled:r}),oe.label]},oe.value))})}),j==="external"&&u.jsx(ji,{label:"Preferred external agent",children:u.jsxs("select",{className:"ri-select",value:O??"",onChange:oe=>J(oe.target.value||null),disabled:r,children:[u.jsx("option",{value:"",children:"(any)"}),oU.map(oe=>u.jsx("option",{value:oe,children:oe},oe))]})})]}),u.jsxs(Qa,{title:"Advanced",children:[u.jsx(ji,{label:"Role type",children:u.jsx("span",{className:"ri-meta-value",children:e.role_type??"worker"})}),u.jsx(ji,{label:"Skills",children:u.jsx("span",{className:"ri-meta-value",children:e.skill_refs&&e.skill_refs.length>0?e.skill_refs.join(", "):"(none)"})}),u.jsx(ji,{label:"Artifact contract",children:u.jsx("span",{className:"ri-meta-value",children:e.artifact_contract_ref??"(none)"})})]})]}),!r&&u.jsx("footer",{className:"ri-panel-footer",children:u.jsx("button",{className:`btn btn-sm ${D?"btn-danger":"btn-ghost"}`,onClick:de,onBlur:()=>M(!1),children:D?"Confirm delete?":"Delete role"})})]})}function Qa({title:e,defaultExpanded:t=!1,children:n}){const[r,i]=C.useState(t);return u.jsxs("section",{className:`ri-group${r?" is-expanded":""}`,children:[u.jsxs("button",{className:"ri-group-header",onClick:()=>i(o=>!o),children:[u.jsx("span",{className:"ri-group-caret",children:r?"▾":"▸"}),u.jsx("span",{className:"ri-group-title",children:e})]}),r&&u.jsx("div",{className:"ri-group-body",children:n})]})}function ji({label:e,children:t}){return u.jsxs("div",{className:"ri-field",children:[u.jsx("label",{className:"ri-field-label",children:e}),u.jsx("div",{className:"ri-field-control",children:t})]})}function cU({value:e,onChange:t,readOnly:n}){const[r,i]=C.useState(!1);return u.jsxs("div",{className:"ri-icon-picker",children:[u.jsxs("button",{className:"ri-icon-picker-trigger",onClick:()=>!n&&i(o=>!o),disabled:n,children:[u.jsx("img",{src:Uu(e),alt:"",className:"ri-icon-picker-current"}),u.jsx("span",{className:"ri-icon-picker-label",children:e??"generic"})]}),r&&u.jsxs("div",{className:"ri-icon-picker-popover",children:[u.jsx("button",{className:`ri-icon-option${e===null?" is-active":""}`,onClick:()=>{t(null),i(!1)},title:"Default icon",children:u.jsx("img",{src:mu.generic,alt:""})}),iU.filter(o=>o!=="generic").map(o=>u.jsx("button",{className:`ri-icon-option${e===o?" is-active":""}`,onClick:()=>{t(o),i(!1)},title:o,children:u.jsx("img",{src:mu[o],alt:o})},o))]})]})}function uU({allIds:e,labelFor:t,selected:n,onToggle:r,readOnly:i}){const[o,a]=C.useState(!1),c=e.filter(d=>!n.has(d));return u.jsxs("div",{className:"ri-multiselect",children:[u.jsxs("div",{className:"ri-chips",children:[Array.from(n).map(d=>u.jsxs("span",{className:"ri-ch
Line truncated
|
||||
font-size: .6rem;
|
||||
font-weight: bold;
|
||||
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return i}}function xt(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function pU(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:yt(()=>[e,n,t,o],(a,c,d,m)=>({table:a,column:c,row:d,cell:m,getValue:m.getValue,renderValue:m.renderValue}),xt(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function hU(e,t,n,r){var i,o;const c={...e._getDefaultColumnDef(),...t},d=c.accessorKey;let m=(i=(o=c.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof c.header=="string"?c.header:void 0,h;if(c.accessorFn?h=c.accessorFn:d&&(d.includes(".")?h=g=>{let x=g;for(const k of d.split(".")){var v;x=(v=x)==null?void 0:v[k]}return x}:h=g=>g[c.accessorKey]),!m)throw new Error;let p={id:`${String(m)}`,accessorFn:h,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:yt(()=>[!0],()=>{var g;return[p,...(g=p.columns)==null?void 0:g.flatMap(x=>x.getFlatColumns())]},xt(e.options,"debugColumns")),getLeafColumns:yt(()=>[e._getOrderColumnsFn()],g=>{var x;if((x=p.columns)!=null&&x.length){let v=p.columns.flatMap(k=>k.getLeafColumns());return g(v)}return[p]},xt(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(p,e);return p}const Or="debugHeaders";function IC(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const gU={createTable:e=>{e.getHeaderGroups=yt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const c=(o=r?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?o:[],d=(a=i?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?a:[],m=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(i!=null&&i.includes(p.id)));return xf(t,[...c,...m,...d],e)},xt(e.options,Or)),e.getCenterHeaderGroups=yt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),xf(t,n,e,"center")),xt(e.options,Or)),e.getLeftHeaderGroups=yt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return xf(t,o,e,"left")},xt(e.options,Or)),e.getRightHeaderGroups=yt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return xf(t,o,e,"right")},xt(e.options,Or)),e.getFooterGroups=yt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),xt(e.options,Or)),e.getLeftFooterGroups=yt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),xt(e.options,Or)),e.getCenterFooterGroups=yt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),xt(e.options,Or)),e.getRightFooterGroups=yt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),xt(e.options,Or)),e.getFlatHeaders=yt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Or)),e.getLeftFlatHeaders=yt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Or)),e.getCenterFlatHeaders=yt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Or)),e.getRightFlatHeaders=yt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Or)),e.getCenterLeafHeaders=yt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Or)),e.getLeftLeafHeaders=yt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Or)),e.getRightLeafHeaders=yt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Or)),e.getLeafHeaders=yt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,c,d,m;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[]].map(h=>h.getLeafHeaders()).flat()},xt(e.options,Or))}};function xf(e,t,n,r){var i,o;let a=0;const c=function(g,x){x===void 0&&(x=1),a=Math.max(a,x),g.filter(v=>v.getIsVisible()).forEach(v=>{var k;(k=v.columns)!=null&&k.length&&c(v.columns,x+1)},0)};c(e);let d=[];const m=(g,x)=>{const v={depth:x,id:[r,`${x}`].filter(Boolean).jo
Line truncated
|
||||
`).replace(`
|
||||
|
||||
`,`
|
||||
+`).split(`
|
||||
`)),h=m.reduce((p,g)=>p.concat(...g),[]);return[m,h]}return[[],[]]},[e]);return C.useEffect(()=>{const d=t?.target??_2,m=t?.actInsideInputWithModifier??!0;if(e!==null){const h=x=>{if(i.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!i.current||i.current&&!m)&&UT(x))return!1;const k=S2(x.code,c);if(o.current.add(x[k]),k2(a,o.current,!1)){const S=x.composedPath?.()?.[0]||x.target,b=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(i.current||!b)&&x.preventDefault(),r(!0)}},p=x=>{const v=S2(x.code,c);k2(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(x[v]),x.key==="Meta"&&o.current.clear(),i.current=!1},g=()=>{o.current.clear(),r(!1)};return d?.addEventListener("keydown",h),d?.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{d?.removeEventListener("keydown",h),d?.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function k2(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function S2(e,t){return t.includes(e)?"code":"key"}const mK=()=>{const e=Hn();return C.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:a,panZoom:c}=e.getState(),d=$0(t,r,i,o,a,n?.padding??.1);return c?(await c.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:c,y:d}=a.getBoundingClientRect(),m={x:t.x-c,y:t.y-d},h=n.snapGrid??i,p=n.snapToGrid??o;return Ku(m,r,p,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),a=Em(t,n);return{x:a.x+i,y:a.y+o}}}),[])};function fR(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const c={...o};for(const d of a)pK(d,c);n.push(c)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function pK(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 mR(e,t){return fR(e,t)}function hK(e,t){return fR(e,t)}function Jo(e,t){return{id:e,type:"select",selected:t}}function al(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const a=t.has(i);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Jo(o.id,a)))}return r}function w2({items:e=[],lookup:t}){const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const a=t.get(o.id),c=a?.internals?.userNode??a;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function C2(e){return{id:e.id,type:"remove"}}const j2=e=>PY(e),gK=e=>LT(e);function pR(e){return C.forwardRef(e)}function E2(e){const[t,n]=C.useState(BigInt(0)),[r]=C.useState(()=>yK(()=>n(i=>i+BigInt(1))));return Tv(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function yK(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const hR=C.createContext(null);function xK({children:e}){const t=Hn(),n=C.useCallback(c=>{const{nodes:d=[],setNodes:m,hasDefaultNodes:h,onNodesChange:p,nodeLookup:g,fitViewQueued:x,onNodesChangeMiddlewareMap:v}=t.getState();let k=d;for(const b of c)k=typeof b=="function"?b(k):b;let S=w2({items:k,lookup:g});for(const b of v.values())S=b(S);h&&m(k),S.length>0?p?.(S):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:j}=t.getState();b&&j(w)})},[]),r=E2(n),i=C.useCallback(c=>{const{edges:d=[],setEdges:m,hasDefaul
Line truncated
|
||||
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}HR.displayName="MiniMap";const sQ=C.memo(HR),oQ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,aQ={[Ol.Line]:"right",[Ol.Handle]:"bottom-right"};function lQ({nodeId:e,position:t,variant:n=Ol.Handle,className:r,style:i=void 0,children:o,color:a,minWidth:c=10,minHeight:d=10,maxWidth:m=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:x=!0,shouldResize:v,onResizeStart:k,onResize:S,onResizeEnd:b}){const w=xR(),j=typeof e=="string"?e:w,N=Hn(),O=C.useRef(null),R=n===Ol.Handle,L=rn(C.useCallback(oQ(R&&x),[R,x]),$n),I=C.useRef(null),D=t??aQ[n];C.useEffect(()=>{if(!(!O.current||!j))return I.current||(I.current=LX({domNode:O.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:A,transform:$,snapGrid:W,snapToGrid:B,nodeOrigin:V,domNode:H}=N.getState();return{nodeLookup:A,transform:$,snapGrid:W,snapToGrid:B,nodeOrigin:V,paneDomNode:H}},onChange:(A,$)=>{const{triggerNodeChanges:W,nodeLookup:B,parentLookup:V,nodeOrigin:H}=N.getState(),U=[],Y={x:A.x,y:A.y},Q=B.get(j);if(Q&&Q.expandParent&&Q.parentId){const q=Q.origin??H,G=A.width??Q.measured.width??0,J=A.height??Q.measured.height??0,P={id:Q.id,parentId:Q.parentId,rect:{width:G,height:J,...FT({x:A.x??Q.position.x,y:A.y??Q.position.y},{width:G,height:J},Q.parentId,B,q)}},K=G0([P],B,V,H);U.push(...K),Y.x=A.x?Math.max(q[0]*G,A.x):void 0,Y.y=A.y?Math.max(q[1]*J,A.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const q={id:j,type:"position",position:{...Y}};U.push(q)}if(A.width!==void 0&&A.height!==void 0){const G={id:j,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:A.width,height:A.height}};U.push(G)}for(const q of $){const G={...q,type:"position"};U.push(G)}W(U)},onEnd:({width:A,height:$})=>{const W={id:j,type:"dimensions",resizing:!1,dimensions:{width:A,height:$}};N.getState().triggerNodeChanges([W])}})),I.current.update({controlPosition:D,boundaries:{minWidth:c,minHeight:d,maxWidth:m,maxHeight:h},keepAspectRatio:p,resizeDirection:g,onResizeStart:k,onResize:S,onResizeEnd:b,shouldResize:v}),()=>{I.current?.destroy()}},[D,c,d,m,h,p,k,S,b,v]);const M=D.split("-");return u.jsx("div",{className:dr(["react-flow__resize-control","nodrag",...M,n,r]),ref:O,style:{...i,scale:L,...a&&{[R?"backgroundColor":"borderColor"]:a}},children:o})}C.memo(lQ);const cQ=C.memo(function({data:t}){const n=["oc-canvas-node",t.isOwner&&"is-owner",t.isSelected&&"is-selected",t.isDropTarget&&"is-drop-target"].filter(Boolean).join(" "),r=Uu(t.icon);return u.jsxs("div",{className:n,children:[u.jsx(Ll,{type:"target",position:st.Top,className:"oc-canvas-handle"}),u.jsxs("div",{className:"oc-canvas-node-row",children:[u.jsx("div",{className:"oc-canvas-node-chip",children:u.jsx("span",{className:"oc-canvas-node-chip-icon",style:{WebkitMaskImage:`url("${r}")`,maskImage:`url("${r}")`},"aria-hidden":!0})}),u.jsxs("div",{className:"oc-canvas-node-text",children:[u.jsx("span",{className:"oc-canvas-node-name",children:t.name}),u.jsxs("div",{className:"oc-canvas-node-meta",children:[t.employeeNames.length>0?u.jsxs("span",{className:"oc-canvas-node-person",title:t.employeeNames.join(", "),children:[t.employeeNames[0],t.employeeNames.length>1?` +${t.employeeNames.length-1}`:""]}):u.jsx("span",{className:"oc-canvas-node-id",children:t.roleId}),t.employeeCount>0&&u.jsx("span",{className:"oc-canvas-node-badge",children:t.employeeCount})]})]})]}),u.jsx(Ll,{type:"source",position:st.Bottom,className:"oc-canvas-handle"})]})});var By,B2;function X0(){if(B2)return By;B2=1;var e="\0",t="\0",n="";class r{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(h){h&&(this._isDirected=Object.hasOwn(h,"directed")?h.directed:!0,this._isMultigraph=Object.hasOwn(h,"multigraph")?h.multigraph:!1,this._isCompound=Object.hasOwn(h,"compound")?h.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(h){return this._label=h,this}graph(){return this._label}setDefaultNodeLabel(h){return this._defaultNodeLabelFn=h,typeof h!="function"&&(this._defaultNodeLabelFn=()=>h),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var h=this;return this.nodes().filter(p=>Object.keys(h._in[p]).length===0)}sinks(){var h=this;return this.nodes().filter(p=>Object.keys(h._out[p]).length===0)}setNodes(h,p){var g=arguments,x=this;return h.forEach(function(v){g.length>1?x.setNode(v,p):x.setNode(v)}),this}setNode(h,p){return Object.hasOwn(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=p),this):(this._nodes[h]=arguments.length>1?p:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=t,
Line truncated
|
||||
${r}`}),u.jsx(XV,{projects:Le.projects,activeId:Le.activeProjectId,onSelect:Z=>{const z=dt(Z);t.current?.switchProject(Z,z)},onCreate:Z=>{t.current?.createProject(Z)},onDelete:Z=>t.current?.deleteProject(Z)})]}),u.jsxs("div",{className:"topbar-center",children:[u.jsxs("div",{className:"page-nav",children:[u.jsxs("button",{className:`page-nav-btn${$==="workspace"?" active":""}`,onClick:()=>W("workspace"),children:["Workspace",(()=>{const Z=ve.channels.reduce((z,ne)=>z+ve.getUnreadCount(ne.id),0);return Z>0?u.jsx("span",{className:"nav-unread-badge",children:Z>99?"99+":Z}):null})()]}),u.jsx("button",{className:`page-nav-btn${$==="office"?" active":""}`,onClick:()=>W("office"),children:"Office"}),u.jsx("button",{className:`page-nav-btn${$==="org"?" active":""}`,onClick:()=>W("org"),children:"Org"})]}),u.jsxs("div",{className:"stat-chips",children:[u.jsxs("span",{className:"stat-chip",children:[u.jsx("b",{children:da.totalAgents})," agents"]}),u.jsxs("span",{className:"stat-chip",children:[u.jsx("b",{children:da.totalSkills})," skills"]}),u.jsxs("span",{className:"stat-chip",children:[u.jsx("b",{children:ae.getOpenTaskCount()})," tasks"]})]})]}),u.jsxs("div",{className:"topbar-right",children:[u.jsxs("select",{className:"theme-select",value:Gn,title:"Outdoor lighting override",onChange:Z=>{const z=Z.target.value;mr(z);try{z==="auto"?(localStorage.removeItem("opc_outdoor_override"),localStorage.removeItem("opc_outdoor_day"),localStorage.removeItem("opc_outdoor_night")):(localStorage.setItem("opc_outdoor_override",z),localStorage.removeItem("opc_outdoor_day"),localStorage.removeItem("opc_outdoor_night"))}catch{}e.current.syncOutdoorLighting()},children:[u.jsx("option",{value:"auto",children:"Outdoor auto"}),u.jsx("option",{value:"day",children:"Outdoor day"}),u.jsx("option",{value:"night",children:"Outdoor night"})]}),u.jsxs("select",{className:"theme-select",value:j,onChange:Z=>N(Z.target.value),children:[u.jsx("option",{value:"midnight",children:"Midnight"}),u.jsx("option",{value:"neon",children:"Neon"}),u.jsx("option",{value:"paper",children:"Paper"}),u.jsx("option",{value:"retro",children:"Retro"}),u.jsx("option",{value:"terminal",children:"Terminal"}),u.jsx("option",{value:"cozy",children:"Cozy"}),u.jsx("option",{value:"openopc",children:"OpenOPC"})]}),u.jsx("button",{className:`icon-btn ${H?"active":""}`,onClick:()=>U(Z=>!Z),title:"Developer Tools",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[u.jsx("path",{d:"M5.5 2L2 5.5 5.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.5 7L14 10.5 10.5 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),$==="workspace"&&u.jsx(xV,{boardStore:ae,chatStore:ve,sessionStore:Ae,agents:B,officeMap:Ai,execMode:q,companyProfile:J,taskPreferredAgent:K,projectId:Le.activeProjectId,orgInfoData:te,onNavigateToOrg:()=>W("org"),savedOrgsList:an,activeSavedOrg:Oe,onSavedOrgsList:Pr,onSavedOrgLoad:fs,recoveryStatus:se,onRecoveryResume:Z=>t.current?.recoveryAction(Je(),"resume",Z),onRecoveryCancel:Z=>t.current?.recoveryAction(Je(),"cancel",Z),commsState:oe,commsMessage:Ee,onCommsRefresh:Z=>{const{project_id:z,...ne}=Z??{};t.current?.commsState(Je(),ne)},onCommsReadMessage:Z=>t.current?.commsReadMessage(Je(),Z),onRunTask:(Z,z,ne,le,he)=>{t.current?.send({type:"run_task",project_id:Je(),task_id:Z,title:z,description:ne,mode:le,profile:he})},onCreateTask:(Z,z,ne,le)=>{t.current?.send({type:"kanban_create_task",project_id:Je(),title:Z,board_id:z,column_id:ne,task_id:le})},onMoveTask:(Z,z)=>{t.current?.send({type:"kanban_move_task",project_id:Je(),task_id:Z,column_id:z})},onCreateSession:()=>{if(ht.current||Vt.current)return;const Z=Je();Pe(Z),t.current?.createSession(Z,void 0,q,Dx(q),K,Ko(q,Oe))},onSessionSend:(Z,z,ne,le)=>t.current?.sessionSend(Je(),Z,z,ne,le),onSecretarySend:Z=>t.current?.secretarySend(Je(),Z),onDeleteSession:Z=>t.current?.deleteSession(Je(),Z),onTitleChange:(Z,z)=>t.current?.sessionUpdateTitle(Je(),Z,z),onSessionConfigChange:Xl,onSessionTaskAgentChange:Kl,onContinueInNewChat:To,onSessionStop:Ju,onSessionResume:pp,onSessionComplete:Z=>t.current?.sessionComplete(Je(),Z),onLoadSessionDetail:(Z,z)=>{const ne=t.current;if(ne)return ne.sessionDetail(Je(),Z,{...z,include:z?.detailLevel==="full"?["messages","session_state","progress","work_items","runtime_context"]:["messages","session_state"],viewGeneration:mn.current}).then(le=>{if(le.ok===!1)throw new Error(String(le.error??"session_detail failed"))})},onOpenExecutionPanel:Z=>gt(Z),onCollabSync:()=>t.current?.collabSync(Je(),void 0,mn.current)}),$==="org"&&u.jsx("div",{className:"org-page",children:u.jsx(xJ,{data:te,sessionRecruitmentByRole:ct,talents:Be,employeeDetail:Pt,reorgProposals:Ct,isCustomMode:Fs,onRequestData:()=>t.current?.orgInfo(),onRequestTalents:()=>t.current?.talentList(),onRequestEmployeeDetail:Z=>t.current?.employeeDetail(Z),onHireTalent:(Z,z)=>{Cn(Z),t.c
Line truncated
|
||||
+1
-1
@@ -1 +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
|
||||
.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
|
||||
@@ -1,155 +0,0 @@
|
||||
import{g as ta,r as A3}from"./phaser-DFK5Ua9d.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var rg={exports:{}},Cc={};var pk;function M3(){if(pk)return Cc;pk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Cc.Fragment=t,Cc.jsx=n,Cc.jsxs=n,Cc}var gk;function D3(){return gk||(gk=1,rg.exports=M3()),rg.exports}var c=D3(),ig={exports:{}},_t={};var xk;function O3(){if(xk)return _t;xk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function _(G,J,P){this.props=G,this.context=J,this.refs=S,this.updater=P||v}_.prototype.isReactComponent={},_.prototype.setState=function(G,J){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,J,"setState")},_.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function w(){}w.prototype=_.prototype;function C(G,J,P){this.props=G,this.context=J,this.refs=S,this.updater=P||v}var N=C.prototype=new w;N.constructor=C,k(N,_.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function I(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function L(G,J,P){var X=P.ref;return{$$typeof:e,type:G,key:J,ref:X!==void 0?X:null,props:P}}function A(G,J){return L(G.type,J,G.props)}function M(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function $(G){var J={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(P){return J[P]})}var W=/\/+/g;function B(G,J){return typeof G=="object"&&G!==null&&G.key!=null?$(""+G.key):J.toString(36)}function U(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(I,I):(G.status="pending",G.then(function(J){G.status==="pending"&&(G.status="fulfilled",G.value=J)},function(J){G.status==="pending"&&(G.status="rejected",G.reason=J)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function H(G,J,P,X,ee){var te=typeof G;(te==="undefined"||te==="boolean")&&(G=null);var re=!1;if(G===null)re=!0;else switch(te){case"bigint":case"string":case"number":re=!0;break;case"object":switch(G.$$typeof){case e:case t:re=!0;break;case p:return re=G._init,H(re(G._payload),J,P,X,ee)}}if(re)return ee=ee(G),re=X===""?"."+B(G,0):X,O(ee)?(P="",re!=null&&(P=re.replace(W,"$&/")+"/"),H(ee,J,P,"",function(se){return se})):ee!=null&&(M(ee)&&(ee=A(ee,P+(ee.key==null||G&&G.key===ee.key?"":(""+ee.key).replace(W,"$&/")+"/")+re)),J.push(ee)),1;re=0;var oe=X===""?".":X+":";if(O(G))for(var de=0;de<G.length;de++)X=G[de],te=oe+B(X,de),re+=H(X,J,P,te,ee);else if(de=y(G),typeof de=="function")for(G=de.call(G),de=0;!(X=G.next()).done;)X=X.value,te=oe+B(X,de++),re+=H(X,J,P,te,ee);else if(te==="object"){if(typeof G.then=="function")return H(U(G),J,P,X,ee);throw J=String(G),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return re}function V(G,J,P){if(G==null)return G;var X=[],ee=0;return H(G,X,"","",function(te){return J.call(P,te,ee++)}),X}function Y(G){if(G._status===-1){var J=G._result;J=J(),J.then(function(P){(G._status===0||G._status===-1)&&(G._status=1,G._result=P)},function(P){(G._status===0||G._status===-1)&&(G._status=2,G._result=P)}),G._status===-1&&(G._status=0,G._result=J)}if(G._status===1)return G._reLine truncated
|
||||
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+we+s+Ce}var Ge=!1;function Ye(s,l){if(!s||Ge)return"";Ge=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(l){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(ye){var xe=ye}Reflect.construct(s,[],Ie)}else{try{Ie.call()}catch(ye){xe=ye}s.call(Ie.prototype)}}else{try{throw Error()}catch(ye){xe=ye}(Ie=s())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(ye){if(ye&&xe&&typeof ye.stack=="string")return[ye.stack,xe.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),F=E[0],K=E[1];if(F&&K){var ie=F.split(`
|
||||
`),ge=K.split(`
|
||||
`);for(b=x=0;x<ie.length&&!ie[x].includes("DetermineComponentFrameRoot");)x++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(x===ie.length||b===ge.length)for(x=ie.length-1,b=ge.length-1;1<=x&&0<=b&&ie[x]!==ge[b];)b--;for(;1<=x&&0<=b;x--,b--)if(ie[x]!==ge[b]){if(x!==1||b!==1)do if(x--,b--,0>b||ie[x]!==ge[b]){var _e=`
|
||||
`+ie[x].replace(" at new "," at ");return s.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",s.displayName)),_e}while(1<=x&&0<=b);break}}}finally{Ge=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Be(f):""}function yt(s,l){switch(s.tag){case 26:case 27:case 5:return Be(s.type);case 16:return Be("Lazy");case 13:return s.child!==l&&l!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Ye(s.type,!1);case 11:return Ye(s.type.render,!1);case 1:return Ye(s.type,!0);case 31:return Be("Activity");default:return""}}function qt(s){try{var l="",f=null;do l+=yt(s,f),f=s,s=s.return;while(s);return l}catch(x){return`
|
||||
Error generating stack: `+x.message+`
|
||||
`+x.stack}}var bt=Object.prototype.hasOwnProperty,vt=e.unstable_scheduleCallback,me=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,rt=e.unstable_requestPaint,Qe=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Wt=e.log,nn=e.unstable_setDisableYieldValue,ke=null,Te=null;function Pe(s){if(typeof Wt=="function"&&nn(s),Te&&typeof Te.setStrictMode=="function")try{Te.setStrictMode(ke,s)}catch{}}var Ve=Math.clz32?Math.clz32:Mn,qe=Math.log,et=Math.LN2;function Mn(s){return s>>>=0,s===0?32:31-(qe(s)/et|0)|0}var Tn=256,Dn=262144,yn=4194304;function Yt(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Jt(s,l,f){var x=s.pendingLanes;if(x===0)return 0;var b=0,E=s.suspendedLanes,F=s.pingedLanes;s=s.warmLanes;var K=x&134217727;return K!==0?(x=K&~E,x!==0?b=Yt(x):(F&=K,F!==0?b=Yt(F):f||(f=K&~s,f!==0&&(b=Yt(f))))):(K=x&~E,K!==0?b=Yt(K):F!==0?b=Yt(F):f||(f=x&~s,f!==0&&(b=Yt(f)))),b===0?0:l!==0&&l!==b&&(l&E)===0&&(E=b&-b,f=l&-l,E>=f||E===32&&(f&4194048)!==0)?l:b}function Et(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function wt(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 tt(){var s=yn;return yn<<=1,(yn&62914560)===0&&(yn=4194304),s}function it(s){for(var l=[],f=0;31>f;f++)l.push(s);return l}function rn(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Xt(s,l,f,x,b,E){var F=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var K=s.entanglements,ie=s.expirationTimes,ge=s.hiddenUpdates;for(f=F&~f;0<f;){var _e=31-Ve(f),Ie=1<<_e;K[_e]=0,ie[_e]=-1;var xe=ge[_e];if(xe!==null)for(ge[_e]=null,_e=0;_e<xe.length;_e++){var ye=xe[_e];ye!==null&&(ye.lane&=-536870913)}f&=~Ie}x!==0&&mt(s,x,0),E!==0&&b===0&&s.tag!==0&&(s.suspendedLanes|=E&~(F&~l))}function mt(s,l,f){s.pendingLanes|=l,s.suspendedLanes&=~l;var x=31-Ve(l);s.entangledLanes|=l,s.entanglements[x]=s.entanglements[x]|1073741824|f&261930}function Ht(s,l){var f=s.entangledLanes|=l;for(s=s.entanglements;f;){var x=31-Ve(f),b=1<<x;b&l|s[x]&l&&(s[x]|=l),f&=~b}}function On(s,l){var f=l&-l;return f=(f&42)!==0?1:vn(f),(f&(s.suspendedLanes|l))!==0?0:f}function vn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Rn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ve(){var s=V.p;return s!==0?s:(s=window.event,s===void 0?32:lk(s.type))}function Re(s,l){var f=V.p;try{return V.p=s,l()}finally{V.p=f}}var Xe=Math.random().toString(36).slice(2),He="__reactFiber$"+Xe,Tt="__reactProps$"+Xe,ht="__reactContainer$"+Xe,$n="__reactEvents$"+Xe,Ae="__reactListeners$"+Xe,Dt="__reactHandles$"+Xe,kn="__reactResources$"+Xe,nr="__reactMarker$"+Xe;function Sn(s){delete s[He],delete s[Tt],delete s[$n],delete s[Ae],delete s[Dt]}function We(s){var l=s[He];if(l)return l;for(var f=s.parentNode;f;){if(l=f[ht]||f[He]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(s=q_(s);s!==null;){if(f=s[He])return f;s=q_(s)}return l}s=f,f=s.parentNode}return null}function lr(s){if(s=s[He]||s[ht]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function cr(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function mn(s){var l=s[kn];return l||(l=s[kn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Pt(s){s[nr]=!0}var Zn=new Set,wn={};function pt(s,l){Ar(s,l),Ar(s+"Capture",l)}function Ar(s,l){for(wn[s]=l,s=0;s<l.length;s++)Zn.add(l[s])}var jr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u2
Line truncated
|
||||
`).replace(e3,"")}function L_(s,l){return l=O_(l),O_(s)===l}function dn(s,l,f,x,b,E){switch(f){case"children":typeof x=="string"?l==="body"||l==="textarea"&&x===""||Rs(s,x):(typeof x=="number"||typeof x=="bigint")&&l!=="body"&&Rs(s,""+x);break;case"className":Nt(s,"class",x);break;case"tabIndex":Nt(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Nt(s,f,x);break;case"style":si(s,x,E);break;case"data":if(l!=="object"){Nt(s,"data",x);break}case"src":case"href":if(x===""&&(l!=="a"||f!=="href")){s.removeAttribute(f);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(f);break}x=sa(""+x),s.setAttribute(f,x);break;case"action":case"formAction":if(typeof x=="function"){s.setAttribute(f,"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 E=="function"&&(f==="formAction"?(l!=="input"&&dn(s,l,"name",b.name,b,null),dn(s,l,"formEncType",b.formEncType,b,null),dn(s,l,"formMethod",b.formMethod,b,null),dn(s,l,"formTarget",b.formTarget,b,null)):(dn(s,l,"encType",b.encType,b,null),dn(s,l,"method",b.method,b,null),dn(s,l,"target",b.target,b,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(f);break}x=sa(""+x),s.setAttribute(f,x);break;case"onClick":x!=null&&(s.onclick=oi);break;case"onScroll":x!=null&&At("scroll",s);break;case"onScrollEnd":x!=null&&At("scrollend",s);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(f=x.__html,f!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":s.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){s.removeAttribute("xlink:href");break}f=sa(""+x),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(f,""+x):s.removeAttribute(f);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":x&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":x===!0?s.setAttribute(f,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(f,x):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?s.setAttribute(f,x):s.removeAttribute(f);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?s.removeAttribute(f):s.setAttribute(f,x);break;case"popover":At("beforetoggle",s),At("toggle",s),sn(s,"popover",x);break;case"xlinkActuate":vr(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":vr(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":vr(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":vr(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":vr(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":vr(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":vr(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":vr(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":vr(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":sn(s,"is",x);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=oh.get(f)||f,sn(s,f,x))}}function Bp(s,l,f,x,b,E){switch(f){case"style":si(s,x,E);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(f=x.__html,f!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof x=="string"?Rs(s,x):(typeof x=="number"||typeof x=="bigint")&&Rs(s,""+x);break;case"onScroll":x!=null&&At("scroll",s);break;case"onScrollEnd":x!=null&&At("scrollend",s);break;case"onClick":x!=null&&(s.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
`),oe=h.map(([de,se])=>` [${de}, ${se}],`).join(`
|
||||
`);return`const MAP_STR: string[] = [
|
||||
${re}
|
||||
]
|
||||
|
||||
const SEATS: [number, number][] = [
|
||||
${oe}
|
||||
]`})(),J=()=>I(te=>Math.min(te+.25,3)),P=()=>I(te=>Math.max(te-.25,.5)),X=m.flat().filter(te=>te===1).length,ee=m.flat().filter(te=>te===0).length;return c.jsxs("div",{className:"collision-editor",children:[c.jsxs("div",{className:"ce-toolbar",children:[c.jsxs("div",{className:"ce-toolbar-group",children:[c.jsx("span",{className:"ce-title",children:"Map Editor"}),c.jsx("select",{className:"ce-office-select",value:a,onChange:te=>M(te.target.value),children:i.map(te=>c.jsx("option",{value:te.id,children:te.name},te.id))})]}),c.jsxs("div",{className:"ce-toolbar-group",children:[c.jsxs("button",{className:`ce-mode-btn ${y==="wall"?"active wall":""}`,onClick:()=>v("wall"),children:[c.jsx("span",{className:"ce-mode-dot wall"})," Wall"]}),c.jsxs("button",{className:`ce-mode-btn ${y==="floor"?"active floor":""}`,onClick:()=>v("floor"),children:[c.jsx("span",{className:"ce-mode-dot floor"})," Floor"]}),c.jsxs("button",{className:`ce-mode-btn ${y==="seat"?"active seat":""}`,onClick:()=>v("seat"),children:[c.jsx("span",{className:"ce-mode-dot seat"})," Seat"]})]}),c.jsxs("div",{className:"ce-toolbar-group",children:[c.jsx("button",{className:"ce-btn",onClick:P,children:"-"}),c.jsxs("span",{className:"ce-zoom-label",children:[Math.round(O*100),"%"]}),c.jsx("button",{className:"ce-btn",onClick:J,children:"+"}),c.jsx("button",{className:`ce-btn${D?" active":""}`,onClick:()=>T(te=>!te),children:"Grid"})]}),c.jsxs("div",{className:"ce-toolbar-group",children:[c.jsx("button",{className:`ce-btn apply${C?" success":""}`,onClick:Y,children:C?"Applied":"Apply"}),c.jsx("button",{className:`ce-btn${_?" active":""}`,onClick:Q,children:"Export"}),c.jsx("button",{className:"ce-btn danger",onClick:q,children:"Reset"})]}),c.jsxs("div",{className:"ce-toolbar-group ce-stats",children:[c.jsxs("span",{children:["Walls: ",X]}),c.jsxs("span",{children:["Floor: ",ee]}),c.jsxs("span",{children:["Seats: ",h.length]})]})]}),c.jsxs("div",{className:"ce-body",children:[c.jsx("div",{className:"ce-canvas-wrap",style:{overflow:"auto"},children:c.jsx("canvas",{ref:t,style:{width:L*R*O,height:A*R*O,imageRendering:"pixelated",cursor:y==="seat"?"crosshair":"cell"},onMouseDown:U,onMouseMove:H,onMouseUp:V,onMouseLeave:V})}),_&&c.jsxs("div",{className:"ce-export-panel",children:[c.jsxs("div",{className:"ce-export-header",children:[c.jsx("span",{children:"Export — copy to source code"}),c.jsx("button",{className:"ce-btn",onClick:()=>navigator.clipboard.writeText(G),children:"Copy"})]}),c.jsx("textarea",{className:"ce-export-textarea",value:G,readOnly:!0,rows:20})]})]})]})}let qM=0;function tr(e,t,n={}){return{event_id:`test-${++qM}`,type:e,agent_id:t,data:n,timestamp:Date.now()/1e3}}function En(e){return new Promise(t=>setTimeout(t,e))}async function WM(e){const t=[],n=e.getScene();if(!n)return t.push({name:"scene-ready",pass:!1,detail:"OfficeScene not initialized"}),t;console.log("%c[EventTest] Starting full event test suite (multi-office)...","color: #6366f1; font-weight: bold");for(const M of[...n.agents.keys()])n.removeAgent(M);await En(100);const r=Bn();t.push({name:"offices-loaded",pass:r.length>=3,detail:`${r.length} offices loaded: ${r.map(M=>M.name).join(", ")}`});const i=["agent-A","agent-B","agent-C","agent-D","agent-E","agent-F"];for(const M of i)e.pushEvent(tr("agent_active",M));await En(300);const o=new Set;let a=!1;for(const M of i){const $=n.getAgent(M);$&&$.seatId&&(o.has($.seatId)&&(a=!0),o.add($.seatId))}t.push({name:"desk-assignment-unique",pass:!a&&o.size===i.length,detail:`Assigned ${o.size} unique seats to ${i.length} agents. IDs: [${[...o].join(", ")}]`});const u=i.every(M=>n.getAgent(M)?.officeId!=null);t.push({name:"agents-have-officeId",pass:u,detail:i.map(M=>`${M}=${n.getAgent(M)?.officeId}`).join(", ")}),e.pushEvent(tr("tool_start","agent-A",{tool_name:"shell"})),await En(200);const d=n.getAgent("agent-A");t.push({name:"tool_start-state",pass:d.isActive===!0&&d.currentTool==="shell",detail:`isActive=${d.isActive}, currentTool=${d.currentTool}`}),e.pushEvent(tr("tool_done","agent-A",{tool_name:"shell"})),await En(100),t.push({name:"tool_done-celebrate",pass:d.agentState==="celebrate",detail:`state=${d.agentState}`});for(let M=0;M<20&&d.agentState==="celebrate";M++)await En(500);t.push({name:"celebrate-to-idle",pass:d.agentState!=="celebrate",detail:`state=${d.agentState}`}),e.pushEvent(tr("waiting","agent-B")),await En(200);const m=n.getAgent("agent-B");t.push({name:"waiting-state",pass:m.isActive===!1&&(m.agentState==="walk"||m.agentState==="idle"||m.agentState==="coffee"),detail:`isActive=${m.isActive}, state=${m.agentState}`}),e.pushEvent(tr("reflect_start","agent-C")),await En(200);const p=n.getAgent("agent-C");t.push({name:"reflect_start-state",pass:p.currentTool==="Reflect"&&(p.agentState==="walk"||p.agentState==="reflect"),detail:`currentTool=${p.currentTool}, state=${p.agentState}`}),e.pushEvent(tr("reflect_done","agent-C")),await En(100),t.push({name:"reflect_done-celebrate",pass:p.agentState==="celebrate",detail:`staLine truncated
|
||||
font-size: .6rem;
|
||||
font-weight: bold;
|
||||
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(i),o=!1,i}return a.updateDeps=u=>{r=u},a}function Gk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const i4=(e,t)=>Math.abs(e-t)<1.01,s4=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},qk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},o4=e=>e,a4=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},l4=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:u,height:d}=a;t({width:Math.round(u),height:Math.round(d)})};if(i(qk(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(a=>{const u=()=>{const d=a[0];if(d?.borderBoxSize){const m=d.borderBoxSize[0];if(m){i({width:m.inlineSize,height:m.blockSize});return}}i(qk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Wk={passive:!0},Yk=typeof window>"u"?!0:"onscrollend"in window,c4=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&Yk?()=>{}:s4(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=p=>()=>{const{horizontal:h,isRtl:g}=e.options;i=h?n.scrollLeft*(g&&-1||1):n.scrollTop,o(),t(i,p)},u=a(!0),d=a(!1);n.addEventListener("scroll",u,Wk);const m=e.options.useScrollendEvent&&Yk;return m&&n.addEventListener("scrollend",d,Wk),()=>{n.removeEventListener("scroll",u),m&&n.removeEventListener("scrollend",d)}},u4=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},d4=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const a=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class f4{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const a=()=>{const u=o.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:o4,rangeExtractor:a4,onChange:()=>{},measureElement:u4,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Va(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}
Line truncated
|
||||
The error may be correlated with this previous error:
|
||||
${te.current.stack}
|
||||
|
||||
`),we}Vf(()=>{te.current=void 0,P.current=void 0,G.current=de});const se=j.useMemo(()=>j.createElement(S,{...de,ref:L}),[L,S,de]);return j.useMemo(()=>v?j.createElement(M.Provider,{value:q},se):se,[M,se,q])}const I=j.memo(N);if(I.WrappedComponent=S,I.displayName=N.displayName=w,d){const T=j.forwardRef(function(A,M){return j.createElement(I,{...A,reactReduxForwardedRef:M})});return T.displayName=w,T.WrappedComponent=S,Ay(T,S)}return Ay(I,S)}}var oE=K5;function Z5(e){const{children:t,context:n,serverState:r,store:i}=e,o=j.useMemo(()=>{const d=rE(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),a=j.useMemo(()=>i.getState(),[i]);Vf(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),a!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,a]);const u=n||sE;return j.createElement(u.Provider,{value:o},t)}var Q5=Z5,J5="Invariant failed";function eD(e,t){throw new Error(J5)}var Ti=function(t){var n=t.top,r=t.right,i=t.bottom,o=t.left,a=r-o,u=i-n,d={top:n,right:r,bottom:i,left:o,width:a,height:u,x:o,y:n,center:{x:(r+o)/2,y:(i+n)/2}};return d},M0=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},vS=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},tD=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},bg={top:0,right:0,bottom:0,left:0},D0=function(t){var n=t.borderBox,r=t.margin,i=r===void 0?bg:r,o=t.border,a=o===void 0?bg:o,u=t.padding,d=u===void 0?bg:u,m=Ti(M0(n,i)),p=Ti(vS(n,a)),h=Ti(vS(p,d));return{marginBox:m,borderBox:Ti(n),paddingBox:p,contentBox:h,margin:i,border:a,padding:d}},gi=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var i=Number(n);return isNaN(i)&&eD(),i},nD=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Uf=function(t,n){var r=t.borderBox,i=t.border,o=t.margin,a=t.padding,u=tD(r,n);return D0({borderBox:u,border:i,margin:o,padding:a})},Gf=function(t,n){return n===void 0&&(n=nD()),Uf(t,n)},aE=function(t,n){var r={top:gi(n.marginTop),right:gi(n.marginRight),bottom:gi(n.marginBottom),left:gi(n.marginLeft)},i={top:gi(n.paddingTop),right:gi(n.paddingRight),bottom:gi(n.paddingBottom),left:gi(n.paddingLeft)},o={top:gi(n.borderTopWidth),right:gi(n.borderRightWidth),bottom:gi(n.borderBottomWidth),left:gi(n.borderLeftWidth)};return D0({borderBox:t,margin:r,padding:i,border:o})},lE=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return aE(n,r)},cu=function(t){var n=[],r=null,i=function(){for(var a=arguments.length,u=new Array(a),d=0;d<a;d++)u[d]=arguments[d];n=u,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return i.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},i};function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qf.apply(null,arguments)}function cE(e,t){}cE.bind(null,"warn");cE.bind(null,"error");function fo(){}function rD(e,t){return{...e,...t}}function bi(e,t,n){const r=t.map(i=>{const o=rD(n,i.options);return e.addEventListener(i.eventName,i.fn,o),function(){e.removeEventListener(i.eventName,i.fn,o)}});return function(){r.forEach(o=>{o()})}}const iD="Invariant failed";class Wf extends Error{}Wf.prototype.toString=function(){return this.message};function Le(e,t){throw new Wf(iD)}let sD=class extends St.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=fo,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Wf&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=bi(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Wf){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}};const oD=`
|
||||
Press space bar to start a drag.
|
||||
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
||||
Some screen readers may require you to be in focus mode or to use your pass through key
|
||||
`,Yf=e=>e+1,aD=e=>`
|
||||
You have lifted an item in position ${Yf(e.source.index)}
|
||||
`,uE=(e,t)=>{const n=e.droppableId===t.droppableId,r=Yf(e.index),i=Yf(t.index);return n?`
|
||||
You have moved the item from position ${r}
|
||||
to position ${i}
|
||||
`:`
|
||||
You have moved the item from position ${r}
|
||||
in list ${e.droppableId}
|
||||
to list ${t.droppableId}
|
||||
in position ${i}
|
||||
`},dE=(e,t,n)=>t.droppableId===n.droppableId?`
|
||||
The item ${e}
|
||||
has been combined with ${n.draggableId}`:`
|
||||
The item ${e}
|
||||
in list ${t.droppableId}
|
||||
has been combined with ${n.draggableId}
|
||||
in list ${n.droppableId}
|
||||
`,lD=e=>{const t=e.destination;if(t)return uE(e.source,t);const n=e.combine;return n?dE(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},bS=e=>`
|
||||
The item has returned to its starting position
|
||||
of ${Yf(e.index)}
|
||||
`,cD=e=>{if(e.reason==="CANCEL")return`
|
||||
Movement cancelled.
|
||||
${bS(e.source)}
|
||||
`;const t=e.destination,n=e.combine;return t?`
|
||||
You have dropped the item.
|
||||
${uE(e.source,t)}
|
||||
`:n?`
|
||||
You have dropped the item.
|
||||
${dE(e.draggableId,e.source,n)}
|
||||
`:`
|
||||
The item has been dropped while not over a drop area.
|
||||
${bS(e.source)}
|
||||
`},Ef={dragHandleUsageInstructions:oD,onDragStart:aD,onDragUpdate:lD,onDragEnd:cD};function uD(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function fE(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!uD(e[n],t[n]))return!1;return!0}function Vt(e,t){const n=j.useState(()=>({inputs:t,result:e()}))[0],r=j.useRef(!0),i=j.useRef(n),a=r.current||!!(t&&i.current.inputs&&fE(t,i.current.inputs))?i.current:{inputs:t,result:e()};return j.useEffect(()=>{r.current=!1,i.current=a},[a]),a.result}function st(e,t){return Vt(()=>e,t)}const ar={x:0,y:0},xr=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Jr=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),mo=(e,t)=>e.x===t.x&&e.y===t.y,Il=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),qo=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},uu=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),_S=(e,t)=>Math.min(...t.map(n=>uu(e,n))),mE=e=>t=>({x:e(t.x),y:e(t.y)});var dD=(e,t)=>{const n=Ti({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const Iu=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),kS=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],fD={top:0,right:0,bottom:0,left:0},mD=(e,t)=>t?Iu(e,t.scroll.diff.displacement):e,hD=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,pD=(e,t)=>t&&t.shouldClipSubject?dD(t.pageMarginBox,e):Ti(e);var ml=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=mD(e.marginBox,r),o=hD(i,n,t),a=pD(o,r);return{page:e,withPlaceholder:t,active:a}},O0=(e,t)=>{e.frame||Le();const n=e.frame,r=Jr(t,n.scroll.initial),i=Il(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},a=ml({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:a}};function or(e,t=fE){let n=null;function r(...i){if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;const o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}const hE=or(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),pE=or(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Im=or(e=>Object.values(e)),gD=or(e=>Object.values(e));var Tl=or((e,t)=>gD(t).filter(r=>e===r.descriptor.droppableId).sort((r,i)=>r.descriptor.index-i.descriptor.index));function L0(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Tm(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Rm=or((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),xD=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled||!L0(i))return null;function a(y){const v={type:"COMBINE",combine:{draggableId:y,droppableId:n.descriptor.id}};return{...i,at:v}}const u=i.displaced.all,d=u.length?u[0]:null;if(e)return d?a(d):null;const m=Rm(t,r);if(!d){if(!m.length)return null;const y=m[m.length-1];return a(y.descriptor.id)}const p=m.findIndex(y=>y.descriptor.id===d);p===-1&&Le();const h=p-1;if(h<0)return null;const g=m[h];return a(g.descriptor.id)},Rl=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const gE={point:ar,value:0},du={invisible:{},visible:{},all:[]},yD={displaced:du,displacedBy:gE,at:null};var _i=(e,t)=>n=>e<=n&&n<=t,xE=e=>{const t=_i(e.top,e.bottom),n=_i(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),a=n(r.left)||n(r.right);if(o&&a)return!0;const d=r.top<e.top&&r.bottom>e.bottom,m=r.left<e.left&&r.right>e.right;return d&&m?!0:d&&a||m&&o}},vD=e=>{const t=_i(e.top,e.bottom),n=_i(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const z0={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},yE={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var bD=e=>t=>{const n=_i(t.top,t.bottom),r=_i(t.left,t.right);return i=>e===z0?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)};const _D=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:ar;return Iu(e,n)},kD=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,SD=(e,t,n)=>n(t)(e),P0=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?_D(e,t):e;return kD(o,t,i)&&SD(o,n,i)},wD=e=>P0({...e,isVisibleThroughFrameFn:xE}),vE=e=>P0({...e,isVisibleThroughFrameFn:vD}),CD=e=>P0({...e,isVisibleThroughFrameFn:bD(e.destination.axis)}),jD=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return o?o.shouldAnimate:!0};function ED(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Ti(M0(n,r))}function fu({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,la
Line truncated
|
||||
cursor: -webkit-grab;
|
||||
cursor: grab;
|
||||
`;return{selector:t(pl.contextId),styles:{always:`
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
touch-action: manipulation;
|
||||
`,resting:u,dragging:NL,dropAnimating:u}}})(),r=(()=>{const u=`
|
||||
transition: ${Qc.outOfTheWay};
|
||||
`;return{selector:t(zy.contextId),styles:{dragging:u,dropAnimating:u,userCancel:u}}})(),i={selector:t(jL.contextId),styles:{always:"overflow-anchor: none;"}},a=[r,n,i,{selector:"body",styles:{dragging:`
|
||||
cursor: grabbing;
|
||||
cursor: -webkit-grabbing;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
overflow-anchor: none;
|
||||
`}}];return{always:Tc(a,"always"),resting:Tc(a,"resting"),dragging:Tc(a,"dragging"),dropAnimating:Tc(a,"dropAnimating"),userCancel:Tc(a,"userCancel")}};const ti=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?j.useLayoutEffect:j.useEffect,Cg=()=>{const e=document.querySelector("head");return e||Le(),e},LS=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function TL(e,t){const n=Vt(()=>IL(e),[e]),r=j.useRef(null),i=j.useRef(null),o=st(or(h=>{const g=i.current;g||Le(),g.textContent=h}),[]),a=st(h=>{const g=r.current;g||Le(),g.textContent=h},[]);ti(()=>{!r.current&&!i.current||Le();const h=LS(t),g=LS(t);return r.current=h,i.current=g,h.setAttribute(`${hl}-always`,e),g.setAttribute(`${hl}-dynamic`,e),Cg().appendChild(h),Cg().appendChild(g),a(n.always),o(n.resting),()=>{const y=v=>{const k=v.current;k||Le(),Cg().removeChild(k),v.current=null};y(r),y(i)}},[t,a,o,n.always,n.resting,e]);const u=st(()=>o(n.dragging),[o,n.dragging]),d=st(h=>{if(h==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),m=st(()=>{i.current&&o(n.resting)},[o,n.resting]);return Vt(()=>({dragging:u,dropping:d,resting:m}),[u,d,m])}function qE(e,t){return Array.from(e.querySelectorAll(t))}var WE=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Mm(e){return e instanceof WE(e).HTMLElement}function RL(e,t){const n=`[${pl.contextId}="${e}"]`,r=qE(document,n);if(!r.length)return null;const i=r.find(o=>o.getAttribute(pl.draggableId)===t);return!i||!Mm(i)?null:i}function AL(e){const t=j.useRef({}),n=j.useRef(null),r=j.useRef(null),i=j.useRef(!1),o=st(function(g,y){const v={id:g,focus:y};return t.current[g]=v,function(){const S=t.current;S[g]!==v&&delete S[g]}},[]),a=st(function(g){const y=RL(e,g);y&&y!==document.activeElement&&y.focus()},[e]),u=st(function(g,y){n.current===g&&(n.current=y)},[]),d=st(function(){r.current||i.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const g=n.current;g&&a(g)}))},[a]),m=st(function(g){n.current=null;const y=document.activeElement;y&&y.getAttribute(pl.draggableId)===g&&(n.current=g)},[]);return ti(()=>(i.current=!0,function(){i.current=!1;const g=r.current;g&&cancelAnimationFrame(g)}),[]),Vt(()=>({register:o,tryRecordFocus:m,tryRestoreFocusRecorded:d,tryShiftRecord:u}),[o,m,d,u])}function ML(){const e={draggables:{},droppables:{}},t=[];function n(h){return t.push(h),function(){const y=t.indexOf(h);y!==-1&&t.splice(y,1)}}function r(h){t.length&&t.forEach(g=>g(h))}function i(h){return e.draggables[h]||null}function o(h){const g=i(h);return g||Le(),g}const a={register:h=>{e.draggables[h.descriptor.id]=h,r({type:"ADDITION",value:h})},update:(h,g)=>{const y=e.draggables[g.descriptor.id];y&&y.uniqueId===h.uniqueId&&(delete e.draggables[g.descriptor.id],e.draggables[h.descriptor.id]=h)},unregister:h=>{const g=h.descriptor.id,y=i(g);y&&h.uniqueId===y.uniqueId&&(delete e.draggables[g],e.droppables[h.descriptor.droppableId]&&r({type:"REMOVAL",value:h}))},getById:o,findById:i,exists:h=>!!i(h),getAllByType:h=>Object.values(e.draggables).filter(g=>g.descriptor.type===h)};function u(h){return e.droppables[h]||null}function d(h){const g=u(h);return g||Le(),g}const m={register:h=>{e.droppables[h.descriptor.id]=h},unregister:h=>{const g=u(h.descriptor.id);g&&h.uniqueId===g.uniqueId&&delete e.droppables[h.descriptor.id]},getById:d,findById:u,exists:h=>!!u(h),getAllByType:h=>Object.values(e.droppables).filter(g=>g.descriptor.type===h)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:m,subscribe:n,clean:p}}function DL(){const e=Vt(ML,[]);return j.useEffect(()=>function(){e.clean()},[e]),e}var X0=St.createContext(null),Kf=()=>{const e=document.body;return e||Le(),e};const OL={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},LL=e=>`rfd-announcement-${e}`;function zL(e){const t=Vt(()=>LL(e),[e]),n=j.useRef(null);return j.useEffect(function(){const o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),qf(o.style,OL),Kf().appendChild(o),function(){setTimeout(function(){const d=Kf();d.contains(o)&&d.removeChild(o),o===n.current&&(n.current=null)})}},[t]),st(i=>{const o=n.current;if(o){o.textContent=i;return}},[])}const PL={separator:"::"};function K0(e,t=PL){const n=St.useId();return Vt(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function BL({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function $L({contextId:e,text:t}){const n=K0("hidden-text",{separator:"-"}),r=Vt(()=>BL({contextId:e,uniqueId:n}),[n,e]);return j.useEffect(function(){const o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",Kf().appendChild(o),function(){const u=Kf();u.contains(o)&&u.removeChild(o)}},[r,t]),r}var Dm=St.c
Line truncated
|
||||
`,m="/",p="*",h="",g="comment",y="declaration";function v(S,_){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];_=_||{};var w=1,C=1;function N(B){var U=B.match(t);U&&(w+=U.length);var H=B.lastIndexOf(d);C=~H?B.length-H:C+B.length}function O(){var B={line:w,column:C};return function(U){return U.position=new I(B),L(),U}}function I(B){this.start=B,this.end={line:w,column:C},this.source=_.source}I.prototype.content=S;function D(B){var U=new Error(_.source+":"+w+":"+C+": "+B);if(U.reason=B,U.filename=_.source,U.line=w,U.column=C,U.source=S,!_.silent)throw U}function T(B){var U=B.exec(S);if(U){var H=U[0];return N(H),S=S.slice(H.length),U}}function L(){T(n)}function A(B){var U;for(B=B||[];U=M();)U!==!1&&B.push(U);return B}function M(){var B=O();if(!(m!=S.charAt(0)||p!=S.charAt(1))){for(var U=2;h!=S.charAt(U)&&(p!=S.charAt(U)||m!=S.charAt(U+1));)++U;if(U+=2,h===S.charAt(U-1))return D("End of comment missing");var H=S.slice(2,U-2);return C+=2,N(H),S=S.slice(U),C+=2,B({type:g,comment:H})}}function $(){var B=O(),U=T(r);if(U){if(M(),!T(i))return D("property missing ':'");var H=T(o),V=B({type:y,property:k(U[0].replace(e,h)),value:H?k(H[0].replace(e,h)):h});return T(a),V}}function W(){var B=[];A(B);for(var U;U=$();)U!==!1&&(B.push(U),A(B));return B}return L(),W()}function k(S){return S?S.replace(u,h):h}return Dg=v,Dg}var ew;function oz(){if(ew)return qa;ew=1;var e=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=n;const t=e(sz());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),u=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:m,value:p}=d;u?i(m,p,d):p&&(o=o||{},o[m]=p)}),o}return qa}var Dc={},tw;function az(){if(tw)return Dc;tw=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},a=function(m,p){return p.toUpperCase()},u=function(m,p){return"".concat(p,"-")},d=function(m,p){return p===void 0&&(p={}),o(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(i,u):m=m.replace(r,u),m.replace(t,a))};return Dc.camelCase=d,Dc}var Oc,nw;function lz(){if(nw)return Oc;nw=1;var e=Oc&&Oc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(oz()),n=az();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(a[(0,n.camelCase)(u,o)]=d)}),a}return r.default=r,Oc=r,Oc}var cz=lz();const uz=ta(cz),vN=bN("end"),nv=bN("start");function bN(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function dz(e){const t=nv(e),n=vN(e);if(t&&n)return{start:t,end:n}}function Jc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rw(e.position):"start"in e||"end"in e?rw(e):"line"in e||"column"in e?Fy(e):""}function Fy(e){return iw(e&&e.line)+":"+iw(e&&e.column)}function rw(e){return Fy(e&&e.start)+"-"+Fy(e&&e.end)}function iw(e){return e&&typeof e=="number"?e:1}class Cr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Jc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Cr.prototype.file="";Cr.prototype.name="";Cr.prototype.reason="";Cr.prototype.message="";Cr.prototype.stack="";Cr.prototype.column=void 0;Cr.prototype.line=void 0;Cr.prototype.ancestors=void 0;Cr.prototype.cause=void 0;Cr.prototype.fatal=void 0;Cr.prototype.place=void 0;Cr.prototype.ruleId=void 0;Cr.prototype.source=void 0;const rv={}.hasOwnProperty,fz=new Map,mz=/[A-Z]/g,hz=new Set(["table","tbody","thead","tfoot","tr"]),pz=new Set(["td","th"]),_N="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function gz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.j
Line truncated
|
||||
`;break}case-3:{a=`\r
|
||||
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function wB(e){const r={constructs:jN([bB,...(e||{}).extensions||[]]),content:i(Bz),defined:[],document:i(Hz),flow:i(sB),lazy:{},string:i(lB),text:i(cB)};return r;function i(o){return a;function a(u){return _B(r,o,u)}}}function CB(e){for(;!RN(e););return e}const hw=/[\0\t\n\r]/g;function jB(){let e=1,t="",n=!0,r;return i;function i(o,a,u){const d=[];let m,p,h,g,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(hw.lastIndex=h,m=hw.exec(o),g=m&&m.index!==void 0?m.index:o.length,y=o.charCodeAt(g),!m){t=o.slice(h);break}if(y===10&&h===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<g&&(d.push(o.slice(h,g)),e+=g-h),y){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const EB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NB(e){return e.replace(EB,IB)}function IB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return EN(n.slice(o?2:1),o?16:10)}return av(n)||e}const zN={}.hasOwnProperty;function TB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),RB(n)(CB(wB(n).document().write(jB()(e,t,!0))))}function RB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(bt),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(Ge),blockQuote:o(se),characterEscape:L,characterReference:L,codeFenced:o(Ee),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Ee,a),codeText:o(we,a),codeTextData:L,data:L,codeFlowValue:L,definition:o(Ce),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Be),hardBreakEscape:o(Ye),hardBreakTrailing:o(Ye),htmlFlow:o(yt,a),htmlFlowData:L,htmlText:o(yt,a),htmlTextData:L,image:o(qt),label:a,link:o(bt),listItem:o(me),listItemValue:g,listOrdered:o(vt,h),listUnordered:o(vt),paragraph:o(Oe),reference:P,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ge),strong:o(rt),thematicBreak:o(Je)},exit:{atxHeading:d(),atxHeadingSequence:O,autolink:d(),autolinkEmail:de,autolinkProtocol:oe,blockQuote:d(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:te,characterReference:re,codeFenced:d(S),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:v,codeFlowValue:A,codeIndented:d(_),codeText:d(U),codeTextData:A,data:A,definition:d(),definitionDestinationString:N,definitionLabelString:w,definitionTitleString:C,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(W),htmlFlowData:A,htmlText:d(B),htmlTextData:A,image:d(V),label:Q,labelText:Y,lineEnding:M,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:X,resourceDestinationString:q,resourceTitleString:G,resource:J,setextHeading:d(T),setextHeadingLineSequence:D,setextHeadingText:I,strong:d(),thematicBreak:d()}};PN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let be={type:"root",children:[]};const Me={stack:[be],tokenStack:[],config:t,enter:u,exit:m,buffer:a,resume:p,data:n},Fe=[];let $e=-1;for(;++$e<fe.length;)if(fe[$e][1].type==="listOrdered"||fe[$e][1].type==="listUnordered")if(fe[$e][0]==="enter")Fe.push($e);else{const Wt=Fe.pop();$e=i(fe,Wt,$e)}for($e=-1;++$e<fe.length;){const Wt=t[fe[$e][0]];zN.call(Wt,fe[$e][1].type)&&Wt[fe[$e][1].type].call(Object.assign({sliceSerialize:fe[$e][2].sliceSerialize},Me),fe[$e][1])}if(Me.tokenStack.length>0){const Wt=Me.tokenStack[Me.tokenStack.length-1];(Wt[1]||pw).call(Me,void 0,Wt[0])}for(be.position={start:io(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:io(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)be=t.transforms[$e](be)||be;return be}function i(fe,be,Me){let Fe=be-1,$e=-1,Wt=!1,nn,ke,Te,Pe;for(;++Fe<=Me;){const Ve=fe[Fe];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?$e++:$e--,Pe=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(nn&&!Pe&&!$e&&!Te&&(Te=Fe),Pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pe=void 0}if(!$e&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||$e===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(nn){let qe=Fe;for(ke=void 0;qe--;){const et=fe[qe];if(et[1].type==="lineEnding"||et[1].type==="lineEndingBlank"){if(et[0]==="exit")continue;ke&&(fe[ke][1].type="lineEndingBlank",Wt=!0),et[1].type="lineEnding",ke=qe}else if(!(et[1].type==="linePrefix"||et[1].type==="blockQuotePrefix"||et[1].type==="blockQuotePrefixWhitespace"Line truncated
|
||||
`}]}function LB(e,t){const n=t.value?t.value+`
|
||||
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function zB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ml(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function $B(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function BN(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function FB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BN(e,t);const i={src:Ml(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function VB(e,t){const n={src:Ml(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function UB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function GB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BN(e,t);const i={href:Ml(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function qB(e,t){const n={href:Ml(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function WB(e,t,n){const r=e.all(t),i=n?YB(n):$N(t),o={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let h;p&&p.type==="element"&&p.tagName==="p"?h=p:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
|
||||
`}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
||||
`});const m={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,m),e.applyData(t,m)}function YB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=$N(n[r])}return t}function $N(e){const t=e.spread;return t??e.children.length>1}function XB(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function KB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function QB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JB(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=nv(t.children[1]),d=vN(t.children[t.children.length-1]);u&&d&&(a.position={start:u,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function e9(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let d=-1;const m=[];for(;++d<u;){const h=t.children[d],g={},y=a?a[d]:void 0;y&&(g.align=y);let v={type:"element",tagName:o,properties:g,children:[]};h&&(v.children=e.all(h),e.patch(h,v),v=e.applyData(h,v)),m.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function t9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gw=9,xw=32;function n9(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(yw(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(yw(t.slice(i),i>0,!1)),o.join("")}function yw(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===gw||o===xw;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===gw||o===xw;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function r9(e,t){const n={type:"text",value:n9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function i9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const s9={blockquote:DB,break:OB,code:LB,delete:zB,emphasis:PB,footnoteReference:BB,heading:$B,html:HB,imageReference:FB,image:VB,inlineCode:UB,linkReference:GB,link:qB,listItem:WB,list:XB,paragraph:KB,root:ZB,strong:QB,table:JB,tableCell:t9,tableRow:e9,text:r9,thematicBreak:i9,toml:ef,yaml:ef,definition:ef,footnoteDefinition:ef};function ef(){}const HN=-1,$m=0,tu=1,nm=2,cv=3,uv=4,dv=5,fv=6,FN=7,VN=8,vw=typeof self=="object"?self:globalThis,o9=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case $m:case HN:return n(a,i);case tu:{const u=n([],i);for(const d of a)u.push(r(d));return u}case nm:{const u=n({},i);for(const[d,m]of a)u[r(d)]=r(m);return u}case cv:return n(new Date(a),i);case uv:{const{source:u,flags:d}=a;return n(new RegExp(u,d),i)}case dv:{const u=n(new Map,i);for(const[d,m]of a)u.set(r(d),r(m));return u}case fv:{const u=n(new Set,i);for(const d of a)u.add(r(d));return u}case FN:{const{name:u,message:d}=a;return n(new vw[u](d),i)}case VN:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new vw[o](a),i)};return r},bw=e=>o9(new Map,e)(0),Wa="",{toString:a9}={},{keys:l9}=Object,zc=e=>{const t=typeof e;if(t!=="object"||!e)return[$m,t];const n=a9.call(e).slice(8,-1);switch(n){case"Array":return[tu,Wa];case"Object":return[nm,Wa];case"Date":return[cv,Wa];case"RegExp":return[uv,Wa];case"Map":return[dv,Wa];case"Set":return[fv,Wa];case"DataView":return[tu,n]}return n.includes("Array")?[tu,n]:n.includes("Error")?[FN,n]:[nm,n]},tf=([e,t])=>e===$m&&(t==="function"||t==="symbol"),c9=(e,t,n,r)=>{const i=(a,u)=>{const d=r.push(a)-1;return n.set(u,d),d},o=a=>{if(n.has(a))return n.get(a);let[u,d]=zc(a);switch(u){case $m:{let p=a;switch(d){case"bigint":u=VN,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([HN],a)}return i([u,p],a)}case tu:{if(d){let g=a;return d==="DataView"?g=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
||||
`}]}}const Hm=(function(e){if(e==null)return g9;if(typeof e=="function")return Fm(e);if(typeof e=="object")return Array.isArray(e)?m9(e):h9(e);if(typeof e=="string")return p9(e);throw new Error("Expected function, string, or object as test")});function m9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hm(e[n]);return Fm(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function h9(e){const t=e;return Fm(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function p9(e){return Fm(t);function t(n){return n&&n.type===e}}function Fm(e){return t;function t(n,r,i){return!!(x9(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function g9(){return!0}function x9(e){return e!==null&&typeof e=="object"&&"type"in e}const UN=[],y9=!0,Gy=!1,v9="skip";function GN(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Hm(i),a=r?-1:1;u(e,void 0,[])();function u(d,m,p){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return g;function g(){let y=UN,v,k,S;if((!t||o(d,m,p[p.length-1]||void 0))&&(y=b9(n(d,p)),y[0]===Gy))return y;if("children"in d&&d.children){const _=d;if(_.children&&y[0]!==v9)for(k=(r?_.children.length:-1)+a,S=p.concat(_);k>-1&&k<_.children.length;){const w=_.children[k];if(v=u(w,k,S)(),v[0]===Gy)return v;k=typeof v[1]=="number"?v[1]:k+a}}return y}}}function b9(e){return Array.isArray(e)?e:typeof e=="number"?[y9,e]:e==null?UN:[e]}function mv(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),GN(e,o,u,i);function u(d,m){const p=m[m.length-1],h=p?p.children.indexOf(d):void 0;return a(d,h,p)}}const qy={}.hasOwnProperty,_9={};function k9(e,t){const n=t||_9,r=new Map,i=new Map,o=new Map,a={...s9,...n.handlers},u={all:m,applyData:w9,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:S9,wrap:j9};return mv(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:i,g=String(p.identifier).toUpperCase();h.has(g)||h.set(g,p)}}),u;function d(p,h){const g=p.type,y=u.handlers[g];if(qy.call(u.handlers,g)&&y)return y(u,p,h);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in p){const{children:k,...S}=p,_=rm(S);return _.children=u.all(p),_}return rm(p)}return(u.options.unknownHandler||C9)(u,p,h)}function m(p){const h=[];if("children"in p){const g=p.children;let y=-1;for(;++y<g.length;){const v=u.one(g[y],p);if(v){if(y&&g[y-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=kw(v.value)),!Array.isArray(v)&&v.type==="element")){const k=v.children[0];k&&k.type==="text"&&(k.value=kw(k.value))}Array.isArray(v)?h.push(...v):h.push(v)}}}return h}}function S9(e,t){e.position&&(t.position=dz(e))}function w9(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,rm(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function C9(e,t){const n=t.data||{},r="value"in t&&!(qy.call(n,"hProperties")||qy.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j9(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
||||
`});++r<e.length;)r&&n.push({type:"text",value:`
|
||||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
||||
`}),n}function kw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Sw(e,t){const n=k9(e,t),r=n.one(e,void 0),i=f9(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
||||
`},i),o}function E9(e,t){return e&&"run"in e?async function(n,r){const i=Sw(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Sw(n,{file:r,...e||t})}}function ww(e){if(e)throw e}var Pg,Cw;function N9(){if(Cw)return Pg;Cw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),h=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!h)return!1;var g;for(g in m);return typeof g>"u"||e.call(m,g)},a=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},u=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(r)return r(m,p).value}else return;return m[p]};return Pg=function d(){var m,p,h,g,y,v,k=arguments[0],S=1,_=arguments.length,w=!1;for(typeof k=="boolean"&&(w=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<_;++S)if(m=arguments[S],m!=null)for(p in m)h=u(k,p),g=u(m,p),k!==g&&(w&&g&&(o(g)||(y=i(g)))?(y?(y=!1,v=h&&i(h)?h:[]):v=h&&o(h)?h:{},a(k,{name:p,newValue:d(w,v,g)})):typeof g<"u"&&a(k,{name:p,newValue:g}));return k},Pg}var I9=N9();const Bg=ta(I9);function Wy(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function T9(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...i);function u(d,...m){const p=e[++o];let h=-1;if(d){a(d);return}for(;++h<i.length;)(m[h]===null||m[h]===void 0)&&(m[h]=i[h]);i=m,p?R9(p,u)(...m):a(null,...m)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function R9(e,t){let n;return r;function r(...a){const u=e.length>a.length;let d;u&&a.push(i);try{d=e.apply(this,a)}catch(m){const p=m;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...u){n||(n=!0,t(a,...u))}function o(a){i(null,a)}}const Vi={basename:A9,dirname:M9,extname:D9,join:O9,sep:"/"};function A9(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function M9(e){if(Mu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function D9(e){Mu(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function O9(...e){let t=-1,n;for(;++t<e.length;)Mu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":L9(n)}function L9(e){Mu(e);const t=e.codePointAt(0)===47;let n=z9(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function z9(e,t){let n="",r=0,i=-1,o=0,a=-1,u,d;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else u===46&&o>-1?o++:o=-1}return n}function Mu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const P9={cwd:B9};function B9(){return"/"}function Yy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $9(e){if(typeof e=="string")e=new URL(e);else if(!Yy(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return H9(e)}function H9(e){if(e.hostname!==""){consLine truncated
|
||||
`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?XN:R$))),m(),d}}function R$(e,t,n){return t===0?e:XN(e,t,n)}function XN(e,t,n){return(n?"":" ")+e}const A$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];KN.peek=z$;function M$(){return{canContainEols:["delete"],enter:{strikethrough:O$},exit:{strikethrough:L$}}}function D$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:A$}],handlers:{delete:KN}}}function O$(e){this.enter({type:"delete",children:[]},e)}function L$(e){this.exit(e)}function KN(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function z$(){return"~"}function P$(e){return e.length}function B$(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||P$,o=[],a=[],u=[],d=[];let m=0,p=-1;for(;++p<e.length;){const k=[],S=[];let _=-1;for(e[p].length>m&&(m=e[p].length);++_<e[p].length;){const w=$$(e[p][_]);if(n.alignDelimiters!==!1){const C=i(w);S[_]=C,(d[_]===void 0||C>d[_])&&(d[_]=C)}k.push(w)}a[p]=k,u[p]=S}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<m;)o[h]=Aw(r[h]);else{const k=Aw(r);for(;++h<m;)o[h]=k}h=-1;const g=[],y=[];for(;++h<m;){const k=o[h];let S="",_="";k===99?(S=":",_=":"):k===108?S=":":k===114&&(_=":");let w=n.alignDelimiters===!1?1:Math.max(1,d[h]-S.length-_.length);const C=S+"-".repeat(w)+_;n.alignDelimiters!==!1&&(w=S.length+w+_.length,w>d[h]&&(d[h]=w),y[h]=w),g[h]=C}a.splice(1,0,g),u.splice(1,0,y),p=-1;const v=[];for(;++p<a.length;){const k=a[p],S=u[p];h=-1;const _=[];for(;++h<m;){const w=k[h]||"";let C="",N="";if(n.alignDelimiters!==!1){const O=d[h]-(S[h]||0),I=o[h];I===114?C=" ".repeat(O):I===99?O%2?(C=" ".repeat(O/2+.5),N=" ".repeat(O/2-.5)):(C=" ".repeat(O/2),N=C):N=" ".repeat(O)}n.delimiterStart!==!1&&!h&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||h)&&_.push(" "),n.alignDelimiters!==!1&&_.push(C),_.push(w),n.alignDelimiters!==!1&&_.push(N),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||h!==m-1)&&_.push("|")}v.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return v.join(`
|
||||
`)}function $$(e){return e==null?"":String(e)}function Aw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function H$(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),F$);return i(),a}function F$(e,t,n){return">"+(n?"":" ")+e}function V$(e,t){return Mw(e,t.inConstruct,!0)&&!Mw(e,t.notInConstruct,!1)}function Mw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Dw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
||||
`&&V$(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||||
`}function U$(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function G$(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function q$(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function W$(e,t,n,r){const i=q$(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(G$(e,n)){const h=n.enter("codeIndented"),g=n.indentLines(o,Y$);return h(),g}const u=n.createTracker(r),d=i.repeat(Math.max(U$(o,i)+1,3)),m=n.enter("codeFenced");let p=u.move(d);if(e.lang){const h=n.enter(`codeFencedLang${a}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${a}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
|
||||
`,encode:["`"],...u.current()})),h()}return p+=u.move(`
|
||||
`),o&&(p+=u.move(o+`
|
||||
`)),p+=u.move(d),m(),p}function Y$(e,t,n){return(n?"":" ")+e}function pv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function X$(e,t,n,r){const i=pv(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(u=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
||||
`,...d.current()}))),u(),e.title&&(u=n.enter(`title${o}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),u()),a(),m}function K$(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function im(e,t,n){const r=yl(e),i=yl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ZN.peek=Z$;function ZN(e,t,n,r){const i=K$(n),o=n.enter("emphasis"),a=n.createTracker(r),u=a.move(i);let d=a.move(n.containerPhrasing(e,{after:i,before:u,...a.current()}));const m=d.charCodeAt(0),p=im(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=yu(m)+d.slice(1));const h=d.charCodeAt(d.length-1),g=im(r.after.charCodeAt(0),h,i);g.inside&&(d=d.slice(0,-1)+yu(h));const y=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},u+d+y}function Z$(e,t,n){return n.options.emphasis||"*"}function Q$(e,t){let n=!1;return mv(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Gy}),!!((!e.depth||e.depth<3)&&ov(e)&&(t.options.setext||n))}function J$(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Q$(e,n)){const p=n.enter("headingSetext"),h=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
|
||||
`,after:`
|
||||
`});return h(),p(),g+`
|
||||
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
||||
`))+1))}const a="#".repeat(i),u=n.enter("headingAtx"),d=n.enter("phrasing");o.move(a+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
||||
`,...o.current()});return/^[\t ]/.test(m)&&(m=yu(m.charCodeAt(0))+m.slice(1)),m=m?a+" "+m:a,n.options.closeAtx&&(m+=" "+a),d(),u(),m}QN.peek=e7;function QN(e){return e.value||""}function e7(){return"<"}JN.peek=t7;function JN(e,t,n,r){const i=pv(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(u=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${o}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),u()),m+=d.move(")"),a(),m}function t7(){return"!"}eI.peek=n7;function eI(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const m=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(m+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return a(),n.stack=p,o(),i==="full"||!m||m!==h?d+=u.move(h+"]"):i==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function n7(){return"!"}tI.peek=r7;function tI(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],u=n.compilePattern(a);let d;if(a.atBreak)for(;d=u.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return i+r+i}function r7(){return"`"}function nI(e,t){const n=ov(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}rI.peek=i7;function rI(e,t,n,r){const i=pv(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,d;if(nI(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),u(),n.stack=p,h}u=n.enter("link"),d=n.enter("label");let m=a.move("[");return m+=a.move(n.containerPhrasing(e,{before:m,after:"](",...a.current()})),m+=a.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=a.move("<"),m+=a.move(n.safe(e.url,{before:m,after:">",...a.current()})),m+=a.move(">")):(d=n.enter("destinationRaw"),m+=a.move(n.safe(e.url,{before:m,after:e.title?" ":")",...a.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=a.move(" "+i),m+=a.move(n.safe(e.title,{before:m,after:i,...a.current()})),m+=a.move(i),d()),m+=a.move(")"),u(),m}function i7(e,t,n){return nI(e,n)?"<":"["}iI.peek=s7;function iI(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(m+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return a(),n.stack=p,o(),i==="full"||!m||m!==h?d+=u.move(h+"]"):i==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function s7(){return"["}function gv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function o7(e){const t=gv(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function a7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function sI(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function l7(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?a7(n):gv(n);const u=e.ordered?a==="."?")":".":o7(n);let d=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),sI(n)===a&&p){let h=-1;for(;++h<e.chilLine truncated
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:d,tableRow:u}};function a(y,v,k,S){return m(p(y,k,S),y.align)}function u(y,v,k,S){const _=h(y,k,S),w=m([_]);return w.slice(0,w.indexOf(`
|
||||
`))}function d(y,v,k,S){const _=k.enter("tableCell"),w=k.enter("phrasing"),C=k.containerPhrasing(y,{...S,before:o,after:o});return w(),_(),C}function m(y,v){return B$(y,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(y,v,k){const S=y.children;let _=-1;const w=[],C=v.enter("table");for(;++_<S.length;)w[_]=h(S[_],v,k);return C(),w}function h(y,v,k){const S=y.children;let _=-1;const w=[],C=v.enter("tableRow");for(;++_<S.length;)w[_]=d(S[_],y,v,k);return C(),w}function g(y,v,k){let S=aI.inlineCode(y,v,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function j7(){return{exit:{taskListCheckValueChecked:Lw,taskListCheckValueUnchecked:Lw,paragraph:N7}}}function E7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:I7}}}function Lw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function N7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function I7(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(a);let d=aI.listItem(e,t,n,{...r,...u.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(p){return p+a}}function T7(){return[l$(),I$(),M$(),v7(),j7()]}function R7(e){return{extensions:[c$(),T$(e),D$(),C7(e),E7()]}}const A7={tokenize:P7,partial:!0},lI={tokenize:B7,partial:!0},cI={tokenize:$7,partial:!0},uI={tokenize:H7,partial:!0},M7={tokenize:F7,partial:!0},dI={name:"wwwAutolink",tokenize:L7,previous:mI},fI={name:"protocolAutolink",tokenize:z7,previous:hI},Is={name:"emailAutolink",tokenize:O7,previous:pI},es={};function D7(){return{text:es}}let Po=48;for(;Po<123;)es[Po]=Is,Po++,Po===58?Po=65:Po===91&&(Po=97);es[43]=Is;es[45]=Is;es[46]=Is;es[95]=Is;es[72]=[Is,fI];es[104]=[Is,fI];es[87]=[Is,dI];es[119]=[Is,dI];function O7(e,t,n){const r=this;let i,o;return a;function a(h){return!Xy(h)||!pI.call(r,r.previous)||xv(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return Xy(h)?(e.consume(h),u):h===64?(e.consume(h),d):n(h)}function d(h){return h===46?e.check(M7,p,m)(h):h===45||h===95||wr(h)?(o=!0,e.consume(h),d):p(h)}function m(h){return e.consume(h),i=!0,d}function p(h){return o&&i&&Rr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function L7(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!mI.call(r,r.previous)||xv(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(A7,e.attempt(lI,e.attempt(cI,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function z7(e,t,n){const r=this;let i="",o=!1;return a;function a(h){return(h===72||h===104)&&hI.call(r,r.previous)&&!xv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(Rr(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(h),d}return n(h)}function d(h){return h===47?(e.consume(h),o?m:(o=!0,d)):n(h)}function m(h){return h===null||tm(h)||gn(h)||Yo(h)||Pm(h)?n(h):e.attempt(lI,e.attempt(cI,p),n)(h)}function p(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function P7(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function B7(e,t,n){let r,i,o;return a;function a(m){return m===46||m===95?e.check(uI,d,u)(m):m===null||gn(m)||Yo(m)||m!==45&&Pm(m)?d(m):(o=!0,e.consume(m),a)}function u(m){return m===95?r=!0:(i=r,r=void 0),e.consume(m),a}function d(m){return i||r||!o?n(m):t(m)}}function $7(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(uI,t,o)(a):a===null||gn(a)||Yo(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function H7(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),i):u===60||u===null||gn(u)||Yo(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||gn(u)||Yo(u)?t(u):r(u)}function o(u){return Rr(u)?a(u):n(u)}function a(u){re
Line truncated
|
||||
`),m=d.length>fH,p=m?d.length-Kg*2:0,h=j.useCallback(()=>{navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),1500)},[a]);return c.jsxs("div",{className:"code-block-wrap",children:[c.jsxs("div",{className:"code-block-header",children:[c.jsxs("span",{className:"code-block-lang",children:[u||"code",m?` (${d.length} lines)`:""]}),c.jsx("button",{className:"code-block-copy",onClick:h,children:n?c.jsxs(c.Fragment,{children:[c.jsx(Nl,{})," ",c.jsx("span",{children:"Copied"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Cm,{})," ",c.jsx("span",{children:"Copy"})]})})]}),c.jsx("pre",{children:c.jsx("code",{className:e,children:m&&!i?c.jsxs(c.Fragment,{children:[d.slice(0,Kg).join(`
|
||||
`)+`
|
||||
`,c.jsxs("span",{className:"code-block-omitted",onClick:()=>o(!0),children:["... +",p," lines (click to expand)"]}),`
|
||||
`+d.slice(-Kg).join(`
|
||||
`)]}):a})}),m&&i&&c.jsxs("button",{className:"code-block-collapse-btn",onClick:()=>o(!1),children:["Collapse (",d.length," lines)"]})]})}const hH={code({className:e,children:t,...n}){return e?.startsWith("language-")?c.jsx(mH,{className:e,children:t}):c.jsx("code",{className:e,...n,children:t})}},pH=3e3,gH=60,Zg=800;function Pw(e){if(e.length>pH)return!0;let t=0;for(let n=0;n<e.length;n++)if(e[n]===`
|
||||
`&&++t>=gH)return!0;return!1}function xH(e){const t=e.lastIndexOf(`
|
||||
`,Zg);return e.slice(0,t>Zg/2?t:Zg)}const sr=St.memo(function({content:t,className:n="msg-content-agent",collapseMode:r="auto"}){const i=r!=="never"&&Pw(t),[o,a]=j.useState(i);j.useEffect(()=>{a(r!=="never"&&Pw(t))},[r,t]);const u=o?xH(t):t,d=t.split(`
|
||||
`).length,m=t.length;return c.jsxs("div",{className:n,children:[c.jsx(Q9,{remarkPlugins:[dH],components:hH,children:u}),i&&o&&c.jsxs("button",{className:"msg-collapse-toggle",onClick:()=>a(!1),children:["Show more (",d," lines, ",(m/1e3).toFixed(1),"k chars)"]}),i&&!o&&c.jsx("button",{className:"msg-collapse-toggle",onClick:()=>a(!0),children:"Show less"})]})}),Bw={native:"OpenOPC Native",codex:"Codex",claude_code:"Claude Code",cursor:"Cursor",opencode:"OpenCode"},vu="codex",Qg="native",yH=["codex","native","claude_code","cursor","opencode"],vH=["native","codex","claude_code","cursor","opencode"];function gI(e){if(!e)return{kind:"fallback"};if(e.kind==="employee"){const t=String(e.id??e.employee_id??"").trim();return t?{kind:"employee",id:t}:{kind:"fallback"}}if(e.kind==="template"){const t=String(e.id??e.template_id??"").trim();return t?{kind:"template",id:t}:{kind:"fallback"}}return{kind:"fallback"}}function xI(e){const t=gI(e);return t.kind==="fallback"?"fallback:":`${t.kind}:${t.id??""}`}function bH(e,t,n){const r=String(e.role_id??"").trim(),i=String(e.role_label??"").trim(),o=`${r} ${i} ${e.role_responsibility??""}`.toLowerCase(),a=new Set((e.same_role_employee_ids??[]).map(m=>String(m??"").trim()).filter(Boolean)),u=t.map(m=>{const p=String(m.employee_id??"").trim(),h=String(m.employee_name??p).trim()||p,g=String(m.role_id??"").trim(),y=String(m.category??"").trim(),v=[g,y].filter(Boolean).join(" · ")||p;return{kind:"employee",id:p,name:h,subtitle:v,category:y,searchText:`${p} ${h} ${g} ${y} ${(m.domains??[]).join(" ")} ${(m.tags??[]).join(" ")}`.toLowerCase(),rank:a.has(p)||g===r?0:2}}).filter(m=>m.id).sort((m,p)=>m.rank-p.rank||m.name.localeCompare(p.name)),d=n.map(m=>{const p=String(m.template_id??"").trim(),h=String(m.template_name??p).trim()||p,g=String(m.category??"").trim(),y=[g,p].filter(Boolean).join(" · ")||p,v=`${p} ${h} ${g} ${(m.domains??[]).join(" ")} ${(m.tags??[]).join(" ")}`.toLowerCase(),k=o.split(/[^a-z0-9]+/).filter(S=>S.length>=3).reduce((S,_)=>S+(v.includes(_)?1:0),0);return{kind:"template",id:p,name:h,subtitle:y,category:g,searchText:v,rank:k}}).filter(m=>m.id).sort((m,p)=>p.rank-m.rank||m.name.localeCompare(p.name));return[...u,...d,{kind:"fallback",id:"",name:"Fallback role-only",subtitle:"No employee override",category:"fallback",searchText:"fallback role only no employee override"}]}function _H(e,t){const n=xI(t);return e.find(r=>`${r.kind}:${r.id}`===n)??e[0]}function kH(e,t){const n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?!0:n.every(r=>e.searchText.includes(r))}function SH(e){return e.map(t=>{const n=String(t.role_id??"").trim(),r=String(t.existing_employee?.employee_id??"").trim(),i=String(t.candidate?.template_id??"").trim(),o=r?{kind:"employee",id:r}:i?{kind:"template",id:i}:{kind:"fallback"};return{role_id:n,role_label:t.role_labels?.[0]??n,role_responsibility:"",default_selection:o,same_role_employee_ids:t.existing_employee_ids??[],fallback_available:!0,default_agent:t.default_agent??vu,selected_agent:t.selected_agent??t.default_agent??vu,default_source:"recruitment"}}).filter(t=>t.role_id)}function wH(e,t){return t.kind==="template"&&e?.candidate?.template_id===t.id?e.candidate.proposed_name||e.candidate.template_name||t.name:t.kind==="employee"&&e?.existing_employee?.employee_id===t.id&&e.existing_employee.employee_name||t.name}function $w(e,t){const n={},r=e.staffing_selections??{};for(const i of t){const o=String(i.role_id??"").trim();o&&(n[o]=gI(r[o]??i.default_selection))}return n}function Hw(e,t){const n=e.recruitment_role_agents??{},r={};for(const i of t){const o=String(i.role_id??"").trim();o&&(r[o]=n[o]??i.selected_agent??i.default_agent??vu)}return r}function CH(e){return!!(String(e.checkpoint_response_message_id??"").trim()||String(e.checkpoint_responded_at??"").trim()||String(e.checkpoint_reply_kind??"").trim())}const yI=St.memo(function({meta:t,onReply:n,responded:r}){const i=t.proposals??[],o=j.useMemo(()=>{const L={};for(const A of i){const M=String(A.role_id??"").trim();M&&(L[M]=A)}return L},[i]),a=j.useMemo(()=>t.staffing_roles?.length?t.staffing_roles:SH(i),[t.staffing_roles,i]),u=t.staffing_pool?.employees??[],d=t.staffing_pool?.templates??[],m=t.recruitment_rationales??[],p=j.useMemo(()=>{const L={};for(const A of a){const M=String(A.role_id??"").trim();M&&(L[M]=bH(A,u,d))}return L},[u,a,d]),[h,g]=j.useState({}),[y,v]=j.useState(""),[k,S]=j.useState(()=>$w(t,a)),[_,w]=j.useState(()=>Hw(t,a)),[C,N]=j.useState(t.recruitment_agent??Qg),O=r;j.useEffect(()=>{!O||!CH(t)||(S($w(t,a)),w(Hw(t,a)),N(t.recruitment_agent??Qg))},[O,t,a]),j.useEffect(()=>{N(t.recruitment_agent??Qg)},[t.recruitment_agent]);const I=j.useCallback(L=>{const A=String(t.checkpoint_id??"").trim();if(!A)throw new Error("Recruitment checkpoint reply requires checkpoint_id metadata.");const M=String(t.checkpoint_type??"").trim();return{response_to_checkpoint_id:A,response_to_checkpoint_type:M||"company_recruitment_confirmation",checkpoint_reply_kind:L,staffin
Line truncated
|
||||
`).map(t=>t.trim()).find(Boolean)??e}function OH(e){switch(e){case"timeout":case"timed_out":case"expired":return"Expired";case"stale":case"invalid":return"Inactive";case"cancelled":case"canceled":return"Cancelled";case"resolved":return"Resolved";default:return"Responded"}}const sm=St.memo(function({meta:t,onReply:n,responded:r}){const i=r,o=String(t.checkpoint_status??"").trim().toLowerCase(),a=OH(o),u=String(t.prompt??t.summary??""),d=j.useMemo(()=>u.split(`
|
||||
`).map(O=>O.trim()).filter(Boolean),[u]),m=DH(u).replace(/^\[[^\]]+\]\s*/,"")||"Action Required",p=d.slice(1).join(`
|
||||
`).trim(),h=String(t.summary??"").trim(),g=(t.options??[]).filter(O=>!!O?.id),y=j.useMemo(()=>(t.active_subagents??[]).filter(O=>!!O&&typeof O=="object"),[t.active_subagents]),v=j.useMemo(()=>(t.permission_requests??[]).filter(O=>!!O&&typeof O=="object"),[t.permission_requests]),k=String(t.worktree_path??"").trim(),S=y.length>0||v.length>0||!!k,[_,w]=j.useState(""),C=!!_&&!i;j.useEffect(()=>{if(!C)return;const O=window.setTimeout(()=>w(""),MH);return()=>window.clearTimeout(O)},[C,_]);const N=j.useCallback(O=>{i||C||(w(O.id),n(O.label||O.id))},[i,C,n]);return c.jsxs("div",{className:"ckpt-panel ckpt-escalation",children:[c.jsxs("div",{className:"ckpt-header",children:[c.jsx("div",{className:"ckpt-icon ckpt-icon-escalation",children:c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M8 1.5L14.5 13H1.5L8 1.5Z"}),c.jsx("path",{d:"M8 5.5V9"}),c.jsx("circle",{cx:"8",cy:"11.5",r:"0.75",fill:"currentColor",stroke:"none"})]})}),c.jsx("div",{className:"ckpt-title",children:m}),c.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:String(t.escalation_type??"decision_needed").replace(/_/g," ")}),i&&c.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:a})]}),h&&h!==m&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Summary"}),c.jsx(sr,{content:h,className:"ckpt-markdown"})]}),p&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Request"}),c.jsx(sr,{content:p,className:"ckpt-markdown"})]}),S&&c.jsxs("details",{className:"ckpt-runtime-details",children:[c.jsx("summary",{children:"Runtime State"}),c.jsxs("div",{className:"ckpt-runtime-body",children:[k&&c.jsxs("div",{children:["Worktree: ",c.jsx("code",{children:k})]}),y.length>0&&c.jsxs("div",{children:["Active subagents: ",y.length]}),v.length>0&&c.jsxs("div",{children:["Pending permission records: ",v.length]})]})]}),!i&&g.length>0&&c.jsx("div",{className:"ckpt-actions ckpt-escalation-actions",children:g.map(O=>c.jsx("button",{className:`ckpt-btn ${O.id.includes("deny")?"ckpt-btn-deny":"ckpt-btn-approve"}${C?" ckpt-btn-submitting":""}`,onClick:()=>N(O),disabled:C,children:C&&_===O.id?"Submitting…":O.label||O.id},O.id))}),C&&c.jsx("div",{className:"ckpt-escalation-hint",children:"Decision sent — waiting for server confirmation…"}),!i&&t.default_action&&c.jsxs("div",{className:"ckpt-escalation-hint",children:["Default on timeout: ",c.jsx("code",{children:t.default_action})]})]})});function LH(e){return e.split(`
|
||||
`).map(t=>t.trim()).find(Boolean)??e}function zH(e){switch(e){case"ignored":return"Ignored";case"timeout":case"timed_out":case"expired":return"Expired";case"stale":case"invalid":return"Inactive";case"superseded":return"Superseded";case"cancelled":case"canceled":return"Cancelled";case"resolved":return"Resolved";default:return"Responded"}}const SI=St.memo(function({meta:t,onReply:n,responded:r}){const i=r,[o,a]=j.useState(""),[u,d]=j.useState(null),m=String(t.checkpoint_status??"").trim().toLowerCase(),p=zH(m),h=String(t.prompt??t.summary??"").trim(),y=`${String(t.work_item_projection_title??LH(h)??"Human Review").trim()||"Human Review"} (for self-evolution)`,v=String(t.summary??"").trim(),k=j.useMemo(()=>(t.active_subagents??[]).filter(T=>!!T&&typeof T=="object"),[t.active_subagents]),S=j.useMemo(()=>(t.permission_requests??[]).filter(T=>!!T&&typeof T=="object"),[t.permission_requests]),_=String(t.worktree_path??"").trim(),w=k.length>0||S.length>0||!!_,C=i||u!==null,N=j.useCallback((T,L="")=>{const A=String(t.checkpoint_id??"").trim();if(!A)throw new Error("Delivery self-evolution reply requires checkpoint_id metadata.");const M={response_to_checkpoint_id:A,response_to_checkpoint_type:"company_delivery_feedback",checkpoint_reply_kind:T};return(T==="approve"||T==="feedback")&&(M.self_evolution_trigger=!0,M.human_feedback_text=L),M},[t.checkpoint_id]),O=j.useCallback(()=>{if(C)return;const T=N("approve");d("approve"),n("I fully agree with this delivery.",T)},[C,N,n]),I=j.useCallback(()=>{const T=o.trim();if(C||!T)return;const L=N("feedback",T);d("feedback"),n(T,L),a("")},[C,N,o,n]),D=j.useCallback(()=>{if(C)return;const T=N("ignore");d("ignore"),n("Ignore this self-evolution review.",T)},[C,N,n]);return c.jsxs("div",{className:"ckpt-panel ckpt-delivery-feedback",children:[c.jsxs("div",{className:"ckpt-header",children:[c.jsx("div",{className:"ckpt-icon ckpt-icon-user-input",children:c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M8 1.5L14 5v4.5c0 2.25-1.8 4.25-6 5-4.2-.75-6-2.75-6-5V5L8 1.5Z"}),c.jsx("path",{d:"M5.5 8.25L7.25 10l3.25-4"})]})}),c.jsx("div",{className:"ckpt-title",children:y}),c.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:String(t.feedback_scope??"final").replace(/_/g," ")}),i&&c.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:p})]}),v&&v!==y&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Summary"}),c.jsx(sr,{content:v,className:"ckpt-markdown"})]}),h&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Review Request"}),c.jsx(sr,{content:h,className:"ckpt-markdown"})]}),w&&c.jsxs("details",{className:"ckpt-runtime-details",children:[c.jsx("summary",{children:"Runtime State"}),c.jsxs("div",{className:"ckpt-runtime-body",children:[_&&c.jsxs("div",{children:["Worktree: ",c.jsx("code",{children:_})]}),k.length>0&&c.jsxs("div",{children:["Active subagents: ",k.length]}),S.length>0&&c.jsxs("div",{children:["Pending permission records: ",S.length]})]})]}),!i&&c.jsxs("div",{className:"ckpt-actions ckpt-actions-inline-feedback",children:[c.jsx("button",{className:"ckpt-btn ckpt-btn-approve",onClick:O,disabled:C,children:"Fully Agree"}),c.jsx("button",{className:"ckpt-btn ckpt-btn-cancel",onClick:D,disabled:C,children:"Ignore"}),c.jsx("textarea",{className:"ckpt-feedback-input ckpt-feedback-inline-input",placeholder:"Feedback for self-evolution...",value:o,onChange:T=>a(T.target.value),disabled:C,rows:2}),c.jsx("button",{className:"ckpt-btn ckpt-btn-feedback",onClick:I,disabled:C||!o.trim(),children:"Send Feedback"})]})]})}),sf="__other__",PH=["A","B","C"];function Ui(e){return String(e??"").trim()}function BH(e,t){const n=Ui(e.question),r=Ui(e.header);if(!n&&!r)return null;const i=(e.options??[]).slice(0,3).map((o,a)=>({id:Ui(o.id)||String.fromCharCode(97+a),label:Ui(o.label),description:Ui(o.description)})).filter(o=>o.label);return{id:Ui(e.id)||`question_${t+1}`,header:r,question:n||r,options:i,allow_freeform:e.allow_freeform!==!1,required:e.required!==!1}}const wI=St.memo(function({meta:t,onReply:n,responded:r}){const[i,o]=j.useState(""),[a,u]=j.useState({}),d=r,m=String(t.work_item_projection_title??t.work_item_projection_id??"Input Needed").trim()||"Input Needed",p=String(t.summary??"").trim(),h=String(t.prompt??"").trim(),g=String(t.context_note??"").trim(),y=String(t.resume_hint??"").trim(),v=j.useMemo(()=>(t.questions??[]).map(V=>String(V).trim()).filter(Boolean),[t.questions]),k=j.useMemo(()=>(t.input_questions??[]).map((V,Y)=>BH(V,Y)).filter(V=>V!==null),[t.input_questions]),S=k.some(V=>(V.options??[]).length>0),_=j.useMemo(()=>(t.required_fields??[]).map(V=>String(V).trim()).filter(Boolean),[t.required_fields]),w=j.useMemo(()=>(t.active_subagents??[]).filter(V=>!!V&&typeof V=="object"),[t.active_subagents]),C=j.useMemo((
Line truncated
|
||||
`),{user_input_answers:V})},[a,B,k,d,n]);return c.jsxs("div",{className:"ckpt-panel ckpt-user-input",children:[c.jsxs("div",{className:"ckpt-header",children:[c.jsx("div",{className:"ckpt-icon ckpt-icon-user-input",children:c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M3 3.5h10v6H6.5L3 13V3.5Z"}),c.jsx("path",{d:"M5.5 6h5"}),c.jsx("path",{d:"M5.5 8h3.5"})]})}),c.jsx("div",{className:"ckpt-title",children:m}),c.jsx("span",{className:"ckpt-badge ckpt-badge-scope",children:"awaiting input"}),d&&c.jsx("span",{className:"ckpt-badge ckpt-badge-responded",children:"Responded"})]}),p&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Summary"}),c.jsx(sr,{content:p,className:"ckpt-markdown"})]}),h&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Request"}),c.jsx(sr,{content:h,className:"ckpt-markdown"})]}),S?c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Questions"}),c.jsx("div",{className:"ckpt-choice-list",children:k.map(V=>{const Y=a[V.id]??{freeformText:""},Q=V.options??[],q=V.allow_freeform!==!1,G=q&&(Q.length===0||Y.selectedOptionId===sf);return c.jsxs("div",{className:"ckpt-choice-question",children:[V.header&&c.jsx("div",{className:"ckpt-question-header",children:V.header}),c.jsx(sr,{content:V.question,className:"ckpt-markdown"}),Q.length>0&&c.jsxs("div",{className:"ckpt-choice-grid",children:[Q.map((J,P)=>{const X=Y.selectedOptionId===J.id;return c.jsxs("button",{className:`ckpt-choice-option${X?" is-selected":""}`,onClick:()=>M(V.id,J.id),children:[c.jsx("span",{className:"ckpt-choice-letter",children:PH[P]??"?"}),c.jsxs("span",{className:"ckpt-choice-copy",children:[c.jsx("span",{className:"ckpt-choice-label",children:J.label}),J.description&&c.jsx("span",{className:"ckpt-choice-desc",children:J.description})]})]},J.id)}),q&&c.jsxs("button",{className:`ckpt-choice-option${Y.selectedOptionId===sf?" is-selected":""}`,onClick:()=>M(V.id,sf),children:[c.jsx("span",{className:"ckpt-choice-letter",children:"D"}),c.jsxs("span",{className:"ckpt-choice-copy",children:[c.jsx("span",{className:"ckpt-choice-label",children:"Other"}),c.jsx("span",{className:"ckpt-choice-desc",children:"Enter a custom answer"})]})]})]}),G&&c.jsx("textarea",{className:"ckpt-feedback-input ckpt-other-field",placeholder:"Type your answer...",value:Y.freeformText,onChange:J=>$(V.id,J.target.value),rows:3})]},V.id)})})]}):v.length>0&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Questions"}),c.jsx("ul",{className:"ckpt-task-list",children:v.map(V=>c.jsx("li",{children:V},V))})]}),_.length>0&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Required Fields"}),c.jsx("div",{className:"ckpt-task-tags",children:_.map(V=>c.jsx("span",{className:"ckpt-field-tag",children:V},V))})]}),g&&c.jsxs("div",{className:"ckpt-section",children:[c.jsx("div",{className:"ckpt-section-title",children:"Context"}),c.jsx(sr,{content:g,className:"ckpt-markdown ckpt-markdown-muted"})]}),y&&c.jsx("div",{className:"ckpt-escalation-hint",children:y}),A&&c.jsxs("details",{className:"ckpt-runtime-details",children:[c.jsx("summary",{children:"Runtime State"}),c.jsxs("div",{className:"ckpt-runtime-body",children:[O&&c.jsxs("div",{children:["Requester: ",c.jsx("code",{children:O})]}),D&&c.jsxs("div",{children:["Work item: ",c.jsx("code",{children:D})]}),I&&c.jsxs("div",{children:["Task: ",c.jsx("code",{children:I})]}),T&&c.jsxs("div",{children:["Seat: ",c.jsx("code",{children:T})]}),N&&c.jsxs("div",{children:["Worktree: ",c.jsx("code",{children:N})]}),w.length>0&&c.jsxs("div",{children:["Active subagents: ",w.length]}),C.length>0&&c.jsxs("div",{children:["Pending permission records: ",C.length]})]})]}),!d&&c.jsxs("div",{className:"ckpt-feedback-area",children:[S?null:c.jsx("textarea",{className:"ckpt-feedback-input",placeholder:"Reply with the missing input to continue...",value:i,onChange:V=>o(V.target.value),rows:3}),c.jsx("div",{className:"ckpt-feedback-btns",children:c.jsx("button",{className:"ckpt-btn ckpt-btn-approve",onClick:S?H:U,disabled:S?!B:!i.trim(),children:"Send Reply"})})]})]})}),Zy={todo:"To do",in_progress:"In progress",in_review:"In review",done:"Done"};function ex(e,t){if(t&&t in Zy)return t;switch(e){case"active":return"in_progress";case"waiting":return"in_review";case"done":return"done";case"failed":return"done";case"pending":return"todo";default:return"todo"}}function of(e){return Zy[e]??Zy.todo}const qw={active:0,waiting:1,failed:2,done:3,pending:4};function $H(e){if(e.length===0)return"pending";let t=e[0],n=qw[t]??99;for(const r of e){const i=qw[r]??99;i<n&&(t=r,n=i)}return t}const HH={native:"Native",codex:"Codex",claude_code:"Claude Code",cursor
Line truncated
|
||||
`)[0].slice(0,140),tone:"danger"};const o=t.match(/^\[Company:([^\]]+)\]\s*(.+)$/);if(o){const d=o[1].split("::"),m=d[0]||"company",p=o[2].trim(),h=p.toLowerCase(),g=h.includes("completed")||h.includes("done")?"success":h.includes("blocked")||h.includes("failed")?"warning":"info";return{kind:"company_event",label:`${m.toUpperCase()} · ${d[1]??""}`.replace(/ · $/,""),summary:p,tone:g}}const a=t.match(/^(Review needed|Status digest|Blocked|Completion):\s*(.+)$/i);if(a){const d=a[1].replace(/\b\w/g,p=>p.toUpperCase()),m=nu(a[2]);return{kind:"company_event",label:d,summary:m,tone:/^Blocked$/i.test(a[1])?"warning":"info"}}const u=t.match(/^NO_DELEGATION_JUSTIFICATION:\s*(.+)$/i);return u?{kind:"company_event",label:"Delegation check",summary:nu(u[1]).slice(0,180),tone:"info"}:null}function xF(e,t){const{isCompanyRuntime:n,detailMode:r}=t;if(!n||r==="full"||lu(e.metadata))return null;const i=jI(e.content);if(!i)return null;const o=e.sender==="system"||e.metadata?.type==="system",a=i.kind==="company_event"||e.content.startsWith("[Company:");return!o&&!a?null:{msg:e,classification:i}}function yF(e,t={}){const{isCompanyRuntime:n=!1,detailMode:r="summary"}=t,i=[];let o=[],a=0;const u=new Set,d=new Set,m=()=>{if(o.length===0)return;const p=o[0].msg,h=o[o.length-1].msg;i.push({kind:"ops-bundle",id:`ops:${p.id}:${o.length}:${h.id}`,timestamp:p.timestamp,events:o,sortOrder:a}),o=[]};return e.forEach((p,h)=>{const g=h*2+1,y=xF(p,{isCompanyRuntime:n,detailMode:r});if(y){o.length===0&&(a=g),o.push(y);return}const v=r==="summary"?CI(p.content):null;if(v){const k=[p.sender,Math.round(p.timestamp/1e3),v.kind,nu(v.summary||v.acceptanceSummary||"").slice(0,500),v.verdict??"",v.deliverables.map(S=>`${S.name}:${S.path}`).join("|").slice(0,800)].join("");if(u.has(k))return;u.add(k)}if(r==="summary"){const k=nu(oF(p.content)).slice(0,1200);if(k){const S=aF(p)?["result",k].join(""):[p.sender,Math.round(p.timestamp/1e3),k].join("");if(d.has(S))return;d.add(S)}}m(),i.push({kind:"message",id:p.id,timestamp:p.timestamp,msg:p,sortOrder:g})}),m(),i}const vF=St.memo(function({msg:t,showDate:n,dateStr:r,classification:i}){const[o,a]=j.useState(!1),u=t.content.trim()!==`[${i.label}] ${i.summary}`.trim()&&t.content.trim().length>i.summary.length+4;return c.jsxs("div",{children:[n&&c.jsx("div",{className:"msg-date-sep",children:c.jsx("span",{children:r})}),c.jsxs("div",{className:`msg-ops-row msg-ops-tone-${i.tone}${o?" expanded":""}`,onClick:u?()=>a(d=>!d):void 0,role:u?"button":void 0,tabIndex:u?0:-1,children:[c.jsx("span",{className:"msg-ops-dot","aria-hidden":"true"}),c.jsx("span",{className:"msg-ops-label",children:i.label}),i.summary&&c.jsx("span",{className:"msg-ops-summary",title:i.summary,children:i.summary}),c.jsx("span",{className:"msg-ops-time",title:Zi(t.timestamp),children:Es(t.timestamp)}),u&&c.jsx("span",{className:`msg-ops-chevron${o?" open":""}`,"aria-hidden":"true",children:c.jsx(Yi,{down:o})})]}),u&&o&&c.jsx("div",{className:"msg-ops-details",children:c.jsx("pre",{className:"msg-ops-details-pre",children:t.content})})]})}),bF=St.memo(function({events:t,showDate:n,dateStr:r}){const[i,o]=j.useState(!1);if(t.length===0)return null;const a=t[0].msg,u=t[t.length-1].msg,d=t.reduce((h,g)=>{const y=g.classification.kind==="company_event"?"company":g.classification.kind.startsWith("external")?"runtime":"delegation";return h[y]=(h[y]??0)+1,h},{}),m=Object.entries(d).map(([h,g])=>`${g} ${h}`).join(" · "),p=`${t.length} technical event${t.length===1?"":"s"} hidden`;return c.jsxs("div",{children:[n&&c.jsx("div",{className:"msg-date-sep",children:c.jsx("span",{children:r})}),c.jsxs("button",{type:"button",className:`msg-ops-bundle${i?" expanded":""}`,onClick:()=>o(h=>!h),title:`${Zi(a.timestamp)} - ${Zi(u.timestamp)}`,children:[c.jsx("span",{className:"msg-ops-bundle-dot"}),c.jsx("span",{className:"msg-ops-bundle-title",children:p}),c.jsx("span",{className:"msg-ops-bundle-summary",children:m}),c.jsx("span",{className:"msg-ops-bundle-time",children:Es(a.timestamp)}),c.jsx("span",{className:"msg-ops-bundle-chevron",children:c.jsx(Yi,{down:i})})]}),i&&c.jsx("div",{className:"msg-ops-bundle-details",children:t.map(({msg:h,classification:g})=>c.jsxs("div",{className:`msg-ops-bundle-event msg-ops-tone-${g.tone}`,children:[c.jsx("span",{className:"msg-ops-dot"}),c.jsx("span",{className:"msg-ops-label",children:g.label}),c.jsx("span",{className:"msg-ops-summary",children:g.summary}),c.jsx("span",{className:"msg-ops-time",title:Zi(h.timestamp),children:Es(h.timestamp)})]},h.id))})]})});function _F(e){return e.kind==="review"?`Review · ${e.verdict?e.verdict.replace(/_/g," "):"review"}`:e.kind==="report"?"Report":"Update"}const kF=St.memo(function({msg:t,payload:n,showDate:r,dateStr:i,isCopied:o,onCopy:a}){const u=yv(t.sender==="system"?t.senderName||"OPC":t.sender),d=t.senderDeleted?"[Deleted]":t.senderName,m=_F(n),p=n.summary||n.acceptanceSummary||m;return c.jsxs("div",{children:[r&&c.jsx("div",{className:"msg-date-sep",children:c.jsx("spa
Line truncated
|
||||
|
||||
Set up at least one role before running a task.
|
||||
|
||||
Go to Org tab now?`)&&n?.(),!1;if(a.length>1&&!u)return confirm(`Your organization has multiple top-level roles but no final decider selected.
|
||||
|
||||
Choose one final decider in the Org tab before running a task.
|
||||
|
||||
Go to Org tab now?`)&&n?.(),!1;const d=[],m=new Set(r.map(y=>y.role_id));o.runtimeTeams.filter(y=>y.member_role_ids.some(v=>m.has(v))||y.manager_role_id&&m.has(y.manager_role_id)).length===0&&d.push("No runtime teams defined — the system will auto-generate from your roles");const h=new Set(i.map(y=>y.role_id)),g=r.filter(y=>!h.has(y.role_id));if(g.length>0){const y=g.map(v=>v.name).join(", ");d.push(`${g.length} role(s) have no employees: ${y}`)}return d.length>0?confirm(`Before running this task:
|
||||
|
||||
`+d.map(y=>"• "+y).join(`
|
||||
`)+`
|
||||
|
||||
Run anyway?`):!0}function tV(e){if(!e)return!1;const t=zm(e);return!!(t.projectRun?.run_id||t.runtimeTeams.length>0||t.runtimeSeats.length>0)}function uC(e,t){const n=!!t?.childDetail;return e?n?"full":e.execMode==="company"||e.execMode==="org"||e.execMode==="custom"?"summary":"full":"summary"}function dC(e){return String(e?.originTaskId??e?.taskId??"").trim()||null}function nV({boardColor:e,title:t,onCommit:n}){const[r,i]=j.useState(!1),[o,a]=j.useState(t),u=j.useRef(null);j.useEffect(()=>{r||a(t)},[t,r]);const d=j.useCallback(()=>{const p=o.trim();p&&p!==t?n(p):a(t),i(!1)},[o,t,n]),m=j.useCallback(()=>{a(t),i(!0),setTimeout(()=>u.current?.select(),0)},[t]);return c.jsx("div",{className:"board-selector",children:c.jsx("div",{className:"board-tabs",children:c.jsxs("span",{className:"board-tab active board-tab-editable",style:{"--board-color":e},children:[c.jsx("span",{className:"board-tab-dot",style:{background:e}}),r?c.jsx("input",{ref:u,className:"board-tab-title-input",value:o,onChange:p=>a(p.target.value),onBlur:d,onKeyDown:p=>{p.key==="Enter"&&d(),p.key==="Escape"&&(a(t),i(!1))}}):c.jsx("span",{className:"board-tab-title",onClick:m,title:"Click to edit session title",children:t})]})})})}function rV({boardStore:e,agents:t,officeMap:n,execMode:r,companyProfile:i,taskPreferredAgent:o,chatStore:a,sessionStore:u,projectId:d,onRunTask:m,onCreateTask:p,onMoveTask:h,onCreateSession:g,onSessionSend:y,onSecretarySend:v,onDeleteSession:k,onTitleChange:S,onSessionConfigChange:_,onSessionTaskAgentChange:w,onContinueInNewChat:C,onSessionStop:N,onSessionResume:O,onSessionComplete:I,onLoadSessionDetail:D,onOpenExecutionPanel:T,onCollabSync:L,orgInfoData:A,onNavigateToOrg:M,recoveryStatus:$,onRecoveryResume:W,onRecoveryCancel:B,commsState:U,commsMessage:H,onCommsRefresh:V,onCommsReadMessage:Y,savedOrgsList:Q,activeSavedOrg:q,onSavedOrgsList:G,onSavedOrgLoad:J}){const{sessions:P,activeSessionId:X,activeSession:ee}=u,[te,re]=j.useState("collapsed"),{width:oe,isResizing:de,handleMouseDown:se}=QF({initialWidth:380,minWidth:300,maxWidth:600,onCollapse:()=>re("collapsed")}),[Ee,we]=j.useState("chat"),[Ce,Be]=j.useState(null),[Ge,Ye]=j.useState({kind:"activity"}),[yt,qt]=j.useState([]),[bt,vt]=j.useState(!1),[me,Oe]=j.useState({}),rt=j.useRef(D),Qe=j.useRef({active:null,child:null}),Je=r==="company"||r==="org"||r==="custom",fe=`secretary:${d}`,be=`activity:${d}`,Me=j.useMemo(()=>Ce?P.find(ue=>ue.taskId===Ce)??null:null,[P,Ce]),Fe=j.useMemo(()=>Ge.kind!=="task-detail"?null:e.tasks.find(ue=>ue.id===Ge.taskId)??null,[Ge,e.tasks]),$e=j.useMemo(()=>{const ue=Lm(Fe);return ue?P.find(Se=>Se.taskId===ue||Se.runtimeTaskId===ue||Se.executionTurnId===ue)??null:null},[P,Fe]),Wt=j.useMemo(()=>$e?a.getChannelMessages($e.channelId):[],[a.messages,a.getChannelMessages,$e]),nn=j.useMemo(()=>jf(ee,P),[P,ee]),ke=j.useMemo(()=>$f(ee,P),[P,ee]),Te=j.useMemo(()=>Hf(ee,[...ke,...nn]),[ee,nn,ke]);j.useEffect(()=>{rt.current=D},[D]);const Pe=j.useCallback((ue,Se,Ue="summary")=>{const ft=rt.current;!ft||!ue||(Oe(Kt=>Kt[ue]?Kt:{...Kt,[ue]:!0}),ft(ue,{limit:JF,beforeCreatedAt:Se?.timestamp,beforeMessageId:Se?.id,detailLevel:Ue}),window.setTimeout(()=>{Oe(Kt=>Kt[ue]?{...Kt,[ue]:!1}:Kt)},800))},[]),Ve=j.useCallback(ue=>!!me[ue],[me]);j.useEffect(()=>{Qe.current={active:null,child:null}},[d]),j.useEffect(()=>{Ce&&!Me&&Be(null)},[Ce,Me]),j.useEffect(()=>{Ge.kind==="task-detail"&&!Fe&&Ye({kind:"activity"})},[Ge,Fe]);const qe=j.useRef(null);j.useEffect(()=>{if(!$e){qe.current=null;return}qe.current!==$e.taskId&&(qe.current=$e.taskId,Pe($e.taskId,void 0,"full"))},[$e,Pe]),j.useEffect(()=>{if(!Ce){Qe.current.child=null;return}Qe.current.child!==Ce&&(Qe.current.child=Ce,Pe(Ce,void 0,"full"))},[Ce,Pe]),j.useEffect(()=>{if(!X){Qe.current.active=null;return}const ue=Te.timelineSessions.length>0?Te.timelineSessions:P.find(Ue=>Ue.taskId===X)?[P.find(Ue=>Ue.taskId===X)]:[];if(ue.length===0){Qe.current.active=null;return}const Se=ue.map(Ue=>`${Ue.taskId}:${uC(Ue,{childDetail:Ue.mode==="child"})}`).join("|");if(Qe.current.active!==Se){Qe.current.active=Se;for(const Ue of ue)Pe(Ue.taskId,void 0,uC(Ue,{childDetail:Ue.mode==="child"}))}},[Te.timelineSessions,X,Pe,P]);const et=j.useMemo(()=>Ce?{kind:"child-detail"}:Ge.kind==="task-detail"||Ge.kind==="secretary"?Ge:X?{kind:"session",taskId:X}:{kind:"activity"},[Ge,X,Ce]),Mn=j.useMemo(()=>et.kind==="secretary"?fe:et.kind==="child-detail"&&Me?Me.channelId:et.kind==="session"&&Te.displaySession?Te.displaySession.channelId:et.kind==="session"&&ee?ee.channelId:be,[et,Te.displaySession,ee,Me,fe,be]),Tn=j.useMemo(()=>{if(et.kind==="activity")return[be];if(et.kind==="secretary")return[fe];if(et.kind==="child-detail"&&Me)return[Me.channelId];if(et.kind==="session"){const ue=Te.timelineSessions.map(Se=>Se.channelId).filter((Se,Ue,ft)=>!!Se&&ft.indexOf(Se)===Ue);if(ue.length>0)return ue}return Mn?[Mn]:[]},[et.kind,Te.timelineSessions,Me,be,fe,Mn]),Dn=j.useMemo(()=>{const ue=new Set;for(const Se of P)Se.status!=="cancelled"&&ue.add(Se.
Line truncated
|
||||
`).replace(/\r/g,`
|
||||
`).split(`
|
||||
`).map(i=>i.trimEnd()).join(`
|
||||
`).replace(/\n{3,}/g,`
|
||||
|
||||
`).trim(),n=sV(t),r=n.split(/\n{2,}/).map(i=>i.trim()).filter(Boolean);return r.length>1&&/^Verification:\s/i.test(r[r.length-1])?r.slice(0,-1).join(`
|
||||
|
||||
`).trim():n}function sV(e){const t=String(e||"").trim(),n=t.match(/^\*\*(.{8,160}?)\*\*:\s+([\s\S]+)$/);if(n){const a=n[2].trim();if(a.length>=80)return a}const r=t.indexOf(": ");if(r<8||r>160)return t;const i=t.slice(0,r).replace(/\*/g,"").trim(),o=t.slice(r+2).trim();return o.length<80||!/[A-Za-z\u4e00-\u9fff]/.test(i)||/^(https?|file)$/i.test(i)?t:o}function Ko(e){const t=Xo(e),n=new Set,r=typeof t.checkpoint_type=="string"?t.checkpoint_type.trim():"",i=typeof t.checkpoint_id=="string"?t.checkpoint_id.trim():"";for(const o of[e.id,typeof t.ui_message_id=="string"?t.ui_message_id:"",r&&i?`checkpoint:${r}:${i}`:""]){const a=String(o??"").trim();a&&n.add(a)}return n}function oV(e){return e.startsWith("checkpoint:")}function Xi(e){return typeof e.timestamp=="number"?e.timestamp:0}function mC(e){const t=String(e.sender??"").trim().toLowerCase(),n=Xo(e),r=typeof n.role=="string"?n.role.trim().toLowerCase():"";return t==="user"||r==="user"?"user":"assistant"}function hC(e){const t=Xo(e),n=String(e.sender??"").trim().toLowerCase();let r=0;const i=TI(e);return i&&(r+=1e3+i),t.source==="engine"&&(r+=100),n&&n!=="system"&&(r+=20),n&&!["assistant","system","user"].includes(n)&&(r+=5),e.replyToId&&(r+=2),r+=Math.min(Object.keys(t).length,10),r}function pC(e){return String(Xo(e).source??"").trim().toLowerCase()==="engine"}function TI(e){const t=Xo(e),n=String(t.transcript_kind??"").trim();if(n)return fC[n]??0;const r=String(t.kind??"").trim();return fC[r]??0}function am(e){return TI(e)>0}function RI(e,t){if(e.channelId!==t.channelId)return!1;const n=Ko(e),r=Ko(t);for(const i of n)if(r.has(i))return!0;return!1}function t0(e,t){if(RI(e,t))return!0;if(e.channelId!==t.channelId||mC(e)!==mC(t)||om(e.content)!==om(t.content))return!1;const n=am(e)&&am(t);if(!n&&String(e.replyToId??"")!==String(t.replyToId??"")||!(pC(e)||pC(t)))return!1;const r=Xi(e),i=Xi(t);return!(!n&&r&&i&&Math.abs(r-i)>_v)}function n0(e,t,n=!1){let r=e,i=t;(n||hC(t)>hC(e))&&(r=t,i=e);const o=[];for(const h of[i.mentions,r.mentions])for(const g of h??[])o.includes(g)||o.push(g);const a=Ko(e),u=Ko(t);let d="";for(const h of a)if(u.has(h)&&!oV(h)){d=h;break}const m=om(r.content),p=m&&m===om(i.content)?m:r.content;return{...i,...r,...d?{id:d}:{},content:p,metadata:{...Xo(i),...Xo(r)},mentions:o,timestamp:Xi(r)||Xi(i)}}function lx(e){const t=[],n=new Map;for(const r of[...e].sort((i,o)=>Xi(i)-Xi(o))){const i=Ko(r);let o=-1,a=!1;for(const d of i){const m=n.get(d);if(m!==void 0){o=m,a=t[m].id===r.id;break}}if(o===-1){const d=Xi(r),m=am(r);for(let p=t.length-1;p>=0;p--){const h=Xi(t[p]);if(!m&&d>0&&h>0&&d-h>_v)break;if(t0(t[p],r)){o=p;break}}}const u=o===-1?t.length:o;o===-1?t.push(r):t[o]=n0(t[o],r,a);for(const d of Ko(t[u]))n.has(d)||n.set(d,u)}return t}function aV(e,t){switch(t.type){case"SET":return t.channels;case"CLEAR":return[];case"ADD":return e.some(n=>n.id===t.channel.id)?e:[...e,t.channel];case"REMOVE":return e.filter(n=>n.id!==t.channelId);case"REMOVE_PARTICIPANT":return e.map(n=>({...n,participants:n.participants.filter(r=>r!==t.agentId)}));default:return e}}function lV(e,t){switch(t.type){case"SET":{const n=lx(t.messages);if(e.length===0)return n;const r=e.filter(i=>typeof i.id=="string"&&i.id.startsWith("msg-")&&!n.some(o=>t0(i,o)));return r.length===0?n:lx([...n,...r])}case"CLEAR":return[];case"ADD":{const n=Xi(t.message);Ko(t.message);let r=!1;for(let i=e.length-1;i>=0;i--){const o=Xi(e[i]);if(!r&&n>0&&o>0&&n-o>_v&&(r=!0),RI(e[i],t.message)){const a=[...e];return a[i]=n0(e[i],t.message,e[i].id===t.message.id),a}if((am(t.message)||!r)&&t0(e[i],t.message)){const a=[...e];return a[i]=n0(e[i],t.message),a}}return[...e,t.message]}case"MERGE":return t.messages.length===0?e:lx([...e,...t.messages]);case"MARK_SENDER_DELETED":return e.map(n=>n.sender===t.senderId?{...n,senderDeleted:!0,senderName:"[已删除的 Agent]"}:n);case"REMOVE_BY_CHANNEL":return e.filter(n=>n.channelId!==t.channelId);case"REMOVE_BY_TASK_ID":return e.filter(n=>n.channelId!==`session:${t.taskId}`&&n.metadata?.task_id!==t.taskId);default:return e}}function cV(){const[e,t]=j.useReducer(aV,[]),[n,r]=j.useReducer(lV,[]),[i,o]=j.useState({}),[a,u]=j.useState("default"),d=j.useMemo(()=>{const I={};for(const D of n)I[D.channelId]||(I[D.channelId]=[]),I[D.channelId].push(D);return I},[n]),m=j.useMemo(()=>{const I={};for(const D of n){if(D.sender==="user")continue;const T=i[D.channelId]??0;D.timestamp<=T||(I[D.channelId]=(I[D.channelId]??0)+1)}return I},[n,i]),p=j.useCallback(I=>{const D={id:`msg-${iV()}`,channelId:I.channelId,sender:I.sender,senderName:I.senderName,content:I.content,timestamp:Date.now(),replyToId:I.replyToId,mentions:[],metadata:I.metadata};return r({type:"ADD",message:D}),D},[]),h=j.useCallback(I=>d[I]??[],[d]),g=j.useCallback(I=>m[I]??0,[m]),y=j.useCallback(I=>{o(D=>({...D,[I]:Date.now()}))},[]),v=j.useCallback(I=>{r({type:"MARK_SENDER_DELETED",senderId:I})},[]),k=j.useCallback(I=>{t({type:"REMOVE_PARTICIPANT",agentId:I})},[]),S=j.useCallback(I=>{t({type:"REMOVE",channe
Line truncated
|
||||
${t}`:`${e}${t}`}function uV(e,t){const n=e.trim().replace(/\s+/g," ");return n?n.length>120?`${n.slice(0,120).trimEnd()}...`:n:t||"Thinking"}function dV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,summary:typeof e.summary=="string"?e.summary:"",detail:typeof e.detail=="string"&&e.detail?e.detail:void 0,turnId:typeof e.turnId=="string"&&e.turnId?e.turnId:void 0,itemId:typeof e.itemId=="string"&&e.itemId?e.itemId:void 0,streamId:typeof e.streamId=="string"&&e.streamId?e.streamId:void 0,toolCallId:typeof e.toolCallId=="string"&&e.toolCallId?e.toolCallId:void 0,permissionGroupKey:typeof e.permissionGroupKey=="string"&&e.permissionGroupKey?e.permissionGroupKey:void 0,seq:typeof e.seq=="number"&&Number.isFinite(e.seq)?e.seq:void 0,executionMode:typeof e.executionMode=="string"&&e.executionMode?e.executionMode:void 0}}function lm(e){const t=e.itemId||e.streamId;return t?`${e.type}:${e.turnId??""}:${t}`:e.toolCallId&&(e.type==="tool_call"||e.type==="autonomy")?`${e.type}:${e.turnId??""}:${e.toolCallId}`:e.permissionGroupKey&&e.type==="autonomy"?`${e.type}:${e.turnId??""}:${e.permissionGroupKey}`:""}function fV(e,t){const n=lm(e),r=lm(t);return n&&r?n===r:t.timestamp-e.timestamp>Vm||e.type!==t.type?!1:e.type==="thinking"||e.type==="assistant"?!0:e.type==="tool_call"?e.summary===t.summary:!1}function mV(e,t){return t.timestamp-e.timestamp<=Vm&&e.type===t.type&&e.summary===t.summary&&(e.detail??"")===(t.detail??"")}function hV(e,t){if(e.type==="thinking"||e.type==="assistant"){const n=r0(e.detail??"",t.detail??"","thinking");return{timestamp:t.timestamp,type:e.type,summary:uV(n,t.summary||e.summary),detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}if(e.type==="tool_call"){const n=r0(e.detail??"",t.detail??"","tool_call");return{timestamp:t.timestamp,type:"tool_call",summary:t.summary||e.summary,detail:n||void 0,turnId:t.turnId??e.turnId,itemId:t.itemId??e.itemId,streamId:t.streamId??e.streamId,toolCallId:t.toolCallId??e.toolCallId,permissionGroupKey:t.permissionGroupKey??e.permissionGroupKey,seq:t.seq??e.seq,executionMode:t.executionMode??e.executionMode}}return t}function AI(e,t,n=100){const r=dV(t),i=lm(r),o=i?[...e].reverse().findIndex(d=>lm(d)===i):-1,a=o>=0?e.length-1-o:e.length-1,u=e[a];return u?i&&o>=0&&typeof u.seq=="number"&&typeof r.seq=="number"&&r.seq<=u.seq?e:mV(u,r)?ll([...e.slice(0,a),{...u,timestamp:r.timestamp},...e.slice(a+1)],n):fV(u,r)?ll([...e.slice(0,a),hV(u,r),...e.slice(a+1)],n):ll([...e,r],n):[r]}function MI(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,r)=>AI(n,r,t),[])}function pV(e){return{timestamp:Number.isFinite(e.timestamp)?e.timestamp:Date.now(),type:e.type,workItemProjectionId:typeof e.workItemProjectionId=="string"&&e.workItemProjectionId?e.workItemProjectionId:void 0,workItemTurnType:typeof e.workItemTurnType=="string"&&e.workItemTurnType?e.workItemTurnType:void 0,workItemProjectionTitle:typeof e.workItemProjectionTitle=="string"&&e.workItemProjectionTitle?e.workItemProjectionTitle:void 0,runtimeTaskId:typeof e.runtimeTaskId=="string"&&e.runtimeTaskId?e.runtimeTaskId:void 0,executionTurnId:typeof e.executionTurnId=="string"&&e.executionTurnId?e.executionTurnId:void 0,roleName:typeof e.roleName=="string"&&e.roleName?e.roleName:void 0,detail:typeof e.detail=="string"&&e.detail?e.detail:void 0}}function DI(e,t){return e.type===t.type&&(e.workItemProjectionId??"")===(t.workItemProjectionId??"")&&(e.workItemTurnType??"")===(t.workItemTurnType??"")&&(e.workItemProjectionTitle??"")===(t.workItemProjectionTitle??"")&&(e.executionTurnId??e.runtimeTaskId??"")===(t.executionTurnId??t.runtimeTaskId??"")&&(e.roleName??"")===(t.roleName??"")}function gV(e,t){return t.timestamp-e.timestamp<=Vm&&DI(e,t)&&(e.type==="thinking"||e.type==="tool_call")}function xV(e,t){return DI(e,t)&&(e.detail??"")===(t.detail??"")&&t.timestamp-e.timestamp<=Vm}function yV(e,t){const n=t.type==="tool_call"?"tool_call":"thinking";return{...e,...t,timestamp:t.timestamp,detail:r0(e.detail??"",t.detail??"",n)||void 0}}function OI(e,t,n=100){const r=pV(t),i=e[e.length-1];return i?xV(i,r)?ll([...e.slice(0,-1),{...i,timestamp:r.timestamp}],n):gV(i,r)?ll([...e.slice(0,-1),yV(i,r)],n):ll([...e,r],n):[r]}function LI(e,t=100){return(Array.isArray(e)?e:[]).reduce((n,r)=>OI(n,r,t),[])}function i0(e){const t=String(e??"").trim().toLowerCase();return t==="company"?"company":t==="org"||t==="custom"?"org":"task"}function vV(e){return String(e??"").trim().toLowerCase()==="custom"?"custom":"corporate"}function zI(e){const t=String(e.execMode??"").trim().toLowerCase(),n=String(e.companyProfile??"").trim().toLowerCase(),r=String(e.orgId??"").trim(),o=t.length>0?i0(t):n==="custom"||r?"org":i0(t);return o==="org"?{...e,execMode:"org",companyProfile:"custom",orgId:r||void 0}:o==="compan
Line truncated
|
||||
`)),[L,A]=j.useState(!1),M=j.useRef(e.role_id);j.useEffect(()=>{M.current!==e.role_id&&(M.current=e.role_id,d(e.name),p(e.responsibility),g(e.reports_to),v(e.icon??null),S(new Set(e.can_spawn)),w(new Set(e.tools)),N(e.runtime_policy?.execution_strategy??"auto"),I(e.preferred_external_agent??null),T((e.prompt_refs??[]).join(`
|
||||
`)),A(!1))},[e]);const $=j.useRef({}),W=j.useRef(null),B=j.useRef(e.role_id);j.useEffect(()=>{B.current=e.role_id},[e.role_id]);const U=j.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=null);const se=$.current;$.current={},Object.keys(se).length!==0&&i(B.current,se)},[i]),H=j.useCallback(se=>{r||($.current={...$.current,...se},W.current&&clearTimeout(W.current),W.current=setTimeout(U,500))},[U,r]);j.useEffect(()=>()=>{W.current&&(clearTimeout(W.current),W.current=null);const se=$.current;Object.keys(se).length>0&&($.current={},i(B.current,se))},[i]);const V=se=>{d(se),H({name:se})},Y=se=>{p(se),H({responsibility:se})},Q=se=>{g(se),H({reports_to:se})},q=se=>{v(se),H({icon:se})},G=se=>{N(se),H({execution_strategy:se})},J=se=>{I(se),H({preferred_external_agent:se})},P=se=>{T(se);const Ee=se.split(`
|
||||
`).map(we=>we.trim()).filter(Boolean);H({prompt_refs:Ee})},X=se=>{const Ee=new Set(k);Ee.has(se)?Ee.delete(se):Ee.add(se),S(Ee),H({can_spawn:Array.from(Ee)})},ee=se=>{const Ee=new Set(_);Ee.has(se)?Ee.delete(se):Ee.add(se),w(Ee),H({tools:Array.from(Ee)})},te=j.useMemo(()=>t.filter(se=>se.role_id!==e.role_id),[t,e.role_id]),re=j.useMemo(()=>n.filter(se=>(se.role_ids?.length?se.role_ids:[se.role_id]).includes(e.role_id)).length,[n,e.role_id]),oe=j.useMemo(()=>D.split(`
|
||||
`).filter(se=>se.trim()).length,[D]),de=()=>{if(!L){A(!0);return}U(),o(e.role_id)};return c.jsxs("aside",{className:"ri-panel","aria-label":`Inspector for role ${e.name}`,children:[c.jsxs("header",{className:"ri-panel-header",children:[c.jsx("img",{src:Du(y),alt:"",className:"ri-panel-icon"}),c.jsxs("div",{className:"ri-panel-title-wrap",children:[c.jsx("h3",{className:"ri-panel-title",children:u||"(unnamed)"}),c.jsx("code",{className:"ri-panel-id",children:e.role_id})]}),c.jsx("button",{className:"btn btn-ghost btn-sm ri-panel-close",onClick:a,title:"Close (Esc)",children:"✕"})]}),c.jsxs("div",{className:"ri-panel-body",children:[c.jsxs(Ya,{title:"Identity",defaultExpanded:!0,children:[c.jsx(xi,{label:"Name",children:c.jsx("input",{className:"ri-text-input",value:u,onChange:se=>V(se.target.value),disabled:r})}),c.jsx(xi,{label:"Responsibility",children:c.jsx("textarea",{className:"ri-textarea",rows:3,value:m,onChange:se=>Y(se.target.value),disabled:r})}),c.jsx(xi,{label:"Icon",children:c.jsx(GV,{value:y,onChange:q,readOnly:r})})]}),c.jsxs(Ya,{title:"Hierarchy",defaultExpanded:!0,children:[c.jsx(xi,{label:"Reports to",children:c.jsxs("select",{className:"ri-select",value:h,onChange:se=>Q(se.target.value),disabled:r,children:[c.jsx("option",{value:"owner",children:"You (Owner)"}),te.map(se=>c.jsx("option",{value:se.role_id,children:se.name},se.role_id))]})}),c.jsx(xi,{label:"Can delegate to",children:c.jsx(qV,{allIds:te.map(se=>se.role_id),labelFor:se=>te.find(Ee=>Ee.role_id===se)?.name??se,selected:k,onToggle:X,readOnly:r})}),c.jsx(xi,{label:"Employees assigned",children:c.jsx("span",{className:"ri-meta-value",children:re})})]}),c.jsx(Ya,{title:`Tools (${_.size})`,children:c.jsx(WV,{tools:_,onToggle:ee,readOnly:r})}),c.jsx(Ya,{title:`Prompts (${oe})`,children:c.jsx(xi,{label:"Prompt refs / inline",children:c.jsx("textarea",{className:"ri-textarea ri-textarea-mono",rows:5,placeholder:"One prompt ref or inline instruction per line",value:D,onChange:se=>P(se.target.value),disabled:r})})}),c.jsxs(Ya,{title:"Runtime policy",children:[c.jsx(xi,{label:"Execution strategy",children:c.jsx("div",{className:"ri-radio-group",children:VV.map(se=>c.jsxs("label",{className:"ri-radio",title:se.hint,children:[c.jsx("input",{type:"radio",name:`exec-strategy-${e.role_id}`,value:se.value,checked:C===se.value,onChange:()=>G(se.value),disabled:r}),se.label]},se.value))})}),C==="external"&&c.jsx(xi,{label:"Preferred external agent",children:c.jsxs("select",{className:"ri-select",value:O??"",onChange:se=>J(se.target.value||null),disabled:r,children:[c.jsx("option",{value:"",children:"(any)"}),FV.map(se=>c.jsx("option",{value:se,children:se},se))]})})]}),c.jsxs(Ya,{title:"Advanced",children:[c.jsx(xi,{label:"Role type",children:c.jsx("span",{className:"ri-meta-value",children:e.role_type??"worker"})}),c.jsx(xi,{label:"Skills",children:c.jsx("span",{className:"ri-meta-value",children:e.skill_refs&&e.skill_refs.length>0?e.skill_refs.join(", "):"(none)"})}),c.jsx(xi,{label:"Artifact contract",children:c.jsx("span",{className:"ri-meta-value",children:e.artifact_contract_ref??"(none)"})})]})]}),!r&&c.jsx("footer",{className:"ri-panel-footer",children:c.jsx("button",{className:`btn btn-sm ${L?"btn-danger":"btn-ghost"}`,onClick:de,onBlur:()=>A(!1),children:L?"Confirm delete?":"Delete role"})})]})}function Ya({title:e,defaultExpanded:t=!1,children:n}){const[r,i]=j.useState(t);return c.jsxs("section",{className:`ri-group${r?" is-expanded":""}`,children:[c.jsxs("button",{className:"ri-group-header",onClick:()=>i(o=>!o),children:[c.jsx("span",{className:"ri-group-caret",children:r?"▾":"▸"}),c.jsx("span",{className:"ri-group-title",children:e})]}),r&&c.jsx("div",{className:"ri-group-body",children:n})]})}function xi({label:e,children:t}){return c.jsxs("div",{className:"ri-field",children:[c.jsx("label",{className:"ri-field-label",children:e}),c.jsx("div",{className:"ri-field-control",children:t})]})}function GV({value:e,onChange:t,readOnly:n}){const[r,i]=j.useState(!1);return c.jsxs("div",{className:"ri-icon-picker",children:[c.jsxs("button",{className:"ri-icon-picker-trigger",onClick:()=>!n&&i(o=>!o),disabled:n,children:[c.jsx("img",{src:Du(e),alt:"",className:"ri-icon-picker-current"}),c.jsx("span",{className:"ri-icon-picker-label",children:e??"generic"})]}),r&&c.jsxs("div",{className:"ri-icon-picker-popover",children:[c.jsx("button",{className:`ri-icon-option${e===null?" is-active":""}`,onClick:()=>{t(null),i(!1)},title:"Default icon",children:c.jsx("img",{src:ru.generic,alt:""})}),$V.filter(o=>o!=="generic").map(o=>c.jsx("button",{className:`ri-icon-option${e===o?" is-active":""}`,onClick:()=>{t(o),i(!1)},title:o,children:c.jsx("img",{src:ru[o],alt:o})},o))]})]})}function qV({allIds:e,labelFor:t,selected:n,onToggle:r,readOnly:i}){const[o,a]=j.useState(!1),u=e.filter(d=>!n.has(d));return c.jsxs("div",{className:"ri-multiselect",children:[c.jsxs("div",{className:"ri-chips",children:[Array.from(n).map(d=>c.jsxs("span",{className:"ri-ch
Line truncated
|
||||
font-size: .6rem;
|
||||
font-weight: bold;
|
||||
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return i}}function xt(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function KV(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:gt(()=>[e,n,t,o],(a,u,d,m)=>({table:a,column:u,row:d,cell:m,getValue:m.getValue,renderValue:m.renderValue}),xt(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function ZV(e,t,n,r){var i,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let m=(i=(o=u.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,p;if(u.accessorFn?p=u.accessorFn:d&&(d.includes(".")?p=g=>{let y=g;for(const k of d.split(".")){var v;y=(v=y)==null?void 0:v[k]}return y}:p=g=>g[u.accessorKey]),!m)throw new Error;let h={id:`${String(m)}`,accessorFn:p,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:gt(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(y=>y.getFlatColumns())]},xt(e.options,"debugColumns")),getLeafColumns:gt(()=>[e._getOrderColumnsFn()],g=>{var y;if((y=h.columns)!=null&&y.length){let v=h.columns.flatMap(k=>k.getLeafColumns());return g(v)}return[h]},xt(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const Sr="debugHeaders";function bC(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),a.push(d)};return u(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const QV={createTable:e=>{e.getHeaderGroups=gt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const u=(o=r?.map(h=>n.find(g=>g.id===h)).filter(Boolean))!=null?o:[],d=(a=i?.map(h=>n.find(g=>g.id===h)).filter(Boolean))!=null?a:[],m=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(i!=null&&i.includes(h.id)));return uf(t,[...u,...m,...d],e)},xt(e.options,Sr)),e.getCenterHeaderGroups=gt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),uf(t,n,e,"center")),xt(e.options,Sr)),e.getLeftHeaderGroups=gt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return uf(t,o,e,"left")},xt(e.options,Sr)),e.getRightHeaderGroups=gt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return uf(t,o,e,"right")},xt(e.options,Sr)),e.getFooterGroups=gt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),xt(e.options,Sr)),e.getLeftFooterGroups=gt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),xt(e.options,Sr)),e.getCenterFooterGroups=gt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),xt(e.options,Sr)),e.getRightFooterGroups=gt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),xt(e.options,Sr)),e.getFlatHeaders=gt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Sr)),e.getLeftFlatHeaders=gt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Sr)),e.getCenterFlatHeaders=gt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Sr)),e.getRightFlatHeaders=gt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),xt(e.options,Sr)),e.getCenterLeafHeaders=gt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Sr)),e.getLeftLeafHeaders=gt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Sr)),e.getRightLeafHeaders=gt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),xt(e.options,Sr)),e.getLeafHeaders=gt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,u,d,m;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(u=n[0])==null?void 0:u.headers)!=null?a:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},xt(e.options,Sr))}};function uf(e,t,n,r){var i,o;let a=0;const u=function(g,y){y===void 0&&(y=1),a=Math.max(a,y),g.filter(v=>v.getIsVisible()).forEach(v=>{var k;(k=v.columns)!=null&&k.length&&u(v.columns,y+1)},0)};u(e);let d=[];const m=(g,y)=>{const v={depth:y,id:[r,`${y}`].filter(Boolean).jo
Line truncated
|
||||
`).replace(`
|
||||
|
||||
`,`
|
||||
+`).split(`
|
||||
`)),p=m.reduce((h,g)=>h.concat(...g),[]);return[m,p]}return[[],[]]},[e]);return j.useEffect(()=>{const d=t?.target??f2,m=t?.actInsideInputWithModifier??!0;if(e!==null){const p=y=>{if(i.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!i.current||i.current&&!m)&&OT(y))return!1;const k=h2(y.code,u);if(o.current.add(y[k]),m2(a,o.current,!1)){const S=y.composedPath?.()?.[0]||y.target,_=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(i.current||!_)&&y.preventDefault(),r(!0)}},h=y=>{const v=h2(y.code,u);m2(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(y[v]),y.key==="Meta"&&o.current.clear(),i.current=!1},g=()=>{o.current.clear(),r(!1)};return d?.addEventListener("keydown",p),d?.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{d?.removeEventListener("keydown",p),d?.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function m2(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function h2(e,t){return t.includes(e)?"code":"key"}const XX=()=>{const e=In();return j.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:a,panZoom:u}=e.getState(),d=Dv(t,r,i,o,a,n?.padding??.1);return u?(await u.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:u,y:d}=a.getBoundingClientRect(),m={x:t.x-u,y:t.y-d},p=n.snapGrid??i,h=n.snapToGrid??o;return $u(m,r,h,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),a=ym(t,n);return{x:a.x+i,y:a.y+o}}}),[])};function rR(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const a=r.get(o.id);a?a.push(o):r.set(o.id,[o])}for(const o of t){const a=r.get(o.id);if(!a){n.push(o);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const u={...o};for(const d of a)KX(d,u);n.push(u)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function KX(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 iR(e,t){return rR(e,t)}function ZX(e,t){return rR(e,t)}function Fo(e,t){return{id:e,type:"select",selected:t}}function nl(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const a=t.has(i);!(o.selected===void 0&&!a)&&o.selected!==a&&(n&&(o.selected=a),r.push(Fo(o.id,a)))}return r}function p2({items:e=[],lookup:t}){const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const a=t.get(o.id),u=a?.internals?.userNode??a;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function g2(e){return{id:e.id,type:"remove"}}const x2=e=>bY(e),QX=e=>ET(e);function sR(e){return j.forwardRef(e)}function y2(e){const[t,n]=j.useState(BigInt(0)),[r]=j.useState(()=>JX(()=>n(i=>i+BigInt(1))));return S0(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function JX(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const oR=j.createContext(null);function eK({children:e}){const t=In(),n=j.useCallback(u=>{const{nodes:d=[],setNodes:m,hasDefaultNodes:p,onNodesChange:h,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:v}=t.getState();let k=d;for(const _ of u)k=typeof _=="function"?_(k):_;let S=p2({items:k,lookup:g});for(const _ of v.values())S=_(S);p&&m(k),S.length>0?h?.(S):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:w,setNodes:C}=t.getState();_&&C(w)})},[]),r=y2(n),i=j.useCallback(u=>{const{edges:d=[],setEdges:m,hasDefaul
Line truncated
|
||||
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}AR.displayName="MiniMap";const HZ=j.memo(AR),FZ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,VZ={[Cl.Line]:"right",[Cl.Handle]:"bottom-right"};function UZ({nodeId:e,position:t,variant:n=Cl.Handle,className:r,style:i=void 0,children:o,color:a,minWidth:u=10,minHeight:d=10,maxWidth:m=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:y=!0,shouldResize:v,onResizeStart:k,onResize:S,onResizeEnd:_}){const w=cR(),C=typeof e=="string"?e:w,N=In(),O=j.useRef(null),I=n===Cl.Handle,D=Gt(j.useCallback(FZ(I&&y),[I,y]),Nn),T=j.useRef(null),L=t??VZ[n];j.useEffect(()=>{if(!(!O.current||!C))return T.current||(T.current=yX({domNode:O.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:M,transform:$,snapGrid:W,snapToGrid:B,nodeOrigin:U,domNode:H}=N.getState();return{nodeLookup:M,transform:$,snapGrid:W,snapToGrid:B,nodeOrigin:U,paneDomNode:H}},onChange:(M,$)=>{const{triggerNodeChanges:W,nodeLookup:B,parentLookup:U,nodeOrigin:H}=N.getState(),V=[],Y={x:M.x,y:M.y},Q=B.get(C);if(Q&&Q.expandParent&&Q.parentId){const q=Q.origin??H,G=M.width??Q.measured.width??0,J=M.height??Q.measured.height??0,P={id:Q.id,parentId:Q.parentId,rect:{width:G,height:J,...MT({x:M.x??Q.position.x,y:M.y??Q.position.y},{width:G,height:J},Q.parentId,B,q)}},X=$v([P],B,U,H);V.push(...X),Y.x=M.x?Math.max(q[0]*G,M.x):void 0,Y.y=M.y?Math.max(q[1]*J,M.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const q={id:C,type:"position",position:{...Y}};V.push(q)}if(M.width!==void 0&&M.height!==void 0){const G={id:C,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};V.push(G)}for(const q of $){const G={...q,type:"position"};V.push(G)}W(V)},onEnd:({width:M,height:$})=>{const W={id:C,type:"dimensions",resizing:!1,dimensions:{width:M,height:$}};N.getState().triggerNodeChanges([W])}})),T.current.update({controlPosition:L,boundaries:{minWidth:u,minHeight:d,maxWidth:m,maxHeight:p},keepAspectRatio:h,resizeDirection:g,onResizeStart:k,onResize:S,onResizeEnd:_,shouldResize:v}),()=>{T.current?.destroy()}},[L,u,d,m,p,h,k,S,_,v]);const A=L.split("-");return c.jsx("div",{className:Kn(["react-flow__resize-control","nodrag",...A,n,r]),ref:O,style:{...i,scale:D,...a&&{[I?"backgroundColor":"borderColor"]:a}},children:o})}j.memo(UZ);const GZ=j.memo(function({data:t}){const n=["oc-canvas-node",t.isOwner&&"is-owner",t.isSelected&&"is-selected",t.isDropTarget&&"is-drop-target"].filter(Boolean).join(" "),r=Du(t.icon);return c.jsxs("div",{className:n,children:[c.jsx(jl,{type:"target",position:at.Top,className:"oc-canvas-handle"}),c.jsxs("div",{className:"oc-canvas-node-row",children:[c.jsx("div",{className:"oc-canvas-node-chip",children:c.jsx("span",{className:"oc-canvas-node-chip-icon",style:{WebkitMaskImage:`url("${r}")`,maskImage:`url("${r}")`},"aria-hidden":!0})}),c.jsxs("div",{className:"oc-canvas-node-text",children:[c.jsx("span",{className:"oc-canvas-node-name",children:t.name}),c.jsxs("div",{className:"oc-canvas-node-meta",children:[t.employeeNames.length>0?c.jsxs("span",{className:"oc-canvas-node-person",title:t.employeeNames.join(", "),children:[t.employeeNames[0],t.employeeNames.length>1?` +${t.employeeNames.length-1}`:""]}):c.jsx("span",{className:"oc-canvas-node-id",children:t.roleId}),t.employeeCount>0&&c.jsx("span",{className:"oc-canvas-node-badge",children:t.employeeCount})]})]})]}),c.jsx(jl,{type:"source",position:at.Bottom,className:"oc-canvas-handle"})]})});var Tx,T2;function Vv(){if(T2)return Tx;T2=1;var e="\0",t="\0",n="";class r{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(p){p&&(this._isDirected=Object.hasOwn(p,"directed")?p.directed:!0,this._isMultigraph=Object.hasOwn(p,"multigraph")?p.multigraph:!1,this._isCompound=Object.hasOwn(p,"compound")?p.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(p){return this._label=p,this}graph(){return this._label}setDefaultNodeLabel(p){return this._defaultNodeLabelFn=p,typeof p!="function"&&(this._defaultNodeLabelFn=()=>p),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var p=this;return this.nodes().filter(h=>Object.keys(p._in[h]).length===0)}sinks(){var p=this;return this.nodes().filter(h=>Object.keys(p._out[h]).length===0)}setNodes(p,h){var g=arguments,y=this;return p.forEach(function(v){g.length>1?y.setNode(v,h):y.setNode(v)}),this}setNode(p,h){return Object.hasOwn(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=h),this):(this._nodes[p]=arguments.length>1?h:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=t,
Line truncated
|
||||
${r}`}),c.jsx(RV,{projects:Mr.projects,activeId:Mr.activeProjectId,onSelect:Z=>{const z=Rs(Z);t.current?.switchProject(Z,z)},onCreate:Z=>{t.current?.createProject(Z)},onDelete:Z=>t.current?.deleteProject(Z)})]}),c.jsxs("div",{className:"topbar-center",children:[c.jsxs("div",{className:"page-nav",children:[c.jsxs("button",{className:`page-nav-btn${$==="workspace"?" active":""}`,onClick:()=>W("workspace"),children:["Workspace",(()=>{const Z=Er.channels.reduce((z,ne)=>z+Er.getUnreadCount(ne.id),0);return Z>0?c.jsx("span",{className:"nav-unread-badge",children:Z>99?"99+":Z}):null})()]}),c.jsx("button",{className:`page-nav-btn${$==="office"?" active":""}`,onClick:()=>W("office"),children:"Office"}),c.jsx("button",{className:`page-nav-btn${$==="org"?" active":""}`,onClick:()=>W("org"),children:"Org"})]}),c.jsxs("div",{className:"stat-chips",children:[c.jsxs("span",{className:"stat-chip",children:[c.jsx("b",{children:oa.totalAgents})," agents"]}),c.jsxs("span",{className:"stat-chip",children:[c.jsx("b",{children:oa.totalSkills})," skills"]}),c.jsxs("span",{className:"stat-chip",children:[c.jsx("b",{children:Hn.getOpenTaskCount()})," tasks"]})]})]}),c.jsxs("div",{className:"topbar-right",children:[c.jsxs("select",{className:"theme-select",value:Ar,title:"Outdoor lighting override",onChange:Z=>{const z=Z.target.value;jr(z);try{z==="auto"?(localStorage.removeItem("opc_outdoor_override"),localStorage.removeItem("opc_outdoor_day"),localStorage.removeItem("opc_outdoor_night")):(localStorage.setItem("opc_outdoor_override",z),localStorage.removeItem("opc_outdoor_day"),localStorage.removeItem("opc_outdoor_night"))}catch{}e.current.syncOutdoorLighting()},children:[c.jsx("option",{value:"auto",children:"Outdoor auto"}),c.jsx("option",{value:"day",children:"Outdoor day"}),c.jsx("option",{value:"night",children:"Outdoor night"})]}),c.jsxs("select",{className:"theme-select",value:C,onChange:Z=>N(Z.target.value),children:[c.jsx("option",{value:"midnight",children:"Midnight"}),c.jsx("option",{value:"neon",children:"Neon"}),c.jsx("option",{value:"paper",children:"Paper"}),c.jsx("option",{value:"retro",children:"Retro"}),c.jsx("option",{value:"terminal",children:"Terminal"}),c.jsx("option",{value:"cozy",children:"Cozy"}),c.jsx("option",{value:"openopc",children:"OpenOPC"})]}),c.jsx("button",{className:`icon-btn ${H?"active":""}`,onClick:()=>V(Z=>!Z),title:"Developer Tools",children:c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[c.jsx("path",{d:"M5.5 2L2 5.5 5.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M10.5 7L14 10.5 10.5 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),$==="workspace"&&c.jsx(rV,{boardStore:Hn,chatStore:Er,sessionStore:hn,agents:B,officeMap:Si,execMode:q,companyProfile:J,taskPreferredAgent:X,projectId:Mr.activeProjectId,orgInfoData:te,onNavigateToOrg:()=>W("org"),savedOrgsList:nn,activeSavedOrg:Te,onSavedOrgsList:oi,onSavedOrgLoad:ns,recoveryStatus:oe,onRecoveryResume:Z=>t.current?.recoveryAction(ct(),"resume",Z),onRecoveryCancel:Z=>t.current?.recoveryAction(ct(),"cancel",Z),commsState:se,commsMessage:we,onCommsRefresh:Z=>{const{project_id:z,...ne}=Z??{};t.current?.commsState(ct(),ne)},onCommsReadMessage:Z=>t.current?.commsReadMessage(ct(),Z),onRunTask:(Z,z,ne,ae,he)=>{t.current?.send({type:"run_task",project_id:ct(),task_id:Z,title:z,description:ne,mode:ae,profile:he})},onCreateTask:(Z,z,ne,ae)=>{t.current?.send({type:"kanban_create_task",project_id:ct(),title:Z,board_id:z,column_id:ne,task_id:ae})},onMoveTask:(Z,z)=>{t.current?.send({type:"kanban_move_task",project_id:ct(),task_id:Z,column_id:z})},onCreateSession:()=>{if(vn.current||Tt.current)return;const Z=ct();Cn(Z),t.current?.createSession(Z,void 0,q,Cy(q),X,Bo(q,Te))},onSessionSend:(Z,z,ne,ae)=>t.current?.sessionSend(ct(),Z,z,ne,ae),onSecretarySend:Z=>t.current?.secretarySend(ct(),Z),onDeleteSession:Z=>t.current?.deleteSession(ct(),Z),onTitleChange:(Z,z)=>t.current?.sessionUpdateTitle(ct(),Z,z),onSessionConfigChange:Bl,onSessionTaskAgentChange:$l,onContinueInNewChat:_o,onSessionStop:Uu,onSessionResume:ah,onSessionComplete:Z=>t.current?.sessionComplete(ct(),Z),onLoadSessionDetail:(Z,z)=>t.current?.sessionDetail(ct(),Z,{...z,include:z?.detailLevel==="full"?["messages","session_state","progress","work_items","runtime_context"]:["messages","session_state"],viewGeneration:ve.current}),onOpenExecutionPanel:Z=>pt(Z),onCollabSync:()=>t.current?.collabSync(ct(),void 0,ve.current)}),$==="org"&&c.jsx("div",{className:"org-page",children:c.jsx(eJ,{data:te,sessionRecruitmentByRole:Hu,talents:Be,employeeDetail:qt,reorgProposals:vt,isCustomMode:Os,onRequestData:()=>t.current?.orgInfo(),onRequestTalents:()=>t.current?.talentList(),onRequestEmployeeDetail:Z=>t.current?.employeeDetail(Z),onHireTalent:(Z,z)=>{kn(Z),t.current?.talentHire(Z,z,void 0,te?.organization_id||Te||void 0)},hiringTemplateId:Dt,onImportEmployee:Z=>t.curre
Line truncated
|
||||
Reference in new issue
Block a user