@nemme/js-sdk 0.8.0 → 0.9.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.
@@ -1,4 +1,4 @@
1
- (function(Rt,an){typeof exports=="object"&&typeof module<"u"?an(exports):typeof define=="function"&&define.amd?define(["exports"],an):(Rt=typeof globalThis<"u"?globalThis:Rt||self,an(Rt.NemmeSDK={}))})(this,(function(Rt){"use strict";const an={apiBaseUrl:"https://api.nemme.io",debug:!1},oo={debug:0,info:1,warn:2,error:3};let Lp=class Mp{prefix;enabled;level;constructor(l={}){this.prefix=l.prefix||"Nemme SDK",this.enabled=l.enabled!==void 0?l.enabled:!0,this.level=l.level||"info"}shouldLog(l){return this.enabled&&oo[l]>=oo[this.level]}formatMessage(l){return`[${this.prefix}] ${l}`}debug(l,...u){this.shouldLog("debug")&&console.debug(this.formatMessage(l),...u)}info(l,...u){this.shouldLog("info")&&console.info(this.formatMessage(l),...u)}warn(l,...u){this.shouldLog("warn")&&console.warn(this.formatMessage(l),...u)}error(l,...u){this.shouldLog("error")&&console.error(this.formatMessage(l),...u)}child(l){return new Mp({prefix:`${this.prefix}:${l}`,enabled:this.enabled,level:this.level})}configure(l){l.prefix!==void 0&&(this.prefix=l.prefix),l.enabled!==void 0&&(this.enabled=l.enabled),l.level!==void 0&&(this.level=l.level)}};const co=new Lp,fo=co.child("network"),kp=3e4,jp=(s,l)=>{const u=new URL(s,an.apiBaseUrl);return l&&Object.entries(l).forEach(([o,c])=>{c!=null&&u.searchParams.append(o,String(c))}),u.toString()},Gt={async request(s,l={}){const{method:u="GET",headers:o={},body:c,params:d,timeout:g=kp}=l,y=jp(s,d),m={"Content-Type":"application/json",Accept:"application/json",...o},p={method:u,headers:m,body:c?JSON.stringify(c):void 0},v=new AbortController,b=setTimeout(()=>v.abort(),g);p.signal=v.signal;try{const w=await fetch(y,p);let L;const x=w.headers.get("content-type");if(x&&x.includes("application/json"))L=await w.json();else{const C=await w.text();try{L=JSON.parse(C)}catch{L=C}}const T={data:L,status:w.status,statusText:w.statusText,headers:w.headers,ok:w.ok};if(w.ok)T.ok=!0;else{const C=`Request failed with status ${w.status}: ${w.statusText}`;fo.error(C,{url:y,method:u,status:w.status,data:T.data}),T.ok=!1,T.error={message:C,details:T.data}}return T}catch(w){let L="Network request failed",x={};return w instanceof DOMException&&w.name==="AbortError"?(L=`Request timeout after ${g}ms`,x={timeout:g,url:y}):x={message:w instanceof Error?w.message:String(w),url:y,method:u},fo.error(L,x),{data:{},status:0,statusText:L,headers:new Headers,ok:!1,error:{message:L,details:x}}}finally{clearTimeout(b)}},async get(s,l={}){return this.request(s,{...l,method:"GET"})},async post(s,l,u={}){return this.request(s,{...u,method:"POST",body:l})},async put(s,l,u={}){return this.request(s,{...u,method:"PUT",body:l})},async patch(s,l,u={}){return this.request(s,{...u,method:"PATCH",body:l})},async delete(s,l={}){return this.request(s,{...l,method:"DELETE"})}};class Up{logger;headers;formConfig;formManager;deliveries=[];constructor(l,u,o){this.logger=l,this.headers=u,this.formConfig=o}async loadDeliveries(){this.logger.debug("Loading deliveries");const l=await Gt.get("/external/deliveries",{headers:this.headers});if(!l.ok){this.logger.error("Failed to load deliveries",l.error),this.deliveries=[];return}this.deliveries=l.data,this.logger.info(`Loaded ${this.deliveries.length} deliveries`)}async evaluateDeliveryTriggers(l){for(const u of this.deliveries)for(const o of u.triggers)if(this.shouldTriggerDelivery(o,l)){if(!await this.isDeliveryValid(u)){this.logger.debug(`Delivery ${u.id} is not valid, skipping`);continue}await this.executeDelivery(u,o);return}}shouldTriggerDelivery(l,u){if(this.hasActiveDelivery())return!1;switch(l.triggerType){case"page_url":return l.urlPattern?this.matchesUrlPattern(u.url,l.urlPattern):!0;case"custom_event":return l.eventKey?u.eventKey===l.eventKey:!1;default:return!1}}hasActiveDelivery(){return document.getElementById("nm")!==null}async executeDelivery(l,u){if(l.productType==="FRM"){this.logger.debug(`Triggering form delivery: ${l.productSlug}`,{triggerType:u.triggerType,urlPattern:u.urlPattern,eventKey:u.eventKey});try{const c=await this.createDeliveryResponse(l);if(!this.formManager){const d=await Promise.resolve().then(()=>y0);this.formManager=new d.FormManager(this.logger,this.headers,this.formConfig)}await this.formManager.fetchAndDisplayForm(l.productSlug,async()=>{this.logger.debug(`Form for delivery: ${l.productSlug} was cancelled`),c&&await this.updateDeliveryResponse(l.id,c.id,!0)},async()=>{this.logger.debug(`Form for delivery: ${l.productSlug} was completed`),c&&await this.updateDeliveryResponse(l.id,c.id,!1,!0)})}catch(c){this.logger.error(`Failed to load form for delivery: ${l.productSlug}`,c)}}}matchesUrlPattern(l,u){let o;try{o=new URL(l).pathname}catch{o=l.startsWith("/")?l:`/${l}`}const c=v=>{if(!v)return"/";let b=v.startsWith("/")?v:`/${v}`;return b.length>1&&b.endsWith("/")&&(b=b.slice(0,-1)),b},d=c(o),g=c(u),y=g.replace(/\*\*/g,"§DOUBLE_STAR§").replace(/\*/g,"§SINGLE_STAR§").replace(/\?/g,"§QUESTION§").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/§SINGLE_STAR§/g,"[^/]*").replace(/§DOUBLE_STAR§/g,".*").replace(/§QUESTION§/g,"."),p=new RegExp(`^${y}$`).test(d);return this.logger.debug("URL pattern matching",{originalUrl:l,pathname:o,normalizedPathname:d,pattern:u,normalizedPattern:g,regexPattern:y,matches:p}),p}async createDeliveryResponse(l){const u=await Gt.post(`/external/deliveries/${l.id}/responses`,{},{headers:this.headers});if(!u.ok){this.logger.error(`Failed to create delivery response for delivery: ${l.id}`,u.error);return}return u.data}async updateDeliveryResponse(l,u,o=!1,c=!1){try{await Gt.patch(`/external/deliveries/${l}/responses/${u}`,{wasDismissed:o,wasCompleted:c},{headers:this.headers})}catch(d){this.logger.error(`Failed to update delivery response: ${u} for delivery: ${l}`,d)}}async isDeliveryValid(l){const u=await Gt.get(`/external/deliveries/${l.id}/should-deliver`,{headers:this.headers});return u.ok?u.data:(this.logger.error(`Failed to check delivery validity for delivery: ${l.id}`,u.error),!1)}}class Bp{logger;headers;sessionId;eventDefinitions=[];onPageView;onEvent;trackUrlParamChanges=!0;getPage;backlog=[];flushTimeout=null;batchConfig={enabled:!0,size:10,delayMs:1e4,sendOnUnload:!0};originalHistoryMethods=null;EVENT_PAGE_VIEW="page_view";lastTrackedPageKey;constructor({logger:l,headers:u,sessionId:o,eventDefinitions:c,batchConfig:d,onPageView:g,onEvent:y,trackUrlParamChanges:m,getPage:p}){this.logger=l,this.headers=u,this.sessionId=o,this.eventDefinitions=c,this.onPageView=g,this.onEvent=y,this.getPage=p,typeof m=="boolean"&&(this.trackUrlParamChanges=m),this.flushEvents=this.flushEvents.bind(this),this.handlePopState=this.handlePopState.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.setupBatching(d)}setupBatching(l){typeof l=="boolean"?this.batchConfig.enabled=l:l&&(this.batchConfig={...this.batchConfig,...l}),this.batchConfig.enabled&&this.batchConfig.sendOnUnload&&typeof window<"u"&&(window.addEventListener("beforeunload",this.flushEvents),window.addEventListener("pagehide",this.flushEvents))}async setupPageViewTracking(){if(typeof window>"u")return;this.originalHistoryMethods={pushState:history.pushState,replaceState:history.replaceState};const l=history.pushState;history.pushState=async(...o)=>{l.apply(history,o),await this.trackPageView()};const u=history.replaceState;history.replaceState=async(...o)=>{u.apply(history,o),await this.trackPageView()},window.addEventListener("popstate",this.handlePopState),document.addEventListener("visibilitychange",this.handleVisibilityChange)}async track(l){if(!this.sessionId){this.logger.warn("Tracking manager not initialized, cannot track event");return}const{eventKey:u,data:o={}}=l;this.logger.debug("Tracking event",{eventKey:u,data:o});const c=this.getPageUrl(),d={sessionId:this.sessionId,eventKey:u,data:o||{},timestamp:new Date().toISOString(),page:c};this.sanitizeEventData(d)&&(this.validateEvent(d),this.batchConfig.enabled?(this.backlog.push(d),this.scheduleFlush()):await this.sendEvents([d]),u===this.EVENT_PAGE_VIEW?this.onPageView?.(c):this.onEvent?.(d,c))}async trackPageView(){if(typeof window>"u")return;const l=this.getPageUrl();if(!this.trackUrlParamChanges){const u=this.getPageKeyWithoutQuery(l);if(this.lastTrackedPageKey===u)return;this.lastTrackedPageKey=u}await this.track({eventKey:this.EVENT_PAGE_VIEW,data:{title:document.title}})}getPageUrl(){if(this.getPage)return this.getPage();const l=window.location.href;return window.location.protocol==="file:"?`/${window.location.pathname.split("/").pop()||""}${window.location.hash}`:l}getPageKeyWithoutQuery(l){try{const u=new URL(l);return`${u.origin}${u.pathname}${u.hash}`}catch{const[u]=l.split("?");return u}}async flush(){return this.flushEvents()}destroy(){this.originalHistoryMethods&&(history.pushState=this.originalHistoryMethods.pushState,history.replaceState=this.originalHistoryMethods.replaceState,this.originalHistoryMethods=null),typeof window<"u"&&(window.removeEventListener("popstate",this.handlePopState),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.flushEvents),window.removeEventListener("pagehide",this.flushEvents)),this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null)}sanitizeEventData(l){if(l.eventKey===this.EVENT_PAGE_VIEW||!l.data)return!0;const u=l.data;for(const o of Object.keys(u)){const c=u[o];if(typeof c=="string"&&c==="[object Object]")return this.logger.error(`Property ${o} contains [object Object], dropping event ${l.eventKey}`),!1;const d=typeof c;if(d!=="boolean"&&d!=="number"&&d!=="string"){this.logger.warn(`Property ${o} has unsupported type ${d}, removing from event ${l.eventKey}`),delete u[o];continue}typeof c=="string"&&(u[o]=c.toLowerCase())}return!0}validateEvent(l){if(l.eventKey===this.EVENT_PAGE_VIEW)return;const u=this.eventDefinitions.find(d=>d.eventKey===l.eventKey);if(!u){this.logger.warn(`Event ${l.eventKey} is not registered`);return}const o=u.properties,c=l.data;if(c)for(const d of Object.keys(c)){const g=c[d],y=o.find(m=>m.name===d);if(!y){this.logger.warn(`Property ${d} is not registered for event ${l.eventKey}`);continue}typeof g!==y.type&&this.logger.warn(`Property ${y.name} has type ${y.type} but value is of type ${typeof g}`)}}async handlePopState(){await this.trackPageView()}async handleVisibilityChange(){document.visibilityState==="visible"&&await this.trackPageView()}scheduleFlush(){if(this.backlog.length>=this.batchConfig.size){this.flushEvents();return}this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>{this.flushEvents()},this.batchConfig.delayMs))}async flushEvents(){if(this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.backlog.length===0)return;const l=[...this.backlog];this.backlog=[];try{await this.sendEvents(l)}catch(u){this.backlog.unshift(...l),this.logger.error("Failed to send batched events",u)}}async sendEvents(l){if(l.length!==0)if(l.length===1){const u=l[0];await Gt.post("/external/trackings/track",u,{headers:this.headers})}else await Gt.post("/external/trackings/batch",l,{headers:this.headers})}}class Kl{clientKey;_userIdentifier;_initialized=!1;_lastInitError=null;clientLogger=co.child("client");headers={};formConfig;get userIdentifier(){return this._userIdentifier}get initialized(){return this._initialized}get lastInitError(){return this._lastInitError}constructor(l){this.clientKey=l}trackingManager;async init({userIdentifier:l,secretKey:u,debug:o=!1,batch:c,formConfig:d,deactivate:g=!1,trackUrlParamChanges:y,getPage:m}){if(this._initialized=!1,this._lastInitError=null,this.trackingManager?.destroy(),this.trackingManager=void 0,g)return this.clientLogger.info("Nemme client deactivated and will stop initialization."),this._initialized=!0,this._lastInitError=null,this.clientLogger.configure({enabled:!1}),this;if(!l)throw new Error("userIdentifier is required parameter");this._userIdentifier=l,this.clientLogger.configure({enabled:o,level:o?"debug":"info"}),this.headers={"X-Client-Key":this.clientKey,"X-User-Id":this._userIdentifier,...u&&{"X-Client-Secret":u}},this.formConfig=d;try{const p=await this.initializeSession();await this.initializeManagers(p,c,y,m),this._initialized=!0,this._lastInitError=null,this.clientLogger.info("Nemme client initialized",{clientKey:this.clientKey,userIdentifier:this._userIdentifier})}catch(p){this.clientLogger.error("Error during initialization:",p),this._initialized=!1,this._lastInitError=p instanceof Error?p:new Error("Error during initialization")}return this}async flush(){return this.trackingManager?.flush()}destroy(){this.trackingManager?.destroy()}async track(l){if(!this._initialized||!this.trackingManager){this.clientLogger.warn("Nemme client not initialized, some operations may fail");return}return this.trackingManager.track(l)}async initializeSession(){try{const l=await Gt.post("/external/trackings/initialize",{},{headers:this.headers});if(!l.ok)throw new Error(l.error?.message||"Request for initialising session failed");return l.data}catch(l){throw this.clientLogger.error("Error during initialization",l),l}}async initializeManagers(l,u,o,c){const d=new Up(this.clientLogger,this.headers,this.formConfig),g=new Bp({logger:this.clientLogger,headers:this.headers,sessionId:l.sessionId,eventDefinitions:l.eventDefinitions,batchConfig:u,trackUrlParamChanges:o,getPage:c,onPageView:async y=>{await d.evaluateDeliveryTriggers({url:y})},onEvent:async(y,m)=>{await d.evaluateDeliveryTriggers({eventKey:y.eventKey,eventData:y.data,url:m})}});await d.loadDeliveries(),typeof window<"u"&&(await g.setupPageViewTracking(),await g.trackPageView(),await g.flush()),this.trackingManager=g}}const go=s=>new Kl(s);let po={};function Hp(){return po}function qp(s){po=s}const Vp={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Gp=(s,l,u)=>{let o;const c=Vp[s];return typeof c=="string"?o=c:l===1?o=c.one:o=c.other.replace("{{count}}",l.toString()),u?.addSuffix?u.comparison&&u.comparison>0?"in "+o:o+" ago":o};function Ar(s){return(l={})=>{const u=l.width?String(l.width):s.defaultWidth;return s.formats[u]||s.formats[s.defaultWidth]}}const Fp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yp=(s,l,u,o)=>Fp[s];function Zn(s){return(l,u)=>{const o=u?.context?String(u.context):"standalone";let c;if(o==="formatting"&&s.formattingValues){const g=s.defaultFormattingWidth||s.defaultWidth,y=u?.width?String(u.width):g;c=s.formattingValues[y]||s.formattingValues[g]}else{const g=s.defaultWidth,y=u?.width?String(u.width):s.defaultWidth;c=s.values[y]||s.values[g]}const d=s.argumentCallback?s.argumentCallback(l):l;return c[d]}}const Zp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xp={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Qp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$p={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Wp={ordinalNumber:(s,l)=>{const u=Number(s),o=u%100;if(o>20||o<10)switch(o%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},era:Zn({values:Zp,defaultWidth:"wide"}),quarter:Zn({values:Xp,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Zn({values:Kp,defaultWidth:"wide"}),day:Zn({values:Qp,defaultWidth:"wide"}),dayPeriod:Zn({values:$p,defaultWidth:"wide",formattingValues:Jp,defaultFormattingWidth:"wide"})};function Xn(s){return(l,u={})=>{const o=u.width,c=o&&s.matchPatterns[o]||s.matchPatterns[s.defaultMatchWidth],d=l.match(c);if(!d)return null;const g=d[0],y=o&&s.parsePatterns[o]||s.parsePatterns[s.defaultParseWidth],m=Array.isArray(y)?Pp(y,b=>b.test(g)):Ip(y,b=>b.test(g));let p;p=s.valueCallback?s.valueCallback(m):m,p=u.valueCallback?u.valueCallback(p):p;const v=l.slice(g.length);return{value:p,rest:v}}}function Ip(s,l){for(const u in s)if(Object.prototype.hasOwnProperty.call(s,u)&&l(s[u]))return u}function Pp(s,l){for(let u=0;u<s.length;u++)if(l(s[u]))return u}function eh(s){return(l,u={})=>{const o=l.match(s.matchPattern);if(!o)return null;const c=o[0],d=l.match(s.parsePattern);if(!d)return null;let g=s.valueCallback?s.valueCallback(d[0]):d[0];g=u.valueCallback?u.valueCallback(g):g;const y=l.slice(c.length);return{value:g,rest:y}}}const th=/^(\d+)(th|st|nd|rd)?/i,ah=/\d+/i,nh={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},lh={any:[/^b/i,/^(a|c)/i]},ih={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rh={any:[/1/i,/2/i,/3/i,/4/i]},uh={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sh={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oh={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ch={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fh={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dh={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gh={ordinalNumber:eh({matchPattern:th,parsePattern:ah,valueCallback:s=>parseInt(s,10)}),era:Xn({matchPatterns:nh,defaultMatchWidth:"wide",parsePatterns:lh,defaultParseWidth:"any"}),quarter:Xn({matchPatterns:ih,defaultMatchWidth:"wide",parsePatterns:rh,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Xn({matchPatterns:uh,defaultMatchWidth:"wide",parsePatterns:sh,defaultParseWidth:"any"}),day:Xn({matchPatterns:oh,defaultMatchWidth:"wide",parsePatterns:ch,defaultParseWidth:"any"}),dayPeriod:Xn({matchPatterns:fh,defaultMatchWidth:"any",parsePatterns:dh,defaultParseWidth:"any"})};function ph(s){const l={},u=Hp();for(const o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o]);for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(s[o]===void 0?delete l[o]:l[o]=s[o]);qp(l)}const hh={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},yh={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},mh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bh={date:Ar({formats:hh,defaultWidth:"full"}),time:Ar({formats:yh,defaultWidth:"full"}),dateTime:Ar({formats:mh,defaultWidth:"full"})},vh={code:"en-GB",formatDistance:Gp,formatLong:bh,formatRelative:Yp,localize:Wp,match:gh,options:{weekStartsOn:1,firstWeekContainsDate:4}},le=s=>typeof s=="string",Kn=()=>{let s,l;const u=new Promise((o,c)=>{s=o,l=c});return u.resolve=s,u.reject=l,u},ho=s=>s==null?"":""+s,Sh=(s,l,u)=>{s.forEach(o=>{l[o]&&(u[o]=l[o])})},xh=/###/g,yo=s=>s&&s.indexOf("###")>-1?s.replace(xh,"."):s,mo=s=>!s||le(s),Qn=(s,l,u)=>{const o=le(l)?l.split("."):l;let c=0;for(;c<o.length-1;){if(mo(s))return{};const d=yo(o[c]);!s[d]&&u&&(s[d]=new u),Object.prototype.hasOwnProperty.call(s,d)?s=s[d]:s={},++c}return mo(s)?{}:{obj:s,k:yo(o[c])}},bo=(s,l,u)=>{const{obj:o,k:c}=Qn(s,l,Object);if(o!==void 0||l.length===1){o[c]=u;return}let d=l[l.length-1],g=l.slice(0,l.length-1),y=Qn(s,g,Object);for(;y.obj===void 0&&g.length;)d=`${g[g.length-1]}.${d}`,g=g.slice(0,g.length-1),y=Qn(s,g,Object),y?.obj&&typeof y.obj[`${y.k}.${d}`]<"u"&&(y.obj=void 0);y.obj[`${y.k}.${d}`]=u},Eh=(s,l,u,o)=>{const{obj:c,k:d}=Qn(s,l,Object);c[d]=c[d]||[],c[d].push(u)},Ql=(s,l)=>{const{obj:u,k:o}=Qn(s,l);if(u&&Object.prototype.hasOwnProperty.call(u,o))return u[o]},Ah=(s,l,u)=>{const o=Ql(s,u);return o!==void 0?o:Ql(l,u)},vo=(s,l,u)=>{for(const o in l)o!=="__proto__"&&o!=="constructor"&&(o in s?le(s[o])||s[o]instanceof String||le(l[o])||l[o]instanceof String?u&&(s[o]=l[o]):vo(s[o],l[o],u):s[o]=l[o]);return s},La=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Th={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Oh=s=>le(s)?s.replace(/[&<>"'\/]/g,l=>Th[l]):s;class wh{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const u=this.regExpMap.get(l);if(u!==void 0)return u;const o=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,o),this.regExpQueue.push(l),o}}const _h=[" ",",","?","!",";"],zh=new wh(20),Nh=(s,l,u)=>{l=l||"",u=u||"";const o=_h.filter(g=>l.indexOf(g)<0&&u.indexOf(g)<0);if(o.length===0)return!0;const c=zh.getRegExp(`(${o.map(g=>g==="?"?"\\?":g).join("|")})`);let d=!c.test(s);if(!d){const g=s.indexOf(u);g>0&&!c.test(s.substring(0,g))&&(d=!0)}return d},Tr=(s,l,u=".")=>{if(!s)return;if(s[l])return Object.prototype.hasOwnProperty.call(s,l)?s[l]:void 0;const o=l.split(u);let c=s;for(let d=0;d<o.length;){if(!c||typeof c!="object")return;let g,y="";for(let m=d;m<o.length;++m)if(m!==d&&(y+=u),y+=o[m],g=c[y],g!==void 0){if(["string","number","boolean"].indexOf(typeof g)>-1&&m<o.length-1)continue;d+=m-d+1;break}c=g}return c},$n=s=>s?.replace("_","-"),Dh={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,l){console?.[s]?.apply?.(console,l)}};class $l{constructor(l,u={}){this.init(l,u)}init(l,u={}){this.prefix=u.prefix||"i18next:",this.logger=l||Dh,this.options=u,this.debug=u.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,u,o,c){return c&&!this.debug?null:(le(l[0])&&(l[0]=`${o}${this.prefix} ${l[0]}`),this.logger[u](l))}create(l){return new $l(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new $l(this.logger,l)}}var jt=new $l;class Jl{constructor(){this.observers={}}on(l,u){return l.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const c=this.observers[o].get(u)||0;this.observers[o].set(u,c+1)}),this}off(l,u){if(this.observers[l]){if(!u){delete this.observers[l];return}this.observers[l].delete(u)}}emit(l,...u){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([c,d])=>{for(let g=0;g<d;g++)c(...u)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,d])=>{for(let g=0;g<d;g++)c.apply(c,[l,...u])})}}class So extends Jl{constructor(l,u={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=u,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const u=this.options.ns.indexOf(l);u>-1&&this.options.ns.splice(u,1)}getResource(l,u,o,c={}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,g=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let y;l.indexOf(".")>-1?y=l.split("."):(y=[l,u],o&&(Array.isArray(o)?y.push(...o):le(o)&&d?y.push(...o.split(d)):y.push(o)));const m=Ql(this.data,y);return!m&&!u&&!o&&l.indexOf(".")>-1&&(l=y[0],u=y[1],o=y.slice(2).join(".")),m||!g||!le(o)?m:Tr(this.data?.[l]?.[u],o,d)}addResource(l,u,o,c,d={silent:!1}){const g=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let y=[l,u];o&&(y=y.concat(g?o.split(g):o)),l.indexOf(".")>-1&&(y=l.split("."),c=u,u=y[1]),this.addNamespaces(u),bo(this.data,y,c),d.silent||this.emit("added",l,u,o,c)}addResources(l,u,o,c={silent:!1}){for(const d in o)(le(o[d])||Array.isArray(o[d]))&&this.addResource(l,u,d,o[d],{silent:!0});c.silent||this.emit("added",l,u,o)}addResourceBundle(l,u,o,c,d,g={silent:!1,skipCopy:!1}){let y=[l,u];l.indexOf(".")>-1&&(y=l.split("."),c=o,o=u,u=y[1]),this.addNamespaces(u);let m=Ql(this.data,y)||{};g.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?vo(m,o,d):m={...m,...o},bo(this.data,y,m),g.silent||this.emit("added",l,u,o)}removeResourceBundle(l,u){this.hasResourceBundle(l,u)&&delete this.data[l][u],this.removeNamespaces(u),this.emit("removed",l,u)}hasResourceBundle(l,u){return this.getResource(l,u)!==void 0}getResourceBundle(l,u){return u||(u=this.options.defaultNS),this.getResource(l,u)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const u=this.getDataByLanguage(l);return!!(u&&Object.keys(u)||[]).find(c=>u[c]&&Object.keys(u[c]).length>0)}toJSON(){return this.data}}var xo={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,l,u,o,c){return s.forEach(d=>{l=this.processors[d]?.process(l,u,o,c)??l}),l}};const Eo=Symbol("i18next/PATH_KEY");function Ch(){const s=[],l=Object.create(null);let u;return l.get=(o,c)=>(u?.revoke?.(),c===Eo?s:(s.push(c),u=Proxy.revocable(o,l),u.proxy)),Proxy.revocable(Object.create(null),l).proxy}function Or(s,l){const{[Eo]:u}=s(Ch());return u.join(l?.keySeparator??".")}const Ao={},wr=s=>!le(s)&&typeof s!="boolean"&&typeof s!="number";class Wl extends Jl{constructor(l,u={}){super(),Sh(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=u,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=jt.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,u={interpolation:{}}){const o={...u};if(l==null)return!1;const c=this.resolve(l,o);if(c?.res===void 0)return!1;const d=wr(c.res);return!(o.returnObjects===!1&&d)}extractFromKey(l,u){let o=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=u.ns||this.options.defaultNS||[];const g=o&&l.indexOf(o)>-1,y=!this.options.userDefinedKeySeparator&&!u.keySeparator&&!this.options.userDefinedNsSeparator&&!u.nsSeparator&&!Nh(l,o,c);if(g&&!y){const m=l.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:l,namespaces:le(d)?[d]:d};const p=l.split(o);(o!==c||o===c&&this.options.ns.indexOf(p[0])>-1)&&(d=p.shift()),l=p.join(c)}return{key:l,namespaces:le(d)?[d]:d}}translate(l,u,o){let c=typeof u=="object"?{...u}:u;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),l==null)return"";typeof l=="function"&&(l=Or(l,{...this.options,...c})),Array.isArray(l)||(l=[String(l)]);const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,g=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:y,namespaces:m}=this.extractFromKey(l[l.length-1],c),p=m[m.length-1];let v=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=c.lng||this.language,w=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return w?d?{res:`${p}${v}${y}`,usedKey:y,exactUsedKey:y,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:`${p}${v}${y}`:d?{res:y,usedKey:y,exactUsedKey:y,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:y;const L=this.resolve(l,c);let x=L?.res;const T=L?.usedKey||y,C=L?.exactUsedKey||y,V=["[object Number]","[object Function]","[object RegExp]"],U=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,X=c.count!==void 0&&!le(c.count),I=Wl.hasDefaultValue(c),ae=X?this.pluralResolver.getSuffix(b,c.count,c):"",Q=c.ordinal&&X?this.pluralResolver.getSuffix(b,c.count,{ordinal:!1}):"",pe=X&&!c.ordinal&&c.count===0,P=pe&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${ae}`]||c[`defaultValue${Q}`]||c.defaultValue;let ne=x;G&&!x&&I&&(ne=P);const se=wr(ne),ie=Object.prototype.toString.apply(ne);if(G&&ne&&se&&V.indexOf(ie)<0&&!(le(U)&&Array.isArray(ne))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,ne,{...c,ns:m}):`key '${y} (${this.language})' returned an object instead of string.`;return d?(L.res=Re,L.usedParams=this.getUsedParamsDetails(c),L):Re}if(g){const Re=Array.isArray(ne),ce=Re?[]:{},De=Re?C:T;for(const R in ne)if(Object.prototype.hasOwnProperty.call(ne,R)){const F=`${De}${g}${R}`;I&&!x?ce[R]=this.translate(F,{...c,defaultValue:wr(P)?P[R]:void 0,joinArrays:!1,ns:m}):ce[R]=this.translate(F,{...c,joinArrays:!1,ns:m}),ce[R]===F&&(ce[R]=ne[R])}x=ce}}else if(G&&le(U)&&Array.isArray(x))x=x.join(U),x&&(x=this.extendTranslation(x,l,c,o));else{let Re=!1,ce=!1;!this.isValidLookup(x)&&I&&(Re=!0,x=P),this.isValidLookup(x)||(ce=!0,x=y);const R=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:x,F=I&&P!==x&&this.options.updateMissing;if(ce||Re||F){if(this.logger.log(F?"updateKey":"missingKey",b,p,y,F?P:x),g){const E=this.resolve(y,{...c,keySeparator:!1});E&&E.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let $=[];const ve=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ve&&ve[0])for(let E=0;E<ve.length;E++)$.push(ve[E]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(c.lng||this.language):$.push(c.lng||this.language);const ge=(E,j,Y)=>{const K=I&&Y!==x?Y:R;this.options.missingKeyHandler?this.options.missingKeyHandler(E,p,j,K,F,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(E,p,j,K,F,c),this.emit("missingKey",E,p,j,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?$.forEach(E=>{const j=this.pluralResolver.getSuffixes(E,c);pe&&c[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(Y=>{ge([E],y+Y,c[`defaultValue${Y}`]||P)})}):ge($,y,P))}x=this.extendTranslation(x,l,c,L,o),ce&&x===y&&this.options.appendNamespaceToMissingKey&&(x=`${p}${v}${y}`),(ce||Re)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${v}${y}`:y,Re?x:void 0,c))}return d?(L.res=x,L.usedParams=this.getUsedParamsDetails(c),L):x}extendTranslation(l,u,o,c,d){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const m=le(l)&&(o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(m){const b=l.match(this.interpolator.nestingRegexp);p=b&&b.length}let v=o.replace&&!le(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,o.lng||this.language||c.usedLng,o),m){const b=l.match(this.interpolator.nestingRegexp),w=b&&b.length;p<w&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(l=this.interpolator.nest(l,(...b)=>d?.[0]===b[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${u[0]}`),null):this.translate(...b,u),o)),o.interpolation&&this.interpolator.reset()}const g=o.postProcess||this.options.postProcess,y=le(g)?[g]:g;return l!=null&&y?.length&&o.applyPostProcessor!==!1&&(l=xo.handle(y,l,u,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),l}resolve(l,u={}){let o,c,d,g,y;return le(l)&&(l=[l]),l.forEach(m=>{if(this.isValidLookup(o))return;const p=this.extractFromKey(m,u),v=p.key;c=v;let b=p.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const w=u.count!==void 0&&!le(u.count),L=w&&!u.ordinal&&u.count===0,x=u.context!==void 0&&(le(u.context)||typeof u.context=="number")&&u.context!=="",T=u.lngs?u.lngs:this.languageUtils.toResolveHierarchy(u.lng||this.language,u.fallbackLng);b.forEach(C=>{this.isValidLookup(o)||(y=C,!Ao[`${T[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(y)&&(Ao[`${T[0]}-${C}`]=!0,this.logger.warn(`key "${c}" for languages "${T.join(", ")}" won't get resolved as namespace "${y}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(V=>{if(this.isValidLookup(o))return;g=V;const U=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(U,v,V,C,u);else{let X;w&&(X=this.pluralResolver.getSuffix(V,u.count,u));const I=`${this.options.pluralSeparator}zero`,ae=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(u.ordinal&&X.indexOf(ae)===0&&U.push(v+X.replace(ae,this.options.pluralSeparator)),U.push(v+X),L&&U.push(v+I)),x){const Q=`${v}${this.options.contextSeparator||"_"}${u.context}`;U.push(Q),w&&(u.ordinal&&X.indexOf(ae)===0&&U.push(Q+X.replace(ae,this.options.pluralSeparator)),U.push(Q+X),L&&U.push(Q+I))}}let G;for(;G=U.pop();)this.isValidLookup(o)||(d=G,o=this.getResource(V,C,G,u))}))})}),{res:o,usedKey:c,exactUsedKey:d,usedLng:g,usedNS:y}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,u,o,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,u,o,c):this.resourceStore.getResource(l,u,o,c)}getUsedParamsDetails(l={}){const u=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=l.replace&&!le(l.replace);let c=o?l.replace:l;if(o&&typeof l.count<"u"&&(c.count=l.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!o){c={...c};for(const d of u)delete c[d]}return c}static hasDefaultValue(l){const u="defaultValue";for(const o in l)if(Object.prototype.hasOwnProperty.call(l,o)&&u===o.substring(0,u.length)&&l[o]!==void 0)return!0;return!1}}class To{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=jt.create("languageUtils")}getScriptPartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return null;const u=l.split("-");return u.length===2||(u.pop(),u[u.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(u.join("-"))}getLanguagePartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return l;const u=l.split("-");return this.formatLanguageCode(u[0])}formatLanguageCode(l){if(le(l)&&l.indexOf("-")>-1){let u;try{u=Intl.getCanonicalLocales(l)[0]}catch{}return u&&this.options.lowerCaseLng&&(u=u.toLowerCase()),u||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let u;return l.forEach(o=>{if(u)return;const c=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(c))&&(u=c)}),!u&&this.options.supportedLngs&&l.forEach(o=>{if(u)return;const c=this.getScriptPartFromCode(o);if(this.isSupportedCode(c))return u=c;const d=this.getLanguagePartFromCode(o);if(this.isSupportedCode(d))return u=d;u=this.options.supportedLngs.find(g=>{if(g===d)return g;if(!(g.indexOf("-")<0&&d.indexOf("-")<0)&&(g.indexOf("-")>0&&d.indexOf("-")<0&&g.substring(0,g.indexOf("-"))===d||g.indexOf(d)===0&&d.length>1))return g})}),u||(u=this.getFallbackCodes(this.options.fallbackLng)[0]),u}getFallbackCodes(l,u){if(!l)return[];if(typeof l=="function"&&(l=l(u)),le(l)&&(l=[l]),Array.isArray(l))return l;if(!u)return l.default||[];let o=l[u];return o||(o=l[this.getScriptPartFromCode(u)]),o||(o=l[this.formatLanguageCode(u)]),o||(o=l[this.getLanguagePartFromCode(u)]),o||(o=l.default),o||[]}toResolveHierarchy(l,u){const o=this.getFallbackCodes((u===!1?[]:u)||this.options.fallbackLng||[],l),c=[],d=g=>{g&&(this.isSupportedCode(g)?c.push(g):this.logger.warn(`rejecting language code not found in supportedLngs: ${g}`))};return le(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(l))):le(l)&&d(this.formatLanguageCode(l)),o.forEach(g=>{c.indexOf(g)<0&&d(this.formatLanguageCode(g))}),c}}const Oo={zero:0,one:1,two:2,few:3,many:4,other:5},wo={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Rh{constructor(l,u={}){this.languageUtils=l,this.options=u,this.logger=jt.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,u={}){const o=$n(l==="dev"?"en":l),c=u.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:o,type:c});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let g;try{g=new Intl.PluralRules(o,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),wo;if(!l.match(/-|_/))return wo;const m=this.languageUtils.getLanguagePartFromCode(l);g=this.getRule(m,u)}return this.pluralRulesCache[d]=g,g}needsPlural(l,u={}){let o=this.getRule(l,u);return o||(o=this.getRule("dev",u)),o?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,u,o={}){return this.getSuffixes(l,o).map(c=>`${u}${c}`)}getSuffixes(l,u={}){let o=this.getRule(l,u);return o||(o=this.getRule("dev",u)),o?o.resolvedOptions().pluralCategories.sort((c,d)=>Oo[c]-Oo[d]).map(c=>`${this.options.prepend}${u.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(l,u,o={}){const c=this.getRule(l,o);return c?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c.select(u)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",u,o))}}const _o=(s,l,u,o=".",c=!0)=>{let d=Ah(s,l,u);return!d&&c&&le(u)&&(d=Tr(s,u,o),d===void 0&&(d=Tr(l,u,o))),d},_r=s=>s.replace(/\$/g,"$$$$");class zo{constructor(l={}){this.logger=jt.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(u=>u),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:u,escapeValue:o,useRawValueToEscape:c,prefix:d,prefixEscaped:g,suffix:y,suffixEscaped:m,formatSeparator:p,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:w,nestingPrefixEscaped:L,nestingSuffix:x,nestingSuffixEscaped:T,nestingOptionsSeparator:C,maxReplaces:V,alwaysFormat:U}=l.interpolation;this.escape=u!==void 0?u:Oh,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?La(d):g||"{{",this.suffix=y?La(y):m||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=w?La(w):L||La("$t("),this.nestingSuffix=x?La(x):T||La(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=V||1e3,this.alwaysFormat=U!==void 0?U:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(u,o)=>u?.source===o?(u.lastIndex=0,u):new RegExp(o,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,u,o,c){let d,g,y;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=L=>{if(L.indexOf(this.formatSeparator)<0){const V=_o(u,m,L,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(V,void 0,o,{...c,...u,interpolationkey:L}):V}const x=L.split(this.formatSeparator),T=x.shift().trim(),C=x.join(this.formatSeparator).trim();return this.format(_o(u,m,T,this.options.keySeparator,this.options.ignoreJSONStructure),C,o,{...c,...u,interpolationkey:T})};this.resetRegExp();const v=c?.missingInterpolationHandler||this.options.missingInterpolationHandler,b=c?.interpolation?.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:L=>_r(L)},{regex:this.regexp,safeValue:L=>this.escapeValue?_r(this.escape(L)):_r(L)}].forEach(L=>{for(y=0;d=L.regex.exec(l);){const x=d[1].trim();if(g=p(x),g===void 0)if(typeof v=="function"){const C=v(l,d,c);g=le(C)?C:""}else if(c&&Object.prototype.hasOwnProperty.call(c,x))g="";else if(b){g=d[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${l}`),g="";else!le(g)&&!this.useRawValueToEscape&&(g=ho(g));const T=L.safeValue(g);if(l=l.replace(d[0],T),b?(L.regex.lastIndex+=g.length,L.regex.lastIndex-=d[0].length):L.regex.lastIndex=0,y++,y>=this.maxReplaces)break}}),l}nest(l,u,o={}){let c,d,g;const y=(m,p)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const b=m.split(new RegExp(`${La(v)}[ ]*{`));let w=`{${b[1]}`;m=b[0],w=this.interpolate(w,g);const L=w.match(/'/g),x=w.match(/"/g);((L?.length??0)%2===0&&!x||(x?.length??0)%2!==0)&&(w=w.replace(/'/g,'"'));try{g=JSON.parse(w),p&&(g={...p,...g})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,T),`${m}${v}${w}`}return g.defaultValue&&g.defaultValue.indexOf(this.prefix)>-1&&delete g.defaultValue,m};for(;c=this.nestingRegexp.exec(l);){let m=[];g={...o},g=g.replace&&!le(g.replace)?g.replace:g,g.applyPostProcessor=!1,delete g.defaultValue;const p=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(p!==-1&&(m=c[1].slice(p).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),c[1]=c[1].slice(0,p)),d=u(y.call(this,c[1].trim(),g),g),d&&c[0]===l&&!le(d))return d;le(d)||(d=ho(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${l}`),d=""),m.length&&(d=m.reduce((v,b)=>this.format(v,b,o.lng,{...o,interpolationkey:c[1].trim()}),d.trim())),l=l.replace(c[0],d),this.regexp.lastIndex=0}return l}}const Mh=s=>{let l=s.toLowerCase().trim();const u={};if(s.indexOf("(")>-1){const o=s.split("(");l=o[0].toLowerCase().trim();const c=o[1].substring(0,o[1].length-1);l==="currency"&&c.indexOf(":")<0?u.currency||(u.currency=c.trim()):l==="relativetime"&&c.indexOf(":")<0?u.range||(u.range=c.trim()):c.split(";").forEach(g=>{if(g){const[y,...m]=g.split(":"),p=m.join(":").trim().replace(/^'+|'+$/g,""),v=y.trim();u[v]||(u[v]=p),p==="false"&&(u[v]=!1),p==="true"&&(u[v]=!0),isNaN(p)||(u[v]=parseInt(p,10))}})}return{formatName:l,formatOptions:u}},No=s=>{const l={};return(u,o,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const g=o+JSON.stringify(d);let y=l[g];return y||(y=s($n(o),c),l[g]=y),y(u)}},Lh=s=>(l,u,o)=>s($n(u),o)(l);class kh{constructor(l={}){this.logger=jt.create("formatter"),this.options=l,this.init(l)}init(l,u={interpolation:{}}){this.formatSeparator=u.interpolation.formatSeparator||",";const o=u.cacheInBuiltFormats?No:Lh;this.formats={number:o((c,d)=>{const g=new Intl.NumberFormat(c,{...d});return y=>g.format(y)}),currency:o((c,d)=>{const g=new Intl.NumberFormat(c,{...d,style:"currency"});return y=>g.format(y)}),datetime:o((c,d)=>{const g=new Intl.DateTimeFormat(c,{...d});return y=>g.format(y)}),relativetime:o((c,d)=>{const g=new Intl.RelativeTimeFormat(c,{...d});return y=>g.format(y,d.range||"day")}),list:o((c,d)=>{const g=new Intl.ListFormat(c,{...d});return y=>g.format(y)})}}add(l,u){this.formats[l.toLowerCase().trim()]=u}addCached(l,u){this.formats[l.toLowerCase().trim()]=No(u)}format(l,u,o,c={}){const d=u.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(y=>y.indexOf(")")>-1)){const y=d.findIndex(m=>m.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,y)].join(this.formatSeparator)}return d.reduce((y,m)=>{const{formatName:p,formatOptions:v}=Mh(m);if(this.formats[p]){let b=y;try{const w=c?.formatParams?.[c.interpolationkey]||{},L=w.locale||w.lng||c.locale||c.lng||o;b=this.formats[p](y,L,{...v,...c,...w})}catch(w){this.logger.warn(w)}return b}else this.logger.warn(`there was no format function for ${p}`);return y},l)}}const jh=(s,l)=>{s.pending[l]!==void 0&&(delete s.pending[l],s.pendingCount--)};class Uh extends Jl{constructor(l,u,o,c={}){super(),this.backend=l,this.store=u,this.services=o,this.languageUtils=o.languageUtils,this.options=c,this.logger=jt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(o,c.backend,c)}queueLoad(l,u,o,c){const d={},g={},y={},m={};return l.forEach(p=>{let v=!0;u.forEach(b=>{const w=`${p}|${b}`;!o.reload&&this.store.hasResourceBundle(p,b)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?g[w]===void 0&&(g[w]=!0):(this.state[w]=1,v=!1,g[w]===void 0&&(g[w]=!0),d[w]===void 0&&(d[w]=!0),m[b]===void 0&&(m[b]=!0)))}),v||(y[p]=!0)}),(Object.keys(d).length||Object.keys(g).length)&&this.queue.push({pending:g,pendingCount:Object.keys(g).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(d),pending:Object.keys(g),toLoadLanguages:Object.keys(y),toLoadNamespaces:Object.keys(m)}}loaded(l,u,o){const c=l.split("|"),d=c[0],g=c[1];u&&this.emit("failedLoading",d,g,u),!u&&o&&this.store.addResourceBundle(d,g,o,void 0,void 0,{skipCopy:!0}),this.state[l]=u?-1:2,u&&o&&(this.state[l]=0);const y={};this.queue.forEach(m=>{Eh(m.loaded,[d],g),jh(m,l),u&&m.errors.push(u),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(p=>{y[p]||(y[p]={});const v=m.loaded[p];v.length&&v.forEach(b=>{y[p][b]===void 0&&(y[p][b]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",y),this.queue=this.queue.filter(m=>!m.done)}read(l,u,o,c=0,d=this.retryTimeout,g){if(!l.length)return g(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:u,fcName:o,tried:c,wait:d,callback:g});return}this.readingCalls++;const y=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(p&&v&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,l,u,o,c+1,d*2,g)},d);return}g(p,v)},m=this.backend[o].bind(this.backend);if(m.length===2){try{const p=m(l,u);p&&typeof p.then=="function"?p.then(v=>y(null,v)).catch(y):y(null,p)}catch(p){y(p)}return}return m(l,u,y)}prepareLoading(l,u,o={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();le(l)&&(l=this.languageUtils.toResolveHierarchy(l)),le(u)&&(u=[u]);const d=this.queueLoad(l,u,o,c);if(!d.toLoad.length)return d.pending.length||c(),null;d.toLoad.forEach(g=>{this.loadOne(g)})}load(l,u,o){this.prepareLoading(l,u,{},o)}reload(l,u,o){this.prepareLoading(l,u,{reload:!0},o)}loadOne(l,u=""){const o=l.split("|"),c=o[0],d=o[1];this.read(c,d,"read",void 0,void 0,(g,y)=>{g&&this.logger.warn(`${u}loading namespace ${d} for language ${c} failed`,g),!g&&y&&this.logger.log(`${u}loaded namespace ${d} for language ${c}`,y),this.loaded(l,g,y)})}saveMissing(l,u,o,c,d,g={},y=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(u)){this.logger.warn(`did not save key "${o}" as the namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend?.create){const m={...g,isUpdate:d},p=this.backend.create.bind(this.backend);if(p.length<6)try{let v;p.length===5?v=p(l,u,o,c,m):v=p(l,u,o,c),v&&typeof v.then=="function"?v.then(b=>y(null,b)).catch(y):y(null,v)}catch(v){y(v)}else p(l,u,o,c,y,m)}!l||!l[0]||this.store.addResource(l[0],u,o,c)}}}const zr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let l={};if(typeof s[1]=="object"&&(l=s[1]),le(s[1])&&(l.defaultValue=s[1]),le(s[2])&&(l.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const u=s[3]||s[2];Object.keys(u).forEach(o=>{l[o]=u[o]})}return l},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Do=s=>(le(s.ns)&&(s.ns=[s.ns]),le(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),le(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs?.indexOf?.("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s),Il=()=>{},Bh=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(u=>{typeof s[u]=="function"&&(s[u]=s[u].bind(s))})};let Co=!1;const Hh=s=>!!(s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0));class Jn extends Jl{constructor(l={},u){if(super(),this.options=Do(l),this.services={},this.logger=jt,this.modules={external:[]},Bh(this),u&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,u),this;setTimeout(()=>{this.init(l,u)},0)}}init(l={},u){this.isInitializing=!0,typeof l=="function"&&(u=l,l={}),l.defaultNS==null&&l.ns&&(le(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const o=zr();this.options={...o,...this.options,...Do(l)},this.options.interpolation={...o.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Hh(this)&&!Co&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),Co=!0);const c=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?jt.init(c(this.modules.logger),this.options):jt.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=kh;const v=new To(this.options);this.store=new So(this.options.resources,this.options);const b=this.services;b.logger=jt,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new Rh(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(b.formatter=c(p),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new zo(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new Uh(c(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(L,...x)=>{this.emit(L,...x)}),this.modules.languageDetector&&(b.languageDetector=c(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=c(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new Wl(this.services,this.options),this.translator.on("*",(L,...x)=>{this.emit(L,...x)}),this.modules.external.forEach(L=>{L.init&&L.init(this)})}if(this.format=this.options.interpolation.format,u||(u=Il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...v)=>this.store[p](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...v)=>(this.store[p](...v),this)});const y=Kn(),m=()=>{const p=(v,b)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),y.resolve(b),u(v,b)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),y}loadResources(l,u=Il){let o=u;const c=le(l)?l:this.language;if(typeof l=="function"&&(o=l),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const d=[],g=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(p=>{p!=="cimode"&&d.indexOf(p)<0&&d.push(p)})};c?g(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>g(m)),this.options.preload?.forEach?.(y=>g(y)),this.services.backendConnector.load(d,this.options.ns,y=>{!y&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(y)})}else o(null)}reloadResources(l,u,o){const c=Kn();return typeof l=="function"&&(o=l,l=void 0),typeof u=="function"&&(o=u,u=void 0),l||(l=this.languages),u||(u=this.options.ns),o||(o=Il),this.services.backendConnector.reload(l,u,d=>{c.resolve(),o(d)}),c}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&xo.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let u=0;u<this.languages.length;u++){const o=this.languages[u];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,u){this.isLanguageChangingTo=l;const o=Kn();this.emit("languageChanging",l);const c=y=>{this.language=y,this.languages=this.services.languageUtils.toResolveHierarchy(y),this.resolvedLanguage=void 0,this.setResolvedLanguage(y)},d=(y,m)=>{m?this.isLanguageChangingTo===l&&(c(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,o.resolve((...p)=>this.t(...p)),u&&u(y,(...p)=>this.t(...p))},g=y=>{!l&&!y&&this.services.languageDetector&&(y=[]);const m=le(y)?y:y&&y[0],p=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(le(y)?[y]:y);p&&(this.language||c(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,v=>{d(v,p)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?g(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(g):this.services.languageDetector.detect(g):g(l),o}getFixedT(l,u,o){const c=(d,g,...y)=>{let m;typeof g!="object"?m=this.options.overloadTranslationOptionHandler([d,g].concat(y)):m={...g},m.lng=m.lng||c.lng,m.lngs=m.lngs||c.lngs,m.ns=m.ns||c.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||o||c.keyPrefix);const p=this.options.keySeparator||".";let v;return m.keyPrefix&&Array.isArray(d)?v=d.map(b=>(typeof b=="function"&&(b=Or(b,{...this.options,...g})),`${m.keyPrefix}${p}${b}`)):(typeof d=="function"&&(d=Or(d,{...this.options,...g})),v=m.keyPrefix?`${m.keyPrefix}${p}${d}`:d),this.t(v,m)};return le(l)?c.lng=l:c.lngs=l,c.ns=u,c.keyPrefix=o,c}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,u={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=u.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const g=(y,m)=>{const p=this.services.backendConnector.state[`${y}|${m}`];return p===-1||p===0||p===2};if(u.precheck){const y=u.precheck(this,g);if(y!==void 0)return y}return!!(this.hasResourceBundle(o,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||g(o,l)&&(!c||g(d,l)))}loadNamespaces(l,u){const o=Kn();return this.options.ns?(le(l)&&(l=[l]),l.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{o.resolve(),u&&u(c)}),o):(u&&u(),Promise.resolve())}loadLanguages(l,u){const o=Kn();le(l)&&(l=[l]);const c=this.options.preload||[],d=l.filter(g=>c.indexOf(g)<0&&this.services.languageUtils.isSupportedCode(g));return d.length?(this.options.preload=c.concat(d),this.loadResources(g=>{o.resolve(),u&&u(g)}),o):(u&&u(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const c=new Intl.Locale(l);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const u=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services?.languageUtils||new To(zr());return l.toLowerCase().indexOf("-latn")>1?"ltr":u.indexOf(o.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},u){const o=new Jn(l,u);return o.createInstance=Jn.createInstance,o}cloneInstance(l={},u=Il){const o=l.forkResourceStore;o&&delete l.forkResourceStore;const c={...this.options,...l,isClone:!0},d=new Jn(c);if((l.debug!==void 0||l.prefix!==void 0)&&(d.logger=d.logger.clone(l)),["store","services","language"].forEach(y=>{d[y]=this[y]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},o){const y=Object.keys(this.store.data).reduce((m,p)=>(m[p]={...this.store.data[p]},m[p]=Object.keys(m[p]).reduce((v,b)=>(v[b]={...m[p][b]},v),m[p]),m),{});d.store=new So(y,c),d.services.resourceStore=d.store}if(l.interpolation){const m={...zr().interpolation,...this.options.interpolation,...l.interpolation},p={...c,interpolation:m};d.services.interpolator=new zo(p)}return d.translator=new Wl(d.services,c),d.translator.on("*",(y,...m)=>{d.emit(y,...m)}),d.init(c,u),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=Jn.createInstance();et.createInstance,et.dir,et.init,et.loadResources,et.reloadResources,et.use,et.changeLanguage,et.getFixedT,et.t,et.exists,et.setDefaultNamespace,et.hasLoadedNamespace,et.loadNamespaces,et.loadLanguages;const{slice:qh,forEach:Vh}=[];function Gh(s){return Vh.call(qh.call(arguments,1),l=>{if(l)for(const u in l)s[u]===void 0&&(s[u]=l[u])}),s}function Fh(s){return typeof s!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(u=>u.test(s))}const Ro=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yh=function(s,l){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},c=encodeURIComponent(l);let d=`${s}=${c}`;if(o.maxAge>0){const g=o.maxAge-0;if(Number.isNaN(g))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(g)}`}if(o.domain){if(!Ro.test(o.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${o.domain}`}if(o.path){if(!Ro.test(o.path))throw new TypeError("option path is invalid");d+=`; Path=${o.path}`}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${o.expires.toUTCString()}`}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d},Mo={create(s,l,u,o){let c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};u&&(c.expires=new Date,c.expires.setTime(c.expires.getTime()+u*60*1e3)),o&&(c.domain=o),document.cookie=Yh(s,l,c)},read(s){const l=`${s}=`,u=document.cookie.split(";");for(let o=0;o<u.length;o++){let c=u[o];for(;c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(l)===0)return c.substring(l.length,c.length)}return null},remove(s,l){this.create(s,"",-1,l)}};var Zh={name:"cookie",lookup(s){let{lookupCookie:l}=s;if(l&&typeof document<"u")return Mo.read(l)||void 0},cacheUserLanguage(s,l){let{lookupCookie:u,cookieMinutes:o,cookieDomain:c,cookieOptions:d}=l;u&&typeof document<"u"&&Mo.create(u,s,o,c,d)}},Xh={name:"querystring",lookup(s){let{lookupQuerystring:l}=s,u;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const d=o.substring(1).split("&");for(let g=0;g<d.length;g++){const y=d[g].indexOf("=");y>0&&d[g].substring(0,y)===l&&(u=d[g].substring(y+1))}}return u}},Kh={name:"hash",lookup(s){let{lookupHash:l,lookupFromHashIndex:u}=s,o;if(typeof window<"u"){const{hash:c}=window.location;if(c&&c.length>2){const d=c.substring(1);if(l){const g=d.split("&");for(let y=0;y<g.length;y++){const m=g[y].indexOf("=");m>0&&g[y].substring(0,m)===l&&(o=g[y].substring(m+1))}}if(o)return o;if(!o&&u>-1){const g=c.match(/\/([a-zA-Z-]*)/g);return Array.isArray(g)?g[typeof u=="number"?u:0]?.replace("/",""):void 0}}}return o}};let nn=null;const Lo=()=>{if(nn!==null)return nn;try{if(nn=typeof window<"u"&&window.localStorage!==null,!nn)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{nn=!1}return nn};var Qh={name:"localStorage",lookup(s){let{lookupLocalStorage:l}=s;if(l&&Lo())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(s,l){let{lookupLocalStorage:u}=l;u&&Lo()&&window.localStorage.setItem(u,s)}};let ln=null;const ko=()=>{if(ln!==null)return ln;try{if(ln=typeof window<"u"&&window.sessionStorage!==null,!ln)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{ln=!1}return ln};var $h={name:"sessionStorage",lookup(s){let{lookupSessionStorage:l}=s;if(l&&ko())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(s,l){let{lookupSessionStorage:u}=l;u&&ko()&&window.sessionStorage.setItem(u,s)}},Jh={name:"navigator",lookup(s){const l=[];if(typeof navigator<"u"){const{languages:u,userLanguage:o,language:c}=navigator;if(u)for(let d=0;d<u.length;d++)l.push(u[d]);o&&l.push(o),c&&l.push(c)}return l.length>0?l:void 0}},Wh={name:"htmlTag",lookup(s){let{htmlTag:l}=s,u;const o=l||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(u=o.getAttribute("lang")),u}},Ih={name:"path",lookup(s){let{lookupFromPathIndex:l}=s;if(typeof window>"u")return;const u=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof l=="number"?l:0]?.replace("/",""):void 0}},Ph={name:"subdomain",lookup(s){let{lookupFromSubdomainIndex:l}=s;const u=typeof l=="number"?l+1:1,o=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(o)return o[u]}};let jo=!1;try{document.cookie,jo=!0}catch{}const Uo=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];jo||Uo.splice(1,1);const ey=()=>({order:Uo,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class Bo{constructor(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,u)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=Gh(u,this.options||{},ey()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=c=>c.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(Zh),this.addDetector(Xh),this.addDetector(Qh),this.addDetector($h),this.addDetector(Jh),this.addDetector(Wh),this.addDetector(Ih),this.addDetector(Ph),this.addDetector(Kh)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,u=[];return l.forEach(o=>{if(this.detectors[o]){let c=this.detectors[o].lookup(this.options);c&&typeof c=="string"&&(c=[c]),c&&(u=u.concat(c))}}),u=u.filter(o=>o!=null&&!Fh(o)).map(o=>this.options.convertDetectedLanguage(o)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?u:u.length>0?u[0]:null}cacheUserLanguage(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;u&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||u.forEach(o=>{this.detectors[o]&&this.detectors[o].cacheUserLanguage(l,this.options)}))}}Bo.type="languageDetector";function ty(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Nr={exports:{}},ue={};var Ho;function ay(){if(Ho)return ue;Ho=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function L(E){return E===null||typeof E!="object"?null:(E=w&&E[w]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function V(E,j,Y){this.props=E,this.context=j,this.refs=C,this.updater=Y||x}V.prototype.isReactComponent={},V.prototype.setState=function(E,j){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,j,"setState")},V.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function U(){}U.prototype=V.prototype;function G(E,j,Y){this.props=E,this.context=j,this.refs=C,this.updater=Y||x}var X=G.prototype=new U;X.constructor=G,T(X,V.prototype),X.isPureReactComponent=!0;var I=Array.isArray;function ae(){}var Q={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function P(E,j,Y){var K=Y.ref;return{$$typeof:s,type:E,key:j,ref:K!==void 0?K:null,props:Y}}function ne(E,j){return P(E.type,j,E.props)}function se(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function ie(E){var j={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Y){return j[Y]})}var Re=/\/+/g;function ce(E,j){return typeof E=="object"&&E!==null&&E.key!=null?ie(""+E.key):j.toString(36)}function De(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ae,ae):(E.status="pending",E.then(function(j){E.status==="pending"&&(E.status="fulfilled",E.value=j)},function(j){E.status==="pending"&&(E.status="rejected",E.reason=j)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function R(E,j,Y,K,re){var fe=typeof E;(fe==="undefined"||fe==="boolean")&&(E=null);var Se=!1;if(E===null)Se=!0;else switch(fe){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(E.$$typeof){case s:case l:Se=!0;break;case v:return Se=E._init,R(Se(E._payload),j,Y,K,re)}}if(Se)return re=re(E),Se=K===""?"."+ce(E,0):K,I(re)?(Y="",Se!=null&&(Y=Se.replace(Re,"$&/")+"/"),R(re,j,Y,"",function(el){return el})):re!=null&&(se(re)&&(re=ne(re,Y+(re.key==null||E&&E.key===re.key?"":(""+re.key).replace(Re,"$&/")+"/")+Se)),j.push(re)),1;Se=0;var Qe=K===""?".":K+":";if(I(E))for(var Me=0;Me<E.length;Me++)K=E[Me],fe=Qe+ce(K,Me),Se+=R(K,j,Y,fe,re);else if(Me=L(E),typeof Me=="function")for(E=Me.call(E),Me=0;!(K=E.next()).done;)K=K.value,fe=Qe+ce(K,Me++),Se+=R(K,j,Y,fe,re);else if(fe==="object"){if(typeof E.then=="function")return R(De(E),j,Y,K,re);throw j=String(E),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return Se}function F(E,j,Y){if(E==null)return E;var K=[],re=0;return R(E,K,"","",function(fe){return j.call(Y,fe,re++)}),K}function $(E){if(E._status===-1){var j=E._result;j=j(),j.then(function(Y){(E._status===0||E._status===-1)&&(E._status=1,E._result=Y)},function(Y){(E._status===0||E._status===-1)&&(E._status=2,E._result=Y)}),E._status===-1&&(E._status=0,E._result=j)}if(E._status===1)return E._result.default;throw E._result}var ve=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},ge={map:F,forEach:function(E,j,Y){F(E,function(){j.apply(this,arguments)},Y)},count:function(E){var j=0;return F(E,function(){j++}),j},toArray:function(E){return F(E,function(j){return j})||[]},only:function(E){if(!se(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return ue.Activity=b,ue.Children=ge,ue.Component=V,ue.Fragment=u,ue.Profiler=c,ue.PureComponent=G,ue.StrictMode=o,ue.Suspense=m,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,ue.__COMPILER_RUNTIME={__proto__:null,c:function(E){return Q.H.useMemoCache(E)}},ue.cache=function(E){return function(){return E.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(E,j,Y){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var K=T({},E.props),re=E.key;if(j!=null)for(fe in j.key!==void 0&&(re=""+j.key),j)!pe.call(j,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&j.ref===void 0||(K[fe]=j[fe]);var fe=arguments.length-2;if(fe===1)K.children=Y;else if(1<fe){for(var Se=Array(fe),Qe=0;Qe<fe;Qe++)Se[Qe]=arguments[Qe+2];K.children=Se}return P(E.type,re,K)},ue.createContext=function(E){return E={$$typeof:g,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},ue.createElement=function(E,j,Y){var K,re={},fe=null;if(j!=null)for(K in j.key!==void 0&&(fe=""+j.key),j)pe.call(j,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(re[K]=j[K]);var Se=arguments.length-2;if(Se===1)re.children=Y;else if(1<Se){for(var Qe=Array(Se),Me=0;Me<Se;Me++)Qe[Me]=arguments[Me+2];re.children=Qe}if(E&&E.defaultProps)for(K in Se=E.defaultProps,Se)re[K]===void 0&&(re[K]=Se[K]);return P(E,fe,re)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(E){return{$$typeof:y,render:E}},ue.isValidElement=se,ue.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:$}},ue.memo=function(E,j){return{$$typeof:p,type:E,compare:j===void 0?null:j}},ue.startTransition=function(E){var j=Q.T,Y={};Q.T=Y;try{var K=E(),re=Q.S;re!==null&&re(Y,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(ae,ve)}catch(fe){ve(fe)}finally{j!==null&&Y.types!==null&&(j.types=Y.types),Q.T=j}},ue.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},ue.use=function(E){return Q.H.use(E)},ue.useActionState=function(E,j,Y){return Q.H.useActionState(E,j,Y)},ue.useCallback=function(E,j){return Q.H.useCallback(E,j)},ue.useContext=function(E){return Q.H.useContext(E)},ue.useDebugValue=function(){},ue.useDeferredValue=function(E,j){return Q.H.useDeferredValue(E,j)},ue.useEffect=function(E,j){return Q.H.useEffect(E,j)},ue.useEffectEvent=function(E){return Q.H.useEffectEvent(E)},ue.useId=function(){return Q.H.useId()},ue.useImperativeHandle=function(E,j,Y){return Q.H.useImperativeHandle(E,j,Y)},ue.useInsertionEffect=function(E,j){return Q.H.useInsertionEffect(E,j)},ue.useLayoutEffect=function(E,j){return Q.H.useLayoutEffect(E,j)},ue.useMemo=function(E,j){return Q.H.useMemo(E,j)},ue.useOptimistic=function(E,j){return Q.H.useOptimistic(E,j)},ue.useReducer=function(E,j,Y){return Q.H.useReducer(E,j,Y)},ue.useRef=function(E){return Q.H.useRef(E)},ue.useState=function(E){return Q.H.useState(E)},ue.useSyncExternalStore=function(E,j,Y){return Q.H.useSyncExternalStore(E,j,Y)},ue.useTransition=function(){return Q.H.useTransition()},ue.version="19.2.4",ue}var qo;function Pl(){return qo||(qo=1,Nr.exports=ay()),Nr.exports}var D=Pl();const Vo=ty(D),ny=(s,l,u,o)=>{const c=[u,{code:l,...o||{}}];if(s?.services?.logger?.forward)return s.services.logger.forward(c,"warn","react-i18next::",!0);ka(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),s?.services?.logger?.warn?s.services.logger.warn(...c):console?.warn&&console.warn(...c)},Go={},Fo=(s,l,u,o)=>{ka(u)&&Go[u]||(ka(u)&&(Go[u]=new Date),ny(s,l,u,o))},Yo=(s,l)=>()=>{if(s.isInitialized)l();else{const u=()=>{setTimeout(()=>{s.off("initialized",u)},0),l()};s.on("initialized",u)}},Dr=(s,l,u)=>{s.loadNamespaces(l,Yo(s,u))},Zo=(s,l,u,o)=>{if(ka(u)&&(u=[u]),s.options.preload&&s.options.preload.indexOf(l)>-1)return Dr(s,u,o);u.forEach(c=>{s.options.ns.indexOf(c)<0&&s.options.ns.push(c)}),s.loadLanguages(l,Yo(s,o))},ly=(s,l,u={})=>!l.languages||!l.languages.length?(Fo(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(s,{lng:u.lng,precheck:(o,c)=>{if(u.bindI18n&&u.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,s))return!1}}),ka=s=>typeof s=="string",iy=s=>typeof s=="object"&&s!==null,ry=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},sy=s=>uy[s];let Cr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:s=>s.replace(ry,sy),transDefaultProps:void 0};const oy=(s={})=>{Cr={...Cr,...s}},cy=()=>Cr;let Xo;const fy=s=>{Xo=s},dy=()=>Xo,gy={type:"3rdParty",init(s){oy(s.options.react),fy(s)}},Ko=D.createContext();class py{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(u=>{this.usedNamespaces[u]||(this.usedNamespaces[u]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Rr={exports:{}},Mr={};var Qo;function hy(){if(Qo)return Mr;Qo=1;var s=Pl();function l(b,w){return b===w&&(b!==0||1/b===1/w)||b!==b&&w!==w}var u=typeof Object.is=="function"?Object.is:l,o=s.useState,c=s.useEffect,d=s.useLayoutEffect,g=s.useDebugValue;function y(b,w){var L=w(),x=o({inst:{value:L,getSnapshot:w}}),T=x[0].inst,C=x[1];return d(function(){T.value=L,T.getSnapshot=w,m(T)&&C({inst:T})},[b,L,w]),c(function(){return m(T)&&C({inst:T}),b(function(){m(T)&&C({inst:T})})},[b]),g(L),L}function m(b){var w=b.getSnapshot;b=b.value;try{var L=w();return!u(b,L)}catch{return!0}}function p(b,w){return w()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:y;return Mr.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:v,Mr}var $o;function yy(){return $o||($o=1,Rr.exports=hy()),Rr.exports}var my=yy();const by={t:(s,l)=>ka(l)?l:iy(l)&&ka(l.defaultValue)?l.defaultValue:Array.isArray(s)?s[s.length-1]:s,ready:!1},vy=()=>()=>{},Lr=(s,l={})=>{const{i18n:u}=l,{i18n:o,defaultNS:c}=D.useContext(Ko)||{},d=u||o||dy();d&&!d.reportNamespaces&&(d.reportNamespaces=new py),d||Fo(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const g=D.useMemo(()=>({...cy(),...d?.options?.react,...l}),[d,l]),{useSuspense:y,keyPrefix:m}=g,p=c||d?.options?.defaultNS,v=ka(p)?[p]:p||["translation"],b=D.useMemo(()=>v,v);d?.reportNamespaces?.addUsedNamespaces?.(b);const w=D.useRef(0),L=D.useCallback(P=>{if(!d)return vy;const{bindI18n:ne,bindI18nStore:se}=g,ie=()=>{w.current+=1,P()};return ne&&d.on(ne,ie),se&&d.store.on(se,ie),()=>{ne&&ne.split(" ").forEach(Re=>d.off(Re,ie)),se&&se.split(" ").forEach(Re=>d.store.off(Re,ie))}},[d,g]),x=D.useRef(),T=D.useCallback(()=>{if(!d)return by;const P=!!(d.isInitialized||d.initializedStoreOnce)&&b.every(De=>ly(De,d,g)),ne=l.lng||d.language,se=w.current,ie=x.current;if(ie&&ie.ready===P&&ie.lng===ne&&ie.keyPrefix===m&&ie.revision===se)return ie;const ce={t:d.getFixedT(ne,g.nsMode==="fallback"?b:b[0],m),ready:P,lng:ne,keyPrefix:m,revision:se};return x.current=ce,ce},[d,b,m,g,l.lng]),[C,V]=D.useState(0),{t:U,ready:G}=my.useSyncExternalStore(L,T,T);D.useEffect(()=>{if(d&&!G&&!y){const P=()=>V(ne=>ne+1);l.lng?Zo(d,l.lng,b,P):Dr(d,b,P)}},[d,l.lng,b,G,y,C]);const X=d||{},I=D.useRef(null),ae=D.useRef(),Q=P=>{const ne=Object.getOwnPropertyDescriptors(P);ne.__original&&delete ne.__original;const se=Object.create(Object.getPrototypeOf(P),ne);if(!Object.prototype.hasOwnProperty.call(se,"__original"))try{Object.defineProperty(se,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return se},pe=D.useMemo(()=>{const P=X,ne=P?.language;let se=P;P&&(I.current&&I.current.__original===P?ae.current!==ne?(se=Q(P),I.current=se,ae.current=ne):se=I.current:(se=Q(P),I.current=se,ae.current=ne));const ie=[U,se,G];return ie.t=U,ie.i18n=se,ie.ready=G,ie},[U,X,G,X.resolvedLanguage,X.language,X.languages]);if(d&&y&&!G)throw new Promise(P=>{const ne=()=>P();l.lng?Zo(d,l.lng,b,ne):Dr(d,b,ne)});return pe};function Sy({i18n:s,defaultNS:l,children:u}){const o=D.useMemo(()=>({i18n:s,defaultNS:l}),[s,l]);return D.createElement(Ko.Provider,{value:o},u)}const xy={Previous:"Previous",Next:"Next",Done:"Done",Submit:"Submit","Type your answer here":"Type your answer here","Max {{maxCharacters}} characters":"Max {{maxCharacters}} characters"},Ey={};ph({locale:vh}),et.use(Bo).use(gy).init({debug:an.debug,fallbackLng:"en",interpolation:{escapeValue:!1},resources:{en:{translation:xy},nb:{tranlation:Ey}}});var kr={exports:{}},Wn={};var Jo;function Ay(){if(Jo)return Wn;Jo=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(o,c,d){var g=null;if(d!==void 0&&(g=""+d),c.key!==void 0&&(g=""+c.key),"key"in c){d={};for(var y in c)y!=="key"&&(d[y]=c[y])}else d=c;return c=d.ref,{$$typeof:s,type:o,key:g,ref:c!==void 0?c:null,props:d}}return Wn.Fragment=l,Wn.jsx=u,Wn.jsxs=u,Wn}var Wo;function Ty(){return Wo||(Wo=1,kr.exports=Ay()),kr.exports}var Z=Ty();const Io=D.createContext(void 0);function Oy(s,l){switch(l.type){case"reset":return{client:null,isInitialized:!1,error:null};case"success":return{client:l.client,isInitialized:l.initialized,error:l.error};case"error":return{client:null,isInitialized:!1,error:l.error}}}const wy=({clientKey:s,config:l,children:u})=>{const[o,c]=D.useReducer(Oy,{client:null,isInitialized:!1,error:null}),d=D.useMemo(()=>l,[JSON.stringify(l)]);D.useEffect(()=>{let y=!1,m=null;return c({type:"reset"}),(async()=>{try{const v=new Kl(s);if(await v.init(d),y){v.destroy();return}m=v,c({type:"success",client:v,initialized:v.initialized,error:v.lastInitError?v.lastInitError.message:null})}catch(v){y||c({type:"error",error:v instanceof Error?v.message:"Failed to initialize Nemme client"})}})(),()=>{y=!0,m&&m.destroy()}},[s,d]);const g={client:o.client,isInitialized:o.isInitialized,error:o.error};return Z.jsx(Io.Provider,{value:g,children:u})},Po=()=>{const s=D.useContext(Io);if(s===void 0)throw new Error("useNemmeContext must be used within a NemmeProvider");return s},_y=()=>{const{client:s,isInitialized:l,error:u}=Po(),o=D.useCallback(async d=>{if(!s||!l){console.warn("Nemme client not initialized");return}return s.track(d)},[s,l]),c=D.useCallback(async()=>{if(!s||!l){console.warn("Nemme client not initialized");return}return s.flush()},[s,l]);return{track:o,flush:c,isInitialized:l,error:u,client:s}},zy=s=>go(s),jr=Object.assign(s=>zy(s),{NemmeClient:Kl,init:async s=>{const{clientKey:l,...u}=s;return await go(l).init(u)}});typeof window<"u"&&(window.NemmeSDK=jr);var Ur={exports:{}},In={},Br={exports:{}},Hr={};var ec;function Ny(){return ec||(ec=1,(function(s){function l(R,F){var $=R.length;R.push(F);e:for(;0<$;){var ve=$-1>>>1,ge=R[ve];if(0<c(ge,F))R[ve]=F,R[$]=ge,$=ve;else break e}}function u(R){return R.length===0?null:R[0]}function o(R){if(R.length===0)return null;var F=R[0],$=R.pop();if($!==F){R[0]=$;e:for(var ve=0,ge=R.length,E=ge>>>1;ve<E;){var j=2*(ve+1)-1,Y=R[j],K=j+1,re=R[K];if(0>c(Y,$))K<ge&&0>c(re,Y)?(R[ve]=re,R[K]=$,ve=K):(R[ve]=Y,R[j]=$,ve=j);else if(K<ge&&0>c(re,$))R[ve]=re,R[K]=$,ve=K;else break e}}return F}function c(R,F){var $=R.sortIndex-F.sortIndex;return $!==0?$:R.id-F.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var g=Date,y=g.now();s.unstable_now=function(){return g.now()-y}}var m=[],p=[],v=1,b=null,w=3,L=!1,x=!1,T=!1,C=!1,V=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function X(R){for(var F=u(p);F!==null;){if(F.callback===null)o(p);else if(F.startTime<=R)o(p),F.sortIndex=F.expirationTime,l(m,F);else break;F=u(p)}}function I(R){if(T=!1,X(R),!x)if(u(m)!==null)x=!0,ae||(ae=!0,ie());else{var F=u(p);F!==null&&De(I,F.startTime-R)}}var ae=!1,Q=-1,pe=5,P=-1;function ne(){return C?!0:!(s.unstable_now()-P<pe)}function se(){if(C=!1,ae){var R=s.unstable_now();P=R;var F=!0;try{e:{x=!1,T&&(T=!1,U(Q),Q=-1),L=!0;var $=w;try{t:{for(X(R),b=u(m);b!==null&&!(b.expirationTime>R&&ne());){var ve=b.callback;if(typeof ve=="function"){b.callback=null,w=b.priorityLevel;var ge=ve(b.expirationTime<=R);if(R=s.unstable_now(),typeof ge=="function"){b.callback=ge,X(R),F=!0;break t}b===u(m)&&o(m),X(R)}else o(m);b=u(m)}if(b!==null)F=!0;else{var E=u(p);E!==null&&De(I,E.startTime-R),F=!1}}break e}finally{b=null,w=$,L=!1}F=void 0}}finally{F?ie():ae=!1}}}var ie;if(typeof G=="function")ie=function(){G(se)};else if(typeof MessageChannel<"u"){var Re=new MessageChannel,ce=Re.port2;Re.port1.onmessage=se,ie=function(){ce.postMessage(null)}}else ie=function(){V(se,0)};function De(R,F){Q=V(function(){R(s.unstable_now())},F)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(R){R.callback=null},s.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pe=0<R?Math.floor(1e3/R):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(R){switch(w){case 1:case 2:case 3:var F=3;break;default:F=w}var $=w;w=F;try{return R()}finally{w=$}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(R,F){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var $=w;w=R;try{return F()}finally{w=$}},s.unstable_scheduleCallback=function(R,F,$){var ve=s.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ve+$:ve):$=ve,R){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=$+ge,R={id:v++,callback:F,priorityLevel:R,startTime:$,expirationTime:ge,sortIndex:-1},$>ve?(R.sortIndex=$,l(p,R),u(m)===null&&R===u(p)&&(T?(U(Q),Q=-1):T=!0,De(I,$-ve))):(R.sortIndex=ge,l(m,R),x||L||(x=!0,ae||(ae=!0,ie()))),R},s.unstable_shouldYield=ne,s.unstable_wrapCallback=function(R){var F=w;return function(){var $=w;w=F;try{return R.apply(this,arguments)}finally{w=$}}}})(Hr)),Hr}var tc;function Dy(){return tc||(tc=1,Br.exports=Ny()),Br.exports}var qr={exports:{}},tt={};var ac;function Cy(){if(ac)return tt;ac=1;var s=Pl();function l(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(l(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(m,p,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:m,containerInfo:p,implementation:v}}var g=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,tt.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(l(299));return d(m,p,null,v)},tt.flushSync=function(m){var p=g.T,v=o.p;try{if(g.T=null,o.p=2,m)return m()}finally{g.T=p,o.p=v,o.d.f()}},tt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(m,p))},tt.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},tt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,b=y(v,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,L=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?o.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:L}):v==="script"&&o.d.X(m,{crossOrigin:b,integrity:w,fetchPriority:L,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=y(p.as,p.crossOrigin);o.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(m)},tt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,b=y(v,p.crossOrigin);o.d.L(m,v,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tt.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=y(p.as,p.crossOrigin);o.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(m)},tt.requestFormReset=function(m){o.d.r(m)},tt.unstable_batchedUpdates=function(m,p){return m(p)},tt.useFormState=function(m,p,v){return g.H.useFormState(m,p,v)},tt.useFormStatus=function(){return g.H.useHostTransitionStatus()},tt.version="19.2.4",tt}var nc;function Ry(){if(nc)return qr.exports;nc=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),qr.exports=Cy(),qr.exports}var lc;function My(){if(lc)return In;lc=1;var s=Dy(),l=Pl(),u=Ry();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var r=i.alternate;if(r===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===a)return m(i),e;if(r===n)return m(i),t;r=r.sibling}throw Error(o(188))}if(a.return!==n.return)a=i,n=r;else{for(var f=!1,h=i.child;h;){if(h===a){f=!0,a=i,n=r;break}if(h===n){f=!0,n=i,a=r;break}h=h.sibling}if(!f){for(h=r.child;h;){if(h===a){f=!0,a=r,n=i;break}if(h===n){f=!0,n=r,a=i;break}h=h.sibling}if(!f)throw Error(o(189))}}if(a.alternate!==n)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),G=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case V:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case ae:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case G:return e.displayName||"Context";case U:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case pe:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var De=Array.isArray,R=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ve=[],ge=-1;function E(e){return{current:e}}function j(e){0>ge||(e.current=ve[ge],ve[ge]=null,ge--)}function Y(e,t){ge++,ve[ge]=e.current,e.current=t}var K=E(null),re=E(null),fe=E(null),Se=E(null);function Qe(e,t){switch(Y(fe,t),Y(re,e),Y(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ap(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ap(t),e=np(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(K),Y(K,e)}function Me(){j(K),j(re),j(fe)}function el(e){e.memoizedState!==null&&Y(Se,e);var t=K.current,a=np(t,e.type);t!==a&&(Y(re,e),Y(K,a))}function ii(e){re.current===e&&(j(K),j(re)),Se.current===e&&(j(Se),Fl._currentValue=$)}var Zr,Cc;function Ua(e){if(Zr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Zr=t&&t[1]||"",Cc=-1<a.stack.indexOf(`
1
+ (function(Rt,an){typeof exports=="object"&&typeof module<"u"?an(exports):typeof define=="function"&&define.amd?define(["exports"],an):(Rt=typeof globalThis<"u"?globalThis:Rt||self,an(Rt.NemmeSDK={}))})(this,(function(Rt){"use strict";const an={apiBaseUrl:"https://api.nemme.io",debug:!1},oo={debug:0,info:1,warn:2,error:3};let Lp=class Mp{prefix;enabled;level;constructor(l={}){this.prefix=l.prefix||"Nemme SDK",this.enabled=l.enabled!==void 0?l.enabled:!0,this.level=l.level||"info"}shouldLog(l){return this.enabled&&oo[l]>=oo[this.level]}formatMessage(l){return`[${this.prefix}] ${l}`}debug(l,...u){this.shouldLog("debug")&&console.debug(this.formatMessage(l),...u)}info(l,...u){this.shouldLog("info")&&console.info(this.formatMessage(l),...u)}warn(l,...u){this.shouldLog("warn")&&console.warn(this.formatMessage(l),...u)}error(l,...u){this.shouldLog("error")&&console.error(this.formatMessage(l),...u)}child(l){return new Mp({prefix:`${this.prefix}:${l}`,enabled:this.enabled,level:this.level})}configure(l){l.prefix!==void 0&&(this.prefix=l.prefix),l.enabled!==void 0&&(this.enabled=l.enabled),l.level!==void 0&&(this.level=l.level)}};const co=new Lp,fo=co.child("network"),kp=3e4,jp=(s,l)=>{const u=new URL(s,an.apiBaseUrl);return l&&Object.entries(l).forEach(([o,c])=>{c!=null&&u.searchParams.append(o,String(c))}),u.toString()},Gt={async request(s,l={}){const{method:u="GET",headers:o={},body:c,params:d,timeout:g=kp}=l,y=jp(s,d),m={"Content-Type":"application/json",Accept:"application/json",...o},p={method:u,headers:m,body:c?JSON.stringify(c):void 0},v=new AbortController,b=setTimeout(()=>v.abort(),g);p.signal=v.signal;try{const w=await fetch(y,p);let L;const x=w.headers.get("content-type");if(x&&x.includes("application/json"))L=await w.json();else{const C=await w.text();try{L=JSON.parse(C)}catch{L=C}}const T={data:L,status:w.status,statusText:w.statusText,headers:w.headers,ok:w.ok};if(w.ok)T.ok=!0;else{const C=`Request failed with status ${w.status}: ${w.statusText}`;fo.error(C,{url:y,method:u,status:w.status,data:T.data}),T.ok=!1,T.error={message:C,details:T.data}}return T}catch(w){let L="Network request failed",x={};return w instanceof DOMException&&w.name==="AbortError"?(L=`Request timeout after ${g}ms`,x={timeout:g,url:y}):x={message:w instanceof Error?w.message:String(w),url:y,method:u},fo.error(L,x),{data:{},status:0,statusText:L,headers:new Headers,ok:!1,error:{message:L,details:x}}}finally{clearTimeout(b)}},async get(s,l={}){return this.request(s,{...l,method:"GET"})},async post(s,l,u={}){return this.request(s,{...u,method:"POST",body:l})},async put(s,l,u={}){return this.request(s,{...u,method:"PUT",body:l})},async patch(s,l,u={}){return this.request(s,{...u,method:"PATCH",body:l})},async delete(s,l={}){return this.request(s,{...l,method:"DELETE"})}};class Up{logger;headers;formConfig;formManager;deliveries=[];constructor(l,u,o){this.logger=l,this.headers=u,this.formConfig=o}async loadDeliveries(){this.logger.debug("Loading deliveries");const l=await Gt.get("/external/deliveries",{headers:this.headers});if(!l.ok){this.logger.error("Failed to load deliveries",l.error),this.deliveries=[];return}this.deliveries=l.data,this.logger.info(`Loaded ${this.deliveries.length} deliveries`)}async evaluateDeliveryTriggers(l){for(const u of this.deliveries)for(const o of u.triggers)if(this.shouldTriggerDelivery(o,l)){if(!await this.isDeliveryValid(u,o.id)){this.logger.debug(`Delivery ${u.id} is not valid, skipping`);continue}await this.executeDelivery(u,o);return}}shouldTriggerDelivery(l,u){if(this.hasActiveDelivery())return!1;switch(l.triggerType){case"page_url":return l.urlPattern?this.matchesUrlPattern(u.url,l.urlPattern):!0;case"custom_event":return l.eventKey?u.eventKey===l.eventKey:!1;default:return!1}}hasActiveDelivery(){return document.getElementById("nm")!==null}async executeDelivery(l,u){if(l.productType==="FRM"){this.logger.debug(`Triggering form delivery: ${l.productSlug}`,{triggerType:u.triggerType,urlPattern:u.urlPattern,eventKey:u.eventKey});try{const c=await this.createDeliveryResponse(l);if(!this.formManager){const d=await Promise.resolve().then(()=>y0);this.formManager=new d.FormManager(this.logger,this.headers,this.formConfig)}await this.formManager.fetchAndDisplayForm(l.productSlug,async()=>{this.logger.debug(`Form for delivery: ${l.productSlug} was cancelled`),c&&await this.updateDeliveryResponse(l.id,c.id,!0)},async()=>{this.logger.debug(`Form for delivery: ${l.productSlug} was completed`),c&&await this.updateDeliveryResponse(l.id,c.id,!1,!0)})}catch(c){this.logger.error(`Failed to load form for delivery: ${l.productSlug}`,c)}}}matchesUrlPattern(l,u){let o;try{o=new URL(l).pathname}catch{o=l.startsWith("/")?l:`/${l}`}const c=v=>{if(!v)return"/";let b=v.startsWith("/")?v:`/${v}`;return b.length>1&&b.endsWith("/")&&(b=b.slice(0,-1)),b},d=c(o),g=c(u),y=g.replace(/\*\*/g,"§DOUBLE_STAR§").replace(/\*/g,"§SINGLE_STAR§").replace(/\?/g,"§QUESTION§").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/§SINGLE_STAR§/g,"[^/]*").replace(/§DOUBLE_STAR§/g,".*").replace(/§QUESTION§/g,"."),p=new RegExp(`^${y}$`).test(d);return this.logger.debug("URL pattern matching",{originalUrl:l,pathname:o,normalizedPathname:d,pattern:u,normalizedPattern:g,regexPattern:y,matches:p}),p}async createDeliveryResponse(l){const u=await Gt.post(`/external/deliveries/${l.id}/responses`,{},{headers:this.headers});if(!u.ok){this.logger.error(`Failed to create delivery response for delivery: ${l.id}`,u.error);return}return u.data}async updateDeliveryResponse(l,u,o=!1,c=!1){try{await Gt.patch(`/external/deliveries/${l}/responses/${u}`,{wasDismissed:o,wasCompleted:c},{headers:this.headers})}catch(d){this.logger.error(`Failed to update delivery response: ${u} for delivery: ${l}`,d)}}async isDeliveryValid(l,u){const o=u!==void 0?`?triggerId=${u}`:"",c=await Gt.get(`/external/deliveries/${l.id}/should-deliver${o}`,{headers:this.headers});return c.ok?c.data:(this.logger.error(`Failed to check delivery validity for delivery: ${l.id}`,c.error),!1)}}class Bp{logger;headers;sessionId;eventDefinitions=[];onPageView;onEvent;trackUrlParamChanges=!0;getPage;backlog=[];flushTimeout=null;batchConfig={enabled:!0,size:10,delayMs:1e4,sendOnUnload:!0};originalHistoryMethods=null;EVENT_PAGE_VIEW="page_view";lastTrackedPageKey;constructor({logger:l,headers:u,sessionId:o,eventDefinitions:c,batchConfig:d,onPageView:g,onEvent:y,trackUrlParamChanges:m,getPage:p}){this.logger=l,this.headers=u,this.sessionId=o,this.eventDefinitions=c,this.onPageView=g,this.onEvent=y,this.getPage=p,typeof m=="boolean"&&(this.trackUrlParamChanges=m),this.flushEvents=this.flushEvents.bind(this),this.handlePopState=this.handlePopState.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.setupBatching(d)}setupBatching(l){typeof l=="boolean"?this.batchConfig.enabled=l:l&&(this.batchConfig={...this.batchConfig,...l}),this.batchConfig.enabled&&this.batchConfig.sendOnUnload&&typeof window<"u"&&(window.addEventListener("beforeunload",this.flushEvents),window.addEventListener("pagehide",this.flushEvents))}async setupPageViewTracking(){if(typeof window>"u")return;this.originalHistoryMethods={pushState:history.pushState,replaceState:history.replaceState};const l=history.pushState;history.pushState=async(...o)=>{l.apply(history,o),await this.trackPageView()};const u=history.replaceState;history.replaceState=async(...o)=>{u.apply(history,o),await this.trackPageView()},window.addEventListener("popstate",this.handlePopState),document.addEventListener("visibilitychange",this.handleVisibilityChange)}async track(l){if(!this.sessionId){this.logger.warn("Tracking manager not initialized, cannot track event");return}const{eventKey:u,data:o={}}=l;this.logger.debug("Tracking event",{eventKey:u,data:o});const c=this.getPageUrl(),d={sessionId:this.sessionId,eventKey:u,data:o||{},timestamp:new Date().toISOString(),page:c};this.sanitizeEventData(d)&&(this.validateEvent(d),this.batchConfig.enabled?(this.backlog.push(d),this.scheduleFlush()):await this.sendEvents([d]),u===this.EVENT_PAGE_VIEW?this.onPageView?.(c):this.onEvent?.(d,c))}async trackPageView(){if(typeof window>"u")return;const l=this.getPageUrl();if(!this.trackUrlParamChanges){const u=this.getPageKeyWithoutQuery(l);if(this.lastTrackedPageKey===u)return;this.lastTrackedPageKey=u}await this.track({eventKey:this.EVENT_PAGE_VIEW,data:{title:document.title}})}getPageUrl(){if(this.getPage)return this.getPage();const l=window.location.href;return window.location.protocol==="file:"?`/${window.location.pathname.split("/").pop()||""}${window.location.hash}`:l}getPageKeyWithoutQuery(l){try{const u=new URL(l);return`${u.origin}${u.pathname}${u.hash}`}catch{const[u]=l.split("?");return u}}async flush(){return this.flushEvents()}destroy(){this.originalHistoryMethods&&(history.pushState=this.originalHistoryMethods.pushState,history.replaceState=this.originalHistoryMethods.replaceState,this.originalHistoryMethods=null),typeof window<"u"&&(window.removeEventListener("popstate",this.handlePopState),document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.flushEvents),window.removeEventListener("pagehide",this.flushEvents)),this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null)}sanitizeEventData(l){if(l.eventKey===this.EVENT_PAGE_VIEW||!l.data)return!0;const u=l.data;for(const o of Object.keys(u)){const c=u[o];if(typeof c=="string"&&c==="[object Object]")return this.logger.error(`Property ${o} contains [object Object], dropping event ${l.eventKey}`),!1;const d=typeof c;if(d!=="boolean"&&d!=="number"&&d!=="string"){this.logger.warn(`Property ${o} has unsupported type ${d}, removing from event ${l.eventKey}`),delete u[o];continue}typeof c=="string"&&(u[o]=c.toLowerCase())}return!0}validateEvent(l){if(l.eventKey===this.EVENT_PAGE_VIEW)return;const u=this.eventDefinitions.find(d=>d.eventKey===l.eventKey);if(!u){this.logger.warn(`Event ${l.eventKey} is not registered`);return}const o=u.properties,c=l.data;if(c)for(const d of Object.keys(c)){const g=c[d],y=o.find(m=>m.name===d);if(!y){this.logger.warn(`Property ${d} is not registered for event ${l.eventKey}`);continue}typeof g!==y.type&&this.logger.warn(`Property ${y.name} has type ${y.type} but value is of type ${typeof g}`)}}async handlePopState(){await this.trackPageView()}async handleVisibilityChange(){document.visibilityState==="visible"&&await this.trackPageView()}scheduleFlush(){if(this.backlog.length>=this.batchConfig.size){this.flushEvents();return}this.flushTimeout||(this.flushTimeout=window.setTimeout(()=>{this.flushEvents()},this.batchConfig.delayMs))}async flushEvents(){if(this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.backlog.length===0)return;const l=[...this.backlog];this.backlog=[];try{await this.sendEvents(l)}catch(u){this.backlog.unshift(...l),this.logger.error("Failed to send batched events",u)}}async sendEvents(l){if(l.length!==0)if(l.length===1){const u=l[0];await Gt.post("/external/trackings/track",u,{headers:this.headers})}else await Gt.post("/external/trackings/batch",l,{headers:this.headers})}}class Kl{clientKey;_userIdentifier;_initialized=!1;_lastInitError=null;clientLogger=co.child("client");headers={};formConfig;get userIdentifier(){return this._userIdentifier}get initialized(){return this._initialized}get lastInitError(){return this._lastInitError}constructor(l){this.clientKey=l}trackingManager;async init({userIdentifier:l,secretKey:u,debug:o=!1,batch:c,formConfig:d,deactivate:g=!1,trackUrlParamChanges:y,getPage:m}){if(this._initialized=!1,this._lastInitError=null,this.trackingManager?.destroy(),this.trackingManager=void 0,g)return this.clientLogger.info("Nemme client deactivated and will stop initialization."),this._initialized=!0,this._lastInitError=null,this.clientLogger.configure({enabled:!1}),this;if(!l)throw new Error("userIdentifier is required parameter");this._userIdentifier=l,this.clientLogger.configure({enabled:o,level:o?"debug":"info"}),this.headers={"X-Client-Key":this.clientKey,"X-User-Id":this._userIdentifier,...u&&{"X-Client-Secret":u}},this.formConfig=d;try{const p=await this.initializeSession();await this.initializeManagers(p,c,y,m),this._initialized=!0,this._lastInitError=null,this.clientLogger.info("Nemme client initialized",{clientKey:this.clientKey,userIdentifier:this._userIdentifier})}catch(p){this.clientLogger.error("Error during initialization:",p),this._initialized=!1,this._lastInitError=p instanceof Error?p:new Error("Error during initialization")}return this}async flush(){return this.trackingManager?.flush()}destroy(){this.trackingManager?.destroy()}async track(l){if(!this._initialized||!this.trackingManager){this.clientLogger.warn("Nemme client not initialized, some operations may fail");return}return this.trackingManager.track(l)}async initializeSession(){try{const l=await Gt.post("/external/trackings/initialize",{},{headers:this.headers});if(!l.ok)throw new Error(l.error?.message||"Request for initialising session failed");return l.data}catch(l){throw this.clientLogger.error("Error during initialization",l),l}}async initializeManagers(l,u,o,c){const d=new Up(this.clientLogger,this.headers,this.formConfig),g=new Bp({logger:this.clientLogger,headers:this.headers,sessionId:l.sessionId,eventDefinitions:l.eventDefinitions,batchConfig:u,trackUrlParamChanges:o,getPage:c,onPageView:async y=>{await d.evaluateDeliveryTriggers({url:y})},onEvent:async(y,m)=>{await d.evaluateDeliveryTriggers({eventKey:y.eventKey,eventData:y.data,url:m})}});await d.loadDeliveries(),typeof window<"u"&&(await g.setupPageViewTracking(),await g.trackPageView(),await g.flush()),this.trackingManager=g}}const go=s=>new Kl(s);let po={};function Hp(){return po}function qp(s){po=s}const Vp={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Gp=(s,l,u)=>{let o;const c=Vp[s];return typeof c=="string"?o=c:l===1?o=c.one:o=c.other.replace("{{count}}",l.toString()),u?.addSuffix?u.comparison&&u.comparison>0?"in "+o:o+" ago":o};function Ar(s){return(l={})=>{const u=l.width?String(l.width):s.defaultWidth;return s.formats[u]||s.formats[s.defaultWidth]}}const Fp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yp=(s,l,u,o)=>Fp[s];function Zn(s){return(l,u)=>{const o=u?.context?String(u.context):"standalone";let c;if(o==="formatting"&&s.formattingValues){const g=s.defaultFormattingWidth||s.defaultWidth,y=u?.width?String(u.width):g;c=s.formattingValues[y]||s.formattingValues[g]}else{const g=s.defaultWidth,y=u?.width?String(u.width):s.defaultWidth;c=s.values[y]||s.values[g]}const d=s.argumentCallback?s.argumentCallback(l):l;return c[d]}}const Zp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xp={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Qp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$p={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Wp={ordinalNumber:(s,l)=>{const u=Number(s),o=u%100;if(o>20||o<10)switch(o%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},era:Zn({values:Zp,defaultWidth:"wide"}),quarter:Zn({values:Xp,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Zn({values:Kp,defaultWidth:"wide"}),day:Zn({values:Qp,defaultWidth:"wide"}),dayPeriod:Zn({values:$p,defaultWidth:"wide",formattingValues:Jp,defaultFormattingWidth:"wide"})};function Xn(s){return(l,u={})=>{const o=u.width,c=o&&s.matchPatterns[o]||s.matchPatterns[s.defaultMatchWidth],d=l.match(c);if(!d)return null;const g=d[0],y=o&&s.parsePatterns[o]||s.parsePatterns[s.defaultParseWidth],m=Array.isArray(y)?Pp(y,b=>b.test(g)):Ip(y,b=>b.test(g));let p;p=s.valueCallback?s.valueCallback(m):m,p=u.valueCallback?u.valueCallback(p):p;const v=l.slice(g.length);return{value:p,rest:v}}}function Ip(s,l){for(const u in s)if(Object.prototype.hasOwnProperty.call(s,u)&&l(s[u]))return u}function Pp(s,l){for(let u=0;u<s.length;u++)if(l(s[u]))return u}function eh(s){return(l,u={})=>{const o=l.match(s.matchPattern);if(!o)return null;const c=o[0],d=l.match(s.parsePattern);if(!d)return null;let g=s.valueCallback?s.valueCallback(d[0]):d[0];g=u.valueCallback?u.valueCallback(g):g;const y=l.slice(c.length);return{value:g,rest:y}}}const th=/^(\d+)(th|st|nd|rd)?/i,ah=/\d+/i,nh={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},lh={any:[/^b/i,/^(a|c)/i]},ih={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rh={any:[/1/i,/2/i,/3/i,/4/i]},uh={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sh={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oh={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ch={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},fh={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dh={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gh={ordinalNumber:eh({matchPattern:th,parsePattern:ah,valueCallback:s=>parseInt(s,10)}),era:Xn({matchPatterns:nh,defaultMatchWidth:"wide",parsePatterns:lh,defaultParseWidth:"any"}),quarter:Xn({matchPatterns:ih,defaultMatchWidth:"wide",parsePatterns:rh,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Xn({matchPatterns:uh,defaultMatchWidth:"wide",parsePatterns:sh,defaultParseWidth:"any"}),day:Xn({matchPatterns:oh,defaultMatchWidth:"wide",parsePatterns:ch,defaultParseWidth:"any"}),dayPeriod:Xn({matchPatterns:fh,defaultMatchWidth:"any",parsePatterns:dh,defaultParseWidth:"any"})};function ph(s){const l={},u=Hp();for(const o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o]);for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(s[o]===void 0?delete l[o]:l[o]=s[o]);qp(l)}const hh={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},yh={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},mh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bh={date:Ar({formats:hh,defaultWidth:"full"}),time:Ar({formats:yh,defaultWidth:"full"}),dateTime:Ar({formats:mh,defaultWidth:"full"})},vh={code:"en-GB",formatDistance:Gp,formatLong:bh,formatRelative:Yp,localize:Wp,match:gh,options:{weekStartsOn:1,firstWeekContainsDate:4}},le=s=>typeof s=="string",Kn=()=>{let s,l;const u=new Promise((o,c)=>{s=o,l=c});return u.resolve=s,u.reject=l,u},ho=s=>s==null?"":""+s,Sh=(s,l,u)=>{s.forEach(o=>{l[o]&&(u[o]=l[o])})},xh=/###/g,yo=s=>s&&s.indexOf("###")>-1?s.replace(xh,"."):s,mo=s=>!s||le(s),Qn=(s,l,u)=>{const o=le(l)?l.split("."):l;let c=0;for(;c<o.length-1;){if(mo(s))return{};const d=yo(o[c]);!s[d]&&u&&(s[d]=new u),Object.prototype.hasOwnProperty.call(s,d)?s=s[d]:s={},++c}return mo(s)?{}:{obj:s,k:yo(o[c])}},bo=(s,l,u)=>{const{obj:o,k:c}=Qn(s,l,Object);if(o!==void 0||l.length===1){o[c]=u;return}let d=l[l.length-1],g=l.slice(0,l.length-1),y=Qn(s,g,Object);for(;y.obj===void 0&&g.length;)d=`${g[g.length-1]}.${d}`,g=g.slice(0,g.length-1),y=Qn(s,g,Object),y?.obj&&typeof y.obj[`${y.k}.${d}`]<"u"&&(y.obj=void 0);y.obj[`${y.k}.${d}`]=u},Eh=(s,l,u,o)=>{const{obj:c,k:d}=Qn(s,l,Object);c[d]=c[d]||[],c[d].push(u)},Ql=(s,l)=>{const{obj:u,k:o}=Qn(s,l);if(u&&Object.prototype.hasOwnProperty.call(u,o))return u[o]},Ah=(s,l,u)=>{const o=Ql(s,u);return o!==void 0?o:Ql(l,u)},vo=(s,l,u)=>{for(const o in l)o!=="__proto__"&&o!=="constructor"&&(o in s?le(s[o])||s[o]instanceof String||le(l[o])||l[o]instanceof String?u&&(s[o]=l[o]):vo(s[o],l[o],u):s[o]=l[o]);return s},La=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Th={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Oh=s=>le(s)?s.replace(/[&<>"'\/]/g,l=>Th[l]):s;class wh{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const u=this.regExpMap.get(l);if(u!==void 0)return u;const o=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,o),this.regExpQueue.push(l),o}}const _h=[" ",",","?","!",";"],zh=new wh(20),Nh=(s,l,u)=>{l=l||"",u=u||"";const o=_h.filter(g=>l.indexOf(g)<0&&u.indexOf(g)<0);if(o.length===0)return!0;const c=zh.getRegExp(`(${o.map(g=>g==="?"?"\\?":g).join("|")})`);let d=!c.test(s);if(!d){const g=s.indexOf(u);g>0&&!c.test(s.substring(0,g))&&(d=!0)}return d},Tr=(s,l,u=".")=>{if(!s)return;if(s[l])return Object.prototype.hasOwnProperty.call(s,l)?s[l]:void 0;const o=l.split(u);let c=s;for(let d=0;d<o.length;){if(!c||typeof c!="object")return;let g,y="";for(let m=d;m<o.length;++m)if(m!==d&&(y+=u),y+=o[m],g=c[y],g!==void 0){if(["string","number","boolean"].indexOf(typeof g)>-1&&m<o.length-1)continue;d+=m-d+1;break}c=g}return c},$n=s=>s?.replace("_","-"),Dh={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,l){console?.[s]?.apply?.(console,l)}};class $l{constructor(l,u={}){this.init(l,u)}init(l,u={}){this.prefix=u.prefix||"i18next:",this.logger=l||Dh,this.options=u,this.debug=u.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,u,o,c){return c&&!this.debug?null:(le(l[0])&&(l[0]=`${o}${this.prefix} ${l[0]}`),this.logger[u](l))}create(l){return new $l(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new $l(this.logger,l)}}var jt=new $l;class Jl{constructor(){this.observers={}}on(l,u){return l.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const c=this.observers[o].get(u)||0;this.observers[o].set(u,c+1)}),this}off(l,u){if(this.observers[l]){if(!u){delete this.observers[l];return}this.observers[l].delete(u)}}emit(l,...u){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([c,d])=>{for(let g=0;g<d;g++)c(...u)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,d])=>{for(let g=0;g<d;g++)c.apply(c,[l,...u])})}}class So extends Jl{constructor(l,u={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=u,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const u=this.options.ns.indexOf(l);u>-1&&this.options.ns.splice(u,1)}getResource(l,u,o,c={}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,g=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let y;l.indexOf(".")>-1?y=l.split("."):(y=[l,u],o&&(Array.isArray(o)?y.push(...o):le(o)&&d?y.push(...o.split(d)):y.push(o)));const m=Ql(this.data,y);return!m&&!u&&!o&&l.indexOf(".")>-1&&(l=y[0],u=y[1],o=y.slice(2).join(".")),m||!g||!le(o)?m:Tr(this.data?.[l]?.[u],o,d)}addResource(l,u,o,c,d={silent:!1}){const g=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let y=[l,u];o&&(y=y.concat(g?o.split(g):o)),l.indexOf(".")>-1&&(y=l.split("."),c=u,u=y[1]),this.addNamespaces(u),bo(this.data,y,c),d.silent||this.emit("added",l,u,o,c)}addResources(l,u,o,c={silent:!1}){for(const d in o)(le(o[d])||Array.isArray(o[d]))&&this.addResource(l,u,d,o[d],{silent:!0});c.silent||this.emit("added",l,u,o)}addResourceBundle(l,u,o,c,d,g={silent:!1,skipCopy:!1}){let y=[l,u];l.indexOf(".")>-1&&(y=l.split("."),c=o,o=u,u=y[1]),this.addNamespaces(u);let m=Ql(this.data,y)||{};g.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?vo(m,o,d):m={...m,...o},bo(this.data,y,m),g.silent||this.emit("added",l,u,o)}removeResourceBundle(l,u){this.hasResourceBundle(l,u)&&delete this.data[l][u],this.removeNamespaces(u),this.emit("removed",l,u)}hasResourceBundle(l,u){return this.getResource(l,u)!==void 0}getResourceBundle(l,u){return u||(u=this.options.defaultNS),this.getResource(l,u)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const u=this.getDataByLanguage(l);return!!(u&&Object.keys(u)||[]).find(c=>u[c]&&Object.keys(u[c]).length>0)}toJSON(){return this.data}}var xo={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,l,u,o,c){return s.forEach(d=>{l=this.processors[d]?.process(l,u,o,c)??l}),l}};const Eo=Symbol("i18next/PATH_KEY");function Ch(){const s=[],l=Object.create(null);let u;return l.get=(o,c)=>(u?.revoke?.(),c===Eo?s:(s.push(c),u=Proxy.revocable(o,l),u.proxy)),Proxy.revocable(Object.create(null),l).proxy}function Or(s,l){const{[Eo]:u}=s(Ch());return u.join(l?.keySeparator??".")}const Ao={},wr=s=>!le(s)&&typeof s!="boolean"&&typeof s!="number";class Wl extends Jl{constructor(l,u={}){super(),Sh(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=u,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=jt.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,u={interpolation:{}}){const o={...u};if(l==null)return!1;const c=this.resolve(l,o);if(c?.res===void 0)return!1;const d=wr(c.res);return!(o.returnObjects===!1&&d)}extractFromKey(l,u){let o=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=u.ns||this.options.defaultNS||[];const g=o&&l.indexOf(o)>-1,y=!this.options.userDefinedKeySeparator&&!u.keySeparator&&!this.options.userDefinedNsSeparator&&!u.nsSeparator&&!Nh(l,o,c);if(g&&!y){const m=l.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:l,namespaces:le(d)?[d]:d};const p=l.split(o);(o!==c||o===c&&this.options.ns.indexOf(p[0])>-1)&&(d=p.shift()),l=p.join(c)}return{key:l,namespaces:le(d)?[d]:d}}translate(l,u,o){let c=typeof u=="object"?{...u}:u;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),l==null)return"";typeof l=="function"&&(l=Or(l,{...this.options,...c})),Array.isArray(l)||(l=[String(l)]);const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,g=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:y,namespaces:m}=this.extractFromKey(l[l.length-1],c),p=m[m.length-1];let v=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=c.lng||this.language,w=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b?.toLowerCase()==="cimode")return w?d?{res:`${p}${v}${y}`,usedKey:y,exactUsedKey:y,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:`${p}${v}${y}`:d?{res:y,usedKey:y,exactUsedKey:y,usedLng:b,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:y;const L=this.resolve(l,c);let x=L?.res;const T=L?.usedKey||y,C=L?.exactUsedKey||y,V=["[object Number]","[object Function]","[object RegExp]"],U=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,X=c.count!==void 0&&!le(c.count),I=Wl.hasDefaultValue(c),ae=X?this.pluralResolver.getSuffix(b,c.count,c):"",Q=c.ordinal&&X?this.pluralResolver.getSuffix(b,c.count,{ordinal:!1}):"",pe=X&&!c.ordinal&&c.count===0,P=pe&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${ae}`]||c[`defaultValue${Q}`]||c.defaultValue;let ne=x;G&&!x&&I&&(ne=P);const se=wr(ne),ie=Object.prototype.toString.apply(ne);if(G&&ne&&se&&V.indexOf(ie)<0&&!(le(U)&&Array.isArray(ne))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,ne,{...c,ns:m}):`key '${y} (${this.language})' returned an object instead of string.`;return d?(L.res=Re,L.usedParams=this.getUsedParamsDetails(c),L):Re}if(g){const Re=Array.isArray(ne),ce=Re?[]:{},De=Re?C:T;for(const R in ne)if(Object.prototype.hasOwnProperty.call(ne,R)){const F=`${De}${g}${R}`;I&&!x?ce[R]=this.translate(F,{...c,defaultValue:wr(P)?P[R]:void 0,joinArrays:!1,ns:m}):ce[R]=this.translate(F,{...c,joinArrays:!1,ns:m}),ce[R]===F&&(ce[R]=ne[R])}x=ce}}else if(G&&le(U)&&Array.isArray(x))x=x.join(U),x&&(x=this.extendTranslation(x,l,c,o));else{let Re=!1,ce=!1;!this.isValidLookup(x)&&I&&(Re=!0,x=P),this.isValidLookup(x)||(ce=!0,x=y);const R=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:x,F=I&&P!==x&&this.options.updateMissing;if(ce||Re||F){if(this.logger.log(F?"updateKey":"missingKey",b,p,y,F?P:x),g){const E=this.resolve(y,{...c,keySeparator:!1});E&&E.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let $=[];const ve=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ve&&ve[0])for(let E=0;E<ve.length;E++)$.push(ve[E]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(c.lng||this.language):$.push(c.lng||this.language);const ge=(E,j,Y)=>{const K=I&&Y!==x?Y:R;this.options.missingKeyHandler?this.options.missingKeyHandler(E,p,j,K,F,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(E,p,j,K,F,c),this.emit("missingKey",E,p,j,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?$.forEach(E=>{const j=this.pluralResolver.getSuffixes(E,c);pe&&c[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(Y=>{ge([E],y+Y,c[`defaultValue${Y}`]||P)})}):ge($,y,P))}x=this.extendTranslation(x,l,c,L,o),ce&&x===y&&this.options.appendNamespaceToMissingKey&&(x=`${p}${v}${y}`),(ce||Re)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${v}${y}`:y,Re?x:void 0,c))}return d?(L.res=x,L.usedParams=this.getUsedParamsDetails(c),L):x}extendTranslation(l,u,o,c,d){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const m=le(l)&&(o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(m){const b=l.match(this.interpolator.nestingRegexp);p=b&&b.length}let v=o.replace&&!le(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),l=this.interpolator.interpolate(l,v,o.lng||this.language||c.usedLng,o),m){const b=l.match(this.interpolator.nestingRegexp),w=b&&b.length;p<w&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(l=this.interpolator.nest(l,(...b)=>d?.[0]===b[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${u[0]}`),null):this.translate(...b,u),o)),o.interpolation&&this.interpolator.reset()}const g=o.postProcess||this.options.postProcess,y=le(g)?[g]:g;return l!=null&&y?.length&&o.applyPostProcessor!==!1&&(l=xo.handle(y,l,u,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),l}resolve(l,u={}){let o,c,d,g,y;return le(l)&&(l=[l]),l.forEach(m=>{if(this.isValidLookup(o))return;const p=this.extractFromKey(m,u),v=p.key;c=v;let b=p.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const w=u.count!==void 0&&!le(u.count),L=w&&!u.ordinal&&u.count===0,x=u.context!==void 0&&(le(u.context)||typeof u.context=="number")&&u.context!=="",T=u.lngs?u.lngs:this.languageUtils.toResolveHierarchy(u.lng||this.language,u.fallbackLng);b.forEach(C=>{this.isValidLookup(o)||(y=C,!Ao[`${T[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(y)&&(Ao[`${T[0]}-${C}`]=!0,this.logger.warn(`key "${c}" for languages "${T.join(", ")}" won't get resolved as namespace "${y}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(V=>{if(this.isValidLookup(o))return;g=V;const U=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(U,v,V,C,u);else{let X;w&&(X=this.pluralResolver.getSuffix(V,u.count,u));const I=`${this.options.pluralSeparator}zero`,ae=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(u.ordinal&&X.indexOf(ae)===0&&U.push(v+X.replace(ae,this.options.pluralSeparator)),U.push(v+X),L&&U.push(v+I)),x){const Q=`${v}${this.options.contextSeparator||"_"}${u.context}`;U.push(Q),w&&(u.ordinal&&X.indexOf(ae)===0&&U.push(Q+X.replace(ae,this.options.pluralSeparator)),U.push(Q+X),L&&U.push(Q+I))}}let G;for(;G=U.pop();)this.isValidLookup(o)||(d=G,o=this.getResource(V,C,G,u))}))})}),{res:o,usedKey:c,exactUsedKey:d,usedLng:g,usedNS:y}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,u,o,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,u,o,c):this.resourceStore.getResource(l,u,o,c)}getUsedParamsDetails(l={}){const u=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=l.replace&&!le(l.replace);let c=o?l.replace:l;if(o&&typeof l.count<"u"&&(c.count=l.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!o){c={...c};for(const d of u)delete c[d]}return c}static hasDefaultValue(l){const u="defaultValue";for(const o in l)if(Object.prototype.hasOwnProperty.call(l,o)&&u===o.substring(0,u.length)&&l[o]!==void 0)return!0;return!1}}class To{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=jt.create("languageUtils")}getScriptPartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return null;const u=l.split("-");return u.length===2||(u.pop(),u[u.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(u.join("-"))}getLanguagePartFromCode(l){if(l=$n(l),!l||l.indexOf("-")<0)return l;const u=l.split("-");return this.formatLanguageCode(u[0])}formatLanguageCode(l){if(le(l)&&l.indexOf("-")>-1){let u;try{u=Intl.getCanonicalLocales(l)[0]}catch{}return u&&this.options.lowerCaseLng&&(u=u.toLowerCase()),u||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let u;return l.forEach(o=>{if(u)return;const c=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(c))&&(u=c)}),!u&&this.options.supportedLngs&&l.forEach(o=>{if(u)return;const c=this.getScriptPartFromCode(o);if(this.isSupportedCode(c))return u=c;const d=this.getLanguagePartFromCode(o);if(this.isSupportedCode(d))return u=d;u=this.options.supportedLngs.find(g=>{if(g===d)return g;if(!(g.indexOf("-")<0&&d.indexOf("-")<0)&&(g.indexOf("-")>0&&d.indexOf("-")<0&&g.substring(0,g.indexOf("-"))===d||g.indexOf(d)===0&&d.length>1))return g})}),u||(u=this.getFallbackCodes(this.options.fallbackLng)[0]),u}getFallbackCodes(l,u){if(!l)return[];if(typeof l=="function"&&(l=l(u)),le(l)&&(l=[l]),Array.isArray(l))return l;if(!u)return l.default||[];let o=l[u];return o||(o=l[this.getScriptPartFromCode(u)]),o||(o=l[this.formatLanguageCode(u)]),o||(o=l[this.getLanguagePartFromCode(u)]),o||(o=l.default),o||[]}toResolveHierarchy(l,u){const o=this.getFallbackCodes((u===!1?[]:u)||this.options.fallbackLng||[],l),c=[],d=g=>{g&&(this.isSupportedCode(g)?c.push(g):this.logger.warn(`rejecting language code not found in supportedLngs: ${g}`))};return le(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(l))):le(l)&&d(this.formatLanguageCode(l)),o.forEach(g=>{c.indexOf(g)<0&&d(this.formatLanguageCode(g))}),c}}const Oo={zero:0,one:1,two:2,few:3,many:4,other:5},wo={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Rh{constructor(l,u={}){this.languageUtils=l,this.options=u,this.logger=jt.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(l,u={}){const o=$n(l==="dev"?"en":l),c=u.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:o,type:c});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let g;try{g=new Intl.PluralRules(o,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),wo;if(!l.match(/-|_/))return wo;const m=this.languageUtils.getLanguagePartFromCode(l);g=this.getRule(m,u)}return this.pluralRulesCache[d]=g,g}needsPlural(l,u={}){let o=this.getRule(l,u);return o||(o=this.getRule("dev",u)),o?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,u,o={}){return this.getSuffixes(l,o).map(c=>`${u}${c}`)}getSuffixes(l,u={}){let o=this.getRule(l,u);return o||(o=this.getRule("dev",u)),o?o.resolvedOptions().pluralCategories.sort((c,d)=>Oo[c]-Oo[d]).map(c=>`${this.options.prepend}${u.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(l,u,o={}){const c=this.getRule(l,o);return c?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c.select(u)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",u,o))}}const _o=(s,l,u,o=".",c=!0)=>{let d=Ah(s,l,u);return!d&&c&&le(u)&&(d=Tr(s,u,o),d===void 0&&(d=Tr(l,u,o))),d},_r=s=>s.replace(/\$/g,"$$$$");class zo{constructor(l={}){this.logger=jt.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(u=>u),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:u,escapeValue:o,useRawValueToEscape:c,prefix:d,prefixEscaped:g,suffix:y,suffixEscaped:m,formatSeparator:p,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:w,nestingPrefixEscaped:L,nestingSuffix:x,nestingSuffixEscaped:T,nestingOptionsSeparator:C,maxReplaces:V,alwaysFormat:U}=l.interpolation;this.escape=u!==void 0?u:Oh,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?La(d):g||"{{",this.suffix=y?La(y):m||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=w?La(w):L||La("$t("),this.nestingSuffix=x?La(x):T||La(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=V||1e3,this.alwaysFormat=U!==void 0?U:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(u,o)=>u?.source===o?(u.lastIndex=0,u):new RegExp(o,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,u,o,c){let d,g,y;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=L=>{if(L.indexOf(this.formatSeparator)<0){const V=_o(u,m,L,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(V,void 0,o,{...c,...u,interpolationkey:L}):V}const x=L.split(this.formatSeparator),T=x.shift().trim(),C=x.join(this.formatSeparator).trim();return this.format(_o(u,m,T,this.options.keySeparator,this.options.ignoreJSONStructure),C,o,{...c,...u,interpolationkey:T})};this.resetRegExp();const v=c?.missingInterpolationHandler||this.options.missingInterpolationHandler,b=c?.interpolation?.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:L=>_r(L)},{regex:this.regexp,safeValue:L=>this.escapeValue?_r(this.escape(L)):_r(L)}].forEach(L=>{for(y=0;d=L.regex.exec(l);){const x=d[1].trim();if(g=p(x),g===void 0)if(typeof v=="function"){const C=v(l,d,c);g=le(C)?C:""}else if(c&&Object.prototype.hasOwnProperty.call(c,x))g="";else if(b){g=d[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${l}`),g="";else!le(g)&&!this.useRawValueToEscape&&(g=ho(g));const T=L.safeValue(g);if(l=l.replace(d[0],T),b?(L.regex.lastIndex+=g.length,L.regex.lastIndex-=d[0].length):L.regex.lastIndex=0,y++,y>=this.maxReplaces)break}}),l}nest(l,u,o={}){let c,d,g;const y=(m,p)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const b=m.split(new RegExp(`${La(v)}[ ]*{`));let w=`{${b[1]}`;m=b[0],w=this.interpolate(w,g);const L=w.match(/'/g),x=w.match(/"/g);((L?.length??0)%2===0&&!x||(x?.length??0)%2!==0)&&(w=w.replace(/'/g,'"'));try{g=JSON.parse(w),p&&(g={...p,...g})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,T),`${m}${v}${w}`}return g.defaultValue&&g.defaultValue.indexOf(this.prefix)>-1&&delete g.defaultValue,m};for(;c=this.nestingRegexp.exec(l);){let m=[];g={...o},g=g.replace&&!le(g.replace)?g.replace:g,g.applyPostProcessor=!1,delete g.defaultValue;const p=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(p!==-1&&(m=c[1].slice(p).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),c[1]=c[1].slice(0,p)),d=u(y.call(this,c[1].trim(),g),g),d&&c[0]===l&&!le(d))return d;le(d)||(d=ho(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${l}`),d=""),m.length&&(d=m.reduce((v,b)=>this.format(v,b,o.lng,{...o,interpolationkey:c[1].trim()}),d.trim())),l=l.replace(c[0],d),this.regexp.lastIndex=0}return l}}const Mh=s=>{let l=s.toLowerCase().trim();const u={};if(s.indexOf("(")>-1){const o=s.split("(");l=o[0].toLowerCase().trim();const c=o[1].substring(0,o[1].length-1);l==="currency"&&c.indexOf(":")<0?u.currency||(u.currency=c.trim()):l==="relativetime"&&c.indexOf(":")<0?u.range||(u.range=c.trim()):c.split(";").forEach(g=>{if(g){const[y,...m]=g.split(":"),p=m.join(":").trim().replace(/^'+|'+$/g,""),v=y.trim();u[v]||(u[v]=p),p==="false"&&(u[v]=!1),p==="true"&&(u[v]=!0),isNaN(p)||(u[v]=parseInt(p,10))}})}return{formatName:l,formatOptions:u}},No=s=>{const l={};return(u,o,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const g=o+JSON.stringify(d);let y=l[g];return y||(y=s($n(o),c),l[g]=y),y(u)}},Lh=s=>(l,u,o)=>s($n(u),o)(l);class kh{constructor(l={}){this.logger=jt.create("formatter"),this.options=l,this.init(l)}init(l,u={interpolation:{}}){this.formatSeparator=u.interpolation.formatSeparator||",";const o=u.cacheInBuiltFormats?No:Lh;this.formats={number:o((c,d)=>{const g=new Intl.NumberFormat(c,{...d});return y=>g.format(y)}),currency:o((c,d)=>{const g=new Intl.NumberFormat(c,{...d,style:"currency"});return y=>g.format(y)}),datetime:o((c,d)=>{const g=new Intl.DateTimeFormat(c,{...d});return y=>g.format(y)}),relativetime:o((c,d)=>{const g=new Intl.RelativeTimeFormat(c,{...d});return y=>g.format(y,d.range||"day")}),list:o((c,d)=>{const g=new Intl.ListFormat(c,{...d});return y=>g.format(y)})}}add(l,u){this.formats[l.toLowerCase().trim()]=u}addCached(l,u){this.formats[l.toLowerCase().trim()]=No(u)}format(l,u,o,c={}){const d=u.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(y=>y.indexOf(")")>-1)){const y=d.findIndex(m=>m.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,y)].join(this.formatSeparator)}return d.reduce((y,m)=>{const{formatName:p,formatOptions:v}=Mh(m);if(this.formats[p]){let b=y;try{const w=c?.formatParams?.[c.interpolationkey]||{},L=w.locale||w.lng||c.locale||c.lng||o;b=this.formats[p](y,L,{...v,...c,...w})}catch(w){this.logger.warn(w)}return b}else this.logger.warn(`there was no format function for ${p}`);return y},l)}}const jh=(s,l)=>{s.pending[l]!==void 0&&(delete s.pending[l],s.pendingCount--)};class Uh extends Jl{constructor(l,u,o,c={}){super(),this.backend=l,this.store=u,this.services=o,this.languageUtils=o.languageUtils,this.options=c,this.logger=jt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(o,c.backend,c)}queueLoad(l,u,o,c){const d={},g={},y={},m={};return l.forEach(p=>{let v=!0;u.forEach(b=>{const w=`${p}|${b}`;!o.reload&&this.store.hasResourceBundle(p,b)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?g[w]===void 0&&(g[w]=!0):(this.state[w]=1,v=!1,g[w]===void 0&&(g[w]=!0),d[w]===void 0&&(d[w]=!0),m[b]===void 0&&(m[b]=!0)))}),v||(y[p]=!0)}),(Object.keys(d).length||Object.keys(g).length)&&this.queue.push({pending:g,pendingCount:Object.keys(g).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(d),pending:Object.keys(g),toLoadLanguages:Object.keys(y),toLoadNamespaces:Object.keys(m)}}loaded(l,u,o){const c=l.split("|"),d=c[0],g=c[1];u&&this.emit("failedLoading",d,g,u),!u&&o&&this.store.addResourceBundle(d,g,o,void 0,void 0,{skipCopy:!0}),this.state[l]=u?-1:2,u&&o&&(this.state[l]=0);const y={};this.queue.forEach(m=>{Eh(m.loaded,[d],g),jh(m,l),u&&m.errors.push(u),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(p=>{y[p]||(y[p]={});const v=m.loaded[p];v.length&&v.forEach(b=>{y[p][b]===void 0&&(y[p][b]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",y),this.queue=this.queue.filter(m=>!m.done)}read(l,u,o,c=0,d=this.retryTimeout,g){if(!l.length)return g(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:u,fcName:o,tried:c,wait:d,callback:g});return}this.readingCalls++;const y=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(p&&v&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,l,u,o,c+1,d*2,g)},d);return}g(p,v)},m=this.backend[o].bind(this.backend);if(m.length===2){try{const p=m(l,u);p&&typeof p.then=="function"?p.then(v=>y(null,v)).catch(y):y(null,p)}catch(p){y(p)}return}return m(l,u,y)}prepareLoading(l,u,o={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();le(l)&&(l=this.languageUtils.toResolveHierarchy(l)),le(u)&&(u=[u]);const d=this.queueLoad(l,u,o,c);if(!d.toLoad.length)return d.pending.length||c(),null;d.toLoad.forEach(g=>{this.loadOne(g)})}load(l,u,o){this.prepareLoading(l,u,{},o)}reload(l,u,o){this.prepareLoading(l,u,{reload:!0},o)}loadOne(l,u=""){const o=l.split("|"),c=o[0],d=o[1];this.read(c,d,"read",void 0,void 0,(g,y)=>{g&&this.logger.warn(`${u}loading namespace ${d} for language ${c} failed`,g),!g&&y&&this.logger.log(`${u}loaded namespace ${d} for language ${c}`,y),this.loaded(l,g,y)})}saveMissing(l,u,o,c,d,g={},y=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(u)){this.logger.warn(`did not save key "${o}" as the namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend?.create){const m={...g,isUpdate:d},p=this.backend.create.bind(this.backend);if(p.length<6)try{let v;p.length===5?v=p(l,u,o,c,m):v=p(l,u,o,c),v&&typeof v.then=="function"?v.then(b=>y(null,b)).catch(y):y(null,v)}catch(v){y(v)}else p(l,u,o,c,y,m)}!l||!l[0]||this.store.addResource(l[0],u,o,c)}}}const zr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let l={};if(typeof s[1]=="object"&&(l=s[1]),le(s[1])&&(l.defaultValue=s[1]),le(s[2])&&(l.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const u=s[3]||s[2];Object.keys(u).forEach(o=>{l[o]=u[o]})}return l},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Do=s=>(le(s.ns)&&(s.ns=[s.ns]),le(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),le(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs?.indexOf?.("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s),Il=()=>{},Bh=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(u=>{typeof s[u]=="function"&&(s[u]=s[u].bind(s))})};let Co=!1;const Hh=s=>!!(s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some(l=>l?.name?.indexOf("Locize")>0||l?.constructor?.name?.indexOf("Locize")>0));class Jn extends Jl{constructor(l={},u){if(super(),this.options=Do(l),this.services={},this.logger=jt,this.modules={external:[]},Bh(this),u&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,u),this;setTimeout(()=>{this.init(l,u)},0)}}init(l={},u){this.isInitializing=!0,typeof l=="function"&&(u=l,l={}),l.defaultNS==null&&l.ns&&(le(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const o=zr();this.options={...o,...this.options,...Do(l)},this.options.interpolation={...o.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Hh(this)&&!Co&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),Co=!0);const c=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?jt.init(c(this.modules.logger),this.options):jt.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=kh;const v=new To(this.options);this.store=new So(this.options.resources,this.options);const b=this.services;b.logger=jt,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new Rh(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(b.formatter=c(p),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new zo(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new Uh(c(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(L,...x)=>{this.emit(L,...x)}),this.modules.languageDetector&&(b.languageDetector=c(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=c(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new Wl(this.services,this.options),this.translator.on("*",(L,...x)=>{this.emit(L,...x)}),this.modules.external.forEach(L=>{L.init&&L.init(this)})}if(this.format=this.options.interpolation.format,u||(u=Il),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...v)=>this.store[p](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...v)=>(this.store[p](...v),this)});const y=Kn(),m=()=>{const p=(v,b)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),y.resolve(b),u(v,b)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),y}loadResources(l,u=Il){let o=u;const c=le(l)?l:this.language;if(typeof l=="function"&&(o=l),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const d=[],g=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(p=>{p!=="cimode"&&d.indexOf(p)<0&&d.push(p)})};c?g(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>g(m)),this.options.preload?.forEach?.(y=>g(y)),this.services.backendConnector.load(d,this.options.ns,y=>{!y&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(y)})}else o(null)}reloadResources(l,u,o){const c=Kn();return typeof l=="function"&&(o=l,l=void 0),typeof u=="function"&&(o=u,u=void 0),l||(l=this.languages),u||(u=this.options.ns),o||(o=Il),this.services.backendConnector.reload(l,u,d=>{c.resolve(),o(d)}),c}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&xo.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let u=0;u<this.languages.length;u++){const o=this.languages[u];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,u){this.isLanguageChangingTo=l;const o=Kn();this.emit("languageChanging",l);const c=y=>{this.language=y,this.languages=this.services.languageUtils.toResolveHierarchy(y),this.resolvedLanguage=void 0,this.setResolvedLanguage(y)},d=(y,m)=>{m?this.isLanguageChangingTo===l&&(c(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,o.resolve((...p)=>this.t(...p)),u&&u(y,(...p)=>this.t(...p))},g=y=>{!l&&!y&&this.services.languageDetector&&(y=[]);const m=le(y)?y:y&&y[0],p=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(le(y)?[y]:y);p&&(this.language||c(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,v=>{d(v,p)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?g(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(g):this.services.languageDetector.detect(g):g(l),o}getFixedT(l,u,o){const c=(d,g,...y)=>{let m;typeof g!="object"?m=this.options.overloadTranslationOptionHandler([d,g].concat(y)):m={...g},m.lng=m.lng||c.lng,m.lngs=m.lngs||c.lngs,m.ns=m.ns||c.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||o||c.keyPrefix);const p=this.options.keySeparator||".";let v;return m.keyPrefix&&Array.isArray(d)?v=d.map(b=>(typeof b=="function"&&(b=Or(b,{...this.options,...g})),`${m.keyPrefix}${p}${b}`)):(typeof d=="function"&&(d=Or(d,{...this.options,...g})),v=m.keyPrefix?`${m.keyPrefix}${p}${d}`:d),this.t(v,m)};return le(l)?c.lng=l:c.lngs=l,c.ns=u,c.keyPrefix=o,c}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,u={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=u.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const g=(y,m)=>{const p=this.services.backendConnector.state[`${y}|${m}`];return p===-1||p===0||p===2};if(u.precheck){const y=u.precheck(this,g);if(y!==void 0)return y}return!!(this.hasResourceBundle(o,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||g(o,l)&&(!c||g(d,l)))}loadNamespaces(l,u){const o=Kn();return this.options.ns?(le(l)&&(l=[l]),l.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{o.resolve(),u&&u(c)}),o):(u&&u(),Promise.resolve())}loadLanguages(l,u){const o=Kn();le(l)&&(l=[l]);const c=this.options.preload||[],d=l.filter(g=>c.indexOf(g)<0&&this.services.languageUtils.isSupportedCode(g));return d.length?(this.options.preload=c.concat(d),this.loadResources(g=>{o.resolve(),u&&u(g)}),o):(u&&u(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const c=new Intl.Locale(l);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const u=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services?.languageUtils||new To(zr());return l.toLowerCase().indexOf("-latn")>1?"ltr":u.indexOf(o.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},u){const o=new Jn(l,u);return o.createInstance=Jn.createInstance,o}cloneInstance(l={},u=Il){const o=l.forkResourceStore;o&&delete l.forkResourceStore;const c={...this.options,...l,isClone:!0},d=new Jn(c);if((l.debug!==void 0||l.prefix!==void 0)&&(d.logger=d.logger.clone(l)),["store","services","language"].forEach(y=>{d[y]=this[y]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},o){const y=Object.keys(this.store.data).reduce((m,p)=>(m[p]={...this.store.data[p]},m[p]=Object.keys(m[p]).reduce((v,b)=>(v[b]={...m[p][b]},v),m[p]),m),{});d.store=new So(y,c),d.services.resourceStore=d.store}if(l.interpolation){const m={...zr().interpolation,...this.options.interpolation,...l.interpolation},p={...c,interpolation:m};d.services.interpolator=new zo(p)}return d.translator=new Wl(d.services,c),d.translator.on("*",(y,...m)=>{d.emit(y,...m)}),d.init(c,u),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=Jn.createInstance();et.createInstance,et.dir,et.init,et.loadResources,et.reloadResources,et.use,et.changeLanguage,et.getFixedT,et.t,et.exists,et.setDefaultNamespace,et.hasLoadedNamespace,et.loadNamespaces,et.loadLanguages;const{slice:qh,forEach:Vh}=[];function Gh(s){return Vh.call(qh.call(arguments,1),l=>{if(l)for(const u in l)s[u]===void 0&&(s[u]=l[u])}),s}function Fh(s){return typeof s!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(u=>u.test(s))}const Ro=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yh=function(s,l){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},c=encodeURIComponent(l);let d=`${s}=${c}`;if(o.maxAge>0){const g=o.maxAge-0;if(Number.isNaN(g))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(g)}`}if(o.domain){if(!Ro.test(o.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${o.domain}`}if(o.path){if(!Ro.test(o.path))throw new TypeError("option path is invalid");d+=`; Path=${o.path}`}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${o.expires.toUTCString()}`}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d},Mo={create(s,l,u,o){let c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};u&&(c.expires=new Date,c.expires.setTime(c.expires.getTime()+u*60*1e3)),o&&(c.domain=o),document.cookie=Yh(s,l,c)},read(s){const l=`${s}=`,u=document.cookie.split(";");for(let o=0;o<u.length;o++){let c=u[o];for(;c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(l)===0)return c.substring(l.length,c.length)}return null},remove(s,l){this.create(s,"",-1,l)}};var Zh={name:"cookie",lookup(s){let{lookupCookie:l}=s;if(l&&typeof document<"u")return Mo.read(l)||void 0},cacheUserLanguage(s,l){let{lookupCookie:u,cookieMinutes:o,cookieDomain:c,cookieOptions:d}=l;u&&typeof document<"u"&&Mo.create(u,s,o,c,d)}},Xh={name:"querystring",lookup(s){let{lookupQuerystring:l}=s,u;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const d=o.substring(1).split("&");for(let g=0;g<d.length;g++){const y=d[g].indexOf("=");y>0&&d[g].substring(0,y)===l&&(u=d[g].substring(y+1))}}return u}},Kh={name:"hash",lookup(s){let{lookupHash:l,lookupFromHashIndex:u}=s,o;if(typeof window<"u"){const{hash:c}=window.location;if(c&&c.length>2){const d=c.substring(1);if(l){const g=d.split("&");for(let y=0;y<g.length;y++){const m=g[y].indexOf("=");m>0&&g[y].substring(0,m)===l&&(o=g[y].substring(m+1))}}if(o)return o;if(!o&&u>-1){const g=c.match(/\/([a-zA-Z-]*)/g);return Array.isArray(g)?g[typeof u=="number"?u:0]?.replace("/",""):void 0}}}return o}};let nn=null;const Lo=()=>{if(nn!==null)return nn;try{if(nn=typeof window<"u"&&window.localStorage!==null,!nn)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{nn=!1}return nn};var Qh={name:"localStorage",lookup(s){let{lookupLocalStorage:l}=s;if(l&&Lo())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(s,l){let{lookupLocalStorage:u}=l;u&&Lo()&&window.localStorage.setItem(u,s)}};let ln=null;const ko=()=>{if(ln!==null)return ln;try{if(ln=typeof window<"u"&&window.sessionStorage!==null,!ln)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{ln=!1}return ln};var $h={name:"sessionStorage",lookup(s){let{lookupSessionStorage:l}=s;if(l&&ko())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(s,l){let{lookupSessionStorage:u}=l;u&&ko()&&window.sessionStorage.setItem(u,s)}},Jh={name:"navigator",lookup(s){const l=[];if(typeof navigator<"u"){const{languages:u,userLanguage:o,language:c}=navigator;if(u)for(let d=0;d<u.length;d++)l.push(u[d]);o&&l.push(o),c&&l.push(c)}return l.length>0?l:void 0}},Wh={name:"htmlTag",lookup(s){let{htmlTag:l}=s,u;const o=l||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(u=o.getAttribute("lang")),u}},Ih={name:"path",lookup(s){let{lookupFromPathIndex:l}=s;if(typeof window>"u")return;const u=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof l=="number"?l:0]?.replace("/",""):void 0}},Ph={name:"subdomain",lookup(s){let{lookupFromSubdomainIndex:l}=s;const u=typeof l=="number"?l+1:1,o=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(o)return o[u]}};let jo=!1;try{document.cookie,jo=!0}catch{}const Uo=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];jo||Uo.splice(1,1);const ey=()=>({order:Uo,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class Bo{constructor(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,u)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=Gh(u,this.options||{},ey()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=c=>c.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(Zh),this.addDetector(Xh),this.addDetector(Qh),this.addDetector($h),this.addDetector(Jh),this.addDetector(Wh),this.addDetector(Ih),this.addDetector(Ph),this.addDetector(Kh)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,u=[];return l.forEach(o=>{if(this.detectors[o]){let c=this.detectors[o].lookup(this.options);c&&typeof c=="string"&&(c=[c]),c&&(u=u.concat(c))}}),u=u.filter(o=>o!=null&&!Fh(o)).map(o=>this.options.convertDetectedLanguage(o)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?u:u.length>0?u[0]:null}cacheUserLanguage(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;u&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||u.forEach(o=>{this.detectors[o]&&this.detectors[o].cacheUserLanguage(l,this.options)}))}}Bo.type="languageDetector";function ty(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Nr={exports:{}},ue={};var Ho;function ay(){if(Ho)return ue;Ho=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function L(E){return E===null||typeof E!="object"?null:(E=w&&E[w]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function V(E,j,Y){this.props=E,this.context=j,this.refs=C,this.updater=Y||x}V.prototype.isReactComponent={},V.prototype.setState=function(E,j){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,j,"setState")},V.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function U(){}U.prototype=V.prototype;function G(E,j,Y){this.props=E,this.context=j,this.refs=C,this.updater=Y||x}var X=G.prototype=new U;X.constructor=G,T(X,V.prototype),X.isPureReactComponent=!0;var I=Array.isArray;function ae(){}var Q={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function P(E,j,Y){var K=Y.ref;return{$$typeof:s,type:E,key:j,ref:K!==void 0?K:null,props:Y}}function ne(E,j){return P(E.type,j,E.props)}function se(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function ie(E){var j={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Y){return j[Y]})}var Re=/\/+/g;function ce(E,j){return typeof E=="object"&&E!==null&&E.key!=null?ie(""+E.key):j.toString(36)}function De(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ae,ae):(E.status="pending",E.then(function(j){E.status==="pending"&&(E.status="fulfilled",E.value=j)},function(j){E.status==="pending"&&(E.status="rejected",E.reason=j)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function R(E,j,Y,K,re){var fe=typeof E;(fe==="undefined"||fe==="boolean")&&(E=null);var Se=!1;if(E===null)Se=!0;else switch(fe){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(E.$$typeof){case s:case l:Se=!0;break;case v:return Se=E._init,R(Se(E._payload),j,Y,K,re)}}if(Se)return re=re(E),Se=K===""?"."+ce(E,0):K,I(re)?(Y="",Se!=null&&(Y=Se.replace(Re,"$&/")+"/"),R(re,j,Y,"",function(el){return el})):re!=null&&(se(re)&&(re=ne(re,Y+(re.key==null||E&&E.key===re.key?"":(""+re.key).replace(Re,"$&/")+"/")+Se)),j.push(re)),1;Se=0;var Qe=K===""?".":K+":";if(I(E))for(var Me=0;Me<E.length;Me++)K=E[Me],fe=Qe+ce(K,Me),Se+=R(K,j,Y,fe,re);else if(Me=L(E),typeof Me=="function")for(E=Me.call(E),Me=0;!(K=E.next()).done;)K=K.value,fe=Qe+ce(K,Me++),Se+=R(K,j,Y,fe,re);else if(fe==="object"){if(typeof E.then=="function")return R(De(E),j,Y,K,re);throw j=String(E),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return Se}function F(E,j,Y){if(E==null)return E;var K=[],re=0;return R(E,K,"","",function(fe){return j.call(Y,fe,re++)}),K}function $(E){if(E._status===-1){var j=E._result;j=j(),j.then(function(Y){(E._status===0||E._status===-1)&&(E._status=1,E._result=Y)},function(Y){(E._status===0||E._status===-1)&&(E._status=2,E._result=Y)}),E._status===-1&&(E._status=0,E._result=j)}if(E._status===1)return E._result.default;throw E._result}var ve=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},ge={map:F,forEach:function(E,j,Y){F(E,function(){j.apply(this,arguments)},Y)},count:function(E){var j=0;return F(E,function(){j++}),j},toArray:function(E){return F(E,function(j){return j})||[]},only:function(E){if(!se(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return ue.Activity=b,ue.Children=ge,ue.Component=V,ue.Fragment=u,ue.Profiler=c,ue.PureComponent=G,ue.StrictMode=o,ue.Suspense=m,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,ue.__COMPILER_RUNTIME={__proto__:null,c:function(E){return Q.H.useMemoCache(E)}},ue.cache=function(E){return function(){return E.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(E,j,Y){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var K=T({},E.props),re=E.key;if(j!=null)for(fe in j.key!==void 0&&(re=""+j.key),j)!pe.call(j,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&j.ref===void 0||(K[fe]=j[fe]);var fe=arguments.length-2;if(fe===1)K.children=Y;else if(1<fe){for(var Se=Array(fe),Qe=0;Qe<fe;Qe++)Se[Qe]=arguments[Qe+2];K.children=Se}return P(E.type,re,K)},ue.createContext=function(E){return E={$$typeof:g,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},ue.createElement=function(E,j,Y){var K,re={},fe=null;if(j!=null)for(K in j.key!==void 0&&(fe=""+j.key),j)pe.call(j,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(re[K]=j[K]);var Se=arguments.length-2;if(Se===1)re.children=Y;else if(1<Se){for(var Qe=Array(Se),Me=0;Me<Se;Me++)Qe[Me]=arguments[Me+2];re.children=Qe}if(E&&E.defaultProps)for(K in Se=E.defaultProps,Se)re[K]===void 0&&(re[K]=Se[K]);return P(E,fe,re)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(E){return{$$typeof:y,render:E}},ue.isValidElement=se,ue.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:$}},ue.memo=function(E,j){return{$$typeof:p,type:E,compare:j===void 0?null:j}},ue.startTransition=function(E){var j=Q.T,Y={};Q.T=Y;try{var K=E(),re=Q.S;re!==null&&re(Y,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(ae,ve)}catch(fe){ve(fe)}finally{j!==null&&Y.types!==null&&(j.types=Y.types),Q.T=j}},ue.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},ue.use=function(E){return Q.H.use(E)},ue.useActionState=function(E,j,Y){return Q.H.useActionState(E,j,Y)},ue.useCallback=function(E,j){return Q.H.useCallback(E,j)},ue.useContext=function(E){return Q.H.useContext(E)},ue.useDebugValue=function(){},ue.useDeferredValue=function(E,j){return Q.H.useDeferredValue(E,j)},ue.useEffect=function(E,j){return Q.H.useEffect(E,j)},ue.useEffectEvent=function(E){return Q.H.useEffectEvent(E)},ue.useId=function(){return Q.H.useId()},ue.useImperativeHandle=function(E,j,Y){return Q.H.useImperativeHandle(E,j,Y)},ue.useInsertionEffect=function(E,j){return Q.H.useInsertionEffect(E,j)},ue.useLayoutEffect=function(E,j){return Q.H.useLayoutEffect(E,j)},ue.useMemo=function(E,j){return Q.H.useMemo(E,j)},ue.useOptimistic=function(E,j){return Q.H.useOptimistic(E,j)},ue.useReducer=function(E,j,Y){return Q.H.useReducer(E,j,Y)},ue.useRef=function(E){return Q.H.useRef(E)},ue.useState=function(E){return Q.H.useState(E)},ue.useSyncExternalStore=function(E,j,Y){return Q.H.useSyncExternalStore(E,j,Y)},ue.useTransition=function(){return Q.H.useTransition()},ue.version="19.2.4",ue}var qo;function Pl(){return qo||(qo=1,Nr.exports=ay()),Nr.exports}var D=Pl();const Vo=ty(D),ny=(s,l,u,o)=>{const c=[u,{code:l,...o||{}}];if(s?.services?.logger?.forward)return s.services.logger.forward(c,"warn","react-i18next::",!0);ka(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),s?.services?.logger?.warn?s.services.logger.warn(...c):console?.warn&&console.warn(...c)},Go={},Fo=(s,l,u,o)=>{ka(u)&&Go[u]||(ka(u)&&(Go[u]=new Date),ny(s,l,u,o))},Yo=(s,l)=>()=>{if(s.isInitialized)l();else{const u=()=>{setTimeout(()=>{s.off("initialized",u)},0),l()};s.on("initialized",u)}},Dr=(s,l,u)=>{s.loadNamespaces(l,Yo(s,u))},Zo=(s,l,u,o)=>{if(ka(u)&&(u=[u]),s.options.preload&&s.options.preload.indexOf(l)>-1)return Dr(s,u,o);u.forEach(c=>{s.options.ns.indexOf(c)<0&&s.options.ns.push(c)}),s.loadLanguages(l,Yo(s,o))},ly=(s,l,u={})=>!l.languages||!l.languages.length?(Fo(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(s,{lng:u.lng,precheck:(o,c)=>{if(u.bindI18n&&u.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,s))return!1}}),ka=s=>typeof s=="string",iy=s=>typeof s=="object"&&s!==null,ry=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},sy=s=>uy[s];let Cr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:s=>s.replace(ry,sy),transDefaultProps:void 0};const oy=(s={})=>{Cr={...Cr,...s}},cy=()=>Cr;let Xo;const fy=s=>{Xo=s},dy=()=>Xo,gy={type:"3rdParty",init(s){oy(s.options.react),fy(s)}},Ko=D.createContext();class py{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(u=>{this.usedNamespaces[u]||(this.usedNamespaces[u]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Rr={exports:{}},Mr={};var Qo;function hy(){if(Qo)return Mr;Qo=1;var s=Pl();function l(b,w){return b===w&&(b!==0||1/b===1/w)||b!==b&&w!==w}var u=typeof Object.is=="function"?Object.is:l,o=s.useState,c=s.useEffect,d=s.useLayoutEffect,g=s.useDebugValue;function y(b,w){var L=w(),x=o({inst:{value:L,getSnapshot:w}}),T=x[0].inst,C=x[1];return d(function(){T.value=L,T.getSnapshot=w,m(T)&&C({inst:T})},[b,L,w]),c(function(){return m(T)&&C({inst:T}),b(function(){m(T)&&C({inst:T})})},[b]),g(L),L}function m(b){var w=b.getSnapshot;b=b.value;try{var L=w();return!u(b,L)}catch{return!0}}function p(b,w){return w()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:y;return Mr.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:v,Mr}var $o;function yy(){return $o||($o=1,Rr.exports=hy()),Rr.exports}var my=yy();const by={t:(s,l)=>ka(l)?l:iy(l)&&ka(l.defaultValue)?l.defaultValue:Array.isArray(s)?s[s.length-1]:s,ready:!1},vy=()=>()=>{},Lr=(s,l={})=>{const{i18n:u}=l,{i18n:o,defaultNS:c}=D.useContext(Ko)||{},d=u||o||dy();d&&!d.reportNamespaces&&(d.reportNamespaces=new py),d||Fo(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const g=D.useMemo(()=>({...cy(),...d?.options?.react,...l}),[d,l]),{useSuspense:y,keyPrefix:m}=g,p=c||d?.options?.defaultNS,v=ka(p)?[p]:p||["translation"],b=D.useMemo(()=>v,v);d?.reportNamespaces?.addUsedNamespaces?.(b);const w=D.useRef(0),L=D.useCallback(P=>{if(!d)return vy;const{bindI18n:ne,bindI18nStore:se}=g,ie=()=>{w.current+=1,P()};return ne&&d.on(ne,ie),se&&d.store.on(se,ie),()=>{ne&&ne.split(" ").forEach(Re=>d.off(Re,ie)),se&&se.split(" ").forEach(Re=>d.store.off(Re,ie))}},[d,g]),x=D.useRef(),T=D.useCallback(()=>{if(!d)return by;const P=!!(d.isInitialized||d.initializedStoreOnce)&&b.every(De=>ly(De,d,g)),ne=l.lng||d.language,se=w.current,ie=x.current;if(ie&&ie.ready===P&&ie.lng===ne&&ie.keyPrefix===m&&ie.revision===se)return ie;const ce={t:d.getFixedT(ne,g.nsMode==="fallback"?b:b[0],m),ready:P,lng:ne,keyPrefix:m,revision:se};return x.current=ce,ce},[d,b,m,g,l.lng]),[C,V]=D.useState(0),{t:U,ready:G}=my.useSyncExternalStore(L,T,T);D.useEffect(()=>{if(d&&!G&&!y){const P=()=>V(ne=>ne+1);l.lng?Zo(d,l.lng,b,P):Dr(d,b,P)}},[d,l.lng,b,G,y,C]);const X=d||{},I=D.useRef(null),ae=D.useRef(),Q=P=>{const ne=Object.getOwnPropertyDescriptors(P);ne.__original&&delete ne.__original;const se=Object.create(Object.getPrototypeOf(P),ne);if(!Object.prototype.hasOwnProperty.call(se,"__original"))try{Object.defineProperty(se,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return se},pe=D.useMemo(()=>{const P=X,ne=P?.language;let se=P;P&&(I.current&&I.current.__original===P?ae.current!==ne?(se=Q(P),I.current=se,ae.current=ne):se=I.current:(se=Q(P),I.current=se,ae.current=ne));const ie=[U,se,G];return ie.t=U,ie.i18n=se,ie.ready=G,ie},[U,X,G,X.resolvedLanguage,X.language,X.languages]);if(d&&y&&!G)throw new Promise(P=>{const ne=()=>P();l.lng?Zo(d,l.lng,b,ne):Dr(d,b,ne)});return pe};function Sy({i18n:s,defaultNS:l,children:u}){const o=D.useMemo(()=>({i18n:s,defaultNS:l}),[s,l]);return D.createElement(Ko.Provider,{value:o},u)}const xy={Previous:"Previous",Next:"Next",Done:"Done",Submit:"Submit","Type your answer here":"Type your answer here","Max {{maxCharacters}} characters":"Max {{maxCharacters}} characters"},Ey={};ph({locale:vh}),et.use(Bo).use(gy).init({debug:an.debug,fallbackLng:"en",interpolation:{escapeValue:!1},resources:{en:{translation:xy},nb:{tranlation:Ey}}});var kr={exports:{}},Wn={};var Jo;function Ay(){if(Jo)return Wn;Jo=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(o,c,d){var g=null;if(d!==void 0&&(g=""+d),c.key!==void 0&&(g=""+c.key),"key"in c){d={};for(var y in c)y!=="key"&&(d[y]=c[y])}else d=c;return c=d.ref,{$$typeof:s,type:o,key:g,ref:c!==void 0?c:null,props:d}}return Wn.Fragment=l,Wn.jsx=u,Wn.jsxs=u,Wn}var Wo;function Ty(){return Wo||(Wo=1,kr.exports=Ay()),kr.exports}var Z=Ty();const Io=D.createContext(void 0);function Oy(s,l){switch(l.type){case"reset":return{client:null,isInitialized:!1,error:null};case"success":return{client:l.client,isInitialized:l.initialized,error:l.error};case"error":return{client:null,isInitialized:!1,error:l.error}}}const wy=({clientKey:s,config:l,children:u})=>{const[o,c]=D.useReducer(Oy,{client:null,isInitialized:!1,error:null}),d=D.useMemo(()=>l,[JSON.stringify(l)]);D.useEffect(()=>{let y=!1,m=null;return c({type:"reset"}),(async()=>{try{const v=new Kl(s);if(await v.init(d),y){v.destroy();return}m=v,c({type:"success",client:v,initialized:v.initialized,error:v.lastInitError?v.lastInitError.message:null})}catch(v){y||c({type:"error",error:v instanceof Error?v.message:"Failed to initialize Nemme client"})}})(),()=>{y=!0,m&&m.destroy()}},[s,d]);const g={client:o.client,isInitialized:o.isInitialized,error:o.error};return Z.jsx(Io.Provider,{value:g,children:u})},Po=()=>{const s=D.useContext(Io);if(s===void 0)throw new Error("useNemmeContext must be used within a NemmeProvider");return s},_y=()=>{const{client:s,isInitialized:l,error:u}=Po(),o=D.useCallback(async d=>{if(!s||!l){console.warn("Nemme client not initialized");return}return s.track(d)},[s,l]),c=D.useCallback(async()=>{if(!s||!l){console.warn("Nemme client not initialized");return}return s.flush()},[s,l]);return{track:o,flush:c,isInitialized:l,error:u,client:s}},zy=s=>go(s),jr=Object.assign(s=>zy(s),{NemmeClient:Kl,init:async s=>{const{clientKey:l,...u}=s;return await go(l).init(u)}});typeof window<"u"&&(window.NemmeSDK=jr);var Ur={exports:{}},In={},Br={exports:{}},Hr={};var ec;function Ny(){return ec||(ec=1,(function(s){function l(R,F){var $=R.length;R.push(F);e:for(;0<$;){var ve=$-1>>>1,ge=R[ve];if(0<c(ge,F))R[ve]=F,R[$]=ge,$=ve;else break e}}function u(R){return R.length===0?null:R[0]}function o(R){if(R.length===0)return null;var F=R[0],$=R.pop();if($!==F){R[0]=$;e:for(var ve=0,ge=R.length,E=ge>>>1;ve<E;){var j=2*(ve+1)-1,Y=R[j],K=j+1,re=R[K];if(0>c(Y,$))K<ge&&0>c(re,Y)?(R[ve]=re,R[K]=$,ve=K):(R[ve]=Y,R[j]=$,ve=j);else if(K<ge&&0>c(re,$))R[ve]=re,R[K]=$,ve=K;else break e}}return F}function c(R,F){var $=R.sortIndex-F.sortIndex;return $!==0?$:R.id-F.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var g=Date,y=g.now();s.unstable_now=function(){return g.now()-y}}var m=[],p=[],v=1,b=null,w=3,L=!1,x=!1,T=!1,C=!1,V=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function X(R){for(var F=u(p);F!==null;){if(F.callback===null)o(p);else if(F.startTime<=R)o(p),F.sortIndex=F.expirationTime,l(m,F);else break;F=u(p)}}function I(R){if(T=!1,X(R),!x)if(u(m)!==null)x=!0,ae||(ae=!0,ie());else{var F=u(p);F!==null&&De(I,F.startTime-R)}}var ae=!1,Q=-1,pe=5,P=-1;function ne(){return C?!0:!(s.unstable_now()-P<pe)}function se(){if(C=!1,ae){var R=s.unstable_now();P=R;var F=!0;try{e:{x=!1,T&&(T=!1,U(Q),Q=-1),L=!0;var $=w;try{t:{for(X(R),b=u(m);b!==null&&!(b.expirationTime>R&&ne());){var ve=b.callback;if(typeof ve=="function"){b.callback=null,w=b.priorityLevel;var ge=ve(b.expirationTime<=R);if(R=s.unstable_now(),typeof ge=="function"){b.callback=ge,X(R),F=!0;break t}b===u(m)&&o(m),X(R)}else o(m);b=u(m)}if(b!==null)F=!0;else{var E=u(p);E!==null&&De(I,E.startTime-R),F=!1}}break e}finally{b=null,w=$,L=!1}F=void 0}}finally{F?ie():ae=!1}}}var ie;if(typeof G=="function")ie=function(){G(se)};else if(typeof MessageChannel<"u"){var Re=new MessageChannel,ce=Re.port2;Re.port1.onmessage=se,ie=function(){ce.postMessage(null)}}else ie=function(){V(se,0)};function De(R,F){Q=V(function(){R(s.unstable_now())},F)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(R){R.callback=null},s.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pe=0<R?Math.floor(1e3/R):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(R){switch(w){case 1:case 2:case 3:var F=3;break;default:F=w}var $=w;w=F;try{return R()}finally{w=$}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(R,F){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var $=w;w=R;try{return F()}finally{w=$}},s.unstable_scheduleCallback=function(R,F,$){var ve=s.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ve+$:ve):$=ve,R){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=$+ge,R={id:v++,callback:F,priorityLevel:R,startTime:$,expirationTime:ge,sortIndex:-1},$>ve?(R.sortIndex=$,l(p,R),u(m)===null&&R===u(p)&&(T?(U(Q),Q=-1):T=!0,De(I,$-ve))):(R.sortIndex=ge,l(m,R),x||L||(x=!0,ae||(ae=!0,ie()))),R},s.unstable_shouldYield=ne,s.unstable_wrapCallback=function(R){var F=w;return function(){var $=w;w=F;try{return R.apply(this,arguments)}finally{w=$}}}})(Hr)),Hr}var tc;function Dy(){return tc||(tc=1,Br.exports=Ny()),Br.exports}var qr={exports:{}},tt={};var ac;function Cy(){if(ac)return tt;ac=1;var s=Pl();function l(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(l(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(m,p,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:m,containerInfo:p,implementation:v}}var g=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,tt.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(l(299));return d(m,p,null,v)},tt.flushSync=function(m){var p=g.T,v=o.p;try{if(g.T=null,o.p=2,m)return m()}finally{g.T=p,o.p=v,o.d.f()}},tt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(m,p))},tt.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},tt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,b=y(v,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,L=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?o.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:L}):v==="script"&&o.d.X(m,{crossOrigin:b,integrity:w,fetchPriority:L,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=y(p.as,p.crossOrigin);o.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(m)},tt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,b=y(v,p.crossOrigin);o.d.L(m,v,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tt.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=y(p.as,p.crossOrigin);o.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(m)},tt.requestFormReset=function(m){o.d.r(m)},tt.unstable_batchedUpdates=function(m,p){return m(p)},tt.useFormState=function(m,p,v){return g.H.useFormState(m,p,v)},tt.useFormStatus=function(){return g.H.useHostTransitionStatus()},tt.version="19.2.4",tt}var nc;function Ry(){if(nc)return qr.exports;nc=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),qr.exports=Cy(),qr.exports}var lc;function My(){if(lc)return In;lc=1;var s=Dy(),l=Pl(),u=Ry();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var r=i.alternate;if(r===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===a)return m(i),e;if(r===n)return m(i),t;r=r.sibling}throw Error(o(188))}if(a.return!==n.return)a=i,n=r;else{for(var f=!1,h=i.child;h;){if(h===a){f=!0,a=i,n=r;break}if(h===n){f=!0,n=i,a=r;break}h=h.sibling}if(!f){for(h=r.child;h;){if(h===a){f=!0,a=r,n=i;break}if(h===n){f=!0,n=r,a=i;break}h=h.sibling}if(!f)throw Error(o(189))}}if(a.alternate!==n)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),G=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var Re=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case V:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case ae:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case G:return e.displayName||"Context";case U:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case pe:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var De=Array.isArray,R=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ve=[],ge=-1;function E(e){return{current:e}}function j(e){0>ge||(e.current=ve[ge],ve[ge]=null,ge--)}function Y(e,t){ge++,ve[ge]=e.current,e.current=t}var K=E(null),re=E(null),fe=E(null),Se=E(null);function Qe(e,t){switch(Y(fe,t),Y(re,e),Y(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ap(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ap(t),e=np(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(K),Y(K,e)}function Me(){j(K),j(re),j(fe)}function el(e){e.memoizedState!==null&&Y(Se,e);var t=K.current,a=np(t,e.type);t!==a&&(Y(re,e),Y(K,a))}function ii(e){re.current===e&&(j(K),j(re)),Se.current===e&&(j(Se),Fl._currentValue=$)}var Zr,Cc;function Ua(e){if(Zr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Zr=t&&t[1]||"",Cc=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+Zr+e+Cc}var Xr=!1;function Kr(e,t){if(!e||Xr)return"";Xr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(M){var N=M}Reflect.construct(e,[],q)}else{try{q.call()}catch(M){N=M}e.call(q.prototype)}}else{try{throw Error()}catch(M){N=M}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(M){if(M&&N&&typeof M.stack=="string")return[M.stack,N.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),f=r[0],h=r[1];if(f&&h){var S=f.split(`
4
4
  `),z=h.split(`