PageSourceSearch

https://www.gumloop.com/_next/static/immutable/chunks/011qm-kq4yt8e.js

js gumloop.com collected 2026-09-25 14:26:34 UTC 27,989 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,675940,e=>{"use strict";var t=e.i(191788);e.i(391398);let r=["shift","alt","meta","mod","ctrl","control"],s={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function a(e){return(s[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function n(e){return r.includes(e)}function i(e,t=","){return e.toLowerCase().split(t)}function o(e,t="+",s=">",n=!1,i,l){let c=[],u=!1;(e=e.trim()).includes(s)?(u=!0,c=e.toLocaleLowerCase().split(s).map(e=>a(e))):c=e.toLocaleLowerCase().split(t).map(e=>a(e));let d={alt:c.includes("alt"),ctrl:c.includes("ctrl")||c.includes("control"),shift:c.includes("shift"),meta:c.includes("meta"),mod:c.includes("mod"),useKey:n},m=c.filter(e=>!r.includes(e));return{...d,keys:m,description:i,isSequence:u,hotkey:e,metadata:l}}"u">typeof document&&(document.addEventListener("keydown",e=>{void 0!==e.code&&u([a(e.code)])}),document.addEventListener("keyup",e=>{void 0!==e.code&&d([a(e.code)])})),"u">typeof window&&(window.addEventListener("blur",()=>{l.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{l.clear()},0)}));let l=new Set;function c(e){return Array.isArray(e)}function u(e){let t=Array.isArray(e)?e:[e];l.has("meta")&&l.forEach(e=>{n(e)||l.delete(e.toLowerCase())}),t.forEach(e=>{l.add(e.toLowerCase())})}function d(e){let t=Array.isArray(e)?e:[e];"meta"===e?l.clear():t.forEach(e=>{l.delete(e.toLowerCase())})}let m=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"];function p(e,t=!1){var r;let s,a,{target:n,composed:i}=e;return(r=n).tagName&&!r.tagName.startsWith("-")&&r.tagName.includes("-")&&i?(s=e.composedPath()[0]&&e.composedPath()[0].tagName,a=e.composedPath()[0]&&e.composedPath()[0].role):(s=n&&n.tagName,a=n&&n.role),c(t)?!!(s&&t&&t.some(e=>e.toLowerCase()===s.toLowerCase()||e===a)):!!(s&&t&&t)}let g=(0,t.createContext)(void 0),y=(0,t.createContext)({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),E=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},h="u">typeof window?t.useLayoutEffect:t.useEffect;e.s(["useHotkeys",0,function(e,r,s,f){let A,S=(0,t.useRef)(null),R=(0,t.useRef)(!1),_=Array.isArray(s)?Array.isArray(f)?void 0:f:s,T=c(e)?e.join(_?.delimiter):e,C=Array.isArray(s)?s:Array.isArray(f)?f:void 0,L=(0,t.useCallback)(r,C??[]),v=(0,t.useRef)(L);C?v.current=L:v.current=r;let O=(function e(t,r){return t&&r&&"object"==typeof t&&"object"==typeof r?Object.keys(t).length===Object.keys(r).length&&Object.keys(t).reduce((s,a)=>s&&e(t[a],r[a]),!0):t===r}((A=(0,t.useRef)(void 0)).current,_)||(A.current=_),A.current),{activeScopes:I}=(0,t.useContext)(y),b=(0,t.useContext)(g);return h(()=>{var e;if(O?.enabled===!1||(e=O?.scopes,!((0!==I.length||!e)&&(!e||I.some(t=>e.includes(t))||I.includes("*")))))return;let t=[],r,s=(e,s=!1)=>
1{if(!(p(e,m)&&!p(e,O?.enableOnFormTags))){if(null!==S.current){let t=S.current.getRootNode();if((t instanceof Document||t instanceof ShadowRoot)&&t.activeElement!==S.current&&!S.current.contains(t.activeElement))return void E(e)}e.target?.isContentEditable&&!O?.enableOnContentEditable||i(T,O?.delimiter).forEach(i=>{if(i.includes(O?.splitKey??"+")&&i.includes(O?.sequenceSplitKey??">"))return void console.warn(`Hotkey ${i} contains both ${O?.splitKey??"+"} and ${O?.sequenceSplitKey??">"} which is not supported.`);let u=o(i,O?.splitKey,O?.sequenceSplitKey,O?.useKey,O?.description,O?.metadata);if(u.isSequence){r=setTimeout(()=>{t=[]},O?.sequenceTimeoutMs??1e3);let s=u.useKey?e.key:a(e.code);if(n(s.toLowerCase()))return;if(t.push(s),s!==u.keys?.[t.length-1]){t=[],r&&clearTimeout(r);return}t.length===u.keys?.length&&(v.current(e,u),r&&clearTimeout(r),t=[])}else if(((e,t,r=!1)=>{let{alt:s,meta:n,mod:i,shift:o,ctrl:u,keys:d,useKey:m}=t,{code:p,key:g,ctrlKey:y,metaKey:E,shiftKey:h,altKey:f}=e,A=a(p);if(m&&d?.length===1&&d.includes(g.toLowerCase()))return!0;if(!d?.includes(A)&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(A))return!1;if(!r){if(s!==f&&"alt"!==A||o!==h&&"shift"!==A)return!1;if(i){if(!E&&!y)return!1}else if(n!==E&&"meta"!==A&&"os"!==A||u!==y&&"ctrl"!==A&&"control"!==A)return!1}return!!(d&&1===d.length&&d.includes(A))||(d&&d.length>0?!!d.includes(A)&&function(e,t=","){return(c(e)?e:e.split(t)).every(e=>l.has(e.trim().toLowerCase()))}(d):!d||0===d.length)})(e,u,O?.ignoreModifiers)||u.keys?.includes("*")){var d,m;if(O?.ignoreEventWhen?.(e)||s&&R.current)return;if(("function"==typeof(d=O?.preventDefault)&&d(e,u)||!0===d)&&e.preventDefault(),"function"==typeof(m=O?.enabled)?!m(e,u):!0!==m&&void 0!==m)return void E(e);v.current(e,u),s||(R.current=!0)}})}},g=e=>{void 0!==e.code&&(u(a(e.code)),(O?.keydown===void 0&&O?.keyup!==!0||O?.keydown)&&s(e))},y=e=>{void 0!==e.code&&(d(a(e.code)),R.current=!1,O?.keyup&&s(e,!0))},h=S.current||_?.document||document;return h.addEventListener("keyup",y,_?.eventListenerOptions),h.addEventListener("keydown",g,_?.eventListenerOptions),b&&i(T,O?.delimiter).forEach(e=>{b.addHotkey(o(e,O?.splitKey,O?.sequenceSplitKey,O?.useKey,O?.description,O?.metadata))}),()=>{h.removeEventListener("keyup",y,_?.eventListenerOptions),h.removeEventListener("keydown",g,_?.eventListenerOptions),b&&i(T,O?.delimiter).forEach(e=>{b.removeHotkey(o(e,O?.splitKey,O?.sequenceSplitKey,O?.useKey,O?.description,O?.metadata))}),t=[],r&&clearTimeout(r)}},[T,O,I]),S}])},801128,e=>{"use strict";var t=e.i(391398),r=e.i(402206),s=e.i(582512);e.s(["AppUnseenIndicator",0,function({unseen:e,className:a,children:n,...i}){return(0,t.jsxs)("span",{"data-slot":"app-unseen-indicator",className:(0,s.cn)("relative inline-flex shrink-0",a),...i,children:[n,e?(0,t.jsx)(r.CornerDot,{variant:"info"}):null]})}])},919660,e=>{"use strict";e.i(650316);var t=e.i(11559),r=e.i(579662),s=e.i(43017);let a={[r.PlRunState.DONE]:"success",[r.PlRunState.FAILED]:"destructive",[r.PlRunState.QUEUED]:"warning",[r.PlRunState.RUNNING]:"accent",[r.PlRunState.STARTED]:"muted",[r.PlRunState.TERMINATED]:"destructive",[r.PlRunState.TERMINATING]:"destructive"},n={[t.GummieInteractionState.IDLE]:"muted",[t.GummieInteractionState.QUEUED]:"warning",[t.GummieInteractionState.PROCESSING]:"accent",[t.GummieInteractionState.ASYNC_PROCESSING]:"accent",[t.GummieInteractionState.COMPLETED]:"success",[t.GummieInteractionState.FAILED]:"destructive",[t.GummieInteractionState.APPROVAL_REQUIRED]:"warning"},i={[t.GummieInteractionState.COMPLETED]:"Completed",[t.GummieInteractionState.QUEUED]:"Queued",[t.GummieInteractionState.PROCESSING]:"Processing",[t.GummieInteractionState.ASYNC_PROCESSING]:"Processing",[t.GummieInteractionState.IDLE]:"Idle",[t.GummieInteractionState.FAILED]:"Failed",[t.GummieInteractionState.APPROVAL_REQUIRED]:"Approval Required"},o=[{label:"Approval Required",value:t.GummieInteractionState.APPROVAL_REQUIRED},{label:"Processing",value:t.GummieInteractionState.PROCESSING},{label:"Completed",value:t.GummieInteractionState.COMPLETED},{label:"Failed",value:t.GummieInteractionState.FAILED}],l={[r.PlRunState.DONE]:"Success",[r.PlRunState.FAILED]:"Failed",[r.PlRunState.TERMINATED]:"Terminated",[r.PlRunState.TERMINATING]:"Terminating",[r.PlRunState.STARTED]:"Started",[r.PlRunState.RUNNING]:"Ru
1nning",[r.PlRunState.QUEUED]:"Queued"},c={[s.HistoryStatusToggle.COMPLETED]:"Completed",[s.HistoryStatusToggle.APPROVAL_REQUIRED]:"Approval Required",[s.HistoryStatusToggle.FAILED]:"Failed"},u={[s.HistoryStatusToggle.COMPLETED]:{status:[r.PlRunState.DONE],state:[t.GummieInteractionState.COMPLETED]},[s.HistoryStatusToggle.APPROVAL_REQUIRED]:{state:[t.GummieInteractionState.APPROVAL_REQUIRED]},[s.HistoryStatusToggle.FAILED]:{status:[r.PlRunState.FAILED,r.PlRunState.TERMINATED],state:[t.GummieInteractionState.FAILED]}};e.s(["CHAT_STATE_FILTER_OPTIONS",0,o,"CHAT_STATE_LABELS",0,i,"CHAT_STATE_TO_BADGE_VARIANT",0,n,"HISTORY_STATUS_TOGGLE_FILTERS",0,u,"HISTORY_STATUS_TOGGLE_LABELS",0,c,"PL_RUN_STATE_TO_BADGE_VARIANT",0,a,"RUN_STATE_LABELS",0,l])},561956,e=>{"use strict";var t=e.i(391398),r=e.i(191788),s=e.i(940071),a=e.i(496190),n=e.i(434413),i=e.i(470567),o=e.i(232566),l=e.i(524389),c=e.i(707075),u=e.i(44314),d=e.i(414767),m=e.i(769650),p=e.i(314512),g=e.i(815363),y=e.i(558021);e.i(505);var E=e.i(294294),h=e.i(468450),f=e.i(618814),A=e.i(587123),S=e.i(257187),R=e.i(292905),_=e.i(893930),T=e.i(285700),C=e.i(101006),L=e.i(772952),v=e.i(716081);let O={all:["share-password"],detail:(e,t)=>[...O.all,e,t]};var I=e.i(701439);let b=E.z.object({password:E.z.string().trim().min(6,"Password must be at least 6 characters.")}),w=({draftRole:e,applyProtected:a,protectedSharingDenyKey:l})=>{let c=(0,u.useShareDialogContext)(),d=c.can(o.AclResourceAction.MANAGE_GENERAL_ACCESS),E=(0,u.resolveAccessType)(c.generalAccess,c.project?.project_name)===o.GeneralAccessType.PROTECTED,{isDenied:w,isResolved:P,isError:G}=(0,S.usePolicyDeny)(),{presentGate:x}=(0,I.useAccessGate)(),D=P||G,{password:N,isLoadingPassword:j,loadError:U,setPassword:k,isSavingPassword:M}=function({resourcePath:e,enabled:t}){let{userProfile:s,idTokenRef:a}=(0,i.useUserProfileContext)(),n=(0,T.useQueryClient)(),o=(0,r.useMemo)(()=>O.detail(e,s.user_id),[e,s.user_id]),l=(0,_.useQuery)({queryKey:o,queryFn:({signal:t})=>(0,v.fetch_with_auth)(`${e}/password`,s,a.current,L.UseApiQueryMethod.GET,null,t),enabled:t&&!!e&&!s.isLoading()&&s.isLoggedIn()&&!!a.current,retry:!1,gcTime:0}),c=(0,R.useMutation)({mutationFn:async t=>{await (0,v.fetch_with_auth)(`${e}/password`,s,a.current,L.UseApiQueryMethod.PUT,{password:t})},onMutate:async()=>{await n.cancelQueries({queryKey:o}),C.toast.add({title:"Saving password...",type:"loading",id:"share-password"})},onSuccess:(e,t)=>{n.setQueryData(o,{password:t}),C.toast.add({title:"Password saved",type:"success",id:"share-password"})},onError:e=>{C.toast.add({title:e.message||"Couldn't save password",type:"error",id:"share-password"})}});return{password:l.data?.password??null,isLoadingPassword:l.isLoading,loadError:l.error?.message??null,setPassword:c.mutate,isSavingPassword:c.isPending}}({resourcePath:c.resourcePath,enabled:d&&E&&!c.isUpdatingAccess}),[F,$]=(0,r.useState)(!1),K=(0,y.useForm)({resolver:(0,g.zodResolver)(b),defaultValues:{password:""},mode:"onSubmit",reValidateMode:"onSubmit"});(0,r.useEffect)(()=>{E&&!j&&!c.isUpdatingAccess&&(K.reset({password:N??""},{keepDirtyValues:!0}),U&&K.setError("password",{type:"server",message:U}))},[c.isUpdatingAccess,K,j,E,U,N]);let Q=M||c.isUpdatingAccess;return d?(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(s.Separator,{}),(0,t.jsx)(h.Form,{...K,children:(0,t.jsx)("form",{onSubmit:K.handleSubmit(t=>{let r=t.password.trim();if(!E){if(l){if(!D)return;if(!G&&w(l))return void x({userType:"role-restricted",deniedKeys:[l]})}let t=e??(c.generalAccess&&"role"in c.generalAccess?c.generalAccess.role:void 0)??c.shareableRoles.find(e=>e.role===o.AclRole.VIEWER)?.role??o.AclRole.VIEWER;a({type:o.GeneralAccessType.PROTECTED,role:t,password:r});return}k(r)}),children:(0,t.jsx)(h.FormField,{control:K.control,name:"password",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{className:"px-0",children:"Password"}),j?(0,t.jsx)(A.Skeleton,{className:"h-9 w-full"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(f.InputGroup,{className:"min-w-0 flex-1","data-disabled":Q||void 0,children:[(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(f.InputGroupInput,{type:F?"text":"password",placeholder:"Set a password",autoComplete:"new-password",disabled:Q,...e})}),(0,t.jsx)(f.InputGroupAddon,{align:"inline-end",className:"has-[>button]:mr-0",children:(0,t.jsx)(f.InputGroupButton,{onClick:()=>$(e=>!e),tabIndex:-1,size:"icon-xs",disabled:Q,"aria-label":F?"Hide password":"Show password",children:F?(0,t.jsx)(p.EyeOffIcon,{}):(0,t.jsx)(m.EyeIcon,{})})})]}),(0,t.jsx)(n.Button,{type:"submit",variant:"outline",disabled:Q,loading:M||c.isUpdatingAccess,children:"Save"})]}),(0,t.jsx)(h.FormMessage,{}),(0,t.jsx)(h.FormDescription,{className:"px-0",children:E?`Users added to this ${o.ACL_RESOURCE_LABEL[c.resource].toLowerCase()} or its agent won't need the password.`:"Save a password to turn on Password Protected access."})]})})})})]}):null};e.s(["default",0,({restrictPublicSharing:e,publicSharingRestrictedReason:m,publicSharingDenyKey:p,protectedS
1haringDenyKey:g})=>{let y=(0,u.useShareDialogContext)(),E=(0,l.getSupportedAccessTypes)(y.resource),{userProfile:h}=(0,i.useUserProfileContext)(),[f,A]=(0,r.useState)(null),[S,R]=(0,r.useState)(null),_=!!y.organization&&h?.organization?.organization_id!==y.organization.organization_id,T=y.project?.project_name,C=(0,u.resolveAccessType)(y.generalAccess,T),L=S?o.GeneralAccessType.PROTECTED:C,v=L===o.GeneralAccessType.PROTECTED,O=(0,r.useMemo)(()=>y.grants.some(e=>e.email===y.currentUserEmail),[y.grants,y.currentUserEmail]),I=y.can(o.AclResourceAction.MANAGE_GENERAL_ACCESS),b=(0,r.useCallback)(e=>{if(O||!I||!y.callerRole||y.callerAccess?.override)return!1;if(e.type===o.GeneralAccessType.PROTECTED&&C!==o.GeneralAccessType.PROTECTED)return!0;let t=c.GENERAL_ACCESS_SCOPE_RANK[C],r=c.GENERAL_ACCESS_SCOPE_RANK[e.type];return r<t||"role"in e&&r===t&&c.ACL_ROLE_RANK[e.role]<c.ACL_ROLE_RANK[y.callerRole]},[y.callerAccess,O,I,y.callerRole,C]),P=(0,r.useCallback)(e=>e.type===o.GeneralAccessType.PROTECTED&&C!==o.GeneralAccessType.PROTECTED||!b(e)||(A(e),!1),[C,b]),{onUpdateGeneralAccess:G}=y,x=(0,r.useCallback)(e=>{e.type===o.GeneralAccessType.PROTECTED&&C!==o.GeneralAccessType.PROTECTED?R(e.role):(R(null),G(e))},[C,G]),D=(0,r.useCallback)(e=>{b(e)?A(e):G(e)},[b,G]),N=(0,r.useCallback)(()=>{f&&(f.type!==o.GeneralAccessType.PROTECTED&&R(null),G(f),A(null))},[f,G]);if(_)return y.callerRole&&!O&&C!==o.GeneralAccessType.RESTRICTED?(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(s.Separator,{}),(0,t.jsxs)("p",{className:"text-muted-foreground text-xs",children:["You have ",(0,t.jsx)("span",{className:"font-medium",children:o.ACL_ROLE_LABEL[y.callerRole]})," access to this"," ",o.ACL_RESOURCE_LABEL[y.resource]]})]}):null;let j=o.ACL_RESOURCE_LABEL[y.resource];return(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(s.Separator,{}),(0,t.jsx)(d.default,{loading:y.isLoading||y.isUpdatingAccess,disabled:!I,value:L,generalAccess:y.generalAccess,onChange:e=>x(e),resource:y.resource,projectName:T,restrictPublicSharing:e,publicSharingRestrictedReason:m,publicSharingDenyKey:p,protectedSharingDenyKey:g,supportedAccessTypes:E,itemOrganization:y.organization,shareableRoles:y.shareableRoles,onBeforeChange:e=>P(e)}),v?(0,t.jsx)(w,{draftRole:S??void 0,applyProtected:D,protectedSharingDenyKey:g}):null,(0,t.jsx)(a.default,{open:!!f,setOpen:e=>{e||A(null)},title:"Reduce your own access?",description:`You don't have a direct share on this ${j.toLowerCase()}. Lowering the general access level may reduce your own permissions and you won't be able to undo this change yourself.`,onConfirm:N,confirmButtonProps:{text:"Continue anyway"},primaryActionButtonVariant:n.GumloopButtonVariant.DESTRUCTIVE})]})}],561956)},145876,e=>{"use strict";var t=e.i(391398),r=e.i(191788),s=e.i(691712),a=e.i(232566),n=e.i(680695),i=e.i(44314),o=e.i(87379),l=e.i(997599);e.s(["default",0,({renderGrantAction:e}={})=>{let c=(0,i.useShareDialogContext)(),u=c.shareableRoles.some(e=>c.can(e.requiredAddPermissionKey)),d=c.shareableRoles.filter(e=>c.can(e.requiredAddPermissionKey)),m=(0,r.useMemo)(()=>new Set(c.grants.map(e=>e.email)),[c.grants]),p=(0,r.useMemo)(()=>c.shareableRoles.map(e=>({role:e.role,label:a.ACL_ROLE_LABEL[e.role],description:e.description(c.resource),canAdd:c.can(e.requiredAddPermissionKey),canRemove:c.can(e.requiredRemovePermissionKey)})),[c]);return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)(s.Label,{className:"text-muted-foreground",children:["Users • ",c.grants.length+c.hiddenGrantCount]}),(0,t.jsx)(l.default,{onInvite:c.onInvite,disabled:!u,isLoading:c.isInviting,excludeEmails:m,shareableRoles:d.map(e=>({role:e.role,label:a.ACL_ROLE_LABEL[e.role],description:e.description(c.resource)}))}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(o.default,{grants:c.grants,isLoading:c.isLoading,onUpdateRole:e=>c.onUpdateRole({email:e.email,role:e.role}),onRevoke:c.onRevoke,mutatingEmails:c.mutatingEmails,shareableRoles:p,canLeave:c.can(a.AclResourceAction.LEAVE),currentUserEmail:c.currentUserEmail,resourceLabel:a.ACL_RESOURCE_LABEL[c.resource],renderGrantAction:e}),c.hiddenGrantCount>0&&(0,t.jsxs)("p",{className:"text-muted-foreground text-xs",children:["+",c.hiddenGrantCount," other ",n.string.pluralize({count:c.hiddenGrantCount,singular:"user"})]})]})]})}])},696920,e=>{"use strict";var t=e.i(171428),r=e.i(191788),s=e.i(668698),a=e.i(325932);e.i(509105);var n=e.i(957054),i=e.i(452427);function o(e){return"function"==typeof e?e():e}var l=e.i(650316),c=e.i(693384);let u=new Set([s.ChatSortOrder.NEWEST,s.ChatSortOrder.OLDEST]);var d=e.i(575142),m=e.i(341248),p=e.i(925745);let g="agent-chat-history-filters",y=m.DEFAULT_CHAT_HISTORY_SORT_ORDER,E={filters:{},sortOrder:y};function h(e){try{var t;let r=JSON.parse(e);return{filters:function(e){if(!e.type)return e;let t=(0,c.serializeSortedCsvParam)((0,a.canonicalizeAgentChatSourceTypes)((0,c.parseCsvParam)(e.type).filter(l.isGummieInteractionType)));return t?{...e,type:t}:Object.fromEntries(Object.entries(e).filter(([e])=>"type"!==e))}(function(e){let{external_channels:t,external_team_id:r,external_channel_id:s,...a}=e;return a}(!(t=r.filters)||"object"!=typeof t||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>"string"==typeof e[1]&&e[1].length>0)))),sortOrder:(0,s.isChatSortOrder)(r.sortOrder)?r.sortOrder:y}}catch{return E}}function f(e){return Object.keys(e.filters).length>0||e.sortOrder!==y}function A(e,t){if(e.sortOrder!==t.sortOrder)return!1;let r=Object.entries(e.filters);return r.length===Object.keys(t.filters).length&&r.every(([e,r])=>t.filters[e]===r)}e.s(["default",0,(e,a)=>{var l;let{includeToolMetadata:c,includeFilterOptions:y=!1,persistFilters:S=!1,filtersStorageScope:R,baseFilters:_,stableOrder:T=!1,retainedInteractionId:C}=a??{},[L,v]=(0,r.useState)(""),[O,I]=(0,r.useState)(""),b=(0,r.useCallback)(e=>I(e),[]),[w,P]=(0,i.useDebouncedCallback)(b,300),G=(0,r.useCallback)(()=>{P(),v(""),I("")},[P]),x=R?`${g}:${R}`:g,[D,N,{isStorageReady:j}]=function({storageKey:e,defaultValue:t,parse:s=function(e){return JSON.parse(e)},serialize:a=function(e){return JSON.stringify(e)},shouldStoreValue:n=function(e){return!0},isEqual:i=Object.is,onRestoreValue:l}){let[c,u]=(0,r.useState)(()=>o(t)),[d,m]=(0,r.useState)(null),p=(0,r.useRef)(null);return(0,r.useEffect)(()=>
1{if(!e){p.current=null,m(null);return}if(p.current!==e){p.current=e;try{let r=localStorage.getItem(e),a=r?s(r):o(t);u(e=>i(e,a)?e:a),l?.(a)}catch{let e=o(t);u(t=>i(t,e)?t:e),l?.(e)}m(e);return}try{n(c)?localStorage.setItem(e,a(c)):localStorage.removeItem(e)}catch{}},[t,i,l,s,a,n,e,c]),[c,u,{clearStoredValue:(0,r.useCallback)(()=>{if(e)try{localStorage.removeItem(e)}catch{}},[e]),isStorageReady:!e||d===e}]}({storageKey:S&&e?`${x}:${e}`:null,defaultValue:E,parse:h,shouldStoreValue:f,isEqual:A,onRestoreValue:G}),{filters:U,sortOrder:k}=D,M=j?L:"",F=j?O:"",$=(0,r.useCallback)(e=>{v(e),w(e)},[w]),K=(0,r.useCallback)((e,t)=>{N(r=>{let s={...r.filters};return t?s[e]=t:delete s[e],{...r,filters:s}})},[N]),Q=(0,r.useCallback)(e=>{N(t=>{let r={...t.filters};return delete r[e],{...t,filters:r}})},[N]),H=(0,r.useCallback)(()=>{N(e=>({...e,filters:{}}))},[N]),V=(0,r.useCallback)(e=>{(0,s.isChatSortOrder)(e)&&N(t=>({...t,sortOrder:e}))},[N]),q=(0,r.useMemo)(()=>{let e={...U,..._};return Object.keys(e).length>0?e:void 0},[U,_]),B=(0,r.useMemo)(()=>(0,m.normalizeChatHistoryKeyParams)({includeToolMetadata:c,searchQuery:F,filters:q,sortOrder:k}),[q,F,c,k]),z=(0,r.useMemo)(()=>({search_query:B.searchQuery||void 0,sort_order:B.sortOrder,include_tool_metadata:B.includeToolMetadata?"true":void 0,...B.filters}),[B]),Y=(0,n.useCursorPaginatedInfiniteQuery)({path:`gummies/${e??""}/chat`,queryKey:m.GUMMIE_CHAT_HISTORY_QUERY_KEYS.list(e??"",B),pageSize:t.GUMMIES_CHAT_HISTORY_PAGE_SIZE,body:z,getItemId:m.getGummieChatHistoryItemId,options:{enabled:!!e&&j,staleTime:m.GUMMIE_CHAT_HISTORY_STALE_TIME_MS,refetchOnWindowFocus:!T,refetchInterval:e=>!!(0,m.hasActiveChat)(e.state.data?.pages)&&m.ACTIVE_CHAT_POLL_INTERVAL_MS}}),J=Y.data?.pages,W=(0,r.useMemo)(()=>(function e(t,r){let s=[];for(let a of t){if(r.has(a.interaction_id))continue;r.add(a.interaction_id);let t=a.subagent_children?e(a.subagent_children,r):void 0;a.subagent_children?.length&&t?.length===0||s.push({...a,subagent_children:t})}return s})((0,d.withChatAccess)(Y.items,(0,d.mergeChatAccessPages)(J)),new Set),[Y.items,J]),Z=(0,r.useMemo)(()=>`${e??""}:${JSON.stringify(B)}`,[e,B]),X=(0,r.useRef)({scope:Z,snapshot:new Map,chats:[]}),ee=T&&(l=B.sortOrder,!u.has(l)),et=(0,r.useMemo)(()=>{var e,t;if(!ee)return W;let{scope:r,snapshot:s,chats:a}=X.current,n=r===Z,i="true"===B.filters.unread?C:void 0,o=n?a.find(e=>e.interaction_id===i):void 0,l=null!=o&&W.some(e=>e.interaction_id===o.interaction_id);return e=n?s:new Map,t=o&&!l?{...o,unseen:!1}:null,function(e,t,r){if(!r||t.some(e=>e.interaction_id===r.interaction_id))return t;let s=e.indexOf(r.interaction_id);if(s<0)return t;for(let a=s-1;a>=0;a-=1){let s=t.findIndex(t=>t.interaction_id===e[a]);if(s>=0)return[...t.slice(0,s+1),r,...t.slice(s+1)]}for(let a=s+1;a<e.length;a+=1){let s=t.findIndex(t=>t.interaction_id===e[a]);if(s>=0)return[...t.slice(0,s),r,...t.slice(s)]}return[...t,r]}(e.get("")??[],function e(t,r,s){let a=s.map(r=>r.subagent_children?.length?{...r,subagent_children:e(t,r.interaction_id,r.subagent_children)}:r),n=t.get(r);if(!n?.length)return a;let i=new Map(a.map(e=>[e.interaction_id,e])),o=n.map(e=>i.get(e)).filter(e=>void 0!==e);if(0===o.length)return a;let l=new Set(o.map(e=>e.interaction_id)),c=a.reduce((e,t,r)=>l.has(t.interaction_id)?r:e,-1),u=e=>!l.has(e.interaction_id);return[...a.slice(0,c+1).filter(u),...o,...a.slice(c+1).filter(u)]}(e,"",W),t)},[ee,Z,C,W]);(0,r.useEffect)(()=>{let e,t;X.current={scope:Z,snapshot:(e=new Map,(t=(r,s)=>{for(let a of(e.set(r,s.map(e=>e.interaction_id)),s))a.subagent_children?.length&&t(a.interaction_id,a.subagent_children)})("",et),e),chats:et}},[et,Z]);let er=(0,p.useGummieChatFilterOptions)(e,{enabled:y}).data,{fetchNextPage:es,hasNextPage:ea,isFetchingNextPage:en}=Y,ei=!!ea,eo=(0,r.useCallback)(()=>{ea&&!en&&es()},[es,en,ea]),el=M!==F,ec=Object.keys(U).length,eu=ec>0||""!==M,ed=Y.isLoading||Y.isPending,em=!en&&Y.isFetching,ep=ed||el||em&&0===et.length,eg=!ep&&0===et.length&&!eu,ey=!ep&&0===et.length&&eu,eE=Y.isFetching||en;return{...Y,chats:et,hasNextPage:ei,loadMore:eo,searchQuery:M,setSearchQuery:$,isSearchPending:el,isInitialLoading:ed,isContentLoading:ep,isEmpty:eg,isFilteredEmpty:ey,isLoadingMore:en,filterOptions:er,filters:U,activeFilterCount:ec,setFilter:K,clearFilter:Q,clearAllFilters:H,sortOrder:k,setSortOrder:V,isFetching:eE,isFiltered:eu,isFiltersStorageReady:j,isUninitialized:"idle"===Y.fetchStatus&&Y.isPending}}],696920)},925745,e=>{"use strict";var t=e.i(772952),r=e.i(470567);e.s(["useGummieChatFilterOptions",0,function(e,{enabled:s=!0}={}){let{userProfile:a,idTokenRef:n}=(0,r.useUserProfileContext)();return(0,t.useAuthApiQuery)({path:`gummies/${e??""}/chat/filter-options`,queryKey:["gummie-chat-filter-options",e??""],options:{enabled:s&&!!e&&a.isLoggedIn()&&!!n.current,staleTime:6e4}})}])},656951,869172,e=>{"use strict";var t=e.i(292905),r=e.i(893930),s=e.i(285700),a=e.i(101006),n=e.i(470567),i=e.i(232566);function o(e){let t=i.GENERAL_ACCESS_LABEL[e.type];return"role"in e&&e.role?`${t} (${i.ACL_ROLE_LABEL[e.role]})`:t}function l(e){switch(e.type){case i.GeneralAccessType.RESTRICTED:return{access_type:i.GeneralAccessType.RESTRICTED};case i.GeneralAccessType.PROJECT:return{access_type:i.GeneralAccessType.PROJECT,role:e.role};case i.GeneralAccessType.ORGANIZATION:return{access_type:i.GeneralAccessType.ORGANIZATION,role:e.role};case i.GeneralAccessType.PROTECTED:return{access_type:i.GeneralAccessType.PROTECTED,role:e.role};case i.GeneralAccessType.ANYONE:return{access_type:i.GeneralAccessType.ANYONE,role:e.role};default:return e}}e.s(["describeGeneralAccess",0,o,"toGeneralAccess",0,l],869172);var c=e.i(716081),u=e.i(680695);function d(e,t){if(!e)return e;let r=e.grants.some(e=>e.email===t.email);return{...e,grants:r?e.grants.map(e=>e.email===t.email?t:e):[...e.grants,t]}}let m=e=>["item-sharing",e];e.s(["itemSharingQueryKey",0,m,"useItemSharing",0,function({resourcePath:e,resourceLabel:p,options:g={},onGrantSuccess:y,onRevokeSuccess:E,onGeneralAccessSuccess:h}
1){let{userProfile:f,idTokenRef:A}=(0,n.useUserProfileContext)(),S=(0,s.useQueryClient)(),R=!!e&&f.isLoggedIn()&&!!A.current&&g?.enabled!==!1,{enabled:_,...T}=g??{},C=m(e),L=["savedItemPermissionMismatch",e],v=(t,r)=>(0,c.fetch_with_auth)(`${e}/share`,f,A.current,"POST",{user_email:t,role:r}),O=(0,r.useQuery)({queryKey:C,queryFn:()=>(0,c.fetch_with_auth)(`${e}/permissions`,f,A.current,"GET"),enabled:R,...T}),I=(0,t.useMutation)({mutationFn:async t=>{let r=l(t),s=t.type===i.GeneralAccessType.PROTECTED&&t.password?{...r,password:t.password}:r;await (0,c.fetch_with_auth)(`${e}/general-access`,f,A.current,"PUT",s)},onMutate:async e=>{a.toast.add({title:`Updating access to ${o(e)}...`,type:"loading",id:`update-${p}-access`}),await S.cancelQueries({queryKey:C});let t=S.getQueryData(C);return S.setQueryData(C,t=>t?{...t,general_access:l(e)}:t),{previous:t}},onSuccess:(e,t)=>{a.toast.add({title:`Access set to ${o(t)}`,type:"success",id:`update-${p}-access`}),h?.(t)},onError:(e,t,r)=>{r?.previous&&S.setQueryData(C,r.previous),a.toast.add({title:e.message||`Unable to update ${p} access`,type:"error",id:`update-${p}-access`})},onSettled:()=>{S.invalidateQueries({queryKey:C}),S.invalidateQueries({queryKey:[...L]})}}),b=(0,t.useMutation)({mutationFn:async({email:e,role:t})=>(a.toast.add({title:`Sharing with ${e}...`,type:"loading",id:"add-user"+e}),v(e,t)),onSuccess:(e,{email:t,role:r})=>{a.toast.add({title:`${e.user_grant.email} added as ${u.string.titleCase(r)}`,type:"success",id:"add-user"+t});let s={...e.user_grant,is_team_member:e.recipient_is_team_member??e.user_grant.is_team_member};S.setQueryData(C,e=>d(e,s)),y?.(e)},onError:(e,{email:t})=>{a.toast.add({title:e.message||`Failed to share with ${t}`,type:"error",id:"add-user"+t})}}),w=(0,t.useMutation)({mutationFn:async({email:e,role:t})=>(a.toast.add({title:`Updating ${e}...`,type:"loading",id:"update-user"+e}),v(e,t)),onSuccess:(e,{email:t,role:r})=>{a.toast.add({title:`${e.user_grant.email} is now ${u.string.titleCase(r)}`,type:"success",id:"update-user"+t});let s={...e.user_grant,is_team_member:e.recipient_is_team_member??e.user_grant.is_team_member};S.setQueryData(C,e=>d(e,s))},onError:(e,{email:t})=>{a.toast.add({title:e.message||`Failed to update role for ${t}`,type:"error",id:"update-user"+t})}}),P=(0,t.useMutation)({mutationFn:async({email:t})=>{let r=t===f.user_email;return a.toast.add({title:r?`Leaving ${p}...`:`Removing ${t}...`,type:"loading",id:"remove-user"+t}),(0,c.fetch_with_auth)(`${e}/share/${encodeURIComponent(t)}`,f,A.current,"DELETE")},onSuccess:(e,{email:t})=>{let r=t===f.user_email;a.toast.add({title:r?`You left this ${p}`:`${t} removed`,type:"success",id:"remove-user"+t}),S.setQueryData(C,e=>e?{...e,grants:e.grants.filter(e=>e.email!==t)}:e),E?.(t)},onError:(e,{email:t})=>{let r=t===f.user_email;a.toast.add({title:e.message||(r?`Failed to leave ${p}`:`Failed to remove ${t}`),type:"error",id:"remove-user"+t})}});return{resourcePath:e,permissions:O,updateGeneralAccess:I,grantUserAccess:b,updateUserRole:w,revokeUserAccess:P}}],656951)}]);

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