-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautocomplete.drawio
More file actions
170 lines (170 loc) · 63.1 KB
/
Copy pathautocomplete.drawio
File metadata and controls
170 lines (170 loc) · 63.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36" version="27.0.5">
<diagram name="Page-1" id="dgKfHVLs2dfAS0LjMVGZ">
<mxGraphModel dx="2055" dy="784" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="UEqxe5ACNQiHhb535YgH-1" value="<h1>Autocomplete</h1>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="360" y="10" width="180" height="70" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-2" value="<h2>Functional Requirements</h2><div><ol><li style="text-align: left;">Display search results for custom query</li><li style="text-align: left;">Allow action on selected item</li><li style="text-align: left;">Support custom styling</li></ol></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="40" y="58" width="270" height="120" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-3" value="<h2>Non-Functional Requirements</h2><div><ul><li style="text-align: left;">generic component that can be used by other websites</li><li style="text-align: left;">debounce query</li><li style="text-align: left;">cache locally</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="490" y="58" width="350" height="120" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-4" value="<h2>Out of Scope</h2><div><ul><li style="text-align: left;">media/images in results</li><li style="text-align: left;">fuzzy search (can be done on backend)</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="300" y="100" width="270" height="110" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-5" value="<h2>High Level Design/Architecture</h2><div><br></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="300" y="200" width="290" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-6" value="Autocomplete Component" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="80" y="270" width="330" height="210" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-11" value="View<div><br></div><div><br></div><div><br></div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="20" y="40" width="290" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-7" value="Results UI" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="30" y="70" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-14" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="UEqxe5ACNQiHhb535YgH-6" source="UEqxe5ACNQiHhb535YgH-10" target="UEqxe5ACNQiHhb535YgH-12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-10" value="Input UI" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="180" y="70" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="UEqxe5ACNQiHhb535YgH-6" source="UEqxe5ACNQiHhb535YgH-12" target="UEqxe5ACNQiHhb535YgH-7">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="210" y="140" />
<mxPoint x="90" y="140" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-17" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="UEqxe5ACNQiHhb535YgH-6" source="UEqxe5ACNQiHhb535YgH-12" target="UEqxe5ACNQiHhb535YgH-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-12" value="Controller" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="190" y="150" width="110" height="40" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="UEqxe5ACNQiHhb535YgH-6" source="UEqxe5ACNQiHhb535YgH-13">
<mxGeometry relative="1" as="geometry">
<mxPoint x="190" y="180" as="targetPoint" />
<Array as="points">
<mxPoint x="190" y="180" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-13" value="Cache" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="30" y="150" width="110" height="40" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-15" value="query" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="250" y="118" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-18" value="query" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="140" y="140" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-20" value="results" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="UEqxe5ACNQiHhb535YgH-6">
<mxGeometry x="135" y="180" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0;entryDx=10;entryDy=70;entryPerimeter=0;" edge="1" parent="1" source="UEqxe5ACNQiHhb535YgH-12" target="UEqxe5ACNQiHhb535YgH-27">
<mxGeometry relative="1" as="geometry">
<mxPoint x="547" y="365.5500000000002" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-23" value="query" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="495" y="440" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-24" value="results" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="180" y="388" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-26" value="results" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="450" y="270" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-27" value="Server" style="shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;" vertex="1" parent="1">
<mxGeometry x="520" y="270" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0;exitDx=0;exitDy=30;exitPerimeter=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="UEqxe5ACNQiHhb535YgH-27" target="UEqxe5ACNQiHhb535YgH-12">
<mxGeometry relative="1" as="geometry">
<mxPoint x="390" y="440" as="targetPoint" />
<mxPoint x="576.04" y="390.48" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-28" value="<h2>Data Model</h2><h3 style="text-align: left;">Controller:</h3><div style=""><ul><li style="text-align: left;">initial props</li><li style="text-align: left;">search string</li></ul><h3 style="text-align: left;">Cache:</h3><div><ul><li style="text-align: left;">initial results (optional)</li><li style="text-align: left;">cached results</li></ul></div></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="630" y="310" width="180" height="210" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-29" value="<h2>API</h2>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="420" y="480" width="50" height="60" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-30" value="<h3>Autocomplete&nbsp;</h3><div><ul><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">number of results</span></li><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">callback to fetch suggestions</span></li><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">hooks for event listeners (select, focus...)</span></li><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">min query length (default 3)</span></li><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">...</span></li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="50" y="530" width="280" height="140" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-36" value="<pre><font style="font-size: 13px;"><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> &lt;</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0); font-weight: 700;">Autocomplete</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><br></span></font><pre><font style="font-size: 13px;"><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> onChange={</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">(<span style="box-sizing: border-box;">query</span>)=&gt;</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);">api.</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0); font-weight: 700;">fetchItems</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);">(query)}<br></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> renderItem={</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">(<span style="box-sizing: border-box;">item</span>)=&gt;</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;"><span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667);">&lt;<span style="box-sizing: border-box; font-weight: 700;">div</span>&gt;</span>{item.label}<span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667);">&lt;/<span style="box-sizing: border-box; font-weight: 700;">div</span>&gt;</span></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);">}<br></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> wrapperClassName=</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0);">"..."<br></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> ...<br></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"> /&gt; </span></font></pre></pre>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=#666666;fillColor=#f5f5f5;fontColor=#333333;rounded=1;glass=0;shadow=1;" vertex="1" parent="1">
<mxGeometry x="360" y="560" width="380" height="140" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-38" value="<h2>Deep Dive</h2>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="385" y="780" width="110" height="60" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-39" value="<h3>Network Race conditions:</h3><div><ul><li style="text-align: left;">maintain hashmap (key=query, value=result)</li></ul><div style=""><br></div></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="30" y="820" width="300" height="100" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-40" value="<h3>Failed Requests:</h3><div><ul><li style="text-align: left;">retry w/exp backoff</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="360" y="820" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-41" value="<h3>Offline Mode:</h3><div><ul><li style="text-align: left;">display UI indicator (register for offline event)</li><li style="text-align: left;">use cache if available</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="520" y="820" width="300" height="100" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-42" value="<h3>Cache:</h3><div><div style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"><b>A. Maintain a hashmap:</b></span></div><ul><li><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255)); text-align: left;">good for short lived (lots of dups )</span></li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="70" y="920" width="240" height="110" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-43" value="<pre><pre><br></pre><pre><font style="font-size: 11px;"><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">$hashmap = { // <b>A</b> <br></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);"> </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'g'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);"> =&gt; [{name=</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'Giant'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">, desc=</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'...'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">}, <br> {name=</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'Google'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">,...}...],<br> </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'goo'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);"> =&gt; [{name=</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'Google'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">, ...},<br> ...<br>} </span></font></pre></pre>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=#666666;fillColor=#f5f5f5;rounded=1;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="330" y="925" width="270" height="150" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-44" value="<pre><div style="text-align: left;"><br></div><div style="text-align: left;"><span style="background-color: rgb(243, 243, 243); color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace;"><font>$list = [ </font></span><span style="background-color: rgb(243, 243, 243); color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: collapse;">// <b>B</b></span></div><font style=""><font style=""><div style="text-align: left;"><font><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);"> { </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace;">id</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">: </span><span style="background-color: transparent; box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">1</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">, </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace;">text</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);">: </span><span style="background-color: transparent; box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; color: rgb(136, 0, 0);">'g'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; background-color: rgb(243, 243, 243);"> }, </span></font></div><font style=""><font><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"> { </div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"> { <span style="background-color: transparent; box-sizing: border-box;">id</span>: <span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">2</span>, <span style="background-color: transparent; box-sizing: border-box;">text</span>: <span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">'goo'</span>},</div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"> ...</div><div style="text-align: left;">]</div><div style="text-align: left;">$cache = {</div><div style="text-align: left;"> </div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"> ...</div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;">]</div></span></font><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><font>$cache = {</font></div></span></font><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><font><font style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255)); font-family: Helvetica; white-space-collapse: collapse;"><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;"> </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0);">'g'</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">: [</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0);">1</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">,</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0);">2</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">,</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; color: rgb(136, 0, 0);">3</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve;">,</span></font><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">4</span><span style="">],</span></font></div></span></font><font><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><span style="background-color: light-dark(rgb(243, 243, 243), rgb(28, 28, 28)); color: light-dark(rgb(68, 68, 68), rgb(179, 179, 179));"> </span></div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><span style="color: rgb(68, 68, 68); background-color: rgb(243, 243, 243);"> </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">'goo'</span><span style="color: rgb(68, 68, 68); background-color: rgb(243, 243, 243);">: [</span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">2</span><span style="color: rgb(68, 68, 68); background-color: rgb(243, 243, 243);">,</span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">3</span><span style="color: rgb(68, 68, 68); background-color: rgb(243, 243, 243);">],</span></div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><span style="background-color: light-dark(rgb(243, 243, 243), rgb(28, 28, 28)); color: light-dark(rgb(68, 68, 68), rgb(179, 179, 179));"> ...</span></div><div style="text-align: left;"><span style="background-color: light-dark(rgb(243, 243, 243), rgb(28, 28, 28)); color: light-dark(rgb(68, 68, 68), rgb(179, 179, 179));">}</span></div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><span style="background-color: light-dark(rgb(243, 243, 243), rgb(28, 28, 28)); color: light-dark(rgb(68, 68, 68), rgb(179, 179, 179));"> ...</span></div></span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space-collapse: preserve; background-color: rgb(243, 243, 243);"><div style="text-align: left;"><span style="background-color: light-dark(rgb(243, 243, 243), rgb(28, 28, 28)); color: light-dark(rgb(68, 68, 68), rgb(179, 179, 179));">}</span></div></span></font></font></pre>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=#666666;fillColor=#f5f5f5;fontColor=#333333;rounded=1;" vertex="1" parent="1">
<mxGeometry x="610" y="920" width="200" height="310" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-45" value="<b><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">B. Normalized list:</span><br></b><ul><li><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">good for long lived</span></li></ul>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="80" y="1070" width="160" height="70" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-46" value="<h3>Styling</h3><div><ul><li style="text-align: left;">theming object</li><li style="text-align: left;">exposed classnames</li><li style="text-align: left;">render callback (flexible but HIGH effort)</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="50" y="658" width="280" height="110" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-47" value="<h3>Server API</h3><div><ul><li style="text-align: left;">query | limit | page number</li></ul></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="530" y="710" width="210" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-48" value="<b>Caching Strategy:</b><div><ul><li>TTL (needs timestamps)</li><li>periodically evict</li></ul></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="80" y="1160" width="190" height="80" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-50" value="<h3>Performance:</h3><h3><span style="text-align: left; background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255)); font-size: 12px; font-weight: normal;">debounce | TTL + cache eviction | virtualized lists</span></h3>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="40" y="1260" width="280" height="90" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-52" value="<div><ol><li><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255)); text-align: left; font-size: 12px;"><b>NPM package</b></span><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255)); text-align: left; font-size: 12px; font-weight: normal;"> (rollup/vite,..) &amp; publish to NPM:</span></li><ul><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">full React integration</span></li><li style="text-align: left;"><span style="background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));">requires React/</span>specific version</li></ul><li style="text-align: left;"><b>Export as</b> <b>Web component</b>:</li><ul><li style="text-align: left;">framework agnostic</li><li style="text-align: left;">use Lit, Stencil.js or react-to-webcomponent</li></ul><li style="text-align: left;"><b>Embed via script</b>:</li><ul><li style="text-align: left;">low integration effort for 3rd parties</li><li style="text-align: left;">good for legacy CMS</li></ul><li style="text-align: left;"><b>Iframe</b>:</li><ul><li style="text-align: left;">fully isolated and secure</li><li style="text-align: left;">can't fully style or control DOM</li><li style="text-align: left;">higher latency</li></ul></ol><br></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="-15" y="1450" width="340" height="240" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-51" value="<h3>A18N:</h3><div><ul><li style="text-align: left;">aria roles:</li><ul><li style="text-align: left;">aria-autocomplete</li><li style="text-align: left;">combobox for input</li><li style="text-align: left;">aria-expanded</li><li style="text-align: left;">aria-live</li></ul><li style="text-align: left;">keyboard:</li><ul><li style="text-align: left;">arrows</li><li style="text-align: left;">Enter</li><li style="text-align: left;">Escape</li></ul></ul></div><div><br></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="340" y="1110" width="210" height="210" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-53" value="<pre><font face="Courier New" style="font-size: 11px;"><b><font style=""><span style="box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);"> // 2. </span></font><font style="color: rgb(153, 153, 153);">Export as Web component (using Lit or Stencil.js)</font></b></font></pre><pre><font face="Courier New" style="font-size: 11px;"><b><span style="box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);"> &lt;<span style="box-sizing: border-box;">autocomplete</span> <span style="box-sizing: border-box;">api-url</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0);">"https://ac.com/suggest"</span> <span style="box-sizing: border-box;">theme</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0);">"dark"</span>&gt;</span><span style="box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);">&lt;/<span style="box-sizing: border-box;">autocomplete</span>&gt;</span></b></font></pre>" style="rounded=1;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="310" y="1490" width="520" height="48" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-54" value="<div><pre style="text-align: left;"><font style="font-size: 11px;"><span style="background-color: transparent; box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; white-space: pre; color: rgba(68, 68, 68, 0.667);"><b><br></b></span></font></pre><pre style="text-align: left;"><font face="Courier New" style="font-size: 11px;"><span style="background-color: transparent; box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);"><b>//3. Embed via script</b></span></font></pre><pre style="text-align: left;"><font face="Courier New" style="font-size: 11px;"><b><span style="background-color: transparent; box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);">&lt;<span style="box-sizing: border-box;">script</span> <span style="box-sizing: border-box;">src</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0);">"https://cdn.example.com/autocomplete-widget.js"</span>&gt;</span><span style="background-color: transparent; box-sizing: border-box; white-space: pre; color: rgba(68, 68, 68, 0.667);">&lt;/<span style="box-sizing: border-box;">script</span>&gt;<br></span><span style="background-color: transparent;">&lt;</span><span style="background-color: transparent; box-sizing: border-box;">script</span><span style="background-color: transparent;">&gt;<br></span><span style="background-color: transparent;"> </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">Autocomplete</span><span style="background-color: transparent;">.</span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">init</span><span style="background-color: transparent;">({<br></span><span style="background-color: transparent;"> </span><span style="background-color: transparent; box-sizing: border-box;">selector</span><span style="background-color: transparent;">: </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">'#search'</span><span style="background-color: transparent;">,<br></span><span style="background-color: transparent;"> </span><span style="background-color: transparent; box-sizing: border-box;">fetch</span><span style="background-color: transparent;">: </span><span style="background-color: transparent; box-sizing: border-box;">(<span style="box-sizing: border-box;">input</span>) =&gt;</span><span style="background-color: transparent;"> </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">fetch</span><span style="background-color: transparent;">(...),<br></span><span style="background-color: transparent;"> </span><span style="background-color: transparent; box-sizing: border-box;">theme</span><span style="background-color: transparent;">: </span><span style="background-color: transparent; box-sizing: border-box; color: rgb(136, 0, 0);">'dark'<br></span><span style="background-color: transparent;"> });<br></span><span style="background-color: transparent;">&lt;/</span><span style="background-color: transparent; box-sizing: border-box;">script</span><span style="background-color: transparent;">&gt;</span></b></font></pre></div><div style="text-align: left;"><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; white-space: pre; color: rgba(68, 68, 68, 0.667);"><b><br></b></span></div><div><br></div>" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="310" y="1550" width="520" height="163" as="geometry" />
</mxCell>
<mxCell id="UEqxe5ACNQiHhb535YgH-67" value="<h3>Options for Distributing:</h3><div><br></div><div><ol></ol></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="330" y="1360" width="190" height="80" as="geometry" />
</mxCell>
<UserObject label="<pre><div style="text-align: left;"><span style="color: light-dark(rgb(105, 112, 112), rgb(138, 144, 144)); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 11px; background-color: transparent;">// 1. NPM package: Autocomplete.tsx</span></div><div style="text-align: left;"><span style="color: light-dark(rgb(105, 112, 112), rgb(138, 144, 144)); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 11px; background-color: transparent;"><br></span></div><font style="font-size: 11px;"><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; font-weight: 700;">export</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;"> </span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; font-weight: 700;">const</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;"> </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(136, 0, 0); font-weight: 700;">Autocomplete</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;"> = (</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ fetch, cache, styles }</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;">) =&gt; { </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(105, 112, 112);">/* ... */</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;"> };</span></font></pre>" link="<meta charset="utf-8"><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(105, 112, 112);">// MyAutocomplete.tsx</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; font-weight: 700;">export</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"> </span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; font-weight: 700;">const</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"> </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(136, 0, 0); font-weight: 700;">MyAutocomplete</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"> = (</span><span style="box-sizing: border-box; color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ fetchSuggestions, cache, styles }</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">) =&gt; { </span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(105, 112, 112);">/* ... */</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"> };</span>" id="UEqxe5ACNQiHhb535YgH-68">
<mxCell style="rounded=1;whiteSpace=wrap;html=1;align=center;" vertex="1" parent="1">
<mxGeometry x="310" y="1422" width="520" height="58" as="geometry" />
</mxCell>
</UserObject>
<UserObject label="<pre><font style="font-size: 11px;"><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgba(68, 68, 68, 0.667);"><span style="white-space: pre;">	</span>// 4. Iframe</span></font></pre><pre><font style="font-size: 11px;"><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgba(68, 68, 68, 0.667);"><span style="white-space: pre;">	</span>&lt;<span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 700;">iframe</span> <span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 400;">src</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0); font-weight: 400;">"https://ac.com/suggestWidget?theme=dark"</span> <span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 400;">style</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0); font-weight: 400;">"width:100%"</span>&gt;</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgba(68, 68, 68, 0.667);">&lt;/<span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 700;">iframe</span>&gt;</span></font></pre>" link="<meta charset="utf-8"><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgba(68, 68, 68, 0.667);">&lt;<span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 700;">iframe</span> <span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 400;">src</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0); font-weight: 400;">"https://autocomplete.example.com/widget?theme=dark"</span> <span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 400;">style</span>=<span style="box-sizing: border-box; color: rgb(136, 0, 0); font-weight: 400;">"width:100%"</span>&gt;</span><span style="box-sizing: border-box; font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgba(68, 68, 68, 0.667);">&lt;/<span style="box-sizing: border-box; color: rgba(68, 68, 68, 0.667); font-weight: 700;">iframe</span>&gt;</span><span style="color: rgb(68, 68, 68); font-family: &quot;Lucida Console&quot;, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(243, 243, 243); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
</span><br class="Apple-interchange-newline">" id="UEqxe5ACNQiHhb535YgH-69">
<mxCell style="rounded=1;whiteSpace=wrap;html=1;align=left;" vertex="1" parent="1">
<mxGeometry x="90" y="1730" width="740" height="70" as="geometry" />
</mxCell>
</UserObject>
</root>
</mxGraphModel>
</diagram>
</mxfile>