@aiquants/contact-map 0.25.1 → 0.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Fi=Object.create;var tr=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var zi=Object.getOwnPropertyNames;var Ui=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(e&&(t=e(e=0)),t);var Aa=(e,t)=>{for(var n in t)tr(e,n,{get:t[n],enumerable:!0})},Oa=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zi(t))!Vi.call(e,i)&&i!==n&&tr(e,i,{get:()=>t[i],enumerable:!(a=Bi(t,i))||a.enumerable});return e};var Ce=(e,t,n)=>(n=e!=null?Fi(Ui(e)):{},Oa(t||!e||!e.__esModule?tr(n,"default",{value:e,enumerable:!0}):n,e)),Ki=e=>Oa(tr({},"__esModule",{value:!0}),e);var et,Ut,$a,ln,cn,Pn,bt,Ye,nr,Gr,qr,st,le,Vt=Re(()=>{"use strict";et=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ut=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,$a=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=et(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},ln=e=>$a(e,["custom_email","email"]),cn=e=>$a(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=et(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},bt=(e,t)=>{let n=et(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ye=(e,t)=>String(e).padStart(t,"0"),nr=e=>`${Ye(e.getUTCFullYear(),4)}-${Ye(e.getUTCMonth()+1,2)}-${Ye(e.getUTCDate(),2)}`,Gr=e=>`${nr(e)} ${Ye(e.getUTCHours(),2)}:${Ye(e.getUTCMinutes(),2)}:${Ye(e.getUTCSeconds(),2)}`,qr=e=>`${Ye(e.getFullYear(),4)}-${Ye(e.getMonth()+1,2)}-${Ye(e.getDate(),2)} ${Ye(e.getHours(),2)}:${Ye(e.getMinutes(),2)}:${Ye(e.getSeconds(),2)}`,st=(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)},le=e=>e==null?"-":typeof e=="string"?et(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ie,Da,_t=Re(()=>{"use strict";ie=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":Da(e);case"function":return Da(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Da=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var dn,Oe,un=Re(()=>{"use strict";dn=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Oe=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var ji,rr,Yr=Re(()=>{"use strict";ji=(e,t)=>{let n=Array.from({length:t.length+1},(a,i)=>i);for(let a=1;a<=e.length;a+=1){let i=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,r))}n=i}return n[t.length]},rr=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let a;for(let i of t){let o=ji(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(a===void 0||o<a.distance)&&(a={key:i,distance:o})}return a?.key}});var St,or,Gi,se,Kt,ar,Ha,mn,lt,qi,Wa,Ia,Yi,Xr,Xi,Qi,Ji,ir,Qr,Jr,jt=Re(()=>{"use strict";St=require("@aiquants/directory-tree"),or=require("@aiquants/virtualscroll");Vt();_t();un();Yr();Gi=Object.freeze({en:"en-US",ja:"ja-JP"}),se=(e,t)=>t.toLocaleString(Gi[e]),Kt=(e,t,n)=>e==="1"?t:n,ar=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${se("en",e)} / ${se("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${se("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${se("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${se("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>Kt(e,"record","records"),companyUnit:e=>Kt(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=>Kt(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=>se("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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:qr,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=se("en",e);return`${n} ${Kt(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: ${se("en",t)}`,timesUnit:e=>Kt(e," time"," times"),itemsUnit:e=>Kt(e," item"," items"),charactersUnit:e=>Kt(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 (${se("ja",e)} / ${se("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${se("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${se("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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:qr,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})=>`${se("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: ${se("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Ha=Object.freeze(Object.keys(ar.en)),mn=Object.freeze([...St.DIRECTORY_TREE_LABEL_KEYS,...Ha]),lt=Object.freeze({en:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.en,...ar.en}),ja:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.ja,...ar.ja})}),qi=new Set(mn),Wa=Object.keys(lt).map(e=>JSON.stringify(e)).join(" or "),Ia=Object.freeze({locale:"locale",labels:"labels"}),Yi=(e,t,n)=>{e[t]=n},Xr=(e,t=Ia.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Wa} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(lt,e))throw new RangeError(`[contact-map] ${t} must be ${Wa} or left out; got ${ie(e)}`);return(0,or.resolveVirtualScrollLocale)(e)},Xi=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ie(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)},Qi=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!qi.has(i)){let r=rr(i,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 ${ie(i)}`)}let o=e[i];o!==void 0&&(Xi(n,i,o,t[i]),a[i]=o)}return a},Ji=e=>{let t={},n=!1;for(let a of St.DIRECTORY_TREE_LABEL_KEYS){let i=e[a];i!==void 0&&(t[a]=i,n=!0)}return n?t:void 0},ir=(e,t,n=Ia)=>{let a=Xr(e,n.locale);if(t===void 0)return lt[a];if(!dn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let i=Qi(t,lt[a],n.labels),r={...(0,St.resolveDirectoryTreeLabels)(a,Ji(i)),...ar[a]};for(let u of Ha){let d=i[u];d!==void 0&&Yi(r,u,d)}return Object.freeze(r)},Qr=e=>{let t={};for(let n of St.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},Jr=e=>{let t={};for(let n of or.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var Fa,Ba,ct,Ua,Zi,ea,Zr,za,He,ne,he=Re(()=>{"use strict";Fa=require("@aiquants/directory-tree"),Ba=require("@aiquants/virtualscroll"),ct=require("react");jt();Ua=require("react/jsx-runtime"),Zi=Object.freeze({locale:"en",labels:lt.en,treeLabels:Qr(lt.en),engineLabels:Jr(lt.en)}),ea=(0,ct.createContext)(Zi),Zr=(e,t)=>{let n=(0,ct.useRef)(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},za=({locale:e,labels:t,surface:n,children:a})=>{let i=Xr(e,n.locale),o=(0,ct.useMemo)(()=>ir(i,t,n),[i,t,n]),r=Zr(o,mn),u=Zr(Qr(r),Fa.DIRECTORY_TREE_LABEL_KEYS),d=Zr(Jr(r),Ba.VIRTUAL_SCROLL_LABEL_KEYS),c=(0,ct.useMemo)(()=>({locale:i,labels:r,treeLabels:u,engineLabels:d}),[i,r,u,d]);return(0,Ua.jsx)(ea.Provider,{value:c,children:a})},He=()=>(0,ct.useContext)(ea),ne=()=>(0,ct.useContext)(ea).labels});var s,k,q,m,re,I,tt,Va,we,Gt,w,At,Ka,pe=Re(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},k={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},q={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},re={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},I={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},tt={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Va={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},we={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},Gt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},w={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},At={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ka="#71829b"});var N,Ot,_,Pe=Re(()=>{"use strict";N="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",Ot="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",_=`${Ot} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var cr,dr,ur,mr,ta=Re(()=>{"use strict";pe();cr="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]",dr=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),ur=`absolute inset-0 ${At.scrim}`,mr=()=>!1});var es,ts,dt,ja,Ga,pn,fn=Re(()=>{"use strict";pe();es="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",ts=2,dt=`focus-visible:outline-2 ${w.focusVisibleOutline} focus-visible:outline-offset-2`,ja=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${w.activeRowOutline}`,Ga=ts,pn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${dt} ${es}`});function $e(...e){return(0,Ya.twMerge)((0,qa.clsx)(e))}var qa,Ya,An=Re(()=>{"use strict";qa=require("clsx"),Ya=require("tailwind-merge")});var Xa,Qa,Ja,Za,be,eo,Y,ns,Ue,rs,as,os,On,hn,is,ss,gn,na,ra,$n,aa=Re(()=>{"use strict";Xa=require("@aiquants/swipe-overlay"),Qa=Ce(require("lucide-react/dist/esm/icons/check.js")),Ja=Ce(require("lucide-react/dist/esm/icons/copy.js")),Za=Ce(require("lucide-react/dist/esm/icons/x.js")),be=require("react"),eo=require("react-dom");Vt();he();ta();pe();fn();Pe();An();Y=require("react/jsx-runtime"),ns=350,Ue=e=>e.stopPropagation(),rs=Object.freeze({onClick:Ue,onDoubleClick:Ue,onContextMenu:Ue,onPointerDown:Ue,onPointerUp:Ue,onMouseDown:Ue,onMouseUp:Ue,onTouchStart:Ue,onTouchEnd:Ue,onKeyDown:Ue,onKeyUp:Ue,onFocus:Ue,onBlur:Ue}),as=$e(cr,"flex items-center justify-center px-4 py-6"),os=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${q.borderControl} ${k.surface} p-4 shadow-lg transition-colors`,On=0,hn=null,is=()=>{let e=document.body.style;On+=1,On===1&&(hn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},ss=()=>{if(On=Math.max(0,On-1),On>0||!hn)return;let e=document.body.style;e.userSelect=hn.userSelect,typeof hn.webkitUserSelect<"u"&&(e.webkitUserSelect=hn.webkitUserSelect),hn=null},gn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},na=(e,t)=>{let n=new Set;return e.reduce((a,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return a;let{normalized:r,key:u,entry:d}=t(o,i);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},ra=({value:e,ariaLabel:t})=>{let[n,a]=(0,be.useState)(!1),i=(0,be.useRef)(null),o=(0,be.useCallback)(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=(0,be.useCallback)(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);a(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);(0,be.useEffect)(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Qa.default:Ja.default;return(0,Y.jsx)("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${q.borderControl} ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:r,"aria-label":t,title:t,children:(0,Y.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},$n=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=ne(),o=(0,be.useRef)(null),r=(0,be.useMemo)(()=>e.contacted_at?st(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=gn(e.full_name)??i.noName,d=gn(e.company_name),c=gn(e.department),f=gn(e.title),p=(0,be.useMemo)(()=>na([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(x,{fieldKey:P,label:K})=>({normalized:x,key:`${P}-${x.toLowerCase()}`,entry:S=>({fieldKey:P,label:K,value:S})})),[d,c,f,i]),l=(0,be.useMemo)(()=>na([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(x,{fieldKey:P,label:K})=>{let S=Pn(x);return{normalized:gn(x),key:(S??x).toLowerCase(),entry:ce=>({fieldKey:P,label:K,value:ce,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=(0,be.useMemo)(()=>na([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(x,{fieldKey:P,label:K})=>{let S=gn(x),R=bt(x,t),ce=!!R?.startsWith("https://mail.google.com");return{normalized:S,key:x.toLowerCase(),entry:j=>({fieldKey:P,label:K,value:j,href:R,isGmailLink:ce})}}),[e.custom_email,e.email,t,i]),b=l.length>0||g.length>0,T=(0,be.useId)(),M=(0,be.useCallback)(()=>{a(),o.current=null},[a]),L=(0,be.useCallback)(x=>x.ownerDocument.getElementById(T),[T]),{dialogProps:Q,backdropProps:X}=(0,Xa.useOverlayDialog)({isOpen:!0,onClose:M,isCloseBlocked:mr,initialFocus:L}),y=(0,be.useCallback)((x,P)=>{P.isGmailLink&&(x.preventDefault(),n(P.value))},[n]),h=(0,be.useCallback)((x,P)=>{if(!P.isGmailLink){o.current=null;return}let K=Date.now(),S=o.current;if(S&&S.email===P.value&&K-S.timestamp<=ns){o.current=null,x.preventDefault(),n(P.value);return}o.current={email:P.value,timestamp:K}},[n]);return(0,be.useEffect)(()=>(is(),ss),[]),(0,eo.createPortal)((0,Y.jsxs)("dialog",{...Q,...rs,"data-contact-popup-root":"true","aria-labelledby":T,className:as,style:dr,children:[(0,Y.jsx)("div",{...X,"data-contact-popup-backdrop":"",className:ur}),(0,Y.jsxs)("div",{"data-contact-popup-card":"",className:os,children:[(0,Y.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,Y.jsx)("h2",{id:T,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),(0,Y.jsx)("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:M,"aria-label":i.close,children:(0,Y.jsx)(Za.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?(0,Y.jsx)("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(x=>(0,Y.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Y.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.value}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]},x.fieldKey))}):null,(0,Y.jsxs)("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:l.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,Y.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value})}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,g.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:g.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,Y.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,target:x.isGmailLink?"_blank":void 0,rel:x.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:P=>y(P,x),onTouchEnd:P=>h(P,x),children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value}),x.isGmailLink?(0,Y.jsx)("span",{className:`mt-1 block ${_} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,r?(0,Y.jsxs)("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,Y.jsx)("span",{className:"text-xs",children:i.popupLastContactDate}),(0,Y.jsx)("span",{children:r})]}):null,b?null:(0,Y.jsx)("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});var xe,Dn,oa=Re(()=>{"use strict";pe();Pe();xe=require("react/jsx-runtime"),Dn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>(0,xe.jsxs)("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,xe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,xe.jsx)("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),(0,xe.jsx)("div",{className:`shrink-0 whitespace-nowrap ${Ot} ${s.fgMuted}`,children:i})]}),(0,xe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,xe.jsx)("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),(0,xe.jsx)("div",{className:"block sm:hidden",children:(0,xe.jsx)("span",{className:`w-full truncate text-left ${Ot} ${s.fgSecondary} leading-tight`,children:a})}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate font-medium ${s.fg}`,children:e}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fg}`,children:n}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fgSecondary}`,children:i}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),(0,xe.jsx)("div",{className:`hidden items-end justify-end ${Ot} ${s.fgMuted} xl:flex`,children:(0,xe.jsx)("span",{className:"truncate",children:r})})]})});var pr,yn,ro,ls,cs,ds,us,ao,oo,ms,ps,fs,gs,hs,ys,bs,Ss,io,so,to,no,fr,Cs,vs,ia,lo,sa=Re(()=>{"use strict";pr=require("@aiquants/fuzzy-search"),yn=require("@aiquants/select-box"),ro=/[​]/g,ls=/^[\s  ]+|[\s  ]+$/g,cs=/\s+/,ds=/^[\p{Script=Latin}\s]+$/u,us=/\p{Script=Latin}/u,ao=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),oo="union",ms=65377,ps=65439,fs=["\uFF9E","\uFF9F"],gs=(()=>{let e=new Map;for(let t=ms;t<=ps;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of fs){let i=(n+a).normalize("NFKC");i.length===1&&e.set(i,n+a)}}return e})(),hs=/[぀-ヿ]/u,ys=e=>{let t=Array.from(e,n=>gs.get(n)??n).join("");return hs.test(t)?null:t},bs=e=>(0,yn.normalizeText)(e.replace(ro,"").replace(ls,""),ao),Ss=e=>{if(!ds.test(e))return null;let t=(0,yn.romajiToKatakana)(e);return us.test(t)?null:t},io=e=>e.split(cs).filter(Boolean),so=e=>(0,pr.parseQuerySets)(e,oo).sets.map(({query:t})=>t),to=e=>so(e).flatMap(t=>io(t)),no=e=>(0,pr.formatQuerySets)({combine:oo,sets:Array.from(new Set(e),t=>({query:t}))}),fr=e=>{let t=so(e.replace(ro,"")).map(a=>io(bs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=Ss(a);if(i===null)return no(t);n.push(i)}return no(n)},Cs=e=>{let t=new Set([...to(e),...to(fr(e))]),n=new Set;for(let a of t)for(let i of(0,yn.getNormalizedVariants)(a,ao)){let o=i.trim();if(!o)continue;n.add(o);let r=ys(o);r!==null&&n.add(r)}return Array.from(n)},vs=/[.*+?^${}()|[\]\\]/g,ia=e=>{let t=Cs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(vs,"\\$&")).sort((a,i)=>i.length-a.length);return new RegExp(n.join("|"),"gi")},lo=(e,t)=>{let n=ia(e);if(n===null)return i=>i;let a=i=>t.some(o=>{let r=i[o];return typeof r=="string"&&r.search(n)!==-1});return i=>{let o=[],r=[];for(let u of i)a(u.item)?o.push(u):r.push(u);return[...o,...r]}}});var co,Ct,xs,Le,gr=Re(()=>{"use strict";co=require("react");sa();pe();Ct=require("react/jsx-runtime"),xs=`rounded ${At.mark} px-1 ${s.fg}`,Le=(0,co.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,Ct.jsx)(Ct.Fragment,{children:e});let a=ia(t);if(a===null)return(0,Ct.jsx)(Ct.Fragment,{children:e});let i=[],o=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}i.push((0,Ct.jsx)("mark",{className:xs,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),(0,Ct.jsx)(Ct.Fragment,{children:i})});Le.displayName="HighlightedText"});var uo={};Aa(uo,{ContactDetailGrid:()=>la,default:()=>Ts});var yr,Dt,hr,la,Ts,mo=Re(()=>{"use strict";yr=require("react");Vt();he();aa();oa();gr();Dt=require("react/jsx-runtime"),hr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},la=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let u=ne(),d=(0,yr.useMemo)(()=>ln(e),[e]),c=(0,yr.useMemo)(()=>cn(e),[e]),f=d.value??"-",p=c.value??"-",l=(0,yr.useMemo)(()=>st(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=hr(e.full_name)??u.noName,b=hr(e.company_name),T=hr(e.department),M=(L,Q="-")=>(0,Dt.jsx)(Le,{text:L??Q,query:t,enabled:n});return(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(Dn,{fullName:M(g),title:M(hr(e.title)),companyName:M(b),department:M(T),phoneNumber:p,email:M(f),updatedAtText:l}),o?(0,Dt.jsx)($n,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Ts=la});var Gl={};Aa(Gl,{AdvancedSearchSettings:()=>sr,BasicSearchSettings:()=>lr,CONTACT_MAP_LABEL_CATALOGS:()=>lt,CONTACT_MAP_LABEL_KEYS:()=>mn,ContactDetailGrid:()=>la,ContactDetailPanel:()=>Yt,ContactDetailPopup:()=>$n,ContactDetailRowLayout:()=>Dn,ContactMapAnnotation:()=>Cr,ContactMapAppView:()=>Kl,ContactMapConfigProvider:()=>Oo,ContactMapSearchListView:()=>ba,ContactMapSearchPage:()=>Ra,ContactMapSearchTabGroup:()=>Ma,ContactMapSearchTreeView:()=>Ea,ContactMapStreamAnnouncer:()=>Br,ContactMapStreamClient:()=>Hn,ContactMapStreamFailureNotice:()=>zr,HighlightedText:()=>Le,IndexWorkerSettings:()=>Pr,LIST_COLLAPSE_THRESHOLD:()=>rl,LIST_DETAIL_PANEL_MIN_WIDTH:()=>Zo,LIST_EXPAND_THRESHOLD:()=>al,LIST_PANEL_MIN_WIDTH:()=>Jo,LIST_RESIZE_HANDLE_THICKNESS:()=>ei,LevenshteinWorkerSettings:()=>_r,Progress:()=>fa,SearchOptionsPanel:()=>Ar,StatItem:()=>D,StatisticsPanel:()=>Dr,SwipeOverlay:()=>Kn,TREE_COLLAPSE_THRESHOLD:()=>yl,TREE_DETAIL_PANEL_MIN_WIDTH:()=>Ci,TREE_EXPAND_THRESHOLD:()=>bl,TREE_PANEL_MIN_WIDTH:()=>Si,TREE_RESIZE_HANDLE_THICKNESS:()=>vi,Tabs:()=>Wn,TabsContent:()=>Ht,TabsList:()=>bn,TabsTrigger:()=>Wt,TreeWorkerSession:()=>jn,WorkerStatsSection:()=>en,assertContactMapStreamEndpoint:()=>In,assertContactMapTreeWorkerUrl:()=>da,assertContactMapWorkerUrls:()=>ks,composeTreeVirtualScrollOptions:()=>xi,contactMapShouldRevalidate:()=>jl,countContactMapCompanies:()=>Io,deserializeStreamRecord:()=>Do,getContactMapStreamClient:()=>Wo,getTreeWorkerSession:()=>li,layerContactMapWorkerUrls:()=>Xt,resetContactMapStreamClientForTesting:()=>$s,resetTreeWorkerSessionForTesting:()=>gl,resolveContactMapLabels:()=>ir,useAnimatedNumber:()=>Ca,useContactMapConfig:()=>mt,useContactMapLabels:()=>ne,useContactMapStream:()=>Ho,useContactPanelSizing:()=>Lr,useDynamicViewportHeight:()=>ga,useHorizontalDragScroll:()=>vt,useLongPressPopup:()=>Un,useReportPopupVisibility:()=>ni,useResponsiveTwoColumnLayout:()=>Vn,useRowPopupRegistry:()=>ti,useStreamedContactMapContext:()=>Fn,useTreeWorker:()=>va});module.exports=Ki(Gl);var qt=require("@aiquants/fuzzy-search"),_n=require("react");he();pe();Pe();var ve=require("react/jsx-runtime"),sr=(0,_n.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=(0,_n.useId)(),r=(0,_n.useId)(),u=[];return u.push((0,ve.jsxs)("div",{className:`${a} ${I.sky} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ve.jsx)("label",{htmlFor:o,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),(0,ve.jsx)("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push((0,ve.jsxs)("div",{className:`${a} ${I.indigo} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ve.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),(0,ve.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),(0,ve.jsxs)("section",{className:"space-y-3",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ve.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[(0,ve.jsx)("span",{children:"\u26A1"}),(0,ve.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ve.jsx)("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${q.borderControl} ${k.muted} px-2 font-medium ${s.fgSecondary} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ve.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});sr.displayName="AdvancedSearchSettings";var $t=require("@aiquants/fuzzy-search"),ze=require("react");he();pe();Pe();var O=require("react/jsx-runtime"),lr=(0,ze.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=ne(),u=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=(0,ze.useId)(),f=(0,ze.useId)(),p=(0,ze.useId)(),l=(0,ze.useId)(),g=(0,ze.useId)(),b=(0,ze.useId)(),T=(0,ze.useId)(),M=(0,ze.useId)(),L=(0,ze.useId)(),Q=(0,ze.useId)(),X=[];return X.push((0,O.jsxs)("div",{className:`${u} ${I.blue} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,O.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),(0,O.jsx)("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),(0,O.jsxs)("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,O.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),X.push((0,O.jsxs)("div",{className:`${u} ${I.amber} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,O.jsxs)("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,O.jsx)("input",{id:f,type:"checkbox",checked:e.caseSensitive??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,O.jsxs)("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,O.jsx)("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,O.jsxs)("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,O.jsx)("input",{id:l,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,O.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,O.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),(0,O.jsxs)("select",{id:g,value:e.multiTermOperator??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,O.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,O.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),X.push((0,O.jsxs)("div",{className:`${u} ${I.emerald} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,O.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,O.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),(0,O.jsxs)("select",{id:b,value:e.sortBy||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,O.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,O.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,O.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),(0,O.jsxs)("select",{id:T,value:e.sortOrder||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,O.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),X.push((0,O.jsxs)("div",{className:`${u} ${I.purple} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,O.jsx)("label",{htmlFor:M,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),(0,O.jsxs)("select",{id:M,value:e.parallelSearchStrategy||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,O.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,O.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,O.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,O.jsxs)("label",{htmlFor:L,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,O.jsx)("input",{id:L,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,O.jsxs)("label",{htmlFor:Q,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,O.jsx)("input",{id:Q,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,O.jsxs)("section",{className:"space-y-3",children:[(0,O.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[(0,O.jsx)("span",{children:"\u{1F527}"}),(0,O.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,O.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:X})]})});lr.displayName="BasicSearchSettings";var ho=require("@aiquants/swipe-overlay"),yo=Ce(require("lucide-react/dist/esm/icons/badge-check.js")),bo=Ce(require("lucide-react/dist/esm/icons/building-2.js")),So=Ce(require("lucide-react/dist/esm/icons/calendar-clock.js")),Co=Ce(require("lucide-react/dist/esm/icons/check.js")),vo=Ce(require("lucide-react/dist/esm/icons/copy.js")),xo=Ce(require("lucide-react/dist/esm/icons/id-card.js")),To=Ce(require("lucide-react/dist/esm/icons/mail.js")),No=Ce(require("lucide-react/dist/esm/icons/phone.js")),Eo=Ce(require("lucide-react/dist/esm/icons/user-round.js")),Ve=require("react");Vt();var ut={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)};he();pe();var nt=Ce(require("@radix-ui/react-tabs")),br=Ce(require("react"));pe();An();var Sr=require("react/jsx-runtime"),Wn=nt.Root,bn=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.List,{ref:n,className:$e(`inline-flex h-10 items-center justify-center rounded-md ${k.muted} p-1 ${s.fgMuted}`,e),...t}));bn.displayName=nt.List.displayName;var Wt=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Trigger,{ref:n,className:$e(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${w.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${w.activeTabSurface} ${w.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Wt.displayName=nt.Trigger.displayName;var Ht=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Content,{ref:n,className:$e(`mt-2 ${w.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Ht.displayName=nt.Content.displayName;fn();Pe();gr();var E=require("react/jsx-runtime"),po=`truncate font-semibold ${s.fg} ${N}`,fo={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ns=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=ne(),p=!!(o&&a&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,E.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.subtle} px-2.5 py-1.5 transition-colors`,children:[(0,E.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,E.jsx)("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${k.surface} ${s.fgMuted} transition-colors`,children:(0,E.jsx)(e,{size:14})}),(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`font-medium ${_} ${s.fgMuted}`,children:t}),u?(0,E.jsx)("a",{href:u,className:`align-top ${po} ${pn}`,target:l,rel:l?"noopener noreferrer":void 0,children:(0,E.jsx)(Le,{text:n,query:d??"",enabled:c})}):(0,E.jsx)("div",{className:po,children:(0,E.jsx)(Le,{text:n,query:d??"",enabled:c})})]})]}),p?(0,E.jsx)("button",{type:"button",onClick:()=>o&&a&&i&&o(a,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverBlueAccentBorder} ${w.hoverBlueFg} ${dt}`,"aria-label":f.copyField(t),children:r?(0,E.jsx)(Co.default,{size:14}):(0,E.jsx)(vo.default,{size:14})}):null]})},go=({items:e,searchTerm:t,enableHighlighting:n})=>(0,E.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>(0,E.jsxs)("div",{className:`flex flex-col gap-0.5 rounded-md border ${q.borderSubtle} ${k.surface} px-2 py-1 transition-colors`,children:[(0,E.jsx)("dt",{className:`font-semibold ${_} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),(0,E.jsx)("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:(0,E.jsx)(Le,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ca=({title:e})=>(0,E.jsx)("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Es=()=>{let e=ne();return(0,E.jsxs)("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${q.borderSubtle} border-dashed ${k.surface} p-4 text-center transition-colors`,children:[(0,E.jsx)("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),(0,E.jsx)("p",{className:`${_} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Ms=Object.freeze({overlay:ho.SWIPE_OVERLAY_SCROLL_AREA_STYLE,pane:void 0}),Yt=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=ne(),[u,d]=(0,Ve.useState)(null),c=(0,Ve.useRef)(null),f=(0,Ve.useMemo)(()=>({...fo,...i}),[i]);(0,Ve.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=(0,Ve.useMemo)(()=>ln(e),[e]),l=(0,Ve.useMemo)(()=>cn(e),[e]),g=(0,Ve.useMemo)(()=>st(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=(0,Ve.useCallback)(async(S,R,ce)=>{try{await navigator.clipboard.writeText(R),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(j){ut.error("Failed to copy contact detail",j)}},[]);if(!e)return(0,E.jsx)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,style:fo,children:(0,E.jsx)(Es,{})});let T=[le(e.title),le(e.department)].filter(S=>S!=="-"),M=[T.join(" / "),le(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",L=et(e.full_name)??r.noName,Q=[{fieldKey:"full_name",label:r.fieldFullName,value:L},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:le(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:le(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:le(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:le(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:le(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:le(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:le(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:le(e.url)}],X=[{label:r.fieldCustomEmail,value:le(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:le(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:le(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:le(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:le(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:le(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:le(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:le(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:le(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:le(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:le(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:le(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:le(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:st(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:le(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:st(e.updated_at,r.recordDateTime)}],x=[{rowKey:"person_id",icon:xo.default,label:"person_id",value:le(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:To.default,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:bt(p.value,!1)},{rowKey:"primary_phone",icon:No.default,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Pn(l.value)},{rowKey:"contacted_at",icon:So.default,label:r.summaryLastContact,value:g}],P=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:X,recommendedKey:p.fieldKey??null,resolveHref:S=>bt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Pn(S!=null?String(S):null)}],K=[{value:"summary",label:r.detailTabSummary,content:(0,E.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,E.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,E.jsxs)("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,E.jsx)(bo.default,{size:16}),(0,E.jsx)("span",{children:(0,E.jsx)(Le,{text:le(e.company_name),query:n??"",enabled:a})})]}),T.length>0?(0,E.jsx)("div",{className:`${s.fgMuted} text-sm`,children:T.map((S,R)=>(0,E.jsxs)("span",{children:[R>0&&" / ",(0,E.jsx)(Le,{text:S,query:n??"",enabled:a})]},`header-line-${R}`))}):null]}),(0,E.jsx)("div",{className:"flex flex-col gap-3",children:x.map(S=>(0,E.jsx)(Ns,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:(0,E.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,E.jsx)(ca,{title:r.detailBasicProfile}),(0,E.jsx)(go,{items:Q,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:(0,E.jsx)("div",{className:"flex flex-col gap-4",children:P.map(({sectionKey:S,title:R,emptyText:ce,entries:j,recommendedKey:Ne,resolveHref:de})=>(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsx)(ca,{title:R}),j.length===0?(0,E.jsx)("p",{className:`${s.fgMuted} text-xs`,children:ce}):(0,E.jsx)("div",{className:"flex flex-col gap-2",children:j.map(z=>{let F=de(z.rawValue),ee=z.fieldKey===Ne;return(0,E.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.surface} px-3 py-2 transition-colors`,children:[(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`font-medium ${s.fgMuted} text-xs`,children:z.label}),(0,E.jsx)("div",{className:`wrap-break-word ${s.fg} text-sm`,children:F?(0,E.jsx)("a",{href:F,className:`text-inherit ${pn}`,children:(0,E.jsx)(Le,{text:z.value,query:n??"",enabled:a})}):(0,E.jsx)(Le,{text:z.value,query:n??"",enabled:a})})]}),ee?(0,E.jsxs)("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${re.emerald} px-2 py-0.5 font-semibold ${_} ${m.emerald} transition-colors`,children:[(0,E.jsx)(yo.default,{size:14}),r.preferred]}):null]},z.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:(0,E.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,E.jsx)(ca,{title:r.detailTabMeta}),(0,E.jsx)(go,{items:h,searchTerm:n,enableHighlighting:a})]})}];return(0,E.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[(0,E.jsx)("div",{className:`${q.borderSubtle} border-b px-3 py-1.5 transition-colors ${k.subtle}`,children:(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${re.blue} ${m.blue} transition-colors`,children:(0,E.jsx)(Eo.default,{size:16})}),(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:(0,E.jsx)(Le,{text:L,query:n??"",enabled:a})}),(0,E.jsx)("div",{className:`truncate ${_} ${s.fgMuted}`,children:(0,E.jsx)(Le,{text:M,query:n??"",enabled:a})})]})]})}),(0,E.jsxs)(Wn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,E.jsx)(bn,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${q.borderSubtle} border-b ${k.subtle} px-2 py-1 transition-colors`,children:K.map(S=>(0,E.jsx)(Wt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${N} transition-colors ${w.activeTabSurface} ${w.activeTabBlueFg}`,children:(0,E.jsx)("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),K.map(S=>(0,E.jsx)(Ht,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Ms[t],children:S.content},S.value))]})]})};var Mo=require("react");jt();he();pe();var Ke=require("react/jsx-runtime"),Cr=(0,Mo.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=He(),u=se(o,e),d=se(o,t);return(0,Ke.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationTotalLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?(0,Ke.jsx)("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?r.annotationStreamingProgress({loaded:a,total:i,percent:Math.min(100,Math.round(a/i*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?(0,Ke.jsx)("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});Cr.displayName="ContactMapAnnotation";var Pa=require("react");un();_t();var vr=e=>e==="unauthenticated"||e==="forbidden";function xr(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ie(e)}`)}function Lo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ie(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ie(e)}`)}var Sn=require("react");_t();un();he();_t();un();Yr();var Ls=["indexWorker","levenshteinWorker","treeWorker"];function ko(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)}}var wo={setting:"workerUrls"},Ro=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Ls,hints:i={}}=t;if(!dn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ie(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(i,r.key)?i[r.key]:void 0,c=d===void 0?rr(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}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ie(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;ko(n,f,c),c!==void 0&&(u[f]=c)}return u};function ks(e,t=wo){Ro(e,t)}function da(e){ko("workerUrls","treeWorker",e)}var Xt=(e,t,n=wo)=>{let a=Ro(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}};var Tr=require("react/jsx-runtime"),Po=e=>{if(!dn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ie(e)}`);let t=e;return{streamEndpoint:Oe(t,"streamEndpoint"),openEmailsWithGmail:Oe(t,"openEmailsWithGmail"),treeWorkerFactory:Oe(t,"treeWorkerFactory"),workerUrls:Xt(void 0,Oe(t,"workerUrls")),locale:Oe(t,"locale"),labels:Oe(t,"labels")}},_o=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:i})}))},ws=_o(Po({})),Ao=(0,Sn.createContext)(ws),Rs=Object.freeze({locale:"locale",labels:"labels"});function ua({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:u,labels:d}=Po(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=(0,Sn.useMemo)(()=>_o({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,i,o,c,f,p,u,d]);return(0,Tr.jsx)(Ao.Provider,{value:l,children:(0,Tr.jsx)(za,{locale:u,labels:d,surface:t,children:n})})}function Oo({config:e,children:t}){return(0,Tr.jsx)(ua,{config:e,chromeSurface:Rs,children:t})}function mt(){return(0,Sn.useContext)(Ao)}var Ie=require("react");var $o=require("@aiquants/auth-core");_t();var Ps=1e3,_s=3e4,As=6;function In(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${ie(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ie(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${ie(e)}`)}var Do=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}),Os=e=>Array.isArray(e.records),Hn=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,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};In(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ps,this.maxRetryDelayMs=t.maxRetryDelayMs??_s,this.maxConsecutiveFailures=t.maxConsecutiveFailures??As,this.logger=t.logger??ut}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"unauthenticated":case"forbidden":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(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});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 i=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let 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"}),n=(0,$o.accessFailureKindOfStatus)(t.status);if(n!==null)return{accessFailure:n};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 a=t.body.getReader(),i=new TextDecoder,o="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=i.decode(c,{stream:!0}),p=(o+f).split(`
2
- `);o=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let T;try{T=JSON.parse(b)}catch(M){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",M);continue}if("type"in T&&T.type==="METADATA"){Number.isSafeInteger(T.total)&&T.total>=0&&this.setState({totalCount:T.total});continue}if(!Os(T)){this.logger.warn("[ContactMapStream] server reported error:","error"in T?T.error:""),u=!0;continue}for(let M of T.records)M&&typeof M.person_id=="number"&&(this.recordMap.set(M.person_id,Do(M)),l=!0);T.nextCursor&&(this.lastCursor=T.nextCursor),T.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"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 rt=null,Wo=e=>{if(rt!==null&&rt.endpoint===e)return rt;if(In(e),rt===null)return rt=new Hn({endpoint:e}),rt;if(rt.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(rt.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 rt},$s=()=>{rt?.dispose(),rt=null},Ds=new Map,Ws={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},Hs=()=>{let{streamEndpoint:e}=mt();return(0,Ie.useMemo)(()=>(In(e),e),[e])};function Ho(){let e=Hs(),t=(0,Ie.useCallback)(()=>Wo(e),[e]);(0,Ie.useEffect)(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=(0,Ie.useCallback)(r=>t().subscribe(r),[t]),a=(0,Ie.useSyncExternalStore)(n,()=>t().getState(),()=>Ws),i=(0,Ie.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>Ds),o=(0,Ie.useCallback)(()=>t().retryNow(),[t]);return(0,Ie.useMemo)(()=>({...a,recordMap:i,retryNow:o}),[a,i,o])}var Io=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 Fn(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:u,retryNow:d}=Ho(),c=(0,Ie.useMemo)(()=>Io(e),[e]);return{context:(0,Ie.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||vr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:i,companyCount:c,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,u,i,c,o,r]),retryNow:d}}he();var Hr=require("@aiquants/fuzzy-search"),Ai=require("@aiquants/fuzzy-search/react"),Oi=Ce(require("lucide-react/dist/esm/icons/search.js")),G=require("react"),Ir=require("react-router");sa();un();var je=require("react"),vt=e=>{let t=(0,je.useRef)(null),n=(0,je.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,i=(0,je.useCallback)(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=(0,je.useCallback)(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);(0,je.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=(0,je.useCallback)(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=(0,je.useCallback)(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=(0,je.useCallback)(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=(0,je.useCallback)(p=>{d(p)},[d]),f=(0,je.useCallback)(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};jt();he();var Fo=require("@aiquants/fuzzy-search"),Is="@aiquants/contact-map:search",Nr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=Fo.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerId:Is,workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};var Fs="[data-contact-map-search-page]",Bs="[data-contact-map-search-field]",Bo='[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]',zs=[Bs,Bo],Us="(pointer: coarse)",ma=e=>e!==null&&typeof e.matchMedia=="function"&&e.matchMedia(Us).matches,zo=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(Fs);if(n!==null)return n}return null},Uo=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;let a=ma(t.defaultView)?[Bo]:zs;for(let i of a){let o=e.querySelector(i);if(o!==null&&(o.focus(),t.activeElement===o))return o}return null};pe();pe();An();var pa=require("react/jsx-runtime");function fa({value:e,max:t=100,className:n,indicatorClassName:a,...i}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return(0,pa.jsx)("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:$e(`relative h-2 w-full overflow-hidden rounded-full ${At.progressTrack}`,n),...i,children:(0,pa.jsx)("div",{"data-slot":"progress-indicator",className:$e(`h-full rounded-full ${tt.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}Pe();var Cn="view";var Rr=require("react"),Ei=require("react-router");he();pe();Pe();var Qt=require("@aiquants/resize-panels"),Tn=require("@aiquants/virtualscroll"),W=require("react");Vt();var Bn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},zn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Er(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,i=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:i}}var vn=require("react"),ga=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:i=240}=t??{},[o,r]=(0,vn.useState)(600),u=(0,vn.useCallback)(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=R=>Number.parseFloat(R)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),T=c(l.getPropertyValue("--scrollbar-height")),M=window.getComputedStyle(d),L=c(M.marginBottom),Q=c(M.paddingBottom),X=window.innerHeight-g-T-a,y=p?Math.min(p.bottom,X):X,h=p?Math.max(p.top,b):b,x=Math.max(f,h),P=y-x-L-Q,K=Number.isFinite(P)?Math.floor(P):0,S=K>0?K:i;S>0&&Number.isFinite(S)&&r(R=>Math.abs(R-S)>1?S:R)},[a,e,i]);return(0,vn.useEffect)(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};var Te=require("react"),Vs=600,Vo=8,Un=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=(0,Te.useState)(!1),[r,u]=(0,Te.useState)(null),d=(0,Te.useRef)(null),c=(0,Te.useRef)(!1),f=(0,Te.useRef)(null),p=(0,Te.useRef)({onSelect:t,resolveItem:n,item:a});(0,Te.useEffect)(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=(0,Te.useCallback)(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=(0,Te.useCallback)(()=>{f.current&&(l(),f.current=null)},[l]),b=(0,Te.useCallback)(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let x=p.current,P=null;x.item!==void 0?P=x.item:x.resolveItem&&h.target&&(P=x.resolveItem(h.target)),P!==null&&(c.current=!0,x.onSelect?.(P),u(P),o(!0)),g()},Vs))},[l,g]),T=(0,Te.useCallback)(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),M=(0,Te.useCallback)(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),L=(0,Te.useCallback)(()=>{c.current=!1},[]),Q=(0,Te.useCallback)(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let x=Math.abs(h.clientX-f.current.x),P=Math.abs(h.clientY-f.current.y);(x>Vo||P>Vo)&&(l(),f.current=null)},[l]),X=(0,Te.useCallback)(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),y=(0,Te.useCallback)(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return(0,Te.useEffect)(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let x=[["pointerdown",b,void 0],["pointerup",T,void 0],["pointercancel",T,void 0],["pointermove",Q,void 0],["pointerleave",T,void 0],["contextmenu",X,void 0]],P=[["mousedown",M,!0],["mouseup",M,!0],["click",M,!0],["pointerdown",L,!0],["keydown",L,!0],["contextmenu",X,!0],["pointerup",T,!0],["pointercancel",T,!0]];for(let[K,S,R]of x)h.addEventListener(K,S,R);for(let[K,S,R]of P)window.addEventListener(K,S,R);return()=>{for(let[K,S,R]of x)h.removeEventListener(K,S,R);for(let[K,S,R]of P)window.removeEventListener(K,S,R);l()}},[e,b,T,Q,M,L,X,l]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};var xt=require("react");function Vn(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",i=(0,xt.useSyncExternalStore)((0,xt.useCallback)(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=(0,xt.useState)(!1),[u,d]=(0,xt.useState)(0);return(0,xt.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(T=>T&&b>=t.expandThreshold?!1:!T&&b<t.collapseThreshold?!0:T))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}he();_t();var Ko=e=>e.isComposing||e.keyCode===229;var jo=(e,t)=>{if(Gs(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Ko(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 js(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}},Ks=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),js=e=>Ks.has(e),Gs=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:i}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ie(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ie(i)}`);let o=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 ${ie(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ie(t)}`)};pe();var xn=require("@aiquants/swipe-overlay"),Mr=require("react");he();ta();pe();fn();An();var Tt=require("react/jsx-runtime"),qs=$e(cr,"flex overflow-hidden"),Ys=$e(ur,"motion-safe:transition-opacity motion-safe:duration-200"),Xs=`relative ml-auto flex h-full w-full max-w-lg flex-col ${k.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Qs=`flex shrink-0 items-center justify-between gap-3 ${q.borderSubtle} border-b px-3 py-2`,Js=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Zs=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${w.hoverMuted} ${dt}`,el="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Kn=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=ne(),r=(0,Mr.useId)(),u=(0,xn.useOverlayPresence)(e),d=(0,Mr.useCallback)(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=(0,xn.useSwipeOverlayDialog)({isOpen:e,onClose:t,isCloseBlocked:mr,skipWhenTextSelected:!0,initialFocus:d});return u?(0,Tt.jsxs)("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:$e(qs,e&&!g?"pointer-events-auto":"pointer-events-none"),style:dr,children:[(0,Tt.jsx)("div",{...f,"data-contact-map-overlay-backdrop":"",className:$e(Ys,e?"opacity-100":"opacity-0")}),(0,Tt.jsxs)("div",{...p,"data-contact-map-overlay-panel":"",className:$e(Xs,e?"pointer-events-auto":"pointer-events-none",a),children:[(0,Tt.jsxs)("div",{className:Qs,children:[(0,Tt.jsx)("h2",{id:r,tabIndex:-1,className:Js,children:i===void 0?o.overlayTitle:i}),(0,Tt.jsx)("button",{type:"button",className:Zs,onClick:()=>l(),children:o.close})]}),(0,Tt.jsx)("div",{"data-contact-map-overlay-body":"",className:el,style:xn.SWIPE_OVERLAY_SCROLL_AREA_STYLE,children:n})]})]}):null};fn();Pe();oa();var $=require("react/jsx-runtime"),tl=(0,W.lazy)(async()=>({default:(await Promise.resolve().then(()=>(mo(),uo))).default})),ha=64,Go="h-[64px]",qo=240,nl=4,ya=Er(Bn),Jo=Bn.listPanelMinWidth,Zo=Bn.detailPanelMinWidth,ei=Bn.handleThickness,rl=ya.collapseThreshold,al=ya.expandThreshold,ol=({contactData:e})=>{let t=ne(),n=et(e?.full_name)??t.noName,a=et(e?.title)??"-",i=et(e?.company_name)??"-",o=et(e?.department)??"-",r=ln(e).value??"-",u=cn(e).value??"-",d=st(e?.updated_at,t.recordDateTime);return(0,$.jsx)(Dn,{fullName:n,title:a,companyName:i,department:o,phoneNumber:u,email:r,updatedAtText:d})},il=e=>({"--contact-panel-height":`${e}px`}),sl=e=>typeof e=="object"&&e!==null&&"item"in e,ll=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,cl=(e,t)=>{for(let n of e){let a=Ut(n);if(a?.person_id===t)return a}return null},Yo=(e,t)=>t!==null&&Ut(e)?.person_id===t,Xo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ut(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Qo=(e,t,n)=>{let a=Xo(e,t,n);return a!==null?a:Xo(e,t-n,n===1?-1:1)},Lr=(e,t,n)=>{let{viewportHeight:a}=ga(t,{enableMutationObserver:!0,bottomGap:nl,minFallbackHeight:qo}),[i,o]=(0,W.useState)(0),r=(0,W.useCallback)(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),T=Math.ceil(b.top-g.top);Number.isFinite(T)&&T>0&&o(M=>Math.abs(M-T)>1?T:M)},[t,n]);(0,W.useLayoutEffect)(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:qo,d=i>0?i:0,c=u+d,f=(0,W.useMemo)(()=>il(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},dl=new Set,ti=()=>{let[e,t]=(0,W.useState)(dl),n=(0,W.useCallback)((a,i)=>{t(o=>{if(o.has(a)===i)return o;let r=new Set(o);return i?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},ni=(e,t,n)=>{let a=(0,W.useRef)(n);(0,W.useLayoutEffect)(()=>{a.current=n},[n]),(0,W.useEffect)(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},ri=(0,W.memo)(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=ne(),b=(0,W.useRef)(null),T=(0,$.jsx)("div",{className:Go}),M=sl(e)?e:null,L=Ut(e),{isPopupVisible:Q,handleClosePopup:X}=Un({ref:b,onSelect:u,item:L?.person_id});if(ni(L?.person_id??null,Q,l),!e||!L)return T;let{person_id:y}=L,h=t%2===0?k.surface:k.subtle,x=`${re.blue} ring-1 ${w.selectedRing}`,P=i?x:h,K=["B","F"].map(S=>ll(S,S==="B"?M?.baseScore:M?.score)).filter(Boolean);return(0,$.jsxs)("div",{ref:b,id:(0,Tn.virtualScrollItemElementId)(a,y),className:`flex ${Go} w-full items-center overflow-hidden ${q.borderSubtle} border-b px-4 py-2 text-left transition-colors ${w.hoverBlueTint} ${P} ${ja}`,style:{height:ha},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(y),children:[(0,$.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,$.jsx)("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),(0,$.jsx)("div",{className:`truncate ${Ot} ${s.fgSecondary} leading-tight`,children:y}),(0,$.jsx)("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${Ot} ${s.fgMuted} leading-tight`,children:K.length?K.map(S=>(0,$.jsx)("span",{children:S},S)):(0,$.jsx)("span",{children:"-"})})]}),(0,$.jsx)(W.Suspense,{fallback:(0,$.jsx)(ol,{contactData:L}),children:(0,$.jsx)(tl,{contactData:L,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:Q,onRequestClose:X})})]})});ri.displayName="ContactListRow";var ba=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=He(),p=(0,W.useRef)(null),l=(0,W.useRef)(null),[g,b]=(0,W.useState)(null),{normalizedViewportHeight:T,panelSizingStyle:M}=Lr(u,l,p),{isAnyPopupVisible:L,handlePopupVisibilityChange:Q}=ti(),X=(0,W.useMemo)(()=>({enablePointerDrag:!L,enableKeyboardNavigation:!1}),[L]),y=(0,W.useMemo)(()=>i?n:t,[i,n,t]),[h,x]=(0,W.useState)(null),P=(0,W.useCallback)(te=>{b(te),x(te)},[]),K=(0,W.useCallback)(te=>{if(!r)return;let ye=te.trim();if(!ye||ye==="-"||typeof window>"u")return;let ae=bt(ye,!0);ae&&window.open(ae,"_blank","noopener,noreferrer")},[r]),[S,R]=(0,W.useState)(!1),ce=(0,W.useCallback)(()=>R(!1),[]),j=(0,W.useCallback)(te=>{P(te),R(!0)},[P]),Ne=(0,W.useId)(),de=(0,W.useId)(),z=(0,W.useRef)(null),F=y.length,ee=(0,W.useCallback)((te,ye)=>(0,$.jsx)(ri,{entry:te,index:ye,itemCount:F,listboxId:Ne,isSelected:Yo(te,g),isActive:Yo(te,h),onSelect:j,onLongPressSelect:P,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:K,onPopupVisibilityChange:Q}),[F,Ne,g,h,j,P,a,o,r,K,Q]),fe=(0,W.useMemo)(()=>{let te=new Map;return y.forEach((ye,ae)=>{let gt=Ut(ye);gt!==null&&te.set(gt.person_id,ae)}),te},[y]),Ee=h===null?null:fe.get(h)??null,Fe=g===null?null:fe.get(g)??null,It=Math.max(1,Math.floor(T/ha)),tn=(0,W.useCallback)(te=>{if(te.target.id!==Ne)return;let ye=jo(te.nativeEvent,{activeIndex:Ee,startIndex:Fe===null?0:Fe,itemCount:F,pageSize:It});if(ye===null)return;if(te.preventDefault(),ye.kind==="activate"){Ee!==null&&h!==null&&j(h);return}let ae=Qo(y,ye.index,ye.direction);ae!==null&&(x(ae.personId),z.current?.scrollToIndex(ae.index,{align:"nearest"}))},[Ne,Ee,Fe,F,It,h,j,y]),Mt=(0,W.useCallback)(te=>{if(te.target.id!==Ne||Ee!==null||!te.target.matches(":focus-visible"))return;let ye=Qo(y,Fe===null?0:Fe,1);ye!==null&&x(ye.personId)},[Ne,Ee,Fe,y]),nn=(0,W.useMemo)(()=>({id:Ne,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":de}),[Ne,c.listboxLabel,de]),Me=(0,W.useCallback)(te=>y[te],[y]),rn=(0,W.useCallback)(te=>Ut(y[te])?.person_id??`row-${te}`,[y]),Qe=(0,W.useCallback)(()=>ha,[]),ft=(0,W.useMemo)(()=>({enabled:!0,renderVisual:Tn.tapScrollCircleSampleVisual}),[]),Je=(0,W.useMemo)(()=>g===null?null:cl(y,g),[g,y]);(0,W.useEffect)(()=>{g!==null&&!Je&&b(null)},[g,Je]);let qe=(0,W.useRef)(null),{isTwoColumn:an}=Vn(qe,ya);S&&(an||Je===null)&&R(!1);let Lt=(0,$.jsxs)("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,$.jsx)("div",{className:`hidden rounded-t-lg border ${q.borderSubtle} ${k.subtle} px-4 py-2 transition-colors sm:block`,children:(0,$.jsxs)("div",{className:"flex items-center",children:[(0,$.jsxs)("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${_} ${s.fgSecondary} uppercase tracking-wider`,children:[(0,$.jsx)("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),(0,$.jsx)("span",{className:"leading-tight",children:c.columnId}),(0,$.jsx)("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),(0,$.jsxs)("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,$.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,$.jsx)("span",{children:c.columnName}),(0,$.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),(0,$.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,$.jsx)("span",{children:c.columnCompany}),(0,$.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),(0,$.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,$.jsx)("span",{children:c.columnPhone}),(0,$.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),(0,$.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,$.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),(0,$.jsx)("p",{id:de,hidden:!0,children:c.listKeyboardHelp}),(0,$.jsx)("div",{ref:l,className:"flex-1",onKeyDown:tn,onFocus:Mt,children:(0,$.jsx)(Tn.VirtualScroll,{ref:z,contentProps:nn,activeItemIndex:F===0?void 0:Ee,activeItemVisibleInset:Ga,itemCount:F,getItemKey:rn,behaviorOptions:X,getItem:Me,getItemHeight:Qe,viewportSize:T,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ft},locale:d,labels:f,className:`w-full rounded-b-lg border ${q.borderSubtle} border-t-0 ${k.surface} pr-0.75 transition-colors`,children:(te,ye)=>ee(te,ye)})}),n.length===0&&i?(0,$.jsx)("div",{className:"py-8 text-center",children:(0,$.jsx)("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,F===0&&!i?(0,$.jsx)("div",{className:"py-8 text-center",children:(0,$.jsx)("p",{className:s.fgMuted,children:c.listNoData})}):null]});return(0,$.jsx)("div",{ref:qe,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:M,children:an?(0,$.jsxs)(Qt.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,$.jsx)(Qt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Jo,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Lt}),(0,$.jsx)(Qt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:ei,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),(0,$.jsx)(Qt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Zo,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,$.jsx)(Yt,{placement:"pane",contact:Je,searchTerm:a,enableHighlighting:o})})]}):(0,$.jsxs)($.Fragment,{children:[Lt,Je?(0,$.jsx)(Kn,{isOpen:S,onClose:ce,title:c.detailHeading,children:(0,$.jsx)(Yt,{placement:"overlay",contact:Je,searchTerm:a,enableHighlighting:o})}):null]})})};var fi=require("@aiquants/directory-tree"),Zt=require("@aiquants/resize-panels"),gi=require("@aiquants/virtualscroll"),hi=Ce(require("@heroicons/react/24/solid/FolderMinusIcon.js")),yi=Ce(require("@heroicons/react/24/solid/FolderPlusIcon.js")),U=require("react"),bi=require("react-dom");Vt();var Sa=(e,t)=>e&&e.trim()||t;var Nt=require("react"),Ca=(e,t=250)=>{let[n,a]=(0,Nt.useState)(e),i=(0,Nt.useRef)(null),o=(0,Nt.useRef)(e),r=(0,Nt.useRef)(null),u=(0,Nt.useRef)(!1);return(0,Nt.useEffect)(()=>{if(!u.current){u.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};var De=require("react");_t();he();var si={},ul=250,ml=4e3,kr=3,ai={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},oi=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,jn=class{constructor(t,{workerSource:n,logger:a=ut}){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>=kr){this.logger.error(`[TreeWorker] the tree Worker failed ${kr} times in a row; the tree stops updating until ${ai[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(ul*2**(this.consecutiveFailures-1),ml);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${kr})`,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 ${ie(n)}`);if(!Object.hasOwn(ai,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ie(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=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>=kr||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||!oi(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!oi(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()}i&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},pl=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof si<"u"?si.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)")},Jt=null,ii=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),fl=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},li=e=>{if(da(e),Jt===null){let t=new jn(()=>pl(e),{workerSource:"workerUrls.treeWorker"});return Jt={session:t,workerUrl:e},t}if(Jt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${ii(Jt.workerUrl)} and cannot also load it from ${ii(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Jt.session},gl=()=>{Jt?.session.reset(),Jt=null},hl={snapshot:null,isBuilding:!1};function va(e,t=!1){let n=mt(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=He(),r=o.uncategorizedCompany,u=o.noName,d=(0,De.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=(0,De.useRef)(a);(0,De.useEffect)(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:i,l=(0,De.useMemo)(()=>f?new jn(()=>fl(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=(0,De.useCallback)(()=>l===null?li(p):l,[l,p]),b=(0,De.useCallback)(M=>g().subscribe(M),[g]),T=(0,De.useCallback)(()=>g().getState(),[g]);return(0,De.useEffect)(()=>{let M=g();M.syncRecords(e,d),t&&M.finalize()},[g,e,t,d]),(0,De.useEffect)(()=>{if(l!==null)return()=>l.stop()},[l]),(0,De.useSyncExternalStore)(b,T,()=>hl)}he();pe();Pe();aa();gr();var A=require("react/jsx-runtime"),Na=Er(zn),Si=zn.listPanelMinWidth,Ci=zn.detailPanelMinWidth,vi=zn.handleThickness,yl=Na.collapseThreshold,bl=Na.expandThreshold,Sl=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=Sa(e.full_name,t.noName),o=Sa(e.title,""),r=(0,A.jsx)(Le,{text:i,query:n,enabled:a});return o?(0,A.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,A.jsx)("span",{children:r}),(0,A.jsx)("span",{className:`${s.fgMuted} text-xs`,children:(0,A.jsx)(Le,{text:o,query:n,enabled:a})})]}):r},Cl="contact-map-tree h-full w-full",vl={hoverClassName:k.muted,directorySelectedClassName:`${re.sky} ${w.treeNameSky}`,itemSelectedClassName:`${re.sky} ${w.treeNameSky}`},xa="h-4 w-4 shrink-0 transition-colors duration-150",xi=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),wr=null,ci=null,Gn=new Map,di="",ui=null,mi=null,xl=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==di||i.formatDirectoryName!==ui||t!==mi)&&(Gn.clear(),di=o,ui=i.formatDirectoryName,mi=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Gn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:Ni([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Gn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let T of g)b.add(T);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Gn.keys())u.has(d)||Gn.delete(d);return r},Ta=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Ti=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Ti(n.children)));return t},Tl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Ni=(e,t,n,a,i)=>{let o=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let T,M,L=l.type==="directory"?a.formatDirectoryName(l.name,Tl(l)):l.name,Q=(0,A.jsx)(Le,{text:L,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let X=t.get(l.personId);if(X){r.set(l.absolutePath,X),o.has(l.personId)||o.set(l.personId,new Set);let y=o.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(M=h=>{let x=Ta(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(x=l.title?m.indigo:m.orange),(0,A.jsx)(n.person,{"aria-hidden":"true",className:`${xa} ${x}`})},l.title&&(Q=Sl(X,a))),Q=(0,A.jsx)("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:Q})}}else if(l.children){let X=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(i&&X.length===0)return null;if(T=X,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;M=h=>(0,A.jsx)(y,{"aria-hidden":"true",className:`${xa} ${Ta(h)}`})}}return{name:L,label:Q,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:M,children:T}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},Nl=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let T of b)a.add(T);n&&b.length>0&&i.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},pi=(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 i=a.values().next();return i.done?null:i.value},Ea=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=He(),p=c.noName,l=c.treeDirectoryName,g=(0,U.useMemo)(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,T]=(0,U.useState)(null),[M,L]=(0,U.useState)(!1),{snapshot:Q,isBuilding:X}=va(n,e.isStreamingComplete),y=Q?.tree??null,h=Q?.rebuildEpoch??0,x=(0,U.useMemo)(()=>y?xl(y,a,b,h,g):null,[y,a,b,h,g]),P=(0,U.useMemo)(()=>{if(!y)return null;if(!o)return x;let B;M||(B=new Set(i.map(ge=>ge.item.person_id)));let me=Ni(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},B);return Nl(me,i,M)},[y,x,a,b,e.searchQuery,e.enableHighlighting,o,i,M,g]),K=(0,U.useMemo)(()=>P||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[P]),S=o&&e.errorMessage!==null,[R,ce]=(0,U.useState)(K),j=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(!(r||S)){j.current=!!y,ce(K);return}!j.current&&y&&K.entries.length>0&&(j.current=!0,ce(K))},[K,y,r,S]);let Ne=o&&(r||S)?R:K,{entries:de,personPathMap:z,contactByPath:F,totalCount:ee}=Ne,fe=(0,U.useMemo)(()=>Ti(de),[de]),[Ee,Fe]=(0,U.useState)(()=>ci??new Set),It=(0,U.useCallback)(B=>!Ee.has(B),[Ee]),tn=(0,U.useCallback)(B=>{Fe(me=>{let ge=new Set(me);return ge.has(B)?ge.delete(B):ge.add(B),ge})},[]),Mt=(0,U.useCallback)(B=>{B.length!==0&&Fe(me=>{let ge=new Set(me);for(let yt of B)ge.add(yt);return ge})},[]),nn=(0,U.useCallback)(B=>{Fe(me=>{if(me.size===0)return me;let ge=!1,yt=new Set(me);for(let J of B)yt.delete(J)&&(ge=!0);return ge?yt:me})},[]);(0,U.useEffect)(()=>{ci=Ee},[Ee]),(0,U.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Me,rn]=(0,U.useState)(null),[Qe,ft]=(0,U.useState)(null),[Je,qe]=(0,U.useState)(!1),an=(0,U.useCallback)(()=>qe(!1),[]),Lt=(0,U.useRef)(null),te=(0,U.useRef)(null),{normalizedViewportHeight:ye,panelSizingStyle:ae}=Lr(u,te,Lt),gt=(0,U.useCallback)(B=>{let me=F.get(B);return me?(Me!==me.person_id&&rn(me.person_id),B!==Qe&&ft(B),!0):!1},[F,Qe,Me]),Ft=(0,U.useCallback)(B=>{gt(B)&&qe(!0)},[gt]),En=(0,U.useCallback)(B=>{Ft(B.entry.absolutePath)},[Ft]),kt=(0,U.useCallback)(B=>B instanceof Element?B.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Be,popupItem:Mn,handleClosePopup:Ln}=Un({ref:te,resolveItem:kt,onSelect:gt}),at=(0,U.useCallback)(B=>{if(!e.openEmailsWithGmail)return;let me=B.trim();if(!me||me==="-"||typeof window>"u")return;let ge=bt(me,!0);ge&&window.open(ge,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),wt=Mn?F.get(Mn):null,ot=Be&&wt!==null&&wt!==void 0;(0,U.useEffect)(()=>{Be&&!wt&&Ln()},[Be,wt,Ln]);let Bt=(0,U.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:gi.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Rt=(0,U.useMemo)(()=>xi(Bt,ye,ot),[Bt,ye,ot]);(0,U.useEffect)(()=>{let B=!1;return typeof window>"u"?()=>{B=!0}:wr?(T(wr),()=>{B=!0}):((async()=>{try{let[ge,yt,J,oe]=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(B)return;let ke=ge.default,it=yt.default,jr=J.default,_a=oe.default;ke&&it&&jr&&_a&&(wr={company:ke,department:it,title:jr,person:_a},T(wr))}catch(ge){ut.warn("Failed to load lucide icons",ge)}})(),()=>{B=!0})},[]);let zt=(0,U.useMemo)(()=>{if(!b)return;let B=oe=>ke=>(0,A.jsx)(oe,{"aria-hidden":"true",className:`${xa} ${Ta(ke)}`}),me={company:B(b.company),department:B(b.department),title:B(b.title)},ge=B(b.person),yt=oe=>oe in me,J=oe=>{let[ke]=oe.entry.relativePath.split(":",1);return(yt(ke)?me[ke]:me.company)(oe)};return{directory:J,directoryExpanded:J,file:ge}},[b]),on=(0,U.useCallback)(()=>{Fe(B=>B.size===0?B:new Set)},[]),Ur=(0,U.useCallback)(()=>{fe.length>0&&Mt(fe)},[fe,Mt]),Pt=pi(Me,Qe,z);(0,U.useEffect)(()=>{let B=pi(Me,Qe,z);if(B===null){Me!==null&&rn(null),Qe!==null&&ft(null);return}B!==Qe&&ft(B)},[Me,Qe,z]);let Ze=Pt===null?null:F.get(Pt)??null,kn=e.isStreamingComplete,Vr=e.isStreamingFailed,Yn=kn&&n.length===0,Xn=(X||!y)&&!Yn,Qn=Ca(ee,250),ht=y!==null||Yn,sn=(0,A.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded ${k.muted} px-1.5 font-medium font-mono ${_} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[(0,A.jsx)("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",ht?c.treeNodeCount(Qn):"\u2026"]}),Vr&&!kn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.rose} ${re.rose} px-1.5 font-medium ${_} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.rose}`}),(0,A.jsx)("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):kn?Xn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.amber} ${re.amber} px-1.5 font-medium ${_} ${m.amber}`,title:c.treeBuildingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.amber}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.amber}`})]}),(0,A.jsx)("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.emerald} ${re.emerald} px-1.5 font-medium ${_} ${m.emerald}`,title:c.treeCompleteTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.emerald}`}),(0,A.jsx)("span",{children:"\u2705"})," ",c.treeComplete]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.sky} ${re.sky} px-1.5 font-medium ${_} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.sky}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.sky}`})]}),(0,A.jsx)("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&(0,A.jsxs)("button",{type:"button",onClick:()=>L(!M),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${M?`${re.blue} ${m.blue}`:`${s.fgMuted} ${w.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[(0,A.jsx)("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),fe.length>0?(0,A.jsxs)("div",{className:"flex items-center gap-1",children:[(0,A.jsx)("button",{type:"button",onClick:on,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:(0,A.jsx)(yi.default,{className:"h-4 w-4"})}),(0,A.jsx)("button",{type:"button",onClick:Ur,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:(0,A.jsx)(hi.default,{className:"h-4 w-4"})})]}):null]}),Jn=(0,U.useRef)(null),{isTwoColumn:wn}=Vn(Jn,Na,{mediaQuery:"(min-width: 768px)"});Je&&(wn||Ze===null)&&qe(!1);let Zn=(0,U.useMemo)(()=>({toggle:tn,isExpanded:It,expandMultiple:nn,collapseMultiple:Mt,isPending:r}),[Mt,nn,It,tn,r]),er=(0,U.useMemo)(()=>({onEntryClick:En,selectedPath:Pt}),[En,Pt]),Kr=(0,U.useMemo)(()=>({className:Cl,lineColor:Ka,iconOverrides:zt,showDirectoryIcons:!!zt,showFileIcons:!!zt,highlightStyles:vl,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[zt]),Rn=(0,A.jsx)("div",{ref:Lt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,A.jsx)("div",{ref:te,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:de.length>0?(0,A.jsx)(fi.DirectoryTree,{entries:de,expansion:Zn,selection:er,visual:Kr,virtualScroll:Rt,locale:d,labels:f}):(0,A.jsx)("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return(0,A.jsxs)("div",{ref:Jn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:ae,children:[t&&(0,bi.createPortal)(sn,t),wn?(0,A.jsxs)(Zt.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,A.jsx)(Zt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Si,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Rn}),(0,A.jsx)(Zt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:vi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),(0,A.jsx)(Zt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Ci,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,A.jsx)(Yt,{placement:"pane",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,A.jsxs)(A.Fragment,{children:[Rn,Ze?(0,A.jsx)(Kn,{isOpen:Je,onClose:an,title:c.detailHeading,children:(0,A.jsx)(Yt,{placement:"overlay",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),ot&&wt&&(0,A.jsx)($n,{contactData:wt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:at,onRequestClose:Ln})]})};var Ge=require("react/jsx-runtime"),El={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ml=e=>e==="tree"?"tree":"list",Ma=({context:e})=>{let t=ne(),[n,a]=(0,Ei.useSearchParams)(),[i,o]=(0,Rr.useState)(null),r=Ml(n.get(Cn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=vt(),b=(0,Rr.useCallback)(T=>{let M=T==="tree"?"tree":"list";if(M===r)return;let L=new URLSearchParams(typeof window<"u"?window.location.search:"");M==="list"?L.delete(Cn):L.set(Cn,M),a(L,{replace:!0})},[r,a]);return(0,Ge.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[(0,Ge.jsxs)("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${k.muted} p-0.5 transition-colors`,style:El,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="list"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="tree"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Ge.jsx)("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),(0,Ge.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Ge.jsx)(ba,{context:e}):null}),(0,Ge.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Ge.jsx)(Ea,{context:e,controlsContainer:i}):null})]})]})};var Mi=require("react");he();pe();Pe();var Z=require("@aiquants/fuzzy-search"),_e=require("react");he();pe();Pe();var C=require("react/jsx-runtime"),La=1e3,Pr=(0,_e.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,_e.useId)(),u=(0,_e.useId)(),d=(0,_e.useId)(),c=(0,_e.useId)(),f=(0,_e.useId)(),p=(0,_e.useId)(),l=(0,_e.useId)(),g=(0,_e.useId)(),b=(0,_e.useId)(),T=(0,_e.useId)(),M=(0,_e.useId)(),L=[];L.push((0,C.jsxs)("div",{className:`${a} ${I.green} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),(0,C.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),(0,C.jsx)("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),L.push((0,C.jsxs)("div",{className:`${a} ${I.blue} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),(0,C.jsx)("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),(0,C.jsx)("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),L.push((0,C.jsxs)("div",{className:`${a} ${I.cyan} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),(0,C.jsxs)("select",{id:c,value:e.indexWorkerOptions?.strategy??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,C.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,C.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,C.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),(0,C.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:l,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),(0,C.jsx)("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),L.push((0,C.jsxs)("div",{className:`${a} ${I.indigo} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),(0,C.jsx)("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,C.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,C.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:La}}))}),n.noLimit]}),(0,C.jsx)("input",{id:b,type:"range",min:La,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?La:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),L.push((0,C.jsxs)("div",{className:`${a} ${I.emerald} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,C.jsx)("input",{id:T,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:M,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),(0,C.jsx)("input",{id:M,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&(0,C.jsx)("p",{className:`${_} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let Q=(0,_e.useId)(),X=(0,_e.useId)();return L.push((0,C.jsxs)("div",{className:`${a} ${I.teal} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:Q,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),(0,C.jsx)("input",{id:Q,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:X,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),(0,C.jsx)("input",{id:X,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),(0,C.jsxs)("section",{className:"space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,C.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[(0,C.jsx)("span",{children:"\u{1F4CA}"}),(0,C.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,C.jsx)("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.green} ${re.green} px-2 font-medium ${m.green} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,C.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:L})]})});Pr.displayName="IndexWorkerSettings";var Ae=require("@aiquants/fuzzy-search"),Et=require("react");he();pe();Pe();var H=require("react/jsx-runtime"),ka=1e3,_r=(0,Et.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,Et.useId)(),u=(0,Et.useId)(),d=(0,Et.useId)(),c=(0,Et.useId)(),f=(0,Et.useId)(),p=(0,Et.useId)(),l=[];return l.push((0,H.jsxs)("div",{className:`${a} ${I.purple} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),(0,H.jsx)("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push((0,H.jsxs)("div",{className:`${a} ${I.pink} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push((0,H.jsxs)("div",{className:`${a} ${I.violet} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,H.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,H.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:ka}}))}),n.noLimit]}),(0,H.jsx)("input",{id:c,type:"range",min:ka,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?ka:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push((0,H.jsxs)("div",{className:`${a} ${I.rose} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,H.jsx)("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),(0,H.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&(0,H.jsx)("p",{className:`${_} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.purple} ${re.purple} px-2 font-medium ${m.purple} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});_r.displayName="LevenshteinWorkerSettings";var Se=require("react/jsx-runtime"),Ll={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ar=(0,Mi.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:u})=>{let d=ne(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T}=vt();return(0,Se.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${I.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,Se.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,Se.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),(0,Se.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,Se.jsxs)("button",{type:"button",onClick:()=>t(M=>Nr(M.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),(0,Se.jsx)("div",{className:"mb-0 shrink-0",children:(0,Se.jsxs)("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:Ll,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T,children:[(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="basic"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="advanced"?`${we.orange} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),(0,Se.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Se.jsx)("div",{className:`${r==="basic"?"block":"hidden"}`,children:(0,Se.jsx)(lr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),(0,Se.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,Se.jsx)(sr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,Se.jsx)(Pr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,Se.jsx)(_r,{searchOptions:e,setSearchOptions:t})})]})]})});Ar.displayName="SearchOptionsPanel";var $r=require("react");jt();he();pe();Pe();var Li=require("react");pe();var Or=require("react/jsx-runtime"),D=(0,Li.memo)(({label:e,value:t,unit:n,color:a=s.fgMuted})=>(0,Or.jsxs)("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[(0,Or.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,Or.jsxs)("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));D.displayName="StatItem";var ki=require("react");jt();he();pe();Pe();var v=require("react/jsx-runtime"),en=(0,ki.memo)(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=He(),r=z=>se(i,z);if(!n)return(0,v.jsx)("section",{className:`rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,T=u.timestamp,M=c.fieldPerformance||{},L=c.performanceInsights||{},Q=c.recentHistory||[],X=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},x=e==="index",P=e==="levenshtein",K=x?o.indexWorkerName:o.levenshteinWorkerName,S=X,R=X,ce=`flex flex-col gap-1 rounded-lg border ${k.surface} p-3 shadow-sm transition-colors`,j="text-xs font-semibold transition-colors",Ne=z=>{if(!z)return;let F=new Date(z);return Number.isNaN(F.getTime())?void 0:o.statsTimestamp(F)},de=[];if(de.push((0,v.jsxs)("div",{className:`${ce} ${I.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),(0,v.jsx)(D,{label:o.statTotalSearches,value:r(f),color:a}),(0,v.jsx)(D,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statErrorCount,value:b,color:b>0?m.red:a}),Ne(T)&&(0,v.jsx)(D,{label:o.statUpdatedAt,value:Ne(T),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let z=Object.entries(h).sort(([,F],[,ee])=>(Number(ee)||0)-(Number(F)||0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${I.amber} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),(0,v.jsx)(D,{label:o.statTotalOperations,value:r(y),color:m.amber}),z.length>0&&(0,v.jsx)("div",{className:"mt-1 space-y-1",children:z.map(([F,ee])=>(0,v.jsx)(D,{label:F,value:r(Number(ee)),unit:o.timesUnit(r(Number(ee))),color:m.amber},F))})]},"operations"))}if(x&&(de.push((0,v.jsxs)("div",{className:`${ce} ${I.green} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),(0,v.jsx)(D,{label:o.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),(0,v.jsx)(D,{label:o.statDataSize,value:r(S.currentDataSize??0),unit:o.itemsUnit(r(S.currentDataSize??0)),color:m.green}),(0,v.jsx)(D,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.emerald} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),(0,v.jsx)(D,{label:o.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let z=Object.entries(S.indexMetadata).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.teal} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),z.map(([F,ee])=>{let fe;if(typeof ee=="number"){let Ee=F.toLowerCase();Ee.includes("time")&&!Ee.includes("timestamp")?fe=`${ee.toFixed(2)}ms`:Ee.includes("timestamp")||Ee.includes("at")?fe=Ne(ee)??ee.toString():fe=r(ee)}else fe=String(ee);return(0,v.jsx)(D,{label:F,value:fe,color:m.teal},F)})]},"index-meta"))}if(P){if(de.push((0,v.jsxs)("div",{className:`${ce} ${I.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),(0,v.jsx)(D,{label:o.statTotalCalculations,value:r(R.totalCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statDistanceCalculations,value:r(R.totalDistanceCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statAverageDistance,value:typeof R.averageDistance=="number"?R.averageDistance.toFixed(2):"0.00",color:m.purple}),(0,v.jsx)(D,{label:o.statMinDistance,value:R.minDistance??o.notAvailable,color:m.purple}),(0,v.jsx)(D,{label:o.statMaxDistance,value:R.maxDistance??0,color:m.purple})]},"lev-basic")),de.push((0,v.jsxs)("div",{className:`${ce} ${I.fuchsia} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),(0,v.jsx)(D,{label:o.statPartialMatches,value:r(R.partialMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statPerfectMatches,value:r(R.perfectMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statEarlyTerminations,value:r(R.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),R.similarityThresholds&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.rose} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),(0,v.jsx)(D,{label:o.statAbove80,value:r(R.similarityThresholds.above80??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statAbove60,value:r(R.similarityThresholds.above60??0),color:m.lime}),(0,v.jsx)(D,{label:o.statAbove40,value:r(R.similarityThresholds.above40??0),color:m.orange}),(0,v.jsx)(D,{label:o.statBelow40,value:r(R.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),R.distanceDistribution){let z=Object.entries(R.distanceDistribution).sort(([,F],[,ee])=>Number(ee)-Number(F)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.indigo} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),z.map(([F,ee])=>(0,v.jsx)(D,{label:o.statDistance(F),value:r(Number(ee)),unit:o.timesUnit(r(Number(ee))),color:m.indigo},F))]},"lev-distance"))}if(R.queryLengthStats){let z=Object.entries(R.queryLengthStats).sort(([,F],[,ee])=>(ee.count??0)-(F.count??0)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.violet} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),z.map(([F,ee])=>{let fe=Number(ee.count??0),Ee=Number(ee.averageScore??0);return(0,v.jsx)(D,{label:o.statQueryLength(F),value:o.statQueryLengthValue({count:fe,averagePercent:(Ee*100).toFixed(1)}),color:m.violet},F)})]},"lev-query-length"))}}if(Object.keys(M).length>0){let z=Object.entries(M).sort(([,F],[,ee])=>(ee.averageScore??0)-(F.averageScore??0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${I.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),z.map(([F,ee])=>{let fe=ee;return(0,v.jsxs)("div",{className:`space-y-1 rounded ${re.purple} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:F}),(0,v.jsx)(D,{label:o.statAverageScore,value:`${((fe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),(0,v.jsx)(D,{label:o.statMatchCount,value:r(fe.matchCount??0),unit:o.itemsUnit(r(fe.matchCount??0)),color:m.purple}),(0,v.jsx)(D,{label:o.statBestWorstScore,value:`${((fe.bestScore??0)*100).toFixed(1)}% / ${((fe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},F)})]},"field-performance"))}if(L.bestPerformingField||L.totalHistoryEntries||L.similarityDistribution){let z=(L.recentAverageResultCount??0).toFixed(1);de.push((0,v.jsxs)("div",{className:`${ce} ${I.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),L.bestPerformingField&&(0,v.jsx)(D,{label:o.statBestField,value:L.bestPerformingField,color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageTime,value:(L.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageResults,value:z,unit:o.itemsUnit(z),color:m.blue}),(0,v.jsx)(D,{label:o.statThroughput,value:(L.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),(0,v.jsx)(D,{label:o.statCommonQueryLength,value:r(L.mostCommonQueryLength??0),unit:o.charactersUnit(r(L.mostCommonQueryLength??0)),color:m.blue}),(0,v.jsx)(D,{label:o.statHistoryEntries,value:r(L.totalHistoryEntries??0),color:m.blue}),L.similarityDistribution&&(0,v.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,v.jsx)(D,{label:o.statHighSimilarity,value:r(L.similarityDistribution.highSimilarity??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statMediumSimilarity,value:r(L.similarityDistribution.mediumSimilarity??0),color:m.lime}),(0,v.jsx)(D,{label:o.statLowSimilarity,value:r(L.similarityDistribution.lowSimilarity??0),color:m.orange}),(0,v.jsx)(D,{label:o.statVeryLowSimilarity,value:r(L.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return Q.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${I.sky} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),Q.slice(-3).reverse().map((z,F)=>(0,v.jsxs)("div",{className:`rounded ${re.sky} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-medium ${m.sky} transition-colors`,children:z.operationType}),(0,v.jsx)("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:z.processingTime.toFixed(2),resultCount:z.resultCount??0})}),Ne(z.timestamp)&&(0,v.jsx)("div",{className:`${_} ${m.sky} transition-colors`,children:Ne(z.timestamp)})]},`${z.operationType}-${z.timestamp??F}`))]},"recent-history")),(0,v.jsxs)("section",{className:"space-y-2",children:[(0,v.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[(0,v.jsx)("span",{children:t}),(0,v.jsx)("span",{className:"tracking-wide",children:K})]}),(0,v.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:de})]})});en.displayName="WorkerStatsSection";var ue=require("react/jsx-runtime"),kl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Dr=(0,$r.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=He(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:T,onPointerUp:M,onPointerLeave:L,onPointerCancel:Q,onClickCapture:X}=vt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,x=y?`cursor-not-allowed ${k.muted} ${s.fgMuted}`:`${we.blue} ${s.onPrimary} ${Gt.blue}`,P=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,K=(0,$r.useCallback)(()=>{o().catch(()=>{})},[o]);return(0,ue.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${I.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,ue.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,ue.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),(0,ue.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ue.jsx)("button",{type:"button",onClick:K,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${x}`,title:h,children:P}),(0,ue.jsxs)("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),(0,ue.jsx)("div",{className:"mb-0 shrink-0",children:(0,ue.jsxs)("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:kl,onPointerDown:b,onPointerMove:T,onPointerUp:M,onPointerLeave:L,onPointerCancel:Q,onClickCapture:X,children:[(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="overview"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),(0,ue.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ue.jsxs)("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[(0,ue.jsx)(D,{label:f.statTotalSearches,value:se(c,e.totalSearches)}),(0,ue.jsx)(D,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ue.jsx)(D,{label:f.statDataCount,value:se(c,e.itemCount)}),(0,ue.jsx)(D,{label:p?f.statResultCount:f.statDisplayedCount,value:se(c,l)})]}),(0,ue.jsx)("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),(0,ue.jsx)("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),(0,ue.jsxs)("div",{className:"hidden",children:[(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Dr.displayName="StatisticsPanel";var V=require("react/jsx-runtime"),wl=/[\u200B\uFEFF]/g,wa=typeof window<"u",$i=wa&&typeof document<"u",Wr=(e,t=[],n=!1)=>{let a=(0,G.useRef)(e);a.current=e,(0,G.useEffect)(()=>{if(!(!wa||n&&!$i))return a.current()},[n,...t])},wi=(e,t,n)=>{let[a,i]=(0,G.useState)(()=>{let o=Ri(r=>r.getItem(e));return o&&t.includes(o)?o:n});return Wr(()=>{Ri(o=>{o.setItem(e,a)})},[e,a]),[a,i]},Ri=e=>{if(!wa)return null;try{return e(window.sessionStorage)}catch{return null}},Pi=(e,t)=>{let[n,a]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Rl="contact-map.settings-tab",Pl="contact-map.statistics-tab",_l=["basic","advanced","index","levenshtein"],Al=["overview","index","levenshtein"],_i=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Ol={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ra=({streamState:e,...t}={})=>e===void 0?(0,V.jsx)($l,{...t}):(0,V.jsx)(Di,{...t,streamState:e}),$l=e=>{let{context:t}=Fn();return(0,V.jsx)(Di,{...e,streamState:t})},Dl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},Di=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=Oe(e,"workerUrls"),o=mt(),{locale:r,labels:u}=He(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=(0,Ir.useNavigation)(),[g]=(0,Ir.useSearchParams)(),b=(0,G.useRef)(null),[T,M]=(0,G.useState)(!0),[L,Q]=(0,G.useState)(o.openEmailsWithGmail??!1),{indexWorker:X,levenshteinWorker:y}=Xt(o.workerUrls,i,Dl),[h,x]=(0,G.useState)(()=>Nr({indexWorker:X,levenshteinWorker:y})),[P,K]=(0,G.useState)(g.get("q")||""),S=Pi(P,h.debounceMs??Hr.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,G.useEffect)(()=>{let J=g.get("q")||"";K(oe=>oe!==J?J:oe)},[g]),(0,G.useEffect)(()=>{if(typeof window>"u")return;let J=new URL(window.location.href);(J.searchParams.get("q")||"")!==S&&(S?J.searchParams.set("q",S):J.searchParams.delete("q"),window.history.replaceState(window.history.state,"",J.toString()))},[S]);let[R,ce]=(0,G.useTransition)(),[j,Ne]=(0,G.useState)("search"),[de,z]=wi(Rl,_l,"basic"),[F,ee]=wi(Pl,Al,"overview"),{setScrollableRef:fe,onPointerDown:Ee,onPointerMove:Fe,onPointerUp:It,onPointerLeave:tn,onPointerCancel:Mt,onClickCapture:nn}=vt(),Me=(0,G.useCallback)(()=>{if(!$i||ma(window))return;let J=b.current;!J||document.activeElement===J||window.requestAnimationFrame(()=>{try{J.focus({preventScroll:!0})}catch{}})},[]),rn=(0,G.useCallback)(J=>{let oe=J;Ne(oe),oe==="search"&&Me()},[Me]),Qe=(0,G.useMemo)(()=>({...h,debounceMs:0}),[h]),[ft,Je]=(0,G.useState)("union"),qe=ft==="intersection",an=qe?u.operatorAndTitle:u.operatorOrTitle,Lt=(0,G.useCallback)(J=>(0,Hr.parseQuerySets)(J,ft),[ft]),te=(0,G.useMemo)(()=>({querySetsOf:Lt}),[Lt]),ye=Pi(d,f?0:800),{searchTerm:ae,setSearchTerm:gt,filteredItems:Ft,resultTerm:En,isSearching:kt,isIndexBuilding:Be,clearSearch:Mn,resetStats:Ln,performanceMetrics:at,rebuildIndex:wt,error:ot}=(0,Ai.useFuzzySearch)(ye,_i,Qe,te),Bt=ae.trim().length>0,[Rt,zt]=(0,G.useState)(""),[on,Ur]=(0,G.useState)(()=>ae),Pt=(0,G.useMemo)(()=>fr(P),[P]),Ze=(0,G.useMemo)(()=>fr(S),[S]);(0,G.useEffect)(()=>{S===Rt&&Ze===ae||ce(()=>{zt(S),gt(Ze)})},[S,Rt,Ze,ae,gt]);let kn=(0,G.useCallback)(J=>{let ke=J.target.value.replace(wl,"");K(ke)},[]),Vr=(0,G.useCallback)(()=>{K(""),zt(""),Mn(),Me()},[Mn,Me]),Yn=(0,G.useCallback)(()=>{Je(J=>J==="intersection"?"union":"intersection"),Me()},[Me]);Wr(()=>{if(!(j==="search"&&l.state==="idle"&&!R))return;let oe=document.activeElement;if(!!!(oe?.matches('[role="tab"]')||oe?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&oe&&oe!==document.body&&oe!==b.current)return;let it=window.requestAnimationFrame(()=>{Me()});return()=>{window.cancelAnimationFrame(it)}},[j,l.state,R,Me],!0),Wr(()=>{if(j!=="search")return;let J=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Me()}],[window,"pageshow",()=>{Me()}]];for(let[oe,ke,it]of J)oe.addEventListener(ke,it);return()=>{for(let[oe,ke,it]of J)oe.removeEventListener(ke,it)}},[j,Me],!0),(0,G.useEffect)(()=>(n&&n(j==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[j,n]),Wr(()=>{let J=document.body,oe=J.style.overflow;return j==="search"&&(J.style.overflow="hidden"),()=>{J.style.overflow=oe}},[j],!0),(0,G.useEffect)(()=>{at&&ut.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:at.totalSearches,averageSearchTime:at.averageSearchTime,itemCount:at.itemCount,resultsCount:at.resultsCount,workersAvailable:!!at.workerStats})},[at]);let{isAwaitingDebounce:Xn,isAwaitingSearchTermSync:Qn,isSearchInProgress:ht}=(0,G.useMemo)(()=>{let J=Pt!==Ze,oe=Ze!==ae,ke=ae.trim().length>0||Pt.trim().length>0;return{isAwaitingDebounce:J,isAwaitingSearchTermSync:oe,isSearchInProgress:R||kt||En!==ae&&ot===null||ke&&Be||J||oe||on!==ae}},[Pt,Ze,ae,En,ot,R,kt,Be,on]),[sn,Jn]=(0,G.useState)(ae);(0,G.useEffect)(()=>{sn!==ae&&Jn(ae)},[ae,sn]),(0,G.useEffect)(()=>{Xn||Qn||R||kt||Be||sn===ae&&on!==ae&&Ur(ae)},[ae,on,Xn,Qn,R,kt,Be,sn]);let wn=(0,G.useMemo)(()=>lo(Rt,_i),[Rt]),Zn=(0,G.useMemo)(()=>wn(Ft),[wn,Ft]),er=(0,G.useMemo)(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Zn,searchQuery:Rt,searchTerm:ae,isSearching:kt,isIndexBuilding:Be,isPending:R,hasSearchTerm:Bt,enableHighlighting:T,openEmailsWithGmail:L,isSearchInProgress:ht,isSearchTabActive:j==="search",errorMessage:ot??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Zn,Rt,ae,kt,Be,R,Bt,T,L,ht,j,ot,f,p]),Kr=Bt?Ft.length:d.length,Rn=se(r,d.length),B=se(r,Ft.length),ge=`${`scrollbar-hidden ${k.subtle} ${s.fg}`}${j==="search"?" h-full min-h-0":""}`;return(0,V.jsx)("div",{"data-contact-map-search-page":"",className:ge,children:(0,V.jsxs)(Wn,{value:j,onValueChange:rn,className:`flex flex-col${j==="search"?" h-full min-h-0":""}`,children:[(0,V.jsxs)(bn,{ref:fe,"data-contact-map-page-tabs":"",style:Ol,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 ${k.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Ee,onPointerMove:Fe,onPointerUp:It,onPointerLeave:tn,onPointerCancel:Mt,onClickCapture:nn,children:[(0,V.jsxs)(Wt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),(0,V.jsxs)(Wt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),(0,V.jsxs)(Wt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),(0,V.jsx)(Ht,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)("div",{className:`rounded-md border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,V.jsxs)("div",{className:"flex flex-col",children:[(0,V.jsx)("div",{className:"relative",children:(0,V.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,V.jsxs)("button",{type:"button",onClick:Yn,"aria-pressed":qe,title:an,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${N} transition-colors sm:min-w-12 sm:px-2 ${qe?`border-transparent ${we.blue} ${s.onPrimary} ${Gt.blue}`:`${Va.amber} ${re.amber} ${m.amber} ${w.hoverSurface}`}`,children:[(0,V.jsx)("span",{children:qe?u.operatorAnd:u.operatorOr}),(0,V.jsx)("span",{className:`hidden ${_} sm:inline`,children:qe?u.operatorAndHint:u.operatorOrHint})]}),(0,V.jsx)("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:P,onChange:kn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${q.borderControl} border-solid px-2 pointer-coarse:text-base ${N} shadow-sm transition-colors ${w.focusBorder} focus:ring-1 ${w.focusRing} ${k.surface} ${s.fg}`}),P&&(0,V.jsx)("button",{type:"button",onClick:Vr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${q.borderControl} px-1.5 ${N} transition-colors ${w.hoverFg} sm:px-2 ${s.fgMuted}`,title:ht?u.searchBusyTitle:u.clearSearch,"aria-label":ht?void 0:u.clearSearch,disabled:ht,children:ht?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Oi.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,V.jsx)("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),(0,V.jsxs)("p",{className:`px-1.5 py-0.5 ${_} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",(0,V.jsx)("span",{className:`font-semibold ${N} ${s.fg}`,children:Rn})," ",u.recordUnit(Rn),Be?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,ot?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,(0,V.jsx)("span",{className:"ml-1 break-all font-semibold",children:ot})]}):null,Bt&&(0,V.jsxs)("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,ht?(0,V.jsx)("span",{className:"ml-1 font-semibold",children:u.searching}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:`ml-1 font-semibold ${N} ${s.fg}`,children:B}),(0,V.jsx)("span",{className:"ml-0.5",children:u.resultUnit(B)})]})]})]}),(0,V.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Be?(0,V.jsx)(fa,{className:`h-1 ${At.progressTrack}`,indicatorClassName:tt.blue}):null})]})}),a?a(er):(0,V.jsx)(Ma,{context:er})]})}),(0,V.jsx)(Ht,{value:"settings",className:"mt-0",children:(0,V.jsx)(Ar,{searchOptions:h,setSearchOptions:x,enableHighlighting:T,setEnableHighlighting:M,openEmailsWithGmail:L,setOpenEmailsWithGmail:Q,activeTab:de,onTabChange:z})}),(0,V.jsx)(Ht,{value:"statistics",className:"mt-0",children:(0,V.jsx)(Dr,{performanceMetrics:at,searchTerm:ae,totalDataCount:d.length,resultsCount:Kr,resetStats:Ln,rebuildIndex:wt,isIndexBuilding:Be,activeTab:F,onTabChange:ee})})]})})};var Fr=require("react");he();var qn=require("react/jsx-runtime"),Wl=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Br=(0,Fr.memo)(({phase:e,loadedCount:t})=>{let n=ne(),[a,i]=(0,Fr.useState)(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:Wl(e,t,n);return o!==a&&i(o),(0,qn.jsxs)("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[(0,qn.jsx)("span",{role:"status",children:o.status}),(0,qn.jsx)("span",{role:"alert",children:o.alert})]})});Br.displayName="ContactMapStreamAnnouncer";var We=require("react");he();pe();fn();Pe();var pt=require("react/jsx-runtime"),Wi="shrink-0 pb-2",Hl=`flex items-center gap-2 rounded-md border ${I.rose} ${re.rose} px-[11px] py-[3px] ${m.rose} ${N}`,Il=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${q.borderControl} ${k.surface} px-[11px] font-semibold ${m.rose} ${N} transition-colors ${w.hoverRoseTint} ${dt}`,Fl=e=>e==="failed"||vr(e),Hi=(e,t)=>{(0,We.useLayoutEffect)(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=zo(n))}},[e,t])},Bl=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=ne(),o=(0,We.useId)(),r=(0,We.useRef)(null);return Hi(r,a),(0,pt.jsx)("div",{className:Wi,children:(0,pt.jsxs)("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:Hl,children:[(0,pt.jsx)("span",{"aria-hidden":"true",children:"\u26D4"}),(0,pt.jsx)("span",{id:o,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:i.streamLoadFailed(e)}),(0,pt.jsx)("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":o,onClick:n,className:Il,children:i.streamRetry})]})})},zl=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),Ul=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=(0,We.useRef)(null),o=(0,We.useRef)(t);(0,We.useLayoutEffect)(()=>{o.current=t});let[r]=(0,We.useState)(()=>zl(e,()=>o.current()));return Hi(i,a),(0,pt.jsx)("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:Wi,children:n(r)})},zr=(0,We.memo)(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{xr(o,"ContactMapStreamFailureNotice accessFailure"),Lo(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=(0,We.useRef)(null);return(0,We.useLayoutEffect)(()=>{let u=r.current;u!==null&&(r.current=null,Uo(u))}),Fl(e)?e==="failed"?(0,pt.jsx)(Bl,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):(0,pt.jsx)(Ul,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});zr.displayName="ContactMapStreamFailureNotice";var Xe=require("react/jsx-runtime"),Vl=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=ne(),o=n===void 0?i.appTitle:n,{context:r,retryNow:u}=Fn(),d=(0,Xe.jsx)(Cr,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return(0,Xe.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[(0,Xe.jsx)(Br,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:d}):(0,Xe.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,Xe.jsx)("h1",{className:"font-bold text-xl",children:o}),d]}),(0,Xe.jsx)(zr,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),(0,Xe.jsx)("div",{className:"min-h-0 flex-1",children:(0,Xe.jsx)(Ra,{streamState:r,onFooterVisibilityChange:a})})]})},Kl=e=>{let t=Oe(e,"accessFailure");xr(t,"ContactMapAppView accessFailure");let n=mt(),a=Oe(e,"streamEndpoint"),i=Oe(e,"workerUrls"),o=Oe(e,"locale"),r=Oe(e,"labels"),u=(0,Pa.useMemo)(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:Xt(n.workerUrls,i,{setting:"ContactMapAppView workerUrls"}),locale:o===void 0?n.locale:o,labels:r===void 0?n.labels:r}),[n,a,i,o,r]),d=o!==void 0,c=r!==void 0,f=(0,Pa.useMemo)(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return(0,Xe.jsx)(ua,{config:u,chromeSurface:f,children:(0,Xe.jsx)(Vl,{...e,accessFailure:t})})};jt();he();var Ii=require("@aiquants/route-revalidation");var jl=(0,Ii.createShouldRevalidate)({submissions:"url",query:{ignore:[Cn,"q"]}});0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamAnnouncer,ContactMapStreamClient,ContactMapStreamFailureNotice,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,assertContactMapStreamEndpoint,assertContactMapTreeWorkerUrl,assertContactMapWorkerUrls,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,countContactMapCompanies,deserializeStreamRecord,getContactMapStreamClient,getTreeWorkerSession,layerContactMapWorkerUrls,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useStreamedContactMapContext,useTreeWorker});
1
+ "use strict";var Ii=Object.create;var tr=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var zi=Object.getOwnPropertyNames;var Ui=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(e&&(t=e(e=0)),t);var Aa=(e,t)=>{for(var n in t)tr(e,n,{get:t[n],enumerable:!0})},$a=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zi(t))!Vi.call(e,i)&&i!==n&&tr(e,i,{get:()=>t[i],enumerable:!(a=Bi(t,i))||a.enumerable});return e};var Ce=(e,t,n)=>(n=e!=null?Ii(Ui(e)):{},$a(t||!e||!e.__esModule?tr(n,"default",{value:e,enumerable:!0}):n,e)),Ki=e=>$a(tr({},"__esModule",{value:!0}),e);var et,Ut,Oa,ln,cn,Pn,bt,Xe,nr,Gr,qr,st,le,Vt=Re(()=>{"use strict";et=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ut=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Oa=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=et(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},ln=e=>Oa(e,["custom_email","email"]),cn=e=>Oa(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=et(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},bt=(e,t)=>{let n=et(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Xe=(e,t)=>String(e).padStart(t,"0"),nr=e=>`${Xe(e.getUTCFullYear(),4)}-${Xe(e.getUTCMonth()+1,2)}-${Xe(e.getUTCDate(),2)}`,Gr=e=>`${nr(e)} ${Xe(e.getUTCHours(),2)}:${Xe(e.getUTCMinutes(),2)}:${Xe(e.getUTCSeconds(),2)}`,qr=e=>`${Xe(e.getFullYear(),4)}-${Xe(e.getMonth()+1,2)}-${Xe(e.getDate(),2)} ${Xe(e.getHours(),2)}:${Xe(e.getMinutes(),2)}:${Xe(e.getSeconds(),2)}`,st=(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)},le=e=>e==null?"-":typeof e=="string"?et(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ie,Da,_t=Re(()=>{"use strict";ie=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":Da(e);case"function":return Da(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Da=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var dn,$e,un=Re(()=>{"use strict";dn=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},$e=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var ji,rr,Xr=Re(()=>{"use strict";ji=(e,t)=>{let n=Array.from({length:t.length+1},(a,i)=>i);for(let a=1;a<=e.length;a+=1){let i=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,r))}n=i}return n[t.length]},rr=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let a;for(let i of t){let o=ji(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(a===void 0||o<a.distance)&&(a={key:i,distance:o})}return a?.key}});var St,or,Gi,se,Kt,ar,Ha,mn,lt,qi,Wa,Fa,Xi,Yr,Yi,Qi,Ji,ir,Qr,Jr,jt=Re(()=>{"use strict";St=require("@aiquants/directory-tree"),or=require("@aiquants/virtualscroll");Vt();_t();un();Xr();Gi=Object.freeze({en:"en-US",ja:"ja-JP"}),se=(e,t)=>t.toLocaleString(Gi[e]),Kt=(e,t,n)=>e==="1"?t:n,ar=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${se("en",e)} / ${se("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${se("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${se("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${se("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>Kt(e,"record","records"),companyUnit:e=>Kt(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=>Kt(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=>se("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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:qr,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=se("en",e);return`${n} ${Kt(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: ${se("en",t)}`,timesUnit:e=>Kt(e," time"," times"),itemsUnit:e=>Kt(e," item"," items"),charactersUnit:e=>Kt(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 (${se("ja",e)} / ${se("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${se("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${se("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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:qr,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})=>`${se("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: ${se("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Ha=Object.freeze(Object.keys(ar.en)),mn=Object.freeze([...St.DIRECTORY_TREE_LABEL_KEYS,...Ha]),lt=Object.freeze({en:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.en,...ar.en}),ja:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.ja,...ar.ja})}),qi=new Set(mn),Wa=Object.keys(lt).map(e=>JSON.stringify(e)).join(" or "),Fa=Object.freeze({locale:"locale",labels:"labels"}),Xi=(e,t,n)=>{e[t]=n},Yr=(e,t=Fa.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Wa} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(lt,e))throw new RangeError(`[contact-map] ${t} must be ${Wa} or left out; got ${ie(e)}`);return(0,or.resolveVirtualScrollLocale)(e)},Yi=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ie(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)},Qi=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!qi.has(i)){let r=rr(i,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 ${ie(i)}`)}let o=e[i];o!==void 0&&(Yi(n,i,o,t[i]),a[i]=o)}return a},Ji=e=>{let t={},n=!1;for(let a of St.DIRECTORY_TREE_LABEL_KEYS){let i=e[a];i!==void 0&&(t[a]=i,n=!0)}return n?t:void 0},ir=(e,t,n=Fa)=>{let a=Yr(e,n.locale);if(t===void 0)return lt[a];if(!dn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let i=Qi(t,lt[a],n.labels),r={...(0,St.resolveDirectoryTreeLabels)(a,Ji(i)),...ar[a]};for(let u of Ha){let d=i[u];d!==void 0&&Xi(r,u,d)}return Object.freeze(r)},Qr=e=>{let t={};for(let n of St.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},Jr=e=>{let t={};for(let n of or.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var Ia,Ba,ct,Ua,Zi,ea,Zr,za,He,ne,he=Re(()=>{"use strict";Ia=require("@aiquants/directory-tree"),Ba=require("@aiquants/virtualscroll"),ct=require("react");jt();Ua=require("react/jsx-runtime"),Zi=Object.freeze({locale:"en",labels:lt.en,treeLabels:Qr(lt.en),engineLabels:Jr(lt.en)}),ea=(0,ct.createContext)(Zi),Zr=(e,t)=>{let n=(0,ct.useRef)(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},za=({locale:e,labels:t,surface:n,children:a})=>{let i=Yr(e,n.locale),o=(0,ct.useMemo)(()=>ir(i,t,n),[i,t,n]),r=Zr(o,mn),u=Zr(Qr(r),Ia.DIRECTORY_TREE_LABEL_KEYS),d=Zr(Jr(r),Ba.VIRTUAL_SCROLL_LABEL_KEYS),c=(0,ct.useMemo)(()=>({locale:i,labels:r,treeLabels:u,engineLabels:d}),[i,r,u,d]);return(0,Ua.jsx)(ea.Provider,{value:c,children:a})},He=()=>(0,ct.useContext)(ea),ne=()=>(0,ct.useContext)(ea).labels});var s,k,q,m,re,F,tt,Va,we,Gt,w,At,Ka,pe=Re(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},k={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},q={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},re={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},F={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},tt={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Va={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},we={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},Gt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},w={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},At={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ka="#71829b"});var N,$t,_,Pe=Re(()=>{"use strict";N="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",$t="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",_=`${$t} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var cr,dr,ur,mr,ta=Re(()=>{"use strict";pe();cr="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]",dr=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),ur=`absolute inset-0 ${At.scrim}`,mr=()=>!1});var es,ts,dt,ja,Ga,pn,fn=Re(()=>{"use strict";pe();es="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",ts=2,dt=`focus-visible:outline-2 ${w.focusVisibleOutline} focus-visible:outline-offset-2`,ja=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${w.activeRowOutline}`,Ga=ts,pn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${dt} ${es}`});function Oe(...e){return(0,Xa.twMerge)((0,qa.clsx)(e))}var qa,Xa,An=Re(()=>{"use strict";qa=require("clsx"),Xa=require("tailwind-merge")});var Ya,Qa,Ja,Za,be,eo,X,ns,Ue,rs,as,os,$n,hn,is,ss,gn,na,ra,On,aa=Re(()=>{"use strict";Ya=require("@aiquants/swipe-overlay"),Qa=Ce(require("lucide-react/dist/esm/icons/check.js")),Ja=Ce(require("lucide-react/dist/esm/icons/copy.js")),Za=Ce(require("lucide-react/dist/esm/icons/x.js")),be=require("react"),eo=require("react-dom");Vt();he();ta();pe();fn();Pe();An();X=require("react/jsx-runtime"),ns=350,Ue=e=>e.stopPropagation(),rs=Object.freeze({onClick:Ue,onDoubleClick:Ue,onContextMenu:Ue,onPointerDown:Ue,onPointerUp:Ue,onMouseDown:Ue,onMouseUp:Ue,onTouchStart:Ue,onTouchEnd:Ue,onKeyDown:Ue,onKeyUp:Ue,onFocus:Ue,onBlur:Ue}),as=Oe(cr,"flex items-center justify-center px-4 py-6"),os=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${q.borderControl} ${k.surface} p-4 shadow-lg transition-colors`,$n=0,hn=null,is=()=>{let e=document.body.style;$n+=1,$n===1&&(hn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},ss=()=>{if($n=Math.max(0,$n-1),$n>0||!hn)return;let e=document.body.style;e.userSelect=hn.userSelect,typeof hn.webkitUserSelect<"u"&&(e.webkitUserSelect=hn.webkitUserSelect),hn=null},gn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},na=(e,t)=>{let n=new Set;return e.reduce((a,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return a;let{normalized:r,key:u,entry:d}=t(o,i);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},ra=({value:e,ariaLabel:t})=>{let[n,a]=(0,be.useState)(!1),i=(0,be.useRef)(null),o=(0,be.useCallback)(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=(0,be.useCallback)(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);a(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);(0,be.useEffect)(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Qa.default:Ja.default;return(0,X.jsx)("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${q.borderControl} ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:r,"aria-label":t,title:t,children:(0,X.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},On=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=ne(),o=(0,be.useRef)(null),r=(0,be.useMemo)(()=>e.contacted_at?st(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=gn(e.full_name)??i.noName,d=gn(e.company_name),c=gn(e.department),f=gn(e.title),p=(0,be.useMemo)(()=>na([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(x,{fieldKey:P,label:K})=>({normalized:x,key:`${P}-${x.toLowerCase()}`,entry:S=>({fieldKey:P,label:K,value:S})})),[d,c,f,i]),l=(0,be.useMemo)(()=>na([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(x,{fieldKey:P,label:K})=>{let S=Pn(x);return{normalized:gn(x),key:(S??x).toLowerCase(),entry:ce=>({fieldKey:P,label:K,value:ce,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=(0,be.useMemo)(()=>na([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(x,{fieldKey:P,label:K})=>{let S=gn(x),R=bt(x,t),ce=!!R?.startsWith("https://mail.google.com");return{normalized:S,key:x.toLowerCase(),entry:j=>({fieldKey:P,label:K,value:j,href:R,isGmailLink:ce})}}),[e.custom_email,e.email,t,i]),b=l.length>0||g.length>0,T=(0,be.useId)(),E=(0,be.useCallback)(()=>{a(),o.current=null},[a]),L=(0,be.useCallback)(x=>x.ownerDocument.getElementById(T),[T]),{dialogProps:Q,backdropProps:Y}=(0,Ya.useOverlayDialog)({isOpen:!0,onClose:E,isCloseBlocked:mr,initialFocus:L}),y=(0,be.useCallback)((x,P)=>{P.isGmailLink&&(x.preventDefault(),n(P.value))},[n]),h=(0,be.useCallback)((x,P)=>{if(!P.isGmailLink){o.current=null;return}let K=Date.now(),S=o.current;if(S&&S.email===P.value&&K-S.timestamp<=ns){o.current=null,x.preventDefault(),n(P.value);return}o.current={email:P.value,timestamp:K}},[n]);return(0,be.useEffect)(()=>(is(),ss),[]),(0,eo.createPortal)((0,X.jsxs)("dialog",{...Q,...rs,"data-contact-popup-root":"true","aria-labelledby":T,className:as,style:dr,children:[(0,X.jsx)("div",{...Y,"data-contact-popup-backdrop":"",className:ur}),(0,X.jsxs)("div",{"data-contact-popup-card":"",className:os,children:[(0,X.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,X.jsx)("h2",{id:T,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),(0,X.jsx)("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:E,"aria-label":i.close,children:(0,X.jsx)(Za.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?(0,X.jsx)("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(x=>(0,X.jsxs)("div",{className:"flex items-center gap-3",children:[(0,X.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.value}),(0,X.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]},x.fieldKey))}):null,(0,X.jsxs)("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?(0,X.jsx)("div",{children:(0,X.jsx)("ul",{className:"space-y-3 text-sm",children:l.map(x=>(0,X.jsx)("li",{className:"flex items-start gap-3",children:(0,X.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,X.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,X.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,X.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.href?(0,X.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,children:x.value}):(0,X.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value})}),(0,X.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,g.length>0?(0,X.jsx)("div",{children:(0,X.jsx)("ul",{className:"space-y-3 text-sm",children:g.map(x=>(0,X.jsx)("li",{className:"flex items-start gap-3",children:(0,X.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,X.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,X.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,X.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[x.href?(0,X.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,target:x.isGmailLink?"_blank":void 0,rel:x.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:P=>y(P,x),onTouchEnd:P=>h(P,x),children:x.value}):(0,X.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value}),x.isGmailLink?(0,X.jsx)("span",{className:`mt-1 block ${_} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),(0,X.jsx)(ra,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,r?(0,X.jsxs)("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,X.jsx)("span",{className:"text-xs",children:i.popupLastContactDate}),(0,X.jsx)("span",{children:r})]}):null,b?null:(0,X.jsx)("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});var xe,Dn,oa=Re(()=>{"use strict";pe();Pe();xe=require("react/jsx-runtime"),Dn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>(0,xe.jsxs)("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,xe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,xe.jsx)("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),(0,xe.jsx)("div",{className:`shrink-0 whitespace-nowrap ${$t} ${s.fgMuted}`,children:i})]}),(0,xe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,xe.jsx)("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),(0,xe.jsx)("div",{className:"block sm:hidden",children:(0,xe.jsx)("span",{className:`w-full truncate text-left ${$t} ${s.fgSecondary} leading-tight`,children:a})}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate font-medium ${s.fg}`,children:e}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fg}`,children:n}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fgSecondary}`,children:i}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),(0,xe.jsx)("div",{className:`hidden items-end justify-end ${$t} ${s.fgMuted} xl:flex`,children:(0,xe.jsx)("span",{className:"truncate",children:r})})]})});var pr,yn,ro,ls,cs,ds,us,ao,oo,ms,ps,fs,gs,hs,ys,bs,Ss,io,so,to,no,fr,Cs,vs,ia,lo,sa=Re(()=>{"use strict";pr=require("@aiquants/fuzzy-search"),yn=require("@aiquants/select-box"),ro=/[​]/g,ls=/^[\s  ]+|[\s  ]+$/g,cs=/\s+/,ds=/^[\p{Script=Latin}\s]+$/u,us=/\p{Script=Latin}/u,ao=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),oo="union",ms=65377,ps=65439,fs=["\uFF9E","\uFF9F"],gs=(()=>{let e=new Map;for(let t=ms;t<=ps;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of fs){let i=(n+a).normalize("NFKC");i.length===1&&e.set(i,n+a)}}return e})(),hs=/[぀-ヿ]/u,ys=e=>{let t=Array.from(e,n=>gs.get(n)??n).join("");return hs.test(t)?null:t},bs=e=>(0,yn.normalizeText)(e.replace(ro,"").replace(ls,""),ao),Ss=e=>{if(!ds.test(e))return null;let t=(0,yn.romajiToKatakana)(e);return us.test(t)?null:t},io=e=>e.split(cs).filter(Boolean),so=e=>(0,pr.parseQuerySets)(e,oo).sets.map(({query:t})=>t),to=e=>so(e).flatMap(t=>io(t)),no=e=>(0,pr.formatQuerySets)({combine:oo,sets:Array.from(new Set(e),t=>({query:t}))}),fr=e=>{let t=so(e.replace(ro,"")).map(a=>io(bs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=Ss(a);if(i===null)return no(t);n.push(i)}return no(n)},Cs=e=>{let t=new Set([...to(e),...to(fr(e))]),n=new Set;for(let a of t)for(let i of(0,yn.getNormalizedVariants)(a,ao)){let o=i.trim();if(!o)continue;n.add(o);let r=ys(o);r!==null&&n.add(r)}return Array.from(n)},vs=/[.*+?^${}()|[\]\\]/g,ia=e=>{let t=Cs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(vs,"\\$&")).sort((a,i)=>i.length-a.length);return new RegExp(n.join("|"),"gi")},lo=(e,t)=>{let n=ia(e);if(n===null)return i=>i;let a=i=>t.some(o=>{let r=i[o];return typeof r=="string"&&r.search(n)!==-1});return i=>{let o=[],r=[];for(let u of i)a(u.item)?o.push(u):r.push(u);return[...o,...r]}}});var co,Ct,xs,Le,gr=Re(()=>{"use strict";co=require("react");sa();pe();Ct=require("react/jsx-runtime"),xs=`rounded ${At.mark} px-1 ${s.fg}`,Le=(0,co.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,Ct.jsx)(Ct.Fragment,{children:e});let a=ia(t);if(a===null)return(0,Ct.jsx)(Ct.Fragment,{children:e});let i=[],o=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}i.push((0,Ct.jsx)("mark",{className:xs,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),(0,Ct.jsx)(Ct.Fragment,{children:i})});Le.displayName="HighlightedText"});var uo={};Aa(uo,{ContactDetailGrid:()=>la,default:()=>Ts});var yr,Dt,hr,la,Ts,mo=Re(()=>{"use strict";yr=require("react");Vt();he();aa();oa();gr();Dt=require("react/jsx-runtime"),hr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},la=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let u=ne(),d=(0,yr.useMemo)(()=>ln(e),[e]),c=(0,yr.useMemo)(()=>cn(e),[e]),f=d.value??"-",p=c.value??"-",l=(0,yr.useMemo)(()=>st(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=hr(e.full_name)??u.noName,b=hr(e.company_name),T=hr(e.department),E=(L,Q="-")=>(0,Dt.jsx)(Le,{text:L??Q,query:t,enabled:n});return(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(Dn,{fullName:E(g),title:E(hr(e.title)),companyName:E(b),department:E(T),phoneNumber:p,email:E(f),updatedAtText:l}),o?(0,Dt.jsx)(On,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Ts=la});var Gl={};Aa(Gl,{AdvancedSearchSettings:()=>sr,BasicSearchSettings:()=>lr,CONTACT_MAP_LABEL_CATALOGS:()=>lt,CONTACT_MAP_LABEL_KEYS:()=>mn,ContactDetailGrid:()=>la,ContactDetailPanel:()=>Xt,ContactDetailPopup:()=>On,ContactDetailRowLayout:()=>Dn,ContactMapAnnotation:()=>Cr,ContactMapAppView:()=>Kl,ContactMapConfigProvider:()=>$o,ContactMapSearchListView:()=>ba,ContactMapSearchPage:()=>Ra,ContactMapSearchTabGroup:()=>Ea,ContactMapSearchTreeView:()=>Ma,ContactMapStreamAnnouncer:()=>Br,ContactMapStreamClient:()=>Hn,ContactMapStreamFailureNotice:()=>zr,HighlightedText:()=>Le,IndexWorkerSettings:()=>Pr,LIST_COLLAPSE_THRESHOLD:()=>rl,LIST_DETAIL_PANEL_MIN_WIDTH:()=>Zo,LIST_EXPAND_THRESHOLD:()=>al,LIST_PANEL_MIN_WIDTH:()=>Jo,LIST_RESIZE_HANDLE_THICKNESS:()=>ei,LevenshteinWorkerSettings:()=>_r,Progress:()=>fa,SearchOptionsPanel:()=>Ar,StatItem:()=>D,StatisticsPanel:()=>Dr,SwipeOverlay:()=>Kn,TREE_COLLAPSE_THRESHOLD:()=>yl,TREE_DETAIL_PANEL_MIN_WIDTH:()=>Ci,TREE_EXPAND_THRESHOLD:()=>bl,TREE_PANEL_MIN_WIDTH:()=>Si,TREE_RESIZE_HANDLE_THICKNESS:()=>vi,Tabs:()=>Wn,TabsContent:()=>Ht,TabsList:()=>bn,TabsTrigger:()=>Wt,TreeWorkerSession:()=>jn,WorkerStatsSection:()=>en,assertContactMapStreamEndpoint:()=>Fn,assertContactMapTreeWorkerUrl:()=>da,assertContactMapWorkerUrls:()=>ks,composeTreeVirtualScrollOptions:()=>xi,contactMapShouldRevalidate:()=>jl,countContactMapCompanies:()=>Fo,deserializeStreamRecord:()=>Do,getContactMapStreamClient:()=>Wo,getTreeWorkerSession:()=>li,layerContactMapWorkerUrls:()=>Yt,resetContactMapStreamClientForTesting:()=>Os,resetTreeWorkerSessionForTesting:()=>gl,resolveContactMapLabels:()=>ir,useAnimatedNumber:()=>Ca,useContactMapConfig:()=>mt,useContactMapLabels:()=>ne,useContactMapStream:()=>Ho,useContactPanelSizing:()=>Lr,useDynamicViewportHeight:()=>ga,useHorizontalDragScroll:()=>vt,useLongPressPopup:()=>Un,useReportPopupVisibility:()=>ni,useResponsiveTwoColumnLayout:()=>Vn,useRowPopupRegistry:()=>ti,useStreamedContactMapContext:()=>In,useTreeWorker:()=>va});module.exports=Ki(Gl);var qt=require("@aiquants/fuzzy-search"),_n=require("react");he();pe();Pe();var ve=require("react/jsx-runtime"),sr=(0,_n.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=(0,_n.useId)(),r=(0,_n.useId)(),u=[];return u.push((0,ve.jsxs)("div",{className:`${a} ${F.sky} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ve.jsx)("label",{htmlFor:o,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),(0,ve.jsx)("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push((0,ve.jsxs)("div",{className:`${a} ${F.indigo} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ve.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),(0,ve.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),(0,ve.jsxs)("section",{className:"space-y-3",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ve.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[(0,ve.jsx)("span",{children:"\u26A1"}),(0,ve.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ve.jsx)("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${q.borderControl} ${k.muted} px-2 font-medium ${s.fgSecondary} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ve.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});sr.displayName="AdvancedSearchSettings";var Ot=require("@aiquants/fuzzy-search"),ze=require("react");he();pe();Pe();var $=require("react/jsx-runtime"),lr=(0,ze.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=ne(),u=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=(0,ze.useId)(),f=(0,ze.useId)(),p=(0,ze.useId)(),l=(0,ze.useId)(),g=(0,ze.useId)(),b=(0,ze.useId)(),T=(0,ze.useId)(),E=(0,ze.useId)(),L=(0,ze.useId)(),Q=(0,ze.useId)(),Y=[];return Y.push((0,$.jsxs)("div",{className:`${u} ${F.blue} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,$.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),(0,$.jsx)("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),(0,$.jsxs)("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,$.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),Y.push((0,$.jsxs)("div",{className:`${u} ${F.amber} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,$.jsxs)("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,$.jsxs)("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,$.jsxs)("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:l,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,$.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,$.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),(0,$.jsxs)("select",{id:g,value:e.multiTermOperator??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,$.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,$.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),Y.push((0,$.jsxs)("div",{className:`${u} ${F.emerald} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,$.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,$.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),(0,$.jsxs)("select",{id:b,value:e.sortBy||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,$.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,$.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,$.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,$.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),(0,$.jsxs)("select",{id:T,value:e.sortOrder||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,$.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),Y.push((0,$.jsxs)("div",{className:`${u} ${F.purple} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,$.jsx)("label",{htmlFor:E,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),(0,$.jsxs)("select",{id:E,value:e.parallelSearchStrategy||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,$.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,$.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,$.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,$.jsxs)("label",{htmlFor:L,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:L,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,$.jsxs)("label",{htmlFor:Q,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:Q,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,$.jsxs)("section",{className:"space-y-3",children:[(0,$.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[(0,$.jsx)("span",{children:"\u{1F527}"}),(0,$.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:Y})]})});lr.displayName="BasicSearchSettings";var ho=require("@aiquants/swipe-overlay"),yo=Ce(require("lucide-react/dist/esm/icons/badge-check.js")),bo=Ce(require("lucide-react/dist/esm/icons/building-2.js")),So=Ce(require("lucide-react/dist/esm/icons/calendar-clock.js")),Co=Ce(require("lucide-react/dist/esm/icons/check.js")),vo=Ce(require("lucide-react/dist/esm/icons/copy.js")),xo=Ce(require("lucide-react/dist/esm/icons/id-card.js")),To=Ce(require("lucide-react/dist/esm/icons/mail.js")),No=Ce(require("lucide-react/dist/esm/icons/phone.js")),Mo=Ce(require("lucide-react/dist/esm/icons/user-round.js")),Ve=require("react");Vt();var ut={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)};he();pe();var nt=Ce(require("@radix-ui/react-tabs")),br=Ce(require("react"));pe();An();var Sr=require("react/jsx-runtime"),Wn=nt.Root,bn=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.List,{ref:n,className:Oe(`inline-flex h-10 items-center justify-center rounded-md ${k.muted} p-1 ${s.fgMuted}`,e),...t}));bn.displayName=nt.List.displayName;var Wt=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Trigger,{ref:n,className:Oe(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${w.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${w.activeTabSurface} ${w.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Wt.displayName=nt.Trigger.displayName;var Ht=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Content,{ref:n,className:Oe(`mt-2 ${w.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Ht.displayName=nt.Content.displayName;fn();Pe();gr();var M=require("react/jsx-runtime"),po=`truncate font-semibold ${s.fg} ${N}`,fo={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ns=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=ne(),p=!!(o&&a&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,M.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.subtle} px-2.5 py-1.5 transition-colors`,children:[(0,M.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,M.jsx)("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${k.surface} ${s.fgMuted} transition-colors`,children:(0,M.jsx)(e,{size:14})}),(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`font-medium ${_} ${s.fgMuted}`,children:t}),u?(0,M.jsx)("a",{href:u,className:`align-top ${po} ${pn}`,target:l,rel:l?"noopener noreferrer":void 0,children:(0,M.jsx)(Le,{text:n,query:d??"",enabled:c})}):(0,M.jsx)("div",{className:po,children:(0,M.jsx)(Le,{text:n,query:d??"",enabled:c})})]})]}),p?(0,M.jsx)("button",{type:"button",onClick:()=>o&&a&&i&&o(a,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverBlueAccentBorder} ${w.hoverBlueFg} ${dt}`,"aria-label":f.copyField(t),children:r?(0,M.jsx)(Co.default,{size:14}):(0,M.jsx)(vo.default,{size:14})}):null]})},go=({items:e,searchTerm:t,enableHighlighting:n})=>(0,M.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>(0,M.jsxs)("div",{className:`flex flex-col gap-0.5 rounded-md border ${q.borderSubtle} ${k.surface} px-2 py-1 transition-colors`,children:[(0,M.jsx)("dt",{className:`font-semibold ${_} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),(0,M.jsx)("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:(0,M.jsx)(Le,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ca=({title:e})=>(0,M.jsx)("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Ms=()=>{let e=ne();return(0,M.jsxs)("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${q.borderSubtle} border-dashed ${k.surface} p-4 text-center transition-colors`,children:[(0,M.jsx)("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),(0,M.jsx)("p",{className:`${_} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Es=Object.freeze({overlay:ho.SWIPE_OVERLAY_SCROLL_AREA_STYLE,pane:void 0}),Xt=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=ne(),[u,d]=(0,Ve.useState)(null),c=(0,Ve.useRef)(null),f=(0,Ve.useMemo)(()=>({...fo,...i}),[i]);(0,Ve.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=(0,Ve.useMemo)(()=>ln(e),[e]),l=(0,Ve.useMemo)(()=>cn(e),[e]),g=(0,Ve.useMemo)(()=>st(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=(0,Ve.useCallback)(async(S,R,ce)=>{try{await navigator.clipboard.writeText(R),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(j){ut.error("Failed to copy contact detail",j)}},[]);if(!e)return(0,M.jsx)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,style:fo,children:(0,M.jsx)(Ms,{})});let T=[le(e.title),le(e.department)].filter(S=>S!=="-"),E=[T.join(" / "),le(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",L=et(e.full_name)??r.noName,Q=[{fieldKey:"full_name",label:r.fieldFullName,value:L},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:le(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:le(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:le(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:le(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:le(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:le(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:le(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:le(e.url)}],Y=[{label:r.fieldCustomEmail,value:le(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:le(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:le(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:le(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:le(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:le(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:le(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:le(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:le(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:le(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:le(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:le(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:le(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:st(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:le(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:st(e.updated_at,r.recordDateTime)}],x=[{rowKey:"person_id",icon:xo.default,label:"person_id",value:le(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:To.default,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:bt(p.value,!1)},{rowKey:"primary_phone",icon:No.default,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Pn(l.value)},{rowKey:"contacted_at",icon:So.default,label:r.summaryLastContact,value:g}],P=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:Y,recommendedKey:p.fieldKey??null,resolveHref:S=>bt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Pn(S!=null?String(S):null)}],K=[{value:"summary",label:r.detailTabSummary,content:(0,M.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,M.jsxs)("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,M.jsx)(bo.default,{size:16}),(0,M.jsx)("span",{children:(0,M.jsx)(Le,{text:le(e.company_name),query:n??"",enabled:a})})]}),T.length>0?(0,M.jsx)("div",{className:`${s.fgMuted} text-sm`,children:T.map((S,R)=>(0,M.jsxs)("span",{children:[R>0&&" / ",(0,M.jsx)(Le,{text:S,query:n??"",enabled:a})]},`header-line-${R}`))}):null]}),(0,M.jsx)("div",{className:"flex flex-col gap-3",children:x.map(S=>(0,M.jsx)(Ns,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:(0,M.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,M.jsx)(ca,{title:r.detailBasicProfile}),(0,M.jsx)(go,{items:Q,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:(0,M.jsx)("div",{className:"flex flex-col gap-4",children:P.map(({sectionKey:S,title:R,emptyText:ce,entries:j,recommendedKey:Ne,resolveHref:de})=>(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)(ca,{title:R}),j.length===0?(0,M.jsx)("p",{className:`${s.fgMuted} text-xs`,children:ce}):(0,M.jsx)("div",{className:"flex flex-col gap-2",children:j.map(z=>{let I=de(z.rawValue),ee=z.fieldKey===Ne;return(0,M.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.surface} px-3 py-2 transition-colors`,children:[(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`font-medium ${s.fgMuted} text-xs`,children:z.label}),(0,M.jsx)("div",{className:`wrap-break-word ${s.fg} text-sm`,children:I?(0,M.jsx)("a",{href:I,className:`text-inherit ${pn}`,children:(0,M.jsx)(Le,{text:z.value,query:n??"",enabled:a})}):(0,M.jsx)(Le,{text:z.value,query:n??"",enabled:a})})]}),ee?(0,M.jsxs)("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${re.emerald} px-2 py-0.5 font-semibold ${_} ${m.emerald} transition-colors`,children:[(0,M.jsx)(yo.default,{size:14}),r.preferred]}):null]},z.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:(0,M.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,M.jsx)(ca,{title:r.detailTabMeta}),(0,M.jsx)(go,{items:h,searchTerm:n,enableHighlighting:a})]})}];return(0,M.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[(0,M.jsx)("div",{className:`${q.borderSubtle} border-b px-3 py-1.5 transition-colors ${k.subtle}`,children:(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${re.blue} ${m.blue} transition-colors`,children:(0,M.jsx)(Mo.default,{size:16})}),(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:(0,M.jsx)(Le,{text:L,query:n??"",enabled:a})}),(0,M.jsx)("div",{className:`truncate ${_} ${s.fgMuted}`,children:(0,M.jsx)(Le,{text:E,query:n??"",enabled:a})})]})]})}),(0,M.jsxs)(Wn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,M.jsx)(bn,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${q.borderSubtle} border-b ${k.subtle} px-2 py-1 transition-colors`,children:K.map(S=>(0,M.jsx)(Wt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${N} transition-colors ${w.activeTabSurface} ${w.activeTabBlueFg}`,children:(0,M.jsx)("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),K.map(S=>(0,M.jsx)(Ht,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Es[t],children:S.content},S.value))]})]})};var Eo=require("react");jt();he();pe();var Ke=require("react/jsx-runtime"),Cr=(0,Eo.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=He(),u=se(o,e),d=se(o,t);return(0,Ke.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationTotalLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?(0,Ke.jsx)("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?r.annotationStreamingProgress({loaded:a,total:i,percent:Math.min(100,Math.round(a/i*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?(0,Ke.jsx)("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});Cr.displayName="ContactMapAnnotation";var Pa=require("react");un();_t();var vr=e=>e==="unauthenticated"||e==="forbidden";function xr(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ie(e)}`)}function Lo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ie(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ie(e)}`)}var Sn=require("react");_t();un();he();_t();un();Xr();var Ls=["indexWorker","levenshteinWorker","treeWorker"];function ko(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)}}var wo={setting:"workerUrls"},Ro=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Ls,hints:i={}}=t;if(!dn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ie(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(i,r.key)?i[r.key]:void 0,c=d===void 0?rr(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}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ie(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;ko(n,f,c),c!==void 0&&(u[f]=c)}return u};function ks(e,t=wo){Ro(e,t)}function da(e){ko("workerUrls","treeWorker",e)}var Yt=(e,t,n=wo)=>{let a=Ro(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}};var Tr=require("react/jsx-runtime"),Po=e=>{if(!dn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ie(e)}`);let t=e;return{streamEndpoint:$e(t,"streamEndpoint"),openEmailsWithGmail:$e(t,"openEmailsWithGmail"),treeWorkerFactory:$e(t,"treeWorkerFactory"),workerUrls:Yt(void 0,$e(t,"workerUrls")),locale:$e(t,"locale"),labels:$e(t,"labels")}},_o=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:i})}))},ws=_o(Po({})),Ao=(0,Sn.createContext)(ws),Rs=Object.freeze({locale:"locale",labels:"labels"});function ua({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:u,labels:d}=Po(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=(0,Sn.useMemo)(()=>_o({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,i,o,c,f,p,u,d]);return(0,Tr.jsx)(Ao.Provider,{value:l,children:(0,Tr.jsx)(za,{locale:u,labels:d,surface:t,children:n})})}function $o({config:e,children:t}){return(0,Tr.jsx)(ua,{config:e,chromeSurface:Rs,children:t})}function mt(){return(0,Sn.useContext)(Ao)}var Fe=require("react");var Oo=require("@aiquants/auth-core");_t();var Ps=1e3,_s=3e4,As=6;function Fn(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${ie(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ie(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${ie(e)}`)}var Do=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}),$s=e=>Array.isArray(e.records),Hn=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,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};Fn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ps,this.maxRetryDelayMs=t.maxRetryDelayMs??_s,this.maxConsecutiveFailures=t.maxConsecutiveFailures??As,this.logger=t.logger??ut}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"unauthenticated":case"forbidden":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(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});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 i=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let 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"}),n=(0,Oo.accessFailureKindOfStatus)(t.status);if(n!==null)return{accessFailure:n};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 a=t.body.getReader(),i=new TextDecoder,o="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=i.decode(c,{stream:!0}),p=(o+f).split(`
2
+ `);o=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let T;try{T=JSON.parse(b)}catch(E){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",E);continue}if("type"in T&&T.type==="METADATA"){Number.isSafeInteger(T.total)&&T.total>=0&&this.setState({totalCount:T.total});continue}if(!$s(T)){this.logger.warn("[ContactMapStream] server reported error:","error"in T?T.error:""),u=!0;continue}for(let E of T.records)E&&typeof E.person_id=="number"&&(this.recordMap.set(E.person_id,Do(E)),l=!0);T.nextCursor&&(this.lastCursor=T.nextCursor),T.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"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 rt=null,Wo=e=>{if(rt!==null&&rt.endpoint===e)return rt;if(Fn(e),rt===null)return rt=new Hn({endpoint:e}),rt;if(rt.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(rt.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 rt},Os=()=>{rt?.dispose(),rt=null},Ds=new Map,Ws={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},Hs=()=>{let{streamEndpoint:e}=mt();return(0,Fe.useMemo)(()=>(Fn(e),e),[e])};function Ho(){let e=Hs(),t=(0,Fe.useCallback)(()=>Wo(e),[e]);(0,Fe.useEffect)(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=(0,Fe.useCallback)(r=>t().subscribe(r),[t]),a=(0,Fe.useSyncExternalStore)(n,()=>t().getState(),()=>Ws),i=(0,Fe.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>Ds),o=(0,Fe.useCallback)(()=>t().retryNow(),[t]);return(0,Fe.useMemo)(()=>({...a,recordMap:i,retryNow:o}),[a,i,o])}var Fo=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 In(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:u,retryNow:d}=Ho(),c=(0,Fe.useMemo)(()=>Fo(e),[e]);return{context:(0,Fe.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||vr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:i,companyCount:c,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,u,i,c,o,r]),retryNow:d}}he();var Hr=require("@aiquants/fuzzy-search"),Ai=require("@aiquants/fuzzy-search/react"),$i=Ce(require("lucide-react/dist/esm/icons/search.js")),G=require("react"),Fr=require("react-router");sa();un();var je=require("react"),vt=e=>{let t=(0,je.useRef)(null),n=(0,je.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,i=(0,je.useCallback)(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=(0,je.useCallback)(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);(0,je.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=(0,je.useCallback)(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=(0,je.useCallback)(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=(0,je.useCallback)(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=(0,je.useCallback)(p=>{d(p)},[d]),f=(0,je.useCallback)(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};jt();he();var Io=require("@aiquants/fuzzy-search"),Fs="@aiquants/contact-map:search",Nr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=Io.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerId:Fs,workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};var Is="[data-contact-map-search-page]",Bs="[data-contact-map-search-field]",Bo='[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]',zs=[Bs,Bo],Us="(pointer: coarse)",ma=e=>e!==null&&typeof e.matchMedia=="function"&&e.matchMedia(Us).matches,zo=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(Is);if(n!==null)return n}return null},Uo=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;let a=ma(t.defaultView)?[Bo]:zs;for(let i of a){let o=e.querySelector(i);if(o!==null&&(o.focus(),t.activeElement===o))return o}return null};pe();pe();An();var pa=require("react/jsx-runtime");function fa({value:e,max:t=100,className:n,indicatorClassName:a,...i}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return(0,pa.jsx)("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Oe(`relative h-2 w-full overflow-hidden rounded-full ${At.progressTrack}`,n),...i,children:(0,pa.jsx)("div",{"data-slot":"progress-indicator",className:Oe(`h-full rounded-full ${tt.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}Pe();var Cn="view";var Rr=require("react"),Mi=require("react-router");he();pe();Pe();var Qt=require("@aiquants/resize-panels"),Tn=require("@aiquants/virtualscroll"),W=require("react");Vt();var Bn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},zn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Mr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,i=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:i}}var vn=require("react"),ga=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:i=240}=t??{},[o,r]=(0,vn.useState)(600),u=(0,vn.useCallback)(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=R=>Number.parseFloat(R)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),T=c(l.getPropertyValue("--scrollbar-height")),E=window.getComputedStyle(d),L=c(E.marginBottom),Q=c(E.paddingBottom),Y=window.innerHeight-g-T-a,y=p?Math.min(p.bottom,Y):Y,h=p?Math.max(p.top,b):b,x=Math.max(f,h),P=y-x-L-Q,K=Number.isFinite(P)?Math.floor(P):0,S=K>0?K:i;S>0&&Number.isFinite(S)&&r(R=>Math.abs(R-S)>1?S:R)},[a,e,i]);return(0,vn.useEffect)(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};var Te=require("react"),Vs=600,Vo=8,Un=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=(0,Te.useState)(!1),[r,u]=(0,Te.useState)(null),d=(0,Te.useRef)(null),c=(0,Te.useRef)(!1),f=(0,Te.useRef)(null),p=(0,Te.useRef)({onSelect:t,resolveItem:n,item:a});(0,Te.useEffect)(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=(0,Te.useCallback)(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=(0,Te.useCallback)(()=>{f.current&&(l(),f.current=null)},[l]),b=(0,Te.useCallback)(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let x=p.current,P=null;x.item!==void 0?P=x.item:x.resolveItem&&h.target&&(P=x.resolveItem(h.target)),P!==null&&(c.current=!0,x.onSelect?.(P),u(P),o(!0)),g()},Vs))},[l,g]),T=(0,Te.useCallback)(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),E=(0,Te.useCallback)(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),L=(0,Te.useCallback)(()=>{c.current=!1},[]),Q=(0,Te.useCallback)(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let x=Math.abs(h.clientX-f.current.x),P=Math.abs(h.clientY-f.current.y);(x>Vo||P>Vo)&&(l(),f.current=null)},[l]),Y=(0,Te.useCallback)(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),y=(0,Te.useCallback)(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return(0,Te.useEffect)(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let x=[["pointerdown",b,void 0],["pointerup",T,void 0],["pointercancel",T,void 0],["pointermove",Q,void 0],["pointerleave",T,void 0],["contextmenu",Y,void 0]],P=[["mousedown",E,!0],["mouseup",E,!0],["click",E,!0],["pointerdown",L,!0],["keydown",L,!0],["contextmenu",Y,!0],["pointerup",T,!0],["pointercancel",T,!0]];for(let[K,S,R]of x)h.addEventListener(K,S,R);for(let[K,S,R]of P)window.addEventListener(K,S,R);return()=>{for(let[K,S,R]of x)h.removeEventListener(K,S,R);for(let[K,S,R]of P)window.removeEventListener(K,S,R);l()}},[e,b,T,Q,E,L,Y,l]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};var xt=require("react");function Vn(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",i=(0,xt.useSyncExternalStore)((0,xt.useCallback)(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=(0,xt.useState)(!1),[u,d]=(0,xt.useState)(0);return(0,xt.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(T=>T&&b>=t.expandThreshold?!1:!T&&b<t.collapseThreshold?!0:T))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}he();var Ko=require("@aiquants/input-method");_t();var jo=(e,t)=>{if(Gs(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(0,Ko.isInputMethodKey)(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 js(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}},Ks=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),js=e=>Ks.has(e),Gs=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:i}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ie(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ie(i)}`);let o=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 ${ie(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ie(t)}`)};pe();var xn=require("@aiquants/swipe-overlay"),Er=require("react");he();ta();pe();fn();An();var Tt=require("react/jsx-runtime"),qs=Oe(cr,"flex overflow-hidden"),Xs=Oe(ur,"motion-safe:transition-opacity motion-safe:duration-200"),Ys=`relative ml-auto flex h-full w-full max-w-lg flex-col ${k.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Qs=`flex shrink-0 items-center justify-between gap-3 ${q.borderSubtle} border-b px-3 py-2`,Js=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Zs=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${w.hoverMuted} ${dt}`,el="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Kn=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=ne(),r=(0,Er.useId)(),u=(0,xn.useOverlayPresence)(e),d=(0,Er.useCallback)(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=(0,xn.useSwipeOverlayDialog)({isOpen:e,onClose:t,isCloseBlocked:mr,skipWhenTextSelected:!0,initialFocus:d});return u?(0,Tt.jsxs)("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:Oe(qs,e&&!g?"pointer-events-auto":"pointer-events-none"),style:dr,children:[(0,Tt.jsx)("div",{...f,"data-contact-map-overlay-backdrop":"",className:Oe(Xs,e?"opacity-100":"opacity-0")}),(0,Tt.jsxs)("div",{...p,"data-contact-map-overlay-panel":"",className:Oe(Ys,e?"pointer-events-auto":"pointer-events-none",a),children:[(0,Tt.jsxs)("div",{className:Qs,children:[(0,Tt.jsx)("h2",{id:r,tabIndex:-1,className:Js,children:i===void 0?o.overlayTitle:i}),(0,Tt.jsx)("button",{type:"button",className:Zs,onClick:()=>l(),children:o.close})]}),(0,Tt.jsx)("div",{"data-contact-map-overlay-body":"",className:el,style:xn.SWIPE_OVERLAY_SCROLL_AREA_STYLE,children:n})]})]}):null};fn();Pe();oa();var O=require("react/jsx-runtime"),tl=(0,W.lazy)(async()=>({default:(await Promise.resolve().then(()=>(mo(),uo))).default})),ha=64,Go="h-[64px]",qo=240,nl=4,ya=Mr(Bn),Jo=Bn.listPanelMinWidth,Zo=Bn.detailPanelMinWidth,ei=Bn.handleThickness,rl=ya.collapseThreshold,al=ya.expandThreshold,ol=({contactData:e})=>{let t=ne(),n=et(e?.full_name)??t.noName,a=et(e?.title)??"-",i=et(e?.company_name)??"-",o=et(e?.department)??"-",r=ln(e).value??"-",u=cn(e).value??"-",d=st(e?.updated_at,t.recordDateTime);return(0,O.jsx)(Dn,{fullName:n,title:a,companyName:i,department:o,phoneNumber:u,email:r,updatedAtText:d})},il=e=>({"--contact-panel-height":`${e}px`}),sl=e=>typeof e=="object"&&e!==null&&"item"in e,ll=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,cl=(e,t)=>{for(let n of e){let a=Ut(n);if(a?.person_id===t)return a}return null},Xo=(e,t)=>t!==null&&Ut(e)?.person_id===t,Yo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ut(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Qo=(e,t,n)=>{let a=Yo(e,t,n);return a!==null?a:Yo(e,t-n,n===1?-1:1)},Lr=(e,t,n)=>{let{viewportHeight:a}=ga(t,{enableMutationObserver:!0,bottomGap:nl,minFallbackHeight:qo}),[i,o]=(0,W.useState)(0),r=(0,W.useCallback)(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),T=Math.ceil(b.top-g.top);Number.isFinite(T)&&T>0&&o(E=>Math.abs(E-T)>1?T:E)},[t,n]);(0,W.useLayoutEffect)(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:qo,d=i>0?i:0,c=u+d,f=(0,W.useMemo)(()=>il(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},dl=new Set,ti=()=>{let[e,t]=(0,W.useState)(dl),n=(0,W.useCallback)((a,i)=>{t(o=>{if(o.has(a)===i)return o;let r=new Set(o);return i?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},ni=(e,t,n)=>{let a=(0,W.useRef)(n);(0,W.useLayoutEffect)(()=>{a.current=n},[n]),(0,W.useEffect)(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},ri=(0,W.memo)(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=ne(),b=(0,W.useRef)(null),T=(0,O.jsx)("div",{className:Go}),E=sl(e)?e:null,L=Ut(e),{isPopupVisible:Q,handleClosePopup:Y}=Un({ref:b,onSelect:u,item:L?.person_id});if(ni(L?.person_id??null,Q,l),!e||!L)return T;let{person_id:y}=L,h=t%2===0?k.surface:k.subtle,x=`${re.blue} ring-1 ${w.selectedRing}`,P=i?x:h,K=["B","F"].map(S=>ll(S,S==="B"?E?.baseScore:E?.score)).filter(Boolean);return(0,O.jsxs)("div",{ref:b,id:(0,Tn.virtualScrollItemElementId)(a,y),className:`flex ${Go} w-full items-center overflow-hidden ${q.borderSubtle} border-b px-4 py-2 text-left transition-colors ${w.hoverBlueTint} ${P} ${ja}`,style:{height:ha},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(y),children:[(0,O.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,O.jsx)("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),(0,O.jsx)("div",{className:`truncate ${$t} ${s.fgSecondary} leading-tight`,children:y}),(0,O.jsx)("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${$t} ${s.fgMuted} leading-tight`,children:K.length?K.map(S=>(0,O.jsx)("span",{children:S},S)):(0,O.jsx)("span",{children:"-"})})]}),(0,O.jsx)(W.Suspense,{fallback:(0,O.jsx)(ol,{contactData:L}),children:(0,O.jsx)(tl,{contactData:L,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:Q,onRequestClose:Y})})]})});ri.displayName="ContactListRow";var ba=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=He(),p=(0,W.useRef)(null),l=(0,W.useRef)(null),[g,b]=(0,W.useState)(null),{normalizedViewportHeight:T,panelSizingStyle:E}=Lr(u,l,p),{isAnyPopupVisible:L,handlePopupVisibilityChange:Q}=ti(),Y=(0,W.useMemo)(()=>({enablePointerDrag:!L,enableKeyboardNavigation:!1}),[L]),y=(0,W.useMemo)(()=>i?n:t,[i,n,t]),[h,x]=(0,W.useState)(null),P=(0,W.useCallback)(te=>{b(te),x(te)},[]),K=(0,W.useCallback)(te=>{if(!r)return;let ye=te.trim();if(!ye||ye==="-"||typeof window>"u")return;let ae=bt(ye,!0);ae&&window.open(ae,"_blank","noopener,noreferrer")},[r]),[S,R]=(0,W.useState)(!1),ce=(0,W.useCallback)(()=>R(!1),[]),j=(0,W.useCallback)(te=>{P(te),R(!0)},[P]),Ne=(0,W.useId)(),de=(0,W.useId)(),z=(0,W.useRef)(null),I=y.length,ee=(0,W.useCallback)((te,ye)=>(0,O.jsx)(ri,{entry:te,index:ye,itemCount:I,listboxId:Ne,isSelected:Xo(te,g),isActive:Xo(te,h),onSelect:j,onLongPressSelect:P,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:K,onPopupVisibilityChange:Q}),[I,Ne,g,h,j,P,a,o,r,K,Q]),fe=(0,W.useMemo)(()=>{let te=new Map;return y.forEach((ye,ae)=>{let gt=Ut(ye);gt!==null&&te.set(gt.person_id,ae)}),te},[y]),Me=h===null?null:fe.get(h)??null,Ie=g===null?null:fe.get(g)??null,Ft=Math.max(1,Math.floor(T/ha)),tn=(0,W.useCallback)(te=>{if(te.target.id!==Ne)return;let ye=jo(te.nativeEvent,{activeIndex:Me,startIndex:Ie===null?0:Ie,itemCount:I,pageSize:Ft});if(ye===null)return;if(te.preventDefault(),ye.kind==="activate"){Me!==null&&h!==null&&j(h);return}let ae=Qo(y,ye.index,ye.direction);ae!==null&&(x(ae.personId),z.current?.scrollToIndex(ae.index,{align:"nearest"}))},[Ne,Me,Ie,I,Ft,h,j,y]),Et=(0,W.useCallback)(te=>{if(te.target.id!==Ne||Me!==null||!te.target.matches(":focus-visible"))return;let ye=Qo(y,Ie===null?0:Ie,1);ye!==null&&x(ye.personId)},[Ne,Me,Ie,y]),nn=(0,W.useMemo)(()=>({id:Ne,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":de}),[Ne,c.listboxLabel,de]),Ee=(0,W.useCallback)(te=>y[te],[y]),rn=(0,W.useCallback)(te=>Ut(y[te])?.person_id??`row-${te}`,[y]),Qe=(0,W.useCallback)(()=>ha,[]),ft=(0,W.useMemo)(()=>({enabled:!0,renderVisual:Tn.tapScrollCircleSampleVisual}),[]),Je=(0,W.useMemo)(()=>g===null?null:cl(y,g),[g,y]);(0,W.useEffect)(()=>{g!==null&&!Je&&b(null)},[g,Je]);let qe=(0,W.useRef)(null),{isTwoColumn:an}=Vn(qe,ya);S&&(an||Je===null)&&R(!1);let Lt=(0,O.jsxs)("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,O.jsx)("div",{className:`hidden rounded-t-lg border ${q.borderSubtle} ${k.subtle} px-4 py-2 transition-colors sm:block`,children:(0,O.jsxs)("div",{className:"flex items-center",children:[(0,O.jsxs)("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${_} ${s.fgSecondary} uppercase tracking-wider`,children:[(0,O.jsx)("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),(0,O.jsx)("span",{className:"leading-tight",children:c.columnId}),(0,O.jsx)("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),(0,O.jsxs)("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnName}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnCompany}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnPhone}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),(0,O.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),(0,O.jsx)("p",{id:de,hidden:!0,children:c.listKeyboardHelp}),(0,O.jsx)("div",{ref:l,className:"flex-1",onKeyDown:tn,onFocus:Et,children:(0,O.jsx)(Tn.VirtualScroll,{ref:z,contentProps:nn,activeItemIndex:I===0?void 0:Me,activeItemVisibleInset:Ga,itemCount:I,getItemKey:rn,behaviorOptions:Y,getItem:Ee,getItemHeight:Qe,viewportSize:T,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ft},locale:d,labels:f,className:`w-full rounded-b-lg border ${q.borderSubtle} border-t-0 ${k.surface} pr-0.75 transition-colors`,children:(te,ye)=>ee(te,ye)})}),n.length===0&&i?(0,O.jsx)("div",{className:"py-8 text-center",children:(0,O.jsx)("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,I===0&&!i?(0,O.jsx)("div",{className:"py-8 text-center",children:(0,O.jsx)("p",{className:s.fgMuted,children:c.listNoData})}):null]});return(0,O.jsx)("div",{ref:qe,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:E,children:an?(0,O.jsxs)(Qt.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,O.jsx)(Qt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Jo,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Lt}),(0,O.jsx)(Qt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:ei,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),(0,O.jsx)(Qt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Zo,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,O.jsx)(Xt,{placement:"pane",contact:Je,searchTerm:a,enableHighlighting:o})})]}):(0,O.jsxs)(O.Fragment,{children:[Lt,Je?(0,O.jsx)(Kn,{isOpen:S,onClose:ce,title:c.detailHeading,children:(0,O.jsx)(Xt,{placement:"overlay",contact:Je,searchTerm:a,enableHighlighting:o})}):null]})})};var fi=require("@aiquants/directory-tree"),Zt=require("@aiquants/resize-panels"),gi=require("@aiquants/virtualscroll"),hi=Ce(require("@heroicons/react/24/solid/FolderMinusIcon.js")),yi=Ce(require("@heroicons/react/24/solid/FolderPlusIcon.js")),U=require("react"),bi=require("react-dom");Vt();var Sa=(e,t)=>e&&e.trim()||t;var Nt=require("react"),Ca=(e,t=250)=>{let[n,a]=(0,Nt.useState)(e),i=(0,Nt.useRef)(null),o=(0,Nt.useRef)(e),r=(0,Nt.useRef)(null),u=(0,Nt.useRef)(!1);return(0,Nt.useEffect)(()=>{if(!u.current){u.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};var De=require("react");_t();he();var si={},ul=250,ml=4e3,kr=3,ai={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},oi=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,jn=class{constructor(t,{workerSource:n,logger:a=ut}){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>=kr){this.logger.error(`[TreeWorker] the tree Worker failed ${kr} times in a row; the tree stops updating until ${ai[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(ul*2**(this.consecutiveFailures-1),ml);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${kr})`,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 ${ie(n)}`);if(!Object.hasOwn(ai,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ie(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=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>=kr||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||!oi(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!oi(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()}i&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},pl=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof si<"u"?si.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)")},Jt=null,ii=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),fl=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},li=e=>{if(da(e),Jt===null){let t=new jn(()=>pl(e),{workerSource:"workerUrls.treeWorker"});return Jt={session:t,workerUrl:e},t}if(Jt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${ii(Jt.workerUrl)} and cannot also load it from ${ii(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Jt.session},gl=()=>{Jt?.session.reset(),Jt=null},hl={snapshot:null,isBuilding:!1};function va(e,t=!1){let n=mt(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=He(),r=o.uncategorizedCompany,u=o.noName,d=(0,De.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=(0,De.useRef)(a);(0,De.useEffect)(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:i,l=(0,De.useMemo)(()=>f?new jn(()=>fl(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=(0,De.useCallback)(()=>l===null?li(p):l,[l,p]),b=(0,De.useCallback)(E=>g().subscribe(E),[g]),T=(0,De.useCallback)(()=>g().getState(),[g]);return(0,De.useEffect)(()=>{let E=g();E.syncRecords(e,d),t&&E.finalize()},[g,e,t,d]),(0,De.useEffect)(()=>{if(l!==null)return()=>l.stop()},[l]),(0,De.useSyncExternalStore)(b,T,()=>hl)}he();pe();Pe();aa();gr();var A=require("react/jsx-runtime"),Na=Mr(zn),Si=zn.listPanelMinWidth,Ci=zn.detailPanelMinWidth,vi=zn.handleThickness,yl=Na.collapseThreshold,bl=Na.expandThreshold,Sl=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=Sa(e.full_name,t.noName),o=Sa(e.title,""),r=(0,A.jsx)(Le,{text:i,query:n,enabled:a});return o?(0,A.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,A.jsx)("span",{children:r}),(0,A.jsx)("span",{className:`${s.fgMuted} text-xs`,children:(0,A.jsx)(Le,{text:o,query:n,enabled:a})})]}):r},Cl="contact-map-tree h-full w-full",vl={hoverClassName:k.muted,directorySelectedClassName:`${re.sky} ${w.treeNameSky}`,itemSelectedClassName:`${re.sky} ${w.treeNameSky}`},xa="h-4 w-4 shrink-0 transition-colors duration-150",xi=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),wr=null,ci=null,Gn=new Map,di="",ui=null,mi=null,xl=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==di||i.formatDirectoryName!==ui||t!==mi)&&(Gn.clear(),di=o,ui=i.formatDirectoryName,mi=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Gn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:Ni([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Gn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let T of g)b.add(T);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Gn.keys())u.has(d)||Gn.delete(d);return r},Ta=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Ti=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Ti(n.children)));return t},Tl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Ni=(e,t,n,a,i)=>{let o=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let T,E,L=l.type==="directory"?a.formatDirectoryName(l.name,Tl(l)):l.name,Q=(0,A.jsx)(Le,{text:L,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let Y=t.get(l.personId);if(Y){r.set(l.absolutePath,Y),o.has(l.personId)||o.set(l.personId,new Set);let y=o.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(E=h=>{let x=Ta(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(x=l.title?m.indigo:m.orange),(0,A.jsx)(n.person,{"aria-hidden":"true",className:`${xa} ${x}`})},l.title&&(Q=Sl(Y,a))),Q=(0,A.jsx)("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:Q})}}else if(l.children){let Y=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(i&&Y.length===0)return null;if(T=Y,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;E=h=>(0,A.jsx)(y,{"aria-hidden":"true",className:`${xa} ${Ta(h)}`})}}return{name:L,label:Q,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:E,children:T}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},Nl=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let T of b)a.add(T);n&&b.length>0&&i.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},pi=(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 i=a.values().next();return i.done?null:i.value},Ma=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=He(),p=c.noName,l=c.treeDirectoryName,g=(0,U.useMemo)(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,T]=(0,U.useState)(null),[E,L]=(0,U.useState)(!1),{snapshot:Q,isBuilding:Y}=va(n,e.isStreamingComplete),y=Q?.tree??null,h=Q?.rebuildEpoch??0,x=(0,U.useMemo)(()=>y?xl(y,a,b,h,g):null,[y,a,b,h,g]),P=(0,U.useMemo)(()=>{if(!y)return null;if(!o)return x;let B;E||(B=new Set(i.map(ge=>ge.item.person_id)));let me=Ni(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},B);return Nl(me,i,E)},[y,x,a,b,e.searchQuery,e.enableHighlighting,o,i,E,g]),K=(0,U.useMemo)(()=>P||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[P]),S=o&&e.errorMessage!==null,[R,ce]=(0,U.useState)(K),j=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(!(r||S)){j.current=!!y,ce(K);return}!j.current&&y&&K.entries.length>0&&(j.current=!0,ce(K))},[K,y,r,S]);let Ne=o&&(r||S)?R:K,{entries:de,personPathMap:z,contactByPath:I,totalCount:ee}=Ne,fe=(0,U.useMemo)(()=>Ti(de),[de]),[Me,Ie]=(0,U.useState)(()=>ci??new Set),Ft=(0,U.useCallback)(B=>!Me.has(B),[Me]),tn=(0,U.useCallback)(B=>{Ie(me=>{let ge=new Set(me);return ge.has(B)?ge.delete(B):ge.add(B),ge})},[]),Et=(0,U.useCallback)(B=>{B.length!==0&&Ie(me=>{let ge=new Set(me);for(let yt of B)ge.add(yt);return ge})},[]),nn=(0,U.useCallback)(B=>{Ie(me=>{if(me.size===0)return me;let ge=!1,yt=new Set(me);for(let J of B)yt.delete(J)&&(ge=!0);return ge?yt:me})},[]);(0,U.useEffect)(()=>{ci=Me},[Me]),(0,U.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ee,rn]=(0,U.useState)(null),[Qe,ft]=(0,U.useState)(null),[Je,qe]=(0,U.useState)(!1),an=(0,U.useCallback)(()=>qe(!1),[]),Lt=(0,U.useRef)(null),te=(0,U.useRef)(null),{normalizedViewportHeight:ye,panelSizingStyle:ae}=Lr(u,te,Lt),gt=(0,U.useCallback)(B=>{let me=I.get(B);return me?(Ee!==me.person_id&&rn(me.person_id),B!==Qe&&ft(B),!0):!1},[I,Qe,Ee]),It=(0,U.useCallback)(B=>{gt(B)&&qe(!0)},[gt]),Mn=(0,U.useCallback)(B=>{It(B.entry.absolutePath)},[It]),kt=(0,U.useCallback)(B=>B instanceof Element?B.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Be,popupItem:En,handleClosePopup:Ln}=Un({ref:te,resolveItem:kt,onSelect:gt}),at=(0,U.useCallback)(B=>{if(!e.openEmailsWithGmail)return;let me=B.trim();if(!me||me==="-"||typeof window>"u")return;let ge=bt(me,!0);ge&&window.open(ge,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),wt=En?I.get(En):null,ot=Be&&wt!==null&&wt!==void 0;(0,U.useEffect)(()=>{Be&&!wt&&Ln()},[Be,wt,Ln]);let Bt=(0,U.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:gi.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Rt=(0,U.useMemo)(()=>xi(Bt,ye,ot),[Bt,ye,ot]);(0,U.useEffect)(()=>{let B=!1;return typeof window>"u"?()=>{B=!0}:wr?(T(wr),()=>{B=!0}):((async()=>{try{let[ge,yt,J,oe]=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(B)return;let ke=ge.default,it=yt.default,jr=J.default,_a=oe.default;ke&&it&&jr&&_a&&(wr={company:ke,department:it,title:jr,person:_a},T(wr))}catch(ge){ut.warn("Failed to load lucide icons",ge)}})(),()=>{B=!0})},[]);let zt=(0,U.useMemo)(()=>{if(!b)return;let B=oe=>ke=>(0,A.jsx)(oe,{"aria-hidden":"true",className:`${xa} ${Ta(ke)}`}),me={company:B(b.company),department:B(b.department),title:B(b.title)},ge=B(b.person),yt=oe=>oe in me,J=oe=>{let[ke]=oe.entry.relativePath.split(":",1);return(yt(ke)?me[ke]:me.company)(oe)};return{directory:J,directoryExpanded:J,file:ge}},[b]),on=(0,U.useCallback)(()=>{Ie(B=>B.size===0?B:new Set)},[]),Ur=(0,U.useCallback)(()=>{fe.length>0&&Et(fe)},[fe,Et]),Pt=pi(Ee,Qe,z);(0,U.useEffect)(()=>{let B=pi(Ee,Qe,z);if(B===null){Ee!==null&&rn(null),Qe!==null&&ft(null);return}B!==Qe&&ft(B)},[Ee,Qe,z]);let Ze=Pt===null?null:I.get(Pt)??null,kn=e.isStreamingComplete,Vr=e.isStreamingFailed,Xn=kn&&n.length===0,Yn=(Y||!y)&&!Xn,Qn=Ca(ee,250),ht=y!==null||Xn,sn=(0,A.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded ${k.muted} px-1.5 font-medium font-mono ${_} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[(0,A.jsx)("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",ht?c.treeNodeCount(Qn):"\u2026"]}),Vr&&!kn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.rose} ${re.rose} px-1.5 font-medium ${_} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.rose}`}),(0,A.jsx)("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):kn?Yn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.amber} ${re.amber} px-1.5 font-medium ${_} ${m.amber}`,title:c.treeBuildingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.amber}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.amber}`})]}),(0,A.jsx)("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.emerald} ${re.emerald} px-1.5 font-medium ${_} ${m.emerald}`,title:c.treeCompleteTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.emerald}`}),(0,A.jsx)("span",{children:"\u2705"})," ",c.treeComplete]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.sky} ${re.sky} px-1.5 font-medium ${_} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.sky}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.sky}`})]}),(0,A.jsx)("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&(0,A.jsxs)("button",{type:"button",onClick:()=>L(!E),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${E?`${re.blue} ${m.blue}`:`${s.fgMuted} ${w.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[(0,A.jsx)("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),fe.length>0?(0,A.jsxs)("div",{className:"flex items-center gap-1",children:[(0,A.jsx)("button",{type:"button",onClick:on,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:(0,A.jsx)(yi.default,{className:"h-4 w-4"})}),(0,A.jsx)("button",{type:"button",onClick:Ur,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:(0,A.jsx)(hi.default,{className:"h-4 w-4"})})]}):null]}),Jn=(0,U.useRef)(null),{isTwoColumn:wn}=Vn(Jn,Na,{mediaQuery:"(min-width: 768px)"});Je&&(wn||Ze===null)&&qe(!1);let Zn=(0,U.useMemo)(()=>({toggle:tn,isExpanded:Ft,expandMultiple:nn,collapseMultiple:Et,isPending:r}),[Et,nn,Ft,tn,r]),er=(0,U.useMemo)(()=>({onEntryClick:Mn,selectedPath:Pt}),[Mn,Pt]),Kr=(0,U.useMemo)(()=>({className:Cl,lineColor:Ka,iconOverrides:zt,showDirectoryIcons:!!zt,showFileIcons:!!zt,highlightStyles:vl,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[zt]),Rn=(0,A.jsx)("div",{ref:Lt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,A.jsx)("div",{ref:te,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:de.length>0?(0,A.jsx)(fi.DirectoryTree,{entries:de,expansion:Zn,selection:er,visual:Kr,virtualScroll:Rt,locale:d,labels:f}):(0,A.jsx)("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return(0,A.jsxs)("div",{ref:Jn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:ae,children:[t&&(0,bi.createPortal)(sn,t),wn?(0,A.jsxs)(Zt.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,A.jsx)(Zt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Si,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Rn}),(0,A.jsx)(Zt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:vi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),(0,A.jsx)(Zt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Ci,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,A.jsx)(Xt,{placement:"pane",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,A.jsxs)(A.Fragment,{children:[Rn,Ze?(0,A.jsx)(Kn,{isOpen:Je,onClose:an,title:c.detailHeading,children:(0,A.jsx)(Xt,{placement:"overlay",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),ot&&wt&&(0,A.jsx)(On,{contactData:wt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:at,onRequestClose:Ln})]})};var Ge=require("react/jsx-runtime"),Ml={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},El=e=>e==="tree"?"tree":"list",Ea=({context:e})=>{let t=ne(),[n,a]=(0,Mi.useSearchParams)(),[i,o]=(0,Rr.useState)(null),r=El(n.get(Cn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=vt(),b=(0,Rr.useCallback)(T=>{let E=T==="tree"?"tree":"list";if(E===r)return;let L=new URLSearchParams(typeof window<"u"?window.location.search:"");E==="list"?L.delete(Cn):L.set(Cn,E),a(L,{replace:!0})},[r,a]);return(0,Ge.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[(0,Ge.jsxs)("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${k.muted} p-0.5 transition-colors`,style:Ml,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="list"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="tree"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Ge.jsx)("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),(0,Ge.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Ge.jsx)(ba,{context:e}):null}),(0,Ge.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Ge.jsx)(Ma,{context:e,controlsContainer:i}):null})]})]})};var Ei=require("react");he();pe();Pe();var Z=require("@aiquants/fuzzy-search"),_e=require("react");he();pe();Pe();var C=require("react/jsx-runtime"),La=1e3,Pr=(0,_e.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,_e.useId)(),u=(0,_e.useId)(),d=(0,_e.useId)(),c=(0,_e.useId)(),f=(0,_e.useId)(),p=(0,_e.useId)(),l=(0,_e.useId)(),g=(0,_e.useId)(),b=(0,_e.useId)(),T=(0,_e.useId)(),E=(0,_e.useId)(),L=[];L.push((0,C.jsxs)("div",{className:`${a} ${F.green} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),(0,C.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),(0,C.jsx)("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),L.push((0,C.jsxs)("div",{className:`${a} ${F.blue} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),(0,C.jsx)("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),(0,C.jsx)("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),L.push((0,C.jsxs)("div",{className:`${a} ${F.cyan} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),(0,C.jsxs)("select",{id:c,value:e.indexWorkerOptions?.strategy??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,C.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,C.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,C.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),(0,C.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:l,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),(0,C.jsx)("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),L.push((0,C.jsxs)("div",{className:`${a} ${F.indigo} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),(0,C.jsx)("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,C.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,C.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:La}}))}),n.noLimit]}),(0,C.jsx)("input",{id:b,type:"range",min:La,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?La:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),L.push((0,C.jsxs)("div",{className:`${a} ${F.emerald} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,C.jsx)("input",{id:T,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:E,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),(0,C.jsx)("input",{id:E,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&(0,C.jsx)("p",{className:`${_} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let Q=(0,_e.useId)(),Y=(0,_e.useId)();return L.push((0,C.jsxs)("div",{className:`${a} ${F.teal} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:Q,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),(0,C.jsx)("input",{id:Q,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:Y,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),(0,C.jsx)("input",{id:Y,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),(0,C.jsxs)("section",{className:"space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,C.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[(0,C.jsx)("span",{children:"\u{1F4CA}"}),(0,C.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,C.jsx)("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.green} ${re.green} px-2 font-medium ${m.green} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,C.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:L})]})});Pr.displayName="IndexWorkerSettings";var Ae=require("@aiquants/fuzzy-search"),Mt=require("react");he();pe();Pe();var H=require("react/jsx-runtime"),ka=1e3,_r=(0,Mt.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,Mt.useId)(),u=(0,Mt.useId)(),d=(0,Mt.useId)(),c=(0,Mt.useId)(),f=(0,Mt.useId)(),p=(0,Mt.useId)(),l=[];return l.push((0,H.jsxs)("div",{className:`${a} ${F.purple} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),(0,H.jsx)("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push((0,H.jsxs)("div",{className:`${a} ${F.pink} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push((0,H.jsxs)("div",{className:`${a} ${F.violet} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,H.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,H.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:ka}}))}),n.noLimit]}),(0,H.jsx)("input",{id:c,type:"range",min:ka,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?ka:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push((0,H.jsxs)("div",{className:`${a} ${F.rose} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,H.jsx)("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),(0,H.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&(0,H.jsx)("p",{className:`${_} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.purple} ${re.purple} px-2 font-medium ${m.purple} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});_r.displayName="LevenshteinWorkerSettings";var Se=require("react/jsx-runtime"),Ll={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ar=(0,Ei.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:u})=>{let d=ne(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T}=vt();return(0,Se.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${F.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,Se.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,Se.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),(0,Se.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,Se.jsxs)("button",{type:"button",onClick:()=>t(E=>Nr(E.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),(0,Se.jsx)("div",{className:"mb-0 shrink-0",children:(0,Se.jsxs)("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:Ll,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T,children:[(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="basic"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="advanced"?`${we.orange} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),(0,Se.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Se.jsx)("div",{className:`${r==="basic"?"block":"hidden"}`,children:(0,Se.jsx)(lr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),(0,Se.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,Se.jsx)(sr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,Se.jsx)(Pr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,Se.jsx)(_r,{searchOptions:e,setSearchOptions:t})})]})]})});Ar.displayName="SearchOptionsPanel";var Or=require("react");jt();he();pe();Pe();var Li=require("react");pe();var $r=require("react/jsx-runtime"),D=(0,Li.memo)(({label:e,value:t,unit:n,color:a=s.fgMuted})=>(0,$r.jsxs)("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[(0,$r.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,$r.jsxs)("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));D.displayName="StatItem";var ki=require("react");jt();he();pe();Pe();var v=require("react/jsx-runtime"),en=(0,ki.memo)(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=He(),r=z=>se(i,z);if(!n)return(0,v.jsx)("section",{className:`rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,T=u.timestamp,E=c.fieldPerformance||{},L=c.performanceInsights||{},Q=c.recentHistory||[],Y=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},x=e==="index",P=e==="levenshtein",K=x?o.indexWorkerName:o.levenshteinWorkerName,S=Y,R=Y,ce=`flex flex-col gap-1 rounded-lg border ${k.surface} p-3 shadow-sm transition-colors`,j="text-xs font-semibold transition-colors",Ne=z=>{if(!z)return;let I=new Date(z);return Number.isNaN(I.getTime())?void 0:o.statsTimestamp(I)},de=[];if(de.push((0,v.jsxs)("div",{className:`${ce} ${F.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),(0,v.jsx)(D,{label:o.statTotalSearches,value:r(f),color:a}),(0,v.jsx)(D,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:o.statErrorCount,value:b,color:b>0?m.red:a}),Ne(T)&&(0,v.jsx)(D,{label:o.statUpdatedAt,value:Ne(T),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let z=Object.entries(h).sort(([,I],[,ee])=>(Number(ee)||0)-(Number(I)||0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${F.amber} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),(0,v.jsx)(D,{label:o.statTotalOperations,value:r(y),color:m.amber}),z.length>0&&(0,v.jsx)("div",{className:"mt-1 space-y-1",children:z.map(([I,ee])=>(0,v.jsx)(D,{label:I,value:r(Number(ee)),unit:o.timesUnit(r(Number(ee))),color:m.amber},I))})]},"operations"))}if(x&&(de.push((0,v.jsxs)("div",{className:`${ce} ${F.green} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),(0,v.jsx)(D,{label:o.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),(0,v.jsx)(D,{label:o.statDataSize,value:r(S.currentDataSize??0),unit:o.itemsUnit(r(S.currentDataSize??0)),color:m.green}),(0,v.jsx)(D,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.emerald} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),(0,v.jsx)(D,{label:o.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let z=Object.entries(S.indexMetadata).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.teal} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),z.map(([I,ee])=>{let fe;if(typeof ee=="number"){let Me=I.toLowerCase();Me.includes("time")&&!Me.includes("timestamp")?fe=`${ee.toFixed(2)}ms`:Me.includes("timestamp")||Me.includes("at")?fe=Ne(ee)??ee.toString():fe=r(ee)}else fe=String(ee);return(0,v.jsx)(D,{label:I,value:fe,color:m.teal},I)})]},"index-meta"))}if(P){if(de.push((0,v.jsxs)("div",{className:`${ce} ${F.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),(0,v.jsx)(D,{label:o.statTotalCalculations,value:r(R.totalCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statDistanceCalculations,value:r(R.totalDistanceCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statAverageDistance,value:typeof R.averageDistance=="number"?R.averageDistance.toFixed(2):"0.00",color:m.purple}),(0,v.jsx)(D,{label:o.statMinDistance,value:R.minDistance??o.notAvailable,color:m.purple}),(0,v.jsx)(D,{label:o.statMaxDistance,value:R.maxDistance??0,color:m.purple})]},"lev-basic")),de.push((0,v.jsxs)("div",{className:`${ce} ${F.fuchsia} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),(0,v.jsx)(D,{label:o.statPartialMatches,value:r(R.partialMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statPerfectMatches,value:r(R.perfectMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statEarlyTerminations,value:r(R.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),R.similarityThresholds&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.rose} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),(0,v.jsx)(D,{label:o.statAbove80,value:r(R.similarityThresholds.above80??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statAbove60,value:r(R.similarityThresholds.above60??0),color:m.lime}),(0,v.jsx)(D,{label:o.statAbove40,value:r(R.similarityThresholds.above40??0),color:m.orange}),(0,v.jsx)(D,{label:o.statBelow40,value:r(R.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),R.distanceDistribution){let z=Object.entries(R.distanceDistribution).sort(([,I],[,ee])=>Number(ee)-Number(I)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.indigo} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),z.map(([I,ee])=>(0,v.jsx)(D,{label:o.statDistance(I),value:r(Number(ee)),unit:o.timesUnit(r(Number(ee))),color:m.indigo},I))]},"lev-distance"))}if(R.queryLengthStats){let z=Object.entries(R.queryLengthStats).sort(([,I],[,ee])=>(ee.count??0)-(I.count??0)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.violet} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),z.map(([I,ee])=>{let fe=Number(ee.count??0),Me=Number(ee.averageScore??0);return(0,v.jsx)(D,{label:o.statQueryLength(I),value:o.statQueryLengthValue({count:fe,averagePercent:(Me*100).toFixed(1)}),color:m.violet},I)})]},"lev-query-length"))}}if(Object.keys(E).length>0){let z=Object.entries(E).sort(([,I],[,ee])=>(ee.averageScore??0)-(I.averageScore??0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${F.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),z.map(([I,ee])=>{let fe=ee;return(0,v.jsxs)("div",{className:`space-y-1 rounded ${re.purple} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:I}),(0,v.jsx)(D,{label:o.statAverageScore,value:`${((fe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),(0,v.jsx)(D,{label:o.statMatchCount,value:r(fe.matchCount??0),unit:o.itemsUnit(r(fe.matchCount??0)),color:m.purple}),(0,v.jsx)(D,{label:o.statBestWorstScore,value:`${((fe.bestScore??0)*100).toFixed(1)}% / ${((fe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},I)})]},"field-performance"))}if(L.bestPerformingField||L.totalHistoryEntries||L.similarityDistribution){let z=(L.recentAverageResultCount??0).toFixed(1);de.push((0,v.jsxs)("div",{className:`${ce} ${F.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),L.bestPerformingField&&(0,v.jsx)(D,{label:o.statBestField,value:L.bestPerformingField,color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageTime,value:(L.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageResults,value:z,unit:o.itemsUnit(z),color:m.blue}),(0,v.jsx)(D,{label:o.statThroughput,value:(L.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),(0,v.jsx)(D,{label:o.statCommonQueryLength,value:r(L.mostCommonQueryLength??0),unit:o.charactersUnit(r(L.mostCommonQueryLength??0)),color:m.blue}),(0,v.jsx)(D,{label:o.statHistoryEntries,value:r(L.totalHistoryEntries??0),color:m.blue}),L.similarityDistribution&&(0,v.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,v.jsx)(D,{label:o.statHighSimilarity,value:r(L.similarityDistribution.highSimilarity??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statMediumSimilarity,value:r(L.similarityDistribution.mediumSimilarity??0),color:m.lime}),(0,v.jsx)(D,{label:o.statLowSimilarity,value:r(L.similarityDistribution.lowSimilarity??0),color:m.orange}),(0,v.jsx)(D,{label:o.statVeryLowSimilarity,value:r(L.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return Q.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.sky} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),Q.slice(-3).reverse().map((z,I)=>(0,v.jsxs)("div",{className:`rounded ${re.sky} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-medium ${m.sky} transition-colors`,children:z.operationType}),(0,v.jsx)("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:z.processingTime.toFixed(2),resultCount:z.resultCount??0})}),Ne(z.timestamp)&&(0,v.jsx)("div",{className:`${_} ${m.sky} transition-colors`,children:Ne(z.timestamp)})]},`${z.operationType}-${z.timestamp??I}`))]},"recent-history")),(0,v.jsxs)("section",{className:"space-y-2",children:[(0,v.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[(0,v.jsx)("span",{children:t}),(0,v.jsx)("span",{className:"tracking-wide",children:K})]}),(0,v.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:de})]})});en.displayName="WorkerStatsSection";var ue=require("react/jsx-runtime"),kl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Dr=(0,Or.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=He(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:T,onPointerUp:E,onPointerLeave:L,onPointerCancel:Q,onClickCapture:Y}=vt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,x=y?`cursor-not-allowed ${k.muted} ${s.fgMuted}`:`${we.blue} ${s.onPrimary} ${Gt.blue}`,P=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,K=(0,Or.useCallback)(()=>{o().catch(()=>{})},[o]);return(0,ue.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${F.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,ue.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,ue.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),(0,ue.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ue.jsx)("button",{type:"button",onClick:K,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${x}`,title:h,children:P}),(0,ue.jsxs)("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),(0,ue.jsx)("div",{className:"mb-0 shrink-0",children:(0,ue.jsxs)("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:kl,onPointerDown:b,onPointerMove:T,onPointerUp:E,onPointerLeave:L,onPointerCancel:Q,onClickCapture:Y,children:[(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="overview"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),(0,ue.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ue.jsxs)("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[(0,ue.jsx)(D,{label:f.statTotalSearches,value:se(c,e.totalSearches)}),(0,ue.jsx)(D,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ue.jsx)(D,{label:f.statDataCount,value:se(c,e.itemCount)}),(0,ue.jsx)(D,{label:p?f.statResultCount:f.statDisplayedCount,value:se(c,l)})]}),(0,ue.jsx)("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),(0,ue.jsx)("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),(0,ue.jsxs)("div",{className:"hidden",children:[(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Dr.displayName="StatisticsPanel";var V=require("react/jsx-runtime"),wl=/[\u200B\uFEFF]/g,wa=typeof window<"u",Oi=wa&&typeof document<"u",Wr=(e,t=[],n=!1)=>{let a=(0,G.useRef)(e);a.current=e,(0,G.useEffect)(()=>{if(!(!wa||n&&!Oi))return a.current()},[n,...t])},wi=(e,t,n)=>{let[a,i]=(0,G.useState)(()=>{let o=Ri(r=>r.getItem(e));return o&&t.includes(o)?o:n});return Wr(()=>{Ri(o=>{o.setItem(e,a)})},[e,a]),[a,i]},Ri=e=>{if(!wa)return null;try{return e(window.sessionStorage)}catch{return null}},Pi=(e,t)=>{let[n,a]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Rl="contact-map.settings-tab",Pl="contact-map.statistics-tab",_l=["basic","advanced","index","levenshtein"],Al=["overview","index","levenshtein"],_i=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],$l={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ra=({streamState:e,...t}={})=>e===void 0?(0,V.jsx)(Ol,{...t}):(0,V.jsx)(Di,{...t,streamState:e}),Ol=e=>{let{context:t}=In();return(0,V.jsx)(Di,{...e,streamState:t})},Dl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},Di=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=$e(e,"workerUrls"),o=mt(),{locale:r,labels:u}=He(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=(0,Fr.useNavigation)(),[g]=(0,Fr.useSearchParams)(),b=(0,G.useRef)(null),[T,E]=(0,G.useState)(!0),[L,Q]=(0,G.useState)(o.openEmailsWithGmail??!1),{indexWorker:Y,levenshteinWorker:y}=Yt(o.workerUrls,i,Dl),[h,x]=(0,G.useState)(()=>Nr({indexWorker:Y,levenshteinWorker:y})),[P,K]=(0,G.useState)(g.get("q")||""),S=Pi(P,h.debounceMs??Hr.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,G.useEffect)(()=>{let J=g.get("q")||"";K(oe=>oe!==J?J:oe)},[g]),(0,G.useEffect)(()=>{if(typeof window>"u")return;let J=new URL(window.location.href);(J.searchParams.get("q")||"")!==S&&(S?J.searchParams.set("q",S):J.searchParams.delete("q"),window.history.replaceState(window.history.state,"",J.toString()))},[S]);let[R,ce]=(0,G.useTransition)(),[j,Ne]=(0,G.useState)("search"),[de,z]=wi(Rl,_l,"basic"),[I,ee]=wi(Pl,Al,"overview"),{setScrollableRef:fe,onPointerDown:Me,onPointerMove:Ie,onPointerUp:Ft,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn}=vt(),Ee=(0,G.useCallback)(()=>{if(!Oi||ma(window))return;let J=b.current;!J||document.activeElement===J||window.requestAnimationFrame(()=>{try{J.focus({preventScroll:!0})}catch{}})},[]),rn=(0,G.useCallback)(J=>{let oe=J;Ne(oe),oe==="search"&&Ee()},[Ee]),Qe=(0,G.useMemo)(()=>({...h,debounceMs:0}),[h]),[ft,Je]=(0,G.useState)("union"),qe=ft==="intersection",an=qe?u.operatorAndTitle:u.operatorOrTitle,Lt=(0,G.useCallback)(J=>(0,Hr.parseQuerySets)(J,ft),[ft]),te=(0,G.useMemo)(()=>({querySetsOf:Lt}),[Lt]),ye=Pi(d,f?0:800),{searchTerm:ae,setSearchTerm:gt,filteredItems:It,resultTerm:Mn,isSearching:kt,isIndexBuilding:Be,clearSearch:En,resetStats:Ln,performanceMetrics:at,rebuildIndex:wt,error:ot}=(0,Ai.useFuzzySearch)(ye,_i,Qe,te),Bt=ae.trim().length>0,[Rt,zt]=(0,G.useState)(""),[on,Ur]=(0,G.useState)(()=>ae),Pt=(0,G.useMemo)(()=>fr(P),[P]),Ze=(0,G.useMemo)(()=>fr(S),[S]);(0,G.useEffect)(()=>{S===Rt&&Ze===ae||ce(()=>{zt(S),gt(Ze)})},[S,Rt,Ze,ae,gt]);let kn=(0,G.useCallback)(J=>{let ke=J.target.value.replace(wl,"");K(ke)},[]),Vr=(0,G.useCallback)(()=>{K(""),zt(""),En(),Ee()},[En,Ee]),Xn=(0,G.useCallback)(()=>{Je(J=>J==="intersection"?"union":"intersection"),Ee()},[Ee]);Wr(()=>{if(!(j==="search"&&l.state==="idle"&&!R))return;let oe=document.activeElement;if(!!!(oe?.matches('[role="tab"]')||oe?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&oe&&oe!==document.body&&oe!==b.current)return;let it=window.requestAnimationFrame(()=>{Ee()});return()=>{window.cancelAnimationFrame(it)}},[j,l.state,R,Ee],!0),Wr(()=>{if(j!=="search")return;let J=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ee()}],[window,"pageshow",()=>{Ee()}]];for(let[oe,ke,it]of J)oe.addEventListener(ke,it);return()=>{for(let[oe,ke,it]of J)oe.removeEventListener(ke,it)}},[j,Ee],!0),(0,G.useEffect)(()=>(n&&n(j==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[j,n]),Wr(()=>{let J=document.body,oe=J.style.overflow;return j==="search"&&(J.style.overflow="hidden"),()=>{J.style.overflow=oe}},[j],!0),(0,G.useEffect)(()=>{at&&ut.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:at.totalSearches,averageSearchTime:at.averageSearchTime,itemCount:at.itemCount,resultsCount:at.resultsCount,workersAvailable:!!at.workerStats})},[at]);let{isAwaitingDebounce:Yn,isAwaitingSearchTermSync:Qn,isSearchInProgress:ht}=(0,G.useMemo)(()=>{let J=Pt!==Ze,oe=Ze!==ae,ke=ae.trim().length>0||Pt.trim().length>0;return{isAwaitingDebounce:J,isAwaitingSearchTermSync:oe,isSearchInProgress:R||kt||Mn!==ae&&ot===null||ke&&Be||J||oe||on!==ae}},[Pt,Ze,ae,Mn,ot,R,kt,Be,on]),[sn,Jn]=(0,G.useState)(ae);(0,G.useEffect)(()=>{sn!==ae&&Jn(ae)},[ae,sn]),(0,G.useEffect)(()=>{Yn||Qn||R||kt||Be||sn===ae&&on!==ae&&Ur(ae)},[ae,on,Yn,Qn,R,kt,Be,sn]);let wn=(0,G.useMemo)(()=>lo(Rt,_i),[Rt]),Zn=(0,G.useMemo)(()=>wn(It),[wn,It]),er=(0,G.useMemo)(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Zn,searchQuery:Rt,searchTerm:ae,isSearching:kt,isIndexBuilding:Be,isPending:R,hasSearchTerm:Bt,enableHighlighting:T,openEmailsWithGmail:L,isSearchInProgress:ht,isSearchTabActive:j==="search",errorMessage:ot??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Zn,Rt,ae,kt,Be,R,Bt,T,L,ht,j,ot,f,p]),Kr=Bt?It.length:d.length,Rn=se(r,d.length),B=se(r,It.length),ge=`${`scrollbar-hidden ${k.subtle} ${s.fg}`}${j==="search"?" h-full min-h-0":""}`;return(0,V.jsx)("div",{"data-contact-map-search-page":"",className:ge,children:(0,V.jsxs)(Wn,{value:j,onValueChange:rn,className:`flex flex-col${j==="search"?" h-full min-h-0":""}`,children:[(0,V.jsxs)(bn,{ref:fe,"data-contact-map-page-tabs":"",style:$l,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 ${k.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Me,onPointerMove:Ie,onPointerUp:Ft,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn,children:[(0,V.jsxs)(Wt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),(0,V.jsxs)(Wt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),(0,V.jsxs)(Wt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),(0,V.jsx)(Ht,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)("div",{className:`rounded-md border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,V.jsxs)("div",{className:"flex flex-col",children:[(0,V.jsx)("div",{className:"relative",children:(0,V.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,V.jsxs)("button",{type:"button",onClick:Xn,"aria-pressed":qe,title:an,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${N} transition-colors sm:min-w-12 sm:px-2 ${qe?`border-transparent ${we.blue} ${s.onPrimary} ${Gt.blue}`:`${Va.amber} ${re.amber} ${m.amber} ${w.hoverSurface}`}`,children:[(0,V.jsx)("span",{children:qe?u.operatorAnd:u.operatorOr}),(0,V.jsx)("span",{className:`hidden ${_} sm:inline`,children:qe?u.operatorAndHint:u.operatorOrHint})]}),(0,V.jsx)("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:P,onChange:kn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${q.borderControl} border-solid px-2 pointer-coarse:text-base ${N} shadow-sm transition-colors ${w.focusBorder} focus:ring-1 ${w.focusRing} ${k.surface} ${s.fg}`}),P&&(0,V.jsx)("button",{type:"button",onClick:Vr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${q.borderControl} px-1.5 ${N} transition-colors ${w.hoverFg} sm:px-2 ${s.fgMuted}`,title:ht?u.searchBusyTitle:u.clearSearch,"aria-label":ht?void 0:u.clearSearch,disabled:ht,children:ht?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)($i.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,V.jsx)("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),(0,V.jsxs)("p",{className:`px-1.5 py-0.5 ${_} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",(0,V.jsx)("span",{className:`font-semibold ${N} ${s.fg}`,children:Rn})," ",u.recordUnit(Rn),Be?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,ot?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,(0,V.jsx)("span",{className:"ml-1 break-all font-semibold",children:ot})]}):null,Bt&&(0,V.jsxs)("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,ht?(0,V.jsx)("span",{className:"ml-1 font-semibold",children:u.searching}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:`ml-1 font-semibold ${N} ${s.fg}`,children:B}),(0,V.jsx)("span",{className:"ml-0.5",children:u.resultUnit(B)})]})]})]}),(0,V.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Be?(0,V.jsx)(fa,{className:`h-1 ${At.progressTrack}`,indicatorClassName:tt.blue}):null})]})}),a?a(er):(0,V.jsx)(Ea,{context:er})]})}),(0,V.jsx)(Ht,{value:"settings",className:"mt-0",children:(0,V.jsx)(Ar,{searchOptions:h,setSearchOptions:x,enableHighlighting:T,setEnableHighlighting:E,openEmailsWithGmail:L,setOpenEmailsWithGmail:Q,activeTab:de,onTabChange:z})}),(0,V.jsx)(Ht,{value:"statistics",className:"mt-0",children:(0,V.jsx)(Dr,{performanceMetrics:at,searchTerm:ae,totalDataCount:d.length,resultsCount:Kr,resetStats:Ln,rebuildIndex:wt,isIndexBuilding:Be,activeTab:I,onTabChange:ee})})]})})};var Ir=require("react");he();var qn=require("react/jsx-runtime"),Wl=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Br=(0,Ir.memo)(({phase:e,loadedCount:t})=>{let n=ne(),[a,i]=(0,Ir.useState)(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:Wl(e,t,n);return o!==a&&i(o),(0,qn.jsxs)("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[(0,qn.jsx)("span",{role:"status",children:o.status}),(0,qn.jsx)("span",{role:"alert",children:o.alert})]})});Br.displayName="ContactMapStreamAnnouncer";var We=require("react");he();pe();fn();Pe();var pt=require("react/jsx-runtime"),Wi="shrink-0 pb-2",Hl=`flex items-center gap-2 rounded-md border ${F.rose} ${re.rose} px-[11px] py-[3px] ${m.rose} ${N}`,Fl=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${q.borderControl} ${k.surface} px-[11px] font-semibold ${m.rose} ${N} transition-colors ${w.hoverRoseTint} ${dt}`,Il=e=>e==="failed"||vr(e),Hi=(e,t)=>{(0,We.useLayoutEffect)(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=zo(n))}},[e,t])},Bl=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=ne(),o=(0,We.useId)(),r=(0,We.useRef)(null);return Hi(r,a),(0,pt.jsx)("div",{className:Wi,children:(0,pt.jsxs)("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:Hl,children:[(0,pt.jsx)("span",{"aria-hidden":"true",children:"\u26D4"}),(0,pt.jsx)("span",{id:o,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:i.streamLoadFailed(e)}),(0,pt.jsx)("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":o,onClick:n,className:Fl,children:i.streamRetry})]})})},zl=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),Ul=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=(0,We.useRef)(null),o=(0,We.useRef)(t);(0,We.useLayoutEffect)(()=>{o.current=t});let[r]=(0,We.useState)(()=>zl(e,()=>o.current()));return Hi(i,a),(0,pt.jsx)("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:Wi,children:n(r)})},zr=(0,We.memo)(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{xr(o,"ContactMapStreamFailureNotice accessFailure"),Lo(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=(0,We.useRef)(null);return(0,We.useLayoutEffect)(()=>{let u=r.current;u!==null&&(r.current=null,Uo(u))}),Il(e)?e==="failed"?(0,pt.jsx)(Bl,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):(0,pt.jsx)(Ul,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});zr.displayName="ContactMapStreamFailureNotice";var Ye=require("react/jsx-runtime"),Vl=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=ne(),o=n===void 0?i.appTitle:n,{context:r,retryNow:u}=In(),d=(0,Ye.jsx)(Cr,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return(0,Ye.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[(0,Ye.jsx)(Br,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:d}):(0,Ye.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,Ye.jsx)("h1",{className:"font-bold text-xl",children:o}),d]}),(0,Ye.jsx)(zr,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),(0,Ye.jsx)("div",{className:"min-h-0 flex-1",children:(0,Ye.jsx)(Ra,{streamState:r,onFooterVisibilityChange:a})})]})},Kl=e=>{let t=$e(e,"accessFailure");xr(t,"ContactMapAppView accessFailure");let n=mt(),a=$e(e,"streamEndpoint"),i=$e(e,"workerUrls"),o=$e(e,"locale"),r=$e(e,"labels"),u=(0,Pa.useMemo)(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:Yt(n.workerUrls,i,{setting:"ContactMapAppView workerUrls"}),locale:o===void 0?n.locale:o,labels:r===void 0?n.labels:r}),[n,a,i,o,r]),d=o!==void 0,c=r!==void 0,f=(0,Pa.useMemo)(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return(0,Ye.jsx)(ua,{config:u,chromeSurface:f,children:(0,Ye.jsx)(Vl,{...e,accessFailure:t})})};jt();he();var Fi=require("@aiquants/route-revalidation");var jl=(0,Fi.createShouldRevalidate)({submissions:"url",query:{ignore:[Cn,"q"]}});0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamAnnouncer,ContactMapStreamClient,ContactMapStreamFailureNotice,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,assertContactMapStreamEndpoint,assertContactMapTreeWorkerUrl,assertContactMapWorkerUrls,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,countContactMapCompanies,deserializeStreamRecord,getContactMapStreamClient,getTreeWorkerSession,layerContactMapWorkerUrls,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useStreamedContactMapContext,useTreeWorker});