@aiquants/contact-map 0.19.0 → 0.21.0
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 +24 -11
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/styles/contact-map.standalone.css +1 -1
- package/package.json +11 -9
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Ko=Object.defineProperty;var he=(e,t)=>()=>(e&&(t=e(e=0)),t);var jo=(e,t)=>{for(var n in t)Ko(e,n,{get:t[n],enumerable:!0})};var Ie,Ct,hr,Kt,jt,fn,nt,Pe,Wn,va,Ca,Ge,q,kt=he(()=>{"use strict";Ie=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ct=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,hr=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=Ie(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},Kt=e=>hr(e,["custom_email","email"]),jt=e=>hr(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),fn=e=>{let t=Ie(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},nt=(e,t)=>{let n=Ie(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Pe=(e,t)=>String(e).padStart(t,"0"),Wn=e=>`${Pe(e.getUTCFullYear(),4)}-${Pe(e.getUTCMonth()+1,2)}-${Pe(e.getUTCDate(),2)}`,va=e=>`${Wn(e)} ${Pe(e.getUTCHours(),2)}:${Pe(e.getUTCMinutes(),2)}:${Pe(e.getUTCSeconds(),2)}`,Ca=e=>`${Pe(e.getFullYear(),4)}-${Pe(e.getMonth()+1,2)}-${Pe(e.getDate(),2)} ${Pe(e.getHours(),2)}:${Pe(e.getMinutes(),2)}:${Pe(e.getSeconds(),2)}`,Ge=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},q=e=>e==null?"-":typeof e=="string"?Ie(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var Z,fr,St=he(()=>{"use strict";Z=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":fr(e);case"function":return fr(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},fr=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var Gt,xe,qt=he(()=>{"use strict";Gt=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},xe=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var Go,Hn,ka=he(()=>{"use strict";Go=(e,t)=>{let n=Array.from({length:t.length+1},(a,s)=>s);for(let a=1;a<=e.length;a+=1){let s=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);s.push(Math.min(n[o]+1,s[o-1]+1,r))}n=s}return n[t.length]},Hn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(o=>o.toLowerCase().startsWith(n));if(s!==void 0)return s}let a;for(let s of t){let o=Go(n,s.toLowerCase());o<=Math.max(1,Math.floor(s.length/4))&&(a===void 0||o<a.distance)&&(a={key:s,distance:o})}return a?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as br,DIRECTORY_TREE_LABEL_KEYS as Sa,resolveDirectoryTreeLabels as qo}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Yo,VIRTUAL_SCROLL_LABEL_KEYS as Qo}from"@aiquants/virtualscroll";var Xo,G,Tt,In,xr,bn,at,Jo,yr,vr,Zo,Ta,es,ts,ns,wa,Na,Ma,wt=he(()=>{"use strict";kt();St();qt();ka();Xo=Object.freeze({en:"en-US",ja:"ja-JP"}),G=(e,t)=>t.toLocaleString(Xo[e]),Tt=(e,t,n)=>e==="1"?t:n,In=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${G("en",e)} / ${G("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${G("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${G("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${G("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>Tt(e,"record","records"),companyUnit:e=>Tt(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>Tt(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>G("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${G("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:va,recordDate:Wn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsTabsLabel:"Statistics tabs",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:Ca,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=G("en",e);return`${n} ${Tt(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${G("en",t)}`,timesUnit:e=>Tt(e," time"," times"),itemsUnit:e=>Tt(e," item"," items"),charactersUnit:e=>Tt(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${G("ja",e)} / ${G("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${G("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${G("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${G("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${G("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${G("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:va,recordDate:Wn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:Ca,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${G("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${G("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),xr=Object.freeze(Object.keys(In.en)),bn=Object.freeze([...Sa,...xr]),at=Object.freeze({en:Object.freeze({...br.en,...In.en}),ja:Object.freeze({...br.ja,...In.ja})}),Jo=new Set(bn),yr=Object.keys(at).map(e=>JSON.stringify(e)).join(" or "),vr=Object.freeze({locale:"locale",labels:"labels"}),Zo=(e,t,n)=>{e[t]=n},Ta=(e,t=vr.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${yr} or left out; got ${Z(e)}`);if(e!==void 0&&!Object.hasOwn(at,e))throw new RangeError(`[contact-map] ${t} must be ${yr} or left out; got ${Z(e)}`);return Yo(e)},es=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${Z(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${Z(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Z(n)}`)},ts=(e,t,n)=>{let a=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!Jo.has(s)){let r=Hn(s,bn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${Z(s)}`)}let o=e[s];o!==void 0&&(es(n,s,o,t[s]),a[s]=o)}return a},ns=e=>{let t={},n=!1;for(let a of Sa){let s=e[a];s!==void 0&&(t[a]=s,n=!0)}return n?t:void 0},wa=(e,t,n=vr)=>{let a=Ta(e,n.locale);if(t===void 0)return at[a];if(!Gt(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${Z(t)}`);let s=ts(t,at[a],n.labels),r={...qo(a,ns(s)),...In[a]};for(let c of xr){let d=s[c];d!==void 0&&Zo(r,c,d)}return Object.freeze(r)},Na=e=>{let t={};for(let n of Sa)t[n]=e[n];return Object.freeze(t)},Ma=e=>{let t={};for(let n of Qo)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as as}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as rs}from"@aiquants/virtualscroll";import{createContext as os,useContext as kr,useMemo as Cr,useRef as ss}from"react";import{jsx as ls}from"react/jsx-runtime";var is,Pa,Ea,Sr,ve,Y,le=he(()=>{"use strict";wt();is=Object.freeze({locale:"en",labels:at.en,treeLabels:Na(at.en),engineLabels:Ma(at.en)}),Pa=os(is),Ea=(e,t)=>{let n=ss(null),a=n.current;return a!==null&&t.every(s=>a[s]===e[s])?a:(n.current=e,e)},Sr=({locale:e,labels:t,surface:n,children:a})=>{let s=Ta(e,n.locale),o=Cr(()=>wa(s,t,n),[s,t,n]),r=Ea(o,bn),c=Ea(Na(r),as),d=Ea(Ma(r),rs),l=Cr(()=>({locale:s,labels:r,treeLabels:c,engineLabels:d}),[s,r,c,d]);return ls(Pa.Provider,{value:l,children:a})},ve=()=>kr(Pa),Y=()=>kr(Pa).labels});var x,pt,N,ge=he(()=>{"use strict";x="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",pt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",N=`${pt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Fn,$n,zn,Bn,Oa=he(()=>{"use strict";Fn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",$n=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),zn="absolute inset-0 bg-slate-900/50",Bn=()=>!1});var us,gt,wr,Qt,yn=he(()=>{"use strict";us="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",gt="focus-visible:outline-2 focus-visible:outline-blue-700 focus-visible:outline-offset-2 dark:focus-visible:outline-sky-300",wr="in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 in-focus-visible:data-[contact-map-row-active]:outline-blue-700 dark:in-focus-visible:data-[contact-map-row-active]:outline-sky-300",Qt=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${gt} ${us}`});import{clsx as ms}from"clsx";import{twMerge as ps}from"tailwind-merge";function fe(...e){return ps(ms(e))}var xn=he(()=>{"use strict"});import{useOverlayDialog as gs}from"@aiquants/swipe-overlay";import hs from"lucide-react/dist/esm/icons/check.js";import fs from"lucide-react/dist/esm/icons/copy.js";import bs from"lucide-react/dist/esm/icons/x.js";import{useCallback as Zt,useEffect as Nr,useId as ys,useMemo as Un,useRef as Mr,useState as xs}from"react";import{createPortal as vs}from"react-dom";import{jsx as Q,jsxs as Fe}from"react/jsx-runtime";var Cs,we,ks,Ss,Ts,vn,Jt,ws,Ns,Xt,_a,Aa,Vn,Da=he(()=>{"use strict";kt();le();Oa();yn();ge();xn();Cs=350,we=e=>e.stopPropagation(),ks=Object.freeze({onClick:we,onDoubleClick:we,onContextMenu:we,onPointerDown:we,onPointerUp:we,onMouseDown:we,onMouseUp:we,onTouchStart:we,onTouchEnd:we,onKeyDown:we,onKeyUp:we,onFocus:we,onBlur:we}),Ss=fe(Fn,"flex items-center justify-center px-4 py-6"),Ts="relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",vn=0,Jt=null,ws=()=>{let e=document.body.style;vn+=1,vn===1&&(Jt={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Ns=()=>{if(vn=Math.max(0,vn-1),vn>0||!Jt)return;let e=document.body.style;e.userSelect=Jt.userSelect,typeof Jt.webkitUserSelect<"u"&&(e.webkitUserSelect=Jt.webkitUserSelect),Jt=null},Xt=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},_a=(e,t)=>{let n=new Set;return e.reduce((a,s)=>{let o=typeof s.value=="string"?s.value.trim():"";if(!o)return a;let{normalized:r,key:c,entry:d}=t(o,s);return r&&!n.has(c)&&(n.add(c),a.push(d(r))),a},[])},Aa=({value:e,ariaLabel:t})=>{let[n,a]=xs(!1),s=Mr(null),o=Zt(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let l=document.createElement("textarea");l.value=d,l.setAttribute("readonly",""),l.style.position="absolute",l.style.left="-9999px",document.body.appendChild(l),l.select(),l.setSelectionRange(0,l.value.length);let u=document.execCommand("copy");return document.body.removeChild(l),u},[]),r=Zt(async d=>{d.preventDefault(),d.stopPropagation(),s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null);let l=await o(e);a(l),l&&typeof window<"u"&&(s.current=window.setTimeout(()=>{a(!1),s.current=null},1500))},[o,e]);Nr(()=>()=>{s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null)},[]);let c=n?hs:fs;return Q("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 ${gt}`,onClick:r,"aria-label":t,title:t,children:Q(c,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},Vn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let s=Y(),o=Mr(null),r=Un(()=>e.contacted_at?Ge(e.contacted_at,s.recordDate):null,[e.contacted_at,s.recordDate]),c=Xt(e.full_name)??s.noName,d=Xt(e.company_name),l=Xt(e.department),u=Xt(e.title),m=Un(()=>_a([{fieldKey:"company_name",label:s.fieldCompanyName,value:d},{fieldKey:"department",label:s.fieldDepartment,value:l},{fieldKey:"title",label:s.fieldTitle,value:u}],(y,{fieldKey:w,label:D})=>({normalized:y,key:`${w}-${y.toLowerCase()}`,entry:b=>({fieldKey:w,label:D,value:b})})),[d,l,u,s]),i=Un(()=>_a([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(y,{fieldKey:w,label:D})=>{let b=fn(y);return{normalized:Xt(y),key:(b??y).toLowerCase(),entry:X=>({fieldKey:w,label:D,value:X,href:b})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),p=Un(()=>_a([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(y,{fieldKey:w,label:D})=>{let b=Xt(y),T=nt(y,t),X=!!T?.startsWith("https://mail.google.com");return{normalized:b,key:y.toLowerCase(),entry:W=>({fieldKey:w,label:D,value:W,href:T,isGmailLink:X})}}),[e.custom_email,e.email,t,s]),h=i.length>0||p.length>0,v=ys(),k=Zt(()=>{a(),o.current=null},[a]),C=Zt(y=>y.ownerDocument.getElementById(v),[v]),{dialogProps:F,backdropProps:I}=gs({isOpen:!0,onClose:k,isCloseBlocked:Bn,initialFocus:C}),f=Zt((y,w)=>{w.isGmailLink&&(y.preventDefault(),n(w.value))},[n]),g=Zt((y,w)=>{if(!w.isGmailLink){o.current=null;return}let D=Date.now(),b=o.current;if(b&&b.email===w.value&&D-b.timestamp<=Cs){o.current=null,y.preventDefault(),n(w.value);return}o.current={email:w.value,timestamp:D}},[n]);return Nr(()=>(ws(),Ns),[]),vs(Fe("dialog",{...F,...ks,"data-contact-popup-root":"true","aria-labelledby":v,className:Ss,style:$n,children:[Q("div",{...I,"data-contact-popup-backdrop":"",className:zn}),Fe("div",{"data-contact-popup-card":"",className:Ts,children:[Fe("div",{className:"flex items-center justify-between gap-4",children:[Q("h2",{id:v,tabIndex:-1,className:"wrap-break-word min-w-0 font-semibold text-gray-900 text-lg outline-none dark:text-slate-100",children:c}),Q("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 dark:hover:bg-slate-800/70 ${gt}`,onClick:k,"aria-label":s.close,children:Q(bs,{className:"h-4 w-4","aria-hidden":"true"})})]}),m.length>0?Q("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:m.map(y=>Fe("div",{className:"flex items-center gap-3",children:[Q("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:y.value}),Q(Aa,{value:y.value,ariaLabel:s.copyField(y.label)})]},y.fieldKey))}):null,Fe("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[i.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:i.map(y=>Q("li",{className:"flex items-start gap-3",children:Fe("div",{className:"min-w-0 flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:y.label}),Fe("div",{className:"mt-1 flex items-center gap-3",children:[Q("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:y.href?Q("a",{href:y.href,className:`wrap-break-word text-blue-800 dark:text-blue-300 ${Qt}`,children:y.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:y.value})}),Q(Aa,{value:y.value,ariaLabel:s.copyField(y.label)})]})]})},`${y.fieldKey}-${y.value}`))})}):null,p.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:p.map(y=>Q("li",{className:"flex items-start gap-3",children:Fe("div",{className:"min-w-0 flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:y.label}),Fe("div",{className:"mt-1 flex items-start gap-3",children:[Fe("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[y.href?Q("a",{href:y.href,className:`wrap-break-word text-blue-800 dark:text-blue-300 ${Qt}`,target:y.isGmailLink?"_blank":void 0,rel:y.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:w=>f(w,y),onTouchEnd:w=>g(w,y),children:y.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:y.value}),y.isGmailLink?Q("span",{className:`mt-1 block ${N} text-slate-600 dark:text-slate-300`,children:s.popupGmailHint}):null]}),Q(Aa,{value:y.value,ariaLabel:s.copyField(y.label)})]})]})},`${y.fieldKey}-${y.value}`))})}):null,r?Fe("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[Q("span",{className:"text-xs",children:s.popupLastContactDate}),Q("span",{children:r})]}):null,h?null:Q("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as Ce,jsxs as Cn}from"react/jsx-runtime";var Kn,Wa=he(()=>{"use strict";ge();Kn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:s="-",email:o="-",updatedAtText:r="-"})=>Cn("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Cn("div",{className:"flex items-center gap-1 sm:hidden",children:[Ce("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),Ce("div",{className:`shrink-0 whitespace-nowrap ${pt} text-slate-600 dark:text-slate-300`,children:s})]}),Ce("div",{className:"flex items-center gap-1 sm:hidden",children:Ce("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),Ce("div",{className:"block sm:hidden",children:Ce("span",{className:`w-full truncate text-left ${pt} text-slate-700 leading-tight dark:text-slate-200`,children:a})}),Cn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[Ce("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),Ce("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),Cn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[Ce("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),Ce("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),Cn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[Ce("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),Ce("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:o})]}),Ce("div",{className:`hidden items-end justify-end ${pt} text-slate-600 xl:flex dark:text-slate-300`,children:Ce("span",{className:"truncate",children:r})})]})});import{formatQuerySets as Ms,parseQuerySets as Es}from"@aiquants/fuzzy-search";import{getNormalizedVariants as Ps,normalizeText as Ls,romajiToKatakana as Rs}from"@aiquants/select-box";var Lr,Os,_s,As,Ds,Rr,Or,Ws,Hs,Is,Fs,$s,zs,Bs,Us,_r,Ar,Er,Pr,jn,Vs,Ks,Ha,Dr,Ia=he(()=>{"use strict";Lr=/[]/g,Os=/^[\s ]+|[\s ]+$/g,_s=/\s+/,As=/^[\p{Script=Latin}\s]+$/u,Ds=/\p{Script=Latin}/u,Rr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Or="union",Ws=65377,Hs=65439,Is=["\uFF9E","\uFF9F"],Fs=(()=>{let e=new Map;for(let t=Ws;t<=Hs;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of Is){let s=(n+a).normalize("NFKC");s.length===1&&e.set(s,n+a)}}return e})(),$s=/[-ヿ]/u,zs=e=>{let t=Array.from(e,n=>Fs.get(n)??n).join("");return $s.test(t)?null:t},Bs=e=>Ls(e.replace(Lr,"").replace(Os,""),Rr),Us=e=>{if(!As.test(e))return null;let t=Rs(e);return Ds.test(t)?null:t},_r=e=>e.split(_s).filter(Boolean),Ar=e=>Es(e,Or).sets.map(({query:t})=>t),Er=e=>Ar(e).flatMap(t=>_r(t)),Pr=e=>Ms({combine:Or,sets:Array.from(new Set(e),t=>({query:t}))}),jn=e=>{let t=Ar(e.replace(Lr,"")).map(a=>_r(Bs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let s=Us(a);if(s===null)return Pr(t);n.push(s)}return Pr(n)},Vs=e=>{let t=new Set([...Er(e),...Er(jn(e))]),n=new Set;for(let a of t)for(let s of Ps(a,Rr)){let o=s.trim();if(!o)continue;n.add(o);let r=zs(o);r!==null&&n.add(r)}return Array.from(n)},Ks=/[.*+?^${}()|[\]\\]/g,Ha=e=>{let t=Vs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(Ks,"\\$&")).sort((a,s)=>s.length-a.length);return new RegExp(n.join("|"),"gi")},Dr=(e,t)=>{let n=Ha(e);if(n===null)return s=>s;let a=s=>t.some(o=>{let r=s[o];return typeof r=="string"&&r.search(n)!==-1});return s=>{let o=[],r=[];for(let c of s)a(c.item)?o.push(c):r.push(c);return[...o,...r]}}});import{memo as js}from"react";import{Fragment as Fa,jsx as Gn}from"react/jsx-runtime";var Gs,pe,qn=he(()=>{"use strict";Ia();Gs="rounded bg-yellow-200 px-1 text-gray-900 dark:bg-yellow-900 dark:text-yellow-100",pe=js(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return Gn(Fa,{children:e});let a=Ha(t);if(a===null)return Gn(Fa,{children:e});let s=[],o=0,r=a.exec(e),c=0;for(;r;){let d=r[0],l=r.index;if(l>o&&s.push(e.substring(o,l)),d.length===0){a.lastIndex++,r=a.exec(e);continue}s.push(Gn("mark",{className:Gs,children:d},`highlight-${l}-${c}`)),o=l+d.length,c+=1,r=a.exec(e)}return o<e.length&&s.push(e.substring(o)),Gn(Fa,{children:s})});pe.displayName="HighlightedText"});var Hr={};jo(Hr,{ContactDetailGrid:()=>Wr,default:()=>qs});import{useMemo as $a}from"react";import{Fragment as Ys,jsx as za,jsxs as Qs}from"react/jsx-runtime";var Yn,Wr,qs,Ir=he(()=>{"use strict";kt();le();Da();Wa();qn();Yn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Wr=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:s,isPopupVisible:o,onRequestClose:r})=>{let c=Y(),d=$a(()=>Kt(e),[e]),l=$a(()=>jt(e),[e]),u=d.value??"-",m=l.value??"-",i=$a(()=>Ge(e.updated_at,c.recordDateTime),[e.updated_at,c.recordDateTime]),p=Yn(e.full_name)??c.noName,h=Yn(e.company_name),v=Yn(e.department),k=(C,F="-")=>za(pe,{text:C??F,query:t,enabled:n});return Qs(Ys,{children:[za(Kn,{fullName:k(p),title:k(Yn(e.title)),companyName:k(h),department:k(v),phoneNumber:m,email:k(u),updatedAtText:i}),o?za(Vn,{contactData:e,openEmailsWithGmail:a,openGmailCompose:s,onRequestClose:r}):null]})},qs=Wr});le();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Yt}from"@aiquants/fuzzy-search";import{memo as ds,useId as Tr}from"react";import{jsx as qe,jsxs as rt}from"react/jsx-runtime";var La=ds(({searchOptions:e,setSearchOptions:t})=>{let n=Y(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=Tr(),r=Tr(),c=[];return c.push(rt("div",{className:`${a} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[rt("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),qe("label",{htmlFor:o,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.advancedLearningLabel}),qe("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||Yt.learningWeight,onChange:d=>t(l=>({...l,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),rt("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||Yt.learningWeight]}),qe("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.advancedLearningHint})]},"learning")),c.push(rt("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[rt("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),qe("label",{htmlFor:r,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.advancedDebounceLabel}),qe("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??Yt.debounceMs,onChange:d=>t(l=>({...l,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),rt("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs??Yt.debounceMs]}),qe("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.advancedDebounceHint})]},"debounce")),rt("section",{className:"space-y-3",children:[rt("div",{className:"flex items-center justify-between gap-3",children:[rt("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[qe("span",{children:"\u26A1"}),qe("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),qe("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:Yt.learningWeight,debounceMs:Yt.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-gray-300 bg-gray-100 px-2 font-medium text-gray-700 ${x} transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70`,title:n.resetToDefaultsTitle,children:n.reset})]}),qe("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:c})]})});La.displayName="AdvancedSearchSettings";le();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Nt}from"@aiquants/fuzzy-search";import{memo as cs,useId as Ye}from"react";import{jsx as ee,jsxs as ne}from"react/jsx-runtime";var Ra=cs(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})=>{let r=Y(),c="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",d="text-xs font-semibold",l=Ye(),u=Ye(),m=Ye(),i=Ye(),p=Ye(),h=Ye(),v=Ye(),k=Ye(),C=Ye(),F=Ye(),I=[];return I.push(ne("div",{className:`${c} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[ne("div",{className:`${d} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),ee("label",{htmlFor:l,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:r.basicThresholdLabel}),ee("input",{id:l,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Nt.threshold,onChange:f=>t(g=>({...g,threshold:parseFloat(f.target.value)})),className:"h-11 w-full"}),ne("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[r.currentValueLabel," ",e.threshold??Nt.threshold]}),ee("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),I.push(ne("div",{className:`${c} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[ne("div",{className:`${d} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",r.basicDisplayHeading]}),ne("label",{htmlFor:u,className:`flex min-h-11 items-center gap-2 text-gray-700 ${x} transition-colors dark:text-slate-200`,children:[ee("input",{id:u,type:"checkbox",checked:e.caseSensitive??Nt.caseSensitive,onChange:f=>t(g=>({...g,caseSensitive:f.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),ne("label",{htmlFor:m,className:`flex min-h-11 items-center gap-2 text-gray-700 ${x} transition-colors dark:text-slate-200`,children:[ee("input",{id:m,type:"checkbox",checked:n,onChange:f=>a(f.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),ne("label",{htmlFor:i,className:`flex min-h-11 items-center gap-2 text-gray-700 ${x} transition-colors dark:text-slate-200`,children:[ee("input",{id:i,type:"checkbox",checked:s,onChange:f=>o(f.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),ne("div",{className:"flex flex-col gap-1",children:[ee("label",{htmlFor:p,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:r.basicMultiTermOperator}),ne("select",{id:p,value:e.multiTermOperator??Nt.multiTermOperator,onChange:f=>t(g=>({...g,multiTermOperator:f.target.value})),className:`min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base ${x} transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100`,children:[ee("option",{value:"or",children:r.basicOperatorOr}),ee("option",{value:"and",children:r.basicOperatorAnd})]}),ee("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:r.basicMultiTermHint})]})]},"display")),I.push(ne("div",{className:`${c} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[ne("div",{className:`${d} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",r.basicSortHeading]}),ne("div",{className:"flex flex-col gap-2",children:[ee("label",{htmlFor:h,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:r.basicSortBy}),ne("select",{id:h,value:e.sortBy||Nt.sortBy,onChange:f=>t(g=>({...g,sortBy:f.target.value})),className:`min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base ${x} transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100`,children:[ee("option",{value:"score",children:r.basicSortByScore}),ee("option",{value:"relevance",children:r.basicSortByRelevance}),ee("option",{value:"original",children:r.basicSortByOriginal})]})]}),ne("div",{className:"flex flex-col gap-2",children:[ee("label",{htmlFor:v,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:r.basicSortOrder}),ne("select",{id:v,value:e.sortOrder||Nt.sortOrder,onChange:f=>t(g=>({...g,sortOrder:f.target.value})),className:`min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base ${x} transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100`,children:[ee("option",{value:"desc",children:r.basicSortDescending}),ee("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),I.push(ne("div",{className:`${c} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[ne("div",{className:`${d} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),ee("label",{htmlFor:k,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:r.basicStrategy}),ne("select",{id:k,value:e.parallelSearchStrategy||Nt.parallelSearchStrategy,onChange:f=>t(g=>({...g,parallelSearchStrategy:f.target.value})),className:`min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base ${x} transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100`,children:[ee("option",{value:"balanced",children:r.basicStrategyBalanced}),ee("option",{value:"index-first",children:r.basicStrategyIndexFirst}),ee("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),ne("div",{className:"mt-2 space-y-2",children:[ne("label",{htmlFor:C,className:`flex min-h-11 items-center gap-2 text-gray-700 ${x} transition-colors dark:text-slate-200`,children:[ee("input",{id:C,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:f=>t(g=>({...g,enableIndexFiltering:f.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),ne("label",{htmlFor:F,className:`flex min-h-11 items-center gap-2 text-gray-700 ${x} transition-colors dark:text-slate-200`,children:[ee("input",{id:F,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:f=>t(g=>({...g,enableLevenshtein:f.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),ne("section",{className:"space-y-3",children:[ne("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[ee("span",{children:"\u{1F527}"}),ee("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),ee("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:I})]})});Ra.displayName="BasicSearchSettings";kt();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Xs}from"@aiquants/swipe-overlay";import Js from"lucide-react/dist/esm/icons/badge-check.js";import Zs from"lucide-react/dist/esm/icons/building-2.js";import ei from"lucide-react/dist/esm/icons/calendar-clock.js";import ti from"lucide-react/dist/esm/icons/check.js";import ni from"lucide-react/dist/esm/icons/copy.js";import ai from"lucide-react/dist/esm/icons/id-card.js";import ri from"lucide-react/dist/esm/icons/mail.js";import oi from"lucide-react/dist/esm/icons/phone.js";import si from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as ii,useEffect as li,useMemo as Jn,useRef as di,useState as ci}from"react";var Qe={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};le();xn();import*as $e from"@radix-ui/react-tabs";import*as Qn from"react";import{jsx as Ba}from"react/jsx-runtime";var Xn=$e.Root,kn=Qn.forwardRef(({className:e,...t},n)=>Ba($e.List,{ref:n,className:fe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));kn.displayName=$e.List.displayName;var Mt=Qn.forwardRef(({className:e,...t},n)=>Ba($e.Trigger,{ref:n,className:fe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));Mt.displayName=$e.Trigger.displayName;var Et=Qn.forwardRef(({className:e,...t},n)=>Ba($e.Content,{ref:n,className:fe("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));Et.displayName=$e.Content.displayName;yn();ge();qn();import{jsx as M,jsxs as me}from"react/jsx-runtime";var Fr=`truncate font-semibold text-slate-900 ${x} dark:text-slate-100`,$r={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},ui=({icon:e,label:t,value:n,fieldKey:a,copyValue:s,onCopy:o,isCopied:r,linkHref:c,searchTerm:d,enableHighlighting:l})=>{let u=Y(),m=!!(o&&a&&s),i=c?.startsWith("https://mail.google.com")?"_blank":void 0;return me("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[me("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[M("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:M(e,{size:14})}),me("div",{className:"min-w-0 flex-1",children:[M("div",{className:`font-medium ${N} text-slate-600 dark:text-slate-300`,children:t}),c?M("a",{href:c,className:`align-top ${Fr} ${Qt}`,target:i,rel:i?"noopener noreferrer":void 0,children:M(pe,{text:n,query:d??"",enabled:l})}):M("div",{className:Fr,children:M(pe,{text:n,query:d??"",enabled:l})})]})]}),m?M("button",{type:"button",onClick:()=>o&&a&&s&&o(a,s,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300 ${gt}`,"aria-label":u.copyField(t),children:r?M(ti,{size:14}):M(ni,{size:14})}):null]})},zr=({items:e,searchTerm:t,enableHighlighting:n})=>M("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>me("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[M("dt",{className:`font-semibold ${N} text-slate-600 uppercase tracking-wide dark:text-slate-300`,children:a.label}),M("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:M(pe,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),Ua=({title:e})=>M("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),mi=()=>{let e=Y();return me("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[M("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),M("p",{className:`${N} text-slate-600 dark:text-slate-300`,children:e.detailEmptyHint})]})},pi=Object.freeze({overlay:Xs,pane:void 0}),en=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:s,className:o=""})=>{let r=Y(),[c,d]=ci(null),l=di(null),u=Jn(()=>({...$r,...s}),[s]);li(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=Jn(()=>Kt(e),[e]),i=Jn(()=>jt(e),[e]),p=Jn(()=>Ge(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),h=ii(async(b,T,X)=>{try{await navigator.clipboard.writeText(T),d(b),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(W){Qe.error("Failed to copy contact detail",W)}},[]);if(!e)return M("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:$r,children:M(mi,{})});let v=[q(e.title),q(e.department)].filter(b=>b!=="-"),k=[v.join(" / "),q(e.company_name)].filter(b=>b&&b!=="-").join(" \u30FB ")||"-",C=Ie(e.full_name)??r.noName,F=[{fieldKey:"full_name",label:r.fieldFullName,value:C},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:q(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:q(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:q(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:q(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:q(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:q(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:q(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:q(e.url)}],I=[{label:r.fieldCustomEmail,value:q(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:q(e.email),fieldKey:"email",rawValue:e.email}].filter(b=>b.value!=="-"),f=[{label:r.fieldCustomMobilePhone,value:q(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:q(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:q(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:q(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(b=>b.value!=="-"),g=[{fieldKey:"person_id",label:"person_id",value:q(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:q(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:q(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:q(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:q(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:q(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:q(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:Ge(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:q(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:Ge(e.updated_at,r.recordDateTime)}],y=[{rowKey:"person_id",icon:ai,label:"person_id",value:q(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:ri,label:r.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:nt(m.value,!1)},{rowKey:"primary_phone",icon:oi,label:r.summaryPhone,value:i.value??"-",fieldKey:"primary_phone",copyValue:i.value,linkHref:fn(i.value)},{rowKey:"contacted_at",icon:ei,label:r.summaryLastContact,value:p}],w=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:I,recommendedKey:m.fieldKey??null,resolveHref:b=>nt(b!=null?String(b):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:f,recommendedKey:i.fieldKey??null,resolveHref:b=>fn(b!=null?String(b):null)}],D=[{value:"summary",label:r.detailTabSummary,content:me("div",{className:"flex flex-col gap-4",children:[me("div",{className:"flex flex-col gap-1",children:[me("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[M(Zs,{size:16}),M("span",{children:M(pe,{text:q(e.company_name),query:n??"",enabled:a})})]}),v.length>0?M("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:v.map((b,T)=>me("span",{children:[T>0&&" / ",M(pe,{text:b,query:n??"",enabled:a})]},`header-line-${T}`))}):null]}),M("div",{className:"flex flex-col gap-3",children:y.map(b=>M(ui,{icon:b.icon,label:b.label,value:b.value,fieldKey:b.fieldKey,copyValue:b.copyValue,onCopy:h,isCopied:b.fieldKey?c===b.fieldKey:!1,linkHref:b.linkHref,searchTerm:n,enableHighlighting:a},b.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:me("div",{className:"flex flex-col gap-3",children:[M(Ua,{title:r.detailBasicProfile}),M(zr,{items:F,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:M("div",{className:"flex flex-col gap-4",children:w.map(({sectionKey:b,title:T,emptyText:X,entries:W,recommendedKey:de,resolveHref:J})=>me("div",{className:"flex flex-col gap-2",children:[M(Ua,{title:T}),W.length===0?M("p",{className:"text-slate-600 text-xs dark:text-slate-300",children:X}):M("div",{className:"flex flex-col gap-2",children:W.map(A=>{let _=J(A.rawValue),U=A.fieldKey===de;return me("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[me("div",{className:"min-w-0 flex-1",children:[M("div",{className:"font-medium text-slate-600 text-xs dark:text-slate-300",children:A.label}),M("div",{className:"wrap-break-word text-slate-900 text-sm dark:text-slate-100",children:_?M("a",{href:_,className:`text-inherit ${Qt}`,children:M(pe,{text:A.value,query:n??"",enabled:a})}):M(pe,{text:A.value,query:n??"",enabled:a})})]}),U?me("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold ${N} text-emerald-900 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200`,children:[M(Js,{size:14}),r.preferred]}):null]},A.fieldKey)})})]},b))})},{value:"meta",label:r.detailTabMeta,content:me("div",{className:"flex flex-col gap-3",children:[M(Ua,{title:r.detailTabMeta}),M(zr,{items:g,searchTerm:n,enableHighlighting:a})]})}];return me("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${o}`.trim(),style:u,children:[M("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:me("div",{className:"flex items-center gap-2",children:[M("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:M(si,{size:16})}),me("div",{className:"min-w-0 flex-1",children:[M("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:M(pe,{text:C,query:n??"",enabled:a})}),M("div",{className:`truncate ${N} text-slate-600 dark:text-slate-300`,children:M(pe,{text:k,query:n??"",enabled:a})})]})]})}),me(Xn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[M(kn,{className:"grid h-auto grid-cols-4 gap-1 rounded-none border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:D.map(b=>M(Mt,{value:b.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold text-slate-700 ${x} transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-800 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300`,children:M("span",{className:"min-w-0 truncate",children:b.label})},b.value))}),D.map(b=>M(Et,{value:b.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",style:pi[t],children:b.content},b.value))]})]})};wt();le();ge();import{memo as gi}from"react";import{jsx as ot,jsxs as Zn}from"react/jsx-runtime";var Va=gi(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:s,errorMessage:o,onRetry:r})=>{let{locale:c,labels:d}=ve(),l=G(c,e),u=G(c,t);return Zn("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[Zn("span",{className:"flex items-baseline gap-1",children:[ot("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationTotalLabel}),ot("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:l}),ot("span",{className:"text-slate-600 dark:text-slate-300",children:d.recordUnit(l)})]}),Zn("span",{className:"flex items-baseline gap-1",children:[ot("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationCompaniesLabel}),ot("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:u}),ot("span",{className:"text-slate-600 dark:text-slate-300",children:d.companyUnit(u)})]}),n==="streaming"||n==="idle"?ot("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?d.annotationStreamingProgress({loaded:a,total:s,percent:Math.min(100,Math.round(a/s*100))}):d.annotationStreamingCount(a)}):null,n==="retrying"?ot("span",{"data-testid":"contact-map-reconnecting-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-2 py-0.5 font-medium text-amber-900 text-xs dark:bg-amber-900/30 dark:text-amber-200",children:d.annotationReconnecting(a)}):null,n==="failed"||n==="auth-required"?Zn("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?o??void 0:void 0,children:["\u26D4 ",n==="auth-required"?d.annotationAuthRequired:d.annotationLoadFailed(a),r?ot("button",{type:"button","data-testid":"contact-map-retry-button",onClick:r,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-rose-300 bg-white px-1.5 font-semibold ${x} text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900`,children:d.annotationRetry}):null]}):null]})});Va.displayName="ContactMapAnnotation";qt();import{useMemo as Uo}from"react";St();qt();le();import{createContext as fi,useContext as bi,useMemo as yi}from"react";St();qt();ka();var hi=["indexWorker","levenshteinWorker","treeWorker"];function Br(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${Z(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Z(n)}`)}}var Ur={setting:"workerUrls"},Vr=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=hi,hints:s={}}=t;if(!Gt(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${Z(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:l})=>l!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(s,r.key)?s[r.key]:void 0,l=d===void 0?Hn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${l===void 0?"":`; did you mean ${JSON.stringify(l)}?`}); got ${Z(r.key)}`)}let c=Object.create(null);for(let{key:d,url:l}of o){let u=d;Br(n,u,l),l!==void 0&&(c[u]=l)}return c};function Tu(e,t=Ur){Vr(e,t)}function Kr(e){Br("workerUrls","treeWorker",e)}var tn=(e,t,n=Ur)=>{let a=Vr(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};import{jsx as Ka}from"react/jsx-runtime";var jr=e=>{if(!Gt(e))throw new TypeError(`[contact-map] config must be a plain object; got ${Z(e)}`);let t=e;return{streamEndpoint:xe(t,"streamEndpoint"),openEmailsWithGmail:xe(t,"openEmailsWithGmail"),treeWorkerFactory:xe(t,"treeWorkerFactory"),workerUrls:tn(void 0,xe(t,"workerUrls")),locale:xe(t,"locale"),labels:xe(t,"labels")}},Gr=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:s})}))},xi=Gr(jr({})),qr=fi(xi),vi=Object.freeze({locale:"locale",labels:"labels"});function ja({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:r,locale:c,labels:d}=jr(e),{indexWorker:l,levenshteinWorker:u,treeWorker:m}=r,i=yi(()=>Gr({streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:{indexWorker:l,levenshteinWorker:u,treeWorker:m},locale:c,labels:d}),[a,s,o,l,u,m,c,d]);return Ka(qr.Provider,{value:i,children:Ka(Sr,{locale:c,labels:d,surface:t,children:n})})}function Ci({config:e,children:t}){return Ka(ja,{config:e,chromeSurface:vi,children:t})}function st(){return bi(qr)}import{useCallback as Ga,useEffect as Mi,useMemo as na,useSyncExternalStore as Yr}from"react";St();var ki=1e3,Si=3e4,Ti=6;function ta(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${Z(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${Z(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${Z(e)}`)}var wi=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),Ni=e=>Array.isArray(e.records),ea=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};ta(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??ki,this.maxRetryDelayMs=t.maxRetryDelayMs??Si,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ti,this.logger=t.logger??Qe}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(a==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(a==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),a=new TextDecoder,s="",o=!1,r=!1;for(;;){let{done:c,value:d}=await n.read();if(c)break;let l=a.decode(d,{stream:!0}),u=(s+l).split(`
|
|
2
|
-
`);s=u.pop()??"";let m=!1;for(let i of u){let p=i.trim();if(!p)continue;let h;try{h=JSON.parse(p)}catch(v){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",v);continue}if("type"in h&&h.type==="METADATA"){Number.isSafeInteger(h.total)&&h.total>=0&&this.setState({totalCount:h.total});continue}if(!Ni(h)){this.logger.warn("[ContactMapStream] server reported error:","error"in h?h.error:""),r=!0;continue}for(let v of h.records)v&&typeof v.person_id=="number"&&(this.recordMap.set(v.person_id,wi(v)),m=!0);h.nextCursor&&(this.lastCursor=h.nextCursor),h.isLast&&(o=!0)}m&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return r?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):o?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var ze=null,Ei=e=>{if(ze!==null&&ze.endpoint===e)return ze;if(ta(e),ze===null)return ze=new ea({endpoint:e}),ze;if(ze.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(ze.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return ze},Fu=()=>{ze?.dispose(),ze=null},Pi=new Map,Li={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Ri=()=>{let{streamEndpoint:e}=st();return na(()=>(ta(e),e),[e])};function Oi(){let e=Ri(),t=Ga(()=>Ei(e),[e]);Mi(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=Ga(r=>t().subscribe(r),[t]),a=Yr(n,()=>t().getState(),()=>Li),s=Yr(n,()=>t().getRecordMap(),()=>Pi),o=Ga(()=>t().retryNow(),[t]);return na(()=>({...a,recordMap:s,retryNow:o}),[a,s,o])}var _i=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function aa(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:s,totalCount:o,error:r,retryNow:c}=Oi(),d=na(()=>_i(e),[e]);return{context:na(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed",streamPhase:a,loadedCount:s,companyCount:d,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,s,d,o,r]),retryNow:c}}le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as hd,parseQuerySets as fd}from"@aiquants/fuzzy-search";import{useFuzzySearch as bd}from"@aiquants/fuzzy-search/react";import yd from"lucide-react/dist/esm/icons/search.js";import{useCallback as ln,useEffect as lt,useMemo as bt,useRef as Fo,useState as Ve,useTransition as xd}from"react";import{useNavigation as vd,useSearchParams as Cd}from"react-router";Ia();qt();import{useCallback as Pt,useEffect as Ai,useRef as Qr}from"react";var ht=e=>{let t=Qr(null),n=Qr({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,s=Pt(m=>{let i=m.currentTarget,p=m.deltaY;!i||p===0||(m.preventDefault(),i.scrollBy({left:p,behavior:"smooth"}))},[]),o=Pt(m=>{t.current?.removeEventListener("wheel",s),t.current=m,m?.addEventListener("wheel",s,{passive:!1})},[s]);Ai(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let r=Pt(m=>{if(m.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=m.clientX,i.scrollLeft=m.currentTarget.scrollLeft,i.pointerId=m.pointerId,i.hasCapture=!1,i.pointerType=m.pointerType},[]),c=Pt(m=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let p=m.currentTarget,h=m.clientX-i.startX;!i.isDragging&&Math.abs(h)>a&&(i.isDragging=!0,i.hasCapture||(p.setPointerCapture?.(m.pointerId),i.hasCapture=!0)),i.isDragging&&(m.preventDefault(),p.scrollLeft=i.scrollLeft-h)},[a]),d=Pt(m=>{let i=n.current;if(i.pointerType==="touch")return;let p=m.currentTarget;i.isPointerDown&&i.hasCapture&&p.hasPointerCapture?.(m.pointerId)&&p.releasePointerCapture(m.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),l=Pt(m=>{d(m)},[d]),u=Pt(m=>{n.current.didDrag&&(m.preventDefault(),m.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:c,onPointerUp:l,onPointerLeave:l,onPointerCancel:l,onClickCapture:u}};wt();le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Di}from"@aiquants/fuzzy-search";var ra=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=Di;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};xn();import{jsx as Xr}from"react/jsx-runtime";function Jr({value:e,max:t=100,className:n,indicatorClassName:a,...s}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return Xr("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:fe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:Xr("div",{"data-slot":"progress-indicator",className:fe("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}ge();var nn="view";import{useCallback as td,useState as nd}from"react";import{useSearchParams as ad}from"react-router";le();ge();kt();import{Panel as so,PanelGroup as ol,PanelResizeHandle as sl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as il,VirtualScroll as ll,virtualScrollItemElementId as dl}from"@aiquants/virtualscroll";import{lazy as cl,memo as ul,Suspense as ml,useCallback as Le,useEffect as go,useId as io,useLayoutEffect as ho,useMemo as Lt,useRef as an,useState as wn}from"react";var Sn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Tn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function oa(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,s=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:s}}import{useCallback as Wi,useEffect as Hi,useState as Ii}from"react";var Zr=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:s=240}=t??{},[o,r]=Ii(600),c=Wi(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let l=T=>Number.parseFloat(T)||0,{top:u}=d.getBoundingClientRect(),m=d.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),p=l(i.getPropertyValue("--footer-height")),h=l(i.getPropertyValue("--header-height")),v=l(i.getPropertyValue("--scrollbar-height")),k=window.getComputedStyle(d),C=l(k.marginBottom),F=l(k.paddingBottom),I=window.innerHeight-p-v-a,f=m?Math.min(m.bottom,I):I,g=m?Math.max(m.top,h):h,y=Math.max(u,g),w=f-y-C-F,D=Number.isFinite(w)?Math.floor(w):0,b=D>0?D:s;b>0&&Number.isFinite(b)&&r(T=>Math.abs(T-b)>1?b:T)},[a,e,s]);return Hi(()=>{if(typeof window>"u")return;let d=null,l=null,u=null,m=null,i=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{c()})};i(),l=window.setTimeout(()=>{i()},150);let p=e.current;return typeof ResizeObserver<"u"&&p&&(u=new ResizeObserver(()=>{i()}),u.observe(p),p.parentElement&&u.observe(p.parentElement)),n&&typeof MutationObserver<"u"&&(m=new MutationObserver(()=>{i()}),m.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{d!==null&&window.cancelAnimationFrame(d),l!==null&&window.clearTimeout(l),u&&u.disconnect(),m&&m.disconnect(),window.removeEventListener("resize",i)}},[e,n,c]),{viewportHeight:o,updateViewportHeight:c}};import{useCallback as it,useEffect as eo,useRef as sa,useState as to}from"react";var Fi=600,no=8,ia=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[s,o]=to(!1),[r,c]=to(null),d=sa(null),l=sa(!1),u=sa(null),m=sa({onSelect:t,resolveItem:n,item:a});eo(()=>{m.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let i=it(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),p=it(()=>{u.current&&(i(),u.current=null)},[i]),h=it(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(i(),l.current=!1,u.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},d.current=window.setTimeout(()=>{let y=m.current,w=null;y.item!==void 0?w=y.item:y.resolveItem&&g.target&&(w=y.resolveItem(g.target)),w!==null&&(l.current=!0,y.onSelect?.(w),c(w),o(!0)),p()},Fi))},[i,p]),v=it(g=>{u.current&&g.pointerId===u.current.pointerId&&(i(),u.current=null)},[i]),k=it(g=>{l.current&&(g.preventDefault(),g.stopPropagation(),g.type==="click"&&(l.current=!1))},[]),C=it(()=>{l.current=!1},[]),F=it(g=>{if(!u.current||g.pointerId!==u.current.pointerId)return;let y=Math.abs(g.clientX-u.current.x),w=Math.abs(g.clientY-u.current.y);(y>no||w>no)&&(i(),u.current=null)},[i]),I=it(g=>{(s||d.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),f=it(()=>{o(!1),c(null),l.current=!1,u.current=null},[]);return eo(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let y=[["pointerdown",h,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",F,void 0],["pointerleave",v,void 0],["contextmenu",I,void 0]],w=[["mousedown",k,!0],["mouseup",k,!0],["click",k,!0],["pointerdown",C,!0],["keydown",C,!0],["contextmenu",I,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[D,b,T]of y)g.addEventListener(D,b,T);for(let[D,b,T]of w)window.addEventListener(D,b,T);return()=>{for(let[D,b,T]of y)g.removeEventListener(D,b,T);for(let[D,b,T]of w)window.removeEventListener(D,b,T);i()}},[e,h,v,F,k,C,I,i]),{isPopupVisible:s,popupItem:r,handleClosePopup:f}};import{useCallback as $i,useEffect as zi,useState as ao,useSyncExternalStore as Bi}from"react";function la(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",s=Bi($i(u=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let m=window.matchMedia(a);return m.addEventListener("change",u),()=>m.removeEventListener("change",u)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=ao(!1),[c,d]=ao(0);return zi(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let u=e.current;if(!u)return;let m=new ResizeObserver(i=>{for(let p of i){if(p.target!==u)continue;let h=0;p.borderBoxSize&&p.borderBoxSize.length>0?h=p.borderBoxSize[0].inlineSize:h=p.contentRect.width,!(!Number.isFinite(h)||h<=0)&&(d(h),r(v=>v&&h>=t.expandThreshold?!1:!v&&h<t.collapseThreshold?!0:v))}});return m.observe(u),()=>m.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!o,isContainerNarrow:o,isMediaMatches:s,containerWidth:c}}le();St();var ro=e=>e.isComposing||e.keyCode===229;var oo=(e,t)=>{if(Ki(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||ro(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return Vi(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},Ui=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),Vi=e=>Ui.has(e),Ki=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:s}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${Z(a)}`);if(!Number.isInteger(s)||s<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${Z(s)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${Z(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${Z(t)}`)};le();Oa();yn();xn();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as ji,useOverlayPresence as Gi,useSwipeOverlayDialog as qi}from"@aiquants/swipe-overlay";import{useCallback as Yi,useId as Qi}from"react";import{jsx as da,jsxs as qa}from"react/jsx-runtime";var Xi=fe(Fn,"flex overflow-hidden"),Ji=fe(zn,"motion-safe:transition-opacity motion-safe:duration-200"),Zi="relative ml-auto flex h-full w-full max-w-lg flex-col bg-white shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out dark:bg-slate-900",el="flex shrink-0 items-center justify-between gap-3 border-slate-200 border-b px-3 py-2 dark:border-slate-700",tl="min-w-0 truncate font-semibold text-base text-slate-900 outline-none dark:text-slate-100",nl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-300 px-4 font-medium text-slate-700 text-sm hover:bg-slate-100 dark:border-slate-600 dark:text-slate-200 dark:hover:bg-slate-800 ${gt}`,al="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",ca=({isOpen:e,onClose:t,children:n,className:a,title:s})=>{let o=Y(),r=Qi(),c=Gi(e),d=Yi(h=>h.ownerDocument.getElementById(r),[r]),{dialogProps:l,backdropProps:u,panelProps:m,attemptClose:i,isSwiping:p}=qi({isOpen:e,onClose:t,isCloseBlocked:Bn,skipWhenTextSelected:!0,initialFocus:d});return c?qa("dialog",{...l,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:fe(Xi,e&&!p?"pointer-events-auto":"pointer-events-none"),style:$n,children:[da("div",{...u,"data-contact-map-overlay-backdrop":"",className:fe(Ji,e?"opacity-100":"opacity-0")}),qa("div",{...m,"data-contact-map-overlay-panel":"",className:fe(Zi,e?"pointer-events-auto":"pointer-events-none",a),children:[qa("div",{className:el,children:[da("h2",{id:r,tabIndex:-1,className:tl,children:s===void 0?o.overlayTitle:s}),da("button",{type:"button",className:nl,onClick:()=>i(),children:o.close})]}),da("div",{"data-contact-map-overlay-body":"",className:al,style:ji,children:n})]})]}):null};yn();ge();Wa();import{Fragment as Nl,jsx as $,jsxs as Be}from"react/jsx-runtime";var pl=cl(async()=>({default:(await Promise.resolve().then(()=>(Ir(),Hr))).default})),Ya=64,lo="h-[64px]",co=240,gl=4,Qa=oa(Sn),hl=Sn.listPanelMinWidth,fl=Sn.detailPanelMinWidth,bl=Sn.handleThickness,Pm=Qa.collapseThreshold,Lm=Qa.expandThreshold,yl=({contactData:e})=>{let t=Y(),n=Ie(e?.full_name)??t.noName,a=Ie(e?.title)??"-",s=Ie(e?.company_name)??"-",o=Ie(e?.department)??"-",r=Kt(e).value??"-",c=jt(e).value??"-",d=Ge(e?.updated_at,t.recordDateTime);return $(Kn,{fullName:n,title:a,companyName:s,department:o,phoneNumber:c,email:r,updatedAtText:d})},xl=e=>({"--contact-panel-height":`${e}px`}),vl=e=>typeof e=="object"&&e!==null&&"item"in e,Cl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,kl=(e,t)=>{for(let n of e){let a=Ct(n);if(a?.person_id===t)return a}return null},uo=(e,t)=>t!==null&&Ct(e)?.person_id===t,mo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let s=Ct(e[a]);if(s!==null)return{index:a,personId:s.person_id}}return null},po=(e,t,n)=>{let a=mo(e,t,n);return a!==null?a:mo(e,t-n,n===1?-1:1)},Xa=(e,t,n)=>{let{viewportHeight:a}=Zr(t,{enableMutationObserver:!0,bottomGap:gl,minFallbackHeight:co}),[s,o]=wn(0),r=Le(()=>{let m=n.current,i=t.current;if(!(m&&i))return;let p=m.getBoundingClientRect(),h=i.getBoundingClientRect(),v=Math.ceil(h.top-p.top);Number.isFinite(v)&&v>0&&o(k=>Math.abs(k-v)>1?v:k)},[t,n]);ho(()=>{if(!e)return;r();let m=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(m),window.removeEventListener("resize",r)}},[e,r]);let c=a>0?a:co,d=s>0?s:0,l=c+d,u=Lt(()=>xl(l),[l]);return{normalizedViewportHeight:c,normalizedDetailHeight:l,panelSizingStyle:u}},Sl=new Set,Tl=()=>{let[e,t]=wn(Sl),n=Le((a,s)=>{t(o=>{if(o.has(a)===s)return o;let r=new Set(o);return s?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},wl=(e,t,n)=>{let a=an(n);ho(()=>{a.current=n},[n]),go(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},fo=ul(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:s,isActive:o,onSelect:r,onLongPressSelect:c,searchQuery:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:m,onPopupVisibilityChange:i})=>{let p=Y(),h=an(null),v=$("div",{className:lo}),k=vl(e)?e:null,C=Ct(e),{isPopupVisible:F,handleClosePopup:I}=ia({ref:h,onSelect:c,item:C?.person_id});if(wl(C?.person_id??null,F,i),!e||!C)return v;let{person_id:f}=C,g=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",w=s?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":g,D=["B","F"].map(b=>Cl(b,b==="B"?k?.baseScore:k?.score)).filter(Boolean);return Be("div",{ref:h,id:dl(a,f),className:`flex ${lo} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${w} ${wr}`,style:{height:Ya},role:"option","aria-selected":s,"aria-posinset":t+1,"aria-setsize":n,"data-selected":s?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(f),children:[Be("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[$("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:p.listRowNumber(t+1)}),$("div",{className:`truncate ${pt} text-slate-700 leading-tight dark:text-slate-200`,children:f}),$("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${pt} text-slate-600 leading-tight dark:text-slate-300`,children:D.length?D.map(b=>$("span",{children:b},b)):$("span",{children:"-"})})]}),$(ml,{fallback:$(yl,{contactData:C}),children:$(pl,{contactData:C,searchTerm:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:m,isPopupVisible:F,onRequestClose:I})})]})});fo.displayName="ContactListRow";var bo=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:s,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:c}=e,{locale:d,labels:l,engineLabels:u}=ve(),m=an(null),i=an(null),[p,h]=wn(null),{normalizedViewportHeight:v,panelSizingStyle:k}=Xa(c,i,m),{isAnyPopupVisible:C,handlePopupVisibilityChange:F}=Tl(),I=Lt(()=>({enablePointerDrag:!C,enableKeyboardNavigation:!1}),[C]),f=Lt(()=>s?n:t,[s,n,t]),[g,y]=wn(null),w=Le(K=>{h(K),y(K)},[]),D=Le(K=>{if(!r)return;let se=K.trim();if(!se||se==="-"||typeof window>"u")return;let V=nt(se,!0);V&&window.open(V,"_blank","noopener,noreferrer")},[r]),[b,T]=wn(!1),X=Le(()=>T(!1),[]),W=Le(K=>{w(K),T(!0)},[w]),de=io(),J=io(),A=an(null),_=f.length,U=Le((K,se)=>$(fo,{entry:K,index:se,itemCount:_,listboxId:de,isSelected:uo(K,p),isActive:uo(K,g),onSelect:W,onLongPressSelect:w,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:D,onPopupVisibilityChange:F}),[_,de,p,g,W,w,a,o,r,D,F]),re=Lt(()=>{let K=new Map;return f.forEach((se,V)=>{let ct=Ct(se);ct!==null&&K.set(ct.person_id,V)}),K},[f]),ce=g===null?null:re.get(g)??null,Se=p===null?null:re.get(p)??null,yt=Math.max(1,Math.floor(v/Ya)),_t=Le(K=>{if(K.target.id!==de)return;let se=oo(K.nativeEvent,{activeIndex:ce,startIndex:Se===null?0:Se,itemCount:_,pageSize:yt});if(se===null)return;if(K.preventDefault(),se.kind==="activate"){ce!==null&&g!==null&&W(g);return}let V=po(f,se.index,se.direction);V!==null&&(y(V.personId),A.current?.scrollToIndex(V.index,{align:"nearest"}))},[de,ce,Se,_,yt,g,W,f]),dt=Le(K=>{if(K.target.id!==de||ce!==null||!K.target.matches(":focus-visible"))return;let se=po(f,Se===null?0:Se,1);se!==null&&y(se.personId)},[de,ce,Se,f]),At=Lt(()=>({id:de,role:"listbox",tabIndex:0,"aria-label":l.listboxLabel,"aria-describedby":J}),[de,l.listboxLabel,J]),ue=Le(K=>f[K],[f]),Dt=Le(K=>Ct(f[K])?.person_id??`row-${K}`,[f]),Ae=Le(()=>Ya,[]),Ze=Lt(()=>({enabled:!0,renderVisual:il}),[]),De=Lt(()=>p===null?null:kl(f,p),[p,f]);go(()=>{p!==null&&!De&&h(null)},[p,De]);let Me=an(null),{isTwoColumn:Wt}=la(Me,Qa);b&&(Wt||De===null)&&T(!1);let xt=Be("div",{ref:m,className:"flex min-h-0 flex-1 flex-col gap-1",children:[$("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:Be("div",{className:"flex items-center",children:[Be("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${N} text-slate-700 uppercase tracking-wider dark:text-slate-200`,children:[$("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:l.columnNo}),$("span",{className:"leading-tight",children:l.columnId}),$("span",{className:"whitespace-nowrap leading-tight",children:l.columnScore})]}),Be("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Be("div",{className:"flex flex-col gap-0.5",children:[$("span",{children:l.columnName}),$("span",{className:`font-normal ${N} text-slate-600 uppercase tracking-wider dark:text-slate-300`,children:l.columnTitle})]}),Be("div",{className:"flex flex-col gap-0.5",children:[$("span",{children:l.columnCompany}),$("span",{className:`font-normal ${N} text-slate-600 uppercase tracking-wider dark:text-slate-300`,children:l.columnDepartment})]}),Be("div",{className:"flex flex-col gap-0.5",children:[$("span",{children:l.columnPhone}),$("span",{className:`font-normal ${N} text-slate-600 uppercase tracking-wider dark:text-slate-300`,children:l.columnEmail})]}),$("div",{className:"hidden items-end justify-end xl:flex",children:$("span",{className:`font-normal ${N} text-slate-600 uppercase tracking-wider dark:text-slate-300`,children:l.columnUpdatedAt})})]})]})}),$("p",{id:J,hidden:!0,children:l.listKeyboardHelp}),$("div",{ref:i,className:"flex-1",onKeyDown:_t,onFocus:dt,children:$(ll,{ref:A,contentProps:At,activeItemIndex:_===0?void 0:ce,activeItemVisibleInset:2,itemCount:_,getItemKey:Dt,behaviorOptions:I,getItem:ue,getItemHeight:Ae,viewportSize:v,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:Ze},locale:d,labels:u,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(K,se)=>U(K,se)})}),n.length===0&&s?$("div",{className:"py-8 text-center",children:$("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoSearchResults})}):null,_===0&&!s?$("div",{className:"py-8 text-center",children:$("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoData})}):null]});return $("div",{ref:Me,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:k,children:Wt?Be(ol,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[$(so,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:hl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),$(sl,{id:"contact-map-list-handle",thickness:bl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.listResizeHandle}),$(so,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:fl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:$(en,{placement:"pane",contact:De,searchTerm:a,enableHighlighting:o})})]}):Be(Nl,{children:[xt,De?$(ca,{isOpen:b,onClose:X,title:l.detailHeading,children:$(en,{placement:"overlay",contact:De,searchTerm:a,enableHighlighting:o})}):null]})})};kt();import{DirectoryTree as Hl}from"@aiquants/directory-tree";import{Panel as To,PanelGroup as Il,PanelResizeHandle as Fl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as $l}from"@aiquants/virtualscroll";import zl from"@heroicons/react/24/solid/FolderMinusIcon.js";import Bl from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Re,useEffect as Ot,useMemo as Ue,useRef as ga,useState as ft}from"react";import{createPortal as Ul}from"react-dom";var Ja=(e,t)=>e&&e.trim()||t;import{useEffect as Ml,useRef as ua,useState as El}from"react";var yo=(e,t=250)=>{let[n,a]=El(e),s=ua(null),o=ua(e),r=ua(null),c=ua(!1);return Ml(()=>{if(!c.current){c.current=!0,a(e),o.current=e;return}o.current=n,s.current=null;let d=l=>{s.current??(s.current=l);let u=l-s.current,m=Math.min(1,Math.max(0,u/t)),i=1-(1-m)**3,p=Math.max(0,Math.round(o.current+(e-o.current)*i));a(p),m<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};St();import{useCallback as Za,useEffect as er,useMemo as xo,useRef as Pl,useSyncExternalStore as Ll}from"react";le();var Rl=250,Ol=4e3,ma=3,vo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Co=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,pa=class{constructor(t,{workerSource:n,logger:a=Qe}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=ma){this.logger.error(`[TreeWorker] the tree Worker failed ${ma} times in a row; the tree stops updating until ${vo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Rl*2**(this.consecutiveFailures-1),Ol);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${ma})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${Z(n)}`);if(!Object.hasOwn(vo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${Z(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=ma||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!Co(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let s=this.workerNeedsReset,o=this.postedNaming===null||!Co(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},_l=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},Rt=null,ko=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Al=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},Dl=e=>{if(Kr(e),Rt===null){let t=new pa(()=>_l(e),{workerSource:"workerUrls.treeWorker"});return Rt={session:t,workerUrl:e},t}if(Rt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${ko(Rt.workerUrl)} and cannot also load it from ${ko(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Rt.session},Bm=()=>{Rt?.session.reset(),Rt=null},Wl={snapshot:null,isBuilding:!1};function So(e,t=!1){let n=st(),a=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:o}=ve(),r=o.uncategorizedCompany,c=o.noName,d=xo(()=>({uncategorizedCompany:r,unnamedPerson:c}),[r,c]),l=Pl(a);er(()=>{l.current=a},[a]);let u=a!==void 0,m=u?void 0:s,i=xo(()=>u?new pa(()=>Al(l.current)(),{workerSource:"treeWorkerFactory"}):null,[u]),p=Za(()=>i===null?Dl(m):i,[i,m]),h=Za(k=>p().subscribe(k),[p]),v=Za(()=>p().getState(),[p]);return er(()=>{let k=p();k.syncRecords(e,d),t&&k.finalize()},[p,e,t,d]),er(()=>{if(i!==null)return()=>i.stop()},[i]),Ll(h,v,()=>Wl)}le();ge();Da();qn();import{Fragment as ed,jsx as z,jsxs as ke}from"react/jsx-runtime";var ar=oa(Tn),Vl=Tn.listPanelMinWidth,Kl=Tn.detailPanelMinWidth,jl=Tn.handleThickness,mp=ar.collapseThreshold,pp=ar.expandThreshold,Gl=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,s=Ja(e.full_name,t.noName),o=Ja(e.title,""),r=z(pe,{text:s,query:n,enabled:a});return o?ke("span",{className:"flex items-center gap-1.5",children:[z("span",{children:r}),z("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:z(pe,{text:o,query:n,enabled:a})})]}):r},ql="contact-map-tree h-full w-full",Yl={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},tr="h-4 w-4 shrink-0 transition-colors duration-150",Ql=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),ha=null,wo=null,Nn=new Map,No="",Mo=null,Eo=null,Xl=(e,t,n,a,s)=>{let o=`${n?"icons":"plain"}#${a}#${s.noName}`;(o!==No||s.formatDirectoryName!==Mo||t!==Eo)&&(Nn.clear(),No=o,Mo=s.formatDirectoryName,Eo=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},c=new Set;for(let d of e){c.add(d.absolutePath);let l=`${d.name}\0${d.memberCount}`,u=Nn.get(d.absolutePath);(!u||u.signature!==l)&&(u={signature:l,result:Ro([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},Nn.set(d.absolutePath,u));let m=u.result;m.entries.length>0&&r.entries.push(m.entries[0]);for(let[i,p]of m.personPathMap){let h=r.personPathMap.get(i);if(h)for(let v of p)h.add(v);else r.personPathMap.set(i,new Set(p))}for(let[i,p]of m.contactByPath)r.contactByPath.set(i,p);for(let[i,p]of m.ancestorsByPath)r.ancestorsByPath.set(i,p);r.totalCount+=m.totalCount,!r.firstPerson&&m.firstPerson&&(r.firstPerson=m.firstPerson)}for(let d of Nn.keys())c.has(d)||Nn.delete(d);return r},nr=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",Lo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Lo(n.children)));return t},Jl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Ro=(e,t,n,a,s)=>{let o=new Map,r=new Map,c=new Map,d=0,l=null,u=(i,p)=>{let h=[...p,i.absolutePath];c.set(i.absolutePath,h);let v,k,C=i.type==="directory"?a.formatDirectoryName(i.name,Jl(i)):i.name,F=z(pe,{text:C,query:a.searchQuery,enabled:a.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let I=t.get(i.personId);if(I){r.set(i.absolutePath,I),o.has(i.personId)||o.set(i.personId,new Set);let f=o.get(i.personId);f&&f.add(i.absolutePath),d++,l||(l={personId:i.personId,path:i.absolutePath}),n&&(k=g=>{let y=nr(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(y=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),z(n.person,{"aria-hidden":"true",className:`${tr} ${y}`})},i.title&&(F=Gl(I,a))),F=z("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:F})}}else if(i.children){let I=i.children.map(f=>u(f,h)).filter(f=>f!==null);if(s&&I.length===0)return null;if(v=I,n){let f=i.relativePath.startsWith("company:")?n.company:n.department;k=g=>z(f,{"aria-hidden":"true",className:`${tr} ${nr(g)}`})}}return{name:C,label:F,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:k,children:v}};return{entries:e.map(i=>u(i,[])).filter(i=>i!==null),personPathMap:o,contactByPath:r,ancestorsByPath:c,firstPerson:l,totalCount:d}},Zl=(e,t,n)=>{let a=new Set,s=new Set,o=new Map;t.forEach((u,m)=>{o.set(u.item.person_id,m)});for(let u of t){let m=u.item.person_id,i=e.personPathMap.get(m);if(i)for(let p of i){a.add(p);let h=e.ancestorsByPath.get(p);if(h){for(let v of h)a.add(v);n&&h.length>0&&s.add(h[0])}}}let r=new Map,c=u=>{let m=r.get(u.absolutePath);if(m!==void 0)return m;let i=1/0;if(u.type==="file"){let p=e.contactByPath.get(u.absolutePath);p&&(i=o.get(p.person_id)??1/0)}else if(u.children)for(let p of u.children)i=Math.min(i,c(p));return r.set(u.absolutePath,i),i},d=(u,m=0)=>u.filter(i=>n&&m===0&&s.has(i.absolutePath)?!0:a.has(i.absolutePath)).map(i=>n&&m===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:d(i.children,m+1)}:i).sort((i,p)=>m===0?c(i)-c(p):0),l=d(e.entries);return{...e,entries:l}},Po=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let s=a.values().next();return s.done?null:s.value},Oo=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:s,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:c}=e,{locale:d,labels:l,treeLabels:u}=ve(),m=l.noName,i=l.treeDirectoryName,p=Ue(()=>({noName:m,formatDirectoryName:i}),[m,i]),[h,v]=ft(null),[k,C]=ft(!1),{snapshot:F,isBuilding:I}=So(n,e.isStreamingComplete),f=F?.tree??null,g=F?.rebuildEpoch??0,y=Ue(()=>f?Xl(f,a,h,g,p):null,[f,a,h,g,p]),w=Ue(()=>{if(!f)return null;if(!o)return y;let R;k||(R=new Set(s.map(P=>P.item.person_id)));let S=Ro(f,a,h,{...p,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},R);return Zl(S,s,k)},[f,y,a,h,e.searchQuery,e.enableHighlighting,o,s,k,p]),D=Ue(()=>w||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[w]),b=o&&e.errorMessage!==null,[T,X]=ft(D),W=ga(!1);Ot(()=>{if(!(r||b)){W.current=!!f,X(D);return}!W.current&&f&&D.entries.length>0&&(W.current=!0,X(D))},[D,f,r,b]);let de=o&&(r||b)?T:D,{entries:J,personPathMap:A,contactByPath:_,totalCount:U}=de,re=Ue(()=>Lo(J),[J]),[ce,Se]=ft(()=>wo??new Set),yt=Re(R=>!ce.has(R),[ce]),_t=Re(R=>{Se(S=>{let P=new Set(S);return P.has(R)?P.delete(R):P.add(R),P})},[]),dt=Re(R=>{R.length!==0&&Se(S=>{let P=new Set(S);for(let ie of R)P.add(ie);return P})},[]),At=Re(R=>{Se(S=>{if(S.size===0)return S;let P=!1,ie=new Set(S);for(let Te of R)ie.delete(Te)&&(P=!0);return P?ie:S})},[]);Ot(()=>{wo=ce},[ce]),Ot(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[ue,Dt]=ft(null),[Ae,Ze]=ft(null),[De,Me]=ft(!1),Wt=Re(()=>Me(!1),[]),[xt,K]=ft(!1),se=ga(null),V=ga(null),{normalizedViewportHeight:ct,panelSizingStyle:Ht}=Xa(c,V,se),It=Re(R=>{let S=_.get(R);return S?(ue!==S.person_id&&Dt(S.person_id),R!==Ae&&Ze(R),!0):!1},[_,Ae,ue]),et=Re(R=>{It(R)&&Me(!0)},[It]),Ee=Re(R=>{et(R.entry.absolutePath)},[et]),En=Re(R=>R instanceof Element?R.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:un,popupItem:We,handleClosePopup:mn}=ia({ref:V,resolveItem:En,onSelect:It}),ut=Re(R=>{if(!e.openEmailsWithGmail)return;let S=R.trim();if(!S||S==="-"||typeof window>"u")return;let P=nt(S,!0);P&&window.open(P,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),He=We?_.get(We):null,Ke=un&&He!==null&&He!==void 0;Ot(()=>{un&&!He&&mn()},[un,He,mn]);let pn=Ue(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:$l}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Ft=Ue(()=>Ql(pn,ct,Ke),[pn,ct,Ke]);Ot(()=>{let R=!1;return typeof window>"u"?()=>{R=!0}:ha?(v(ha),()=>{R=!0}):((async()=>{try{let[P,ie,Te,tt]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(R)return;let vt=P.default,xa=ie.default,pr=Te.default,gr=tt.default;vt&&xa&&pr&&gr&&(ha={company:vt,department:xa,title:pr,person:gr},v(ha))}catch(P){Qe.warn("Failed to load lucide icons",P)}})(),()=>{R=!0})},[]);let $t=Ue(()=>{if(!h)return;let R=tt=>vt=>z(tt,{"aria-hidden":"true",className:`${tr} ${nr(vt)}`}),S={company:R(h.company),department:R(h.department),title:R(h.title)},P=R(h.person),ie=tt=>tt in S,Te=tt=>{let[vt]=tt.entry.relativePath.split(":",1);return(ie(vt)?S[vt]:S.company)(tt)};return{directory:Te,directoryExpanded:Te,file:P}},[h]),gn=Re(()=>{Se(R=>R.size===0?R:new Set)},[]),mt=Re(()=>{re.length>0&&dt(re)},[re,dt]);Ot(()=>{if(typeof window>"u")return;let R=document.documentElement,S=window.matchMedia("(prefers-color-scheme: dark)"),P=()=>K(R.classList.contains("dark")||S.matches);P(),S.addEventListener("change",P);let ie=new MutationObserver(P);return ie.observe(R,{attributes:!0,attributeFilter:["class"]}),()=>{S.removeEventListener("change",P),ie.disconnect()}},[]);let zt=Po(ue,Ae,A);Ot(()=>{let R=Po(ue,Ae,A);if(R===null){ue!==null&&Dt(null),Ae!==null&&Ze(null);return}R!==Ae&&Ze(R)},[ue,Ae,A]);let Bt=zt===null?null:_.get(zt)??null,Pn=xt?"#475569":"#94A3B8",Ut=e.isStreamingComplete,Ln=e.isStreamingFailed,je=Ut&&n.length===0,Vt=(I||!f)&&!je,ba=yo(U,250),Rn=f!==null||je,On=ke("div",{className:"flex flex-wrap items-center gap-1.5",children:[ke("span",{className:`inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono ${N} text-slate-700 dark:bg-slate-800 dark:text-slate-200`,title:l.treeNodeCountTitle,children:[z("span",{children:"\u{1F333}"})," ",l.treeNodeCountLabel," ",Rn?l.treeNodeCount(ba):"\u2026"]}),Ln&&!Ut?ke("span",{className:`inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium ${N} text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300`,title:l.treeStreamInterruptedTitle,children:[z("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),z("span",{children:"\u26D4"})," ",l.treeStreamInterrupted]}):Ut?Vt?ke("span",{className:`inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium ${N} text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300`,title:l.treeBuildingTitle,children:[ke("span",{className:"relative flex h-1.5 w-1.5",children:[z("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),z("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),z("span",{children:"\u{1F33F}"})," ",l.treeBuilding]}):ke("span",{className:`inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium ${N} text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300`,title:l.treeCompleteTitle,children:[z("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),z("span",{children:"\u2705"})," ",l.treeComplete]}):ke("span",{className:`inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium ${N} text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300`,title:l.treeStreamLoadingTitle,children:[ke("span",{className:"relative flex h-1.5 w-1.5",children:[z("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),z("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),z("span",{children:"\u23F3"})," ",l.treeStreamLoading]}),o&&ke("button",{type:"button",onClick:()=>C(!k),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${k?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:l.treeShowEntireCompanyTitle,children:[z("span",{children:"\u{1F3E2}"})," ",l.treeShowEntireCompany]}),re.length>0?ke("div",{className:"flex items-center gap-1",children:[z("button",{type:"button",onClick:gn,className:"inline-flex h-11 w-11 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeExpandAll,title:l.treeExpandAllTitle,children:z(Bl,{className:"h-4 w-4"})}),z("button",{type:"button",onClick:mt,className:"inline-flex h-11 w-11 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeCollapseAll,title:l.treeCollapseAllTitle,children:z(zl,{className:"h-4 w-4"})})]}):null]}),hn=ga(null),{isTwoColumn:_n}=la(hn,ar,{mediaQuery:"(min-width: 768px)"});De&&(_n||Bt===null)&&Me(!1);let An=Ue(()=>({toggle:_t,isExpanded:yt,expandMultiple:At,collapseMultiple:dt,isPending:r}),[dt,At,yt,_t,r]),Dn=Ue(()=>({onEntryClick:Ee,selectedPath:zt}),[Ee,zt]),mr=Ue(()=>({className:ql,lineColor:Pn,iconOverrides:$t,showDirectoryIcons:!!$t,showFileIcons:!!$t,highlightStyles:Yl,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[Pn,$t]),ya=z("div",{ref:se,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:z("div",{ref:V,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:J.length>0?z(Hl,{entries:J,expansion:An,selection:Dn,visual:mr,virtualScroll:Ft,locale:d,labels:u}):z("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:o?l.treeNoMatches:l.treeEmpty})})});return ke("div",{ref:hn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:Ht,children:[t&&Ul(On,t),_n?ke(Il,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[z(To,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Vl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ya}),z(Fl,{id:"contact-map-tree-handle",thickness:jl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.treeResizeHandle}),z(To,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Kl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:z(en,{placement:"pane",contact:Bt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):ke(ed,{children:[ya,Bt?z(ca,{isOpen:De,onClose:Wt,title:l.detailHeading,children:z(en,{placement:"overlay",contact:Bt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),Ke&&He&&z(Vn,{contactData:He,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:ut,onRequestClose:mn})]})};import{jsx as Mn,jsxs as rn}from"react/jsx-runtime";var rd={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},od=e=>e==="tree"?"tree":"list",_o=({context:e})=>{let t=Y(),[n,a]=ad(),[s,o]=nd(null),r=od(n.get(nn)),{setScrollableRef:c,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:m,onPointerCancel:i,onClickCapture:p}=ht(),h=td(v=>{let k=v==="tree"?"tree":"list";if(k===r)return;let C=new URLSearchParams(typeof window<"u"?window.location.search:"");k==="list"?C.delete(nn):C.set(nn,k),a(C,{replace:!0})},[r,a]);return rn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[rn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[rn("div",{ref:c,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:rd,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:m,onPointerCancel:i,onClickCapture:p,children:[rn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>h("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),rn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>h("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),Mn("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),rn("div",{className:"flex h-full flex-1 flex-col",children:[Mn("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?Mn(bo,{context:e}):null}),Mn("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?Mn(Oo,{context:e,controlsContainer:s}):null})]})]})};import{memo as ld}from"react";le();ge();le();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as B}from"@aiquants/fuzzy-search";import{memo as sd,useId as Ne}from"react";import{jsx as O,jsxs as H}from"react/jsx-runtime";var rr=1e3,or=sd(({searchOptions:e,setSearchOptions:t})=>{let n=Y(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=Ne(),c=Ne(),d=Ne(),l=Ne(),u=Ne(),m=Ne(),i=Ne(),p=Ne(),h=Ne(),v=Ne(),k=Ne(),C=[];C.push(H("div",{className:`${a} border-green-200 border-l-4 dark:border-green-400/60`,children:[H("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:r,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexNgramSize}),O("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||B.ngramSize,onChange:f=>t(g=>({...g,ngramSize:parseInt(f.target.value,10)})),className:"h-11 w-full"}),H("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||B.ngramSize]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexNgramSizeHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:c,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexMinNgramOverlap}),O("input",{id:c,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||B.minNgramOverlap,onChange:f=>t(g=>({...g,minNgramOverlap:parseInt(f.target.value,10)})),className:"h-11 w-full"}),H("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||B.minNgramOverlap]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),C.push(H("div",{className:`${a} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[H("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:d,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexThreshold}),O("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??B.indexWorkerOptions?.threshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??B.indexWorkerOptions?.threshold]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexThresholdHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:u,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexNgramOverlapThreshold}),O("input",{id:u,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??B.indexWorkerOptions?.ngramOverlapThreshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??B.indexWorkerOptions?.ngramOverlapThreshold]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),C.push(H("div",{className:`${a} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[H("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:l,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexStrategy}),H("select",{id:l,value:e.indexWorkerOptions?.strategy??B.indexWorkerOptions?.strategy??"hybrid",onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:f.target.value}})),className:`min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base ${x} transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100`,children:[O("option",{value:"fast",children:n.indexStrategyFast}),O("option",{value:"accurate",children:n.indexStrategyAccurate}),O("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexStrategyHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:m,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexMinCandidatesRatio}),O("input",{id:m,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??B.indexWorkerOptions?.minCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??B.indexWorkerOptions?.minCandidatesRatio]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexMinCandidatesRatioHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:i,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexMaxCandidatesRatio}),O("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??B.indexWorkerOptions?.maxCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??B.indexWorkerOptions?.maxCandidatesRatio]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),C.push(H("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[H("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:p,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexJaroWinklerPrefix}),O("input",{id:p,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??B.indexWorkerOptions?.jaroWinklerPrefix,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??B.indexWorkerOptions?.jaroWinklerPrefix]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexJaroWinklerPrefixHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:h,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.maxResults}),H("label",{className:`flex min-h-11 items-center gap-2 ${x} text-gray-600 dark:text-slate-300`,children:[O("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:f.target.checked?void 0:rr}}))}),n.noLimit]}),O("input",{id:h,type:"range",min:rr,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?rr:e.indexWorkerOptions.maxResults,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(f.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexMaxResultsHint})]})]},"jaro")),C.push(H("div",{className:`${a} border-emerald-200 border-l-4 ${o?"":"opacity-50"} dark:border-emerald-400/60`,children:[H("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:v,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.fieldWeight}),O("input",{id:v,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??B.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(f.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??B.indexWorkerOptions?.relevanceFieldWeight??.2]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexFieldWeightHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:k,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexPerfectMatchBonus}),O("input",{id:k,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??B.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(f.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??B.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexPerfectMatchBonusHint})]}),!o&&O("p",{className:`${N} text-emerald-600 dark:text-emerald-300`,children:n.relevanceOnlyNotice})]},"relevance"));let F=Ne(),I=Ne();return C.push(H("div",{className:`${a} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[H("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:F,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexContainmentBase}),O("input",{id:F,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??B.indexWorkerOptions?.containmentScoreBase??.7,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??B.indexWorkerOptions?.containmentScoreBase??.7]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexContainmentBaseHint})]}),H("div",{className:"space-y-2",children:[O("label",{htmlFor:I,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.indexContainmentCoverage}),O("input",{id:I,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??B.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(f.target.value)}})),className:"h-11 w-full"}),H("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??B.indexWorkerOptions?.containmentCoverageWeight??.3]}),O("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.indexContainmentCoverageHint})]})]},"containment")),H("section",{className:"space-y-3",children:[H("div",{className:"flex items-center justify-between gap-3",children:[H("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[O("span",{children:"\u{1F4CA}"}),O("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),O("button",{type:"button",onClick:()=>t(f=>({...f,indexWorkerOptions:{threshold:B.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:B.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:B.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:B.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:B.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:B.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:B.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:B.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:B.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:B.indexWorkerOptions?.strategy},ngramSize:B.ngramSize,minNgramOverlap:B.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-green-300 bg-green-100 px-2 font-medium text-green-700 ${x} transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30`,title:n.resetToDefaultsTitle,children:n.reset})]}),O("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:C})]})});or.displayName="IndexWorkerSettings";le();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as be}from"@aiquants/fuzzy-search";import{memo as id,useId as on}from"react";import{jsx as ae,jsxs as oe}from"react/jsx-runtime";var sr=1e3,ir=id(({searchOptions:e,setSearchOptions:t})=>{let n=Y(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=on(),c=on(),d=on(),l=on(),u=on(),m=on(),i=[];return i.push(oe("div",{className:`${a} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[oe("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),oe("div",{className:"space-y-2",children:[ae("label",{htmlFor:r,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.levenshteinThreshold}),ae("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??be.levenshteinWorkerOptions?.threshold,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,threshold:parseFloat(p.target.value)}})),className:"h-11 w-full"}),oe("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??be.levenshteinWorkerOptions?.threshold]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),oe("div",{className:"space-y-2",children:[ae("label",{htmlFor:c,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.levenshteinLengthSimilarity}),ae("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??be.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(p.target.value)}})),className:"h-11 w-full"}),oe("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??be.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push(oe("div",{className:`${a} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[oe("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),oe("div",{className:"space-y-2",children:[ae("label",{htmlFor:d,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.levenshteinLengthPenalty}),ae("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??be.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(p.target.value)}})),className:"h-11 w-full"}),oe("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??be.levenshteinWorkerOptions?.lengthDiffPenalty]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push(oe("div",{className:`${a} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[oe("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),ae("label",{htmlFor:l,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.maxResults}),oe("label",{className:`flex min-h-11 items-center gap-2 ${x} text-gray-600 dark:text-slate-300`,children:[ae("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:p.target.checked?void 0:sr}}))}),n.noLimit]}),ae("input",{id:l,type:"range",min:sr,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?sr:e.levenshteinWorkerOptions.maxResults,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:parseInt(p.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),oe("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.levenshteinMaxResultsHint})]},"max-results")),i.push(oe("div",{className:`${a} border-rose-200 border-l-4 ${o?"":"opacity-50"} dark:border-rose-400/60`,children:[oe("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),oe("div",{className:"space-y-2",children:[ae("label",{htmlFor:u,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.fieldWeight}),ae("input",{id:u,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??be.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(p.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),oe("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??be.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.levenshteinFieldWeightHint})]}),oe("div",{className:"space-y-2",children:[ae("label",{htmlFor:m,className:`font-medium ${x} text-gray-600 transition-colors dark:text-slate-300`,children:n.levenshteinPartialBonus}),ae("input",{id:m,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??be.levenshteinWorkerOptions?.partialMatchBonus,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,partialMatchBonus:parseFloat(p.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),oe("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??be.levenshteinWorkerOptions?.partialMatchBonus]}),ae("p",{className:`${N} text-gray-500 transition-colors dark:text-slate-400`,children:n.levenshteinPartialBonusHint})]}),!o&&ae("p",{className:`${N} text-rose-600 dark:text-rose-300`,children:n.relevanceOnlyNotice})]},"relevance")),oe("section",{className:"space-y-3",children:[oe("div",{className:"flex items-center justify-between gap-3",children:[oe("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[ae("span",{children:"\u{1F4CF}"}),ae("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),ae("button",{type:"button",onClick:()=>t(p=>({...p,levenshteinWorkerOptions:{threshold:be.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:be.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:be.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:be.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:be.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-purple-300 bg-purple-100 px-2 font-medium text-purple-700 ${x} transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30`,title:n.resetToDefaultsTitle,children:n.reset})]}),ae("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});ir.displayName="LevenshteinWorkerSettings";import{jsx as Je,jsxs as Xe}from"react/jsx-runtime";var dd={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},lr=ld(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:c})=>{let d=Y(),{setScrollableRef:l,onPointerDown:u,onPointerMove:m,onPointerUp:i,onPointerLeave:p,onPointerCancel:h,onClickCapture:v}=ht();return Xe("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[Xe("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[Xe("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",d.searchSettings]}),Je("div",{className:"flex flex-wrap gap-1.5",children:Xe("button",{type:"button",onClick:()=>t(k=>ra(k.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded bg-red-500 px-1.5 ${x} text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),Je("div",{className:"mb-0 shrink-0",children:Xe("div",{ref:l,role:"tablist","aria-label":d.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:dd,onPointerDown:u,onPointerMove:m,onPointerUp:i,onPointerLeave:p,onPointerCancel:h,onClickCapture:v,children:[Xe("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>c("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",d.settingsBasicTab]}),Xe("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>c("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",d.settingsAdvancedTab]}),Xe("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>c("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",d.indexWorkerName]}),Xe("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>c("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),Xe("div",{className:"flex flex-col gap-1",children:[Je("div",{className:`${r==="basic"?"block":"hidden"}`,children:Je(Ra,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})}),Je("div",{className:`${r==="advanced"?"block":"hidden"}`,children:Je(La,{searchOptions:e,setSearchOptions:t})}),Je("div",{className:`${r==="index"?"block":"hidden"}`,children:Je(or,{searchOptions:e,setSearchOptions:t})}),Je("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:Je(ir,{searchOptions:e,setSearchOptions:t})})]})]})});lr.displayName="SearchOptionsPanel";import{memo as md,useCallback as pd}from"react";wt();le();ge();import{memo as cd}from"react";import{jsxs as dr}from"react/jsx-runtime";var L=cd(({label:e,value:t,unit:n,color:a="text-gray-600 dark:text-slate-300"})=>dr("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[dr("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),dr("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));L.displayName="StatItem";wt();le();ge();import{memo as ud}from"react";import{jsx as E,jsxs as j}from"react/jsx-runtime";var sn=ud(({kind:e,icon:t,stats:n,color:a})=>{let{locale:s,labels:o}=ve(),r=A=>G(s,A);if(!n)return E("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:o.statsNoData});let c=n.basic||{},d=n.workerSpecific||{},l=n.analysis||{},u=c.totalSearches??0,m=c.totalProcessingTime??0,i=c.averageSearchTime??0,p=c.lastSearchTime??0,h=c.errorCount??0,v=c.timestamp,k=l.fieldPerformance||{},C=l.performanceInsights||{},F=l.recentHistory||[],I=d.specificMetrics||{},f=d.operationCount??0,g=d.operationDistribution||{},y=e==="index",w=e==="levenshtein",D=y?o.indexWorkerName:o.levenshteinWorkerName,b=I,T=I,X="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",W="text-xs font-semibold transition-colors",de=A=>{if(!A)return;let _=new Date(A);return Number.isNaN(_.getTime())?void 0:o.statsTimestamp(_)},J=[];if(J.push(j("div",{className:`${X} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[j("div",{className:`${W} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),E(L,{label:o.statTotalSearches,value:r(u),color:a}),E(L,{label:o.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:a}),E(L,{label:o.statTotalProcessingTime,value:m.toFixed(2),unit:"ms",color:a}),E(L,{label:o.statLastSearchTime,value:p.toFixed(2),unit:"ms",color:a}),E(L,{label:o.statErrorCount,value:h,color:h>0?"text-red-600 dark:text-red-400":a}),de(v)&&E(L,{label:o.statUpdatedAt,value:de(v),color:"text-gray-500 dark:text-slate-400"})]},"basic")),f>0||Object.keys(g).length>0){let A=Object.entries(g).sort(([,_],[,U])=>(Number(U)||0)-(Number(_)||0)).slice(0,6);J.push(j("div",{className:`${X} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[j("div",{className:`${W} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",o.statsOperationsHeading]}),E(L,{label:o.statTotalOperations,value:r(f),color:"text-amber-700 dark:text-amber-300"}),A.length>0&&E("div",{className:"mt-1 space-y-1",children:A.map(([_,U])=>E(L,{label:_,value:r(Number(U)),unit:o.timesUnit(r(Number(U))),color:"text-amber-700 dark:text-amber-300"},_))})]},"operations"))}if(y&&(J.push(j("div",{className:`${X} border-green-200 border-l-4 dark:border-green-400/60`,children:[j("div",{className:`${W} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),E(L,{label:o.statIndexBuilds,value:r(b.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),E(L,{label:o.statDataSize,value:r(b.currentDataSize??0),unit:o.itemsUnit(r(b.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),E(L,{label:o.statLastBuildTime,value:(b.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),b.cacheSize&&J.push(j("div",{className:`${X} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[j("div",{className:`${W} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",o.statsCacheHeading]}),E(L,{label:o.statCacheNgram,value:r(b.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),E(L,{label:o.statCacheWord,value:r(b.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),E(L,{label:o.statCachePhonetic,value:r(b.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),b.indexMetadata)){let A=Object.entries(b.indexMetadata).slice(0,6);A.length>0&&J.push(j("div",{className:`${X} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[j("div",{className:`${W} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),A.map(([_,U])=>{let re;if(typeof U=="number"){let ce=_.toLowerCase();ce.includes("time")&&!ce.includes("timestamp")?re=`${U.toFixed(2)}ms`:ce.includes("timestamp")||ce.includes("at")?re=de(U)??U.toString():re=r(U)}else re=String(U);return E(L,{label:_,value:re,color:"text-teal-700 dark:text-teal-300"},_)})]},"index-meta"))}if(w){if(J.push(j("div",{className:`${X} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[j("div",{className:`${W} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",o.statsCalculationsHeading]}),E(L,{label:o.statTotalCalculations,value:r(T.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statDistanceCalculations,value:r(T.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statAverageDistance,value:typeof T.averageDistance=="number"?T.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statMinDistance,value:T.minDistance??o.notAvailable,color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statMaxDistance,value:T.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),J.push(j("div",{className:`${X} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[j("div",{className:`${W} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),E(L,{label:o.statPartialMatches,value:r(T.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),E(L,{label:o.statPerfectMatches,value:r(T.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),E(L,{label:o.statEarlyTerminations,value:r(T.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),T.similarityThresholds&&J.push(j("div",{className:`${X} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[j("div",{className:`${W} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),E(L,{label:o.statAbove80,value:r(T.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),E(L,{label:o.statAbove60,value:r(T.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),E(L,{label:o.statAbove40,value:r(T.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),E(L,{label:o.statBelow40,value:r(T.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),T.distanceDistribution){let A=Object.entries(T.distanceDistribution).sort(([,_],[,U])=>Number(U)-Number(_)).slice(0,6);A.length>0&&J.push(j("div",{className:`${X} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[j("div",{className:`${W} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),A.map(([_,U])=>E(L,{label:o.statDistance(_),value:r(Number(U)),unit:o.timesUnit(r(Number(U))),color:"text-indigo-700 dark:text-indigo-300"},_))]},"lev-distance"))}if(T.queryLengthStats){let A=Object.entries(T.queryLengthStats).sort(([,_],[,U])=>(U.count??0)-(_.count??0)).slice(0,6);A.length>0&&J.push(j("div",{className:`${X} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[j("div",{className:`${W} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),A.map(([_,U])=>{let re=Number(U.count??0),ce=Number(U.averageScore??0);return E(L,{label:o.statQueryLength(_),value:o.statQueryLengthValue({count:re,averagePercent:(ce*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},_)})]},"lev-query-length"))}}if(Object.keys(k).length>0){let A=Object.entries(k).sort(([,_],[,U])=>(U.averageScore??0)-(_.averageScore??0)).slice(0,6);J.push(j("div",{className:`${X} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[j("div",{className:`${W} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),A.map(([_,U])=>{let re=U;return j("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[E("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:_}),E(L,{label:o.statAverageScore,value:`${((re.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statMatchCount,value:r(re.matchCount??0),unit:o.itemsUnit(r(re.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),E(L,{label:o.statBestWorstScore,value:`${((re.bestScore??0)*100).toFixed(1)}% / ${((re.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},_)})]},"field-performance"))}if(C.bestPerformingField||C.totalHistoryEntries||C.similarityDistribution){let A=(C.recentAverageResultCount??0).toFixed(1);J.push(j("div",{className:`${X} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[j("div",{className:`${W} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",o.statsInsightsHeading]}),C.bestPerformingField&&E(L,{label:o.statBestField,value:C.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),E(L,{label:o.statRecentAverageTime,value:(C.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),E(L,{label:o.statRecentAverageResults,value:A,unit:o.itemsUnit(A),color:"text-blue-700 dark:text-blue-300"}),E(L,{label:o.statThroughput,value:(C.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),E(L,{label:o.statCommonQueryLength,value:r(C.mostCommonQueryLength??0),unit:o.charactersUnit(r(C.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),E(L,{label:o.statHistoryEntries,value:r(C.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),C.similarityDistribution&&j("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[E(L,{label:o.statHighSimilarity,value:r(C.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),E(L,{label:o.statMediumSimilarity,value:r(C.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),E(L,{label:o.statLowSimilarity,value:r(C.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),E(L,{label:o.statVeryLowSimilarity,value:r(C.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return F.length>0&&J.push(j("div",{className:`${X} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[j("div",{className:`${W} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),F.slice(-3).reverse().map((A,_)=>j("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[E("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:A.operationType}),E("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:o.statsHistoryEntry({processingTimeMs:A.processingTime.toFixed(2),resultCount:A.resultCount??0})}),de(A.timestamp)&&E("div",{className:`${N} text-sky-500 transition-colors dark:text-sky-200`,children:de(A.timestamp)})]},`${A.operationType}-${A.timestamp??_}`))]},"recent-history")),j("section",{className:"space-y-2",children:[j("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[E("span",{children:t}),E("span",{className:"tracking-wide",children:D})]}),E("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:J})]})});sn.displayName="WorkerStatsSection";import{jsx as _e,jsxs as Oe}from"react/jsx-runtime";var gd={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},cr=md(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:s,rebuildIndex:o,isIndexBuilding:r,activeTab:c,onTabChange:d})=>{let{locale:l,labels:u}=ve(),m=t.trim(),i=m?a:n,{setScrollableRef:p,onPointerDown:h,onPointerMove:v,onPointerUp:k,onPointerLeave:C,onPointerCancel:F,onClickCapture:I}=ht(),f=c!=="index"||r,g=r?u.statsRebuildingTitle:c!=="index"?u.statsRebuildIndexTabOnlyTitle:u.statsRebuildTitle,y=f?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",w=r?`\u23F3 ${u.statsRebuilding}`:`\u{1F3D7}\uFE0F ${u.statsRebuild}`,D=pd(()=>{o().catch(()=>{})},[o]);return Oe("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[Oe("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[Oe("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",u.searchStatistics]}),Oe("div",{className:"flex flex-wrap gap-1.5",children:[_e("button",{type:"button",onClick:D,disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${y}`,title:g,children:w}),Oe("button",{type:"button",onClick:s,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded bg-red-500 px-1.5 ${x} text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700`,title:u.statsResetTitle,children:["\u{1F504} ",u.reset]})]})]}),_e("div",{className:"mb-0 shrink-0",children:Oe("div",{ref:p,role:"tablist","aria-label":u.statsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:gd,onPointerDown:h,onPointerMove:v,onPointerUp:k,onPointerLeave:C,onPointerCancel:F,onClickCapture:I,children:[Oe("button",{type:"button",role:"tab","aria-selected":c==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${c==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",u.statsOverviewTab]}),Oe("button",{type:"button",role:"tab","aria-selected":c==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${c==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",u.statsIndexTab]}),Oe("button",{type:"button",role:"tab","aria-selected":c==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${c==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",u.statsLevenshteinTab]})]})}),Oe("div",{className:"flex flex-col gap-1 pb-0.5",children:[Oe("div",{className:`${c==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[_e(L,{label:u.statTotalSearches,value:G(l,e.totalSearches)}),_e(L,{label:u.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),_e(L,{label:u.statDataCount,value:G(l,e.itemCount)}),_e(L,{label:m?u.statResultCount:u.statDisplayedCount,value:G(l,i)})]}),_e("div",{className:`${c==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:_e(sn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),_e("div",{className:`${c==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:_e(sn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),Oe("div",{className:"hidden",children:[_e(sn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),_e(sn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});cr.displayName="StatisticsPanel";import{Fragment as Io,jsx as te,jsxs as ye}from"react/jsx-runtime";var kd=/[\u200B\uFEFF]/g,ur=typeof window<"u",$o=ur&&typeof document<"u",fa=(e,t=[],n=!1)=>{let a=Fo(e);a.current=e,lt(()=>{if(!(!ur||n&&!$o))return a.current()},[n,...t])},Ao=(e,t,n)=>{let[a,s]=Ve(()=>{let o=Do(r=>r.getItem(e));return o&&t.includes(o)?o:n});return fa(()=>{Do(o=>{o.setItem(e,a)})},[e,a]),[a,s]},Do=e=>{if(!ur)return null;try{return e(window.sessionStorage)}catch{return null}},Wo=(e,t)=>{let[n,a]=Ve(e);return lt(()=>{let s=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},Sd="contact-map.settings-tab",Td="contact-map.statistics-tab",wd=["basic","advanced","index","levenshtein"],Nd=["overview","index","levenshtein"],Ho=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Md={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},zo=({streamState:e,...t}={})=>e===void 0?te(Ed,{...t}):te(Bo,{...t,streamState:e}),Ed=e=>{let{context:t}=aa();return te(Bo,{...e,streamState:t})},Pd={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},Bo=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,s=xe(e,"workerUrls"),o=st(),{locale:r,labels:c}=ve(),{contactMapRecords:d,contactMapRecordMap:l,isStreamingComplete:u,isStreamingFailed:m}=t,i=vd(),[p]=Cd(),h=Fo(null),[v,k]=Ve(!0),[C,F]=Ve(o.openEmailsWithGmail??!1),{indexWorker:I,levenshteinWorker:f}=tn(o.workerUrls,s,Pd),[g,y]=Ve(()=>ra({indexWorker:I,levenshteinWorker:f})),[w,D]=Ve(p.get("q")||""),b=Wo(w,g.debounceMs??hd.debounceMs);lt(()=>{let S=p.get("q")||"";D(P=>P!==S?S:P)},[p]),lt(()=>{if(typeof window>"u")return;let S=new URL(window.location.href);(S.searchParams.get("q")||"")!==b&&(b?S.searchParams.set("q",b):S.searchParams.delete("q"),window.history.replaceState(window.history.state,"",S.toString()))},[b]);let[T,X]=xd(),[W,de]=Ve("search"),[J,A]=Ao(Sd,wd,"basic"),[_,U]=Ao(Td,Nd,"overview"),{setScrollableRef:re,onPointerDown:ce,onPointerMove:Se,onPointerUp:yt,onPointerLeave:_t,onPointerCancel:dt,onClickCapture:At}=ht(),ue=ln(()=>{if(!$o)return;let S=h.current;!S||document.activeElement===S||window.requestAnimationFrame(()=>{try{S.focus({preventScroll:!0})}catch{}})},[]),Dt=ln(S=>{let P=S;de(P),P==="search"&&ue()},[ue]),Ae=bt(()=>({...g,debounceMs:0}),[g]),[Ze,De]=Ve("union"),Me=Ze==="intersection",Wt=Me?c.operatorAndTitle:c.operatorOrTitle,xt=ln(S=>fd(S,Ze),[Ze]),K=bt(()=>({querySetsOf:xt}),[xt]),se=Wo(d,u?0:800),{searchTerm:V,setSearchTerm:ct,filteredItems:Ht,resultTerm:It,isSearching:et,isIndexBuilding:Ee,clearSearch:En,resetStats:un,performanceMetrics:We,rebuildIndex:mn,error:ut}=bd(se,Ho,Ae,K),He=V.trim().length>0,[Ke,pn]=Ve(""),[Ft,$t]=Ve(()=>V),gn=bt(()=>jn(w),[w]),mt=bt(()=>jn(b),[b]);lt(()=>{b===Ke&&mt===V||X(()=>{pn(b),ct(mt)})},[b,Ke,mt,V,ct]);let zt=ln(S=>{let ie=S.target.value.replace(kd,"");D(ie)},[]),Bt=ln(()=>{D(""),pn(""),En(),ue()},[En,ue]),Pn=ln(()=>{De(S=>S==="intersection"?"union":"intersection"),ue()},[ue]);fa(()=>{if(!(W==="search"&&i.state==="idle"&&!T))return;let P=document.activeElement;if(!!!(P?.matches('[role="tab"]')||P?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&P&&P!==document.body&&P!==h.current)return;let Te=window.requestAnimationFrame(()=>{ue()});return()=>{window.cancelAnimationFrame(Te)}},[W,i.state,T,ue],!0),fa(()=>{if(W!=="search")return;let S=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&ue()}],[window,"pageshow",()=>{ue()}]];for(let[P,ie,Te]of S)P.addEventListener(ie,Te);return()=>{for(let[P,ie,Te]of S)P.removeEventListener(ie,Te)}},[W,ue],!0),lt(()=>(n&&n(W==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[W,n]),fa(()=>{let S=document.body,P=S.style.overflow;return W==="search"&&(S.style.overflow="hidden"),()=>{S.style.overflow=P}},[W],!0),lt(()=>{We&&Qe.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:We.totalSearches,averageSearchTime:We.averageSearchTime,itemCount:We.itemCount,resultsCount:We.resultsCount,workersAvailable:!!We.workerStats})},[We]);let{isAwaitingDebounce:Ut,isAwaitingSearchTermSync:Ln,isSearchInProgress:je}=bt(()=>{let S=gn!==mt,P=mt!==V,ie=V.trim().length>0||gn.trim().length>0;return{isAwaitingDebounce:S,isAwaitingSearchTermSync:P,isSearchInProgress:T||et||It!==V&&ut===null||ie&&Ee||S||P||Ft!==V}},[gn,mt,V,It,ut,T,et,Ee,Ft]),[Vt,ba]=Ve(V);lt(()=>{Vt!==V&&ba(V)},[V,Vt]),lt(()=>{Ut||Ln||T||et||Ee||Vt===V&&Ft!==V&&$t(V)},[V,Ft,Ut,Ln,T,et,Ee,Vt]);let Rn=bt(()=>Dr(Ke,Ho),[Ke]),On=bt(()=>Rn(Ht),[Rn,Ht]),hn=bt(()=>({contactMapRecords:d,contactMapRecordMap:l,filteredItems:On,searchQuery:Ke,searchTerm:V,isSearching:et,isIndexBuilding:Ee,isPending:T,hasSearchTerm:He,enableHighlighting:v,openEmailsWithGmail:C,isSearchInProgress:je,isSearchTabActive:W==="search",errorMessage:ut??null,isStreamingComplete:u,isStreamingFailed:m}),[d,l,On,Ke,V,et,Ee,T,He,v,C,je,W,ut,u,m]),_n=He?Ht.length:d.length,An=G(r,d.length),Dn=G(r,Ht.length);return te("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${W==="search"?" h-full min-h-0":""}`,children:ye(Xn,{value:W,onValueChange:Dt,className:`flex flex-col${W==="search"?" h-full min-h-0":""}`,children:[ye(kn,{ref:re,style:Md,className:"scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:ce,onPointerMove:Se,onPointerUp:yt,onPointerLeave:_t,onPointerCancel:dt,onClickCapture:At,children:[ye(Mt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100`,children:["\u{1F50D} ",c.searchTab]}),ye(Mt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100`,children:["\u2699\uFE0F ",c.searchSettings]}),ye(Mt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100`,children:["\u{1F4CA} ",c.searchStatistics]})]}),te(Et,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:ye("div",{className:"flex h-full flex-col",children:[te("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:ye("div",{className:"flex flex-col",children:[te("div",{className:"relative",children:ye("div",{className:"flex items-center gap-1 p-1",children:[ye("button",{type:"button",onClick:Pn,"aria-pressed":Me,title:Wt,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${x} transition-colors sm:min-w-12 sm:px-2 ${Me?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[te("span",{children:Me?c.operatorAnd:c.operatorOr}),te("span",{className:`hidden ${N} sm:inline`,children:Me?c.operatorAndHint:c.operatorOrHint})]}),te("input",{ref:h,type:"text",value:w,onChange:zt,placeholder:c.searchPlaceholder,className:`min-h-11 flex-1 rounded border border-gray-300 border-solid px-2 pointer-coarse:text-base ${x} shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none`}),w&&te("button",{type:"button",onClick:Bt,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border border-gray-300 px-1.5 ${x} transition-colors hover:text-gray-700 sm:px-2 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100`,title:je?c.searchBusyTitle:c.clearSearch,"aria-label":je?void 0:c.clearSearch,disabled:je,children:je?ye(Io,{children:[te(yd,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),te("span",{className:"hidden sm:inline",children:c.searching})]}):"\u2715"})]})}),ye("p",{className:`px-1.5 py-0.5 ${N} text-slate-700 transition-colors dark:text-slate-200`,children:[c.registeredCountLabel," ",te("span",{className:`font-semibold ${x} text-slate-900 dark:text-white`,children:An})," ",c.recordUnit(An),Ee?ye("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-blue-700 dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",c.rebuildingIndex]}):null,ut?ye("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-rose-700 dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",c.errorLabel,te("span",{className:"ml-1 break-all font-semibold",children:ut})]}):null,He&&ye("span",{className:"ml-1.5 text-blue-600 dark:text-sky-400",children:["| ",c.resultCountLabel,je?te("span",{className:"ml-1 font-semibold",children:c.searching}):ye(Io,{children:[te("span",{className:`ml-1 font-semibold ${x} text-slate-900 dark:text-white`,children:Dn}),te("span",{className:"ml-0.5",children:c.resultUnit(Dn)})]})]})]}),te("div",{className:"h-2.5 px-2 pb-1.5",children:Ee?te(Jr,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),a?a(hn):te(_o,{context:hn})]})}),te(Et,{value:"settings",className:"mt-0",children:te(lr,{searchOptions:g,setSearchOptions:y,enableHighlighting:v,setEnableHighlighting:k,openEmailsWithGmail:C,setOpenEmailsWithGmail:F,activeTab:J,onTabChange:A})}),te(Et,{value:"statistics",className:"mt-0",children:te(cr,{performanceMetrics:We,searchTerm:V,totalDataCount:d.length,resultsCount:_n,resetStats:un,rebuildIndex:mn,isIndexBuilding:Ee,activeTab:_,onTabChange:U})})]})})};import{jsx as cn,jsxs as Vo}from"react/jsx-runtime";var Ld=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let a=Y(),s=t===void 0?a.appTitle:t,{context:o,retryNow:r}=aa(),c=cn(Va,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount,errorMessage:o.errorMessage,onRetry:r});return Vo("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:c}):Vo("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[cn("h1",{className:"font-bold text-xl",children:s}),c]}),cn("div",{className:"min-h-0 flex-1",children:cn(zo,{streamState:o,onFooterVisibilityChange:n})})]})},Kg=e=>{let t=st(),n=xe(e,"streamEndpoint"),a=xe(e,"workerUrls"),s=xe(e,"locale"),o=xe(e,"labels"),r=Uo(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:tn(t.workerUrls,a,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:o===void 0?t.labels:o}),[t,n,a,s,o]),c=s!==void 0,d=o!==void 0,l=Uo(()=>({locale:c?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[c,d]);return cn(ja,{config:r,chromeSurface:l,children:cn(Ld,{...e})})};wt();le();import{createShouldRevalidate as Rd}from"@aiquants/route-revalidation";var Qg=Rd({submissions:"url",query:{ignore:[nn,"q"]}});export{La as AdvancedSearchSettings,Ra as BasicSearchSettings,at as CONTACT_MAP_LABEL_CATALOGS,bn as CONTACT_MAP_LABEL_KEYS,Wr as ContactDetailGrid,en as ContactDetailPanel,Vn as ContactDetailPopup,Kn as ContactDetailRowLayout,Va as ContactMapAnnotation,Kg as ContactMapAppView,Ci as ContactMapConfigProvider,bo as ContactMapSearchListView,zo as ContactMapSearchPage,_o as ContactMapSearchTabGroup,Oo as ContactMapSearchTreeView,ea as ContactMapStreamClient,pe as HighlightedText,or as IndexWorkerSettings,Pm as LIST_COLLAPSE_THRESHOLD,fl as LIST_DETAIL_PANEL_MIN_WIDTH,Lm as LIST_EXPAND_THRESHOLD,hl as LIST_PANEL_MIN_WIDTH,bl as LIST_RESIZE_HANDLE_THICKNESS,ir as LevenshteinWorkerSettings,Jr as Progress,lr as SearchOptionsPanel,L as StatItem,cr as StatisticsPanel,ca as SwipeOverlay,mp as TREE_COLLAPSE_THRESHOLD,Kl as TREE_DETAIL_PANEL_MIN_WIDTH,pp as TREE_EXPAND_THRESHOLD,Vl as TREE_PANEL_MIN_WIDTH,jl as TREE_RESIZE_HANDLE_THICKNESS,Xn as Tabs,Et as TabsContent,kn as TabsList,Mt as TabsTrigger,pa as TreeWorkerSession,sn as WorkerStatsSection,ta as assertContactMapStreamEndpoint,Kr as assertContactMapTreeWorkerUrl,Tu as assertContactMapWorkerUrls,Ql as composeTreeVirtualScrollOptions,Qg as contactMapShouldRevalidate,_i as countContactMapCompanies,wi as deserializeStreamRecord,Ei as getContactMapStreamClient,Dl as getTreeWorkerSession,tn as layerContactMapWorkerUrls,Fu as resetContactMapStreamClientForTesting,Bm as resetTreeWorkerSessionForTesting,wa as resolveContactMapLabels,yo as useAnimatedNumber,st as useContactMapConfig,Y as useContactMapLabels,Oi as useContactMapStream,Xa as useContactPanelSizing,Zr as useDynamicViewportHeight,ht as useHorizontalDragScroll,ia as useLongPressPopup,wl as useReportPopupVisibility,la as useResponsiveTwoColumnLayout,Tl as useRowPopupRegistry,aa as useStreamedContactMapContext,So as useTreeWorker};
|
|
1
|
+
var ai=Object.defineProperty;var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var oi=(e,t)=>{for(var n in t)ai(e,n,{get:t[n],enumerable:!0})};var Ge,Wt,Ea,nn,rn,wn,ft,Ie,Gn,_r,$r,at,te,Ht=Ee(()=>{"use strict";Ge=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Wt=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Ea=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=Ge(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},nn=e=>Ea(e,["custom_email","email"]),rn=e=>Ea(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),wn=e=>{let t=Ge(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},ft=(e,t)=>{let n=Ge(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ie=(e,t)=>String(e).padStart(t,"0"),Gn=e=>`${Ie(e.getUTCFullYear(),4)}-${Ie(e.getUTCMonth()+1,2)}-${Ie(e.getUTCDate(),2)}`,_r=e=>`${Gn(e)} ${Ie(e.getUTCHours(),2)}:${Ie(e.getUTCMinutes(),2)}:${Ie(e.getUTCSeconds(),2)}`,$r=e=>`${Ie(e.getFullYear(),4)}-${Ie(e.getMonth()+1,2)}-${Ie(e.getDate(),2)} ${Ie(e.getHours(),2)}:${Ie(e.getMinutes(),2)}:${Ie(e.getSeconds(),2)}`,at=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},te=e=>e==null?"-":typeof e=="string"?Ge(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ie,ka,It=Ee(()=>{"use strict";ie=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":ka(e);case"function":return ka(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},ka=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var an,Re,on=Ee(()=>{"use strict";an=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Re=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var ii,qn,Or=Ee(()=>{"use strict";ii=(e,t)=>{let n=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r];for(let o=1;o<=t.length;o+=1){let a=n[o-1]+(e[r-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,a))}n=i}return n[t.length]},qn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let r;for(let i of t){let o=ii(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(r===void 0||o<r.distance)&&(r={key:i,distance:o})}return r?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as La,DIRECTORY_TREE_LABEL_KEYS as Ar,resolveDirectoryTreeLabels as si}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as li,VIRTUAL_SCROLL_LABEL_KEYS as ci}from"@aiquants/virtualscroll";var di,ee,Ft,Xn,wa,Rn,gt,ui,Ma,Ra,mi,Dr,pi,fi,gi,Wr,Hr,Ir,Bt=Ee(()=>{"use strict";Ht();It();on();Or();di=Object.freeze({en:"en-US",ja:"ja-JP"}),ee=(e,t)=>t.toLocaleString(di[e]),Ft=(e,t,n)=>e==="1"?t:n,Xn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${ee("en",e)} / ${ee("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${ee("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${ee("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${ee("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>Ft(e,"record","records"),companyUnit:e=>Ft(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>Ft(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>ee("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${ee("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:_r,recordDate:Gn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsTabsLabel:"Statistics tabs",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:$r,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=ee("en",e);return`${n} ${Ft(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${ee("en",t)}`,timesUnit:e=>Ft(e," time"," times"),itemsUnit:e=>Ft(e," item"," items"),charactersUnit:e=>Ft(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ee("ja",e)} / ${ee("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ee("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${ee("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${ee("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${ee("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${ee("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:_r,recordDate:Gn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:$r,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${ee("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${ee("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),wa=Object.freeze(Object.keys(Xn.en)),Rn=Object.freeze([...Ar,...wa]),gt=Object.freeze({en:Object.freeze({...La.en,...Xn.en}),ja:Object.freeze({...La.ja,...Xn.ja})}),ui=new Set(Rn),Ma=Object.keys(gt).map(e=>JSON.stringify(e)).join(" or "),Ra=Object.freeze({locale:"locale",labels:"labels"}),mi=(e,t,n)=>{e[t]=n},Dr=(e,t=Ra.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Ma} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(gt,e))throw new RangeError(`[contact-map] ${t} must be ${Ma} or left out; got ${ie(e)}`);return li(e)},pi=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ie(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)},fi=(e,t,n)=>{let r=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!ui.has(i)){let a=qn(i,Rn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${a===void 0?"":`did you mean ${JSON.stringify(a)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${ie(i)}`)}let o=e[i];o!==void 0&&(pi(n,i,o,t[i]),r[i]=o)}return r},gi=e=>{let t={},n=!1;for(let r of Ar){let i=e[r];i!==void 0&&(t[r]=i,n=!0)}return n?t:void 0},Wr=(e,t,n=Ra)=>{let r=Dr(e,n.locale);if(t===void 0)return gt[r];if(!an(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let i=fi(t,gt[r],n.labels),a={...si(r,gi(i)),...Xn[r]};for(let u of wa){let d=i[u];d!==void 0&&mi(a,u,d)}return Object.freeze(a)},Hr=e=>{let t={};for(let n of Ar)t[n]=e[n];return Object.freeze(t)},Ir=e=>{let t={};for(let n of ci)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as hi}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as yi}from"@aiquants/virtualscroll";import{createContext as bi,useContext as _a,useMemo as Pa,useRef as Si}from"react";import{jsx as Ci}from"react/jsx-runtime";var vi,Br,Fr,$a,Pe,ne,ye=Ee(()=>{"use strict";Bt();vi=Object.freeze({locale:"en",labels:gt.en,treeLabels:Hr(gt.en),engineLabels:Ir(gt.en)}),Br=bi(vi),Fr=(e,t)=>{let n=Si(null),r=n.current;return r!==null&&t.every(i=>r[i]===e[i])?r:(n.current=e,e)},$a=({locale:e,labels:t,surface:n,children:r})=>{let i=Dr(e,n.locale),o=Pa(()=>Wr(i,t,n),[i,t,n]),a=Fr(o,Rn),u=Fr(Hr(a),hi),d=Fr(Ir(a),yi),c=Pa(()=>({locale:i,labels:a,treeLabels:u,engineLabels:d}),[i,a,u,d]);return Ci(Br.Provider,{value:c,children:r})},Pe=()=>_a(Br),ne=()=>_a(Br).labels});import{TOKENS as Lt}from"@aiquants/console-ui/core";var dd,s,N,B,m,Y,$,qe,Oa,Te,zt,E,Mt,Aa,fe=Ee(()=>{"use strict";dd={fg:Lt.color.fg,fgSecondary:Lt.color["fg-secondary"],fgMuted:Lt.color["fg-muted"],surface:Lt.color.surface,subtle:Lt.color.subtle,muted:{light:"#f1f5f9",dark:"#1d293d"},borderSubtle:Lt.color["border-subtle"],borderControl:Lt.color["border-control"],onPrimary:Lt.color["on-solid"]},s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},N={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},B={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},Y={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},$={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},qe={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Oa={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},Te={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},zt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},E={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},Mt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Aa="#71829b"});var C,wt,w,ke=Ee(()=>{"use strict";C="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",wt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Yn,Qn,Jn,Zn,Vr=Ee(()=>{"use strict";fe();Yn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Qn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Jn=`absolute inset-0 ${Mt.scrim}`,Zn=()=>!1});var Ni,Ei,Rt,Wa,Ha,ln,Pn=Ee(()=>{"use strict";fe();Ni="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Ei=2,Rt=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Wa=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Ha=Ei,ln=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${Rt} ${Ni}`});import{clsx as ki}from"clsx";import{twMerge as Li}from"tailwind-merge";function Le(...e){return Li(ki(e))}var _n=Ee(()=>{"use strict"});import{useOverlayDialog as Mi}from"@aiquants/swipe-overlay";import wi from"lucide-react/dist/esm/icons/check.js";import Ri from"lucide-react/dist/esm/icons/copy.js";import Pi from"lucide-react/dist/esm/icons/x.js";import{useCallback as un,useEffect as Ia,useId as _i,useMemo as er,useRef as Fa,useState as $i}from"react";import{createPortal as Oi}from"react-dom";import{jsx as re,jsxs as Xe}from"react/jsx-runtime";var Ai,De,Di,Wi,Hi,$n,dn,Ii,Fi,cn,Kr,jr,tr,Gr=Ee(()=>{"use strict";Ht();ye();Vr();fe();Pn();ke();_n();Ai=350,De=e=>e.stopPropagation(),Di=Object.freeze({onClick:De,onDoubleClick:De,onContextMenu:De,onPointerDown:De,onPointerUp:De,onMouseDown:De,onMouseUp:De,onTouchStart:De,onTouchEnd:De,onKeyDown:De,onKeyUp:De,onFocus:De,onBlur:De}),Wi=Le(Yn,"flex items-center justify-center px-4 py-6"),Hi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${B.borderControl} ${N.surface} p-4 shadow-lg transition-colors`,$n=0,dn=null,Ii=()=>{let e=document.body.style;$n+=1,$n===1&&(dn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Fi=()=>{if($n=Math.max(0,$n-1),$n>0||!dn)return;let e=document.body.style;e.userSelect=dn.userSelect,typeof dn.webkitUserSelect<"u"&&(e.webkitUserSelect=dn.webkitUserSelect),dn=null},cn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Kr=(e,t)=>{let n=new Set;return e.reduce((r,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return r;let{normalized:a,key:u,entry:d}=t(o,i);return a&&!n.has(u)&&(n.add(u),r.push(d(a))),r},[])},jr=({value:e,ariaLabel:t})=>{let[n,r]=$i(!1),i=Fa(null),o=un(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let p=document.execCommand("copy");return document.body.removeChild(c),p},[]),a=un(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);r(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{r(!1),i.current=null},1500))},[o,e]);Ia(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?wi:Ri;return re("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${B.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${Rt}`,onClick:a,"aria-label":t,title:t,children:re(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},tr=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let i=ne(),o=Fa(null),a=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=cn(e.full_name)??i.noName,d=cn(e.company_name),c=cn(e.department),p=cn(e.title),f=er(()=>Kr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:p}],(v,{fieldKey:M,label:H})=>({normalized:v,key:`${M}-${v.toLowerCase()}`,entry:S=>({fieldKey:M,label:H,value:S})})),[d,c,p,i]),l=er(()=>Kr([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(v,{fieldKey:M,label:H})=>{let S=wn(v);return{normalized:cn(v),key:(S??v).toLowerCase(),entry:ae=>({fieldKey:M,label:H,value:ae,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=er(()=>Kr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(v,{fieldKey:M,label:H})=>{let S=cn(v),L=ft(v,t),ae=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:v.toLowerCase(),entry:I=>({fieldKey:M,label:H,value:I,href:L,isGmailLink:ae})}}),[e.custom_email,e.email,t,i]),y=l.length>0||g.length>0,x=_i(),k=un(()=>{r(),o.current=null},[r]),T=un(v=>v.ownerDocument.getElementById(x),[x]),{dialogProps:U,backdropProps:z}=Mi({isOpen:!0,onClose:k,isCloseBlocked:Zn,initialFocus:T}),b=un((v,M)=>{M.isGmailLink&&(v.preventDefault(),n(M.value))},[n]),h=un((v,M)=>{if(!M.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===M.value&&H-S.timestamp<=Ai){o.current=null,v.preventDefault(),n(M.value);return}o.current={email:M.value,timestamp:H}},[n]);return Ia(()=>(Ii(),Fi),[]),Oi(Xe("dialog",{...U,...Di,"data-contact-popup-root":"true","aria-labelledby":x,className:Wi,style:Qn,children:[re("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Xe("div",{"data-contact-popup-card":"",className:Hi,children:[Xe("div",{className:"flex items-center justify-between gap-4",children:[re("h2",{id:x,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),re("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${E.hoverMuted} ${Rt}`,onClick:k,"aria-label":i.close,children:re(Pi,{className:"h-4 w-4","aria-hidden":"true"})})]}),f.length>0?re("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:f.map(v=>Xe("div",{className:"flex items-center gap-3",children:[re("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.value}),re(jr,{value:v.value,ariaLabel:i.copyField(v.label)})]},v.fieldKey))}):null,Xe("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?re("div",{children:re("ul",{className:"space-y-3 text-sm",children:l.map(v=>re("li",{className:"flex items-start gap-3",children:Xe("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:v.label}),Xe("div",{className:"mt-1 flex items-center gap-3",children:[re("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.href?re("a",{href:v.href,className:`wrap-break-word ${m.blue} ${ln}`,children:v.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:v.value})}),re(jr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,g.length>0?re("div",{children:re("ul",{className:"space-y-3 text-sm",children:g.map(v=>re("li",{className:"flex items-start gap-3",children:Xe("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:v.label}),Xe("div",{className:"mt-1 flex items-start gap-3",children:[Xe("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[v.href?re("a",{href:v.href,className:`wrap-break-word ${m.blue} ${ln}`,target:v.isGmailLink?"_blank":void 0,rel:v.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:M=>b(M,v),onTouchEnd:M=>h(M,v),children:v.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:v.value}),v.isGmailLink?re("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),re(jr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,a?Xe("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[re("span",{className:"text-xs",children:i.popupLastContactDate}),re("span",{children:a})]}):null,y?null:re("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as _e,jsxs as On}from"react/jsx-runtime";var nr,qr=Ee(()=>{"use strict";fe();ke();nr=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:i="-",email:o="-",updatedAtText:a="-"})=>On("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[On("div",{className:"flex items-center gap-1 sm:hidden",children:[_e("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),_e("div",{className:`shrink-0 whitespace-nowrap ${wt} ${s.fgMuted}`,children:i})]}),_e("div",{className:"flex items-center gap-1 sm:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block sm:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:r})}),On("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),On("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:r})]}),On("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fgSecondary}`,children:i}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),_e("div",{className:`hidden items-end justify-end ${wt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:a})})]})});import{formatQuerySets as Bi,parseQuerySets as zi}from"@aiquants/fuzzy-search";import{getNormalizedVariants as Ui,normalizeText as Vi,romajiToKatakana as Ki}from"@aiquants/select-box";var Ua,ji,Gi,qi,Xi,Va,Ka,Yi,Qi,Ji,Zi,es,ts,ns,rs,ja,Ga,Ba,za,rr,as,os,Xr,qa,Yr=Ee(()=>{"use strict";Ua=/[]/g,ji=/^[\s ]+|[\s ]+$/g,Gi=/\s+/,qi=/^[\p{Script=Latin}\s]+$/u,Xi=/\p{Script=Latin}/u,Va=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Ka="union",Yi=65377,Qi=65439,Ji=["\uFF9E","\uFF9F"],Zi=(()=>{let e=new Map;for(let t=Yi;t<=Qi;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of Ji){let i=(n+r).normalize("NFKC");i.length===1&&e.set(i,n+r)}}return e})(),es=/[-ヿ]/u,ts=e=>{let t=Array.from(e,n=>Zi.get(n)??n).join("");return es.test(t)?null:t},ns=e=>Vi(e.replace(Ua,"").replace(ji,""),Va),rs=e=>{if(!qi.test(e))return null;let t=Ki(e);return Xi.test(t)?null:t},ja=e=>e.split(Gi).filter(Boolean),Ga=e=>zi(e,Ka).sets.map(({query:t})=>t),Ba=e=>Ga(e).flatMap(t=>ja(t)),za=e=>Bi({combine:Ka,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=Ga(e.replace(Ua,"")).map(r=>ja(ns(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let i=rs(r);if(i===null)return za(t);n.push(i)}return za(n)},as=e=>{let t=new Set([...Ba(e),...Ba(rr(e))]),n=new Set;for(let r of t)for(let i of Ui(r,Va)){let o=i.trim();if(!o)continue;n.add(o);let a=ts(o);a!==null&&n.add(a)}return Array.from(n)},os=/[.*+?^${}()|[\]\\]/g,Xr=e=>{let t=as(e);if(t.length===0)return null;let n=t.map(r=>r.replace(os,"\\$&")).sort((r,i)=>i.length-r.length);return new RegExp(n.join("|"),"gi")},qa=(e,t)=>{let n=Xr(e);if(n===null)return i=>i;let r=i=>t.some(o=>{let a=i[o];return typeof a=="string"&&a.search(n)!==-1});return i=>{let o=[],a=[];for(let u of i)r(u.item)?o.push(u):a.push(u);return[...o,...a]}}});import{memo as is}from"react";import{Fragment as Qr,jsx as ar}from"react/jsx-runtime";var ss,Ne,or=Ee(()=>{"use strict";Yr();fe();ss=`rounded ${Mt.mark} px-1 ${s.fg}`,Ne=is(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Qr,{children:e});let r=Xr(t);if(r===null)return ar(Qr,{children:e});let i=[],o=0,a=r.exec(e),u=0;for(;a;){let d=a[0],c=a.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){r.lastIndex++,a=r.exec(e);continue}i.push(ar("mark",{className:ss,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,a=r.exec(e)}return o<e.length&&i.push(e.substring(o)),ar(Qr,{children:i})});Ne.displayName="HighlightedText"});var Ya={};oi(Ya,{ContactDetailGrid:()=>Xa,default:()=>ls});import{useMemo as Jr}from"react";import{Fragment as cs,jsx as Zr,jsxs as ds}from"react/jsx-runtime";var ir,Xa,ls,Qa=Ee(()=>{"use strict";Ht();ye();Gr();qr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Xa=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:i,isPopupVisible:o,onRequestClose:a})=>{let u=ne(),d=Jr(()=>nn(e),[e]),c=Jr(()=>rn(e),[e]),p=d.value??"-",f=c.value??"-",l=Jr(()=>at(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=ir(e.full_name)??u.noName,y=ir(e.company_name),x=ir(e.department),k=(T,U="-")=>Zr(Ne,{text:T??U,query:t,enabled:n});return ds(cs,{children:[Zr(nr,{fullName:k(g),title:k(ir(e.title)),companyName:k(y),department:k(x),phoneNumber:f,email:k(p),updatedAtText:l}),o?Zr(tr,{contactData:e,openEmailsWithGmail:r,openGmailCompose:i,onRequestClose:a}):null]})},ls=Xa});ye();fe();ke();import{DEFAULT_FUZZY_SEARCH_OPTIONS as sn}from"@aiquants/fuzzy-search";import{memo as xi,useId as Da}from"react";import{jsx as ot,jsxs as ht}from"react/jsx-runtime";var zr=xi(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=Da(),a=Da(),u=[];return u.push(ht("div",{className:`${r} ${$.sky} border-l-4`,children:[ht("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),ot("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||sn.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),ht("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||sn.learningWeight]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push(ht("div",{className:`${r} ${$.indigo} border-l-4`,children:[ht("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:a,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),ot("input",{id:a,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??sn.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),ht("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??sn.debounceMs]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),ht("section",{className:"space-y-3",children:[ht("div",{className:"flex items-center justify-between gap-3",children:[ht("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[ot("span",{children:"\u26A1"}),ot("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),ot("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:sn.learningWeight,debounceMs:sn.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${B.borderControl} ${N.muted} px-2 font-medium ${s.fgSecondary} ${C} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ot("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});zr.displayName="AdvancedSearchSettings";ye();fe();ke();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Ti,useId as it}from"react";import{jsx as se,jsxs as de}from"react/jsx-runtime";var Ur=Ti(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let a=ne(),u=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=it(),p=it(),f=it(),l=it(),g=it(),y=it(),x=it(),k=it(),T=it(),U=it(),z=[];return z.push(de("div",{className:`${u} ${$.blue} border-l-4`,children:[de("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",a.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:a.basicThresholdLabel}),se("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ut.threshold,onChange:b=>t(h=>({...h,threshold:parseFloat(b.target.value)})),className:"h-11 w-full"}),de("span",{className:`${m.blue} text-xs`,children:[a.currentValueLabel," ",e.threshold??Ut.threshold]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?a.basicThresholdRangeRelevance:a.basicThresholdRange})]},"threshold")),z.push(de("div",{className:`${u} ${$.amber} border-l-4`,children:[de("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",a.basicDisplayHeading]}),de("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${C} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:b=>t(h=>({...h,caseSensitive:b.target.checked})),className:"h-3 w-3"}),a.basicCaseSensitive]}),de("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${C} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:n,onChange:b=>r(b.target.checked),className:"h-3 w-3"}),a.basicHighlight]}),de("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${C} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:b=>o(b.target.checked),className:"h-3 w-3"}),a.basicOpenEmailsWithGmail]}),de("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:a.basicMultiTermOperator}),de("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:b=>t(h=>({...h,multiTermOperator:b.target.value})),className:`min-h-11 rounded border ${B.borderControl} px-2 pointer-coarse:text-base ${C} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"or",children:a.basicOperatorOr}),se("option",{value:"and",children:a.basicOperatorAnd})]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:a.basicMultiTermHint})]})]},"display")),z.push(de("div",{className:`${u} ${$.emerald} border-l-4`,children:[de("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",a.basicSortHeading]}),de("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:y,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:a.basicSortBy}),de("select",{id:y,value:e.sortBy||Ut.sortBy,onChange:b=>t(h=>({...h,sortBy:b.target.value})),className:`min-h-11 rounded border ${B.borderControl} px-2 pointer-coarse:text-base ${C} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"score",children:a.basicSortByScore}),se("option",{value:"relevance",children:a.basicSortByRelevance}),se("option",{value:"original",children:a.basicSortByOriginal})]})]}),de("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:x,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:a.basicSortOrder}),de("select",{id:x,value:e.sortOrder||Ut.sortOrder,onChange:b=>t(h=>({...h,sortOrder:b.target.value})),className:`min-h-11 rounded border ${B.borderControl} px-2 pointer-coarse:text-base ${C} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"desc",children:a.basicSortDescending}),se("option",{value:"asc",children:a.basicSortAscending})]})]})]},"sorting")),z.push(de("div",{className:`${u} ${$.purple} border-l-4`,children:[de("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",a.basicEngineHeading]}),se("label",{htmlFor:k,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:a.basicStrategy}),de("select",{id:k,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:b=>t(h=>({...h,parallelSearchStrategy:b.target.value})),className:`min-h-11 rounded border ${B.borderControl} px-2 pointer-coarse:text-base ${C} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"balanced",children:a.basicStrategyBalanced}),se("option",{value:"index-first",children:a.basicStrategyIndexFirst}),se("option",{value:"levenshtein-first",children:a.basicStrategyLevenshteinFirst})]}),de("div",{className:"mt-2 space-y-2",children:[de("label",{htmlFor:T,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${C} transition-colors`,children:[se("input",{id:T,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:b=>t(h=>({...h,enableIndexFiltering:b.target.checked})),className:"h-3 w-3"}),a.basicIndexFiltering]}),de("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${C} transition-colors`,children:[se("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:b=>t(h=>({...h,enableLevenshtein:b.target.checked})),className:"h-3 w-3"}),a.basicLevenshtein]})]})]},"engine")),de("section",{className:"space-y-3",children:[de("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[se("span",{children:"\u{1F527}"}),se("span",{className:"tracking-wide",children:a.settingsBasicTab})]}),se("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:z})]})});Ur.displayName="BasicSearchSettings";Ht();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as us}from"@aiquants/swipe-overlay";import ms from"lucide-react/dist/esm/icons/badge-check.js";import ps from"lucide-react/dist/esm/icons/building-2.js";import fs from"lucide-react/dist/esm/icons/calendar-clock.js";import gs from"lucide-react/dist/esm/icons/check.js";import hs from"lucide-react/dist/esm/icons/copy.js";import ys from"lucide-react/dist/esm/icons/id-card.js";import bs from"lucide-react/dist/esm/icons/mail.js";import Ss from"lucide-react/dist/esm/icons/phone.js";import vs from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as Cs,useEffect as xs,useMemo as cr,useRef as Ts,useState as Ns}from"react";var st={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};ye();fe();fe();_n();import*as Ye from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as ea}from"react/jsx-runtime";var lr=Ye.Root,An=sr.forwardRef(({className:e,...t},n)=>ea(Ye.List,{ref:n,className:Le(`inline-flex h-10 items-center justify-center rounded-md ${N.muted} p-1 ${s.fgMuted}`,e),...t}));An.displayName=Ye.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>ea(Ye.Trigger,{ref:n,className:Le(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${E.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${E.activeTabSurface} ${E.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Vt.displayName=Ye.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>ea(Ye.Content,{ref:n,className:Le(`mt-2 ${E.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Kt.displayName=Ye.Content.displayName;Pn();ke();or();import{jsx as R,jsxs as Ce}from"react/jsx-runtime";var Ja=`truncate font-semibold ${s.fg} ${C}`,Za={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Es=({icon:e,label:t,value:n,fieldKey:r,copyValue:i,onCopy:o,isCopied:a,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let p=ne(),f=!!(o&&r&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return Ce("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${B.borderSubtle} ${N.subtle} px-2.5 py-1.5 transition-colors`,children:[Ce("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[R("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${N.surface} ${s.fgMuted} transition-colors`,children:R(e,{size:14})}),Ce("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${w} ${s.fgMuted}`,children:t}),u?R("a",{href:u,className:`align-top ${Ja} ${ln}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:Ja,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),f?R("button",{type:"button",onClick:()=>o&&r&&i&&o(r,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${B.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${Rt}`,"aria-label":p.copyField(t),children:a?R(gs,{size:14}):R(hs,{size:14})}):null]})},eo=({items:e,searchTerm:t,enableHighlighting:n})=>R("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>Ce("div",{className:`flex flex-col gap-0.5 rounded-md border ${B.borderSubtle} ${N.surface} px-2 py-1 transition-colors`,children:[R("dt",{className:`font-semibold ${w} ${s.fgMuted} uppercase tracking-wide`,children:r.label}),R("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:R(Ne,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),ta=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),ks=()=>{let e=ne();return Ce("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${B.borderSubtle} border-dashed ${N.surface} p-4 text-center transition-colors`,children:[R("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),R("p",{className:`${w} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Ls=Object.freeze({overlay:us,pane:void 0}),mn=({contact:e,placement:t,searchTerm:n,enableHighlighting:r,style:i,className:o=""})=>{let a=ne(),[u,d]=Ns(null),c=Ts(null),p=cr(()=>({...Za,...i}),[i]);xs(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let f=cr(()=>nn(e),[e]),l=cr(()=>rn(e),[e]),g=cr(()=>at(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),y=Cs(async(S,L,ae)=>{try{await navigator.clipboard.writeText(L),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(I){st.error("Failed to copy contact detail",I)}},[]);if(!e)return R("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${B.borderSubtle} ${N.surface} shadow-sm transition-colors`,style:Za,children:R(ks,{})});let x=[te(e.title),te(e.department)].filter(S=>S!=="-"),k=[x.join(" / "),te(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",T=Ge(e.full_name)??a.noName,U=[{fieldKey:"full_name",label:a.fieldFullName,value:T},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:te(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:te(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:te(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:te(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:te(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:te(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:te(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:te(e.url)}],z=[{label:a.fieldCustomEmail,value:te(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:te(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),b=[{label:a.fieldCustomMobilePhone,value:te(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:te(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:te(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:te(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:te(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:te(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:te(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:te(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:te(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:te(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:te(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:at(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:te(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:at(e.updated_at,a.recordDateTime)}],v=[{rowKey:"person_id",icon:ys,label:"person_id",value:te(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:bs,label:a.summaryEmail,value:f.value??"-",fieldKey:"primary_email",copyValue:f.value,linkHref:ft(f.value,!1)},{rowKey:"primary_phone",icon:Ss,label:a.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:wn(l.value)},{rowKey:"contacted_at",icon:fs,label:a.summaryLastContact,value:g}],M=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:z,recommendedKey:f.fieldKey??null,resolveHref:S=>ft(S!=null?String(S):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:b,recommendedKey:l.fieldKey??null,resolveHref:S=>wn(S!=null?String(S):null)}],H=[{value:"summary",label:a.detailTabSummary,content:Ce("div",{className:"flex flex-col gap-4",children:[Ce("div",{className:"flex flex-col gap-1",children:[Ce("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(ps,{size:16}),R("span",{children:R(Ne,{text:te(e.company_name),query:n??"",enabled:r})})]}),x.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:x.map((S,L)=>Ce("span",{children:[L>0&&" / ",R(Ne,{text:S,query:n??"",enabled:r})]},`header-line-${L}`))}):null]}),R("div",{className:"flex flex-col gap-3",children:v.map(S=>R(Es,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:y,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:r},S.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:Ce("div",{className:"flex flex-col gap-3",children:[R(ta,{title:a.detailBasicProfile}),R(eo,{items:U,searchTerm:n,enableHighlighting:r})]})},{value:"contact",label:a.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:M.map(({sectionKey:S,title:L,emptyText:ae,entries:I,recommendedKey:be,resolveHref:oe})=>Ce("div",{className:"flex flex-col gap-2",children:[R(ta,{title:L}),I.length===0?R("p",{className:`${s.fgMuted} text-xs`,children:ae}):R("div",{className:"flex flex-col gap-2",children:I.map(W=>{let A=oe(W.rawValue),q=W.fieldKey===be;return Ce("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${B.borderSubtle} ${N.surface} px-3 py-2 transition-colors`,children:[Ce("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${s.fgMuted} text-xs`,children:W.label}),R("div",{className:`wrap-break-word ${s.fg} text-sm`,children:A?R("a",{href:A,className:`text-inherit ${ln}`,children:R(Ne,{text:W.value,query:n??"",enabled:r})}):R(Ne,{text:W.value,query:n??"",enabled:r})})]}),q?Ce("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${Y.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(ms,{size:14}),a.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:a.detailTabMeta,content:Ce("div",{className:"flex flex-col gap-3",children:[R(ta,{title:a.detailTabMeta}),R(eo,{items:h,searchTerm:n,enableHighlighting:r})]})}];return Ce("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${B.borderSubtle} ${N.surface} shadow-sm transition-colors ${o}`.trim(),style:p,children:[R("div",{className:`${B.borderSubtle} border-b px-3 py-1.5 transition-colors ${N.subtle}`,children:Ce("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${Y.blue} ${m.blue} transition-colors`,children:R(vs,{size:16})}),Ce("div",{className:"min-w-0 flex-1",children:[R("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:R(Ne,{text:T,query:n??"",enabled:r})}),R("div",{className:`truncate ${w} ${s.fgMuted}`,children:R(Ne,{text:k,query:n??"",enabled:r})})]})]})}),Ce(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(An,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${B.borderSubtle} border-b ${N.subtle} px-2 py-1 transition-colors`,children:H.map(S=>R(Vt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${C} transition-colors ${E.activeTabSurface} ${E.activeTabBlueFg}`,children:R("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),H.map(S=>R(Kt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Ls[t],children:S.content},S.value))]})]})};Bt();ye();fe();ke();import{memo as Ms}from"react";import{jsx as yt,jsxs as dr}from"react/jsx-runtime";var na=Ms(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:i,errorMessage:o,onRetry:a})=>{let{locale:u,labels:d}=Pe(),c=ee(u,e),p=ee(u,t);return dr("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[dr("span",{className:"flex items-baseline gap-1",children:[yt("span",{className:s.fgMuted,children:d.annotationTotalLabel}),yt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:c}),yt("span",{className:s.fgMuted,children:d.recordUnit(c)})]}),dr("span",{className:"flex items-baseline gap-1",children:[yt("span",{className:s.fgMuted,children:d.annotationCompaniesLabel}),yt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:p}),yt("span",{className:s.fgMuted,children:d.companyUnit(p)})]}),n==="streaming"||n==="idle"?yt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Y.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?d.annotationStreamingProgress({loaded:r,total:i,percent:Math.min(100,Math.round(r/i*100))}):d.annotationStreamingCount(r)}):null,n==="retrying"?yt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Y.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:d.annotationReconnecting(r)}):null,n==="failed"||n==="auth-required"?dr("span",{"data-testid":"contact-map-error-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Y.rose} px-2 py-0.5 font-medium ${m.rose} text-xs`,title:n==="failed"?o??void 0:void 0,children:["\u26D4 ",n==="auth-required"?d.annotationAuthRequired:d.annotationLoadFailed(r),a?yt("button",{type:"button","data-testid":"contact-map-retry-button",onClick:a,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.rose} ${N.surface} px-1.5 font-semibold ${C} ${m.rose} transition-colors ${E.hoverRoseTint}`,children:d.annotationRetry}):null]}):null]})});na.displayName="ContactMapAnnotation";on();import{useMemo as ni}from"react";It();on();ye();import{createContext as Rs,useContext as Ps,useMemo as _s}from"react";It();on();Or();var ws=["indexWorker","levenshteinWorker","treeWorker"];function to(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)}}var no={setting:"workerUrls"},ro=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=ws,hints:i={}}=t;if(!an(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ie(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),a=o.find(({key:d,url:c})=>c!==void 0&&!r.includes(d));if(a!==void 0){let d=Object.hasOwn(i,a.key)?i[a.key]:void 0,c=d===void 0?qn(a.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ie(a.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let p=d;to(n,p,c),c!==void 0&&(u[p]=c)}return u};function Yu(e,t=no){ro(e,t)}function ao(e){to("workerUrls","treeWorker",e)}var pn=(e,t,n=no)=>{let r=ro(t,n);return{indexWorker:r?.indexWorker===void 0?e?.indexWorker:r.indexWorker,levenshteinWorker:r?.levenshteinWorker===void 0?e?.levenshteinWorker:r.levenshteinWorker,treeWorker:r?.treeWorker===void 0?e?.treeWorker:r.treeWorker}};import{jsx as ra}from"react/jsx-runtime";var oo=e=>{if(!an(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ie(e)}`);let t=e;return{streamEndpoint:Re(t,"streamEndpoint"),openEmailsWithGmail:Re(t,"openEmailsWithGmail"),treeWorkerFactory:Re(t,"treeWorkerFactory"),workerUrls:pn(void 0,Re(t,"workerUrls")),locale:Re(t,"locale"),labels:Re(t,"labels")}},io=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:i})}))},$s=io(oo({})),so=Rs($s),Os=Object.freeze({locale:"locale",labels:"labels"});function aa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:a,locale:u,labels:d}=oo(e),{indexWorker:c,levenshteinWorker:p,treeWorker:f}=a,l=_s(()=>io({streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:p,treeWorker:f},locale:u,labels:d}),[r,i,o,c,p,f,u,d]);return ra(so.Provider,{value:l,children:ra($a,{locale:u,labels:d,surface:t,children:n})})}function As({config:e,children:t}){return ra(aa,{config:e,chromeSurface:Os,children:t})}function bt(){return Ps(so)}import{useCallback as oa,useEffect as Bs,useMemo as pr,useSyncExternalStore as lo}from"react";It();var Ds=1e3,Ws=3e4,Hs=6;function mr(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${ie(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ie(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${ie(e)}`)}var Is=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),Fs=e=>Array.isArray(e.records),ur=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};mr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ds,this.maxRetryDelayMs=t.maxRetryDelayMs??Ws,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Hs,this.logger=t.logger??st}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,r=await this.streamOnce();if(r==="aborted")return;if(r==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(r==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(r==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let i=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let r=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(r),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),r=new TextDecoder,i="",o=!1,a=!1;for(;;){let{done:u,value:d}=await n.read();if(u)break;let c=r.decode(d,{stream:!0}),p=(i+c).split(`
|
|
2
|
+
`);i=p.pop()??"";let f=!1;for(let l of p){let g=l.trim();if(!g)continue;let y;try{y=JSON.parse(g)}catch(x){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",x);continue}if("type"in y&&y.type==="METADATA"){Number.isSafeInteger(y.total)&&y.total>=0&&this.setState({totalCount:y.total});continue}if(!Fs(y)){this.logger.warn("[ContactMapStream] server reported error:","error"in y?y.error:""),a=!0;continue}for(let x of y.records)x&&typeof x.person_id=="number"&&(this.recordMap.set(x.person_id,Is(x)),f=!0);y.nextCursor&&(this.lastCursor=y.nextCursor),y.isLast&&(o=!0)}f&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return a?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):o?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Qe=null,zs=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(mr(e),Qe===null)return Qe=new ur({endpoint:e}),Qe;if(Qe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Qe.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Qe},um=()=>{Qe?.dispose(),Qe=null},Us=new Map,Vs={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Ks=()=>{let{streamEndpoint:e}=bt();return pr(()=>(mr(e),e),[e])};function js(){let e=Ks(),t=oa(()=>zs(e),[e]);Bs(()=>{let a=t();a.start(),a.retryNow()},[t]);let n=oa(a=>t().subscribe(a),[t]),r=lo(n,()=>t().getState(),()=>Vs),i=lo(n,()=>t().getRecordMap(),()=>Us),o=oa(()=>t().retryNow(),[t]);return pr(()=>({...r,recordMap:i,retryNow:o}),[r,i,o])}var Gs=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function fr(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:i,totalCount:o,error:a,retryNow:u}=js(),d=pr(()=>Gs(e),[e]);return{context:pr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:i,companyCount:d,totalCount:o,errorMessage:a?.message??null}),[e,t,n,r,i,d,o,a]),retryNow:u}}ye();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Mc,parseQuerySets as wc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Rc}from"@aiquants/fuzzy-search/react";import Pc from"lucide-react/dist/esm/icons/search.js";import{useCallback as vn,useEffect as vt,useMemo as _t,useRef as Jo,useState as et,useTransition as _c}from"react";import{useNavigation as $c,useSearchParams as Oc}from"react-router";Yr();on();import{useCallback as jt,useEffect as qs,useRef as co}from"react";var Pt=e=>{let t=co(null),n=co({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,i=jt(f=>{let l=f.currentTarget,g=f.deltaY;!l||g===0||(f.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(f=>{t.current?.removeEventListener("wheel",i),t.current=f,f?.addEventListener("wheel",i,{passive:!1})},[i]);qs(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let a=jt(f=>{if(f.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=f.clientX,l.scrollLeft=f.currentTarget.scrollLeft,l.pointerId=f.pointerId,l.hasCapture=!1,l.pointerType=f.pointerType},[]),u=jt(f=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=f.currentTarget,y=f.clientX-l.startX;!l.isDragging&&Math.abs(y)>r&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(f.pointerId),l.hasCapture=!0)),l.isDragging&&(f.preventDefault(),g.scrollLeft=l.scrollLeft-y)},[r]),d=jt(f=>{let l=n.current;if(l.pointerType==="touch")return;let g=f.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(f.pointerId)&&g.releasePointerCapture(f.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=jt(f=>{d(f)},[d]),p=jt(f=>{n.current.didDrag&&(f.preventDefault(),f.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:a,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:p}};Bt();ye();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Xs}from"@aiquants/fuzzy-search";var gr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=Xs;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};fe();fe();_n();import{jsx as uo}from"react/jsx-runtime";function mo({value:e,max:t=100,className:n,indicatorClassName:r,...i}){let o=e===void 0,a=o?0:Math.min(100,Math.max(0,e/t*100));return uo("div",{role:"progressbar","aria-valuenow":o?void 0:a,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Le(`relative h-2 w-full overflow-hidden rounded-full ${Mt.progressTrack}`,n),...i,children:uo("div",{"data-slot":"progress-indicator",className:Le(`h-full rounded-full ${qe.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",r),style:o?void 0:{width:`${a}%`}})})}ke();var fn="view";import{useCallback as fc,useState as gc}from"react";import{useSearchParams as hc}from"react-router";ye();fe();ke();Ht();import{Panel as vo,PanelGroup as bl,PanelResizeHandle as Sl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as vl,VirtualScroll as Cl,virtualScrollItemElementId as xl}from"@aiquants/virtualscroll";import{lazy as Tl,memo as Nl,Suspense as El,useCallback as Fe,useEffect as Lo,useId as Co,useLayoutEffect as Mo,useMemo as Gt,useRef as gn,useState as Hn}from"react";var Dn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Wn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function hr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,i=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:i}}import{useCallback as Ys,useEffect as Qs,useState as Js}from"react";var po=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:i=240}=t??{},[o,a]=Js(600),u=Ys(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=L=>Number.parseFloat(L)||0,{top:p}=d.getBoundingClientRect(),f=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),y=c(l.getPropertyValue("--header-height")),x=c(l.getPropertyValue("--scrollbar-height")),k=window.getComputedStyle(d),T=c(k.marginBottom),U=c(k.paddingBottom),z=window.innerHeight-g-x-r,b=f?Math.min(f.bottom,z):z,h=f?Math.max(f.top,y):y,v=Math.max(p,h),M=b-v-T-U,H=Number.isFinite(M)?Math.floor(M):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&a(L=>Math.abs(L-S)>1?S:L)},[r,e,i]);return Qs(()=>{if(typeof window>"u")return;let d=null,c=null,p=null,f=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(p=new ResizeObserver(()=>{l()}),p.observe(g),g.parentElement&&p.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(f=new MutationObserver(()=>{l()}),f.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),p&&p.disconnect(),f&&f.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as fo,useRef as yr,useState as go}from"react";var Zs=600,ho=8,br=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[i,o]=go(!1),[a,u]=go(null),d=yr(null),c=yr(!1),p=yr(null),f=yr({onSelect:t,resolveItem:n,item:r});fo(()=>{f.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let l=St(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=St(()=>{p.current&&(l(),p.current=null)},[l]),y=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,p.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let v=f.current,M=null;v.item!==void 0?M=v.item:v.resolveItem&&h.target&&(M=v.resolveItem(h.target)),M!==null&&(c.current=!0,v.onSelect?.(M),u(M),o(!0)),g()},Zs))},[l,g]),x=St(h=>{p.current&&h.pointerId===p.current.pointerId&&(l(),p.current=null)},[l]),k=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),T=St(()=>{c.current=!1},[]),U=St(h=>{if(!p.current||h.pointerId!==p.current.pointerId)return;let v=Math.abs(h.clientX-p.current.x),M=Math.abs(h.clientY-p.current.y);(v>ho||M>ho)&&(l(),p.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),b=St(()=>{o(!1),u(null),c.current=!1,p.current=null},[]);return fo(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let v=[["pointerdown",y,void 0],["pointerup",x,void 0],["pointercancel",x,void 0],["pointermove",U,void 0],["pointerleave",x,void 0],["contextmenu",z,void 0]],M=[["mousedown",k,!0],["mouseup",k,!0],["click",k,!0],["pointerdown",T,!0],["keydown",T,!0],["contextmenu",z,!0],["pointerup",x,!0],["pointercancel",x,!0]];for(let[H,S,L]of v)h.addEventListener(H,S,L);for(let[H,S,L]of M)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of v)h.removeEventListener(H,S,L);for(let[H,S,L]of M)window.removeEventListener(H,S,L);l()}},[e,y,x,U,k,T,z,l]),{isPopupVisible:i,popupItem:a,handleClosePopup:b}};import{useCallback as el,useEffect as tl,useState as yo,useSyncExternalStore as nl}from"react";function Sr(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",i=nl(el(p=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let f=window.matchMedia(r);return f.addEventListener("change",p),()=>f.removeEventListener("change",p)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[o,a]=yo(!1),[u,d]=yo(0);return tl(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let p=e.current;if(!p)return;let f=new ResizeObserver(l=>{for(let g of l){if(g.target!==p)continue;let y=0;g.borderBoxSize&&g.borderBoxSize.length>0?y=g.borderBoxSize[0].inlineSize:y=g.contentRect.width,!(!Number.isFinite(y)||y<=0)&&(d(y),a(x=>x&&y>=t.expandThreshold?!1:!x&&y<t.collapseThreshold?!0:x))}});return f.observe(p),()=>f.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ye();It();var bo=e=>e.isComposing||e.keyCode===229;var So=(e,t)=>{if(ol(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||bo(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return al(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let r=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(r+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(r-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(r+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(r-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},rl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),al=e=>rl.has(e),ol=e=>{let{activeIndex:t,startIndex:n,itemCount:r,pageSize:i}=e;if(!Number.isInteger(r)||r<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ie(r)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ie(i)}`);let o=a=>Number.isInteger(a)&&a>=0&&a<r;if(r>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${r}; got ${ie(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${r}; got ${ie(t)}`)};fe();ye();Vr();fe();Pn();_n();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as il,useOverlayPresence as sl,useSwipeOverlayDialog as ll}from"@aiquants/swipe-overlay";import{useCallback as cl,useId as dl}from"react";import{jsx as vr,jsxs as ia}from"react/jsx-runtime";var ul=Le(Yn,"flex overflow-hidden"),ml=Le(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),pl=`relative ml-auto flex h-full w-full max-w-lg flex-col ${N.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,fl=`flex shrink-0 items-center justify-between gap-3 ${B.borderSubtle} border-b px-3 py-2`,gl=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,hl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${B.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${Rt}`,yl="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Cr=({isOpen:e,onClose:t,children:n,className:r,title:i})=>{let o=ne(),a=dl(),u=sl(e),d=cl(y=>y.ownerDocument.getElementById(a),[a]),{dialogProps:c,backdropProps:p,panelProps:f,attemptClose:l,isSwiping:g}=ll({isOpen:e,onClose:t,isCloseBlocked:Zn,skipWhenTextSelected:!0,initialFocus:d});return u?ia("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":a,className:Le(ul,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[vr("div",{...p,"data-contact-map-overlay-backdrop":"",className:Le(ml,e?"opacity-100":"opacity-0")}),ia("div",{...f,"data-contact-map-overlay-panel":"",className:Le(pl,e?"pointer-events-auto":"pointer-events-none",r),children:[ia("div",{className:fl,children:[vr("h2",{id:a,tabIndex:-1,className:gl,children:i===void 0?o.overlayTitle:i}),vr("button",{type:"button",className:hl,onClick:()=>l(),children:o.close})]}),vr("div",{"data-contact-map-overlay-body":"",className:yl,style:il,children:n})]})]}):null};Pn();ke();qr();import{Fragment as Il,jsx as K,jsxs as Je}from"react/jsx-runtime";var kl=Tl(async()=>({default:(await Promise.resolve().then(()=>(Qa(),Ya))).default})),sa=64,xo="h-[64px]",To=240,Ll=4,la=hr(Dn),Ml=Dn.listPanelMinWidth,wl=Dn.detailPanelMinWidth,Rl=Dn.handleThickness,ap=la.collapseThreshold,op=la.expandThreshold,Pl=({contactData:e})=>{let t=ne(),n=Ge(e?.full_name)??t.noName,r=Ge(e?.title)??"-",i=Ge(e?.company_name)??"-",o=Ge(e?.department)??"-",a=nn(e).value??"-",u=rn(e).value??"-",d=at(e?.updated_at,t.recordDateTime);return K(nr,{fullName:n,title:r,companyName:i,department:o,phoneNumber:u,email:a,updatedAtText:d})},_l=e=>({"--contact-panel-height":`${e}px`}),$l=e=>typeof e=="object"&&e!==null&&"item"in e,Ol=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,Al=(e,t)=>{for(let n of e){let r=Wt(n);if(r?.person_id===t)return r}return null},No=(e,t)=>t!==null&&Wt(e)?.person_id===t,Eo=(e,t,n)=>{for(let r=t;r>=0&&r<e.length;r+=n){let i=Wt(e[r]);if(i!==null)return{index:r,personId:i.person_id}}return null},ko=(e,t,n)=>{let r=Eo(e,t,n);return r!==null?r:Eo(e,t-n,n===1?-1:1)},ca=(e,t,n)=>{let{viewportHeight:r}=po(t,{enableMutationObserver:!0,bottomGap:Ll,minFallbackHeight:To}),[i,o]=Hn(0),a=Fe(()=>{let f=n.current,l=t.current;if(!(f&&l))return;let g=f.getBoundingClientRect(),y=l.getBoundingClientRect(),x=Math.ceil(y.top-g.top);Number.isFinite(x)&&x>0&&o(k=>Math.abs(k-x)>1?x:k)},[t,n]);Mo(()=>{if(!e)return;a();let f=requestAnimationFrame(a);return window.addEventListener("resize",a),()=>{cancelAnimationFrame(f),window.removeEventListener("resize",a)}},[e,a]);let u=r>0?r:To,d=i>0?i:0,c=u+d,p=Gt(()=>_l(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:p}},Dl=new Set,Wl=()=>{let[e,t]=Hn(Dl),n=Fe((r,i)=>{t(o=>{if(o.has(r)===i)return o;let a=new Set(o);return i?a.add(r):a.delete(r),a})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Hl=(e,t,n)=>{let r=gn(n);Mo(()=>{r.current=n},[n]),Lo(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},wo=Nl(({entry:e,index:t,itemCount:n,listboxId:r,isSelected:i,isActive:o,onSelect:a,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:p,openGmailCompose:f,onPopupVisibilityChange:l})=>{let g=ne(),y=gn(null),x=K("div",{className:xo}),k=$l(e)?e:null,T=Wt(e),{isPopupVisible:U,handleClosePopup:z}=br({ref:y,onSelect:u,item:T?.person_id});if(Hl(T?.person_id??null,U,l),!e||!T)return x;let{person_id:b}=T,h=t%2===0?N.surface:N.subtle,v=`${Y.blue} ring-1 ${E.selectedRing}`,M=i?v:h,H=["B","F"].map(S=>Ol(S,S==="B"?k?.baseScore:k?.score)).filter(Boolean);return Je("div",{ref:y,id:xl(r,b),className:`flex ${xo} w-full items-center overflow-hidden ${B.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${M} ${Wa}`,style:{height:sa},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>a(b),children:[Je("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[K("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),K("div",{className:`truncate ${wt} ${s.fgSecondary} leading-tight`,children:b}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${wt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(El,{fallback:K(Pl,{contactData:T}),children:K(kl,{contactData:T,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:p,openGmailCompose:f,isPopupVisible:U,onRequestClose:z})})]})});wo.displayName="ContactListRow";var Ro=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:a,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:p}=Pe(),f=gn(null),l=gn(null),[g,y]=Hn(null),{normalizedViewportHeight:x,panelSizingStyle:k}=ca(u,l,f),{isAnyPopupVisible:T,handlePopupVisibilityChange:U}=Wl(),z=Gt(()=>({enablePointerDrag:!T,enableKeyboardNavigation:!1}),[T]),b=Gt(()=>i?n:t,[i,n,t]),[h,v]=Hn(null),M=Fe(X=>{y(X),v(X)},[]),H=Fe(X=>{if(!a)return;let he=X.trim();if(!he||he==="-"||typeof window>"u")return;let Q=ft(he,!0);Q&&window.open(Q,"_blank","noopener,noreferrer")},[a]),[S,L]=Hn(!1),ae=Fe(()=>L(!1),[]),I=Fe(X=>{M(X),L(!0)},[M]),be=Co(),oe=Co(),W=gn(null),A=b.length,q=Fe((X,he)=>K(wo,{entry:X,index:he,itemCount:A,listboxId:be,isSelected:No(X,g),isActive:No(X,h),onSelect:I,onLongPressSelect:M,searchQuery:r,enableHighlighting:o,openEmailsWithGmail:a,openGmailCompose:H,onPopupVisibilityChange:U}),[A,be,g,h,I,M,r,o,a,H,U]),me=Gt(()=>{let X=new Map;return b.forEach((he,Q)=>{let ut=Wt(he);ut!==null&&X.set(ut.person_id,Q)}),X},[b]),Se=h===null?null:me.get(h)??null,Oe=g===null?null:me.get(g)??null,$t=Math.max(1,Math.floor(x/sa)),Yt=Fe(X=>{if(X.target.id!==be)return;let he=So(X.nativeEvent,{activeIndex:Se,startIndex:Oe===null?0:Oe,itemCount:A,pageSize:$t});if(he===null)return;if(X.preventDefault(),he.kind==="activate"){Se!==null&&h!==null&&I(h);return}let Q=ko(b,he.index,he.direction);Q!==null&&(v(Q.personId),W.current?.scrollToIndex(Q.index,{align:"nearest"}))},[be,Se,Oe,A,$t,h,I,b]),Ct=Fe(X=>{if(X.target.id!==be||Se!==null||!X.target.matches(":focus-visible"))return;let he=ko(b,Oe===null?0:Oe,1);he!==null&&v(he.personId)},[be,Se,Oe,b]),Qt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":oe}),[be,c.listboxLabel,oe]),ve=Fe(X=>b[X],[b]),Jt=Fe(X=>Wt(b[X])?.person_id??`row-${X}`,[b]),Ve=Fe(()=>sa,[]),dt=Gt(()=>({enabled:!0,renderVisual:vl}),[]),Ke=Gt(()=>g===null?null:Al(b,g),[g,b]);Lo(()=>{g!==null&&!Ke&&y(null)},[g,Ke]);let He=gn(null),{isTwoColumn:Zt}=Sr(He,la);S&&(Zt||Ke===null)&&L(!1);let xt=Je("div",{ref:f,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${B.borderSubtle} ${N.subtle} px-4 py-2 transition-colors sm:block`,children:Je("div",{className:"flex items-center",children:[Je("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${w} ${s.fgSecondary} uppercase tracking-wider`,children:[K("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),K("span",{className:"leading-tight",children:c.columnId}),K("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Je("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnName}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnCompany}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnPhone}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),K("div",{className:"hidden items-end justify-end xl:flex",children:K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),K("p",{id:oe,hidden:!0,children:c.listKeyboardHelp}),K("div",{ref:l,className:"flex-1",onKeyDown:Yt,onFocus:Ct,children:K(Cl,{ref:W,contentProps:Qt,activeItemIndex:A===0?void 0:Se,activeItemVisibleInset:Ha,itemCount:A,getItemKey:Jt,behaviorOptions:z,getItem:ve,getItemHeight:Ve,viewportSize:x,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:dt},locale:d,labels:p,className:`w-full rounded-b-lg border ${B.borderSubtle} border-t-0 ${N.surface} pr-0.75 transition-colors`,children:(X,he)=>q(X,he)})}),n.length===0&&i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,A===0&&!i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoData})}):null]});return K("div",{ref:He,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:k,children:Zt?Je(bl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[K(vo,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Ml,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(Sl,{id:"contact-map-list-handle",thickness:Rl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),K(vo,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:wl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(mn,{placement:"pane",contact:Ke,searchTerm:r,enableHighlighting:o})})]}):Je(Il,{children:[xt,Ke?K(Cr,{isOpen:S,onClose:ae,title:c.detailHeading,children:K(mn,{placement:"overlay",contact:Ke,searchTerm:r,enableHighlighting:o})}):null]})})};Ht();import{DirectoryTree as Yl}from"@aiquants/directory-tree";import{Panel as Wo,PanelGroup as Ql,PanelResizeHandle as Jl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Zl}from"@aiquants/virtualscroll";import ec from"@heroicons/react/24/solid/FolderMinusIcon.js";import tc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as hn,useMemo as Ze,useRef as Er,useState as Xt}from"react";import{createPortal as nc}from"react-dom";var da=(e,t)=>e&&e.trim()||t;import{useEffect as Fl,useRef as xr,useState as Bl}from"react";var Po=(e,t=250)=>{let[n,r]=Bl(e),i=xr(null),o=xr(e),a=xr(null),u=xr(!1);return Fl(()=>{if(!u.current){u.current=!0,r(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let p=c-i.current,f=Math.min(1,Math.max(0,p/t)),l=1-(1-f)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));r(g),f<1&&(a.current=requestAnimationFrame(d))};return a.current=requestAnimationFrame(d),()=>{a.current!==null&&cancelAnimationFrame(a.current)}},[e,t]),Math.max(0,n)};It();import{useCallback as ua,useEffect as ma,useMemo as _o,useRef as zl,useSyncExternalStore as Ul}from"react";ye();var Vl=250,Kl=4e3,Tr=3,$o={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Oo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Nr=class{constructor(t,{workerSource:n,logger:r=st}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Tr){this.logger.error(`[TreeWorker] the tree Worker failed ${Tr} times in a row; the tree stops updating until ${$o[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Vl*2**(this.consecutiveFailures-1),Kl);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Tr})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let r=this.lastSyncedNaming;r!==null&&this.syncRecords(this.lastSyncedRecords,r)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${ie(n)}`);if(!Object.hasOwn($o,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ie(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=r}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=Tr||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!Oo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Oo(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,r.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let a=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:a}),this.updateState()}i&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},jl=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let r=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(r,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},qt=null,Ao=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Gl=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},ql=e=>{if(ao(e),qt===null){let t=new Nr(()=>jl(e),{workerSource:"workerUrls.treeWorker"});return qt={session:t,workerUrl:e},t}if(qt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Ao(qt.workerUrl)} and cannot also load it from ${Ao(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return qt.session},yp=()=>{qt?.session.reset(),qt=null},Xl={snapshot:null,isBuilding:!1};function Do(e,t=!1){let n=bt(),r=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),a=o.uncategorizedCompany,u=o.noName,d=_o(()=>({uncategorizedCompany:a,unnamedPerson:u}),[a,u]),c=zl(r);ma(()=>{c.current=r},[r]);let p=r!==void 0,f=p?void 0:i,l=_o(()=>p?new Nr(()=>Gl(c.current)(),{workerSource:"treeWorkerFactory"}):null,[p]),g=ua(()=>l===null?ql(f):l,[l,f]),y=ua(k=>g().subscribe(k),[g]),x=ua(()=>g().getState(),[g]);return ma(()=>{let k=g();k.syncRecords(e,d),t&&k.finalize()},[g,e,t,d]),ma(()=>{if(l!==null)return()=>l.stop()},[l]),Ul(y,x,()=>Xl)}ye();fe();ke();Gr();or();import{Fragment as pc,jsx as j,jsxs as $e}from"react/jsx-runtime";var ga=hr(Wn),rc=Wn.listPanelMinWidth,ac=Wn.detailPanelMinWidth,oc=Wn.handleThickness,zp=ga.collapseThreshold,Up=ga.expandThreshold,ic=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,i=da(e.full_name,t.noName),o=da(e.title,""),a=j(Ne,{text:i,query:n,enabled:r});return o?$e("span",{className:"flex items-center gap-1.5",children:[j("span",{children:a}),j("span",{className:`${s.fgMuted} text-xs`,children:j(Ne,{text:o,query:n,enabled:r})})]}):a},sc="contact-map-tree h-full w-full",lc={hoverClassName:N.muted,directorySelectedClassName:`${Y.sky} ${E.treeNameSky}`,itemSelectedClassName:`${Y.sky} ${E.treeNameSky}`},pa="h-4 w-4 shrink-0 transition-colors duration-150",cc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),kr=null,Ho=null,In=new Map,Io="",Fo=null,Bo=null,dc=(e,t,n,r,i)=>{let o=`${n?"icons":"plain"}#${r}#${i.noName}`;(o!==Io||i.formatDirectoryName!==Fo||t!==Bo)&&(In.clear(),Io=o,Fo=i.formatDirectoryName,Bo=t);let a={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,p=In.get(d.absolutePath);(!p||p.signature!==c)&&(p={signature:c,result:Vo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},In.set(d.absolutePath,p));let f=p.result;f.entries.length>0&&a.entries.push(f.entries[0]);for(let[l,g]of f.personPathMap){let y=a.personPathMap.get(l);if(y)for(let x of g)y.add(x);else a.personPathMap.set(l,new Set(g))}for(let[l,g]of f.contactByPath)a.contactByPath.set(l,g);for(let[l,g]of f.ancestorsByPath)a.ancestorsByPath.set(l,g);a.totalCount+=f.totalCount,!a.firstPerson&&f.firstPerson&&(a.firstPerson=f.firstPerson)}for(let d of In.keys())u.has(d)||In.delete(d);return a},fa=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Uo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Uo(n.children)));return t},uc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Vo=(e,t,n,r,i)=>{let o=new Map,a=new Map,u=new Map,d=0,c=null,p=(l,g)=>{let y=[...g,l.absolutePath];u.set(l.absolutePath,y);let x,k,T=l.type==="directory"?r.formatDirectoryName(l.name,uc(l)):l.name,U=j(Ne,{text:T,query:r.searchQuery,enabled:r.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let z=t.get(l.personId);if(z){a.set(l.absolutePath,z),o.has(l.personId)||o.set(l.personId,new Set);let b=o.get(l.personId);b&&b.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(k=h=>{let v=fa(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(v=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${pa} ${v}`})},l.title&&(U=ic(z,r))),U=j("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:U})}}else if(l.children){let z=l.children.map(b=>p(b,y)).filter(b=>b!==null);if(i&&z.length===0)return null;if(x=z,n){let b=l.relativePath.startsWith("company:")?n.company:n.department;k=h=>j(b,{"aria-hidden":"true",className:`${pa} ${fa(h)}`})}}return{name:T,label:U,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:k,children:x}};return{entries:e.map(l=>p(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:a,ancestorsByPath:u,firstPerson:c,totalCount:d}},mc=(e,t,n)=>{let r=new Set,i=new Set,o=new Map;t.forEach((p,f)=>{o.set(p.item.person_id,f)});for(let p of t){let f=p.item.person_id,l=e.personPathMap.get(f);if(l)for(let g of l){r.add(g);let y=e.ancestorsByPath.get(g);if(y){for(let x of y)r.add(x);n&&y.length>0&&i.add(y[0])}}}let a=new Map,u=p=>{let f=a.get(p.absolutePath);if(f!==void 0)return f;let l=1/0;if(p.type==="file"){let g=e.contactByPath.get(p.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(p.children)for(let g of p.children)l=Math.min(l,u(g));return a.set(p.absolutePath,l),l},d=(p,f=0)=>p.filter(l=>n&&f===0&&i.has(l.absolutePath)?!0:r.has(l.absolutePath)).map(l=>n&&f===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,f+1)}:l).sort((l,g)=>f===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},zo=(e,t,n)=>{if(e===null)return null;let r=n.get(e);if(r===void 0)return null;if(t!==null&&r.has(t))return t;let i=r.values().next();return i.done?null:i.value},Ko=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:i,hasSearchTerm:o,isSearchInProgress:a,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:p}=Pe(),f=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:f,formatDirectoryName:l}),[f,l]),[y,x]=Xt(null),[k,T]=Xt(!1),{snapshot:U,isBuilding:z}=Do(n,e.isStreamingComplete),b=U?.tree??null,h=U?.rebuildEpoch??0,v=Ze(()=>b?dc(b,r,y,h,g):null,[b,r,y,h,g]),M=Ze(()=>{if(!b)return null;if(!o)return v;let D;k||(D=new Set(i.map(pe=>pe.item.person_id)));let le=Vo(b,r,y,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return mc(le,i,k)},[b,v,r,y,e.searchQuery,e.enableHighlighting,o,i,k,g]),H=Ze(()=>M||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[M]),S=o&&e.errorMessage!==null,[L,ae]=Xt(H),I=Er(!1);hn(()=>{if(!(a||S)){I.current=!!b,ae(H);return}!I.current&&b&&H.entries.length>0&&(I.current=!0,ae(H))},[H,b,a,S]);let be=o&&(a||S)?L:H,{entries:oe,personPathMap:W,contactByPath:A,totalCount:q}=be,me=Ze(()=>Uo(oe),[oe]),[Se,Oe]=Xt(()=>Ho??new Set),$t=Be(D=>!Se.has(D),[Se]),Yt=Be(D=>{Oe(le=>{let pe=new Set(le);return pe.has(D)?pe.delete(D):pe.add(D),pe})},[]),Ct=Be(D=>{D.length!==0&&Oe(le=>{let pe=new Set(le);for(let pt of D)pe.add(pt);return pe})},[]),Qt=Be(D=>{Oe(le=>{if(le.size===0)return le;let pe=!1,pt=new Set(le);for(let V of D)pt.delete(V)&&(pe=!0);return pe?pt:le})},[]);hn(()=>{Ho=Se},[Se]),hn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[ve,Jt]=Xt(null),[Ve,dt]=Xt(null),[Ke,He]=Xt(!1),Zt=Be(()=>He(!1),[]),xt=Er(null),X=Er(null),{normalizedViewportHeight:he,panelSizingStyle:Q}=ca(u,X,xt),ut=Be(D=>{let le=A.get(D);return le?(ve!==le.person_id&&Jt(le.person_id),D!==Ve&&dt(D),!0):!1},[A,Ve,ve]),Ot=Be(D=>{ut(D)&&He(!0)},[ut]),Tn=Be(D=>{Ot(D.entry.absolutePath)},[Ot]),Tt=Be(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Ae,popupItem:Nn,handleClosePopup:En}=br({ref:X,resolveItem:Tt,onSelect:ut}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let pe=ft(le,!0);pe&&window.open(pe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Nn?A.get(Nn):null,nt=Ae&&Nt!==null&&Nt!==void 0;hn(()=>{Ae&&!Nt&&En()},[Ae,Nt,En]);let At=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Zl}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Et=Ze(()=>cc(At,he,nt),[At,he,nt]);hn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:kr?(x(kr),()=>{D=!0}):((async()=>{try{let[pe,pt,V,J]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(D)return;let xe=pe.default,rt=pt.default,Pr=V.default,Na=J.default;xe&&rt&&Pr&&Na&&(kr={company:xe,department:rt,title:Pr,person:Na},x(kr))}catch(pe){st.warn("Failed to load lucide icons",pe)}})(),()=>{D=!0})},[]);let Dt=Ze(()=>{if(!y)return;let D=J=>xe=>j(J,{"aria-hidden":"true",className:`${pa} ${fa(xe)}`}),le={company:D(y.company),department:D(y.department),title:D(y.title)},pe=D(y.person),pt=J=>J in le,V=J=>{let[xe]=J.entry.relativePath.split(":",1);return(pt(xe)?le[xe]:le.company)(J)};return{directory:V,directoryExpanded:V,file:pe}},[y]),en=Be(()=>{Oe(D=>D.size===0?D:new Set)},[]),Mr=Be(()=>{me.length>0&&Ct(me)},[me,Ct]),kt=zo(ve,Ve,W);hn(()=>{let D=zo(ve,Ve,W);if(D===null){ve!==null&&Jt(null),Ve!==null&&dt(null);return}D!==Ve&&dt(D)},[ve,Ve,W]);let je=kt===null?null:A.get(kt)??null,kn=e.isStreamingComplete,wr=e.isStreamingFailed,Bn=kn&&n.length===0,zn=(z||!b)&&!Bn,Un=Po(q,250),mt=b!==null||Bn,tn=$e("div",{className:"flex flex-wrap items-center gap-1.5",children:[$e("span",{className:`inline-flex h-5 items-center gap-1 rounded ${N.muted} px-1.5 font-medium font-mono ${w} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[j("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",mt?c.treeNodeCount(Un):"\u2026"]}),wr&&!kn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.rose} ${Y.rose} px-1.5 font-medium ${w} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.rose}`}),j("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):kn?zn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.amber} ${Y.amber} px-1.5 font-medium ${w} ${m.amber}`,title:c.treeBuildingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.amber}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.amber}`})]}),j("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.emerald} ${Y.emerald} px-1.5 font-medium ${w} ${m.emerald}`,title:c.treeCompleteTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.emerald}`}),j("span",{children:"\u2705"})," ",c.treeComplete]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.sky} ${Y.sky} px-1.5 font-medium ${w} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.sky}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.sky}`})]}),j("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&$e("button",{type:"button",onClick:()=>T(!k),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${k?`${Y.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),me.length>0?$e("div",{className:"flex items-center gap-1",children:[j("button",{type:"button",onClick:en,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${B.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(tc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Mr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${B.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(ec,{className:"h-4 w-4"})})]}):null]}),Vn=Er(null),{isTwoColumn:Ln}=Sr(Vn,ga,{mediaQuery:"(min-width: 768px)"});Ke&&(Ln||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Yt,isExpanded:$t,expandMultiple:Qt,collapseMultiple:Ct,isPending:a}),[Ct,Qt,$t,Yt,a]),jn=Ze(()=>({onEntryClick:Tn,selectedPath:kt}),[Tn,kt]),Rr=Ze(()=>({className:sc,lineColor:Aa,iconOverrides:Dt,showDirectoryIcons:!!Dt,showFileIcons:!!Dt,highlightStyles:lc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Dt]),Mn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${B.borderSubtle} ${N.surface} shadow-sm transition-colors`,children:j("div",{ref:X,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:oe.length>0?j(Yl,{entries:oe,expansion:Kn,selection:jn,visual:Rr,virtualScroll:Et,locale:d,labels:p}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${B.borderSubtle} border-dashed ${N.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return $e("div",{ref:Vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:Q,children:[t&&nc(tn,t),Ln?$e(Ql,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[j(Wo,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:rc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Mn}),j(Jl,{id:"contact-map-tree-handle",thickness:oc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),j(Wo,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:ac,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(mn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):$e(pc,{children:[Mn,je?j(Cr,{isOpen:Ke,onClose:Zt,title:c.detailHeading,children:j(mn,{placement:"overlay",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),nt&&Nt&&j(tr,{contactData:Nt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:tt,onRequestClose:En})]})};import{jsx as Fn,jsxs as yn}from"react/jsx-runtime";var yc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},bc=e=>e==="tree"?"tree":"list",jo=({context:e})=>{let t=ne(),[n,r]=hc(),[i,o]=gc(null),a=bc(n.get(fn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:p,onPointerLeave:f,onPointerCancel:l,onClickCapture:g}=Pt(),y=fc(x=>{let k=x==="tree"?"tree":"list";if(k===a)return;let T=new URLSearchParams(typeof window<"u"?window.location.search:"");k==="list"?T.delete(fn):T.set(fn,k),r(T,{replace:!0})},[a,r]);return yn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[yn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[yn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${N.muted} p-0.5 transition-colors`,style:yc,onPointerDown:d,onPointerMove:c,onPointerUp:p,onPointerLeave:f,onPointerCancel:l,onClickCapture:g,children:[yn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":a==="list",onClick:()=>y("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${C} transition-colors ${a==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),yn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":a==="tree",onClick:()=>y("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${C} transition-colors ${a==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),Fn("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),yn("div",{className:"flex h-full flex-1 flex-col",children:[Fn("div",{className:`${a==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="list"?Fn(Ro,{context:e}):null}),Fn("div",{className:`${a==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="tree"?Fn(Ko,{context:e,controlsContainer:i}):null})]})]})};import{memo as Cc}from"react";ye();fe();ke();ye();fe();ke();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as Sc,useId as We}from"react";import{jsx as O,jsxs as F}from"react/jsx-runtime";var ha=1e3,ya=Sc(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=We(),u=We(),d=We(),c=We(),p=We(),f=We(),l=We(),g=We(),y=We(),x=We(),k=We(),T=[];T.push(F("div",{className:`${r} ${$.green} border-l-4`,children:[F("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:a,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),O("input",{id:a,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||G.ngramSize,onChange:b=>t(h=>({...h,ngramSize:parseInt(b.target.value,10)})),className:"h-11 w-full"}),F("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:u,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),O("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||G.minNgramOverlap,onChange:b=>t(h=>({...h,minNgramOverlap:parseInt(b.target.value,10)})),className:"h-11 w-full"}),F("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||G.minNgramOverlap]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),T.push(F("div",{className:`${r} ${$.blue} border-l-4`,children:[F("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:d,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),O("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:p,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),O("input",{id:p,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),T.push(F("div",{className:`${r} ${$.cyan} border-l-4`,children:[F("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:c,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),F("select",{id:c,value:e.indexWorkerOptions?.strategy??G.indexWorkerOptions?.strategy??"hybrid",onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:b.target.value}})),className:`min-h-11 rounded border ${B.borderControl} px-2 pointer-coarse:text-base ${C} transition-colors ${N.surface} ${s.fg}`,children:[O("option",{value:"fast",children:n.indexStrategyFast}),O("option",{value:"accurate",children:n.indexStrategyAccurate}),O("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:f,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),O("input",{id:f,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:l,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),O("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),T.push(F("div",{className:`${r} ${$.indigo} border-l-4`,children:[F("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:g,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),O("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:y,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.maxResults}),F("label",{className:`flex min-h-11 items-center gap-2 ${C} ${s.fgMuted}`,children:[O("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:b.target.checked?void 0:ha}}))}),n.noLimit]}),O("input",{id:y,type:"range",min:ha,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?ha:e.indexWorkerOptions.maxResults,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(b.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),F("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),T.push(F("div",{className:`${r} ${$.emerald} border-l-4`,children:[F("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:x,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),O("input",{id:x,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),F("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:k,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),O("input",{id:k,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),F("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&O("p",{className:`${w} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=We(),z=We();return T.push(F("div",{className:`${r} ${$.teal} border-l-4`,children:[F("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:U,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),O("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),F("div",{className:"space-y-2",children:[O("label",{htmlFor:z,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),O("input",{id:z,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(b.target.value)}})),className:"h-11 w-full"}),F("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),F("section",{className:"space-y-3",children:[F("div",{className:"flex items-center justify-between gap-3",children:[F("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[O("span",{children:"\u{1F4CA}"}),O("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),O("button",{type:"button",onClick:()=>t(b=>({...b,indexWorkerOptions:{threshold:G.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:G.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:G.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:G.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:G.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:G.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:G.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:G.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:G.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:G.indexWorkerOptions?.strategy},ngramSize:G.ngramSize,minNgramOverlap:G.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.green} ${Y.green} px-2 font-medium ${m.green} ${C} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),O("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});ya.displayName="IndexWorkerSettings";ye();fe();ke();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Me}from"@aiquants/fuzzy-search";import{memo as vc,useId as bn}from"react";import{jsx as ue,jsxs as ge}from"react/jsx-runtime";var ba=1e3,Sa=vc(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${N.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=bn(),u=bn(),d=bn(),c=bn(),p=bn(),f=bn(),l=[];return l.push(ge("div",{className:`${r} ${$.purple} border-l-4`,children:[ge("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),ge("div",{className:"space-y-2",children:[ue("label",{htmlFor:a,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),ue("input",{id:a,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??Me.levenshteinWorkerOptions?.threshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),ge("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??Me.levenshteinWorkerOptions?.threshold]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),ge("div",{className:"space-y-2",children:[ue("label",{htmlFor:u,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),ue("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Me.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),ge("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Me.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(ge("div",{className:`${r} ${$.pink} border-l-4`,children:[ge("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),ge("div",{className:"space-y-2",children:[ue("label",{htmlFor:d,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),ue("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??Me.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),ge("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??Me.levenshteinWorkerOptions?.lengthDiffPenalty]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(ge("div",{className:`${r} ${$.violet} border-l-4`,children:[ge("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),ue("label",{htmlFor:c,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.maxResults}),ge("label",{className:`flex min-h-11 items-center gap-2 ${C} ${s.fgMuted}`,children:[ue("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:ba}}))}),n.noLimit]}),ue("input",{id:c,type:"range",min:ba,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?ba:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),ge("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(ge("div",{className:`${r} ${$.rose} border-l-4`,children:[ge("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),ge("div",{className:"space-y-2",children:[ue("label",{htmlFor:p,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),ue("input",{id:p,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??Me.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),ge("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??Me.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),ge("div",{className:"space-y-2",children:[ue("label",{htmlFor:f,className:`font-medium ${C} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),ue("input",{id:f,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??Me.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),ge("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??Me.levenshteinWorkerOptions?.partialMatchBonus]}),ue("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&ue("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),ge("section",{className:"space-y-3",children:[ge("div",{className:"flex items-center justify-between gap-3",children:[ge("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[ue("span",{children:"\u{1F4CF}"}),ue("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),ue("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:Me.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:Me.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:Me.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:Me.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:Me.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.purple} ${Y.purple} px-2 font-medium ${m.purple} ${C} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ue("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});Sa.displayName="LevenshteinWorkerSettings";import{jsx as ct,jsxs as lt}from"react/jsx-runtime";var xc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},va=Cc(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:a,onTabChange:u})=>{let d=ne(),{setScrollableRef:c,onPointerDown:p,onPointerMove:f,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x}=Pt();return lt("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${N.surface} p-1.5 shadow-md transition-colors`,children:[lt("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Y.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[lt("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),ct("div",{className:"flex flex-wrap gap-1.5",children:lt("button",{type:"button",onClick:()=>t(k=>gr(k.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${C} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),ct("div",{className:"mb-0 shrink-0",children:lt("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${N.muted} p-0.5 transition-colors`,style:xc,onPointerDown:p,onPointerMove:f,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x,children:[lt("button",{type:"button",role:"tab","aria-selected":a==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${a==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),lt("button",{type:"button",role:"tab","aria-selected":a==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${a==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),lt("button",{type:"button",role:"tab","aria-selected":a==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${a==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),lt("button",{type:"button",role:"tab","aria-selected":a==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${a==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),lt("div",{className:"flex flex-col gap-1",children:[ct("div",{className:`${a==="basic"?"block":"hidden"}`,children:ct(Ur,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),ct("div",{className:`${a==="advanced"?"block":"hidden"}`,children:ct(zr,{searchOptions:e,setSearchOptions:t})}),ct("div",{className:`${a==="index"?"block":"hidden"}`,children:ct(ya,{searchOptions:e,setSearchOptions:t})}),ct("div",{className:`${a==="levenshtein"?"block":"hidden"}`,children:ct(Sa,{searchOptions:e,setSearchOptions:t})})]})]})});va.displayName="SearchOptionsPanel";import{memo as Ec,useCallback as kc}from"react";Bt();ye();fe();ke();fe();import{memo as Tc}from"react";import{jsxs as Ca}from"react/jsx-runtime";var _=Tc(({label:e,value:t,unit:n,color:r=s.fgMuted})=>Ca("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[Ca("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Ca("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ye();fe();ke();import{memo as Nc}from"react";import{jsx as P,jsxs as Z}from"react/jsx-runtime";var Sn=Nc(({kind:e,icon:t,stats:n,color:r})=>{let{locale:i,labels:o}=Pe(),a=W=>ee(i,W);if(!n)return P("section",{className:`rounded-lg border ${B.borderSubtle} border-dashed ${N.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},p=u.totalSearches??0,f=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,y=u.errorCount??0,x=u.timestamp,k=c.fieldPerformance||{},T=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},b=d.operationCount??0,h=d.operationDistribution||{},v=e==="index",M=e==="levenshtein",H=v?o.indexWorkerName:o.levenshteinWorkerName,S=z,L=z,ae=`flex flex-col gap-1 rounded-lg border ${N.surface} p-3 shadow-sm transition-colors`,I="text-xs font-semibold transition-colors",be=W=>{if(!W)return;let A=new Date(W);return Number.isNaN(A.getTime())?void 0:o.statsTimestamp(A)},oe=[];if(oe.push(Z("div",{className:`${ae} ${$.blue} border-l-4`,children:[Z("div",{className:`${I} ${r}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:a(p),color:r}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statTotalProcessingTime,value:f.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statErrorCount,value:y,color:y>0?m.red:r}),be(x)&&P(_,{label:o.statUpdatedAt,value:be(x),color:s.fgMuted})]},"basic")),b>0||Object.keys(h).length>0){let W=Object.entries(h).sort(([,A],[,q])=>(Number(q)||0)-(Number(A)||0)).slice(0,6);oe.push(Z("div",{className:`${ae} ${$.amber} border-l-4`,children:[Z("div",{className:`${I} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),P(_,{label:o.statTotalOperations,value:a(b),color:m.amber}),W.length>0&&P("div",{className:"mt-1 space-y-1",children:W.map(([A,q])=>P(_,{label:A,value:a(Number(q)),unit:o.timesUnit(a(Number(q))),color:m.amber},A))})]},"operations"))}if(v&&(oe.push(Z("div",{className:`${ae} ${$.green} border-l-4`,children:[Z("div",{className:`${I} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),P(_,{label:o.statIndexBuilds,value:a(S.totalIndexBuilds??0),color:m.green}),P(_,{label:o.statDataSize,value:a(S.currentDataSize??0),unit:o.itemsUnit(a(S.currentDataSize??0)),color:m.green}),P(_,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&oe.push(Z("div",{className:`${ae} ${$.emerald} border-l-4`,children:[Z("div",{className:`${I} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),P(_,{label:o.statCacheNgram,value:a(S.cacheSize.ngram??0),color:m.emerald}),P(_,{label:o.statCacheWord,value:a(S.cacheSize.word??0),color:m.emerald}),P(_,{label:o.statCachePhonetic,value:a(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let W=Object.entries(S.indexMetadata).slice(0,6);W.length>0&&oe.push(Z("div",{className:`${ae} ${$.teal} border-l-4`,children:[Z("div",{className:`${I} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([A,q])=>{let me;if(typeof q=="number"){let Se=A.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?me=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?me=be(q)??q.toString():me=a(q)}else me=String(q);return P(_,{label:A,value:me,color:m.teal},A)})]},"index-meta"))}if(M){if(oe.push(Z("div",{className:`${ae} ${$.purple} border-l-4`,children:[Z("div",{className:`${I} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),P(_,{label:o.statTotalCalculations,value:a(L.totalCalculations??0),color:m.purple}),P(_,{label:o.statDistanceCalculations,value:a(L.totalDistanceCalculations??0),color:m.purple}),P(_,{label:o.statAverageDistance,value:typeof L.averageDistance=="number"?L.averageDistance.toFixed(2):"0.00",color:m.purple}),P(_,{label:o.statMinDistance,value:L.minDistance??o.notAvailable,color:m.purple}),P(_,{label:o.statMaxDistance,value:L.maxDistance??0,color:m.purple})]},"lev-basic")),oe.push(Z("div",{className:`${ae} ${$.fuchsia} border-l-4`,children:[Z("div",{className:`${I} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),P(_,{label:o.statPartialMatches,value:a(L.partialMatches??0),color:m.fuchsia}),P(_,{label:o.statPerfectMatches,value:a(L.perfectMatches??0),color:m.fuchsia}),P(_,{label:o.statEarlyTerminations,value:a(L.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),L.similarityThresholds&&oe.push(Z("div",{className:`${ae} ${$.rose} border-l-4`,children:[Z("div",{className:`${I} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),P(_,{label:o.statAbove80,value:a(L.similarityThresholds.above80??0),color:m.emerald}),P(_,{label:o.statAbove60,value:a(L.similarityThresholds.above60??0),color:m.lime}),P(_,{label:o.statAbove40,value:a(L.similarityThresholds.above40??0),color:m.orange}),P(_,{label:o.statBelow40,value:a(L.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),L.distanceDistribution){let W=Object.entries(L.distanceDistribution).sort(([,A],[,q])=>Number(q)-Number(A)).slice(0,6);W.length>0&&oe.push(Z("div",{className:`${ae} ${$.indigo} border-l-4`,children:[Z("div",{className:`${I} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([A,q])=>P(_,{label:o.statDistance(A),value:a(Number(q)),unit:o.timesUnit(a(Number(q))),color:m.indigo},A))]},"lev-distance"))}if(L.queryLengthStats){let W=Object.entries(L.queryLengthStats).sort(([,A],[,q])=>(q.count??0)-(A.count??0)).slice(0,6);W.length>0&&oe.push(Z("div",{className:`${ae} ${$.violet} border-l-4`,children:[Z("div",{className:`${I} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([A,q])=>{let me=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(A),value:o.statQueryLengthValue({count:me,averagePercent:(Se*100).toFixed(1)}),color:m.violet},A)})]},"lev-query-length"))}}if(Object.keys(k).length>0){let W=Object.entries(k).sort(([,A],[,q])=>(q.averageScore??0)-(A.averageScore??0)).slice(0,6);oe.push(Z("div",{className:`${ae} ${$.purple} border-l-4`,children:[Z("div",{className:`${I} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([A,q])=>{let me=q;return Z("div",{className:`space-y-1 rounded ${Y.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:A}),P(_,{label:o.statAverageScore,value:`${((me.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:a(me.matchCount??0),unit:o.itemsUnit(a(me.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((me.bestScore??0)*100).toFixed(1)}% / ${((me.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},A)})]},"field-performance"))}if(T.bestPerformingField||T.totalHistoryEntries||T.similarityDistribution){let W=(T.recentAverageResultCount??0).toFixed(1);oe.push(Z("div",{className:`${ae} ${$.blue} border-l-4`,children:[Z("div",{className:`${I} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),T.bestPerformingField&&P(_,{label:o.statBestField,value:T.bestPerformingField,color:m.blue}),P(_,{label:o.statRecentAverageTime,value:(T.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),P(_,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:m.blue}),P(_,{label:o.statThroughput,value:(T.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),P(_,{label:o.statCommonQueryLength,value:a(T.mostCommonQueryLength??0),unit:o.charactersUnit(a(T.mostCommonQueryLength??0)),color:m.blue}),P(_,{label:o.statHistoryEntries,value:a(T.totalHistoryEntries??0),color:m.blue}),T.similarityDistribution&&Z("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[P(_,{label:o.statHighSimilarity,value:a(T.similarityDistribution.highSimilarity??0),color:m.emerald}),P(_,{label:o.statMediumSimilarity,value:a(T.similarityDistribution.mediumSimilarity??0),color:m.lime}),P(_,{label:o.statLowSimilarity,value:a(T.similarityDistribution.lowSimilarity??0),color:m.orange}),P(_,{label:o.statVeryLowSimilarity,value:a(T.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return U.length>0&&oe.push(Z("div",{className:`${ae} ${$.sky} border-l-4`,children:[Z("div",{className:`${I} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,A)=>Z("div",{className:`rounded ${Y.sky} p-2 transition-colors`,children:[P("div",{className:`font-medium ${m.sky} transition-colors`,children:W.operationType}),P("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),be(W.timestamp)&&P("div",{className:`${w} ${m.sky} transition-colors`,children:be(W.timestamp)})]},`${W.operationType}-${W.timestamp??A}`))]},"recent-history")),Z("section",{className:"space-y-2",children:[Z("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[P("span",{children:t}),P("span",{className:"tracking-wide",children:H})]}),P("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:oe})]})});Sn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Lc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},xa=Ec(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:i,rebuildIndex:o,isIndexBuilding:a,activeTab:u,onTabChange:d})=>{let{locale:c,labels:p}=Pe(),f=t.trim(),l=f?r:n,{setScrollableRef:g,onPointerDown:y,onPointerMove:x,onPointerUp:k,onPointerLeave:T,onPointerCancel:U,onClickCapture:z}=Pt(),b=u!=="index"||a,h=a?p.statsRebuildingTitle:u!=="index"?p.statsRebuildIndexTabOnlyTitle:p.statsRebuildTitle,v=b?`cursor-not-allowed ${N.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,M=a?`\u23F3 ${p.statsRebuilding}`:`\u{1F3D7}\uFE0F ${p.statsRebuild}`,H=kc(()=>{o().catch(()=>{})},[o]);return ze("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${N.surface} p-1.5 shadow-md transition-colors`,children:[ze("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Y.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ze("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",p.searchStatistics]}),ze("div",{className:"flex flex-wrap gap-1.5",children:[Ue("button",{type:"button",onClick:H,disabled:b,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${v}`,title:h,children:M}),ze("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${C} ${s.onPrimary} transition-colors ${zt.red}`,title:p.statsResetTitle,children:["\u{1F504} ",p.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":p.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${N.muted} p-0.5 transition-colors`,style:Lc,onPointerDown:y,onPointerMove:x,onPointerUp:k,onPointerLeave:T,onPointerCancel:U,onClickCapture:z,children:[ze("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",p.statsOverviewTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",p.statsIndexTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${C} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",p.statsLevenshteinTab]})]})}),ze("div",{className:"flex flex-col gap-1 pb-0.5",children:[ze("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[Ue(_,{label:p.statTotalSearches,value:ee(c,e.totalSearches)}),Ue(_,{label:p.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:p.statDataCount,value:ee(c,e.itemCount)}),Ue(_,{label:f?p.statResultCount:p.statDisplayedCount,value:ee(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(Sn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),Ue("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(Sn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(Sn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(Sn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});xa.displayName="StatisticsPanel";import{Fragment as Qo,jsx as ce,jsxs as we}from"react/jsx-runtime";var Ac=/[\u200B\uFEFF]/g,Ta=typeof window<"u",Zo=Ta&&typeof document<"u",Lr=(e,t=[],n=!1)=>{let r=Jo(e);r.current=e,vt(()=>{if(!(!Ta||n&&!Zo))return r.current()},[n,...t])},Go=(e,t,n)=>{let[r,i]=et(()=>{let o=qo(a=>a.getItem(e));return o&&t.includes(o)?o:n});return Lr(()=>{qo(o=>{o.setItem(e,r)})},[e,r]),[r,i]},qo=e=>{if(!Ta)return null;try{return e(window.sessionStorage)}catch{return null}},Xo=(e,t)=>{let[n,r]=et(e);return vt(()=>{let i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Dc="contact-map.settings-tab",Wc="contact-map.statistics-tab",Hc=["basic","advanced","index","levenshtein"],Ic=["overview","index","levenshtein"],Yo=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Fc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ei=({streamState:e,...t}={})=>e===void 0?ce(Bc,{...t}):ce(ti,{...t,streamState:e}),Bc=e=>{let{context:t}=fr();return ce(ti,{...e,streamState:t})},zc={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ti=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,i=Re(e,"workerUrls"),o=bt(),{locale:a,labels:u}=Pe(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:p,isStreamingFailed:f}=t,l=$c(),[g]=Oc(),y=Jo(null),[x,k]=et(!0),[T,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:b}=pn(o.workerUrls,i,zc),[h,v]=et(()=>gr({indexWorker:z,levenshteinWorker:b})),[M,H]=et(g.get("q")||""),S=Xo(M,h.debounceMs??Mc.debounceMs);vt(()=>{let V=g.get("q")||"";H(J=>J!==V?V:J)},[g]),vt(()=>{if(typeof window>"u")return;let V=new URL(window.location.href);(V.searchParams.get("q")||"")!==S&&(S?V.searchParams.set("q",S):V.searchParams.delete("q"),window.history.replaceState(window.history.state,"",V.toString()))},[S]);let[L,ae]=_c(),[I,be]=et("search"),[oe,W]=Go(Dc,Hc,"basic"),[A,q]=Go(Wc,Ic,"overview"),{setScrollableRef:me,onPointerDown:Se,onPointerMove:Oe,onPointerUp:$t,onPointerLeave:Yt,onPointerCancel:Ct,onClickCapture:Qt}=Pt(),ve=vn(()=>{if(!Zo)return;let V=y.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Jt=vn(V=>{let J=V;be(J),J==="search"&&ve()},[ve]),Ve=_t(()=>({...h,debounceMs:0}),[h]),[dt,Ke]=et("union"),He=dt==="intersection",Zt=He?u.operatorAndTitle:u.operatorOrTitle,xt=vn(V=>wc(V,dt),[dt]),X=_t(()=>({querySetsOf:xt}),[xt]),he=Xo(d,p?0:800),{searchTerm:Q,setSearchTerm:ut,filteredItems:Ot,resultTerm:Tn,isSearching:Tt,isIndexBuilding:Ae,clearSearch:Nn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Rc(he,Yo,Ve,X),At=Q.trim().length>0,[Et,Dt]=et(""),[en,Mr]=et(()=>Q),kt=_t(()=>rr(M),[M]),je=_t(()=>rr(S),[S]);vt(()=>{S===Et&&je===Q||ae(()=>{Dt(S),ut(je)})},[S,Et,je,Q,ut]);let kn=vn(V=>{let xe=V.target.value.replace(Ac,"");H(xe)},[]),wr=vn(()=>{H(""),Dt(""),Nn(),ve()},[Nn,ve]),Bn=vn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),ve()},[ve]);Lr(()=>{if(!(I==="search"&&l.state==="idle"&&!L))return;let J=document.activeElement;if(!!!(J?.matches('[role="tab"]')||J?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&J&&J!==document.body&&J!==y.current)return;let rt=window.requestAnimationFrame(()=>{ve()});return()=>{window.cancelAnimationFrame(rt)}},[I,l.state,L,ve],!0),Lr(()=>{if(I!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&ve()}],[window,"pageshow",()=>{ve()}]];for(let[J,xe,rt]of V)J.addEventListener(xe,rt);return()=>{for(let[J,xe,rt]of V)J.removeEventListener(xe,rt)}},[I,ve],!0),vt(()=>(n&&n(I==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[I,n]),Lr(()=>{let V=document.body,J=V.style.overflow;return I==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=J}},[I],!0),vt(()=>{tt&&st.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:tt.totalSearches,averageSearchTime:tt.averageSearchTime,itemCount:tt.itemCount,resultsCount:tt.resultsCount,workersAvailable:!!tt.workerStats})},[tt]);let{isAwaitingDebounce:zn,isAwaitingSearchTermSync:Un,isSearchInProgress:mt}=_t(()=>{let V=kt!==je,J=je!==Q,xe=Q.trim().length>0||kt.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:J,isSearchInProgress:L||Tt||Tn!==Q&&nt===null||xe&&Ae||V||J||en!==Q}},[kt,je,Q,Tn,nt,L,Tt,Ae,en]),[tn,Vn]=et(Q);vt(()=>{tn!==Q&&Vn(Q)},[Q,tn]),vt(()=>{zn||Un||L||Tt||Ae||tn===Q&&en!==Q&&Mr(Q)},[Q,en,zn,Un,L,Tt,Ae,tn]);let Ln=_t(()=>qa(Et,Yo),[Et]),Kn=_t(()=>Ln(Ot),[Ln,Ot]),jn=_t(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Et,searchTerm:Q,isSearching:Tt,isIndexBuilding:Ae,isPending:L,hasSearchTerm:At,enableHighlighting:x,openEmailsWithGmail:T,isSearchInProgress:mt,isSearchTabActive:I==="search",errorMessage:nt??null,isStreamingComplete:p,isStreamingFailed:f}),[d,c,Kn,Et,Q,Tt,Ae,L,At,x,T,mt,I,nt,p,f]),Rr=At?Ot.length:d.length,Mn=ee(a,d.length),D=ee(a,Ot.length),pe=`${`scrollbar-hidden ${N.subtle} ${s.fg}`}${I==="search"?" h-full min-h-0":""}`;return ce("div",{className:pe,children:we(lr,{value:I,onValueChange:Jt,className:`flex flex-col${I==="search"?" h-full min-h-0":""}`,children:[we(An,{ref:me,style:Fc,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${N.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Se,onPointerMove:Oe,onPointerUp:$t,onPointerLeave:Yt,onPointerCancel:Ct,onClickCapture:Qt,children:[we(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${C} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),we(Vt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${C} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),we(Vt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${C} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),ce(Kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:we("div",{className:"flex h-full flex-col",children:[ce("div",{className:`rounded-md border ${B.borderSubtle} ${N.surface} shadow-sm transition-colors`,children:we("div",{className:"flex flex-col",children:[ce("div",{className:"relative",children:we("div",{className:"flex items-center gap-1 p-1",children:[we("button",{type:"button",onClick:Bn,"aria-pressed":He,title:Zt,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${C} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Oa.amber} ${Y.amber} ${m.amber} ${E.hoverSurface}`}`,children:[ce("span",{children:He?u.operatorAnd:u.operatorOr}),ce("span",{className:`hidden ${w} sm:inline`,children:He?u.operatorAndHint:u.operatorOrHint})]}),ce("input",{ref:y,type:"text",value:M,onChange:kn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${B.borderControl} border-solid px-2 pointer-coarse:text-base ${C} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${N.surface} ${s.fg}`}),M&&ce("button",{type:"button",onClick:wr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${B.borderControl} px-1.5 ${C} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:mt?u.searchBusyTitle:u.clearSearch,"aria-label":mt?void 0:u.clearSearch,disabled:mt,children:mt?we(Qo,{children:[ce(Pc,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),ce("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),we("p",{className:`px-1.5 py-0.5 ${w} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",ce("span",{className:`font-semibold ${C} ${s.fg}`,children:Mn})," ",u.recordUnit(Mn),Ae?we("span",{className:`ml-1.5 inline-flex items-center rounded ${Y.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,nt?we("span",{className:`ml-1.5 inline-flex items-center rounded ${Y.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,ce("span",{className:"ml-1 break-all font-semibold",children:nt})]}):null,At&&we("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,mt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):we(Qo,{children:[ce("span",{className:`ml-1 font-semibold ${C} ${s.fg}`,children:D}),ce("span",{className:"ml-0.5",children:u.resultUnit(D)})]})]})]}),ce("div",{className:"h-2.5 px-2 pb-1.5",children:Ae?ce(mo,{className:`h-1 ${Mt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),r?r(jn):ce(jo,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(va,{searchOptions:h,setSearchOptions:v,enableHighlighting:x,setEnableHighlighting:k,openEmailsWithGmail:T,setOpenEmailsWithGmail:U,activeTab:oe,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(xa,{performanceMetrics:tt,searchTerm:Q,totalDataCount:d.length,resultsCount:Rr,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Ae,activeTab:A,onTabChange:q})})]})})};import{jsx as xn,jsxs as ri}from"react/jsx-runtime";var Uc=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=ne(),i=t===void 0?r.appTitle:t,{context:o,retryNow:a}=fr(),u=xn(na,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount,errorMessage:o.errorMessage,onRetry:a});return ri("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:i,annotation:u}):ri("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[xn("h1",{className:"font-bold text-xl",children:i}),u]}),xn("div",{className:"min-h-0 flex-1",children:xn(ei,{streamState:o,onFooterVisibilityChange:n})})]})},Rg=e=>{let t=bt(),n=Re(e,"streamEndpoint"),r=Re(e,"workerUrls"),i=Re(e,"locale"),o=Re(e,"labels"),a=ni(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:pn(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:i===void 0?t.locale:i,labels:o===void 0?t.labels:o}),[t,n,r,i,o]),u=i!==void 0,d=o!==void 0,c=ni(()=>({locale:u?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[u,d]);return xn(aa,{config:a,chromeSurface:c,children:xn(Uc,{...e})})};Bt();ye();import{createShouldRevalidate as Vc}from"@aiquants/route-revalidation";var Ag=Vc({submissions:"url",query:{ignore:[fn,"q"]}});export{zr as AdvancedSearchSettings,Ur as BasicSearchSettings,gt as CONTACT_MAP_LABEL_CATALOGS,Rn as CONTACT_MAP_LABEL_KEYS,Xa as ContactDetailGrid,mn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,na as ContactMapAnnotation,Rg as ContactMapAppView,As as ContactMapConfigProvider,Ro as ContactMapSearchListView,ei as ContactMapSearchPage,jo as ContactMapSearchTabGroup,Ko as ContactMapSearchTreeView,ur as ContactMapStreamClient,Ne as HighlightedText,ya as IndexWorkerSettings,ap as LIST_COLLAPSE_THRESHOLD,wl as LIST_DETAIL_PANEL_MIN_WIDTH,op as LIST_EXPAND_THRESHOLD,Ml as LIST_PANEL_MIN_WIDTH,Rl as LIST_RESIZE_HANDLE_THICKNESS,Sa as LevenshteinWorkerSettings,mo as Progress,va as SearchOptionsPanel,_ as StatItem,xa as StatisticsPanel,Cr as SwipeOverlay,zp as TREE_COLLAPSE_THRESHOLD,ac as TREE_DETAIL_PANEL_MIN_WIDTH,Up as TREE_EXPAND_THRESHOLD,rc as TREE_PANEL_MIN_WIDTH,oc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,An as TabsList,Vt as TabsTrigger,Nr as TreeWorkerSession,Sn as WorkerStatsSection,mr as assertContactMapStreamEndpoint,ao as assertContactMapTreeWorkerUrl,Yu as assertContactMapWorkerUrls,cc as composeTreeVirtualScrollOptions,Ag as contactMapShouldRevalidate,Gs as countContactMapCompanies,Is as deserializeStreamRecord,zs as getContactMapStreamClient,ql as getTreeWorkerSession,pn as layerContactMapWorkerUrls,um as resetContactMapStreamClientForTesting,yp as resetTreeWorkerSessionForTesting,Wr as resolveContactMapLabels,Po as useAnimatedNumber,bt as useContactMapConfig,ne as useContactMapLabels,js as useContactMapStream,ca as useContactPanelSizing,po as useDynamicViewportHeight,Pt as useHorizontalDragScroll,br as useLongPressPopup,Hl as useReportPopupVisibility,Sr as useResponsiveTwoColumnLayout,Wl as useRowPopupRegistry,fr as useStreamedContactMapContext,Do as useTreeWorker};
|