datocms-plugin-ai-translations 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -159,7 +159,11 @@ export default {
159
159
  };
160
160
  if (req.method === 'OPTIONS') return new Response(null, { headers: cors });
161
161
 
162
- const upstream = new URL('/v2/translate', env.DEEPL_BASE_URL || 'https://api.deepl.com');
162
+ const url = new URL(req.url);
163
+ const isFree = url.searchParams.get('endpoint') === 'free';
164
+ const baseUrl = isFree ? 'https://api-free.deepl.com' : 'https://api.deepl.com';
165
+ const upstream = new URL('/v2/translate', baseUrl);
166
+
163
167
  const body = await req.text(); // passthrough JSON body
164
168
 
165
169
  const resp = await fetch(upstream, {
@@ -195,7 +199,10 @@ export default async function handler(req, res) {
195
199
  res.setHeader('Access-Control-Allow-Headers', '*');
196
200
  if (req.method === 'OPTIONS') return res.status(204).end();
197
201
 
198
- const upstream = `${process.env.DEEPL_BASE_URL || 'https://api.deepl.com'}/v2/translate`;
202
+ const isFree = req.query.endpoint === 'free';
203
+ const baseUrl = isFree ? 'https://api-free.deepl.com' : 'https://api.deepl.com';
204
+ const upstream = `${baseUrl}/v2/translate`;
205
+
199
206
  const r = await fetch(upstream, {
200
207
  method: 'POST',
201
208
  headers: {
@@ -229,7 +236,11 @@ export const handler = async (event) => {
229
236
  if (event.httpMethod === 'OPTIONS') {
230
237
  return { statusCode: 204, headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*' } };
231
238
  }
232
- const upstream = `${process.env.DEEPL_BASE_URL || 'https://api.deepl.com'}/v2/translate`;
239
+
240
+ const isFree = event.queryStringParameters?.endpoint === 'free';
241
+ const baseUrl = isFree ? 'https://api-free.deepl.com' : 'https://api.deepl.com';
242
+ const upstream = `${baseUrl}/v2/translate`;
243
+
233
244
  const r = await fetch(upstream, {
234
245
  method: 'POST',
235
246
  headers: {
@@ -267,8 +278,7 @@ Endpoint selection (Free vs Pro)
267
278
 
268
279
  That’s it — once your proxy passes the test, DeepL translations (including large Structured Text fields) will work end‑to‑end.
269
280
 
270
- See also
271
- - CLI step‑by‑steps for deploying a proxy (Cloudflare, Vercel, Netlify): docs/DeepL-Proxy-CLI.md
281
+
272
282
 
273
283
  ## DeepL Glossaries
274
284
 
@@ -53,7 +53,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
53
53
  */var Je=typeof Symbol=="function"&&Symbol.for,Ag=Je?Symbol.for("react.element"):60103,Og=Je?Symbol.for("react.portal"):60106,Dc=Je?Symbol.for("react.fragment"):60107,Fc=Je?Symbol.for("react.strict_mode"):60108,jc=Je?Symbol.for("react.profiler"):60114,Bc=Je?Symbol.for("react.provider"):60109,$c=Je?Symbol.for("react.context"):60110,Ig=Je?Symbol.for("react.async_mode"):60111,zc=Je?Symbol.for("react.concurrent_mode"):60111,Vc=Je?Symbol.for("react.forward_ref"):60112,Uc=Je?Symbol.for("react.suspense"):60113,w6=Je?Symbol.for("react.suspense_list"):60120,Kc=Je?Symbol.for("react.memo"):60115,Gc=Je?Symbol.for("react.lazy"):60116,_6=Je?Symbol.for("react.block"):60121,b6=Je?Symbol.for("react.fundamental"):60117,S6=Je?Symbol.for("react.responder"):60118,T6=Je?Symbol.for("react.scope"):60119;function Ht(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Ag:switch(t=t.type,t){case Ig:case zc:case Dc:case jc:case Fc:case Uc:return t;default:switch(t=t&&t.$$typeof,t){case $c:case Vc:case Gc:case Kc:case Bc:return t;default:return e}}case Og:return e}}}function yS(t){return Ht(t)===zc}pe.AsyncMode=Ig;pe.ConcurrentMode=zc;pe.ContextConsumer=$c;pe.ContextProvider=Bc;pe.Element=Ag;pe.ForwardRef=Vc;pe.Fragment=Dc;pe.Lazy=Gc;pe.Memo=Kc;pe.Portal=Og;pe.Profiler=jc;pe.StrictMode=Fc;pe.Suspense=Uc;pe.isAsyncMode=function(t){return yS(t)||Ht(t)===Ig};pe.isConcurrentMode=yS;pe.isContextConsumer=function(t){return Ht(t)===$c};pe.isContextProvider=function(t){return Ht(t)===Bc};pe.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ag};pe.isForwardRef=function(t){return Ht(t)===Vc};pe.isFragment=function(t){return Ht(t)===Dc};pe.isLazy=function(t){return Ht(t)===Gc};pe.isMemo=function(t){return Ht(t)===Kc};pe.isPortal=function(t){return Ht(t)===Og};pe.isProfiler=function(t){return Ht(t)===jc};pe.isStrictMode=function(t){return Ht(t)===Fc};pe.isSuspense=function(t){return Ht(t)===Uc};pe.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Dc||t===zc||t===jc||t===Fc||t===Uc||t===w6||typeof t=="object"&&t!==null&&(t.$$typeof===Gc||t.$$typeof===Kc||t.$$typeof===Bc||t.$$typeof===$c||t.$$typeof===Vc||t.$$typeof===b6||t.$$typeof===S6||t.$$typeof===T6||t.$$typeof===_6)};pe.typeOf=Ht;mS.exports=pe;var E6=mS.exports,vS=E6,C6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x6={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},wS={};wS[vS.ForwardRef]=C6;wS[vS.Memo]=x6;var R6=!0;function k6(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var _S=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||R6===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},P6=function(e,n,r){_S(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var a=n;do e.insert(n===a?"."+i:"",a,e.sheet,!0),a=a.next;while(a!==void 0)}};function A6(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var O6={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},I6=/[A-Z]|^ms/g,M6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bS=function(e){return e.charCodeAt(1)===45},Wv=function(e){return e!=null&&typeof e!="boolean"},Qd=c6(function(t){return bS(t)?t:t.replace(I6,"-$&").toLowerCase()}),Yv=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(M6,function(r,i,a){return kn={name:i,styles:a,next:kn},i})}return O6[e]!==1&&!bS(e)&&typeof n=="number"&&n!==0?n+"px":n};function cs(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return kn={name:i.name,styles:i.styles,next:kn},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)kn={name:o.name,styles:o.styles,next:kn},o=o.next;var l=a.styles+";";return l}return L6(t,e,n)}case"function":{if(t!==void 0){var u=kn,s=n(t);return kn=u,cs(t,e,s)}break}}var c=n;return c}function L6(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=cs(t,e,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var l=o;Wv(l)&&(r+=Qd(a)+":"+Yv(a,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&e==null)for(var u=0;u<o.length;u++)Wv(o[u])&&(r+=Qd(a)+":"+Yv(a,o[u])+";");else{var s=cs(t,e,o);switch(a){case"animation":case"animationName":{r+=Qd(a)+":"+s+";";break}default:r+=a+"{"+s+"}"}}}return r}var Xv=/label:\s*([^\s;{]+)\s*(;|$)/g,kn;function SS(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";kn=void 0;var a=t[0];if(a==null||a.raw===void 0)r=!1,i+=cs(n,e,a);else{var o=a;i+=o[0]}for(var l=1;l<t.length;l++)if(i+=cs(n,e,t[l]),r){var u=a;i+=u[l]}Xv.lastIndex=0;for(var s="",c;(c=Xv.exec(i))!==null;)s+="-"+c[1];var d=A6(i)+s;return{name:d,styles:i,next:kn}}var N6=function(e){return e()},D6=ky.useInsertionEffect?ky.useInsertionEffect:!1,F6=D6||N6,TS=b.createContext(typeof HTMLElement<"u"?v6({key:"css"}):null);TS.Provider;var j6=function(e){return b.forwardRef(function(n,r){var i=b.useContext(TS);return e(n,i,r)})},B6=b.createContext({}),Mg={}.hasOwnProperty,zh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",$6=function(e,n){var r={};for(var i in n)Mg.call(n,i)&&(r[i]=n[i]);return r[zh]=e,r},z6=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return _S(n,r,i),F6(function(){return P6(n,r,i)}),null},V6=j6(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=t[zh],a=[r],o="";typeof t.className=="string"?o=k6(e.registered,a,t.className):t.className!=null&&(o=t.className+" ");var l=SS(a,void 0,b.useContext(B6));o+=e.key+"-"+l.name;var u={};for(var s in t)Mg.call(t,s)&&s!=="css"&&s!==zh&&(u[s]=t[s]);return u.className=o,n&&(u.ref=n),b.createElement(b.Fragment,null,b.createElement(z6,{cache:e,serialized:l,isStringTag:typeof i=="string"}),b.createElement(i,u))}),U6=V6,Y=function(e,n){var r=arguments;if(n==null||!Mg.call(n,"css"))return b.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=U6,a[1]=$6(e,n);for(var o=2;o<i;o++)a[o]=r[o];return b.createElement.apply(null,a)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Y||(Y={}));function Lg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return SS(e)}function K6(){var t=Lg.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function G6(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const H6=Math.min,q6=Math.max,Du=Math.round,ul=Math.floor,Fu=t=>({x:t,y:t});function W6(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Hc(){return typeof window<"u"}function ES(t){return xS(t)?(t.nodeName||"").toLowerCase():"#document"}function rr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function CS(t){var e;return(e=(xS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xS(t){return Hc()?t instanceof Node||t instanceof rr(t).Node:!1}function Y6(t){return Hc()?t instanceof Element||t instanceof rr(t).Element:!1}function Ng(t){return Hc()?t instanceof HTMLElement||t instanceof rr(t).HTMLElement:!1}function Jv(t){return!Hc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof rr(t).ShadowRoot}const X6=new Set(["inline","contents"]);function RS(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Dg(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!X6.has(i)}function J6(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Z6=new Set(["html","body","#document"]);function Q6(t){return Z6.has(ES(t))}function Dg(t){return rr(t).getComputedStyle(t)}function eP(t){if(ES(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Jv(t)&&t.host||CS(t);return Jv(e)?e.host:e}function kS(t){const e=eP(t);return Q6(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ng(e)&&RS(e)?e:kS(e)}function ju(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=kS(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),o=rr(i);if(a){const l=Vh(o);return e.concat(o,o.visualViewport||[],RS(i)?i:[],l&&n?ju(l):[])}return e.concat(i,ju(i,[],n))}function Vh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tP(t){const e=Dg(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ng(t),a=i?t.offsetWidth:n,o=i?t.offsetHeight:r,l=Du(n)!==a||Du(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Fg(t){return Y6(t)?t:t.contextElement}function Zv(t){const e=Fg(t);if(!Ng(e))return Fu(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=tP(e);let o=(a?Du(n.width):n.width)/r,l=(a?Du(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const nP=Fu(0);function rP(t){const e=rr(t);return!J6()||!e.visualViewport?nP:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function iP(t,e,n){return!1}function Qv(t,e,n,r){e===void 0&&(e=!1);const i=t.getBoundingClientRect(),a=Fg(t);let o=Fu(1);e&&(o=Zv(t));const l=iP()?rP(a):Fu(0);let u=(i.left+l.x)/o.x,s=(i.top+l.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=rr(a),h=r;let p=f,y=Vh(p);for(;y&&r&&h!==p;){const w=Zv(y),g=y.getBoundingClientRect(),m=Dg(y),v=g.left+(y.clientLeft+parseFloat(m.paddingLeft))*w.x,_=g.top+(y.clientTop+parseFloat(m.paddingTop))*w.y;u*=w.x,s*=w.y,c*=w.x,d*=w.y,u+=v,s+=_,p=rr(y),y=Vh(p)}}return W6({width:c,height:d,x:u,y:s})}function PS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function aP(t,e){let n=null,r;const i=CS(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const s=t.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=s;if(l||e(),!f||!h)return;const p=ul(d),y=ul(i.clientWidth-(c+f)),w=ul(i.clientHeight-(d+h)),g=ul(c),v={rootMargin:-p+"px "+-y+"px "+-w+"px "+-g+"px",threshold:q6(0,H6(1,u))||1};let _=!0;function S(E){const T=E[0].intersectionRatio;if(T!==u){if(!_)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!PS(s,t.getBoundingClientRect())&&o(),_=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(t)}return o(!0),a}function oP(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,s=Fg(t),c=i||a?[...s?ju(s):[],...ju(e)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const d=s&&l?aP(s,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===s&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),s&&!u&&h.observe(s),h.observe(e));let p,y=u?Qv(t):null;u&&w();function w(){const g=Qv(t);y&&!PS(y,g)&&n(),y=g,p=requestAnimationFrame(w)}return n(),()=>{var g;c.forEach(m=>{i&&m.removeEventListener("scroll",n),a&&m.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,u&&cancelAnimationFrame(p)}}var Bu=b.useLayoutEffect,sP=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],$u=function(){};function lP(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function uP(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[].concat(r);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&a.push("".concat(lP(t,o)));return a.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var e0=function(e){return vP(e)?e.filter(Boolean):Ci(e)==="object"&&e!==null?[e]:[]},AS=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=lr(e,sP);return J({},n)},De=function(e,n,r){var i=e.cx,a=e.getStyles,o=e.getClassNames,l=e.className;return{css:a(n,e),className:i(r??{},o(n,e),l)}};function qc(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function cP(t){return qc(t)?window.innerHeight:t.clientHeight}function OS(t){return qc(t)?window.pageYOffset:t.scrollTop}function zu(t,e){if(qc(t)){window.scrollTo(0,e);return}t.scrollTop=e}function dP(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=t;i=i.parentElement;)if(e=getComputedStyle(i),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function fP(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function cl(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:$u,i=OS(t),a=e-i,o=10,l=0;function u(){l+=o;var s=fP(l,i,a,n);zu(t,s),l<n?window.requestAnimationFrame(u):r(t)}u()}function t0(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>n.bottom?zu(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+i,t.scrollHeight)):r.top-i<n.top&&zu(t,Math.max(e.offsetTop-i,0))}function hP(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function n0(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pP(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var IS=!1,gP={get passive(){return IS=!0}},dl=typeof window<"u"?window:{};dl.addEventListener&&dl.removeEventListener&&(dl.addEventListener("p",$u,gP),dl.removeEventListener("p",$u,!1));var mP=IS;function yP(t){return t!=null}function vP(t){return Array.isArray(t)}function fl(t,e,n){return t?e:n}var wP=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=Object.entries(e).filter(function(o){var l=Xn(o,1),u=l[0];return!r.includes(u)});return a.reduce(function(o,l){var u=Xn(l,2),s=u[0],c=u[1];return o[s]=c,o},{})},_P=["children","innerProps"],bP=["children","innerProps"];function SP(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,i=t.placement,a=t.shouldScroll,o=t.isFixedPosition,l=t.controlHeight,u=dP(n),s={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return s;var c=u.getBoundingClientRect(),d=c.height,f=n.getBoundingClientRect(),h=f.bottom,p=f.height,y=f.top,w=n.offsetParent.getBoundingClientRect(),g=w.top,m=o?window.innerHeight:cP(u),v=OS(u),_=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),E=g-S,T=m-y,x=E+v,P=d-v-y,R=h-m+v+_,A=v+y-S,j=160;switch(i){case"auto":case"bottom":if(T>=p)return{placement:"bottom",maxHeight:e};if(P>=p&&!o)return a&&cl(u,R,j),{placement:"bottom",maxHeight:e};if(!o&&P>=r||o&&T>=r){a&&cl(u,R,j);var L=o?T-_:P-_;return{placement:"bottom",maxHeight:L}}if(i==="auto"||o){var D=e,$=o?E:x;return $>=r&&(D=Math.min($-_-l,e)),{placement:"top",maxHeight:D}}if(i==="bottom")return a&&zu(u,R),{placement:"bottom",maxHeight:e};break;case"top":if(E>=p)return{placement:"top",maxHeight:e};if(x>=p&&!o)return a&&cl(u,A,j),{placement:"top",maxHeight:e};if(!o&&x>=r||o&&E>=r){var B=e;return(!o&&x>=r||o&&E>=r)&&(B=o?E-S:x-S),a&&cl(u,A,j),{placement:"top",maxHeight:B}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return s}function TP(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var MS=function(e){return e==="auto"?"bottom":e},EP=function(e,n){var r,i=e.placement,a=e.theme,o=a.borderRadius,l=a.spacing,u=a.colors;return J((r={label:"menu"},yo(r,TP(i),"100%"),yo(r,"position","absolute"),yo(r,"width","100%"),yo(r,"zIndex",1),r),n?{}:{backgroundColor:u.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},LS=b.createContext(null),CP=function(e){var n=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,a=e.menuPlacement,o=e.menuPosition,l=e.menuShouldScrollIntoView,u=e.theme,s=b.useContext(LS)||{},c=s.setPortalPlacement,d=b.useRef(null),f=b.useState(i),h=Xn(f,2),p=h[0],y=h[1],w=b.useState(null),g=Xn(w,2),m=g[0],v=g[1],_=u.spacing.controlHeight;return Bu(function(){var S=d.current;if(S){var E=o==="fixed",T=l&&!E,x=SP({maxHeight:i,menuEl:S,minHeight:r,placement:a,shouldScroll:T,isFixedPosition:E,controlHeight:_});y(x.maxHeight),v(x.placement),c==null||c(x.placement)}},[i,a,o,l,r,c,_]),n({ref:d,placerProps:J(J({},e),{},{placement:m||MS(a),maxHeight:p})})},xP=function(e){var n=e.children,r=e.innerRef,i=e.innerProps;return Y("div",Z({},De(e,"menu",{menu:!0}),{ref:r},i),n)},RP=xP,kP=function(e,n){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return J({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},PP=function(e){var n=e.children,r=e.innerProps,i=e.innerRef,a=e.isMulti;return Y("div",Z({},De(e,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:i},r),n)},NS=function(e,n){var r=e.theme,i=r.spacing.baseUnit,a=r.colors;return J({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},AP=NS,OP=NS,IP=function(e){var n=e.children,r=n===void 0?"No options":n,i=e.innerProps,a=lr(e,_P);return Y("div",Z({},De(J(J({},a),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},MP=function(e){var n=e.children,r=n===void 0?"Loading...":n,i=e.innerProps,a=lr(e,bP);return Y("div",Z({},De(J(J({},a),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},LP=function(e){var n=e.rect,r=e.offset,i=e.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},NP=function(e){var n=e.appendTo,r=e.children,i=e.controlElement,a=e.innerProps,o=e.menuPlacement,l=e.menuPosition,u=b.useRef(null),s=b.useRef(null),c=b.useState(MS(o)),d=Xn(c,2),f=d[0],h=d[1],p=b.useMemo(function(){return{setPortalPlacement:h}},[]),y=b.useState(null),w=Xn(y,2),g=w[0],m=w[1],v=b.useCallback(function(){if(i){var T=hP(i),x=l==="fixed"?0:window.pageYOffset,P=T[f]+x;(P!==(g==null?void 0:g.offset)||T.left!==(g==null?void 0:g.rect.left)||T.width!==(g==null?void 0:g.rect.width))&&m({offset:P,rect:T})}},[i,l,f,g==null?void 0:g.offset,g==null?void 0:g.rect.left,g==null?void 0:g.rect.width]);Bu(function(){v()},[v]);var _=b.useCallback(function(){typeof s.current=="function"&&(s.current(),s.current=null),i&&u.current&&(s.current=oP(i,u.current,v,{elementResize:"ResizeObserver"in window}))},[i,v]);Bu(function(){_()},[_]);var S=b.useCallback(function(T){u.current=T,_()},[_]);if(!n&&l!=="fixed"||!g)return null;var E=Y("div",Z({ref:S},De(J(J({},e),{},{offset:g.offset,position:l,rect:g.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Y(LS.Provider,{value:p},n?Cg.createPortal(E,n):E)},DP=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},FP=function(e){var n=e.children,r=e.innerProps,i=e.isDisabled,a=e.isRtl;return Y("div",Z({},De(e,"container",{"--is-disabled":i,"--is-rtl":a}),r),n)},jP=function(e,n){var r=e.theme.spacing,i=e.isMulti,a=e.hasValue,o=e.selectProps.controlShouldRenderValue;return J({alignItems:"center",display:i&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},BP=function(e){var n=e.children,r=e.innerProps,i=e.isMulti,a=e.hasValue;return Y("div",Z({},De(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":a}),r),n)},$P=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zP=function(e){var n=e.children,r=e.innerProps;return Y("div",Z({},De(e,"indicatorsContainer",{indicators:!0}),r),n)},r0,VP=["size"],UP=["innerProps","isRtl","size"],KP={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},DS=function(e){var n=e.size,r=lr(e,VP);return Y("svg",Z({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:KP},r))},jg=function(e){return Y(DS,Z({size:20},e),Y("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},FS=function(e){return Y(DS,Z({size:20},e),Y("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},jS=function(e,n){var r=e.isFocused,i=e.theme,a=i.spacing.baseUnit,o=i.colors;return J({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},GP=jS,HP=function(e){var n=e.children,r=e.innerProps;return Y("div",Z({},De(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Y(FS,null))},qP=jS,WP=function(e){var n=e.children,r=e.innerProps;return Y("div",Z({},De(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Y(jg,null))},YP=function(e,n){var r=e.isDisabled,i=e.theme,a=i.spacing.baseUnit,o=i.colors;return J({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},XP=function(e){var n=e.innerProps;return Y("span",Z({},n,De(e,"indicatorSeparator",{"indicator-separator":!0})))},JP=K6(r0||(r0=G6([`
54
54
  0%, 80%, 100% { opacity: 0; }
55
55
  40% { opacity: 1; }
56
- `]))),ZP=function(e,n){var r=e.isFocused,i=e.size,a=e.theme,o=a.colors,l=a.spacing.baseUnit;return J({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:l*2})},ef=function(e){var n=e.delay,r=e.offset;return Y("span",{css:Lg({animation:"".concat(JP," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},QP=function(e){var n=e.innerProps,r=e.isRtl,i=e.size,a=i===void 0?4:i,o=lr(e,UP);return Y("div",Z({},De(J(J({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Y(ef,{delay:0,offset:r}),Y(ef,{delay:160,offset:!0}),Y(ef,{delay:320,offset:!r}))},e9=function(e,n){var r=e.isDisabled,i=e.isFocused,a=e.theme,o=a.colors,l=a.borderRadius,u=a.spacing;return J({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:u.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},t9=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,a=e.innerRef,o=e.innerProps,l=e.menuIsOpen;return Y("div",Z({ref:a},De(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},n9=t9,r9=["data"],i9=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},a9=function(e){var n=e.children,r=e.cx,i=e.getStyles,a=e.getClassNames,o=e.Heading,l=e.headingProps,u=e.innerProps,s=e.label,c=e.theme,d=e.selectProps;return Y("div",Z({},De(e,"group",{group:!0}),u),Y(o,Z({},l,{selectProps:d,theme:c,getStyles:i,getClassNames:a,cx:r}),s),Y("div",null,n))},o9=function(e,n){var r=e.theme,i=r.colors,a=r.spacing;return J({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},s9=function(e){var n=AS(e);n.data;var r=lr(n,r9);return Y("div",Z({},De(e,"groupHeading",{"group-heading":!0}),r))},l9=a9,u9=["innerRef","isDisabled","isHidden","inputClassName"],c9=function(e,n){var r=e.isDisabled,i=e.value,a=e.theme,o=a.spacing,l=a.colors;return J(J({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},d9),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},BS={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},d9={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":J({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},BS)},f9=function(e){return J({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},BS)},h9=function(e){var n=e.cx,r=e.value,i=AS(e),a=i.innerRef,o=i.isDisabled,l=i.isHidden,u=i.inputClassName,s=lr(i,u9);return Y("div",Z({},De(e,"input",{"input-container":!0}),{"data-value":r||""}),Y("input",Z({className:n({input:!0},u),ref:a,style:f9(l),disabled:o},s)))},p9=h9,g9=function(e,n){var r=e.theme,i=r.spacing,a=r.borderRadius,o=r.colors;return J({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},m9=function(e,n){var r=e.theme,i=r.borderRadius,a=r.colors,o=e.cropWithEllipsis;return J({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},y9=function(e,n){var r=e.theme,i=r.spacing,a=r.borderRadius,o=r.colors,l=e.isFocused;return J({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:l?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},$S=function(e){var n=e.children,r=e.innerProps;return Y("div",r,n)},v9=$S,w9=$S;function _9(t){var e=t.children,n=t.innerProps;return Y("div",Z({role:"button"},n),e||Y(jg,{size:14}))}var b9=function(e){var n=e.children,r=e.components,i=e.data,a=e.innerProps,o=e.isDisabled,l=e.removeProps,u=e.selectProps,s=r.Container,c=r.Label,d=r.Remove;return Y(s,{data:i,innerProps:J(J({},De(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:u},Y(c,{data:i,innerProps:J({},De(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:u},n),Y(d,{data:i,innerProps:J(J({},De(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:u}))},S9=b9,T9=function(e,n){var r=e.isDisabled,i=e.isFocused,a=e.isSelected,o=e.theme,l=o.spacing,u=o.colors;return J({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?u.primary:i?u.primary25:"transparent",color:r?u.neutral20:a?u.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?u.primary:u.primary50}})},E9=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,a=e.isSelected,o=e.innerRef,l=e.innerProps;return Y("div",Z({},De(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},C9=E9,x9=function(e,n){var r=e.theme,i=r.spacing,a=r.colors;return J({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},R9=function(e){var n=e.children,r=e.innerProps;return Y("div",Z({},De(e,"placeholder",{placeholder:!0}),r),n)},k9=R9,P9=function(e,n){var r=e.isDisabled,i=e.theme,a=i.spacing,o=i.colors;return J({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},A9=function(e){var n=e.children,r=e.isDisabled,i=e.innerProps;return Y("div",Z({},De(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},O9=A9,I9={ClearIndicator:WP,Control:n9,DropdownIndicator:HP,DownChevron:FS,CrossIcon:jg,Group:l9,GroupHeading:s9,IndicatorsContainer:zP,IndicatorSeparator:XP,Input:p9,LoadingIndicator:QP,Menu:RP,MenuList:PP,MenuPortal:NP,LoadingMessage:MP,NoOptionsMessage:IP,MultiValue:S9,MultiValueContainer:v9,MultiValueLabel:w9,MultiValueRemove:_9,Option:C9,Placeholder:k9,SelectContainer:FP,SingleValue:O9,ValueContainer:BP},M9=function(e){return J(J({},I9),e.components)},i0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function L9(t,e){return!!(t===e||i0(t)&&i0(e))}function N9(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!L9(t[n],e[n]))return!1;return!0}function D9(t,e){e===void 0&&(e=N9);var n=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var o=t.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}var F9={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},j9=function(e){return Y("span",Z({css:F9},e))},a0=j9,B9={guidance:function(e){var n=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,a=e.context,o=e.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,i=r===void 0?"":r,a=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,i=e.options,a=e.label,o=a===void 0?"":a,l=e.selectValue,u=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,d=function(y,w){return y&&y.length?"".concat(y.indexOf(w)+1," of ").concat(y.length):""};if(n==="value"&&l)return"value ".concat(o," focused, ").concat(d(l,r),".");if(n==="menu"&&c){var f=u?" disabled":"",h="".concat(s?" selected":"").concat(f);return"".concat(o).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},$9=function(e){var n=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,a=e.focusableOptions,o=e.isFocused,l=e.selectValue,u=e.selectProps,s=e.id,c=e.isAppleDevice,d=u.ariaLiveMessages,f=u.getOptionLabel,h=u.inputValue,p=u.isMulti,y=u.isOptionDisabled,w=u.isSearchable,g=u.menuIsOpen,m=u.options,v=u.screenReaderStatus,_=u.tabSelectsValue,S=u.isLoading,E=u["aria-label"],T=u["aria-live"],x=b.useMemo(function(){return J(J({},B9),d||{})},[d]),P=b.useMemo(function(){var $="";if(n&&x.onChange){var B=n.option,N=n.options,O=n.removedValue,z=n.removedValues,U=n.value,ie=function(xe){return Array.isArray(xe)?null:xe},X=O||B||ie(U),oe=X?f(X):"",ye=N||z||void 0,be=ye?ye.map(f):[],ue=J({isDisabled:X&&y(X,l),label:oe,labels:be},n);$=x.onChange(ue)}return $},[n,x,y,l,f]),R=b.useMemo(function(){var $="",B=r||i,N=!!(r&&l&&l.includes(r));if(B&&x.onFocus){var O={focused:B,label:f(B),isDisabled:y(B,l),isSelected:N,options:a,context:B===r?"menu":"value",selectValue:l,isAppleDevice:c};$=x.onFocus(O)}return $},[r,i,f,y,x,a,l,c]),A=b.useMemo(function(){var $="";if(g&&m.length&&!S&&x.onFilter){var B=v({count:a.length});$=x.onFilter({inputValue:h,resultsMessage:B})}return $},[a,h,g,x,m,v,S]),j=(n==null?void 0:n.action)==="initial-input-focus",L=b.useMemo(function(){var $="";if(x.guidance){var B=i?"value":g?"menu":"input";$=x.guidance({"aria-label":E,context:B,isDisabled:r&&y(r,l),isMulti:p,isSearchable:w,tabSelectsValue:_,isInitialFocus:j})}return $},[E,r,i,p,y,w,g,x,l,_,j]),D=Y(b.Fragment,null,Y("span",{id:"aria-selection"},P),Y("span",{id:"aria-focused"},R),Y("span",{id:"aria-results"},A),Y("span",{id:"aria-guidance"},L));return Y(b.Fragment,null,Y(a0,{id:s},j&&D),Y(a0,{"aria-live":T,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!j&&D))},z9=$9,Uh=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],V9=new RegExp("["+Uh.map(function(t){return t.letters}).join("")+"]","g"),zS={};for(var tf=0;tf<Uh.length;tf++)for(var nf=Uh[tf],rf=0;rf<nf.letters.length;rf++)zS[nf.letters[rf]]=nf.base;var VS=function(e){return e.replace(V9,function(n){return zS[n]})},U9=D9(VS),o0=function(e){return e.replace(/^\s+|\s+$/g,"")},K9=function(e){return"".concat(e.label," ").concat(e.value)},G9=function(e){return function(n,r){if(n.data.__isNew__)return!0;var i=J({ignoreCase:!0,ignoreAccents:!0,stringify:K9,trim:!0,matchFrom:"any"},e),a=i.ignoreCase,o=i.ignoreAccents,l=i.stringify,u=i.trim,s=i.matchFrom,c=u?o0(r):r,d=u?o0(l(n)):l(n);return a&&(c=c.toLowerCase(),d=d.toLowerCase()),o&&(c=U9(c),d=VS(d)),s==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},H9=["innerRef"];function q9(t){var e=t.innerRef,n=lr(t,H9),r=wP(n,"onExited","in","enter","exit","appear");return Y("input",Z({ref:e},r,{css:Lg({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var W9=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Y9(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,i=t.onTopArrive,a=t.onTopLeave,o=b.useRef(!1),l=b.useRef(!1),u=b.useRef(0),s=b.useRef(null),c=b.useCallback(function(w,g){if(s.current!==null){var m=s.current,v=m.scrollTop,_=m.scrollHeight,S=m.clientHeight,E=s.current,T=g>0,x=_-S-v,P=!1;x>g&&o.current&&(r&&r(w),o.current=!1),T&&l.current&&(a&&a(w),l.current=!1),T&&g>x?(n&&!o.current&&n(w),E.scrollTop=_,P=!0,o.current=!0):!T&&-g>v&&(i&&!l.current&&i(w),E.scrollTop=0,P=!0,l.current=!0),P&&W9(w)}},[n,r,i,a]),d=b.useCallback(function(w){c(w,w.deltaY)},[c]),f=b.useCallback(function(w){u.current=w.changedTouches[0].clientY},[]),h=b.useCallback(function(w){var g=u.current-w.changedTouches[0].clientY;c(w,g)},[c]),p=b.useCallback(function(w){if(w){var g=mP?{passive:!1}:!1;w.addEventListener("wheel",d,g),w.addEventListener("touchstart",f,g),w.addEventListener("touchmove",h,g)}},[h,f,d]),y=b.useCallback(function(w){w&&(w.removeEventListener("wheel",d,!1),w.removeEventListener("touchstart",f,!1),w.removeEventListener("touchmove",h,!1))},[h,f,d]);return b.useEffect(function(){if(e){var w=s.current;return p(w),function(){y(w)}}},[e,p,y]),function(w){s.current=w}}var s0=["boxSizing","height","overflow","paddingRight","position"],l0={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function u0(t){t.cancelable&&t.preventDefault()}function c0(t){t.stopPropagation()}function d0(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function f0(){return"ontouchstart"in window||navigator.maxTouchPoints}var h0=!!(typeof window<"u"&&window.document&&window.document.createElement),co=0,Fi={capture:!1,passive:!1};function X9(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,i=b.useRef({}),a=b.useRef(null),o=b.useCallback(function(u){if(h0){var s=document.body,c=s&&s.style;if(r&&s0.forEach(function(p){var y=c&&c[p];i.current[p]=y}),r&&co<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(l0).forEach(function(p){var y=l0[p];c&&(c[p]=y)}),c&&(c.paddingRight="".concat(h,"px"))}s&&f0()&&(s.addEventListener("touchmove",u0,Fi),u&&(u.addEventListener("touchstart",d0,Fi),u.addEventListener("touchmove",c0,Fi))),co+=1}},[r]),l=b.useCallback(function(u){if(h0){var s=document.body,c=s&&s.style;co=Math.max(co-1,0),r&&co<1&&s0.forEach(function(d){var f=i.current[d];c&&(c[d]=f)}),s&&f0()&&(s.removeEventListener("touchmove",u0,Fi),u&&(u.removeEventListener("touchstart",d0,Fi),u.removeEventListener("touchmove",c0,Fi)))}},[r]);return b.useEffect(function(){if(e){var u=a.current;return o(u),function(){l(u)}}},[e,o,l]),function(u){a.current=u}}var J9=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Z9={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Q9(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,i=r===void 0?!0:r,a=t.onBottomArrive,o=t.onBottomLeave,l=t.onTopArrive,u=t.onTopLeave,s=Y9({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:u}),c=X9({isEnabled:n}),d=function(h){s(h),c(h)};return Y(b.Fragment,null,n&&Y("div",{onClick:J9,css:Z9}),e(d))}var eA={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tA=function(e){var n=e.name,r=e.onFocus;return Y("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:eA,value:"",onChange:function(){}})},nA=tA;function Bg(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function rA(){return Bg(/^iPhone/i)}function US(){return Bg(/^Mac/i)}function iA(){return Bg(/^iPad/i)||US()&&navigator.maxTouchPoints>1}function aA(){return rA()||iA()}function oA(){return US()||aA()}var sA=function(e){return e.label},lA=function(e){return e.label},uA=function(e){return e.value},cA=function(e){return!!e.isDisabled},dA={clearIndicator:qP,container:DP,control:e9,dropdownIndicator:GP,group:i9,groupHeading:o9,indicatorsContainer:$P,indicatorSeparator:YP,input:c9,loadingIndicator:ZP,loadingMessage:OP,menu:EP,menuList:kP,menuPortal:LP,multiValue:g9,multiValueLabel:m9,multiValueRemove:y9,noOptionsMessage:AP,option:T9,placeholder:x9,singleValue:P9,valueContainer:jP},fA={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},hA=4,KS=4,pA=38,gA=KS*2,mA={baseUnit:KS,controlHeight:pA,menuGutter:gA},af={borderRadius:hA,colors:fA,spacing:mA},yA={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:n0(),captureMenuScroll:!n0(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:G9(),formatGroupLabel:sA,getOptionLabel:lA,getOptionValue:uA,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:cA,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pP(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function p0(t,e,n,r){var i=qS(t,e,n),a=WS(t,e,n),o=HS(t,e),l=Vu(t,e);return{type:"option",data:e,isDisabled:i,isSelected:a,label:o,value:l,index:r}}function Wl(t,e){return t.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,l){return p0(t,o,e,l)}).filter(function(o){return m0(t,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var a=p0(t,n,e,r);return m0(t,a)?a:void 0}).filter(yP)}function GS(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,xg(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function g0(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,xg(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function vA(t,e){return GS(Wl(t,e))}function m0(t,e){var n=t.inputValue,r=n===void 0?"":n,i=e.data,a=e.isSelected,o=e.label,l=e.value;return(!XS(t)||!a)&&YS(t,{label:o,value:l,data:i},r)}function wA(t,e){var n=t.focusedValue,r=t.selectValue,i=r.indexOf(n);if(i>-1){var a=e.indexOf(n);if(a>-1)return n;if(i<e.length)return e[i]}return null}function _A(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var of=function(e,n){var r,i=(r=e.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return i||null},HS=function(e,n){return e.getOptionLabel(n)},Vu=function(e,n){return e.getOptionValue(n)};function qS(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function WS(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=Vu(t,e);return n.some(function(i){return Vu(t,i)===r})}function YS(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var XS=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},bA=1,JS=function(t){Dk(n,t);var e=Bk(n);function n(r){var i;if(Lk(this,n),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(u){i.controlRef=u},i.focusedOptionRef=null,i.getFocusedOptionRef=function(u){i.focusedOptionRef=u},i.menuListRef=null,i.getMenuListRef=function(u){i.menuListRef=u},i.inputRef=null,i.getInputRef=function(u){i.inputRef=u},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(u,s){var c=i.props,d=c.onChange,f=c.name;s.name=f,i.ariaOnChange(u,s),d(u,s)},i.setValue=function(u,s,c){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(u,{action:s,option:c})},i.selectOption=function(u){var s=i.props,c=s.blurInputOnSelect,d=s.isMulti,f=s.name,h=i.state.selectValue,p=d&&i.isOptionSelected(u,h),y=i.isOptionDisabled(u,h);if(p){var w=i.getOptionValue(u);i.setValue(h.filter(function(g){return i.getOptionValue(g)!==w}),"deselect-option",u)}else if(!y)d?i.setValue([].concat(xg(h),[u]),"select-option",u):i.setValue(u,"select-option");else{i.ariaOnChange(u,{action:"select-option",option:u,name:f});return}c&&i.blurInput()},i.removeValue=function(u){var s=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(u),f=c.filter(function(p){return i.getOptionValue(p)!==d}),h=fl(s,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:u}),i.focusInput()},i.clearValue=function(){var u=i.state.selectValue;i.onChange(fl(i.props.isMulti,[],null),{action:"clear",removedValues:u})},i.popValue=function(){var u=i.props.isMulti,s=i.state.selectValue,c=s[s.length-1],d=s.slice(0,s.length-1),f=fl(u,d,d[0]||null);c&&i.onChange(f,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(u){return of(i.state.focusableOptionsWithIds,u)},i.getFocusableOptionsWithIds=function(){return g0(Wl(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];return uP.apply(void 0,[i.props.classNamePrefix].concat(s))},i.getOptionLabel=function(u){return HS(i.props,u)},i.getOptionValue=function(u){return Vu(i.props,u)},i.getStyles=function(u,s){var c=i.props.unstyled,d=dA[u](s,c);d.boxSizing="border-box";var f=i.props.styles[u];return f?f(d,s):d},i.getClassNames=function(u,s){var c,d;return(c=(d=i.props.classNames)[u])===null||c===void 0?void 0:c.call(d,s)},i.getElementId=function(u){return"".concat(i.state.instancePrefix,"-").concat(u)},i.getComponents=function(){return M9(i.props)},i.buildCategorizedOptions=function(){return Wl(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return GS(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(u,s){i.setState({ariaSelection:J({value:u},s)})},i.onMenuMouseDown=function(u){u.button===0&&(u.stopPropagation(),u.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(u){i.blockOptionHover=!1},i.onControlMouseDown=function(u){if(!u.defaultPrevented){var s=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"&&i.onMenuClose():s&&i.openMenu("first"):(s&&(i.openAfterFocus=!0),i.focusInput()),u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"&&u.preventDefault()}},i.onDropdownIndicatorMouseDown=function(u){if(!(u&&u.type==="mousedown"&&u.button!==0)&&!i.props.isDisabled){var s=i.props,c=s.isMulti,d=s.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),u.preventDefault()}},i.onClearIndicatorMouseDown=function(u){u&&u.type==="mousedown"&&u.button!==0||(i.clearValue(),u.preventDefault(),i.openAfterFocus=!1,u.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(u){typeof i.props.closeMenuOnScroll=="boolean"?u.target instanceof HTMLElement&&qc(u.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(u)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(u){var s=u.touches,c=s&&s.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(u){var s=u.touches,c=s&&s.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),f=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(u){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(u.target)&&i.menuListRef&&!i.menuListRef.contains(u.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(u){i.userIsDragging||i.onControlMouseDown(u)},i.onClearIndicatorTouchEnd=function(u){i.userIsDragging||i.onClearIndicatorMouseDown(u)},i.onDropdownIndicatorTouchEnd=function(u){i.userIsDragging||i.onDropdownIndicatorMouseDown(u)},i.handleInputChange=function(u){var s=i.props.inputValue,c=u.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:s}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(u){i.props.onFocus&&i.props.onFocus(u),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(u){var s=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(u),i.onInputChange("",{action:"input-blur",prevInputValue:s}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(u){if(!(i.blockOptionHover||i.state.focusedOption===u)){var s=i.getFocusableOptions(),c=s.indexOf(u);i.setState({focusedOption:u,focusedOptionId:c>-1?i.getFocusedOptionId(u):null})}},i.shouldHideSelectedOptions=function(){return XS(i.props)},i.onValueInputFocus=function(u){u.preventDefault(),u.stopPropagation(),i.focus()},i.onKeyDown=function(u){var s=i.props,c=s.isMulti,d=s.backspaceRemovesValue,f=s.escapeClearsValue,h=s.inputValue,p=s.isClearable,y=s.isDisabled,w=s.menuIsOpen,g=s.onKeyDown,m=s.tabSelectsValue,v=s.openMenuOnFocus,_=i.state,S=_.focusedOption,E=_.focusedValue,T=_.selectValue;if(!y&&!(typeof g=="function"&&(g(u),u.defaultPrevented))){switch(i.blockOptionHover=!0,u.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(E)i.removeValue(E);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||u.shiftKey||!w||!m||!S||v&&i.isOptionSelected(S,T))return;i.selectOption(S);break;case"Enter":if(u.keyCode===229)break;if(w){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":w?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&f&&i.clearValue();break;case" ":if(h)return;if(!w){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":w?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":w?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!w)return;i.focusOption("pageup");break;case"PageDown":if(!w)return;i.focusOption("pagedown");break;case"Home":if(!w)return;i.focusOption("first");break;case"End":if(!w)return;i.focusOption("last");break;default:return}u.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++bA),i.state.selectValue=e0(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),l=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=o[l],i.state.focusedOptionId=of(a,o[l])}return i}return Nk(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&t0(this.menuListRef,this.focusedOptionRef),oA()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isDisabled,l=a.menuIsOpen,u=this.state.isFocused;(u&&!o&&i.isDisabled||u&&l&&!i.menuIsOpen)&&this.focusInput(),u&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!u&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t0(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,o=this.state,l=o.selectValue,u=o.isFocused,s=this.buildFocusableOptions(),c=i==="first"?0:s.length-1;if(!this.props.isMulti){var d=s.indexOf(l[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(u&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,o=a.selectValue,l=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var u=o.indexOf(l);l||(u=-1);var s=o.length-1,c=-1;if(o.length){switch(i){case"previous":u===0?c=0:u===-1?c=s:c=u-1;break;case"next":u>-1&&u<s&&(c=u+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:o[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var u=0,s=l.indexOf(o);o||(s=-1),i==="up"?u=s>0?s-1:l.length-1:i==="down"?u=(s+1)%l.length:i==="pageup"?(u=s-a,u<0&&(u=0)):i==="pagedown"?(u=s+a,u>l.length-1&&(u=l.length-1)):i==="last"&&(u=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[u],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[u])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(af):J(J({},af),this.props.theme):af}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,o=this.getStyles,l=this.getClassNames,u=this.getValue,s=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,p=d.options,y=this.hasValue();return{clearValue:i,cx:a,getStyles:o,getClassNames:l,getValue:u,hasValue:y,isMulti:f,isRtl:h,options:p,selectOption:s,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,o=i.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(i,a){return qS(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return WS(this.props,i,a)}},{key:"filterOption",value:function(i,a){return YS(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:o,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,o=i.isSearchable,l=i.inputId,u=i.inputValue,s=i.tabIndex,c=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),p=h.Input,y=this.state,w=y.inputIsHidden,g=y.ariaSelection,m=this.commonProps,v=l||this.getElementId("input"),_=J(J(J({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(g==null?void 0:g.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?b.createElement(p,Z({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:a,isHidden:w,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:u},_)):b.createElement(q9,Z({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:$u,onFocus:this.onInputFocus,disabled:a,tabIndex:s,inputMode:"none",form:c,value:""},_))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),o=a.MultiValue,l=a.MultiValueContainer,u=a.MultiValueLabel,s=a.MultiValueRemove,c=a.SingleValue,d=a.Placeholder,f=this.commonProps,h=this.props,p=h.controlShouldRenderValue,y=h.isDisabled,w=h.isMulti,g=h.inputValue,m=h.placeholder,v=this.state,_=v.selectValue,S=v.focusedValue,E=v.isFocused;if(!this.hasValue()||!p)return g?null:b.createElement(d,Z({},f,{key:"placeholder",isDisabled:y,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),m);if(w)return _.map(function(x,P){var R=x===S,A="".concat(i.getOptionLabel(x),"-").concat(i.getOptionValue(x));return b.createElement(o,Z({},f,{components:{Container:l,Label:u,Remove:s},isFocused:R,isDisabled:y,key:A,index:P,removeProps:{onClick:function(){return i.removeValue(x)},onTouchEnd:function(){return i.removeValue(x)},onMouseDown:function(L){L.preventDefault()}},data:x}),i.formatOptionLabel(x,"value"))});if(g)return null;var T=_[0];return b.createElement(c,Z({},f,{data:T,isDisabled:y}),this.formatOptionLabel(T,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,o=this.commonProps,l=this.props,u=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!a||u||!this.hasValue()||s)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,o=this.commonProps,l=this.props,u=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!a||!s)return null;var d={"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:d,isDisabled:u,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,o=i.IndicatorSeparator;if(!a||!o)return null;var l=this.commonProps,u=this.props.isDisabled,s=this.state.isFocused;return b.createElement(o,Z({},l,{isDisabled:u,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var o=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:s,isDisabled:l,isFocused:u}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),o=a.Group,l=a.GroupHeading,u=a.Menu,s=a.MenuList,c=a.MenuPortal,d=a.LoadingMessage,f=a.NoOptionsMessage,h=a.Option,p=this.commonProps,y=this.state.focusedOption,w=this.props,g=w.captureMenuScroll,m=w.inputValue,v=w.isLoading,_=w.loadingMessage,S=w.minMenuHeight,E=w.maxMenuHeight,T=w.menuIsOpen,x=w.menuPlacement,P=w.menuPosition,R=w.menuPortalTarget,A=w.menuShouldBlockScroll,j=w.menuShouldScrollIntoView,L=w.noOptionsMessage,D=w.onMenuScrollToTop,$=w.onMenuScrollToBottom;if(!T)return null;var B=function(oe,ye){var be=oe.type,ue=oe.data,fe=oe.isDisabled,xe=oe.isSelected,gt=oe.label,mt=oe.value,on=y===ue,ot=fe?void 0:function(){return i.onOptionHover(ue)},wn=fe?void 0:function(){return i.selectOption(ue)},Me="".concat(i.getElementId("option"),"-").concat(ye),St={id:Me,onClick:wn,onMouseMove:ot,onMouseOver:ot,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:xe};return b.createElement(h,Z({},p,{innerProps:St,data:ue,isDisabled:fe,isSelected:xe,key:Me,label:gt,type:be,value:mt,isFocused:on,innerRef:on?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(oe.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(X){if(X.type==="group"){var oe=X.data,ye=X.options,be=X.index,ue="".concat(i.getElementId("group"),"-").concat(be),fe="".concat(ue,"-heading");return b.createElement(o,Z({},p,{key:ue,data:oe,options:ye,Heading:l,headingProps:{id:fe,data:X.data},label:i.formatGroupLabel(X.data)}),X.options.map(function(xe){return B(xe,"".concat(be,"-").concat(xe.index))}))}else if(X.type==="option")return B(X,"".concat(X.index))});else if(v){var O=_({inputValue:m});if(O===null)return null;N=b.createElement(d,p,O)}else{var z=L({inputValue:m});if(z===null)return null;N=b.createElement(f,p,z)}var U={minMenuHeight:S,maxMenuHeight:E,menuPlacement:x,menuPosition:P,menuShouldScrollIntoView:j},ie=b.createElement(CP,Z({},p,U),function(X){var oe=X.ref,ye=X.placerProps,be=ye.placement,ue=ye.maxHeight;return b.createElement(u,Z({},p,U,{innerRef:oe,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:v,placement:be}),b.createElement(Q9,{captureEnabled:g,onTopArrive:D,onBottomArrive:$,lockEnabled:A},function(fe){return b.createElement(s,Z({},p,{innerRef:function(gt){i.getMenuListRef(gt),fe(gt)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:v,maxHeight:ue,focusedOption:y}),N)}))});return R||P==="fixed"?b.createElement(c,Z({},p,{appendTo:R,controlElement:this.controlRef,menuPlacement:x,menuPosition:P}),ie):ie}},{key:"renderFormField",value:function(){var i=this,a=this.props,o=a.delimiter,l=a.isDisabled,u=a.isMulti,s=a.name,c=a.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!l)return b.createElement(nA,{name:s,onFocus:this.onValueInputFocus});if(!(!s||l))if(u)if(o){var f=d.map(function(y){return i.getOptionValue(y)}).join(o);return b.createElement("input",{name:s,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(y,w){return b.createElement("input",{key:"i-".concat(w),name:s,type:"hidden",value:i.getOptionValue(y)})}):b.createElement("input",{name:s,type:"hidden",value:""});return b.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return b.createElement("input",{name:s,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,o=a.ariaSelection,l=a.focusedOption,u=a.focusedValue,s=a.isFocused,c=a.selectValue,d=this.getFocusableOptions();return b.createElement(z9,Z({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:l,focusedValue:u,isFocused:s,selectValue:c,focusableOptions:d,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,o=i.IndicatorsContainer,l=i.SelectContainer,u=i.ValueContainer,s=this.props,c=s.className,d=s.id,f=s.isDisabled,h=s.menuIsOpen,p=this.state.isFocused,y=this.commonProps=this.getCommonProps();return b.createElement(l,Z({},y,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:p}),this.renderLiveRegion(),b.createElement(a,Z({},y,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:p,menuIsOpen:h}),b.createElement(u,Z({},y,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),b.createElement(o,Z({},y,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var o=a.prevProps,l=a.clearFocusValueOnUpdate,u=a.inputIsHiddenAfterUpdate,s=a.ariaSelection,c=a.isFocused,d=a.prevWasFocused,f=a.instancePrefix,h=i.options,p=i.value,y=i.menuIsOpen,w=i.inputValue,g=i.isMulti,m=e0(p),v={};if(o&&(p!==o.value||h!==o.options||y!==o.menuIsOpen||w!==o.inputValue)){var _=y?vA(i,m):[],S=y?g0(Wl(i,m),"".concat(f,"-option")):[],E=l?wA(a,m):null,T=_A(a,_),x=of(S,T);v={selectValue:m,focusedOption:T,focusedOptionId:x,focusableOptionsWithIds:S,focusedValue:E,clearFocusValueOnUpdate:!1}}var P=u!=null&&i!==o?{inputIsHidden:u,inputIsHiddenAfterUpdate:void 0}:{},R=s,A=c&&d;return c&&!A&&(R={value:fl(g,m,m[0]||null),options:m,action:"initial-input-focus"},A=!d),(s==null?void 0:s.action)==="initial-input-focus"&&(R=null),J(J(J({},v),P),{},{prevProps:i,ariaSelection:R,prevWasFocused:A})}}]),n}(b.Component);JS.defaultProps=yA;var SA=b.forwardRef(function(t,e){var n=Mk(t);return b.createElement(JS,Z({ref:e},n))}),TA=SA,ve=function(){return ve=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ve.apply(this,arguments)},EA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},CA=function(t){return ve(ve({},t),{borderRadius:0,colors:ve(ve({},t.colors),{primary25:"var(--semi-transparent-accent-color)",neutral10:"var(--border-color)",neutral20:"var(--border-color)",primary:"var(--accent-color)",neutral30:"var(--darker-border-color)"})})},xA=function(t,e){return b.useMemo(function(){return{placeholder:function(n){return ve(ve({},n),{color:"var(--placeholder-body-color)"})},container:function(n){return ve(ve({},n),{fontSize:"inherit"})},control:function(n,r){var i=r.isFocused,a=n;return a=ve(ve({},a),{minHeight:40}),i?ve(ve({},a),{borderColor:e?"var(--alert-color)":"var(--accent-color)",backgroundColor:t?"var(--disabled-color)":"white",boxShadow:"0 0 0 3px ".concat(e?"rgba(var(--alert-color-rgb-components), 0.2)":"var(--semi-transparent-accent-color)"),"&:hover":{borderColor:e?"var(--alert-color)":"var(--accent-color)"}}):ve(ve({},a),{borderColor:e?"var(--alert-color)":"var(--border-color)",backgroundColor:t?"var(--disabled-color)":"white","&:hover":{borderColor:e?"var(--alert-color)":"var(--darker-border-color)"}})},multiValueRemove:function(n){return ve(ve({},n),{cursor:"pointer"})},menu:function(n){return ve(ve({},n),{zIndex:1e3,minWidth:250})},input:function(n){var r=ve(ve({},n),{boxShadow:"none","input:focus":{boxShadow:"none"}});return r},multiValue:function(n){return ve(ve({},n),{zIndex:100,backgroundColor:"var(--light-color)",userSelect:"none"})},multiValueLabel:function(n){return ve(ve({},n),{fontSize:"inherit",padding:3})}}},[t,e])};function RA(t){var e=t.isDisabled,n=t.error,r=EA(t,["isDisabled","error"]),i=xA(e,n);return V.createElement(TA,ve({},r,{isDisabled:e,theme:CA,styles:i}))}const kA="_Spinner__bar_oumod_13",sf={"Spinner--inline":"_Spinner--inline_oumod_1","Spinner--centered":"_Spinner--centered_oumod_7",Spinner__bar:kA};var Uu=function(){return Uu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uu.apply(this,arguments)};function Ku(t){for(var e,n=t.size,r=n===void 0?32:n,i=t.placement,a=i===void 0?"inline":i,o=t.style,l=o===void 0?{}:o,u=[],s=0;s<12;s+=1){var c={};c.animationDelay="".concat((s-12)/10,"s"),c.transform="rotate(".concat(s*30,"deg) translate(146%)"),u.push(V.createElement("div",{style:c,className:sf.Spinner__bar,key:s}))}var d={width:r*.5,height:r*.5};return a==="inline"&&(d.marginLeft=r*.5,d.transform="translateY(33%)"),V.createElement("div",{className:jn((e={},e[sf["Spinner--inline"]]=a==="inline",e[sf["Spinner--centered"]]=a==="centered",e)),style:Uu(Uu({},l),d)},u)}const PA="_switchField__flex_16z4j_1",AA="_switchField__switchInput_16z4j_6",OA="_switchField__label_16z4j_10",IA="_switchField__below_16z4j_22",hl={switchField__flex:PA,switchField__switchInput:AA,switchField__label:OA,switchField__below:IA};var Gu=function(){return Gu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gu.apply(this,arguments)};function ji(t){var e=t.id,n=t.name,r=t.label,i=t.hint,a=t.error,o=t.required,l=t.formLabelProps,u=t.value,s=t.onChange,c=t.switchInputProps;return V.createElement(V.Fragment,null,V.createElement("div",{className:hl.switchField__flex},V.createElement("div",{className:hl.switchField__switchInput},V.createElement(jA,Gu({},c,{name:n,value:u,onChange:s}))),V.createElement(iS,Gu({},l,{htmlFor:e,required:o,className:jn(hl.switchField__label,l==null?void 0:l.className),error:!!a}),r)),(i||a)&&V.createElement("div",{className:hl.switchField__below},a&&V.createElement(tS,null,a),i&&V.createElement(nS,null,i)))}const MA="_switchInput__inner_1knbg_1",LA="_switchInput_1knbg_1",NA="_switchInput__checked_1knbg_47",DA="_switchInput__disabled_1knbg_60",pl={switchInput__inner:MA,switchInput:LA,switchInput__checked:NA,switchInput__disabled:DA};var Kh=function(){return Kh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Kh.apply(this,arguments)},FA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function jA(t){var e,n=t.className,r=t.value,i=t.disabled,a=t.onClick,o=t.onChange,l=t.onKeyDown,u=FA(t,["className","value","disabled","onClick","onChange","onKeyDown"]);function s(h,p){!i&&o&&o(h,p)}function c(h){h.key==="ArrowLeft"?s(!1,h):h.key==="ArrowRight"&&s(!0,h),l==null||l(h)}function d(h){s(!r,h),a==null||a(h)}var f=jn(pl.switchInput,n,(e={},e[pl.switchInput__checked]=r,e[pl.switchInput__disabled]=i,e));return V.createElement("button",Kh({},u,{type:"button",role:"switch","aria-checked":r,disabled:i,className:f,onKeyDown:c,onClick:d}),V.createElement("span",{className:pl.switchInput__inner}))}var Gh=function(){return Gh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gh.apply(this,arguments)};function fr(t){var e=t.id,n=t.name,r=t.label,i=t.hint,a=t.error,o=t.required,l=t.placeholder,u=t.formLabelProps,s=t.value,c=t.onChange,d=t.textInputProps;return V.createElement(rS,{formLabelProps:u,id:e,required:o,error:a,hint:i,label:r},V.createElement(zA,Gh({},d,{id:e,name:n,value:s,placeholder:l,onChange:c,error:!!a})))}const BA="_TextInput_x2oj2_1",gl={TextInput:BA,"TextInput--monospaced":"_TextInput--monospaced_x2oj2_30","TextInput--disabled":"_TextInput--disabled_x2oj2_35","TextInput--error":"_TextInput--error_x2oj2_41"};var Hh=function(){return Hh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Hh.apply(this,arguments)},$A=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},zA=function(t){var e,n=t.className,r=t.disabled,i=r===void 0?!1:r,a=t.error,o=t.id,l=t.inputRef,u=t.maxLength,s=t.name,c=t.labelText,d=t.onBlur,f=t.onChange,h=t.placeholder,p=t.required,y=p===void 0?!1:p,w=t.type,g=t.value,m=t.monospaced,v=$A(t,["className","disabled","error","id","inputRef","maxLength","name","labelText","onBlur","onChange","placeholder","required","type","value","monospaced"]),_=b.useCallback(function(E){f&&f(E.target.value,E)},[f]),S=jn(gl.TextInput,n,(e={},e[gl["TextInput--disabled"]]=i,e[gl["TextInput--error"]]=a,e[gl["TextInput--monospaced"]]=m,e));return V.createElement("input",Hh({className:S,"aria-label":c,id:o,name:s,required:y,placeholder:h,maxLength:u,disabled:i,onBlur:d,onChange:_,value:g,type:w,ref:l},v))};const VA="_modelSelect_hfvrd_8",UA="_dropdownLabel_hfvrd_15",KA="_tooltipConfig_hfvrd_61",GA="_buttons_hfvrd_32",HA="_inlineStatus_hfvrd_89",qA="_fieldSpacing_hfvrd_94",WA="_textarea_hfvrd_132",YA="_label_hfvrd_142",XA="_switchField_hfvrd_165",JA="_buttonRow_hfvrd_170",ZA="_exclusionRules_hfvrd_176",QA="_promptContainer_hfvrd_182",eO="_tooltipContainer_hfvrd_190",tO="_warningTooltip_hfvrd_197",nO="_tooltipText_hfvrd_206",rO="_imageTooltip_hfvrd_240",iO="_leftAnchorTooltip_hfvrd_245",K={modelSelect:VA,dropdownLabel:UA,tooltipConfig:KA,buttons:GA,inlineStatus:HA,fieldSpacing:qA,textarea:WA,label:YA,switchField:XA,buttonRow:JA,exclusionRules:ZA,promptContainer:QA,tooltipContainer:eO,warningTooltip:tO,tooltipText:nO,imageTooltip:rO,leftAnchorTooltip:iO};class ZS{constructor(e){we(this,"vendor","deepl");we(this,"capabilities",{streaming:!1});we(this,"apiKey");we(this,"baseUrl");we(this,"proxyUrl");this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||"https://api.deepl.com",this.proxyUrl=e.proxyUrl}async*streamText(e,n){const r=await this.completeText(e,n);r&&(yield r)}async completeText(e,n){return(await this.translateArray([e],{targetLang:"EN"}))[0]||""}async translateArray(e,n){var l,u;if(!e.length)return e;const r=(this.proxyUrl||this.baseUrl).replace(/\/$/,"")+"/v2/translate",i=new Array(e.length),a=45,o={"content-type":"application/json"};this.proxyUrl||(o.Authorization=`DeepL-Auth-Key ${this.apiKey}`);for(let s=0;s<e.length;s+=a){const c=e.slice(s,s+a),d=this.proxyUrl?this.proxyUrl.replace(/\/$/,"")+"/v2/translate":r,f=w=>{var m,v,_;const g={text:c,target_lang:n.targetLang};return n.sourceLang&&(g.source_lang=n.sourceLang),n.isHTML&&(g.tag_handling="html"),n.formality&&n.formality!=="default"&&(g.formality=n.formality),g.preserve_formatting=n.preserveFormatting!==!1,(m=n.ignoreTags)!=null&&m.length&&(g.ignore_tags=n.ignoreTags),(v=n.nonSplittingTags)!=null&&v.length&&(g.non_splitting_tags=n.nonSplittingTags),(_=n.splittingTags)!=null&&_.length&&(g.splitting_tags=n.splittingTags),w&&n.glossaryId&&(g.glossary_id=n.glossaryId),g};let h=await fetch(d,{method:"POST",headers:o,body:JSON.stringify(f(!!n.glossaryId))});if(!h.ok){let w=h.statusText,g=null;try{g=await h.json(),w=(g==null?void 0:g.message)||((l=g==null?void 0:g.error)==null?void 0:l.message)||w}catch{}const m=/glossary/i.test(w)&&/(language|pair|match|not found)/i.test(w);n.glossaryId&&m&&h.status>=400&&h.status<500&&(h=await fetch(d,{method:"POST",headers:o,body:JSON.stringify(f(!1))}))}if(!h.ok){let w=h.statusText;try{const m=await h.json();w=(m==null?void 0:m.message)||((u=m==null?void 0:m.error)==null?void 0:u.message)||w}catch{}if(/wrong endpoint/i.test(w)){const m=/:fx\b/i.test(this.apiKey),v=/api\.deepl\.com/i.test(this.baseUrl);w=`DeepL: wrong endpoint for your API key. ${m&&v?'Your key looks like a Free key (:fx), but the Pro endpoint is configured. In Settings → DeepL, enable "Use DeepL Free endpoint (api-free.deepl.com)".':!m&&/api-free\.deepl\.com/i.test(this.baseUrl)?'A Pro key is being used with the Free endpoint. In Settings → DeepL, disable "Use DeepL Free endpoint" to use api.deepl.com.':"Ensure the endpoint matches your plan: api-free.deepl.com for Free (:fx) keys; api.deepl.com for Pro."}`}const g=new Error(w);throw g.status=h.status,g}const p=await h.json(),y=Array.isArray(p==null?void 0:p.translations)?p.translations.map(w=>String((w==null?void 0:w.text)??"")):[];for(let w=0;w<c.length;w++)i[s+w]=y[w]??c[w]}return i}}const hr=(t,...e)=>typeof t=="string"&&e.some(n=>t.toLowerCase().includes(n.toLowerCase()));function ur(t,e){var o,l,u,s;const n=t,r=(n==null?void 0:n.status)||(n==null?void 0:n.code)||((o=n==null?void 0:n.response)==null?void 0:o.status),i=String((n==null?void 0:n.message)||((l=n==null?void 0:n.error)==null?void 0:l.message)||n||"Unknown error"),a=i;return e==="openai"&&(((u=n==null?void 0:n.error)==null?void 0:u.code)==="unsupported_value"||r===400)&&(((s=n==null?void 0:n.error)==null?void 0:s.param)==="stream"||hr(a,"stream"))&&hr(a,"must be verified to stream this model")?{code:"auth",message:a,hint:"Verify your organization in OpenAI or choose a different model."}:r===401||hr(a,"unauthorized","invalid api key","invalid authentication","not valid api key","permission_denied")?{code:"auth",message:"Authentication failed for the selected AI vendor.",hint:e==="openai"?"Check OpenAI API key and organization access in settings.":"Check Google API key and that Generative Language API is enabled."}:r===429||hr(a,"rate limit","too many requests")?{code:"rate_limit",message:"Rate limit reached. Please wait and try again.",hint:e==="openai"?"Reduce concurrency, switch to a more available model, or increase limits.":e==="google"?"Reduce request rate or increase quota in Google Cloud console.":e==="anthropic"?"Reduce request rate or increase Anthropic rate limits.":"Reduce concurrency or batch size; check DeepL plan limits."}:hr(a,"insufficient_quota","quota exceeded","resource has been exhausted","out of quota")?{code:"quota",message:"Quota exceeded for the selected AI vendor.",hint:e==="openai"?"Check OpenAI usage and billing; switch to a smaller model if needed.":e==="google"?"Verify Google project quotas and billing for Generative Language API.":e==="anthropic"?"Check Anthropic usage limits and billing.":"Check DeepL usage limits and plan."}:r===404||hr(a,"model not found","no such model","unsupported model","not found: model")?{code:"model",message:"The selected model is unavailable or not accessible.",hint:e==="openai"?"Ensure the model exists on your account and is spelled correctly.":e==="google"?"Ensure the Gemini model id is correct and available in your region.":e==="anthropic"?"Ensure the Claude model id is correct and you have access.":"Ensure the language pair is valid for DeepL; check target code."}:hr(a,"failed to fetch","fetch failed","network","ecconn","enotfound","timeout")?{code:"network",message:i,hint:"This often indicates CORS/proxy issues or connectivity problems."}:e==="deepl"&&(r===403||hr(a,"wrong endpoint"))?{code:"auth",message:'DeepL: wrong endpoint for your API key. If your key ends with :fx, enable "Use DeepL Free endpoint (api-free.deepl.com)" in Settings. Otherwise, disable it to use api.deepl.com.',hint:"Match the endpoint to your plan: Free (:fx) → api-free.deepl.com; Pro → api.deepl.com."}:{code:"unknown",message:a}}var aO=function(e){var n=V.useRef(e);return Bu(function(){n.current=e}),n},y0=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},oO=function(e,n){var r=V.useRef();return V.useCallback(function(i){e.current=i,r.current&&y0(r.current,null),r.current=n,n&&y0(n,i)},[n])},v0={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},sO=function(e){Object.keys(v0).forEach(function(n){e.style.setProperty(n,v0[n],"important")})},w0=sO,yt=null,_0=function(e,n){var r=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function lO(t,e,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),yt||(yt=document.createElement("textarea"),yt.setAttribute("tabindex","-1"),yt.setAttribute("aria-hidden","true"),w0(yt)),yt.parentNode===null&&document.body.appendChild(yt);var i=t.paddingSize,a=t.borderSize,o=t.sizingStyle,l=o.boxSizing;Object.keys(o).forEach(function(f){var h=f;yt.style[h]=o[h]}),w0(yt),yt.value=e;var u=_0(yt,t);yt.value=e,u=_0(yt,t),yt.value="x";var s=yt.scrollHeight-i,c=s*n;l==="border-box"&&(c=c+i+a),u=Math.max(c,u);var d=s*r;return l==="border-box"&&(d=d+i+a),u=Math.min(d,u),[u,s]}var b0=function(){},uO=function(e,n){return e.reduce(function(r,i){return r[i]=n[i],r},{})},cO=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],dO=!!document.documentElement.currentStyle,fO=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var r=uO(cO,n),i=r.boxSizing;if(i==="")return null;dO&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var a=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:a,borderSize:o}},hO=fO;function $g(t,e,n){var r=aO(n);b.useLayoutEffect(function(){var i=function(o){return r.current(o)};if(t)return t.addEventListener(e,i),function(){return t.removeEventListener(e,i)}},[])}var pO=function(e,n){$g(document.body,"reset",function(r){e.current.form===r.target&&n(r)})},gO=function(e){$g(window,"resize",e)},mO=function(e){$g(document.fonts,"loadingdone",e)},yO=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],vO=function(e,n){var r=e.cacheMeasurements,i=e.maxRows,a=e.minRows,o=e.onChange,l=o===void 0?b0:o,u=e.onHeightChange,s=u===void 0?b0:u,c=sS(e,yO),d=c.value!==void 0,f=b.useRef(null),h=oO(f,n),p=b.useRef(0),y=b.useRef(),w=function(){var v=f.current,_=r&&y.current?y.current:hO(v);if(_){y.current=_;var S=lO(_,v.value||v.placeholder||"x",a,i),E=S[0],T=S[1];p.current!==E&&(p.current=E,v.style.setProperty("height",E+"px","important"),s(E,{rowHeight:T}))}},g=function(v){d||w(),l(v)};return b.useLayoutEffect(w),pO(f,function(){if(!d){var m=f.current.value;requestAnimationFrame(function(){var v=f.current;v&&m!==v.value&&w()})}}),gO(w),mO(w),b.createElement("textarea",Z({},c,{onChange:g,ref:h}))},S0=b.forwardRef(vO);const vo=`You are an expert translator specializing in CMS content translation.
56
+ `]))),ZP=function(e,n){var r=e.isFocused,i=e.size,a=e.theme,o=a.colors,l=a.spacing.baseUnit;return J({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:l*2})},ef=function(e){var n=e.delay,r=e.offset;return Y("span",{css:Lg({animation:"".concat(JP," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},QP=function(e){var n=e.innerProps,r=e.isRtl,i=e.size,a=i===void 0?4:i,o=lr(e,UP);return Y("div",Z({},De(J(J({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Y(ef,{delay:0,offset:r}),Y(ef,{delay:160,offset:!0}),Y(ef,{delay:320,offset:!r}))},e9=function(e,n){var r=e.isDisabled,i=e.isFocused,a=e.theme,o=a.colors,l=a.borderRadius,u=a.spacing;return J({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:u.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},t9=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,a=e.innerRef,o=e.innerProps,l=e.menuIsOpen;return Y("div",Z({ref:a},De(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},n9=t9,r9=["data"],i9=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},a9=function(e){var n=e.children,r=e.cx,i=e.getStyles,a=e.getClassNames,o=e.Heading,l=e.headingProps,u=e.innerProps,s=e.label,c=e.theme,d=e.selectProps;return Y("div",Z({},De(e,"group",{group:!0}),u),Y(o,Z({},l,{selectProps:d,theme:c,getStyles:i,getClassNames:a,cx:r}),s),Y("div",null,n))},o9=function(e,n){var r=e.theme,i=r.colors,a=r.spacing;return J({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},s9=function(e){var n=AS(e);n.data;var r=lr(n,r9);return Y("div",Z({},De(e,"groupHeading",{"group-heading":!0}),r))},l9=a9,u9=["innerRef","isDisabled","isHidden","inputClassName"],c9=function(e,n){var r=e.isDisabled,i=e.value,a=e.theme,o=a.spacing,l=a.colors;return J(J({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},d9),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},BS={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},d9={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":J({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},BS)},f9=function(e){return J({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},BS)},h9=function(e){var n=e.cx,r=e.value,i=AS(e),a=i.innerRef,o=i.isDisabled,l=i.isHidden,u=i.inputClassName,s=lr(i,u9);return Y("div",Z({},De(e,"input",{"input-container":!0}),{"data-value":r||""}),Y("input",Z({className:n({input:!0},u),ref:a,style:f9(l),disabled:o},s)))},p9=h9,g9=function(e,n){var r=e.theme,i=r.spacing,a=r.borderRadius,o=r.colors;return J({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},m9=function(e,n){var r=e.theme,i=r.borderRadius,a=r.colors,o=e.cropWithEllipsis;return J({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},y9=function(e,n){var r=e.theme,i=r.spacing,a=r.borderRadius,o=r.colors,l=e.isFocused;return J({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:l?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},$S=function(e){var n=e.children,r=e.innerProps;return Y("div",r,n)},v9=$S,w9=$S;function _9(t){var e=t.children,n=t.innerProps;return Y("div",Z({role:"button"},n),e||Y(jg,{size:14}))}var b9=function(e){var n=e.children,r=e.components,i=e.data,a=e.innerProps,o=e.isDisabled,l=e.removeProps,u=e.selectProps,s=r.Container,c=r.Label,d=r.Remove;return Y(s,{data:i,innerProps:J(J({},De(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:u},Y(c,{data:i,innerProps:J({},De(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:u},n),Y(d,{data:i,innerProps:J(J({},De(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:u}))},S9=b9,T9=function(e,n){var r=e.isDisabled,i=e.isFocused,a=e.isSelected,o=e.theme,l=o.spacing,u=o.colors;return J({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?u.primary:i?u.primary25:"transparent",color:r?u.neutral20:a?u.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?u.primary:u.primary50}})},E9=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,a=e.isSelected,o=e.innerRef,l=e.innerProps;return Y("div",Z({},De(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},C9=E9,x9=function(e,n){var r=e.theme,i=r.spacing,a=r.colors;return J({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},R9=function(e){var n=e.children,r=e.innerProps;return Y("div",Z({},De(e,"placeholder",{placeholder:!0}),r),n)},k9=R9,P9=function(e,n){var r=e.isDisabled,i=e.theme,a=i.spacing,o=i.colors;return J({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},A9=function(e){var n=e.children,r=e.isDisabled,i=e.innerProps;return Y("div",Z({},De(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},O9=A9,I9={ClearIndicator:WP,Control:n9,DropdownIndicator:HP,DownChevron:FS,CrossIcon:jg,Group:l9,GroupHeading:s9,IndicatorsContainer:zP,IndicatorSeparator:XP,Input:p9,LoadingIndicator:QP,Menu:RP,MenuList:PP,MenuPortal:NP,LoadingMessage:MP,NoOptionsMessage:IP,MultiValue:S9,MultiValueContainer:v9,MultiValueLabel:w9,MultiValueRemove:_9,Option:C9,Placeholder:k9,SelectContainer:FP,SingleValue:O9,ValueContainer:BP},M9=function(e){return J(J({},I9),e.components)},i0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function L9(t,e){return!!(t===e||i0(t)&&i0(e))}function N9(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!L9(t[n],e[n]))return!1;return!0}function D9(t,e){e===void 0&&(e=N9);var n=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var o=t.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}var F9={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},j9=function(e){return Y("span",Z({css:F9},e))},a0=j9,B9={guidance:function(e){var n=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,a=e.context,o=e.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,i=r===void 0?"":r,a=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,i=e.options,a=e.label,o=a===void 0?"":a,l=e.selectValue,u=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,d=function(y,w){return y&&y.length?"".concat(y.indexOf(w)+1," of ").concat(y.length):""};if(n==="value"&&l)return"value ".concat(o," focused, ").concat(d(l,r),".");if(n==="menu"&&c){var f=u?" disabled":"",h="".concat(s?" selected":"").concat(f);return"".concat(o).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},$9=function(e){var n=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,a=e.focusableOptions,o=e.isFocused,l=e.selectValue,u=e.selectProps,s=e.id,c=e.isAppleDevice,d=u.ariaLiveMessages,f=u.getOptionLabel,h=u.inputValue,p=u.isMulti,y=u.isOptionDisabled,w=u.isSearchable,g=u.menuIsOpen,m=u.options,v=u.screenReaderStatus,_=u.tabSelectsValue,S=u.isLoading,E=u["aria-label"],T=u["aria-live"],x=b.useMemo(function(){return J(J({},B9),d||{})},[d]),P=b.useMemo(function(){var $="";if(n&&x.onChange){var B=n.option,N=n.options,O=n.removedValue,z=n.removedValues,U=n.value,ie=function(xe){return Array.isArray(xe)?null:xe},X=O||B||ie(U),oe=X?f(X):"",ye=N||z||void 0,be=ye?ye.map(f):[],ue=J({isDisabled:X&&y(X,l),label:oe,labels:be},n);$=x.onChange(ue)}return $},[n,x,y,l,f]),R=b.useMemo(function(){var $="",B=r||i,N=!!(r&&l&&l.includes(r));if(B&&x.onFocus){var O={focused:B,label:f(B),isDisabled:y(B,l),isSelected:N,options:a,context:B===r?"menu":"value",selectValue:l,isAppleDevice:c};$=x.onFocus(O)}return $},[r,i,f,y,x,a,l,c]),A=b.useMemo(function(){var $="";if(g&&m.length&&!S&&x.onFilter){var B=v({count:a.length});$=x.onFilter({inputValue:h,resultsMessage:B})}return $},[a,h,g,x,m,v,S]),j=(n==null?void 0:n.action)==="initial-input-focus",L=b.useMemo(function(){var $="";if(x.guidance){var B=i?"value":g?"menu":"input";$=x.guidance({"aria-label":E,context:B,isDisabled:r&&y(r,l),isMulti:p,isSearchable:w,tabSelectsValue:_,isInitialFocus:j})}return $},[E,r,i,p,y,w,g,x,l,_,j]),D=Y(b.Fragment,null,Y("span",{id:"aria-selection"},P),Y("span",{id:"aria-focused"},R),Y("span",{id:"aria-results"},A),Y("span",{id:"aria-guidance"},L));return Y(b.Fragment,null,Y(a0,{id:s},j&&D),Y(a0,{"aria-live":T,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!j&&D))},z9=$9,Uh=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],V9=new RegExp("["+Uh.map(function(t){return t.letters}).join("")+"]","g"),zS={};for(var tf=0;tf<Uh.length;tf++)for(var nf=Uh[tf],rf=0;rf<nf.letters.length;rf++)zS[nf.letters[rf]]=nf.base;var VS=function(e){return e.replace(V9,function(n){return zS[n]})},U9=D9(VS),o0=function(e){return e.replace(/^\s+|\s+$/g,"")},K9=function(e){return"".concat(e.label," ").concat(e.value)},G9=function(e){return function(n,r){if(n.data.__isNew__)return!0;var i=J({ignoreCase:!0,ignoreAccents:!0,stringify:K9,trim:!0,matchFrom:"any"},e),a=i.ignoreCase,o=i.ignoreAccents,l=i.stringify,u=i.trim,s=i.matchFrom,c=u?o0(r):r,d=u?o0(l(n)):l(n);return a&&(c=c.toLowerCase(),d=d.toLowerCase()),o&&(c=U9(c),d=VS(d)),s==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},H9=["innerRef"];function q9(t){var e=t.innerRef,n=lr(t,H9),r=wP(n,"onExited","in","enter","exit","appear");return Y("input",Z({ref:e},r,{css:Lg({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var W9=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Y9(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,i=t.onTopArrive,a=t.onTopLeave,o=b.useRef(!1),l=b.useRef(!1),u=b.useRef(0),s=b.useRef(null),c=b.useCallback(function(w,g){if(s.current!==null){var m=s.current,v=m.scrollTop,_=m.scrollHeight,S=m.clientHeight,E=s.current,T=g>0,x=_-S-v,P=!1;x>g&&o.current&&(r&&r(w),o.current=!1),T&&l.current&&(a&&a(w),l.current=!1),T&&g>x?(n&&!o.current&&n(w),E.scrollTop=_,P=!0,o.current=!0):!T&&-g>v&&(i&&!l.current&&i(w),E.scrollTop=0,P=!0,l.current=!0),P&&W9(w)}},[n,r,i,a]),d=b.useCallback(function(w){c(w,w.deltaY)},[c]),f=b.useCallback(function(w){u.current=w.changedTouches[0].clientY},[]),h=b.useCallback(function(w){var g=u.current-w.changedTouches[0].clientY;c(w,g)},[c]),p=b.useCallback(function(w){if(w){var g=mP?{passive:!1}:!1;w.addEventListener("wheel",d,g),w.addEventListener("touchstart",f,g),w.addEventListener("touchmove",h,g)}},[h,f,d]),y=b.useCallback(function(w){w&&(w.removeEventListener("wheel",d,!1),w.removeEventListener("touchstart",f,!1),w.removeEventListener("touchmove",h,!1))},[h,f,d]);return b.useEffect(function(){if(e){var w=s.current;return p(w),function(){y(w)}}},[e,p,y]),function(w){s.current=w}}var s0=["boxSizing","height","overflow","paddingRight","position"],l0={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function u0(t){t.cancelable&&t.preventDefault()}function c0(t){t.stopPropagation()}function d0(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function f0(){return"ontouchstart"in window||navigator.maxTouchPoints}var h0=!!(typeof window<"u"&&window.document&&window.document.createElement),co=0,Fi={capture:!1,passive:!1};function X9(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,i=b.useRef({}),a=b.useRef(null),o=b.useCallback(function(u){if(h0){var s=document.body,c=s&&s.style;if(r&&s0.forEach(function(p){var y=c&&c[p];i.current[p]=y}),r&&co<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(l0).forEach(function(p){var y=l0[p];c&&(c[p]=y)}),c&&(c.paddingRight="".concat(h,"px"))}s&&f0()&&(s.addEventListener("touchmove",u0,Fi),u&&(u.addEventListener("touchstart",d0,Fi),u.addEventListener("touchmove",c0,Fi))),co+=1}},[r]),l=b.useCallback(function(u){if(h0){var s=document.body,c=s&&s.style;co=Math.max(co-1,0),r&&co<1&&s0.forEach(function(d){var f=i.current[d];c&&(c[d]=f)}),s&&f0()&&(s.removeEventListener("touchmove",u0,Fi),u&&(u.removeEventListener("touchstart",d0,Fi),u.removeEventListener("touchmove",c0,Fi)))}},[r]);return b.useEffect(function(){if(e){var u=a.current;return o(u),function(){l(u)}}},[e,o,l]),function(u){a.current=u}}var J9=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Z9={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Q9(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,i=r===void 0?!0:r,a=t.onBottomArrive,o=t.onBottomLeave,l=t.onTopArrive,u=t.onTopLeave,s=Y9({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:u}),c=X9({isEnabled:n}),d=function(h){s(h),c(h)};return Y(b.Fragment,null,n&&Y("div",{onClick:J9,css:Z9}),e(d))}var eA={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tA=function(e){var n=e.name,r=e.onFocus;return Y("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:eA,value:"",onChange:function(){}})},nA=tA;function Bg(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function rA(){return Bg(/^iPhone/i)}function US(){return Bg(/^Mac/i)}function iA(){return Bg(/^iPad/i)||US()&&navigator.maxTouchPoints>1}function aA(){return rA()||iA()}function oA(){return US()||aA()}var sA=function(e){return e.label},lA=function(e){return e.label},uA=function(e){return e.value},cA=function(e){return!!e.isDisabled},dA={clearIndicator:qP,container:DP,control:e9,dropdownIndicator:GP,group:i9,groupHeading:o9,indicatorsContainer:$P,indicatorSeparator:YP,input:c9,loadingIndicator:ZP,loadingMessage:OP,menu:EP,menuList:kP,menuPortal:LP,multiValue:g9,multiValueLabel:m9,multiValueRemove:y9,noOptionsMessage:AP,option:T9,placeholder:x9,singleValue:P9,valueContainer:jP},fA={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},hA=4,KS=4,pA=38,gA=KS*2,mA={baseUnit:KS,controlHeight:pA,menuGutter:gA},af={borderRadius:hA,colors:fA,spacing:mA},yA={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:n0(),captureMenuScroll:!n0(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:G9(),formatGroupLabel:sA,getOptionLabel:lA,getOptionValue:uA,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:cA,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pP(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function p0(t,e,n,r){var i=qS(t,e,n),a=WS(t,e,n),o=HS(t,e),l=Vu(t,e);return{type:"option",data:e,isDisabled:i,isSelected:a,label:o,value:l,index:r}}function Wl(t,e){return t.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,l){return p0(t,o,e,l)}).filter(function(o){return m0(t,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var a=p0(t,n,e,r);return m0(t,a)?a:void 0}).filter(yP)}function GS(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,xg(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function g0(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,xg(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function vA(t,e){return GS(Wl(t,e))}function m0(t,e){var n=t.inputValue,r=n===void 0?"":n,i=e.data,a=e.isSelected,o=e.label,l=e.value;return(!XS(t)||!a)&&YS(t,{label:o,value:l,data:i},r)}function wA(t,e){var n=t.focusedValue,r=t.selectValue,i=r.indexOf(n);if(i>-1){var a=e.indexOf(n);if(a>-1)return n;if(i<e.length)return e[i]}return null}function _A(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var of=function(e,n){var r,i=(r=e.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return i||null},HS=function(e,n){return e.getOptionLabel(n)},Vu=function(e,n){return e.getOptionValue(n)};function qS(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function WS(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=Vu(t,e);return n.some(function(i){return Vu(t,i)===r})}function YS(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var XS=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},bA=1,JS=function(t){Dk(n,t);var e=Bk(n);function n(r){var i;if(Lk(this,n),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(u){i.controlRef=u},i.focusedOptionRef=null,i.getFocusedOptionRef=function(u){i.focusedOptionRef=u},i.menuListRef=null,i.getMenuListRef=function(u){i.menuListRef=u},i.inputRef=null,i.getInputRef=function(u){i.inputRef=u},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(u,s){var c=i.props,d=c.onChange,f=c.name;s.name=f,i.ariaOnChange(u,s),d(u,s)},i.setValue=function(u,s,c){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(u,{action:s,option:c})},i.selectOption=function(u){var s=i.props,c=s.blurInputOnSelect,d=s.isMulti,f=s.name,h=i.state.selectValue,p=d&&i.isOptionSelected(u,h),y=i.isOptionDisabled(u,h);if(p){var w=i.getOptionValue(u);i.setValue(h.filter(function(g){return i.getOptionValue(g)!==w}),"deselect-option",u)}else if(!y)d?i.setValue([].concat(xg(h),[u]),"select-option",u):i.setValue(u,"select-option");else{i.ariaOnChange(u,{action:"select-option",option:u,name:f});return}c&&i.blurInput()},i.removeValue=function(u){var s=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(u),f=c.filter(function(p){return i.getOptionValue(p)!==d}),h=fl(s,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:u}),i.focusInput()},i.clearValue=function(){var u=i.state.selectValue;i.onChange(fl(i.props.isMulti,[],null),{action:"clear",removedValues:u})},i.popValue=function(){var u=i.props.isMulti,s=i.state.selectValue,c=s[s.length-1],d=s.slice(0,s.length-1),f=fl(u,d,d[0]||null);c&&i.onChange(f,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(u){return of(i.state.focusableOptionsWithIds,u)},i.getFocusableOptionsWithIds=function(){return g0(Wl(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];return uP.apply(void 0,[i.props.classNamePrefix].concat(s))},i.getOptionLabel=function(u){return HS(i.props,u)},i.getOptionValue=function(u){return Vu(i.props,u)},i.getStyles=function(u,s){var c=i.props.unstyled,d=dA[u](s,c);d.boxSizing="border-box";var f=i.props.styles[u];return f?f(d,s):d},i.getClassNames=function(u,s){var c,d;return(c=(d=i.props.classNames)[u])===null||c===void 0?void 0:c.call(d,s)},i.getElementId=function(u){return"".concat(i.state.instancePrefix,"-").concat(u)},i.getComponents=function(){return M9(i.props)},i.buildCategorizedOptions=function(){return Wl(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return GS(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(u,s){i.setState({ariaSelection:J({value:u},s)})},i.onMenuMouseDown=function(u){u.button===0&&(u.stopPropagation(),u.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(u){i.blockOptionHover=!1},i.onControlMouseDown=function(u){if(!u.defaultPrevented){var s=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"&&i.onMenuClose():s&&i.openMenu("first"):(s&&(i.openAfterFocus=!0),i.focusInput()),u.target.tagName!=="INPUT"&&u.target.tagName!=="TEXTAREA"&&u.preventDefault()}},i.onDropdownIndicatorMouseDown=function(u){if(!(u&&u.type==="mousedown"&&u.button!==0)&&!i.props.isDisabled){var s=i.props,c=s.isMulti,d=s.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),u.preventDefault()}},i.onClearIndicatorMouseDown=function(u){u&&u.type==="mousedown"&&u.button!==0||(i.clearValue(),u.preventDefault(),i.openAfterFocus=!1,u.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(u){typeof i.props.closeMenuOnScroll=="boolean"?u.target instanceof HTMLElement&&qc(u.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(u)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(u){var s=u.touches,c=s&&s.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(u){var s=u.touches,c=s&&s.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),f=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(u){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(u.target)&&i.menuListRef&&!i.menuListRef.contains(u.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(u){i.userIsDragging||i.onControlMouseDown(u)},i.onClearIndicatorTouchEnd=function(u){i.userIsDragging||i.onClearIndicatorMouseDown(u)},i.onDropdownIndicatorTouchEnd=function(u){i.userIsDragging||i.onDropdownIndicatorMouseDown(u)},i.handleInputChange=function(u){var s=i.props.inputValue,c=u.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:s}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(u){i.props.onFocus&&i.props.onFocus(u),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(u){var s=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(u),i.onInputChange("",{action:"input-blur",prevInputValue:s}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(u){if(!(i.blockOptionHover||i.state.focusedOption===u)){var s=i.getFocusableOptions(),c=s.indexOf(u);i.setState({focusedOption:u,focusedOptionId:c>-1?i.getFocusedOptionId(u):null})}},i.shouldHideSelectedOptions=function(){return XS(i.props)},i.onValueInputFocus=function(u){u.preventDefault(),u.stopPropagation(),i.focus()},i.onKeyDown=function(u){var s=i.props,c=s.isMulti,d=s.backspaceRemovesValue,f=s.escapeClearsValue,h=s.inputValue,p=s.isClearable,y=s.isDisabled,w=s.menuIsOpen,g=s.onKeyDown,m=s.tabSelectsValue,v=s.openMenuOnFocus,_=i.state,S=_.focusedOption,E=_.focusedValue,T=_.selectValue;if(!y&&!(typeof g=="function"&&(g(u),u.defaultPrevented))){switch(i.blockOptionHover=!0,u.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(E)i.removeValue(E);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||u.shiftKey||!w||!m||!S||v&&i.isOptionSelected(S,T))return;i.selectOption(S);break;case"Enter":if(u.keyCode===229)break;if(w){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":w?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&f&&i.clearValue();break;case" ":if(h)return;if(!w){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":w?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":w?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!w)return;i.focusOption("pageup");break;case"PageDown":if(!w)return;i.focusOption("pagedown");break;case"Home":if(!w)return;i.focusOption("first");break;case"End":if(!w)return;i.focusOption("last");break;default:return}u.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++bA),i.state.selectValue=e0(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),l=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=o[l],i.state.focusedOptionId=of(a,o[l])}return i}return Nk(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&t0(this.menuListRef,this.focusedOptionRef),oA()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isDisabled,l=a.menuIsOpen,u=this.state.isFocused;(u&&!o&&i.isDisabled||u&&l&&!i.menuIsOpen)&&this.focusInput(),u&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!u&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t0(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,o=this.state,l=o.selectValue,u=o.isFocused,s=this.buildFocusableOptions(),c=i==="first"?0:s.length-1;if(!this.props.isMulti){var d=s.indexOf(l[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(u&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,o=a.selectValue,l=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var u=o.indexOf(l);l||(u=-1);var s=o.length-1,c=-1;if(o.length){switch(i){case"previous":u===0?c=0:u===-1?c=s:c=u-1;break;case"next":u>-1&&u<s&&(c=u+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:o[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var u=0,s=l.indexOf(o);o||(s=-1),i==="up"?u=s>0?s-1:l.length-1:i==="down"?u=(s+1)%l.length:i==="pageup"?(u=s-a,u<0&&(u=0)):i==="pagedown"?(u=s+a,u>l.length-1&&(u=l.length-1)):i==="last"&&(u=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[u],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[u])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(af):J(J({},af),this.props.theme):af}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,o=this.getStyles,l=this.getClassNames,u=this.getValue,s=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,p=d.options,y=this.hasValue();return{clearValue:i,cx:a,getStyles:o,getClassNames:l,getValue:u,hasValue:y,isMulti:f,isRtl:h,options:p,selectOption:s,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,o=i.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(i,a){return qS(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return WS(this.props,i,a)}},{key:"filterOption",value:function(i,a){return YS(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:o,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,o=i.isSearchable,l=i.inputId,u=i.inputValue,s=i.tabIndex,c=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),p=h.Input,y=this.state,w=y.inputIsHidden,g=y.ariaSelection,m=this.commonProps,v=l||this.getElementId("input"),_=J(J(J({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(g==null?void 0:g.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?b.createElement(p,Z({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:a,isHidden:w,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:u},_)):b.createElement(q9,Z({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:$u,onFocus:this.onInputFocus,disabled:a,tabIndex:s,inputMode:"none",form:c,value:""},_))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),o=a.MultiValue,l=a.MultiValueContainer,u=a.MultiValueLabel,s=a.MultiValueRemove,c=a.SingleValue,d=a.Placeholder,f=this.commonProps,h=this.props,p=h.controlShouldRenderValue,y=h.isDisabled,w=h.isMulti,g=h.inputValue,m=h.placeholder,v=this.state,_=v.selectValue,S=v.focusedValue,E=v.isFocused;if(!this.hasValue()||!p)return g?null:b.createElement(d,Z({},f,{key:"placeholder",isDisabled:y,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),m);if(w)return _.map(function(x,P){var R=x===S,A="".concat(i.getOptionLabel(x),"-").concat(i.getOptionValue(x));return b.createElement(o,Z({},f,{components:{Container:l,Label:u,Remove:s},isFocused:R,isDisabled:y,key:A,index:P,removeProps:{onClick:function(){return i.removeValue(x)},onTouchEnd:function(){return i.removeValue(x)},onMouseDown:function(L){L.preventDefault()}},data:x}),i.formatOptionLabel(x,"value"))});if(g)return null;var T=_[0];return b.createElement(c,Z({},f,{data:T,isDisabled:y}),this.formatOptionLabel(T,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,o=this.commonProps,l=this.props,u=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!a||u||!this.hasValue()||s)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,o=this.commonProps,l=this.props,u=l.isDisabled,s=l.isLoading,c=this.state.isFocused;if(!a||!s)return null;var d={"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:d,isDisabled:u,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,o=i.IndicatorSeparator;if(!a||!o)return null;var l=this.commonProps,u=this.props.isDisabled,s=this.state.isFocused;return b.createElement(o,Z({},l,{isDisabled:u,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var o=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(a,Z({},o,{innerProps:s,isDisabled:l,isFocused:u}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),o=a.Group,l=a.GroupHeading,u=a.Menu,s=a.MenuList,c=a.MenuPortal,d=a.LoadingMessage,f=a.NoOptionsMessage,h=a.Option,p=this.commonProps,y=this.state.focusedOption,w=this.props,g=w.captureMenuScroll,m=w.inputValue,v=w.isLoading,_=w.loadingMessage,S=w.minMenuHeight,E=w.maxMenuHeight,T=w.menuIsOpen,x=w.menuPlacement,P=w.menuPosition,R=w.menuPortalTarget,A=w.menuShouldBlockScroll,j=w.menuShouldScrollIntoView,L=w.noOptionsMessage,D=w.onMenuScrollToTop,$=w.onMenuScrollToBottom;if(!T)return null;var B=function(oe,ye){var be=oe.type,ue=oe.data,fe=oe.isDisabled,xe=oe.isSelected,gt=oe.label,mt=oe.value,on=y===ue,ot=fe?void 0:function(){return i.onOptionHover(ue)},wn=fe?void 0:function(){return i.selectOption(ue)},Me="".concat(i.getElementId("option"),"-").concat(ye),St={id:Me,onClick:wn,onMouseMove:ot,onMouseOver:ot,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:xe};return b.createElement(h,Z({},p,{innerProps:St,data:ue,isDisabled:fe,isSelected:xe,key:Me,label:gt,type:be,value:mt,isFocused:on,innerRef:on?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(oe.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(X){if(X.type==="group"){var oe=X.data,ye=X.options,be=X.index,ue="".concat(i.getElementId("group"),"-").concat(be),fe="".concat(ue,"-heading");return b.createElement(o,Z({},p,{key:ue,data:oe,options:ye,Heading:l,headingProps:{id:fe,data:X.data},label:i.formatGroupLabel(X.data)}),X.options.map(function(xe){return B(xe,"".concat(be,"-").concat(xe.index))}))}else if(X.type==="option")return B(X,"".concat(X.index))});else if(v){var O=_({inputValue:m});if(O===null)return null;N=b.createElement(d,p,O)}else{var z=L({inputValue:m});if(z===null)return null;N=b.createElement(f,p,z)}var U={minMenuHeight:S,maxMenuHeight:E,menuPlacement:x,menuPosition:P,menuShouldScrollIntoView:j},ie=b.createElement(CP,Z({},p,U),function(X){var oe=X.ref,ye=X.placerProps,be=ye.placement,ue=ye.maxHeight;return b.createElement(u,Z({},p,U,{innerRef:oe,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:v,placement:be}),b.createElement(Q9,{captureEnabled:g,onTopArrive:D,onBottomArrive:$,lockEnabled:A},function(fe){return b.createElement(s,Z({},p,{innerRef:function(gt){i.getMenuListRef(gt),fe(gt)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:v,maxHeight:ue,focusedOption:y}),N)}))});return R||P==="fixed"?b.createElement(c,Z({},p,{appendTo:R,controlElement:this.controlRef,menuPlacement:x,menuPosition:P}),ie):ie}},{key:"renderFormField",value:function(){var i=this,a=this.props,o=a.delimiter,l=a.isDisabled,u=a.isMulti,s=a.name,c=a.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!l)return b.createElement(nA,{name:s,onFocus:this.onValueInputFocus});if(!(!s||l))if(u)if(o){var f=d.map(function(y){return i.getOptionValue(y)}).join(o);return b.createElement("input",{name:s,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(y,w){return b.createElement("input",{key:"i-".concat(w),name:s,type:"hidden",value:i.getOptionValue(y)})}):b.createElement("input",{name:s,type:"hidden",value:""});return b.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return b.createElement("input",{name:s,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,o=a.ariaSelection,l=a.focusedOption,u=a.focusedValue,s=a.isFocused,c=a.selectValue,d=this.getFocusableOptions();return b.createElement(z9,Z({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:l,focusedValue:u,isFocused:s,selectValue:c,focusableOptions:d,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,o=i.IndicatorsContainer,l=i.SelectContainer,u=i.ValueContainer,s=this.props,c=s.className,d=s.id,f=s.isDisabled,h=s.menuIsOpen,p=this.state.isFocused,y=this.commonProps=this.getCommonProps();return b.createElement(l,Z({},y,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:p}),this.renderLiveRegion(),b.createElement(a,Z({},y,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:p,menuIsOpen:h}),b.createElement(u,Z({},y,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),b.createElement(o,Z({},y,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var o=a.prevProps,l=a.clearFocusValueOnUpdate,u=a.inputIsHiddenAfterUpdate,s=a.ariaSelection,c=a.isFocused,d=a.prevWasFocused,f=a.instancePrefix,h=i.options,p=i.value,y=i.menuIsOpen,w=i.inputValue,g=i.isMulti,m=e0(p),v={};if(o&&(p!==o.value||h!==o.options||y!==o.menuIsOpen||w!==o.inputValue)){var _=y?vA(i,m):[],S=y?g0(Wl(i,m),"".concat(f,"-option")):[],E=l?wA(a,m):null,T=_A(a,_),x=of(S,T);v={selectValue:m,focusedOption:T,focusedOptionId:x,focusableOptionsWithIds:S,focusedValue:E,clearFocusValueOnUpdate:!1}}var P=u!=null&&i!==o?{inputIsHidden:u,inputIsHiddenAfterUpdate:void 0}:{},R=s,A=c&&d;return c&&!A&&(R={value:fl(g,m,m[0]||null),options:m,action:"initial-input-focus"},A=!d),(s==null?void 0:s.action)==="initial-input-focus"&&(R=null),J(J(J({},v),P),{},{prevProps:i,ariaSelection:R,prevWasFocused:A})}}]),n}(b.Component);JS.defaultProps=yA;var SA=b.forwardRef(function(t,e){var n=Mk(t);return b.createElement(JS,Z({ref:e},n))}),TA=SA,ve=function(){return ve=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ve.apply(this,arguments)},EA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},CA=function(t){return ve(ve({},t),{borderRadius:0,colors:ve(ve({},t.colors),{primary25:"var(--semi-transparent-accent-color)",neutral10:"var(--border-color)",neutral20:"var(--border-color)",primary:"var(--accent-color)",neutral30:"var(--darker-border-color)"})})},xA=function(t,e){return b.useMemo(function(){return{placeholder:function(n){return ve(ve({},n),{color:"var(--placeholder-body-color)"})},container:function(n){return ve(ve({},n),{fontSize:"inherit"})},control:function(n,r){var i=r.isFocused,a=n;return a=ve(ve({},a),{minHeight:40}),i?ve(ve({},a),{borderColor:e?"var(--alert-color)":"var(--accent-color)",backgroundColor:t?"var(--disabled-color)":"white",boxShadow:"0 0 0 3px ".concat(e?"rgba(var(--alert-color-rgb-components), 0.2)":"var(--semi-transparent-accent-color)"),"&:hover":{borderColor:e?"var(--alert-color)":"var(--accent-color)"}}):ve(ve({},a),{borderColor:e?"var(--alert-color)":"var(--border-color)",backgroundColor:t?"var(--disabled-color)":"white","&:hover":{borderColor:e?"var(--alert-color)":"var(--darker-border-color)"}})},multiValueRemove:function(n){return ve(ve({},n),{cursor:"pointer"})},menu:function(n){return ve(ve({},n),{zIndex:1e3,minWidth:250})},input:function(n){var r=ve(ve({},n),{boxShadow:"none","input:focus":{boxShadow:"none"}});return r},multiValue:function(n){return ve(ve({},n),{zIndex:100,backgroundColor:"var(--light-color)",userSelect:"none"})},multiValueLabel:function(n){return ve(ve({},n),{fontSize:"inherit",padding:3})}}},[t,e])};function RA(t){var e=t.isDisabled,n=t.error,r=EA(t,["isDisabled","error"]),i=xA(e,n);return V.createElement(TA,ve({},r,{isDisabled:e,theme:CA,styles:i}))}const kA="_Spinner__bar_oumod_13",sf={"Spinner--inline":"_Spinner--inline_oumod_1","Spinner--centered":"_Spinner--centered_oumod_7",Spinner__bar:kA};var Uu=function(){return Uu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uu.apply(this,arguments)};function Ku(t){for(var e,n=t.size,r=n===void 0?32:n,i=t.placement,a=i===void 0?"inline":i,o=t.style,l=o===void 0?{}:o,u=[],s=0;s<12;s+=1){var c={};c.animationDelay="".concat((s-12)/10,"s"),c.transform="rotate(".concat(s*30,"deg) translate(146%)"),u.push(V.createElement("div",{style:c,className:sf.Spinner__bar,key:s}))}var d={width:r*.5,height:r*.5};return a==="inline"&&(d.marginLeft=r*.5,d.transform="translateY(33%)"),V.createElement("div",{className:jn((e={},e[sf["Spinner--inline"]]=a==="inline",e[sf["Spinner--centered"]]=a==="centered",e)),style:Uu(Uu({},l),d)},u)}const PA="_switchField__flex_16z4j_1",AA="_switchField__switchInput_16z4j_6",OA="_switchField__label_16z4j_10",IA="_switchField__below_16z4j_22",hl={switchField__flex:PA,switchField__switchInput:AA,switchField__label:OA,switchField__below:IA};var Gu=function(){return Gu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gu.apply(this,arguments)};function ji(t){var e=t.id,n=t.name,r=t.label,i=t.hint,a=t.error,o=t.required,l=t.formLabelProps,u=t.value,s=t.onChange,c=t.switchInputProps;return V.createElement(V.Fragment,null,V.createElement("div",{className:hl.switchField__flex},V.createElement("div",{className:hl.switchField__switchInput},V.createElement(jA,Gu({},c,{name:n,value:u,onChange:s}))),V.createElement(iS,Gu({},l,{htmlFor:e,required:o,className:jn(hl.switchField__label,l==null?void 0:l.className),error:!!a}),r)),(i||a)&&V.createElement("div",{className:hl.switchField__below},a&&V.createElement(tS,null,a),i&&V.createElement(nS,null,i)))}const MA="_switchInput__inner_1knbg_1",LA="_switchInput_1knbg_1",NA="_switchInput__checked_1knbg_47",DA="_switchInput__disabled_1knbg_60",pl={switchInput__inner:MA,switchInput:LA,switchInput__checked:NA,switchInput__disabled:DA};var Kh=function(){return Kh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Kh.apply(this,arguments)},FA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function jA(t){var e,n=t.className,r=t.value,i=t.disabled,a=t.onClick,o=t.onChange,l=t.onKeyDown,u=FA(t,["className","value","disabled","onClick","onChange","onKeyDown"]);function s(h,p){!i&&o&&o(h,p)}function c(h){h.key==="ArrowLeft"?s(!1,h):h.key==="ArrowRight"&&s(!0,h),l==null||l(h)}function d(h){s(!r,h),a==null||a(h)}var f=jn(pl.switchInput,n,(e={},e[pl.switchInput__checked]=r,e[pl.switchInput__disabled]=i,e));return V.createElement("button",Kh({},u,{type:"button",role:"switch","aria-checked":r,disabled:i,className:f,onKeyDown:c,onClick:d}),V.createElement("span",{className:pl.switchInput__inner}))}var Gh=function(){return Gh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gh.apply(this,arguments)};function fr(t){var e=t.id,n=t.name,r=t.label,i=t.hint,a=t.error,o=t.required,l=t.placeholder,u=t.formLabelProps,s=t.value,c=t.onChange,d=t.textInputProps;return V.createElement(rS,{formLabelProps:u,id:e,required:o,error:a,hint:i,label:r},V.createElement(zA,Gh({},d,{id:e,name:n,value:s,placeholder:l,onChange:c,error:!!a})))}const BA="_TextInput_x2oj2_1",gl={TextInput:BA,"TextInput--monospaced":"_TextInput--monospaced_x2oj2_30","TextInput--disabled":"_TextInput--disabled_x2oj2_35","TextInput--error":"_TextInput--error_x2oj2_41"};var Hh=function(){return Hh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Hh.apply(this,arguments)},$A=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},zA=function(t){var e,n=t.className,r=t.disabled,i=r===void 0?!1:r,a=t.error,o=t.id,l=t.inputRef,u=t.maxLength,s=t.name,c=t.labelText,d=t.onBlur,f=t.onChange,h=t.placeholder,p=t.required,y=p===void 0?!1:p,w=t.type,g=t.value,m=t.monospaced,v=$A(t,["className","disabled","error","id","inputRef","maxLength","name","labelText","onBlur","onChange","placeholder","required","type","value","monospaced"]),_=b.useCallback(function(E){f&&f(E.target.value,E)},[f]),S=jn(gl.TextInput,n,(e={},e[gl["TextInput--disabled"]]=i,e[gl["TextInput--error"]]=a,e[gl["TextInput--monospaced"]]=m,e));return V.createElement("input",Hh({className:S,"aria-label":c,id:o,name:s,required:y,placeholder:h,maxLength:u,disabled:i,onBlur:d,onChange:_,value:g,type:w,ref:l},v))};const VA="_modelSelect_hfvrd_8",UA="_dropdownLabel_hfvrd_15",KA="_tooltipConfig_hfvrd_61",GA="_buttons_hfvrd_32",HA="_inlineStatus_hfvrd_89",qA="_fieldSpacing_hfvrd_94",WA="_textarea_hfvrd_132",YA="_label_hfvrd_142",XA="_switchField_hfvrd_165",JA="_buttonRow_hfvrd_170",ZA="_exclusionRules_hfvrd_176",QA="_promptContainer_hfvrd_182",eO="_tooltipContainer_hfvrd_190",tO="_warningTooltip_hfvrd_197",nO="_tooltipText_hfvrd_206",rO="_imageTooltip_hfvrd_240",iO="_leftAnchorTooltip_hfvrd_245",K={modelSelect:VA,dropdownLabel:UA,tooltipConfig:KA,buttons:GA,inlineStatus:HA,fieldSpacing:qA,textarea:WA,label:YA,switchField:XA,buttonRow:JA,exclusionRules:ZA,promptContainer:QA,tooltipContainer:eO,warningTooltip:tO,tooltipText:nO,imageTooltip:rO,leftAnchorTooltip:iO};class ZS{constructor(e){we(this,"vendor","deepl");we(this,"capabilities",{streaming:!1});we(this,"apiKey");we(this,"baseUrl");we(this,"proxyUrl");this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||"https://api.deepl.com",this.proxyUrl=e.proxyUrl}async*streamText(e,n){const r=await this.completeText(e,n);r&&(yield r)}async completeText(e,n){return(await this.translateArray([e],{targetLang:"EN"}))[0]||""}async translateArray(e,n){var l,u;if(!e.length)return e;const r=(this.proxyUrl||this.baseUrl).replace(/\/$/,"")+"/v2/translate",i=new Array(e.length),a=45,o={"content-type":"application/json"};this.proxyUrl||(o.Authorization=`DeepL-Auth-Key ${this.apiKey}`);for(let s=0;s<e.length;s+=a){const c=e.slice(s,s+a),d=/api-free\.deepl\.com/i.test(this.baseUrl),f=this.proxyUrl?this.proxyUrl.replace(/\/$/,"")+(d?"?endpoint=free":""):r,h=g=>{var v,_,S;const m={text:c,target_lang:n.targetLang};return n.sourceLang&&(m.source_lang=n.sourceLang),n.isHTML&&(m.tag_handling="html"),n.formality&&n.formality!=="default"&&(m.formality=n.formality),m.preserve_formatting=n.preserveFormatting!==!1,(v=n.ignoreTags)!=null&&v.length&&(m.ignore_tags=n.ignoreTags),(_=n.nonSplittingTags)!=null&&_.length&&(m.non_splitting_tags=n.nonSplittingTags),(S=n.splittingTags)!=null&&S.length&&(m.splitting_tags=n.splittingTags),g&&n.glossaryId&&(m.glossary_id=n.glossaryId),m};let p=await fetch(f,{method:"POST",headers:o,body:JSON.stringify(h(!!n.glossaryId))});if(!p.ok){let g=p.statusText,m=null;try{m=await p.json(),g=(m==null?void 0:m.message)||((l=m==null?void 0:m.error)==null?void 0:l.message)||g}catch{}const v=/glossary/i.test(g)&&/(language|pair|match|not found)/i.test(g);n.glossaryId&&v&&p.status>=400&&p.status<500&&(p=await fetch(f,{method:"POST",headers:o,body:JSON.stringify(h(!1))}))}if(!p.ok){let g=p.statusText;try{const v=await p.json();g=(v==null?void 0:v.message)||((u=v==null?void 0:v.error)==null?void 0:u.message)||g}catch{}if(/wrong endpoint/i.test(g)){const v=/:fx\b/i.test(this.apiKey),_=/api\.deepl\.com/i.test(this.baseUrl);g=`DeepL: wrong endpoint for your API key. ${v&&_?'Your key looks like a Free key (:fx), but the Pro endpoint is configured. In Settings → DeepL, enable "Use DeepL Free endpoint (api-free.deepl.com)".':!v&&/api-free\.deepl\.com/i.test(this.baseUrl)?'A Pro key is being used with the Free endpoint. In Settings → DeepL, disable "Use DeepL Free endpoint" to use api.deepl.com.':"Ensure the endpoint matches your plan: api-free.deepl.com for Free (:fx) keys; api.deepl.com for Pro."}`}const m=new Error(g);throw m.status=p.status,m}const y=await p.json(),w=Array.isArray(y==null?void 0:y.translations)?y.translations.map(g=>String((g==null?void 0:g.text)??"")):[];for(let g=0;g<c.length;g++)i[s+g]=w[g]??c[g]}return i}}const hr=(t,...e)=>typeof t=="string"&&e.some(n=>t.toLowerCase().includes(n.toLowerCase()));function ur(t,e){var o,l,u,s;const n=t,r=(n==null?void 0:n.status)||(n==null?void 0:n.code)||((o=n==null?void 0:n.response)==null?void 0:o.status),i=String((n==null?void 0:n.message)||((l=n==null?void 0:n.error)==null?void 0:l.message)||n||"Unknown error"),a=i;return e==="openai"&&(((u=n==null?void 0:n.error)==null?void 0:u.code)==="unsupported_value"||r===400)&&(((s=n==null?void 0:n.error)==null?void 0:s.param)==="stream"||hr(a,"stream"))&&hr(a,"must be verified to stream this model")?{code:"auth",message:a,hint:"Verify your organization in OpenAI or choose a different model."}:r===401||hr(a,"unauthorized","invalid api key","invalid authentication","not valid api key","permission_denied")?{code:"auth",message:"Authentication failed for the selected AI vendor.",hint:e==="openai"?"Check OpenAI API key and organization access in settings.":"Check Google API key and that Generative Language API is enabled."}:r===429||hr(a,"rate limit","too many requests")?{code:"rate_limit",message:"Rate limit reached. Please wait and try again.",hint:e==="openai"?"Reduce concurrency, switch to a more available model, or increase limits.":e==="google"?"Reduce request rate or increase quota in Google Cloud console.":e==="anthropic"?"Reduce request rate or increase Anthropic rate limits.":"Reduce concurrency or batch size; check DeepL plan limits."}:hr(a,"insufficient_quota","quota exceeded","resource has been exhausted","out of quota")?{code:"quota",message:"Quota exceeded for the selected AI vendor.",hint:e==="openai"?"Check OpenAI usage and billing; switch to a smaller model if needed.":e==="google"?"Verify Google project quotas and billing for Generative Language API.":e==="anthropic"?"Check Anthropic usage limits and billing.":"Check DeepL usage limits and plan."}:r===404||hr(a,"model not found","no such model","unsupported model","not found: model")?{code:"model",message:"The selected model is unavailable or not accessible.",hint:e==="openai"?"Ensure the model exists on your account and is spelled correctly.":e==="google"?"Ensure the Gemini model id is correct and available in your region.":e==="anthropic"?"Ensure the Claude model id is correct and you have access.":"Ensure the language pair is valid for DeepL; check target code."}:hr(a,"failed to fetch","fetch failed","network","ecconn","enotfound","timeout")?{code:"network",message:i,hint:"This often indicates CORS/proxy issues or connectivity problems."}:e==="deepl"&&(r===403||hr(a,"wrong endpoint"))?{code:"auth",message:'DeepL: wrong endpoint for your API key. If your key ends with :fx, enable "Use DeepL Free endpoint (api-free.deepl.com)" in Settings. Otherwise, disable it to use api.deepl.com.',hint:"Match the endpoint to your plan: Free (:fx) → api-free.deepl.com; Pro → api.deepl.com."}:{code:"unknown",message:a}}var aO=function(e){var n=V.useRef(e);return Bu(function(){n.current=e}),n},y0=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},oO=function(e,n){var r=V.useRef();return V.useCallback(function(i){e.current=i,r.current&&y0(r.current,null),r.current=n,n&&y0(n,i)},[n])},v0={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},sO=function(e){Object.keys(v0).forEach(function(n){e.style.setProperty(n,v0[n],"important")})},w0=sO,yt=null,_0=function(e,n){var r=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function lO(t,e,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),yt||(yt=document.createElement("textarea"),yt.setAttribute("tabindex","-1"),yt.setAttribute("aria-hidden","true"),w0(yt)),yt.parentNode===null&&document.body.appendChild(yt);var i=t.paddingSize,a=t.borderSize,o=t.sizingStyle,l=o.boxSizing;Object.keys(o).forEach(function(f){var h=f;yt.style[h]=o[h]}),w0(yt),yt.value=e;var u=_0(yt,t);yt.value=e,u=_0(yt,t),yt.value="x";var s=yt.scrollHeight-i,c=s*n;l==="border-box"&&(c=c+i+a),u=Math.max(c,u);var d=s*r;return l==="border-box"&&(d=d+i+a),u=Math.min(d,u),[u,s]}var b0=function(){},uO=function(e,n){return e.reduce(function(r,i){return r[i]=n[i],r},{})},cO=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],dO=!!document.documentElement.currentStyle,fO=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var r=uO(cO,n),i=r.boxSizing;if(i==="")return null;dO&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var a=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:a,borderSize:o}},hO=fO;function $g(t,e,n){var r=aO(n);b.useLayoutEffect(function(){var i=function(o){return r.current(o)};if(t)return t.addEventListener(e,i),function(){return t.removeEventListener(e,i)}},[])}var pO=function(e,n){$g(document.body,"reset",function(r){e.current.form===r.target&&n(r)})},gO=function(e){$g(window,"resize",e)},mO=function(e){$g(document.fonts,"loadingdone",e)},yO=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],vO=function(e,n){var r=e.cacheMeasurements,i=e.maxRows,a=e.minRows,o=e.onChange,l=o===void 0?b0:o,u=e.onHeightChange,s=u===void 0?b0:u,c=sS(e,yO),d=c.value!==void 0,f=b.useRef(null),h=oO(f,n),p=b.useRef(0),y=b.useRef(),w=function(){var v=f.current,_=r&&y.current?y.current:hO(v);if(_){y.current=_;var S=lO(_,v.value||v.placeholder||"x",a,i),E=S[0],T=S[1];p.current!==E&&(p.current=E,v.style.setProperty("height",E+"px","important"),s(E,{rowHeight:T}))}},g=function(v){d||w(),l(v)};return b.useLayoutEffect(w),pO(f,function(){if(!d){var m=f.current.value;requestAnimationFrame(function(){var v=f.current;v&&m!==v.value&&w()})}}),gO(w),mO(w),b.createElement("textarea",Z({},c,{onChange:g,ref:h}))},S0=b.forwardRef(vO);const vo=`You are an expert translator specializing in CMS content translation.
57
57
 
58
58
  TRANSLATION REQUIREMENTS:
59
59
  - Translate the content accurately while preserving the original meaning and intent
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>DatoCMS Plugin</title>
8
- <script type="module" crossorigin src="./assets/index-BxSWvGrl.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-CZF7YKl5.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-C_QC-zaQ.css">
10
10
  </head>
11
11
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Translate fields and records directly on DatoCMS using AI",
4
4
  "homepage": "https://github.com/marcelofinamorvieira/datocms-plugin-ai-translations",
5
5
  "private": false,
6
- "version": "2.1.0",
6
+ "version": "2.2.0",
7
7
  "author": "marcelofinamorvieira <marcelofinamorvieira@gmail.com>",
8
8
  "type": "module",
9
9
  "keywords": [
@@ -22,17 +22,6 @@
22
22
  "dist",
23
23
  "docs"
24
24
  ],
25
- "scripts": {
26
- "dev": "vite",
27
- "build": "tsc -b && vite build",
28
- "preview": "vite preview",
29
- "prepublishOnly": "npm run build",
30
- "test": "vitest run",
31
- "test:watch": "vitest",
32
- "coverage": "vitest run --coverage",
33
- "lint": "eslint . --ext .ts,.tsx",
34
- "lint:fix": "eslint . --ext .ts,.tsx --fix"
35
- },
36
25
  "dependencies": {
37
26
  "@datocms/cma-client-browser": "^3.4.0",
38
27
  "@google/generative-ai": "^0.21.0",
@@ -67,5 +56,14 @@
67
56
  "vitest": "^2.1.3",
68
57
  "@vitest/coverage-v8": "^2.1.3"
69
58
  },
70
- "packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8"
71
- }
59
+ "scripts": {
60
+ "dev": "vite",
61
+ "build": "tsc -b && vite build",
62
+ "preview": "vite preview",
63
+ "test": "vitest run",
64
+ "test:watch": "vitest",
65
+ "coverage": "vitest run --coverage",
66
+ "lint": "eslint . --ext .ts,.tsx",
67
+ "lint:fix": "eslint . --ext .ts,.tsx --fix"
68
+ }
69
+ }
@@ -1,195 +0,0 @@
1
- # DeepL Proxy via CLI (Only for DeepL)
2
-
3
- DeepL’s API blocks browser-origin requests (no CORS). For this plugin, a tiny proxy is required only when using DeepL. The proxy forwards POST bodies to DeepL and injects the Authorization header server‑side.
4
-
5
- Below are precise, CLI-only quickstarts for Cloudflare Workers, Vercel, and Netlify.
6
-
7
- Important
8
- - Keep your DeepL key on the server (env vars). Never expose it in the browser.
9
- - Choose the right upstream host:
10
- - Free keys (end with `:fx`) → `https://api-free.deepl.com`
11
- - Pro keys → `https://api.deepl.com`
12
- - In the plugin, set Settings → DeepL → Proxy URL to your deployed endpoint base; the plugin will call `POST <proxy>/v2/translate`.
13
-
14
- <details>
15
- <summary>Cloudflare Workers (wrangler)</summary>
16
-
17
- Prereqs
18
- - Node 18+ and npm
19
- - `npm i -g wrangler`
20
-
21
- Steps
22
- 1) Init project
23
- ```
24
- mkdir deepl-proxy-cf && cd deepl-proxy-cf
25
- wrangler init --yes --type=javascript
26
- ```
27
-
28
- 2) Replace `src/index.js` with:
29
- ```
30
- export default {
31
- async fetch(req, env) {
32
- const cors = {
33
- 'Access-Control-Allow-Origin': '*',
34
- 'Access-Control-Allow-Headers': '*',
35
- };
36
- if (req.method === 'OPTIONS') return new Response(null, { headers: cors });
37
-
38
- const upstream = new URL('/v2/translate', env.DEEPL_BASE_URL || 'https://api.deepl.com');
39
- const body = await req.text();
40
- const resp = await fetch(upstream, {
41
- method: 'POST',
42
- headers: {
43
- 'Content-Type': 'application/json',
44
- 'Authorization': `DeepL-Auth-Key ${env.DEEPL_AUTH_KEY}`,
45
- },
46
- body,
47
- });
48
- const text = await resp.text();
49
- return new Response(text, { status: resp.status, headers: { ...cors, 'Content-Type': 'application/json' } });
50
- }
51
- }
52
- ```
53
-
54
- 3) Add env vars
55
- ```
56
- wrangler secret put DEEPL_AUTH_KEY
57
- ```
58
- Paste your key when prompted.
59
-
60
- In `wrangler.toml`, add:
61
- ```
62
- [vars]
63
- DEEPL_BASE_URL = "https://api-free.deepl.com" # or https://api.deepl.com
64
- ```
65
-
66
- 4) Deploy
67
- ```
68
- wrangler deploy
69
- ```
70
-
71
- 5) Use in plugin
72
- - Copy your Worker URL (e.g., `https://<name>.<account>.workers.dev`) into Settings → DeepL → Proxy URL.
73
-
74
- </details>
75
-
76
- <details>
77
- <summary>Vercel (vercel CLI)</summary>
78
-
79
- Prereqs
80
- - Node 18+ and npm
81
- - `npm i -g vercel`
82
-
83
- Steps
84
- 1) Init project
85
- ```
86
- mkdir deepl-proxy-vercel && cd deepl-proxy-vercel
87
- npm init -y
88
- mkdir -p api
89
- ```
90
-
91
- 2) Create `api/deepl.js`:
92
- ```
93
- export default async function handler(req, res) {
94
- res.setHeader('Access-Control-Allow-Origin', '*');
95
- res.setHeader('Access-Control-Allow-Headers', '*');
96
- if (req.method === 'OPTIONS') return res.status(204).end();
97
-
98
- const upstream = `${process.env.DEEPL_BASE_URL || 'https://api.deepl.com'}/v2/translate`;
99
- const r = await fetch(upstream, {
100
- method: 'POST',
101
- headers: {
102
- 'Content-Type': 'application/json',
103
- 'Authorization': `DeepL-Auth-Key ${process.env.DEEPL_AUTH_KEY}`,
104
- },
105
- body: JSON.stringify(req.body ?? {}),
106
- });
107
- const text = await r.text();
108
- res.status(r.status).setHeader('Content-Type', 'application/json').send(text);
109
- }
110
- ```
111
-
112
- 3) Login and link
113
- ```
114
- vercel login
115
- vercel link --yes
116
- ```
117
-
118
- 4) Add env vars (interactive)
119
- ```
120
- vercel env add DEEPL_AUTH_KEY production
121
- vercel env add DEEPL_BASE_URL production
122
- ```
123
- Set `DEEPL_BASE_URL` to `https://api-free.deepl.com` (Free) or `https://api.deepl.com` (Pro).
124
-
125
- 5) Deploy
126
- ```
127
- vercel deploy --prod --yes
128
- ```
129
-
130
- 6) Use in plugin
131
- - Proxy URL: `https://<your-app>.vercel.app/api/deepl`
132
-
133
- </details>
134
-
135
- <details>
136
- <summary>Netlify (netlify-cli)</summary>
137
-
138
- Prereqs
139
- - Node 18+ and npm
140
- - `npm i -g netlify-cli`
141
-
142
- Steps
143
- 1) Init project
144
- ```
145
- mkdir deepl-proxy-netlify && cd deepl-proxy-netlify
146
- netlify init --manual
147
- mkdir -p netlify/functions
148
- ```
149
-
150
- 2) Create `netlify/functions/deepl-proxy.js`:
151
- ```
152
- export const handler = async (event) => {
153
- if (event.httpMethod === 'OPTIONS') {
154
- return { statusCode: 204, headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*' } };
155
- }
156
- const upstream = `${process.env.DEEPL_BASE_URL || 'https://api.deepl.com'}/v2/translate`;
157
- const r = await fetch(upstream, {
158
- method: 'POST',
159
- headers: {
160
- 'Content-Type': 'application/json',
161
- 'Authorization': `DeepL-Auth-Key ${process.env.DEEPL_AUTH_KEY}`,
162
- },
163
- body: event.body || '{}',
164
- });
165
- const text = await r.text();
166
- return {
167
- statusCode: r.status,
168
- headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json' },
169
- body: text,
170
- };
171
- };
172
- ```
173
-
174
- 3) Set env vars
175
- ```
176
- netlify env:set DEEPL_AUTH_KEY <your-key>
177
- netlify env:set DEEPL_BASE_URL https://api-free.deepl.com # or https://api.deepl.com
178
- ```
179
-
180
- 4) Deploy
181
- ```
182
- netlify deploy --build --prod
183
- ```
184
-
185
- 5) Use in plugin
186
- - Proxy URL: `https://<yoursite>.netlify.app/.netlify/functions/deepl-proxy`
187
-
188
- </details>
189
-
190
- Testing
191
- - In plugin settings, click “Test proxy”. You should see a green “Proxy OK …” message.
192
- - If you see “Wrong endpoint for your API key”, match Free (:fx) keys to `api-free.deepl.com` and Pro keys to `api.deepl.com`.
193
-
194
- This proxy is only required for DeepL. OpenAI, Google (Gemini), and Anthropic (Claude) work from the browser with their standard API keys.
195
-