@aiquants/contact-map 0.21.0 → 0.22.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/dist/client.mjs CHANGED
@@ -1,2 +1,2 @@
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};
1
+ var ui=Object.defineProperty;var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var mi=(e,t)=>{for(var n in t)ui(e,n,{get:t[n],enumerable:!0})};var Ge,Wt,La,nn,rn,wn,gt,Ie,Gn,Pr,_r,at,ne,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,La=(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=>La(e,["custom_email","email"]),rn=e=>La(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}`},gt=(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)}`,Pr=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)},ne=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 pi,qn,$r=Ee(()=>{"use strict";pi=(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=pi(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 wa,DIRECTORY_TREE_LABEL_KEYS as Or,resolveDirectoryTreeLabels as fi}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as gi,VIRTUAL_SCROLL_LABEL_KEYS as hi}from"@aiquants/virtualscroll";var yi,te,Ft,Yn,Pa,Rn,ht,bi,Ra,_a,Si,Ar,Ci,vi,xi,Dr,Wr,Hr,Bt=Ee(()=>{"use strict";Ht();It();on();$r();yi=Object.freeze({en:"en-US",ja:"ja-JP"}),te=(e,t)=>t.toLocaleString(yi[e]),Ft=(e,t,n)=>e==="1"?t:n,Yn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${te("en",e)} / ${te("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${te("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${te("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${te("en",e)} received)`,streamAuthRequired:"Session expired: sign in again, then retry",streamRetry:"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=>te("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${te("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:Pr,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=te("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: ${te("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 (${te("ja",e)} / ${te("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${te("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${te("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${te("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamAuthRequired:"\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",streamRetry:"\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=>`${te("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${te("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:Pr,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})=>`${te("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: ${te("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Pa=Object.freeze(Object.keys(Yn.en)),Rn=Object.freeze([...Or,...Pa]),ht=Object.freeze({en:Object.freeze({...wa.en,...Yn.en}),ja:Object.freeze({...wa.ja,...Yn.ja})}),bi=new Set(Rn),Ra=Object.keys(ht).map(e=>JSON.stringify(e)).join(" or "),_a=Object.freeze({locale:"locale",labels:"labels"}),Si=(e,t,n)=>{e[t]=n},Ar=(e,t=_a.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Ra} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(ht,e))throw new RangeError(`[contact-map] ${t} must be ${Ra} or left out; got ${ie(e)}`);return gi(e)},Ci=(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)}`)},vi=(e,t,n)=>{let r=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!bi.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&&(Ci(n,i,o,t[i]),r[i]=o)}return r},xi=e=>{let t={},n=!1;for(let r of Or){let i=e[r];i!==void 0&&(t[r]=i,n=!0)}return n?t:void 0},Dr=(e,t,n=_a)=>{let r=Ar(e,n.locale);if(t===void 0)return ht[r];if(!an(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let i=vi(t,ht[r],n.labels),a={...fi(r,xi(i)),...Yn[r]};for(let u of Pa){let d=i[u];d!==void 0&&Si(a,u,d)}return Object.freeze(a)},Wr=e=>{let t={};for(let n of Or)t[n]=e[n];return Object.freeze(t)},Hr=e=>{let t={};for(let n of hi)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Ti}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as Ni}from"@aiquants/virtualscroll";import{createContext as Ei,useContext as Oa,useMemo as $a,useRef as Mi}from"react";import{jsx as ki}from"react/jsx-runtime";var Li,Fr,Ir,Aa,Pe,Q,ge=Ee(()=>{"use strict";Bt();Li=Object.freeze({locale:"en",labels:ht.en,treeLabels:Wr(ht.en),engineLabels:Hr(ht.en)}),Fr=Ei(Li),Ir=(e,t)=>{let n=Mi(null),r=n.current;return r!==null&&t.every(i=>r[i]===e[i])?r:(n.current=e,e)},Aa=({locale:e,labels:t,surface:n,children:r})=>{let i=Ar(e,n.locale),o=$a(()=>Dr(i,t,n),[i,t,n]),a=Ir(o,Rn),u=Ir(Wr(a),Ti),d=Ir(Hr(a),Ni),c=$a(()=>({locale:i,labels:a,treeLabels:u,engineLabels:d}),[i,a,u,d]);return ki(Fr.Provider,{value:c,children:r})},Pe=()=>Oa(Fr),Q=()=>Oa(Fr).labels});var s,N,F,m,X,$,qe,Da,Te,zt,E,Lt,Wa,de=Ee(()=>{"use strict";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)]"},F={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)]"},X={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)]"},Da={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)]"},Lt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Wa="#71829b"});var v,kt,w,Me=Ee(()=>{"use strict";v="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",kt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${kt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Xn,Qn,Jn,Zn,Ur=Ee(()=>{"use strict";de();Xn="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 ${Lt.scrim}`,Zn=()=>!1});var Pi,_i,st,Ia,Fa,ln,cn=Ee(()=>{"use strict";de();Pi="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",_i=2,st=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Ia=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Fa=_i,ln=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${st} ${Pi}`});import{clsx as $i}from"clsx";import{twMerge as Oi}from"tailwind-merge";function Le(...e){return Oi($i(e))}var Pn=Ee(()=>{"use strict"});import{useOverlayDialog as Ai}from"@aiquants/swipe-overlay";import Di from"lucide-react/dist/esm/icons/check.js";import Wi from"lucide-react/dist/esm/icons/copy.js";import Hi from"lucide-react/dist/esm/icons/x.js";import{useCallback as mn,useEffect as Ba,useId as Ii,useMemo as er,useRef as za,useState as Fi}from"react";import{createPortal as Bi}from"react-dom";import{jsx as re,jsxs as Ye}from"react/jsx-runtime";var zi,De,Ui,Vi,Ki,_n,un,ji,Gi,dn,Vr,Kr,tr,jr=Ee(()=>{"use strict";Ht();ge();Ur();de();cn();Me();Pn();zi=350,De=e=>e.stopPropagation(),Ui=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}),Vi=Le(Xn,"flex items-center justify-center px-4 py-6"),Ki=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${F.borderControl} ${N.surface} p-4 shadow-lg transition-colors`,_n=0,un=null,ji=()=>{let e=document.body.style;_n+=1,_n===1&&(un={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Gi=()=>{if(_n=Math.max(0,_n-1),_n>0||!un)return;let e=document.body.style;e.userSelect=un.userSelect,typeof un.webkitUserSelect<"u"&&(e.webkitUserSelect=un.webkitUserSelect),un=null},dn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Vr=(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},[])},Kr=({value:e,ariaLabel:t})=>{let[n,r]=Fi(!1),i=za(null),o=mn(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 f=document.execCommand("copy");return document.body.removeChild(c),f},[]),a=mn(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]);Ba(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Di:Wi;return re("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${F.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,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=Q(),o=za(null),a=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=dn(e.full_name)??i.noName,d=dn(e.company_name),c=dn(e.department),f=dn(e.title),p=er(()=>Vr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(C,{fieldKey:k,label:H})=>({normalized:C,key:`${k}-${C.toLowerCase()}`,entry:S=>({fieldKey:k,label:H,value:S})})),[d,c,f,i]),l=er(()=>Vr([{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}],(C,{fieldKey:k,label:H})=>{let S=wn(C);return{normalized:dn(C),key:(S??C).toLowerCase(),entry:ae=>({fieldKey:k,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(()=>Vr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(C,{fieldKey:k,label:H})=>{let S=dn(C),L=gt(C,t),ae=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:C.toLowerCase(),entry:I=>({fieldKey:k,label:H,value:I,href:L,isGmailLink:ae})}}),[e.custom_email,e.email,t,i]),y=l.length>0||g.length>0,x=Ii(),M=mn(()=>{r(),o.current=null},[r]),T=mn(C=>C.ownerDocument.getElementById(x),[x]),{dialogProps:U,backdropProps:z}=Ai({isOpen:!0,onClose:M,isCloseBlocked:Zn,initialFocus:T}),b=mn((C,k)=>{k.isGmailLink&&(C.preventDefault(),n(k.value))},[n]),h=mn((C,k)=>{if(!k.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===k.value&&H-S.timestamp<=zi){o.current=null,C.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:H}},[n]);return Ba(()=>(ji(),Gi),[]),Bi(Ye("dialog",{...U,...Ui,"data-contact-popup-root":"true","aria-labelledby":x,className:Vi,style:Qn,children:[re("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Ye("div",{"data-contact-popup-card":"",className:Ki,children:[Ye("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} ${st}`,onClick:M,"aria-label":i.close,children:re(Hi,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?re("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(C=>Ye("div",{className:"flex items-center gap-3",children:[re("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.value}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]},C.fieldKey))}):null,Ye("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(C=>re("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-center gap-3",children:[re("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.href?re("a",{href:C.href,className:`wrap-break-word ${m.blue} ${ln}`,children:C.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:C.value})}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,g.length>0?re("div",{children:re("ul",{className:"space-y-3 text-sm",children:g.map(C=>re("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[re("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-start gap-3",children:[Ye("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[C.href?re("a",{href:C.href,className:`wrap-break-word ${m.blue} ${ln}`,target:C.isGmailLink?"_blank":void 0,rel:C.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>b(k,C),onTouchEnd:k=>h(k,C),children:C.value}):re("span",{className:`wrap-break-word ${s.fg}`,children:C.value}),C.isGmailLink?re("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),re(Kr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,a?Ye("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 $n}from"react/jsx-runtime";var nr,Gr=Ee(()=>{"use strict";de();Me();nr=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:i="-",email:o="-",updatedAtText:a="-"})=>$n("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:[$n("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 ${kt} ${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 ${kt} ${s.fgSecondary} leading-tight`,children:r})}),$n("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})]}),$n("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})]}),$n("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 ${kt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:a})})]})});import{formatQuerySets as qi,parseQuerySets as Yi}from"@aiquants/fuzzy-search";import{getNormalizedVariants as Xi,normalizeText as Qi,romajiToKatakana as Ji}from"@aiquants/select-box";var Ka,Zi,es,ts,ns,ja,Ga,rs,as,os,is,ss,ls,cs,ds,qa,Ya,Ua,Va,rr,us,ms,qr,Xa,Yr=Ee(()=>{"use strict";Ka=/[​]/g,Zi=/^[\s  ]+|[\s  ]+$/g,es=/\s+/,ts=/^[\p{Script=Latin}\s]+$/u,ns=/\p{Script=Latin}/u,ja=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Ga="union",rs=65377,as=65439,os=["\uFF9E","\uFF9F"],is=(()=>{let e=new Map;for(let t=rs;t<=as;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of os){let i=(n+r).normalize("NFKC");i.length===1&&e.set(i,n+r)}}return e})(),ss=/[぀-ヿ]/u,ls=e=>{let t=Array.from(e,n=>is.get(n)??n).join("");return ss.test(t)?null:t},cs=e=>Qi(e.replace(Ka,"").replace(Zi,""),ja),ds=e=>{if(!ts.test(e))return null;let t=Ji(e);return ns.test(t)?null:t},qa=e=>e.split(es).filter(Boolean),Ya=e=>Yi(e,Ga).sets.map(({query:t})=>t),Ua=e=>Ya(e).flatMap(t=>qa(t)),Va=e=>qi({combine:Ga,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=Ya(e.replace(Ka,"")).map(r=>qa(cs(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let i=ds(r);if(i===null)return Va(t);n.push(i)}return Va(n)},us=e=>{let t=new Set([...Ua(e),...Ua(rr(e))]),n=new Set;for(let r of t)for(let i of Xi(r,ja)){let o=i.trim();if(!o)continue;n.add(o);let a=ls(o);a!==null&&n.add(a)}return Array.from(n)},ms=/[.*+?^${}()|[\]\\]/g,qr=e=>{let t=us(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ms,"\\$&")).sort((r,i)=>i.length-r.length);return new RegExp(n.join("|"),"gi")},Xa=(e,t)=>{let n=qr(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 ps}from"react";import{Fragment as Xr,jsx as ar}from"react/jsx-runtime";var fs,Ne,or=Ee(()=>{"use strict";Yr();de();fs=`rounded ${Lt.mark} px-1 ${s.fg}`,Ne=ps(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Xr,{children:e});let r=qr(t);if(r===null)return ar(Xr,{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:fs,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(Xr,{children:i})});Ne.displayName="HighlightedText"});var Ja={};mi(Ja,{ContactDetailGrid:()=>Qa,default:()=>gs});import{useMemo as Qr}from"react";import{Fragment as hs,jsx as Jr,jsxs as ys}from"react/jsx-runtime";var ir,Qa,gs,Za=Ee(()=>{"use strict";Ht();ge();jr();Gr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Qa=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:i,isPopupVisible:o,onRequestClose:a})=>{let u=Q(),d=Qr(()=>nn(e),[e]),c=Qr(()=>rn(e),[e]),f=d.value??"-",p=c.value??"-",l=Qr(()=>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),M=(T,U="-")=>Jr(Ne,{text:T??U,query:t,enabled:n});return ys(hs,{children:[Jr(nr,{fullName:M(g),title:M(ir(e.title)),companyName:M(y),department:M(x),phoneNumber:p,email:M(f),updatedAtText:l}),o?Jr(tr,{contactData:e,openEmailsWithGmail:r,openGmailCompose:i,onRequestClose:a}):null]})},gs=Qa});ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as sn}from"@aiquants/fuzzy-search";import{memo as wi,useId as Ha}from"react";import{jsx as ot,jsxs as yt}from"react/jsx-runtime";var Br=wi(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),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=Ha(),a=Ha(),u=[];return u.push(yt("div",{className:`${r} ${$.sky} border-l-4`,children:[yt("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${v} ${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"}),yt("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(yt("div",{className:`${r} ${$.indigo} border-l-4`,children:[yt("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:a,className:`font-medium ${v} ${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"}),yt("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")),yt("section",{className:"space-y-3",children:[yt("div",{className:"flex items-center justify-between gap-3",children:[yt("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 ${F.borderControl} ${N.muted} px-2 font-medium ${s.fgSecondary} ${v} 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})]})});Br.displayName="AdvancedSearchSettings";ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Ri,useId as it}from"react";import{jsx as se,jsxs as ue}from"react/jsx-runtime";var zr=Ri(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let a=Q(),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(),f=it(),p=it(),l=it(),g=it(),y=it(),x=it(),M=it(),T=it(),U=it(),z=[];return z.push(ue("div",{className:`${u} ${$.blue} border-l-4`,children:[ue("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",a.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${v} ${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"}),ue("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(ue("div",{className:`${u} ${$.amber} border-l-4`,children:[ue("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",a.basicDisplayHeading]}),ue("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:b=>t(h=>({...h,caseSensitive:b.target.checked})),className:"h-3 w-3"}),a.basicCaseSensitive]}),ue("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:n,onChange:b=>r(b.target.checked),className:"h-3 w-3"}),a.basicHighlight]}),ue("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:b=>o(b.target.checked),className:"h-3 w-3"}),a.basicOpenEmailsWithGmail]}),ue("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicMultiTermOperator}),ue("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:b=>t(h=>({...h,multiTermOperator:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} 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(ue("div",{className:`${u} ${$.emerald} border-l-4`,children:[ue("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",a.basicSortHeading]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:y,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicSortBy}),ue("select",{id:y,value:e.sortBy||Ut.sortBy,onChange:b=>t(h=>({...h,sortBy:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} 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})]})]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:x,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicSortOrder}),ue("select",{id:x,value:e.sortOrder||Ut.sortOrder,onChange:b=>t(h=>({...h,sortOrder:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} transition-colors ${N.surface} ${s.fg}`,children:[se("option",{value:"desc",children:a.basicSortDescending}),se("option",{value:"asc",children:a.basicSortAscending})]})]})]},"sorting")),z.push(ue("div",{className:`${u} ${$.purple} border-l-4`,children:[ue("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",a.basicEngineHeading]}),se("label",{htmlFor:M,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:a.basicStrategy}),ue("select",{id:M,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:b=>t(h=>({...h,parallelSearchStrategy:b.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${v} 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})]}),ue("div",{className:"mt-2 space-y-2",children:[ue("label",{htmlFor:T,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} 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]}),ue("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${v} 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")),ue("section",{className:"space-y-3",children:[ue("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})]})});zr.displayName="BasicSearchSettings";Ht();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as bs}from"@aiquants/swipe-overlay";import Ss from"lucide-react/dist/esm/icons/badge-check.js";import Cs from"lucide-react/dist/esm/icons/building-2.js";import vs from"lucide-react/dist/esm/icons/calendar-clock.js";import xs from"lucide-react/dist/esm/icons/check.js";import Ts from"lucide-react/dist/esm/icons/copy.js";import Ns from"lucide-react/dist/esm/icons/id-card.js";import Es from"lucide-react/dist/esm/icons/mail.js";import Ms from"lucide-react/dist/esm/icons/phone.js";import Ls from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as ks,useEffect as ws,useMemo as cr,useRef as Rs,useState as Ps}from"react";var lt={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)};ge();de();de();Pn();import*as Xe from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as Zr}from"react/jsx-runtime";var lr=Xe.Root,On=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.List,{ref:n,className:Le(`inline-flex h-10 items-center justify-center rounded-md ${N.muted} p-1 ${s.fgMuted}`,e),...t}));On.displayName=Xe.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.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=Xe.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>Zr(Xe.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=Xe.Content.displayName;cn();Me();or();import{jsx as R,jsxs as ve}from"react/jsx-runtime";var eo=`truncate font-semibold ${s.fg} ${v}`,to={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},_s=({icon:e,label:t,value:n,fieldKey:r,copyValue:i,onCopy:o,isCopied:a,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=Q(),p=!!(o&&r&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${N.subtle} px-2.5 py-1.5 transition-colors`,children:[ve("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})}),ve("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 ${eo} ${ln}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:eo,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),p?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 ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${st}`,"aria-label":f.copyField(t),children:a?R(xs,{size:14}):R(Ts,{size:14})}):null]})},no=({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=>ve("div",{className:`flex flex-col gap-0.5 rounded-md border ${F.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))}),ea=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),$s=()=>{let e=Q();return ve("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${F.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})]})},Os=Object.freeze({overlay:bs,pane:void 0}),pn=({contact:e,placement:t,searchTerm:n,enableHighlighting:r,style:i,className:o=""})=>{let a=Q(),[u,d]=Ps(null),c=Rs(null),f=cr(()=>({...to,...i}),[i]);ws(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=cr(()=>nn(e),[e]),l=cr(()=>rn(e),[e]),g=cr(()=>at(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),y=ks(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){lt.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 ${F.borderSubtle} ${N.surface} shadow-sm transition-colors`,style:to,children:R($s,{})});let x=[ne(e.title),ne(e.department)].filter(S=>S!=="-"),M=[x.join(" / "),ne(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:ne(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:ne(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:ne(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:ne(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:ne(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:ne(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:ne(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:ne(e.url)}],z=[{label:a.fieldCustomEmail,value:ne(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:ne(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),b=[{label:a.fieldCustomMobilePhone,value:ne(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:ne(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:ne(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:ne(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:ne(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:ne(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:ne(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:ne(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:ne(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:ne(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:ne(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:at(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:ne(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:at(e.updated_at,a.recordDateTime)}],C=[{rowKey:"person_id",icon:Ns,label:"person_id",value:ne(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Es,label:a.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:gt(p.value,!1)},{rowKey:"primary_phone",icon:Ms,label:a.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:wn(l.value)},{rowKey:"contacted_at",icon:vs,label:a.summaryLastContact,value:g}],k=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:z,recommendedKey:p.fieldKey??null,resolveHref:S=>gt(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:ve("div",{className:"flex flex-col gap-4",children:[ve("div",{className:"flex flex-col gap-1",children:[ve("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(Cs,{size:16}),R("span",{children:R(Ne,{text:ne(e.company_name),query:n??"",enabled:r})})]}),x.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:x.map((S,L)=>ve("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:C.map(S=>R(_s,{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:ve("div",{className:"flex flex-col gap-3",children:[R(ea,{title:a.detailBasicProfile}),R(no,{items:U,searchTerm:n,enableHighlighting:r})]})},{value:"contact",label:a.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:k.map(({sectionKey:S,title:L,emptyText:ae,entries:I,recommendedKey:be,resolveHref:oe})=>ve("div",{className:"flex flex-col gap-2",children:[R(ea,{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 ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${N.surface} px-3 py-2 transition-colors`,children:[ve("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?ve("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${X.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(Ss,{size:14}),a.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:a.detailTabMeta,content:ve("div",{className:"flex flex-col gap-3",children:[R(ea,{title:a.detailTabMeta}),R(no,{items:h,searchTerm:n,enableHighlighting:r})]})}];return ve("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[R("div",{className:`${F.borderSubtle} border-b px-3 py-1.5 transition-colors ${N.subtle}`,children:ve("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${X.blue} ${m.blue} transition-colors`,children:R(Ls,{size:16})}),ve("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:M,query:n??"",enabled:r})})]})]})}),ve(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(On,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${F.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} ${v} 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:Os[t],children:S.content},S.value))]})]})};Bt();ge();de();import{memo as As}from"react";import{jsx as wt,jsxs as ta}from"react/jsx-runtime";var na=As(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:i})=>{let{locale:o,labels:a}=Pe(),u=te(o,e),d=te(o,t);return ta("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[ta("span",{className:"flex items-baseline gap-1",children:[wt("span",{className:s.fgMuted,children:a.annotationTotalLabel}),wt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),wt("span",{className:s.fgMuted,children:a.recordUnit(u)})]}),ta("span",{className:"flex items-baseline gap-1",children:[wt("span",{className:s.fgMuted,children:a.annotationCompaniesLabel}),wt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),wt("span",{className:s.fgMuted,children:a.companyUnit(d)})]}),n==="streaming"||n==="idle"?wt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?a.annotationStreamingProgress({loaded:r,total:i,percent:Math.min(100,Math.round(r/i*100))}):a.annotationStreamingCount(r)}):null,n==="retrying"?wt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:a.annotationReconnecting(r)}):null]})});na.displayName="ContactMapAnnotation";on();import{useMemo as ci}from"react";It();on();ge();import{createContext as Ws,useContext as Hs,useMemo as Is}from"react";It();on();$r();var Ds=["indexWorker","levenshteinWorker","treeWorker"];function ro(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 ao={setting:"workerUrls"},oo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=Ds,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 f=d;ro(n,f,c),c!==void 0&&(u[f]=c)}return u};function fm(e,t=ao){oo(e,t)}function io(e){ro("workerUrls","treeWorker",e)}var fn=(e,t,n=ao)=>{let r=oo(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 so=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:fn(void 0,Re(t,"workerUrls")),locale:Re(t,"locale"),labels:Re(t,"labels")}},lo=({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})}))},Fs=lo(so({})),co=Ws(Fs),Bs=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}=so(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=a,l=Is(()=>lo({streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[r,i,o,c,f,p,u,d]);return ra(co.Provider,{value:l,children:ra(Aa,{locale:u,labels:d,surface:t,children:n})})}function zs({config:e,children:t}){return ra(aa,{config:e,chromeSurface:Bs,children:t})}function bt(){return Hs(co)}import{useCallback as oa,useEffect as qs,useMemo as mr,useSyncExternalStore as uo}from"react";It();var Us=1e3,Vs=3e4,Ks=6;function ur(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 js=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}),Gs=e=>Array.isArray(e.records),dr=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?.()};ur(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Us,this.maxRetryDelayMs=t.maxRetryDelayMs??Vs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ks,this.logger=t.logger??lt}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}),f=(i+c).split(`
2
+ `);i=f.pop()??"";let p=!1;for(let l of f){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(!Gs(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,js(x)),p=!0);y.nextCursor&&(this.lastCursor=y.nextCursor),y.isLast&&(o=!0)}p&&(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,Ys=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(ur(e),Qe===null)return Qe=new dr({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},wm=()=>{Qe?.dispose(),Qe=null},Xs=new Map,Qs={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Js=()=>{let{streamEndpoint:e}=bt();return mr(()=>(ur(e),e),[e])};function Zs(){let e=Js(),t=oa(()=>Ys(e),[e]);qs(()=>{let a=t();a.start(),a.retryNow()},[t]);let n=oa(a=>t().subscribe(a),[t]),r=uo(n,()=>t().getState(),()=>Qs),i=uo(n,()=>t().getRecordMap(),()=>Xs),o=oa(()=>t().retryNow(),[t]);return mr(()=>({...r,recordMap:i,retryNow:o}),[r,i,o])}var el=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 pr(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:i,totalCount:o,error:a,retryNow:u}=Zs(),d=mr(()=>el(e),[e]);return{context:mr(()=>({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}}ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ac,parseQuerySets as Dc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Wc}from"@aiquants/fuzzy-search/react";import Hc from"lucide-react/dist/esm/icons/search.js";import{useCallback as vn,useEffect as Ct,useMemo as Pt,useRef as ei,useState as et,useTransition as Ic}from"react";import{useNavigation as Fc,useSearchParams as Bc}from"react-router";Yr();on();import{useCallback as jt,useEffect as tl,useRef as mo}from"react";var Rt=e=>{let t=mo(null),n=mo({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,i=jt(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);tl(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let a=jt(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=jt(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,y=p.clientX-l.startX;!l.isDragging&&Math.abs(y)>r&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-y)},[r]),d=jt(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.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(p=>{d(p)},[d]),f=jt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:a,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};Bt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as nl}from"@aiquants/fuzzy-search";var fr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=nl;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};de();de();Pn();import{jsx as po}from"react/jsx-runtime";function fo({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 po("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 ${Lt.progressTrack}`,n),...i,children:po("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}%`}})})}Me();var gn="view";import{useCallback as vc,useState as xc}from"react";import{useSearchParams as Tc}from"react-router";ge();de();Me();Ht();import{Panel as xo,PanelGroup as El,PanelResizeHandle as Ml}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Ll,VirtualScroll as kl,virtualScrollItemElementId as wl}from"@aiquants/virtualscroll";import{lazy as Rl,memo as Pl,Suspense as _l,useCallback as Fe,useEffect as wo,useId as To,useLayoutEffect as Ro,useMemo as Gt,useRef as hn,useState as Wn}from"react";var An={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Dn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function gr(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 rl,useEffect as al,useState as ol}from"react";var go=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:i=240}=t??{},[o,a]=ol(600),u=rl(()=>{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:f}=d.getBoundingClientRect(),p=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")),M=window.getComputedStyle(d),T=c(M.marginBottom),U=c(M.paddingBottom),z=window.innerHeight-g-x-r,b=p?Math.min(p.bottom,z):z,h=p?Math.max(p.top,y):y,C=Math.max(f,h),k=b-C-T-U,H=Number.isFinite(k)?Math.floor(k):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&a(L=>Math.abs(L-S)>1?S:L)},[r,e,i]);return al(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=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&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as ho,useRef as hr,useState as yo}from"react";var il=600,bo=8,yr=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[i,o]=yo(!1),[a,u]=yo(null),d=hr(null),c=hr(!1),f=hr(null),p=hr({onSelect:t,resolveItem:n,item:r});ho(()=>{p.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(()=>{f.current&&(l(),f.current=null)},[l]),y=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let C=p.current,k=null;C.item!==void 0?k=C.item:C.resolveItem&&h.target&&(k=C.resolveItem(h.target)),k!==null&&(c.current=!0,C.onSelect?.(k),u(k),o(!0)),g()},il))},[l,g]),x=St(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),M=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),T=St(()=>{c.current=!1},[]),U=St(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let C=Math.abs(h.clientX-f.current.x),k=Math.abs(h.clientY-f.current.y);(C>bo||k>bo)&&(l(),f.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),b=St(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return ho(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let C=[["pointerdown",y,void 0],["pointerup",x,void 0],["pointercancel",x,void 0],["pointermove",U,void 0],["pointerleave",x,void 0],["contextmenu",z,void 0]],k=[["mousedown",M,!0],["mouseup",M,!0],["click",M,!0],["pointerdown",T,!0],["keydown",T,!0],["contextmenu",z,!0],["pointerup",x,!0],["pointercancel",x,!0]];for(let[H,S,L]of C)h.addEventListener(H,S,L);for(let[H,S,L]of k)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of C)h.removeEventListener(H,S,L);for(let[H,S,L]of k)window.removeEventListener(H,S,L);l()}},[e,y,x,U,M,T,z,l]),{isPopupVisible:i,popupItem:a,handleClosePopup:b}};import{useCallback as sl,useEffect as ll,useState as So,useSyncExternalStore as cl}from"react";function br(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",i=cl(sl(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(r);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[o,a]=So(!1),[u,d]=So(0);return ll(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)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 p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ge();It();var Co=e=>e.isComposing||e.keyCode===229;var vo=(e,t)=>{if(ml(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Co(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 ul(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}},dl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),ul=e=>dl.has(e),ml=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)}`)};de();ge();Ur();de();cn();Pn();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as pl,useOverlayPresence as fl,useSwipeOverlayDialog as gl}from"@aiquants/swipe-overlay";import{useCallback as hl,useId as yl}from"react";import{jsx as Sr,jsxs as ia}from"react/jsx-runtime";var bl=Le(Xn,"flex overflow-hidden"),Sl=Le(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),Cl=`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`,vl=`flex shrink-0 items-center justify-between gap-3 ${F.borderSubtle} border-b px-3 py-2`,xl=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Tl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${F.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${st}`,Nl="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=Q(),a=yl(),u=fl(e),d=hl(y=>y.ownerDocument.getElementById(a),[a]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=gl({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(bl,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[Sr("div",{...f,"data-contact-map-overlay-backdrop":"",className:Le(Sl,e?"opacity-100":"opacity-0")}),ia("div",{...p,"data-contact-map-overlay-panel":"",className:Le(Cl,e?"pointer-events-auto":"pointer-events-none",r),children:[ia("div",{className:vl,children:[Sr("h2",{id:a,tabIndex:-1,className:xl,children:i===void 0?o.overlayTitle:i}),Sr("button",{type:"button",className:Tl,onClick:()=>l(),children:o.close})]}),Sr("div",{"data-contact-map-overlay-body":"",className:Nl,style:pl,children:n})]})]}):null};cn();Me();Gr();import{Fragment as jl,jsx as K,jsxs as Je}from"react/jsx-runtime";var $l=Rl(async()=>({default:(await Promise.resolve().then(()=>(Za(),Ja))).default})),sa=64,No="h-[64px]",Eo=240,Ol=4,la=gr(An),Al=An.listPanelMinWidth,Dl=An.detailPanelMinWidth,Wl=An.handleThickness,xp=la.collapseThreshold,Tp=la.expandThreshold,Hl=({contactData:e})=>{let t=Q(),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})},Il=e=>({"--contact-panel-height":`${e}px`}),Fl=e=>typeof e=="object"&&e!==null&&"item"in e,Bl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,zl=(e,t)=>{for(let n of e){let r=Wt(n);if(r?.person_id===t)return r}return null},Mo=(e,t)=>t!==null&&Wt(e)?.person_id===t,Lo=(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=Lo(e,t,n);return r!==null?r:Lo(e,t-n,n===1?-1:1)},ca=(e,t,n)=>{let{viewportHeight:r}=go(t,{enableMutationObserver:!0,bottomGap:Ol,minFallbackHeight:Eo}),[i,o]=Wn(0),a=Fe(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),y=l.getBoundingClientRect(),x=Math.ceil(y.top-g.top);Number.isFinite(x)&&x>0&&o(M=>Math.abs(M-x)>1?x:M)},[t,n]);Ro(()=>{if(!e)return;a();let p=requestAnimationFrame(a);return window.addEventListener("resize",a),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",a)}},[e,a]);let u=r>0?r:Eo,d=i>0?i:0,c=u+d,f=Gt(()=>Il(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},Ul=new Set,Vl=()=>{let[e,t]=Wn(Ul),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}},Kl=(e,t,n)=>{let r=hn(n);Ro(()=>{r.current=n},[n]),wo(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},Po=Pl(({entry:e,index:t,itemCount:n,listboxId:r,isSelected:i,isActive:o,onSelect:a,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=Q(),y=hn(null),x=K("div",{className:No}),M=Fl(e)?e:null,T=Wt(e),{isPopupVisible:U,handleClosePopup:z}=yr({ref:y,onSelect:u,item:T?.person_id});if(Kl(T?.person_id??null,U,l),!e||!T)return x;let{person_id:b}=T,h=t%2===0?N.surface:N.subtle,C=`${X.blue} ring-1 ${E.selectedRing}`,k=i?C:h,H=["B","F"].map(S=>Bl(S,S==="B"?M?.baseScore:M?.score)).filter(Boolean);return Je("div",{ref:y,id:wl(r,b),className:`flex ${No} w-full items-center overflow-hidden ${F.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${k} ${Ia}`,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 ${kt} ${s.fgSecondary} leading-tight`,children:b}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${kt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(_l,{fallback:K(Hl,{contactData:T}),children:K($l,{contactData:T,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:U,onRequestClose:z})})]})});Po.displayName="ContactListRow";var _o=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:a,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=Pe(),p=hn(null),l=hn(null),[g,y]=Wn(null),{normalizedViewportHeight:x,panelSizingStyle:M}=ca(u,l,p),{isAnyPopupVisible:T,handlePopupVisibilityChange:U}=Vl(),z=Gt(()=>({enablePointerDrag:!T,enableKeyboardNavigation:!1}),[T]),b=Gt(()=>i?n:t,[i,n,t]),[h,C]=Wn(null),k=Fe(Y=>{y(Y),C(Y)},[]),H=Fe(Y=>{if(!a)return;let ye=Y.trim();if(!ye||ye==="-"||typeof window>"u")return;let J=gt(ye,!0);J&&window.open(J,"_blank","noopener,noreferrer")},[a]),[S,L]=Wn(!1),ae=Fe(()=>L(!1),[]),I=Fe(Y=>{k(Y),L(!0)},[k]),be=To(),oe=To(),W=hn(null),A=b.length,q=Fe((Y,ye)=>K(Po,{entry:Y,index:ye,itemCount:A,listboxId:be,isSelected:Mo(Y,g),isActive:Mo(Y,h),onSelect:I,onLongPressSelect:k,searchQuery:r,enableHighlighting:o,openEmailsWithGmail:a,openGmailCompose:H,onPopupVisibilityChange:U}),[A,be,g,h,I,k,r,o,a,H,U]),pe=Gt(()=>{let Y=new Map;return b.forEach((ye,J)=>{let mt=Wt(ye);mt!==null&&Y.set(mt.person_id,J)}),Y},[b]),Se=h===null?null:pe.get(h)??null,Oe=g===null?null:pe.get(g)??null,$t=Math.max(1,Math.floor(x/sa)),Xt=Fe(Y=>{if(Y.target.id!==be)return;let ye=vo(Y.nativeEvent,{activeIndex:Se,startIndex:Oe===null?0:Oe,itemCount:A,pageSize:$t});if(ye===null)return;if(Y.preventDefault(),ye.kind==="activate"){Se!==null&&h!==null&&I(h);return}let J=ko(b,ye.index,ye.direction);J!==null&&(C(J.personId),W.current?.scrollToIndex(J.index,{align:"nearest"}))},[be,Se,Oe,A,$t,h,I,b]),vt=Fe(Y=>{if(Y.target.id!==be||Se!==null||!Y.target.matches(":focus-visible"))return;let ye=ko(b,Oe===null?0:Oe,1);ye!==null&&C(ye.personId)},[be,Se,Oe,b]),Qt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":oe}),[be,c.listboxLabel,oe]),Ce=Fe(Y=>b[Y],[b]),Jt=Fe(Y=>Wt(b[Y])?.person_id??`row-${Y}`,[b]),Ve=Fe(()=>sa,[]),ut=Gt(()=>({enabled:!0,renderVisual:Ll}),[]),Ke=Gt(()=>g===null?null:zl(b,g),[g,b]);wo(()=>{g!==null&&!Ke&&y(null)},[g,Ke]);let He=hn(null),{isTwoColumn:Zt}=br(He,la);S&&(Zt||Ke===null)&&L(!1);let xt=Je("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${F.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:Xt,onFocus:vt,children:K(kl,{ref:W,contentProps:Qt,activeItemIndex:A===0?void 0:Se,activeItemVisibleInset:Fa,itemCount:A,getItemKey:Jt,behaviorOptions:z,getItem:Ce,getItemHeight:Ve,viewportSize:x,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ut},locale:d,labels:f,className:`w-full rounded-b-lg border ${F.borderSubtle} border-t-0 ${N.surface} pr-0.75 transition-colors`,children:(Y,ye)=>q(Y,ye)})}),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:M,children:Zt?Je(El,{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(xo,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Al,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(Ml,{id:"contact-map-list-handle",thickness:Wl,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(xo,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Dl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(pn,{placement:"pane",contact:Ke,searchTerm:r,enableHighlighting:o})})]}):Je(jl,{children:[xt,Ke?K(Cr,{isOpen:S,onClose:ae,title:c.detailHeading,children:K(pn,{placement:"overlay",contact:Ke,searchTerm:r,enableHighlighting:o})}):null]})})};Ht();import{DirectoryTree as rc}from"@aiquants/directory-tree";import{Panel as Io,PanelGroup as ac,PanelResizeHandle as oc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as ic}from"@aiquants/virtualscroll";import sc from"@heroicons/react/24/solid/FolderMinusIcon.js";import lc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as yn,useMemo as Ze,useRef as Nr,useState as Yt}from"react";import{createPortal as cc}from"react-dom";var da=(e,t)=>e&&e.trim()||t;import{useEffect as Gl,useRef as vr,useState as ql}from"react";var $o=(e,t=250)=>{let[n,r]=ql(e),i=vr(null),o=vr(e),a=vr(null),u=vr(!1);return Gl(()=>{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 f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));r(g),p<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 Oo,useRef as Yl,useSyncExternalStore as Xl}from"react";ge();var Ql=250,Jl=4e3,xr=3,Ao={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Do=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Tr=class{constructor(t,{workerSource:n,logger:r=lt}){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>=xr){this.logger.error(`[TreeWorker] the tree Worker failed ${xr} times in a row; the tree stops updating until ${Ao[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Ql*2**(this.consecutiveFailures-1),Jl);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${xr})`,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(Ao,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>=xr||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||!Do(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||!Do(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}}},Zl=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,Wo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),ec=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},tc=e=>{if(io(e),qt===null){let t=new Tr(()=>Zl(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 ${Wo(qt.workerUrl)} and cannot also load it from ${Wo(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},Ap=()=>{qt?.session.reset(),qt=null},nc={snapshot:null,isBuilding:!1};function Ho(e,t=!1){let n=bt(),r=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),a=o.uncategorizedCompany,u=o.noName,d=Oo(()=>({uncategorizedCompany:a,unnamedPerson:u}),[a,u]),c=Yl(r);ma(()=>{c.current=r},[r]);let f=r!==void 0,p=f?void 0:i,l=Oo(()=>f?new Tr(()=>ec(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=ua(()=>l===null?tc(p):l,[l,p]),y=ua(M=>g().subscribe(M),[g]),x=ua(()=>g().getState(),[g]);return ma(()=>{let M=g();M.syncRecords(e,d),t&&M.finalize()},[g,e,t,d]),ma(()=>{if(l!==null)return()=>l.stop()},[l]),Xl(y,x,()=>nc)}ge();de();Me();jr();or();import{Fragment as Cc,jsx as j,jsxs as $e}from"react/jsx-runtime";var ga=gr(Dn),dc=Dn.listPanelMinWidth,uc=Dn.detailPanelMinWidth,mc=Dn.handleThickness,sf=ga.collapseThreshold,lf=ga.expandThreshold,pc=(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},fc="contact-map-tree h-full w-full",gc={hoverClassName:N.muted,directorySelectedClassName:`${X.sky} ${E.treeNameSky}`,itemSelectedClassName:`${X.sky} ${E.treeNameSky}`},pa="h-4 w-4 shrink-0 transition-colors duration-150",hc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Er=null,Fo=null,Hn=new Map,Bo="",zo=null,Uo=null,yc=(e,t,n,r,i)=>{let o=`${n?"icons":"plain"}#${r}#${i.noName}`;(o!==Bo||i.formatDirectoryName!==zo||t!==Uo)&&(Hn.clear(),Bo=o,zo=i.formatDirectoryName,Uo=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}`,f=Hn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:jo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Hn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&a.entries.push(p.entries[0]);for(let[l,g]of p.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 p.contactByPath)a.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)a.ancestorsByPath.set(l,g);a.totalCount+=p.totalCount,!a.firstPerson&&p.firstPerson&&(a.firstPerson=p.firstPerson)}for(let d of Hn.keys())u.has(d)||Hn.delete(d);return a},fa=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Ko=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Ko(n.children)));return t},bc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},jo=(e,t,n,r,i)=>{let o=new Map,a=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let y=[...g,l.absolutePath];u.set(l.absolutePath,y);let x,M,T=l.type==="directory"?r.formatDirectoryName(l.name,bc(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&&(M=h=>{let C=fa(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(C=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${pa} ${C}`})},l.title&&(U=pc(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=>f(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;M=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:M,children:x}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:a,ancestorsByPath:u,firstPerson:c,totalCount:d}},Sc=(e,t,n)=>{let r=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);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=f=>{let p=a.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return a.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:r.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},Vo=(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},Go=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:i,hasSearchTerm:o,isSearchInProgress:a,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=Pe(),p=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:p,formatDirectoryName:l}),[p,l]),[y,x]=Yt(null),[M,T]=Yt(!1),{snapshot:U,isBuilding:z}=Ho(n,e.isStreamingComplete),b=U?.tree??null,h=U?.rebuildEpoch??0,C=Ze(()=>b?yc(b,r,y,h,g):null,[b,r,y,h,g]),k=Ze(()=>{if(!b)return null;if(!o)return C;let D;M||(D=new Set(i.map(fe=>fe.item.person_id)));let le=jo(b,r,y,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return Sc(le,i,M)},[b,C,r,y,e.searchQuery,e.enableHighlighting,o,i,M,g]),H=Ze(()=>k||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[k]),S=o&&e.errorMessage!==null,[L,ae]=Yt(H),I=Nr(!1);yn(()=>{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,pe=Ze(()=>Ko(oe),[oe]),[Se,Oe]=Yt(()=>Fo??new Set),$t=Be(D=>!Se.has(D),[Se]),Xt=Be(D=>{Oe(le=>{let fe=new Set(le);return fe.has(D)?fe.delete(D):fe.add(D),fe})},[]),vt=Be(D=>{D.length!==0&&Oe(le=>{let fe=new Set(le);for(let ft of D)fe.add(ft);return fe})},[]),Qt=Be(D=>{Oe(le=>{if(le.size===0)return le;let fe=!1,ft=new Set(le);for(let V of D)ft.delete(V)&&(fe=!0);return fe?ft:le})},[]);yn(()=>{Fo=Se},[Se]),yn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ce,Jt]=Yt(null),[Ve,ut]=Yt(null),[Ke,He]=Yt(!1),Zt=Be(()=>He(!1),[]),xt=Nr(null),Y=Nr(null),{normalizedViewportHeight:ye,panelSizingStyle:J}=ca(u,Y,xt),mt=Be(D=>{let le=A.get(D);return le?(Ce!==le.person_id&&Jt(le.person_id),D!==Ve&&ut(D),!0):!1},[A,Ve,Ce]),Ot=Be(D=>{mt(D)&&He(!0)},[mt]),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}=yr({ref:Y,resolveItem:Tt,onSelect:mt}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let fe=gt(le,!0);fe&&window.open(fe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Nn?A.get(Nn):null,nt=Ae&&Nt!==null&&Nt!==void 0;yn(()=>{Ae&&!Nt&&En()},[Ae,Nt,En]);let At=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:ic}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Et=Ze(()=>hc(At,ye,nt),[At,ye,nt]);yn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Er?(x(Er),()=>{D=!0}):((async()=>{try{let[fe,ft,V,Z]=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=fe.default,rt=ft.default,Rr=V.default,Ma=Z.default;xe&&rt&&Rr&&Ma&&(Er={company:xe,department:rt,title:Rr,person:Ma},x(Er))}catch(fe){lt.warn("Failed to load lucide icons",fe)}})(),()=>{D=!0})},[]);let Dt=Ze(()=>{if(!y)return;let D=Z=>xe=>j(Z,{"aria-hidden":"true",className:`${pa} ${fa(xe)}`}),le={company:D(y.company),department:D(y.department),title:D(y.title)},fe=D(y.person),ft=Z=>Z in le,V=Z=>{let[xe]=Z.entry.relativePath.split(":",1);return(ft(xe)?le[xe]:le.company)(Z)};return{directory:V,directoryExpanded:V,file:fe}},[y]),en=Be(()=>{Oe(D=>D.size===0?D:new Set)},[]),Lr=Be(()=>{pe.length>0&&vt(pe)},[pe,vt]),Mt=Vo(Ce,Ve,W);yn(()=>{let D=Vo(Ce,Ve,W);if(D===null){Ce!==null&&Jt(null),Ve!==null&&ut(null);return}D!==Ve&&ut(D)},[Ce,Ve,W]);let je=Mt===null?null:A.get(Mt)??null,Mn=e.isStreamingComplete,kr=e.isStreamingFailed,Bn=Mn&&n.length===0,zn=(z||!b)&&!Bn,Un=$o(q,250),pt=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," ",pt?c.treeNodeCount(Un):"\u2026"]}),kr&&!Mn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.rose} ${X.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]}):Mn?zn?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.amber} ${X.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} ${X.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} ${X.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(!M),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${v} transition-colors ${M?`${X.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),pe.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 ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(lc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Lr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${F.borderControl} ${N.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(sc,{className:"h-4 w-4"})})]}):null]}),Vn=Nr(null),{isTwoColumn:Ln}=br(Vn,ga,{mediaQuery:"(min-width: 768px)"});Ke&&(Ln||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Xt,isExpanded:$t,expandMultiple:Qt,collapseMultiple:vt,isPending:a}),[vt,Qt,$t,Xt,a]),jn=Ze(()=>({onEntryClick:Tn,selectedPath:Mt}),[Tn,Mt]),wr=Ze(()=>({className:fc,lineColor:Wa,iconOverrides:Dt,showDirectoryIcons:!!Dt,showFileIcons:!!Dt,highlightStyles:gc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Dt]),kn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${F.borderSubtle} ${N.surface} shadow-sm transition-colors`,children:j("div",{ref:Y,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:oe.length>0?j(rc,{entries:oe,expansion:Kn,selection:jn,visual:wr,virtualScroll:Et,locale:d,labels:f}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${F.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:J,children:[t&&cc(tn,t),Ln?$e(ac,{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(Io,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:dc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:kn}),j(oc,{id:"contact-map-tree-handle",thickness:mc,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(Io,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:uc,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(pn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):$e(Cc,{children:[kn,je?j(Cr,{isOpen:Ke,onClose:Zt,title:c.detailHeading,children:j(pn,{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 In,jsxs as bn}from"react/jsx-runtime";var Nc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ec=e=>e==="tree"?"tree":"list",qo=({context:e})=>{let t=Q(),[n,r]=Tc(),[i,o]=xc(null),a=Ec(n.get(gn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Rt(),y=vc(x=>{let M=x==="tree"?"tree":"list";if(M===a)return;let T=new URLSearchParams(typeof window<"u"?window.location.search:"");M==="list"?T.delete(gn):T.set(gn,M),r(T,{replace:!0})},[a,r]);return bn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[bn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[bn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${N.muted} p-0.5 transition-colors`,style:Nc,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[bn("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 ${v} transition-colors ${a==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),bn("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 ${v} transition-colors ${a==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),In("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),bn("div",{className:"flex h-full flex-1 flex-col",children:[In("div",{className:`${a==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="list"?In(_o,{context:e}):null}),In("div",{className:`${a==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="tree"?In(Go,{context:e,controlsContainer:i}):null})]})]})};import{memo as kc}from"react";ge();de();Me();ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as Mc,useId as We}from"react";import{jsx as O,jsxs as B}from"react/jsx-runtime";var ha=1e3,ya=Mc(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),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(),f=We(),p=We(),l=We(),g=We(),y=We(),x=We(),M=We(),T=[];T.push(B("div",{className:`${r} ${$.green} border-l-4`,children:[B("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:a,className:`font-medium ${v} ${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"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),O("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:u,className:`font-medium ${v} ${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"}),B("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(B("div",{className:`${r} ${$.blue} border-l-4`,children:[B("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:d,className:`font-medium ${v} ${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"}),B("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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:f,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),O("input",{id:f,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"}),B("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(B("div",{className:`${r} ${$.cyan} border-l-4`,children:[B("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:c,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),B("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 ${F.borderControl} px-2 pointer-coarse:text-base ${v} 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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:p,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),O("input",{id:p,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"}),B("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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:l,className:`font-medium ${v} ${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"}),B("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(B("div",{className:`${r} ${$.indigo} border-l-4`,children:[B("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:g,className:`font-medium ${v} ${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"}),B("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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:y,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.maxResults}),B("label",{className:`flex min-h-11 items-center gap-2 ${v} ${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"}),B("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(B("div",{className:`${r} ${$.emerald} border-l-4`,children:[B("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:x,className:`font-medium ${v} ${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"}),B("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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:M,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),O("input",{id:M,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"}),B("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(B("div",{className:`${r} ${$.teal} border-l-4`,children:[B("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:U,className:`font-medium ${v} ${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"}),B("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})]}),B("div",{className:"space-y-2",children:[O("label",{htmlFor:z,className:`font-medium ${v} ${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"}),B("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")),B("section",{className:"space-y-3",children:[B("div",{className:"flex items-center justify-between gap-3",children:[B("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} ${X.green} px-2 font-medium ${m.green} ${v} 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";ge();de();Me();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ke}from"@aiquants/fuzzy-search";import{memo as Lc,useId as Sn}from"react";import{jsx as me,jsxs as he}from"react/jsx-runtime";var ba=1e3,Sa=Lc(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),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=Sn(),u=Sn(),d=Sn(),c=Sn(),f=Sn(),p=Sn(),l=[];return l.push(he("div",{className:`${r} ${$.purple} border-l-4`,children:[he("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:a,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),me("input",{id:a,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??ke.levenshteinWorkerOptions?.threshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??ke.levenshteinWorkerOptions?.threshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:u,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),me("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ke.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ke.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(he("div",{className:`${r} ${$.pink} border-l-4`,children:[he("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:d,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),me("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??ke.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??ke.levenshteinWorkerOptions?.lengthDiffPenalty]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(he("div",{className:`${r} ${$.violet} border-l-4`,children:[he("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),me("label",{htmlFor:c,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.maxResults}),he("label",{className:`flex min-h-11 items-center gap-2 ${v} ${s.fgMuted}`,children:[me("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]}),me("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"}),he("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(he("div",{className:`${r} ${$.rose} border-l-4`,children:[he("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:f,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),me("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??ke.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"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??ke.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:p,className:`font-medium ${v} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),me("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??ke.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"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??ke.levenshteinWorkerOptions?.partialMatchBonus]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&me("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),he("section",{className:"space-y-3",children:[he("div",{className:"flex items-center justify-between gap-3",children:[he("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[me("span",{children:"\u{1F4CF}"}),me("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),me("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:ke.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:ke.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:ke.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:ke.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:ke.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.purple} ${X.purple} px-2 font-medium ${m.purple} ${v} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),me("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 dt,jsxs as ct}from"react/jsx-runtime";var wc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ca=kc(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:a,onTabChange:u})=>{let d=Q(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x}=Rt();return ct("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:[ct("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ct("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),dt("div",{className:"flex flex-wrap gap-1.5",children:ct("button",{type:"button",onClick:()=>t(M=>fr(M.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${v} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),dt("div",{className:"mb-0 shrink-0",children:ct("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:wc,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:x,children:[ct("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 ${v} transition-colors ${a==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),ct("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 ${v} transition-colors ${a==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),ct("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 ${v} transition-colors ${a==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),ct("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 ${v} transition-colors ${a==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),ct("div",{className:"flex flex-col gap-1",children:[dt("div",{className:`${a==="basic"?"block":"hidden"}`,children:dt(zr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),dt("div",{className:`${a==="advanced"?"block":"hidden"}`,children:dt(Br,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${a==="index"?"block":"hidden"}`,children:dt(ya,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${a==="levenshtein"?"block":"hidden"}`,children:dt(Sa,{searchOptions:e,setSearchOptions:t})})]})]})});Ca.displayName="SearchOptionsPanel";import{memo as _c,useCallback as $c}from"react";Bt();ge();de();Me();de();import{memo as Rc}from"react";import{jsxs as va}from"react/jsx-runtime";var _=Rc(({label:e,value:t,unit:n,color:r=s.fgMuted})=>va("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[va("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),va("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ge();de();Me();import{memo as Pc}from"react";import{jsx as P,jsxs as ee}from"react/jsx-runtime";var Cn=Pc(({kind:e,icon:t,stats:n,color:r})=>{let{locale:i,labels:o}=Pe(),a=W=>te(i,W);if(!n)return P("section",{className:`rounded-lg border ${F.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||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,y=u.errorCount??0,x=u.timestamp,M=c.fieldPerformance||{},T=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},b=d.operationCount??0,h=d.operationDistribution||{},C=e==="index",k=e==="levenshtein",H=C?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(ee("div",{className:`${ae} ${$.blue} border-l-4`,children:[ee("div",{className:`${I} ${r}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:a(f),color:r}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:r}),P(_,{label:o.statTotalProcessingTime,value:p.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(ee("div",{className:`${ae} ${$.amber} border-l-4`,children:[ee("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(C&&(oe.push(ee("div",{className:`${ae} ${$.green} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.emerald} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.teal} border-l-4`,children:[ee("div",{className:`${I} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([A,q])=>{let pe;if(typeof q=="number"){let Se=A.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?pe=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?pe=be(q)??q.toString():pe=a(q)}else pe=String(q);return P(_,{label:A,value:pe,color:m.teal},A)})]},"index-meta"))}if(k){if(oe.push(ee("div",{className:`${ae} ${$.purple} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.fuchsia} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.rose} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.indigo} border-l-4`,children:[ee("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(ee("div",{className:`${ae} ${$.violet} border-l-4`,children:[ee("div",{className:`${I} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([A,q])=>{let pe=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(A),value:o.statQueryLengthValue({count:pe,averagePercent:(Se*100).toFixed(1)}),color:m.violet},A)})]},"lev-query-length"))}}if(Object.keys(M).length>0){let W=Object.entries(M).sort(([,A],[,q])=>(q.averageScore??0)-(A.averageScore??0)).slice(0,6);oe.push(ee("div",{className:`${ae} ${$.purple} border-l-4`,children:[ee("div",{className:`${I} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([A,q])=>{let pe=q;return ee("div",{className:`space-y-1 rounded ${X.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:A}),P(_,{label:o.statAverageScore,value:`${((pe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:a(pe.matchCount??0),unit:o.itemsUnit(a(pe.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((pe.bestScore??0)*100).toFixed(1)}% / ${((pe.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(ee("div",{className:`${ae} ${$.blue} border-l-4`,children:[ee("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&&ee("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(ee("div",{className:`${ae} ${$.sky} border-l-4`,children:[ee("div",{className:`${I} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,A)=>ee("div",{className:`rounded ${X.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")),ee("section",{className:"space-y-2",children:[ee("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})]})});Cn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Oc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},xa=_c(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:i,rebuildIndex:o,isIndexBuilding:a,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=Pe(),p=t.trim(),l=p?r:n,{setScrollableRef:g,onPointerDown:y,onPointerMove:x,onPointerUp:M,onPointerLeave:T,onPointerCancel:U,onClickCapture:z}=Rt(),b=u!=="index"||a,h=a?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,C=b?`cursor-not-allowed ${N.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,k=a?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,H=$c(()=>{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 ${X.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} ",f.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 ${v} transition-colors ${C}`,title:h,children:k}),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 ${v} ${s.onPrimary} transition-colors ${zt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${N.muted} p-0.5 transition-colors`,style:Oc,onPointerDown:y,onPointerMove:x,onPointerUp:M,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 ${v} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",f.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 ${v} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",f.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 ${v} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",f.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:f.statTotalSearches,value:te(c,e.totalSearches)}),Ue(_,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:f.statDataCount,value:te(c,e.itemCount)}),Ue(_,{label:p?f.statResultCount:f.statDisplayedCount,value:te(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(Cn,{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(Cn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(Cn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(Cn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});xa.displayName="StatisticsPanel";import{Fragment as Zo,jsx as ce,jsxs as we}from"react/jsx-runtime";var zc=/[\u200B\uFEFF]/g,Ta=typeof window<"u",ti=Ta&&typeof document<"u",Mr=(e,t=[],n=!1)=>{let r=ei(e);r.current=e,Ct(()=>{if(!(!Ta||n&&!ti))return r.current()},[n,...t])},Yo=(e,t,n)=>{let[r,i]=et(()=>{let o=Xo(a=>a.getItem(e));return o&&t.includes(o)?o:n});return Mr(()=>{Xo(o=>{o.setItem(e,r)})},[e,r]),[r,i]},Xo=e=>{if(!Ta)return null;try{return e(window.sessionStorage)}catch{return null}},Qo=(e,t)=>{let[n,r]=et(e);return Ct(()=>{let i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Uc="contact-map.settings-tab",Vc="contact-map.statistics-tab",Kc=["basic","advanced","index","levenshtein"],jc=["overview","index","levenshtein"],Jo=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Gc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ni=({streamState:e,...t}={})=>e===void 0?ce(qc,{...t}):ce(ri,{...t,streamState:e}),qc=e=>{let{context:t}=pr();return ce(ri,{...e,streamState:t})},Yc={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ri=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:f,isStreamingFailed:p}=t,l=Fc(),[g]=Bc(),y=ei(null),[x,M]=et(!0),[T,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:b}=fn(o.workerUrls,i,Yc),[h,C]=et(()=>fr({indexWorker:z,levenshteinWorker:b})),[k,H]=et(g.get("q")||""),S=Qo(k,h.debounceMs??Ac.debounceMs);Ct(()=>{let V=g.get("q")||"";H(Z=>Z!==V?V:Z)},[g]),Ct(()=>{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]=Ic(),[I,be]=et("search"),[oe,W]=Yo(Uc,Kc,"basic"),[A,q]=Yo(Vc,jc,"overview"),{setScrollableRef:pe,onPointerDown:Se,onPointerMove:Oe,onPointerUp:$t,onPointerLeave:Xt,onPointerCancel:vt,onClickCapture:Qt}=Rt(),Ce=vn(()=>{if(!ti)return;let V=y.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Jt=vn(V=>{let Z=V;be(Z),Z==="search"&&Ce()},[Ce]),Ve=Pt(()=>({...h,debounceMs:0}),[h]),[ut,Ke]=et("union"),He=ut==="intersection",Zt=He?u.operatorAndTitle:u.operatorOrTitle,xt=vn(V=>Dc(V,ut),[ut]),Y=Pt(()=>({querySetsOf:xt}),[xt]),ye=Qo(d,f?0:800),{searchTerm:J,setSearchTerm:mt,filteredItems:Ot,resultTerm:Tn,isSearching:Tt,isIndexBuilding:Ae,clearSearch:Nn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Wc(ye,Jo,Ve,Y),At=J.trim().length>0,[Et,Dt]=et(""),[en,Lr]=et(()=>J),Mt=Pt(()=>rr(k),[k]),je=Pt(()=>rr(S),[S]);Ct(()=>{S===Et&&je===J||ae(()=>{Dt(S),mt(je)})},[S,Et,je,J,mt]);let Mn=vn(V=>{let xe=V.target.value.replace(zc,"");H(xe)},[]),kr=vn(()=>{H(""),Dt(""),Nn(),Ce()},[Nn,Ce]),Bn=vn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),Ce()},[Ce]);Mr(()=>{if(!(I==="search"&&l.state==="idle"&&!L))return;let Z=document.activeElement;if(!!!(Z?.matches('[role="tab"]')||Z?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Z&&Z!==document.body&&Z!==y.current)return;let rt=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(rt)}},[I,l.state,L,Ce],!0),Mr(()=>{if(I!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ce()}],[window,"pageshow",()=>{Ce()}]];for(let[Z,xe,rt]of V)Z.addEventListener(xe,rt);return()=>{for(let[Z,xe,rt]of V)Z.removeEventListener(xe,rt)}},[I,Ce],!0),Ct(()=>(n&&n(I==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[I,n]),Mr(()=>{let V=document.body,Z=V.style.overflow;return I==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=Z}},[I],!0),Ct(()=>{tt&&lt.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:pt}=Pt(()=>{let V=Mt!==je,Z=je!==J,xe=J.trim().length>0||Mt.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:Z,isSearchInProgress:L||Tt||Tn!==J&&nt===null||xe&&Ae||V||Z||en!==J}},[Mt,je,J,Tn,nt,L,Tt,Ae,en]),[tn,Vn]=et(J);Ct(()=>{tn!==J&&Vn(J)},[J,tn]),Ct(()=>{zn||Un||L||Tt||Ae||tn===J&&en!==J&&Lr(J)},[J,en,zn,Un,L,Tt,Ae,tn]);let Ln=Pt(()=>Xa(Et,Jo),[Et]),Kn=Pt(()=>Ln(Ot),[Ln,Ot]),jn=Pt(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Et,searchTerm:J,isSearching:Tt,isIndexBuilding:Ae,isPending:L,hasSearchTerm:At,enableHighlighting:x,openEmailsWithGmail:T,isSearchInProgress:pt,isSearchTabActive:I==="search",errorMessage:nt??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Kn,Et,J,Tt,Ae,L,At,x,T,pt,I,nt,f,p]),wr=At?Ot.length:d.length,kn=te(a,d.length),D=te(a,Ot.length),fe=`${`scrollbar-hidden ${N.subtle} ${s.fg}`}${I==="search"?" h-full min-h-0":""}`;return ce("div",{"data-contact-map-search-page":"",className:fe,children:we(lr,{value:I,onValueChange:Jt,className:`flex flex-col${I==="search"?" h-full min-h-0":""}`,children:[we(On,{ref:pe,"data-contact-map-page-tabs":"",style:Gc,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:Xt,onPointerCancel:vt,onClickCapture:Qt,children:[we(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${v} 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 ${v} 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 ${v} 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 ${F.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 ${v} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Da.amber} ${X.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,"data-contact-map-search-field":"",type:"text",value:k,onChange:Mn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${F.borderControl} border-solid px-2 pointer-coarse:text-base ${v} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${N.surface} ${s.fg}`}),k&&ce("button",{type:"button",onClick:kr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${F.borderControl} px-1.5 ${v} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:pt?u.searchBusyTitle:u.clearSearch,"aria-label":pt?void 0:u.clearSearch,disabled:pt,children:pt?we(Zo,{children:[ce(Hc,{"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 ${v} ${s.fg}`,children:kn})," ",u.recordUnit(kn),Ae?we("span",{className:`ml-1.5 inline-flex items-center rounded ${X.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 ${X.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,pt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):we(Zo,{children:[ce("span",{className:`ml-1 font-semibold ${v} ${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(fo,{className:`h-1 ${Lt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),r?r(jn):ce(qo,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(Ca,{searchOptions:h,setSearchOptions:C,enableHighlighting:x,setEnableHighlighting:M,openEmailsWithGmail:T,setOpenEmailsWithGmail:U,activeTab:oe,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(xa,{performanceMetrics:tt,searchTerm:J,totalDataCount:d.length,resultsCount:wr,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Ae,activeTab:A,onTabChange:q})})]})})};ge();import{memo as Xc,useState as Qc}from"react";import{jsx as ai,jsxs as Zc}from"react/jsx-runtime";var Jc=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"auth-required":return{phase:e,status:"",alert:n.streamAuthRequired};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Na=Xc(({phase:e,loadedCount:t})=>{let n=Q(),[r,i]=Qc(()=>({phase:e,status:"",alert:""})),o=r.phase===e?r:Jc(e,t,n);return o!==r&&i(o),Zc("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[ai("span",{role:"status",children:o.status}),ai("span",{role:"alert",children:o.alert})]})});Na.displayName="ContactMapStreamAnnouncer";ge();import{memo as nd,useId as rd,useLayoutEffect as si,useRef as li}from"react";var ed="[data-contact-map-search-page]",td=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],oi=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(ed);if(n!==null)return n}return null},ii=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let r of td){let i=e.querySelector(r);if(i!==null&&(i.focus(),t.activeElement===i))return i}return null};de();cn();Me();import{jsx as Fn,jsxs as cd}from"react/jsx-runtime";var ad="shrink-0 pb-2",od=`flex items-center gap-2 rounded-md border ${$.rose} ${X.rose} px-[11px] py-[3px] ${m.rose} ${v}`,id=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${F.borderControl} ${N.surface} px-[11px] font-semibold ${m.rose} ${v} transition-colors ${E.hoverRoseTint} ${st}`,sd=e=>e==="failed"||e==="auth-required",ld=({phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i})=>{let o=Q(),a=rd(),u=li(null);return si(()=>{let d=u.current;return()=>{d?.contains(d.ownerDocument.activeElement)&&(i.current=oi(d))}},[i]),Fn("div",{className:ad,children:cd("div",{ref:u,role:"group","aria-labelledby":a,"data-testid":"contact-map-stream-failure-notice","data-phase":e,className:od,children:[Fn("span",{"aria-hidden":"true",children:"\u26D4"}),Fn("span",{id:a,className:"min-w-0 flex-1 font-medium",title:e==="failed"?n??void 0:void 0,children:e==="auth-required"?o.streamAuthRequired:o.streamLoadFailed(t)}),Fn("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":a,onClick:r,className:id,children:o.streamRetry})]})})},Ea=nd(({phase:e,loadedCount:t,errorMessage:n,onRetry:r})=>{let i=li(null),o=sd(e);return si(()=>{let a=i.current;o||a===null||(i.current=null,ii(a))},[o]),o?Fn(ld,{phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i}):null});Ea.displayName="ContactMapStreamFailureNotice";import{jsx as _t,jsxs as di}from"react/jsx-runtime";var dd=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=Q(),i=t===void 0?r.appTitle:t,{context:o,retryNow:a}=pr(),u=_t(na,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount});return di("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[_t(Na,{phase:o.streamPhase,loadedCount:o.loadedCount}),e?e({title:i,annotation:u}):di("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[_t("h1",{className:"font-bold text-xl",children:i}),u]}),_t(Ea,{phase:o.streamPhase,loadedCount:o.loadedCount,errorMessage:o.errorMessage,onRetry:a}),_t("div",{className:"min-h-0 flex-1",children:_t(ni,{streamState:o,onFooterVisibilityChange:n})})]})},ch=e=>{let t=bt(),n=Re(e,"streamEndpoint"),r=Re(e,"workerUrls"),i=Re(e,"locale"),o=Re(e,"labels"),a=ci(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:fn(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=ci(()=>({locale:u?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[u,d]);return _t(aa,{config:a,chromeSurface:c,children:_t(dd,{...e})})};Bt();ge();import{createShouldRevalidate as ud}from"@aiquants/route-revalidation";var fh=ud({submissions:"url",query:{ignore:[gn,"q"]}});export{Br as AdvancedSearchSettings,zr as BasicSearchSettings,ht as CONTACT_MAP_LABEL_CATALOGS,Rn as CONTACT_MAP_LABEL_KEYS,Qa as ContactDetailGrid,pn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,na as ContactMapAnnotation,ch as ContactMapAppView,zs as ContactMapConfigProvider,_o as ContactMapSearchListView,ni as ContactMapSearchPage,qo as ContactMapSearchTabGroup,Go as ContactMapSearchTreeView,Na as ContactMapStreamAnnouncer,dr as ContactMapStreamClient,Ea as ContactMapStreamFailureNotice,Ne as HighlightedText,ya as IndexWorkerSettings,xp as LIST_COLLAPSE_THRESHOLD,Dl as LIST_DETAIL_PANEL_MIN_WIDTH,Tp as LIST_EXPAND_THRESHOLD,Al as LIST_PANEL_MIN_WIDTH,Wl as LIST_RESIZE_HANDLE_THICKNESS,Sa as LevenshteinWorkerSettings,fo as Progress,Ca as SearchOptionsPanel,_ as StatItem,xa as StatisticsPanel,Cr as SwipeOverlay,sf as TREE_COLLAPSE_THRESHOLD,uc as TREE_DETAIL_PANEL_MIN_WIDTH,lf as TREE_EXPAND_THRESHOLD,dc as TREE_PANEL_MIN_WIDTH,mc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,On as TabsList,Vt as TabsTrigger,Tr as TreeWorkerSession,Cn as WorkerStatsSection,ur as assertContactMapStreamEndpoint,io as assertContactMapTreeWorkerUrl,fm as assertContactMapWorkerUrls,hc as composeTreeVirtualScrollOptions,fh as contactMapShouldRevalidate,el as countContactMapCompanies,js as deserializeStreamRecord,Ys as getContactMapStreamClient,tc as getTreeWorkerSession,fn as layerContactMapWorkerUrls,wm as resetContactMapStreamClientForTesting,Ap as resetTreeWorkerSessionForTesting,Dr as resolveContactMapLabels,$o as useAnimatedNumber,bt as useContactMapConfig,Q as useContactMapLabels,Zs as useContactMapStream,ca as useContactPanelSizing,go as useDynamicViewportHeight,Rt as useHorizontalDragScroll,yr as useLongPressPopup,Kl as useReportPopupVisibility,br as useResponsiveTwoColumnLayout,Vl as useRowPopupRegistry,pr as useStreamedContactMapContext,Ho as useTreeWorker};