@hiver/connector-agent 4.20.0-darktheme2-beta.2 → 4.20.0-darktheme2-beta.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/index.umd.js
CHANGED
|
@@ -3016,7 +3016,7 @@ Do you want to continue?`,Zw="Select an object to create",Jw="Select an object t
|
|
|
3016
3016
|
}
|
|
3017
3017
|
}
|
|
3018
3018
|
`};
|
|
3019
|
-
`,OT="data:image/svg+xml,%3csvg%20width='124'%20height='107'%20viewBox='0%200%20124%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28.6168%2054.7446C28.6931%2052.5589%2031.0146%2051.1102%2033.0842%2051.8174C35.9985%2052.8133%2040.0375%2053.9024%2044.0621%2054.043C48.0034%2054.1806%2051.968%2053.4097%2054.8762%2052.6339C57.0264%2052.0602%2059.2927%2053.6932%2059.215%2055.9172C59.1742%2057.0856%2058.4742%2058.1269%2057.3723%2058.5178C54.8051%2059.4284%2049.7633%2060.8927%2044.3075%2060.7022C38.7694%2060.5088%2033.1999%2058.6241%2030.4004%2057.5311C29.2637%2057.0873%2028.5742%2055.9641%2028.6168%2054.7446Z'%20fill='url(%23paint0_linear_8481_102191)'/%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='url(%23paint1_linear_8481_102191)'/%3e%3cmask%20id='mask0_8481_102191'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='46'%20y='14'%20width='60'%20height='79'%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_8481_102191)'%3e%3cellipse%20cx='63.7775'%20cy='46.8684'%20rx='1.48152'%20ry='1.39438'%20transform='rotate(-12%2063.7775%2046.8684)'%20fill='%23435C71'/%3e%3crect%20x='47.4368'%20y='59.3203'%20width='53.657'%20height='13.2235'%20transform='rotate(-12%2047.4368%2059.3203)'%20fill='url(%23paint2_linear_8481_102191)'/%3e%3crect%20x='51.1907'%20y='76.9824'%20width='53.657'%20height='10.4263'%20transform='rotate(-12%2051.1907%2076.9824)'%20fill='url(%23paint3_linear_8481_102191)'/%3e%3c/g%3e%3cpath%20opacity='0.883952'%20d='M113.939%2051.0679C114.775%2055%20112.265%2058.865%20108.333%2059.7008L107.842%2059.8052C103.639%2060.6986%2099.5073%2058.0155%2098.6139%2053.8123L97.205%2047.1837L105.307%2045.4616C109.239%2044.6259%20113.104%2047.1359%20113.939%2051.0679Z'%20fill='url(%23paint4_linear_8481_102191)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.7215%2066.4138C67.1801%2064.8725%2067.6745%2062.2062%2069.587%2061.1603C72.4457%2059.5969%2076.2861%2057.1773%2079.3785%2054.0849C82.4099%2051.0535%2084.752%2047.3461%2086.2775%2044.5465C87.3388%2042.5989%2090.0598%2042.0819%2091.6282%2043.6503C92.4782%2044.5003%2092.758%2045.7623%2092.2604%2046.8566C91.0829%2049.4466%2088.5191%2054.344%2084.4346%2058.4285C80.2853%2062.5778%2074.8639%2065.591%2072.0553%2066.9952C70.9363%2067.5548%2069.6062%2067.2985%2068.7215%2066.4138Z'%20fill='url(%23paint5_linear_8481_102191)'/%3e%3crect%20x='48.7264'%20y='33.7744'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2048.7264%2033.7744)'%20fill='url(%23paint6_linear_8481_102191)'/%3e%3crect%20x='50.0175'%20y='35.8193'%20width='4.0158'%20height='3.84848'%20rx='1.92424'%20transform='rotate(-12%2050.0175%2035.8193)'%20fill='%23435C71'/%3e%3crect%20x='59.2875'%20y='31.5723'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2059.2875%2031.5723)'%20fill='%23FFFEFE'/%3e%3cpath%20opacity='0.883952'%20d='M111.25%2038.5376C110.415%2034.6055%20106.55%2032.0955%20102.618%2032.9313L102.127%2033.0356C97.9234%2033.9291%2095.2403%2038.0607%2096.1337%2042.2639L97.5426%2048.8925L105.644%2047.1705C109.576%2046.3347%20112.086%2042.4696%20111.25%2038.5376Z'%20fill='url(%23paint7_linear_8481_102191)'/%3e%3crect%20x='60.0181'%20y='33.8037'%20width='3.84848'%20height='3.84848'%20rx='1.90724'%20transform='rotate(-12%2060.0181%2033.8037)'%20fill='%23435C71'/%3e%3cpath%20d='M36.9246%2059.1604C36.4487%2060.717%2034.7371%2061.6271%2033.1805%2061.1512C32.3613%2060.9007%2031.7241%2060.3475%2031.3259%2059.5987L25.2059%2046.7983C24.9784%2046.3703%2025.1286%2045.8788%2025.5566%2045.6513L28.338%2044.1724C28.7659%2043.9449%2029.2574%2044.0951%2029.4849%2044.5231L36.6496%2056.8367C37.0728%2057.5036%2037.15%2058.423%2036.9246%2059.1604Z'%20fill='%23FFDF9F'/%3e%3crect%20x='27.9973'%20y='44.333'%20width='2.39869'%20height='3.59807'%20transform='rotate(152%2027.9973%2044.333)'%20fill='%23FF9090'/%3e%3cpath%20d='M26.6628%2044.3769L26.9472%2044.9118L28.0169%2044.343L26.3106%2041.1338L24.171%2042.2714L25.0243%2043.876C25.6661%2043.5347%2026.3215%2043.7351%2026.6628%2044.3769Z'%20fill='%23FFB19F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.26386%2027.248C9.3428%2020.4481%2016.5101%2016.6372%2023.31%2018.7161C30.11%2020.7951%2033.9209%2027.9624%2031.8419%2034.7623C29.763%2041.5622%2022.5956%2045.3731%2015.7958%2043.2942C8.99587%2041.2152%205.18493%2034.0479%207.26386%2027.248ZM9.72157%2027.9983C8.06843%2033.4055%2011.1399%2039.1821%2016.5471%2040.8352C21.9543%2042.4884%2027.7309%2039.4168%2029.384%2034.0096C31.0372%2028.6024%2027.9657%2022.8258%2022.5585%2021.1727C17.1513%2019.5196%2011.3747%2022.5911%209.72157%2027.9983Z'%20fill='%23FFE69F'/%3e%3ccircle%20opacity='0.414016'%20cx='19.5529'%20cy='31.0039'%20r='10.2804'%20transform='rotate(17%2019.5529%2031.0039)'%20fill='%23BBDEFC'/%3e%3cpath%20d='M14.3685%2030.6746C15.7299%2027.6867%2018.9391%2025.9803%2022.1776%2026.5225L22.2595%2026.5475C23.7024%2026.8095%2024.3854%2024.8682%2023.1497%2024.2218C22.3806%2023.8074%2021.5613%2023.557%2020.717%2023.3884C17.3715%2022.9031%2014.0553%2024.6664%2012.6939%2027.6543C12.2796%2028.4235%2012.0859%2029.3497%2012.0244%2030.1372C11.8444%2031.6051%2013.8607%2032.0424%2014.4503%2030.6997C14.3434%2030.7566%2014.3685%2030.6746%2014.3685%2030.6746Z'%20fill='%23F6FBFF'/%3e%3cpath%20d='M10.2904%2029.0679C11.9436%2023.6607%2017.7202%2020.5893%2023.1274%2022.2424C25.6671%2023.0189%2027.5785%2024.6783%2028.9301%2026.704C27.7539%2024.1048%2025.508%2022.0744%2022.5586%2021.1727C17.1514%2019.5196%2011.3748%2022.591%209.72165%2027.9982C8.81993%2030.9476%209.32924%2033.97%2010.7444%2036.3735C9.82081%2034.1203%209.51395%2031.6077%2010.2904%2029.0679Z'%20fill='%23ADCBE7'/%3e%3cpath%20opacity='0.406087'%20d='M36.4864%2056.8021L36.1373%2056.2691C36.3845%2056.8563%2036.428%2057.5516%2036.2372%2058.1754C35.9273%2059.189%2034.5593%2059.1971%2034.0713%2058.2806L28.3787%2047.5877C28.0534%2046.9767%2027.3508%2046.7619%2026.7395%2047.0866L25.7206%2047.6277L31.4395%2059.3516C31.7648%2059.9627%2032.27%2060.5434%2032.8706%2060.8123C33.7054%2061.1528%2034.6593%2061.1034%2035.3726%2060.7247C36.0858%2060.3459%2036.6602%2059.5837%2036.8444%2058.7021C37.0351%2058.0783%2036.8117%2057.4132%2036.4864%2056.8021Z'%20fill='white'/%3e%3cpath%20d='M29.8826%2048.4977C29.8006%2048.4726%2029.6368%2048.4225%2029.5799%2048.3155L28.1579%2045.6411C28.0442%2045.4272%2028.1193%2045.1814%2028.3332%2045.0677C28.5472%2044.9539%2028.7929%2045.0291%2028.9067%2045.243L30.3287%2047.9174C30.4424%2048.1313%2030.3673%2048.3771%2030.1534%2048.4908C30.1284%2048.5728%2029.9645%2048.5227%2029.8826%2048.4977Z'%20fill='%23FFF5EB'/%3e%3cellipse%20cx='29.2637'%20cy='54.631'%20rx='1.50593'%20ry='3.17918'%20transform='rotate(-23%2029.2637%2054.631)'%20fill='%23FFC478'/%3e%3cellipse%20cx='34.0592'%20cy='52.4078'%20rx='0.920288'%20ry='1.67325'%20transform='rotate(106%2034.0592%2052.4078)'%20fill='%23FFC478'/%3e%3cpath%20d='M89.1282%2019.2055L68.2257%2026.8725L45.9197%2028.3898L44.4929%2016.4082C44.3371%2013.798%2047.5283%2011.4502%2050.9859%2011.6309L65.1429%2012.369L67.3969%2012.4869C68.5309%2012.5463%2069.7066%2012.3289%2070.7522%2011.8627L78.6899%208.34726C81.725%206.99992%2085.3012%207.87475%2086.2125%2010.1876L89.1282%2019.2055Z'%20fill='url(%23paint8_linear_8481_102191)'/%3e%3cpath%20opacity='0.479771'%20d='M88.6262%2019.0953L68.3101%2026.5288L65.3314%2012.5149L67.5211%2012.6263C68.6228%2012.6824%2069.7652%2012.471%2070.7816%2012.0192L78.4972%208.61266C81.4474%207.30707%2084.9208%208.14856%2085.8036%2010.3829L88.6262%2019.0953Z'%20fill='%23ADCBE7'/%3e%3cpath%20d='M91.6332%2026.6212L46.9517%2036.1186L46.0387%2028.4438L89.2535%2019.2582L91.6332%2026.6212Z'%20fill='%23717DAD'/%3e%3cpath%20d='M102.961%2024.2033C103.125%2024.9722%20102.371%2025.7829%20101.278%2026.015L37.9675%2039.4722C36.8754%2039.7043%2035.8568%2039.2704%2035.6933%2038.5015C35.5301%2037.7336%2036.284%2036.922%2037.3761%2036.6898L100.687%2023.2327C101.779%2023.0005%20102.798%2023.4354%20102.961%2024.2033Z'%20fill='%239ED1FF'/%3e%3cpath%20d='M102.703%2024.1718C102.838%2024.805%20102.067%2025.5045%20100.983%2025.7349L69.5583%2032.4144L69.0712%2030.123L100.496%2023.4436C101.58%2023.2131%20102.569%2023.5394%20102.703%2024.1718Z'%20fill='%2378AFE1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_8481_102191'%20x1='32.2665'%20y1='59.6553'%20x2='59.0518'%20y2='60.5906'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8481_102191'%20x1='67.3434'%20y1='85.966'%20x2='103.216'%20y2='78.3411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFABC'/%3e%3cstop%20offset='1'%20stop-color='%23FFA650'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8481_102191'%20x1='51.4347'%20y1='74.8197'%20x2='91.1539'%20y2='74.8197'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8481_102191'%20x1='55.1887'%20y1='89.2031'%20x2='94.9078'%20y2='89.2031'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_8481_102191'%20x1='94.5023'%20y1='53.1799'%20x2='106.762'%20y2='58.7056'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_8481_102191'%20x1='74.9906'%20y1='66.9871'%20x2='94.9778'%20y2='46.9999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_8481_102191'%20x1='50.5805'%20y1='44.0581'%20x2='59.9372'%20y2='44.0581'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23E3EEF3'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_8481_102191'%20x1='88.4187'%20y1='43.3906'%20x2='99.3981'%20y2='25.1833'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_8481_102191'%20x1='56.4985'%20y1='29.5482'%20x2='100.532'%20y2='20.1885'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ECF7FF'/%3e%3cstop%20offset='1'%20stop-color='%23C2E0FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",MT=()=>f.jsxs(s.Box,{justifyItems:"center",marginTop:"40px",children:[f.jsx("img",{src:OT,width:124,height:107}),f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:aT})]}),NT=({searchResults:e,selectedObject:t,onReset:n,fetchCards:u})=>{const r=xt(),{sendTrackingEvent:o,currentSmIds:a}=h.useContext(nt),[i,c]=h.useState(null),D=At(rT,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),l=(E,C)=>{o(ng,{search_keyword:t.label,search_result_label:C,sm_ids:a,connector_name:t.connectorName}),c({externalResourceId:E,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:C})},A=()=>{c(null),r(hw())},F=()=>{n(),u(),A()};return e.length?i?f.jsx(LT,{meta:i,onBack:A,onLink:F}):f.jsxs(s.Stack,{gap:"14px",marginTop:"12px",children:[f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:D}),f.jsx(s.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:E,name:C,description:p})=>f.jsxs(Xd,{onClick:()=>l(E,C),direction:"row",children:[f.jsxs(s.Stack,{flexGrow:1,children:[f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-text-primary)"},children:C}),f.jsx(s.Typography,{variant:"caption",sx:{color:"var(--connector-caption-text)"},children:p})]}),f.jsx(s.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:f.jsx(P1,{width:"20px",height:"20px","aria-hidden":!0})})]},E))})]}):f.jsx(MT,{})},Pr=s.styled(s.Skeleton)`
|
|
3019
|
+
`,OT="data:image/svg+xml,%3csvg%20width='124'%20height='107'%20viewBox='0%200%20124%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28.6168%2054.7446C28.6931%2052.5589%2031.0146%2051.1102%2033.0842%2051.8174C35.9985%2052.8133%2040.0375%2053.9024%2044.0621%2054.043C48.0034%2054.1806%2051.968%2053.4097%2054.8762%2052.6339C57.0264%2052.0602%2059.2927%2053.6932%2059.215%2055.9172C59.1742%2057.0856%2058.4742%2058.1269%2057.3723%2058.5178C54.8051%2059.4284%2049.7633%2060.8927%2044.3075%2060.7022C38.7694%2060.5088%2033.1999%2058.6241%2030.4004%2057.5311C29.2637%2057.0873%2028.5742%2055.9641%2028.6168%2054.7446Z'%20fill='url(%23paint0_linear_8481_102191)'/%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='url(%23paint1_linear_8481_102191)'/%3e%3cmask%20id='mask0_8481_102191'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='46'%20y='14'%20width='60'%20height='79'%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_8481_102191)'%3e%3cellipse%20cx='63.7775'%20cy='46.8684'%20rx='1.48152'%20ry='1.39438'%20transform='rotate(-12%2063.7775%2046.8684)'%20fill='%23435C71'/%3e%3crect%20x='47.4368'%20y='59.3203'%20width='53.657'%20height='13.2235'%20transform='rotate(-12%2047.4368%2059.3203)'%20fill='url(%23paint2_linear_8481_102191)'/%3e%3crect%20x='51.1907'%20y='76.9824'%20width='53.657'%20height='10.4263'%20transform='rotate(-12%2051.1907%2076.9824)'%20fill='url(%23paint3_linear_8481_102191)'/%3e%3c/g%3e%3cpath%20opacity='0.883952'%20d='M113.939%2051.0679C114.775%2055%20112.265%2058.865%20108.333%2059.7008L107.842%2059.8052C103.639%2060.6986%2099.5073%2058.0155%2098.6139%2053.8123L97.205%2047.1837L105.307%2045.4616C109.239%2044.6259%20113.104%2047.1359%20113.939%2051.0679Z'%20fill='url(%23paint4_linear_8481_102191)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.7215%2066.4138C67.1801%2064.8725%2067.6745%2062.2062%2069.587%2061.1603C72.4457%2059.5969%2076.2861%2057.1773%2079.3785%2054.0849C82.4099%2051.0535%2084.752%2047.3461%2086.2775%2044.5465C87.3388%2042.5989%2090.0598%2042.0819%2091.6282%2043.6503C92.4782%2044.5003%2092.758%2045.7623%2092.2604%2046.8566C91.0829%2049.4466%2088.5191%2054.344%2084.4346%2058.4285C80.2853%2062.5778%2074.8639%2065.591%2072.0553%2066.9952C70.9363%2067.5548%2069.6062%2067.2985%2068.7215%2066.4138Z'%20fill='url(%23paint5_linear_8481_102191)'/%3e%3crect%20x='48.7264'%20y='33.7744'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2048.7264%2033.7744)'%20fill='url(%23paint6_linear_8481_102191)'/%3e%3crect%20x='50.0175'%20y='35.8193'%20width='4.0158'%20height='3.84848'%20rx='1.92424'%20transform='rotate(-12%2050.0175%2035.8193)'%20fill='%23435C71'/%3e%3crect%20x='59.2875'%20y='31.5723'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2059.2875%2031.5723)'%20fill='%23FFFEFE'/%3e%3cpath%20opacity='0.883952'%20d='M111.25%2038.5376C110.415%2034.6055%20106.55%2032.0955%20102.618%2032.9313L102.127%2033.0356C97.9234%2033.9291%2095.2403%2038.0607%2096.1337%2042.2639L97.5426%2048.8925L105.644%2047.1705C109.576%2046.3347%20112.086%2042.4696%20111.25%2038.5376Z'%20fill='url(%23paint7_linear_8481_102191)'/%3e%3crect%20x='60.0181'%20y='33.8037'%20width='3.84848'%20height='3.84848'%20rx='1.90724'%20transform='rotate(-12%2060.0181%2033.8037)'%20fill='%23435C71'/%3e%3cpath%20d='M36.9246%2059.1604C36.4487%2060.717%2034.7371%2061.6271%2033.1805%2061.1512C32.3613%2060.9007%2031.7241%2060.3475%2031.3259%2059.5987L25.2059%2046.7983C24.9784%2046.3703%2025.1286%2045.8788%2025.5566%2045.6513L28.338%2044.1724C28.7659%2043.9449%2029.2574%2044.0951%2029.4849%2044.5231L36.6496%2056.8367C37.0728%2057.5036%2037.15%2058.423%2036.9246%2059.1604Z'%20fill='%23FFDF9F'/%3e%3crect%20x='27.9973'%20y='44.333'%20width='2.39869'%20height='3.59807'%20transform='rotate(152%2027.9973%2044.333)'%20fill='%23FF9090'/%3e%3cpath%20d='M26.6628%2044.3769L26.9472%2044.9118L28.0169%2044.343L26.3106%2041.1338L24.171%2042.2714L25.0243%2043.876C25.6661%2043.5347%2026.3215%2043.7351%2026.6628%2044.3769Z'%20fill='%23FFB19F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.26386%2027.248C9.3428%2020.4481%2016.5101%2016.6372%2023.31%2018.7161C30.11%2020.7951%2033.9209%2027.9624%2031.8419%2034.7623C29.763%2041.5622%2022.5956%2045.3731%2015.7958%2043.2942C8.99587%2041.2152%205.18493%2034.0479%207.26386%2027.248ZM9.72157%2027.9983C8.06843%2033.4055%2011.1399%2039.1821%2016.5471%2040.8352C21.9543%2042.4884%2027.7309%2039.4168%2029.384%2034.0096C31.0372%2028.6024%2027.9657%2022.8258%2022.5585%2021.1727C17.1513%2019.5196%2011.3747%2022.5911%209.72157%2027.9983Z'%20fill='%23FFE69F'/%3e%3ccircle%20opacity='0.414016'%20cx='19.5529'%20cy='31.0039'%20r='10.2804'%20transform='rotate(17%2019.5529%2031.0039)'%20fill='%23BBDEFC'/%3e%3cpath%20d='M14.3685%2030.6746C15.7299%2027.6867%2018.9391%2025.9803%2022.1776%2026.5225L22.2595%2026.5475C23.7024%2026.8095%2024.3854%2024.8682%2023.1497%2024.2218C22.3806%2023.8074%2021.5613%2023.557%2020.717%2023.3884C17.3715%2022.9031%2014.0553%2024.6664%2012.6939%2027.6543C12.2796%2028.4235%2012.0859%2029.3497%2012.0244%2030.1372C11.8444%2031.6051%2013.8607%2032.0424%2014.4503%2030.6997C14.3434%2030.7566%2014.3685%2030.6746%2014.3685%2030.6746Z'%20fill='%23F6FBFF'/%3e%3cpath%20d='M10.2904%2029.0679C11.9436%2023.6607%2017.7202%2020.5893%2023.1274%2022.2424C25.6671%2023.0189%2027.5785%2024.6783%2028.9301%2026.704C27.7539%2024.1048%2025.508%2022.0744%2022.5586%2021.1727C17.1514%2019.5196%2011.3748%2022.591%209.72165%2027.9982C8.81993%2030.9476%209.32924%2033.97%2010.7444%2036.3735C9.82081%2034.1203%209.51395%2031.6077%2010.2904%2029.0679Z'%20fill='%23ADCBE7'/%3e%3cpath%20opacity='0.406087'%20d='M36.4864%2056.8021L36.1373%2056.2691C36.3845%2056.8563%2036.428%2057.5516%2036.2372%2058.1754C35.9273%2059.189%2034.5593%2059.1971%2034.0713%2058.2806L28.3787%2047.5877C28.0534%2046.9767%2027.3508%2046.7619%2026.7395%2047.0866L25.7206%2047.6277L31.4395%2059.3516C31.7648%2059.9627%2032.27%2060.5434%2032.8706%2060.8123C33.7054%2061.1528%2034.6593%2061.1034%2035.3726%2060.7247C36.0858%2060.3459%2036.6602%2059.5837%2036.8444%2058.7021C37.0351%2058.0783%2036.8117%2057.4132%2036.4864%2056.8021Z'%20fill='white'/%3e%3cpath%20d='M29.8826%2048.4977C29.8006%2048.4726%2029.6368%2048.4225%2029.5799%2048.3155L28.1579%2045.6411C28.0442%2045.4272%2028.1193%2045.1814%2028.3332%2045.0677C28.5472%2044.9539%2028.7929%2045.0291%2028.9067%2045.243L30.3287%2047.9174C30.4424%2048.1313%2030.3673%2048.3771%2030.1534%2048.4908C30.1284%2048.5728%2029.9645%2048.5227%2029.8826%2048.4977Z'%20fill='%23FFF5EB'/%3e%3cellipse%20cx='29.2637'%20cy='54.631'%20rx='1.50593'%20ry='3.17918'%20transform='rotate(-23%2029.2637%2054.631)'%20fill='%23FFC478'/%3e%3cellipse%20cx='34.0592'%20cy='52.4078'%20rx='0.920288'%20ry='1.67325'%20transform='rotate(106%2034.0592%2052.4078)'%20fill='%23FFC478'/%3e%3cpath%20d='M89.1282%2019.2055L68.2257%2026.8725L45.9197%2028.3898L44.4929%2016.4082C44.3371%2013.798%2047.5283%2011.4502%2050.9859%2011.6309L65.1429%2012.369L67.3969%2012.4869C68.5309%2012.5463%2069.7066%2012.3289%2070.7522%2011.8627L78.6899%208.34726C81.725%206.99992%2085.3012%207.87475%2086.2125%2010.1876L89.1282%2019.2055Z'%20fill='url(%23paint8_linear_8481_102191)'/%3e%3cpath%20opacity='0.479771'%20d='M88.6262%2019.0953L68.3101%2026.5288L65.3314%2012.5149L67.5211%2012.6263C68.6228%2012.6824%2069.7652%2012.471%2070.7816%2012.0192L78.4972%208.61266C81.4474%207.30707%2084.9208%208.14856%2085.8036%2010.3829L88.6262%2019.0953Z'%20fill='%23ADCBE7'/%3e%3cpath%20d='M91.6332%2026.6212L46.9517%2036.1186L46.0387%2028.4438L89.2535%2019.2582L91.6332%2026.6212Z'%20fill='%23717DAD'/%3e%3cpath%20d='M102.961%2024.2033C103.125%2024.9722%20102.371%2025.7829%20101.278%2026.015L37.9675%2039.4722C36.8754%2039.7043%2035.8568%2039.2704%2035.6933%2038.5015C35.5301%2037.7336%2036.284%2036.922%2037.3761%2036.6898L100.687%2023.2327C101.779%2023.0005%20102.798%2023.4354%20102.961%2024.2033Z'%20fill='%239ED1FF'/%3e%3cpath%20d='M102.703%2024.1718C102.838%2024.805%20102.067%2025.5045%20100.983%2025.7349L69.5583%2032.4144L69.0712%2030.123L100.496%2023.4436C101.58%2023.2131%20102.569%2023.5394%20102.703%2024.1718Z'%20fill='%2378AFE1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_8481_102191'%20x1='32.2665'%20y1='59.6553'%20x2='59.0518'%20y2='60.5906'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8481_102191'%20x1='67.3434'%20y1='85.966'%20x2='103.216'%20y2='78.3411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFABC'/%3e%3cstop%20offset='1'%20stop-color='%23FFA650'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8481_102191'%20x1='51.4347'%20y1='74.8197'%20x2='91.1539'%20y2='74.8197'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8481_102191'%20x1='55.1887'%20y1='89.2031'%20x2='94.9078'%20y2='89.2031'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_8481_102191'%20x1='94.5023'%20y1='53.1799'%20x2='106.762'%20y2='58.7056'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_8481_102191'%20x1='74.9906'%20y1='66.9871'%20x2='94.9778'%20y2='46.9999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_8481_102191'%20x1='50.5805'%20y1='44.0581'%20x2='59.9372'%20y2='44.0581'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23E3EEF3'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_8481_102191'%20x1='88.4187'%20y1='43.3906'%20x2='99.3981'%20y2='25.1833'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_8481_102191'%20x1='56.4985'%20y1='29.5482'%20x2='100.532'%20y2='20.1885'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ECF7FF'/%3e%3cstop%20offset='1'%20stop-color='%23C2E0FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",MT=()=>f.jsxs(s.Stack,{alignItems:"center",marginTop:"40px",children:[f.jsx("img",{src:OT,width:124,height:107}),f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:aT})]}),NT=({searchResults:e,selectedObject:t,onReset:n,fetchCards:u})=>{const r=xt(),{sendTrackingEvent:o,currentSmIds:a}=h.useContext(nt),[i,c]=h.useState(null),D=At(rT,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),l=(E,C)=>{o(ng,{search_keyword:t.label,search_result_label:C,sm_ids:a,connector_name:t.connectorName}),c({externalResourceId:E,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:C})},A=()=>{c(null),r(hw())},F=()=>{n(),u(),A()};return e.length?i?f.jsx(LT,{meta:i,onBack:A,onLink:F}):f.jsxs(s.Stack,{gap:"14px",marginTop:"12px",children:[f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:D}),f.jsx(s.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:E,name:C,description:p})=>f.jsxs(Xd,{onClick:()=>l(E,C),direction:"row",children:[f.jsxs(s.Stack,{flexGrow:1,children:[f.jsx(s.Typography,{variant:"body2",sx:{color:"var(--connector-text-primary)"},children:C}),f.jsx(s.Typography,{variant:"caption",sx:{color:"var(--connector-caption-text)"},children:p})]}),f.jsx(s.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:f.jsx(P1,{width:"20px",height:"20px","aria-hidden":!0})})]},E))})]}):f.jsx(MT,{})},Pr=s.styled(s.Skeleton)`
|
|
3020
3020
|
display: block;
|
|
3021
3021
|
margin: ${e=>e.margin?e.margin:0};
|
|
3022
3022
|
`,QT=()=>f.jsxs(s.Stack,{marginTop:"12px",children:[f.jsx(Pr,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),f.jsx(s.Stack,{gap:"17px",children:f.jsxs(Xd,{gap:"8px",disableHover:!0,children:[f.jsx(Pr,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),f.jsx(Pr,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]});let _1={};const R1=new Set,jT=(e,t)=>{_1={..._1,[e]:t},R1.forEach(n=>n())},PT=e=>(R1.add(e),()=>R1.delete(e)),_T=e=>h.useSyncExternalStore(PT,()=>_1)[e],RT=async({id:e,searchString:t,args:n})=>{try{if(e===void 0||t===void 0)return[];const u=await xe({url:yT.replace(":formId",e.toString()),method:Te.POST,data:{search_string:t,args:n}});let r=null;return u!=null&&u.data&&"data"in u.data&&(r=u.data.data),r}catch(u){_e({message:Jn,type:ot}),console.error(u)}},HT=(e,t)=>nn({mutationFn:RT,onMutate:({searchString:n,connectorName:u})=>{e(n,u)},onSuccess:(n,{searchString:u,connectorName:r})=>{t(u,n,r)}}),WT=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,u=h.useRef(!1),r=h.useRef(void 0),o=h.useCallback((c="auto")=>{const D=e.current;D&&D.scrollIntoView({behavior:c})},[e]),a=h.useCallback((c,D="smooth")=>{u.current||(r.current!==void 0&&clearTimeout(r.current),c&&(r.current=setTimeout(()=>{o(D),u.current=!0},n)))},[o,n]),i=h.useCallback(()=>{u.current=!1,r.current!==void 0&&clearTimeout(r.current)},[]);return h.useEffect(()=>()=>{r.current!==void 0&&clearTimeout(r.current)},[]),{scrollOnceAfterLoad:a,resetScrollState:i,hasScrolledOnce:u.current}},VT="/v1/api/connectors/lookup/bulk",GT="/v1/api/connectors/lookup/bulk",zT=async e=>{const t=new URLSearchParams;e.forEach(r=>t.append("connector_ids",r));const n=`${VT}?${t.toString()}`,u=await xe({url:n,method:Te.GET});return u==null?void 0:u.data},XT=async e=>{const t=await xe({url:GT,method:Te.PUT,data:{entries:e}});return t==null?void 0:t.data},ZT={fontSize:`${s.theme.typography.body1.fontSize}px`,width:"209px",height:"40px",color:"var(--connector-text-primary)",background:"var(--connector-surface)",borderRadius:"8px",fontWeight:s.theme.typography.fontWeightRegular,"& .MuiOutlinedInput-notchedOutline":{borderColor:"var(--connector-border-strong)"}},JT={border:"1px solid var(--connector-border-strong)",borderRadius:"8px",padding:"12px"},Zd={flex:1,height:"1px",backgroundColor:"var(--connector-border)"},YT={flexShrink:0,border:"1px solid var(--connector-border)",borderRadius:"15px"},qT={border:"1px solid var(--connector-border)",backgroundColor:"var(--connector-surface-active)",borderRadius:"8px",padding:"8px 10px"},UT=h.memo(function({connector:t,selectedHiverParam:n,onChange:u,sendTrackingEvent:r}){var i;const o=((i=(t.presets??[]).find(c=>c.hiverParam===n))==null?void 0:i.objectParamLabel)??"",a=h.useCallback(c=>{r(cg,{hiver_param:c.target.value,connector_name:t.connectorName,page:"agent_connector_panel"}),u(t.connectorId,c.target.value)},[t.connectorId,t.connectorName,u,r]);return f.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:"0px",justifyContent:"space-between",children:[f.jsx(s.Select,{value:n,onChange:a,size:"small",variant:"outlined",sx:ZT,MenuProps:{sx:{zIndex:1500}},renderValue:c=>{var l;const D=((l=(t.presets??[]).find(A=>A.hiverParam===c))==null?void 0:l.label)??"";return f.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[f.jsx(Ad,{width:18,height:18}),f.jsx("span",{children:D})]})},children:(t.presets??[]).map(c=>f.jsx(s.MenuItem,{value:c.hiverParam,sx:{fontSize:`${s.theme.typography.body1.fontSize}px`},children:c.label},c.hiverParam))}),f.jsx(s.Box,{sx:Zd}),f.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:"4px",padding:"4px 12px",sx:YT,children:[t.logo&&f.jsx("img",{src:t.logo,width:16,height:16,alt:t.connectorName}),f.jsxs(s.Typography,{variant:"body2",color:"var(--connector-caption-text)",children:["Matches with ",t.connectorName,"'s"]})]}),f.jsx(s.Box,{sx:Zd}),f.jsx(s.Box,{sx:qT,children:f.jsx(s.Typography,{variant:"body2",fontSize:14,children:o})})]})}),KT=h.memo(function({open:t,onClose:n,connectors:u,onSaveSuccess:r}){const{sendTrackingEvent:o}=h.useContext(nt),[a,i]=h.useState({});h.useEffect(()=>{if(t&&u.length>0){const C={};u.filter(p=>{var d;return((d=p.presets)==null?void 0:d.length)>1}).forEach(p=>{C[p.connectorId]=p.hiverParam}),i(C)}},[t,u]);const c=It(),{mutate:D,isPending:l}=nn({mutationFn:XT,onSuccess:C=>{const p={};C.results.forEach(({connectorId:d,hiverParam:g})=>{p[d]=g}),c.setQueriesData({queryKey:["lookup","bulk"]},d=>d&&{...d,connectors:d.connectors.map(g=>p[g.connectorId]!==void 0?{...g,hiverParam:p[g.connectorId]}:g)}),o(Dg,{page:"agent_connector_panel"}),_e({message:"Identity mapping saved successfully",type:"success"}),r==null||r(),n()},onError:()=>{_e({message:"Failed to save identity mapping",type:"error"})}}),A=h.useCallback(()=>{const C=Object.entries(a).map(([p,d])=>({connector_id:p,hiver_param:d}));D(C)},[a,D]),F=h.useCallback((C,p)=>{i(d=>({...d,[C]:p}))},[]),E=h.useCallback(C=>{C||n()},[n]);return f.jsx(Mn,{shown:t,setShown:E,showCloseButton:!1,children:f.jsxs(s.Stack,{padding:"24px 20px",gap:"16px",sx:{minWidth:"800px"},children:[f.jsx(s.Typography,{variant:"h2",children:"Customer identity mapping"}),f.jsx(s.Typography,{variant:"body2",children:"Choose how Hiver should identify customers when fetching data from connected apps."}),u.some(C=>{var p;return((p=C.presets)==null?void 0:p.length)>1})&&f.jsx(s.Stack,{gap:"8px",sx:JT,children:u.filter(C=>{var p;return((p=C.presets)==null?void 0:p.length)>1}).map(C=>f.jsx(UT,{connector:C,selectedHiverParam:a[C.connectorId]??C.hiverParam,onChange:F,sendTrackingEvent:o},C.connectorId))}),f.jsxs(s.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:[f.jsx(s.Button,{variant:"text",onClick:n,children:"Cancel"}),f.jsx(s.Button,{variant:"contained",onClick:A,disabled:l,children:"Save"})]})]})})}),$T=({enabled:e,...t})=>{const{actionQueue:n}=h.useContext(nt),{connectorId:u,conversationId:r}=t,o=h.useRef(t);o.current=t,h.useEffect(()=>{if(!n||!e)return;const a=n.register(()=>o.current);return()=>n.unregister(a)},[n,e,u,r])},eL=({isAdmin:e=!1})=>{var os,O5;const{email:t,currentSmIds:n,sendTrackingEvent:u,availableFeatures:r,conversationId:o,connectorId:a}=h.useContext(nt),i=xt(),{userGroupId:c,userId:D}=Mt()||{},l=h.useRef(!1),A=h.useRef(null),F=h.useRef(null),E=h.useRef(null),[C,p]=h.useState({}),[d,g]=h.useState(!1),[m,b]=h.useState(!1),[x,y]=h.useState(!1),[B,w]=h.useState(!1),[S,k]=h.useState(),[O,Q]=h.useState(!1),[T,N]=h.useState(null),[j,P]=h.useState(),[H,V]=h.useState(null),[_,z]=h.useState(!1),[U,Z]=h.useState(!1),[X,se]=h.useState(!1),[re,W]=h.useState(!1),[De,Fe]=h.useState(void 0),Ie=h.useRef(),te=Oe(Z2),oe=Oe(DS),ae=Oe(AS),K=Oe(dS),R=Oe(CS),Y=Oe(lS),q=Oe(ed),ue=Oe(GS),ye=Oe(td),me=Oe(nd),ee=Oe(ud),ke=Oe(Fk),ut=dt(r,mg),$e=dt(r,SD),cn=dt(r,wg),nu=dt(r,Ig),Ht=dt(r,kg),Wt=dt(r,Tg),$t=(os=Mt())==null?void 0:os.tenantPlatform,Dn=dt(r,$t==="HIVERWEB"?`hot-${ID}`:ID),{data:Rn}=Dt({queryKey:["connectors","enabledAuthenticated"],queryFn:()=>i3(),enabled:Dn&&e}),xn=h.useMemo(()=>(Rn??[]).map(de=>de.id),[Rn]),{data:ht,isSuccess:uu}=Dt({queryKey:["lookup","bulk",xn.join(",")],queryFn:()=>zT(xn),enabled:xn.length>0&&Dn&&e,refetchOnMount:!1}),Bn=uu&&((ht==null?void 0:ht.connectors)??[]).some(de=>{var Qe;return(((Qe=de.presets)==null?void 0:Qe.length)??0)>1});$T({conversationId:o,connectorId:a,openCreateForm:de=>{if(de!=null&&de.selectConnectorForm&&de.connectorId){p({connectorId:de.connectorId});return}y(!0)},enabled:oe});const en=h.useMemo(()=>!te||!te.length?null:iS(te,ae,K),[te,ae,K]),Et=qg(ae),Hn=Oe(L1),ln=h.useMemo(()=>{if(!Hn)return[];const de=new Map;return Object.values(Hn).forEach(Qe=>{Qe.userAuthEnabled&&Qe.connectorId&&!de.has(Qe.connectorId)&&de.set(Qe.connectorId,{connectorId:Qe.connectorId,connectorName:Qe.connectorName??Qe.name,connectorLogo:Qe.logoUrl??""})}),Array.from(de.values())},[Hn]),Wn=Oe(de=>ln.some(Qe=>dI(de,Qe.connectorId))),Vn=h.useMemo(()=>{const de=new Set;return(te??[]).forEach(Qe=>{Qe.userAuthEnabled&&Qe.connectorId&&de.add(Qe.connectorId)}),ln.forEach(Qe=>de.add(Qe.connectorId)),Array.from(de)},[te,ln]),{isResolving:Ae}=FI(Vn),{data:he,isLoading:qe}=Gd({senderEmail:t,conversationId:String(o),enabled:nu&&!!t}),{emailHeaders:He,selectedEmail:Vt}=he??{},{scrollOnceAfterLoad:An,resetScrollState:vu}=WT(F),oo=Y!==le.LOADING&&(!K||!Object.values(K).some(de=>de===le.LOADING))&&te&&te.length>0;h.useLayoutEffect(()=>{var de;_&&!d&&U&&((de=E==null?void 0:E.current)!=null&&de.scrollHeight)&&An(!!oo,"smooth")},[_,d,U,oo,An,(O5=E==null?void 0:E.current)==null?void 0:O5.scrollHeight,D]);const ao=(de,Qe)=>{u($C,{search_keyword:de,sm_ids:n,connector_name:Qe,suggestion_type:ke})},lr=(de,Qe,dn)=>{!Array.isArray(Qe)||!Qe.length?u(eg,{search_keyword:de,sm_ids:n,connector_name:dn,suggestion_type:ke}):Qe.length&&u(tg,{num_of_results:Qe.length,search_keyword:de,sm_ids:n,connector_name:dn,suggestion_type:ke})},{mutate:fo,reset:Ar,data:so,isPending:io,isIdle:ia}=HT(ao,lr),co=h.useCallback(()=>{Ar(),N(null)},[Ar,N]),wu=It(),Gt=h.useCallback(()=>{if(t&&n.length&&o){const de=i(Gf({inboxIds:n,conversationId:o,connectorId:a}));return()=>de.abort()}},[i,t,n,o,a]),M=h.useCallback(()=>{wu.invalidateQueries({queryKey:["lookup","bulk"]}),Gt()},[wu,Gt]),$=h.useCallback(()=>{wu.invalidateQueries({queryKey:["lookup","bulk"]}),Gt()},[wu,Gt]),ie=h.useCallback((de,Qe)=>{de&&o&&Qe&&i(Hf({id:de,channelType:"email",conversationId:o,externalResourceId:Qe,contactEmail:t})).unwrap().catch(()=>{i(Uu(null))})},[i,o,t]);if(h.useEffect(()=>{(async()=>{D&&(z(await ks(D)),Z(await Ec(D)))})()},[D]),h.useEffect(()=>{qe||P(Vt||t)},[t,Vt,qe]),h.useEffect(()=>{j&&o&&jT(String(o),j)},[j,o]),h.useEffect(()=>{U&&D&&mc(D)},[U,D]),h.useEffect(()=>{i(Uu(null))},[a,i]),h.useEffect(()=>{var de;if(me){b(!0);const{externalResourceId:Qe}=me,dn=(de=me.forms.find(gi=>gi.type==="edit"))==null?void 0:de.id;ie(dn,Qe)}else b(!1),i(nS())},[me,ie,i]),h.useEffect(()=>{const de=Gt();return vu(),()=>{de==null||de(),i(K2.clearConnectorList())}},[i,Gt,vu]),h.useEffect(()=>{var de;if(R&&te&&te.length&&en&&!l.current){const{cards_per_app:Qe,total_empty_cards:dn,total_cards_with_errors:gi}=en,M5=a?(de=Qe[0])==null?void 0:de.app_name:null;u(IC,{numOfCards:te.length,total_cards_loaded:te.length,total_empty_cards:dn,total_cards_with_errors:gi,cards_per_app:Qe,sm_ids:n,...M5?{app_name:M5}:null}),l.current=!0}return()=>{l.current=!1}},[R,te,en,u,n,a]),h.useEffect(()=>{if(o&&n&&n.length){const de=i(Qf({inboxIds:n,conversationId:o,channelType:"email",isExpandedFormEnabled:Wt,connectorId:a}));return()=>de.abort()}},[i,n,o,Wt,a]),h.useEffect(()=>{if(!(q!=null&&q.length)||!C.connectorId)return;const de=C.connectorId;p({});const Qe=q.find(dn=>dn.connectorId===de);Qe&&(V(Qe),y(!0))},[q,C]),!t.length||Y===le.LOADING||Ae)return f.jsx(rk,{});const we=de=>{u(MC,{connector_name:ue,source:de,sm_ids:n})},J=de=>{y(!0),we(de)},fe=()=>{w(!0),ce(yD),Ce(BD),u(NC)},ce=de=>{u(de,S),ee?Q(!0):(y(!1),V(null))},Ce=de=>{if(me){const{connectorName:Qe,title:dn}=me;u(de,{connector_name:Qe,card_title:dn,sm_ids:n,ug_id:c})}ee?Q(!0):i(Uu(null))},Pe=()=>{y(!1),i(Uu(null)),k(void 0),Q(!1)},je=()=>{Gt(),y(!1),b(!1),i(K2.clearConnectorList())},Ue=[{label:"Go back",variant:"text",action:Pe},{label:"Stay",variant:"contained",action:()=>Q(!1)}],rt=q.length>0,yt=ye.length>0,zt=x||m||B,et=()=>rt||yt?f.jsx(qk,{haveCreateObjects:rt,haveLinkObjects:yt,onCreateClick:()=>J(RD.MAIN_BUTTON),onLinkClick:()=>w(!0)}):f.jsx(pd,{isAdmin:e,hideHeading:!0}),Gn=()=>{se(!0);const de=Ie.current,Qe=de==null?void 0:de.connectorName,dn=de==null?void 0:de.name;u(lg,{entry_point:"agent",app_name:Qe,object_type:dn})},Su=de=>{Ie.current=de};return f.jsxs(KD,{ref:A,"data-testid":Array.isArray(te)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:x||B,children:[f.jsx(TI,{}),f.jsx(Md,{shown:O,setShown:Q,title:zw,description:Xw,buttons:Ue}),f.jsx(SF,{onWheel:()=>g(!0),ref:E,children:oe?f.jsxs(f.Fragment,{children:[!Wn&&f.jsx(f9,{connectors:Et,isWriteFlowEnabled:$e,haveCreateObjects:rt,haveLinkObjects:yt,cards:te,handleCreateNewObject:()=>J(RD.ICON),handleLinkNewObject:fe}),cn&&!zt?f.jsx(ST,{selectedObject:T,setSelectedObject:N,fetchSearchResults:fo,onReset:co,root:A.current}):null,f.jsxs(jr,{children:[f.jsx(qn,{condition:cn&&io,children:f.jsx(QT,{})},"search"),f.jsx(qn,{condition:cn&&!!T&&!ia,children:f.jsx(NT,{searchResults:so??[],selectedObject:T,onReset:co,fetchCards:Gt})},"results"),f.jsx(qn,{condition:x,children:f.jsx(N1,{onClose:()=>ce(yD),title:s0,rightNode:f.jsx(Od,{formId:De,conversationId:o,inboxIds:n,enabled:x&&!!De&&!!e,setMapFormOpen:Gn}),children:f.jsx(Qd,{onClose:()=>ce(RC),onCreateSuccess:je,metaData:S,setMetaData:k,defaultOption:H,connectors:Et,mapFormOpen:X,setMapFormOpen:se,setCreateFormId:Fe,syncCurrentObject:Su})})},"create-form"),f.jsx(qn,{condition:m,children:f.jsx(N1,{onClose:()=>Ce(BD),title:Rg,backButtonTooltip:"Back",children:f.jsx(Qd,{isEdit:!0,onClose:()=>Ce(XC),onCreateSuccess:je,metaData:S,setMetaData:k,connectors:Et})})},"edit-form"),f.jsx(qn,{condition:B,children:f.jsx(N1,{onClose:()=>w(!1),children:f.jsx(Zk,{setOpenTaskLinking:w,onLinkingSuccess:Gt})})},"link-form"),f.jsxs(qn,{fallback:!0,children:[nu&&(te!=null&&te.length)&&!Wn?f.jsxs(s.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[f.jsx(s.Stack,{sx:{flex:1,minWidth:0},children:f.jsx(dk,{emailHeaders:He,selectedEmail:j,root:A.current,isLoading:qe,setSelectedEmail:P})}),Dn&&Bn&&e&&f.jsx(s.Tooltip,{title:"Update customer identity mapping",placement:"top",children:f.jsx(s.IconButton,{"aria-label":"Open customer identity mapping settings",sx:{height:"32px",width:"32px",marginTop:"12px",flexShrink:0},onClick:()=>{u(vD,{page:"agent_connector_panel"}),W(!0)},children:f.jsx(s.icons.SettingsOutlined,{sx:{height:"20px",width:"20px"}})})})]}):null,!nu&&Dn&&Bn&&e&&(te!=null&&te.length)?f.jsx(s.Button,{fullWidth:!0,variant:"contained",startIcon:f.jsx(s.icons.SettingsOutlined,{sx:{height:"14px",width:"14px"}}),sx:{backgroundColor:"var(--connector-surface-active)",color:"var(--connector-text-secondary)",borderRadius:"6px",padding:"9px 12px",marginTop:"12px",textTransform:"none",fontWeight:s.theme.typography.fontWeightMedium,fontSize:`${s.theme.typography.body1.fontSize}px`,lineHeight:"20px",boxShadow:"none","&:hover":{backgroundColor:"var(--connector-surface-hover)",boxShadow:"none"}},onClick:()=>{u(vD,{page:"agent_connector_panel"}),W(!0)},children:"Customer identity mapping"}):null,ut?f.jsx(ok,{}):null,f.jsxs(jr,{children:[f.jsxs(qn,{condition:!!te&&te.length>0,children:[f.jsx(wI,{cards:te,specificCardData:ae,email:j??"",specificConnectorApiStatus:K,onCardUnlinking:Gt}),f.jsx("div",{ref:F,children:Ht?f.jsx(sF,{connectors:Et,expanded:_}):null})]},"cards-list"),f.jsx(qn,{condition:!(te!=null&&te.length)&&$e,children:ln.length>0?f.jsx(II,{connectors:ln,onConnected:$,children:et()}):et()},"create-banner")]})]},"cards")]})]}):f.jsx(pd,{isAdmin:e})}),!oe&&f.jsx(EF,{}),Dn&&f.jsx(KT,{open:re,onClose:()=>W(!1),connectors:(ht==null?void 0:ht.connectors)??[],onSaveSuccess:M})]})},tL=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:u={},currentSmIds:r=[],userEmail:o,metaData:a,availableFeatures:i,conversationId:c,connectorFunctions:D,stackingContext:l,isAdmin:A=!1,actionQueue:F,store:E,connectorId:C,variables:p})=>{const d=h.useMemo(()=>({userEmail:o,email:n,baseUrls:u,currentSmIds:r,metaData:a,conversationId:c,sendTrackingEvent:t||(()=>{}),availableFeatures:i,isAdmin:A,connectorFunctions:D,stackingContext:l,actionQueue:F,store:E,connectorId:C,variables:p}),[o,n,u,t,r,a,i,c,A,D,l,F,E,C,p]);return f.jsx(nt.Provider,{value:d,children:e})},Jd=h.createContext(null),Yd=({value:e,children:t})=>f.jsx(Jd.Provider,{value:e,children:t}),Un=()=>{const e=h.useContext(Jd);if(!e)throw new Error("useSlackContext must be used inside <SlackContextProvider>");return e},Xf=e=>{var o;const t=e==null?void 0:e.response;if(!t)return!1;const n=t.status,u=t.data,r=((o=u==null?void 0:u.detail)==null?void 0:o.reason)??(u==null?void 0:u.reason);return n===401&&r==="slack_invalid_auth"||n===412&&r==="user_slack_auth_missing"};function Zf(){const{connectorId:e}=Un(),t=It();return h.useCallback(()=>{t.invalidateQueries({queryKey:["userAuthStatus",e]})},[t,e])}const _r=({children:e})=>{const[t]=h.useState(()=>{const n=r=>{Xf(r)&&u.invalidateQueries({queryKey:["userAuthStatus"]})},u=new t4({queryCache:new zi({onError:n}),mutationCache:new Zi({onError:n})});return u});return f.jsx(s4,{client:t,children:e})},nL=dl({cardList:HS,userAuth:DI,write:uS,common:bw}),Ku=vh({reducer:nL,devTools:!0}),uL=()=>{const e=Mt();if(!e){console.warn("[connectors-ui] registerUserAuthCallback called before initConnectorsBifrost; user-tier 412 responses will not route through the userAuth slice.");return}e.onUserAuthRequired=t=>{Ku.dispatch(iI({connectorId:t.connector_id,connectUrl:t.connect_url,reason:t.reason}))}},rL=({children:e,userEmail:t,extraParams:n,contactEmail:u,baseUrls:r,availableFeatures:o,connectorFunctions:a,stackingContext:i,actionQueue:c,store:D,connectorId:l,theme:A})=>(h.useEffect(()=>{uL()},[]),f.jsx(yr,{store:Ku,children:f.jsx(Xu,{config:A,children:f.jsx(_r,{children:f.jsx(tL,{...n,userEmail:t,availableFeatures:o,sendTrackingEvent:n==null?void 0:n.sendTrackingEvent,contactEmail:u,currentSmIds:n==null?void 0:n.currentSmIds,metaData:n==null?void 0:n.metaData,conversationId:n==null?void 0:n.conversationId,baseUrls:r,connectorFunctions:a,stackingContext:i,actionQueue:c,isAdmin:n==null?void 0:n.isAdmin,store:D,connectorId:l,children:f.jsx(h.Suspense,{fallback:f.jsx(f.Fragment,{}),children:e})})})})})),oL=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:u={},availableFeatures:r={},connectorFunctions:o,stackingContext:a={},actionQueue:i,store:c,theme:D={mode:"light"}})=>{const[l,A]=h.useState(()=>{if(c)return c.getData("connectorId")});return h.useEffect(()=>{if(!c)return;const F=c.subscribe(E=>{A(E)},"connectorId");return()=>F()},[c]),f.jsx(Br,{className:"connector-theme-root","data-color-scheme":D.mode,style:Du(D.mode,cu(D)),children:f.jsxs(rL,{userEmail:e,availableFeatures:r,extraParams:u,contactEmail:t,connectorFunctions:o,stackingContext:a,actionQueue:i,baseUrls:n,store:c,connectorId:l,theme:D,children:[f.jsx(eL,{isAdmin:u==null?void 0:u.isAdmin},l||"root"),f.jsx(rf,{zIndex:a.toastMessage}),f.jsx("div",{"data-connectorid":"connector-layover-portal"})]})})},aL={OPEN_FORM_VIEW:"connector-agent-open-form-view"},qd="/v1/api",fL=`${qd}/connector/conversation/:conversationId/data`,sL=`${qd}/connector/feedback/conversation/:conversationId`,iL=async(e,t)=>{try{let n=fL.replace(":conversationId",e)+"?channel_type=email";if(t!=null&&t.length){const r=t.map(o=>`inbox_ids=${encodeURIComponent(o)}`).join("&");n+=`&${r}`}const u=await xe({url:n,method:Te.GET});return u!=null&&u.data&&Array.isArray(u.data)?u.data.reduce((o,a)=>{var i,c;return o[(i=a==null?void 0:a.cardData)==null?void 0:i.textToHighlight]||(o[(c=a==null?void 0:a.cardData)==null?void 0:c.textToHighlight]={...a}),o},{}):null}catch(n){return Promise.reject(n)}};function cL(e,t,n){return Dt({queryKey:["connector-analytics",e,t,n],queryFn:async()=>!t||!e?null:await iL(e,n),enabled:!!t&&!!e})}class DL{constructor(t=[],n=null){ze(this,"highlightTerms");ze(this,"observer");ze(this,"isHighlighting");ze(this,"debounceTimer");ze(this,"debounceDelay");ze(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,this.init()}init(){this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){console.warn("Gmail container not found");return}this.observer=new MutationObserver(n=>{if(this.isHighlighting)return;let u=!1;n.forEach(r=>{r.type==="childList"&&Array.from(r.addedNodes).some(i=>{var c,D,l,A;return i.nodeType===1&&i instanceof Element&&(((c=i.classList)==null?void 0:c.contains("a3s"))||((D=i.classList)==null?void 0:D.contains("ii"))||((l=i.querySelector)==null?void 0:l.call(i,".a3s"))||((A=i.querySelector)==null?void 0:A.call(i,"h2.hP")))})&&(u=!0)}),u&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0})}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){var t;if(this.highlightTerms.length!==0){this.isHighlighting=!0;try{if(this.clearHighlights(),["h2.hP",".ii.gt .a3s.aiL",".ii.gt .a3s",'[data-expanded="true"]'].forEach(u=>{document.querySelectorAll(u).forEach(o=>{this.isElementVisible(o)&&this.highlightInElement(o)})}),this.onHighlightsUpdated){const u=Array.from(document.querySelectorAll(".gmail-highlight"));(t=this.onHighlightsUpdated)==null||t.call(this,u)}}finally{setTimeout(()=>{this.isHighlighting=!1},250)}}}isElementVisible(t){const n=t;return n.offsetParent!==null&&n.offsetWidth>0&&n.offsetHeight>0}highlightInElement(t){if(!t||this.highlightTerms.length===0||t.dataset.highlightProcessed==="true")return;const u=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:a=>a.parentElement&&a.parentElement.classList.contains("gmail-highlight")||a.parentElement&&["SCRIPT","STYLE"].includes(a.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),r=[];let o;for(;o=u.nextNode();)r.push(o);r.forEach(a=>{this.highlightInTextNode(a)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,u=!1;if(!n)return;if([...this.highlightTerms].sort((o,a)=>a.length-o.length).forEach(o=>{if(!o||o.trim().length===0)return;const a=this.escapeRegex(o.trim()),i=new RegExp(`\\b${a}\\b`,"gi");i.test(n)&&(n=n.replace(i,`<span class="gmail-highlight" data-highlight-term="${o.trim()}"><span class="gmail-highlight-inner">${o}</span></span>`),u=!0)}),u&&t.parentNode){const o=document.createElement("span");o.innerHTML=n,t.parentNode.replaceChild(o,t)}}clearHighlights(){document.querySelectorAll(".gmail-highlight").forEach(u=>{const r=u.parentNode;r&&u.textContent&&(r.replaceChild(document.createTextNode(u.textContent),u),r.normalize())}),document.querySelectorAll('[data-highlight-processed="true"]').forEach(u=>{delete u.dataset.highlightProcessed})}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}refreshHighlights(){this.highlightAllEmails()}updateHighlightTerms(t){this.highlightTerms=t||[],this.highlightAllEmails()}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
|