@aiquants/contact-map 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -16
- package/dist/client.d.mts +17 -17
- package/dist/client.d.ts +17 -17
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/styles/contact-map.standalone.css +1 -1
- package/package.json +14 -11
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var So=Object.defineProperty;var we=(e,t)=>()=>(e&&(t=e(e=0)),t);var To=(e,t)=>{for(var n in t)So(e,n,{get:t[n],enumerable:!0})};var Re,Tn,Za,Rt,Lt,Jt,Ge,Ne,wn,sa,ia,Ie,G,ft=we(()=>{"use strict";Re=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Tn=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Za=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=Re(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},Rt=e=>Za(e,["custom_email","email"]),Lt=e=>Za(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Jt=e=>{let t=Re(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},Ge=(e,t)=>{let n=Re(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ne=(e,t)=>String(e).padStart(t,"0"),wn=e=>`${Ne(e.getUTCFullYear(),4)}-${Ne(e.getUTCMonth()+1,2)}-${Ne(e.getUTCDate(),2)}`,sa=e=>`${wn(e)} ${Ne(e.getUTCHours(),2)}:${Ne(e.getUTCMinutes(),2)}:${Ne(e.getUTCSeconds(),2)}`,ia=e=>`${Ne(e.getFullYear(),4)}-${Ne(e.getMonth()+1,2)}-${Ne(e.getDate(),2)} ${Ne(e.getHours(),2)}:${Ne(e.getMinutes(),2)}:${Ne(e.getSeconds(),2)}`,Ie=(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)},G=e=>e==null?"-":typeof e=="string"?Re(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var oe,er,Et=we(()=>{"use strict";oe=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":er(e);case"function":return er(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},er=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var Ot,fe,Dt=we(()=>{"use strict";Ot=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},fe=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var wo,Nn,la=we(()=>{"use strict";wo=(e,t)=>{let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r+=1){let s=[r];for(let a=1;a<=t.length;a+=1){let o=n[a-1]+(e[r-1]===t[a-1]?0:1);s.push(Math.min(n[a]+1,s[a-1]+1,o))}n=s}return n[t.length]},Nn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(a=>a.toLowerCase().startsWith(n));if(s!==void 0)return s}let r;for(let s of t){let a=wo(n,s.toLowerCase());a<=Math.max(1,Math.floor(s.length/4))&&(r===void 0||a<r.distance)&&(r={key:s,distance:a})}return r?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as tr,DIRECTORY_TREE_LABEL_KEYS as da,resolveDirectoryTreeLabels as No}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Mo,VIRTUAL_SCROLL_LABEL_KEYS as Po}from"@aiquants/virtualscroll";var Ro,j,yt,Mn,ar,Zt,qe,Lo,nr,rr,Eo,ca,Oo,Do,Wo,pa,ua,ma,bt=we(()=>{"use strict";ft();Et();Dt();la();Ro=Object.freeze({en:"en-US",ja:"ja-JP"}),j=(e,t)=>t.toLocaleString(Ro[e]),yt=(e,t,n)=>e==="1"?t:n,Mn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${j("en",e)} / ${j("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${j("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${j("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${j("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>yt(e,"record","records"),companyUnit:e=>yt(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=>yt(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",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=>j("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${j("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:sa,recordDate:wn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",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",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:ia,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=j("en",e);return`${n} ${yt(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: ${j("en",t)}`,timesUnit:e=>yt(e," time"," times"),itemsUnit:e=>yt(e," item"," items"),charactersUnit:e=>yt(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 (${j("ja",e)} / ${j("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${j("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${j("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${j("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",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=>`${j("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${j("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:sa,recordDate:wn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",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",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:ia,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})=>`${j("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: ${j("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),ar=Object.freeze(Object.keys(Mn.en)),Zt=Object.freeze([...da,...ar]),qe=Object.freeze({en:Object.freeze({...tr.en,...Mn.en}),ja:Object.freeze({...tr.ja,...Mn.ja})}),Lo=new Set(Zt),nr=Object.keys(qe).map(e=>JSON.stringify(e)).join(" or "),rr=Object.freeze({locale:"locale",labels:"labels"}),Eo=(e,t,n)=>{e[t]=n},ca=(e,t=rr.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${nr} or left out; got ${oe(e)}`);if(e!==void 0&&!Object.hasOwn(qe,e))throw new RangeError(`[contact-map] ${t} must be ${nr} or left out; got ${oe(e)}`);return Mo(e)},Oo=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${oe(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${oe(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${oe(n)}`)},Do=(e,t,n)=>{let r=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!Lo.has(s)){let o=Nn(s,Zt);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${o===void 0?"":`did you mean ${JSON.stringify(o)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${oe(s)}`)}let a=e[s];a!==void 0&&(Oo(n,s,a,t[s]),r[s]=a)}return r},Wo=e=>{let t={},n=!1;for(let r of da){let s=e[r];s!==void 0&&(t[r]=s,n=!0)}return n?t:void 0},pa=(e,t,n=rr)=>{let r=ca(e,n.locale);if(t===void 0)return qe[r];if(!Ot(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${oe(t)}`);let s=Do(t,qe[r],n.labels),o={...No(r,Wo(s)),...Mn[r]};for(let d of ar){let l=s[d];l!==void 0&&Eo(o,d,l)}return Object.freeze(o)},ua=e=>{let t={};for(let n of da)t[n]=e[n];return Object.freeze(t)},ma=e=>{let t={};for(let n of Po)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Ho}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as _o}from"@aiquants/virtualscroll";import{createContext as Ao,useContext as sr,useMemo as or,useRef as Io}from"react";import{jsx as zo}from"react/jsx-runtime";var Fo,ha,ga,ir,ye,q,ie=we(()=>{"use strict";bt();Fo=Object.freeze({locale:"en",labels:qe.en,treeLabels:ua(qe.en),engineLabels:ma(qe.en)}),ha=Ao(Fo),ga=(e,t)=>{let n=Io(null),r=n.current;return r!==null&&t.every(s=>r[s]===e[s])?r:(n.current=e,e)},ir=({locale:e,labels:t,surface:n,children:r})=>{let s=ca(e,n.locale),a=or(()=>pa(s,t,n),[s,t,n]),o=ga(a,Zt),d=ga(ua(o),Ho),l=ga(ma(o),_o),c=or(()=>({locale:s,labels:o,treeLabels:d,engineLabels:l}),[s,o,d,l]);return zo(ha.Provider,{value:c,children:r})},ye=()=>sr(ha),q=()=>sr(ha).labels});var Pn,ba=we(()=>{"use strict";Pn=e=>e.isComposing||e.keyCode===229});import $o from"lucide-react/dist/esm/icons/check.js";import Vo from"lucide-react/dist/esm/icons/copy.js";import Ko from"lucide-react/dist/esm/icons/x.js";import{useCallback as it,useEffect as Ca,useMemo as en,useRef as ka,useState as pr}from"react";import{createPortal as jo}from"react-dom";import{jsx as Q,jsxs as Le}from"react/jsx-runtime";var Go,dr,tn,_t,qo,Qo,Ht,xa,cr,va,Rn,Sa=we(()=>{"use strict";ft();ie();ba();Go=350,dr=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],tn=0,_t=null,qo=()=>{let e=document.body.style;tn+=1,tn===1&&(_t={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Qo=()=>{if(tn=Math.max(0,tn-1),tn>0||!_t)return;let e=document.body.style;e.userSelect=_t.userSelect,typeof _t.webkitUserSelect<"u"&&(e.webkitUserSelect=_t.webkitUserSelect),_t=null},Ht=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},xa=(e,t)=>{let n=new Set;return e.reduce((r,s)=>{let a=typeof s.value=="string"?s.value.trim():"";if(!a)return r;let{normalized:o,key:d,entry:l}=t(a,s);return o&&!n.has(d)&&(n.add(d),r.push(l(o))),r},[])},cr=(e,t)=>e===t,va=({value:e,ariaLabel:t,size:n="md"})=>{let[r,s]=pr(!1),a=ka(null),o=it(async p=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(p),!0}catch{}if(typeof document>"u")return!1;let i=document.createElement("textarea");i.value=p,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),i.setSelectionRange(0,i.value.length);let u=document.execCommand("copy");return document.body.removeChild(i),u},[]),d=it(async p=>{p.preventDefault(),p.stopPropagation(),a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null);let i=await o(e);s(i),i&&typeof window<"u"&&(a.current=window.setTimeout(()=>{s(!1),a.current=null},1500))},[o,e]);Ca(()=>()=>{a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null)},[]);let l=n==="sm"?"h-6 w-6":"h-7 w-7",c=n==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=r?$o:Vo;return Q("button",{type:"button",className:`inline-flex ${l} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:d,"aria-label":t,title:t,children:Q(m,{className:c,"aria-hidden":"true"})})},Rn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let s=q(),[a,o]=pr(null);Ca(()=>{o(document.body)},[]);let d=ka(null),l=ka(null),c=en(()=>e.contacted_at?Ie(e.contacted_at,s.recordDate):null,[e.contacted_at,s.recordDate]),m=Ht(e.full_name)??s.noName,p=Ht(e.company_name),i=Ht(e.department),u=Ht(e.title),f=en(()=>xa([{fieldKey:"company_name",label:s.fieldCompanyName,value:p},{fieldKey:"department",label:s.fieldDepartment,value:i},{fieldKey:"title",label:s.fieldTitle,value:u}],(h,{fieldKey:b,label:D})=>({normalized:h,key:`${b}-${h.toLowerCase()}`,entry:S=>({fieldKey:b,label:D,value:S})})),[p,i,u,s]),C=en(()=>xa([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(h,{fieldKey:b,label:D})=>{let S=Jt(h);return{normalized:Ht(h),key:(S??h).toLowerCase(),entry:w=>({fieldKey:b,label:D,value:w,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),v=en(()=>xa([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(h,{fieldKey:b,label:D})=>{let S=Ht(h),te=Ge(h,t),w=!!te?.startsWith("https://mail.google.com");return{normalized:S,key:h.toLowerCase(),entry:N=>({fieldKey:b,label:D,value:N,href:te,isGmailLink:w})}}),[e.custom_email,e.email,t,s]),k=C.length>0||v.length>0,I=en(()=>`contact-methods-${e.person_id}`,[e.person_id]),E=it(h=>{r(h),l.current=null},[r]),y=it(h=>{h.stopPropagation(),cr(h.target,h.currentTarget)&&E()},[E]),g=it(h=>{h.stopPropagation(),cr(h.target,h.currentTarget)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),E())},[E]),A=it(h=>{h.stopPropagation(),E()},[E]),B=it((h,b)=>{b.isGmailLink&&(h.preventDefault(),n(b.value))},[n]),x=it((h,b)=>{if(!b.isGmailLink){l.current=null;return}let D=Date.now(),S=l.current;if(S&&S.email===b.value&&D-S.timestamp<=Go){l.current=null,h.preventDefault(),n(b.value);return}l.current={email:b.value,timestamp:D}},[n]);return Ca(()=>{let h=[];if(typeof window<"u"){let b=D=>{if(D.key==="Escape"&&!Pn(D)){E();return}if(D.key==="Tab"&&d.current){let S=d.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(S.length===0)return;let te=S[0],w=S[S.length-1];D.shiftKey?document.activeElement===te&&(D.preventDefault(),w.focus()):document.activeElement===w&&(D.preventDefault(),te.focus())}};window.addEventListener("keydown",b),h.push(()=>window.removeEventListener("keydown",b))}if(typeof document<"u"){let b=d.current;if(b){let w=N=>{N.stopPropagation()};for(let N of dr)b.addEventListener(N,w);h.push(()=>{for(let N of dr)b.removeEventListener(N,w)})}let D=w=>{let N=d.current;return N&&w instanceof Node?N.contains(w):!1},S=w=>{D(w.target)||E({suppressLongPress:!0,cancelLongPressTimer:!0})},te=["pointerdown","wheel","touchmove"];for(let w of te)document.addEventListener(w,S,!0);h.push(()=>{for(let w of te)document.removeEventListener(w,S,!0)}),qo(),h.push(Qo)}return()=>{for(let b of h)b()}},[E,a]),a?jo(Q("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, 0px)",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":I,tabIndex:-1,onClick:y,onKeyDown:g,children:Le("div",{ref:d,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[Le("div",{className:"flex items-start justify-between gap-4",children:[Le("div",{children:[Q("h2",{id:I,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),f.length>0?Q("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:f.map(h=>Le("div",{className:"flex items-center gap-3",children:[Q("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.value}),Q(va,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]},h.fieldKey))}):null]}),Q("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:A,"aria-label":s.close,children:Q(Ko,{className:"h-4 w-4","aria-hidden":"true"})})]}),Le("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[C.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:C.map(h=>Q("li",{className:"flex items-start gap-3",children:Le("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),Le("div",{className:"mt-1 flex items-center gap-3",children:[Q("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.href?Q("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:h.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value})}),Q(va,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,v.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:v.map(h=>Q("li",{className:"flex items-start gap-3",children:Le("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),Le("div",{className:"mt-1 flex items-start gap-3",children:[Le("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[h.href?Q("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:h.isGmailLink?"_blank":void 0,rel:h.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:b=>B(b,h),onTouchEnd:b=>x(b,h),children:h.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value}),h.isGmailLink?Q("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:s.popupGmailHint}):null]}),Q(va,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,c?Le("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[Q("span",{className:"text-xs",children:s.popupLastContactDate}),Q("span",{children:c})]}):null,k?null:Q("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})}),a):null}});import{jsx as be,jsxs as nn}from"react/jsx-runtime";var Ln,Ta=we(()=>{"use strict";Ln=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:s="-",email:a="-",updatedAtText:o="-"})=>nn("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[nn("div",{className:"flex items-center gap-1 sm:hidden",children:[be("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),be("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),be("div",{className:"flex items-center gap-1 sm:hidden",children:be("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),be("div",{className:"block sm:hidden",children:be("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:r})}),nn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),nn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:r})]}),nn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),be("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:be("span",{className:"truncate",children:o})})]})});import{formatQuerySets as Yo,parseQuerySets as Xo}from"@aiquants/fuzzy-search";import{getNormalizedVariants as Jo,normalizeText as Zo,romajiToKatakana as es}from"@aiquants/select-box";var gr,ts,ns,as,rs,hr,fr,os,ss,is,ls,ds,cs,ps,us,yr,br,ur,mr,En,ms,gs,wa,xr,Na=we(()=>{"use strict";gr=/[]/g,ts=/^[\s ]+|[\s ]+$/g,ns=/\s+/,as=/^[\p{Script=Latin}\s]+$/u,rs=/\p{Script=Latin}/u,hr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),fr="union",os=65377,ss=65439,is=["\uFF9E","\uFF9F"],ls=(()=>{let e=new Map;for(let t=os;t<=ss;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of is){let s=(n+r).normalize("NFKC");s.length===1&&e.set(s,n+r)}}return e})(),ds=/[-ヿ]/u,cs=e=>{let t=Array.from(e,n=>ls.get(n)??n).join("");return ds.test(t)?null:t},ps=e=>Zo(e.replace(gr,"").replace(ts,""),hr),us=e=>{if(!as.test(e))return null;let t=es(e);return rs.test(t)?null:t},yr=e=>e.split(ns).filter(Boolean),br=e=>Xo(e,fr).sets.map(({query:t})=>t),ur=e=>br(e).flatMap(t=>yr(t)),mr=e=>Yo({combine:fr,sets:Array.from(new Set(e),t=>({query:t}))}),En=e=>{let t=br(e.replace(gr,"")).map(r=>yr(ps(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let s=us(r);if(s===null)return mr(t);n.push(s)}return mr(n)},ms=e=>{let t=new Set([...ur(e),...ur(En(e))]),n=new Set;for(let r of t)for(let s of Jo(r,hr)){let a=s.trim();if(!a)continue;n.add(a);let o=cs(a);o!==null&&n.add(o)}return Array.from(n)},gs=/[.*+?^${}()|[\]\\]/g,wa=e=>{let t=ms(e);if(t.length===0)return null;let n=t.map(r=>r.replace(gs,"\\$&")).sort((r,s)=>s.length-r.length);return new RegExp(n.join("|"),"gi")},xr=(e,t)=>{let n=wa(e);if(n===null)return s=>s;let r=s=>t.some(a=>{let o=s[a];return typeof o=="string"&&o.search(n)!==-1});return s=>{let a=[],o=[];for(let d of s)r(d.item)?a.push(d):o.push(d);return[...a,...o]}}});import{memo as hs}from"react";import{Fragment as Ma,jsx as On}from"react/jsx-runtime";var fs,pe,Dn=we(()=>{"use strict";Na();fs="rounded bg-yellow-200 px-1 text-gray-900 dark:bg-yellow-900 dark:text-yellow-100",pe=hs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return On(Ma,{children:e});let r=wa(t);if(r===null)return On(Ma,{children:e});let s=[],a=0,o=r.exec(e),d=0;for(;o;){let l=o[0],c=o.index;if(c>a&&s.push(e.substring(a,c)),l.length===0){r.lastIndex++,o=r.exec(e);continue}s.push(On("mark",{className:fs,children:l},`highlight-${c}-${d}`)),a=c+l.length,d+=1,o=r.exec(e)}return a<e.length&&s.push(e.substring(a)),On(Ma,{children:s})});pe.displayName="HighlightedText"});var Cr={};To(Cr,{ContactDetailGrid:()=>vr,default:()=>ys});import{useMemo as Pa}from"react";import{Fragment as bs,jsx as Ra,jsxs as xs}from"react/jsx-runtime";var Wn,vr,ys,kr=we(()=>{"use strict";ft();ie();Sa();Ta();Dn();Wn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},vr=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:s,isPopupVisible:a,onRequestClose:o})=>{let d=q(),l=Pa(()=>Rt(e),[e]),c=Pa(()=>Lt(e),[e]),m=l.value??"-",p=c.value??"-",i=Pa(()=>Ie(e.updated_at,d.recordDateTime),[e.updated_at,d.recordDateTime]),u=Wn(e.full_name)??d.noName,f=Wn(e.company_name),C=Wn(e.department),v=(k,I="-")=>Ra(pe,{text:k??I,query:t,enabled:n});return xs(bs,{children:[Ra(Ln,{fullName:v(u),title:v(Wn(e.title)),companyName:v(f),department:v(C),phoneNumber:p,email:v(m),updatedAtText:i}),a?Ra(Rn,{contactData:e,openEmailsWithGmail:r,openGmailCompose:s,onRequestClose:o}):null]})},ys=vr});ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Wt}from"@aiquants/fuzzy-search";import{memo as Bo,useId as lr}from"react";import{jsx as Fe,jsxs as Qe}from"react/jsx-runtime";var fa=Bo(({searchOptions:e,setSearchOptions:t})=>{let n=q(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=lr(),o=lr(),d=[];return d.push(Qe("div",{className:`${r} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[Qe("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),Fe("label",{htmlFor:a,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),Fe("input",{id:a,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||Wt.learningWeight,onChange:l=>t(c=>({...c,learningWeight:parseFloat(l.target.value)})),className:"w-full"}),Qe("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||Wt.learningWeight]}),Fe("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),d.push(Qe("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[Qe("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),Fe("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),Fe("input",{id:o,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??Wt.debounceMs,onChange:l=>t(c=>({...c,debounceMs:parseInt(l.target.value,10)})),className:"w-full"}),Qe("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs??Wt.debounceMs]}),Fe("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),Qe("section",{className:"space-y-3",children:[Qe("div",{className:"flex items-center justify-between gap-3",children:[Qe("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[Fe("span",{children:"\u26A1"}),Fe("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),Fe("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:Wt.learningWeight,debounceMs:Wt.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),Fe("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:d})]})});fa.displayName="AdvancedSearchSettings";ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as xt}from"@aiquants/fuzzy-search";import{memo as Uo,useId as ze}from"react";import{jsx as X,jsxs as Z}from"react/jsx-runtime";var ya=Uo(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})=>{let o=q(),d="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",c=ze(),m=ze(),p=ze(),i=ze(),u=ze(),f=ze(),C=ze(),v=ze(),k=ze(),I=ze(),E=[];return E.push(Z("div",{className:`${d} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[Z("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",o.basicThresholdHeading]}),X("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicThresholdLabel}),X("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??xt.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"w-full"}),Z("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[o.currentValueLabel," ",e.threshold??xt.threshold]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?o.basicThresholdRangeRelevance:o.basicThresholdRange})]},"threshold")),E.push(Z("div",{className:`${d} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[Z("div",{className:`${l} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",o.basicDisplayHeading]}),Z("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:m,type:"checkbox",checked:e.caseSensitive??xt.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),o.basicCaseSensitive]}),Z("label",{htmlFor:p,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:p,type:"checkbox",checked:n,onChange:y=>r(y.target.checked),className:"h-3 w-3"}),o.basicHighlight]}),Z("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:i,type:"checkbox",checked:s,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),o.basicOpenEmailsWithGmail]}),Z("div",{className:"flex flex-col gap-1",children:[X("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicMultiTermOperator}),Z("select",{id:u,value:e.multiTermOperator??xt.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"or",children:o.basicOperatorOr}),X("option",{value:"and",children:o.basicOperatorAnd})]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o.basicMultiTermHint})]})]},"display")),E.push(Z("div",{className:`${d} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[Z("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",o.basicSortHeading]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortBy}),Z("select",{id:f,value:e.sortBy||xt.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"score",children:o.basicSortByScore}),X("option",{value:"relevance",children:o.basicSortByRelevance}),X("option",{value:"original",children:o.basicSortByOriginal})]})]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortOrder}),Z("select",{id:C,value:e.sortOrder||xt.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"desc",children:o.basicSortDescending}),X("option",{value:"asc",children:o.basicSortAscending})]})]})]},"sorting")),E.push(Z("div",{className:`${d} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[Z("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",o.basicEngineHeading]}),X("label",{htmlFor:v,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicStrategy}),Z("select",{id:v,value:e.parallelSearchStrategy||xt.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"balanced",children:o.basicStrategyBalanced}),X("option",{value:"index-first",children:o.basicStrategyIndexFirst}),X("option",{value:"levenshtein-first",children:o.basicStrategyLevenshteinFirst})]}),Z("div",{className:"mt-2 space-y-2",children:[Z("label",{htmlFor:k,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:k,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),o.basicIndexFiltering]}),Z("label",{htmlFor:I,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:I,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),o.basicLevenshtein]})]})]},"engine")),Z("section",{className:"space-y-3",children:[Z("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[X("span",{children:"\u{1F527}"}),X("span",{className:"tracking-wide",children:o.settingsBasicTab})]}),X("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:E})]})});ya.displayName="BasicSearchSettings";ft();import ks from"lucide-react/dist/esm/icons/badge-check.js";import Ss from"lucide-react/dist/esm/icons/building-2.js";import Ts from"lucide-react/dist/esm/icons/calendar-clock.js";import ws from"lucide-react/dist/esm/icons/check.js";import Ns from"lucide-react/dist/esm/icons/copy.js";import Ms from"lucide-react/dist/esm/icons/id-card.js";import Ps from"lucide-react/dist/esm/icons/mail.js";import Rs from"lucide-react/dist/esm/icons/phone.js";import Ls from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as Es,useEffect as Os,useMemo as An,useRef as Ds,useState as Ws}from"react";var Be={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)};ie();import*as Ee from"@radix-ui/react-tabs";import*as Hn from"react";import{clsx as vs}from"clsx";import{twMerge as Cs}from"tailwind-merge";function vt(...e){return Cs(vs(e))}import{jsx as La}from"react/jsx-runtime";var _n=Ee.Root,an=Hn.forwardRef(({className:e,...t},n)=>La(Ee.List,{ref:n,className:vt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));an.displayName=Ee.List.displayName;var Ct=Hn.forwardRef(({className:e,...t},n)=>La(Ee.Trigger,{ref:n,className:vt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));Ct.displayName=Ee.Trigger.displayName;var kt=Hn.forwardRef(({className:e,...t},n)=>La(Ee.Content,{ref:n,className:vt("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));kt.displayName=Ee.Content.displayName;Dn();import{jsx as M,jsxs as de}from"react/jsx-runtime";var Sr={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Hs=({icon:e,label:t,value:n,fieldKey:r,copyValue:s,onCopy:a,isCopied:o,linkHref:d,searchTerm:l,enableHighlighting:c})=>{let m=q(),p=!!(a&&r&&s),i=d?.startsWith("https://mail.google.com")?"_blank":void 0;return de("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[de("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[M("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:M(e,{size:14})}),de("div",{className:"min-w-0 flex-1",children:[M("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),M("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:d?M("a",{href:d,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:i,rel:i?"noopener noreferrer":void 0,children:M(pe,{text:n,query:l??"",enabled:c})}):M(pe,{text:n,query:l??"",enabled:c})})]})]}),p?M("button",{type:"button",onClick:()=>a&&r&&s&&a(r,s,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:o?M(ws,{size:14}):M(Ns,{size:14})}):null]})},Tr=({items:e,searchTerm:t,enableHighlighting:n})=>M("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>de("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[M("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:r.label}),M("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:M(pe,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),Ea=({title:e})=>M("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),_s=()=>{let e=q();return de("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[M("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),M("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},lt=({contact:e,searchTerm:t,enableHighlighting:n,style:r,className:s=""})=>{let a=q(),[o,d]=Ws(null),l=Ds(null),c=An(()=>({...Sr,...r}),[r]);Os(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=An(()=>Rt(e),[e]),p=An(()=>Lt(e),[e]),i=An(()=>Ie(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),u=Es(async(x,h,b)=>{try{await navigator.clipboard.writeText(h),d(x),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(D){Be.error("Failed to copy contact detail",D)}},[]);if(!e)return M("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:Sr,children:M(_s,{})});let f=[G(e.title),G(e.department)].filter(x=>x!=="-"),C=[f.join(" / "),G(e.company_name)].filter(x=>x&&x!=="-").join(" \u30FB ")||"-",v=Re(e.full_name)??a.noName,k=[{fieldKey:"full_name",label:a.fieldFullName,value:v},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:G(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:G(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:G(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:G(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:G(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:G(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:G(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:G(e.url)}],I=[{label:a.fieldCustomEmail,value:G(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:G(e.email),fieldKey:"email",rawValue:e.email}].filter(x=>x.value!=="-"),E=[{label:a.fieldCustomMobilePhone,value:G(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:G(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:G(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:G(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(x=>x.value!=="-"),y=[{fieldKey:"person_id",label:"person_id",value:G(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:G(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:G(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:G(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:G(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:G(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:G(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:Ie(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:G(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:Ie(e.updated_at,a.recordDateTime)}],g=[{rowKey:"person_id",icon:Ms,label:"person_id",value:G(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Ps,label:a.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:Ge(m.value,!1)},{rowKey:"primary_phone",icon:Rs,label:a.summaryPhone,value:p.value??"-",fieldKey:"primary_phone",copyValue:p.value,linkHref:Jt(p.value)},{rowKey:"contacted_at",icon:Ts,label:a.summaryLastContact,value:i}],A=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:I,recommendedKey:m.fieldKey??null,resolveHref:x=>Ge(x!=null?String(x):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:E,recommendedKey:p.fieldKey??null,resolveHref:x=>Jt(x!=null?String(x):null)}],B=[{value:"summary",label:a.detailTabSummary,content:de("div",{className:"flex flex-col gap-4",children:[de("div",{className:"flex flex-col gap-1",children:[de("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[M(Ss,{size:16}),M("span",{children:M(pe,{text:G(e.company_name),query:t??"",enabled:n})})]}),f.length>0?M("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:f.map((x,h)=>de("span",{children:[h>0&&" / ",M(pe,{text:x,query:t??"",enabled:n})]},`header-line-${h}`))}):null]}),M("div",{className:"flex flex-col gap-3",children:g.map(x=>M(Hs,{icon:x.icon,label:x.label,value:x.value,fieldKey:x.fieldKey,copyValue:x.copyValue,onCopy:u,isCopied:x.fieldKey?o===x.fieldKey:!1,linkHref:x.linkHref,searchTerm:t,enableHighlighting:n},x.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:de("div",{className:"flex flex-col gap-3",children:[M(Ea,{title:a.detailBasicProfile}),M(Tr,{items:k,searchTerm:t,enableHighlighting:n})]})},{value:"contact",label:a.detailTabContact,content:M("div",{className:"flex flex-col gap-4",children:A.map(({sectionKey:x,title:h,emptyText:b,entries:D,recommendedKey:S,resolveHref:te})=>de("div",{className:"flex flex-col gap-2",children:[M(Ea,{title:h}),D.length===0?M("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:b}):M("div",{className:"flex flex-col gap-2",children:D.map(w=>{let N=te(w.rawValue),O=w.fieldKey===S;return de("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[de("div",{children:[M("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:w.label}),M("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:N?M("a",{href:N,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:M(pe,{text:w.value,query:t??"",enabled:n})}):M(pe,{text:w.value,query:t??"",enabled:n})})]}),O?de("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[M(ks,{size:14}),a.preferred]}):null]},w.fieldKey)})})]},x))})},{value:"meta",label:a.detailTabMeta,content:de("div",{className:"flex flex-col gap-3",children:[M(Ea,{title:a.detailTabMeta}),M(Tr,{items:y,searchTerm:t,enableHighlighting:n})]})}];return de("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${s}`.trim(),style:c,children:[M("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:de("div",{className:"flex items-center gap-2",children:[M("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:M(Ls,{size:16})}),de("div",{className:"min-w-0 flex-1",children:[M("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:M(pe,{text:v,query:t??"",enabled:n})}),M("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:M(pe,{text:C,query:t??"",enabled:n})})]})]})}),de(_n,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[M(an,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:B.map(x=>M(Ct,{value:x.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:x.label},x.value))}),B.map(x=>M(kt,{value:x.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:x.content},x.value))]})]})};bt();ie();import{memo as As}from"react";import{jsx as Ye,jsxs as In}from"react/jsx-runtime";var Oa=As(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:s,errorMessage:a,onRetry:o})=>{let{locale:d,labels:l}=ye(),c=j(d,e),m=j(d,t);return In("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[In("span",{className:"flex items-baseline gap-1",children:[Ye("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationTotalLabel}),Ye("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:c}),Ye("span",{className:"text-slate-600 dark:text-slate-300",children:l.recordUnit(c)})]}),In("span",{className:"flex items-baseline gap-1",children:[Ye("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationCompaniesLabel}),Ye("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),Ye("span",{className:"text-slate-600 dark:text-slate-300",children:l.companyUnit(m)})]}),n==="streaming"||n==="idle"?Ye("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?l.annotationStreamingProgress({loaded:r,total:s,percent:Math.min(100,Math.round(r/s*100))}):l.annotationStreamingCount(r)}):null,n==="retrying"?Ye("span",{"data-testid":"contact-map-reconnecting-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-2 py-0.5 font-medium text-amber-900 text-xs dark:bg-amber-900/30 dark:text-amber-200",children:l.annotationReconnecting(r)}):null,n==="failed"||n==="auth-required"?In("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?a??void 0:void 0,children:["\u26D4 ",n==="auth-required"?l.annotationAuthRequired:l.annotationLoadFailed(r),o?Ye("button",{type:"button","data-testid":"contact-map-retry-button",onClick:o,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:l.annotationRetry}):null]}):null]})});Oa.displayName="ContactMapAnnotation";Dt();import{useMemo as Co}from"react";Et();Dt();ie();import{createContext as Fs,useContext as zs,useMemo as Bs}from"react";Et();Dt();la();var Is=["indexWorker","levenshteinWorker","treeWorker"];function wr(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 ${oe(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${oe(n)}`)}}var Nr={setting:"workerUrls"},Mr=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=Is,hints:s={}}=t;if(!Ot(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${oe(e)}`);let a=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),o=a.find(({key:l,url:c})=>c!==void 0&&!r.includes(l));if(o!==void 0){let l=Object.hasOwn(s,o.key)?s[o.key]:void 0,c=l===void 0?Nn(o.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${l===void 0?"":`; ${l}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${oe(o.key)}`)}let d=Object.create(null);for(let{key:l,url:c}of a){let m=l;wr(n,m,c),c!==void 0&&(d[m]=c)}return d};function Sc(e,t=Nr){Mr(e,t)}function Pr(e){wr("workerUrls","treeWorker",e)}var At=(e,t,n=Nr)=>{let r=Mr(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 Da}from"react/jsx-runtime";var Rr=e=>{if(!Ot(e))throw new TypeError(`[contact-map] config must be a plain object; got ${oe(e)}`);let t=e;return{streamEndpoint:fe(t,"streamEndpoint"),openEmailsWithGmail:fe(t,"openEmailsWithGmail"),treeWorkerFactory:fe(t,"treeWorkerFactory"),workerUrls:At(void 0,fe(t,"workerUrls")),locale:fe(t,"locale"),labels:fe(t,"labels")}},Lr=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:s})}))},Us=Lr(Rr({})),Er=Fs(Us),$s=Object.freeze({locale:"locale",labels:"labels"});function Wa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:o,locale:d,labels:l}=Rr(e),{indexWorker:c,levenshteinWorker:m,treeWorker:p}=o,i=Bs(()=>Lr({streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:{indexWorker:c,levenshteinWorker:m,treeWorker:p},locale:d,labels:l}),[r,s,a,c,m,p,d,l]);return Da(Er.Provider,{value:i,children:Da(ir,{locale:d,labels:l,surface:t,children:n})})}function Vs({config:e,children:t}){return Da(Wa,{config:e,chromeSurface:$s,children:t})}function Xe(){return zs(Er)}import{useCallback as Ha,useEffect as Ys,useMemo as Bn,useSyncExternalStore as Or}from"react";Et();var Ks=1e3,js=3e4,Gs=6;function zn(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 ${oe(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${oe(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 ${oe(e)}`)}var qs=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}),Qs=e=>Array.isArray(e.records),Fn=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?.()};zn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ks,this.maxRetryDelayMs=t.maxRetryDelayMs??js,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Gs,this.logger=t.logger??Be}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 s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let 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,s="",a=!1,o=!1;for(;;){let{done:d,value:l}=await n.read();if(d)break;let c=r.decode(l,{stream:!0}),m=(s+c).split(`
|
|
2
|
-
`);s=m.pop()??"";let p=!1;for(let i of m){let u=i.trim();if(!u)continue;let f;try{f=JSON.parse(u)}catch(C){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",C);continue}if("type"in f&&f.type==="METADATA"){Number.isSafeInteger(f.total)&&f.total>=0&&this.setState({totalCount:f.total});continue}if(!Qs(f)){this.logger.warn("[ContactMapStream] server reported error:","error"in f?f.error:""),o=!0;continue}for(let C of f.records)C&&typeof C.person_id=="number"&&(this.recordMap.set(C.person_id,qs(C)),p=!0);f.nextCursor&&(this.lastCursor=f.nextCursor),f.isLast&&(a=!0)}p&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return o?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):a?"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 Oe=null,Xs=e=>{if(Oe!==null&&Oe.endpoint===e)return Oe;if(zn(e),Oe===null)return Oe=new Fn({endpoint:e}),Oe;if(Oe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Oe.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 Oe},Ic=()=>{Oe?.dispose(),Oe=null},Js=new Map,Zs={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},ei=()=>{let{streamEndpoint:e}=Xe();return Bn(()=>(zn(e),e),[e])};function ti(){let e=ei(),t=Ha(()=>Xs(e),[e]);Ys(()=>{let o=t();o.start(),o.retryNow()},[t]);let n=Ha(o=>t().subscribe(o),[t]),r=Or(n,()=>t().getState(),()=>Zs),s=Or(n,()=>t().getRecordMap(),()=>Js),a=Ha(()=>t().retryNow(),[t]);return Bn(()=>({...r,recordMap:s,retryNow:a}),[r,s,a])}var ni=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 Un(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:s,totalCount:a,error:o,retryNow:d}=ti(),l=Bn(()=>ni(e),[e]);return{context:Bn(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:s,companyCount:l,totalCount:a,errorMessage:o?.message??null}),[e,t,n,r,s,l,a,o]),retryNow:d}}ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ml,parseQuerySets as Pl}from"@aiquants/fuzzy-search";import{useFuzzySearch as Rl}from"@aiquants/fuzzy-search/react";import Ll from"lucide-react/dist/esm/icons/search.js";import{useCallback as Ut,useEffect as Ze,useMemo as ut,useRef as yo,useState as We,useTransition as El}from"react";import{useNavigation as Ol,useSearchParams as Dl}from"react-router";Na();Dt();import{useCallback as St,useEffect as ai,useRef as Dr}from"react";var dt=e=>{let t=Dr(null),n=Dr({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,s=St(p=>{let i=p.currentTarget,u=p.deltaY;!i||u===0||(p.preventDefault(),i.scrollBy({left:u,behavior:"smooth"}))},[]),a=St(p=>{t.current?.removeEventListener("wheel",s),t.current=p,p?.addEventListener("wheel",s,{passive:!1})},[s]);ai(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let o=St(p=>{if(p.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=p.clientX,i.scrollLeft=p.currentTarget.scrollLeft,i.pointerId=p.pointerId,i.hasCapture=!1,i.pointerType=p.pointerType},[]),d=St(p=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let u=p.currentTarget,f=p.clientX-i.startX;!i.isDragging&&Math.abs(f)>r&&(i.isDragging=!0,i.hasCapture||(u.setPointerCapture?.(p.pointerId),i.hasCapture=!0)),i.isDragging&&(p.preventDefault(),u.scrollLeft=i.scrollLeft-f)},[r]),l=St(p=>{let i=n.current;if(i.pointerType==="touch")return;let u=p.currentTarget;i.isPointerDown&&i.hasCapture&&u.hasPointerCapture?.(p.pointerId)&&u.releasePointerCapture(p.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),c=St(p=>{l(p)},[l]),m=St(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:a,onPointerDown:o,onPointerMove:d,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:m}};bt();ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ri}from"@aiquants/fuzzy-search";var $n=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=ri;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};import{jsx as Wr}from"react/jsx-runtime";function Hr({value:e,max:t=100,className:n,indicatorClassName:r,...s}){let a=e===void 0,o=a?0:Math.min(100,Math.max(0,e/t*100));return Wr("div",{role:"progressbar","aria-valuenow":a?void 0:o,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:vt("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:Wr("div",{"data-slot":"progress-indicator",className:vt("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",a&&"w-1/3 animate-progress-indeterminate",r),style:a?void 0:{width:`${o}%`}})})}var It="view";import{useCallback as ml,useState as gl}from"react";import{useSearchParams as hl}from"react-router";ie();ft();import{Panel as Ur,PanelGroup as bi,PanelResizeHandle as xi}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as vi,VirtualScroll as Ci}from"@aiquants/virtualscroll";import{lazy as ki,memo as Si,Suspense as Ti,useCallback as Je,useEffect as Kr,useLayoutEffect as jr,useMemo as ln,useRef as dn,useState as qn}from"react";var rn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},on={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Vn(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,s=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:s}}import{useCallback as oi,useEffect as si,useState as ii}from"react";var _r=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:s=240}=t??{},[a,o]=ii(600),d=oi(()=>{if(typeof window>"u")return;let l=e.current;if(!l||l.offsetParent===null&&window.getComputedStyle(l).position!=="fixed")return;let c=b=>Number.parseFloat(b)||0,{top:m}=l.getBoundingClientRect(),p=l.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),u=c(i.getPropertyValue("--footer-height")),f=c(i.getPropertyValue("--header-height")),C=c(i.getPropertyValue("--scrollbar-height")),v=window.getComputedStyle(l),k=c(v.marginBottom),I=c(v.paddingBottom),E=window.innerHeight-u-C-r,y=p?Math.min(p.bottom,E):E,g=p?Math.max(p.top,f):f,A=Math.max(m,g),B=y-A-k-I,x=Number.isFinite(B)?Math.floor(B):0,h=x>0?x:s;h>0&&Number.isFinite(h)&&o(b=>Math.abs(b-h)>1?h:b)},[r,e,s]);return si(()=>{if(typeof window>"u")return;let l=null,c=null,m=null,p=null,i=()=>{l!==null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{d()})};i(),c=window.setTimeout(()=>{i()},150);let u=e.current;return typeof ResizeObserver<"u"&&u&&(m=new ResizeObserver(()=>{i()}),m.observe(u),u.parentElement&&m.observe(u.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{i()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{l!==null&&window.cancelAnimationFrame(l),c!==null&&window.clearTimeout(c),m&&m.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",i)}},[e,n,d]),{viewportHeight:a,updateViewportHeight:d}};import{useCallback as ct,useEffect as Ar,useRef as sn,useState as Ir}from"react";var li=600,Fr=8,Kn=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[s,a]=Ir(!1),[o,d]=Ir(null),l=sn(null),c=sn(!1),m=sn(!1),p=sn(null),i=sn({onSelect:t,resolveItem:n,item:r});Ar(()=>{i.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let u=ct(()=>{typeof window>"u"||l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),f=ct(()=>{p.current&&(u(),m.current=!1,p.current=null)},[u]),C=ct(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(u(),m.current=!1,c.current=!1,p.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},l.current=window.setTimeout(()=>{let A=i.current,B=null;A.item!==void 0?B=A.item:A.resolveItem&&g.target&&(B=A.resolveItem(g.target)),B!==null&&(c.current=!0,A.onSelect?.(B),d(B),a(!0)),f()},li))},[u,f]),v=ct(g=>{p.current&&g.pointerId===p.current.pointerId&&(u(),p.current=null,m.current=!1)},[u]),k=ct(g=>{c.current&&(g.preventDefault(),g.stopPropagation(),c.current=!1)},[]),I=ct(g=>{if(!p.current||g.pointerId!==p.current.pointerId)return;let A=Math.abs(g.clientX-p.current.x),B=Math.abs(g.clientY-p.current.y);(A>Fr||B>Fr)&&(u(),p.current=null)},[u]),E=ct(g=>{(s||l.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),y=ct(g=>{g?.cancelLongPressTimer&&u(),g?.suppressLongPress&&(m.current=!0),a(!1),d(null),c.current=!1,p.current=null},[u]);return Ar(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let A=[["pointerdown",C,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",I,void 0],["pointerleave",v,void 0],["click",k,!0],["contextmenu",E,void 0]],B=[["contextmenu",E,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[x,h,b]of A)g.addEventListener(x,h,b);for(let[x,h,b]of B)window.addEventListener(x,h,b);return()=>{for(let[x,h,b]of A)g.removeEventListener(x,h,b);for(let[x,h,b]of B)window.removeEventListener(x,h,b);u()}},[e,C,v,I,k,E,u]),{isPopupVisible:s,popupItem:o,handleClosePopup:y}};import{useCallback as di,useEffect as ci,useState as zr,useSyncExternalStore as pi}from"react";function jn(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",s=pi(di(m=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(r);return p.addEventListener("change",m),()=>p.removeEventListener("change",m)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[a,o]=zr(!1),[d,l]=zr(0);return ci(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let m=e.current;if(!m)return;let p=new ResizeObserver(i=>{for(let u of i){if(u.target!==m)continue;let f=0;u.borderBoxSize&&u.borderBoxSize.length>0?f=u.borderBoxSize[0].inlineSize:f=u.contentRect.width,!(!Number.isFinite(f)||f<=0)&&(l(f),o(C=>C&&f>=t.expandThreshold?!1:!C&&f<t.collapseThreshold?!0:C))}});return p.observe(m),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!a,isContainerNarrow:a,isMediaMatches:s,containerWidth:d}}ie();ie();ba();import{useSwipeToDismissOverlay as ui,useTapClick as mi}from"@aiquants/swipe-overlay";import{useCallback as gi,useEffect as hi,useRef as fi}from"react";import{jsx as Br,jsxs as yi}from"react/jsx-runtime";var Gn=({isOpen:e,onClose:t,children:n,className:r="",title:s})=>{let a=q(),o=fi(null),{overlayRef:d,overlayStyle:l,attemptClose:c}=ui({isOpen:e,onClose:t,isCloseBlocked:gi(()=>!1,[]),skipWhenTextSelected:!0}),m=mi(()=>c());return hi(()=>{!e&&o.current?.contains(document.activeElement)&&document.activeElement.blur()},[e]),e?yi("div",{ref:o,"data-testid":"contact-map-mobile-overlay",className:`fixed top-0 bottom-0 left-0 z-50 flex touch-manipulation transition-[visibility] duration-200 ${e?"pointer-events-auto visible":"pointer-events-none invisible"}`,style:{right:"var(--aqcm-overlay-right, 0px)",transition:"right 0.5s, visibility 0.2s"},"aria-hidden":!e,children:[Br("button",{type:"button","aria-label":a.overlayBackdrop,className:`absolute inset-0 touch-manipulation bg-slate-900/50 transition-opacity duration-200 focus:outline-none ${e?"opacity-100":"opacity-0"}`,...m}),Br("aside",{role:"dialog","aria-modal":"true","aria-label":s===void 0?a.overlayTitle:s,style:l,ref:d,className:`relative ml-auto flex h-full w-full max-w-lg transform touch-pan-y flex-col bg-white shadow-xl transition-transform duration-200 ease-out dark:bg-slate-900 ${r}`,onKeyDown:p=>{p.key==="Escape"&&!Pn(p.nativeEvent)&&(p.stopPropagation(),c())},children:n})]}):null};Ta();import{Fragment as Ii,jsx as H,jsxs as Ce}from"react/jsx-runtime";var wi=ki(async()=>({default:(await Promise.resolve().then(()=>(kr(),Cr))).default})),Gr=64,$r="h-[64px]",Vr=240,Ni=4,_a=Vn(rn),Mi=rn.listPanelMinWidth,Pi=rn.detailPanelMinWidth,Ri=rn.handleThickness,xp=_a.collapseThreshold,vp=_a.expandThreshold,Li=({contactData:e})=>{let t=q(),n=Re(e?.full_name)??t.noName,r=Re(e?.title)??"-",s=Re(e?.company_name)??"-",a=Re(e?.department)??"-",o=Rt(e).value??"-",d=Lt(e).value??"-",l=Ie(e?.updated_at,t.recordDateTime);return H(Ln,{fullName:n,title:r,companyName:s,department:a,phoneNumber:d,email:o,updatedAtText:l})},Ei=e=>({"--contact-panel-height":`${e}px`}),Oi=e=>typeof e=="object"&&e!==null&&"item"in e,Di=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,Wi=(e,t)=>{for(let n of e){let r=Tn(n);if(r?.person_id===t)return r}return null},Aa=(e,t,n)=>{let{viewportHeight:r}=_r(t,{enableMutationObserver:!0,bottomGap:Ni,minFallbackHeight:Vr}),[s,a]=qn(0),o=Je(()=>{let p=n.current,i=t.current;if(!(p&&i))return;let u=p.getBoundingClientRect(),f=i.getBoundingClientRect(),C=Math.ceil(f.top-u.top);Number.isFinite(C)&&C>0&&a(v=>Math.abs(v-C)>1?C:v)},[t,n]);jr(()=>{if(!e)return;o();let p=requestAnimationFrame(o);return window.addEventListener("resize",o),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",o)}},[e,o]);let d=r>0?r:Vr,l=s>0?s:0,c=d+l,m=ln(()=>Ei(c),[c]);return{normalizedViewportHeight:d,normalizedDetailHeight:c,panelSizingStyle:m}},Hi=new Set,_i=()=>{let[e,t]=qn(Hi),n=Je((r,s)=>{t(a=>{if(a.has(r)===s)return a;let o=new Set(a);return s?o.add(r):o.delete(r),o})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Ai=(e,t,n)=>{let r=dn(n);jr(()=>{r.current=n},[n]),Kr(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},qr=Si(({entry:e,index:t,selectedPersonId:n,onSelect:r,searchQuery:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:d,onPopupVisibilityChange:l})=>{let c=q(),m=dn(null),p=H("div",{className:$r}),i=Oi(e)?e:null,u=Tn(e),{isPopupVisible:f,handleClosePopup:C}=Kn({ref:m,onSelect:r,item:u?.person_id});if(Ai(u?.person_id??null,f,l),!e||!u)return p;let{person_id:v}=u,k=n===v,I=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",y=k?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":I,g=["B","F"].map(A=>Di(A,A==="B"?i?.baseScore:i?.score)).filter(Boolean);return Ce("div",{ref:m,className:`flex ${$r} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${y}`,style:{height:Gr},role:"button","aria-pressed":k,"data-selected":k?"true":"false",onClick:()=>r(v),children:[Ce("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[H("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:c.listRowNumber(t+1)}),H("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:v}),H("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:g.length?g.map(A=>H("span",{children:A},A)):H("span",{children:"-"})})]}),H(Ti,{fallback:H(Li,{contactData:u}),children:H(wi,{contactData:u,searchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:d,isPopupVisible:f,onRequestClose:C})})]})});qr.displayName="ContactListRow";var Qr=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,isSearchTabActive:d}=e,{locale:l,labels:c,engineLabels:m}=ye(),p=dn(null),i=dn(null),[u,f]=qn(null),{normalizedViewportHeight:C,panelSizingStyle:v}=Aa(d,i,p),{isAnyPopupVisible:k,handlePopupVisibilityChange:I}=_i(),E=ln(()=>({enablePointerDrag:!k,enableKeyboardNavigation:!k}),[k]),y=ln(()=>s?n:t,[s,n,t]),g=Je(se=>{f(se)},[]),A=Je(se=>{if(!o)return;let Se=se.trim();if(!Se||Se==="-"||typeof window>"u")return;let mt=Ge(Se,!0);mt&&window.open(mt,"_blank","noopener,noreferrer")},[o]),[B,x]=qn(!1),h=Je(se=>{g(se),x(!0)},[g]),b=Je((se,Se)=>H(qr,{entry:se,index:Se,selectedPersonId:u,onSelect:h,searchQuery:r,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:A,onPopupVisibilityChange:I}),[u,h,r,a,o,A,I]),D=Je(se=>y[se],[y]),S=Je(se=>Tn(y[se])?.person_id??`row-${se}`,[y]),te=Je(()=>Gr,[]),w=y.length,N=ln(()=>({enabled:!0,renderVisual:vi}),[]),O=ln(()=>u===null?null:Wi(y,u),[u,y]);Kr(()=>{u!==null&&!O&&f(null)},[u,O]);let U=dn(null),{isTwoColumn:re}=jn(U,_a),ue=Ce("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[H("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:Ce("div",{className:"flex items-center",children:[Ce("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[H("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:c.columnNo}),H("span",{className:"leading-tight",children:c.columnId}),H("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Ce("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Ce("div",{className:"flex flex-col gap-0.5",children:[H("span",{children:c.columnName}),H("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnTitle})]}),Ce("div",{className:"flex flex-col gap-0.5",children:[H("span",{children:c.columnCompany}),H("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnDepartment})]}),Ce("div",{className:"flex flex-col gap-0.5",children:[H("span",{children:c.columnPhone}),H("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnEmail})]}),H("div",{className:"hidden items-end justify-end xl:flex",children:H("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnUpdatedAt})})]})]})}),H("div",{ref:i,className:"flex-1",children:H(Ci,{itemCount:w,getItemKey:S,behaviorOptions:E,getItem:D,getItemHeight:te,viewportSize:C,overscanCount:10,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:N},locale:l,labels:m,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(se,Se)=>b(se,Se)})}),n.length===0&&s?H("div",{className:"py-8 text-center",children:H("p",{className:"text-slate-600 dark:text-slate-300",children:c.listNoSearchResults})}):null,w===0&&!s?H("div",{className:"py-8 text-center",children:H("p",{className:"text-slate-600 dark:text-slate-300",children:c.listNoData})}):null]});return H("div",{ref:U,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:v,children:re?Ce(bi,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[H(Ur,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Mi,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ue}),H(xi,{id:"contact-map-list-handle",thickness:Ri,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":c.listResizeHandle}),H(Ur,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Pi,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:H(lt,{contact:O,searchTerm:r,enableHighlighting:a})})]}):Ce(Ii,{children:[ue,H("div",{className:"hidden","aria-hidden":"true",children:H(lt,{contact:O,searchTerm:r,enableHighlighting:a})}),O?H(Gn,{isOpen:B,onClose:()=>x(!1),className:"z-50 bg-white dark:bg-slate-900",children:Ce("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[Ce("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[H("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:c.detailHeading}),H("button",{type:"button",onClick:()=>x(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:c.close})]}),H("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:H(lt,{contact:O,searchTerm:r,enableHighlighting:a})})]})}):null]})})};ft();import{DirectoryTree as Qi}from"@aiquants/directory-tree";import{Panel as no,PanelGroup as Yi,PanelResizeHandle as Xi}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Ji}from"@aiquants/virtualscroll";import Zi from"@heroicons/react/24/solid/FolderMinusIcon.js";import el from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Ue,useEffect as wt,useMemo as De,useRef as Jn,useState as pt}from"react";import{createPortal as tl}from"react-dom";var Ia=(e,t)=>e&&e.trim()||t;import{useEffect as Fi,useRef as Qn,useState as zi}from"react";var Yr=(e,t=250)=>{let[n,r]=zi(e),s=Qn(null),a=Qn(e),o=Qn(null),d=Qn(!1);return Fi(()=>{if(!d.current){d.current=!0,r(e),a.current=e;return}a.current=n,s.current=null;let l=c=>{s.current??(s.current=c);let m=c-s.current,p=Math.min(1,Math.max(0,m/t)),i=1-(1-p)**3,u=Math.max(0,Math.round(a.current+(e-a.current)*i));r(u),p<1&&(o.current=requestAnimationFrame(l))};return o.current=requestAnimationFrame(l),()=>{o.current!==null&&cancelAnimationFrame(o.current)}},[e,t]),Math.max(0,n)};Et();import{useCallback as Fa,useEffect as za,useMemo as Xr,useRef as Bi,useSyncExternalStore as Ui}from"react";ie();var $i=250,Vi=4e3,Yn=3,Jr={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Zr=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Xn=class{constructor(t,{workerSource:n,logger:r=Be}){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>=Yn){this.logger.error(`[TreeWorker] the tree Worker failed ${Yn} times in a row; the tree stops updating until ${Jr[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min($i*2**(this.consecutiveFailures-1),Vi);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Yn})`,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 ${oe(n)}`);if(!Object.hasOwn(Jr,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${oe(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>=Yn||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||!Zr(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let s=this.workerNeedsReset,a=this.postedNaming===null||!Zr(this.postedNaming,n);if((this.workerNeedsReset||a||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 o=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:o}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},Ki=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)")},Tt=null,eo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),ji=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},Gi=e=>{if(Pr(e),Tt===null){let t=new Xn(()=>Ki(e),{workerSource:"workerUrls.treeWorker"});return Tt={session:t,workerUrl:e},t}if(Tt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${eo(Tt.workerUrl)} and cannot also load it from ${eo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Tt.session},Op=()=>{Tt?.session.reset(),Tt=null},qi={snapshot:null,isBuilding:!1};function to(e,t=!1){let n=Xe(),r=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:a}=ye(),o=a.uncategorizedCompany,d=a.noName,l=Xr(()=>({uncategorizedCompany:o,unnamedPerson:d}),[o,d]),c=Bi(r);za(()=>{c.current=r},[r]);let m=r!==void 0,p=m?void 0:s,i=Xr(()=>m?new Xn(()=>ji(c.current)(),{workerSource:"treeWorkerFactory"}):null,[m]),u=Fa(()=>i===null?Gi(p):i,[i,p]),f=Fa(v=>u().subscribe(v),[u]),C=Fa(()=>u().getState(),[u]);return za(()=>{let v=u();v.syncRecords(e,l),t&&v.finalize()},[u,e,t,l]),za(()=>{if(i!==null)return()=>i.stop()},[i]),Ui(f,C,()=>qi)}ie();Sa();Dn();import{Fragment as ul,jsx as _,jsxs as me}from"react/jsx-runtime";var $a=Vn(on),nl=on.listPanelMinWidth,al=on.detailPanelMinWidth,rl=on.handleThickness,tu=$a.collapseThreshold,nu=$a.expandThreshold,ol=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,s=Ia(e.full_name,t.noName),a=Ia(e.title,""),o=_(pe,{text:s,query:n,enabled:r});return a?me("span",{className:"flex items-center gap-1.5",children:[_("span",{children:o}),_("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:_(pe,{text:a,query:n,enabled:r})})]}):o},sl="contact-map-tree h-full w-full",il={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},Ba="h-4 w-4 shrink-0 transition-colors duration-150",ll=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Zn=null,ao=null,cn=new Map,ro="",oo=null,so=null,dl=(e,t,n,r,s)=>{let a=`${n?"icons":"plain"}#${r}#${s.noName}`;(a!==ro||s.formatDirectoryName!==oo||t!==so)&&(cn.clear(),ro=a,oo=s.formatDirectoryName,so=t);let o={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},d=new Set;for(let l of e){d.add(l.absolutePath);let c=`${l.name}\0${l.memberCount}`,m=cn.get(l.absolutePath);(!m||m.signature!==c)&&(m={signature:c,result:lo([l],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},cn.set(l.absolutePath,m));let p=m.result;p.entries.length>0&&o.entries.push(p.entries[0]);for(let[i,u]of p.personPathMap){let f=o.personPathMap.get(i);if(f)for(let C of u)f.add(C);else o.personPathMap.set(i,new Set(u))}for(let[i,u]of p.contactByPath)o.contactByPath.set(i,u);for(let[i,u]of p.ancestorsByPath)o.ancestorsByPath.set(i,u);o.totalCount+=p.totalCount,!o.firstPerson&&p.firstPerson&&(o.firstPerson=p.firstPerson)}for(let l of cn.keys())d.has(l)||cn.delete(l);return o},Ua=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",io=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...io(n.children)));return t},cl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},lo=(e,t,n,r,s)=>{let a=new Map,o=new Map,d=new Map,l=0,c=null,m=(i,u)=>{let f=[...u,i.absolutePath];d.set(i.absolutePath,f);let C,v,k=i.type==="directory"?r.formatDirectoryName(i.name,cl(i)):i.name,I=_(pe,{text:k,query:r.searchQuery,enabled:r.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let E=t.get(i.personId);if(E){o.set(i.absolutePath,E),a.has(i.personId)||a.set(i.personId,new Set);let y=a.get(i.personId);y&&y.add(i.absolutePath),l++,c||(c={personId:i.personId,path:i.absolutePath}),n&&(v=g=>{let A=Ua(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(A=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),_(n.person,{"aria-hidden":"true",className:`${Ba} ${A}`})},i.title&&(I=ol(E,r))),I=_("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:I})}}else if(i.children){let E=i.children.map(y=>m(y,f)).filter(y=>y!==null);if(s&&E.length===0)return null;if(C=E,n){let y=i.relativePath.startsWith("company:")?n.company:n.department;v=g=>_(y,{"aria-hidden":"true",className:`${Ba} ${Ua(g)}`})}}return{name:k,label:I,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:v,children:C}};return{entries:e.map(i=>m(i,[])).filter(i=>i!==null),personPathMap:a,contactByPath:o,ancestorsByPath:d,firstPerson:c,totalCount:l}},pl=(e,t,n)=>{let r=new Set,s=new Set,a=new Map;t.forEach((m,p)=>{a.set(m.item.person_id,p)});for(let m of t){let p=m.item.person_id,i=e.personPathMap.get(p);if(i)for(let u of i){r.add(u);let f=e.ancestorsByPath.get(u);if(f){for(let C of f)r.add(C);n&&f.length>0&&s.add(f[0])}}}let o=new Map,d=m=>{let p=o.get(m.absolutePath);if(p!==void 0)return p;let i=1/0;if(m.type==="file"){let u=e.contactByPath.get(m.absolutePath);u&&(i=a.get(u.person_id)??1/0)}else if(m.children)for(let u of m.children)i=Math.min(i,d(u));return o.set(m.absolutePath,i),i},l=(m,p=0)=>m.filter(i=>n&&p===0&&s.has(i.absolutePath)?!0:r.has(i.absolutePath)).map(i=>n&&p===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:l(i.children,p+1)}:i).sort((i,u)=>p===0?d(i)-d(u):0),c=l(e.entries);return{...e,entries:c}},co=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:s,hasSearchTerm:a,isSearchInProgress:o,isSearchTabActive:d}=e,{locale:l,labels:c,treeLabels:m}=ye(),p=c.noName,i=c.treeDirectoryName,u=De(()=>({noName:p,formatDirectoryName:i}),[p,i]),[f,C]=pt(null),[v,k]=pt(!1),{snapshot:I,isBuilding:E}=to(n,e.isStreamingComplete),y=I?.tree??null,g=I?.rebuildEpoch??0,A=De(()=>y?dl(y,r,f,g,u):null,[y,r,f,g,u]),B=De(()=>{if(!y)return null;if(!a)return A;let R;v||(R=new Set(s.map(Y=>Y.item.person_id)));let $=lo(y,r,f,{...u,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},R);return pl($,s,v)},[y,A,r,f,e.searchQuery,e.enableHighlighting,a,s,v,u]),x=De(()=>B||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[B]),h=a&&e.errorMessage!==null,[b,D]=pt(x),S=Jn(!1);wt(()=>{if(!(o||h)){S.current=!!y,D(x);return}!S.current&&y&&x.entries.length>0&&(S.current=!0,D(x))},[x,y,o,h]);let te=a&&(o||h)?b:x,{entries:w,personPathMap:N,contactByPath:O,totalCount:U}=te,re=De(()=>io(w),[w]),[ue,se]=pt(()=>ao??new Set),Se=Ue(R=>!ue.has(R),[ue]),mt=Ue(R=>{se($=>{let Y=new Set($);return Y.has(R)?Y.delete(R):Y.add(R),Y})},[]),Nt=Ue(R=>{R.length!==0&&se($=>{let Y=new Set($);for(let Te of R)Y.add(Te);return Y})},[]),un=Ue(R=>{se($=>{if($.size===0)return $;let Y=!1,Te=new Set($);for(let F of R)Te.delete(F)&&(Y=!0);return Y?Te:$})},[]);wt(()=>{ao=ue},[ue]),wt(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[le,Kt]=pt(null),[xe,et]=pt(null),[mn,Ke]=pt(!1),[ta,gn]=pt(!1),hn=Jn(null),jt=Jn(null),{normalizedViewportHeight:ne,panelSizingStyle:fn}=Aa(d,jt,hn),tt=Ue(R=>{let $=O.get(R);$&&(le!==$.person_id&&Kt($.person_id),R!==xe&&et(R),Ke(!0))},[O,xe,le]),Gt=Ue(R=>{tt(R.entry.absolutePath)},[tt]),nt=Ue(R=>R instanceof Element?R.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:ve,popupItem:qt,handleClosePopup:Qt}=Kn({ref:jt,resolveItem:nt,onSelect:tt}),He=Ue(R=>{if(!e.openEmailsWithGmail)return;let $=R.trim();if(!$||$==="-"||typeof window>"u")return;let Y=Ge($,!0);Y&&window.open(Y,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),at=qt?O.get(qt):null,_e=ve&&at!==null&&at!==void 0;wt(()=>{ve&&!at&&Qt()},[ve,at,Qt]);let gt=De(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Ji}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),rt=De(()=>ll(gt,ne,_e),[gt,ne,_e]);wt(()=>{let R=!1;return typeof window>"u"?()=>{R=!0}:Zn?(C(Zn),()=>{R=!0}):((async()=>{try{let[Y,Te,F,V]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(R)return;let ce=Y.default,Ae=Te.default,oa=F.default,Ja=V.default;ce&&Ae&&oa&&Ja&&(Zn={company:ce,department:Ae,title:oa,person:Ja},C(Zn))}catch(Y){Be.warn("Failed to load lucide icons",Y)}})(),()=>{R=!0})},[]);let ht=De(()=>{if(!f)return;let R=V=>ce=>_(V,{"aria-hidden":"true",className:`${Ba} ${Ua(ce)}`}),$={company:R(f.company),department:R(f.department),title:R(f.title)},Y=R(f.person),Te=V=>V in $,F=V=>{let[ce]=V.entry.relativePath.split(":",1);return(Te(ce)?$[ce]:$.company)(V)};return{directory:F,directoryExpanded:F,file:Y}},[f]),Mt=Ue(()=>{se(R=>R.size===0?R:new Set)},[]),na=Ue(()=>{re.length>0&&Nt(re)},[re,Nt]);wt(()=>{if(typeof window>"u")return;let R=document.documentElement,$=window.matchMedia("(prefers-color-scheme: dark)"),Y=()=>gn(R.classList.contains("dark")||$.matches);Y(),$.addEventListener("change",Y);let Te=new MutationObserver(Y);return Te.observe(R,{attributes:!0,attributeFilter:["class"]}),()=>{$.removeEventListener("change",Y),Te.disconnect()}},[]),wt(()=>{if(U===0){le!==null&&Kt(null),xe!==null&&et(null);return}if(le!==null){let R=N.get(le);if(R){if(xe&&R.has(xe))return;let $=R.values().next().value;$&&et($);return}}le!==null&&Kt(null),xe!==null&&et(null)},[U,le,xe,N]);let ot=xe?O.get(xe)??null:null,je=ta?"#475569":"#94A3B8",Yt=e.isStreamingComplete,aa=e.isStreamingFailed,yn=Yt&&n.length===0,bn=(E||!y)&&!yn,xn=Yr(U,250),st=y!==null||yn,Pt=me("div",{className:"flex items-center gap-1.5",children:[me("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:c.treeNodeCountTitle,children:[_("span",{className:"text-[10px]",children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",st?c.treeNodeCount(xn):"\u2026"]}),aa&&!Yt?me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:c.treeStreamInterruptedTitle,children:[_("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),_("span",{className:"text-[10px]",children:"\u26D4"})," ",c.treeStreamInterrupted]}):Yt?bn?me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:c.treeBuildingTitle,children:[me("span",{className:"relative flex h-1.5 w-1.5",children:[_("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),_("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),_("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",c.treeBuilding]}):me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:c.treeCompleteTitle,children:[_("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),_("span",{className:"text-[10px]",children:"\u2705"})," ",c.treeComplete]}):me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:c.treeStreamLoadingTitle,children:[me("span",{className:"relative flex h-1.5 w-1.5",children:[_("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),_("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),_("span",{className:"text-[10px]",children:"\u23F3"})," ",c.treeStreamLoading]}),a&&me("button",{type:"button",onClick:()=>k(!v),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${v?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:c.treeShowEntireCompanyTitle,children:[_("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),re.length>0?me("div",{className:"flex items-center gap-1",children:[_("button",{type:"button",onClick:Mt,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:_(el,{className:"h-3 w-3"})}),_("button",{type:"button",onClick:na,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:_(Zi,{className:"h-3 w-3"})})]}):null]}),vn=Jn(null),{isTwoColumn:Cn}=jn(vn,$a,{mediaQuery:"(min-width: 768px)"}),kn=De(()=>({toggle:mt,isExpanded:Se,expandMultiple:un,collapseMultiple:Nt,isPending:o}),[Nt,un,Se,mt,o]),Sn=De(()=>({onEntryClick:Gt,selectedPath:xe}),[Gt,xe]),ra=De(()=>({className:sl,lineColor:je,iconOverrides:ht,showDirectoryIcons:!!ht,showFileIcons:!!ht,highlightStyles:il,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[je,ht]),Xt=_("div",{ref:hn,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:_("div",{ref:jt,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:w.length>0?_(Qi,{entries:w,expansion:kn,selection:Sn,visual:ra,virtualScroll:rt,locale:l,labels:m}):_("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:a?c.treeNoMatches:c.treeEmpty})})});return me("div",{ref:vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:fn,children:[t&&tl(Pt,t),Cn?me(Yi,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[_(no,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:nl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Xt}),_(Xi,{id:"contact-map-tree-handle",thickness:rl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":c.treeResizeHandle}),_(no,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:al,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:_(lt,{contact:ot??null,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):me(ul,{children:[Xt,_("div",{className:"hidden","aria-hidden":"true",children:_(lt,{contact:ot,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}),mn&&ot?_(Gn,{isOpen:mn,onClose:()=>Ke(!1),className:"z-50 bg-white dark:bg-slate-900",children:me("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[me("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[_("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:c.detailHeading}),_("button",{type:"button",onClick:()=>Ke(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:c.close})]}),_("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:_(lt,{contact:ot,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]})}):null]}),_e&&at&&_(Rn,{contactData:at,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:He,onRequestClose:Qt})]})};import{jsx as pn,jsxs as Ft}from"react/jsx-runtime";var fl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},yl=e=>e==="tree"?"tree":"list",po=({context:e})=>{let t=q(),[n,r]=hl(),[s,a]=gl(null),o=yl(n.get(It)),{setScrollableRef:d,onPointerDown:l,onPointerMove:c,onPointerUp:m,onPointerLeave:p,onPointerCancel:i,onClickCapture:u}=dt(),f=ml(C=>{let v=C==="tree"?"tree":"list";if(v===o)return;let k=new URLSearchParams(typeof window<"u"?window.location.search:"");v==="list"?k.delete(It):k.set(It,v),r(k,{replace:!0})},[o,r]);return Ft("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[Ft("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[Ft("div",{ref:d,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:fl,onPointerDown:l,onPointerMove:c,onPointerUp:m,onPointerLeave:p,onPointerCancel:i,onClickCapture:u,children:[Ft("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>f("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),Ft("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>f("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),pn("div",{ref:a,className:"flex items-center gap-1.5"})]}),Ft("div",{className:"flex h-full flex-1 flex-col",children:[pn("div",{className:`${o==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="list"?pn(Qr,{context:e}):null}),pn("div",{className:`${o==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="tree"?pn(co,{context:e,controlsContainer:s}):null})]})]})};import{memo as vl}from"react";ie();ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as z}from"@aiquants/fuzzy-search";import{memo as bl,useId as ke}from"react";import{jsx as L,jsxs as W}from"react/jsx-runtime";var Va=1e3,Ka=bl(({searchOptions:e,setSearchOptions:t})=>{let n=q(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=ke(),d=ke(),l=ke(),c=ke(),m=ke(),p=ke(),i=ke(),u=ke(),f=ke(),C=ke(),v=ke(),k=[];k.push(W("div",{className:`${r} border-green-200 border-l-4 dark:border-green-400/60`,children:[W("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramSize}),L("input",{id:o,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||z.ngramSize,onChange:y=>t(g=>({...g,ngramSize:parseInt(y.target.value,10)})),className:"w-full"}),W("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||z.ngramSize]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramSizeHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinNgramOverlap}),L("input",{id:d,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||z.minNgramOverlap,onChange:y=>t(g=>({...g,minNgramOverlap:parseInt(y.target.value,10)})),className:"w-full"}),W("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||z.minNgramOverlap]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinNgramOverlapHint})]})]},"index-build")),k.push(W("div",{className:`${r} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[W("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexThreshold}),L("input",{id:l,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexThresholdHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramOverlapThreshold}),L("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),k.push(W("div",{className:`${r} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[W("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexStrategy}),W("select",{id:c,value:e.indexWorkerOptions?.strategy??z.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:y.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[L("option",{value:"fast",children:n.indexStrategyFast}),L("option",{value:"accurate",children:n.indexStrategyAccurate}),L("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexStrategyHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinCandidatesRatio}),L("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinCandidatesRatioHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMaxCandidatesRatio}),L("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),k.push(W("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[W("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexJaroWinklerPrefix}),L("input",{id:u,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexJaroWinklerPrefixHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),W("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[L("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:y.target.checked?void 0:Va}}))}),n.noLimit]}),L("input",{id:f,type:"range",min:Va,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Va:e.indexWorkerOptions.maxResults,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),W("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxResultsHint})]})]},"jaro")),k.push(W("div",{className:`${r} border-emerald-200 border-l-4 ${a?"":"opacity-50"} dark:border-emerald-400/60`,children:[W("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),L("input",{id:C,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),W("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexFieldWeightHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:v,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexPerfectMatchBonus}),L("input",{id:v,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),W("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexPerfectMatchBonusHint})]}),!a&&L("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:n.relevanceOnlyNotice})]},"relevance"));let I=ke(),E=ke();return k.push(W("div",{className:`${r} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[W("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:I,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentBase}),L("input",{id:I,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentBaseHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:E,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentCoverage}),L("input",{id:E,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"w-full"}),W("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentCoverageHint})]})]},"containment")),W("section",{className:"space-y-3",children:[W("div",{className:"flex items-center justify-between gap-3",children:[W("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[L("span",{children:"\u{1F4CA}"}),L("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),L("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:z.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:z.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:z.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:z.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:z.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:z.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:z.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:z.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:z.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:z.indexWorkerOptions?.strategy},ngramSize:z.ngramSize,minNgramOverlap:z.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),L("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:k})]})});Ka.displayName="IndexWorkerSettings";ie();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ge}from"@aiquants/fuzzy-search";import{memo as xl,useId as zt}from"react";import{jsx as ee,jsxs as ae}from"react/jsx-runtime";var ja=1e3,Ga=xl(({searchOptions:e,setSearchOptions:t})=>{let n=q(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=zt(),d=zt(),l=zt(),c=zt(),m=zt(),p=zt(),i=[];return i.push(ae("div",{className:`${r} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[ae("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinThreshold}),ee("input",{id:o,type:"range",min:"0.0",max:a?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??ge.levenshteinWorkerOptions?.threshold,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,threshold:parseFloat(u.target.value)}})),className:"w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??ge.levenshteinWorkerOptions?.threshold]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthSimilarity}),ee("input",{id:d,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ge.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(u.target.value)}})),className:"w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ge.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push(ae("div",{className:`${r} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[ae("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthPenalty}),ee("input",{id:l,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??ge.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(u.target.value)}})),className:"w-full"}),ae("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??ge.levenshteinWorkerOptions?.lengthDiffPenalty]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push(ae("div",{className:`${r} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[ae("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),ee("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),ae("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[ee("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:u.target.checked?void 0:ja}}))}),n.noLimit]}),ee("input",{id:c,type:"range",min:ja,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?ja:e.levenshteinWorkerOptions.maxResults,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:parseInt(u.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinMaxResultsHint})]},"max-results")),i.push(ae("div",{className:`${r} border-rose-200 border-l-4 ${a?"":"opacity-50"} dark:border-rose-400/60`,children:[ae("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),ee("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??ge.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(u.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??ge.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinFieldWeightHint})]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinPartialBonus}),ee("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??ge.levenshteinWorkerOptions?.partialMatchBonus,onChange:u=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,partialMatchBonus:parseFloat(u.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??ge.levenshteinWorkerOptions?.partialMatchBonus]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinPartialBonusHint})]}),!a&&ee("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:n.relevanceOnlyNotice})]},"relevance")),ae("section",{className:"space-y-3",children:[ae("div",{className:"flex items-center justify-between gap-3",children:[ae("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[ee("span",{children:"\u{1F4CF}"}),ee("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),ee("button",{type:"button",onClick:()=>t(u=>({...u,levenshteinWorkerOptions:{threshold:ge.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:ge.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:ge.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:ge.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:ge.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),ee("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});Ga.displayName="LevenshteinWorkerSettings";import{jsx as Ve,jsxs as $e}from"react/jsx-runtime";var Cl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},qa=vl(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a,activeTab:o,onTabChange:d})=>{let l=q(),{setScrollableRef:c,onPointerDown:m,onPointerMove:p,onPointerUp:i,onPointerLeave:u,onPointerCancel:f,onClickCapture:C}=dt();return $e("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[$e("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[$e("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",l.searchSettings]}),Ve("div",{className:"flex flex-wrap gap-1.5",children:$e("button",{type:"button",onClick:()=>t(v=>$n(v.workerUrls)),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:l.settingsResetAllTitle,children:["\u{1F504} ",l.settingsResetAll]})})]}),Ve("div",{className:"mb-0 shrink-0",children:$e("div",{ref:c,role:"tablist","aria-label":l.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:Cl,onPointerDown:m,onPointerMove:p,onPointerUp:i,onPointerLeave:u,onPointerCancel:f,onClickCapture:C,children:[$e("button",{type:"button",role:"tab","aria-selected":o==="basic",onClick:()=>d("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",l.settingsBasicTab]}),$e("button",{type:"button",role:"tab","aria-selected":o==="advanced",onClick:()=>d("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",l.settingsAdvancedTab]}),$e("button",{type:"button",role:"tab","aria-selected":o==="index",onClick:()=>d("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",l.indexWorkerName]}),$e("button",{type:"button",role:"tab","aria-selected":o==="levenshtein",onClick:()=>d("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",l.levenshteinWorkerName]})]})}),$e("div",{className:"flex flex-col gap-1",children:[Ve("div",{className:`${o==="basic"?"block":"hidden"}`,children:Ve(ya,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})}),Ve("div",{className:`${o==="advanced"?"block":"hidden"}`,children:Ve(fa,{searchOptions:e,setSearchOptions:t})}),Ve("div",{className:`${o==="index"?"block":"hidden"}`,children:Ve(Ka,{searchOptions:e,setSearchOptions:t})}),Ve("div",{className:`${o==="levenshtein"?"block":"hidden"}`,children:Ve(Ga,{searchOptions:e,setSearchOptions:t})})]})]})});qa.displayName="SearchOptionsPanel";import{memo as Tl,useCallback as wl}from"react";bt();ie();import{memo as kl}from"react";import{jsxs as Qa}from"react/jsx-runtime";var P=kl(({label:e,value:t,unit:n,color:r="text-gray-600 dark:text-slate-300"})=>Qa("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[Qa("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Qa("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));P.displayName="StatItem";bt();ie();import{memo as Sl}from"react";import{jsx as T,jsxs as K}from"react/jsx-runtime";var Bt=Sl(({kind:e,icon:t,stats:n,color:r})=>{let{locale:s,labels:a}=ye(),o=N=>j(s,N);if(!n)return T("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:a.statsNoData});let d=n.basic||{},l=n.workerSpecific||{},c=n.analysis||{},m=d.totalSearches??0,p=d.totalProcessingTime??0,i=d.averageSearchTime??0,u=d.lastSearchTime??0,f=d.errorCount??0,C=d.timestamp,v=c.fieldPerformance||{},k=c.performanceInsights||{},I=c.recentHistory||[],E=l.specificMetrics||{},y=l.operationCount??0,g=l.operationDistribution||{},A=e==="index",B=e==="levenshtein",x=A?a.indexWorkerName:a.levenshteinWorkerName,h=E,b=E,D="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",S="text-xs font-semibold transition-colors",te=N=>{if(!N)return;let O=new Date(N);return Number.isNaN(O.getTime())?void 0:a.statsTimestamp(O)},w=[];if(w.push(K("div",{className:`${D} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[K("div",{className:`${S} ${r}`,children:["\u{1F4CA} ",a.statsBasicHeading]}),T(P,{label:a.statTotalSearches,value:o(m),color:r}),T(P,{label:a.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:r}),T(P,{label:a.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:r}),T(P,{label:a.statLastSearchTime,value:u.toFixed(2),unit:"ms",color:r}),T(P,{label:a.statErrorCount,value:f,color:f>0?"text-red-600 dark:text-red-400":r}),te(C)&&T(P,{label:a.statUpdatedAt,value:te(C),color:"text-gray-500 dark:text-slate-400"})]},"basic")),y>0||Object.keys(g).length>0){let N=Object.entries(g).sort(([,O],[,U])=>(Number(U)||0)-(Number(O)||0)).slice(0,6);w.push(K("div",{className:`${D} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[K("div",{className:`${S} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",a.statsOperationsHeading]}),T(P,{label:a.statTotalOperations,value:o(y),color:"text-amber-700 dark:text-amber-300"}),N.length>0&&T("div",{className:"mt-1 space-y-1",children:N.map(([O,U])=>T(P,{label:O,value:o(Number(U)),unit:a.timesUnit(o(Number(U))),color:"text-amber-700 dark:text-amber-300"},O))})]},"operations"))}if(A&&(w.push(K("div",{className:`${D} border-green-200 border-l-4 dark:border-green-400/60`,children:[K("div",{className:`${S} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",a.statsIndexHeading]}),T(P,{label:a.statIndexBuilds,value:o(h.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),T(P,{label:a.statDataSize,value:o(h.currentDataSize??0),unit:a.itemsUnit(o(h.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),T(P,{label:a.statLastBuildTime,value:(h.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),h.cacheSize&&w.push(K("div",{className:`${D} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[K("div",{className:`${S} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",a.statsCacheHeading]}),T(P,{label:a.statCacheNgram,value:o(h.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),T(P,{label:a.statCacheWord,value:o(h.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),T(P,{label:a.statCachePhonetic,value:o(h.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),h.indexMetadata)){let N=Object.entries(h.indexMetadata).slice(0,6);N.length>0&&w.push(K("div",{className:`${D} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[K("div",{className:`${S} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",a.statsIndexMetadataHeading]}),N.map(([O,U])=>{let re;if(typeof U=="number"){let ue=O.toLowerCase();ue.includes("time")&&!ue.includes("timestamp")?re=`${U.toFixed(2)}ms`:ue.includes("timestamp")||ue.includes("at")?re=te(U)??U.toString():re=o(U)}else re=String(U);return T(P,{label:O,value:re,color:"text-teal-700 dark:text-teal-300"},O)})]},"index-meta"))}if(B){if(w.push(K("div",{className:`${D} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[K("div",{className:`${S} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",a.statsCalculationsHeading]}),T(P,{label:a.statTotalCalculations,value:o(b.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statDistanceCalculations,value:o(b.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statAverageDistance,value:typeof b.averageDistance=="number"?b.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statMinDistance,value:b.minDistance??a.notAvailable,color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statMaxDistance,value:b.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),w.push(K("div",{className:`${D} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[K("div",{className:`${S} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",a.statsMatchesHeading]}),T(P,{label:a.statPartialMatches,value:o(b.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),T(P,{label:a.statPerfectMatches,value:o(b.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),T(P,{label:a.statEarlyTerminations,value:o(b.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),b.similarityThresholds&&w.push(K("div",{className:`${D} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[K("div",{className:`${S} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",a.statsSimilarityHeading]}),T(P,{label:a.statAbove80,value:o(b.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),T(P,{label:a.statAbove60,value:o(b.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),T(P,{label:a.statAbove40,value:o(b.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),T(P,{label:a.statBelow40,value:o(b.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),b.distanceDistribution){let N=Object.entries(b.distanceDistribution).sort(([,O],[,U])=>Number(U)-Number(O)).slice(0,6);N.length>0&&w.push(K("div",{className:`${D} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[K("div",{className:`${S} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",a.statsDistanceHeading]}),N.map(([O,U])=>T(P,{label:a.statDistance(O),value:o(Number(U)),unit:a.timesUnit(o(Number(U))),color:"text-indigo-700 dark:text-indigo-300"},O))]},"lev-distance"))}if(b.queryLengthStats){let N=Object.entries(b.queryLengthStats).sort(([,O],[,U])=>(U.count??0)-(O.count??0)).slice(0,6);N.length>0&&w.push(K("div",{className:`${D} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[K("div",{className:`${S} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",a.statsQueryLengthHeading]}),N.map(([O,U])=>{let re=Number(U.count??0),ue=Number(U.averageScore??0);return T(P,{label:a.statQueryLength(O),value:a.statQueryLengthValue({count:re,averagePercent:(ue*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},O)})]},"lev-query-length"))}}if(Object.keys(v).length>0){let N=Object.entries(v).sort(([,O],[,U])=>(U.averageScore??0)-(O.averageScore??0)).slice(0,6);w.push(K("div",{className:`${D} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[K("div",{className:`${S} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",a.statsFieldPerformanceHeading]}),N.map(([O,U])=>{let re=U;return K("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[T("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:O}),T(P,{label:a.statAverageScore,value:`${((re.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statMatchCount,value:o(re.matchCount??0),unit:a.itemsUnit(o(re.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),T(P,{label:a.statBestWorstScore,value:`${((re.bestScore??0)*100).toFixed(1)}% / ${((re.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},O)})]},"field-performance"))}if(k.bestPerformingField||k.totalHistoryEntries||k.similarityDistribution){let N=(k.recentAverageResultCount??0).toFixed(1);w.push(K("div",{className:`${D} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[K("div",{className:`${S} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",a.statsInsightsHeading]}),k.bestPerformingField&&T(P,{label:a.statBestField,value:k.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),T(P,{label:a.statRecentAverageTime,value:(k.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),T(P,{label:a.statRecentAverageResults,value:N,unit:a.itemsUnit(N),color:"text-blue-700 dark:text-blue-300"}),T(P,{label:a.statThroughput,value:(k.throughputPerSecond??0).toFixed(2),unit:a.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),T(P,{label:a.statCommonQueryLength,value:o(k.mostCommonQueryLength??0),unit:a.charactersUnit(o(k.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),T(P,{label:a.statHistoryEntries,value:o(k.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),k.similarityDistribution&&K("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[T(P,{label:a.statHighSimilarity,value:o(k.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),T(P,{label:a.statMediumSimilarity,value:o(k.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),T(P,{label:a.statLowSimilarity,value:o(k.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),T(P,{label:a.statVeryLowSimilarity,value:o(k.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return I.length>0&&w.push(K("div",{className:`${D} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[K("div",{className:`${S} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",a.statsRecentHistoryHeading]}),I.slice(-3).reverse().map((N,O)=>K("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[T("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:N.operationType}),T("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:a.statsHistoryEntry({processingTimeMs:N.processingTime.toFixed(2),resultCount:N.resultCount??0})}),te(N.timestamp)&&T("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:te(N.timestamp)})]},`${N.operationType}-${N.timestamp??O}`))]},"recent-history")),K("section",{className:"space-y-2",children:[K("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[T("span",{children:t}),T("span",{className:"tracking-wide",children:x})]}),T("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:w})]})});Bt.displayName="WorkerStatsSection";import{jsx as Pe,jsxs as Me}from"react/jsx-runtime";var Nl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ya=Tl(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:s,rebuildIndex:a,isIndexBuilding:o,activeTab:d,onTabChange:l})=>{let{locale:c,labels:m}=ye(),p=t.trim(),i=p?r:n,{setScrollableRef:u,onPointerDown:f,onPointerMove:C,onPointerUp:v,onPointerLeave:k,onPointerCancel:I,onClickCapture:E}=dt(),y=d!=="index"||o,g=o?m.statsRebuildingTitle:d!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,A=y?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",B=o?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`,x=wl(()=>{a().catch(()=>{})},[a]);return Me("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[Me("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[Me("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",m.searchStatistics]}),Me("div",{className:"flex flex-wrap gap-1.5",children:[Pe("button",{type:"button",onClick:x,disabled:y,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${A}`,title:g,children:B}),Me("button",{type:"button",onClick:s,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),Pe("div",{className:"mb-0 shrink-0",children:Me("div",{ref:u,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:Nl,onPointerDown:f,onPointerMove:C,onPointerUp:v,onPointerLeave:k,onPointerCancel:I,onClickCapture:E,children:[Me("button",{type:"button",onClick:()=>l("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),Me("button",{type:"button",onClick:()=>l("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",m.statsIndexTab]}),Me("button",{type:"button",onClick:()=>l("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),Me("div",{className:"flex flex-col gap-1 pb-0.5",children:[Me("div",{className:`${d==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[Pe(P,{label:m.statTotalSearches,value:j(c,e.totalSearches)}),Pe(P,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Pe(P,{label:m.statDataCount,value:j(c,e.itemCount)}),Pe(P,{label:p?m.statResultCount:m.statDisplayedCount,value:j(c,i)})]}),Pe("div",{className:`${d==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:Pe(Bt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),Pe("div",{className:`${d==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:Pe(Bt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),Me("div",{className:"hidden",children:[Pe(Bt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),Pe(Bt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});Ya.displayName="StatisticsPanel";import{Fragment as fo,jsx as J,jsxs as he}from"react/jsx-runtime";var Wl=/[\u200B\uFEFF]/g,Xa=typeof window<"u",bo=Xa&&typeof document<"u",ea=(e,t=[],n=!1)=>{let r=yo(e);r.current=e,Ze(()=>{if(!(!Xa||n&&!bo))return r.current()},[n,...t])},uo=(e,t,n)=>{let[r,s]=We(()=>{let a=mo(o=>o.getItem(e));return a&&t.includes(a)?a:n});return ea(()=>{mo(a=>{a.setItem(e,r)})},[e,r]),[r,s]},mo=e=>{if(!Xa)return null;try{return e(window.sessionStorage)}catch{return null}},go=(e,t)=>{let[n,r]=We(e);return Ze(()=>{let s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},Hl="contact-map.settings-tab",_l="contact-map.statistics-tab",Al=["basic","advanced","index","levenshtein"],Il=["overview","index","levenshtein"],ho=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Fl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},xo=({streamState:e,...t}={})=>e===void 0?J(zl,{...t}):J(vo,{...t,streamState:e}),zl=e=>{let{context:t}=Un();return J(vo,{...e,streamState:t})},Bl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},vo=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,s=fe(e,"workerUrls"),a=Xe(),{locale:o,labels:d}=ye(),{contactMapRecords:l,contactMapRecordMap:c,isStreamingComplete:m,isStreamingFailed:p}=t,i=Ol(),[u]=Dl(),f=yo(null),[C,v]=We(!0),[k,I]=We(a.openEmailsWithGmail??!1),{indexWorker:E,levenshteinWorker:y}=At(a.workerUrls,s,Bl),[g,A]=We(()=>$n({indexWorker:E,levenshteinWorker:y})),[B,x]=We(u.get("q")||""),h=go(B,g.debounceMs??Ml.debounceMs);Ze(()=>{let F=u.get("q")||"";x(V=>V!==F?F:V)},[u]),Ze(()=>{if(typeof window>"u")return;let F=new URL(window.location.href);(F.searchParams.get("q")||"")!==h&&(h?F.searchParams.set("q",h):F.searchParams.delete("q"),window.history.replaceState(window.history.state,"",F.toString()))},[h]);let[b,D]=El(),[S,te]=We("search"),[w,N]=uo(Hl,Al,"basic"),[O,U]=uo(_l,Il,"overview"),{setScrollableRef:re,onPointerDown:ue,onPointerMove:se,onPointerUp:Se,onPointerLeave:mt,onPointerCancel:Nt,onClickCapture:un}=dt(),le=Ut(()=>{if(!bo)return;let F=f.current;!F||document.activeElement===F||window.requestAnimationFrame(()=>{try{F.focus({preventScroll:!0})}catch{}})},[]),Kt=Ut(F=>{let V=F;te(V),V==="search"&&le()},[le]),xe=ut(()=>({...g,debounceMs:0}),[g]),[et,mn]=We("union"),Ke=et==="intersection",ta=Ke?d.operatorAndTitle:d.operatorOrTitle,gn=Ut(F=>Pl(F,et),[et]),hn=ut(()=>({querySetsOf:gn}),[gn]),jt=go(l,m?0:800),{searchTerm:ne,setSearchTerm:fn,filteredItems:tt,resultTerm:Gt,isSearching:nt,isIndexBuilding:ve,clearSearch:qt,resetStats:Qt,performanceMetrics:He,rebuildIndex:at,error:_e}=Rl(jt,ho,xe,hn),gt=ne.trim().length>0,[rt,ht]=We(""),[Mt,na]=We(()=>ne),ot=ut(()=>En(B),[B]),je=ut(()=>En(h),[h]);Ze(()=>{h===rt&&je===ne||D(()=>{ht(h),fn(je)})},[h,rt,je,ne,fn]);let Yt=Ut(F=>{let ce=F.target.value.replace(Wl,"");x(ce)},[]),aa=Ut(()=>{x(""),ht(""),qt(),le()},[qt,le]),yn=Ut(()=>{mn(F=>F==="intersection"?"union":"intersection"),le()},[le]);ea(()=>{if(!(S==="search"&&i.state==="idle"&&!b))return;let V=document.activeElement;if(!!!(V?.matches('[role="tab"]')||V?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&V&&V!==document.body&&V!==f.current)return;let Ae=window.requestAnimationFrame(()=>{le()});return()=>{window.cancelAnimationFrame(Ae)}},[S,i.state,b,le],!0),ea(()=>{if(S!=="search")return;let F=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&le()}],[window,"pageshow",()=>{le()}]];for(let[V,ce,Ae]of F)V.addEventListener(ce,Ae);return()=>{for(let[V,ce,Ae]of F)V.removeEventListener(ce,Ae)}},[S,le],!0),Ze(()=>(n&&n(S==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[S,n]),ea(()=>{let F=document.body,V=F.style.overflow;return S==="search"&&(F.style.overflow="hidden"),()=>{F.style.overflow=V}},[S],!0),Ze(()=>{He&&Be.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:He.totalSearches,averageSearchTime:He.averageSearchTime,itemCount:He.itemCount,resultsCount:He.resultsCount,workersAvailable:!!He.workerStats})},[He]);let{isAwaitingDebounce:bn,isAwaitingSearchTermSync:xn,isSearchInProgress:st}=ut(()=>{let F=ot!==je,V=je!==ne,ce=ne.trim().length>0||ot.trim().length>0;return{isAwaitingDebounce:F,isAwaitingSearchTermSync:V,isSearchInProgress:b||nt||Gt!==ne&&_e===null||ce&&ve||F||V||Mt!==ne}},[ot,je,ne,Gt,_e,b,nt,ve,Mt]),[Pt,vn]=We(ne);Ze(()=>{Pt!==ne&&vn(ne)},[ne,Pt]),Ze(()=>{bn||xn||b||nt||ve||Pt===ne&&Mt!==ne&&na(ne)},[ne,Mt,bn,xn,b,nt,ve,Pt]);let Cn=ut(()=>xr(rt,ho),[rt]),kn=ut(()=>Cn(tt),[Cn,tt]),Sn=ut(()=>({contactMapRecords:l,contactMapRecordMap:c,filteredItems:kn,searchQuery:rt,searchTerm:ne,isSearching:nt,isIndexBuilding:ve,isPending:b,hasSearchTerm:gt,enableHighlighting:C,openEmailsWithGmail:k,isSearchInProgress:st,isSearchTabActive:S==="search",errorMessage:_e??null,isStreamingComplete:m,isStreamingFailed:p}),[l,c,kn,rt,ne,nt,ve,b,gt,C,k,st,S,_e,m,p]),ra=gt?tt.length:l.length,Xt=j(o,l.length),R=j(o,tt.length);return J("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${S==="search"?" h-full min-h-0":""}`,children:he(_n,{value:S,onValueChange:Kt,className:`flex flex-col${S==="search"?" h-full min-h-0":""}`,children:[he(an,{ref:re,style:Fl,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:ue,onPointerMove:se,onPointerUp:Se,onPointerLeave:mt,onPointerCancel:Nt,onClickCapture:un,children:[he(Ct,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",d.searchTab]}),he(Ct,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",d.searchSettings]}),he(Ct,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",d.searchStatistics]})]}),J(kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:he("div",{className:"flex h-full flex-col",children:[J("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:he("div",{className:"flex flex-col",children:[J("div",{className:"relative",children:he("div",{className:"flex items-center gap-1 p-1",children:[he("button",{type:"button",onClick:yn,"aria-pressed":Ke,title:ta,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${Ke?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[J("span",{className:"text-[10px] sm:text-xs",children:Ke?d.operatorAnd:d.operatorOr}),J("span",{className:"hidden text-[10px] sm:inline",children:Ke?d.operatorAndHint:d.operatorOrHint})]}),J("input",{ref:f,type:"text",value:B,onChange:Yt,placeholder:d.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),B&&J("button",{type:"button",onClick:aa,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:st?d.searchBusyTitle:d.clearSearch,disabled:st,children:st?he(fo,{children:[J(Ll,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),J("span",{className:"hidden sm:inline",children:d.searching})]}):"\u2715"})]})}),he("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[d.registeredCountLabel," ",J("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Xt})," ",d.recordUnit(Xt),ve?he("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",d.rebuildingIndex]}):null,_e?he("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",d.errorLabel,J("span",{className:"ml-1 break-all font-semibold",children:_e})]}):null,gt&&he("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",d.resultCountLabel,st?J("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:d.searching}):he(fo,{children:[J("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:R}),J("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:d.resultUnit(R)})]})]})]}),J("div",{className:"h-2.5 px-2 pb-1.5",children:ve?J(Hr,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),r?r(Sn):J(po,{context:Sn})]})}),J(kt,{value:"settings",className:"mt-0",children:J(qa,{searchOptions:g,setSearchOptions:A,enableHighlighting:C,setEnableHighlighting:v,openEmailsWithGmail:k,setOpenEmailsWithGmail:I,activeTab:w,onTabChange:N})}),J(kt,{value:"statistics",className:"mt-0",children:J(Ya,{performanceMetrics:He,searchTerm:ne,totalDataCount:l.length,resultsCount:ra,resetStats:Qt,rebuildIndex:at,isIndexBuilding:ve,activeTab:O,onTabChange:U})})]})})};import{jsx as Vt,jsxs as ko}from"react/jsx-runtime";var Ul=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=q(),s=t===void 0?r.appTitle:t,{context:a,retryNow:o}=Un(),d=Vt(Oa,{recordCount:a.contactMapRecords.length,companyCount:a.companyCount,phase:a.streamPhase,loadedCount:a.loadedCount,totalCount:a.totalCount,errorMessage:a.errorMessage,onRetry:o});return ko("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:d}):ko("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[Vt("h1",{className:"font-bold text-xl",children:s}),d]}),Vt("div",{className:"min-h-0 flex-1",children:Vt(xo,{streamState:a,onFooterVisibilityChange:n})})]})},Mm=e=>{let t=Xe(),n=fe(e,"streamEndpoint"),r=fe(e,"workerUrls"),s=fe(e,"locale"),a=fe(e,"labels"),o=Co(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:At(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:a===void 0?t.labels:a}),[t,n,r,s,a]),d=s!==void 0,l=a!==void 0,c=Co(()=>({locale:d?"ContactMapAppView locale":"locale",labels:l?"ContactMapAppView labels":"labels"}),[d,l]);return Vt(Wa,{config:o,chromeSurface:c,children:Vt(Ul,{...e})})};bt();ie();import{createShouldRevalidate as $l}from"@aiquants/route-revalidation";var Om=$l({submissions:"url",query:{ignore:[It,"q"]}});export{fa as AdvancedSearchSettings,ya as BasicSearchSettings,qe as CONTACT_MAP_LABEL_CATALOGS,Zt as CONTACT_MAP_LABEL_KEYS,vr as ContactDetailGrid,lt as ContactDetailPanel,Rn as ContactDetailPopup,Ln as ContactDetailRowLayout,Oa as ContactMapAnnotation,Mm as ContactMapAppView,Vs as ContactMapConfigProvider,Qr as ContactMapSearchListView,xo as ContactMapSearchPage,po as ContactMapSearchTabGroup,co as ContactMapSearchTreeView,Fn as ContactMapStreamClient,pe as HighlightedText,Ka as IndexWorkerSettings,xp as LIST_COLLAPSE_THRESHOLD,Pi as LIST_DETAIL_PANEL_MIN_WIDTH,vp as LIST_EXPAND_THRESHOLD,Mi as LIST_PANEL_MIN_WIDTH,Ri as LIST_RESIZE_HANDLE_THICKNESS,Ga as LevenshteinWorkerSettings,Hr as Progress,qa as SearchOptionsPanel,P as StatItem,Ya as StatisticsPanel,Gn as SwipeOverlay,tu as TREE_COLLAPSE_THRESHOLD,al as TREE_DETAIL_PANEL_MIN_WIDTH,nu as TREE_EXPAND_THRESHOLD,nl as TREE_PANEL_MIN_WIDTH,rl as TREE_RESIZE_HANDLE_THICKNESS,_n as Tabs,kt as TabsContent,an as TabsList,Ct as TabsTrigger,Xn as TreeWorkerSession,Bt as WorkerStatsSection,zn as assertContactMapStreamEndpoint,Pr as assertContactMapTreeWorkerUrl,Sc as assertContactMapWorkerUrls,ll as composeTreeVirtualScrollOptions,Om as contactMapShouldRevalidate,ni as countContactMapCompanies,qs as deserializeStreamRecord,Xs as getContactMapStreamClient,Gi as getTreeWorkerSession,At as layerContactMapWorkerUrls,Ic as resetContactMapStreamClientForTesting,Op as resetTreeWorkerSessionForTesting,pa as resolveContactMapLabels,Yr as useAnimatedNumber,Xe as useContactMapConfig,q as useContactMapLabels,ti as useContactMapStream,Aa as useContactPanelSizing,_r as useDynamicViewportHeight,dt as useHorizontalDragScroll,Kn as useLongPressPopup,Ai as useReportPopupVisibility,jn as useResponsiveTwoColumnLayout,_i as useRowPopupRegistry,Un as useStreamedContactMapContext,to as useTreeWorker};
|
|
1
|
+
var Uo=Object.defineProperty;var he=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bo=(e,t)=>{for(var n in t)Uo(e,n,{get:t[n],enumerable:!0})};var We,bt,ur,Ut,Bt,pn,Ze,Ne,On,fa,ba,Ve,j,yt=he(()=>{"use strict";We=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},bt=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,ur=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=We(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},Ut=e=>ur(e,["custom_email","email"]),Bt=e=>ur(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),pn=e=>{let t=We(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},Ze=(e,t)=>{let n=We(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ne=(e,t)=>String(e).padStart(t,"0"),On=e=>`${Ne(e.getUTCFullYear(),4)}-${Ne(e.getUTCMonth()+1,2)}-${Ne(e.getUTCDate(),2)}`,fa=e=>`${On(e)} ${Ne(e.getUTCHours(),2)}:${Ne(e.getUTCMinutes(),2)}:${Ne(e.getUTCSeconds(),2)}`,ba=e=>`${Ne(e.getFullYear(),4)}-${Ne(e.getMonth()+1,2)}-${Ne(e.getDate(),2)} ${Ne(e.getHours(),2)}:${Ne(e.getMinutes(),2)}:${Ne(e.getSeconds(),2)}`,Ve=(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)},j=e=>e==null?"-":typeof e=="string"?We(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var X,pr,xt=he(()=>{"use strict";X=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":pr(e);case"function":return pr(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},pr=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var $t,fe,Vt=he(()=>{"use strict";$t=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},fe=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var $o,Dn,ya=he(()=>{"use strict";$o=(e,t)=>{let n=Array.from({length:t.length+1},(a,s)=>s);for(let a=1;a<=e.length;a+=1){let s=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);s.push(Math.min(n[o]+1,s[o-1]+1,r))}n=s}return n[t.length]},Dn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(o=>o.toLowerCase().startsWith(n));if(s!==void 0)return s}let a;for(let s of t){let o=$o(n,s.toLowerCase());o<=Math.max(1,Math.floor(s.length/4))&&(a===void 0||o<a.distance)&&(a={key:s,distance:o})}return a?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as mr,DIRECTORY_TREE_LABEL_KEYS as xa,resolveDirectoryTreeLabels as Vo}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Ko,VIRTUAL_SCROLL_LABEL_KEYS as jo}from"@aiquants/virtualscroll";var Go,K,vt,_n,hr,mn,et,qo,gr,fr,Yo,va,Qo,Xo,Jo,Ca,ka,Sa,Ct=he(()=>{"use strict";yt();xt();Vt();ya();Go=Object.freeze({en:"en-US",ja:"ja-JP"}),K=(e,t)=>t.toLocaleString(Go[e]),vt=(e,t,n)=>e==="1"?t:n,_n=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${K("en",e)} / ${K("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${K("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${K("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${K("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>vt(e,"record","records"),companyUnit:e=>vt(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=>vt(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=>K("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${K("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:fa,recordDate:On,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:ba,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=K("en",e);return`${n} ${vt(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: ${K("en",t)}`,timesUnit:e=>vt(e," time"," times"),itemsUnit:e=>vt(e," item"," items"),charactersUnit:e=>vt(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 (${K("ja",e)} / ${K("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${K("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${K("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${K("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=>`${K("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${K("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:fa,recordDate:On,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:ba,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})=>`${K("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: ${K("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),hr=Object.freeze(Object.keys(_n.en)),mn=Object.freeze([...xa,...hr]),et=Object.freeze({en:Object.freeze({...mr.en,..._n.en}),ja:Object.freeze({...mr.ja,..._n.ja})}),qo=new Set(mn),gr=Object.keys(et).map(e=>JSON.stringify(e)).join(" or "),fr=Object.freeze({locale:"locale",labels:"labels"}),Yo=(e,t,n)=>{e[t]=n},va=(e,t=fr.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${gr} or left out; got ${X(e)}`);if(e!==void 0&&!Object.hasOwn(et,e))throw new RangeError(`[contact-map] ${t} must be ${gr} or left out; got ${X(e)}`);return Ko(e)},Qo=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${X(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${X(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${X(n)}`)},Xo=(e,t,n)=>{let a=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!qo.has(s)){let r=Dn(s,mn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${X(s)}`)}let o=e[s];o!==void 0&&(Qo(n,s,o,t[s]),a[s]=o)}return a},Jo=e=>{let t={},n=!1;for(let a of xa){let s=e[a];s!==void 0&&(t[a]=s,n=!0)}return n?t:void 0},Ca=(e,t,n=fr)=>{let a=va(e,n.locale);if(t===void 0)return et[a];if(!$t(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${X(t)}`);let s=Xo(t,et[a],n.labels),r={...Vo(a,Jo(s)),..._n[a]};for(let c of hr){let d=s[c];d!==void 0&&Yo(r,c,d)}return Object.freeze(r)},ka=e=>{let t={};for(let n of xa)t[n]=e[n];return Object.freeze(t)},Sa=e=>{let t={};for(let n of jo)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Zo}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as es}from"@aiquants/virtualscroll";import{createContext as ts,useContext as yr,useMemo as br,useRef as ns}from"react";import{jsx as rs}from"react/jsx-runtime";var as,wa,Ta,xr,be,G,se=he(()=>{"use strict";Ct();as=Object.freeze({locale:"en",labels:et.en,treeLabels:ka(et.en),engineLabels:Sa(et.en)}),wa=ts(as),Ta=(e,t)=>{let n=ns(null),a=n.current;return a!==null&&t.every(s=>a[s]===e[s])?a:(n.current=e,e)},xr=({locale:e,labels:t,surface:n,children:a})=>{let s=va(e,n.locale),o=br(()=>Ca(s,t,n),[s,t,n]),r=Ta(o,mn),c=Ta(ka(r),Zo),d=Ta(Sa(r),es),l=br(()=>({locale:s,labels:r,treeLabels:c,engineLabels:d}),[s,r,c,d]);return rs(wa.Provider,{value:l,children:a})},be=()=>yr(wa),G=()=>yr(wa).labels});var Wn,An,Hn,In,Pa=he(()=>{"use strict";Wn="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]",An=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Hn="absolute inset-0 bg-slate-900/50",In=()=>!1});var is,ct,Cr,jt,gn=he(()=>{"use strict";is="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",ct="focus-visible:outline-2 focus-visible:outline-blue-700 focus-visible:outline-offset-2 dark:focus-visible:outline-sky-300",Cr="in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 in-focus-visible:data-[contact-map-row-active]:outline-blue-700 dark:in-focus-visible:data-[contact-map-row-active]:outline-sky-300",jt=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${ct} ${is}`});import{clsx as ls}from"clsx";import{twMerge as ds}from"tailwind-merge";function pe(...e){return ds(ls(e))}var hn=he(()=>{"use strict"});import{useOverlayDialog as cs}from"@aiquants/swipe-overlay";import us from"lucide-react/dist/esm/icons/check.js";import ps from"lucide-react/dist/esm/icons/copy.js";import ms from"lucide-react/dist/esm/icons/x.js";import{useCallback as Yt,useEffect as kr,useId as gs,useMemo as Fn,useRef as Sr,useState as hs}from"react";import{createPortal as fs}from"react-dom";import{jsx as q,jsxs as Ae}from"react/jsx-runtime";var bs,ke,ys,xs,vs,fn,qt,Cs,ks,Gt,Ra,La,zn,Ea=he(()=>{"use strict";yt();se();Pa();gn();hn();bs=350,ke=e=>e.stopPropagation(),ys=Object.freeze({onClick:ke,onDoubleClick:ke,onContextMenu:ke,onPointerDown:ke,onPointerUp:ke,onMouseDown:ke,onMouseUp:ke,onTouchStart:ke,onTouchEnd:ke,onKeyDown:ke,onKeyUp:ke,onFocus:ke,onBlur:ke}),xs=pe(Wn,"flex items-center justify-center px-4 py-6"),vs="relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",fn=0,qt=null,Cs=()=>{let e=document.body.style;fn+=1,fn===1&&(qt={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},ks=()=>{if(fn=Math.max(0,fn-1),fn>0||!qt)return;let e=document.body.style;e.userSelect=qt.userSelect,typeof qt.webkitUserSelect<"u"&&(e.webkitUserSelect=qt.webkitUserSelect),qt=null},Gt=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Ra=(e,t)=>{let n=new Set;return e.reduce((a,s)=>{let o=typeof s.value=="string"?s.value.trim():"";if(!o)return a;let{normalized:r,key:c,entry:d}=t(o,s);return r&&!n.has(c)&&(n.add(c),a.push(d(r))),a},[])},La=({value:e,ariaLabel:t})=>{let[n,a]=hs(!1),s=Sr(null),o=Yt(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let l=document.createElement("textarea");l.value=d,l.setAttribute("readonly",""),l.style.position="absolute",l.style.left="-9999px",document.body.appendChild(l),l.select(),l.setSelectionRange(0,l.value.length);let u=document.execCommand("copy");return document.body.removeChild(l),u},[]),r=Yt(async d=>{d.preventDefault(),d.stopPropagation(),s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null);let l=await o(e);a(l),l&&typeof window<"u"&&(s.current=window.setTimeout(()=>{a(!1),s.current=null},1500))},[o,e]);kr(()=>()=>{s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null)},[]);let c=n?us:ps;return q("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 ${ct}`,onClick:r,"aria-label":t,title:t,children:q(c,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},zn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let s=G(),o=Sr(null),r=Fn(()=>e.contacted_at?Ve(e.contacted_at,s.recordDate):null,[e.contacted_at,s.recordDate]),c=Gt(e.full_name)??s.noName,d=Gt(e.company_name),l=Gt(e.department),u=Gt(e.title),p=Fn(()=>Ra([{fieldKey:"company_name",label:s.fieldCompanyName,value:d},{fieldKey:"department",label:s.fieldDepartment,value:l},{fieldKey:"title",label:s.fieldTitle,value:u}],(y,{fieldKey:T,label:D})=>({normalized:y,key:`${T}-${y.toLowerCase()}`,entry:b=>({fieldKey:T,label:D,value:b})})),[d,l,u,s]),i=Fn(()=>Ra([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(y,{fieldKey:T,label:D})=>{let b=pn(y);return{normalized:Gt(y),key:(b??y).toLowerCase(),entry:Y=>({fieldKey:T,label:D,value:Y,href:b})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),m=Fn(()=>Ra([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(y,{fieldKey:T,label:D})=>{let b=Gt(y),S=Ze(y,t),Y=!!S?.startsWith("https://mail.google.com");return{normalized:b,key:y.toLowerCase(),entry:_=>({fieldKey:T,label:D,value:_,href:S,isGmailLink:Y})}}),[e.custom_email,e.email,t,s]),h=i.length>0||m.length>0,x=gs(),C=Yt(()=>{a(),o.current=null},[a]),v=Yt(y=>y.ownerDocument.getElementById(x),[x]),{dialogProps:H,backdropProps:A}=cs({isOpen:!0,onClose:C,isCloseBlocked:In,initialFocus:v}),f=Yt((y,T)=>{T.isGmailLink&&(y.preventDefault(),n(T.value))},[n]),g=Yt((y,T)=>{if(!T.isGmailLink){o.current=null;return}let D=Date.now(),b=o.current;if(b&&b.email===T.value&&D-b.timestamp<=bs){o.current=null,y.preventDefault(),n(T.value);return}o.current={email:T.value,timestamp:D}},[n]);return kr(()=>(Cs(),ks),[]),fs(Ae("dialog",{...H,...ys,"data-contact-popup-root":"true","aria-labelledby":x,className:xs,style:An,children:[q("div",{...A,"data-contact-popup-backdrop":"",className:Hn}),Ae("div",{"data-contact-popup-card":"",className:vs,children:[Ae("div",{className:"flex items-center justify-between gap-4",children:[q("h2",{id:x,tabIndex:-1,className:"wrap-break-word min-w-0 font-semibold text-gray-900 text-lg outline-none dark:text-slate-100",children:c}),q("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 dark:hover:bg-slate-800/70 ${ct}`,onClick:C,"aria-label":s.close,children:q(ms,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?q("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:p.map(y=>Ae("div",{className:"flex items-center gap-3",children:[q("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:y.value}),q(La,{value:y.value,ariaLabel:s.copyField(y.label)})]},y.fieldKey))}):null,Ae("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[i.length>0?q("div",{children:q("ul",{className:"space-y-3 text-sm",children:i.map(y=>q("li",{className:"flex items-start gap-3",children:Ae("div",{className:"min-w-0 flex-1",children:[q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:y.label}),Ae("div",{className:"mt-1 flex items-center gap-3",children:[q("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:y.href?q("a",{href:y.href,className:`wrap-break-word text-blue-800 dark:text-blue-300 ${jt}`,children:y.value}):q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:y.value})}),q(La,{value:y.value,ariaLabel:s.copyField(y.label)})]})]})},`${y.fieldKey}-${y.value}`))})}):null,m.length>0?q("div",{children:q("ul",{className:"space-y-3 text-sm",children:m.map(y=>q("li",{className:"flex items-start gap-3",children:Ae("div",{className:"min-w-0 flex-1",children:[q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:y.label}),Ae("div",{className:"mt-1 flex items-start gap-3",children:[Ae("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[y.href?q("a",{href:y.href,className:`wrap-break-word text-blue-800 dark:text-blue-300 ${jt}`,target:y.isGmailLink?"_blank":void 0,rel:y.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:T=>f(T,y),onTouchEnd:T=>g(T,y),children:y.value}):q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:y.value}),y.isGmailLink?q("span",{className:"mt-1 block text-[11px] text-slate-600 dark:text-slate-300",children:s.popupGmailHint}):null]}),q(La,{value:y.value,ariaLabel:s.copyField(y.label)})]})]})},`${y.fieldKey}-${y.value}`))})}):null,r?Ae("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[q("span",{className:"text-xs",children:s.popupLastContactDate}),q("span",{children:r})]}):null,h?null:q("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as ye,jsxs as bn}from"react/jsx-runtime";var Un,Oa=he(()=>{"use strict";Un=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:s="-",email:o="-",updatedAtText:r="-"})=>bn("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[bn("div",{className:"flex items-center gap-1 sm:hidden",children:[ye("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),ye("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),ye("div",{className:"flex items-center gap-1 sm:hidden",children:ye("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),ye("div",{className:"block sm:hidden",children:ye("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:a})}),bn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[ye("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),ye("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),bn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[ye("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),ye("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),bn("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[ye("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),ye("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:o})]}),ye("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:ye("span",{className:"truncate",children:r})})]})});import{formatQuerySets as Ss,parseQuerySets as Ts}from"@aiquants/fuzzy-search";import{getNormalizedVariants as ws,normalizeText as Ns,romajiToKatakana as Ms}from"@aiquants/select-box";var Nr,Ps,Rs,Ls,Es,Mr,Pr,Os,Ds,_s,Ws,As,Hs,Is,Fs,Rr,Lr,Tr,wr,Bn,zs,Us,Da,Er,_a=he(()=>{"use strict";Nr=/[]/g,Ps=/^[\s ]+|[\s ]+$/g,Rs=/\s+/,Ls=/^[\p{Script=Latin}\s]+$/u,Es=/\p{Script=Latin}/u,Mr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Pr="union",Os=65377,Ds=65439,_s=["\uFF9E","\uFF9F"],Ws=(()=>{let e=new Map;for(let t=Os;t<=Ds;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of _s){let s=(n+a).normalize("NFKC");s.length===1&&e.set(s,n+a)}}return e})(),As=/[-ヿ]/u,Hs=e=>{let t=Array.from(e,n=>Ws.get(n)??n).join("");return As.test(t)?null:t},Is=e=>Ns(e.replace(Nr,"").replace(Ps,""),Mr),Fs=e=>{if(!Ls.test(e))return null;let t=Ms(e);return Es.test(t)?null:t},Rr=e=>e.split(Rs).filter(Boolean),Lr=e=>Ts(e,Pr).sets.map(({query:t})=>t),Tr=e=>Lr(e).flatMap(t=>Rr(t)),wr=e=>Ss({combine:Pr,sets:Array.from(new Set(e),t=>({query:t}))}),Bn=e=>{let t=Lr(e.replace(Nr,"")).map(a=>Rr(Is(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let s=Fs(a);if(s===null)return wr(t);n.push(s)}return wr(n)},zs=e=>{let t=new Set([...Tr(e),...Tr(Bn(e))]),n=new Set;for(let a of t)for(let s of ws(a,Mr)){let o=s.trim();if(!o)continue;n.add(o);let r=Hs(o);r!==null&&n.add(r)}return Array.from(n)},Us=/[.*+?^${}()|[\]\\]/g,Da=e=>{let t=zs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(Us,"\\$&")).sort((a,s)=>s.length-a.length);return new RegExp(n.join("|"),"gi")},Er=(e,t)=>{let n=Da(e);if(n===null)return s=>s;let a=s=>t.some(o=>{let r=s[o];return typeof r=="string"&&r.search(n)!==-1});return s=>{let o=[],r=[];for(let c of s)a(c.item)?o.push(c):r.push(c);return[...o,...r]}}});import{memo as Bs}from"react";import{Fragment as Wa,jsx as $n}from"react/jsx-runtime";var $s,ue,Vn=he(()=>{"use strict";_a();$s="rounded bg-yellow-200 px-1 text-gray-900 dark:bg-yellow-900 dark:text-yellow-100",ue=Bs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return $n(Wa,{children:e});let a=Da(t);if(a===null)return $n(Wa,{children:e});let s=[],o=0,r=a.exec(e),c=0;for(;r;){let d=r[0],l=r.index;if(l>o&&s.push(e.substring(o,l)),d.length===0){a.lastIndex++,r=a.exec(e);continue}s.push($n("mark",{className:$s,children:d},`highlight-${l}-${c}`)),o=l+d.length,c+=1,r=a.exec(e)}return o<e.length&&s.push(e.substring(o)),$n(Wa,{children:s})});ue.displayName="HighlightedText"});var Dr={};Bo(Dr,{ContactDetailGrid:()=>Or,default:()=>Vs});import{useMemo as Aa}from"react";import{Fragment as Ks,jsx as Ha,jsxs as js}from"react/jsx-runtime";var Kn,Or,Vs,_r=he(()=>{"use strict";yt();se();Ea();Oa();Vn();Kn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Or=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:s,isPopupVisible:o,onRequestClose:r})=>{let c=G(),d=Aa(()=>Ut(e),[e]),l=Aa(()=>Bt(e),[e]),u=d.value??"-",p=l.value??"-",i=Aa(()=>Ve(e.updated_at,c.recordDateTime),[e.updated_at,c.recordDateTime]),m=Kn(e.full_name)??c.noName,h=Kn(e.company_name),x=Kn(e.department),C=(v,H="-")=>Ha(ue,{text:v??H,query:t,enabled:n});return js(Ks,{children:[Ha(Un,{fullName:C(m),title:C(Kn(e.title)),companyName:C(h),department:C(x),phoneNumber:p,email:C(u),updatedAtText:i}),o?Ha(zn,{contactData:e,openEmailsWithGmail:a,openGmailCompose:s,onRequestClose:r}):null]})},Vs=Or});se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Kt}from"@aiquants/fuzzy-search";import{memo as os,useId as vr}from"react";import{jsx as Ke,jsxs as tt}from"react/jsx-runtime";var Na=os(({searchOptions:e,setSearchOptions:t})=>{let n=G(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=vr(),r=vr(),c=[];return c.push(tt("div",{className:`${a} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[tt("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),Ke("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),Ke("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||Kt.learningWeight,onChange:d=>t(l=>({...l,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),tt("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||Kt.learningWeight]}),Ke("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),c.push(tt("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[tt("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),Ke("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),Ke("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??Kt.debounceMs,onChange:d=>t(l=>({...l,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),tt("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs??Kt.debounceMs]}),Ke("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),tt("section",{className:"space-y-3",children:[tt("div",{className:"flex items-center justify-between gap-3",children:[tt("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[Ke("span",{children:"\u26A1"}),Ke("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),Ke("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:Kt.learningWeight,debounceMs:Kt.debounceMs})),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-gray-300 bg-gray-100 px-2 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),Ke("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:c})]})});Na.displayName="AdvancedSearchSettings";se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as kt}from"@aiquants/fuzzy-search";import{memo as ss,useId as je}from"react";import{jsx as J,jsxs as ee}from"react/jsx-runtime";var Ma=ss(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})=>{let r=G(),c="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",d="text-xs font-semibold",l=je(),u=je(),p=je(),i=je(),m=je(),h=je(),x=je(),C=je(),v=je(),H=je(),A=[];return A.push(ee("div",{className:`${c} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[ee("div",{className:`${d} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),J("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicThresholdLabel}),J("input",{id:l,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??kt.threshold,onChange:f=>t(g=>({...g,threshold:parseFloat(f.target.value)})),className:"h-11 w-full"}),ee("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[r.currentValueLabel," ",e.threshold??kt.threshold]}),J("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),A.push(ee("div",{className:`${c} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[ee("div",{className:`${d} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",r.basicDisplayHeading]}),ee("label",{htmlFor:u,className:"flex min-h-11 items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[J("input",{id:u,type:"checkbox",checked:e.caseSensitive??kt.caseSensitive,onChange:f=>t(g=>({...g,caseSensitive:f.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),ee("label",{htmlFor:p,className:"flex min-h-11 items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[J("input",{id:p,type:"checkbox",checked:n,onChange:f=>a(f.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),ee("label",{htmlFor:i,className:"flex min-h-11 items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[J("input",{id:i,type:"checkbox",checked:s,onChange:f=>o(f.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),ee("div",{className:"flex flex-col gap-1",children:[J("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicMultiTermOperator}),ee("select",{id:m,value:e.multiTermOperator??kt.multiTermOperator,onChange:f=>t(g=>({...g,multiTermOperator:f.target.value})),className:"min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[J("option",{value:"or",children:r.basicOperatorOr}),J("option",{value:"and",children:r.basicOperatorAnd})]}),J("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:r.basicMultiTermHint})]})]},"display")),A.push(ee("div",{className:`${c} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[ee("div",{className:`${d} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",r.basicSortHeading]}),ee("div",{className:"flex flex-col gap-2",children:[J("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortBy}),ee("select",{id:h,value:e.sortBy||kt.sortBy,onChange:f=>t(g=>({...g,sortBy:f.target.value})),className:"min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[J("option",{value:"score",children:r.basicSortByScore}),J("option",{value:"relevance",children:r.basicSortByRelevance}),J("option",{value:"original",children:r.basicSortByOriginal})]})]}),ee("div",{className:"flex flex-col gap-2",children:[J("label",{htmlFor:x,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortOrder}),ee("select",{id:x,value:e.sortOrder||kt.sortOrder,onChange:f=>t(g=>({...g,sortOrder:f.target.value})),className:"min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[J("option",{value:"desc",children:r.basicSortDescending}),J("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),A.push(ee("div",{className:`${c} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[ee("div",{className:`${d} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),J("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicStrategy}),ee("select",{id:C,value:e.parallelSearchStrategy||kt.parallelSearchStrategy,onChange:f=>t(g=>({...g,parallelSearchStrategy:f.target.value})),className:"min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[J("option",{value:"balanced",children:r.basicStrategyBalanced}),J("option",{value:"index-first",children:r.basicStrategyIndexFirst}),J("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),ee("div",{className:"mt-2 space-y-2",children:[ee("label",{htmlFor:v,className:"flex min-h-11 items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[J("input",{id:v,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:f=>t(g=>({...g,enableIndexFiltering:f.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),ee("label",{htmlFor:H,className:"flex min-h-11 items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[J("input",{id:H,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:f=>t(g=>({...g,enableLevenshtein:f.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),ee("section",{className:"space-y-3",children:[ee("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[J("span",{children:"\u{1F527}"}),J("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),J("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:A})]})});Ma.displayName="BasicSearchSettings";yt();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Gs}from"@aiquants/swipe-overlay";import qs from"lucide-react/dist/esm/icons/badge-check.js";import Ys from"lucide-react/dist/esm/icons/building-2.js";import Qs from"lucide-react/dist/esm/icons/calendar-clock.js";import Xs from"lucide-react/dist/esm/icons/check.js";import Js from"lucide-react/dist/esm/icons/copy.js";import Zs from"lucide-react/dist/esm/icons/id-card.js";import ei from"lucide-react/dist/esm/icons/mail.js";import ti from"lucide-react/dist/esm/icons/phone.js";import ni from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as ai,useEffect as ri,useMemo as qn,useRef as oi,useState as si}from"react";var Ge={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)};se();hn();import*as He from"@radix-ui/react-tabs";import*as jn from"react";import{jsx as Ia}from"react/jsx-runtime";var Gn=He.Root,yn=jn.forwardRef(({className:e,...t},n)=>Ia(He.List,{ref:n,className:pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));yn.displayName=He.List.displayName;var St=jn.forwardRef(({className:e,...t},n)=>Ia(He.Trigger,{ref:n,className:pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));St.displayName=He.Trigger.displayName;var Tt=jn.forwardRef(({className:e,...t},n)=>Ia(He.Content,{ref:n,className:pe("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));Tt.displayName=He.Content.displayName;gn();Vn();import{jsx as w,jsxs as ce}from"react/jsx-runtime";var Wr="truncate font-semibold text-slate-900 text-xs dark:text-slate-100",Ar={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},ii=({icon:e,label:t,value:n,fieldKey:a,copyValue:s,onCopy:o,isCopied:r,linkHref:c,searchTerm:d,enableHighlighting:l})=>{let u=G(),p=!!(o&&a&&s),i=c?.startsWith("https://mail.google.com")?"_blank":void 0;return ce("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[w("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:w(e,{size:14})}),ce("div",{className:"min-w-0 flex-1",children:[w("div",{className:"font-medium text-[10px] text-slate-600 dark:text-slate-300",children:t}),c?w("a",{href:c,className:`align-top ${Wr} ${jt}`,target:i,rel:i?"noopener noreferrer":void 0,children:w(ue,{text:n,query:d??"",enabled:l})}):w("div",{className:Wr,children:w(ue,{text:n,query:d??"",enabled:l})})]})]}),p?w("button",{type:"button",onClick:()=>o&&a&&s&&o(a,s,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300 ${ct}`,"aria-label":u.copyField(t),children:r?w(Xs,{size:14}):w(Js,{size:14})}):null]})},Hr=({items:e,searchTerm:t,enableHighlighting:n})=>w("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>ce("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[w("dt",{className:"font-semibold text-[10px] text-slate-600 uppercase tracking-wide dark:text-slate-300",children:a.label}),w("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:w(ue,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),Fa=({title:e})=>w("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),li=()=>{let e=G();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 border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[w("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),w("p",{className:"text-[11px] text-slate-600 dark:text-slate-300",children:e.detailEmptyHint})]})},di=Object.freeze({overlay:Gs,pane:void 0}),Qt=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:s,className:o=""})=>{let r=G(),[c,d]=si(null),l=oi(null),u=qn(()=>({...Ar,...s}),[s]);ri(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let p=qn(()=>Ut(e),[e]),i=qn(()=>Bt(e),[e]),m=qn(()=>Ve(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),h=ai(async(b,S,Y)=>{try{await navigator.clipboard.writeText(S),d(b),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(_){Ge.error("Failed to copy contact detail",_)}},[]);if(!e)return w("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:Ar,children:w(li,{})});let x=[j(e.title),j(e.department)].filter(b=>b!=="-"),C=[x.join(" / "),j(e.company_name)].filter(b=>b&&b!=="-").join(" \u30FB ")||"-",v=We(e.full_name)??r.noName,H=[{fieldKey:"full_name",label:r.fieldFullName,value:v},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:j(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:j(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:j(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:j(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:j(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:j(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:j(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:j(e.url)}],A=[{label:r.fieldCustomEmail,value:j(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:j(e.email),fieldKey:"email",rawValue:e.email}].filter(b=>b.value!=="-"),f=[{label:r.fieldCustomMobilePhone,value:j(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:j(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:j(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:j(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(b=>b.value!=="-"),g=[{fieldKey:"person_id",label:"person_id",value:j(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:j(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:j(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:j(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:j(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:j(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:j(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:Ve(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:j(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:Ve(e.updated_at,r.recordDateTime)}],y=[{rowKey:"person_id",icon:Zs,label:"person_id",value:j(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:ei,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:Ze(p.value,!1)},{rowKey:"primary_phone",icon:ti,label:r.summaryPhone,value:i.value??"-",fieldKey:"primary_phone",copyValue:i.value,linkHref:pn(i.value)},{rowKey:"contacted_at",icon:Qs,label:r.summaryLastContact,value:m}],T=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:A,recommendedKey:p.fieldKey??null,resolveHref:b=>Ze(b!=null?String(b):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:f,recommendedKey:i.fieldKey??null,resolveHref:b=>pn(b!=null?String(b):null)}],D=[{value:"summary",label:r.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 text-slate-600 text-sm dark:text-slate-300",children:[w(Ys,{size:16}),w("span",{children:w(ue,{text:j(e.company_name),query:n??"",enabled:a})})]}),x.length>0?w("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:x.map((b,S)=>ce("span",{children:[S>0&&" / ",w(ue,{text:b,query:n??"",enabled:a})]},`header-line-${S}`))}):null]}),w("div",{className:"flex flex-col gap-3",children:y.map(b=>w(ii,{icon:b.icon,label:b.label,value:b.value,fieldKey:b.fieldKey,copyValue:b.copyValue,onCopy:h,isCopied:b.fieldKey?c===b.fieldKey:!1,linkHref:b.linkHref,searchTerm:n,enableHighlighting:a},b.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:ce("div",{className:"flex flex-col gap-3",children:[w(Fa,{title:r.detailBasicProfile}),w(Hr,{items:H,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:w("div",{className:"flex flex-col gap-4",children:T.map(({sectionKey:b,title:S,emptyText:Y,entries:_,recommendedKey:ie,resolveHref:Q})=>ce("div",{className:"flex flex-col gap-2",children:[w(Fa,{title:S}),_.length===0?w("p",{className:"text-slate-600 text-xs dark:text-slate-300",children:Y}):w("div",{className:"flex flex-col gap-2",children:_.map(O=>{let E=Q(O.rawValue),U=O.fieldKey===ie;return ce("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{className:"min-w-0 flex-1",children:[w("div",{className:"font-medium text-slate-600 text-xs dark:text-slate-300",children:O.label}),w("div",{className:"wrap-break-word text-slate-900 text-sm dark:text-slate-100",children:E?w("a",{href:E,className:`text-inherit ${jt}`,children:w(ue,{text:O.value,query:n??"",enabled:a})}):w(ue,{text:O.value,query:n??"",enabled:a})})]}),U?ce("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-900 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[w(qs,{size:14}),r.preferred]}):null]},O.fieldKey)})})]},b))})},{value:"meta",label:r.detailTabMeta,content:ce("div",{className:"flex flex-col gap-3",children:[w(Fa,{title:r.detailTabMeta}),w(Hr,{items:g,searchTerm:n,enableHighlighting:a})]})}];return ce("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${o}`.trim(),style:u,children:[w("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:ce("div",{className:"flex items-center gap-2",children:[w("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:w(ni,{size:16})}),ce("div",{className:"min-w-0 flex-1",children:[w("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:w(ue,{text:v,query:n??"",enabled:a})}),w("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:w(ue,{text:C,query:n??"",enabled:a})})]})]})}),ce(Gn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[w(yn,{className:"grid h-auto grid-cols-4 gap-1 rounded-none border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:D.map(b=>w(St,{value:b.value,className:"flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold text-slate-700 text-xs transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-800 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:w("span",{className:"min-w-0 truncate",children:b.label})},b.value))}),D.map(b=>w(Tt,{value:b.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",style:di[t],children:b.content},b.value))]})]})};Ct();se();import{memo as ci}from"react";import{jsx as nt,jsxs as Yn}from"react/jsx-runtime";var za=ci(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:s,errorMessage:o,onRetry:r})=>{let{locale:c,labels:d}=be(),l=K(c,e),u=K(c,t);return Yn("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[Yn("span",{className:"flex items-baseline gap-1",children:[nt("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationTotalLabel}),nt("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:l}),nt("span",{className:"text-slate-600 dark:text-slate-300",children:d.recordUnit(l)})]}),Yn("span",{className:"flex items-baseline gap-1",children:[nt("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationCompaniesLabel}),nt("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:u}),nt("span",{className:"text-slate-600 dark:text-slate-300",children:d.companyUnit(u)})]}),n==="streaming"||n==="idle"?nt("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?d.annotationStreamingProgress({loaded:a,total:s,percent:Math.min(100,Math.round(a/s*100))}):d.annotationStreamingCount(a)}):null,n==="retrying"?nt("span",{"data-testid":"contact-map-reconnecting-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-2 py-0.5 font-medium text-amber-900 text-xs dark:bg-amber-900/30 dark:text-amber-200",children:d.annotationReconnecting(a)}):null,n==="failed"||n==="auth-required"?Yn("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?o??void 0:void 0,children:["\u26D4 ",n==="auth-required"?d.annotationAuthRequired:d.annotationLoadFailed(a),r?nt("button",{type:"button","data-testid":"contact-map-retry-button",onClick:r,className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-rose-300 bg-white px-1.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:d.annotationRetry}):null]}):null]})});za.displayName="ContactMapAnnotation";Vt();import{useMemo as Fo}from"react";xt();Vt();se();import{createContext as pi,useContext as mi,useMemo as gi}from"react";xt();Vt();ya();var ui=["indexWorker","levenshteinWorker","treeWorker"];function Ir(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 ${X(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${X(n)}`)}}var Fr={setting:"workerUrls"},zr=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=ui,hints:s={}}=t;if(!$t(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${X(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:l})=>l!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(s,r.key)?s[r.key]:void 0,l=d===void 0?Dn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${l===void 0?"":`; did you mean ${JSON.stringify(l)}?`}); got ${X(r.key)}`)}let c=Object.create(null);for(let{key:d,url:l}of o){let u=d;Ir(n,u,l),l!==void 0&&(c[u]=l)}return c};function mu(e,t=Fr){zr(e,t)}function Ur(e){Ir("workerUrls","treeWorker",e)}var Xt=(e,t,n=Fr)=>{let a=zr(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};import{jsx as Ua}from"react/jsx-runtime";var Br=e=>{if(!$t(e))throw new TypeError(`[contact-map] config must be a plain object; got ${X(e)}`);let t=e;return{streamEndpoint:fe(t,"streamEndpoint"),openEmailsWithGmail:fe(t,"openEmailsWithGmail"),treeWorkerFactory:fe(t,"treeWorkerFactory"),workerUrls:Xt(void 0,fe(t,"workerUrls")),locale:fe(t,"locale"),labels:fe(t,"labels")}},$r=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:s})}))},hi=$r(Br({})),Vr=pi(hi),fi=Object.freeze({locale:"locale",labels:"labels"});function Ba({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:r,locale:c,labels:d}=Br(e),{indexWorker:l,levenshteinWorker:u,treeWorker:p}=r,i=gi(()=>$r({streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:{indexWorker:l,levenshteinWorker:u,treeWorker:p},locale:c,labels:d}),[a,s,o,l,u,p,c,d]);return Ua(Vr.Provider,{value:i,children:Ua(xr,{locale:c,labels:d,surface:t,children:n})})}function bi({config:e,children:t}){return Ua(Ba,{config:e,chromeSurface:fi,children:t})}function at(){return mi(Vr)}import{useCallback as $a,useEffect as Si,useMemo as Jn,useSyncExternalStore as Kr}from"react";xt();var yi=1e3,xi=3e4,vi=6;function Xn(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 ${X(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${X(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 ${X(e)}`)}var Ci=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}),ki=e=>Array.isArray(e.records),Qn=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?.()};Xn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??yi,this.maxRetryDelayMs=t.maxRetryDelayMs??xi,this.maxConsecutiveFailures=t.maxConsecutiveFailures??vi,this.logger=t.logger??Ge}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(a==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(a==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),a=new TextDecoder,s="",o=!1,r=!1;for(;;){let{done:c,value:d}=await n.read();if(c)break;let l=a.decode(d,{stream:!0}),u=(s+l).split(`
|
|
2
|
+
`);s=u.pop()??"";let p=!1;for(let i of u){let m=i.trim();if(!m)continue;let h;try{h=JSON.parse(m)}catch(x){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",x);continue}if("type"in h&&h.type==="METADATA"){Number.isSafeInteger(h.total)&&h.total>=0&&this.setState({totalCount:h.total});continue}if(!ki(h)){this.logger.warn("[ContactMapStream] server reported error:","error"in h?h.error:""),r=!0;continue}for(let x of h.records)x&&typeof x.person_id=="number"&&(this.recordMap.set(x.person_id,Ci(x)),p=!0);h.nextCursor&&(this.lastCursor=h.nextCursor),h.isLast&&(o=!0)}p&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return r?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):o?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Ie=null,Ti=e=>{if(Ie!==null&&Ie.endpoint===e)return Ie;if(Xn(e),Ie===null)return Ie=new Qn({endpoint:e}),Ie;if(Ie.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Ie.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 Ie},Pu=()=>{Ie?.dispose(),Ie=null},wi=new Map,Ni={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Mi=()=>{let{streamEndpoint:e}=at();return Jn(()=>(Xn(e),e),[e])};function Pi(){let e=Mi(),t=$a(()=>Ti(e),[e]);Si(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=$a(r=>t().subscribe(r),[t]),a=Kr(n,()=>t().getState(),()=>Ni),s=Kr(n,()=>t().getRecordMap(),()=>wi),o=$a(()=>t().retryNow(),[t]);return Jn(()=>({...a,recordMap:s,retryNow:o}),[a,s,o])}var Ri=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 Zn(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:s,totalCount:o,error:r,retryNow:c}=Pi(),d=Jn(()=>Ri(e),[e]);return{context:Jn(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed",streamPhase:a,loadedCount:s,companyCount:d,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,s,d,o,r]),retryNow:c}}se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ud,parseQuerySets as pd}from"@aiquants/fuzzy-search";import{useFuzzySearch as md}from"@aiquants/fuzzy-search/react";import gd from"lucide-react/dist/esm/icons/search.js";import{useCallback as an,useEffect as ot,useMemo as mt,useRef as Wo,useState as Ue,useTransition as hd}from"react";import{useNavigation as fd,useSearchParams as bd}from"react-router";_a();Vt();import{useCallback as wt,useEffect as Li,useRef as jr}from"react";var ut=e=>{let t=jr(null),n=jr({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,s=wt(p=>{let i=p.currentTarget,m=p.deltaY;!i||m===0||(p.preventDefault(),i.scrollBy({left:m,behavior:"smooth"}))},[]),o=wt(p=>{t.current?.removeEventListener("wheel",s),t.current=p,p?.addEventListener("wheel",s,{passive:!1})},[s]);Li(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let r=wt(p=>{if(p.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=p.clientX,i.scrollLeft=p.currentTarget.scrollLeft,i.pointerId=p.pointerId,i.hasCapture=!1,i.pointerType=p.pointerType},[]),c=wt(p=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let m=p.currentTarget,h=p.clientX-i.startX;!i.isDragging&&Math.abs(h)>a&&(i.isDragging=!0,i.hasCapture||(m.setPointerCapture?.(p.pointerId),i.hasCapture=!0)),i.isDragging&&(p.preventDefault(),m.scrollLeft=i.scrollLeft-h)},[a]),d=wt(p=>{let i=n.current;if(i.pointerType==="touch")return;let m=p.currentTarget;i.isPointerDown&&i.hasCapture&&m.hasPointerCapture?.(p.pointerId)&&m.releasePointerCapture(p.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),l=wt(p=>{d(p)},[d]),u=wt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:c,onPointerUp:l,onPointerLeave:l,onPointerCancel:l,onClickCapture:u}};Ct();se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ei}from"@aiquants/fuzzy-search";var ea=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=Ei;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};hn();import{jsx as Gr}from"react/jsx-runtime";function qr({value:e,max:t=100,className:n,indicatorClassName:a,...s}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return Gr("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:pe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:Gr("div",{"data-slot":"progress-indicator",className:pe("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}var Jt="view";import{useCallback as Xl,useState as Jl}from"react";import{useSearchParams as Zl}from"react-router";se();yt();import{Panel as no,PanelGroup as tl,PanelResizeHandle as nl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as al,VirtualScroll as rl,virtualScrollItemElementId as ol}from"@aiquants/virtualscroll";import{lazy as sl,memo as il,Suspense as ll,useCallback as Me,useEffect as co,useId as ao,useLayoutEffect as uo,useMemo as Nt,useRef as Zt,useState as Cn}from"react";var xn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},vn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function ta(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,s=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:s}}import{useCallback as Oi,useEffect as Di,useState as _i}from"react";var Yr=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:s=240}=t??{},[o,r]=_i(600),c=Oi(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let l=S=>Number.parseFloat(S)||0,{top:u}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),m=l(i.getPropertyValue("--footer-height")),h=l(i.getPropertyValue("--header-height")),x=l(i.getPropertyValue("--scrollbar-height")),C=window.getComputedStyle(d),v=l(C.marginBottom),H=l(C.paddingBottom),A=window.innerHeight-m-x-a,f=p?Math.min(p.bottom,A):A,g=p?Math.max(p.top,h):h,y=Math.max(u,g),T=f-y-v-H,D=Number.isFinite(T)?Math.floor(T):0,b=D>0?D:s;b>0&&Number.isFinite(b)&&r(S=>Math.abs(S-b)>1?b:S)},[a,e,s]);return Di(()=>{if(typeof window>"u")return;let d=null,l=null,u=null,p=null,i=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{c()})};i(),l=window.setTimeout(()=>{i()},150);let m=e.current;return typeof ResizeObserver<"u"&&m&&(u=new ResizeObserver(()=>{i()}),u.observe(m),m.parentElement&&u.observe(m.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{i()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{d!==null&&window.cancelAnimationFrame(d),l!==null&&window.clearTimeout(l),u&&u.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",i)}},[e,n,c]),{viewportHeight:o,updateViewportHeight:c}};import{useCallback as rt,useEffect as Qr,useRef as na,useState as Xr}from"react";var Wi=600,Jr=8,aa=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[s,o]=Xr(!1),[r,c]=Xr(null),d=na(null),l=na(!1),u=na(null),p=na({onSelect:t,resolveItem:n,item:a});Qr(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let i=rt(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),m=rt(()=>{u.current&&(i(),u.current=null)},[i]),h=rt(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(i(),l.current=!1,u.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},d.current=window.setTimeout(()=>{let y=p.current,T=null;y.item!==void 0?T=y.item:y.resolveItem&&g.target&&(T=y.resolveItem(g.target)),T!==null&&(l.current=!0,y.onSelect?.(T),c(T),o(!0)),m()},Wi))},[i,m]),x=rt(g=>{u.current&&g.pointerId===u.current.pointerId&&(i(),u.current=null)},[i]),C=rt(g=>{l.current&&(g.preventDefault(),g.stopPropagation(),g.type==="click"&&(l.current=!1))},[]),v=rt(()=>{l.current=!1},[]),H=rt(g=>{if(!u.current||g.pointerId!==u.current.pointerId)return;let y=Math.abs(g.clientX-u.current.x),T=Math.abs(g.clientY-u.current.y);(y>Jr||T>Jr)&&(i(),u.current=null)},[i]),A=rt(g=>{(s||d.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),f=rt(()=>{o(!1),c(null),l.current=!1,u.current=null},[]);return Qr(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let y=[["pointerdown",h,void 0],["pointerup",x,void 0],["pointercancel",x,void 0],["pointermove",H,void 0],["pointerleave",x,void 0],["contextmenu",A,void 0]],T=[["mousedown",C,!0],["mouseup",C,!0],["click",C,!0],["pointerdown",v,!0],["keydown",v,!0],["contextmenu",A,!0],["pointerup",x,!0],["pointercancel",x,!0]];for(let[D,b,S]of y)g.addEventListener(D,b,S);for(let[D,b,S]of T)window.addEventListener(D,b,S);return()=>{for(let[D,b,S]of y)g.removeEventListener(D,b,S);for(let[D,b,S]of T)window.removeEventListener(D,b,S);i()}},[e,h,x,H,C,v,A,i]),{isPopupVisible:s,popupItem:r,handleClosePopup:f}};import{useCallback as Ai,useEffect as Hi,useState as Zr,useSyncExternalStore as Ii}from"react";function ra(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",s=Ii(Ai(u=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",u),()=>p.removeEventListener("change",u)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=Zr(!1),[c,d]=Zr(0);return Hi(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let u=e.current;if(!u)return;let p=new ResizeObserver(i=>{for(let m of i){if(m.target!==u)continue;let h=0;m.borderBoxSize&&m.borderBoxSize.length>0?h=m.borderBoxSize[0].inlineSize:h=m.contentRect.width,!(!Number.isFinite(h)||h<=0)&&(d(h),r(x=>x&&h>=t.expandThreshold?!1:!x&&h<t.collapseThreshold?!0:x))}});return p.observe(u),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!o,isContainerNarrow:o,isMediaMatches:s,containerWidth:c}}se();xt();var eo=e=>e.isComposing||e.keyCode===229;var to=(e,t)=>{if(Ui(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||eo(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 zi(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},Fi=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),zi=e=>Fi.has(e),Ui=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:s}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${X(a)}`);if(!Number.isInteger(s)||s<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${X(s)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${X(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${X(t)}`)};se();Pa();gn();hn();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Bi,useOverlayPresence as $i,useSwipeOverlayDialog as Vi}from"@aiquants/swipe-overlay";import{useCallback as Ki,useId as ji}from"react";import{jsx as oa,jsxs as Va}from"react/jsx-runtime";var Gi=pe(Wn,"flex overflow-hidden"),qi=pe(Hn,"motion-safe:transition-opacity motion-safe:duration-200"),Yi="relative ml-auto flex h-full w-full max-w-lg flex-col bg-white shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out dark:bg-slate-900",Qi="flex shrink-0 items-center justify-between gap-3 border-slate-200 border-b px-3 py-2 dark:border-slate-700",Xi="min-w-0 truncate font-semibold text-base text-slate-900 outline-none dark:text-slate-100",Ji=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-300 px-4 font-medium text-slate-700 text-sm hover:bg-slate-100 dark:border-slate-600 dark:text-slate-200 dark:hover:bg-slate-800 ${ct}`,Zi="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",sa=({isOpen:e,onClose:t,children:n,className:a,title:s})=>{let o=G(),r=ji(),c=$i(e),d=Ki(h=>h.ownerDocument.getElementById(r),[r]),{dialogProps:l,backdropProps:u,panelProps:p,attemptClose:i,isSwiping:m}=Vi({isOpen:e,onClose:t,isCloseBlocked:In,skipWhenTextSelected:!0,initialFocus:d});return c?Va("dialog",{...l,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:pe(Gi,e&&!m?"pointer-events-auto":"pointer-events-none"),style:An,children:[oa("div",{...u,"data-contact-map-overlay-backdrop":"",className:pe(qi,e?"opacity-100":"opacity-0")}),Va("div",{...p,"data-contact-map-overlay-panel":"",className:pe(Yi,e?"pointer-events-auto":"pointer-events-none",a),children:[Va("div",{className:Qi,children:[oa("h2",{id:r,tabIndex:-1,className:Xi,children:s===void 0?o.overlayTitle:s}),oa("button",{type:"button",className:Ji,onClick:()=>i(),children:o.close})]}),oa("div",{"data-contact-map-overlay-body":"",className:Zi,style:Bi,children:n})]})]}):null};gn();Oa();import{Fragment as kl,jsx as I,jsxs as Fe}from"react/jsx-runtime";var dl=sl(async()=>({default:(await Promise.resolve().then(()=>(_r(),Dr))).default})),Ka=64,ro="h-[64px]",oo=240,cl=4,ja=ta(xn),ul=xn.listPanelMinWidth,pl=xn.detailPanelMinWidth,ml=xn.handleThickness,bp=ja.collapseThreshold,yp=ja.expandThreshold,gl=({contactData:e})=>{let t=G(),n=We(e?.full_name)??t.noName,a=We(e?.title)??"-",s=We(e?.company_name)??"-",o=We(e?.department)??"-",r=Ut(e).value??"-",c=Bt(e).value??"-",d=Ve(e?.updated_at,t.recordDateTime);return I(Un,{fullName:n,title:a,companyName:s,department:o,phoneNumber:c,email:r,updatedAtText:d})},hl=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,yl=(e,t)=>{for(let n of e){let a=bt(n);if(a?.person_id===t)return a}return null},so=(e,t)=>t!==null&&bt(e)?.person_id===t,io=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let s=bt(e[a]);if(s!==null)return{index:a,personId:s.person_id}}return null},lo=(e,t,n)=>{let a=io(e,t,n);return a!==null?a:io(e,t-n,n===1?-1:1)},Ga=(e,t,n)=>{let{viewportHeight:a}=Yr(t,{enableMutationObserver:!0,bottomGap:cl,minFallbackHeight:oo}),[s,o]=Cn(0),r=Me(()=>{let p=n.current,i=t.current;if(!(p&&i))return;let m=p.getBoundingClientRect(),h=i.getBoundingClientRect(),x=Math.ceil(h.top-m.top);Number.isFinite(x)&&x>0&&o(C=>Math.abs(C-x)>1?x:C)},[t,n]);uo(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let c=a>0?a:oo,d=s>0?s:0,l=c+d,u=Nt(()=>hl(l),[l]);return{normalizedViewportHeight:c,normalizedDetailHeight:l,panelSizingStyle:u}},xl=new Set,vl=()=>{let[e,t]=Cn(xl),n=Me((a,s)=>{t(o=>{if(o.has(a)===s)return o;let r=new Set(o);return s?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Cl=(e,t,n)=>{let a=Zt(n);uo(()=>{a.current=n},[n]),co(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},po=il(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:s,isActive:o,onSelect:r,onLongPressSelect:c,searchQuery:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:p,onPopupVisibilityChange:i})=>{let m=G(),h=Zt(null),x=I("div",{className:ro}),C=fl(e)?e:null,v=bt(e),{isPopupVisible:H,handleClosePopup:A}=aa({ref:h,onSelect:c,item:v?.person_id});if(Cl(v?.person_id??null,H,i),!e||!v)return x;let{person_id:f}=v,g=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",T=s?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":g,D=["B","F"].map(b=>bl(b,b==="B"?C?.baseScore:C?.score)).filter(Boolean);return Fe("div",{ref:h,id:ol(a,f),className:`flex ${ro} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${T} ${Cr}`,style:{height:Ka},role:"option","aria-selected":s,"aria-posinset":t+1,"aria-setsize":n,"data-selected":s?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(f),children:[Fe("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[I("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:m.listRowNumber(t+1)}),I("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:f}),I("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:D.length?D.map(b=>I("span",{children:b},b)):I("span",{children:"-"})})]}),I(ll,{fallback:I(gl,{contactData:v}),children:I(dl,{contactData:v,searchTerm:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:p,isPopupVisible:H,onRequestClose:A})})]})});po.displayName="ContactListRow";var mo=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:s,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:c}=e,{locale:d,labels:l,engineLabels:u}=be(),p=Zt(null),i=Zt(null),[m,h]=Cn(null),{normalizedViewportHeight:x,panelSizingStyle:C}=Ga(c,i,p),{isAnyPopupVisible:v,handlePopupVisibilityChange:H}=vl(),A=Nt(()=>({enablePointerDrag:!v,enableKeyboardNavigation:!1}),[v]),f=Nt(()=>s?n:t,[s,n,t]),[g,y]=Cn(null),T=Me($=>{h($),y($)},[]),D=Me($=>{if(!r)return;let re=$.trim();if(!re||re==="-"||typeof window>"u")return;let B=Ze(re,!0);B&&window.open(B,"_blank","noopener,noreferrer")},[r]),[b,S]=Cn(!1),Y=Me(()=>S(!1),[]),_=Me($=>{T($),S(!0)},[T]),ie=ao(),Q=ao(),O=Zt(null),E=f.length,U=Me(($,re)=>I(po,{entry:$,index:re,itemCount:E,listboxId:ie,isSelected:so($,m),isActive:so($,g),onSelect:_,onLongPressSelect:T,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:D,onPopupVisibilityChange:H}),[E,ie,m,g,_,T,a,o,r,D,H]),ne=Nt(()=>{let $=new Map;return f.forEach((re,B)=>{let it=bt(re);it!==null&&$.set(it.person_id,B)}),$},[f]),le=g===null?null:ne.get(g)??null,ve=m===null?null:ne.get(m)??null,gt=Math.max(1,Math.floor(x/Ka)),Rt=Me($=>{if($.target.id!==ie)return;let re=to($.nativeEvent,{activeIndex:le,startIndex:ve===null?0:ve,itemCount:E,pageSize:gt});if(re===null)return;if($.preventDefault(),re.kind==="activate"){le!==null&&g!==null&&_(g);return}let B=lo(f,re.index,re.direction);B!==null&&(y(B.personId),O.current?.scrollToIndex(B.index,{align:"nearest"}))},[ie,le,ve,E,gt,g,_,f]),st=Me($=>{if($.target.id!==ie||le!==null||!$.target.matches(":focus-visible"))return;let re=lo(f,ve===null?0:ve,1);re!==null&&y(re.personId)},[ie,le,ve,f]),Lt=Nt(()=>({id:ie,role:"listbox",tabIndex:0,"aria-label":l.listboxLabel,"aria-describedby":Q}),[ie,l.listboxLabel,Q]),de=Me($=>f[$],[f]),Et=Me($=>bt(f[$])?.person_id??`row-${$}`,[f]),Ee=Me(()=>Ka,[]),Qe=Nt(()=>({enabled:!0,renderVisual:al}),[]),Oe=Nt(()=>m===null?null:yl(f,m),[m,f]);co(()=>{m!==null&&!Oe&&h(null)},[m,Oe]);let Te=Zt(null),{isTwoColumn:Ot}=ra(Te,ja);b&&(Ot||Oe===null)&&S(!1);let ht=Fe("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[I("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:Fe("div",{className:"flex items-center",children:[Fe("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[I("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:l.columnNo}),I("span",{className:"leading-tight",children:l.columnId}),I("span",{className:"whitespace-nowrap leading-tight",children:l.columnScore})]}),Fe("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Fe("div",{className:"flex flex-col gap-0.5",children:[I("span",{children:l.columnName}),I("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnTitle})]}),Fe("div",{className:"flex flex-col gap-0.5",children:[I("span",{children:l.columnCompany}),I("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnDepartment})]}),Fe("div",{className:"flex flex-col gap-0.5",children:[I("span",{children:l.columnPhone}),I("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnEmail})]}),I("div",{className:"hidden items-end justify-end xl:flex",children:I("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnUpdatedAt})})]})]})}),I("p",{id:Q,hidden:!0,children:l.listKeyboardHelp}),I("div",{ref:i,className:"flex-1",onKeyDown:Rt,onFocus:st,children:I(rl,{ref:O,contentProps:Lt,activeItemIndex:E===0?void 0:le,activeItemVisibleInset:2,itemCount:E,getItemKey:Et,behaviorOptions:A,getItem:de,getItemHeight:Ee,viewportSize:x,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:Qe},locale:d,labels:u,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:($,re)=>U($,re)})}),n.length===0&&s?I("div",{className:"py-8 text-center",children:I("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoSearchResults})}):null,E===0&&!s?I("div",{className:"py-8 text-center",children:I("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoData})}):null]});return I("div",{ref:Te,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:C,children:Ot?Fe(tl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[I(no,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:ul,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ht}),I(nl,{id:"contact-map-list-handle",thickness:ml,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.listResizeHandle}),I(no,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:pl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:I(Qt,{placement:"pane",contact:Oe,searchTerm:a,enableHighlighting:o})})]}):Fe(kl,{children:[ht,Oe?I(sa,{isOpen:b,onClose:Y,title:l.detailHeading,children:I(Qt,{placement:"overlay",contact:Oe,searchTerm:a,enableHighlighting:o})}):null]})})};yt();import{DirectoryTree as Dl}from"@aiquants/directory-tree";import{Panel as vo,PanelGroup as _l,PanelResizeHandle as Wl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Al}from"@aiquants/virtualscroll";import Hl from"@heroicons/react/24/solid/FolderMinusIcon.js";import Il from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Pe,useEffect as Pt,useMemo as ze,useRef as ca,useState as pt}from"react";import{createPortal as Fl}from"react-dom";var qa=(e,t)=>e&&e.trim()||t;import{useEffect as Sl,useRef as ia,useState as Tl}from"react";var go=(e,t=250)=>{let[n,a]=Tl(e),s=ia(null),o=ia(e),r=ia(null),c=ia(!1);return Sl(()=>{if(!c.current){c.current=!0,a(e),o.current=e;return}o.current=n,s.current=null;let d=l=>{s.current??(s.current=l);let u=l-s.current,p=Math.min(1,Math.max(0,u/t)),i=1-(1-p)**3,m=Math.max(0,Math.round(o.current+(e-o.current)*i));a(m),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};xt();import{useCallback as Ya,useEffect as Qa,useMemo as ho,useRef as wl,useSyncExternalStore as Nl}from"react";se();var Ml=250,Pl=4e3,la=3,fo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},bo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,da=class{constructor(t,{workerSource:n,logger:a=Ge}){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>=la){this.logger.error(`[TreeWorker] the tree Worker failed ${la} times in a row; the tree stops updating until ${fo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Ml*2**(this.consecutiveFailures-1),Pl);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${la})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${X(n)}`);if(!Object.hasOwn(fo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${X(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=la||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||!bo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let s=this.workerNeedsReset,o=this.postedNaming===null||!bo(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},Rl=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},Mt=null,yo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Ll=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},El=e=>{if(Ur(e),Mt===null){let t=new da(()=>Rl(e),{workerSource:"workerUrls.treeWorker"});return Mt={session:t,workerUrl:e},t}if(Mt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${yo(Mt.workerUrl)} and cannot also load it from ${yo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Mt.session},Lp=()=>{Mt?.session.reset(),Mt=null},Ol={snapshot:null,isBuilding:!1};function xo(e,t=!1){let n=at(),a=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:o}=be(),r=o.uncategorizedCompany,c=o.noName,d=ho(()=>({uncategorizedCompany:r,unnamedPerson:c}),[r,c]),l=wl(a);Qa(()=>{l.current=a},[a]);let u=a!==void 0,p=u?void 0:s,i=ho(()=>u?new da(()=>Ll(l.current)(),{workerSource:"treeWorkerFactory"}):null,[u]),m=Ya(()=>i===null?El(p):i,[i,p]),h=Ya(C=>m().subscribe(C),[m]),x=Ya(()=>m().getState(),[m]);return Qa(()=>{let C=m();C.syncRecords(e,d),t&&C.finalize()},[m,e,t,d]),Qa(()=>{if(i!==null)return()=>i.stop()},[i]),Nl(h,x,()=>Ol)}se();Ea();Vn();import{Fragment as Ql,jsx as F,jsxs as xe}from"react/jsx-runtime";var Za=ta(vn),zl=vn.listPanelMinWidth,Ul=vn.detailPanelMinWidth,Bl=vn.handleThickness,Zp=Za.collapseThreshold,em=Za.expandThreshold,$l=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,s=qa(e.full_name,t.noName),o=qa(e.title,""),r=F(ue,{text:s,query:n,enabled:a});return o?xe("span",{className:"flex items-center gap-1.5",children:[F("span",{children:r}),F("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:F(ue,{text:o,query:n,enabled:a})})]}):r},Vl="contact-map-tree h-full w-full",Kl={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},Xa="h-4 w-4 shrink-0 transition-colors duration-150",jl=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),ua=null,Co=null,kn=new Map,ko="",So=null,To=null,Gl=(e,t,n,a,s)=>{let o=`${n?"icons":"plain"}#${a}#${s.noName}`;(o!==ko||s.formatDirectoryName!==So||t!==To)&&(kn.clear(),ko=o,So=s.formatDirectoryName,To=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},c=new Set;for(let d of e){c.add(d.absolutePath);let l=`${d.name}\0${d.memberCount}`,u=kn.get(d.absolutePath);(!u||u.signature!==l)&&(u={signature:l,result:Mo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},kn.set(d.absolutePath,u));let p=u.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[i,m]of p.personPathMap){let h=r.personPathMap.get(i);if(h)for(let x of m)h.add(x);else r.personPathMap.set(i,new Set(m))}for(let[i,m]of p.contactByPath)r.contactByPath.set(i,m);for(let[i,m]of p.ancestorsByPath)r.ancestorsByPath.set(i,m);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of kn.keys())c.has(d)||kn.delete(d);return r},Ja=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",No=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...No(n.children)));return t},ql=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Mo=(e,t,n,a,s)=>{let o=new Map,r=new Map,c=new Map,d=0,l=null,u=(i,m)=>{let h=[...m,i.absolutePath];c.set(i.absolutePath,h);let x,C,v=i.type==="directory"?a.formatDirectoryName(i.name,ql(i)):i.name,H=F(ue,{text:v,query:a.searchQuery,enabled:a.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let A=t.get(i.personId);if(A){r.set(i.absolutePath,A),o.has(i.personId)||o.set(i.personId,new Set);let f=o.get(i.personId);f&&f.add(i.absolutePath),d++,l||(l={personId:i.personId,path:i.absolutePath}),n&&(C=g=>{let y=Ja(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(y=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),F(n.person,{"aria-hidden":"true",className:`${Xa} ${y}`})},i.title&&(H=$l(A,a))),H=F("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:H})}}else if(i.children){let A=i.children.map(f=>u(f,h)).filter(f=>f!==null);if(s&&A.length===0)return null;if(x=A,n){let f=i.relativePath.startsWith("company:")?n.company:n.department;C=g=>F(f,{"aria-hidden":"true",className:`${Xa} ${Ja(g)}`})}}return{name:v,label:H,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:C,children:x}};return{entries:e.map(i=>u(i,[])).filter(i=>i!==null),personPathMap:o,contactByPath:r,ancestorsByPath:c,firstPerson:l,totalCount:d}},Yl=(e,t,n)=>{let a=new Set,s=new Set,o=new Map;t.forEach((u,p)=>{o.set(u.item.person_id,p)});for(let u of t){let p=u.item.person_id,i=e.personPathMap.get(p);if(i)for(let m of i){a.add(m);let h=e.ancestorsByPath.get(m);if(h){for(let x of h)a.add(x);n&&h.length>0&&s.add(h[0])}}}let r=new Map,c=u=>{let p=r.get(u.absolutePath);if(p!==void 0)return p;let i=1/0;if(u.type==="file"){let m=e.contactByPath.get(u.absolutePath);m&&(i=o.get(m.person_id)??1/0)}else if(u.children)for(let m of u.children)i=Math.min(i,c(m));return r.set(u.absolutePath,i),i},d=(u,p=0)=>u.filter(i=>n&&p===0&&s.has(i.absolutePath)?!0:a.has(i.absolutePath)).map(i=>n&&p===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:d(i.children,p+1)}:i).sort((i,m)=>p===0?c(i)-c(m):0),l=d(e.entries);return{...e,entries:l}},wo=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let s=a.values().next();return s.done?null:s.value},Po=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:s,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:c}=e,{locale:d,labels:l,treeLabels:u}=be(),p=l.noName,i=l.treeDirectoryName,m=ze(()=>({noName:p,formatDirectoryName:i}),[p,i]),[h,x]=pt(null),[C,v]=pt(!1),{snapshot:H,isBuilding:A}=xo(n,e.isStreamingComplete),f=H?.tree??null,g=H?.rebuildEpoch??0,y=ze(()=>f?Gl(f,a,h,g,m):null,[f,a,h,g,m]),T=ze(()=>{if(!f)return null;if(!o)return y;let R;C||(R=new Set(s.map(M=>M.item.person_id)));let k=Mo(f,a,h,{...m,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},R);return Yl(k,s,C)},[f,y,a,h,e.searchQuery,e.enableHighlighting,o,s,C,m]),D=ze(()=>T||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[T]),b=o&&e.errorMessage!==null,[S,Y]=pt(D),_=ca(!1);Pt(()=>{if(!(r||b)){_.current=!!f,Y(D);return}!_.current&&f&&D.entries.length>0&&(_.current=!0,Y(D))},[D,f,r,b]);let ie=o&&(r||b)?S:D,{entries:Q,personPathMap:O,contactByPath:E,totalCount:U}=ie,ne=ze(()=>No(Q),[Q]),[le,ve]=pt(()=>Co??new Set),gt=Pe(R=>!le.has(R),[le]),Rt=Pe(R=>{ve(k=>{let M=new Set(k);return M.has(R)?M.delete(R):M.add(R),M})},[]),st=Pe(R=>{R.length!==0&&ve(k=>{let M=new Set(k);for(let oe of R)M.add(oe);return M})},[]),Lt=Pe(R=>{ve(k=>{if(k.size===0)return k;let M=!1,oe=new Set(k);for(let Ce of R)oe.delete(Ce)&&(M=!0);return M?oe:k})},[]);Pt(()=>{Co=le},[le]),Pt(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[de,Et]=pt(null),[Ee,Qe]=pt(null),[Oe,Te]=pt(!1),Ot=Pe(()=>Te(!1),[]),[ht,$]=pt(!1),re=ca(null),B=ca(null),{normalizedViewportHeight:it,panelSizingStyle:Dt}=Ga(c,B,re),_t=Pe(R=>{let k=E.get(R);return k?(de!==k.person_id&&Et(k.person_id),R!==Ee&&Qe(R),!0):!1},[E,Ee,de]),Xe=Pe(R=>{_t(R)&&Te(!0)},[_t]),we=Pe(R=>{Xe(R.entry.absolutePath)},[Xe]),Tn=Pe(R=>R instanceof Element?R.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:sn,popupItem:De,handleClosePopup:ln}=aa({ref:B,resolveItem:Tn,onSelect:_t}),lt=Pe(R=>{if(!e.openEmailsWithGmail)return;let k=R.trim();if(!k||k==="-"||typeof window>"u")return;let M=Ze(k,!0);M&&window.open(M,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),_e=De?E.get(De):null,Be=sn&&_e!==null&&_e!==void 0;Pt(()=>{sn&&!_e&&ln()},[sn,_e,ln]);let dn=ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Al}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Wt=ze(()=>jl(dn,it,Be),[dn,it,Be]);Pt(()=>{let R=!1;return typeof window>"u"?()=>{R=!0}:ua?(x(ua),()=>{R=!0}):((async()=>{try{let[M,oe,Ce,Je]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(R)return;let ft=M.default,ha=oe.default,dr=Ce.default,cr=Je.default;ft&&ha&&dr&&cr&&(ua={company:ft,department:ha,title:dr,person:cr},x(ua))}catch(M){Ge.warn("Failed to load lucide icons",M)}})(),()=>{R=!0})},[]);let At=ze(()=>{if(!h)return;let R=Je=>ft=>F(Je,{"aria-hidden":"true",className:`${Xa} ${Ja(ft)}`}),k={company:R(h.company),department:R(h.department),title:R(h.title)},M=R(h.person),oe=Je=>Je in k,Ce=Je=>{let[ft]=Je.entry.relativePath.split(":",1);return(oe(ft)?k[ft]:k.company)(Je)};return{directory:Ce,directoryExpanded:Ce,file:M}},[h]),cn=Pe(()=>{ve(R=>R.size===0?R:new Set)},[]),dt=Pe(()=>{ne.length>0&&st(ne)},[ne,st]);Pt(()=>{if(typeof window>"u")return;let R=document.documentElement,k=window.matchMedia("(prefers-color-scheme: dark)"),M=()=>$(R.classList.contains("dark")||k.matches);M(),k.addEventListener("change",M);let oe=new MutationObserver(M);return oe.observe(R,{attributes:!0,attributeFilter:["class"]}),()=>{k.removeEventListener("change",M),oe.disconnect()}},[]);let Ht=wo(de,Ee,O);Pt(()=>{let R=wo(de,Ee,O);if(R===null){de!==null&&Et(null),Ee!==null&&Qe(null);return}R!==Ee&&Qe(R)},[de,Ee,O]);let It=Ht===null?null:E.get(Ht)??null,wn=ht?"#475569":"#94A3B8",Ft=e.isStreamingComplete,Nn=e.isStreamingFailed,$e=Ft&&n.length===0,zt=(A||!f)&&!$e,ma=go(U,250),Mn=f!==null||$e,Pn=xe("div",{className:"flex flex-wrap items-center gap-1.5",children:[xe("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:l.treeNodeCountTitle,children:[F("span",{className:"text-[10px]",children:"\u{1F333}"})," ",l.treeNodeCountLabel," ",Mn?l.treeNodeCount(ma):"\u2026"]}),Nn&&!Ft?xe("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:l.treeStreamInterruptedTitle,children:[F("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),F("span",{className:"text-[10px]",children:"\u26D4"})," ",l.treeStreamInterrupted]}):Ft?zt?xe("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:l.treeBuildingTitle,children:[xe("span",{className:"relative flex h-1.5 w-1.5",children:[F("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),F("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),F("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",l.treeBuilding]}):xe("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:l.treeCompleteTitle,children:[F("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),F("span",{className:"text-[10px]",children:"\u2705"})," ",l.treeComplete]}):xe("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:l.treeStreamLoadingTitle,children:[xe("span",{className:"relative flex h-1.5 w-1.5",children:[F("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),F("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),F("span",{className:"text-[10px]",children:"\u23F3"})," ",l.treeStreamLoading]}),o&&xe("button",{type:"button",onClick:()=>v(!C),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${C?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:l.treeShowEntireCompanyTitle,children:[F("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",l.treeShowEntireCompany]}),ne.length>0?xe("div",{className:"flex items-center gap-1",children:[F("button",{type:"button",onClick:cn,className:"inline-flex h-11 w-11 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeExpandAll,title:l.treeExpandAllTitle,children:F(Il,{className:"h-4 w-4"})}),F("button",{type:"button",onClick:dt,className:"inline-flex h-11 w-11 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeCollapseAll,title:l.treeCollapseAllTitle,children:F(Hl,{className:"h-4 w-4"})})]}):null]}),un=ca(null),{isTwoColumn:Rn}=ra(un,Za,{mediaQuery:"(min-width: 768px)"});Oe&&(Rn||It===null)&&Te(!1);let Ln=ze(()=>({toggle:Rt,isExpanded:gt,expandMultiple:Lt,collapseMultiple:st,isPending:r}),[st,Lt,gt,Rt,r]),En=ze(()=>({onEntryClick:we,selectedPath:Ht}),[we,Ht]),lr=ze(()=>({className:Vl,lineColor:wn,iconOverrides:At,showDirectoryIcons:!!At,showFileIcons:!!At,highlightStyles:Kl,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[wn,At]),ga=F("div",{ref:re,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:F("div",{ref:B,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:Q.length>0?F(Dl,{entries:Q,expansion:Ln,selection:En,visual:lr,virtualScroll:Wt,locale:d,labels:u}):F("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:o?l.treeNoMatches:l.treeEmpty})})});return xe("div",{ref:un,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:Dt,children:[t&&Fl(Pn,t),Rn?xe(_l,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[F(vo,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:zl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ga}),F(Wl,{id:"contact-map-tree-handle",thickness:Bl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.treeResizeHandle}),F(vo,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Ul,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:F(Qt,{placement:"pane",contact:It,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):xe(Ql,{children:[ga,It?F(sa,{isOpen:Oe,onClose:Ot,title:l.detailHeading,children:F(Qt,{placement:"overlay",contact:It,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),Be&&_e&&F(zn,{contactData:_e,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:lt,onRequestClose:ln})]})};import{jsx as Sn,jsxs as en}from"react/jsx-runtime";var ed={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},td=e=>e==="tree"?"tree":"list",Ro=({context:e})=>{let t=G(),[n,a]=Zl(),[s,o]=Jl(null),r=td(n.get(Jt)),{setScrollableRef:c,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:p,onPointerCancel:i,onClickCapture:m}=ut(),h=Xl(x=>{let C=x==="tree"?"tree":"list";if(C===r)return;let v=new URLSearchParams(typeof window<"u"?window.location.search:"");C==="list"?v.delete(Jt):v.set(Jt,C),a(v,{replace:!0})},[r,a]);return en("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[en("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[en("div",{ref:c,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:ed,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:p,onPointerCancel:i,onClickCapture:m,children:[en("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>h("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 text-xs transition-colors ${r==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),en("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>h("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 text-xs transition-colors ${r==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),Sn("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),en("div",{className:"flex h-full flex-1 flex-col",children:[Sn("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?Sn(mo,{context:e}):null}),Sn("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?Sn(Po,{context:e,controlsContainer:s}):null})]})]})};import{memo as rd}from"react";se();se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as z}from"@aiquants/fuzzy-search";import{memo as nd,useId as Se}from"react";import{jsx as L,jsxs as W}from"react/jsx-runtime";var er=1e3,tr=nd(({searchOptions:e,setSearchOptions:t})=>{let n=G(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=Se(),c=Se(),d=Se(),l=Se(),u=Se(),p=Se(),i=Se(),m=Se(),h=Se(),x=Se(),C=Se(),v=[];v.push(W("div",{className:`${a} border-green-200 border-l-4 dark:border-green-400/60`,children:[W("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramSize}),L("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||z.ngramSize,onChange:f=>t(g=>({...g,ngramSize:parseInt(f.target.value,10)})),className:"h-11 w-full"}),W("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||z.ngramSize]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramSizeHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinNgramOverlap}),L("input",{id:c,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||z.minNgramOverlap,onChange:f=>t(g=>({...g,minNgramOverlap:parseInt(f.target.value,10)})),className:"h-11 w-full"}),W("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||z.minNgramOverlap]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinNgramOverlapHint})]})]},"index-build")),v.push(W("div",{className:`${a} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[W("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexThreshold}),L("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexThresholdHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramOverlapThreshold}),L("input",{id:u,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),v.push(W("div",{className:`${a} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[W("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexStrategy}),W("select",{id:l,value:e.indexWorkerOptions?.strategy??z.indexWorkerOptions?.strategy??"hybrid",onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:f.target.value}})),className:"min-h-11 rounded border border-gray-300 px-2 pointer-coarse:text-base text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[L("option",{value:"fast",children:n.indexStrategyFast}),L("option",{value:"accurate",children:n.indexStrategyAccurate}),L("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexStrategyHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinCandidatesRatio}),L("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinCandidatesRatioHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMaxCandidatesRatio}),L("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),v.push(W("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[W("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexJaroWinklerPrefix}),L("input",{id:m,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexJaroWinklerPrefixHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),W("label",{className:"flex min-h-11 items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[L("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:f.target.checked?void 0:er}}))}),n.noLimit]}),L("input",{id:h,type:"range",min:er,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?er:e.indexWorkerOptions.maxResults,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(f.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),W("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxResultsHint})]})]},"jaro")),v.push(W("div",{className:`${a} border-emerald-200 border-l-4 ${o?"":"opacity-50"} dark:border-emerald-400/60`,children:[W("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:x,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),L("input",{id:x,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(f.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),W("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexFieldWeightHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexPerfectMatchBonus}),L("input",{id:C,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(f.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),W("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexPerfectMatchBonusHint})]}),!o&&L("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:n.relevanceOnlyNotice})]},"relevance"));let H=Se(),A=Se();return v.push(W("div",{className:`${a} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[W("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:H,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentBase}),L("input",{id:H,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentBaseHint})]}),W("div",{className:"space-y-2",children:[L("label",{htmlFor:A,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentCoverage}),L("input",{id:A,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(f.target.value)}})),className:"h-11 w-full"}),W("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentCoverageHint})]})]},"containment")),W("section",{className:"space-y-3",children:[W("div",{className:"flex items-center justify-between gap-3",children:[W("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[L("span",{children:"\u{1F4CA}"}),L("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),L("button",{type:"button",onClick:()=>t(f=>({...f,indexWorkerOptions:{threshold:z.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:z.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:z.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:z.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:z.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:z.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:z.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:z.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:z.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:z.indexWorkerOptions?.strategy},ngramSize:z.ngramSize,minNgramOverlap:z.minNgramOverlap})),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded border border-green-300 bg-green-100 px-2 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),L("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:v})]})});tr.displayName="IndexWorkerSettings";se();import{DEFAULT_FUZZY_SEARCH_OPTIONS as me}from"@aiquants/fuzzy-search";import{memo as ad,useId as tn}from"react";import{jsx as te,jsxs as ae}from"react/jsx-runtime";var nr=1e3,ar=ad(({searchOptions:e,setSearchOptions:t})=>{let n=G(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=tn(),c=tn(),d=tn(),l=tn(),u=tn(),p=tn(),i=[];return i.push(ae("div",{className:`${a} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[ae("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),ae("div",{className:"space-y-2",children:[te("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinThreshold}),te("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??me.levenshteinWorkerOptions?.threshold,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,threshold:parseFloat(m.target.value)}})),className:"h-11 w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??me.levenshteinWorkerOptions?.threshold]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),ae("div",{className:"space-y-2",children:[te("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthSimilarity}),te("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??me.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(m.target.value)}})),className:"h-11 w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??me.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push(ae("div",{className:`${a} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[ae("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),ae("div",{className:"space-y-2",children:[te("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthPenalty}),te("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??me.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(m.target.value)}})),className:"h-11 w-full"}),ae("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??me.levenshteinWorkerOptions?.lengthDiffPenalty]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push(ae("div",{className:`${a} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[ae("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),te("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),ae("label",{className:"flex min-h-11 items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[te("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:m.target.checked?void 0:nr}}))}),n.noLimit]}),te("input",{id:l,type:"range",min:nr,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?nr:e.levenshteinWorkerOptions.maxResults,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:parseInt(m.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinMaxResultsHint})]},"max-results")),i.push(ae("div",{className:`${a} border-rose-200 border-l-4 ${o?"":"opacity-50"} dark:border-rose-400/60`,children:[ae("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),ae("div",{className:"space-y-2",children:[te("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),te("input",{id:u,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??me.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(m.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??me.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinFieldWeightHint})]}),ae("div",{className:"space-y-2",children:[te("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinPartialBonus}),te("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??me.levenshteinWorkerOptions?.partialMatchBonus,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,partialMatchBonus:parseFloat(m.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??me.levenshteinWorkerOptions?.partialMatchBonus]}),te("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinPartialBonusHint})]}),!o&&te("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:n.relevanceOnlyNotice})]},"relevance")),ae("section",{className:"space-y-3",children:[ae("div",{className:"flex items-center justify-between gap-3",children:[ae("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[te("span",{children:"\u{1F4CF}"}),te("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),te("button",{type:"button",onClick:()=>t(m=>({...m,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 border-purple-300 bg-purple-100 px-2 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),te("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});ar.displayName="LevenshteinWorkerSettings";import{jsx as Ye,jsxs as qe}from"react/jsx-runtime";var od={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},rr=rd(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:c})=>{let d=G(),{setScrollableRef:l,onPointerDown:u,onPointerMove:p,onPointerUp:i,onPointerLeave:m,onPointerCancel:h,onClickCapture:x}=ut();return qe("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[qe("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[qe("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",d.searchSettings]}),Ye("div",{className:"flex flex-wrap gap-1.5",children:qe("button",{type:"button",onClick:()=>t(C=>ea(C.workerUrls)),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded bg-red-500 px-1.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),Ye("div",{className:"mb-0 shrink-0",children:qe("div",{ref:l,role:"tablist","aria-label":d.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:od,onPointerDown:u,onPointerMove:p,onPointerUp:i,onPointerLeave:m,onPointerCancel:h,onClickCapture:x,children:[qe("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>c("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${r==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",d.settingsBasicTab]}),qe("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>c("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${r==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",d.settingsAdvancedTab]}),qe("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>c("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${r==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",d.indexWorkerName]}),qe("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>c("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${r==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),qe("div",{className:"flex flex-col gap-1",children:[Ye("div",{className:`${r==="basic"?"block":"hidden"}`,children:Ye(Ma,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})}),Ye("div",{className:`${r==="advanced"?"block":"hidden"}`,children:Ye(Na,{searchOptions:e,setSearchOptions:t})}),Ye("div",{className:`${r==="index"?"block":"hidden"}`,children:Ye(tr,{searchOptions:e,setSearchOptions:t})}),Ye("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:Ye(ar,{searchOptions:e,setSearchOptions:t})})]})]})});rr.displayName="SearchOptionsPanel";import{memo as ld,useCallback as dd}from"react";Ct();se();import{memo as sd}from"react";import{jsxs as or}from"react/jsx-runtime";var P=sd(({label:e,value:t,unit:n,color:a="text-gray-600 dark:text-slate-300"})=>or("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[or("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),or("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));P.displayName="StatItem";Ct();se();import{memo as id}from"react";import{jsx as N,jsxs as V}from"react/jsx-runtime";var nn=id(({kind:e,icon:t,stats:n,color:a})=>{let{locale:s,labels:o}=be(),r=O=>K(s,O);if(!n)return N("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:o.statsNoData});let c=n.basic||{},d=n.workerSpecific||{},l=n.analysis||{},u=c.totalSearches??0,p=c.totalProcessingTime??0,i=c.averageSearchTime??0,m=c.lastSearchTime??0,h=c.errorCount??0,x=c.timestamp,C=l.fieldPerformance||{},v=l.performanceInsights||{},H=l.recentHistory||[],A=d.specificMetrics||{},f=d.operationCount??0,g=d.operationDistribution||{},y=e==="index",T=e==="levenshtein",D=y?o.indexWorkerName:o.levenshteinWorkerName,b=A,S=A,Y="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",_="text-xs font-semibold transition-colors",ie=O=>{if(!O)return;let E=new Date(O);return Number.isNaN(E.getTime())?void 0:o.statsTimestamp(E)},Q=[];if(Q.push(V("div",{className:`${Y} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[V("div",{className:`${_} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),N(P,{label:o.statTotalSearches,value:r(u),color:a}),N(P,{label:o.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:a}),N(P,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),N(P,{label:o.statLastSearchTime,value:m.toFixed(2),unit:"ms",color:a}),N(P,{label:o.statErrorCount,value:h,color:h>0?"text-red-600 dark:text-red-400":a}),ie(x)&&N(P,{label:o.statUpdatedAt,value:ie(x),color:"text-gray-500 dark:text-slate-400"})]},"basic")),f>0||Object.keys(g).length>0){let O=Object.entries(g).sort(([,E],[,U])=>(Number(U)||0)-(Number(E)||0)).slice(0,6);Q.push(V("div",{className:`${Y} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[V("div",{className:`${_} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",o.statsOperationsHeading]}),N(P,{label:o.statTotalOperations,value:r(f),color:"text-amber-700 dark:text-amber-300"}),O.length>0&&N("div",{className:"mt-1 space-y-1",children:O.map(([E,U])=>N(P,{label:E,value:r(Number(U)),unit:o.timesUnit(r(Number(U))),color:"text-amber-700 dark:text-amber-300"},E))})]},"operations"))}if(y&&(Q.push(V("div",{className:`${Y} border-green-200 border-l-4 dark:border-green-400/60`,children:[V("div",{className:`${_} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),N(P,{label:o.statIndexBuilds,value:r(b.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),N(P,{label:o.statDataSize,value:r(b.currentDataSize??0),unit:o.itemsUnit(r(b.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),N(P,{label:o.statLastBuildTime,value:(b.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),b.cacheSize&&Q.push(V("div",{className:`${Y} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[V("div",{className:`${_} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",o.statsCacheHeading]}),N(P,{label:o.statCacheNgram,value:r(b.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),N(P,{label:o.statCacheWord,value:r(b.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),N(P,{label:o.statCachePhonetic,value:r(b.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),b.indexMetadata)){let O=Object.entries(b.indexMetadata).slice(0,6);O.length>0&&Q.push(V("div",{className:`${Y} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[V("div",{className:`${_} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),O.map(([E,U])=>{let ne;if(typeof U=="number"){let le=E.toLowerCase();le.includes("time")&&!le.includes("timestamp")?ne=`${U.toFixed(2)}ms`:le.includes("timestamp")||le.includes("at")?ne=ie(U)??U.toString():ne=r(U)}else ne=String(U);return N(P,{label:E,value:ne,color:"text-teal-700 dark:text-teal-300"},E)})]},"index-meta"))}if(T){if(Q.push(V("div",{className:`${Y} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[V("div",{className:`${_} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",o.statsCalculationsHeading]}),N(P,{label:o.statTotalCalculations,value:r(S.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statDistanceCalculations,value:r(S.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statAverageDistance,value:typeof S.averageDistance=="number"?S.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statMinDistance,value:S.minDistance??o.notAvailable,color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statMaxDistance,value:S.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),Q.push(V("div",{className:`${Y} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[V("div",{className:`${_} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),N(P,{label:o.statPartialMatches,value:r(S.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),N(P,{label:o.statPerfectMatches,value:r(S.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),N(P,{label:o.statEarlyTerminations,value:r(S.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),S.similarityThresholds&&Q.push(V("div",{className:`${Y} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[V("div",{className:`${_} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),N(P,{label:o.statAbove80,value:r(S.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),N(P,{label:o.statAbove60,value:r(S.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),N(P,{label:o.statAbove40,value:r(S.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),N(P,{label:o.statBelow40,value:r(S.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),S.distanceDistribution){let O=Object.entries(S.distanceDistribution).sort(([,E],[,U])=>Number(U)-Number(E)).slice(0,6);O.length>0&&Q.push(V("div",{className:`${Y} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[V("div",{className:`${_} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),O.map(([E,U])=>N(P,{label:o.statDistance(E),value:r(Number(U)),unit:o.timesUnit(r(Number(U))),color:"text-indigo-700 dark:text-indigo-300"},E))]},"lev-distance"))}if(S.queryLengthStats){let O=Object.entries(S.queryLengthStats).sort(([,E],[,U])=>(U.count??0)-(E.count??0)).slice(0,6);O.length>0&&Q.push(V("div",{className:`${Y} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[V("div",{className:`${_} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),O.map(([E,U])=>{let ne=Number(U.count??0),le=Number(U.averageScore??0);return N(P,{label:o.statQueryLength(E),value:o.statQueryLengthValue({count:ne,averagePercent:(le*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},E)})]},"lev-query-length"))}}if(Object.keys(C).length>0){let O=Object.entries(C).sort(([,E],[,U])=>(U.averageScore??0)-(E.averageScore??0)).slice(0,6);Q.push(V("div",{className:`${Y} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[V("div",{className:`${_} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),O.map(([E,U])=>{let ne=U;return V("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[N("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:E}),N(P,{label:o.statAverageScore,value:`${((ne.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statMatchCount,value:r(ne.matchCount??0),unit:o.itemsUnit(r(ne.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),N(P,{label:o.statBestWorstScore,value:`${((ne.bestScore??0)*100).toFixed(1)}% / ${((ne.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},E)})]},"field-performance"))}if(v.bestPerformingField||v.totalHistoryEntries||v.similarityDistribution){let O=(v.recentAverageResultCount??0).toFixed(1);Q.push(V("div",{className:`${Y} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[V("div",{className:`${_} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",o.statsInsightsHeading]}),v.bestPerformingField&&N(P,{label:o.statBestField,value:v.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),N(P,{label:o.statRecentAverageTime,value:(v.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),N(P,{label:o.statRecentAverageResults,value:O,unit:o.itemsUnit(O),color:"text-blue-700 dark:text-blue-300"}),N(P,{label:o.statThroughput,value:(v.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),N(P,{label:o.statCommonQueryLength,value:r(v.mostCommonQueryLength??0),unit:o.charactersUnit(r(v.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),N(P,{label:o.statHistoryEntries,value:r(v.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),v.similarityDistribution&&V("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[N(P,{label:o.statHighSimilarity,value:r(v.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),N(P,{label:o.statMediumSimilarity,value:r(v.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),N(P,{label:o.statLowSimilarity,value:r(v.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),N(P,{label:o.statVeryLowSimilarity,value:r(v.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return H.length>0&&Q.push(V("div",{className:`${Y} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[V("div",{className:`${_} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),H.slice(-3).reverse().map((O,E)=>V("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[N("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:O.operationType}),N("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:o.statsHistoryEntry({processingTimeMs:O.processingTime.toFixed(2),resultCount:O.resultCount??0})}),ie(O.timestamp)&&N("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:ie(O.timestamp)})]},`${O.operationType}-${O.timestamp??E}`))]},"recent-history")),V("section",{className:"space-y-2",children:[V("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[N("span",{children:t}),N("span",{className:"tracking-wide",children:D})]}),N("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:Q})]})});nn.displayName="WorkerStatsSection";import{jsx as Le,jsxs as Re}from"react/jsx-runtime";var cd={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},sr=ld(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:s,rebuildIndex:o,isIndexBuilding:r,activeTab:c,onTabChange:d})=>{let{locale:l,labels:u}=be(),p=t.trim(),i=p?a:n,{setScrollableRef:m,onPointerDown:h,onPointerMove:x,onPointerUp:C,onPointerLeave:v,onPointerCancel:H,onClickCapture:A}=ut(),f=c!=="index"||r,g=r?u.statsRebuildingTitle:c!=="index"?u.statsRebuildIndexTabOnlyTitle:u.statsRebuildTitle,y=f?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",T=r?`\u23F3 ${u.statsRebuilding}`:`\u{1F3D7}\uFE0F ${u.statsRebuild}`,D=dd(()=>{o().catch(()=>{})},[o]);return Re("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[Re("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[Re("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",u.searchStatistics]}),Re("div",{className:"flex flex-wrap gap-1.5",children:[Le("button",{type:"button",onClick:D,disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${y}`,title:g,children:T}),Re("button",{type:"button",onClick:s,className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded bg-red-500 px-1.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:u.statsResetTitle,children:["\u{1F504} ",u.reset]})]})]}),Le("div",{className:"mb-0 shrink-0",children:Re("div",{ref:m,role:"tablist","aria-label":u.statsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:cd,onPointerDown:h,onPointerMove:x,onPointerUp:C,onPointerLeave:v,onPointerCancel:H,onClickCapture:A,children:[Re("button",{type:"button",role:"tab","aria-selected":c==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${c==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",u.statsOverviewTab]}),Re("button",{type:"button",role:"tab","aria-selected":c==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${c==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",u.statsIndexTab]}),Re("button",{type:"button",role:"tab","aria-selected":c==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 text-[10px] transition-colors ${c==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",u.statsLevenshteinTab]})]})}),Re("div",{className:"flex flex-col gap-1 pb-0.5",children:[Re("div",{className:`${c==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[Le(P,{label:u.statTotalSearches,value:K(l,e.totalSearches)}),Le(P,{label:u.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Le(P,{label:u.statDataCount,value:K(l,e.itemCount)}),Le(P,{label:p?u.statResultCount:u.statDisplayedCount,value:K(l,i)})]}),Le("div",{className:`${c==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:Le(nn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),Le("div",{className:`${c==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:Le(nn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),Re("div",{className:"hidden",children:[Le(nn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),Le(nn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});sr.displayName="StatisticsPanel";import{Fragment as _o,jsx as Z,jsxs as ge}from"react/jsx-runtime";var yd=/[\u200B\uFEFF]/g,ir=typeof window<"u",Ao=ir&&typeof document<"u",pa=(e,t=[],n=!1)=>{let a=Wo(e);a.current=e,ot(()=>{if(!(!ir||n&&!Ao))return a.current()},[n,...t])},Lo=(e,t,n)=>{let[a,s]=Ue(()=>{let o=Eo(r=>r.getItem(e));return o&&t.includes(o)?o:n});return pa(()=>{Eo(o=>{o.setItem(e,a)})},[e,a]),[a,s]},Eo=e=>{if(!ir)return null;try{return e(window.sessionStorage)}catch{return null}},Oo=(e,t)=>{let[n,a]=Ue(e);return ot(()=>{let s=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},xd="contact-map.settings-tab",vd="contact-map.statistics-tab",Cd=["basic","advanced","index","levenshtein"],kd=["overview","index","levenshtein"],Do=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Sd={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ho=({streamState:e,...t}={})=>e===void 0?Z(Td,{...t}):Z(Io,{...t,streamState:e}),Td=e=>{let{context:t}=Zn();return Z(Io,{...e,streamState:t})},wd={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},Io=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,s=fe(e,"workerUrls"),o=at(),{locale:r,labels:c}=be(),{contactMapRecords:d,contactMapRecordMap:l,isStreamingComplete:u,isStreamingFailed:p}=t,i=fd(),[m]=bd(),h=Wo(null),[x,C]=Ue(!0),[v,H]=Ue(o.openEmailsWithGmail??!1),{indexWorker:A,levenshteinWorker:f}=Xt(o.workerUrls,s,wd),[g,y]=Ue(()=>ea({indexWorker:A,levenshteinWorker:f})),[T,D]=Ue(m.get("q")||""),b=Oo(T,g.debounceMs??ud.debounceMs);ot(()=>{let k=m.get("q")||"";D(M=>M!==k?k:M)},[m]),ot(()=>{if(typeof window>"u")return;let k=new URL(window.location.href);(k.searchParams.get("q")||"")!==b&&(b?k.searchParams.set("q",b):k.searchParams.delete("q"),window.history.replaceState(window.history.state,"",k.toString()))},[b]);let[S,Y]=hd(),[_,ie]=Ue("search"),[Q,O]=Lo(xd,Cd,"basic"),[E,U]=Lo(vd,kd,"overview"),{setScrollableRef:ne,onPointerDown:le,onPointerMove:ve,onPointerUp:gt,onPointerLeave:Rt,onPointerCancel:st,onClickCapture:Lt}=ut(),de=an(()=>{if(!Ao)return;let k=h.current;!k||document.activeElement===k||window.requestAnimationFrame(()=>{try{k.focus({preventScroll:!0})}catch{}})},[]),Et=an(k=>{let M=k;ie(M),M==="search"&&de()},[de]),Ee=mt(()=>({...g,debounceMs:0}),[g]),[Qe,Oe]=Ue("union"),Te=Qe==="intersection",Ot=Te?c.operatorAndTitle:c.operatorOrTitle,ht=an(k=>pd(k,Qe),[Qe]),$=mt(()=>({querySetsOf:ht}),[ht]),re=Oo(d,u?0:800),{searchTerm:B,setSearchTerm:it,filteredItems:Dt,resultTerm:_t,isSearching:Xe,isIndexBuilding:we,clearSearch:Tn,resetStats:sn,performanceMetrics:De,rebuildIndex:ln,error:lt}=md(re,Do,Ee,$),_e=B.trim().length>0,[Be,dn]=Ue(""),[Wt,At]=Ue(()=>B),cn=mt(()=>Bn(T),[T]),dt=mt(()=>Bn(b),[b]);ot(()=>{b===Be&&dt===B||Y(()=>{dn(b),it(dt)})},[b,Be,dt,B,it]);let Ht=an(k=>{let oe=k.target.value.replace(yd,"");D(oe)},[]),It=an(()=>{D(""),dn(""),Tn(),de()},[Tn,de]),wn=an(()=>{Oe(k=>k==="intersection"?"union":"intersection"),de()},[de]);pa(()=>{if(!(_==="search"&&i.state==="idle"&&!S))return;let M=document.activeElement;if(!!!(M?.matches('[role="tab"]')||M?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&M&&M!==document.body&&M!==h.current)return;let Ce=window.requestAnimationFrame(()=>{de()});return()=>{window.cancelAnimationFrame(Ce)}},[_,i.state,S,de],!0),pa(()=>{if(_!=="search")return;let k=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&de()}],[window,"pageshow",()=>{de()}]];for(let[M,oe,Ce]of k)M.addEventListener(oe,Ce);return()=>{for(let[M,oe,Ce]of k)M.removeEventListener(oe,Ce)}},[_,de],!0),ot(()=>(n&&n(_==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[_,n]),pa(()=>{let k=document.body,M=k.style.overflow;return _==="search"&&(k.style.overflow="hidden"),()=>{k.style.overflow=M}},[_],!0),ot(()=>{De&&Ge.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:De.totalSearches,averageSearchTime:De.averageSearchTime,itemCount:De.itemCount,resultsCount:De.resultsCount,workersAvailable:!!De.workerStats})},[De]);let{isAwaitingDebounce:Ft,isAwaitingSearchTermSync:Nn,isSearchInProgress:$e}=mt(()=>{let k=cn!==dt,M=dt!==B,oe=B.trim().length>0||cn.trim().length>0;return{isAwaitingDebounce:k,isAwaitingSearchTermSync:M,isSearchInProgress:S||Xe||_t!==B&<===null||oe&&we||k||M||Wt!==B}},[cn,dt,B,_t,lt,S,Xe,we,Wt]),[zt,ma]=Ue(B);ot(()=>{zt!==B&&ma(B)},[B,zt]),ot(()=>{Ft||Nn||S||Xe||we||zt===B&&Wt!==B&&At(B)},[B,Wt,Ft,Nn,S,Xe,we,zt]);let Mn=mt(()=>Er(Be,Do),[Be]),Pn=mt(()=>Mn(Dt),[Mn,Dt]),un=mt(()=>({contactMapRecords:d,contactMapRecordMap:l,filteredItems:Pn,searchQuery:Be,searchTerm:B,isSearching:Xe,isIndexBuilding:we,isPending:S,hasSearchTerm:_e,enableHighlighting:x,openEmailsWithGmail:v,isSearchInProgress:$e,isSearchTabActive:_==="search",errorMessage:lt??null,isStreamingComplete:u,isStreamingFailed:p}),[d,l,Pn,Be,B,Xe,we,S,_e,x,v,$e,_,lt,u,p]),Rn=_e?Dt.length:d.length,Ln=K(r,d.length),En=K(r,Dt.length);return Z("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${_==="search"?" h-full min-h-0":""}`,children:ge(Gn,{value:_,onValueChange:Et,className:`flex flex-col${_==="search"?" h-full min-h-0":""}`,children:[ge(yn,{ref:ne,style:Sd,className:"scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:le,onPointerMove:ve,onPointerUp:gt,onPointerLeave:Rt,onPointerCancel:st,onClickCapture:Lt,children:[ge(St,{value:"search",className:"min-h-11 min-w-16 px-2 py-0 text-xs transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",c.searchTab]}),ge(St,{value:"settings",className:"min-h-11 min-w-16 px-2 py-0 text-xs transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",c.searchSettings]}),ge(St,{value:"statistics",className:"min-h-11 min-w-16 px-2 py-0 text-xs transition-colors sm:min-w-24 sm:px-2.5 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",c.searchStatistics]})]}),Z(Tt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:ge("div",{className:"flex h-full flex-col",children:[Z("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:ge("div",{className:"flex flex-col",children:[Z("div",{className:"relative",children:ge("div",{className:"flex items-center gap-1 p-1",children:[ge("button",{type:"button",onClick:wn,"aria-pressed":Te,title:Ot,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:text-xs ${Te?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[Z("span",{className:"text-[10px] sm:text-xs",children:Te?c.operatorAnd:c.operatorOr}),Z("span",{className:"hidden text-[10px] sm:inline",children:Te?c.operatorAndHint:c.operatorOrHint})]}),Z("input",{ref:h,type:"text",value:T,onChange:Ht,placeholder:c.searchPlaceholder,className:"min-h-11 flex-1 rounded border border-gray-300 border-solid px-2 pointer-coarse:text-base text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),T&&Z("button",{type:"button",onClick:It,className:"flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border border-gray-300 px-1.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:$e?c.searchBusyTitle:c.clearSearch,"aria-label":$e?void 0:c.clearSearch,disabled:$e,children:$e?ge(_o,{children:[Z(gd,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),Z("span",{className:"hidden sm:inline",children:c.searching})]}):"\u2715"})]})}),ge("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[c.registeredCountLabel," ",Z("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Ln})," ",c.recordUnit(Ln),we?ge("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",c.rebuildingIndex]}):null,lt?ge("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",c.errorLabel,Z("span",{className:"ml-1 break-all font-semibold",children:lt})]}):null,_e&&ge("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",c.resultCountLabel,$e?Z("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:c.searching}):ge(_o,{children:[Z("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:En}),Z("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:c.resultUnit(En)})]})]})]}),Z("div",{className:"h-2.5 px-2 pb-1.5",children:we?Z(qr,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),a?a(un):Z(Ro,{context:un})]})}),Z(Tt,{value:"settings",className:"mt-0",children:Z(rr,{searchOptions:g,setSearchOptions:y,enableHighlighting:x,setEnableHighlighting:C,openEmailsWithGmail:v,setOpenEmailsWithGmail:H,activeTab:Q,onTabChange:O})}),Z(Tt,{value:"statistics",className:"mt-0",children:Z(sr,{performanceMetrics:De,searchTerm:B,totalDataCount:d.length,resultsCount:Rn,resetStats:sn,rebuildIndex:ln,isIndexBuilding:we,activeTab:E,onTabChange:U})})]})})};import{jsx as on,jsxs as zo}from"react/jsx-runtime";var Nd=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let a=G(),s=t===void 0?a.appTitle:t,{context:o,retryNow:r}=Zn(),c=on(za,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount,errorMessage:o.errorMessage,onRetry:r});return zo("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:c}):zo("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[on("h1",{className:"font-bold text-xl",children:s}),c]}),on("div",{className:"min-h-0 flex-1",children:on(Ho,{streamState:o,onFooterVisibilityChange:n})})]})},wg=e=>{let t=at(),n=fe(e,"streamEndpoint"),a=fe(e,"workerUrls"),s=fe(e,"locale"),o=fe(e,"labels"),r=Fo(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:Xt(t.workerUrls,a,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:o===void 0?t.labels:o}),[t,n,a,s,o]),c=s!==void 0,d=o!==void 0,l=Fo(()=>({locale:c?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[c,d]);return on(Ba,{config:r,chromeSurface:l,children:on(Nd,{...e})})};Ct();se();import{createShouldRevalidate as Md}from"@aiquants/route-revalidation";var Lg=Md({submissions:"url",query:{ignore:[Jt,"q"]}});export{Na as AdvancedSearchSettings,Ma as BasicSearchSettings,et as CONTACT_MAP_LABEL_CATALOGS,mn as CONTACT_MAP_LABEL_KEYS,Or as ContactDetailGrid,Qt as ContactDetailPanel,zn as ContactDetailPopup,Un as ContactDetailRowLayout,za as ContactMapAnnotation,wg as ContactMapAppView,bi as ContactMapConfigProvider,mo as ContactMapSearchListView,Ho as ContactMapSearchPage,Ro as ContactMapSearchTabGroup,Po as ContactMapSearchTreeView,Qn as ContactMapStreamClient,ue as HighlightedText,tr as IndexWorkerSettings,bp as LIST_COLLAPSE_THRESHOLD,pl as LIST_DETAIL_PANEL_MIN_WIDTH,yp as LIST_EXPAND_THRESHOLD,ul as LIST_PANEL_MIN_WIDTH,ml as LIST_RESIZE_HANDLE_THICKNESS,ar as LevenshteinWorkerSettings,qr as Progress,rr as SearchOptionsPanel,P as StatItem,sr as StatisticsPanel,sa as SwipeOverlay,Zp as TREE_COLLAPSE_THRESHOLD,Ul as TREE_DETAIL_PANEL_MIN_WIDTH,em as TREE_EXPAND_THRESHOLD,zl as TREE_PANEL_MIN_WIDTH,Bl as TREE_RESIZE_HANDLE_THICKNESS,Gn as Tabs,Tt as TabsContent,yn as TabsList,St as TabsTrigger,da as TreeWorkerSession,nn as WorkerStatsSection,Xn as assertContactMapStreamEndpoint,Ur as assertContactMapTreeWorkerUrl,mu as assertContactMapWorkerUrls,jl as composeTreeVirtualScrollOptions,Lg as contactMapShouldRevalidate,Ri as countContactMapCompanies,Ci as deserializeStreamRecord,Ti as getContactMapStreamClient,El as getTreeWorkerSession,Xt as layerContactMapWorkerUrls,Pu as resetContactMapStreamClientForTesting,Lp as resetTreeWorkerSessionForTesting,Ca as resolveContactMapLabels,go as useAnimatedNumber,at as useContactMapConfig,G as useContactMapLabels,Pi as useContactMapStream,Ga as useContactPanelSizing,Yr as useDynamicViewportHeight,ut as useHorizontalDragScroll,aa as useLongPressPopup,Cl as useReportPopupVisibility,ra as useResponsiveTwoColumnLayout,vl as useRowPopupRegistry,Zn as useStreamedContactMapContext,xo as useTreeWorker};
|