@airporting/integrations-app 0.4.31 → 0.4.33

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.
Files changed (115) hide show
  1. package/README.md +74 -2
  2. package/dist/mf/{18.js → 1018.js} +3 -3
  3. package/dist/mf/{235.js → 1330.js} +2 -2
  4. package/dist/mf/1600.js +1 -0
  5. package/dist/mf/1857.js +1 -0
  6. package/dist/mf/{70.js → 2070.js} +3 -3
  7. package/dist/mf/3.js +1 -0
  8. package/dist/mf/{134.js → 3134.js} +2 -2
  9. package/dist/mf/{330.js → 3235.js} +2 -2
  10. package/dist/mf/{473.js → 3711.js} +2 -2
  11. package/dist/mf/4447.js +1 -0
  12. package/dist/mf/{756.js → 4756.js} +4 -4
  13. package/dist/mf/4810.js +1 -0
  14. package/dist/mf/5475.js +1 -0
  15. package/dist/mf/{616.js → 5616.js} +2 -2
  16. package/dist/mf/5625.js +1 -0
  17. package/dist/mf/5741.js +1 -0
  18. package/dist/mf/6082.js +1 -0
  19. package/dist/mf/6092.js +10 -0
  20. package/dist/mf/6124.js +1 -0
  21. package/dist/mf/6702.js +1 -0
  22. package/dist/mf/7285.js +1 -0
  23. package/dist/mf/{286.js → 7286.js} +3 -3
  24. package/dist/mf/7476.js +1 -0
  25. package/dist/mf/7493.js +6 -0
  26. package/dist/mf/7493.js.LICENSE.txt +13 -0
  27. package/dist/mf/8170.js +18 -0
  28. package/dist/mf/8473.js +10 -0
  29. package/dist/mf/{637.js → 8637.js} +3 -3
  30. package/dist/mf/8949.js +10 -0
  31. package/dist/mf/8978.js +33 -0
  32. package/dist/mf/{37.js → 9037.js} +3 -3
  33. package/dist/mf/9110.js +1 -0
  34. package/dist/mf/{755.js → 9430.js} +2 -2
  35. package/dist/mf/9666.js +10 -0
  36. package/dist/mf/9666.js.LICENSE.txt +9 -0
  37. package/dist/mf/9758.js +1 -0
  38. package/dist/mf/@mf-types/compiled-types/api/connectors/connectorAddMutation.d.ts +1 -0
  39. package/dist/mf/@mf-types/compiled-types/api/connectors/connectorCatalogQuery.d.ts +1 -0
  40. package/dist/mf/@mf-types/compiled-types/api/connectors/connectorDeleteMutation.d.ts +1 -0
  41. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroDetailQuery.d.ts +2 -0
  42. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobConfigQuery.d.ts +1 -0
  43. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobRunMutation.d.ts +4 -0
  44. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobSaveMutation.d.ts +5 -0
  45. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroListQuery.d.ts +2 -0
  46. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroRunMutation.d.ts +1 -0
  47. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroScheduleMutations.d.ts +21 -0
  48. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroSpreadsheetsQuery.d.ts +4 -0
  49. package/dist/mf/@mf-types/compiled-types/api/synchro/synchroToggleMutation.d.ts +4 -0
  50. package/dist/mf/@mf-types/compiled-types/api/synchro/types.d.ts +67 -0
  51. package/dist/mf/@mf-types/compiled-types/api/useApiSynchro.d.ts +6 -0
  52. package/dist/mf/@mf-types/compiled-types/components/InlineLoader.d.ts +4 -0
  53. package/dist/mf/@mf-types/compiled-types/components/connectors/connector-menu.component.d.ts +7 -0
  54. package/dist/mf/@mf-types/compiled-types/components/connectors/delete-active-connector-modal.d.ts +1 -0
  55. package/dist/mf/@mf-types/compiled-types/components/connectors/is-delete-confirm-input.d.ts +6 -0
  56. package/dist/mf/@mf-types/compiled-types/components/connectors/list.catalog.component.d.ts +1 -0
  57. package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputDateBoundary.d.ts +12 -0
  58. package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputGsheetsSelector.d.ts +11 -0
  59. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.dynamic-form.d.ts +29 -0
  60. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.functions.d.ts +7 -0
  61. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.history.d.ts +6 -0
  62. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.job-config-modal.d.ts +9 -0
  63. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.list.d.ts +8 -0
  64. package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.schedule.d.ts +8 -0
  65. package/dist/mf/@mf-types/compiled-types/gen/IntegrationsApi.d.ts +120 -4
  66. package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigConnectorSingle.d.ts +1 -1
  67. package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigSynchro.d.ts +9 -0
  68. package/dist/mf/@mf-types/compiled-types/providersSynchro.d.ts +15 -0
  69. package/dist/mf/@mf-types/compiled-types/synchro.app.d.ts +1 -0
  70. package/dist/mf/@mf-types/compiled-types/synchro.d.ts +2 -0
  71. package/dist/mf/__federation_expose_connectors.js +2 -2
  72. package/dist/mf/__federation_expose_single_connector.js +2 -2
  73. package/dist/mf/__federation_expose_synchronisation.js +10 -0
  74. package/dist/mf/__federation_expose_synchronisation.js.LICENSE.txt +9 -0
  75. package/dist/mf/index.js +4 -5
  76. package/dist/mf/integrations_app.js +4 -5
  77. package/dist/mf/mf-manifest.json +133 -30
  78. package/dist/mf/mf-stats.json +189 -41
  79. package/package.json +7 -6
  80. package/dist/mf/124.js +0 -1
  81. package/dist/mf/170.js +0 -18
  82. package/dist/mf/285.js +0 -1
  83. package/dist/mf/447.js +0 -1
  84. package/dist/mf/475.js +0 -1
  85. package/dist/mf/476.js +0 -1
  86. package/dist/mf/600.js +0 -1
  87. package/dist/mf/625.js +0 -1
  88. package/dist/mf/666.js +0 -10
  89. package/dist/mf/702.js +0 -1
  90. package/dist/mf/711.js +0 -10
  91. package/dist/mf/741.js +0 -1
  92. package/dist/mf/857.js +0 -1
  93. package/dist/mf/949.js +0 -10
  94. package/dist/mf/978.js +0 -33
  95. package/dist/mf/@mf-types/connectors.d.ts +0 -2
  96. package/dist/mf/@mf-types/single-connector.d.ts +0 -2
  97. package/dist/mf/@mf-types.d.ts +0 -3
  98. package/dist/mf/@mf-types.zip +0 -0
  99. /package/dist/mf/{18.js.LICENSE.txt → 1018.js.LICENSE.txt} +0 -0
  100. /package/dist/mf/{235.js.LICENSE.txt → 1330.js.LICENSE.txt} +0 -0
  101. /package/dist/mf/{70.css → 2070.css} +0 -0
  102. /package/dist/mf/{70.js.LICENSE.txt → 2070.js.LICENSE.txt} +0 -0
  103. /package/dist/mf/{134.js.LICENSE.txt → 3134.js.LICENSE.txt} +0 -0
  104. /package/dist/mf/{330.js.LICENSE.txt → 3235.js.LICENSE.txt} +0 -0
  105. /package/dist/mf/{473.js.LICENSE.txt → 3711.js.LICENSE.txt} +0 -0
  106. /package/dist/mf/{756.js.LICENSE.txt → 4756.js.LICENSE.txt} +0 -0
  107. /package/dist/mf/{616.js.LICENSE.txt → 5616.js.LICENSE.txt} +0 -0
  108. /package/dist/mf/{666.js.LICENSE.txt → 6092.js.LICENSE.txt} +0 -0
  109. /package/dist/mf/{286.js.LICENSE.txt → 7286.js.LICENSE.txt} +0 -0
  110. /package/dist/mf/{170.js.LICENSE.txt → 8170.js.LICENSE.txt} +0 -0
  111. /package/dist/mf/{711.js.LICENSE.txt → 8473.js.LICENSE.txt} +0 -0
  112. /package/dist/mf/{637.js.LICENSE.txt → 8637.js.LICENSE.txt} +0 -0
  113. /package/dist/mf/{949.js.LICENSE.txt → 8949.js.LICENSE.txt} +0 -0
  114. /package/dist/mf/{978.js.LICENSE.txt → 8978.js.LICENSE.txt} +0 -0
  115. /package/dist/mf/{37.js.LICENSE.txt → 9037.js.LICENSE.txt} +0 -0
