@hiver/connector-admin 4.13.0-userauthfixes-beta.0 → 4.13.0-userauthfixesv2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js CHANGED
@@ -36615,7 +36615,7 @@ const nJ = T(G)`
36615
36615
  ] })
36616
36616
  ] })
36617
36617
  ] });
36618
- }, dJ = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", CJ = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", EJ = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", fJ = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%23343C45'%3e%3cg%20fill-rule='evenodd'%3e%3ccircle%20cx='17'%20cy='15.5'%20r='1.12'/%3e%3cpath%20d='M17%2017.5c-.73%200-2.19.36-2.24%201.08.5.71%201.32%201.17%202.24%201.17s1.74-.46%202.24-1.17c-.05-.72-1.51-1.08-2.24-1.08'/%3e%3cpath%20d='M18%2011.09V6.27L10.5%203%203%206.27v4.91c0%204.54%203.2%208.79%207.5%209.82.55-.13%201.08-.32%201.6-.55C13.18%2021.99%2014.97%2023%2017%2023c3.31%200%206-2.69%206-6%200-2.97-2.16-5.43-5-5.91M11%2017c0%20.56.08%201.11.23%201.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4%205.5%202.4v3.51c-2.84.48-5%202.94-5%205.91m6%204c-2.21%200-4-1.79-4-4s1.79-4%204-4%204%201.79%204%204-1.79%204-4%204'/%3e%3c/g%3e%3c/svg%3e", IJ = "integration_sense", cb = "email_log_settings", BJ = "quick_access", rC = "user_auth_enabled", hJ = "This feature can only be used for one App and is currently enabled for :enabledConnector.", pJ = [
36618
+ }, dJ = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", CJ = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", EJ = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", fJ = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%3e%3cg%20transform='translate(1.004%201.004)'%3e%3ccircle%20cx='12.5953'%20cy='12.4035'%20r='4.10637'%20fill='%23FFE250'/%3e%3cpath%20d='M12.5951%2012.2532C13.1515%2012.2532%2013.6027%2011.8021%2013.6027%2011.2456C13.6027%2010.6891%2013.1515%2010.238%2012.5951%2010.238C12.0386%2010.238%2011.5875%2010.6891%2011.5875%2011.2456C11.5875%2011.8021%2012.0386%2012.2532%2012.5951%2012.2532Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5948%2013.0445C11.938%2013.0445%2010.6246%2013.3683%2010.5796%2014.0161C11.0294%2014.6548%2011.7671%2015.0687%2012.5948%2015.0687C13.4224%2015.0687%2014.1602%2014.6548%2014.61%2014.0161C14.565%2013.3683%2013.2515%2013.0445%2012.5948%2013.0445Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.4946%207.2781V2.94183L6.74731%200L0%202.94183V7.35907C0%2011.4434%202.87885%2015.2669%206.74731%2016.1936C7.24212%2016.0766%207.71893%2015.9057%208.18674%2015.6988C9.15835%2017.0842%2010.7687%2017.9928%2012.595%2017.9928C15.5728%2017.9928%2017.9928%2015.5728%2017.9928%2012.595C17.9928%209.92305%2016.0496%207.70993%2013.4946%207.2781ZM7.19713%2012.595C7.19713%2013.0988%207.26911%2013.5936%207.40405%2014.0524C7.18814%2014.1514%206.97222%2014.2503%206.74731%2014.3223C3.89545%2013.4227%201.79928%2010.5078%201.79928%207.35907V4.12036L6.74731%201.96122L11.6953%204.12036V7.2781C9.14036%207.70993%207.19713%209.92305%207.19713%2012.595ZM12.595%2016.1936C10.6068%2016.1936%208.99642%2014.5832%208.99642%2012.595C8.99642%2010.6068%2010.6068%208.99642%2012.595%208.99642C14.5832%208.99642%2016.1936%2010.6068%2016.1936%2012.595C16.1936%2014.5832%2014.5832%2016.1936%2012.595%2016.1936Z'%20fill='%23343C45'/%3e%3c/g%3e%3c/svg%3e", IJ = "integration_sense", cb = "email_log_settings", BJ = "quick_access", rC = "user_auth_enabled", hJ = "This feature can only be used for one App and is currently enabled for :enabledConnector.", pJ = [
36619
36619
  {
36620
36620
  id: IJ,
36621
36621
  heading: "Smart Previews",
package/index.umd.js CHANGED
@@ -73,9 +73,9 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
73
73
  * LICENSE.md file in the root directory of this source tree.
74
74
  *
75
75
  * @license MIT
76
- */function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}var Ut;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ut||(Ut={}));const rp="popstate";function w3(e){e===void 0&&(e={});function t(r,o){let{pathname:A,search:s,hash:a}=r.location;return ha("",{pathname:A,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Do(o)}return T3(t,n,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function S3(){return Math.random().toString(36).substr(2,8)}function op(e,t){return{usr:e.state,key:e.key,idx:t}}function ha(e,t,n,r){return n===void 0&&(n=null),kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Lo(t):t,{state:n,key:t&&t.key||r||S3()})}function Do(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Lo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function T3(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:A=!1}=r,s=o.history,a=Ut.Pop,i=null,l=u();l==null&&(l=0,s.replaceState(kt({},s.state,{idx:l}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=Ut.Pop;let E=u(),h=E==null?null:E-l;l=E,i&&i({action:a,location:C.location,delta:h})}function f(E,h){a=Ut.Push;let p=ha(C.location,E,h);l=u()+1;let Q=op(p,l),y=C.createHref(p);try{s.pushState(Q,"",y)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;o.location.assign(y)}A&&i&&i({action:a,location:C.location,delta:1})}function B(E,h){a=Ut.Replace;let p=ha(C.location,E,h);l=u();let Q=op(p,l),y=C.createHref(p);s.replaceState(Q,"",y),A&&i&&i({action:a,location:C.location,delta:0})}function I(E){let h=o.location.origin!=="null"?o.location.origin:o.location.href,p=typeof E=="string"?E:Do(E);return p=p.replace(/ $/,"%20"),Fe(h,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,h)}let C={get action(){return a},get location(){return e(o,s)},listen(E){if(i)throw new Error("A history only accepts one active listener");return o.addEventListener(rp,d),i=E,()=>{o.removeEventListener(rp,d),i=null}},createHref(E){return t(o,E)},createURL:I,encodeLocation(E){let h=I(E);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:B,go(E){return s.go(E)}};return C}var vt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vt||(vt={}));const _3=new Set(["lazy","caseSensitive","path","id","index","children"]);function O3(e){return e.index===!0}function Qa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,A)=>{let s=[...n,String(A)],a=typeof o.id=="string"?o.id:s.join("-");if(Fe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Fe(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),O3(o)){let i=kt({},o,t(o),{id:a});return r[a]=i,i}else{let i=kt({},o,t(o),{id:a,children:void 0});return r[a]=i,o.children&&(i.children=Qa(o.children,t,s,r)),i}})}function fA(e,t,n){return n===void 0&&(n="/"),Bl(e,t,n,!1)}function Bl(e,t,n,r){let o=typeof t=="string"?Lo(t):t,A=xr(o.pathname||"/",n);if(A==null)return null;let s=Ap(e);L3(s);let a=null;for(let i=0;a==null&&i<s.length;++i){let l=W3(A);a=G3(s[i],l,r)}return a}function D3(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Ap(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(A,s,a)=>{let i={relativePath:a===void 0?A.path||"":a,caseSensitive:A.caseSensitive===!0,childrenIndex:s,route:A};i.relativePath.startsWith("/")&&(Fe(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),i.relativePath=i.relativePath.slice(r.length));let l=Gr([r,i.relativePath]),u=n.concat(i);A.children&&A.children.length>0&&(Fe(A.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),Ap(A.children,t,u,l)),!(A.path==null&&!A.index)&&t.push({path:l,score:j3(l,A.index),routesMeta:u})};return e.forEach((A,s)=>{var a;if(A.path===""||!((a=A.path)!=null&&a.includes("?")))o(A,s);else for(let i of sp(A.path))o(A,s,i)}),t}function sp(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),A=n.replace(/\?$/,"");if(r.length===0)return o?[A,""]:[A];let s=sp(r.join("/")),a=[];return a.push(...s.map(i=>i===""?A:[A,i].join("/"))),o&&a.push(...s),a.map(i=>e.startsWith("/")&&i===""?"/":i)}function L3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:V3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const F3=/^:[\w-]+$/,N3=3,R3=2,k3=1,P3=10,M3=-2,ap=e=>e==="*";function j3(e,t){let n=e.split("/"),r=n.length;return n.some(ap)&&(r+=M3),t&&(r+=R3),n.filter(o=>!ap(o)).reduce((o,A)=>o+(F3.test(A)?N3:A===""?k3:P3),r)}function V3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function G3(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},A="/",s=[];for(let a=0;a<r.length;++a){let i=r[a],l=a===r.length-1,u=A==="/"?t:t.slice(A.length)||"/",d=hl({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},u),f=i.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=hl({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},u)),!d)return null;Object.assign(o,d.params),s.push({params:o,pathname:Gr([A,d.pathname]),pathnameBase:J3(Gr([A,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(A=Gr([A,d.pathnameBase]))}return s}function hl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=H3(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let A=o[0],s=A.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:B}=u;if(f==="*"){let C=a[d]||"";s=A.slice(0,A.length-C.length).replace(/(.)\/+$/,"$1")}const I=a[d];return B&&!I?l[f]=void 0:l[f]=(I||"").replace(/%2F/g,"/"),l},{}),pathname:A,pathnameBase:s,pattern:e}}function H3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),sn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,i)=>(r.push({paramName:a,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function W3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return sn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function z3(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Lo(e):e;return{pathname:n?n.startsWith("/")?n:Y3(n,t):t,search:X3(r),hash:q3(o)}}function Y3(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ug(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ip(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gg(e,t){let n=ip(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dg(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Lo(e):(o=kt({},e),Fe(!o.pathname||!o.pathname.includes("?"),ug("?","pathname","search",o)),Fe(!o.pathname||!o.pathname.includes("#"),ug("#","pathname","hash",o)),Fe(!o.search||!o.search.includes("#"),ug("#","search","hash",o)));let A=e===""||o.pathname==="",s=A?"/":o.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?t[d]:"/"}let i=z3(o,a),l=s&&s!=="/"&&s.endsWith("/"),u=(A||s===".")&&n.endsWith("/");return!i.pathname.endsWith("/")&&(l||u)&&(i.pathname+="/"),i}const Gr=e=>e.join("/").replace(/\/\/+/g,"/"),J3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,q3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ql{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ml(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lp=["post","put","patch","delete"],Z3=new Set(lp),U3=["get",...lp],$3=new Set(U3),K3=new Set([301,302,303,307,308]),eS=new Set([307,308]),Cg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ma={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Eg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nS=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cp="remix-router-transitions";function rS(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;o=H=>({hasErrorBoundary:k(H)})}else o=nS;let A={},s=Qa(e.routes,o,void 0,A),a,i=e.basename||"/",l=e.unstable_dataStrategy||lS,u=e.unstable_patchRoutesOnNavigation,d=kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,B=new Set,I=1e3,C=new Set,E=null,h=null,p=null,Q=e.hydrationData!=null,y=fA(s,e.history.location,i),b=null;if(y==null&&!u){let k=Ln(404,{pathname:e.history.location.pathname}),{matches:H,route:U}=Qp(s);y=H,b={[U.id]:k}}y&&!e.hydrationData&&nn(y,s,e.history.location.pathname).active&&(y=null);let v;if(y)if(y.some(k=>k.route.lazy))v=!1;else if(!y.some(k=>k.route.loader))v=!0;else if(d.v7_partialHydration){let k=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null,U=T=>T.route.loader?typeof T.route.loader=="function"&&T.route.loader.hydrate===!0?!1:k&&k[T.route.id]!==void 0||H&&H[T.route.id]!==void 0:!0;if(H){let T=y.findIndex(J=>H[J.route.id]!==void 0);v=y.slice(0,T+1).every(U)}else v=y.every(U)}else v=e.hydrationData!=null;else if(v=!1,y=[],d.v7_partialHydration){let k=nn(null,s,e.history.location.pathname);k.active&&k.matches&&(y=k.matches)}let w,x={historyAction:e.history.action,location:e.history.location,matches:y,initialized:v,navigation:Cg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},S=Ut.Pop,R=!1,O,N=!1,W=new Map,L=null,X=!1,oe=!1,ne=[],de=new Set,q=new Map,M=0,F=-1,D=new Map,j=new Set,G=new Map,Z=new Map,re=new Set,$=new Map,ce=new Map,K=new Map,le;function Le(){if(f=e.history.listen(k=>{let{action:H,location:U,delta:T}=k;if(le){le(),le=void 0;return}sn(ce.size===0||T!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let J=xt({currentLocation:x.location,nextLocation:U,historyAction:H});if(J&&T!=null){let ae=new Promise(fe=>{le=fe});e.history.go(T*-1),at(J,{state:"blocked",location:U,proceed(){at(J,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ae.then(()=>e.history.go(T))},reset(){let fe=new Map(x.blockers);fe.set(J,ma),ve({blockers:fe})}});return}return Lt(H,U)}),n){bS(t,W);let k=()=>xS(t,W);t.addEventListener("pagehide",k),L=()=>t.removeEventListener("pagehide",k)}return x.initialized||Lt(Ut.Pop,x.location,{initialHydration:!0}),w}function Y(){f&&f(),L&&L(),B.clear(),O&&O.abort(),x.fetchers.forEach((k,H)=>io(H)),x.blockers.forEach((k,H)=>Rt(H))}function je(k){return B.add(k),()=>B.delete(k)}function ve(k,H){H===void 0&&(H={}),x=kt({},x,k);let U=[],T=[];d.v7_fetcherPersist&&x.fetchers.forEach((J,ae)=>{J.state==="idle"&&(re.has(ae)?T.push(ae):U.push(ae))}),[...B].forEach(J=>J(x,{deletedFetchers:T,unstable_viewTransitionOpts:H.viewTransitionOpts,unstable_flushSync:H.flushSync===!0})),d.v7_fetcherPersist&&(U.forEach(J=>x.fetchers.delete(J)),T.forEach(J=>io(J)))}function Ue(k,H,U){var T,J;let{flushSync:ae}=U===void 0?{}:U,fe=x.actionData!=null&&x.navigation.formMethod!=null&&vr(x.navigation.formMethod)&&x.navigation.state==="loading"&&((T=k.state)==null?void 0:T._isRedirect)!==!0,ge;H.actionData?Object.keys(H.actionData).length>0?ge=H.actionData:ge=null:fe?ge=x.actionData:ge=null;let Qe=H.loaderData?Bp(x.loaderData,H.loaderData,H.matches||[],H.errors):x.loaderData,Ee=x.blockers;Ee.size>0&&(Ee=new Map(Ee),Ee.forEach((Re,Ge)=>Ee.set(Ge,ma)));let Ce=R===!0||x.navigation.formMethod!=null&&vr(x.navigation.formMethod)&&((J=k.state)==null?void 0:J._isRedirect)!==!0;a&&(s=a,a=void 0),X||S===Ut.Pop||(S===Ut.Push?e.history.push(k,k.state):S===Ut.Replace&&e.history.replace(k,k.state));let Ve;if(S===Ut.Pop){let Re=W.get(x.location.pathname);Re&&Re.has(k.pathname)?Ve={currentLocation:x.location,nextLocation:k}:W.has(k.pathname)&&(Ve={currentLocation:k,nextLocation:x.location})}else if(N){let Re=W.get(x.location.pathname);Re?Re.add(k.pathname):(Re=new Set([k.pathname]),W.set(x.location.pathname,Re)),Ve={currentLocation:x.location,nextLocation:k}}ve(kt({},H,{actionData:ge,loaderData:Qe,historyAction:S,location:k,initialized:!0,navigation:Cg,revalidation:"idle",restoreScrollPosition:Xn(k,H.matches||x.matches),preventScrollReset:Ce,blockers:Ee}),{viewTransitionOpts:Ve,flushSync:ae===!0}),S=Ut.Pop,R=!1,N=!1,X=!1,oe=!1,ne=[]}async function bt(k,H){if(typeof k=="number"){e.history.go(k);return}let U=fg(x.location,x.matches,i,d.v7_prependBasename,k,d.v7_relativeSplatPath,H==null?void 0:H.fromRouteId,H==null?void 0:H.relative),{path:T,submission:J,error:ae}=up(d.v7_normalizeFormMethod,!1,U,H),fe=x.location,ge=ha(x.location,T,H&&H.state);ge=kt({},ge,e.history.encodeLocation(ge));let Qe=H&&H.replace!=null?H.replace:void 0,Ee=Ut.Push;Qe===!0?Ee=Ut.Replace:Qe===!1||J!=null&&vr(J.formMethod)&&J.formAction===x.location.pathname+x.location.search&&(Ee=Ut.Replace);let Ce=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,Ve=(H&&H.unstable_flushSync)===!0,Re=xt({currentLocation:fe,nextLocation:ge,historyAction:Ee});if(Re){at(Re,{state:"blocked",location:ge,proceed(){at(Re,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),bt(k,H)},reset(){let Ge=new Map(x.blockers);Ge.set(Re,ma),ve({blockers:Ge})}});return}return await Lt(Ee,ge,{submission:J,pendingError:ae,preventScrollReset:Ce,replace:H&&H.replace,enableViewTransition:H&&H.unstable_viewTransition,flushSync:Ve})}function En(){if(wn(),ve({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){Lt(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}Lt(S||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:N===!0})}}async function Lt(k,H,U){O&&O.abort(),O=null,S=k,X=(U&&U.startUninterruptedRevalidation)===!0,fn(x.location,x.matches),R=(U&&U.preventScrollReset)===!0,N=(U&&U.enableViewTransition)===!0;let T=a||s,J=U&&U.overrideNavigation,ae=fA(T,H,i),fe=(U&&U.flushSync)===!0,ge=nn(ae,T,H.pathname);if(ge.active&&ge.matches&&(ae=ge.matches),!ae){let{error:He,notFoundMatches:St,route:dt}=jt(H.pathname);Ue(H,{matches:St,loaderData:{},errors:{[dt.id]:He}},{flushSync:fe});return}if(x.initialized&&!oe&&ES(x.location,H)&&!(U&&U.submission&&vr(U.submission.formMethod))){Ue(H,{matches:ae},{flushSync:fe});return}O=new AbortController;let Qe=$A(e.history,H,O.signal,U&&U.submission),Ee;if(U&&U.pendingError)Ee=[KA(ae).route.id,{type:vt.error,error:U.pendingError}];else if(U&&U.submission&&vr(U.submission.formMethod)){let He=await Xt(Qe,H,U.submission,ae,ge.active,{replace:U.replace,flushSync:fe});if(He.shortCircuited)return;if(He.pendingActionResult){let[St,dt]=He.pendingActionResult;if(rr(dt)&&ml(dt.error)&&dt.error.status===404){O=null,Ue(H,{matches:He.matches,loaderData:{},errors:{[St]:dt.error}});return}}ae=He.matches||ae,Ee=He.pendingActionResult,J=hg(H,U.submission),fe=!1,ge.active=!1,Qe=$A(e.history,Qe.url,Qe.signal)}let{shortCircuited:Ce,matches:Ve,loaderData:Re,errors:Ge}=await yt(Qe,H,ae,ge.active,J,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,fe,Ee);Ce||(O=null,Ue(H,kt({matches:Ve||ae},hp(Ee),{loaderData:Re,errors:Ge})))}async function Xt(k,H,U,T,J,ae){ae===void 0&&(ae={}),wn();let fe=mS(H,U);if(ve({navigation:fe},{flushSync:ae.flushSync===!0}),J){let Ee=await Ft(T,H.pathname,k.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){let{boundaryId:Ce,error:Ve}=Vt(H.pathname,Ee);return{matches:Ee.partialMatches,pendingActionResult:[Ce,{type:vt.error,error:Ve}]}}else if(Ee.matches)T=Ee.matches;else{let{notFoundMatches:Ce,error:Ve,route:Re}=jt(H.pathname);return{matches:Ce,pendingActionResult:[Re.id,{type:vt.error,error:Ve}]}}}let ge,Qe=ya(T,H);if(!Qe.route.action&&!Qe.route.lazy)ge={type:vt.error,error:Ln(405,{method:k.method,pathname:H.pathname,routeId:Qe.route.id})};else if(ge=(await en("action",x,k,[Qe],T,null))[Qe.route.id],k.signal.aborted)return{shortCircuited:!0};if(IA(ge)){let Ee;return ae&&ae.replace!=null?Ee=ae.replace:Ee=fp(ge.response.headers.get("Location"),new URL(k.url),i)===x.location.pathname+x.location.search,await Jn(k,ge,!0,{submission:U,replace:Ee}),{shortCircuited:!0}}if(Fo(ge))throw Ln(400,{type:"defer-action"});if(rr(ge)){let Ee=KA(T,Qe.route.id);return(ae&&ae.replace)!==!0&&(S=Ut.Push),{matches:T,pendingActionResult:[Ee.route.id,ge]}}return{matches:T,pendingActionResult:[Qe.route.id,ge]}}async function yt(k,H,U,T,J,ae,fe,ge,Qe,Ee,Ce){let Ve=J||hg(H,ae),Re=ae||fe||xp(Ve),Ge=!X&&(!d.v7_partialHydration||!Qe);if(T){if(Ge){let te=xn(Ce);ve(kt({navigation:Ve},te!==void 0?{actionData:te}:{}),{flushSync:Ee})}let z=await Ft(U,H.pathname,k.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){let{boundaryId:te,error:ie}=Vt(H.pathname,z);return{matches:z.partialMatches,loaderData:{},errors:{[te]:ie}}}else if(z.matches)U=z.matches;else{let{error:te,notFoundMatches:ie,route:ue}=jt(H.pathname);return{matches:ie,loaderData:{},errors:{[ue.id]:te}}}}let He=a||s,[St,dt]=gp(e.history,x,U,Re,H,d.v7_partialHydration&&Qe===!0,d.v7_skipActionErrorRevalidation,oe,ne,de,re,G,j,He,i,Ce);if(hn(z=>!(U&&U.some(te=>te.route.id===z))||St&&St.some(te=>te.route.id===z)),F=++M,St.length===0&&dt.length===0){let z=Se();return Ue(H,kt({matches:U,loaderData:{},errors:Ce&&rr(Ce[1])?{[Ce[0]]:Ce[1].error}:null},hp(Ce),z?{fetchers:new Map(x.fetchers)}:{}),{flushSync:Ee}),{shortCircuited:!0}}if(Ge){let z={};if(!T){z.navigation=Ve;let te=xn(Ce);te!==void 0&&(z.actionData=te)}dt.length>0&&(z.fetchers=vn(dt)),ve(z,{flushSync:Ee})}dt.forEach(z=>{q.has(z.key)&&Tn(z.key),z.controller&&q.set(z.key,z.controller)});let Jt=()=>dt.forEach(z=>Tn(z.key));O&&O.signal.addEventListener("abort",Jt);let{loaderResults:On,fetcherResults:lo}=await ar(x,U,St,dt,k);if(k.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Jt),dt.forEach(z=>q.delete(z.key));let pr=yl(On);if(pr)return await Jn(k,pr.result,!0,{replace:ge}),{shortCircuited:!0};if(pr=yl(lo),pr)return j.add(pr.key),await Jn(k,pr.result,!0,{replace:ge}),{shortCircuited:!0};let{loaderData:$s,errors:Br}=pp(x,U,St,On,Ce,dt,lo,$);$.forEach((z,te)=>{z.subscribe(ie=>{(ie||z.done)&&$.delete(te)})}),d.v7_partialHydration&&Qe&&x.errors&&Object.entries(x.errors).filter(z=>{let[te]=z;return!St.some(ie=>ie.route.id===te)}).forEach(z=>{let[te,ie]=z;Br=Object.assign(Br||{},{[te]:ie})});let Ae=Se(),P=kr(F),ee=Ae||P||dt.length>0;return kt({matches:U,loaderData:$s,errors:Br},ee?{fetchers:new Map(x.fetchers)}:{})}function xn(k){if(k&&!rr(k[1]))return{[k[0]]:k[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function vn(k){return k.forEach(H=>{let U=x.fetchers.get(H.key),T=ba(void 0,U?U.data:void 0);x.fetchers.set(H.key,T)}),new Map(x.fetchers)}function Ko(k,H,U,T){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");q.has(k)&&Tn(k);let J=(T&&T.unstable_flushSync)===!0,ae=a||s,fe=fg(x.location,x.matches,i,d.v7_prependBasename,U,d.v7_relativeSplatPath,H,T==null?void 0:T.relative),ge=fA(ae,fe,i),Qe=nn(ge,ae,fe);if(Qe.active&&Qe.matches&&(ge=Qe.matches),!ge){Nt(k,H,Ln(404,{pathname:fe}),{flushSync:J});return}let{path:Ee,submission:Ce,error:Ve}=up(d.v7_normalizeFormMethod,!0,fe,T);if(Ve){Nt(k,H,Ve,{flushSync:J});return}let Re=ya(ge,Ee);if(R=(T&&T.preventScrollReset)===!0,Ce&&vr(Ce.formMethod)){eA(k,H,Ee,Re,ge,Qe.active,J,Ce);return}G.set(k,{routeId:H,path:Ee}),tA(k,H,Ee,Re,ge,Qe.active,J,Ce)}async function eA(k,H,U,T,J,ae,fe,ge){wn(),G.delete(k);function Qe(ue){if(!ue.route.action&&!ue.route.lazy){let Be=Ln(405,{method:ge.formMethod,pathname:U,routeId:H});return Nt(k,H,Be,{flushSync:fe}),!0}return!1}if(!ae&&Qe(T))return;let Ee=x.fetchers.get(k);Sn(k,yS(ge,Ee),{flushSync:fe});let Ce=new AbortController,Ve=$A(e.history,U,Ce.signal,ge);if(ae){let ue=await Ft(J,U,Ve.signal);if(ue.type==="aborted")return;if(ue.type==="error"){let{error:Be}=Vt(U,ue);Nt(k,H,Be,{flushSync:fe});return}else if(ue.matches){if(J=ue.matches,T=ya(J,U),Qe(T))return}else{Nt(k,H,Ln(404,{pathname:U}),{flushSync:fe});return}}q.set(k,Ce);let Re=M,He=(await en("action",x,Ve,[T],J,k))[T.route.id];if(Ve.signal.aborted){q.get(k)===Ce&&q.delete(k);return}if(d.v7_fetcherPersist&&re.has(k)){if(IA(He)||rr(He)){Sn(k,No(void 0));return}}else{if(IA(He))if(q.delete(k),F>Re){Sn(k,No(void 0));return}else return j.add(k),Sn(k,ba(ge)),Jn(Ve,He,!1,{fetcherSubmission:ge});if(rr(He)){Nt(k,H,He.error);return}}if(Fo(He))throw Ln(400,{type:"defer-action"});let St=x.navigation.location||x.location,dt=$A(e.history,St,Ce.signal),Jt=a||s,On=x.navigation.state!=="idle"?fA(Jt,x.navigation.location,i):x.matches;Fe(On,"Didn't find any matches after fetcher action");let lo=++M;D.set(k,lo);let pr=ba(ge,He.data);x.fetchers.set(k,pr);let[$s,Br]=gp(e.history,x,On,ge,St,!1,d.v7_skipActionErrorRevalidation,oe,ne,de,re,G,j,Jt,i,[T.route.id,He]);Br.filter(ue=>ue.key!==k).forEach(ue=>{let Be=ue.key,Ie=x.fetchers.get(Be),he=ba(void 0,Ie?Ie.data:void 0);x.fetchers.set(Be,he),q.has(Be)&&Tn(Be),ue.controller&&q.set(Be,ue.controller)}),ve({fetchers:new Map(x.fetchers)});let Ae=()=>Br.forEach(ue=>Tn(ue.key));Ce.signal.addEventListener("abort",Ae);let{loaderResults:P,fetcherResults:ee}=await ar(x,On,$s,Br,dt);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",Ae),D.delete(k),q.delete(k),Br.forEach(ue=>q.delete(ue.key));let z=yl(P);if(z)return Jn(dt,z.result,!1);if(z=yl(ee),z)return j.add(z.key),Jn(dt,z.result,!1);let{loaderData:te,errors:ie}=pp(x,On,$s,P,void 0,Br,ee,$);if(x.fetchers.has(k)){let ue=No(He.data);x.fetchers.set(k,ue)}kr(lo),x.navigation.state==="loading"&&lo>F?(Fe(S,"Expected pending action"),O&&O.abort(),Ue(x.navigation.location,{matches:On,loaderData:te,errors:ie,fetchers:new Map(x.fetchers)})):(ve({errors:ie,loaderData:Bp(x.loaderData,te,On,ie),fetchers:new Map(x.fetchers)}),oe=!1)}async function tA(k,H,U,T,J,ae,fe,ge){let Qe=x.fetchers.get(k);Sn(k,ba(ge,Qe?Qe.data:void 0),{flushSync:fe});let Ee=new AbortController,Ce=$A(e.history,U,Ee.signal);if(ae){let He=await Ft(J,U,Ce.signal);if(He.type==="aborted")return;if(He.type==="error"){let{error:St}=Vt(U,He);Nt(k,H,St,{flushSync:fe});return}else if(He.matches)J=He.matches,T=ya(J,U);else{Nt(k,H,Ln(404,{pathname:U}),{flushSync:fe});return}}q.set(k,Ee);let Ve=M,Ge=(await en("loader",x,Ce,[T],J,k))[T.route.id];if(Fo(Ge)&&(Ge=await pg(Ge,Ce.signal,!0)||Ge),q.get(k)===Ee&&q.delete(k),!Ce.signal.aborted){if(re.has(k)){Sn(k,No(void 0));return}if(IA(Ge))if(F>Ve){Sn(k,No(void 0));return}else{j.add(k),await Jn(Ce,Ge,!1);return}if(rr(Ge)){Nt(k,H,Ge.error);return}Fe(!Fo(Ge),"Unhandled fetcher deferred data"),Sn(k,No(Ge.data))}}async function Jn(k,H,U,T){let{submission:J,fetcherSubmission:ae,replace:fe}=T===void 0?{}:T;H.response.headers.has("X-Remix-Revalidate")&&(oe=!0);let ge=H.response.headers.get("Location");Fe(ge,"Expected a Location header on the redirect Response"),ge=fp(ge,new URL(k.url),i);let Qe=ha(x.location,ge,{_isRedirect:!0});if(n){let He=!1;if(H.response.headers.has("X-Remix-Reload-Document"))He=!0;else if(Eg.test(ge)){const St=e.history.createURL(ge);He=St.origin!==t.location.origin||xr(St.pathname,i)==null}if(He){fe?t.location.replace(ge):t.location.assign(ge);return}}O=null;let Ee=fe===!0||H.response.headers.has("X-Remix-Replace")?Ut.Replace:Ut.Push,{formMethod:Ce,formAction:Ve,formEncType:Re}=x.navigation;!J&&!ae&&Ce&&Ve&&Re&&(J=xp(x.navigation));let Ge=J||ae;if(eS.has(H.response.status)&&Ge&&vr(Ge.formMethod))await Lt(Ee,Qe,{submission:kt({},Ge,{formAction:ge}),preventScrollReset:R,enableViewTransition:U?N:void 0});else{let He=hg(Qe,J);await Lt(Ee,Qe,{overrideNavigation:He,fetcherSubmission:ae,preventScrollReset:R,enableViewTransition:U?N:void 0})}}async function en(k,H,U,T,J,ae){let fe,ge={};try{fe=await cS(l,k,H,U,T,J,ae,A,o)}catch(Qe){return T.forEach(Ee=>{ge[Ee.route.id]={type:vt.error,error:Qe}}),ge}for(let[Qe,Ee]of Object.entries(fe))if(IS(Ee)){let Ce=Ee.result;ge[Qe]={type:vt.redirect,response:dS(Ce,U,Qe,J,i,d.v7_relativeSplatPath)}}else ge[Qe]=await gS(Ee);return ge}async function ar(k,H,U,T,J){let ae=k.matches,fe=en("loader",k,J,U,H,null),ge=Promise.all(T.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.controller){let Re=(await en("loader",k,$A(e.history,Ce.path,Ce.controller.signal),[Ce.match],Ce.matches,Ce.key))[Ce.match.route.id];return{[Ce.key]:Re}}else return Promise.resolve({[Ce.key]:{type:vt.error,error:Ln(404,{pathname:Ce.path})}})})),Qe=await fe,Ee=(await ge).reduce((Ce,Ve)=>Object.assign(Ce,Ve),{});return await Promise.all([hS(H,Qe,J.signal,ae,k.loaderData),QS(H,Ee,T)]),{loaderResults:Qe,fetcherResults:Ee}}function wn(){oe=!0,ne.push(...hn()),G.forEach((k,H)=>{q.has(H)&&(de.add(H),Tn(H))})}function Sn(k,H,U){U===void 0&&(U={}),x.fetchers.set(k,H),ve({fetchers:new Map(x.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Nt(k,H,U,T){T===void 0&&(T={});let J=KA(x.matches,H);io(k),ve({errors:{[J.route.id]:U},fetchers:new Map(x.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function yo(k){return d.v7_fetcherPersist&&(Z.set(k,(Z.get(k)||0)+1),re.has(k)&&re.delete(k)),x.fetchers.get(k)||tS}function io(k){let H=x.fetchers.get(k);q.has(k)&&!(H&&H.state==="loading"&&D.has(k))&&Tn(k),G.delete(k),D.delete(k),j.delete(k),re.delete(k),de.delete(k),x.fetchers.delete(k)}function nA(k){if(d.v7_fetcherPersist){let H=(Z.get(k)||0)-1;H<=0?(Z.delete(k),re.add(k)):Z.set(k,H)}else io(k);ve({fetchers:new Map(x.fetchers)})}function Tn(k){let H=q.get(k);Fe(H,"Expected fetch controller: "+k),H.abort(),q.delete(k)}function bo(k){for(let H of k){let U=yo(H),T=No(U.data);x.fetchers.set(H,T)}}function Se(){let k=[],H=!1;for(let U of j){let T=x.fetchers.get(U);Fe(T,"Expected fetcher: "+U),T.state==="loading"&&(j.delete(U),k.push(U),H=!0)}return bo(k),H}function kr(k){let H=[];for(let[U,T]of D)if(T<k){let J=x.fetchers.get(U);Fe(J,"Expected fetcher: "+U),J.state==="loading"&&(Tn(U),D.delete(U),H.push(U))}return bo(H),H.length>0}function Ir(k,H){let U=x.blockers.get(k)||ma;return ce.get(k)!==H&&ce.set(k,H),U}function Rt(k){x.blockers.delete(k),ce.delete(k)}function at(k,H){let U=x.blockers.get(k)||ma;Fe(U.state==="unblocked"&&H.state==="blocked"||U.state==="blocked"&&H.state==="blocked"||U.state==="blocked"&&H.state==="proceeding"||U.state==="blocked"&&H.state==="unblocked"||U.state==="proceeding"&&H.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+H.state);let T=new Map(x.blockers);T.set(k,H),ve({blockers:T})}function xt(k){let{currentLocation:H,nextLocation:U,historyAction:T}=k;if(ce.size===0)return;ce.size>1&&sn(!1,"A router only supports one blocker at a time");let J=Array.from(ce.entries()),[ae,fe]=J[J.length-1],ge=x.blockers.get(ae);if(!(ge&&ge.state==="proceeding")&&fe({currentLocation:H,nextLocation:U,historyAction:T}))return ae}function jt(k){let H=Ln(404,{pathname:k}),U=a||s,{matches:T,route:J}=Qp(U);return hn(),{notFoundMatches:T,route:J,error:H}}function Vt(k,H){return{boundaryId:KA(H.partialMatches).route.id,error:Ln(400,{type:"route-discovery",pathname:k,message:H.error!=null&&"message"in H.error?H.error:String(H.error)})}}function hn(k){let H=[];return $.forEach((U,T)=>{(!k||k(T))&&(U.cancel(),H.push(T),$.delete(T))}),H}function qt(k,H,U){if(E=k,p=H,h=U||null,!Q&&x.navigation===Cg){Q=!0;let T=Xn(x.location,x.matches);T!=null&&ve({restoreScrollPosition:T})}return()=>{E=null,p=null,h=null}}function tn(k,H){return h&&h(k,H.map(T=>D3(T,x.loaderData)))||k.key}function fn(k,H){if(E&&p){let U=tn(k,H);E[U]=p()}}function Xn(k,H){if(E){let U=tn(k,H),T=E[U];if(typeof T=="number")return T}return null}function nn(k,H,U){if(u){if(C.has(U))return{active:!1,matches:k};if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:Bl(H,U,i,!0)}}else return{active:!0,matches:Bl(H,U,i,!0)||[]}}return{active:!1,matches:null}}async function Ft(k,H,U){let T=k;for(;;){let J=a==null,ae=a||s;try{await aS(u,H,T,ae,A,o,K,U)}catch(Qe){return{type:"error",error:Qe,partialMatches:T}}finally{J&&(s=[...s])}if(U.aborted)return{type:"aborted"};let fe=fA(ae,H,i);if(fe)return ir(H,C),{type:"success",matches:fe};let ge=Bl(ae,H,i,!0);if(!ge||T.length===ge.length&&T.every((Qe,Ee)=>Qe.route.id===ge[Ee].route.id))return ir(H,C),{type:"success",matches:null};T=ge}}function ir(k,H){if(H.size>=I){let U=H.values().next().value;H.delete(U)}H.add(k)}function lr(k){A={},a=Qa(k,o,void 0,A)}function _n(k,H){let U=a==null;Ep(k,H,a||s,A,o),U&&(s=[...s],ve({}))}return w={get basename(){return i},get future(){return d},get state(){return x},get routes(){return s},get window(){return t},initialize:Le,subscribe:je,enableScrollRestoration:qt,navigate:bt,fetch:Ko,revalidate:En,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:yo,deleteFetcher:nA,dispose:Y,getBlocker:Ir,deleteBlocker:Rt,patchRoutes:_n,_internalFetchControllers:q,_internalActiveDeferreds:$,_internalSetRoutes:lr},w}function oS(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function fg(e,t,n,r,o,A,s,a){let i,l;if(s){i=[];for(let d of t)if(i.push(d),d.route.id===s){l=d;break}}else i=t,l=t[t.length-1];let u=dg(o||".",gg(i,A),xr(e.pathname,n)||e.pathname,a==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&l&&l.route.index&&!Bg(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Gr([n,u.pathname])),Do(u)}function up(e,t,n,r){if(!r||!oS(r))return{path:n};if(r.formMethod&&!BS(r.formMethod))return{path:n,error:Ln(405,{method:r.formMethod})};let o=()=>({path:n,error:Ln(400,{type:"invalid-body"})}),A=r.formMethod||"get",s=e?A.toUpperCase():A.toLowerCase(),a=mp(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!vr(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((B,I)=>{let[C,E]=I;return""+B+C+"="+E+`
77
- `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!vr(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let i,l;if(r.formData)i=Ig(r.formData),l=r.formData;else if(r.body instanceof FormData)i=Ig(r.body),l=r.body;else if(r.body instanceof URLSearchParams)i=r.body,l=Ip(i);else if(r.body==null)i=new URLSearchParams,l=new FormData;else try{i=new URLSearchParams(r.body),l=Ip(i)}catch{return o()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(vr(u.formMethod))return{path:n,submission:u};let d=Lo(n);return t&&d.search&&Bg(d.search)&&i.append("index",""),d.search="?"+i,{path:Do(d),submission:u}}function AS(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function gp(e,t,n,r,o,A,s,a,i,l,u,d,f,B,I,C){let E=C?rr(C[1])?C[1].error:C[1].data:void 0,h=e.createURL(t.location),p=e.createURL(o),Q=C&&rr(C[1])?C[0]:void 0,y=Q?AS(n,Q):n,b=C?C[1].statusCode:void 0,v=s&&b&&b>=400,w=y.filter((S,R)=>{let{route:O}=S;if(O.lazy)return!0;if(O.loader==null)return!1;if(A)return typeof O.loader!="function"||O.loader.hydrate?!0:t.loaderData[O.id]===void 0&&(!t.errors||t.errors[O.id]===void 0);if(sS(t.loaderData,t.matches[R],S)||i.some(L=>L===S.route.id))return!0;let N=t.matches[R],W=S;return Cp(S,kt({currentUrl:h,currentParams:N.params,nextUrl:p,nextParams:W.params},r,{actionResult:E,actionStatus:b,defaultShouldRevalidate:v?!1:a||h.pathname+h.search===p.pathname+p.search||h.search!==p.search||dp(N,W)}))}),x=[];return d.forEach((S,R)=>{if(A||!n.some(X=>X.route.id===S.routeId)||u.has(R))return;let O=fA(B,S.path,I);if(!O){x.push({key:R,routeId:S.routeId,path:S.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(R),W=ya(O,S.path),L=!1;f.has(R)?L=!1:l.has(R)?(l.delete(R),L=!0):N&&N.state!=="idle"&&N.data===void 0?L=a:L=Cp(W,kt({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:E,actionStatus:b,defaultShouldRevalidate:v?!1:a})),L&&x.push({key:R,routeId:S.routeId,path:S.path,matches:O,match:W,controller:new AbortController})}),[w,x]}function sS(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function dp(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Cp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function aS(e,t,n,r,o,A,s,a){let i=[t,...n.map(l=>l.route.id)].join("-");try{let l=s.get(i);l||(l=e({path:t,matches:n,patch:(u,d)=>{a.aborted||Ep(u,d,r,o,A)}}),s.set(i,l)),l&&fS(l)&&await l}finally{s.delete(i)}}function Ep(e,t,n,r,o){if(e){var A;let s=r[e];Fe(s,"No route found to patch children into: routeId = "+e);let a=Qa(t,o,[e,"patch",String(((A=s.children)==null?void 0:A.length)||"0")],r);s.children?s.children.push(...a):s.children=a}else{let s=Qa(t,o,["patch",String(n.length||"0")],r);n.push(...s)}}async function iS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Fe(o,"No route found in manifest");let A={};for(let s in r){let i=o[s]!==void 0&&s!=="hasErrorBoundary";sn(!i,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!i&&!_3.has(s)&&(A[s]=r[s])}Object.assign(o,A),Object.assign(o,kt({},t(o),{lazy:void 0}))}async function lS(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,A,s)=>Object.assign(o,{[n[s].route.id]:A}),{})}async function cS(e,t,n,r,o,A,s,a,i,l){let u=A.map(B=>B.route.lazy?iS(B.route,i,a):void 0),d=A.map((B,I)=>{let C=u[I],E=o.some(p=>p.route.id===B.route.id);return kt({},B,{shouldLoad:E,resolve:async p=>(p&&r.method==="GET"&&(B.route.lazy||B.route.loader)&&(E=!0),E?uS(t,r,B,C,p,l):Promise.resolve({type:vt.data,result:void 0}))})}),f=await e({matches:d,request:r,params:A[0].params,fetcherKey:s,context:l});try{await Promise.all(u)}catch{}return f}async function uS(e,t,n,r,o,A){let s,a,i=l=>{let u,d=new Promise((I,C)=>u=C);a=()=>u(),t.signal.addEventListener("abort",a);let f=I=>typeof l!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):l({request:t,params:n.params,context:A},...I!==void 0?[I]:[]),B=(async()=>{try{return{type:"data",result:await(o?o(C=>f(C)):f())}}catch(I){return{type:"error",result:I}}})();return Promise.race([B,d])};try{let l=n.route[e];if(r)if(l){let u,[d]=await Promise.all([i(l).catch(f=>{u=f}),r]);if(u!==void 0)throw u;s=d}else if(await r,l=n.route[e],l)s=await i(l);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw Ln(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:vt.data,result:void 0};else if(l)s=await i(l);else{let u=new URL(t.url),d=u.pathname+u.search;throw Ln(404,{pathname:d})}Fe(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(l){return{type:vt.error,result:l}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function gS(e){let{result:t,type:n}=e;if(bp(t)){let l;try{let u=t.headers.get("Content-Type");u&&/\bapplication\/json\b/.test(u)?t.body==null?l=null:l=await t.json():l=await t.text()}catch(u){return{type:vt.error,error:u}}return n===vt.error?{type:vt.error,error:new Ql(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:vt.data,data:l,statusCode:t.status,headers:t.headers}}if(n===vt.error){if(yp(t)){var r;if(t.data instanceof Error){var o;return{type:vt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Ql(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:vt.error,error:t,statusCode:ml(t)?t.status:void 0}}if(pS(t)){var A,s;return{type:vt.deferred,deferredData:t,statusCode:(A=t.init)==null?void 0:A.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(yp(t)){var a,i;return{type:vt.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:vt.data,data:t}}function dS(e,t,n,r,o,A){let s=e.headers.get("Location");if(Fe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Eg.test(s)){let a=r.slice(0,r.findIndex(i=>i.route.id===n)+1);s=fg(new URL(t.url),a,o,!0,s,A),e.headers.set("Location",s)}return e}function fp(e,t,n){if(Eg.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),A=xr(o.pathname,n)!=null;if(o.origin===t.origin&&A)return o.pathname+o.search+o.hash}return e}function $A(e,t,n,r){let o=e.createURL(mp(t)).toString(),A={signal:n};if(r&&vr(r.formMethod)){let{formMethod:s,formEncType:a}=r;A.method=s.toUpperCase(),a==="application/json"?(A.headers=new Headers({"Content-Type":a}),A.body=JSON.stringify(r.json)):a==="text/plain"?A.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?A.body=Ig(r.formData):A.body=r.formData}return new Request(o,A)}function Ig(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ip(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function CS(e,t,n,r,o){let A={},s=null,a,i=!1,l={},u=n&&rr(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,B=t[f];if(Fe(!IA(B),"Cannot handle redirect results in processLoaderData"),rr(B)){let I=B.error;u!==void 0&&(I=u,u=void 0),s=s||{};{let C=KA(e,f);s[C.route.id]==null&&(s[C.route.id]=I)}A[f]=void 0,i||(i=!0,a=ml(B.error)?B.error.status:500),B.headers&&(l[f]=B.headers)}else Fo(B)?(r.set(f,B.deferredData),A[f]=B.deferredData.data,B.statusCode!=null&&B.statusCode!==200&&!i&&(a=B.statusCode),B.headers&&(l[f]=B.headers)):(A[f]=B.data,B.statusCode&&B.statusCode!==200&&!i&&(a=B.statusCode),B.headers&&(l[f]=B.headers))}),u!==void 0&&n&&(s={[n[0]]:u},A[n[0]]=void 0),{loaderData:A,errors:s,statusCode:a||200,loaderHeaders:l}}function pp(e,t,n,r,o,A,s,a){let{loaderData:i,errors:l}=CS(t,r,o,a);return A.forEach(u=>{let{key:d,match:f,controller:B}=u,I=s[d];if(Fe(I,"Did not find corresponding fetcher result"),!(B&&B.signal.aborted))if(rr(I)){let C=KA(e.matches,f==null?void 0:f.route.id);l&&l[C.route.id]||(l=kt({},l,{[C.route.id]:I.error})),e.fetchers.delete(d)}else if(IA(I))Fe(!1,"Unhandled fetcher revalidation redirect");else if(Fo(I))Fe(!1,"Unhandled fetcher deferred data");else{let C=No(I.data);e.fetchers.set(d,C)}}),{loaderData:i,errors:l}}function Bp(e,t,n,r){let o=kt({},t);for(let A of n){let s=A.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&A.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function hp(e){return e?rr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function KA(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Qp(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ln(e,t){let{pathname:n,routeId:r,method:o,type:A,message:s}=t===void 0?{}:t,a="Unknown Server Error",i="Unknown @remix-run/router error";return e===400?(a="Bad Request",A==="route-discovery"?i='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
78
- `+s):o&&n&&r?i="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":A==="defer-action"?i="defer() is not supported in actions":A==="invalid-body"&&(i="Unable to encode submission body")):e===403?(a="Forbidden",i='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",i='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?i="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(i='Invalid request method "'+o.toUpperCase()+'"')),new Ql(e||500,a,new Error(i),!0)}function yl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(IA(o))return{key:r,result:o}}}function mp(e){let t=typeof e=="string"?Lo(e):e;return Do(kt({},t,{hash:""}))}function ES(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function fS(e){return typeof e=="object"&&e!=null&&"then"in e}function IS(e){return bp(e.result)&&K3.has(e.result.status)}function Fo(e){return e.type===vt.deferred}function rr(e){return e.type===vt.error}function IA(e){return(e&&e.type)===vt.redirect}function yp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function pS(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function bp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function BS(e){return $3.has(e.toLowerCase())}function vr(e){return Z3.has(e.toLowerCase())}async function hS(e,t,n,r,o){let A=Object.entries(t);for(let s=0;s<A.length;s++){let[a,i]=A[s],l=e.find(f=>(f==null?void 0:f.route.id)===a);if(!l)continue;let u=r.find(f=>f.route.id===l.route.id),d=u!=null&&!dp(u,l)&&(o&&o[l.route.id])!==void 0;Fo(i)&&d&&await pg(i,n,!1).then(f=>{f&&(t[a]=f)})}}async function QS(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:A,controller:s}=n[r],a=t[o];e.find(l=>(l==null?void 0:l.route.id)===A)&&Fo(a)&&(Fe(s,"Expected an AbortController for revalidating fetcher deferred result"),await pg(a,s.signal,!0).then(l=>{l&&(t[o]=l)}))}}async function pg(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:vt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:vt.error,error:o}}return{type:vt.data,data:e.deferredData.data}}}function Bg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ya(e,t){let n=typeof t=="string"?Lo(t).search:t.search;if(e[e.length-1].route.index&&Bg(n||""))return e[e.length-1];let r=ip(e);return r[r.length-1]}function xp(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:A,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(A!=null)return{formMethod:t,formAction:n,formEncType:r,formData:A,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function hg(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mS(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ba(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function yS(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function No(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bS(e,t){try{let n=e.sessionStorage.getItem(cp);if(n){let r=JSON.parse(n);for(let[o,A]of Object.entries(r||{}))A&&Array.isArray(A)&&t.set(o,new Set(A||[]))}}catch{}}function xS(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(cp,JSON.stringify(n))}catch(r){sn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
76
+ */function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}var Ut;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ut||(Ut={}));const rp="popstate";function w3(e){e===void 0&&(e={});function t(r,o){let{pathname:A,search:s,hash:a}=r.location;return ha("",{pathname:A,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Do(o)}return T3(t,n,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function S3(){return Math.random().toString(36).substr(2,8)}function op(e,t){return{usr:e.state,key:e.key,idx:t}}function ha(e,t,n,r){return n===void 0&&(n=null),kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Lo(t):t,{state:n,key:t&&t.key||r||S3()})}function Do(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Lo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function T3(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:A=!1}=r,s=o.history,a=Ut.Pop,i=null,l=u();l==null&&(l=0,s.replaceState(kt({},s.state,{idx:l}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=Ut.Pop;let E=u(),h=E==null?null:E-l;l=E,i&&i({action:a,location:C.location,delta:h})}function f(E,h){a=Ut.Push;let p=ha(C.location,E,h);l=u()+1;let Q=op(p,l),y=C.createHref(p);try{s.pushState(Q,"",y)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;o.location.assign(y)}A&&i&&i({action:a,location:C.location,delta:1})}function B(E,h){a=Ut.Replace;let p=ha(C.location,E,h);l=u();let Q=op(p,l),y=C.createHref(p);s.replaceState(Q,"",y),A&&i&&i({action:a,location:C.location,delta:0})}function I(E){let h=o.location.origin!=="null"?o.location.origin:o.location.href,p=typeof E=="string"?E:Do(E);return p=p.replace(/ $/,"%20"),Fe(h,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,h)}let C={get action(){return a},get location(){return e(o,s)},listen(E){if(i)throw new Error("A history only accepts one active listener");return o.addEventListener(rp,d),i=E,()=>{o.removeEventListener(rp,d),i=null}},createHref(E){return t(o,E)},createURL:I,encodeLocation(E){let h=I(E);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:B,go(E){return s.go(E)}};return C}var vt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vt||(vt={}));const _3=new Set(["lazy","caseSensitive","path","id","index","children"]);function O3(e){return e.index===!0}function Qa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,A)=>{let s=[...n,String(A)],a=typeof o.id=="string"?o.id:s.join("-");if(Fe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Fe(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),O3(o)){let i=kt({},o,t(o),{id:a});return r[a]=i,i}else{let i=kt({},o,t(o),{id:a,children:void 0});return r[a]=i,o.children&&(i.children=Qa(o.children,t,s,r)),i}})}function fA(e,t,n){return n===void 0&&(n="/"),Bl(e,t,n,!1)}function Bl(e,t,n,r){let o=typeof t=="string"?Lo(t):t,A=xr(o.pathname||"/",n);if(A==null)return null;let s=Ap(e);L3(s);let a=null;for(let i=0;a==null&&i<s.length;++i){let l=W3(A);a=G3(s[i],l,r)}return a}function D3(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Ap(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(A,s,a)=>{let i={relativePath:a===void 0?A.path||"":a,caseSensitive:A.caseSensitive===!0,childrenIndex:s,route:A};i.relativePath.startsWith("/")&&(Fe(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),i.relativePath=i.relativePath.slice(r.length));let l=Gr([r,i.relativePath]),u=n.concat(i);A.children&&A.children.length>0&&(Fe(A.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),Ap(A.children,t,u,l)),!(A.path==null&&!A.index)&&t.push({path:l,score:j3(l,A.index),routesMeta:u})};return e.forEach((A,s)=>{var a;if(A.path===""||!((a=A.path)!=null&&a.includes("?")))o(A,s);else for(let i of sp(A.path))o(A,s,i)}),t}function sp(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),A=n.replace(/\?$/,"");if(r.length===0)return o?[A,""]:[A];let s=sp(r.join("/")),a=[];return a.push(...s.map(i=>i===""?A:[A,i].join("/"))),o&&a.push(...s),a.map(i=>e.startsWith("/")&&i===""?"/":i)}function L3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:V3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const F3=/^:[\w-]+$/,N3=3,R3=2,k3=1,P3=10,M3=-2,ap=e=>e==="*";function j3(e,t){let n=e.split("/"),r=n.length;return n.some(ap)&&(r+=M3),t&&(r+=R3),n.filter(o=>!ap(o)).reduce((o,A)=>o+(F3.test(A)?N3:A===""?k3:P3),r)}function V3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function G3(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},A="/",s=[];for(let a=0;a<r.length;++a){let i=r[a],l=a===r.length-1,u=A==="/"?t:t.slice(A.length)||"/",d=hl({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},u),f=i.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=hl({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},u)),!d)return null;Object.assign(o,d.params),s.push({params:o,pathname:Gr([A,d.pathname]),pathnameBase:J3(Gr([A,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(A=Gr([A,d.pathnameBase]))}return s}function hl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=H3(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let A=o[0],s=A.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:B}=u;if(f==="*"){let C=a[d]||"";s=A.slice(0,A.length-C.length).replace(/(.)\/+$/,"$1")}const I=a[d];return B&&!I?l[f]=void 0:l[f]=(I||"").replace(/%2F/g,"/"),l},{}),pathname:A,pathnameBase:s,pattern:e}}function H3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),sn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,i)=>(r.push({paramName:a,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function W3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return sn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function z3(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Lo(e):e;return{pathname:n?n.startsWith("/")?n:Y3(n,t):t,search:X3(r),hash:q3(o)}}function Y3(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ug(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ip(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gg(e,t){let n=ip(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dg(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Lo(e):(o=kt({},e),Fe(!o.pathname||!o.pathname.includes("?"),ug("?","pathname","search",o)),Fe(!o.pathname||!o.pathname.includes("#"),ug("#","pathname","hash",o)),Fe(!o.search||!o.search.includes("#"),ug("#","search","hash",o)));let A=e===""||o.pathname==="",s=A?"/":o.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?t[d]:"/"}let i=z3(o,a),l=s&&s!=="/"&&s.endsWith("/"),u=(A||s===".")&&n.endsWith("/");return!i.pathname.endsWith("/")&&(l||u)&&(i.pathname+="/"),i}const Gr=e=>e.join("/").replace(/\/\/+/g,"/"),J3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,q3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ql{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ml(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lp=["post","put","patch","delete"],Z3=new Set(lp),U3=["get",...lp],$3=new Set(U3),K3=new Set([301,302,303,307,308]),e4=new Set([307,308]),Cg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},t4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ma={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Eg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,n4=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cp="remix-router-transitions";function r4(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;o=H=>({hasErrorBoundary:k(H)})}else o=n4;let A={},s=Qa(e.routes,o,void 0,A),a,i=e.basename||"/",l=e.unstable_dataStrategy||l4,u=e.unstable_patchRoutesOnNavigation,d=kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,B=new Set,I=1e3,C=new Set,E=null,h=null,p=null,Q=e.hydrationData!=null,y=fA(s,e.history.location,i),b=null;if(y==null&&!u){let k=Ln(404,{pathname:e.history.location.pathname}),{matches:H,route:U}=Qp(s);y=H,b={[U.id]:k}}y&&!e.hydrationData&&nn(y,s,e.history.location.pathname).active&&(y=null);let v;if(y)if(y.some(k=>k.route.lazy))v=!1;else if(!y.some(k=>k.route.loader))v=!0;else if(d.v7_partialHydration){let k=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null,U=T=>T.route.loader?typeof T.route.loader=="function"&&T.route.loader.hydrate===!0?!1:k&&k[T.route.id]!==void 0||H&&H[T.route.id]!==void 0:!0;if(H){let T=y.findIndex(J=>H[J.route.id]!==void 0);v=y.slice(0,T+1).every(U)}else v=y.every(U)}else v=e.hydrationData!=null;else if(v=!1,y=[],d.v7_partialHydration){let k=nn(null,s,e.history.location.pathname);k.active&&k.matches&&(y=k.matches)}let w,x={historyAction:e.history.action,location:e.history.location,matches:y,initialized:v,navigation:Cg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},S=Ut.Pop,R=!1,O,N=!1,W=new Map,L=null,X=!1,oe=!1,ne=[],de=new Set,q=new Map,M=0,F=-1,D=new Map,j=new Set,G=new Map,Z=new Map,re=new Set,$=new Map,ce=new Map,K=new Map,le;function Le(){if(f=e.history.listen(k=>{let{action:H,location:U,delta:T}=k;if(le){le(),le=void 0;return}sn(ce.size===0||T!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let J=xt({currentLocation:x.location,nextLocation:U,historyAction:H});if(J&&T!=null){let ae=new Promise(fe=>{le=fe});e.history.go(T*-1),at(J,{state:"blocked",location:U,proceed(){at(J,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ae.then(()=>e.history.go(T))},reset(){let fe=new Map(x.blockers);fe.set(J,ma),ve({blockers:fe})}});return}return Lt(H,U)}),n){b4(t,W);let k=()=>x4(t,W);t.addEventListener("pagehide",k),L=()=>t.removeEventListener("pagehide",k)}return x.initialized||Lt(Ut.Pop,x.location,{initialHydration:!0}),w}function Y(){f&&f(),L&&L(),B.clear(),O&&O.abort(),x.fetchers.forEach((k,H)=>io(H)),x.blockers.forEach((k,H)=>Rt(H))}function je(k){return B.add(k),()=>B.delete(k)}function ve(k,H){H===void 0&&(H={}),x=kt({},x,k);let U=[],T=[];d.v7_fetcherPersist&&x.fetchers.forEach((J,ae)=>{J.state==="idle"&&(re.has(ae)?T.push(ae):U.push(ae))}),[...B].forEach(J=>J(x,{deletedFetchers:T,unstable_viewTransitionOpts:H.viewTransitionOpts,unstable_flushSync:H.flushSync===!0})),d.v7_fetcherPersist&&(U.forEach(J=>x.fetchers.delete(J)),T.forEach(J=>io(J)))}function Ue(k,H,U){var T,J;let{flushSync:ae}=U===void 0?{}:U,fe=x.actionData!=null&&x.navigation.formMethod!=null&&vr(x.navigation.formMethod)&&x.navigation.state==="loading"&&((T=k.state)==null?void 0:T._isRedirect)!==!0,ge;H.actionData?Object.keys(H.actionData).length>0?ge=H.actionData:ge=null:fe?ge=x.actionData:ge=null;let Qe=H.loaderData?Bp(x.loaderData,H.loaderData,H.matches||[],H.errors):x.loaderData,Ee=x.blockers;Ee.size>0&&(Ee=new Map(Ee),Ee.forEach((Re,Ge)=>Ee.set(Ge,ma)));let Ce=R===!0||x.navigation.formMethod!=null&&vr(x.navigation.formMethod)&&((J=k.state)==null?void 0:J._isRedirect)!==!0;a&&(s=a,a=void 0),X||S===Ut.Pop||(S===Ut.Push?e.history.push(k,k.state):S===Ut.Replace&&e.history.replace(k,k.state));let Ve;if(S===Ut.Pop){let Re=W.get(x.location.pathname);Re&&Re.has(k.pathname)?Ve={currentLocation:x.location,nextLocation:k}:W.has(k.pathname)&&(Ve={currentLocation:k,nextLocation:x.location})}else if(N){let Re=W.get(x.location.pathname);Re?Re.add(k.pathname):(Re=new Set([k.pathname]),W.set(x.location.pathname,Re)),Ve={currentLocation:x.location,nextLocation:k}}ve(kt({},H,{actionData:ge,loaderData:Qe,historyAction:S,location:k,initialized:!0,navigation:Cg,revalidation:"idle",restoreScrollPosition:Xn(k,H.matches||x.matches),preventScrollReset:Ce,blockers:Ee}),{viewTransitionOpts:Ve,flushSync:ae===!0}),S=Ut.Pop,R=!1,N=!1,X=!1,oe=!1,ne=[]}async function bt(k,H){if(typeof k=="number"){e.history.go(k);return}let U=fg(x.location,x.matches,i,d.v7_prependBasename,k,d.v7_relativeSplatPath,H==null?void 0:H.fromRouteId,H==null?void 0:H.relative),{path:T,submission:J,error:ae}=up(d.v7_normalizeFormMethod,!1,U,H),fe=x.location,ge=ha(x.location,T,H&&H.state);ge=kt({},ge,e.history.encodeLocation(ge));let Qe=H&&H.replace!=null?H.replace:void 0,Ee=Ut.Push;Qe===!0?Ee=Ut.Replace:Qe===!1||J!=null&&vr(J.formMethod)&&J.formAction===x.location.pathname+x.location.search&&(Ee=Ut.Replace);let Ce=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,Ve=(H&&H.unstable_flushSync)===!0,Re=xt({currentLocation:fe,nextLocation:ge,historyAction:Ee});if(Re){at(Re,{state:"blocked",location:ge,proceed(){at(Re,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),bt(k,H)},reset(){let Ge=new Map(x.blockers);Ge.set(Re,ma),ve({blockers:Ge})}});return}return await Lt(Ee,ge,{submission:J,pendingError:ae,preventScrollReset:Ce,replace:H&&H.replace,enableViewTransition:H&&H.unstable_viewTransition,flushSync:Ve})}function En(){if(wn(),ve({revalidation:"loading"}),x.navigation.state!=="submitting"){if(x.navigation.state==="idle"){Lt(x.historyAction,x.location,{startUninterruptedRevalidation:!0});return}Lt(S||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:N===!0})}}async function Lt(k,H,U){O&&O.abort(),O=null,S=k,X=(U&&U.startUninterruptedRevalidation)===!0,fn(x.location,x.matches),R=(U&&U.preventScrollReset)===!0,N=(U&&U.enableViewTransition)===!0;let T=a||s,J=U&&U.overrideNavigation,ae=fA(T,H,i),fe=(U&&U.flushSync)===!0,ge=nn(ae,T,H.pathname);if(ge.active&&ge.matches&&(ae=ge.matches),!ae){let{error:He,notFoundMatches:St,route:dt}=jt(H.pathname);Ue(H,{matches:St,loaderData:{},errors:{[dt.id]:He}},{flushSync:fe});return}if(x.initialized&&!oe&&E4(x.location,H)&&!(U&&U.submission&&vr(U.submission.formMethod))){Ue(H,{matches:ae},{flushSync:fe});return}O=new AbortController;let Qe=$A(e.history,H,O.signal,U&&U.submission),Ee;if(U&&U.pendingError)Ee=[KA(ae).route.id,{type:vt.error,error:U.pendingError}];else if(U&&U.submission&&vr(U.submission.formMethod)){let He=await Xt(Qe,H,U.submission,ae,ge.active,{replace:U.replace,flushSync:fe});if(He.shortCircuited)return;if(He.pendingActionResult){let[St,dt]=He.pendingActionResult;if(rr(dt)&&ml(dt.error)&&dt.error.status===404){O=null,Ue(H,{matches:He.matches,loaderData:{},errors:{[St]:dt.error}});return}}ae=He.matches||ae,Ee=He.pendingActionResult,J=hg(H,U.submission),fe=!1,ge.active=!1,Qe=$A(e.history,Qe.url,Qe.signal)}let{shortCircuited:Ce,matches:Ve,loaderData:Re,errors:Ge}=await yt(Qe,H,ae,ge.active,J,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,fe,Ee);Ce||(O=null,Ue(H,kt({matches:Ve||ae},hp(Ee),{loaderData:Re,errors:Ge})))}async function Xt(k,H,U,T,J,ae){ae===void 0&&(ae={}),wn();let fe=m4(H,U);if(ve({navigation:fe},{flushSync:ae.flushSync===!0}),J){let Ee=await Ft(T,H.pathname,k.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){let{boundaryId:Ce,error:Ve}=Vt(H.pathname,Ee);return{matches:Ee.partialMatches,pendingActionResult:[Ce,{type:vt.error,error:Ve}]}}else if(Ee.matches)T=Ee.matches;else{let{notFoundMatches:Ce,error:Ve,route:Re}=jt(H.pathname);return{matches:Ce,pendingActionResult:[Re.id,{type:vt.error,error:Ve}]}}}let ge,Qe=ya(T,H);if(!Qe.route.action&&!Qe.route.lazy)ge={type:vt.error,error:Ln(405,{method:k.method,pathname:H.pathname,routeId:Qe.route.id})};else if(ge=(await en("action",x,k,[Qe],T,null))[Qe.route.id],k.signal.aborted)return{shortCircuited:!0};if(IA(ge)){let Ee;return ae&&ae.replace!=null?Ee=ae.replace:Ee=fp(ge.response.headers.get("Location"),new URL(k.url),i)===x.location.pathname+x.location.search,await Jn(k,ge,!0,{submission:U,replace:Ee}),{shortCircuited:!0}}if(Fo(ge))throw Ln(400,{type:"defer-action"});if(rr(ge)){let Ee=KA(T,Qe.route.id);return(ae&&ae.replace)!==!0&&(S=Ut.Push),{matches:T,pendingActionResult:[Ee.route.id,ge]}}return{matches:T,pendingActionResult:[Qe.route.id,ge]}}async function yt(k,H,U,T,J,ae,fe,ge,Qe,Ee,Ce){let Ve=J||hg(H,ae),Re=ae||fe||xp(Ve),Ge=!X&&(!d.v7_partialHydration||!Qe);if(T){if(Ge){let te=xn(Ce);ve(kt({navigation:Ve},te!==void 0?{actionData:te}:{}),{flushSync:Ee})}let z=await Ft(U,H.pathname,k.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){let{boundaryId:te,error:ie}=Vt(H.pathname,z);return{matches:z.partialMatches,loaderData:{},errors:{[te]:ie}}}else if(z.matches)U=z.matches;else{let{error:te,notFoundMatches:ie,route:ue}=jt(H.pathname);return{matches:ie,loaderData:{},errors:{[ue.id]:te}}}}let He=a||s,[St,dt]=gp(e.history,x,U,Re,H,d.v7_partialHydration&&Qe===!0,d.v7_skipActionErrorRevalidation,oe,ne,de,re,G,j,He,i,Ce);if(hn(z=>!(U&&U.some(te=>te.route.id===z))||St&&St.some(te=>te.route.id===z)),F=++M,St.length===0&&dt.length===0){let z=Se();return Ue(H,kt({matches:U,loaderData:{},errors:Ce&&rr(Ce[1])?{[Ce[0]]:Ce[1].error}:null},hp(Ce),z?{fetchers:new Map(x.fetchers)}:{}),{flushSync:Ee}),{shortCircuited:!0}}if(Ge){let z={};if(!T){z.navigation=Ve;let te=xn(Ce);te!==void 0&&(z.actionData=te)}dt.length>0&&(z.fetchers=vn(dt)),ve(z,{flushSync:Ee})}dt.forEach(z=>{q.has(z.key)&&Tn(z.key),z.controller&&q.set(z.key,z.controller)});let Jt=()=>dt.forEach(z=>Tn(z.key));O&&O.signal.addEventListener("abort",Jt);let{loaderResults:On,fetcherResults:lo}=await ar(x,U,St,dt,k);if(k.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Jt),dt.forEach(z=>q.delete(z.key));let pr=yl(On);if(pr)return await Jn(k,pr.result,!0,{replace:ge}),{shortCircuited:!0};if(pr=yl(lo),pr)return j.add(pr.key),await Jn(k,pr.result,!0,{replace:ge}),{shortCircuited:!0};let{loaderData:$s,errors:Br}=pp(x,U,St,On,Ce,dt,lo,$);$.forEach((z,te)=>{z.subscribe(ie=>{(ie||z.done)&&$.delete(te)})}),d.v7_partialHydration&&Qe&&x.errors&&Object.entries(x.errors).filter(z=>{let[te]=z;return!St.some(ie=>ie.route.id===te)}).forEach(z=>{let[te,ie]=z;Br=Object.assign(Br||{},{[te]:ie})});let Ae=Se(),P=kr(F),ee=Ae||P||dt.length>0;return kt({matches:U,loaderData:$s,errors:Br},ee?{fetchers:new Map(x.fetchers)}:{})}function xn(k){if(k&&!rr(k[1]))return{[k[0]]:k[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function vn(k){return k.forEach(H=>{let U=x.fetchers.get(H.key),T=ba(void 0,U?U.data:void 0);x.fetchers.set(H.key,T)}),new Map(x.fetchers)}function Ko(k,H,U,T){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");q.has(k)&&Tn(k);let J=(T&&T.unstable_flushSync)===!0,ae=a||s,fe=fg(x.location,x.matches,i,d.v7_prependBasename,U,d.v7_relativeSplatPath,H,T==null?void 0:T.relative),ge=fA(ae,fe,i),Qe=nn(ge,ae,fe);if(Qe.active&&Qe.matches&&(ge=Qe.matches),!ge){Nt(k,H,Ln(404,{pathname:fe}),{flushSync:J});return}let{path:Ee,submission:Ce,error:Ve}=up(d.v7_normalizeFormMethod,!0,fe,T);if(Ve){Nt(k,H,Ve,{flushSync:J});return}let Re=ya(ge,Ee);if(R=(T&&T.preventScrollReset)===!0,Ce&&vr(Ce.formMethod)){eA(k,H,Ee,Re,ge,Qe.active,J,Ce);return}G.set(k,{routeId:H,path:Ee}),tA(k,H,Ee,Re,ge,Qe.active,J,Ce)}async function eA(k,H,U,T,J,ae,fe,ge){wn(),G.delete(k);function Qe(ue){if(!ue.route.action&&!ue.route.lazy){let Be=Ln(405,{method:ge.formMethod,pathname:U,routeId:H});return Nt(k,H,Be,{flushSync:fe}),!0}return!1}if(!ae&&Qe(T))return;let Ee=x.fetchers.get(k);Sn(k,y4(ge,Ee),{flushSync:fe});let Ce=new AbortController,Ve=$A(e.history,U,Ce.signal,ge);if(ae){let ue=await Ft(J,U,Ve.signal);if(ue.type==="aborted")return;if(ue.type==="error"){let{error:Be}=Vt(U,ue);Nt(k,H,Be,{flushSync:fe});return}else if(ue.matches){if(J=ue.matches,T=ya(J,U),Qe(T))return}else{Nt(k,H,Ln(404,{pathname:U}),{flushSync:fe});return}}q.set(k,Ce);let Re=M,He=(await en("action",x,Ve,[T],J,k))[T.route.id];if(Ve.signal.aborted){q.get(k)===Ce&&q.delete(k);return}if(d.v7_fetcherPersist&&re.has(k)){if(IA(He)||rr(He)){Sn(k,No(void 0));return}}else{if(IA(He))if(q.delete(k),F>Re){Sn(k,No(void 0));return}else return j.add(k),Sn(k,ba(ge)),Jn(Ve,He,!1,{fetcherSubmission:ge});if(rr(He)){Nt(k,H,He.error);return}}if(Fo(He))throw Ln(400,{type:"defer-action"});let St=x.navigation.location||x.location,dt=$A(e.history,St,Ce.signal),Jt=a||s,On=x.navigation.state!=="idle"?fA(Jt,x.navigation.location,i):x.matches;Fe(On,"Didn't find any matches after fetcher action");let lo=++M;D.set(k,lo);let pr=ba(ge,He.data);x.fetchers.set(k,pr);let[$s,Br]=gp(e.history,x,On,ge,St,!1,d.v7_skipActionErrorRevalidation,oe,ne,de,re,G,j,Jt,i,[T.route.id,He]);Br.filter(ue=>ue.key!==k).forEach(ue=>{let Be=ue.key,Ie=x.fetchers.get(Be),he=ba(void 0,Ie?Ie.data:void 0);x.fetchers.set(Be,he),q.has(Be)&&Tn(Be),ue.controller&&q.set(Be,ue.controller)}),ve({fetchers:new Map(x.fetchers)});let Ae=()=>Br.forEach(ue=>Tn(ue.key));Ce.signal.addEventListener("abort",Ae);let{loaderResults:P,fetcherResults:ee}=await ar(x,On,$s,Br,dt);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",Ae),D.delete(k),q.delete(k),Br.forEach(ue=>q.delete(ue.key));let z=yl(P);if(z)return Jn(dt,z.result,!1);if(z=yl(ee),z)return j.add(z.key),Jn(dt,z.result,!1);let{loaderData:te,errors:ie}=pp(x,On,$s,P,void 0,Br,ee,$);if(x.fetchers.has(k)){let ue=No(He.data);x.fetchers.set(k,ue)}kr(lo),x.navigation.state==="loading"&&lo>F?(Fe(S,"Expected pending action"),O&&O.abort(),Ue(x.navigation.location,{matches:On,loaderData:te,errors:ie,fetchers:new Map(x.fetchers)})):(ve({errors:ie,loaderData:Bp(x.loaderData,te,On,ie),fetchers:new Map(x.fetchers)}),oe=!1)}async function tA(k,H,U,T,J,ae,fe,ge){let Qe=x.fetchers.get(k);Sn(k,ba(ge,Qe?Qe.data:void 0),{flushSync:fe});let Ee=new AbortController,Ce=$A(e.history,U,Ee.signal);if(ae){let He=await Ft(J,U,Ce.signal);if(He.type==="aborted")return;if(He.type==="error"){let{error:St}=Vt(U,He);Nt(k,H,St,{flushSync:fe});return}else if(He.matches)J=He.matches,T=ya(J,U);else{Nt(k,H,Ln(404,{pathname:U}),{flushSync:fe});return}}q.set(k,Ee);let Ve=M,Ge=(await en("loader",x,Ce,[T],J,k))[T.route.id];if(Fo(Ge)&&(Ge=await pg(Ge,Ce.signal,!0)||Ge),q.get(k)===Ee&&q.delete(k),!Ce.signal.aborted){if(re.has(k)){Sn(k,No(void 0));return}if(IA(Ge))if(F>Ve){Sn(k,No(void 0));return}else{j.add(k),await Jn(Ce,Ge,!1);return}if(rr(Ge)){Nt(k,H,Ge.error);return}Fe(!Fo(Ge),"Unhandled fetcher deferred data"),Sn(k,No(Ge.data))}}async function Jn(k,H,U,T){let{submission:J,fetcherSubmission:ae,replace:fe}=T===void 0?{}:T;H.response.headers.has("X-Remix-Revalidate")&&(oe=!0);let ge=H.response.headers.get("Location");Fe(ge,"Expected a Location header on the redirect Response"),ge=fp(ge,new URL(k.url),i);let Qe=ha(x.location,ge,{_isRedirect:!0});if(n){let He=!1;if(H.response.headers.has("X-Remix-Reload-Document"))He=!0;else if(Eg.test(ge)){const St=e.history.createURL(ge);He=St.origin!==t.location.origin||xr(St.pathname,i)==null}if(He){fe?t.location.replace(ge):t.location.assign(ge);return}}O=null;let Ee=fe===!0||H.response.headers.has("X-Remix-Replace")?Ut.Replace:Ut.Push,{formMethod:Ce,formAction:Ve,formEncType:Re}=x.navigation;!J&&!ae&&Ce&&Ve&&Re&&(J=xp(x.navigation));let Ge=J||ae;if(e4.has(H.response.status)&&Ge&&vr(Ge.formMethod))await Lt(Ee,Qe,{submission:kt({},Ge,{formAction:ge}),preventScrollReset:R,enableViewTransition:U?N:void 0});else{let He=hg(Qe,J);await Lt(Ee,Qe,{overrideNavigation:He,fetcherSubmission:ae,preventScrollReset:R,enableViewTransition:U?N:void 0})}}async function en(k,H,U,T,J,ae){let fe,ge={};try{fe=await c4(l,k,H,U,T,J,ae,A,o)}catch(Qe){return T.forEach(Ee=>{ge[Ee.route.id]={type:vt.error,error:Qe}}),ge}for(let[Qe,Ee]of Object.entries(fe))if(I4(Ee)){let Ce=Ee.result;ge[Qe]={type:vt.redirect,response:d4(Ce,U,Qe,J,i,d.v7_relativeSplatPath)}}else ge[Qe]=await g4(Ee);return ge}async function ar(k,H,U,T,J){let ae=k.matches,fe=en("loader",k,J,U,H,null),ge=Promise.all(T.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.controller){let Re=(await en("loader",k,$A(e.history,Ce.path,Ce.controller.signal),[Ce.match],Ce.matches,Ce.key))[Ce.match.route.id];return{[Ce.key]:Re}}else return Promise.resolve({[Ce.key]:{type:vt.error,error:Ln(404,{pathname:Ce.path})}})})),Qe=await fe,Ee=(await ge).reduce((Ce,Ve)=>Object.assign(Ce,Ve),{});return await Promise.all([h4(H,Qe,J.signal,ae,k.loaderData),Q4(H,Ee,T)]),{loaderResults:Qe,fetcherResults:Ee}}function wn(){oe=!0,ne.push(...hn()),G.forEach((k,H)=>{q.has(H)&&(de.add(H),Tn(H))})}function Sn(k,H,U){U===void 0&&(U={}),x.fetchers.set(k,H),ve({fetchers:new Map(x.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Nt(k,H,U,T){T===void 0&&(T={});let J=KA(x.matches,H);io(k),ve({errors:{[J.route.id]:U},fetchers:new Map(x.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function yo(k){return d.v7_fetcherPersist&&(Z.set(k,(Z.get(k)||0)+1),re.has(k)&&re.delete(k)),x.fetchers.get(k)||t4}function io(k){let H=x.fetchers.get(k);q.has(k)&&!(H&&H.state==="loading"&&D.has(k))&&Tn(k),G.delete(k),D.delete(k),j.delete(k),re.delete(k),de.delete(k),x.fetchers.delete(k)}function nA(k){if(d.v7_fetcherPersist){let H=(Z.get(k)||0)-1;H<=0?(Z.delete(k),re.add(k)):Z.set(k,H)}else io(k);ve({fetchers:new Map(x.fetchers)})}function Tn(k){let H=q.get(k);Fe(H,"Expected fetch controller: "+k),H.abort(),q.delete(k)}function bo(k){for(let H of k){let U=yo(H),T=No(U.data);x.fetchers.set(H,T)}}function Se(){let k=[],H=!1;for(let U of j){let T=x.fetchers.get(U);Fe(T,"Expected fetcher: "+U),T.state==="loading"&&(j.delete(U),k.push(U),H=!0)}return bo(k),H}function kr(k){let H=[];for(let[U,T]of D)if(T<k){let J=x.fetchers.get(U);Fe(J,"Expected fetcher: "+U),J.state==="loading"&&(Tn(U),D.delete(U),H.push(U))}return bo(H),H.length>0}function Ir(k,H){let U=x.blockers.get(k)||ma;return ce.get(k)!==H&&ce.set(k,H),U}function Rt(k){x.blockers.delete(k),ce.delete(k)}function at(k,H){let U=x.blockers.get(k)||ma;Fe(U.state==="unblocked"&&H.state==="blocked"||U.state==="blocked"&&H.state==="blocked"||U.state==="blocked"&&H.state==="proceeding"||U.state==="blocked"&&H.state==="unblocked"||U.state==="proceeding"&&H.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+H.state);let T=new Map(x.blockers);T.set(k,H),ve({blockers:T})}function xt(k){let{currentLocation:H,nextLocation:U,historyAction:T}=k;if(ce.size===0)return;ce.size>1&&sn(!1,"A router only supports one blocker at a time");let J=Array.from(ce.entries()),[ae,fe]=J[J.length-1],ge=x.blockers.get(ae);if(!(ge&&ge.state==="proceeding")&&fe({currentLocation:H,nextLocation:U,historyAction:T}))return ae}function jt(k){let H=Ln(404,{pathname:k}),U=a||s,{matches:T,route:J}=Qp(U);return hn(),{notFoundMatches:T,route:J,error:H}}function Vt(k,H){return{boundaryId:KA(H.partialMatches).route.id,error:Ln(400,{type:"route-discovery",pathname:k,message:H.error!=null&&"message"in H.error?H.error:String(H.error)})}}function hn(k){let H=[];return $.forEach((U,T)=>{(!k||k(T))&&(U.cancel(),H.push(T),$.delete(T))}),H}function qt(k,H,U){if(E=k,p=H,h=U||null,!Q&&x.navigation===Cg){Q=!0;let T=Xn(x.location,x.matches);T!=null&&ve({restoreScrollPosition:T})}return()=>{E=null,p=null,h=null}}function tn(k,H){return h&&h(k,H.map(T=>D3(T,x.loaderData)))||k.key}function fn(k,H){if(E&&p){let U=tn(k,H);E[U]=p()}}function Xn(k,H){if(E){let U=tn(k,H),T=E[U];if(typeof T=="number")return T}return null}function nn(k,H,U){if(u){if(C.has(U))return{active:!1,matches:k};if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:Bl(H,U,i,!0)}}else return{active:!0,matches:Bl(H,U,i,!0)||[]}}return{active:!1,matches:null}}async function Ft(k,H,U){let T=k;for(;;){let J=a==null,ae=a||s;try{await a4(u,H,T,ae,A,o,K,U)}catch(Qe){return{type:"error",error:Qe,partialMatches:T}}finally{J&&(s=[...s])}if(U.aborted)return{type:"aborted"};let fe=fA(ae,H,i);if(fe)return ir(H,C),{type:"success",matches:fe};let ge=Bl(ae,H,i,!0);if(!ge||T.length===ge.length&&T.every((Qe,Ee)=>Qe.route.id===ge[Ee].route.id))return ir(H,C),{type:"success",matches:null};T=ge}}function ir(k,H){if(H.size>=I){let U=H.values().next().value;H.delete(U)}H.add(k)}function lr(k){A={},a=Qa(k,o,void 0,A)}function _n(k,H){let U=a==null;Ep(k,H,a||s,A,o),U&&(s=[...s],ve({}))}return w={get basename(){return i},get future(){return d},get state(){return x},get routes(){return s},get window(){return t},initialize:Le,subscribe:je,enableScrollRestoration:qt,navigate:bt,fetch:Ko,revalidate:En,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:yo,deleteFetcher:nA,dispose:Y,getBlocker:Ir,deleteBlocker:Rt,patchRoutes:_n,_internalFetchControllers:q,_internalActiveDeferreds:$,_internalSetRoutes:lr},w}function o4(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function fg(e,t,n,r,o,A,s,a){let i,l;if(s){i=[];for(let d of t)if(i.push(d),d.route.id===s){l=d;break}}else i=t,l=t[t.length-1];let u=dg(o||".",gg(i,A),xr(e.pathname,n)||e.pathname,a==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&l&&l.route.index&&!Bg(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Gr([n,u.pathname])),Do(u)}function up(e,t,n,r){if(!r||!o4(r))return{path:n};if(r.formMethod&&!B4(r.formMethod))return{path:n,error:Ln(405,{method:r.formMethod})};let o=()=>({path:n,error:Ln(400,{type:"invalid-body"})}),A=r.formMethod||"get",s=e?A.toUpperCase():A.toLowerCase(),a=mp(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!vr(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((B,I)=>{let[C,E]=I;return""+B+C+"="+E+`
77
+ `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!vr(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let i,l;if(r.formData)i=Ig(r.formData),l=r.formData;else if(r.body instanceof FormData)i=Ig(r.body),l=r.body;else if(r.body instanceof URLSearchParams)i=r.body,l=Ip(i);else if(r.body==null)i=new URLSearchParams,l=new FormData;else try{i=new URLSearchParams(r.body),l=Ip(i)}catch{return o()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(vr(u.formMethod))return{path:n,submission:u};let d=Lo(n);return t&&d.search&&Bg(d.search)&&i.append("index",""),d.search="?"+i,{path:Do(d),submission:u}}function A4(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function gp(e,t,n,r,o,A,s,a,i,l,u,d,f,B,I,C){let E=C?rr(C[1])?C[1].error:C[1].data:void 0,h=e.createURL(t.location),p=e.createURL(o),Q=C&&rr(C[1])?C[0]:void 0,y=Q?A4(n,Q):n,b=C?C[1].statusCode:void 0,v=s&&b&&b>=400,w=y.filter((S,R)=>{let{route:O}=S;if(O.lazy)return!0;if(O.loader==null)return!1;if(A)return typeof O.loader!="function"||O.loader.hydrate?!0:t.loaderData[O.id]===void 0&&(!t.errors||t.errors[O.id]===void 0);if(s4(t.loaderData,t.matches[R],S)||i.some(L=>L===S.route.id))return!0;let N=t.matches[R],W=S;return Cp(S,kt({currentUrl:h,currentParams:N.params,nextUrl:p,nextParams:W.params},r,{actionResult:E,actionStatus:b,defaultShouldRevalidate:v?!1:a||h.pathname+h.search===p.pathname+p.search||h.search!==p.search||dp(N,W)}))}),x=[];return d.forEach((S,R)=>{if(A||!n.some(X=>X.route.id===S.routeId)||u.has(R))return;let O=fA(B,S.path,I);if(!O){x.push({key:R,routeId:S.routeId,path:S.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(R),W=ya(O,S.path),L=!1;f.has(R)?L=!1:l.has(R)?(l.delete(R),L=!0):N&&N.state!=="idle"&&N.data===void 0?L=a:L=Cp(W,kt({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:E,actionStatus:b,defaultShouldRevalidate:v?!1:a})),L&&x.push({key:R,routeId:S.routeId,path:S.path,matches:O,match:W,controller:new AbortController})}),[w,x]}function s4(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function dp(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Cp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function a4(e,t,n,r,o,A,s,a){let i=[t,...n.map(l=>l.route.id)].join("-");try{let l=s.get(i);l||(l=e({path:t,matches:n,patch:(u,d)=>{a.aborted||Ep(u,d,r,o,A)}}),s.set(i,l)),l&&f4(l)&&await l}finally{s.delete(i)}}function Ep(e,t,n,r,o){if(e){var A;let s=r[e];Fe(s,"No route found to patch children into: routeId = "+e);let a=Qa(t,o,[e,"patch",String(((A=s.children)==null?void 0:A.length)||"0")],r);s.children?s.children.push(...a):s.children=a}else{let s=Qa(t,o,["patch",String(n.length||"0")],r);n.push(...s)}}async function i4(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Fe(o,"No route found in manifest");let A={};for(let s in r){let i=o[s]!==void 0&&s!=="hasErrorBoundary";sn(!i,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!i&&!_3.has(s)&&(A[s]=r[s])}Object.assign(o,A),Object.assign(o,kt({},t(o),{lazy:void 0}))}async function l4(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,A,s)=>Object.assign(o,{[n[s].route.id]:A}),{})}async function c4(e,t,n,r,o,A,s,a,i,l){let u=A.map(B=>B.route.lazy?i4(B.route,i,a):void 0),d=A.map((B,I)=>{let C=u[I],E=o.some(p=>p.route.id===B.route.id);return kt({},B,{shouldLoad:E,resolve:async p=>(p&&r.method==="GET"&&(B.route.lazy||B.route.loader)&&(E=!0),E?u4(t,r,B,C,p,l):Promise.resolve({type:vt.data,result:void 0}))})}),f=await e({matches:d,request:r,params:A[0].params,fetcherKey:s,context:l});try{await Promise.all(u)}catch{}return f}async function u4(e,t,n,r,o,A){let s,a,i=l=>{let u,d=new Promise((I,C)=>u=C);a=()=>u(),t.signal.addEventListener("abort",a);let f=I=>typeof l!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):l({request:t,params:n.params,context:A},...I!==void 0?[I]:[]),B=(async()=>{try{return{type:"data",result:await(o?o(C=>f(C)):f())}}catch(I){return{type:"error",result:I}}})();return Promise.race([B,d])};try{let l=n.route[e];if(r)if(l){let u,[d]=await Promise.all([i(l).catch(f=>{u=f}),r]);if(u!==void 0)throw u;s=d}else if(await r,l=n.route[e],l)s=await i(l);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw Ln(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:vt.data,result:void 0};else if(l)s=await i(l);else{let u=new URL(t.url),d=u.pathname+u.search;throw Ln(404,{pathname:d})}Fe(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(l){return{type:vt.error,result:l}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function g4(e){let{result:t,type:n}=e;if(bp(t)){let l;try{let u=t.headers.get("Content-Type");u&&/\bapplication\/json\b/.test(u)?t.body==null?l=null:l=await t.json():l=await t.text()}catch(u){return{type:vt.error,error:u}}return n===vt.error?{type:vt.error,error:new Ql(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:vt.data,data:l,statusCode:t.status,headers:t.headers}}if(n===vt.error){if(yp(t)){var r;if(t.data instanceof Error){var o;return{type:vt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Ql(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:vt.error,error:t,statusCode:ml(t)?t.status:void 0}}if(p4(t)){var A,s;return{type:vt.deferred,deferredData:t,statusCode:(A=t.init)==null?void 0:A.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(yp(t)){var a,i;return{type:vt.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:vt.data,data:t}}function d4(e,t,n,r,o,A){let s=e.headers.get("Location");if(Fe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Eg.test(s)){let a=r.slice(0,r.findIndex(i=>i.route.id===n)+1);s=fg(new URL(t.url),a,o,!0,s,A),e.headers.set("Location",s)}return e}function fp(e,t,n){if(Eg.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),A=xr(o.pathname,n)!=null;if(o.origin===t.origin&&A)return o.pathname+o.search+o.hash}return e}function $A(e,t,n,r){let o=e.createURL(mp(t)).toString(),A={signal:n};if(r&&vr(r.formMethod)){let{formMethod:s,formEncType:a}=r;A.method=s.toUpperCase(),a==="application/json"?(A.headers=new Headers({"Content-Type":a}),A.body=JSON.stringify(r.json)):a==="text/plain"?A.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?A.body=Ig(r.formData):A.body=r.formData}return new Request(o,A)}function Ig(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ip(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function C4(e,t,n,r,o){let A={},s=null,a,i=!1,l={},u=n&&rr(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,B=t[f];if(Fe(!IA(B),"Cannot handle redirect results in processLoaderData"),rr(B)){let I=B.error;u!==void 0&&(I=u,u=void 0),s=s||{};{let C=KA(e,f);s[C.route.id]==null&&(s[C.route.id]=I)}A[f]=void 0,i||(i=!0,a=ml(B.error)?B.error.status:500),B.headers&&(l[f]=B.headers)}else Fo(B)?(r.set(f,B.deferredData),A[f]=B.deferredData.data,B.statusCode!=null&&B.statusCode!==200&&!i&&(a=B.statusCode),B.headers&&(l[f]=B.headers)):(A[f]=B.data,B.statusCode&&B.statusCode!==200&&!i&&(a=B.statusCode),B.headers&&(l[f]=B.headers))}),u!==void 0&&n&&(s={[n[0]]:u},A[n[0]]=void 0),{loaderData:A,errors:s,statusCode:a||200,loaderHeaders:l}}function pp(e,t,n,r,o,A,s,a){let{loaderData:i,errors:l}=C4(t,r,o,a);return A.forEach(u=>{let{key:d,match:f,controller:B}=u,I=s[d];if(Fe(I,"Did not find corresponding fetcher result"),!(B&&B.signal.aborted))if(rr(I)){let C=KA(e.matches,f==null?void 0:f.route.id);l&&l[C.route.id]||(l=kt({},l,{[C.route.id]:I.error})),e.fetchers.delete(d)}else if(IA(I))Fe(!1,"Unhandled fetcher revalidation redirect");else if(Fo(I))Fe(!1,"Unhandled fetcher deferred data");else{let C=No(I.data);e.fetchers.set(d,C)}}),{loaderData:i,errors:l}}function Bp(e,t,n,r){let o=kt({},t);for(let A of n){let s=A.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&A.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function hp(e){return e?rr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function KA(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Qp(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ln(e,t){let{pathname:n,routeId:r,method:o,type:A,message:s}=t===void 0?{}:t,a="Unknown Server Error",i="Unknown @remix-run/router error";return e===400?(a="Bad Request",A==="route-discovery"?i='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
78
+ `+s):o&&n&&r?i="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":A==="defer-action"?i="defer() is not supported in actions":A==="invalid-body"&&(i="Unable to encode submission body")):e===403?(a="Forbidden",i='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",i='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?i="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(i='Invalid request method "'+o.toUpperCase()+'"')),new Ql(e||500,a,new Error(i),!0)}function yl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(IA(o))return{key:r,result:o}}}function mp(e){let t=typeof e=="string"?Lo(e):e;return Do(kt({},t,{hash:""}))}function E4(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function f4(e){return typeof e=="object"&&e!=null&&"then"in e}function I4(e){return bp(e.result)&&K3.has(e.result.status)}function Fo(e){return e.type===vt.deferred}function rr(e){return e.type===vt.error}function IA(e){return(e&&e.type)===vt.redirect}function yp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function p4(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function bp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function B4(e){return $3.has(e.toLowerCase())}function vr(e){return Z3.has(e.toLowerCase())}async function h4(e,t,n,r,o){let A=Object.entries(t);for(let s=0;s<A.length;s++){let[a,i]=A[s],l=e.find(f=>(f==null?void 0:f.route.id)===a);if(!l)continue;let u=r.find(f=>f.route.id===l.route.id),d=u!=null&&!dp(u,l)&&(o&&o[l.route.id])!==void 0;Fo(i)&&d&&await pg(i,n,!1).then(f=>{f&&(t[a]=f)})}}async function Q4(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:A,controller:s}=n[r],a=t[o];e.find(l=>(l==null?void 0:l.route.id)===A)&&Fo(a)&&(Fe(s,"Expected an AbortController for revalidating fetcher deferred result"),await pg(a,s.signal,!0).then(l=>{l&&(t[o]=l)}))}}async function pg(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:vt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:vt.error,error:o}}return{type:vt.data,data:e.deferredData.data}}}function Bg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ya(e,t){let n=typeof t=="string"?Lo(t).search:t.search;if(e[e.length-1].route.index&&Bg(n||""))return e[e.length-1];let r=ip(e);return r[r.length-1]}function xp(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:A,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(A!=null)return{formMethod:t,formAction:n,formEncType:r,formData:A,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function hg(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function m4(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ba(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function y4(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function No(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function b4(e,t){try{let n=e.sessionStorage.getItem(cp);if(n){let r=JSON.parse(n);for(let[o,A]of Object.entries(r||{}))A&&Array.isArray(A)&&t.set(o,new Set(A||[]))}}catch{}}function x4(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(cp,JSON.stringify(n))}catch(r){sn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
79
79
  * React Router v6.26.2
80
80
  *
81
81
  * Copyright (c) Remix Software Inc.
@@ -84,9 +84,9 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
84
84
  * LICENSE.md file in the root directory of this source tree.
85
85
  *
86
86
  * @license MIT
87
- */function bl(){return bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bl.apply(this,arguments)}const es=_.createContext(null);process.env.NODE_ENV!=="production"&&(es.displayName="DataRouter");const xl=_.createContext(null);process.env.NODE_ENV!=="production"&&(xl.displayName="DataRouterState");const vS=_.createContext(null);process.env.NODE_ENV!=="production"&&(vS.displayName="Await");const wr=_.createContext(null);process.env.NODE_ENV!=="production"&&(wr.displayName="Navigation");const vl=_.createContext(null);process.env.NODE_ENV!=="production"&&(vl.displayName="Location");const Sr=_.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Sr.displayName="Route");const Qg=_.createContext(null);process.env.NODE_ENV!=="production"&&(Qg.displayName="RouteError");function wS(e,t){let{relative:n}=t===void 0?{}:t;xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useHref() may be used only in the context of a <Router> component."):Fe(!1));let{basename:r,navigator:o}=_.useContext(wr),{hash:A,pathname:s,search:a}=va(e,{relative:n}),i=s;return r!=="/"&&(i=s==="/"?r:Gr([r,s])),o.createHref({pathname:i,search:a,hash:A})}function xa(){return _.useContext(vl)!=null}function Ro(){return xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useLocation() may be used only in the context of a <Router> component."):Fe(!1)),_.useContext(vl).location}const vp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wp(e){_.useContext(wr).static||_.useLayoutEffect(e)}function cn(){let{isDataRoute:e}=_.useContext(Sr);return e?GS():SS()}function SS(){xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useNavigate() may be used only in the context of a <Router> component."):Fe(!1));let e=_.useContext(es),{basename:t,future:n,navigator:r}=_.useContext(wr),{matches:o}=_.useContext(Sr),{pathname:A}=Ro(),s=JSON.stringify(gg(o,n.v7_relativeSplatPath)),a=_.useRef(!1);return wp(()=>{a.current=!0}),_.useCallback(function(l,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&sn(a.current,vp),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=dg(l,JSON.parse(s),A,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Gr([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,A,e])}const TS=_.createContext(null);function _S(e){let t=_.useContext(Sr).outlet;return t&&_.createElement(TS.Provider,{value:e},t)}function ko(){let{matches:e}=_.useContext(Sr),t=e[e.length-1];return t?t.params:{}}function va(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=_.useContext(wr),{matches:o}=_.useContext(Sr),{pathname:A}=Ro(),s=JSON.stringify(gg(o,r.v7_relativeSplatPath));return _.useMemo(()=>dg(e,JSON.parse(s),A,n==="path"),[e,s,A,n])}function OS(e,t,n,r){xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useRoutes() may be used only in the context of a <Router> component."):Fe(!1));let{navigator:o}=_.useContext(wr),{matches:A}=_.useContext(Sr),s=A[A.length-1],a=s?s.params:{},i=s?s.pathname:"/",l=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let h=u&&u.path||"";_p(i,!u||h.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+i+'" (under <Route path="'+h+'">) but the ')+`parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
87
+ */function bl(){return bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bl.apply(this,arguments)}const es=_.createContext(null);process.env.NODE_ENV!=="production"&&(es.displayName="DataRouter");const xl=_.createContext(null);process.env.NODE_ENV!=="production"&&(xl.displayName="DataRouterState");const v4=_.createContext(null);process.env.NODE_ENV!=="production"&&(v4.displayName="Await");const wr=_.createContext(null);process.env.NODE_ENV!=="production"&&(wr.displayName="Navigation");const vl=_.createContext(null);process.env.NODE_ENV!=="production"&&(vl.displayName="Location");const Sr=_.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Sr.displayName="Route");const Qg=_.createContext(null);process.env.NODE_ENV!=="production"&&(Qg.displayName="RouteError");function w4(e,t){let{relative:n}=t===void 0?{}:t;xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useHref() may be used only in the context of a <Router> component."):Fe(!1));let{basename:r,navigator:o}=_.useContext(wr),{hash:A,pathname:s,search:a}=va(e,{relative:n}),i=s;return r!=="/"&&(i=s==="/"?r:Gr([r,s])),o.createHref({pathname:i,search:a,hash:A})}function xa(){return _.useContext(vl)!=null}function Ro(){return xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useLocation() may be used only in the context of a <Router> component."):Fe(!1)),_.useContext(vl).location}const vp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wp(e){_.useContext(wr).static||_.useLayoutEffect(e)}function cn(){let{isDataRoute:e}=_.useContext(Sr);return e?G4():S4()}function S4(){xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useNavigate() may be used only in the context of a <Router> component."):Fe(!1));let e=_.useContext(es),{basename:t,future:n,navigator:r}=_.useContext(wr),{matches:o}=_.useContext(Sr),{pathname:A}=Ro(),s=JSON.stringify(gg(o,n.v7_relativeSplatPath)),a=_.useRef(!1);return wp(()=>{a.current=!0}),_.useCallback(function(l,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&sn(a.current,vp),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=dg(l,JSON.parse(s),A,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Gr([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,A,e])}const T4=_.createContext(null);function _4(e){let t=_.useContext(Sr).outlet;return t&&_.createElement(T4.Provider,{value:e},t)}function ko(){let{matches:e}=_.useContext(Sr),t=e[e.length-1];return t?t.params:{}}function va(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=_.useContext(wr),{matches:o}=_.useContext(Sr),{pathname:A}=Ro(),s=JSON.stringify(gg(o,r.v7_relativeSplatPath));return _.useMemo(()=>dg(e,JSON.parse(s),A,n==="path"),[e,s,A,n])}function O4(e,t,n,r){xa()||(process.env.NODE_ENV!=="production"?Fe(!1,"useRoutes() may be used only in the context of a <Router> component."):Fe(!1));let{navigator:o}=_.useContext(wr),{matches:A}=_.useContext(Sr),s=A[A.length-1],a=s?s.params:{},i=s?s.pathname:"/",l=s?s.pathnameBase:"/",u=s&&s.route;if(process.env.NODE_ENV!=="production"){let h=u&&u.path||"";_p(i,!u||h.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+i+'" (under <Route path="'+h+'">) but the ')+`parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
88
88
 
89
- `+('Please change the parent <Route path="'+h+'"> to <Route ')+('path="'+(h==="/"?"*":h+"/*")+'">.'))}let d=Ro(),f;f=d;let B=f.pathname||"/",I=B;if(l!=="/"){let h=l.replace(/^\//,"").split("/");I="/"+B.replace(/^\//,"").split("/").slice(h.length).join("/")}let C=fA(e,{pathname:I});return process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&sn(u||C!=null,'No routes matched location "'+f.pathname+f.search+f.hash+'" '),process.env.NODE_ENV!=="production"&&sn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,'Matched leaf route at location "'+f.pathname+f.search+f.hash+'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.')),RS(C&&C.map(h=>Object.assign({},h,{params:Object.assign({},a,h.params),pathname:Gr([l,o.encodeLocation?o.encodeLocation(h.pathname).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?l:Gr([l,o.encodeLocation?o.encodeLocation(h.pathnameBase).pathname:h.pathnameBase])})),A,n,r)}function DS(){let e=VS(),t=ml(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},A={padding:"2px 4px",backgroundColor:r},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:A},"ErrorBoundary")," or"," ",_.createElement("code",{style:A},"errorElement")," prop on your route."))),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:o},n):null,s)}const LS=_.createElement(DS,null);class FS extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?_.createElement(Sr.Provider,{value:this.props.routeContext},_.createElement(Qg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function NS(e){let{routeContext:t,match:n,children:r}=e,o=_.useContext(es);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Sr.Provider,{value:t},r)}function RS(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var A;if(!n)return null;if(n.errors)e=n.matches;else if((A=r)!=null&&A.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let u=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||(process.env.NODE_ENV!=="production"?Fe(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(a).join(",")):Fe(!1)),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:B}=n,I=d.route.loader&&f[d.route.id]===void 0&&(!B||B[d.route.id]===void 0);if(d.route.lazy||I){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((u,d,f)=>{let B,I=!1,C=null,E=null;n&&(B=a&&d.route.id?a[d.route.id]:void 0,C=d.route.errorElement||LS,i&&(l<0&&f===0?(_p("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),I=!0,E=null):l===f&&(I=!0,E=d.route.hydrateFallbackElement||null)));let h=t.concat(s.slice(0,f+1)),p=()=>{let Q;return B?Q=C:I?Q=E:d.route.Component?Q=_.createElement(d.route.Component,null):d.route.element?Q=d.route.element:Q=u,_.createElement(NS,{match:d,routeContext:{outlet:u,matches:h,isDataRoute:n!=null},children:Q})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(FS,{location:n.location,revalidation:n.revalidation,component:C,error:B,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()},null)}var Sp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Sp||{}),wa=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wa||{});function mg(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function kS(e){let t=_.useContext(es);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function PS(e){let t=_.useContext(xl);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function MS(e){let t=_.useContext(Sr);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function yg(e){let t=MS(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?Fe(!1,e+' can only be used on routes that contain a unique "id"'):Fe(!1)),n.route.id}function jS(){return yg(wa.UseRouteId)}function VS(){var e;let t=_.useContext(Qg),n=PS(wa.UseRouteError),r=yg(wa.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function GS(){let{router:e}=kS(Sp.UseNavigateStable),t=yg(wa.UseNavigateStable),n=_.useRef(!1);return wp(()=>{n.current=!0}),_.useCallback(function(o,A){A===void 0&&(A={}),process.env.NODE_ENV!=="production"&&sn(n.current,vp),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,bl({fromRouteId:t},A)))},[e,t])}const Tp={};function _p(e,t,n){!t&&!Tp[e]&&(Tp[e]=!0,process.env.NODE_ENV!=="production"&&sn(!1,n))}function HS(e){return _S(e.context)}function WS(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ut.Pop,navigator:A,static:s=!1,future:a}=e;xa()&&(process.env.NODE_ENV!=="production"?Fe(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):Fe(!1));let i=t.replace(/^\/*/,"/"),l=_.useMemo(()=>({basename:i,navigator:A,static:s,future:bl({v7_relativeSplatPath:!1},a)}),[i,a,A,s]);typeof r=="string"&&(r=Lo(r));let{pathname:u="/",search:d="",hash:f="",state:B=null,key:I="default"}=r,C=_.useMemo(()=>{let E=xr(u,i);return E==null?null:{location:{pathname:E,search:d,hash:f,state:B,key:I},navigationType:o}},[i,u,d,f,B,I,o]);return process.env.NODE_ENV!=="production"&&sn(C!=null,'<Router basename="'+i+'"> is not able to match the URL '+('"'+u+d+f+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),C==null?null:_.createElement(wr.Provider,{value:l},_.createElement(vl.Provider,{children:n,value:C}))}new Promise(()=>{});function zS(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(process.env.NODE_ENV!=="production"&&e.element&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(process.env.NODE_ENV!=="production"&&e.hydrateFallbackElement&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(process.env.NODE_ENV!=="production"&&e.errorElement&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}/**
89
+ `+('Please change the parent <Route path="'+h+'"> to <Route ')+('path="'+(h==="/"?"*":h+"/*")+'">.'))}let d=Ro(),f;f=d;let B=f.pathname||"/",I=B;if(l!=="/"){let h=l.replace(/^\//,"").split("/");I="/"+B.replace(/^\//,"").split("/").slice(h.length).join("/")}let C=fA(e,{pathname:I});return process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&sn(u||C!=null,'No routes matched location "'+f.pathname+f.search+f.hash+'" '),process.env.NODE_ENV!=="production"&&sn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,'Matched leaf route at location "'+f.pathname+f.search+f.hash+'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.')),R4(C&&C.map(h=>Object.assign({},h,{params:Object.assign({},a,h.params),pathname:Gr([l,o.encodeLocation?o.encodeLocation(h.pathname).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?l:Gr([l,o.encodeLocation?o.encodeLocation(h.pathnameBase).pathname:h.pathnameBase])})),A,n,r)}function D4(){let e=V4(),t=ml(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},A={padding:"2px 4px",backgroundColor:r},s=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),s=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:A},"ErrorBoundary")," or"," ",_.createElement("code",{style:A},"errorElement")," prop on your route."))),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:o},n):null,s)}const L4=_.createElement(D4,null);class F4 extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?_.createElement(Sr.Provider,{value:this.props.routeContext},_.createElement(Qg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function N4(e){let{routeContext:t,match:n,children:r}=e,o=_.useContext(es);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Sr.Provider,{value:t},r)}function R4(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var A;if(!n)return null;if(n.errors)e=n.matches;else if((A=r)!=null&&A.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let u=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||(process.env.NODE_ENV!=="production"?Fe(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(a).join(",")):Fe(!1)),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:B}=n,I=d.route.loader&&f[d.route.id]===void 0&&(!B||B[d.route.id]===void 0);if(d.route.lazy||I){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((u,d,f)=>{let B,I=!1,C=null,E=null;n&&(B=a&&d.route.id?a[d.route.id]:void 0,C=d.route.errorElement||L4,i&&(l<0&&f===0?(_p("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),I=!0,E=null):l===f&&(I=!0,E=d.route.hydrateFallbackElement||null)));let h=t.concat(s.slice(0,f+1)),p=()=>{let Q;return B?Q=C:I?Q=E:d.route.Component?Q=_.createElement(d.route.Component,null):d.route.element?Q=d.route.element:Q=u,_.createElement(N4,{match:d,routeContext:{outlet:u,matches:h,isDataRoute:n!=null},children:Q})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(F4,{location:n.location,revalidation:n.revalidation,component:C,error:B,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()},null)}var Sp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Sp||{}),wa=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wa||{});function mg(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function k4(e){let t=_.useContext(es);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function P4(e){let t=_.useContext(xl);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function M4(e){let t=_.useContext(Sr);return t||(process.env.NODE_ENV!=="production"?Fe(!1,mg(e)):Fe(!1)),t}function yg(e){let t=M4(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?Fe(!1,e+' can only be used on routes that contain a unique "id"'):Fe(!1)),n.route.id}function j4(){return yg(wa.UseRouteId)}function V4(){var e;let t=_.useContext(Qg),n=P4(wa.UseRouteError),r=yg(wa.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function G4(){let{router:e}=k4(Sp.UseNavigateStable),t=yg(wa.UseNavigateStable),n=_.useRef(!1);return wp(()=>{n.current=!0}),_.useCallback(function(o,A){A===void 0&&(A={}),process.env.NODE_ENV!=="production"&&sn(n.current,vp),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,bl({fromRouteId:t},A)))},[e,t])}const Tp={};function _p(e,t,n){!t&&!Tp[e]&&(Tp[e]=!0,process.env.NODE_ENV!=="production"&&sn(!1,n))}function H4(e){return _4(e.context)}function W4(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ut.Pop,navigator:A,static:s=!1,future:a}=e;xa()&&(process.env.NODE_ENV!=="production"?Fe(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):Fe(!1));let i=t.replace(/^\/*/,"/"),l=_.useMemo(()=>({basename:i,navigator:A,static:s,future:bl({v7_relativeSplatPath:!1},a)}),[i,a,A,s]);typeof r=="string"&&(r=Lo(r));let{pathname:u="/",search:d="",hash:f="",state:B=null,key:I="default"}=r,C=_.useMemo(()=>{let E=xr(u,i);return E==null?null:{location:{pathname:E,search:d,hash:f,state:B,key:I},navigationType:o}},[i,u,d,f,B,I,o]);return process.env.NODE_ENV!=="production"&&sn(C!=null,'<Router basename="'+i+'"> is not able to match the URL '+('"'+u+d+f+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),C==null?null:_.createElement(wr.Provider,{value:l},_.createElement(vl.Provider,{children:n,value:C}))}new Promise(()=>{});function z4(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(process.env.NODE_ENV!=="production"&&e.element&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(process.env.NODE_ENV!=="production"&&e.hydrateFallbackElement&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(process.env.NODE_ENV!=="production"&&e.errorElement&&process.env.NODE_ENV!=="production"&&sn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}/**
90
90
  * React Router DOM v6.26.2
91
91
  *
92
92
  * Copyright (c) Remix Software Inc.
@@ -95,17 +95,17 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
95
95
  * LICENSE.md file in the root directory of this source tree.
96
96
  *
97
97
  * @license MIT
98
- */function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}function bg(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,A;for(A=0;A<r.length;A++)o=r[A],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const wl="get",Sl="application/x-www-form-urlencoded";function Tl(e){return e!=null&&typeof e.tagName=="string"}function YS(e){return Tl(e)&&e.tagName.toLowerCase()==="button"}function JS(e){return Tl(e)&&e.tagName.toLowerCase()==="form"}function XS(e){return Tl(e)&&e.tagName.toLowerCase()==="input"}function qS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZS(e,t){return e.button===0&&(!t||t==="_self")&&!qS(e)}function xg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function US(e,t){let n=xg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(A=>{n.append(o,A)})}),n}let _l=null;function $S(){if(_l===null)try{new FormData(document.createElement("form"),0),_l=!1}catch{_l=!0}return _l}const KS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vg(e){return e!=null&&!KS.has(e)?(process.env.NODE_ENV!=="production"&&sn(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Sl+'"')),null):e}function e4(e,t){let n,r,o,A,s;if(JS(e)){let a=e.getAttribute("action");r=a?xr(a,t):null,n=e.getAttribute("method")||wl,o=vg(e.getAttribute("enctype"))||Sl,A=new FormData(e)}else if(YS(e)||XS(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||a.getAttribute("action");if(r=i?xr(i,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,o=vg(e.getAttribute("formenctype"))||vg(a.getAttribute("enctype"))||Sl,A=new FormData(a,e),!$S()){let{name:l,type:u,value:d}=e;if(u==="image"){let f=l?l+".":"";A.append(f+"x","0"),A.append(f+"y","0")}else l&&A.append(l,d)}}else{if(Tl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,o=Sl,s=e}return A&&o==="text/plain"&&(s=A,A=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:A,body:s}}const t4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],n4=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],r4=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],o4="6";try{window.__reactRouterVersion=o4}catch{}function Op(e,t){return rS({basename:t==null?void 0:t.basename,future:Po({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:w3({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||A4(),routes:e,mapRouteProperties:zS,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function A4(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Po({},t,{errors:s4(t.errors)})),t}function s4(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Ql(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let A=window[o.__subType];if(typeof A=="function")try{let s=new A(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let A=new Error(o.message);A.stack="",n[r]=A}}else n[r]=o;return n}const wg=_.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(wg.displayName="ViewTransition");const Dp=_.createContext(new Map);process.env.NODE_ENV!=="production"&&(Dp.displayName="Fetchers");const Lp=_["startTransition"],Fp=m2["flushSync"];function a4(e){Lp?Lp(e):e()}function Sa(e){Fp?Fp(e):e()}class i4{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Np(e){let{fallbackElement:t,router:n,future:r}=e,[o,A]=_.useState(n.state),[s,a]=_.useState(),[i,l]=_.useState({isTransitioning:!1}),[u,d]=_.useState(),[f,B]=_.useState(),[I,C]=_.useState(),E=_.useRef(new Map),{v7_startTransition:h}=r||{},p=_.useCallback(x=>{h?a4(x):x()},[h]),Q=_.useCallback((x,S)=>{let{deletedFetchers:R,unstable_flushSync:O,unstable_viewTransitionOpts:N}=S;R.forEach(L=>E.current.delete(L)),x.fetchers.forEach((L,X)=>{L.data!==void 0&&E.current.set(X,L.data)});let W=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||W){O?Sa(()=>A(x)):p(()=>A(x));return}if(O){Sa(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let L=n.window.document.startViewTransition(()=>{Sa(()=>A(x))});L.finished.finally(()=>{Sa(()=>{d(void 0),B(void 0),a(void 0),l({isTransitioning:!1})})}),Sa(()=>B(L));return}f?(u&&u.resolve(),f.skipTransition(),C({state:x,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(x),l({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,f,u,E,p]);_.useLayoutEffect(()=>n.subscribe(Q),[n,Q]),_.useEffect(()=>{i.isTransitioning&&!i.flushSync&&d(new i4)},[i]),_.useEffect(()=>{if(u&&s&&n.window){let x=s,S=u.promise,R=n.window.document.startViewTransition(async()=>{p(()=>A(x)),await S});R.finished.finally(()=>{d(void 0),B(void 0),a(void 0),l({isTransitioning:!1})}),B(R)}},[p,s,u,n.window]),_.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),_.useEffect(()=>{!i.isTransitioning&&I&&(a(I.state),l({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}),C(void 0))},[i.isTransitioning,I]),_.useEffect(()=>{process.env.NODE_ENV!=="production"&&sn(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let y=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:x=>n.navigate(x),push:(x,S,R)=>n.navigate(x,{state:S,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(x,S,R)=>n.navigate(x,{replace:!0,state:S,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),b=n.basename||"/",v=_.useMemo(()=>({router:n,navigator:y,static:!1,basename:b}),[n,y,b]),w=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.createElement(_.Fragment,null,_.createElement(es.Provider,{value:v},_.createElement(xl.Provider,{value:o},_.createElement(Dp.Provider,{value:E.current},_.createElement(wg.Provider,{value:i},_.createElement(WS,{basename:b,location:o.location,navigationType:o.historyAction,navigator:y,future:w},o.initialized||n.future.v7_partialHydration?_.createElement(l4,{routes:n.routes,future:n.future,state:o}):t))))),null)}const l4=_.memo(c4);function c4(e){let{routes:t,future:n,state:r}=e;return OS(t,void 0,r,n)}process.env.NODE_ENV;const u4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rp=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:A,replace:s,state:a,target:i,to:l,preventScrollReset:u,unstable_viewTransition:d}=t,f=bg(t,t4),{basename:B}=_.useContext(wr),I,C=!1;if(typeof l=="string"&&g4.test(l)&&(I=l,u4))try{let Q=new URL(window.location.href),y=l.startsWith("//")?new URL(Q.protocol+l):new URL(l),b=xr(y.pathname,B);y.origin===Q.origin&&b!=null?l=b+y.search+y.hash:C=!0}catch{process.env.NODE_ENV!=="production"&&sn(!1,'<Link to="'+l+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let E=wS(l,{relative:o}),h=f4(l,{replace:s,state:a,target:i,preventScrollReset:u,relative:o,unstable_viewTransition:d});function p(Q){r&&r(Q),Q.defaultPrevented||h(Q)}return _.createElement("a",Po({},f,{href:I||E,onClick:C||A?r:p,ref:n,target:i}))});process.env.NODE_ENV!=="production"&&(Rp.displayName="Link");const d4=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:A="",end:s=!1,style:a,to:i,unstable_viewTransition:l,children:u}=t,d=bg(t,n4),f=va(i,{relative:d.relative}),B=Ro(),I=_.useContext(xl),{navigator:C,basename:E}=_.useContext(wr),h=I!=null&&m4(f)&&l===!0,p=C.encodeLocation?C.encodeLocation(f).pathname:f.pathname,Q=B.pathname,y=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;o||(Q=Q.toLowerCase(),y=y?y.toLowerCase():null,p=p.toLowerCase()),y&&E&&(y=xr(y,E)||y);const b=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let v=Q===p||!s&&Q.startsWith(p)&&Q.charAt(b)==="/",w=y!=null&&(y===p||!s&&y.startsWith(p)&&y.charAt(p.length)==="/"),x={isActive:v,isPending:w,isTransitioning:h},S=v?r:void 0,R;typeof A=="function"?R=A(x):R=[A,v?"active":null,w?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let O=typeof a=="function"?a(x):a;return _.createElement(Rp,Po({},d,{"aria-current":S,className:R,ref:n,style:O,to:i,unstable_viewTransition:l}),typeof u=="function"?u(x):u)});process.env.NODE_ENV!=="production"&&(d4.displayName="NavLink");const C4=_.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:A,state:s,method:a=wl,action:i,onSubmit:l,relative:u,preventScrollReset:d,unstable_viewTransition:f}=e,B=bg(e,r4),I=h4(),C=Q4(i,{relative:u}),E=a.toLowerCase()==="get"?"get":"post",h=p=>{if(l&&l(p),p.defaultPrevented)return;p.preventDefault();let Q=p.nativeEvent.submitter,y=(Q==null?void 0:Q.getAttribute("formmethod"))||a;I(Q||p.currentTarget,{fetcherKey:n,method:y,navigate:r,replace:A,state:s,relative:u,preventScrollReset:d,unstable_viewTransition:f})};return _.createElement("form",Po({ref:t,method:E,action:C,onSubmit:o?l:h},B))});process.env.NODE_ENV!=="production"&&(C4.displayName="Form"),process.env.NODE_ENV;var Ol;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ol||(Ol={}));var kp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kp||(kp={}));function E4(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Pp(e){let t=_.useContext(es);return t||(process.env.NODE_ENV!=="production"?Fe(!1,E4(e)):Fe(!1)),t}function f4(e,t){let{target:n,replace:r,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,i=cn(),l=Ro(),u=va(e,{relative:s});return _.useCallback(d=>{if(ZS(d,n)){d.preventDefault();let f=r!==void 0?r:Do(l)===Do(u);i(e,{replace:f,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a})}},[l,i,u,r,o,n,e,A,s,a])}function pA(e){process.env.NODE_ENV!=="production"&&sn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(xg(e)),n=_.useRef(!1),r=Ro(),o=_.useMemo(()=>US(r.search,n.current?null:t.current),[r.search]),A=cn(),s=_.useCallback((a,i)=>{const l=xg(typeof a=="function"?a(o):a);n.current=!0,A("?"+l,i)},[A,o]);return[o,s]}function I4(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let p4=0,B4=()=>"__"+String(++p4)+"__";function h4(){let{router:e}=Pp(Ol.UseSubmit),{basename:t}=_.useContext(wr),n=jS();return _.useCallback(function(r,o){o===void 0&&(o={}),I4();let{action:A,method:s,encType:a,formData:i,body:l}=e4(r,t);if(o.navigate===!1){let u=o.fetcherKey||B4();e.fetch(u,n,o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function Q4(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=_.useContext(wr),o=_.useContext(Sr);o||(process.env.NODE_ENV!=="production"?Fe(!1,"useFormAction must be used inside a RouteContext"):Fe(!1));let[A]=o.matches.slice(-1),s=Po({},va(e||".",{relative:n})),a=Ro();if(e==null){s.search=a.search;let i=new URLSearchParams(s.search);i.has("index")&&i.get("index")===""&&(i.delete("index"),s.search=i.toString()?"?"+i.toString():"")}return(!e||e===".")&&A.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Gr([r,s.pathname])),Do(s)}function m4(e,t){t===void 0&&(t={});let n=_.useContext(wg);n==null&&(process.env.NODE_ENV!=="production"?Fe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Fe(!1));let{basename:r}=Pp(Ol.useViewTransitionState),o=va(e,{relative:t.relative});if(!n.isTransitioning)return!1;let A=xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hl(o.pathname,s)!=null||hl(o.pathname,A)!=null}const y4=g.styled(g.Stack)`
98
+ */function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}function bg(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,A;for(A=0;A<r.length;A++)o=r[A],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const wl="get",Sl="application/x-www-form-urlencoded";function Tl(e){return e!=null&&typeof e.tagName=="string"}function Y4(e){return Tl(e)&&e.tagName.toLowerCase()==="button"}function J4(e){return Tl(e)&&e.tagName.toLowerCase()==="form"}function X4(e){return Tl(e)&&e.tagName.toLowerCase()==="input"}function q4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Z4(e,t){return e.button===0&&(!t||t==="_self")&&!q4(e)}function xg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function U4(e,t){let n=xg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(A=>{n.append(o,A)})}),n}let _l=null;function $4(){if(_l===null)try{new FormData(document.createElement("form"),0),_l=!1}catch{_l=!0}return _l}const K4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vg(e){return e!=null&&!K4.has(e)?(process.env.NODE_ENV!=="production"&&sn(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Sl+'"')),null):e}function eS(e,t){let n,r,o,A,s;if(J4(e)){let a=e.getAttribute("action");r=a?xr(a,t):null,n=e.getAttribute("method")||wl,o=vg(e.getAttribute("enctype"))||Sl,A=new FormData(e)}else if(Y4(e)||X4(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||a.getAttribute("action");if(r=i?xr(i,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,o=vg(e.getAttribute("formenctype"))||vg(a.getAttribute("enctype"))||Sl,A=new FormData(a,e),!$4()){let{name:l,type:u,value:d}=e;if(u==="image"){let f=l?l+".":"";A.append(f+"x","0"),A.append(f+"y","0")}else l&&A.append(l,d)}}else{if(Tl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,o=Sl,s=e}return A&&o==="text/plain"&&(s=A,A=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:A,body:s}}const tS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],nS=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],rS=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],oS="6";try{window.__reactRouterVersion=oS}catch{}function Op(e,t){return r4({basename:t==null?void 0:t.basename,future:Po({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:w3({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||AS(),routes:e,mapRouteProperties:z4,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function AS(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Po({},t,{errors:sS(t.errors)})),t}function sS(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Ql(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let A=window[o.__subType];if(typeof A=="function")try{let s=new A(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let A=new Error(o.message);A.stack="",n[r]=A}}else n[r]=o;return n}const wg=_.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(wg.displayName="ViewTransition");const Dp=_.createContext(new Map);process.env.NODE_ENV!=="production"&&(Dp.displayName="Fetchers");const Lp=_["startTransition"],Fp=m2["flushSync"];function aS(e){Lp?Lp(e):e()}function Sa(e){Fp?Fp(e):e()}class iS{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Np(e){let{fallbackElement:t,router:n,future:r}=e,[o,A]=_.useState(n.state),[s,a]=_.useState(),[i,l]=_.useState({isTransitioning:!1}),[u,d]=_.useState(),[f,B]=_.useState(),[I,C]=_.useState(),E=_.useRef(new Map),{v7_startTransition:h}=r||{},p=_.useCallback(x=>{h?aS(x):x()},[h]),Q=_.useCallback((x,S)=>{let{deletedFetchers:R,unstable_flushSync:O,unstable_viewTransitionOpts:N}=S;R.forEach(L=>E.current.delete(L)),x.fetchers.forEach((L,X)=>{L.data!==void 0&&E.current.set(X,L.data)});let W=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||W){O?Sa(()=>A(x)):p(()=>A(x));return}if(O){Sa(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let L=n.window.document.startViewTransition(()=>{Sa(()=>A(x))});L.finished.finally(()=>{Sa(()=>{d(void 0),B(void 0),a(void 0),l({isTransitioning:!1})})}),Sa(()=>B(L));return}f?(u&&u.resolve(),f.skipTransition(),C({state:x,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(x),l({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,f,u,E,p]);_.useLayoutEffect(()=>n.subscribe(Q),[n,Q]),_.useEffect(()=>{i.isTransitioning&&!i.flushSync&&d(new iS)},[i]),_.useEffect(()=>{if(u&&s&&n.window){let x=s,S=u.promise,R=n.window.document.startViewTransition(async()=>{p(()=>A(x)),await S});R.finished.finally(()=>{d(void 0),B(void 0),a(void 0),l({isTransitioning:!1})}),B(R)}},[p,s,u,n.window]),_.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),_.useEffect(()=>{!i.isTransitioning&&I&&(a(I.state),l({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}),C(void 0))},[i.isTransitioning,I]),_.useEffect(()=>{process.env.NODE_ENV!=="production"&&sn(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let y=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:x=>n.navigate(x),push:(x,S,R)=>n.navigate(x,{state:S,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(x,S,R)=>n.navigate(x,{replace:!0,state:S,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),b=n.basename||"/",v=_.useMemo(()=>({router:n,navigator:y,static:!1,basename:b}),[n,y,b]),w=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.createElement(_.Fragment,null,_.createElement(es.Provider,{value:v},_.createElement(xl.Provider,{value:o},_.createElement(Dp.Provider,{value:E.current},_.createElement(wg.Provider,{value:i},_.createElement(W4,{basename:b,location:o.location,navigationType:o.historyAction,navigator:y,future:w},o.initialized||n.future.v7_partialHydration?_.createElement(lS,{routes:n.routes,future:n.future,state:o}):t))))),null)}const lS=_.memo(cS);function cS(e){let{routes:t,future:n,state:r}=e;return O4(t,void 0,r,n)}process.env.NODE_ENV;const uS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rp=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:A,replace:s,state:a,target:i,to:l,preventScrollReset:u,unstable_viewTransition:d}=t,f=bg(t,tS),{basename:B}=_.useContext(wr),I,C=!1;if(typeof l=="string"&&gS.test(l)&&(I=l,uS))try{let Q=new URL(window.location.href),y=l.startsWith("//")?new URL(Q.protocol+l):new URL(l),b=xr(y.pathname,B);y.origin===Q.origin&&b!=null?l=b+y.search+y.hash:C=!0}catch{process.env.NODE_ENV!=="production"&&sn(!1,'<Link to="'+l+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let E=w4(l,{relative:o}),h=fS(l,{replace:s,state:a,target:i,preventScrollReset:u,relative:o,unstable_viewTransition:d});function p(Q){r&&r(Q),Q.defaultPrevented||h(Q)}return _.createElement("a",Po({},f,{href:I||E,onClick:C||A?r:p,ref:n,target:i}))});process.env.NODE_ENV!=="production"&&(Rp.displayName="Link");const dS=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:A="",end:s=!1,style:a,to:i,unstable_viewTransition:l,children:u}=t,d=bg(t,nS),f=va(i,{relative:d.relative}),B=Ro(),I=_.useContext(xl),{navigator:C,basename:E}=_.useContext(wr),h=I!=null&&mS(f)&&l===!0,p=C.encodeLocation?C.encodeLocation(f).pathname:f.pathname,Q=B.pathname,y=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;o||(Q=Q.toLowerCase(),y=y?y.toLowerCase():null,p=p.toLowerCase()),y&&E&&(y=xr(y,E)||y);const b=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let v=Q===p||!s&&Q.startsWith(p)&&Q.charAt(b)==="/",w=y!=null&&(y===p||!s&&y.startsWith(p)&&y.charAt(p.length)==="/"),x={isActive:v,isPending:w,isTransitioning:h},S=v?r:void 0,R;typeof A=="function"?R=A(x):R=[A,v?"active":null,w?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let O=typeof a=="function"?a(x):a;return _.createElement(Rp,Po({},d,{"aria-current":S,className:R,ref:n,style:O,to:i,unstable_viewTransition:l}),typeof u=="function"?u(x):u)});process.env.NODE_ENV!=="production"&&(dS.displayName="NavLink");const CS=_.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:A,state:s,method:a=wl,action:i,onSubmit:l,relative:u,preventScrollReset:d,unstable_viewTransition:f}=e,B=bg(e,rS),I=hS(),C=QS(i,{relative:u}),E=a.toLowerCase()==="get"?"get":"post",h=p=>{if(l&&l(p),p.defaultPrevented)return;p.preventDefault();let Q=p.nativeEvent.submitter,y=(Q==null?void 0:Q.getAttribute("formmethod"))||a;I(Q||p.currentTarget,{fetcherKey:n,method:y,navigate:r,replace:A,state:s,relative:u,preventScrollReset:d,unstable_viewTransition:f})};return _.createElement("form",Po({ref:t,method:E,action:C,onSubmit:o?l:h},B))});process.env.NODE_ENV!=="production"&&(CS.displayName="Form"),process.env.NODE_ENV;var Ol;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ol||(Ol={}));var kp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kp||(kp={}));function ES(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Pp(e){let t=_.useContext(es);return t||(process.env.NODE_ENV!=="production"?Fe(!1,ES(e)):Fe(!1)),t}function fS(e,t){let{target:n,replace:r,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,i=cn(),l=Ro(),u=va(e,{relative:s});return _.useCallback(d=>{if(Z4(d,n)){d.preventDefault();let f=r!==void 0?r:Do(l)===Do(u);i(e,{replace:f,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a})}},[l,i,u,r,o,n,e,A,s,a])}function pA(e){process.env.NODE_ENV!=="production"&&sn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(xg(e)),n=_.useRef(!1),r=Ro(),o=_.useMemo(()=>U4(r.search,n.current?null:t.current),[r.search]),A=cn(),s=_.useCallback((a,i)=>{const l=xg(typeof a=="function"?a(o):a);n.current=!0,A("?"+l,i)},[A,o]);return[o,s]}function IS(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let pS=0,BS=()=>"__"+String(++pS)+"__";function hS(){let{router:e}=Pp(Ol.UseSubmit),{basename:t}=_.useContext(wr),n=j4();return _.useCallback(function(r,o){o===void 0&&(o={}),IS();let{action:A,method:s,encType:a,formData:i,body:l}=eS(r,t);if(o.navigate===!1){let u=o.fetcherKey||BS();e.fetch(u,n,o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function QS(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=_.useContext(wr),o=_.useContext(Sr);o||(process.env.NODE_ENV!=="production"?Fe(!1,"useFormAction must be used inside a RouteContext"):Fe(!1));let[A]=o.matches.slice(-1),s=Po({},va(e||".",{relative:n})),a=Ro();if(e==null){s.search=a.search;let i=new URLSearchParams(s.search);i.has("index")&&i.get("index")===""&&(i.delete("index"),s.search=i.toString()?"?"+i.toString():"")}return(!e||e===".")&&A.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Gr([r,s.pathname])),Do(s)}function mS(e,t){t===void 0&&(t={});let n=_.useContext(wg);n==null&&(process.env.NODE_ENV!=="production"?Fe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Fe(!1));let{basename:r}=Pp(Ol.useViewTransitionState),o=va(e,{relative:t.relative});if(!n.isTransitioning)return!1;let A=xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hl(o.pathname,s)!=null||hl(o.pathname,A)!=null}const yS=g.styled(g.Stack)`
99
99
  width: 100%;
100
100
  height: 100%;
101
101
  align-items: center;
102
102
  justify-content: center;
103
- `,b4=g.styled(g.Stack)`
103
+ `,bS=g.styled(g.Stack)`
104
104
  height: 380px;
105
105
  border-radius: 10px;
106
106
  overflow: hidden;
107
107
  flex-direction: row;
108
- `,x4=g.styled(g.Box)`
108
+ `,xS=g.styled(g.Box)`
109
109
  width: 367px;
110
110
  height: 100%;
111
111
  background: #f6f8fc;
@@ -119,7 +119,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
119
119
  color: #196fe0;
120
120
  cursor: pointer;
121
121
  }
122
- `,v4=g.styled(g.Box)`
122
+ `,vS=g.styled(g.Box)`
123
123
  width: 501px;
124
124
  height: 100%;
125
125
  background: #e5eeff;
@@ -128,7 +128,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
128
128
  width: 476px;
129
129
  height: 267px;
130
130
  }
131
- `,w4=g.styled(g.Stack)`
131
+ `,wS=g.styled(g.Stack)`
132
132
  width: 92px;
133
133
  height: 20px;
134
134
  background: #fab400;
@@ -139,7 +139,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
139
139
  border-radius: 11px;
140
140
  justify-content: center;
141
141
  align-items: center;
142
- `,S4="Customising connectors on the agent’s panel",T4="Configure your Connectors in the right panel, add your cards and name them how you want the agents to see and update them.",_4="Coming Soon",O4="Have any questions? ",Mp="internal-chat",D4="https://cdn.hiverhq.com/connectors-module/assets/RequestNewCCLogo.svg",L4="https://cdn.hiverhq.com/connectors-module/assets/agent-view.svg",F4="https://cdn.hiverhq.com/connectors-module/assets/RequestConnector.svg",N4="https://cdn.hiverhq.com/connectors-module/assets/UpgradeImage.svg",R4=()=>{const{availableFeatures:e}=m.useContext(on),t=n=>{n.stopPropagation(),Mr(e,Mp)&&yf()};return c.jsx(y4,{children:c.jsxs(b4,{children:[c.jsxs(x4,{children:[c.jsx(w4,{children:_4}),c.jsx(g.Typography,{variant:"h2",children:S4}),c.jsx(g.Typography,{variant:"body2",className:"description__agentView",children:T4}),c.jsxs(g.Typography,{variant:"body1",className:"description__agentView",children:[O4,c.jsx("span",{className:"contact__agentView",onClick:t,children:pf})]})]}),c.jsx(v4,{children:c.jsx("img",{src:L4,alt:"agent-view"})})]})})},k4=g.styled(g.Stack)`
142
+ `,SS="Customising connectors on the agent’s panel",TS="Configure your Connectors in the right panel, add your cards and name them how you want the agents to see and update them.",_S="Coming Soon",OS="Have any questions? ",Mp="internal-chat",DS="https://cdn.hiverhq.com/connectors-module/assets/RequestNewCCLogo.svg",LS="https://cdn.hiverhq.com/connectors-module/assets/agent-view.svg",FS="https://cdn.hiverhq.com/connectors-module/assets/RequestConnector.svg",NS="https://cdn.hiverhq.com/connectors-module/assets/UpgradeImage.svg",RS=()=>{const{availableFeatures:e}=m.useContext(on),t=n=>{n.stopPropagation(),Mr(e,Mp)&&yf()};return c.jsx(yS,{children:c.jsxs(bS,{children:[c.jsxs(xS,{children:[c.jsx(wS,{children:_S}),c.jsx(g.Typography,{variant:"h2",children:SS}),c.jsx(g.Typography,{variant:"body2",className:"description__agentView",children:TS}),c.jsxs(g.Typography,{variant:"body1",className:"description__agentView",children:[OS,c.jsx("span",{className:"contact__agentView",onClick:t,children:pf})]})]}),c.jsx(vS,{children:c.jsx("img",{src:LS,alt:"agent-view"})})]})})},kS=g.styled(g.Stack)`
143
143
  box-sizing: border-box;
144
144
  min-height: 100%;
145
145
  padding: 0;
@@ -147,7 +147,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
147
147
  align-items: center;
148
148
  flex-direction: row;
149
149
  margin-left: 23px;
150
- `,P4=()=>c.jsx(k4,{children:c.jsx(R4,{})}),M4="Enhance with Custom Connectors",j4="Let us know your use case, and we'll design and deliver a custom connector tailored to your needs within a few working days.",jp="Request new connector",V4="Create your own (coming soon)",G4="Request new feature",H4="Request a new connector",Vp="Tell us your use case and we will create a connector for you within a few working days.",W4=`Request new connectors to get better customer context and key actions right into your inbox. ${Vp}`,z4="Select a feature",Y4="Select a connector",J4="Feel free to add specific details (Optional)",X4="Submit Request",q4="Request submitted",Z4="Your request has been submitted successfully. We will get back to you within a few working days.",U4="Done",$4="Add connector",K4="Edit connector",eT="Enable",tT="Disable",Gp={CONNECTOR:"connector",API:"api"},nT="Failed to submit the request. Please try again.",ct={REQUEST_NEW_CLICKED:"request_new_connector_clicked",TOGGLE_ENABLED:"connector_enabled_clicked",TOGGLE_DISABLED:"connector_disabled_clicked",SETTINGS_CLICKED:"connector_settings_clicked",ADD_CONNECTOR_CLICKED:"add_connector_clicked",CONNECTOR_BACK_CLICKED:"connector_back_button_clicked",SAVE_AUTHORIZE_CLICKED:"save_and_authenticate_clicked",SEND_TEST_CLICK:"send_test_request_clicked",AUTH_UPDATED:"auth_type_updated",REQUEST_NEW_FEATURE_CLICKED:"request_new_feature_clicked",REQUEST_NEW_CONNECTOR_SHOWN:"request_new_connector_popup_shown",REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED:"request_new_connector_popup_submitted_clicked",REQUEST_NEW_CONNECTOR_CLOSE_CLICKED:"request_new_connector_popup_closed_clicked",REQUEST_NEW_CONNECTOR_DONE_CLICKED:"request_new_connector_popup_done_clicked",REQUEST_NEW_FEATURE_SHOWN:"request_new_feature_popup_shown",REQUEST_NEW_FEATURE_SUBMIT_CLICKED:"request_new_feature_popup_submitted_clicked",REQUEST_NEW_FEATURE_CLOSE_CLICKED:"request_new_feature_popup_closed_clicked",REQUEST_NEW_FEATURE_DONE_CLICKED:"request_new_feature_popup_done_clicked",LIBRARY_CARD_CLICKED:"library_item_clicked",TAB_CLICKED:"tab_clicked",CONFIGURE_VISIBILITY_CLICKED:"configure_visibility_clicked",CARD_VISIBILITY_UPDATED:"card_visibility_updated",CARD_VISIBILITY_UPDATE_CLOSED:"card_visibility_update_closed",CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED:"connector_visibility_field_tab_clicked",SCHEDULE_CALL_CLICKED:"schedule_call_clicked",SCHEDULE_CALL_CROSS_CLICKED:"schedule_call_cross_clicked",CONNECTOR_VIDEO_CLICKED:"connector_video_clicked",CONNECTOR_AUTH_PAGE_KB_CLICKED:"connector_auth_page_kb_clicked",CONNECTOR_AUTH_PAGE_CONTACT_SUPPORT_CLICKED:"connector_auth_page_contact_support_clicked",CONNECTOR_AUTH_SUCCESS:"connector_auth_success",CONNECTOR_SECTION_VIEWED:"connector_section_viewed"},rT={AUTH_PAGE:"auth_page",DETAILS_PAGE:"details_page",CONNECTORS_PAGE_ADMIN_SIDE:"connectors_page_admin_side"},Mo=RE.withTypes(),At=DE.withTypes(),Tr=g.styled(g.Skeleton)`
150
+ `,PS=()=>c.jsx(kS,{children:c.jsx(RS,{})}),MS="Enhance with Custom Connectors",jS="Let us know your use case, and we'll design and deliver a custom connector tailored to your needs within a few working days.",jp="Request new connector",VS="Create your own (coming soon)",GS="Request new feature",HS="Request a new connector",Vp="Tell us your use case and we will create a connector for you within a few working days.",WS=`Request new connectors to get better customer context and key actions right into your inbox. ${Vp}`,zS="Select a feature",YS="Select a connector",JS="Feel free to add specific details (Optional)",XS="Submit Request",qS="Request submitted",ZS="Your request has been submitted successfully. We will get back to you within a few working days.",US="Done",$S="Add connector",KS="Edit connector",eT="Enable",tT="Disable",Gp={CONNECTOR:"connector",API:"api"},nT="Failed to submit the request. Please try again.",ct={REQUEST_NEW_CLICKED:"request_new_connector_clicked",TOGGLE_ENABLED:"connector_enabled_clicked",TOGGLE_DISABLED:"connector_disabled_clicked",SETTINGS_CLICKED:"connector_settings_clicked",ADD_CONNECTOR_CLICKED:"add_connector_clicked",CONNECTOR_BACK_CLICKED:"connector_back_button_clicked",SAVE_AUTHORIZE_CLICKED:"save_and_authenticate_clicked",SEND_TEST_CLICK:"send_test_request_clicked",AUTH_UPDATED:"auth_type_updated",REQUEST_NEW_FEATURE_CLICKED:"request_new_feature_clicked",REQUEST_NEW_CONNECTOR_SHOWN:"request_new_connector_popup_shown",REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED:"request_new_connector_popup_submitted_clicked",REQUEST_NEW_CONNECTOR_CLOSE_CLICKED:"request_new_connector_popup_closed_clicked",REQUEST_NEW_CONNECTOR_DONE_CLICKED:"request_new_connector_popup_done_clicked",REQUEST_NEW_FEATURE_SHOWN:"request_new_feature_popup_shown",REQUEST_NEW_FEATURE_SUBMIT_CLICKED:"request_new_feature_popup_submitted_clicked",REQUEST_NEW_FEATURE_CLOSE_CLICKED:"request_new_feature_popup_closed_clicked",REQUEST_NEW_FEATURE_DONE_CLICKED:"request_new_feature_popup_done_clicked",LIBRARY_CARD_CLICKED:"library_item_clicked",TAB_CLICKED:"tab_clicked",CONFIGURE_VISIBILITY_CLICKED:"configure_visibility_clicked",CARD_VISIBILITY_UPDATED:"card_visibility_updated",CARD_VISIBILITY_UPDATE_CLOSED:"card_visibility_update_closed",CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED:"connector_visibility_field_tab_clicked",SCHEDULE_CALL_CLICKED:"schedule_call_clicked",SCHEDULE_CALL_CROSS_CLICKED:"schedule_call_cross_clicked",CONNECTOR_VIDEO_CLICKED:"connector_video_clicked",CONNECTOR_AUTH_PAGE_KB_CLICKED:"connector_auth_page_kb_clicked",CONNECTOR_AUTH_PAGE_CONTACT_SUPPORT_CLICKED:"connector_auth_page_contact_support_clicked",CONNECTOR_AUTH_SUCCESS:"connector_auth_success",CONNECTOR_SECTION_VIEWED:"connector_section_viewed"},rT={AUTH_PAGE:"auth_page",DETAILS_PAGE:"details_page",CONNECTORS_PAGE_ADMIN_SIDE:"connectors_page_admin_side"},Mo=RE.withTypes(),At=DE.withTypes(),Tr=g.styled(g.Skeleton)`
151
151
  display: block;
152
152
  margin: ${e=>e.margin?e.margin:0};
153
153
  `,oT=g.styled("li")`
@@ -293,7 +293,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
293
293
  box-shadow: none;
294
294
  color: ${g.theme.palette.gray.black};
295
295
  border: 1px solid ${g.theme.palette.gray.gray5};
296
- `,qT=({setModalState:e})=>{const t=n=>{n==null||n.stopPropagation(),e(!0)};return c.jsxs(GT,{direction:"row",justifyContent:"space-between","data-testid":"connector-not-available-request-new",children:[c.jsxs(HT,{children:[c.jsx(WT,{variant:"h1",color:g.theme.palette.gray.black,children:M4}),c.jsx(zT,{variant:"body1",color:g.theme.palette.gray.gray2,children:j4}),c.jsxs(YT,{direction:"row",justifyContent:"space-between",children:[c.jsx(JT,{variant:"contained",onClick:t,children:jp}),c.jsx(XT,{variant:"outlined",className:"create-own__btn",children:V4})]})]}),c.jsx(VT,{children:c.jsx("img",{src:D4})})]})},_g=m.createContext({hasRendered:!1,setHasRendered:()=>{}}),qp=m.memo(({children:e})=>{const[t,n]=m.useState(!1),r=m.useMemo(()=>({hasRendered:t,setHasRendered:n}),[t,n]);return c.jsx(_g.Provider,{value:r,children:e})});qp.displayName="SingletonProvider";const Zp=e=>e.connectorLirary.connectorList,Dl=e=>e.connectorLirary.connectors,Up=e=>e.connectorLirary.connectorsApiStatus,ZT=e=>e.connectorLirary.currentUpdatingConnectors,Og=e=>e.connectorLirary.connectorDetailApiStatus,$p=e=>e.connectorLirary.emailInboxDetails,Kp=e=>e.connectorLirary.rolesAndPermissions,UT=e=>e.connectorLirary.updateEnableConnectorsApiStatus,$T=e=>e.connectorLirary.cardCustomFields,KT=e=>e.connectorLirary.cardCustomFieldsApiStatus,e5=g.styled(g.Box)`
296
+ `,qT=({setModalState:e})=>{const t=n=>{n==null||n.stopPropagation(),e(!0)};return c.jsxs(GT,{direction:"row",justifyContent:"space-between","data-testid":"connector-not-available-request-new",children:[c.jsxs(HT,{children:[c.jsx(WT,{variant:"h1",color:g.theme.palette.gray.black,children:MS}),c.jsx(zT,{variant:"body1",color:g.theme.palette.gray.gray2,children:jS}),c.jsxs(YT,{direction:"row",justifyContent:"space-between",children:[c.jsx(JT,{variant:"contained",onClick:t,children:jp}),c.jsx(XT,{variant:"outlined",className:"create-own__btn",children:VS})]})]}),c.jsx(VT,{children:c.jsx("img",{src:DS})})]})},_g=m.createContext({hasRendered:!1,setHasRendered:()=>{}}),qp=m.memo(({children:e})=>{const[t,n]=m.useState(!1),r=m.useMemo(()=>({hasRendered:t,setHasRendered:n}),[t,n]);return c.jsx(_g.Provider,{value:r,children:e})});qp.displayName="SingletonProvider";const Zp=e=>e.connectorLirary.connectorList,Dl=e=>e.connectorLirary.connectors,Up=e=>e.connectorLirary.connectorsApiStatus,ZT=e=>e.connectorLirary.currentUpdatingConnectors,Og=e=>e.connectorLirary.connectorDetailApiStatus,$p=e=>e.connectorLirary.emailInboxDetails,Kp=e=>e.connectorLirary.rolesAndPermissions,UT=e=>e.connectorLirary.updateEnableConnectorsApiStatus,$T=e=>e.connectorLirary.cardCustomFields,KT=e=>e.connectorLirary.cardCustomFieldsApiStatus,e5=g.styled(g.Box)`
297
297
  border-radius: 4px;
298
298
  border: 1px solid ${g.theme.palette.gray.gray5};
299
299
  margin-bottom: 12px;
@@ -598,7 +598,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
598
598
  margin: 0;
599
599
  padding-inline-start: 20px;
600
600
  }
601
- `,W6=({connectorName:e,updates:t=""})=>c.jsxs(g.Stack,{padding:"20px",children:[c.jsxs(g.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),c.jsx(H6,{variant:"body2",color:g.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),z6=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),jB=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),{id:A,name:s,logo:a,description:i,isAuthenticated:l,showUpgradeButton:u=!1,updates:d}=e,f=At(ZT),B=At(Up),I=At(Og),[C,E]=m.useState(!1),h=Mo(),p=cn(),Q=(L,X)=>{L==null||L.stopPropagation(),h(Al({id:X,enabled:L.target.checked})).unwrap().then(()=>{L.target.checked?o(ct.TOGGLE_ENABLED,{connector_name:s}):(o(ct.TOGGLE_DISABLED,{connector_name:s}),Gn({message:c5,type:eB}))}).catch(()=>{Gn({message:l5,type:Eo})})},y=(L,X)=>{L==null||L.stopPropagation(),o(ct.ADD_CONNECTOR_CLICKED,{connector_name:s}),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${X}`)},b=(L,X)=>{L==null||L.stopPropagation(),o(ct.SETTINGS_CLICKED,{connector_name:s}),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${X}?isEdit=true`)},v=(L,X="")=>{L==null||L.preventDefault(),L==null||L.stopPropagation(),!t&&p(`${et.BASEPATH}${et.API_VIEW}/${X}?isEdit=true`)},w=L=>{L==null||L.stopPropagation(),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${A}?isEdit=true`)};let x=!1;"isEnabled"in e&&typeof e.isEnabled=="boolean"&&(x=e.isEnabled);const S=!(e!=null&&e.isAuthenticated),R=[B,I].includes(Te.LOADING)||S,O=!t&&(e==null?void 0:e.cardList)&&e.isEnabled&&e.isAuthenticated,W=bf({"connector-flex":!0,"connector-settings":!!t,"connector-expanded":!t&&x&&!!l,"connector-has-upgrade":u});return c.jsxs(e5,{className:t?"noBorder":"",children:[c.jsx(B5,{shown:C,setShown:E,connectorName:e.name}),c.jsxs(t5,{"data-testid":A,className:"connector-grid",onClick:L=>v(L,A),children:[c.jsxs(g.Stack,{className:W,width:"100%",children:[c.jsx(g.Stack,{direction:"row",gap:1,alignItems:"center",children:c.jsxs(g.Stack,{flexDirection:"row",alignItems:"center",children:[t?c.jsx("img",{src:a??"",className:"logoIcon",width:"28xp",height:"28px",alt:s}):null,c.jsxs(g.Box,{children:[c.jsx(n5,{variant:r?"body1_medium":"h2",children:s}),c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",hidden:t||!u||S||!d,children:[c.jsx(g.Typography,{variant:"body2",color:g.theme.palette.gray.gray3,children:_T}),c.jsx(z6,{placement:"bottom",title:c.jsx(W6,{connectorName:e.name,updates:d}),children:c.jsx(g.Icon,{children:c.jsx(i5,{})})})]})]})]})}),t&&!n?c.jsx(s5,{variant:"contained",onClick:L=>y(L,A),children:$4}):c.jsxs(r5,{children:[!t&&u&&!S?c.jsx(g.Box,{marginRight:"7px",children:c.jsx(g.Button,{size:"small",onClick:w,children:ST})}):null,!t&&S?c.jsx(a5,{severity:"error",children:TT}):null,c.jsx(g.Tooltip,{title:K4,placement:"bottom",children:c.jsx(g.IconButton,{onClick:L=>b(L,A),children:c.jsx("img",{src:u5,className:"settingsIcon"})})}),(f==null?void 0:f[A])!==Te.LOADING?c.jsx(g.Tooltip,{title:x?tT:eT,placement:"bottom",children:c.jsx(g.Switch,{id:`switch_${A}`,checked:x,disabled:R,onClick:L=>L==null?void 0:L.stopPropagation(),onChange:L=>Q(L,A)})}):c.jsx(o5,{width:"58px",height:"38px",alignItems:"center",flexDirection:"row",justifyContent:"center",children:c.jsx(A5,{"data-testid":"loading"})})]})]}),t?c.jsx(g.Typography,{maxWidth:"577px",variant:"body1",color:g.theme.palette.gray.gray3,className:"connector-grid",children:i}):null]}),O?c.jsx(G6,{setShowEnabledModal:E,currentConnectorId:A,infoCards:e.cardList||[]}):null]})},Y6=()=>{const e=At(Zp),t=At(Dl);return c.jsx(qp,{children:c.jsx(g.Box,{"data-testid":"connector-custom-card",children:e.map(n=>{var r;return(r=t==null?void 0:t[n])!=null&&r.id?c.jsx(jB,{connector:t[n],isConfigSettingsPage:!1,isConnectorCard:!0},n):null})})})},VB=e=>e.requestConnectorApi.connectorRequestsApiStatus,J6=e=>e.requestConnectorApi.requestableConnectors,X6=e=>e.requestConnectorApi.requestableApis,q6=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:o,handleSubmit:A,isApiText:s})=>{const{sendTrackingEvent:a}=m.useContext(on),l=At(VB)===Te.LOADING,u=r.length===0?s?z4:Y4:"";return m.useEffect(()=>{a(s?ct.REQUEST_NEW_FEATURE_SHOWN:ct.REQUEST_NEW_CONNECTOR_SHOWN)},[a,s]),c.jsx(g.Stack,{"data-testid":"request-panel",children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"440px",height:"100%",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsxs(g.Stack,{gap:"4px",marginBottom:"36px",children:[c.jsx(g.Typography,{variant:"h2",children:s?G4:H4}),c.jsx(g.Typography,{variant:"body2",children:s?Vp:W4})]}),c.jsx(g.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:l,isOptionEqualToValue:(d,f)=>d.id===f.id,renderOption:(d,f,{selected:B})=>{const{key:I,...C}=d;return c.jsxs(g.Box,{component:"li",...C,minHeight:"36px",children:[c.jsx(g.Checkbox,{style:{marginRight:8},checked:B}),f.label]},I)},renderInput:d=>c.jsx(td,{...d,variant:"outlined",placeholder:u}),ListboxProps:{style:{maxHeight:250}},onChange:(d,f)=>{n(f)}}),c.jsx(kB,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:l,placeholder:J4,onChange:d=>{o(d.target.value)}})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(g.Button,{"data-testid":"submit-request-button",onClick:A,color:"tertiary",size:"medium",sx:{height:"32px",width:"140.25px"},disabled:!t||l,children:l?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):c.jsx("div",{children:X4})})})]})})},Z6=({handleClose:e})=>c.jsx(g.Stack,{children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"378px",height:"100%",justifyContent:"center",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsx("img",{src:tB,alt:"checkmark",width:92,height:92}),c.jsxs(g.Stack,{gap:"4px",children:[c.jsx(g.Typography,{variant:"h2",children:q4}),c.jsx(g.Typography,{variant:"body2",children:Z4})]})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(_6,{onClick:e,variant:"outlined",color:"tertiary",size:"medium",children:U4})})]})}),nd=({shown:e,setShown:t,connectorType:n,isApi:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),A=Mo(),s=At(J6),a=At(X6),i=At(VB),[l,u]=m.useState(""),[d,f]=m.useState([]),[B,I]=m.useState([]),[C,E]=m.useState(!1),[h,p]=m.useState(!1),Q=()=>{const w=r?Gp.API:Gp.CONNECTOR,x=B.map(S=>S.id);A(dl({type:w,values:x,description:l})).unwrap().then(()=>{o(r?ct.REQUEST_NEW_FEATURE_SUBMIT_CLICKED:ct.REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED),p(!0)}).catch(()=>{Gn({message:nT,type:Eo})})};m.useEffect(()=>(e&&h&&p(!1),()=>{I([]),u("")}),[e]),m.useEffect(()=>{var w;if(r){const x=((w=a==null?void 0:a.find(S=>S.connector_type===n))==null?void 0:w.apis)||[];f(x.map(S=>({label:S.name,id:S.key})))}else f((s||[]).map(x=>({label:x.name,id:x.key})))},[a,s,r,n]),m.useEffect(()=>{E(B.length>0)},[B,l]);const y=h&&i!==Te.LOADING,b=w=>{w||o(r?ct.REQUEST_NEW_FEATURE_CLOSE_CLICKED:ct.REQUEST_NEW_CONNECTOR_CLOSE_CLICKED),t(w)},v=()=>{t(!1),o(r?ct.REQUEST_NEW_FEATURE_DONE_CLICKED:ct.REQUEST_NEW_CONNECTOR_DONE_CLICKED)};return c.jsxs(Dg,{shown:e,setShown:b,showCloseButton:!0,children:[y?c.jsx(Z6,{handleClose:v}):c.jsx(q6,{connectors:d,canSubmit:C,setSelectedConnectors:I,selectedConnectors:B,setOptionalDetails:u,handleSubmit:Q,isApiText:r}),c.jsx(T6,{children:c.jsx("img",{loading:"lazy",className:"request-new-connector-img",src:F4,alt:"Request new connector"})})]})},U6="Custom Connectors",$6="Connectors help you get a better customer context and key actions right into your inbox",K6="Library",e_="Use these pre-built connectors to get started without any hassle. Authenticate and access them from the right panel of Hiver.",t_=g.styled(g.Box)`
601
+ `,W6=({connectorName:e,updates:t=""})=>c.jsxs(g.Stack,{padding:"20px",children:[c.jsxs(g.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),c.jsx(H6,{variant:"body2",color:g.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),z6=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),jB=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),{id:A,name:s,logo:a,description:i,isAuthenticated:l,showUpgradeButton:u=!1,updates:d}=e,f=At(ZT),B=At(Up),I=At(Og),[C,E]=m.useState(!1),h=Mo(),p=cn(),Q=(L,X)=>{L==null||L.stopPropagation(),h(Al({id:X,enabled:L.target.checked})).unwrap().then(()=>{L.target.checked?o(ct.TOGGLE_ENABLED,{connector_name:s}):(o(ct.TOGGLE_DISABLED,{connector_name:s}),Gn({message:c5,type:eB}))}).catch(()=>{Gn({message:l5,type:Eo})})},y=(L,X)=>{L==null||L.stopPropagation(),o(ct.ADD_CONNECTOR_CLICKED,{connector_name:s}),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${X}`)},b=(L,X)=>{L==null||L.stopPropagation(),o(ct.SETTINGS_CLICKED,{connector_name:s}),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${X}?isEdit=true`)},v=(L,X="")=>{L==null||L.preventDefault(),L==null||L.stopPropagation(),!t&&p(`${et.BASEPATH}${et.API_VIEW}/${X}?isEdit=true`)},w=L=>{L==null||L.stopPropagation(),p(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${A}?isEdit=true`)};let x=!1;"isEnabled"in e&&typeof e.isEnabled=="boolean"&&(x=e.isEnabled);const S=!(e!=null&&e.isAuthenticated),R=[B,I].includes(Te.LOADING)||S,O=!t&&(e==null?void 0:e.cardList)&&e.isEnabled&&e.isAuthenticated,W=bf({"connector-flex":!0,"connector-settings":!!t,"connector-expanded":!t&&x&&!!l,"connector-has-upgrade":u});return c.jsxs(e5,{className:t?"noBorder":"",children:[c.jsx(B5,{shown:C,setShown:E,connectorName:e.name}),c.jsxs(t5,{"data-testid":A,className:"connector-grid",onClick:L=>v(L,A),children:[c.jsxs(g.Stack,{className:W,width:"100%",children:[c.jsx(g.Stack,{direction:"row",gap:1,alignItems:"center",children:c.jsxs(g.Stack,{flexDirection:"row",alignItems:"center",children:[t?c.jsx("img",{src:a??"",className:"logoIcon",width:"28xp",height:"28px",alt:s}):null,c.jsxs(g.Box,{children:[c.jsx(n5,{variant:r?"body1_medium":"h2",children:s}),c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",hidden:t||!u||S||!d,children:[c.jsx(g.Typography,{variant:"body2",color:g.theme.palette.gray.gray3,children:_T}),c.jsx(z6,{placement:"bottom",title:c.jsx(W6,{connectorName:e.name,updates:d}),children:c.jsx(g.Icon,{children:c.jsx(i5,{})})})]})]})]})}),t&&!n?c.jsx(s5,{variant:"contained",onClick:L=>y(L,A),children:$S}):c.jsxs(r5,{children:[!t&&u&&!S?c.jsx(g.Box,{marginRight:"7px",children:c.jsx(g.Button,{size:"small",onClick:w,children:ST})}):null,!t&&S?c.jsx(a5,{severity:"error",children:TT}):null,c.jsx(g.Tooltip,{title:KS,placement:"bottom",children:c.jsx(g.IconButton,{onClick:L=>b(L,A),children:c.jsx("img",{src:u5,className:"settingsIcon"})})}),(f==null?void 0:f[A])!==Te.LOADING?c.jsx(g.Tooltip,{title:x?tT:eT,placement:"bottom",children:c.jsx(g.Switch,{id:`switch_${A}`,checked:x,disabled:R,onClick:L=>L==null?void 0:L.stopPropagation(),onChange:L=>Q(L,A)})}):c.jsx(o5,{width:"58px",height:"38px",alignItems:"center",flexDirection:"row",justifyContent:"center",children:c.jsx(A5,{"data-testid":"loading"})})]})]}),t?c.jsx(g.Typography,{maxWidth:"577px",variant:"body1",color:g.theme.palette.gray.gray3,className:"connector-grid",children:i}):null]}),O?c.jsx(G6,{setShowEnabledModal:E,currentConnectorId:A,infoCards:e.cardList||[]}):null]})},Y6=()=>{const e=At(Zp),t=At(Dl);return c.jsx(qp,{children:c.jsx(g.Box,{"data-testid":"connector-custom-card",children:e.map(n=>{var r;return(r=t==null?void 0:t[n])!=null&&r.id?c.jsx(jB,{connector:t[n],isConfigSettingsPage:!1,isConnectorCard:!0},n):null})})})},VB=e=>e.requestConnectorApi.connectorRequestsApiStatus,J6=e=>e.requestConnectorApi.requestableConnectors,X6=e=>e.requestConnectorApi.requestableApis,q6=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:o,handleSubmit:A,isApiText:s})=>{const{sendTrackingEvent:a}=m.useContext(on),l=At(VB)===Te.LOADING,u=r.length===0?s?zS:YS:"";return m.useEffect(()=>{a(s?ct.REQUEST_NEW_FEATURE_SHOWN:ct.REQUEST_NEW_CONNECTOR_SHOWN)},[a,s]),c.jsx(g.Stack,{"data-testid":"request-panel",children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"440px",height:"100%",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsxs(g.Stack,{gap:"4px",marginBottom:"36px",children:[c.jsx(g.Typography,{variant:"h2",children:s?GS:HS}),c.jsx(g.Typography,{variant:"body2",children:s?Vp:WS})]}),c.jsx(g.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:l,isOptionEqualToValue:(d,f)=>d.id===f.id,renderOption:(d,f,{selected:B})=>{const{key:I,...C}=d;return c.jsxs(g.Box,{component:"li",...C,minHeight:"36px",children:[c.jsx(g.Checkbox,{style:{marginRight:8},checked:B}),f.label]},I)},renderInput:d=>c.jsx(td,{...d,variant:"outlined",placeholder:u}),ListboxProps:{style:{maxHeight:250}},onChange:(d,f)=>{n(f)}}),c.jsx(kB,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:l,placeholder:JS,onChange:d=>{o(d.target.value)}})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(g.Button,{"data-testid":"submit-request-button",onClick:A,color:"tertiary",size:"medium",sx:{height:"32px",width:"140.25px"},disabled:!t||l,children:l?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):c.jsx("div",{children:XS})})})]})})},Z6=({handleClose:e})=>c.jsx(g.Stack,{children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"378px",height:"100%",justifyContent:"center",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsx("img",{src:tB,alt:"checkmark",width:92,height:92}),c.jsxs(g.Stack,{gap:"4px",children:[c.jsx(g.Typography,{variant:"h2",children:qS}),c.jsx(g.Typography,{variant:"body2",children:ZS})]})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(_6,{onClick:e,variant:"outlined",color:"tertiary",size:"medium",children:US})})]})}),nd=({shown:e,setShown:t,connectorType:n,isApi:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),A=Mo(),s=At(J6),a=At(X6),i=At(VB),[l,u]=m.useState(""),[d,f]=m.useState([]),[B,I]=m.useState([]),[C,E]=m.useState(!1),[h,p]=m.useState(!1),Q=()=>{const w=r?Gp.API:Gp.CONNECTOR,x=B.map(S=>S.id);A(dl({type:w,values:x,description:l})).unwrap().then(()=>{o(r?ct.REQUEST_NEW_FEATURE_SUBMIT_CLICKED:ct.REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED),p(!0)}).catch(()=>{Gn({message:nT,type:Eo})})};m.useEffect(()=>(e&&h&&p(!1),()=>{I([]),u("")}),[e]),m.useEffect(()=>{var w;if(r){const x=((w=a==null?void 0:a.find(S=>S.connector_type===n))==null?void 0:w.apis)||[];f(x.map(S=>({label:S.name,id:S.key})))}else f((s||[]).map(x=>({label:x.name,id:x.key})))},[a,s,r,n]),m.useEffect(()=>{E(B.length>0)},[B,l]);const y=h&&i!==Te.LOADING,b=w=>{w||o(r?ct.REQUEST_NEW_FEATURE_CLOSE_CLICKED:ct.REQUEST_NEW_CONNECTOR_CLOSE_CLICKED),t(w)},v=()=>{t(!1),o(r?ct.REQUEST_NEW_FEATURE_DONE_CLICKED:ct.REQUEST_NEW_CONNECTOR_DONE_CLICKED)};return c.jsxs(Dg,{shown:e,setShown:b,showCloseButton:!0,children:[y?c.jsx(Z6,{handleClose:v}):c.jsx(q6,{connectors:d,canSubmit:C,setSelectedConnectors:I,selectedConnectors:B,setOptionalDetails:u,handleSubmit:Q,isApiText:r}),c.jsx(T6,{children:c.jsx("img",{loading:"lazy",className:"request-new-connector-img",src:FS,alt:"Request new connector"})})]})},U6="Custom Connectors",$6="Connectors help you get a better customer context and key actions right into your inbox",K6="Library",e_="Use these pre-built connectors to get started without any hassle. Authenticate and access them from the right panel of Hiver.",t_=g.styled(g.Box)`
602
602
  padding: 14px 0px 0 32px;
603
603
  box-sizing: border-box;
604
604
  `,n_=g.styled(g.Stack)`
@@ -728,7 +728,7 @@ Take a look at the reducer(s) handling this action type: ${B.type}.
728
728
  margin: 0 48px 20px 177px;
729
729
  width: 100%;
730
730
  min-height: 100%;
731
- `,L_=()=>{const{sendTrackingEvent:e}=m.useContext(on),t=m.useRef(!1);return m.useEffect(()=>{t.current||(e(ct.CONNECTOR_SECTION_VIEWED),t.current=!0)},[e]),c.jsxs(O_,{children:[c.jsx(__,{sidebarOptions:Jw}),c.jsx(D_,{id:"connectors-content-outlet",children:c.jsx(HS,{})})]})},F_="{{connector}} features",N_="Following are the list of features that you will find in this connector",R_="Request new feature",HB=g.styled(Tr)`
731
+ `,L_=()=>{const{sendTrackingEvent:e}=m.useContext(on),t=m.useRef(!1);return m.useEffect(()=>{t.current||(e(ct.CONNECTOR_SECTION_VIEWED),t.current=!0)},[e]),c.jsxs(O_,{children:[c.jsx(__,{sidebarOptions:Jw}),c.jsx(D_,{id:"connectors-content-outlet",children:c.jsx(H4,{})})]})},F_="{{connector}} features",N_="Following are the list of features that you will find in this connector",R_="Request new feature",HB=g.styled(Tr)`
732
732
  max-width: ${e=>e.maxWidth?e.maxWidth:null};
733
733
  `,k_=g.styled(g.Stack)`
734
734
  width: 100%;
@@ -1768,7 +1768,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1768
1768
  width: 100vw;
1769
1769
  height: 100vh;
1770
1770
  padding: 20px;
1771
- `,aj=()=>{const e=Mo(),t=At(Aj),n=At(oj);return m.useEffect(()=>{const r=new URLSearchParams(window.location.search),o=r.get(y7),A=r.get(b7);window.opener&&A&&o&&e(ul({data:{token:o},connectorId:A}))},[e]),m.useEffect(()=>{window.opener&&t&&window.opener.postMessage(n===Te.FAILED?l0:jd,window.location.origin)},[t,n]),c.jsxs(sj,{children:[c.jsx("h1",{children:"Authentication Complete"}),c.jsx("p",{children:"Redirecting..."})]})},ij=e=>Op([{path:et.BASEPATH,element:c.jsx(L_,{}),children:[{index:!0,element:c.jsx(GB,{})},{path:et.DASHBOARD,element:c.jsx(GB,{})},{path:et.AGENT,element:c.jsx(P4,{})},{path:`${et.API_VIEW}/:id`,element:c.jsx(p7,{})}]},{path:`${et.CONNECTOR_SETTINGS}/:id`,element:c.jsx(rj,{})},{path:et.AUTH_SUCCESS,element:c.jsx(aj,{})}],{basename:e}),lj=({basename:e="/",metaData:t,userId:n})=>{var o;const r=m.useMemo(()=>ij(e),[e]);return(o=t==null?void 0:t.templateUpdates)!=null&&o.version&&n&&(y6(t.templateUpdates.version),w6(n)),c.jsx(Np,{router:r})},cj=g.styled(g.Box)`
1771
+ `,aj=()=>{const e=Mo(),t=At(Aj),n=At(oj);return m.useEffect(()=>{const r=new URLSearchParams(window.location.search),o=r.get(y7),A=r.get(b7);window.opener&&A&&o&&e(ul({data:{token:o},connectorId:A}))},[e]),m.useEffect(()=>{window.opener&&t&&window.opener.postMessage(n===Te.FAILED?l0:jd,window.location.origin)},[t,n]),c.jsxs(sj,{children:[c.jsx("h1",{children:"Authentication Complete"}),c.jsx("p",{children:"Redirecting..."})]})},ij=e=>Op([{path:et.BASEPATH,element:c.jsx(L_,{}),children:[{index:!0,element:c.jsx(GB,{})},{path:et.DASHBOARD,element:c.jsx(GB,{})},{path:et.AGENT,element:c.jsx(PS,{})},{path:`${et.API_VIEW}/:id`,element:c.jsx(p7,{})}]},{path:`${et.CONNECTOR_SETTINGS}/:id`,element:c.jsx(rj,{})},{path:et.AUTH_SUCCESS,element:c.jsx(aj,{})}],{basename:e}),lj=({basename:e="/",metaData:t,userId:n})=>{var o;const r=m.useMemo(()=>ij(e),[e]);return(o=t==null?void 0:t.templateUpdates)!=null&&o.version&&n&&(y6(t.templateUpdates.version),w6(n)),c.jsx(Np,{router:r})},cj=g.styled(g.Box)`
1772
1772
  padding: 43px 0px 0 35px;
1773
1773
  box-sizing: border-box;
1774
1774
  width: 100%;
@@ -1852,7 +1852,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1852
1852
  }
1853
1853
  `,Nm=g.styled(g.Typography)`
1854
1854
  white-space: pre;
1855
- `,Qj="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.44441%207.72259C1.2339%206.35423%201.02339%204.98592%200.812876%203.61756C0.766191%203.31424%201.11132%203.10736%201.35682%203.2915C2.01269%203.7834%202.66853%204.27527%203.32439%204.76717C3.54034%204.92913%203.84799%204.87642%203.9977%204.65182L5.63574%202.19474C5.80885%201.93509%206.19035%201.93509%206.36346%202.19474L8.0015%204.65182C8.15121%204.87642%208.45886%204.92909%208.67481%204.76717C9.33068%204.27527%209.98651%203.7834%2010.6424%203.2915C10.8879%203.10736%2011.233%203.31424%2011.1864%203.61756C10.9758%204.98592%2010.7653%206.35423%2010.5548%207.72259H1.44441Z'%20fill='white'/%3e%3cpath%20d='M10.0788%2010.0027H1.91834C1.65602%2010.0027%201.44336%209.79009%201.44336%209.52777V8.48438H10.5538V9.52777C10.5537%209.79009%2010.3411%2010.0027%2010.0788%2010.0027Z'%20fill='white'/%3e%3c/svg%3e",mj=({availableFeatures:e})=>{const t=n=>{n.stopPropagation(),Mr(e,Mp)&&yf()};return c.jsxs(cj,{children:[c.jsx(gj,{children:c.jsx(Sg,{variant:"h2",children:Uu})}),c.jsxs(dj,{children:[c.jsxs(Cj,{children:[c.jsxs(fj,{children:[c.jsx("img",{src:Qj}),c.jsx(Ij,{variant:"caption",children:bb})]}),c.jsx(Sg,{variant:"h2",children:Uu}),c.jsx(pj,{variant:"body2",children:xb}),c.jsxs(Fm,{children:[c.jsx(Bj,{children:vb}),c.jsx(hj,{variant:"outlined",children:wb})]}),c.jsxs(uj,{children:[c.jsx(Nm,{variant:"body1",children:Sb}),"  ",c.jsx(Nm,{component:"a",variant:"body1",color:"#1a70e0",onClick:n=>t(n),children:pf})]})]}),c.jsx(Ej,{children:c.jsx("img",{src:N4})})]})]})},yj=g.styled(g.Box)`
1855
+ `,Qj="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.44441%207.72259C1.2339%206.35423%201.02339%204.98592%200.812876%203.61756C0.766191%203.31424%201.11132%203.10736%201.35682%203.2915C2.01269%203.7834%202.66853%204.27527%203.32439%204.76717C3.54034%204.92913%203.84799%204.87642%203.9977%204.65182L5.63574%202.19474C5.80885%201.93509%206.19035%201.93509%206.36346%202.19474L8.0015%204.65182C8.15121%204.87642%208.45886%204.92909%208.67481%204.76717C9.33068%204.27527%209.98651%203.7834%2010.6424%203.2915C10.8879%203.10736%2011.233%203.31424%2011.1864%203.61756C10.9758%204.98592%2010.7653%206.35423%2010.5548%207.72259H1.44441Z'%20fill='white'/%3e%3cpath%20d='M10.0788%2010.0027H1.91834C1.65602%2010.0027%201.44336%209.79009%201.44336%209.52777V8.48438H10.5538V9.52777C10.5537%209.79009%2010.3411%2010.0027%2010.0788%2010.0027Z'%20fill='white'/%3e%3c/svg%3e",mj=({availableFeatures:e})=>{const t=n=>{n.stopPropagation(),Mr(e,Mp)&&yf()};return c.jsxs(cj,{children:[c.jsx(gj,{children:c.jsx(Sg,{variant:"h2",children:Uu})}),c.jsxs(dj,{children:[c.jsxs(Cj,{children:[c.jsxs(fj,{children:[c.jsx("img",{src:Qj}),c.jsx(Ij,{variant:"caption",children:bb})]}),c.jsx(Sg,{variant:"h2",children:Uu}),c.jsx(pj,{variant:"body2",children:xb}),c.jsxs(Fm,{children:[c.jsx(Bj,{children:vb}),c.jsx(hj,{variant:"outlined",children:wb})]}),c.jsxs(uj,{children:[c.jsx(Nm,{variant:"body1",children:Sb}),"  ",c.jsx(Nm,{component:"a",variant:"body1",color:"#1a70e0",onClick:n=>t(n),children:pf})]})]}),c.jsx(Ej,{children:c.jsx("img",{src:NS})})]})]})},yj=g.styled(g.Box)`
1856
1856
  height: 100%;
1857
1857
  & > div {
1858
1858
  height: 100%;
@@ -3465,7 +3465,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3465
3465
  `,oJ=g.styled(g.icons.OpenInNew)`
3466
3466
  height: 18px;
3467
3467
  width: 18px;
3468
- `,AJ=({upgradeGuideContent:e,upgradeGuideLink:t})=>c.jsxs(eJ,{children:[c.jsxs(g.Stack,{marginBottom:"20px",children:[c.jsxs(g.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[c.jsx(tJ,{}),c.jsx(g.Typography,{variant:"body1_medium",color:g.theme.palette.gray.black,children:lY})]}),c.jsx(g.Typography,{variant:"body2",children:cY})]}),c.jsx(g.Typography,{variant:"body2_medium",marginBottom:"8px",color:g.theme.palette.gray.black,children:uY}),c.jsx(rJ,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?c.jsxs(nJ,{target:"_blank",underline:"none",href:t,children:[c.jsx(oJ,{}),gY]}):null]}),$1=(e,t)=>{const n=t.authType===di,r=t.authType===B1,o=t.authType===Ls;if(!e||!e.data)return{authUrl:"",authStatus:r?nt.API_KEY_FAILED:n?nt.BASIC_AUTH_FAILED:o?nt.OAUTH1_FAILED:nt.OAUTH_FAILED};const A=e.data;return r?{authUrl:"",id:A.id,authStatus:nt.API_KEY_SUCCESS}:n?{authUrl:"",id:A.id,authStatus:nt.BASIC_AUTH_SUCCESS}:o?{authUrl:"",id:A.id,authStatus:nt.OAUTH1_SUCCESS}:A.authorizationUrl?{authUrl:A.authorizationUrl,id:A.id,authStatus:nt.PENDING}:{authUrl:"",id:"",authStatus:nt.OAUTH_FAILED}},sJ=async e=>{try{const t=await Pe({url:tG,method:zt.POST,data:e});return $1(t,e.authDetails)}catch(t){return Promise.reject(t)}},aJ=async(e,t)=>{try{const n=rG.replace("{{id}}",t),r=await Pe({url:n,method:zt.PATCH,data:e});return $1(r,e.authDetails)}catch(n){return Promise.reject(n)}},iJ=({connectorId:e,onSuccess:t})=>{const n=Oo(),r=m.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=Co({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:nt.IDLE,id:""}),enabled:!1}),A=EA({mutationFn:a=>"connectorId"in a?aJ(a.data,a.connectorId):sJ(a.data),onSuccess:a=>{n.setQueryData(r,a),t==null||t()}});m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const s=m.useCallback(a=>{n.setQueryData(r,i=>i&&{...i,authStatus:a})},[r,n]);return{mutate:A.mutate,isLoading:A.isPending,data:o,mutateStatus:s}},lJ=async e=>{var t;try{const n=await Pe({url:Lr(AG,{connectorId:e}),method:zt.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},cJ=({connectorId:e,enabled:t=!1})=>{const n=Oo(),r=m.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=Co({queryKey:r,queryFn:()=>lJ(e),refetchInterval:A=>{var s,a;return((s=A.state.data)==null?void 0:s.status)==="failed"||((a=A.state.data)==null?void 0:a.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},K1=({connectorData:e})=>{const{sendTrackingEvent:t,availableFeatures:n}=m.useContext(Qt),[r,o]=m.useState(!1),A=Oe(ci),s=Oe(zm),a=m.useRef(null),i=cn(),{id:l=""}=ko(),[u]=pA(),d=u.get("isEdit")==="true",f=!!(e!=null&&e.showUpgradeButton),B=Ar(n,Fj),{data:I,mutateStatus:C,isLoading:E,mutate:h}=iJ({connectorId:l,onSuccess:()=>{B&&o(!0)}}),p=cJ({connectorId:(I==null?void 0:I.id)||"",enabled:r}),{status:Q}=p.data||{},y=(I==null?void 0:I.authStatus)||nt.IDLE,b=(I==null?void 0:I.authUrl)||"",v=sr();m.useEffect(()=>()=>{v(iG())},[v]),m.useEffect(()=>{let x,S;const R=O=>{a.current&&O.origin===window.location.origin&&(O.data===P1||O.data===KC)&&(clearTimeout(x),a.current.close(),a.current=null,C(O.data===KC?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))};try{if(b){a.current=window.open(b,"_blank");const O=5*60*1e3;x=setTimeout(()=>{var N;(N=a.current)==null||N.close(),a.current=null,C(nt.OAUTH_FAILED)},O),S=setInterval(()=>{var N;(N=a.current)!=null&&N.closed&&(clearInterval(S),a.current=null,C(nt.OAUTH_FAILED))},500),window.addEventListener("message",R)}}catch(O){console.log("Error in Authentication",O)}return()=>{window.removeEventListener("message",R),clearTimeout(x),clearInterval(S)}},[b,v,C]),m.useEffect(()=>{Q&&Q!=="pending"&&a.current&&B&&(a.current.close(),a.current=null,C(Q==="success"?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))},[Q,C,B]),m.useEffect(()=>{switch((y===nt.OAUTH1_FAILED||y===nt.OAUTH_FAILED||y===nt.API_KEY_FAILED||y===nt.BASIC_AUTH_FAILED)&&i(Xe.BASEPATH),(y===nt.OAUTH1_SUCCESS||y===nt.OAUTH_SUCCESS||y===nt.API_KEY_SUCCESS||y===nt.BASIC_AUTH_SUCCESS)&&I!=null&&I.id&&i(d?Xe.BASEPATH:`${Xe.BASEPATH}${Xe.CONNECTOR_INITIAL_SETUP}/${l}?connectorId=${I.id}`),y){case nt.BASIC_AUTH_SUCCESS:case nt.OAUTH1_SUCCESS:case nt.OAUTH_SUCCESS:{Dt({message:f?M1:nY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.BASIC_AUTH_FAILED:case nt.OAUTH1_FAILED:case nt.OAUTH_FAILED:{Dt({message:f?j1:rY,type:Nn});break}case nt.REQUEST_FAILED:{Dt({message:Mc,type:Nn});break}case nt.API_KEY_SUCCESS:{Dt({message:f?M1:AY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.API_KEY_FAILED:{Dt({message:f?j1:Mc,type:Nn});break}}},[y,i,f,l,d,e==null?void 0:e.name,t,I==null?void 0:I.id]);const w=A===pe.LOADING||s===pe.LOADING;return c.jsxs(KY,{direction:"row",id:"connectors-auth-page",children:[c.jsx("div",{className:"flex flex-col",children:c.jsx(VY,{connectorId:l,isEdit:d,connectorData:e,authStatus:y,isLoading:w,authMutate:h,isAuthPending:E})}),c.jsxs(g.Stack,{gap:"36px",width:"322px",className:"connector-auth-help",children:[e!=null&&e.upgradeGuideContent?c.jsx(AJ,{upgradeGuideContent:e.upgradeGuideContent,upgradeGuideLink:e.upgradeGuideLink}):null,c.jsxs(g.Stack,{gap:"12px",children:[c.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:eW}),d?null:c.jsx(JC,{isSettingsPage:!0}),c.jsx($Y,{connectorName:e==null?void 0:e.name,supportLinks:e==null?void 0:e.supportLinks})]})]})]})},uJ="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",dJ="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CJ="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='%23343C45'%3e%3cg%20fill-rule='evenodd'%3e%3ccircle%20cx='17'%20cy='15.5'%20r='1.12'/%3e%3cpath%20d='M17%2017.5c-.73%200-2.19.36-2.24%201.08.5.71%201.32%201.17%202.24%201.17s1.74-.46%202.24-1.17c-.05-.72-1.51-1.08-2.24-1.08'/%3e%3cpath%20d='M18%2011.09V6.27L10.5%203%203%206.27v4.91c0%204.54%203.2%208.79%207.5%209.82.55-.13%201.08-.32%201.6-.55C13.18%2021.99%2014.97%2023%2017%2023c3.31%200%206-2.69%206-6%200-2.97-2.16-5.43-5-5.91M11%2017c0%20.56.08%201.11.23%201.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4%205.5%202.4v3.51c-2.84.48-5%202.94-5%205.91m6%204c-2.21%200-4-1.79-4-4s1.79-4%204-4%204%201.79%204%204-1.79%204-4%204'/%3e%3c/g%3e%3c/svg%3e",EJ="integration_sense",e2="email_log_settings",fJ="quick_access",oE="user_auth_enabled",IJ="This feature can only be used for one App and is currently enabled for :enabledConnector.",pJ=[{id:EJ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:uJ,featureKey:Nj},{id:e2,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:gJ,featureKey:kj,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:fJ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:dJ,featureKey:Rj},{id:oE,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:CJ,featureKey:Pj}],BJ="Advanced settings",hJ="Enhance your integrations with contextual insights and email logging.",Kc={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},QJ=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({width:e,height:t,color:n})=>({[`& .${g.tooltipClasses.arrow}`]:{color:n||"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:n||"#fff",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),t2=e=>c.jsx(g.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),mJ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:A,placeholder:s})=>{const[a,i]=m.useState(""),[l,u]=m.useState(""),d=E=>{i(E.target.value)},f=E=>{E.stopPropagation();const{value:h}=(E==null?void 0:E.target)||{};u(h)},B=()=>{t({feedbackOption:a,feedbackComment:l})},I=()=>{e==null||e()},C=r?!a:!l;return c.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[c.jsx(g.Typography,{variant:"h3",children:o}),c.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?c.jsx(g.FormControl,{children:c.jsx(g.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:a,onChange:d,children:A.map(E=>c.jsx(g.FormControlLabel,{value:E.value,control:c.jsx(g.Radio,{}),label:E.label},E.value))})}):null,c.jsx(pC,{type:"text",placeholder:s,value:l,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vk()}}),c.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[c.jsx(g.Button,{variant:"text",color:"primary",style:{color:g.theme.palette.gray.gray3},disabled:n,onClick:I,children:"Cancel"}),c.jsx(t2,{variant:"contained",color:"primary",isLoading:n,disabled:C,label:"Submit",onClick:B})]})]})},yJ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:A=!1,onConfirm:s,onCancel:a})=>c.jsxs("div",{className:"flex flex-col gap-2 p-5",style:{minWidth:360,maxWidth:440},children:[c.jsx(g.Typography,{sx:{fontWeight:500,fontSize:"18px",lineHeight:"28px",color:"#343C45"},children:e}),c.jsx(g.Typography,{sx:{fontSize:"14px",lineHeight:"20px",color:"#4D596C"},children:t}),c.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[c.jsx(g.Button,{variant:"text",style:{color:"#4D596C"},disabled:o,onClick:a,children:r}),c.jsx(t2,{variant:"contained",isLoading:o,label:n,onClick:s,sx:A?{backgroundColor:"#CD3746","&:hover":{backgroundColor:"#B83340"}}:void 0})]})]}),bJ=wt+"/connectors/:connectorId/advanced-feature",xJ=wt+"/connectors/:connectorId/user-auth-enabled",vJ=`${wt}/connector/admin-feedback`,wJ=async(e,t)=>{try{const n=Lr(bJ,{connectorId:t})+"?channel_type=email",r=await Pe({url:n,method:zt.PATCH,data:e});return Dt({type:eo,message:"Successfully updated feature"}),r}catch(n){return Dt({type:Nn,message:"Failed to update feature"}),Promise.reject(n)}};function SJ(){return EA({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await wJ(t,e);return n==null?void 0:n.data}})}const TJ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=Lr(xJ,{connectorId:e}),r=await Pe({url:n,method:zt.PATCH,data:{userAuthEnabled:t}});return Dt({type:eo,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Dt({type:Nn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function _J(){return EA({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await TJ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const OJ=async({feedbackData:e})=>{try{const t=await Pe({url:vJ+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function DJ(){return EA({mutationFn:OJ})}const LJ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:A,connectorType:s,modalSettings:a,disabled:i=!1,tooltipContent:l=""})=>{var S;const[u,d]=m.useState(!1),[f,B]=m.useState(r),[I,C]=m.useState(!1),[E,h]=m.useState(!1),p=Oe(ci)===pe.LOADING,{mutate:Q}=SJ(),{mutate:y}=_J(),{mutate:b}=DJ();m.useEffect(()=>{B(r)},[r]);const v=()=>{d(!0),y({connectorId:A,userAuthEnabled:!0},{onSettled:()=>{d(!1),h(!1)},onSuccess:R=>{(R==null?void 0:R.userAuthEnabled)!==void 0&&B(R.userAuthEnabled)}})},w=R=>{const O=R.target.checked;if(e===oE&&O){h(!0);return}if(d(!0),e===oE){y({connectorId:A,userAuthEnabled:O},{onSettled:()=>{d(!1)},onSuccess:N=>{(N==null?void 0:N.userAuthEnabled)!==void 0&&B(N.userAuthEnabled),(N==null?void 0:N.userAuthEnabled)===!1&&a&&C(!0)}});return}Q({connectorId:A,data:{[e]:O}},{onSettled:()=>{d(!1)},onSuccess:N=>{N.enabled!==void 0&&B(N.enabled),!O&&a&&C(!0)}})},x=R=>{const O={feedback_type:"email-logging-disabled",comment:R.feedbackComment,option:R.feedbackOption,connector_id:A,connector_type:s};b({feedbackData:O}),C(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"w-full flex justify-between items-center border-1 border-gray-5 rounded-sm p-4 gap-2.5 [&:first-child:last-child]:col-span-2",children:[c.jsxs("div",{className:"flex gap-2.5",children:[c.jsx("div",{className:"h-11 w-10.5 p-3 bg-gray-6a rounded-sm shrink-0",children:c.jsx("img",{src:o,alt:"Smart Previews Icon"})}),c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("h3",{className:"font-medium! text-body1",children:t}),c.jsx("p",{className:"text-body2",children:n})]})]}),c.jsx(QJ,{title:l,placement:"top",color:"#343C45",arrow:!0,width:"287px",children:c.jsx("div",{className:"w-12",children:c.jsx(k1,{id:`switch_${e}`,checked:f,onClick:R=>R==null?void 0:R.stopPropagation(),onChange:w,isLoading:u||p,disabled:u||p||i})})})]}),c.jsx(_A,{shown:I,setShown:C,borderRadius:12,sx:{zIndex:15002},children:c.jsx(mJ,{onCancel:()=>C(!1),onSubmit:x,isLoading:u,title:(a==null?void 0:a.title)||"",feedbackOptions:(a==null?void 0:a.radioOptions)||[],placeholder:((S=a==null?void 0:a.textArea)==null?void 0:S.placeholder)||""})}),c.jsx(_A,{shown:E,setShown:h,showCloseButton:!0,borderRadius:8,sx:{zIndex:15002},children:c.jsx(yJ,{title:Kc.title,description:Kc.description,confirmLabel:Kc.confirmLabel,cancelLabel:Kc.cancelLabel,isLoading:u,danger:!0,onConfirm:v,onCancel:()=>h(!1)})})]})},FJ=(e,t)=>typeof e[t]=="boolean",NJ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},RJ=e=>{const t={};for(const n in e)NJ(e,n)?t[n]=e[n]:FJ(e,n)&&(t[n]={enabled:e[n],connector:n===e2?e.connector:void 0});return t},kJ=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r})=>{const{availableFeatures:o}=m.useContext(Qt),A=RJ(e),s=pJ.filter(l=>Ar(o,l.featureKey)&&typeof A[l.id]=="object");if(s.length===0)return null;const a=l=>A[l].enabled,i=l=>{var d;const u=A[l];return!a(l)&&((d=u==null?void 0:u.connector)!=null&&d.id)?{isDisabled:!0,tooltipContent:Lr(IJ,{enabledConnector:u.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return c.jsxs("div",{children:[c.jsx("h2",{className:"text-h2 text-[#4D596C]! mt-8 mb-2",children:BJ}),c.jsx("p",{className:"text-body2 text-[#6F7C90]!",children:hJ}),c.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:s.map(l=>{const{isDisabled:u,tooltipContent:d}=i(l.id);return c.jsx(LJ,{id:l.id,heading:l.heading.replace(/\{\{app_name\}\}/g,n),subHeading:l.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:a(l.id),icon:l.icon,connectorId:t,connectorType:r,modalSettings:l.modalSettings,disabled:u,tooltipContent:d},l.id)})})]})},PJ=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_1446_4479)"},_.createElement("path",{d:"M11.3333 2H3.33333C2.59333 2 2 2.6 2 3.33333V12.6667C2 13.4 2.59333 14 3.33333 14H12.6667C13.4 14 14 13.4 14 12.6667V4.66667L11.3333 2ZM8 12.6667C6.89333 12.6667 6 11.7733 6 10.6667C6 9.56 6.89333 8.66667 8 8.66667C9.10667 8.66667 10 9.56 10 10.6667C10 11.7733 9.10667 12.6667 8 12.6667ZM10 6H3.33333V3.33333H10V6Z",fill:"white"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_1446_4479"},_.createElement("rect",{width:16,height:16,fill:"white"})))),n2=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),_.createElement("g",{filter:"url(#filter0_d_360_39563)"},_.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),_.createElement("g",{filter:"url(#filter1_d_360_39563)"},_.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),_.createElement("defs",null,_.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),_.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),MJ=({connectorId:e,connectorName:t,connectorLogo:n})=>{const{sendTrackingEvent:r}=m.useContext(Qt),[o,A]=m.useState(null),[s,a]=m.useState([]),[i,l]=m.useState(!1),[u,d]=m.useState(""),[f,B]=m.useState(!0),[I,C]=m.useState(!1);if(m.useEffect(()=>{(async()=>{var v;B(!0);try{const[w,x]=await Promise.all([VV(e),GV(e)]);A(w.data??null),a(((v=x.data)==null?void 0:v.presets)??[])}catch(w){Dt({message:Mc,type:Nn}),console.error(w)}finally{B(!1)}})()},[e]),f||s.length===0)return null;const E=s.find(b=>b.hiverParam===(o==null?void 0:o.hiverParam))??s[0],h=()=>{var w;r(Ye.LOOKUP_CONFIG_CLICKED,{connector_name:t,page:"connector_settings"});const b=(o==null?void 0:o.hiverParam)??E.hiverParam,v=s.some(x=>x.hiverParam===b);d(v?b:((w=s[0])==null?void 0:w.hiverParam)??""),l(!0)},p=async()=>{C(!0);try{await HV([{connectorId:e,hiverParam:u}]),A({connectorId:e,hiverParam:u}),r(Ye.LOOKUP_SAVED,{connector_name:t,hiver_param:u,page:"connector_settings"}),Dt({message:fH,type:eo}),l(!1)}catch{Dt({message:IH,type:Nn})}finally{C(!1)}},Q=EH.replace("%s",t),y=s.find(b=>b.hiverParam===(u||(o==null?void 0:o.hiverParam)))??s[0];return c.jsxs("div",{className:"border border-[#D6DDE8] rounded-lg bg-white p-4 mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-h2 text-[#3E4C5A]!",children:uH}),i?c.jsx(g.Button,{variant:"contained",size:"small",startIcon:c.jsx(PJ,{}),onClick:p,disabled:I,children:CH}):c.jsx(g.Button,{variant:"outlined",color:"tertiary",size:"small",onClick:h,children:dH})]}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6",children:gH}),i?c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsx(g.Select,{value:u,onChange:b=>{const v=b.target.value;r(Ye.LOOKUP_FIELD_CLICKED,{hiver_param:v,connector_name:t,page:"connector_settings"}),d(v)},size:"small",variant:"outlined",renderValue:b=>{var w;const v=((w=s.find(x=>x.hiverParam===b))==null?void 0:w.label)??"";return c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),v]})},sx:{fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},children:s.map(b=>c.jsx(g.MenuItem,{value:b.hiverParam,sx:{fontSize:"14px"},children:b.label},b.hiverParam))}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]}):c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-[8px] font-medium bg-[#F6F8FC] w-[209px] h-10",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),y.label]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]})]})},jJ=({connectorData:e})=>{var B;const{cardList:t=[],name:n="",customCardsList:r=[],advancedFeatures:o={},type:A,logo:s=null}=e||{},[a,i]=m.useState(!1),{availableFeatures:l}=m.useContext(Qt),u=(B=yr())==null?void 0:B.tenantPlatform,d=Ar(l,u==="HIVERWEB"?`hot-${Rm}`:Rm),{id:f=""}=ko();return c.jsxs(c.Fragment,{children:[c.jsx(qC,{shown:a,setShown:i,connectorName:n}),c.jsx("h2",{className:"text-h2 text-[#4D596C]!",children:lH}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6 mt-2",children:cH}),d&&c.jsx(MJ,{connectorId:f,connectorName:n,connectorLogo:s}),c.jsx(L1,{setShowEnabledModal:i,currentConnectorId:f,formDefaultsEnabled:e==null?void 0:e.formDefaultsEnabled,infoCards:[...t,...r]}),c.jsx(kJ,{advancedFeatures:o,connectorId:f,connectorName:n,connectorType:A})]})},VJ=()=>{const e=sr(),{sendTrackingEvent:t}=m.useContext(Qt),n=Oe(_C),r=Oe(ci),o=Oe(s1),A=Oe(to),s=Oe(ri),{id:a=""}=ko(),[i]=pA(),l=i.get("isEdit")==="true",u=i.get("tabIndex"),[d,f]=m.useState(()=>{const v=Number(u);return Number.isNaN(v)||v<0?0:v>Zc.length-1?Zc.length-1:v}),B=(v,w)=>{f(w)},I=(A==null?void 0:A[a])||null,C=(s==null?void 0:s[a])||null,E=l?I:C,h=!(E!=null&&E.isAuthenticated),p=!!(E!=null&&E.isEnabled),Q=[n,r].includes(pe.LOADING)||h,y=[{name:Lc,route:`${Xe.BASEPATH}${Xe.DASHBOARD}`},{name:(E==null?void 0:E.name)||"",route:`${Xe.BASEPATH}${Xe.API_VIEW}/${a}?isEdit=${String(l)}`},{name:Xz}],b=(v,w)=>{v==null||v.stopPropagation(),e(si({id:w,enabled:v.target.checked})).unwrap().then(()=>{v.target.checked?t(Ye.TOGGLE_ENABLED,{connector_name:E==null?void 0:E.name}):(t(Ye.TOGGLE_DISABLED,{connector_name:E==null?void 0:E.name}),Dt({message:Zm,type:wC}))}).catch(()=>{Dt({message:qm,type:Nn})})};return m.useEffect(()=>{e(ai()),l?(e(ii(a)),e(Vc(a))):e(oi(a))},[l,e,a]),c.jsxs("div",{className:"w-full h-full flex flex-col",children:[c.jsxs("div",{className:`flex flex-row justify-between ${l?"mb-2":"mb-9"}`,children:[c.jsx(R1,{options:y}),l?c.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c.jsx($z,{active:p,label:c.jsx(g.Typography,{variant:"body2",children:p?"Active":"Inactive"})}),c.jsx(k1,{isLoading:(o==null?void 0:o[a])===pe.LOADING,id:`switch_${a}`,checked:p,disabled:Q,onClick:v=>v==null?void 0:v.stopPropagation(),onChange:v=>b(v,a)})]}):null]}),l?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsxs(g.Tabs,{value:d,onChange:B,classes:{flexContainer:"border-b-2 border-[#D6DDE8]"},children:[c.jsx(g.Tab,{label:Zc[0],className:"border-b-0!"}),c.jsx(g.Tab,{label:Zc[1],className:"border-b-0!"})]})}),c.jsx("div",{hidden:d!==0,className:"grow overflow-auto py-6",children:c.jsx(K1,{connectorData:E})}),c.jsx("div",{hidden:d!==1,className:"grow overflow-auto py-6",children:c.jsx(jJ,{connectorData:E})})]}):c.jsx("div",{className:"grow overflow-auto py-0",children:c.jsx(K1,{connectorData:E})})]})},GJ=e=>e.auth.verifyTokenApiStatus,HJ=e=>e.auth.authVerificationDone,WJ=g.styled(g.Box)`
3468
+ `,AJ=({upgradeGuideContent:e,upgradeGuideLink:t})=>c.jsxs(eJ,{children:[c.jsxs(g.Stack,{marginBottom:"20px",children:[c.jsxs(g.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[c.jsx(tJ,{}),c.jsx(g.Typography,{variant:"body1_medium",color:g.theme.palette.gray.black,children:lY})]}),c.jsx(g.Typography,{variant:"body2",children:cY})]}),c.jsx(g.Typography,{variant:"body2_medium",marginBottom:"8px",color:g.theme.palette.gray.black,children:uY}),c.jsx(rJ,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?c.jsxs(nJ,{target:"_blank",underline:"none",href:t,children:[c.jsx(oJ,{}),gY]}):null]}),$1=(e,t)=>{const n=t.authType===di,r=t.authType===B1,o=t.authType===Ls;if(!e||!e.data)return{authUrl:"",authStatus:r?nt.API_KEY_FAILED:n?nt.BASIC_AUTH_FAILED:o?nt.OAUTH1_FAILED:nt.OAUTH_FAILED};const A=e.data;return r?{authUrl:"",id:A.id,authStatus:nt.API_KEY_SUCCESS}:n?{authUrl:"",id:A.id,authStatus:nt.BASIC_AUTH_SUCCESS}:o?{authUrl:"",id:A.id,authStatus:nt.OAUTH1_SUCCESS}:A.authorizationUrl?{authUrl:A.authorizationUrl,id:A.id,authStatus:nt.PENDING}:{authUrl:"",id:"",authStatus:nt.OAUTH_FAILED}},sJ=async e=>{try{const t=await Pe({url:tG,method:zt.POST,data:e});return $1(t,e.authDetails)}catch(t){return Promise.reject(t)}},aJ=async(e,t)=>{try{const n=rG.replace("{{id}}",t),r=await Pe({url:n,method:zt.PATCH,data:e});return $1(r,e.authDetails)}catch(n){return Promise.reject(n)}},iJ=({connectorId:e,onSuccess:t})=>{const n=Oo(),r=m.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=Co({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:nt.IDLE,id:""}),enabled:!1}),A=EA({mutationFn:a=>"connectorId"in a?aJ(a.data,a.connectorId):sJ(a.data),onSuccess:a=>{n.setQueryData(r,a),t==null||t()}});m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const s=m.useCallback(a=>{n.setQueryData(r,i=>i&&{...i,authStatus:a})},[r,n]);return{mutate:A.mutate,isLoading:A.isPending,data:o,mutateStatus:s}},lJ=async e=>{var t;try{const n=await Pe({url:Lr(AG,{connectorId:e}),method:zt.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},cJ=({connectorId:e,enabled:t=!1})=>{const n=Oo(),r=m.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=Co({queryKey:r,queryFn:()=>lJ(e),refetchInterval:A=>{var s,a;return((s=A.state.data)==null?void 0:s.status)==="failed"||((a=A.state.data)==null?void 0:a.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},K1=({connectorData:e})=>{const{sendTrackingEvent:t,availableFeatures:n}=m.useContext(Qt),[r,o]=m.useState(!1),A=Oe(ci),s=Oe(zm),a=m.useRef(null),i=cn(),{id:l=""}=ko(),[u]=pA(),d=u.get("isEdit")==="true",f=!!(e!=null&&e.showUpgradeButton),B=Ar(n,Fj),{data:I,mutateStatus:C,isLoading:E,mutate:h}=iJ({connectorId:l,onSuccess:()=>{B&&o(!0)}}),p=cJ({connectorId:(I==null?void 0:I.id)||"",enabled:r}),{status:Q}=p.data||{},y=(I==null?void 0:I.authStatus)||nt.IDLE,b=(I==null?void 0:I.authUrl)||"",v=sr();m.useEffect(()=>()=>{v(iG())},[v]),m.useEffect(()=>{let x,S;const R=O=>{a.current&&O.origin===window.location.origin&&(O.data===P1||O.data===KC)&&(clearTimeout(x),a.current.close(),a.current=null,C(O.data===KC?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))};try{if(b){a.current=window.open(b,"_blank");const O=5*60*1e3;x=setTimeout(()=>{var N;(N=a.current)==null||N.close(),a.current=null,C(nt.OAUTH_FAILED)},O),S=setInterval(()=>{var N;(N=a.current)!=null&&N.closed&&(clearInterval(S),a.current=null,C(nt.OAUTH_FAILED))},500),window.addEventListener("message",R)}}catch(O){console.log("Error in Authentication",O)}return()=>{window.removeEventListener("message",R),clearTimeout(x),clearInterval(S)}},[b,v,C]),m.useEffect(()=>{Q&&Q!=="pending"&&a.current&&B&&(a.current.close(),a.current=null,C(Q==="success"?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))},[Q,C,B]),m.useEffect(()=>{switch((y===nt.OAUTH1_FAILED||y===nt.OAUTH_FAILED||y===nt.API_KEY_FAILED||y===nt.BASIC_AUTH_FAILED)&&i(Xe.BASEPATH),(y===nt.OAUTH1_SUCCESS||y===nt.OAUTH_SUCCESS||y===nt.API_KEY_SUCCESS||y===nt.BASIC_AUTH_SUCCESS)&&I!=null&&I.id&&i(d?Xe.BASEPATH:`${Xe.BASEPATH}${Xe.CONNECTOR_INITIAL_SETUP}/${l}?connectorId=${I.id}`),y){case nt.BASIC_AUTH_SUCCESS:case nt.OAUTH1_SUCCESS:case nt.OAUTH_SUCCESS:{Dt({message:f?M1:nY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.BASIC_AUTH_FAILED:case nt.OAUTH1_FAILED:case nt.OAUTH_FAILED:{Dt({message:f?j1:rY,type:Nn});break}case nt.REQUEST_FAILED:{Dt({message:Mc,type:Nn});break}case nt.API_KEY_SUCCESS:{Dt({message:f?M1:AY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.API_KEY_FAILED:{Dt({message:f?j1:Mc,type:Nn});break}}},[y,i,f,l,d,e==null?void 0:e.name,t,I==null?void 0:I.id]);const w=A===pe.LOADING||s===pe.LOADING;return c.jsxs(KY,{direction:"row",id:"connectors-auth-page",children:[c.jsx("div",{className:"flex flex-col",children:c.jsx(VY,{connectorId:l,isEdit:d,connectorData:e,authStatus:y,isLoading:w,authMutate:h,isAuthPending:E})}),c.jsxs(g.Stack,{gap:"36px",width:"322px",className:"connector-auth-help",children:[e!=null&&e.upgradeGuideContent?c.jsx(AJ,{upgradeGuideContent:e.upgradeGuideContent,upgradeGuideLink:e.upgradeGuideLink}):null,c.jsxs(g.Stack,{gap:"12px",children:[c.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:eW}),d?null:c.jsx(JC,{isSettingsPage:!0}),c.jsx($Y,{connectorName:e==null?void 0:e.name,supportLinks:e==null?void 0:e.supportLinks})]})]})]})},uJ="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",dJ="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CJ="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%3e%3cg%20transform='translate(1.004%201.004)'%3e%3ccircle%20cx='12.5953'%20cy='12.4035'%20r='4.10637'%20fill='%23FFE250'/%3e%3cpath%20d='M12.5951%2012.2532C13.1515%2012.2532%2013.6027%2011.8021%2013.6027%2011.2456C13.6027%2010.6891%2013.1515%2010.238%2012.5951%2010.238C12.0386%2010.238%2011.5875%2010.6891%2011.5875%2011.2456C11.5875%2011.8021%2012.0386%2012.2532%2012.5951%2012.2532Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5948%2013.0445C11.938%2013.0445%2010.6246%2013.3683%2010.5796%2014.0161C11.0294%2014.6548%2011.7671%2015.0687%2012.5948%2015.0687C13.4224%2015.0687%2014.1602%2014.6548%2014.61%2014.0161C14.565%2013.3683%2013.2515%2013.0445%2012.5948%2013.0445Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.4946%207.2781V2.94183L6.74731%200L0%202.94183V7.35907C0%2011.4434%202.87885%2015.2669%206.74731%2016.1936C7.24212%2016.0766%207.71893%2015.9057%208.18674%2015.6988C9.15835%2017.0842%2010.7687%2017.9928%2012.595%2017.9928C15.5728%2017.9928%2017.9928%2015.5728%2017.9928%2012.595C17.9928%209.92305%2016.0496%207.70993%2013.4946%207.2781ZM7.19713%2012.595C7.19713%2013.0988%207.26911%2013.5936%207.40405%2014.0524C7.18814%2014.1514%206.97222%2014.2503%206.74731%2014.3223C3.89545%2013.4227%201.79928%2010.5078%201.79928%207.35907V4.12036L6.74731%201.96122L11.6953%204.12036V7.2781C9.14036%207.70993%207.19713%209.92305%207.19713%2012.595ZM12.595%2016.1936C10.6068%2016.1936%208.99642%2014.5832%208.99642%2012.595C8.99642%2010.6068%2010.6068%208.99642%2012.595%208.99642C14.5832%208.99642%2016.1936%2010.6068%2016.1936%2012.595C16.1936%2014.5832%2014.5832%2016.1936%2012.595%2016.1936Z'%20fill='%23343C45'/%3e%3c/g%3e%3c/svg%3e",EJ="integration_sense",e2="email_log_settings",fJ="quick_access",oE="user_auth_enabled",IJ="This feature can only be used for one App and is currently enabled for :enabledConnector.",pJ=[{id:EJ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:uJ,featureKey:Nj},{id:e2,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:gJ,featureKey:kj,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:fJ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:dJ,featureKey:Rj},{id:oE,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:CJ,featureKey:Pj}],BJ="Advanced settings",hJ="Enhance your integrations with contextual insights and email logging.",Kc={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},QJ=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({width:e,height:t,color:n})=>({[`& .${g.tooltipClasses.arrow}`]:{color:n||"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:n||"#fff",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),t2=e=>c.jsx(g.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),mJ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:A,placeholder:s})=>{const[a,i]=m.useState(""),[l,u]=m.useState(""),d=E=>{i(E.target.value)},f=E=>{E.stopPropagation();const{value:h}=(E==null?void 0:E.target)||{};u(h)},B=()=>{t({feedbackOption:a,feedbackComment:l})},I=()=>{e==null||e()},C=r?!a:!l;return c.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[c.jsx(g.Typography,{variant:"h3",children:o}),c.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?c.jsx(g.FormControl,{children:c.jsx(g.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:a,onChange:d,children:A.map(E=>c.jsx(g.FormControlLabel,{value:E.value,control:c.jsx(g.Radio,{}),label:E.label},E.value))})}):null,c.jsx(pC,{type:"text",placeholder:s,value:l,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vk()}}),c.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[c.jsx(g.Button,{variant:"text",color:"primary",style:{color:g.theme.palette.gray.gray3},disabled:n,onClick:I,children:"Cancel"}),c.jsx(t2,{variant:"contained",color:"primary",isLoading:n,disabled:C,label:"Submit",onClick:B})]})]})},yJ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:A=!1,onConfirm:s,onCancel:a})=>c.jsxs("div",{className:"flex flex-col gap-2 p-5",style:{minWidth:360,maxWidth:440},children:[c.jsx(g.Typography,{sx:{fontWeight:500,fontSize:"18px",lineHeight:"28px",color:"#343C45"},children:e}),c.jsx(g.Typography,{sx:{fontSize:"14px",lineHeight:"20px",color:"#4D596C"},children:t}),c.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[c.jsx(g.Button,{variant:"text",style:{color:"#4D596C"},disabled:o,onClick:a,children:r}),c.jsx(t2,{variant:"contained",isLoading:o,label:n,onClick:s,sx:A?{backgroundColor:"#CD3746","&:hover":{backgroundColor:"#B83340"}}:void 0})]})]}),bJ=wt+"/connectors/:connectorId/advanced-feature",xJ=wt+"/connectors/:connectorId/user-auth-enabled",vJ=`${wt}/connector/admin-feedback`,wJ=async(e,t)=>{try{const n=Lr(bJ,{connectorId:t})+"?channel_type=email",r=await Pe({url:n,method:zt.PATCH,data:e});return Dt({type:eo,message:"Successfully updated feature"}),r}catch(n){return Dt({type:Nn,message:"Failed to update feature"}),Promise.reject(n)}};function SJ(){return EA({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await wJ(t,e);return n==null?void 0:n.data}})}const TJ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=Lr(xJ,{connectorId:e}),r=await Pe({url:n,method:zt.PATCH,data:{userAuthEnabled:t}});return Dt({type:eo,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Dt({type:Nn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function _J(){return EA({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await TJ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const OJ=async({feedbackData:e})=>{try{const t=await Pe({url:vJ+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function DJ(){return EA({mutationFn:OJ})}const LJ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:A,connectorType:s,modalSettings:a,disabled:i=!1,tooltipContent:l=""})=>{var S;const[u,d]=m.useState(!1),[f,B]=m.useState(r),[I,C]=m.useState(!1),[E,h]=m.useState(!1),p=Oe(ci)===pe.LOADING,{mutate:Q}=SJ(),{mutate:y}=_J(),{mutate:b}=DJ();m.useEffect(()=>{B(r)},[r]);const v=()=>{d(!0),y({connectorId:A,userAuthEnabled:!0},{onSettled:()=>{d(!1),h(!1)},onSuccess:R=>{(R==null?void 0:R.userAuthEnabled)!==void 0&&B(R.userAuthEnabled)}})},w=R=>{const O=R.target.checked;if(e===oE&&O){h(!0);return}if(d(!0),e===oE){y({connectorId:A,userAuthEnabled:O},{onSettled:()=>{d(!1)},onSuccess:N=>{(N==null?void 0:N.userAuthEnabled)!==void 0&&B(N.userAuthEnabled),(N==null?void 0:N.userAuthEnabled)===!1&&a&&C(!0)}});return}Q({connectorId:A,data:{[e]:O}},{onSettled:()=>{d(!1)},onSuccess:N=>{N.enabled!==void 0&&B(N.enabled),!O&&a&&C(!0)}})},x=R=>{const O={feedback_type:"email-logging-disabled",comment:R.feedbackComment,option:R.feedbackOption,connector_id:A,connector_type:s};b({feedbackData:O}),C(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"w-full flex justify-between items-center border-1 border-gray-5 rounded-sm p-4 gap-2.5 [&:first-child:last-child]:col-span-2",children:[c.jsxs("div",{className:"flex gap-2.5",children:[c.jsx("div",{className:"h-11 w-10.5 p-3 bg-gray-6a rounded-sm shrink-0",children:c.jsx("img",{src:o,alt:"Smart Previews Icon"})}),c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("h3",{className:"font-medium! text-body1",children:t}),c.jsx("p",{className:"text-body2",children:n})]})]}),c.jsx(QJ,{title:l,placement:"top",color:"#343C45",arrow:!0,width:"287px",children:c.jsx("div",{className:"w-12",children:c.jsx(k1,{id:`switch_${e}`,checked:f,onClick:R=>R==null?void 0:R.stopPropagation(),onChange:w,isLoading:u||p,disabled:u||p||i})})})]}),c.jsx(_A,{shown:I,setShown:C,borderRadius:12,sx:{zIndex:15002},children:c.jsx(mJ,{onCancel:()=>C(!1),onSubmit:x,isLoading:u,title:(a==null?void 0:a.title)||"",feedbackOptions:(a==null?void 0:a.radioOptions)||[],placeholder:((S=a==null?void 0:a.textArea)==null?void 0:S.placeholder)||""})}),c.jsx(_A,{shown:E,setShown:h,showCloseButton:!0,borderRadius:8,sx:{zIndex:15002},children:c.jsx(yJ,{title:Kc.title,description:Kc.description,confirmLabel:Kc.confirmLabel,cancelLabel:Kc.cancelLabel,isLoading:u,danger:!0,onConfirm:v,onCancel:()=>h(!1)})})]})},FJ=(e,t)=>typeof e[t]=="boolean",NJ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},RJ=e=>{const t={};for(const n in e)NJ(e,n)?t[n]=e[n]:FJ(e,n)&&(t[n]={enabled:e[n],connector:n===e2?e.connector:void 0});return t},kJ=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r})=>{const{availableFeatures:o}=m.useContext(Qt),A=RJ(e),s=pJ.filter(l=>Ar(o,l.featureKey)&&typeof A[l.id]=="object");if(s.length===0)return null;const a=l=>A[l].enabled,i=l=>{var d;const u=A[l];return!a(l)&&((d=u==null?void 0:u.connector)!=null&&d.id)?{isDisabled:!0,tooltipContent:Lr(IJ,{enabledConnector:u.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return c.jsxs("div",{children:[c.jsx("h2",{className:"text-h2 text-[#4D596C]! mt-8 mb-2",children:BJ}),c.jsx("p",{className:"text-body2 text-[#6F7C90]!",children:hJ}),c.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:s.map(l=>{const{isDisabled:u,tooltipContent:d}=i(l.id);return c.jsx(LJ,{id:l.id,heading:l.heading.replace(/\{\{app_name\}\}/g,n),subHeading:l.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:a(l.id),icon:l.icon,connectorId:t,connectorType:r,modalSettings:l.modalSettings,disabled:u,tooltipContent:d},l.id)})})]})},PJ=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_1446_4479)"},_.createElement("path",{d:"M11.3333 2H3.33333C2.59333 2 2 2.6 2 3.33333V12.6667C2 13.4 2.59333 14 3.33333 14H12.6667C13.4 14 14 13.4 14 12.6667V4.66667L11.3333 2ZM8 12.6667C6.89333 12.6667 6 11.7733 6 10.6667C6 9.56 6.89333 8.66667 8 8.66667C9.10667 8.66667 10 9.56 10 10.6667C10 11.7733 9.10667 12.6667 8 12.6667ZM10 6H3.33333V3.33333H10V6Z",fill:"white"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_1446_4479"},_.createElement("rect",{width:16,height:16,fill:"white"})))),n2=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),_.createElement("g",{filter:"url(#filter0_d_360_39563)"},_.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),_.createElement("g",{filter:"url(#filter1_d_360_39563)"},_.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),_.createElement("defs",null,_.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),_.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),MJ=({connectorId:e,connectorName:t,connectorLogo:n})=>{const{sendTrackingEvent:r}=m.useContext(Qt),[o,A]=m.useState(null),[s,a]=m.useState([]),[i,l]=m.useState(!1),[u,d]=m.useState(""),[f,B]=m.useState(!0),[I,C]=m.useState(!1);if(m.useEffect(()=>{(async()=>{var v;B(!0);try{const[w,x]=await Promise.all([VV(e),GV(e)]);A(w.data??null),a(((v=x.data)==null?void 0:v.presets)??[])}catch(w){Dt({message:Mc,type:Nn}),console.error(w)}finally{B(!1)}})()},[e]),f||s.length===0)return null;const E=s.find(b=>b.hiverParam===(o==null?void 0:o.hiverParam))??s[0],h=()=>{var w;r(Ye.LOOKUP_CONFIG_CLICKED,{connector_name:t,page:"connector_settings"});const b=(o==null?void 0:o.hiverParam)??E.hiverParam,v=s.some(x=>x.hiverParam===b);d(v?b:((w=s[0])==null?void 0:w.hiverParam)??""),l(!0)},p=async()=>{C(!0);try{await HV([{connectorId:e,hiverParam:u}]),A({connectorId:e,hiverParam:u}),r(Ye.LOOKUP_SAVED,{connector_name:t,hiver_param:u,page:"connector_settings"}),Dt({message:fH,type:eo}),l(!1)}catch{Dt({message:IH,type:Nn})}finally{C(!1)}},Q=EH.replace("%s",t),y=s.find(b=>b.hiverParam===(u||(o==null?void 0:o.hiverParam)))??s[0];return c.jsxs("div",{className:"border border-[#D6DDE8] rounded-lg bg-white p-4 mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-h2 text-[#3E4C5A]!",children:uH}),i?c.jsx(g.Button,{variant:"contained",size:"small",startIcon:c.jsx(PJ,{}),onClick:p,disabled:I,children:CH}):c.jsx(g.Button,{variant:"outlined",color:"tertiary",size:"small",onClick:h,children:dH})]}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6",children:gH}),i?c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsx(g.Select,{value:u,onChange:b=>{const v=b.target.value;r(Ye.LOOKUP_FIELD_CLICKED,{hiver_param:v,connector_name:t,page:"connector_settings"}),d(v)},size:"small",variant:"outlined",renderValue:b=>{var w;const v=((w=s.find(x=>x.hiverParam===b))==null?void 0:w.label)??"";return c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),v]})},sx:{fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},children:s.map(b=>c.jsx(g.MenuItem,{value:b.hiverParam,sx:{fontSize:"14px"},children:b.label},b.hiverParam))}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]}):c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-[8px] font-medium bg-[#F6F8FC] w-[209px] h-10",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),y.label]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]})]})},jJ=({connectorData:e})=>{var B;const{cardList:t=[],name:n="",customCardsList:r=[],advancedFeatures:o={},type:A,logo:s=null}=e||{},[a,i]=m.useState(!1),{availableFeatures:l}=m.useContext(Qt),u=(B=yr())==null?void 0:B.tenantPlatform,d=Ar(l,u==="HIVERWEB"?`hot-${Rm}`:Rm),{id:f=""}=ko();return c.jsxs(c.Fragment,{children:[c.jsx(qC,{shown:a,setShown:i,connectorName:n}),c.jsx("h2",{className:"text-h2 text-[#4D596C]!",children:lH}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6 mt-2",children:cH}),d&&c.jsx(MJ,{connectorId:f,connectorName:n,connectorLogo:s}),c.jsx(L1,{setShowEnabledModal:i,currentConnectorId:f,formDefaultsEnabled:e==null?void 0:e.formDefaultsEnabled,infoCards:[...t,...r]}),c.jsx(kJ,{advancedFeatures:o,connectorId:f,connectorName:n,connectorType:A})]})},VJ=()=>{const e=sr(),{sendTrackingEvent:t}=m.useContext(Qt),n=Oe(_C),r=Oe(ci),o=Oe(s1),A=Oe(to),s=Oe(ri),{id:a=""}=ko(),[i]=pA(),l=i.get("isEdit")==="true",u=i.get("tabIndex"),[d,f]=m.useState(()=>{const v=Number(u);return Number.isNaN(v)||v<0?0:v>Zc.length-1?Zc.length-1:v}),B=(v,w)=>{f(w)},I=(A==null?void 0:A[a])||null,C=(s==null?void 0:s[a])||null,E=l?I:C,h=!(E!=null&&E.isAuthenticated),p=!!(E!=null&&E.isEnabled),Q=[n,r].includes(pe.LOADING)||h,y=[{name:Lc,route:`${Xe.BASEPATH}${Xe.DASHBOARD}`},{name:(E==null?void 0:E.name)||"",route:`${Xe.BASEPATH}${Xe.API_VIEW}/${a}?isEdit=${String(l)}`},{name:Xz}],b=(v,w)=>{v==null||v.stopPropagation(),e(si({id:w,enabled:v.target.checked})).unwrap().then(()=>{v.target.checked?t(Ye.TOGGLE_ENABLED,{connector_name:E==null?void 0:E.name}):(t(Ye.TOGGLE_DISABLED,{connector_name:E==null?void 0:E.name}),Dt({message:Zm,type:wC}))}).catch(()=>{Dt({message:qm,type:Nn})})};return m.useEffect(()=>{e(ai()),l?(e(ii(a)),e(Vc(a))):e(oi(a))},[l,e,a]),c.jsxs("div",{className:"w-full h-full flex flex-col",children:[c.jsxs("div",{className:`flex flex-row justify-between ${l?"mb-2":"mb-9"}`,children:[c.jsx(R1,{options:y}),l?c.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c.jsx($z,{active:p,label:c.jsx(g.Typography,{variant:"body2",children:p?"Active":"Inactive"})}),c.jsx(k1,{isLoading:(o==null?void 0:o[a])===pe.LOADING,id:`switch_${a}`,checked:p,disabled:Q,onClick:v=>v==null?void 0:v.stopPropagation(),onChange:v=>b(v,a)})]}):null]}),l?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsxs(g.Tabs,{value:d,onChange:B,classes:{flexContainer:"border-b-2 border-[#D6DDE8]"},children:[c.jsx(g.Tab,{label:Zc[0],className:"border-b-0!"}),c.jsx(g.Tab,{label:Zc[1],className:"border-b-0!"})]})}),c.jsx("div",{hidden:d!==0,className:"grow overflow-auto py-6",children:c.jsx(K1,{connectorData:E})}),c.jsx("div",{hidden:d!==1,className:"grow overflow-auto py-6",children:c.jsx(jJ,{connectorData:E})})]}):c.jsx("div",{className:"grow overflow-auto py-0",children:c.jsx(K1,{connectorData:E})})]})},GJ=e=>e.auth.verifyTokenApiStatus,HJ=e=>e.auth.authVerificationDone,WJ=g.styled(g.Box)`
3469
3469
  position: fixed;
3470
3470
  z-index: 1000;
3471
3471
  background-color: #fff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-admin",
3
- "version": "4.13.0-userauthfixes-beta.0",
3
+ "version": "4.13.0-userauthfixesv2-beta.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",