1"use strict";(globalThis.rspackChunknotion_next=globalThis.rspackChunknotion_next||[]).push([[23251],{517215(e,t,a){let s=new(a(246382)).R({key:"spacedScopedUserChatPreference",namespace:a(274919).Bq,important:!0,trackingType:"necessary"});function i(e,t){let a=s.getState();s.setState({...a,[e]:{...null==a?void 0:a[e],...t}})}a.d(t,{O:()=>i},{C:s})},41709(e,t,a){a.r(t),a.d(t,{ClientAIChatStore:()=>o,UserChatPreferenceLocalStorageStore:()=>n().C,defaultClientAIChatStore:()=>g,defaultLegacyThreadConfig:()=>d});var s=()=>a(546605);a(730330),a(976614),a(974864),a(218043);let i="confirmed_safe_by_user",r={acceptedInferenceKeys:[],inferenceKeysToAnnotations:{},inferenceKeysToMemories:{},tags:[],abortController:void 0,stopInferencePromise:void 0,temporarySteps:[],chatGptAllowanceExhaustedRetryStepId:void 0,inferences:[],traceId:void 0,draftTraceId:void 0,wasForceStoppedByUser:!1,requestInfo:void 0,loading:!1,currentUserInitiatedRunningInference:!1,stagedData:{},agentSearchResultsByToolResultStepId:{},pendingStop:!1,pendingPinUserStepId:void 0,customAgentNudge:void 0,hasShownCustomAgentNudge:!1};class l extends s().Store{getInitialState(){return r}resetState(){var e;null==(e=this.state.abortController)||e.abort(),this.setState({...r,hasS
1hownCustomAgentNudge:this.state.hasShownCustomAgentNudge})}setPendingPinUserStepId(e){this.setState({...this.state,pendingPinUserStepId:e})}clearPendingPinUserStepId(){void 0!==this.state.pendingPinUserStepId&&this.setState({...this.state,pendingPinUserStepId:void 0})}getOrCreateTraceId(){let e=this.state.traceId??(0,a(83388).Ay)();return this.state.traceId||this.setState({...this.state,traceId:e}),e}clearTraceId(){this.setState({...this.state,traceId:void 0})}getOrCreateDraftTraceId(){let e=this.state.draftTraceId??(0,a(83388).Ay)();return this.state.draftTraceId||this.setState({...this.state,draftTraceId:e}),e}setAgentSearchResultsForTool(e){let{agentStepId:t,toolCallId:a,toolResultStepId:s,results:i}=e;this.setState({...this.state,agentSearchResultsByToolResultStepId:{...this.state.agentSearchResultsByToolResultStepId,[s]:{agentStepId:t,toolCallId:a,results:i}}})}getTemporaryAttachmentStagedDataOrInstantiate(){let e=this.state.stagedData;if(null!=e&&e.attachmentStagedData)return e.attachmentStagedData;let t={stagedAttachmentUploadStore:new(a(729849)).Gi,stagedClientSteps:[],stagedEngineSteps:[],stagedInferenceTranscriptSteps:[]};return this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:t}}),t}getStagedAttachmentUploadStoreIfExists(){var e;let t=this.state.stagedData;return null==t||null==(e=t.attachmentStagedData)?void 0:e.stagedAttachmentUploadStore}stageAttachmentInferenceTranscriptStep(e){let{step:t}=e,a=this.getTemporaryAttachmentStagedDataOrInstantiate(),s={...a,stagedInferenceTranscriptSteps:[...a.stagedInferenceTranscriptSteps,t]};this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:s}})}unstageAttachmentInferenceTranscriptStep(e){var t;let{fileId:a}=e,s=null==(t=this.state.stagedData)?void 0:t.attachmentStagedData;if(!s)return;let i=s.stagedInferenceTranscriptSteps.filter(e=>"attachment"!==e.type&&"computer-file"!==e.type||e.fileUrl!==a);this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:{...s,stagedInferenceTranscriptSteps:i}}})}clearStagedComputerFileSteps(){var e;let t=null==(e=this.state.stagedData)?void 0:e.attachmentStagedData;if(!t)return;let a=t.stagedInferenceTranscriptSteps.flatMap(e=>"computer-file"===e.type?[e.fileUrl]:[]);if(0===a.length)return;let s=t.stagedAttachmentUploadStore;a.forEach(e=>{s.onDeleteFileUpload(e)});let i=t.stagedInferenceTranscriptSteps.filter(e=>"computer-file"!==e.type);this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:{...t,stagedInferenceTranscriptSteps:i}}})}markStagedAttachmentInferenceTranscriptStepAsSafe(e){var t,a;let{fileUrl:s}=e,r=null==(t=this.state.stagedData)?void 0:t.attachmentStagedData;if(!r)return;let l=r.stagedInferenceTranscriptSteps.findIndex(e=>"attachment"===e.type&&e.fileUrl===s);if(l<0)return;let n=r.stagedInferenceTranscriptSteps[l];if("attachment"!==n.type)return;let d=null!=(a=n.metadata)&&a.guardrail?{...n.metadata.guardrail,attachmentRisk:i}:{attachmentRisk:i},o={...n,metadata:{...n.metadata??{},guardrail:d}},g=[...r.stagedInferenceTranscriptSteps];g[l]=o,this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:{...r,stagedInferenceTranscriptSteps:g}}})}getAndClearStagedAssistantAttachmentSteps(){var e;let t=null==(e=this.state.stagedData)?void 0:e.attachmentStagedData;if(!t)return;let{stagedInferenceTranscriptSteps:a}=t;return this.setState({...this.state,stagedData:{...this.state.stagedData,attachmentStagedData:void 0}}),a}getStagedMentionPointers(){let{mentionStagedData:e}=this.state.stagedData;return e?[...e]:[]}updateMentionedStagedData(e){this.setState({...this.state,stagedData:{...this.state.stagedData,mentionStagedData:new(a(227318)).d(e)}})}setCustomAgentNudge(e){this.setState({...this.state,customAgentNudge:e,hasShownCustomAgentNudge:!0})}clearCustomAgentNudge(){this.state.customAgentNudge&&this.setState({...this.state,customAgentNudge:void 0})}}var n=()=>a(517215);let d={type:"search",scopeForNextSearch:{type:"everything"}};class o extends s().Store{getInitialState(){return{showHistory:!1,showDebug:!1,loading:!1,configForNewTranscripts:d,userSelectedConfig:void 0,model:void 0,debugOverrides:{usePromptCache:a(363256).e.withListenerIgnored(()=>a(218744).default.checkGate({gateName:"workflows_inference_replay"}))?"s3":void 0,emitAgentSearchExtractedResults:!0},threadRegistry:{},threadToStagedData:{},primeInput:void 0,primeModelOverride:void 0}}getOrCreateClientAIChatThreadStore(e){if(!this.state.threadRegistry[e]){let t=new l;return this.setState({...this.state,threadRegistry:{...this.state.threadRegistry,[e]:t}}),t}return this.state.threadRegistry[e]}getExistingClientAIChatThreadStore(e){return this.state.threadRegistry[e]}removeClientAIChatThreadStore(e){let{threadRegistry:t}=this.state,a={...t};delete a[e],this.setState({...this.state,threadRegistry:a})}}let g=new o;(0,a(202146).exposeDebugValue)("clientAiChatStore",g)},729849(e,t,a){a(730330),a(976614),a(218043);var s=()=>a(546605);function i(){return a(218744).default.getConfigKey("agent_max_attachments","value")}function r(){return(0,a(579993).K8)(()=>i(),[])}class l extends s().Store{getInitialState(){return{originalFileUrlToSuccessfullyUploadedFiles:new Map,inProgressUploadFileIdsToProgress:new Map}}setValueForUploadedFile(e,t){this.setState({...this.state,originalFileUrlToSuccessfullyUploadedFiles:new Map(this.state.originalFileUrlToSuccessfullyUploadedFiles).set(e,t)})}markUploadedFilesAsSafe(e){let t=new Map(this.state.originalFileUrlToSuccessfullyUploadedFiles);
1e.forEach(e=>{var a;let s=t.get(e);s&&t.set(e,{...s,metadata:{...s.metadata,guardrail:{...null==(a=s.metadata)?void 0:a.guardrail,attachmentRisk:"confirmed_safe_by_user"}}})}),this.setState({...this.state,originalFileUrlToSuccessfullyUploadedFiles:t})}setValueForUploadingFile(e,t){let a=new Map(this.state.inProgressUploadFileIdsToProgress),s=a.get(e);a.set(e,{...t,timeUploaded:(null==s?void 0:s.timeUploaded)??Date.now()}),this.setState({...this.state,inProgressUploadFileIdsToProgress:a})}getTimeUploadedForUploadingFile(e){let t=new Map(this.state.inProgressUploadFileIdsToProgress).get(e);return(null==t?void 0:t.timeUploaded)??Date.now()}getTimeUploadedForUploadedFile(e){let t=new Map(this.state.originalFileUrlToSuccessfullyUploadedFiles).get(e);return(null==t?void 0:t.timeUploaded)??Date.now()}deleteValueForUploadingFile(e){let t=new Map(this.state.inProgressUploadFileIdsToProgress);t.delete(e),this.setState({...this.state,inProgressUploadFileIdsToProgress:t})}deleteValueForUploadedFile(e){let t=new Map(this.state.originalFileUrlToSuccessfullyUploadedFiles);t.delete(e),this.setState({...this.state,originalFileUrlToSuccessfullyUploadedFiles:t})}onFileUploadPercentageChanged(e){let{fileId:t,fileName:a,percentage:s,contentType:i}=e;this.setValueForUploadingFile(t,{type:"uploading",fileName:a,progress:s,contentType:i})}onFileUploadFailed(e){let{error:t}=e,{files:a}=t;a.forEach(({fileId:e,fileName:a})=>{this.setValueForUploadingFile(e,{type:"error",error:t,fileName:a})})}onFileUploadCompleted(e,t){let a=this.getTimeUploadedForUploadingFile(e);this.deleteValueForUploadingFile(e),this.setValueForUploadedFile(t.originalFileUrl,{...t,timeUploaded:a})}onComputerFileUploadCompleted(e,t){let s=this.getTimeUploadedForUploadingFile(e);this.deleteValueForUploadingFile(e),this.setValueForUploadedFile(t.originalFileUrl,{originalFileUrl:t.originalFileUrl,fileName:t.fileName,contentType:"application/pdf",base64EncodedFileUrl:"",attachmentSource:"user_upload",assistantSessionId:(0,a(818963).pg)(t.assistantSessionId),fileSizeBytes:t.fileSizeBytes,timeUploaded:s})}setCompletedFileForRetry(e){let t=this.getTimeUploadedForUploadedFile(e.originalFileUrl);this.setValueForUploadedFile(e.originalFileUrl,{...e,timeUploaded:t})}onDeleteFileUpload(e){this.deleteValueForUploadedFile(e)}isUploadInProgress(){return Array.from(this.state.inProgressUploadFileIdsToProgress.values()).filter(e=>"error"!==e.type).length>0}hasTooManyAttachments(e=i()){return this.isUploadInProgress()||this.state.originalFileUrlToSuccessfullyUploadedFiles.size>e}}a.d(t,{Gi:()=>l,bY:()=>i,yB:()=>r})}}]);
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.