package/dist/mf/600.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["600"],{7059:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{changeLanguage:()=>changeLanguage,createInstance:()=>createInstance,default:()=>instance,dir:()=>dir,exists:()=>exists,getFixedT:()=>getFixedT,hasLoadedNamespace:()=>hasLoadedNamespace,init:()=>init,keyFromSelector:()=>keysFromSelector,loadLanguages:()=>loadLanguages,loadNamespaces:()=>loadNamespaces,loadResources:()=>loadResources,reloadResources:()=>reloadResources,setDefaultNamespace:()=>setDefaultNamespace,t:()=>t,use:()=>use});const isString=obj=>"string"==typeof obj;const defer=()=>{let res;let rej;const promise=new Promise((resolve,reject)=>{res=resolve;rej=reject});promise.resolve=res;promise.reject=rej;return promise};const makeString=object=>{if(null==object)return"";return""+object};const copy=(a,s,t)=>{a.forEach(m=>{if(s[m])t[m]=s[m]})};const lastOfPathSeparatorRegExp=/###/g;const cleanKey=key=>key&&key.indexOf("###")>-1?key.replace(lastOfPathSeparatorRegExp,"."):key;const canNotTraverseDeeper=object=>!object||isString(object);const getLastOfPath=(object,path,Empty)=>{const stack=isString(path)?path.split("."):path;let stackIndex=0;while(stackIndex<stack.length-1){if(canNotTraverseDeeper(object))return{};const key=cleanKey(stack[stackIndex]);if(!object[key]&&Empty)object[key]=new Empty;object=Object.prototype.hasOwnProperty.call(object,key)?object[key]:{};++stackIndex}if(canNotTraverseDeeper(object))return{};return{obj:object,k:cleanKey(stack[stackIndex])}};const setPath=(object,path,newValue)=>{const{obj,k}=getLastOfPath(object,path,Object);if(void 0!==obj||1===path.length){obj[k]=newValue;return}let e=path[path.length-1];let p=path.slice(0,path.length-1);let last=getLastOfPath(object,p,Object);while(void 0===last.obj&&p.length){e=`${p[p.length-1]}.${e}`;p=p.slice(0,p.length-1);last=getLastOfPath(object,p,Object);if(last?.obj&&void 0!==last.obj[`${last.k}.${e}`])last.obj=void 0}last.obj[`${last.k}.${e}`]=newValue};const pushPath=(object,path,newValue,concat)=>{const{obj,k}=getLastOfPath(object,path,Object);obj[k]=obj[k]||[];obj[k].push(newValue)};const getPath=(object,path)=>{const{obj,k}=getLastOfPath(object,path);if(!obj)return;if(!Object.prototype.hasOwnProperty.call(obj,k))return;return obj[k]};const getPathWithDefaults=(data,defaultData,key)=>{const value=getPath(data,key);if(void 0!==value)return value;return getPath(defaultData,key)};const deepExtend=(target,source,overwrite)=>{for(const prop in source)if("__proto__"!==prop&&"constructor"!==prop)if(prop in target)if(isString(target[prop])||target[prop]instanceof String||isString(source[prop])||source[prop]instanceof String){if(overwrite)target[prop]=source[prop]}else deepExtend(target[prop],source[prop],overwrite);else target[prop]=source[prop];return target};const regexEscape=str=>str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const escape=data=>{if(isString(data))return data.replace(/[&<>"'\/]/g,s=>_entityMap[s]);return data};class RegExpCache{constructor(capacity){this.capacity=capacity;this.regExpMap=new Map;this.regExpQueue=[]}getRegExp(pattern){const regExpFromCache=this.regExpMap.get(pattern);if(void 0!==regExpFromCache)return regExpFromCache;const regExpNew=new RegExp(pattern);if(this.regExpQueue.length===this.capacity)this.regExpMap.delete(this.regExpQueue.shift());this.regExpMap.set(pattern,regExpNew);this.regExpQueue.push(pattern);return regExpNew}}const chars=[" ",",","?","!",";"];const looksLikeObjectPathRegExpCache=new RegExpCache(20);const looksLikeObjectPath=(key,nsSeparator,keySeparator)=>{nsSeparator=nsSeparator||"";keySeparator=keySeparator||"";const possibleChars=chars.filter(c=>nsSeparator.indexOf(c)<0&&keySeparator.indexOf(c)<0);if(0===possibleChars.length)return true;const r=looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c=>"?"===c?"\\?":c).join("|")})`);let matched=!r.test(key);if(!matched){const ki=key.indexOf(keySeparator);if(ki>0&&!r.test(key.substring(0,ki)))matched=true}return matched};const deepFind=(obj,path,keySeparator=".")=>{if(!obj)return;if(obj[path]){if(!Object.prototype.hasOwnProperty.call(obj,path))return;return obj[path]}const tokens=path.split(keySeparator);let current=obj;for(let i=0;i<tokens.length;){if(!current||"object"!=typeof current)return;let next;let nextPath="";for(let j=i;j<tokens.length;++j){if(j!==i)nextPath+=keySeparator;nextPath+=tokens[j];next=current[nextPath];if(void 0!==next){if(["string","number","boolean"].indexOf(typeof next)>-1&&j<tokens.length-1)continue;i+=j-i+1;break}}current=next}return current};const getCleanedCode=code=>code?.replace("_","-");const consoleLogger={type:"logger",log(args){this.output("log",args)},warn(args){this.output("warn",args)},error(args){this.output("error",args)},output(type,args){console?.[type]?.apply?.(console,args)}};class Logger{constructor(concreteLogger,options={}){this.init(concreteLogger,options)}init(concreteLogger,options={}){this.prefix=options.prefix||"i18next:";this.logger=concreteLogger||consoleLogger;this.options=options;this.debug=options.debug}log(...args){return this.forward(args,"log","",true)}warn(...args){return this.forward(args,"warn","",true)}error(...args){return this.forward(args,"error","")}deprecate(...args){return this.forward(args,"warn","WARNING DEPRECATED: ",true)}forward(args,lvl,prefix,debugOnly){if(debugOnly&&!this.debug)return null;if(isString(args[0]))args[0]=`${prefix}${this.prefix} ${args[0]}`;return this.logger[lvl](args)}create(moduleName){return new Logger(this.logger,{...{prefix:`${this.prefix}:${moduleName}:`},...this.options})}clone(options){options=options||this.options;options.prefix=options.prefix||this.prefix;return new Logger(this.logger,options)}}var baseLogger=new Logger;class EventEmitter{constructor(){this.observers={}}on(events,listener){events.split(" ").forEach(event=>{if(!this.observers[event])this.observers[event]=new Map;const numListeners=this.observers[event].get(listener)||0;this.observers[event].set(listener,numListeners+1)});return this}off(event,listener){if(!this.observers[event])return;if(!listener)return void delete this.observers[event];this.observers[event].delete(listener)}emit(event,...args){if(this.observers[event]){const cloned=Array.from(this.observers[event].entries());cloned.forEach(([observer,numTimesAdded])=>{for(let i=0;i<numTimesAdded;i++)observer(...args)})}if(this.observers["*"]){const cloned=Array.from(this.observers["*"].entries());cloned.forEach(([observer,numTimesAdded])=>{for(let i=0;i<numTimesAdded;i++)observer.apply(observer,[event,...args])})}}}class ResourceStore extends EventEmitter{constructor(data,options={ns:["translation"],defaultNS:"translation"}){super();this.data=data||{};this.options=options;if(void 0===this.options.keySeparator)this.options.keySeparator=".";if(void 0===this.options.ignoreJSONStructure)this.options.ignoreJSONStructure=true}addNamespaces(ns){if(this.options.ns.indexOf(ns)<0)this.options.ns.push(ns)}removeNamespaces(ns){const index=this.options.ns.indexOf(ns);if(index>-1)this.options.ns.splice(index,1)}getResource(lng,ns,key,options={}){const keySeparator=void 0!==options.keySeparator?options.keySeparator:this.options.keySeparator;const ignoreJSONStructure=void 0!==options.ignoreJSONStructure?options.ignoreJSONStructure:this.options.ignoreJSONStructure;let path;if(lng.indexOf(".")>-1)path=lng.split(".");else{path=[lng,ns];if(key)if(Array.isArray(key))path.push(...key);else if(isString(key)&&keySeparator)path.push(...key.split(keySeparator));else path.push(key)}const result=getPath(this.data,path);if(!result&&!ns&&!key&&lng.indexOf(".")>-1){lng=path[0];ns=path[1];key=path.slice(2).join(".")}if(result||!ignoreJSONStructure||!isString(key))return result;return deepFind(this.data?.[lng]?.[ns],key,keySeparator)}addResource(lng,ns,key,value,options={silent:false}){const keySeparator=void 0!==options.keySeparator?options.keySeparator:this.options.keySeparator;let path=[lng,ns];if(key)path=path.concat(keySeparator?key.split(keySeparator):key);if(lng.indexOf(".")>-1){path=lng.split(".");value=ns;ns=path[1]}this.addNamespaces(ns);setPath(this.data,path,value);if(!options.silent)this.emit("added",lng,ns,key,value)}addResources(lng,ns,resources,options={silent:false}){for(const m in resources)if(isString(resources[m])||Array.isArray(resources[m]))this.addResource(lng,ns,m,resources[m],{silent:true});if(!options.silent)this.emit("added",lng,ns,resources)}addResourceBundle(lng,ns,resources,deep,overwrite,options={silent:false,skipCopy:false}){let path=[lng,ns];if(lng.indexOf(".")>-1){path=lng.split(".");deep=resources;resources=ns;ns=path[1]}this.addNamespaces(ns);let pack=getPath(this.data,path)||{};if(!options.skipCopy)resources=JSON.parse(JSON.stringify(resources));if(deep)deepExtend(pack,resources,overwrite);else pack={...pack,...resources};setPath(this.data,path,pack);if(!options.silent)this.emit("added",lng,ns,resources)}removeResourceBundle(lng,ns){if(this.hasResourceBundle(lng,ns))delete this.data[lng][ns];this.removeNamespaces(ns);this.emit("removed",lng,ns)}hasResourceBundle(lng,ns){return void 0!==this.getResource(lng,ns)}getResourceBundle(lng,ns){if(!ns)ns=this.options.defaultNS;return this.getResource(lng,ns)}getDataByLanguage(lng){return this.data[lng]}hasLanguageSomeTranslations(lng){const data=this.getDataByLanguage(lng);const n=data&&Object.keys(data)||[];return!!n.find(v=>data[v]&&Object.keys(data[v]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(module){this.processors[module.name]=module},handle(processors,value,key,options,translator){processors.forEach(processor=>{value=this.processors[processor]?.process(value,key,options,translator)??value});return value}};const PATH_KEY=Symbol("i18next/PATH_KEY");function createProxy(){const state=[];const handler=Object.create(null);let proxy;handler.get=(target,key)=>{proxy?.revoke?.();if(key===PATH_KEY)return state;state.push(key);proxy=Proxy.revocable(target,handler);return proxy.proxy};return Proxy.revocable(Object.create(null),handler).proxy}function keysFromSelector(selector,opts){const{[PATH_KEY]:path}=selector(createProxy());return path.join(opts?.keySeparator??".")}const checkedLoadedFor={};const shouldHandleAsObject=res=>!isString(res)&&"boolean"!=typeof res&&"number"!=typeof res;class Translator extends EventEmitter{constructor(services,options={}){super();copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],services,this);this.options=options;if(void 0===this.options.keySeparator)this.options.keySeparator=".";this.logger=baseLogger.create("translator")}changeLanguage(lng){if(lng)this.language=lng}exists(key,o={interpolation:{}}){const opt={...o};if(null==key)return false;const resolved=this.resolve(key,opt);if(resolved?.res===void 0)return false;const isObject=shouldHandleAsObject(resolved.res);if(false===opt.returnObjects&&isObject)return false;return true}extractFromKey(key,opt){let nsSeparator=void 0!==opt.nsSeparator?opt.nsSeparator:this.options.nsSeparator;if(void 0===nsSeparator)nsSeparator=":";const keySeparator=void 0!==opt.keySeparator?opt.keySeparator:this.options.keySeparator;let namespaces=opt.ns||this.options.defaultNS||[];const wouldCheckForNsInKey=nsSeparator&&key.indexOf(nsSeparator)>-1;const seemsNaturalLanguage=!this.options.userDefinedKeySeparator&&!opt.keySeparator&&!this.options.userDefinedNsSeparator&&!opt.nsSeparator&&!looksLikeObjectPath(key,nsSeparator,keySeparator);if(wouldCheckForNsInKey&&!seemsNaturalLanguage){const m=key.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key,namespaces:isString(namespaces)?[namespaces]:namespaces};const parts=key.split(nsSeparator);if(nsSeparator!==keySeparator||nsSeparator===keySeparator&&this.options.ns.indexOf(parts[0])>-1)namespaces=parts.shift();key=parts.join(keySeparator)}return{key,namespaces:isString(namespaces)?[namespaces]:namespaces}}translate(keys,o,lastKey){let opt="object"==typeof o?{...o}:o;if("object"!=typeof opt&&this.options.overloadTranslationOptionHandler)opt=this.options.overloadTranslationOptionHandler(arguments);if("object"==typeof opt)opt={...opt};if(!opt)opt={};if(null==keys)return"";if("function"==typeof keys)keys=keysFromSelector(keys,{...this.options,...opt});if(!Array.isArray(keys))keys=[String(keys)];const returnDetails=void 0!==opt.returnDetails?opt.returnDetails:this.options.returnDetails;const keySeparator=void 0!==opt.keySeparator?opt.keySeparator:this.options.keySeparator;const{key,namespaces}=this.extractFromKey(keys[keys.length-1],opt);const namespace=namespaces[namespaces.length-1];let nsSeparator=void 0!==opt.nsSeparator?opt.nsSeparator:this.options.nsSeparator;if(void 0===nsSeparator)nsSeparator=":";const lng=opt.lng||this.language;const appendNamespaceToCIMode=opt.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(lng?.toLowerCase()==="cimode"){if(appendNamespaceToCIMode){if(returnDetails)return{res:`${namespace}${nsSeparator}${key}`,usedKey:key,exactUsedKey:key,usedLng:lng,usedNS:namespace,usedParams:this.getUsedParamsDetails(opt)};return`${namespace}${nsSeparator}${key}`}if(returnDetails)return{res:key,usedKey:key,exactUsedKey:key,usedLng:lng,usedNS:namespace,usedParams:this.getUsedParamsDetails(opt)};return key}const resolved=this.resolve(keys,opt);let res=resolved?.res;const resUsedKey=resolved?.usedKey||key;const resExactUsedKey=resolved?.exactUsedKey||key;const noObject=["[object Number]","[object Function]","[object RegExp]"];const joinArrays=void 0!==opt.joinArrays?opt.joinArrays:this.options.joinArrays;const handleAsObjectInI18nFormat=!this.i18nFormat||this.i18nFormat.handleAsObject;const needsPluralHandling=void 0!==opt.count&&!isString(opt.count);const hasDefaultValue=Translator.hasDefaultValue(opt);const defaultValueSuffix=needsPluralHandling?this.pluralResolver.getSuffix(lng,opt.count,opt):"";const defaultValueSuffixOrdinalFallback=opt.ordinal&&needsPluralHandling?this.pluralResolver.getSuffix(lng,opt.count,{ordinal:false}):"";const needsZeroSuffixLookup=needsPluralHandling&&!opt.ordinal&&0===opt.count;const defaultValue=needsZeroSuffixLookup&&opt[`defaultValue${this.options.pluralSeparator}zero`]||opt[`defaultValue${defaultValueSuffix}`]||opt[`defaultValue${defaultValueSuffixOrdinalFallback}`]||opt.defaultValue;let resForObjHndl=res;if(handleAsObjectInI18nFormat&&!res&&hasDefaultValue)resForObjHndl=defaultValue;const handleAsObject=shouldHandleAsObject(resForObjHndl);const resType=Object.prototype.toString.apply(resForObjHndl);if(handleAsObjectInI18nFormat&&resForObjHndl&&handleAsObject&&noObject.indexOf(resType)<0&&!(isString(joinArrays)&&Array.isArray(resForObjHndl))){if(!opt.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler)this.logger.warn("accessing an object - but returnObjects options is not enabled!");const r=this.options.returnedObjectHandler?this.options.returnedObjectHandler(resUsedKey,resForObjHndl,{...opt,ns:namespaces}):`key '${key} (${this.language})' returned an object instead of string.`;if(returnDetails){resolved.res=r;resolved.usedParams=this.getUsedParamsDetails(opt);return resolved}return r}if(keySeparator){const resTypeIsArray=Array.isArray(resForObjHndl);const copy=resTypeIsArray?[]:{};const newKeyToUse=resTypeIsArray?resExactUsedKey:resUsedKey;for(const m in resForObjHndl)if(Object.prototype.hasOwnProperty.call(resForObjHndl,m)){const deepKey=`${newKeyToUse}${keySeparator}${m}`;if(hasDefaultValue&&!res)copy[m]=this.translate(deepKey,{...opt,defaultValue:shouldHandleAsObject(defaultValue)?defaultValue[m]:void 0,...{joinArrays:false,ns:namespaces}});else copy[m]=this.translate(deepKey,{...opt,joinArrays:false,ns:namespaces});if(copy[m]===deepKey)copy[m]=resForObjHndl[m]}res=copy}}else if(handleAsObjectInI18nFormat&&isString(joinArrays)&&Array.isArray(res)){res=res.join(joinArrays);if(res)res=this.extendTranslation(res,keys,opt,lastKey)}else{let usedDefault=false;let usedKey=false;if(!this.isValidLookup(res)&&hasDefaultValue){usedDefault=true;res=defaultValue}if(!this.isValidLookup(res)){usedKey=true;res=key}const missingKeyNoValueFallbackToKey=opt.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;const resForMissing=missingKeyNoValueFallbackToKey&&usedKey?void 0:res;const updateMissing=hasDefaultValue&&defaultValue!==res&&this.options.updateMissing;if(usedKey||usedDefault||updateMissing){this.logger.log(updateMissing?"updateKey":"missingKey",lng,namespace,key,updateMissing?defaultValue:res);if(keySeparator){const fk=this.resolve(key,{...opt,keySeparator:false});if(fk&&fk.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 lngs=[];const fallbackLngs=this.languageUtils.getFallbackCodes(this.options.fallbackLng,opt.lng||this.language);if("fallback"===this.options.saveMissingTo&&fallbackLngs&&fallbackLngs[0])for(let i=0;i<fallbackLngs.length;i++)lngs.push(fallbackLngs[i]);else if("all"===this.options.saveMissingTo)lngs=this.languageUtils.toResolveHierarchy(opt.lng||this.language);else lngs.push(opt.lng||this.language);const send=(l,k,specificDefaultValue)=>{const defaultForMissing=hasDefaultValue&&specificDefaultValue!==res?specificDefaultValue:resForMissing;if(this.options.missingKeyHandler)this.options.missingKeyHandler(l,namespace,k,defaultForMissing,updateMissing,opt);else if(this.backendConnector?.saveMissing)this.backendConnector.saveMissing(l,namespace,k,defaultForMissing,updateMissing,opt);this.emit("missingKey",l,namespace,k,res)};if(this.options.saveMissing)if(this.options.saveMissingPlurals&&needsPluralHandling)lngs.forEach(language=>{const suffixes=this.pluralResolver.getSuffixes(language,opt);if(needsZeroSuffixLookup&&opt[`defaultValue${this.options.pluralSeparator}zero`]&&suffixes.indexOf(`${this.options.pluralSeparator}zero`)<0)suffixes.push(`${this.options.pluralSeparator}zero`);suffixes.forEach(suffix=>{send([language],key+suffix,opt[`defaultValue${suffix}`]||defaultValue)})});else send(lngs,key,defaultValue)}res=this.extendTranslation(res,keys,opt,resolved,lastKey);if(usedKey&&res===key&&this.options.appendNamespaceToMissingKey)res=`${namespace}${nsSeparator}${key}`;if((usedKey||usedDefault)&&this.options.parseMissingKeyHandler)res=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${namespace}${nsSeparator}${key}`:key,usedDefault?res:void 0,opt)}if(returnDetails){resolved.res=res;resolved.usedParams=this.getUsedParamsDetails(opt);return resolved}return res}extendTranslation(res,key,opt,resolved,lastKey){if(this.i18nFormat?.parse)res=this.i18nFormat.parse(res,{...this.options.interpolation.defaultVariables,...opt},opt.lng||this.language||resolved.usedLng,resolved.usedNS,resolved.usedKey,{resolved});else if(!opt.skipInterpolation){if(opt.interpolation)this.interpolator.init({...opt,...{interpolation:{...this.options.interpolation,...opt.interpolation}}});const skipOnVariables=isString(res)&&(opt?.interpolation?.skipOnVariables!==void 0?opt.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let nestBef;if(skipOnVariables){const nb=res.match(this.interpolator.nestingRegexp);nestBef=nb&&nb.length}let data=opt.replace&&!isString(opt.replace)?opt.replace:opt;if(this.options.interpolation.defaultVariables)data={...this.options.interpolation.defaultVariables,...data};res=this.interpolator.interpolate(res,data,opt.lng||this.language||resolved.usedLng,opt);if(skipOnVariables){const na=res.match(this.interpolator.nestingRegexp);const nestAft=na&&na.length;if(nestBef<nestAft)opt.nest=false}if(!opt.lng&&resolved&&resolved.res)opt.lng=this.language||resolved.usedLng;if(false!==opt.nest)res=this.interpolator.nest(res,(...args)=>{if(lastKey?.[0]===args[0]&&!opt.context){this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);return null}return this.translate(...args,key)},opt);if(opt.interpolation)this.interpolator.reset()}const postProcess=opt.postProcess||this.options.postProcess;const postProcessorNames=isString(postProcess)?[postProcess]:postProcess;if(null!=res&&postProcessorNames?.length&&false!==opt.applyPostProcessor)res=postProcessor.handle(postProcessorNames,res,key,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...resolved,usedParams:this.getUsedParamsDetails(opt)},...opt}:opt,this);return res}resolve(keys,opt={}){let found;let usedKey;let exactUsedKey;let usedLng;let usedNS;if(isString(keys))keys=[keys];keys.forEach(k=>{if(this.isValidLookup(found))return;const extracted=this.extractFromKey(k,opt);const key=extracted.key;usedKey=key;let namespaces=extracted.namespaces;if(this.options.fallbackNS)namespaces=namespaces.concat(this.options.fallbackNS);const needsPluralHandling=void 0!==opt.count&&!isString(opt.count);const needsZeroSuffixLookup=needsPluralHandling&&!opt.ordinal&&0===opt.count;const needsContextHandling=void 0!==opt.context&&(isString(opt.context)||"number"==typeof opt.context)&&""!==opt.context;const codes=opt.lngs?opt.lngs:this.languageUtils.toResolveHierarchy(opt.lng||this.language,opt.fallbackLng);namespaces.forEach(ns=>{if(this.isValidLookup(found))return;usedNS=ns;if(!checkedLoadedFor[`${codes[0]}-${ns}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(usedNS)){checkedLoadedFor[`${codes[0]}-${ns}`]=true;this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" 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!!!")}codes.forEach(code=>{if(this.isValidLookup(found))return;usedLng=code;const finalKeys=[key];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(finalKeys,key,code,ns,opt);else{let pluralSuffix;if(needsPluralHandling)pluralSuffix=this.pluralResolver.getSuffix(code,opt.count,opt);const zeroSuffix=`${this.options.pluralSeparator}zero`;const ordinalPrefix=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(needsPluralHandling){if(opt.ordinal&&0===pluralSuffix.indexOf(ordinalPrefix))finalKeys.push(key+pluralSuffix.replace(ordinalPrefix,this.options.pluralSeparator));finalKeys.push(key+pluralSuffix);if(needsZeroSuffixLookup)finalKeys.push(key+zeroSuffix)}if(needsContextHandling){const contextKey=`${key}${this.options.contextSeparator||"_"}${opt.context}`;finalKeys.push(contextKey);if(needsPluralHandling){if(opt.ordinal&&0===pluralSuffix.indexOf(ordinalPrefix))finalKeys.push(contextKey+pluralSuffix.replace(ordinalPrefix,this.options.pluralSeparator));finalKeys.push(contextKey+pluralSuffix);if(needsZeroSuffixLookup)finalKeys.push(contextKey+zeroSuffix)}}}let possibleKey;while(possibleKey=finalKeys.pop())if(!this.isValidLookup(found)){exactUsedKey=possibleKey;found=this.getResource(code,ns,possibleKey,opt)}})})});return{res:found,usedKey,exactUsedKey,usedLng,usedNS}}isValidLookup(res){return void 0!==res&&!(!this.options.returnNull&&null===res)&&!(!this.options.returnEmptyString&&""===res)}getResource(code,ns,key,options={}){if(this.i18nFormat?.getResource)return this.i18nFormat.getResource(code,ns,key,options);return this.resourceStore.getResource(code,ns,key,options)}getUsedParamsDetails(options={}){const optionsKeys=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"];const useOptionsReplaceForData=options.replace&&!isString(options.replace);let data=useOptionsReplaceForData?options.replace:options;if(useOptionsReplaceForData&&void 0!==options.count)data.count=options.count;if(this.options.interpolation.defaultVariables)data={...this.options.interpolation.defaultVariables,...data};if(!useOptionsReplaceForData){data={...data};for(const key of optionsKeys)delete data[key]}return data}static hasDefaultValue(options){const prefix="defaultValue";for(const option in options)if(Object.prototype.hasOwnProperty.call(options,option)&&prefix===option.substring(0,prefix.length)&&void 0!==options[option])return true;return false}}class LanguageUtil{constructor(options){this.options=options;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(code){code=getCleanedCode(code);if(!code||code.indexOf("-")<0)return null;const p=code.split("-");if(2===p.length)return null;p.pop();if("x"===p[p.length-1].toLowerCase())return null;return this.formatLanguageCode(p.join("-"))}getLanguagePartFromCode(code){code=getCleanedCode(code);if(!code||code.indexOf("-")<0)return code;const p=code.split("-");return this.formatLanguageCode(p[0])}formatLanguageCode(code){if(isString(code)&&code.indexOf("-")>-1){let formattedCode;try{formattedCode=Intl.getCanonicalLocales(code)[0]}catch(e){}if(formattedCode&&this.options.lowerCaseLng)formattedCode=formattedCode.toLowerCase();if(formattedCode)return formattedCode;if(this.options.lowerCaseLng)return code.toLowerCase();return code}return this.options.cleanCode||this.options.lowerCaseLng?code.toLowerCase():code}isSupportedCode(code){if("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)code=this.getLanguagePartFromCode(code);return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(code)>-1}getBestMatchFromCodes(codes){if(!codes)return null;let found;codes.forEach(code=>{if(found)return;const cleanedLng=this.formatLanguageCode(code);if(!this.options.supportedLngs||this.isSupportedCode(cleanedLng))found=cleanedLng});if(!found&&this.options.supportedLngs)codes.forEach(code=>{if(found)return;const lngScOnly=this.getScriptPartFromCode(code);if(this.isSupportedCode(lngScOnly))return found=lngScOnly;const lngOnly=this.getLanguagePartFromCode(code);if(this.isSupportedCode(lngOnly))return found=lngOnly;found=this.options.supportedLngs.find(supportedLng=>{if(supportedLng===lngOnly)return supportedLng;if(supportedLng.indexOf("-")<0&&lngOnly.indexOf("-")<0)return;if(supportedLng.indexOf("-")>0&&lngOnly.indexOf("-")<0&&supportedLng.substring(0,supportedLng.indexOf("-"))===lngOnly)return supportedLng;if(0===supportedLng.indexOf(lngOnly)&&lngOnly.length>1)return supportedLng})});if(!found)found=this.getFallbackCodes(this.options.fallbackLng)[0];return found}getFallbackCodes(fallbacks,code){if(!fallbacks)return[];if("function"==typeof fallbacks)fallbacks=fallbacks(code);if(isString(fallbacks))fallbacks=[fallbacks];if(Array.isArray(fallbacks))return fallbacks;if(!code)return fallbacks.default||[];let found=fallbacks[code];if(!found)found=fallbacks[this.getScriptPartFromCode(code)];if(!found)found=fallbacks[this.formatLanguageCode(code)];if(!found)found=fallbacks[this.getLanguagePartFromCode(code)];if(!found)found=fallbacks.default;return found||[]}toResolveHierarchy(code,fallbackCode){const fallbackCodes=this.getFallbackCodes((false===fallbackCode?[]:fallbackCode)||this.options.fallbackLng||[],code);const codes=[];const addCode=c=>{if(!c)return;if(this.isSupportedCode(c))codes.push(c);else this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`)};if(isString(code)&&(code.indexOf("-")>-1||code.indexOf("_")>-1)){if("languageOnly"!==this.options.load)addCode(this.formatLanguageCode(code));if("languageOnly"!==this.options.load&&"currentOnly"!==this.options.load)addCode(this.getScriptPartFromCode(code));if("currentOnly"!==this.options.load)addCode(this.getLanguagePartFromCode(code))}else if(isString(code))addCode(this.formatLanguageCode(code));fallbackCodes.forEach(fc=>{if(codes.indexOf(fc)<0)addCode(this.formatLanguageCode(fc))});return codes}}const suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};const dummyRule={select:count=>1===count?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class PluralResolver{constructor(languageUtils,options={}){this.languageUtils=languageUtils;this.options=options;this.logger=baseLogger.create("pluralResolver");this.pluralRulesCache={}}addRule(lng,obj){this.rules[lng]=obj}clearCache(){this.pluralRulesCache={}}getRule(code,options={}){const cleanedCode=getCleanedCode("dev"===code?"en":code);const type=options.ordinal?"ordinal":"cardinal";const cacheKey=JSON.stringify({cleanedCode,type});if(cacheKey in this.pluralRulesCache)return this.pluralRulesCache[cacheKey];let rule;try{rule=new Intl.PluralRules(cleanedCode,{type})}catch(err){if(!Intl){this.logger.error("No Intl support, please use an Intl polyfill!");return dummyRule}if(!code.match(/-|_/))return dummyRule;const lngPart=this.languageUtils.getLanguagePartFromCode(code);rule=this.getRule(lngPart,options)}this.pluralRulesCache[cacheKey]=rule;return rule}needsPlural(code,options={}){let rule=this.getRule(code,options);if(!rule)rule=this.getRule("dev",options);return rule?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(code,key,options={}){return this.getSuffixes(code,options).map(suffix=>`${key}${suffix}`)}getSuffixes(code,options={}){let rule=this.getRule(code,options);if(!rule)rule=this.getRule("dev",options);if(!rule)return[];return rule.resolvedOptions().pluralCategories.sort((pluralCategory1,pluralCategory2)=>suffixesOrder[pluralCategory1]-suffixesOrder[pluralCategory2]).map(pluralCategory=>`${this.options.prepend}${options.ordinal?`ordinal${this.options.prepend}`:""}${pluralCategory}`)}getSuffix(code,count,options={}){const rule=this.getRule(code,options);if(rule)return`${this.options.prepend}${options.ordinal?`ordinal${this.options.prepend}`:""}${rule.select(count)}`;this.logger.warn(`no plural rule found for: ${code}`);return this.getSuffix("dev",count,options)}}const deepFindWithDefaults=(data,defaultData,key,keySeparator=".",ignoreJSONStructure=true)=>{let path=getPathWithDefaults(data,defaultData,key);if(!path&&ignoreJSONStructure&&isString(key)){path=deepFind(data,key,keySeparator);if(void 0===path)path=deepFind(defaultData,key,keySeparator)}return path};const regexSafe=val=>val.replace(/\$/g,"$$$$");class Interpolator{constructor(options={}){this.logger=baseLogger.create("interpolator");this.options=options;this.format=options?.interpolation?.format||(value=>value);this.init(options)}init(options={}){if(!options.interpolation)options.interpolation={escapeValue:true};const{escape:escape$1,escapeValue,useRawValueToEscape,prefix,prefixEscaped,suffix,suffixEscaped,formatSeparator,unescapeSuffix,unescapePrefix,nestingPrefix,nestingPrefixEscaped,nestingSuffix,nestingSuffixEscaped,nestingOptionsSeparator,maxReplaces,alwaysFormat}=options.interpolation;this.escape=void 0!==escape$1?escape$1:escape;this.escapeValue=void 0!==escapeValue?escapeValue:true;this.useRawValueToEscape=void 0!==useRawValueToEscape?useRawValueToEscape:false;this.prefix=prefix?regexEscape(prefix):prefixEscaped||"{{";this.suffix=suffix?regexEscape(suffix):suffixEscaped||"}}";this.formatSeparator=formatSeparator||",";this.unescapePrefix=unescapeSuffix?"":unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":unescapeSuffix||"";this.nestingPrefix=nestingPrefix?regexEscape(nestingPrefix):nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=nestingSuffix?regexEscape(nestingSuffix):nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=nestingOptionsSeparator||",";this.maxReplaces=maxReplaces||1e3;this.alwaysFormat=void 0!==alwaysFormat?alwaysFormat:false;this.resetRegExp()}reset(){if(this.options)this.init(this.options)}resetRegExp(){const getOrResetRegExp=(existingRegExp,pattern)=>{if(existingRegExp?.source===pattern){existingRegExp.lastIndex=0;return existingRegExp}return new RegExp(pattern,"g")};this.regexp=getOrResetRegExp(this.regexp,`${this.prefix}(.+?)${this.suffix}`);this.regexpUnescape=getOrResetRegExp(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);this.nestingRegexp=getOrResetRegExp(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(str,data,lng,options){let match;let value;let replaces;const defaultData=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};const handleFormat=key=>{if(key.indexOf(this.formatSeparator)<0){const path=deepFindWithDefaults(data,defaultData,key,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(path,void 0,lng,{...options,...data,interpolationkey:key}):path}const p=key.split(this.formatSeparator);const k=p.shift().trim();const f=p.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(data,defaultData,k,this.options.keySeparator,this.options.ignoreJSONStructure),f,lng,{...options,...data,interpolationkey:k})};this.resetRegExp();const missingInterpolationHandler=options?.missingInterpolationHandler||this.options.missingInterpolationHandler;const skipOnVariables=options?.interpolation?.skipOnVariables!==void 0?options.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;const todos=[{regex:this.regexpUnescape,safeValue:val=>regexSafe(val)},{regex:this.regexp,safeValue:val=>this.escapeValue?regexSafe(this.escape(val)):regexSafe(val)}];todos.forEach(todo=>{replaces=0;while(match=todo.regex.exec(str)){const matchedVar=match[1].trim();value=handleFormat(matchedVar);if(void 0===value)if("function"==typeof missingInterpolationHandler){const temp=missingInterpolationHandler(str,match,options);value=isString(temp)?temp:""}else if(options&&Object.prototype.hasOwnProperty.call(options,matchedVar))value="";else if(skipOnVariables){value=match[0];continue}else{this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);value=""}else if(!isString(value)&&!this.useRawValueToEscape)value=makeString(value);const safeValue=todo.safeValue(value);str=str.replace(match[0],safeValue);if(skipOnVariables){todo.regex.lastIndex+=value.length;todo.regex.lastIndex-=match[0].length}else todo.regex.lastIndex=0;replaces++;if(replaces>=this.maxReplaces)break}});return str}nest(str,fc,options={}){let match;let value;let clonedOptions;const handleHasOptions=(key,inheritedOptions)=>{const sep=this.nestingOptionsSeparator;if(key.indexOf(sep)<0)return key;const c=key.split(new RegExp(`${sep}[ ]*{`));let optionsString=`{${c[1]}`;key=c[0];optionsString=this.interpolate(optionsString,clonedOptions);const matchedSingleQuotes=optionsString.match(/'/g);const matchedDoubleQuotes=optionsString.match(/"/g);if((matchedSingleQuotes?.length??0)%2===0&&!matchedDoubleQuotes||matchedDoubleQuotes.length%2!==0)optionsString=optionsString.replace(/'/g,'"');try{clonedOptions=JSON.parse(optionsString);if(inheritedOptions)clonedOptions={...inheritedOptions,...clonedOptions}}catch(e){this.logger.warn(`failed parsing options string in nesting for key ${key}`,e);return`${key}${sep}${optionsString}`}if(clonedOptions.defaultValue&&clonedOptions.defaultValue.indexOf(this.prefix)>-1)delete clonedOptions.defaultValue;return key};while(match=this.nestingRegexp.exec(str)){let formatters=[];clonedOptions={...options};clonedOptions=clonedOptions.replace&&!isString(clonedOptions.replace)?clonedOptions.replace:clonedOptions;clonedOptions.applyPostProcessor=false;delete clonedOptions.defaultValue;const keyEndIndex=/{.*}/.test(match[1])?match[1].lastIndexOf("}")+1:match[1].indexOf(this.formatSeparator);if(-1!==keyEndIndex){formatters=match[1].slice(keyEndIndex).split(this.formatSeparator).map(elem=>elem.trim()).filter(Boolean);match[1]=match[1].slice(0,keyEndIndex)}value=fc(handleHasOptions.call(this,match[1].trim(),clonedOptions),clonedOptions);if(value&&match[0]===str&&!isString(value))return value;if(!isString(value))value=makeString(value);if(!value){this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);value=""}if(formatters.length)value=formatters.reduce((v,f)=>this.format(v,f,options.lng,{...options,interpolationkey:match[1].trim()}),value.trim());str=str.replace(match[0],value);this.regexp.lastIndex=0}return str}}const parseFormatStr=formatStr=>{let formatName=formatStr.toLowerCase().trim();const formatOptions={};if(formatStr.indexOf("(")>-1){const p=formatStr.split("(");formatName=p[0].toLowerCase().trim();const optStr=p[1].substring(0,p[1].length-1);if("currency"===formatName&&optStr.indexOf(":")<0){if(!formatOptions.currency)formatOptions.currency=optStr.trim()}else if("relativetime"===formatName&&optStr.indexOf(":")<0){if(!formatOptions.range)formatOptions.range=optStr.trim()}else{const opts=optStr.split(";");opts.forEach(opt=>{if(opt){const[key,...rest]=opt.split(":");const val=rest.join(":").trim().replace(/^'+|'+$/g,"");const trimmedKey=key.trim();if(!formatOptions[trimmedKey])formatOptions[trimmedKey]=val;if("false"===val)formatOptions[trimmedKey]=false;if("true"===val)formatOptions[trimmedKey]=true;if(!isNaN(val))formatOptions[trimmedKey]=parseInt(val,10)}})}}return{formatName,formatOptions}};const createCachedFormatter=fn=>{const cache={};return(v,l,o)=>{let optForCache=o;if(o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey])optForCache={...optForCache,[o.interpolationkey]:void 0};const key=l+JSON.stringify(optForCache);let frm=cache[key];if(!frm){frm=fn(getCleanedCode(l),o);cache[key]=frm}return frm(v)}};const createNonCachedFormatter=fn=>(v,l,o)=>fn(getCleanedCode(l),o)(v);class Formatter{constructor(options={}){this.logger=baseLogger.create("formatter");this.options=options;this.init(options)}init(services,options={interpolation:{}}){this.formatSeparator=options.interpolation.formatSeparator||",";const cf=options.cacheInBuiltFormats?createCachedFormatter:createNonCachedFormatter;this.formats={number:cf((lng,opt)=>{const formatter=new Intl.NumberFormat(lng,{...opt});return val=>formatter.format(val)}),currency:cf((lng,opt)=>{const formatter=new Intl.NumberFormat(lng,{...opt,style:"currency"});return val=>formatter.format(val)}),datetime:cf((lng,opt)=>{const formatter=new Intl.DateTimeFormat(lng,{...opt});return val=>formatter.format(val)}),relativetime:cf((lng,opt)=>{const formatter=new Intl.RelativeTimeFormat(lng,{...opt});return val=>formatter.format(val,opt.range||"day")}),list:cf((lng,opt)=>{const formatter=new Intl.ListFormat(lng,{...opt});return val=>formatter.format(val)})}}add(name,fc){this.formats[name.toLowerCase().trim()]=fc}addCached(name,fc){this.formats[name.toLowerCase().trim()]=createCachedFormatter(fc)}format(value,format,lng,options={}){const formats=format.split(this.formatSeparator);if(formats.length>1&&formats[0].indexOf("(")>1&&formats[0].indexOf(")")<0&&formats.find(f=>f.indexOf(")")>-1)){const lastIndex=formats.findIndex(f=>f.indexOf(")")>-1);formats[0]=[formats[0],...formats.splice(1,lastIndex)].join(this.formatSeparator)}const result=formats.reduce((mem,f)=>{const{formatName,formatOptions}=parseFormatStr(f);if(this.formats[formatName]){let formatted=mem;try{const valOptions=options?.formatParams?.[options.interpolationkey]||{};const l=valOptions.locale||valOptions.lng||options.locale||options.lng||lng;formatted=this.formats[formatName](mem,l,{...formatOptions,...options,...valOptions})}catch(error){this.logger.warn(error)}return formatted}this.logger.warn(`there was no format function for ${formatName}`);return mem},value);return result}}const removePending=(q,name)=>{if(void 0!==q.pending[name]){delete q.pending[name];q.pendingCount--}};class Connector extends EventEmitter{constructor(backend,store,services,options={}){super();this.backend=backend;this.store=store;this.services=services;this.languageUtils=services.languageUtils;this.options=options;this.logger=baseLogger.create("backendConnector");this.waitingReads=[];this.maxParallelReads=options.maxParallelReads||10;this.readingCalls=0;this.maxRetries=options.maxRetries>=0?options.maxRetries:5;this.retryTimeout=options.retryTimeout>=1?options.retryTimeout:350;this.state={};this.queue=[];this.backend?.init?.(services,options.backend,options)}queueLoad(languages,namespaces,options,callback){const toLoad={};const pending={};const toLoadLanguages={};const toLoadNamespaces={};languages.forEach(lng=>{let hasAllNamespaces=true;namespaces.forEach(ns=>{const name=`${lng}|${ns}`;if(!options.reload&&this.store.hasResourceBundle(lng,ns))this.state[name]=2;else if(this.state[name]<0);else if(1===this.state[name]){if(void 0===pending[name])pending[name]=true}else{this.state[name]=1;hasAllNamespaces=false;if(void 0===pending[name])pending[name]=true;if(void 0===toLoad[name])toLoad[name]=true;if(void 0===toLoadNamespaces[ns])toLoadNamespaces[ns]=true}});if(!hasAllNamespaces)toLoadLanguages[lng]=true});if(Object.keys(toLoad).length||Object.keys(pending).length)this.queue.push({pending,pendingCount:Object.keys(pending).length,loaded:{},errors:[],callback});return{toLoad:Object.keys(toLoad),pending:Object.keys(pending),toLoadLanguages:Object.keys(toLoadLanguages),toLoadNamespaces:Object.keys(toLoadNamespaces)}}loaded(name,err,data){const s=name.split("|");const lng=s[0];const ns=s[1];if(err)this.emit("failedLoading",lng,ns,err);if(!err&&data)this.store.addResourceBundle(lng,ns,data,void 0,void 0,{skipCopy:true});this.state[name]=err?-1:2;if(err&&data)this.state[name]=0;const loaded={};this.queue.forEach(q=>{pushPath(q.loaded,[lng],ns);removePending(q,name);if(err)q.errors.push(err);if(0===q.pendingCount&&!q.done){Object.keys(q.loaded).forEach(l=>{if(!loaded[l])loaded[l]={};const loadedKeys=q.loaded[l];if(loadedKeys.length)loadedKeys.forEach(n=>{if(void 0===loaded[l][n])loaded[l][n]=true})});q.done=true;if(q.errors.length)q.callback(q.errors);else q.callback()}});this.emit("loaded",loaded);this.queue=this.queue.filter(q=>!q.done)}read(lng,ns,fcName,tried=0,wait=this.retryTimeout,callback){if(!lng.length)return callback(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng,ns,fcName,tried,wait,callback});this.readingCalls++;const resolver=(err,data)=>{this.readingCalls--;if(this.waitingReads.length>0){const next=this.waitingReads.shift();this.read(next.lng,next.ns,next.fcName,next.tried,next.wait,next.callback)}if(err&&data&&tried<this.maxRetries)return void setTimeout(()=>{this.read.call(this,lng,ns,fcName,tried+1,2*wait,callback)},wait);callback(err,data)};const fc=this.backend[fcName].bind(this.backend);if(2===fc.length){try{const r=fc(lng,ns);if(r&&"function"==typeof r.then)r.then(data=>resolver(null,data)).catch(resolver);else resolver(null,r)}catch(err){resolver(err)}return}return fc(lng,ns,resolver)}prepareLoading(languages,namespaces,options={},callback){if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return callback&&callback()}if(isString(languages))languages=this.languageUtils.toResolveHierarchy(languages);if(isString(namespaces))namespaces=[namespaces];const toLoad=this.queueLoad(languages,namespaces,options,callback);if(!toLoad.toLoad.length){if(!toLoad.pending.length)callback();return null}toLoad.toLoad.forEach(name=>{this.loadOne(name)})}load(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{},callback)}reload(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{reload:true},callback)}loadOne(name,prefix=""){const s=name.split("|");const lng=s[0];const ns=s[1];this.read(lng,ns,"read",void 0,void 0,(err,data)=>{if(err)this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`,err);if(!err&&data)this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`,data);this.loaded(name,err,data)})}saveMissing(languages,namespace,key,fallbackValue,isUpdate,options={},clb=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(namespace))return void this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" 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!!!");if(null==key||""===key)return;if(this.backend?.create){const opts={...options,isUpdate};const fc=this.backend.create.bind(this.backend);if(fc.length<6)try{let r;r=5===fc.length?fc(languages,namespace,key,fallbackValue,opts):fc(languages,namespace,key,fallbackValue);if(r&&"function"==typeof r.then)r.then(data=>clb(null,data)).catch(clb);else clb(null,r)}catch(err){clb(err)}else fc(languages,namespace,key,fallbackValue,clb,opts)}if(!languages||!languages[0])return;this.store.addResource(languages[0],namespace,key,fallbackValue)}}const get=()=>({debug:false,initAsync:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:false,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:args=>{let ret={};if("object"==typeof args[1])ret=args[1];if(isString(args[1]))ret.defaultValue=args[1];if(isString(args[2]))ret.tDescription=args[2];if("object"==typeof args[2]||"object"==typeof args[3]){const options=args[3]||args[2];Object.keys(options).forEach(key=>{ret[key]=options[key]})}return ret},interpolation:{escapeValue:true,format:value=>value,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true},cacheInBuiltFormats:true});const transformOptions=options=>{if(isString(options.ns))options.ns=[options.ns];if(isString(options.fallbackLng))options.fallbackLng=[options.fallbackLng];if(isString(options.fallbackNS))options.fallbackNS=[options.fallbackNS];if(options.supportedLngs?.indexOf?.("cimode")<0)options.supportedLngs=options.supportedLngs.concat(["cimode"]);if("boolean"==typeof options.initImmediate)options.initAsync=options.initImmediate;return options};const noop=()=>{};const bindMemberFunctions=inst=>{const mems=Object.getOwnPropertyNames(Object.getPrototypeOf(inst));mems.forEach(mem=>{if("function"==typeof inst[mem])inst[mem]=inst[mem].bind(inst)})};class I18n extends EventEmitter{constructor(options={},callback){super();this.options=transformOptions(options);this.services={};this.logger=baseLogger;this.modules={external:[]};bindMemberFunctions(this);if(callback&&!this.isInitialized&&!options.isClone){if(!this.options.initAsync){this.init(options,callback);return this}setTimeout(()=>{this.init(options,callback)},0)}}init(options={},callback){this.isInitializing=true;if("function"==typeof options){callback=options;options={}}if(null==options.defaultNS&&options.ns){if(isString(options.ns))options.defaultNS=options.ns;else if(options.ns.indexOf("translation")<0)options.defaultNS=options.ns[0]}const defOpts=get();this.options={...defOpts,...this.options,...transformOptions(options)};this.options.interpolation={...defOpts.interpolation,...this.options.interpolation};if(void 0!==options.keySeparator)this.options.userDefinedKeySeparator=options.keySeparator;if(void 0!==options.nsSeparator)this.options.userDefinedNsSeparator=options.nsSeparator;const createClassOnDemand=ClassOrObject=>{if(!ClassOrObject)return null;if("function"==typeof ClassOrObject)return new ClassOrObject;return ClassOrObject};if(!this.options.isClone){if(this.modules.logger)baseLogger.init(createClassOnDemand(this.modules.logger),this.options);else baseLogger.init(null,this.options);let formatter;formatter=this.modules.formatter?this.modules.formatter:Formatter;const lu=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const s=this.services;s.logger=baseLogger;s.resourceStore=this.store;s.languageUtils=lu;s.pluralResolver=new PluralResolver(lu,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});const usingLegacyFormatFunction=this.options.interpolation.format&&this.options.interpolation.format!==defOpts.interpolation.format;if(usingLegacyFormatFunction)this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting");if(formatter&&(!this.options.interpolation.format||this.options.interpolation.format===defOpts.interpolation.format)){s.formatter=createClassOnDemand(formatter);if(s.formatter.init)s.formatter.init(s,this.options);this.options.interpolation.format=s.formatter.format.bind(s.formatter)}s.interpolator=new Interpolator(this.options);s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};s.backendConnector=new Connector(createClassOnDemand(this.modules.backend),s.resourceStore,s,this.options);s.backendConnector.on("*",(event,...args)=>{this.emit(event,...args)});if(this.modules.languageDetector){s.languageDetector=createClassOnDemand(this.modules.languageDetector);if(s.languageDetector.init)s.languageDetector.init(s,this.options.detection,this.options)}if(this.modules.i18nFormat){s.i18nFormat=createClassOnDemand(this.modules.i18nFormat);if(s.i18nFormat.init)s.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(event,...args)=>{this.emit(event,...args)});this.modules.external.forEach(m=>{if(m.init)m.init(this)})}this.format=this.options.interpolation.format;if(!callback)callback=noop;if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const codes=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(codes.length>0&&"dev"!==codes[0])this.options.lng=codes[0]}if(!this.services.languageDetector&&!this.options.lng)this.logger.warn("init: no languageDetector is used and no lng is defined");const storeApi=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];storeApi.forEach(fcName=>{this[fcName]=(...args)=>this.store[fcName](...args)});const storeApiChained=["addResource","addResources","addResourceBundle","removeResourceBundle"];storeApiChained.forEach(fcName=>{this[fcName]=(...args)=>{this.store[fcName](...args);return this}});const deferred=defer();const load=()=>{const finish=(err,t)=>{this.isInitializing=false;if(this.isInitialized&&!this.initializedStoreOnce)this.logger.warn("init: i18next is already initialized. You should call init just once!");this.isInitialized=true;if(!this.options.isClone)this.logger.log("initialized",this.options);this.emit("initialized",this.options);deferred.resolve(t);callback(err,t)};if(this.languages&&!this.isInitialized)return finish(null,this.t.bind(this));this.changeLanguage(this.options.lng,finish)};if(this.options.resources||!this.options.initAsync)load();else setTimeout(load,0);return deferred}loadResources(language,callback=noop){let usedCallback=callback;const usedLng=isString(language)?language:this.language;if("function"==typeof language)usedCallback=language;if(!this.options.resources||this.options.partialBundledLanguages){if(usedLng?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return usedCallback();const toLoad=[];const append=lng=>{if(!lng)return;if("cimode"===lng)return;const lngs=this.services.languageUtils.toResolveHierarchy(lng);lngs.forEach(l=>{if("cimode"===l)return;if(toLoad.indexOf(l)<0)toLoad.push(l)})};if(usedLng)append(usedLng);else{const fallbacks=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);fallbacks.forEach(l=>append(l))}this.options.preload?.forEach?.(l=>append(l));this.services.backendConnector.load(toLoad,this.options.ns,e=>{if(!e&&!this.resolvedLanguage&&this.language)this.setResolvedLanguage(this.language);usedCallback(e)})}else usedCallback(null)}reloadResources(lngs,ns,callback){const deferred=defer();if("function"==typeof lngs){callback=lngs;lngs=void 0}if("function"==typeof ns){callback=ns;ns=void 0}if(!lngs)lngs=this.languages;if(!ns)ns=this.options.ns;if(!callback)callback=noop;this.services.backendConnector.reload(lngs,ns,err=>{deferred.resolve();callback(err)});return deferred}use(module){if(!module)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!module.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");if("backend"===module.type)this.modules.backend=module;if("logger"===module.type||module.log&&module.warn&&module.error)this.modules.logger=module;if("languageDetector"===module.type)this.modules.languageDetector=module;if("i18nFormat"===module.type)this.modules.i18nFormat=module;if("postProcessor"===module.type)postProcessor.addPostProcessor(module);if("formatter"===module.type)this.modules.formatter=module;if("3rdParty"===module.type)this.modules.external.push(module);return this}setResolvedLanguage(l){if(!l||!this.languages)return;if(["cimode","dev"].indexOf(l)>-1)return;for(let li=0;li<this.languages.length;li++){const lngInLngs=this.languages[li];if(!(["cimode","dev"].indexOf(lngInLngs)>-1)){if(this.store.hasLanguageSomeTranslations(lngInLngs)){this.resolvedLanguage=lngInLngs;break}}}if(!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)){this.resolvedLanguage=l;this.languages.unshift(l)}}changeLanguage(lng,callback){this.isLanguageChangingTo=lng;const deferred=defer();this.emit("languageChanging",lng);const setLngProps=l=>{this.language=l;this.languages=this.services.languageUtils.toResolveHierarchy(l);this.resolvedLanguage=void 0;this.setResolvedLanguage(l)};const done=(err,l)=>{if(l){if(this.isLanguageChangingTo===lng){setLngProps(l);this.translator.changeLanguage(l);this.isLanguageChangingTo=void 0;this.emit("languageChanged",l);this.logger.log("languageChanged",l)}}else this.isLanguageChangingTo=void 0;deferred.resolve((...args)=>this.t(...args));if(callback)callback(err,(...args)=>this.t(...args))};const setLng=lngs=>{if(!lng&&!lngs&&this.services.languageDetector)lngs=[];const fl=isString(lngs)?lngs:lngs&&lngs[0];const l=this.store.hasLanguageSomeTranslations(fl)?fl:this.services.languageUtils.getBestMatchFromCodes(isString(lngs)?[lngs]:lngs);if(l){if(!this.language)setLngProps(l);if(!this.translator.language)this.translator.changeLanguage(l);this.services.languageDetector?.cacheUserLanguage?.(l)}this.loadResources(l,err=>{done(err,l)})};if(lng||!this.services.languageDetector||this.services.languageDetector.async)if(!lng&&this.services.languageDetector&&this.services.languageDetector.async)if(0===this.services.languageDetector.detect.length)this.services.languageDetector.detect().then(setLng);else this.services.languageDetector.detect(setLng);else setLng(lng);else setLng(this.services.languageDetector.detect());return deferred}getFixedT(lng,ns,keyPrefix){const fixedT=(key,opts,...rest)=>{let o;o="object"!=typeof opts?this.options.overloadTranslationOptionHandler([key,opts].concat(rest)):{...opts};o.lng=o.lng||fixedT.lng;o.lngs=o.lngs||fixedT.lngs;o.ns=o.ns||fixedT.ns;if(""!==o.keyPrefix)o.keyPrefix=o.keyPrefix||keyPrefix||fixedT.keyPrefix;const keySeparator=this.options.keySeparator||".";let resultKey;if(o.keyPrefix&&Array.isArray(key))resultKey=key.map(k=>{if("function"==typeof k)k=keysFromSelector(k,{...this.options,...opts});return`${o.keyPrefix}${keySeparator}${k}`});else{if("function"==typeof key)key=keysFromSelector(key,{...this.options,...opts});resultKey=o.keyPrefix?`${o.keyPrefix}${keySeparator}${key}`:key}return this.t(resultKey,o)};if(isString(lng))fixedT.lng=lng;else fixedT.lngs=lng;fixedT.ns=ns;fixedT.keyPrefix=keyPrefix;return fixedT}t(...args){return this.translator?.translate(...args)}exists(...args){return this.translator?.exists(...args)}setDefaultNamespace(ns){this.options.defaultNS=ns}hasLoadedNamespace(ns,options={}){if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}const lng=options.lng||this.resolvedLanguage||this.languages[0];const fallbackLng=this.options?this.options.fallbackLng:false;const lastLng=this.languages[this.languages.length-1];if("cimode"===lng.toLowerCase())return true;const loadNotPending=(l,n)=>{const loadState=this.services.backendConnector.state[`${l}|${n}`];return -1===loadState||0===loadState||2===loadState};if(options.precheck){const preResult=options.precheck(this,loadNotPending);if(void 0!==preResult)return preResult}if(this.hasResourceBundle(lng,ns))return true;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return true;if(loadNotPending(lng,ns)&&(!fallbackLng||loadNotPending(lastLng,ns)))return true;return false}loadNamespaces(ns,callback){const deferred=defer();if(!this.options.ns){if(callback)callback();return Promise.resolve()}if(isString(ns))ns=[ns];ns.forEach(n=>{if(this.options.ns.indexOf(n)<0)this.options.ns.push(n)});this.loadResources(err=>{deferred.resolve();if(callback)callback(err)});return deferred}loadLanguages(lngs,callback){const deferred=defer();if(isString(lngs))lngs=[lngs];const preloaded=this.options.preload||[];const newLngs=lngs.filter(lng=>preloaded.indexOf(lng)<0&&this.services.languageUtils.isSupportedCode(lng));if(!newLngs.length){if(callback)callback();return Promise.resolve()}this.options.preload=preloaded.concat(newLngs);this.loadResources(err=>{deferred.resolve();if(callback)callback(err)});return deferred}dir(lng){if(!lng)lng=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language);if(!lng)return"rtl";try{const l=new Intl.Locale(lng);if(l&&l.getTextInfo){const ti=l.getTextInfo();if(ti&&ti.direction)return ti.direction}}catch(e){}const rtlLngs=["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"];const languageUtils=this.services?.languageUtils||new LanguageUtil(get());if(lng.toLowerCase().indexOf("-latn")>1)return"ltr";return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng))>-1||lng.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(options={},callback){return new I18n(options,callback)}cloneInstance(options={},callback=noop){const forkResourceStore=options.forkResourceStore;if(forkResourceStore)delete options.forkResourceStore;const mergedOptions={...this.options,...options,isClone:true};const clone=new I18n(mergedOptions);if(void 0!==options.debug||void 0!==options.prefix)clone.logger=clone.logger.clone(options);const membersToCopy=["store","services","language"];membersToCopy.forEach(m=>{clone[m]=this[m]});clone.services={...this.services};clone.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)};if(forkResourceStore){const clonedData=Object.keys(this.store.data).reduce((prev,l)=>{prev[l]={...this.store.data[l]};prev[l]=Object.keys(prev[l]).reduce((acc,n)=>{acc[n]={...prev[l][n]};return acc},prev[l]);return prev},{});clone.store=new ResourceStore(clonedData,mergedOptions);clone.services.resourceStore=clone.store}clone.translator=new Translator(clone.services,mergedOptions);clone.translator.on("*",(event,...args)=>{clone.emit(event,...args)});clone.init(mergedOptions,callback);clone.translator.options=mergedOptions;clone.translator.backendConnector.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)};return clone}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;const createInstance=instance.createInstance;const dir=instance.dir;const init=instance.init;const loadResources=instance.loadResources;const reloadResources=instance.reloadResources;const use=instance.use;const changeLanguage=instance.changeLanguage;const getFixedT=instance.getFixedT;const t=instance.t;const exists=instance.exists;const setDefaultNamespace=instance.setDefaultNamespace;const hasLoadedNamespace=instance.hasLoadedNamespace;const loadNamespaces=instance.loadNamespaces;const loadLanguages=instance.loadLanguages}}]);
package/dist/mf/625.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["625"],{7216:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{useOrientation:()=>useOrientation,clamp:()=>clamp,useDebouncedValue:()=>useDebouncedValue,useMutationObserver:()=>useMutationObserver,useResizeObserver:()=>useResizeObserver,useSet:()=>useSet,randomId:()=>randomId,useShallowEffect:()=>useShallowEffect,useThrottledState:()=>useThrottledState,mergeRefs:()=>mergeRefs,usePrevious:()=>usePrevious,useLongPress:()=>useLongPress,useReducedMotion:()=>useReducedMotion,useSetState:()=>useSetState,readLocalStorageValue:()=>readLocalStorageValue,useCounter:()=>useCounter,useValidatedState:()=>useValidatedState,useDebouncedState:()=>useDebouncedState,useMove:()=>useMove,useFileDialog:()=>useFileDialog,useClipboard:()=>useClipboard,useIsomorphicEffect:()=>useIsomorphicEffect,useLogger:()=>useLogger,useIdle:()=>useIdle,useElementSize:()=>useElementSize,useClickOutside:()=>useClickOutside,shallowEqual:()=>shallowEqual,useNetwork:()=>useNetwork,useEyeDropper:()=>useEyeDropper,useId:()=>useId,range:()=>range,useMediaQuery:()=>useMediaQuery,useRadialMove:()=>useRadialMove,useHotkeys:()=>useHotkeys,useSelection:()=>useSelection,useWindowEvent:()=>useWindowEvent,useInterval:()=>useInterval,useHeadroom:()=>useHeadroom,useSessionStorage:()=>useSessionStorage,useDebouncedCallback:()=>useDebouncedCallback,useDocumentTitle:()=>useDocumentTitle,useFocusTrap:()=>useFocusTrap,useHash:()=>useHash,upperFirst:()=>upperFirst,useThrottledValue:()=>useThrottledValue,useOs:()=>useOs,normalizeRadialValue:()=>normalizeRadialValue,useDocumentVisibility:()=>useDocumentVisibility,useHover:()=>useHover,useMap:()=>useMap,useScrollIntoView:()=>useScrollIntoView,useFocusReturn:()=>useFocusReturn,usePageLeave:()=>usePageLeave,useMergedRef:()=>useMergedRef,useDidUpdate:()=>useDidUpdate,useInViewport:()=>useInViewport,useIsFirstRender:()=>useIsFirstRender,usePagination:()=>usePagination,useMouse:()=>useMouse,useFavicon:()=>useFavicon,useQueue:()=>useQueue,useTimeout:()=>useTimeout,useToggle:()=>useToggle,useColorScheme:()=>useColorScheme,useEventListener:()=>useEventListener,useFullscreen:()=>useFullscreen,useIntersection:()=>useIntersection,useLocalStorage:()=>useLocalStorage,useFocusWithin:()=>useFocusWithin,useMounted:()=>useMounted,assignRef:()=>assignRef,useThrottledCallback:()=>useThrottledCallback,useStateHistory:()=>useStateHistory,useViewportSize:()=>useViewportSize,getHotkeyHandler:()=>getHotkeyHandler,useCallbackRef:()=>useCallbackRef,useTextSelection:()=>useTextSelection,useWindowScroll:()=>useWindowScroll,useDisclosure:()=>useDisclosure,readSessionStorageValue:()=>readSessionStorageValue,clampUseMovePosition:()=>clampUseMovePosition,useInputState:()=>useInputState,useForceUpdate:()=>useForceUpdate,useFetch:()=>useFetch,useListState:()=>useListState,lowerFirst:()=>lowerFirst,useScrollSpy:()=>useScrollSpy,useUncontrolled:()=>useUncontrolled});"use client";function clamp(value,min,max){if(void 0===min&&void 0===max)return value;if(void 0!==min&&void 0===max)return Math.max(value,min);if(void 0===min&&void 0!==max)return Math.min(value,max);return Math.min(Math.max(value,min),max)}"use client";function lowerFirst(value){return"string"!=typeof value?"":value.charAt(0).toLowerCase()+value.slice(1)}"use client";function randomId(prefix="mantine-"){return`${prefix}${Math.random().toString(36).slice(2,11)}`}"use client";function range(start,end){const length=Math.abs(end-start)+1;const reversed=start>end;if(!reversed)return Array.from({length},(_,index)=>index+start);return Array.from({length},(_,index)=>start-index)}"use client";function shallowEqual(a,b){if(a===b)return true;if(Number.isNaN(a)&&Number.isNaN(b))return true;if(!(a instanceof Object)||!(b instanceof Object))return false;const keys=Object.keys(a);const{length}=keys;if(length!==Object.keys(b).length)return false;for(let i=0;i<length;i+=1){const key=keys[i];if(!(key in b))return false;if(a[key]!==b[key]&&!(Number.isNaN(a[key])&&Number.isNaN(b[key])))return false}return true}"use client";function upperFirst(value){return"string"!=typeof value?"":value.charAt(0).toUpperCase()+value.slice(1)}var index_js_=__webpack_require__(3620);"use client";function useCallbackRef(callback){const callbackRef=(0,index_js_.useRef)(callback);(0,index_js_.useEffect)(()=>{callbackRef.current=callback});return(0,index_js_.useMemo)(()=>(...args)=>callbackRef.current?.(...args),[])}"use client";function useDebouncedCallback(callback,options){const{delay,flushOnUnmount,leading}="number"==typeof options?{delay:options,flushOnUnmount:false,leading:false}:options;const handleCallback=useCallbackRef(callback);const debounceTimerRef=(0,index_js_.useRef)(0);const lastCallback=(0,index_js_.useMemo)(()=>{const currentCallback=Object.assign((...args)=>{window.clearTimeout(debounceTimerRef.current);const isFirstCall=currentCallback._isFirstCall;currentCallback._isFirstCall=false;function clearTimeoutAndLeadingRef(){window.clearTimeout(debounceTimerRef.current);debounceTimerRef.current=0;currentCallback._isFirstCall=true}if(leading&&isFirstCall){handleCallback(...args);const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}if(leading&&!isFirstCall){const flush2=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel2=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush2;currentCallback.cancel=cancel2;const resetLeadingState=()=>{clearTimeoutAndLeadingRef()};debounceTimerRef.current=window.setTimeout(resetLeadingState,delay);return}const flush=()=>{if(0!==debounceTimerRef.current){clearTimeoutAndLeadingRef();handleCallback(...args)}};const cancel=()=>{clearTimeoutAndLeadingRef()};currentCallback.flush=flush;currentCallback.cancel=cancel;debounceTimerRef.current=window.setTimeout(flush,delay)},{flush:()=>{},cancel:()=>{},_isFirstCall:true});return currentCallback},[handleCallback,delay,leading]);(0,index_js_.useEffect)(()=>()=>{if(flushOnUnmount)lastCallback.flush();else lastCallback.cancel()},[lastCallback,flushOnUnmount]);return lastCallback}"use client";const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(callback,events,nodes){const ref=(0,index_js_.useRef)(null);const eventsList=events||DEFAULT_EVENTS;(0,index_js_.useEffect)(()=>{const listener=event=>{const{target}=event??{};if(Array.isArray(nodes)){const shouldIgnore=!document.body.contains(target)&&target?.tagName!=="HTML";const shouldTrigger=nodes.every(node=>!!node&&!event.composedPath().includes(node));shouldTrigger&&!shouldIgnore&&callback(event)}else if(ref.current&&!ref.current.contains(target))callback(event)};eventsList.forEach(fn=>document.addEventListener(fn,listener));return()=>{eventsList.forEach(fn=>document.removeEventListener(fn,listener))}},[ref,callback,nodes]);return ref}"use client";function useClipboard(options={timeout:2e3}){const[error,setError]=(0,index_js_.useState)(null);const[copied,setCopied]=(0,index_js_.useState)(false);const[copyTimeout,setCopyTimeout]=(0,index_js_.useState)(null);const handleCopyResult=value=>{window.clearTimeout(copyTimeout);setCopyTimeout(window.setTimeout(()=>setCopied(false),options.timeout));setCopied(value)};const copy=value=>{if("clipboard"in navigator)navigator.clipboard.writeText(value).then(()=>handleCopyResult(true)).catch(err=>setError(err));else setError(new Error("useClipboard: navigator.clipboard is not supported"))};const reset=()=>{setCopied(false);setError(null);window.clearTimeout(copyTimeout)};return{copy,reset,error,copied}}"use client";function attachMediaListener(query,callback){try{query.addEventListener("change",callback);return()=>query.removeEventListener("change",callback)}catch(e){query.addListener(callback);return()=>query.removeListener(callback)}}function getInitialValue(query,initialValue){if("undefined"!=typeof window&&"matchMedia"in window)return window.matchMedia(query).matches;return false}function useMediaQuery(query,initialValue,{getInitialValueInEffect}={getInitialValueInEffect:true}){const[matches,setMatches]=(0,index_js_.useState)(getInitialValueInEffect?initialValue:getInitialValue(query));(0,index_js_.useEffect)(()=>{try{const mediaQuery=window.matchMedia(query);setMatches(mediaQuery.matches);return attachMediaListener(mediaQuery,event=>setMatches(event.matches))}catch(e){return}},[query]);return matches||false}"use client";function useColorScheme(initialValue,options){return useMediaQuery("(prefers-color-scheme: dark)","dark"===initialValue,options)?"dark":"light"}"use client";const DEFAULT_OPTIONS={min:-1/0,max:1/0};function useCounter(initialValue=0,options){const{min,max}={...DEFAULT_OPTIONS,...options};const[count,setCount]=(0,index_js_.useState)(clamp(initialValue,min,max));const increment=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current+1,min,max)),[min,max]);const decrement=(0,index_js_.useCallback)(()=>setCount(current=>clamp(current-1,min,max)),[min,max]);const set=(0,index_js_.useCallback)(value=>setCount(clamp(value,min,max)),[min,max]);const reset=(0,index_js_.useCallback)(()=>setCount(clamp(initialValue,min,max)),[initialValue,min,max]);return[count,{increment,decrement,set,reset}]}"use client";function useDebouncedState(defaultValue,wait,options={leading:false}){const[value,setValue]=(0,index_js_.useState)(defaultValue);const timeoutRef=(0,index_js_.useRef)(null);const leadingRef=(0,index_js_.useRef)(true);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);(0,index_js_.useEffect)(()=>clearTimeout1,[]);const debouncedSetValue=(0,index_js_.useCallback)(newValue=>{clearTimeout1();if(leadingRef.current&&options.leading)setValue(newValue);else timeoutRef.current=window.setTimeout(()=>{leadingRef.current=true;setValue(newValue)},wait);leadingRef.current=false},[options.leading]);return[value,debouncedSetValue]}"use client";function useDebouncedValue(value,wait,options={leading:false}){const[_value,setValue]=(0,index_js_.useState)(value);const mountedRef=(0,index_js_.useRef)(false);const timeoutRef=(0,index_js_.useRef)(null);const cooldownRef=(0,index_js_.useRef)(false);const cancel=(0,index_js_.useCallback)(()=>window.clearTimeout(timeoutRef.current),[]);(0,index_js_.useEffect)(()=>{if(mountedRef.current)if(!cooldownRef.current&&options.leading){cooldownRef.current=true;setValue(value)}else{cancel();timeoutRef.current=window.setTimeout(()=>{cooldownRef.current=false;setValue(value)},wait)}},[value,options.leading,wait]);(0,index_js_.useEffect)(()=>{mountedRef.current=true;return cancel},[]);return[_value,cancel]}"use client";const useIsomorphicEffect="undefined"!=typeof document?index_js_.useLayoutEffect:index_js_.useEffect;"use client";function useDocumentTitle(title){useIsomorphicEffect(()=>{if("string"==typeof title&&title.trim().length>0)document.title=title.trim()},[title])}"use client";function useDocumentVisibility(){const[documentVisibility,setDocumentVisibility]=(0,index_js_.useState)("visible");(0,index_js_.useEffect)(()=>{setDocumentVisibility(document.visibilityState);const listener=()=>setDocumentVisibility(document.visibilityState);document.addEventListener("visibilitychange",listener);return()=>document.removeEventListener("visibilitychange",listener)},[]);return documentVisibility}"use client";function useDidUpdate(fn,dependencies){const mounted=(0,index_js_.useRef)(false);(0,index_js_.useEffect)(()=>()=>{mounted.current=false},[]);(0,index_js_.useEffect)(()=>{if(mounted.current)return fn();mounted.current=true},dependencies)}"use client";function useFocusReturn({opened,shouldReturnFocus=true}){const lastActiveElement=(0,index_js_.useRef)(null);const returnFocus=()=>{if(lastActiveElement.current&&"focus"in lastActiveElement.current&&"function"==typeof lastActiveElement.current.focus)lastActiveElement.current?.focus({preventScroll:true})};useDidUpdate(()=>{let timeout=-1;const clearFocusTimeout=event=>{if("Tab"===event.key)window.clearTimeout(timeout)};document.addEventListener("keydown",clearFocusTimeout);if(opened)lastActiveElement.current=document.activeElement;else if(shouldReturnFocus)timeout=window.setTimeout(returnFocus,10);return()=>{window.clearTimeout(timeout);document.removeEventListener("keydown",clearFocusTimeout)}},[opened,shouldReturnFocus]);return returnFocus}"use client";const TABBABLE_NODES=/input|select|textarea|button|object/;const FOCUS_SELECTOR="a, input, select, textarea, button, object, [tabindex]";function tabbable_hidden(element){return"none"===element.style.display}function visible(element){const isHidden=element.getAttribute("aria-hidden")||element.getAttribute("hidden")||"hidden"===element.getAttribute("type");if(isHidden)return false;let parentElement=element;while(parentElement){if(parentElement===document.body||11===parentElement.nodeType)break;if(tabbable_hidden(parentElement))return false;parentElement=parentElement.parentNode}return true}function getElementTabIndex(element){let tabIndex=element.getAttribute("tabindex");if(null===tabIndex)tabIndex=void 0;return parseInt(tabIndex,10)}function focusable(element){const nodeName=element.nodeName.toLowerCase();const isTabIndexNotNaN=!Number.isNaN(getElementTabIndex(element));const res=TABBABLE_NODES.test(nodeName)&&!element.disabled||(element instanceof HTMLAnchorElement?element.href||isTabIndexNotNaN:isTabIndexNotNaN);return res&&visible(element)}function tabbable_tabbable(element){const tabIndex=getElementTabIndex(element);const isTabIndexNaN=Number.isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element)}function findTabbableDescendants(element){return Array.from(element.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable_tabbable)}"use client";function scopeTab(node,event){const tabbable=findTabbableDescendants(node);if(!tabbable.length)return void event.preventDefault();const finalTabbable=tabbable[event.shiftKey?0:tabbable.length-1];const root=node.getRootNode();let leavingFinalTabbable=finalTabbable===root.activeElement||node===root.activeElement;const activeElement=root.activeElement;const activeElementIsRadio="INPUT"===activeElement.tagName&&"radio"===activeElement.getAttribute("type");if(activeElementIsRadio){const activeRadioGroup=tabbable.filter(element=>"radio"===element.getAttribute("type")&&element.getAttribute("name")===activeElement.getAttribute("name"));leavingFinalTabbable=activeRadioGroup.includes(finalTabbable)}if(!leavingFinalTabbable)return;event.preventDefault();const target=tabbable[event.shiftKey?tabbable.length-1:0];if(target)target.focus()}"use client";function useFocusTrap(active=true){const ref=(0,index_js_.useRef)(null);const focusNode=node=>{let focusElement=node.querySelector("[data-autofocus]");if(!focusElement){const children=Array.from(node.querySelectorAll(FOCUS_SELECTOR));focusElement=children.find(tabbable_tabbable)||children.find(focusable)||null;if(!focusElement&&focusable(node))focusElement=node}if(focusElement)focusElement.focus({preventScroll:true})};const setRef=(0,index_js_.useCallback)(node=>{if(!active)return;if(null===node)return;if(ref.current===node)return;if(node){setTimeout(()=>{if(node.getRootNode())focusNode(node)});ref.current=node}else ref.current=null},[active]);(0,index_js_.useEffect)(()=>{if(!active)return;ref.current&&setTimeout(()=>focusNode(ref.current));const handleKeyDown=event=>{if("Tab"===event.key&&ref.current)scopeTab(ref.current,event)};document.addEventListener("keydown",handleKeyDown);return()=>document.removeEventListener("keydown",handleKeyDown)},[active]);return setRef}"use client";const reducer=value=>(value+1)%1e6;function useForceUpdate(){const[,update]=(0,index_js_.useReducer)(reducer,0);return update}"use client";const __useId=index_js_["useId".toString()]||(()=>void 0);function useReactId(){const id=__useId();return id?`mantine-${id.replace(/:/g,"")}`:""}"use client";function useId(staticId){const reactId=useReactId();const[uuid,setUuid]=(0,index_js_.useState)(reactId);useIsomorphicEffect(()=>{setUuid(randomId())},[]);if("string"==typeof staticId)return staticId;if("undefined"==typeof window)return reactId;return uuid}"use client";const use_idle_DEFAULT_OPTIONS={events:["keydown","mousemove","touchmove","click","scroll","wheel"],initialState:true};function useIdle(timeout,options){const{events,initialState}={...use_idle_DEFAULT_OPTIONS,...options};const[idle,setIdle]=(0,index_js_.useState)(initialState);const timer=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>{const handleEvents=()=>{setIdle(false);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>{setIdle(true)},timeout)};events.forEach(event=>document.addEventListener(event,handleEvents));timer.current=window.setTimeout(()=>{setIdle(true)},timeout);return()=>{events.forEach(event=>document.removeEventListener(event,handleEvents));window.clearTimeout(timer.current);timer.current=-1}},[timeout]);return idle}"use client";function useInterval(fn,interval,{autoInvoke=false}={}){const[active,setActive]=(0,index_js_.useState)(false);const intervalRef=(0,index_js_.useRef)(null);const fnRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)(()=>{setActive(old=>{if(!old&&(!intervalRef.current||-1===intervalRef.current))intervalRef.current=window.setInterval(fnRef.current,interval);return true})},[]);const stop=(0,index_js_.useCallback)(()=>{setActive(false);window.clearInterval(intervalRef.current||-1);intervalRef.current=-1},[]);const toggle=(0,index_js_.useCallback)(()=>{if(active)stop();else start()},[active]);(0,index_js_.useEffect)(()=>{fnRef.current=fn;active&&start();return stop},[fn,active,interval]);(0,index_js_.useEffect)(()=>{if(autoInvoke)start()},[]);return{start,stop,toggle,active}}"use client";function useListState(initialValue=[]){const[state,setState]=(0,index_js_.useState)(initialValue);const append=(...items)=>setState(current=>[...current,...items]);const prepend=(...items)=>setState(current=>[...items,...current]);const insert=(index,...items)=>setState(current=>[...current.slice(0,index),...items,...current.slice(index)]);const apply=fn=>setState(current=>current.map((item,index)=>fn(item,index)));const remove=(...indices)=>setState(current=>current.filter((_,index)=>!indices.includes(index)));const pop=()=>setState(current=>{const cloned=[...current];cloned.pop();return cloned});const shift=()=>setState(current=>{const cloned=[...current];cloned.shift();return cloned});const reorder=({from,to})=>setState(current=>{const cloned=[...current];const item=current[from];cloned.splice(from,1);cloned.splice(to,0,item);return cloned});const swap=({from,to})=>setState(current=>{const cloned=[...current];const fromItem=cloned[from];const toItem=cloned[to];cloned.splice(to,1,fromItem);cloned.splice(from,1,toItem);return cloned});const setItem=(index,item)=>setState(current=>{const cloned=[...current];cloned[index]=item;return cloned});const setItemProp=(index,prop,value)=>setState(current=>{const cloned=[...current];cloned[index]={...cloned[index],[prop]:value};return cloned});const applyWhere=(condition,fn)=>setState(current=>current.map((item,index)=>condition(item,index)?fn(item,index):item));const filter=fn=>{setState(current=>current.filter(fn))};return[state,{setState,append,prepend,insert,pop,shift,apply,applyWhere,remove,reorder,swap,setItem,setItemProp,filter}]}"use client";function useWindowEvent(type,listener,options){(0,index_js_.useEffect)(()=>{window.addEventListener(type,listener,options);return()=>window.removeEventListener(type,listener,options)},[type,listener])}"use client";function serializeJSON(value,hookName="use-local-storage"){try{return JSON.stringify(value)}catch(error){throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`)}}function deserializeJSON(value){try{return value&&JSON.parse(value)}catch{return value}}function createStorageHandler(type){const getItem=key=>{try{return window[type].getItem(key)}catch(error){console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked");return null}};const setItem=(key,value)=>{try{window[type].setItem(key,value)}catch(error){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}};const removeItem=key=>{try{window[type].removeItem(key)}catch(error){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}};return{getItem,setItem,removeItem}}function createStorage(type,hookName){const eventName="localStorage"===type?"mantine-local-storage":"mantine-session-storage";const{getItem,setItem,removeItem}=createStorageHandler(type);return function({key,defaultValue,getInitialValueInEffect=true,sync=true,deserialize=deserializeJSON,serialize=value=>serializeJSON(value,hookName)}){const readStorageValue=(0,index_js_.useCallback)(skipStorage=>{let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]||!!skipStorage}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue},[key,defaultValue]);const[value,setValue]=(0,index_js_.useState)(readStorageValue(getInitialValueInEffect));const setStorageValue=(0,index_js_.useCallback)(val=>{if(val instanceof Function)setValue(current=>{const result=val(current);setItem(key,serialize(result));queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val(current)}}))});return result});else{setItem(key,serialize(val));window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:val}}));setValue(val)}},[key]);const removeStorageValue=(0,index_js_.useCallback)(()=>{removeItem(key);setValue(defaultValue);window.dispatchEvent(new CustomEvent(eventName,{detail:{key,value:defaultValue}}))},[key,defaultValue]);useWindowEvent("storage",event=>{if(sync){if(event.storageArea===window[type]&&event.key===key)setValue(deserialize(event.newValue??void 0))}});useWindowEvent(eventName,event=>{if(sync){if(event.detail.key===key)setValue(event.detail.value)}});(0,index_js_.useEffect)(()=>{if(void 0!==defaultValue&&void 0===value)setStorageValue(defaultValue)},[defaultValue,value,setStorageValue]);(0,index_js_.useEffect)(()=>{const val=readStorageValue();void 0!==val&&setStorageValue(val)},[key]);return[void 0===value?defaultValue:value,setStorageValue,removeStorageValue]}}function readValue(type){const{getItem}=createStorageHandler(type);return function({key,defaultValue,deserialize=deserializeJSON}){let storageBlockedOrSkipped;try{storageBlockedOrSkipped="undefined"==typeof window||!(type in window)||null===window[type]}catch(_e){storageBlockedOrSkipped=true}if(storageBlockedOrSkipped)return defaultValue;const storageValue=getItem(key);return null!==storageValue?deserialize(storageValue):defaultValue}}"use client";function useLocalStorage(props){return createStorage("localStorage","use-local-storage")(props)}const readLocalStorageValue=readValue("localStorage");"use client";function useSessionStorage(props){return createStorage("sessionStorage","use-session-storage")(props)}const readSessionStorageValue=readValue("sessionStorage");"use client";function assignRef(ref,value){if("function"==typeof ref)return ref(value);if("object"==typeof ref&&null!==ref&&"current"in ref)ref.current=value}function mergeRefs(...refs){const cleanupMap=/* @__PURE__ */new Map;return node=>{refs.forEach(ref=>{const cleanup=assignRef(ref,node);if(cleanup)cleanupMap.set(ref,cleanup)});if(cleanupMap.size>0)return()=>{refs.forEach(ref=>{const cleanup=cleanupMap.get(ref);if(cleanup&&"function"==typeof cleanup)cleanup();else assignRef(ref,null)});cleanupMap.clear()}}}function useMergedRef(...refs){return(0,index_js_.useCallback)(mergeRefs(...refs),refs)}"use client";function useMouse(options={resetOnExit:false}){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});const ref=(0,index_js_.useRef)(null);const setMousePosition=event=>{if(ref.current){const rect=event.currentTarget.getBoundingClientRect();const x=Math.max(0,Math.round(event.pageX-rect.left-(window.scrollX||window.scrollX)));const y=Math.max(0,Math.round(event.pageY-rect.top-(window.scrollY||window.scrollY)));setPosition({x,y})}else setPosition({x:event.clientX,y:event.clientY})};const resetMousePosition=()=>setPosition({x:0,y:0});(0,index_js_.useEffect)(()=>{const element=ref?.current?ref.current:document;element.addEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.addEventListener("mouseleave",resetMousePosition);return()=>{element.removeEventListener("mousemove",setMousePosition);if(options.resetOnExit)element.removeEventListener("mouseleave",resetMousePosition)}},[ref.current]);return{ref,...position}}"use client";function clampUseMovePosition(position){return{x:clamp(position.x,0,1),y:clamp(position.y,0,1)}}function useMove(onChange,handlers,dir="ltr"){const mounted=(0,index_js_.useRef)(false);const isSliding=(0,index_js_.useRef)(false);const frame=(0,index_js_.useRef)(0);const[active,setActive]=(0,index_js_.useState)(false);const cleanupRef=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{if(cleanupRef.current){cleanupRef.current();cleanupRef.current=null}if(!node)return;const onScrub=({x,y})=>{cancelAnimationFrame(frame.current);frame.current=requestAnimationFrame(()=>{if(mounted.current&&node){node.style.userSelect="none";const rect=node.getBoundingClientRect();if(rect.width&&rect.height){const _x=clamp((x-rect.left)/rect.width,0,1);onChange({x:"ltr"===dir?_x:1-_x,y:clamp((y-rect.top)/rect.height,0,1)})}}})};const bindEvents=()=>{document.addEventListener("mousemove",onMouseMove);document.addEventListener("mouseup",stopScrubbing);document.addEventListener("touchmove",onTouchMove,{passive:false});document.addEventListener("touchend",stopScrubbing)};const unbindEvents=()=>{document.removeEventListener("mousemove",onMouseMove);document.removeEventListener("mouseup",stopScrubbing);document.removeEventListener("touchmove",onTouchMove);document.removeEventListener("touchend",stopScrubbing)};const startScrubbing=()=>{if(!isSliding.current&&mounted.current){isSliding.current=true;"function"==typeof handlers?.onScrubStart&&handlers.onScrubStart();setActive(true);bindEvents()}};const stopScrubbing=()=>{if(isSliding.current&&mounted.current){isSliding.current=false;setActive(false);unbindEvents();setTimeout(()=>{"function"==typeof handlers?.onScrubEnd&&handlers.onScrubEnd()},0)}};const onMouseDown=event=>{startScrubbing();event.preventDefault();onMouseMove(event)};const onMouseMove=event=>onScrub({x:event.clientX,y:event.clientY});const onTouchStart=event=>{if(event.cancelable)event.preventDefault();startScrubbing();onTouchMove(event)};const onTouchMove=event=>{if(event.cancelable)event.preventDefault();onScrub({x:event.changedTouches[0].clientX,y:event.changedTouches[0].clientY})};node.addEventListener("mousedown",onMouseDown);node.addEventListener("touchstart",onTouchStart,{passive:false});cleanupRef.current=()=>{node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",onTouchStart)}},[dir,onChange]);return{ref:refCallback,active}}"use client";function useUncontrolled({value,defaultValue,finalValue,onChange=()=>{}}){const[uncontrolledValue,setUncontrolledValue]=(0,index_js_.useState)(void 0!==defaultValue?defaultValue:finalValue);const handleUncontrolledChange=(val,...payload)=>{setUncontrolledValue(val);onChange?.(val,...payload)};if(void 0!==value)return[value,onChange,true];return[uncontrolledValue,handleUncontrolledChange,false]}"use client";function use_pagination_range(start,end){const length=end-start+1;return Array.from({length},(_,index)=>index+start)}const DOTS="dots";function usePagination({total,siblings=1,boundaries=1,page,initialPage=1,onChange}){const _total=Math.max(Math.trunc(total),0);const[activePage,setActivePage]=useUncontrolled({value:page,onChange,defaultValue:initialPage,finalValue:initialPage});const setPage=pageNumber=>{if(pageNumber<=0)setActivePage(1);else pageNumber>_total?setActivePage(_total):setActivePage(pageNumber)};const next=()=>setPage(activePage+1);const previous=()=>setPage(activePage-1);const first=()=>setPage(1);const last=()=>setPage(_total);const paginationRange=(0,index_js_.useMemo)(()=>{const totalPageNumbers=2*siblings+3+2*boundaries;if(totalPageNumbers>=_total)return use_pagination_range(1,_total);const leftSiblingIndex=Math.max(activePage-siblings,boundaries);const rightSiblingIndex=Math.min(activePage+siblings,_total-boundaries);const shouldShowLeftDots=leftSiblingIndex>boundaries+2;const shouldShowRightDots=rightSiblingIndex<_total-(boundaries+1);if(!shouldShowLeftDots&&shouldShowRightDots){const leftItemCount=2*siblings+boundaries+2;return[...use_pagination_range(1,leftItemCount),DOTS,...use_pagination_range(_total-(boundaries-1),_total)]}if(shouldShowLeftDots&&!shouldShowRightDots){const rightItemCount=boundaries+1+2*siblings;return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(_total-rightItemCount,_total)]}return[...use_pagination_range(1,boundaries),DOTS,...use_pagination_range(leftSiblingIndex,rightSiblingIndex),DOTS,...use_pagination_range(_total-boundaries+1,_total)]},[_total,siblings,activePage]);return{range:paginationRange,active:activePage,setPage,next,previous,first,last}}"use client";function useQueue({initialValues=[],limit}){const[state,setState]=(0,index_js_.useState)({state:initialValues.slice(0,limit),queue:initialValues.slice(limit)});const add=(...items)=>setState(current=>{const results=[...current.state,...current.queue,...items];return{state:results.slice(0,limit),queue:results.slice(limit)}});const update=fn=>setState(current=>{const results=fn([...current.state,...current.queue]);return{state:results.slice(0,limit),queue:results.slice(limit)}});const cleanQueue=()=>setState(current=>({state:current.state,queue:[]}));return{state:state.state,queue:state.queue,add,update,cleanQueue}}"use client";function usePageLeave(onPageLeave){(0,index_js_.useEffect)(()=>{document.documentElement.addEventListener("mouseleave",onPageLeave);return()=>document.documentElement.removeEventListener("mouseleave",onPageLeave)},[])}"use client";function useReducedMotion(initialValue,options){return useMediaQuery("(prefers-reduced-motion: reduce)",initialValue,options)}"use client";function useScrollIntoView({duration=1250,axis="y",onScrollFinish,easing=easeInOutQuad,offset=0,cancelable=true,isList=false}={}){const frameID=(0,index_js_.useRef)(0);const startTime=(0,index_js_.useRef)(0);const shouldStop=(0,index_js_.useRef)(false);const scrollableRef=(0,index_js_.useRef)(null);const targetRef=(0,index_js_.useRef)(null);const reducedMotion=useReducedMotion();const cancel=()=>{if(frameID.current)cancelAnimationFrame(frameID.current)};const scrollIntoView=(0,index_js_.useCallback)(({alignment="start"}={})=>{shouldStop.current=false;if(frameID.current)cancel();const start=getScrollStart({parent:scrollableRef.current,axis})??0;const change=getRelativePosition({parent:scrollableRef.current,target:targetRef.current,axis,alignment,offset,isList})-(scrollableRef.current?0:start);function animateScroll(){if(0===startTime.current)startTime.current=performance.now();const now=performance.now();const elapsed=now-startTime.current;const t=reducedMotion||0===duration?1:elapsed/duration;const distance=start+change*easing(t);setScrollParam({parent:scrollableRef.current,axis,distance});if(!shouldStop.current&&t<1)frameID.current=requestAnimationFrame(animateScroll);else{"function"==typeof onScrollFinish&&onScrollFinish();startTime.current=0;frameID.current=0;cancel()}}animateScroll()},[axis,duration,easing,isList,offset,onScrollFinish,reducedMotion]);const handleStop=()=>{if(cancelable)shouldStop.current=true};useWindowEvent("wheel",handleStop,{passive:true});useWindowEvent("touchmove",handleStop,{passive:true});(0,index_js_.useEffect)(()=>cancel,[]);return{scrollableRef,targetRef,scrollIntoView,cancel}}function easeInOutQuad(t){return t<.5?2*t*t:-1+(4-2*t)*t}function getRelativePosition({axis,target,parent,alignment,offset,isList}){if(!target||!parent&&"undefined"==typeof document)return 0;const isCustomParent=!!parent;const parentElement=parent||document.body;const parentPosition=parentElement.getBoundingClientRect();const targetPosition=target.getBoundingClientRect();const getDiff=property=>targetPosition[property]-parentPosition[property];if("y"===axis){const diff=getDiff("top");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}const parentHeight=isCustomParent?parentPosition.height:window.innerHeight;if("end"===alignment){const distance=diff+offset-parentHeight+targetPosition.height;const shouldScroll=distance>=-targetPosition.height*(isList?0:1)||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentHeight/2+targetPosition.height/2;return 0}if("x"===axis){const diff=getDiff("left");if(0===diff)return 0;if("start"===alignment){const distance=diff-offset;const shouldScroll=distance<=targetPosition.width||!isList;return shouldScroll?distance:0}const parentWidth=isCustomParent?parentPosition.width:window.innerWidth;if("end"===alignment){const distance=diff+offset-parentWidth+targetPosition.width;const shouldScroll=distance>=-targetPosition.width||!isList;return shouldScroll?distance:0}if("center"===alignment)return diff-parentWidth/2+targetPosition.width/2}return 0}function getScrollStart({axis,parent}){if(!parent&&"undefined"==typeof document)return 0;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)return parent[method];const{body,documentElement}=document;return body[method]+documentElement[method]}function setScrollParam({axis,parent,distance}){if(!parent&&"undefined"==typeof document)return;const method="y"===axis?"scrollTop":"scrollLeft";if(parent)parent[method]=distance;else{const{body,documentElement}=document;body[method]=distance;documentElement[method]=distance}}"use client";const defaultState={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function useResizeObserver(options){const frameID=(0,index_js_.useRef)(0);const ref=(0,index_js_.useRef)(null);const[rect,setRect]=(0,index_js_.useState)(defaultState);const observer=(0,index_js_.useMemo)(()=>"undefined"!=typeof window?new ResizeObserver(entries=>{const entry=entries[0];if(entry){cancelAnimationFrame(frameID.current);frameID.current=requestAnimationFrame(()=>{if(ref.current){const boxSize=entry.borderBoxSize?.[0]||entry.contentBoxSize?.[0];if(boxSize){const width=boxSize.inlineSize;const height=boxSize.blockSize;setRect({width,height,x:entry.contentRect.x,y:entry.contentRect.y,top:entry.contentRect.top,left:entry.contentRect.left,bottom:entry.contentRect.bottom,right:entry.contentRect.right})}else setRect(entry.contentRect)}})}}):null,[]);(0,index_js_.useEffect)(()=>{if(ref.current)observer?.observe(ref.current,options);return()=>{observer?.disconnect();if(frameID.current)cancelAnimationFrame(frameID.current)}},[ref.current]);return[ref,rect]}function useElementSize(options){const[ref,{width,height}]=useResizeObserver(options);return{ref,width,height}}"use client";function shallowCompare(prevValue,currValue){if(!prevValue||!currValue)return false;if(prevValue===currValue)return true;if(prevValue.length!==currValue.length)return false;for(let i=0;i<prevValue.length;i+=1)if(!shallowEqual(prevValue[i],currValue[i]))return false;return true}function useShallowCompare(dependencies){const ref=(0,index_js_.useRef)([]);const updateRef=(0,index_js_.useRef)(0);if(!shallowCompare(ref.current,dependencies)){ref.current=dependencies;updateRef.current+=1}return[updateRef.current]}function useShallowEffect(cb,dependencies){(0,index_js_.useEffect)(cb,useShallowCompare(dependencies))}"use client";function useToggle(options=[false,true]){const[[option],toggle]=(0,index_js_.useReducer)((state,action)=>{const value=action instanceof Function?action(state[0]):action;const index=Math.abs(state.indexOf(value));return state.slice(index).concat(state.slice(0,index))},options);return[option,toggle]}"use client";const eventListerOptions={passive:true};function useViewportSize(){const[windowSize,setWindowSize]=(0,index_js_.useState)({width:0,height:0});const setSize=(0,index_js_.useCallback)(()=>{setWindowSize({width:window.innerWidth||0,height:window.innerHeight||0})},[]);useWindowEvent("resize",setSize,eventListerOptions);useWindowEvent("orientationchange",setSize,eventListerOptions);(0,index_js_.useEffect)(setSize,[]);return windowSize}"use client";function getScrollPosition(){return"undefined"!=typeof window?{x:window.scrollX,y:window.scrollY}:{x:0,y:0}}function scrollTo({x,y}){if("undefined"!=typeof window){const scrollOptions={behavior:"smooth"};if("number"==typeof x)scrollOptions.left=x;if("number"==typeof y)scrollOptions.top=y;window.scrollTo(scrollOptions)}}function useWindowScroll(){const[position,setPosition]=(0,index_js_.useState)({x:0,y:0});useWindowEvent("scroll",()=>setPosition(getScrollPosition()));useWindowEvent("resize",()=>setPosition(getScrollPosition()));(0,index_js_.useEffect)(()=>{setPosition(getScrollPosition())},[]);return[position,scrollTo]}"use client";function useIntersection(options){const[entry,setEntry]=(0,index_js_.useState)(null);const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useCallback)(element=>{if(observer.current){observer.current.disconnect();observer.current=null}if(null===element)return void setEntry(null);observer.current=new IntersectionObserver(([_entry])=>{setEntry(_entry)},options);observer.current.observe(element)},[options?.rootMargin,options?.root,options?.threshold]);return{ref,entry}}"use client";function useHash({getInitialValueInEffect=true}={}){const[hash,setHash]=(0,index_js_.useState)(getInitialValueInEffect?"":window.location.hash||"");const setHashHandler=value=>{const valueWithHash=value.startsWith("#")?value:`#${value}`;window.location.hash=valueWithHash;setHash(valueWithHash)};useWindowEvent("hashchange",()=>{const newHash=window.location.hash;if(hash!==newHash)setHash(newHash)});(0,index_js_.useEffect)(()=>{if(getInitialValueInEffect)setHash(window.location.hash)},[]);return[hash,setHashHandler]}"use client";const keyNameMap={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function normalizeKey(key){const lowerKey=key.replace("Key","").toLowerCase();return keyNameMap[key]||lowerKey}function parseHotkey(hotkey){const keys=hotkey.toLowerCase().split("+").map(part=>part.trim());const modifiers={alt:keys.includes("alt"),ctrl:keys.includes("ctrl"),meta:keys.includes("meta"),mod:keys.includes("mod"),shift:keys.includes("shift"),plus:keys.includes("[plus]")};const reservedKeys=["alt","ctrl","meta","shift","mod"];const freeKey=keys.find(key=>!reservedKeys.includes(key));return{...modifiers,key:"[plus]"===freeKey?"+":freeKey}}function isExactHotkey(hotkey,event,usePhysicalKeys){const{alt,ctrl,meta,mod,shift,key}=hotkey;const{altKey,ctrlKey,metaKey,shiftKey,key:pressedKey,code:pressedCode}=event;if(alt!==altKey)return false;if(mod){if(!ctrlKey&&!metaKey)return false}else{if(ctrl!==ctrlKey)return false;if(meta!==metaKey)return false}if(shift!==shiftKey)return false;if(key&&(usePhysicalKeys?normalizeKey(pressedCode)===normalizeKey(key):normalizeKey(pressedKey??pressedCode)===normalizeKey(key)))return true;return false}function getHotkeyMatcher(hotkey,usePhysicalKeys){return event=>isExactHotkey(parseHotkey(hotkey),event,usePhysicalKeys)}function getHotkeyHandler(hotkeys){return event=>{const _event="nativeEvent"in event?event.nativeEvent:event;hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(_event)){if(options.preventDefault)event.preventDefault();handler(_event)}})}}"use client";function shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable=false){if(event.target instanceof HTMLElement){if(triggerOnContentEditable)return!tagsToIgnore.includes(event.target.tagName);return!event.target.isContentEditable&&!tagsToIgnore.includes(event.target.tagName)}return true}function useHotkeys(hotkeys,tagsToIgnore=["INPUT","TEXTAREA","SELECT"],triggerOnContentEditable=false){(0,index_js_.useEffect)(()=>{const keydownListener=event=>{hotkeys.forEach(([hotkey,handler,options={preventDefault:true,usePhysicalKeys:false}])=>{if(getHotkeyMatcher(hotkey,options.usePhysicalKeys)(event)&&shouldFireEvent(event,tagsToIgnore,triggerOnContentEditable)){if(options.preventDefault)event.preventDefault();handler(event)}})};document.documentElement.addEventListener("keydown",keydownListener);return()=>document.documentElement.removeEventListener("keydown",keydownListener)},[hotkeys])}"use client";function getFullscreenElement(){const _document=window.document;const fullscreenElement=_document.fullscreenElement||_document.webkitFullscreenElement||_document.mozFullScreenElement||_document.msFullscreenElement;return fullscreenElement}function exitFullscreen(){const _document=window.document;if("function"==typeof _document.exitFullscreen)return _document.exitFullscreen();if("function"==typeof _document.msExitFullscreen)return _document.msExitFullscreen();if("function"==typeof _document.webkitExitFullscreen)return _document.webkitExitFullscreen();if("function"==typeof _document.mozCancelFullScreen)return _document.mozCancelFullScreen();return null}function enterFullScreen(element){const _element=element;return _element.requestFullscreen?.()||_element.msRequestFullscreen?.()||_element.webkitEnterFullscreen?.()||_element.webkitRequestFullscreen?.()||_element.mozRequestFullscreen?.()}const prefixes=["","webkit","moz","ms"];function addEvents(element,{onFullScreen,onError}){prefixes.forEach(prefix=>{element.addEventListener(`${prefix}fullscreenchange`,onFullScreen);element.addEventListener(`${prefix}fullscreenerror`,onError)});return()=>{prefixes.forEach(prefix=>{element.removeEventListener(`${prefix}fullscreenchange`,onFullScreen);element.removeEventListener(`${prefix}fullscreenerror`,onError)})}}function useFullscreen(){const[fullscreen,setFullscreen]=(0,index_js_.useState)(false);const _ref=(0,index_js_.useRef)(null);const handleFullscreenChange=(0,index_js_.useCallback)(event=>{setFullscreen(event.target===getFullscreenElement())},[setFullscreen]);const handleFullscreenError=(0,index_js_.useCallback)(event=>{setFullscreen(false);console.error(`[@mantine/hooks] use-fullscreen: Error attempting full-screen mode method: ${event} (${event.target})`)},[setFullscreen]);const toggle=(0,index_js_.useCallback)(async()=>{if(getFullscreenElement())await exitFullscreen();else await enterFullScreen(_ref.current)},[]);const ref=(0,index_js_.useCallback)(element=>{if(null===element)_ref.current=window.document.documentElement;else _ref.current=element},[]);(0,index_js_.useEffect)(()=>{if(!_ref.current&&window.document){_ref.current=window.document.documentElement;return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})}if(_ref.current)return addEvents(_ref.current,{onFullScreen:handleFullscreenChange,onError:handleFullscreenError})},[_ref.current]);return{ref,toggle,fullscreen}}"use client";function useLogger(componentName,props){(0,index_js_.useEffect)(()=>{console.log(`${componentName} mounted`,...props);return()=>console.log(`${componentName} unmounted`)},[]);useDidUpdate(()=>{console.log(`${componentName} updated`,...props)},props);return null}"use client";function useHover(){const[hovered,setHovered]=(0,index_js_.useState)(false);const previousNode=(0,index_js_.useRef)(null);const handleMouseEnter=(0,index_js_.useCallback)(()=>{setHovered(true)},[]);const handleMouseLeave=(0,index_js_.useCallback)(()=>{setHovered(false)},[]);const ref=(0,index_js_.useCallback)(node=>{if(previousNode.current){previousNode.current.removeEventListener("mouseenter",handleMouseEnter);previousNode.current.removeEventListener("mouseleave",handleMouseLeave)}if(node){node.addEventListener("mouseenter",handleMouseEnter);node.addEventListener("mouseleave",handleMouseLeave)}previousNode.current=node},[handleMouseEnter,handleMouseLeave]);return{ref,hovered}}"use client";function useValidatedState(initialValue,validate,initialValidationState){const[value,setValue]=(0,index_js_.useState)(initialValue);const[lastValidValue,setLastValidValue]=(0,index_js_.useState)(validate(initialValue)?initialValue:void 0);const[valid,setValid]=(0,index_js_.useState)("boolean"==typeof initialValidationState?initialValidationState:validate(initialValue));const onChange=val=>{if(validate(val)){setLastValidValue(val);setValid(true)}else setValid(false);setValue(val)};return[{value,lastValidValue,valid},onChange]}"use client";function isMacOS(userAgent){const macosPattern=/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i;return macosPattern.test(userAgent)}function isIOS(userAgent){const iosPattern=/(iPhone)|(iPad)|(iPod)/i;return iosPattern.test(userAgent)}function isWindows(userAgent){const windowsPattern=/(Win32)|(Win64)|(Windows)|(WinCE)/i;return windowsPattern.test(userAgent)}function isAndroid(userAgent){const androidPattern=/Android/i;return androidPattern.test(userAgent)}function isLinux(userAgent){const linuxPattern=/Linux/i;return linuxPattern.test(userAgent)}function isChromeOS(userAgent){const chromePattern=/CrOS/i;return chromePattern.test(userAgent)}function getOS(){if("undefined"==typeof window)return"undetermined";const{userAgent}=window.navigator;if(isIOS(userAgent)||isMacOS(userAgent)&&"ontouchend"in document)return"ios";if(isMacOS(userAgent))return"macos";if(isWindows(userAgent))return"windows";if(isAndroid(userAgent))return"android";if(isLinux(userAgent))return"linux";if(isChromeOS(userAgent))return"chromeos";return"undetermined"}function useOs(options={getValueInEffect:true}){const[value,setValue]=(0,index_js_.useState)(options.getValueInEffect?"undetermined":getOS());useIsomorphicEffect(()=>{if(options.getValueInEffect)setValue(getOS)},[]);return value}"use client";function useSetState(initialState){const[state,setState]=(0,index_js_.useState)(initialState);const _setState=(0,index_js_.useCallback)(statePartial=>setState(current=>({...current,..."function"==typeof statePartial?statePartial(current):statePartial})),[]);return[state,_setState]}"use client";function getInputOnChange(setValue){return val=>{if(val)if("function"==typeof val)setValue(val);else if("object"==typeof val&&"nativeEvent"in val){const{currentTarget}=val;"checkbox"===currentTarget.type?setValue(currentTarget.checked):setValue(currentTarget.value)}else setValue(val);else setValue(val)}}function useInputState(initialState){const[value,setValue]=(0,index_js_.useState)(initialState);return[value,getInputOnChange(setValue)]}"use client";function useEventListener(type,listener,options){const previousListener=(0,index_js_.useRef)(null);const previousNode=(0,index_js_.useRef)(null);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options);node.addEventListener(type,listener,options);previousNode.current=node;previousListener.current=listener},[type,listener,options]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current&&previousListener.current)previousNode.current.removeEventListener(type,previousListener.current,options)},[type,options]);return callbackRef}"use client";function useDisclosure(initialState=false,options={}){const[opened,setOpened]=(0,index_js_.useState)(initialState);const open=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(!isOpened){options.onOpen?.();return true}return isOpened})},[options.onOpen]);const close=(0,index_js_.useCallback)(()=>{setOpened(isOpened=>{if(isOpened){options.onClose?.();return false}return isOpened})},[options.onClose]);const toggle=(0,index_js_.useCallback)(()=>{opened?close():open()},[close,open,opened]);return[opened,{open,close,toggle}]}"use client";function containsRelatedTarget(event){if(event.currentTarget instanceof HTMLElement&&event.relatedTarget instanceof HTMLElement)return event.currentTarget.contains(event.relatedTarget);return false}function useFocusWithin({onBlur,onFocus}={}){const[focused,setFocused]=(0,index_js_.useState)(false);const focusedRef=(0,index_js_.useRef)(false);const previousNode=(0,index_js_.useRef)(null);const _setFocused=(0,index_js_.useCallback)(value=>{setFocused(value);focusedRef.current=value},[]);const handleFocusIn=(0,index_js_.useCallback)(event=>{if(!focusedRef.current){_setFocused(true);onFocus?.(event)}},[onFocus]);const handleFocusOut=(0,index_js_.useCallback)(event=>{if(focusedRef.current&&!containsRelatedTarget(event)){_setFocused(false);onBlur?.(event)}},[onBlur]);const callbackRef=(0,index_js_.useCallback)(node=>{if(!node)return;if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}node.addEventListener("focusin",handleFocusIn);node.addEventListener("focusout",handleFocusOut)},[handleFocusIn,handleFocusOut]);(0,index_js_.useEffect)(()=>()=>{if(previousNode.current){previousNode.current.removeEventListener("focusin",handleFocusIn);previousNode.current.removeEventListener("focusout",handleFocusOut)}},[]);return{ref:callbackRef,focused}}"use client";function getConnection(){if("undefined"==typeof navigator)return{};const _navigator=navigator;const connection=_navigator.connection||_navigator.mozConnection||_navigator.webkitConnection;if(!connection)return{};return{downlink:connection?.downlink,downlinkMax:connection?.downlinkMax,effectiveType:connection?.effectiveType,rtt:connection?.rtt,saveData:connection?.saveData,type:connection?.type}}function useNetwork(){const[status,setStatus]=(0,index_js_.useState)({online:true});const handleConnectionChange=(0,index_js_.useCallback)(()=>setStatus(current=>({...current,...getConnection()})),[]);useWindowEvent("online",()=>setStatus({online:true,...getConnection()}));useWindowEvent("offline",()=>setStatus({online:false,...getConnection()}));(0,index_js_.useEffect)(()=>{const _navigator=navigator;if(_navigator.connection){setStatus({online:_navigator.onLine,...getConnection()});_navigator.connection.addEventListener("change",handleConnectionChange);return()=>_navigator.connection.removeEventListener("change",handleConnectionChange)}if("boolean"==typeof _navigator.onLine)setStatus(current=>({...current,online:_navigator.onLine}))},[]);return status}"use client";function useTimeout(callback,delay,options={autoInvoke:false}){const timeoutRef=(0,index_js_.useRef)(null);const start=(0,index_js_.useCallback)((...args)=>{if(!timeoutRef.current)timeoutRef.current=window.setTimeout(()=>{callback(args);timeoutRef.current=null},delay)},[delay]);const clear=(0,index_js_.useCallback)(()=>{if(timeoutRef.current){window.clearTimeout(timeoutRef.current);timeoutRef.current=null}},[]);(0,index_js_.useEffect)(()=>{if(options.autoInvoke)start();return clear},[clear,start]);return{start,clear}}"use client";function useTextSelection(){const forceUpdate=useForceUpdate();const[selection,setSelection]=(0,index_js_.useState)(null);const handleSelectionChange=()=>{setSelection(document.getSelection());forceUpdate()};(0,index_js_.useEffect)(()=>{setSelection(document.getSelection());document.addEventListener("selectionchange",handleSelectionChange);return()=>document.removeEventListener("selectionchange",handleSelectionChange)},[]);return selection}"use client";function usePrevious(value){const ref=(0,index_js_.useRef)(void 0);(0,index_js_.useEffect)(()=>{ref.current=value},[value]);return ref.current}"use client";const MIME_TYPES={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function useFavicon(url){const link=(0,index_js_.useRef)(null);useIsomorphicEffect(()=>{if(!url)return;if(!link.current){const existingElements=document.querySelectorAll('link[rel*="icon"]');existingElements.forEach(element2=>document.head.removeChild(element2));const element=document.createElement("link");element.rel="shortcut icon";link.current=element;document.querySelector("head").appendChild(element)}const splittedUrl=url.split(".");link.current.setAttribute("type",MIME_TYPES[splittedUrl[splittedUrl.length-1].toLowerCase()]);link.current.setAttribute("href",url)},[url])}"use client";const isFixed=(current,fixedAt)=>current<=fixedAt;const isPinnedOrReleased=(current,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)=>{const isInFixedPosition=isFixed(current,fixedAt);if(isInFixedPosition&&!isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=true;onPin?.()}else if(isInFixedPosition||!isScrollingUp||isCurrentlyPinnedRef.current){if(!isInFixedPosition&&isCurrentlyPinnedRef.current){isCurrentlyPinnedRef.current=false;onRelease?.()}}else{isCurrentlyPinnedRef.current=true;onPin?.()}};const useScrollDirection=()=>{const[lastScrollTop,setLastScrollTop]=(0,index_js_.useState)(0);const[isScrollingUp,setIsScrollingUp]=(0,index_js_.useState)(false);const[isResizing,setIsResizing]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{let resizeTimer;const onResize=()=>{setIsResizing(true);clearTimeout(resizeTimer);resizeTimer=setTimeout(()=>{setIsResizing(false)},300)};const onScroll=()=>{if(isResizing)return;const currentScrollTop=window.scrollY||document.documentElement.scrollTop;setIsScrollingUp(currentScrollTop<lastScrollTop);setLastScrollTop(currentScrollTop)};window.addEventListener("scroll",onScroll);window.addEventListener("resize",onResize);return()=>{window.removeEventListener("scroll",onScroll);window.removeEventListener("resize",onResize)}},[lastScrollTop,isResizing]);return isScrollingUp};function useHeadroom({fixedAt=0,onPin,onFix,onRelease}={}){const isCurrentlyPinnedRef=(0,index_js_.useRef)(false);const isScrollingUp=useScrollDirection();const[{y:scrollPosition}]=useWindowScroll();useIsomorphicEffect(()=>{isPinnedOrReleased(scrollPosition,fixedAt,isCurrentlyPinnedRef,isScrollingUp,onPin,onRelease)},[scrollPosition]);useIsomorphicEffect(()=>{if(isFixed(scrollPosition,fixedAt))onFix?.()},[scrollPosition,fixedAt,onFix]);if(isFixed(scrollPosition,fixedAt)||isScrollingUp)return true;return false}"use client";function useEyeDropper(){const[supported,setSupported]=(0,index_js_.useState)(false);useIsomorphicEffect(()=>{setSupported("undefined"!=typeof window&&!isOpera()&&"EyeDropper"in window)},[]);const open=(0,index_js_.useCallback)((options={})=>{if(supported){const eyeDropper=new window.EyeDropper;return eyeDropper.open(options)}return Promise.resolve(void 0)},[supported]);return{supported,open}}function isOpera(){return navigator.userAgent.includes("OPR")}"use client";function useInViewport(){const observer=(0,index_js_.useRef)(null);const[inViewport,setInViewport]=(0,index_js_.useState)(false);const ref=(0,index_js_.useCallback)(node=>{if("undefined"!=typeof IntersectionObserver){if(node&&!observer.current)observer.current=new IntersectionObserver(entries=>setInViewport(entries.some(entry=>entry.isIntersecting)));else observer.current?.disconnect();if(node)observer.current?.observe(node);else setInViewport(false)}},[]);return{ref,inViewport}}"use client";function useMutationObserver(callback,options,target){const observer=(0,index_js_.useRef)(null);const ref=(0,index_js_.useRef)(null);(0,index_js_.useEffect)(()=>{const targetElement="function"==typeof target?target():target;if(targetElement||ref.current){observer.current=new MutationObserver(callback);observer.current.observe(targetElement||ref.current,options)}return()=>{observer.current?.disconnect()}},[callback,options]);return ref}"use client";function useMounted(){const[mounted,setMounted]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>setMounted(true),[]);return mounted}"use client";function useStateHistory(initialValue){const[state,setState]=(0,index_js_.useState)({history:[initialValue],current:0});const set=(0,index_js_.useCallback)(val=>setState(currentState=>{const nextState=[...currentState.history.slice(0,currentState.current+1),val];return{history:nextState,current:nextState.length-1}}),[]);const back=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.max(0,currentState.current-steps)})),[]);const forward=(0,index_js_.useCallback)((steps=1)=>setState(currentState=>({history:currentState.history,current:Math.min(currentState.history.length-1,currentState.current+steps)})),[]);const reset=(0,index_js_.useCallback)(()=>{setState({history:[initialValue],current:0})},[initialValue]);const handlers=(0,index_js_.useMemo)(()=>({back,forward,reset,set}),[back,forward,reset,set]);return[state.history[state.current],handlers,state]}"use client";function useMap(initialState){const mapRef=(0,index_js_.useRef)(new Map(initialState));const forceUpdate=useForceUpdate();mapRef.current.set=(...args)=>{Map.prototype.set.apply(mapRef.current,args);forceUpdate();return mapRef.current};mapRef.current.clear=(...args)=>{Map.prototype.clear.apply(mapRef.current,args);forceUpdate()};mapRef.current.delete=(...args)=>{const res=Map.prototype.delete.apply(mapRef.current,args);forceUpdate();return res};return mapRef.current}"use client";function readonlySetLikeToSet(input){if(input instanceof Set)return input;const result=/* @__PURE__ */new Set;for(const item of input)result.add(item);return result}function useSet(values){const setRef=(0,index_js_.useRef)(new Set(values));const forceUpdate=useForceUpdate();setRef.current.add=(...args)=>{const res=Set.prototype.add.apply(setRef.current,args);forceUpdate();return res};setRef.current.clear=(...args)=>{Set.prototype.clear.apply(setRef.current,args);forceUpdate()};setRef.current.delete=(...args)=>{const res=Set.prototype.delete.apply(setRef.current,args);forceUpdate();return res};setRef.current.union=other=>{const result=new Set(setRef.current);readonlySetLikeToSet(other).forEach(item=>result.add(item));return result};setRef.current.intersection=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(otherSet.has(item))result.add(item)});return result};setRef.current.difference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});return result};setRef.current.symmetricDifference=other=>{const result=/* @__PURE__ */new Set;const otherSet=readonlySetLikeToSet(other);setRef.current.forEach(item=>{if(!otherSet.has(item))result.add(item)});otherSet.forEach(item=>{if(!setRef.current.has(item))result.add(item)});return result};return setRef.current}"use client";function useThrottledCallbackWithClearTimeout(callback,wait){const handleCallback=useCallbackRef(callback);const latestInArgsRef=(0,index_js_.useRef)(null);const latestOutArgsRef=(0,index_js_.useRef)(null);const active=(0,index_js_.useRef)(true);const waitRef=(0,index_js_.useRef)(wait);const timeoutRef=(0,index_js_.useRef)(-1);const clearTimeout1=()=>window.clearTimeout(timeoutRef.current);const callThrottledCallback=(0,index_js_.useCallback)((...args)=>{handleCallback(...args);latestInArgsRef.current=args;latestOutArgsRef.current=args;active.current=false},[handleCallback]);const timerCallback=(0,index_js_.useCallback)(()=>{if(latestInArgsRef.current&&latestInArgsRef.current!==latestOutArgsRef.current){callThrottledCallback(...latestInArgsRef.current);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else active.current=true},[callThrottledCallback]);const throttled=(0,index_js_.useCallback)((...args)=>{if(active.current){callThrottledCallback(...args);timeoutRef.current=window.setTimeout(timerCallback,waitRef.current)}else latestInArgsRef.current=args},[callThrottledCallback,timerCallback]);(0,index_js_.useEffect)(()=>{waitRef.current=wait},[wait]);return[throttled,clearTimeout1]}function useThrottledCallback(callback,wait){return useThrottledCallbackWithClearTimeout(callback,wait)[0]}"use client";function useThrottledState(defaultValue,wait){const[value,setValue]=(0,index_js_.useState)(defaultValue);const[setThrottledValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setValue,wait);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return[value,setThrottledValue]}"use client";function useThrottledValue(value,wait){const[throttledValue,setThrottledValue]=(0,index_js_.useState)(value);const valueRef=(0,index_js_.useRef)(value);const[throttledSetValue,clearTimeout1]=useThrottledCallbackWithClearTimeout(setThrottledValue,wait);(0,index_js_.useEffect)(()=>{if(value!==valueRef.current){valueRef.current=value;throttledSetValue(value)}},[throttledSetValue,value]);(0,index_js_.useEffect)(()=>clearTimeout1,[]);return throttledValue}"use client";function useIsFirstRender(){const renderRef=(0,index_js_.useRef)(true);if(true===renderRef.current){renderRef.current=false;return true}return renderRef.current}"use client";function use_orientation_getInitialValue(initialValue,getInitialValueInEffect){if(getInitialValueInEffect)return initialValue;if("undefined"!=typeof window&&"screen"in window)return{angle:window.screen.orientation?.angle??initialValue.angle,type:window.screen.orientation?.type??initialValue.type};return initialValue}function useOrientation({defaultAngle=0,defaultType="landscape-primary",getInitialValueInEffect=true}={}){const[orientation,setOrientation]=(0,index_js_.useState)(use_orientation_getInitialValue({angle:defaultAngle,type:defaultType},getInitialValueInEffect));const handleOrientationChange=event=>{const target=event.currentTarget;setOrientation({angle:target?.angle||0,type:target?.type||"landscape-primary"})};useIsomorphicEffect(()=>{window.screen.orientation?.addEventListener("change",handleOrientationChange);return()=>window.screen.orientation?.removeEventListener("change",handleOrientationChange)},[]);return orientation}"use client";function useFetch(url,{autoInvoke=true,...options}={}){const[data,setData]=(0,index_js_.useState)(null);const[loading,setLoading]=(0,index_js_.useState)(false);const[error,setError]=(0,index_js_.useState)(null);const controller=(0,index_js_.useRef)(null);const refetch=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current.abort();controller.current=new AbortController;setLoading(true);return fetch(url,{signal:controller.current.signal,...options}).then(res=>res.json()).then(res=>{setData(res);setLoading(false);return res}).catch(err=>{setLoading(false);if("AbortError"!==err.name)setError(err);return err})},[url]);const abort=(0,index_js_.useCallback)(()=>{if(controller.current)controller.current?.abort("")},[]);(0,index_js_.useEffect)(()=>{if(autoInvoke)refetch();return()=>{if(controller.current)controller.current.abort("")}},[refetch,autoInvoke]);return{data,loading,error,refetch,abort}}"use client";function radiansToDegrees(radians){return 180/Math.PI*radians}function getElementCenter(element){const rect=element.getBoundingClientRect();return[rect.left+rect.width/2,rect.top+rect.height/2]}function getAngle(coordinates,element){const center=getElementCenter(element);const x=coordinates[0]-center[0];const y=coordinates[1]-center[1];const deg=radiansToDegrees(Math.atan2(x,y))+180;return 360-deg}function toFixed(value,digits){return parseFloat(value.toFixed(digits))}function getDigitsAfterDot(value){return value.toString().split(".")[1]?.length||0}function normalizeRadialValue(degree,step){const clamped=clamp(degree,0,360);const high=Math.ceil(clamped/step);const low=Math.round(clamped/step);return toFixed(high>=clamped/step?high*step===360?0:high*step:low*step,getDigitsAfterDot(step))}function useRadialMove(onChange,{step=.01,onChangeEnd,onScrubStart,onScrubEnd}={}){const mounted=(0,index_js_.useRef)(false);const[active,setActive]=(0,index_js_.useState)(false);(0,index_js_.useEffect)(()=>{mounted.current=true},[]);const refCallback=(0,index_js_.useCallback)(node=>{const update=(event,done=false)=>{if(node){node.style.userSelect="none";const deg=getAngle([event.clientX,event.clientY],node);const newValue=normalizeRadialValue(deg,step||1);onChange(newValue);done&&onChangeEnd?.(newValue)}};const beginTracking=()=>{onScrubStart?.();setActive(true);document.addEventListener("mousemove",handleMouseMove,false);document.addEventListener("mouseup",handleMouseUp,false);document.addEventListener("touchmove",handleTouchMove,{passive:false});document.addEventListener("touchend",handleTouchEnd,false)};const endTracking=()=>{onScrubEnd?.();setActive(false);document.removeEventListener("mousemove",handleMouseMove,false);document.removeEventListener("mouseup",handleMouseUp,false);document.removeEventListener("touchmove",handleTouchMove,false);document.removeEventListener("touchend",handleTouchEnd,false)};const onMouseDown=event=>{beginTracking();update(event)};const handleMouseMove=event=>{update(event)};const handleMouseUp=event=>{update(event,true);endTracking()};const handleTouchMove=event=>{event.preventDefault();update(event.touches[0])};const handleTouchEnd=event=>{update(event.changedTouches[0],true);endTracking()};const handleTouchStart=event=>{event.preventDefault();beginTracking();update(event.touches[0])};node?.addEventListener("mousedown",onMouseDown);node?.addEventListener("touchstart",handleTouchStart,{passive:false});return()=>{if(node){node.removeEventListener("mousedown",onMouseDown);node.removeEventListener("touchstart",handleTouchStart)}}},[onChange]);return{ref:refCallback,active}}"use client";function getHeadingsData(headings,getDepth,getValue){const result=[];for(let i=0;i<headings.length;i+=1){const heading=headings[i];result.push({depth:getDepth(heading),value:getValue(heading),id:heading.id||randomId(),getNode:()=>heading.id?document.getElementById(heading.id):heading})}return result}function getActiveElement(rects,offset=0){if(0===rects.length)return -1;const closest=rects.reduce((acc,item,index)=>{if(Math.abs(acc.position-offset)<Math.abs(item.y-offset))return acc;return{index,position:item.y}},{index:0,position:rects[0].y});return closest.index}function getDefaultDepth(element){return Number(element.tagName[1])}function getDefaultValue(element){return element.textContent||""}function useScrollSpy({selector="h1, h2, h3, h4, h5, h6",getDepth=getDefaultDepth,getValue=getDefaultValue,offset=0,scrollHost}={}){const[active,setActive]=(0,index_js_.useState)(-1);const[initialized,setInitialized]=(0,index_js_.useState)(false);const[data,setData]=(0,index_js_.useState)([]);const headingsRef=(0,index_js_.useRef)([]);const handleScroll=()=>{setActive(getActiveElement(headingsRef.current.map(d=>d.getNode().getBoundingClientRect()),offset))};const initialize=()=>{const headings=getHeadingsData(Array.from(document.querySelectorAll(selector)),getDepth,getValue);headingsRef.current=headings;setInitialized(true);setData(headings);setActive(getActiveElement(headings.map(d=>d.getNode().getBoundingClientRect()),offset))};(0,index_js_.useEffect)(()=>{initialize();const _scrollHost=scrollHost||window;_scrollHost.addEventListener("scroll",handleScroll);return()=>_scrollHost.removeEventListener("scroll",handleScroll)},[scrollHost]);return{reinitialize:initialize,active,initialized,data}}"use client";const defaultOptions={multiple:true,accept:"*"};function getInitialFilesList(files){if(!files)return null;if(files instanceof FileList)return files;const result=new DataTransfer;for(const file of files)result.items.add(file);return result.files}function createInput(options){if("undefined"==typeof document)return null;const input=document.createElement("input");input.type="file";if(options.accept)input.accept=options.accept;if(options.multiple)input.multiple=options.multiple;if(options.capture)input.capture=options.capture;if(options.directory)input.webkitdirectory=options.directory;input.style.display="none";return input}function useFileDialog(input={}){const options={...defaultOptions,...input};const[files,setFiles]=(0,index_js_.useState)(getInitialFilesList(options.initialFiles));const inputRef=(0,index_js_.useRef)(null);const handleChange=(0,index_js_.useCallback)(event=>{const target=event.target;if(target?.files){setFiles(target.files);options.onChange?.(target.files)}},[options.onChange]);const createAndSetupInput=(0,index_js_.useCallback)(()=>{inputRef.current?.remove();inputRef.current=createInput(options);if(inputRef.current){inputRef.current.addEventListener("change",handleChange,{once:true});document.body.appendChild(inputRef.current)}},[options,handleChange]);useIsomorphicEffect(()=>{createAndSetupInput();return()=>inputRef.current?.remove()},[]);const reset=(0,index_js_.useCallback)(()=>{setFiles(null);options.onChange?.(null)},[options.onChange]);const open=(0,index_js_.useCallback)(()=>{if(options.resetOnOpen)reset();createAndSetupInput();inputRef.current?.click()},[options.resetOnOpen,reset,createAndSetupInput]);return{files,open,reset}}"use client";function useLongPress(onLongPress,options={}){const{threshold=400,onStart,onFinish,onCancel}=options;const isLongPressActive=(0,index_js_.useRef)(false);const isPressed=(0,index_js_.useRef)(false);const timeout=(0,index_js_.useRef)(-1);(0,index_js_.useEffect)(()=>()=>window.clearTimeout(timeout.current),[]);return(0,index_js_.useMemo)(()=>{if("function"!=typeof onLongPress)return{};const start=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(onStart)onStart(event);isPressed.current=true;timeout.current=window.setTimeout(()=>{onLongPress(event);isLongPressActive.current=true},threshold)};const cancel=event=>{if(!isMouseEvent(event)&&!isTouchEvent(event))return;if(isLongPressActive.current){if(onFinish)onFinish(event)}else if(isPressed.current){if(onCancel)onCancel(event)}isLongPressActive.current=false;isPressed.current=false;if(timeout.current)window.clearTimeout(timeout.current)};return{onMouseDown:start,onMouseUp:cancel,onMouseLeave:cancel,onTouchStart:start,onTouchEnd:cancel}},[onLongPress,threshold,onCancel,onFinish,onStart])}function isTouchEvent(event){return window.TouchEvent?event.nativeEvent instanceof TouchEvent:"touches"in event.nativeEvent}function isMouseEvent(event){return event.nativeEvent instanceof MouseEvent}"use client";function useSelection(input){const[selectionSet,setSelectionSet]=(0,index_js_.useState)(new Set(input.defaultSelection||[]));useDidUpdate(()=>{if(input.resetSelectionOnDataChange)setSelectionSet(/* @__PURE__ */new Set)},[input.data,input.resetSelectionOnDataChange]);const select=(0,index_js_.useCallback)(selected=>{setSelectionSet(state=>{if(!state.has(selected)){const newSet=new Set(state);newSet.add(selected);return newSet}return state})},[]);const deselect=(0,index_js_.useCallback)(deselected=>{setSelectionSet(state=>{if(state.has(deselected)){const newSet=new Set(state);newSet.delete(deselected);return newSet}return state})},[]);const toggle=(0,index_js_.useCallback)(toggled=>{setSelectionSet(state=>{const newSet=new Set(state);if(state.has(toggled))newSet.delete(toggled);else newSet.add(toggled);return newSet})},[]);const resetSelection=(0,index_js_.useCallback)(()=>{setSelectionSet(/* @__PURE__ */new Set)},[]);const setSelection=(0,index_js_.useCallback)(selection=>{setSelectionSet(new Set(selection))},[]);const isAllSelected=(0,index_js_.useCallback)(()=>{if(0===input.data.length)return false;return input.data.every(item=>selectionSet.has(item))},[selectionSet,input.data]);const isSomeSelected=(0,index_js_.useCallback)(()=>input.data.some(item=>selectionSet.has(item)),[selectionSet,input.data]);return[Array.from(selectionSet),{select,deselect,toggle,isAllSelected,isSomeSelected,setSelection,resetSelection}]}}}]);
package/dist/mf/666.js DELETED
@@ -1,10 +0,0 @@
1
- /*! For license information please see 666.js.LICENSE.txt */
2
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["666"],{9698:function(__unused_webpack_module,exports){/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},2004:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{updateContextModal:()=>events_updateContextModal,closeAllModals:()=>closeAllModals,updateModal:()=>events_updateModal,ModalsProvider:()=>ModalsProvider,openContextModal:()=>events_openContextModal,openConfirmModal:()=>events_openConfirmModal,closeModal:()=>events_closeModal,modals:()=>events_modals,openModal:()=>events_openModal,useModals:()=>useModals});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);var index_mjs_=__webpack_require__(9389);var esm_index_mjs_=__webpack_require__(207);"use client";const ModalsContext=(0,index_js_.createContext)(null);ModalsContext.displayName="@mantine/modals/ModalsContext";"use client";function useModals(){const ctx=(0,index_js_.useContext)(ModalsContext);if(!ctx)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return ctx}"use client";function ConfirmModal({id,cancelProps,confirmProps,labels={cancel:"",confirm:""},closeOnConfirm=true,closeOnCancel=true,groupProps,onCancel,onConfirm,children}){const{cancel:cancelLabel,confirm:confirmLabel}=labels;const ctx=useModals();const handleCancel=event=>{"function"==typeof cancelProps?.onClick&&cancelProps?.onClick(event);"function"==typeof onCancel&&onCancel();closeOnCancel&&ctx.closeModal(id)};const handleConfirm=event=>{"function"==typeof confirmProps?.onClick&&confirmProps?.onClick(event);"function"==typeof onConfirm&&onConfirm();closeOnConfirm&&ctx.closeModal(id)};return/* @__PURE__ */(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[children&&/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{mb:"md",children}),/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{mt:children?0:"md",justify:"flex-end",...groupProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",...cancelProps,onClick:handleCancel,children:cancelProps?.children||cancelLabel}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{...confirmProps,onClick:handleConfirm,children:confirmProps?.children||confirmLabel})]})]})}"use client";const[useModalsEvents,createEvent]=(0,index_mjs_.createUseExternalEvents)("mantine-modals");const events_openModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openModal")({...payload,modalId:id});return id};const events_openConfirmModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openConfirmModal")({...payload,modalId:id});return id};const events_openContextModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openContextModal")({...payload,modalId:id});return id};const events_closeModal=createEvent("closeModal");const closeAllModals=createEvent("closeAllModals");const events_updateModal=payload=>createEvent("updateModal")(payload);const events_updateContextModal=payload=>createEvent("updateContextModal")(payload);const events_modals={open:events_openModal,close:events_closeModal,closeAll:closeAllModals,openConfirmModal:events_openConfirmModal,openContextModal:events_openContextModal,updateModal:events_updateModal,updateContextModal:events_updateContextModal};"use client";function handleCloseModal(modal,canceled){if(canceled&&"confirm"===modal.type)modal.props.onCancel?.();modal.props.onClose?.()}function modalsReducer(state,action){switch(action.type){case"OPEN":return{current:action.modal,modals:[...state.modals,action.modal]};case"CLOSE":{const modal=state.modals.find(m=>m.id===action.modalId);if(!modal)return state;handleCloseModal(modal,action.canceled);const remainingModals=state.modals.filter(m=>m.id!==action.modalId);return{current:remainingModals[remainingModals.length-1]||state.current,modals:remainingModals}}case"CLOSE_ALL":if(!state.modals.length)return state;state.modals.concat().reverse().forEach(modal=>{handleCloseModal(modal,action.canceled)});return{current:state.current,modals:[]};case"UPDATE":{const{modalId,newProps}=action;const updatedModals=state.modals.map(modal=>{if(modal.id!==modalId)return modal;if("content"===modal.type||"confirm"===modal.type)return{...modal,props:{...modal.props,...newProps}};if("context"===modal.type)return{...modal,props:{...modal.props,...newProps,innerProps:{...modal.props.innerProps,...newProps.innerProps}}};return modal});const currentModal=state.current?.id===modalId?updatedModals.find(modal=>modal.id===modalId)||state.current:state.current;return{...state,modals:updatedModals,current:currentModal}}default:return state}}"use client";function separateConfirmModalProps(props){if(!props)return{confirmProps:{},modalProps:{}};const{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels,...others}=props;return{confirmProps:{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels},modalProps:{id,...others}}}function ModalsProvider({children,modalProps,labels,modals}){const[state,dispatch]=(0,index_js_.useReducer)(modalsReducer,{modals:[],current:null});const stateRef=(0,index_js_.useRef)(state);stateRef.current=state;const closeAll=(0,index_js_.useCallback)(canceled=>{dispatch({type:"CLOSE_ALL",canceled})},[stateRef,dispatch]);const openModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"content",props}});return id},[dispatch]);const openConfirmModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"confirm",props}});return id},[dispatch]);const openContextModal=(0,index_js_.useCallback)((modal,{modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"context",props,ctx:modal}});return id},[dispatch]);const closeModal=(0,index_js_.useCallback)((id,canceled)=>{dispatch({type:"CLOSE",modalId:id,canceled})},[stateRef,dispatch]);const updateModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);const updateContextModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);useModalsEvents({openModal,openConfirmModal,openContextModal:({modal,...payload})=>openContextModal(modal,payload),closeModal,closeContextModal:closeModal,closeAllModals:closeAll,updateModal,updateContextModal});const ctx={modalProps:modalProps||{},modals:state.modals,openModal,openConfirmModal,openContextModal,closeModal,closeContextModal:closeModal,closeAll,updateModal,updateContextModal};const getCurrentModal=()=>{const currentModal=stateRef.current.current;switch(currentModal?.type){case"context":{const{innerProps,...rest}=currentModal.props;const ContextModal=modals[currentModal.ctx];return{modalProps:rest,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ContextModal,{innerProps,context:ctx,id:currentModal.id})}}case"confirm":{const{modalProps:separatedModalProps,confirmProps:separatedConfirmProps}=separateConfirmModalProps(currentModal.props);return{modalProps:separatedModalProps,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ConfirmModal,{...separatedConfirmProps,id:currentModal.id,labels:currentModal.props.labels||labels})}}case"content":{const{children:currentModalChildren,...rest}=currentModal.props;return{modalProps:rest,content:currentModalChildren}}default:return{modalProps:{},content:null}}};const{modalProps:currentModalProps,content}=getCurrentModal();return/* @__PURE__ */(0,jsx_runtime.jsxs)(ModalsContext.Provider,{value:ctx,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Modal,{zIndex:(0,index_mjs_.getDefaultZIndex)("modal")+1,...modalProps,...currentModalProps,opened:state.modals.length>0,onClose:()=>closeModal(state.current?.id),children:content}),children]})}}}]);
package/dist/mf/702.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["702"],{8861:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AreaChart:()=>AreaChart,BubbleChart:()=>BubbleChart,FunnelChart:()=>FunnelChart,RadialBarChart:()=>RadialBarChart,AreaGradient:()=>AreaGradient,CompositeChart:()=>CompositeChart,ChartTooltip:()=>ChartTooltip,DonutChart:()=>DonutChart,LineChart:()=>LineChart,RadarChart:()=>RadarChart,ChartLegend:()=>ChartLegend,Heatmap:()=>Heatmap,ScatterChart:()=>ScatterChart,PieChart:()=>PieChart,getSplitOffset:()=>getSplitOffset,getFilteredChartLegendPayload:()=>getFilteredChartLegendPayload,BarChart:()=>BarChart,Sparkline:()=>Sparkline,getFilteredChartTooltipPayload:()=>getFilteredChartTooltipPayload});var jsx_runtime=__webpack_require__(4848);var index_mjs_=__webpack_require__(9389);"use client";function getSeriesLabels(series){if(!series)return{};return series.reduce((acc,item)=>{const matchFound=item.name.search(/\./);if(matchFound>=0){const key=item.name.substring(matchFound+1);acc[key]=item.label;return acc}acc[item.name]=item.label;return acc},{})}"use client";var classes={tooltip:"m_e4d36c9b",tooltipLabel:"m_7f4bcb19",tooltipBody:"m_3de554dd",tooltipItemColor:"m_b30369b5",tooltipItem:"m_3de8964e",tooltipItemBody:"m_50186d10",tooltipItemName:"m_501dadf9",tooltipItemData:"m_50192318"};"use client";function updateChartTooltipPayload(payload){return payload.map(item=>{if(!item.payload||item.payload[item.name])return item;const matchFound=item.name.search(/\./);if(matchFound>=0){const newDataKey=item.name.substring(0,matchFound);const nestedPayload={...item.payload[newDataKey]};const shallowPayload=Object.entries(item.payload).reduce((acc,current)=>{const[k,v]=current;return k===newDataKey?acc:{...acc,[k]:v}},{});return{...item,name:item.name.substring(matchFound+1),payload:{...shallowPayload,...nestedPayload}}}return item})}function getFilteredChartTooltipPayload(payload,segmentId){const duplicatesFilter=updateChartTooltipPayload(payload.filter(item=>"none"!==item.fill||!item.color));if(!segmentId)return duplicatesFilter;return duplicatesFilter.filter(item=>item.name===segmentId)}function getData(item,type){if("radial"===type||"scatter"===type){if(Array.isArray(item.value))return item.value[1]-item.value[0];return item.value}if(Array.isArray(item.payload[item.dataKey]))return item.payload[item.dataKey][1]-item.payload[item.dataKey][0];return item.payload[item.name]}const defaultProps={type:"area",showColor:true};const ChartTooltip=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartTooltip",defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,payload,label,unit,type,segmentId,mod,series,valueFormatter,showColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"ChartTooltip",classes:classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartTooltipPayload(payload,segmentId);const scatterLabel="scatter"===type?payload[0]?.payload?.name:null;const labels=getSeriesLabels(series);const _label=label||scatterLabel;const items=filteredPayload.map(item=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{"data-type":type,...getStyles("tooltipItem"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemBody"),children:[showColor&&/* @__PURE__ */(0,jsx_runtime.jsx)("svg",{...getStyles("tooltipItemColor"),children:/* @__PURE__ */(0,jsx_runtime.jsx)("circle",{r:6,fill:(0,index_mjs_.getThemeColor)(item.color,theme),width:12,height:12,cx:6,cy:6})}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipItemName"),children:labels[item.name]||item.name})]}),/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemData"),children:["function"==typeof valueFormatter?valueFormatter(getData(item,type)):getData(item,type),unit||item.unit]})]},item?.key??item.name));return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{...getStyles("tooltip"),mod:[{type},mod],ref,...others,children:[_label&&/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipLabel"),children:_label}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipBody"),children:items})]})});ChartTooltip.displayName="@mantine/charts/ChartTooltip";"use client";var ChartLegend_module_css_classes={legend:"m_847eaf",legendItem:"m_17da7e62",legendItemColor:"m_6e236e21",legendItemName:"m_8ff56c0d"};"use client";function updateChartLegendPayload(payload){return payload.map(item=>{const newDataKey=item.dataKey?.split(".").pop();return{...item,dataKey:newDataKey,payload:{...item.payload,name:newDataKey,dataKey:newDataKey}}})}function getFilteredChartLegendPayload(payload){return updateChartLegendPayload(payload.filter(item=>"none"!==item.color))}const ChartLegend=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartLegend",null,_props);const{classNames,className,style,styles,unstyled,vars,payload,onHighlight,legendPosition,mod,series,showColor,centered,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"ChartLegend",classes:ChartLegend_module_css_classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartLegendPayload(payload);const labels=getSeriesLabels(series);const items=filteredPayload.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("legendItem"),onMouseEnter:()=>onHighlight(item.dataKey),onMouseLeave:()=>onHighlight(null),"data-without-color":false===showColor||void 0,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:item.color,size:12,...getStyles("legendItemColor"),withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("p",{...getStyles("legendItemName"),children:labels[item.dataKey]||item.dataKey})]},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,mod:[{position:legendPosition,centered},mod],...getStyles("legend"),...others,children:items})});ChartLegend.displayName="@mantine/charts/ChartLegend";var index_js_=__webpack_require__(3620);var es6_index_js_=__webpack_require__(1301);"use client";function PointLabel({x,y,value,valueFormatter}){return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${x},${y})`,children:/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:0,dy:-8,dx:-10,textAnchor:"top",fill:"var(--chart-text-color, var(--mantine-color-dimmed))",fontSize:8,children:valueFormatter?valueFormatter(value):value})})}"use client";function AreaGradient({color,id,withGradient,fillOpacity}){return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:withGradient?/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"0%",stopColor:color,stopOpacity:fillOpacity}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"100%",stopColor:color,stopOpacity:.01})]}):/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{stopColor:color,stopOpacity:fillOpacity??.2})})})}AreaGradient.displayName="@mantine/charts/AreaGradient";"use client";function AreaSplit({offset,id,colors,fillOpacity}){const theme=(0,index_mjs_.useMantineTheme)();return/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[0],theme),stopOpacity:fillOpacity??.2}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[1],theme),stopOpacity:fillOpacity??.2})]})}AreaSplit.displayName="@mantine/charts/AreaSplit";"use client";function getSplitOffset({data,dataKey}){const dataMax=Math.max(...data.map(item=>item[dataKey]));const dataMin=Math.min(...data.map(item=>item[dataKey]));if(dataMax<=0)return 0;if(dataMin>=0)return 1;return dataMax/(dataMax-dataMin)}function getDefaultSplitOffset({data,series}){if(1===series.length){const dataKey=series[0].name;return getSplitOffset({data,dataKey})}return .5}"use client";var grid_chart_module_css_classes={root:"m_a50f3e58",container:"m_af9188cb",grid:"m_a50a48bc",axis:"m_a507a517",axisLabel:"m_2293801d",tooltip:"m_92b296cd"};"use client";function valueToPercent(value){return`${(100*value).toFixed(0)}%`}const AreaChart_defaultProps={withXAxis:true,withYAxis:true,withDots:true,withTooltip:true,connectNulls:true,strokeWidth:2,tooltipAnimationDuration:0,fillOpacity:.2,tickLine:"y",strokeDasharray:"5 5",curveType:"monotone",gridAxis:"x",type:"default",splitColors:["green.7","red.7"],orientation:"horizontal"};const varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const AreaChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("AreaChart",AreaChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,withGradient,dataKey,withXAxis,withYAxis,curveType,gridProps,withDots,tickLine,strokeDasharray,gridAxis,unit,yAxisProps,xAxisProps,dotProps,activeDotProps,strokeWidth,tooltipAnimationDuration,type,legendProps,tooltipProps,withLegend,withTooltip,areaChartProps,fillOpacity,splitColors,splitOffset,connectNulls,onMouseLeave,orientation,referenceLines,dir,valueFormatter,children,areaProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const baseId=(0,index_js_.useId)();const splitId=`${baseId}-split`;const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const isAnimationActive=(tooltipAnimationDuration||0)>0;const _withGradient="boolean"==typeof withGradient?withGradient:"default"===type;const stacked="stacked"===type||"percent"===type;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"AreaChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver});const dotsAreas=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),activeDot:{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps},dot:{fill:color,fillOpacity:dimmed?0:1,strokeWidth:2,r:4,...dotProps},key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:"none",strokeWidth,stroke:"none",isAnimationActive:false,connectNulls,stackId:stacked?"stack-dots":void 0,yAxisId:item.yAxisId||"left",..."function"==typeof areaProps?areaProps(item):areaProps})});const areas=series.map(item=>{const id=`${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g,"")}`;const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_js_.Fragment,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{color,withGradient:_withGradient,id,fillOpacity})}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{...getStyles("area"),activeDot:false,dot:false,name:item.name,type:curveType,dataKey:item.name,fill:"split"===type?`url(#${splitId})`:`url(#${id})`,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,stackId:stacked?"stack":void 0,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps})]},item.name)});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const tickFormatter="percent"===type?valueToPercent:valueFormatter;const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data,stackOffset:"percent"===type?"expand":void 0,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...areaChartProps,children:[referenceLinesItems,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),"split"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaSplit,{colors:splitColors,id:splitId,offset:splitOffset??getDefaultSplitOffset({data,series}),fillOpacity})}),areas,withDots&&dotsAreas,children]})})})});AreaChart.classes=grid_chart_module_css_classes;AreaChart.displayName="@mantine/charts/AreaChart";"use client";function BarChart_valueToPercent(value){return`${(100*value).toFixed(0)}%`}const BarChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",type:"default"};const BarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor,cursorFill,barLabelColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-cursor-fill":cursorFill?(0,index_mjs_.getThemeColor)(cursorFill,theme):void 0,"--chart-bar-label-color":barLabelColor?(0,index_mjs_.getThemeColor)(barLabelColor,theme):void 0}}));function calculateCumulativeTotal(waterfallData,dataKey){let start=0;let end=0;return waterfallData.map(item=>{if(item.standalone){for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey)item[prop]=[0,item[prop]]}else for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey){end+=item[prop];item[prop]=[start,end];start=end}return item})}function getBarFill(barProps,series){if("function"==typeof barProps)return barProps(series).fill;return barProps?.fill}const BarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BarChart",BarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,fillOpacity,barChartProps,type,orientation,dir,valueFormatter,children,barProps,xAxisLabel,yAxisLabel,withBarValueLabel,valueLabelProps,withRightYAxis,rightYAxisLabel,rightYAxisProps,minBarSize,maxBarWidth,mod,getBarColor,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const stacked="stacked"===type||"percent"===type;const tickFormatter="percent"===type?BarChart_valueToPercent:valueFormatter;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const inputData="waterfall"===type?calculateCumulativeTotal(data,dataKey):data;const getStyles=(0,index_mjs_.useStyles)({name:"BarChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BarChart_varsResolver});const bars=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:fillOpacity,strokeOpacity:dimmed?.2:0,stackId:stacked?"stack":item.stackId||void 0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},inputData.map((entry,index)=>{const cellColor=entry.color?(0,index_mjs_.getThemeColor)(entry.color,theme):"function"==typeof getBarColor?(0,index_mjs_.getThemeColor)(getBarColor(entry[item.name],item),theme):getBarFill(barProps,item)||color;return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:cellColor},`cell-${index}`)}),withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"vertical"===orientation?"right":"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>tickFormatter?.(val),..."function"==typeof valueLabelProps?valueLabelProps(item):valueLabelProps}))});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",mod:[{orientation},mod],...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.BarChart,{data:inputData,stackOffset:"percent"===type?"expand":void 0,layout:orientation,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...barChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"waterfall"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray,fill:"var(--chart-cursor-fill)"},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,type:"waterfall"===type?"scatter":void 0,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),bars,referenceLinesItems,children]})})})});BarChart.displayName="@mantine/charts/BarChart";BarChart.classes=grid_chart_module_css_classes;var esm_index_mjs_=__webpack_require__(207);"use client";const LineChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone",gradientStops:[{offset:0,color:"red"},{offset:100,color:"blue"}]};const LineChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const LineChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("LineChart",LineChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,lineChartProps,connectNulls,fillOpacity,curveType,orientation,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,type,gradientStops,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,attributes,gridColor,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"LineChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:LineChart_varsResolver});const id=(0,esm_index_mjs_.useId)();const gradientId=`line-chart-gradient-${id}`;const stops=gradientStops?.map(stop=>/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:`${stop.offset}%`,stopColor:(0,index_mjs_.getThemeColor)(stop.color,theme)},stop.color));const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...dotProps}:false,activeDot:withDots?{fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...activeDotProps}:false,fill:color,stroke:"gradient"===type?`url(#${gradientId})`:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:fillOpacity,strokeOpacity:dimmed?.5:fillOpacity,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps})});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.LineChart,{data,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...lineChartProps,children:["gradient"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id:gradientId,x1:"0",y1:"0",x2:"0",y2:"1",children:stops})}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"gradient"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?valueFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,showColor:"gradient"!==type,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});LineChart.displayName="@mantine/charts/LineChart";LineChart.classes=grid_chart_module_css_classes;"use client";const Sparkline_classes={};const Sparkline_defaultProps={withGradient:true,connectNulls:true,fillOpacity:.6,strokeWidth:2,curveType:"linear"};function getTrendColor(data,trendColors){const first=data[0];const last=data[data.length-1];if(null===first||null===last)return trendColors.neutral||trendColors.positive;if(first<last)return trendColors.positive;if(first>last)return trendColors.negative;return trendColors.neutral||trendColors.positive}const Sparkline_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{color,data,trendColors})=>({root:{"--chart-color":trendColors?(0,index_mjs_.getThemeColor)(getTrendColor(data,trendColors),theme):color?(0,index_mjs_.getThemeColor)(color,theme):void 0}}));const Sparkline=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Sparkline",Sparkline_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withGradient,fillOpacity,curveType,strokeWidth,trendColors,connectNulls,areaProps,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Sparkline",classes:Sparkline_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:Sparkline_varsResolver});const id=(0,index_js_.useId)();const mappedData=(0,index_js_.useMemo)(()=>data.map((value,index)=>({value,index})),[data]);return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,dir:"ltr",children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data:mappedData,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{dataKey:"value",type:curveType,fill:`url(#${id})`,stroke:"var(--chart-color, var(--mantine-color-blue-filled))",isAnimationActive:false,connectNulls,strokeWidth,fillOpacity:1,...areaProps}),/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{id,color:"var(--chart-color, var(--mantine-color-blue-filled))",fillOpacity,withGradient})})]})})})});Sparkline.displayName="@mantine/charts/Sparkline";Sparkline.classes=Sparkline_classes;"use client";var DonutChart_module_css_classes={root:"m_a410e613",label:"m_ddb0bfe3"};"use client";const DonutChart_defaultProps={withTooltip:true,withLabelsLine:true,paddingAngle:0,thickness:20,size:160,strokeWidth:1,startAngle:0,endAngle:360,labelsType:"value",tooltipDataSource:"all"};const DonutChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType)return`${(100*(percent||0)).toFixed(0)}%`;if("function"==typeof valueFormatter)return valueFormatter(value||0);return value};const getLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:getLabelValue(labelsType,value,percent,valueFormatter)})});const DonutChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("DonutChart",DonutChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,thickness,strokeWidth,startAngle,endAngle,tooltipDataSource,chartLabel,children,pieChartProps,valueFormatter,strokeColor,labelsType,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"DonutChart",classes:DonutChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:DonutChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:size/2-thickness,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?getLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),chartLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",...getStyles("label"),children:chartLabel}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});DonutChart.displayName="@mantine/charts/DonutChart";DonutChart.classes=DonutChart_module_css_classes;"use client";var PieChart_module_css_classes={root:"m_cd8943fd"};"use client";const PieChart_defaultProps={withTooltip:false,withLabelsLine:true,paddingAngle:0,size:160,strokeWidth:1,startAngle:0,endAngle:360,tooltipDataSource:"all",labelsPosition:"outside",labelsType:"value"};const PieChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size,labelsPosition})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels&&"outside"===labelsPosition?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const PieChart_getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType&&"number"==typeof percent)return`${(100*percent).toFixed(0)}%`;if("function"==typeof valueFormatter&&"number"==typeof value)return valueFormatter(value);return value};const getInsideLabel=(labelsType,valueFormatter)=>({cx,cy,midAngle,innerRadius,outerRadius,value,percent})=>{const RADIAN=Math.PI/180;const radius=innerRadius+(outerRadius-innerRadius)*.5;const x=cx+radius*Math.cos(-(midAngle||0)*RADIAN);const y=cy+radius*Math.sin(-(midAngle||0)*RADIAN);return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,textAnchor:x>cx?"start":"end",dominantBaseline:"central",className:PieChart_module_css_classes.label,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})};const getOutsideLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})});const PieChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("PieChart",PieChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,strokeWidth,startAngle,endAngle,tooltipDataSource,children,pieChartProps,labelsPosition,valueFormatter,labelsType,strokeColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"PieChart",classes:PieChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:PieChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:0,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?"inside"===labelsPosition?getInsideLabel(labelsType||"value",valueFormatter):getOutsideLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine&&"outside"===labelsPosition?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});PieChart.displayName="@mantine/charts/PieChart";PieChart.classes=PieChart_module_css_classes;"use client";var RadarChart_module_css_classes={root:"m_1f271cf7",container:"m_cf06f58c"};"use client";const RadarChart_defaultProps={withPolarGrid:true,withPolarAngleAxis:true,withPolarRadiusAxis:false,withTooltip:false,withDots:false,tooltipAnimationDuration:0};const RadarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{gridColor,textColor})=>({root:{"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0}}));const RadarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadarChart",RadarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,dataKey,gridColor,textColor,radarProps,radarChartProps,polarGridProps,polarAngleAxisProps,polarRadiusAxisProps,tooltipProps,withPolarGrid,withPolarAngleAxis,withPolarRadiusAxis,withTooltip,tooltipAnimationDuration,children,withLegend,withDots,dotProps,activeDotProps,legendProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"RadarChart",classes:RadarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadarChart_varsResolver});const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const radars=series.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Radar,{name:item.name,dataKey:item.name,stroke:(0,index_mjs_.getThemeColor)(item.strokeColor||item.color,theme),fill:(0,index_mjs_.getThemeColor)(item.color,theme),fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||.4:.05:item.opacity||.4,dot:withDots?{fillOpacity:1,strokeOpacity:0,strokeWidth:1,fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...dotProps}:false,activeDot:withDots?{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...activeDotProps}:false,strokeOpacity:highlightedArea?highlightedArea===item.name?1:.1:1,isAnimationActive:false,..."function"==typeof radarProps?radarProps(item):radarProps},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadarChart,{data,...radarChartProps,children:[withPolarGrid&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarGrid,{stroke:"var(--chart-grid-color)",...polarGridProps}),withPolarAngleAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarAngleAxis,{dataKey,...polarAngleAxisProps}),withPolarRadiusAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarRadiusAxis,{stroke:"var(--chart-grid-color)",...polarRadiusAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...tooltipProps}),radars,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,series,centered:true,attributes}),...legendProps}),children]})})})});RadarChart.displayName="@mantine/charts/RadarChart";RadarChart.classes=RadarChart_module_css_classes;"use client";function getAxis(key,dataKey){return key===dataKey.x?"x":"y"}const ScatterChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x"};const ScatterChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const ScatterChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ScatterChart",ScatterChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,referenceLines,dir,withLegend,withTooltip,withXAxis,withYAxis,xAxisProps,yAxisProps,orientation,scatterChartProps,legendProps,data,gridAxis,tickLine,strokeDasharray,gridProps,tooltipAnimationDuration,tooltipProps,children,onMouseLeave,dataKey,textColor,gridColor,xAxisLabel,yAxisLabel,unit,labels,valueFormatter,scatterProps,pointLabels,attributes,...others}=props;const getFormatter=axis=>"function"==typeof valueFormatter?valueFormatter:valueFormatter?.[axis];const xFormatter=getFormatter("x");const yFormatter=getFormatter("y");const theme=(0,index_mjs_.useMantineTheme)();const mappedData=data.map(item=>({...item,data:item.data.map(point=>({...point,name:item.name}))}));const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"ScatterChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:ScatterChart_varsResolver});const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const scatters=mappedData.map((item,index)=>{const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Scatter,{data:item.data,fill:(0,index_mjs_.getThemeColor)(item.color,theme),isAnimationActive:false,fillOpacity:dimmed?.1:1,...scatterProps,children:[pointLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{dataKey:dataKey[pointLabels],fontSize:8,dy:10}),scatterProps?.children]},index)});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...scatterChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{type:"number",hide:!withXAxis,dataKey:dataKey.x,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,unit:unit?.x,tickFormatter:xFormatter,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{type:"number",hide:!withYAxis,axisLine:false,dataKey:dataKey.y,tickLine:withYTickLine?{stroke:"currentColor"}:false,tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},allowDecimals:true,unit:unit?.y,tickFormatter:yFormatter,...getStyles("axis"),...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{type:"scatter",label,payload:labels?payload?.map(item=>({...item,name:labels[getAxis(item.name,dataKey)]||item.name,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})):payload?.map(item=>({...item,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})),classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),...tooltipProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map((item,index)=>({...item,dataKey:data[index].name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),height:44,...legendProps}),referenceLinesItems,scatters]})})})});ScatterChart.displayName="@mantine/charts/ScatterChart";ScatterChart.classes=grid_chart_module_css_classes;"use client";function getDomain(data,key){const values=data.map(item=>item[key]);return[Math.min(...values),Math.max(...values)]}function BubbleChartTooltip({active,payload,getStyles,dataKey,valueFormatter}){if(active&&payload&&payload.length){const data=payload[0]&&payload[0].payload;return/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltip"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:data[dataKey.x]}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:valueFormatter?valueFormatter(data[dataKey.z]):data[dataKey.z]})]})})}return null}const BubbleChart_defaultProps={color:"blue.6",withTooltip:true};const BubbleChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const BubbleChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BubbleChart",BubbleChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,xAxisProps,yAxisProps,zAxisProps,tooltipProps,scatterProps,color,label,withTooltip,dataKey,range,valueFormatter,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"BubbleChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BubbleChart_varsResolver});const yAxisWidth=label?void 0:{width:0};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.XAxis,{type:"category",dataKey:dataKey.x,interval:0,tick:{fontSize:12,fill:"currentColor"},tickLine:{transform:"translate(0, -6)",stroke:"currentColor"},stroke:"currentColor",...getStyles("axis"),...xAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.YAxis,{type:"number",dataKey:dataKey.y,height:10,...yAxisWidth,tick:false,tickLine:false,axisLine:false,label:{value:label,position:"insideRight",fontSize:12,fill:"currentColor"},...getStyles("axis"),...yAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ZAxis,{type:"number",dataKey:dataKey.z,domain:getDomain(data,dataKey.z),range,...zAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:100,isAnimationActive:false,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:"3 3"},content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(BubbleChartTooltip,{dataKey,active:payload.active,payload:payload.payload,getStyles,valueFormatter}),...tooltipProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Scatter,{data,fill:(0,index_mjs_.getThemeColor)(color,theme),isAnimationActive:false,...scatterProps})]})})})});BubbleChart.displayName="@mantine/charts/BubbleChart";BubbleChart.classes=grid_chart_module_css_classes;"use client";const CompositeChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone"};const CompositeChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const CompositeChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("CompositeChart",CompositeChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,connectNulls,curveType,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,areaProps,barProps,withBarValueLabel,minBarSize,maxBarWidth,composedChartProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"CompositeChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:CompositeChart_varsResolver});const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;if("line"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:"var(--mantine-color-white)",stroke:color,...activeDotProps}:false,fill:color,stroke:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps});if("area"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:color,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps}:false,fillOpacity:dimmed?0:.2,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps});if("bar"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:1,strokeOpacity:dimmed?.2:0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>valueFormatter?.(val)}));return null});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,type:"number",tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ComposedChart,{data,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...composedChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,dataKey,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});CompositeChart.displayName="@mantine/charts/CompositeChart";CompositeChart.classes=grid_chart_module_css_classes;"use client";var RadialBarChart_module_css_classes={root:"m_cd2bd9e5",tooltip:"m_6bcc3420"};"use client";const RadialBarChart_defaultProps={barSize:20,startAngle:90,endAngle:-270,withBackground:true,withTooltip:true};const RadialBarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{emptyBackgroundColor})=>({root:{"--chart-empty-background":emptyBackgroundColor?(0,index_mjs_.getThemeColor)(emptyBackgroundColor,theme):void 0}}));const RadialBarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadialBarChart",RadialBarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,barSize,withBackground,dataKey,radialBarProps,radialBarChartProps,withLabels,withLegend,legendProps,withTooltip,tooltipProps,startAngle,endAngle,attributes,...others}=props;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const getStyles=(0,index_mjs_.useStyles)({name:"RadialBarChart",classes:RadialBarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadialBarChart_varsResolver});const theme=(0,index_mjs_.useMantineTheme)();const dataWithResolvedColor=data.map(({color,...item})=>{const resolvedColor=(0,index_mjs_.getThemeColor)(color,theme);return{...item,fill:resolvedColor,fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||1:.05:item.opacity||1}});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadialBarChart,{margin:{top:0,bottom:0,left:0,right:0},innerRadius:"10%",outerRadius:"100%",cx:"50%",cy:"50%",barSize,startAngle,endAngle,data:dataWithResolvedColor,...radialBarChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.RadialBar,{label:withLabels?{position:"insideStart",fill:"var(--mantine-color-white)",fontSize:12}:void 0,background:withBackground?{fill:"var(--chart-empty-background)"}:void 0,dataKey,isAnimationActive:false,...radialBarProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map(item=>({...item,dataKey:item.payload?.name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,centered:true,attributes}),...legendProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:0,isAnimationActive:false,cursor:{stroke:"var(--chart-cursor-color)"},content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Paper,{...getStyles("tooltip"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"sm",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:payload?.[0]?.payload.fill,size:12,withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload.name})]}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload[dataKey]})]}),...tooltipProps})]})})})});RadialBarChart.displayName="@mantine/core/RadialBarChart";RadialBarChart.classes=RadialBarChart_module_css_classes;"use client";var FunnelChart_module_css_classes={root:"m_80d531e7"};"use client";const FunnelChart_defaultProps={withTooltip:true,size:300,strokeWidth:1,withLabels:false,labelsPosition:"right",tooltipDataSource:"all"};const FunnelChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":(0,index_mjs_.rem)(size)}}));const FunnelChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("FunnelChart",FunnelChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,strokeWidth,withLabels,size,valueFormatter,children,funnelChartProps,funnelProps,labelsPosition,tooltipDataSource,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"FunnelChart",classes:FunnelChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:FunnelChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.FunnelChart,{...funnelChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Funnel,{data,dataKey:"value",isAnimationActive:false,stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth,...funnelProps,children:[withLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:labelsPosition,fill:"inside"===labelsPosition?"var(--chart-labels-color, var(--mantine-color-white))":"var(--chart-labels-color, var(--mantine-color-dimmed))",stroke:"none",fontFamily:"var(--mantine-font-family)",fontSize:14,dataKey:entry=>"function"==typeof valueFormatter?valueFormatter(entry.value):entry.value}),data.map((entry,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(entry.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index))]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});FunnelChart.displayName="@mantine/charts/FunnelChart";FunnelChart.classes=FunnelChart_module_css_classes;"use client";function getBoundaries({data,domain}){if(Array.isArray(domain))return domain;const values=Object.values(data);return[Math.min(...values),Math.max(...values)]}"use client";function getColumns(datesRange,splitMonths){if(!splitMonths)return datesRange.map((week,weekIndex)=>{const firstDay=week.find(d=>null!==d);const month=new Date(firstDay).getMonth();return{type:"column",month,weekIndex}});const tmp=[];datesRange.forEach((week,weekIndex)=>{const months=week.map(d=>d?new Date(d).getMonth():null);let firstMonth=null;let boundaryIndex=null;for(let i=0;i<months.length;i+=1)if(null!==months[i]){if(null===firstMonth)firstMonth=months[i];else if(months[i]!==firstMonth){boundaryIndex=i;break}}if(null===firstMonth)return;if(null===boundaryIndex)tmp.push({type:"column",month:firstMonth,weekIndex});else{let nextMonth=null;for(let i=boundaryIndex;i<months.length;i+=1)if(null!==months[i]){nextMonth=months[i];break}if(null===nextMonth)tmp.push({type:"column",month:firstMonth,weekIndex});else{tmp.push({type:"column",month:firstMonth,weekIndex});tmp.push({type:"column",month:nextMonth,weekIndex})}}});const columns=[];for(let i=0;i<tmp.length;i+=1){if(i>0&&tmp[i].month!==tmp[i-1].month)columns.push({type:"spacer"});columns.push(tmp[i])}return columns}function getFirstMonthColumnIndex(columns,month){for(let i=0;i<columns.length;i+=1){const c=columns[i];if("column"===c.type&&c.month===month)return i}return -1}"use client";function formatDate(date){return date.toISOString().split("T")[0]}function addDays(date,days){return new Date(date.getTime()+864e5*days)}function startOfWeek(date,firstDayOfWeek){let value=new Date(date);while(value.getDay()!==firstDayOfWeek)value=addDays(value,-1);return value}function endOfWeek(date,firstDayOfWeek){const day=date.getDay();const diff=(day<firstDayOfWeek?7:0)+day-firstDayOfWeek;return addDays(date,6-diff)}function getDatesRange({startDate,endDate,withOutsideDates=true,firstDayOfWeek=1}={}){const start=startDate?new Date(startDate):new Date(/* @__PURE__ */new Date().getFullYear()-1,/* @__PURE__ */new Date().getMonth(),/* @__PURE__ */new Date().getDate());const end=endDate?new Date(endDate):/* @__PURE__ */new Date;const startWeek=startOfWeek(start,firstDayOfWeek);const endWeek=endOfWeek(end,firstDayOfWeek);const dates=[];let current=startWeek;while(current<=endWeek){const week=Array.from({length:7},(_,i)=>{const day=addDays(current,i);return withOutsideDates||day>=start&&day<=end?formatDate(day):null});dates.push(week);current=addDays(current,7)}return dates}"use client";function getMonthsRange(weeksData){let position=0;let current=null;const result=[];weeksData.forEach(week=>{const day=null===week[0]?week[week.length-1]:week[0];const month=new Date(day).getMonth();if(current!==month){current=month;result.push({month:current,position,size:0})}result[result.length-1].size+=1;position+=1});return result}"use client";function getHeatColor({value,min,max,colors}){const percent=(value-min)/(max-min);const colorIndex=Math.round((colors.length-1)*percent);return colors[colorIndex]}"use client";function HeatmapSplitWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;const columns=getColumns(datesRange,true);return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:columns.map((col,columnIndex)=>{if("spacer"===col.type)return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`},`spacer-${columnIndex}`);const week=datesRange[col.weekIndex];const days=week.map((date,dayIndex)=>{if(!date)return null;if(new Date(date).getMonth()!==col.month)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},`${date}-${col.month}`)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},`col-${col.weekIndex}-${col.month}-${columnIndex}`)})})}"use client";function HeatmapWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:datesRange.map((week,weekIndex)=>{const days=week.map((date,dayIndex)=>{if(!date)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},date)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${weekIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},weekIndex)})})}"use client";function rotateWeekdaysNames(weekdayNames,firstDayOfWeek){const rotated=[...weekdayNames];for(let i=0;i<firstDayOfWeek;i+=1)rotated.push(rotated.shift());return rotated}"use client";var Heatmap_module_css_classes={root:"m_2ef228c3",rect:"m_2ef201c5",monthLabel:"m_7e977775",weekdayLabel:"m_c4b68f8d"};"use client";const Heatmap_defaultProps={monthLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdayLabels:["Sun","Mon","","Wed","","Fri",""],withOutsideDates:true,firstDayOfWeek:1,rectSize:10,weekdaysLabelsWidth:30,monthsLabelsHeight:14,gap:1,rectRadius:2,fontSize:12,colors:["var(--heatmap-level-1)","var(--heatmap-level-2)","var(--heatmap-level-3)","var(--heatmap-level-4)"]};const Heatmap=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Heatmap",Heatmap_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,startDate,endDate,withMonthLabels,withWeekdayLabels,weekdayLabels,withOutsideDates,monthLabels,firstDayOfWeek,rectSize=10,gap=1,rectRadius,domain,colors,weekdaysLabelsWidth,monthsLabelsHeight,fontSize,getTooltipLabel,withTooltip,tooltipProps,getRectProps,splitMonths,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Heatmap",classes:Heatmap_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars});const[hoveredRect,setHoveredRect]=(0,index_js_.useState)(null);const rectSizeWithGap=rectSize+gap;const weekdaysOffset=withWeekdayLabels?weekdaysLabelsWidth:0;const monthsOffset=withMonthLabels?monthsLabelsHeight:0;const[min,max]=getBoundaries({data,domain});const rotatedWeekdayLabels=(0,index_js_.useMemo)(()=>rotateWeekdaysNames(weekdayLabels,firstDayOfWeek),[weekdayLabels,firstDayOfWeek]);const datesRange=getDatesRange({startDate,endDate,withOutsideDates,firstDayOfWeek});const monthsRange=withMonthLabels||splitMonths?getMonthsRange(datesRange):[];const weeksProps={data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles};const weeks=splitMonths?/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapSplitWeeks,{...weeksProps}):/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapWeeks,{...weeksProps});const totalColumns=splitMonths?getColumns(datesRange,splitMonths).length:datesRange.length;const computeMonthLabelX=(monthPosition,monthIndex)=>{if(!splitMonths)return monthPosition*rectSizeWithGap+gap+weekdaysOffset;const firstMonth=monthsRange[monthIndex];const columns=getColumns(datesRange,splitMonths);const i=getFirstMonthColumnIndex(columns,firstMonth.month);const base=i>=0?i:monthPosition;return(base+1)*rectSizeWithGap+gap+weekdaysOffset};const monthsLabelsNodes=withMonthLabels&&monthLabels?monthsRange.map((month,monthIndex)=>{const minSize=splitMonths?2:3;if(month.size<minSize)return null;const monthLabel=monthLabels[month.month];return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:computeMonthLabelX(month.position,monthIndex),y:monthsLabelsHeight-4,width:month.size*rectSizeWithGap,fontSize,...getStyles("monthLabel"),children:monthLabel},monthIndex)}):null;const weekdayLabelsNodes=withWeekdayLabels&&weekdayLabels?rotatedWeekdayLabels.map((weekdayLabel,dayIndex)=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:(dayIndex+1)*rectSizeWithGap-gap+monthsOffset,width:weekdaysLabelsWidth,fontSize,...getStyles("weekdayLabel"),children:weekdayLabel},dayIndex)):null;const label=getTooltipLabel&&hoveredRect&&withTooltip?getTooltipLabel(hoveredRect):null;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{component:"svg",ref,width:rectSizeWithGap*totalColumns+gap+weekdaysOffset,height:7*rectSizeWithGap+gap+monthsOffset,...getStyles("root"),...others,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Tooltip.Floating,{label,disabled:!withTooltip||!label,position:"top",...tooltipProps,children:/* @__PURE__ */(0,jsx_runtime.jsxs)("g",{transform:`translate(${weekdaysOffset}, ${monthsOffset})`,"data-id":"all-weeks",children:[withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{fill:"transparent",width:rectSizeWithGap*totalColumns+gap,height:7*rectSizeWithGap+gap}),weeks]})}),weekdayLabelsNodes,monthsLabelsNodes]})});Heatmap.displayName="@mantine/charts/Heatmap";Heatmap.classes=Heatmap_module_css_classes}}]);
package/dist/mf/711.js DELETED
@@ -1,10 +0,0 @@
1
- /*! For license information please see 711.js.LICENSE.txt */
2
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["711"],{9698:function(__unused_webpack_module,exports){/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)}}]);