forge-openclaw-plugin 0.2.13 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/assets/{board-C_m78kvK.js → board-2KevHCI0.js} +2 -2
- package/dist/assets/{board-C_m78kvK.js.map → board-2KevHCI0.js.map} +1 -1
- package/dist/assets/index-CDYW4WDH.js +36 -0
- package/dist/assets/index-CDYW4WDH.js.map +1 -0
- package/dist/assets/index-yroQr6YZ.css +1 -0
- package/dist/assets/{motion-CpZvZumD.js → motion-q19HPmWs.js} +2 -2
- package/dist/assets/{motion-CpZvZumD.js.map → motion-q19HPmWs.js.map} +1 -1
- package/dist/assets/{table-DtyXTw03.js → table-BDMHBY4a.js} +2 -2
- package/dist/assets/{table-DtyXTw03.js.map → table-BDMHBY4a.js.map} +1 -1
- package/dist/assets/{ui-BXbpiKyS.js → ui-CQ_AsFs8.js} +2 -2
- package/dist/assets/{ui-BXbpiKyS.js.map → ui-CQ_AsFs8.js.map} +1 -1
- package/dist/assets/{vendor-QBH6qVEe.js → vendor-5HifrnRK.js} +90 -75
- package/dist/assets/{vendor-QBH6qVEe.js.map → vendor-5HifrnRK.js.map} +1 -1
- package/dist/assets/{viz-w-IMeueL.js → viz-CQzkRnTu.js} +2 -2
- package/dist/assets/{viz-w-IMeueL.js.map → viz-CQzkRnTu.js.map} +1 -1
- package/dist/index.html +8 -8
- package/dist/openclaw/api-client.d.ts +1 -0
- package/dist/openclaw/local-runtime.js +243 -15
- package/dist/openclaw/plugin-entry-shared.js +45 -4
- package/dist/openclaw/tools.js +15 -0
- package/dist/server/app.js +129 -11
- package/dist/server/openapi.js +181 -4
- package/dist/server/repositories/habits.js +358 -0
- package/dist/server/repositories/rewards.js +62 -0
- package/dist/server/services/context.js +16 -6
- package/dist/server/services/dashboard.js +6 -3
- package/dist/server/services/entity-crud.js +23 -1
- package/dist/server/services/gamification.js +66 -18
- package/dist/server/services/insights.js +2 -1
- package/dist/server/services/reviews.js +2 -1
- package/dist/server/types.js +140 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server/migrations/003_habits.sql +30 -0
- package/server/migrations/004_habit_links.sql +8 -0
- package/server/migrations/005_habit_psyche_links.sql +24 -0
- package/skills/forge-openclaw/SKILL.md +16 -2
- package/skills/forge-openclaw/cron_jobs.md +395 -0
- package/dist/assets/index-BWtLtXwb.js +0 -36
- package/dist/assets/index-BWtLtXwb.js.map +0 -1
- package/dist/assets/index-Dp5GXY_z.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as h,R as Ce,a as qe,b as Qe,c as Je,_ as et,u as tt,d as _,s as Se,e as nt,f as rt,h as ot}from"./vendor-QBH6qVEe.js";function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ue(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Re(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ue(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ue(e[o],null)}}}}function I(...e){return a.useCallback(Re(...e),e)}function at(e,t){const n=a.createContext(t),r=i=>{const{children:c,...s}=i,d=a.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function it(e,t=[]){let n=[];function r(i,c){const s=a.createContext(c),d=n.length;n=[...n,c];const l=v=>{var E;const{scope:g,children:p,...R}=v,u=((E=g==null?void 0:g[e])==null?void 0:E[d])||s,m=a.useMemo(()=>R,Object.values(R));return h.jsx(u.Provider,{value:m,children:p})};l.displayName=i+"Provider";function f(v,g){var u;const p=((u=g==null?void 0:g[e])==null?void 0:u[d])||s,R=a.useContext(p);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(c=>a.createContext(c));return function(s){const d=(s==null?void 0:s[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,st(o,...t)]}function st(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(i)[`__scope${l}`];return{...s,...v}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var j=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ct=Ce[" useId ".trim().toString()]||(()=>{}),ut=0;function q(e){const[t,n]=a.useState(ct());return j(()=>{n(r=>r??String(ut++))},[e]),e||(t?`radix-${t}`:"")}var lt=Ce[" useInsertionEffect ".trim().toString()]||j;function dt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,c]=ft({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=a.useCallback(f=>{var v;if(s){const g=vt(f)?f(e):f;g!==e&&((v=c.current)==null||v.call(c,g))}else i(f)},[s,e,i,c]);return[d,l]}function ft({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return lt(()=>{i.current=t},[t]),a.useEffect(()=>{var c;o.current!==n&&((c=i.current)==null||c.call(i,n),o.current=n)},[n,o]),[n,r,i]}function vt(e){return typeof e=="function"}function we(e){const t=mt(e),n=a.forwardRef((r,o)=>{const{children:i,...c}=r,s=a.Children.toArray(i),d=s.find(gt);if(d){const l=d.props.children,f=s.map(v=>v===d?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:v);return h.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function mt(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const c=Et(o),s=pt(i,o.props);return o.type!==a.Fragment&&(s.ref=r?Re(r,c):c),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ht=Symbol("radix.slottable");function gt(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ht}function pt(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const d=i(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Et(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=yt.reduce((e,t)=>{const n=we(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bt(e,t){e&&qe.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ct(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var St="DismissableLayer",re="dismissableLayer.update",Rt="dismissableLayer.pointerDownOutside",wt="dismissableLayer.focusOutside",le,Pe=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...d}=e,l=a.useContext(Pe),[f,v]=a.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),R=I(t,y=>v(y)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),E=u.indexOf(m),b=f?u.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=E,w=Dt(y=>{const T=y.target,L=[...l.branches].some(W=>W.contains(T));!S||L||(o==null||o(y),c==null||c(y),y.defaultPrevented||s==null||s())},g),P=xt(y=>{const T=y.target;[...l.branches].some(W=>W.contains(T))||(i==null||i(y),c==null||c(y),y.defaultPrevented||s==null||s())},g);return Ct(y=>{b===l.layers.size-1&&(r==null||r(y),!y.defaultPrevented&&s&&(y.preventDefault(),s()))},g),a.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=le)}},[f,g,n,l]),a.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),de())},[f,l]),a.useEffect(()=>{const y=()=>p({});return document.addEventListener(re,y),()=>document.removeEventListener(re,y)},[]),h.jsx(D.div,{...d,ref:R,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,P.onFocusCapture),onBlurCapture:O(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,w.onPointerDownCapture)})});Ne.displayName=St;var Pt="DismissableLayerBranch",Nt=a.forwardRef((e,t)=>{const n=a.useContext(Pe),r=a.useRef(null),o=I(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});Nt.displayName=Pt;function Dt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let d=function(){De(Rt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&De(wt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(re);document.dispatchEvent(e)}function De(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bt(o,i):o.dispatchEvent(i)}var Q="focusScope.autoFocusOnMount",J="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Ot="FocusScope",xe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...c}=e,[s,d]=a.useState(null),l=B(o),f=B(i),v=a.useRef(null),g=I(t,u=>d(u)),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let u=function(C){if(p.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:x(v.current,{select:!0})},m=function(C){if(p.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||x(v.current,{select:!0}))},E=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&x(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const b=new MutationObserver(E);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,p.paused]),a.useEffect(()=>{if(s){me.add(p);const u=document.activeElement;if(!s.contains(u)){const E=new CustomEvent(Q,fe);s.addEventListener(Q,l),s.dispatchEvent(E),E.defaultPrevented||(Tt(Ft(Oe(s)),{select:!0}),document.activeElement===u&&x(s))}return()=>{s.removeEventListener(Q,l),setTimeout(()=>{const E=new CustomEvent(J,fe);s.addEventListener(J,f),s.dispatchEvent(E),E.defaultPrevented||x(u??document.body,{select:!0}),s.removeEventListener(J,f),me.remove(p)},0)}}},[s,l,f,p]);const R=a.useCallback(u=>{if(!n&&!r||p.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,E=document.activeElement;if(m&&E){const b=u.currentTarget,[C,S]=At(b);C&&S?!u.shiftKey&&E===S?(u.preventDefault(),n&&x(C,{select:!0})):u.shiftKey&&E===C&&(u.preventDefault(),n&&x(S,{select:!0})):E===b&&u.preventDefault()}},[n,r,p.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:g,onKeyDown:R})});xe.displayName=Ot;function Tt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(x(r,{select:t}),document.activeElement!==n)return}function At(e){const t=Oe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!It(n,{upTo:t}))return n}function It(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Lt(e){return e instanceof HTMLInputElement&&"select"in e}function x(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lt(e)&&t&&e.select()}}var me=Mt();function Mt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ft(e){return e.filter(t=>t.tagName!=="A")}var _t="Portal",Te=a.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=a.useState(!1);j(()=>i(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Qe.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});Te.displayName=_t;function kt(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var H=e=>{const{present:t,children:n}=e,r=Wt(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=I(r.ref,jt(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};H.displayName="Presence";function Wt(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,d]=kt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=$(r.current);i.current=s==="mounted"?l:"none"},[s]),j(()=>{const l=r.current,f=o.current;if(f!==e){const g=i.current,p=$(l);e?d("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),j(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=p=>{const u=$(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},g=p=>{p.target===t&&(i.current=$(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function jt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee=0;function Bt(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),ee++,()=>{ee===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ee--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",Y="width-before-scroll-bar",Ut="with-scroll-bars-hidden",$t="--removed-body-scroll-bar-size",Ae=Je(),te=function(){},z=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,g=e.sideCar,p=e.noRelative,R=e.noIsolation,u=e.inert,m=e.allowPinchZoom,E=e.as,b=E===void 0?"div":E,C=e.gapMode,S=et(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=g,P=tt([n,t]),y=_(_({},S),o);return a.createElement(a.Fragment,null,f&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:p,noIsolation:R,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:C}),c?a.cloneElement(a.Children.only(s),_(_({},y),{ref:P})):a.createElement(b,_({},y,{className:d,ref:P}),s))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};z.classNames={fullWidth:Y,zeroRight:G};var Vt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Kt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Gt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vt;var t=Kt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Yt=Se(),k="data-scroll-locked",Xt=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as a,j as h,R as Ce,a as qe,b as Qe,c as Je,_ as et,u as tt,d as _,s as Se,e as nt,f as rt,h as ot}from"./vendor-5HifrnRK.js";function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ue(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Re(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ue(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ue(e[o],null)}}}}function I(...e){return a.useCallback(Re(...e),e)}function at(e,t){const n=a.createContext(t),r=i=>{const{children:c,...s}=i,d=a.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function it(e,t=[]){let n=[];function r(i,c){const s=a.createContext(c),d=n.length;n=[...n,c];const l=v=>{var E;const{scope:g,children:p,...R}=v,u=((E=g==null?void 0:g[e])==null?void 0:E[d])||s,m=a.useMemo(()=>R,Object.values(R));return h.jsx(u.Provider,{value:m,children:p})};l.displayName=i+"Provider";function f(v,g){var u;const p=((u=g==null?void 0:g[e])==null?void 0:u[d])||s,R=a.useContext(p);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(c=>a.createContext(c));return function(s){const d=(s==null?void 0:s[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,st(o,...t)]}function st(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(i)[`__scope${l}`];return{...s,...v}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var j=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ct=Ce[" useId ".trim().toString()]||(()=>{}),ut=0;function q(e){const[t,n]=a.useState(ct());return j(()=>{n(r=>r??String(ut++))},[e]),e||(t?`radix-${t}`:"")}var lt=Ce[" useInsertionEffect ".trim().toString()]||j;function dt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,c]=ft({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=a.useCallback(f=>{var v;if(s){const g=vt(f)?f(e):f;g!==e&&((v=c.current)==null||v.call(c,g))}else i(f)},[s,e,i,c]);return[d,l]}function ft({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return lt(()=>{i.current=t},[t]),a.useEffect(()=>{var c;o.current!==n&&((c=i.current)==null||c.call(i,n),o.current=n)},[n,o]),[n,r,i]}function vt(e){return typeof e=="function"}function we(e){const t=mt(e),n=a.forwardRef((r,o)=>{const{children:i,...c}=r,s=a.Children.toArray(i),d=s.find(gt);if(d){const l=d.props.children,f=s.map(v=>v===d?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:v);return h.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function mt(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const c=Et(o),s=pt(i,o.props);return o.type!==a.Fragment&&(s.ref=r?Re(r,c):c),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ht=Symbol("radix.slottable");function gt(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ht}function pt(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const d=i(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Et(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=yt.reduce((e,t)=>{const n=we(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bt(e,t){e&&qe.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ct(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var St="DismissableLayer",re="dismissableLayer.update",Rt="dismissableLayer.pointerDownOutside",wt="dismissableLayer.focusOutside",le,Pe=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...d}=e,l=a.useContext(Pe),[f,v]=a.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),R=I(t,y=>v(y)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),E=u.indexOf(m),b=f?u.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=E,w=Dt(y=>{const T=y.target,L=[...l.branches].some(W=>W.contains(T));!S||L||(o==null||o(y),c==null||c(y),y.defaultPrevented||s==null||s())},g),P=xt(y=>{const T=y.target;[...l.branches].some(W=>W.contains(T))||(i==null||i(y),c==null||c(y),y.defaultPrevented||s==null||s())},g);return Ct(y=>{b===l.layers.size-1&&(r==null||r(y),!y.defaultPrevented&&s&&(y.preventDefault(),s()))},g),a.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=le)}},[f,g,n,l]),a.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),de())},[f,l]),a.useEffect(()=>{const y=()=>p({});return document.addEventListener(re,y),()=>document.removeEventListener(re,y)},[]),h.jsx(D.div,{...d,ref:R,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,P.onFocusCapture),onBlurCapture:O(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,w.onPointerDownCapture)})});Ne.displayName=St;var Pt="DismissableLayerBranch",Nt=a.forwardRef((e,t)=>{const n=a.useContext(Pe),r=a.useRef(null),o=I(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});Nt.displayName=Pt;function Dt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let d=function(){De(Rt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&De(wt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(re);document.dispatchEvent(e)}function De(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bt(o,i):o.dispatchEvent(i)}var Q="focusScope.autoFocusOnMount",J="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Ot="FocusScope",xe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...c}=e,[s,d]=a.useState(null),l=B(o),f=B(i),v=a.useRef(null),g=I(t,u=>d(u)),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let u=function(C){if(p.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:x(v.current,{select:!0})},m=function(C){if(p.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||x(v.current,{select:!0}))},E=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&x(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const b=new MutationObserver(E);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,p.paused]),a.useEffect(()=>{if(s){me.add(p);const u=document.activeElement;if(!s.contains(u)){const E=new CustomEvent(Q,fe);s.addEventListener(Q,l),s.dispatchEvent(E),E.defaultPrevented||(Tt(Ft(Oe(s)),{select:!0}),document.activeElement===u&&x(s))}return()=>{s.removeEventListener(Q,l),setTimeout(()=>{const E=new CustomEvent(J,fe);s.addEventListener(J,f),s.dispatchEvent(E),E.defaultPrevented||x(u??document.body,{select:!0}),s.removeEventListener(J,f),me.remove(p)},0)}}},[s,l,f,p]);const R=a.useCallback(u=>{if(!n&&!r||p.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,E=document.activeElement;if(m&&E){const b=u.currentTarget,[C,S]=At(b);C&&S?!u.shiftKey&&E===S?(u.preventDefault(),n&&x(C,{select:!0})):u.shiftKey&&E===C&&(u.preventDefault(),n&&x(S,{select:!0})):E===b&&u.preventDefault()}},[n,r,p.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:g,onKeyDown:R})});xe.displayName=Ot;function Tt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(x(r,{select:t}),document.activeElement!==n)return}function At(e){const t=Oe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!It(n,{upTo:t}))return n}function It(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Lt(e){return e instanceof HTMLInputElement&&"select"in e}function x(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lt(e)&&t&&e.select()}}var me=Mt();function Mt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ft(e){return e.filter(t=>t.tagName!=="A")}var _t="Portal",Te=a.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=a.useState(!1);j(()=>i(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Qe.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});Te.displayName=_t;function kt(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var H=e=>{const{present:t,children:n}=e,r=Wt(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=I(r.ref,jt(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};H.displayName="Presence";function Wt(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,d]=kt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=$(r.current);i.current=s==="mounted"?l:"none"},[s]),j(()=>{const l=r.current,f=o.current;if(f!==e){const g=i.current,p=$(l);e?d("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),j(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=p=>{const u=$(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},g=p=>{p.target===t&&(i.current=$(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function jt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee=0;function Bt(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),ee++,()=>{ee===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ee--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",Y="width-before-scroll-bar",Ut="with-scroll-bars-hidden",$t="--removed-body-scroll-bar-size",Ae=Je(),te=function(){},z=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,g=e.sideCar,p=e.noRelative,R=e.noIsolation,u=e.inert,m=e.allowPinchZoom,E=e.as,b=E===void 0?"div":E,C=e.gapMode,S=et(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=g,P=tt([n,t]),y=_(_({},S),o);return a.createElement(a.Fragment,null,f&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:p,noIsolation:R,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:C}),c?a.cloneElement(a.Children.only(s),_(_({},y),{ref:P})):a.createElement(b,_({},y,{className:d,ref:P}),s))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};z.classNames={fullWidth:Y,zeroRight:G};var Vt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Kt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Gt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vt;var t=Kt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Yt=Se(),k="data-scroll-locked",Xt=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(Ut,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -43,4 +43,4 @@ import{r as a,j as h,R as Ce,a as qe,b as Qe,c as Je,_ as et,u as tt,d as _,s as
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
45
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},En="DialogDescriptionWarning",yn=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ze(En).contentName}}.`;return a.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Sn=ke,Rn=Be,wn=Ue,Pn=$e,Nn=Ke,Dn=Ye,xn=He;export{Pn as C,Dn as D,wn as O,Rn as P,Sn as R,Nn as T,xn as a};
|
|
46
|
-
//# sourceMappingURL=ui-
|
|
46
|
+
//# sourceMappingURL=ui-CQ_AsFs8.js.map
|