@ysolve/ocity-heritage-visualizer 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- (function(F,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],f):(F=typeof globalThis<"u"?globalThis:F||self,f(F.OCityHeritageVisualizer={},F["react/jsx-runtime"],F.React))})(this,function(F,f,w){"use strict";const Pt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_DEBUG_MODE:"true",VITE_DEFAULT_IMAGE_URL:"https://o-city.org/assets/NO_AVAILABLE_IMG-4d02b370.png",VITE_ELEVENLABS_API_BASE:"https://api.elevenlabs.io/v1",VITE_ELEVENLABS_API_KEY:"sk_fcf711f6cba8630638aef7a7e1802559a1e9d029461b55cf",VITE_GOOGLE_TRANSLATE_BASE:"https://translate.googleapis.com/translate_a/single",VITE_IMAGE_BASE_URL:"https://eu2.contabostorage.com/7fb97413b6c243adb4347dafa02551a9:ocity/heritage/images/"};function te(e,t=!0){const n=Pt[e];if(!n&&t)throw new Error(`❌ Missing required env variable: ${e}`);return n??""}const ae={NODE_ENV:"production",ELEVENLABS_API_BASE:te("VITE_ELEVENLABS_API_BASE"),ELEVENLABS_API_KEY:te("VITE_ELEVENLABS_API_KEY"),DEBUG_MODE:!0,GOOGLE_TRANSLATE_BASE:te("VITE_GOOGLE_TRANSLATE_BASE"),IMAGE_BASE_URL:te("VITE_IMAGE_BASE_URL"),DEFAULT_IMAGE_URL:te("VITE_DEFAULT_IMAGE_URL")};async function Ut(e,t){if(!e.trim())return e;try{const n=`${ae.GOOGLE_TRANSLATE_BASE}?client=gtx&sl=auto&tl=${t}&dt=t&q=${encodeURIComponent(e)}`,r=await fetch(n);if(!r.ok)throw new Error(`Error en la traducción: ${r.status}`);const s=await r.json();return s&&Array.isArray(s[0])?s[0].map(i=>i[0]).join(""):e}catch(n){return console.error("Error al traducir:",n),e}}function je(e,t){return function(){return e.apply(t,arguments)}}const{toString:It}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:ce,toStringTag:Me}=Symbol,le=(e=>t=>{const n=It.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),D=e=>(e=e.toLowerCase(),t=>le(t)===e),ue=e=>t=>typeof t===e,{isArray:Z}=Array,ne=ue("undefined");function Ft(e){return e!==null&&!ne(e)&&e.constructor!==null&&!ne(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=D("ArrayBuffer");function Dt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$e(e.buffer),t}const jt=ue("string"),P=ue("function"),qe=ue("number"),de=e=>e!==null&&typeof e=="object",Mt=e=>e===!0||e===!1,fe=e=>{if(le(e)!=="object")return!1;const t=Te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Me in e)&&!(ce in e)},$t=D("Date"),qt=D("File"),Ht=D("Blob"),zt=D("FileList"),Vt=e=>de(e)&&P(e.pipe),Jt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=le(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Gt=D("URLSearchParams"),[Wt,Kt,Xt,Zt]=["ReadableStream","Request","Response","Headers"].map(D),Yt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function He(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const G=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ze=e=>!ne(e)&&e!==G;function Ae(){const{caseless:e}=ze(this)&&this||{},t={},n=(r,s)=>{const i=e&&He(t,s)||s;fe(t[i])&&fe(r)?t[i]=Ae(t[i],r):fe(r)?t[i]=Ae({},r):Z(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&re(arguments[r],n);return t}const Qt=(e,t,n,{allOwnKeys:r}={})=>(re(t,(s,i)=>{n&&P(s)?e[i]=je(s,n):e[i]=s},{allOwnKeys:r}),e),en=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),tn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},nn=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},rn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},sn=e=>{if(!e)return null;if(Z(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},on=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Te(Uint8Array)),an=(e,t)=>{const r=(e&&e[ce]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},cn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ln=D("HTMLFormElement"),un=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dn=D("RegExp"),Je=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};re(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},fn=e=>{Je(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Z(e)?r(e):r(String(e).split(t)),n},hn=()=>{},mn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function gn(e){return!!(e&&P(e.append)&&e[Me]==="FormData"&&e[ce])}const wn=e=>{const t=new Array(10),n=(r,s)=>{if(de(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=Z(r)?[]:{};return re(r,(o,c)=>{const l=n(o,s+1);!ne(l)&&(i[c]=l)}),t[s]=void 0,i}}return r};return n(e,0)},yn=D("AsyncFunction"),En=e=>e&&(de(e)||P(e))&&P(e.then)&&P(e.catch),Ge=((e,t)=>e?setImmediate:t?((n,r)=>(G.addEventListener("message",({source:s,data:i})=>{s===G&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),G.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(G.postMessage)),bn=typeof queueMicrotask<"u"?queueMicrotask.bind(G):typeof process<"u"&&process.nextTick||Ge,a={isArray:Z,isArrayBuffer:$e,isBuffer:Ft,isFormData:Jt,isArrayBufferView:Dt,isString:jt,isNumber:qe,isBoolean:Mt,isObject:de,isPlainObject:fe,isReadableStream:Wt,isRequest:Kt,isResponse:Xt,isHeaders:Zt,isUndefined:ne,isDate:$t,isFile:qt,isBlob:Ht,isRegExp:dn,isFunction:P,isStream:Vt,isURLSearchParams:Gt,isTypedArray:on,isFileList:zt,forEach:re,merge:Ae,extend:Qt,trim:Yt,stripBOM:en,inherits:tn,toFlatObject:nn,kindOf:le,kindOfTest:D,endsWith:rn,toArray:sn,forEachEntry:an,matchAll:cn,isHTMLForm:ln,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Je,freezeMethods:fn,toObjectSet:pn,toCamelCase:un,noop:hn,toFiniteNumber:mn,findKey:He,global:G,isContextDefined:ze,isSpecCompliantForm:gn,toJSONObject:wn,isAsyncFn:yn,isThenable:En,setImmediate:Ge,asap:bn,isIterable:e=>e!=null&&P(e[ce])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const We=y.prototype,Ke={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ke[e]={value:e}}),Object.defineProperties(y,Ke),Object.defineProperty(We,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(We);return a.toFlatObject(e,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),y.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Sn=null;function Oe(e){return a.isPlainObject(e)||a.isArray(e)}function Xe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,i){return s=Xe(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function _n(e){return a.isArray(e)&&!e.some(Oe)}const Tn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function pe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!a.isUndefined(m[g])});const r=n.metaTokens,s=n.visitor||d,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!l&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,g,m){let A=p;if(p&&!m&&typeof p=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&_n(p)||(a.isFileList(p)||a.endsWith(g,"[]"))&&(A=a.toArray(p)))return g=Xe(g),A.forEach(function(T,B){!(a.isUndefined(T)||T===null)&&t.append(o===!0?Ze([g],B,i):o===null?g:g+"[]",u(T))}),!1}return Oe(p)?!0:(t.append(Ze(m,g,i),u(p)),!1)}const h=[],E=Object.assign(Tn,{defaultVisitor:d,convertValue:u,isVisitable:Oe});function b(p,g){if(!a.isUndefined(p)){if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(p),a.forEach(p,function(A,R){(!(a.isUndefined(A)||A===null)&&s.call(t,A,a.isString(R)?R.trim():R,g,E))===!0&&b(A,g?g.concat(R):[R])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ye(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Re(e,t){this._pairs=[],e&&pe(e,this,t)}const Qe=Re.prototype;Qe.append=function(t,n){this._pairs.push([t,n])},Qe.toString=function(t){const n=t?function(r){return t.call(this,r,Ye)}:Ye;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function An(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function et(e,t,n){if(!t)return e;const r=n&&n.encode||An;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Re(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class tt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},On={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Re,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ve=typeof window<"u"&&typeof document<"u",Ce=typeof navigator=="object"&&navigator||void 0,Rn=ve&&(!Ce||["ReactNative","NativeScript","NS"].indexOf(Ce.product)<0),vn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cn=ve&&window.location.href||"http://localhost",N={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ve,hasStandardBrowserEnv:Rn,hasStandardBrowserWebWorkerEnv:vn,navigator:Ce,origin:Cn},Symbol.toStringTag,{value:"Module"})),...On};function xn(e,t){return pe(e,new N.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return N.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Ln(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Bn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function rt(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),l=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,l?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Bn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Ln(r),s,n,0)}),n}return null}function Nn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const se={transitional:nt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(rt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return pe(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Nn(t)):t}],transformResponse:[function(t){const n=this.transitional||se.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:N.classes.FormData,Blob:N.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{se.headers[e]={}});const kn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pn=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&kn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},st=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function he(e){return e===!1||e==null?e:a.isArray(e)?e.map(he):String(e)}function Un(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const In=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function xe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Fn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Dn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let U=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,l,u){const d=oe(l);if(!d)throw new Error("header name must be a non-empty string");const h=a.findKey(s,d);(!h||s[h]===void 0||u===!0||u===void 0&&s[h]!==!1)&&(s[h||l]=he(c))}const o=(c,l)=>a.forEach(c,(u,d)=>i(u,d,l));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!In(t))o(Pn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},l,u;for(const d of t){if(!a.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[u=d[0]]=(l=c[u])?a.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=oe(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Un(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=oe(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||xe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=oe(o),o){const c=a.findKey(r,o);c&&(!n||xe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||xe(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=he(s),delete n[i];return}const c=t?Fn(i):String(i).trim();c!==i&&delete n[i],n[c]=he(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[st]=this[st]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=oe(o);r[c]||(Dn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(U.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(U);function Le(e,t){const n=this||se,r=t||n,s=U.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ot(e){return!!(e&&e.__CANCEL__)}function Y(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(Y,y,{__CANCEL__:!0});function it(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function jn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Mn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=r[i];o||(o=u),n[s]=l,r[s]=u;let h=i,E=0;for(;h!==s;)E+=n[h++],h=h%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const b=d&&u-d;return b?Math.round(E*1e3/b):void 0}}function $n(e,t){let n=0,r=1e3/t,s,i;const o=(u,d=Date.now())=>{n=d,s=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-n;h>=r?o(u,d):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-h)))},()=>s&&o(s)]}const me=(e,t,n=3)=>{let r=0;const s=Mn(50,250);return $n(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,l=o-r,u=s(l),d=o<=c;r=o;const h={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&d?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},at=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ct=e=>(...t)=>a.asap(()=>e(...t)),qn=N.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,N.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(N.origin),N.navigator&&/(msie|trident)/i.test(N.navigator.userAgent)):()=>!0,Hn=N.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function zn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lt(e,t,n){let r=!zn(t);return e&&(r||n==!1)?Vn(e,t):t}const ut=e=>e instanceof U?{...e}:e;function W(e,t){t=t||{};const n={};function r(u,d,h,E){return a.isPlainObject(u)&&a.isPlainObject(d)?a.merge.call({caseless:E},u,d):a.isPlainObject(d)?a.merge({},d):a.isArray(d)?d.slice():d}function s(u,d,h,E){if(a.isUndefined(d)){if(!a.isUndefined(u))return r(void 0,u,h,E)}else return r(u,d,h,E)}function i(u,d){if(!a.isUndefined(d))return r(void 0,d)}function o(u,d){if(a.isUndefined(d)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function c(u,d,h){if(h in t)return r(u,d);if(h in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,d,h)=>s(ut(u),ut(d),h,!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(d){const h=l[d]||s,E=h(e[d],t[d],d);a.isUndefined(E)&&h!==c||(n[d]=E)}),n}const dt=e=>{const t=W({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;t.headers=o=U.from(o),t.url=et(lt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(a.isFormData(n)){if(N.hasStandardBrowserEnv||N.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(N.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&qn(t.url))){const u=s&&i&&Hn.read(i);u&&o.set(s,u)}return t},Jn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=dt(e);let i=s.data;const o=U.from(s.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=s,d,h,E,b,p;function g(){b&&b(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function A(){if(!m)return;const T=U.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:T,config:e,request:m};it(function(j){n(j),g()},function(j){r(j),g()},x),m=null}"onloadend"in m?m.onloadend=A:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(A)},m.onabort=function(){m&&(r(new y("Request aborted",y.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let B=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||nt;s.timeoutErrorMessage&&(B=s.timeoutErrorMessage),r(new y(B,x.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(B,x){m.setRequestHeader(x,B)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),u&&([E,p]=me(u,!0),m.addEventListener("progress",E)),l&&m.upload&&([h,b]=me(l),m.upload.addEventListener("progress",h),m.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(d=T=>{m&&(r(!T||T.type?new Y(null,e,m):T),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const R=jn(s.url);if(R&&N.protocols.indexOf(R)===-1){r(new y("Unsupported protocol "+R+":",y.ERR_BAD_REQUEST,e));return}m.send(i||null)})},Gn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,c();const d=u instanceof Error?u:this.reason;r.abort(d instanceof y?d:new Y(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>a.asap(c),l}},Wn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Kn=async function*(e,t){for await(const n of Xn(e))yield*Wn(n,t)},Xn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ft=(e,t,n,r)=>{const s=Kn(e,t);let i=0,o,c=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await s.next();if(u){c(),l.close();return}let h=d.byteLength;if(n){let E=i+=h;n(E)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),s.return()}},{highWaterMark:2})},ge=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pt=ge&&typeof ReadableStream=="function",Zn=ge&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ht=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Yn=pt&&ht(()=>{let e=!1;const t=new Request(N.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),mt=64*1024,Be=pt&&ht(()=>a.isReadableStream(new Response("").body)),we={stream:Be&&(e=>e.body)};ge&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!we[t]&&(we[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Qn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(N.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Zn(e)).byteLength},er=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Qn(t)},Ne={http:Sn,xhr:Jn,fetch:ge&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:E}=dt(e);u=u?(u+"").toLowerCase():"text";let b=Gn([s,i&&i.toAbortSignal()],o),p;const g=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let m;try{if(l&&Yn&&n!=="get"&&n!=="head"&&(m=await er(d,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(a.isFormData(r)&&(k=x.headers.get("content-type"))&&d.setContentType(k),x.body){const[j,S]=at(m,me(ct(l)));r=ft(x.body,mt,j,S)}}a.isString(h)||(h=h?"include":"omit");const A="credentials"in Request.prototype;p=new Request(t,{...E,signal:b,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:A?h:void 0});let R=await fetch(p,E);const T=Be&&(u==="stream"||u==="response");if(Be&&(c||T&&g)){const x={};["status","statusText","headers"].forEach(v=>{x[v]=R[v]});const k=a.toFiniteNumber(R.headers.get("content-length")),[j,S]=c&&at(k,me(ct(c),!0))||[];R=new Response(ft(R.body,mt,j,()=>{S&&S(),g&&g()}),x)}u=u||"text";let B=await we[a.findKey(we,u)||"text"](R,e);return!T&&g&&g(),await new Promise((x,k)=>{it(x,k,{data:B,headers:U.from(R.headers),status:R.status,statusText:R.statusText,config:e,request:p})})}catch(A){throw g&&g(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:A.cause||A}):y.from(A,A&&A.code,e,p)}})};a.forEach(Ne,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const gt=e=>`- ${e}`,tr=e=>a.isFunction(e)||e===null||e===!1,wt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!tr(n)&&(r=Ne[(o=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
1
+ (function(F,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],m):(F=typeof globalThis<"u"?globalThis:F||self,m(F.OCityHeritageVisualizer={},F["react/jsx-runtime"],F.React))})(this,function(F,m,w){"use strict";const Nt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_DEBUG_MODE:"false",VITE_DEFAULT_IMAGE_URL:"https://o-city.org/assets/NO_AVAILABLE_IMG-4d02b370.png",VITE_ELEVENLABS_API_BASE:"https://api.elevenlabs.io/v1",VITE_ELEVENLABS_API_KEY:"sk_fcf711f6cba8630638aef7a7e1802559a1e9d029461b55cf",VITE_GOOGLE_TRANSLATE_BASE:"https://translate.googleapis.com/translate_a/single",VITE_IMAGE_BASE_URL:"https://eu2.contabostorage.com/7fb97413b6c243adb4347dafa02551a9:ocity/heritage/images/"};function te(e,t=!0){const n=Nt[e];if(!n&&t)throw new Error(`❌ Missing required env variable: ${e}`);return n??""}const ne={NODE_ENV:"production",ELEVENLABS_API_BASE:te("VITE_ELEVENLABS_API_BASE"),ELEVENLABS_API_KEY:te("VITE_ELEVENLABS_API_KEY"),DEBUG_MODE:!1,GOOGLE_TRANSLATE_BASE:te("VITE_GOOGLE_TRANSLATE_BASE"),IMAGE_BASE_URL:te("VITE_IMAGE_BASE_URL"),DEFAULT_IMAGE_URL:te("VITE_DEFAULT_IMAGE_URL")};async function Pt(e,t){if(!e.trim())return e;try{const n=`${ne.GOOGLE_TRANSLATE_BASE}?client=gtx&sl=auto&tl=${t}&dt=t&q=${encodeURIComponent(e)}`,r=await fetch(n);if(!r.ok)throw new Error(`Error en la traducción: ${r.status}`);const s=await r.json();return s&&Array.isArray(s[0])?s[0].map(i=>i[0]).join(""):e}catch(n){return console.error("Error al traducir:",n),e}}function je(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ut}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:ce,toStringTag:Me}=Symbol,le=(e=>t=>{const n=Ut.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),D=e=>(e=e.toLowerCase(),t=>le(t)===e),ue=e=>t=>typeof t===e,{isArray:Z}=Array,re=ue("undefined");function It(e){return e!==null&&!re(e)&&e.constructor!==null&&!re(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=D("ArrayBuffer");function Ft(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$e(e.buffer),t}const Dt=ue("string"),P=ue("function"),qe=ue("number"),de=e=>e!==null&&typeof e=="object",jt=e=>e===!0||e===!1,fe=e=>{if(le(e)!=="object")return!1;const t=Te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Me in e)&&!(ce in e)},Mt=D("Date"),$t=D("File"),qt=D("Blob"),Ht=D("FileList"),zt=e=>de(e)&&P(e.pipe),Vt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=le(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Jt=D("URLSearchParams"),[Gt,Wt,Kt,Xt]=["ReadableStream","Request","Response","Headers"].map(D),Zt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function se(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function He(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const G=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ze=e=>!re(e)&&e!==G;function Ae(){const{caseless:e}=ze(this)&&this||{},t={},n=(r,s)=>{const i=e&&He(t,s)||s;fe(t[i])&&fe(r)?t[i]=Ae(t[i],r):fe(r)?t[i]=Ae({},r):Z(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&se(arguments[r],n);return t}const Yt=(e,t,n,{allOwnKeys:r}={})=>(se(t,(s,i)=>{n&&P(s)?e[i]=je(s,n):e[i]=s},{allOwnKeys:r}),e),Qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),en=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},tn=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},nn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},rn=e=>{if(!e)return null;if(Z(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Te(Uint8Array)),on=(e,t)=>{const r=(e&&e[ce]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},an=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},cn=D("HTMLFormElement"),ln=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),un=D("RegExp"),Je=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};se(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},dn=e=>{Je(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},fn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Z(e)?r(e):r(String(e).split(t)),n},pn=()=>{},hn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function mn(e){return!!(e&&P(e.append)&&e[Me]==="FormData"&&e[ce])}const gn=e=>{const t=new Array(10),n=(r,s)=>{if(de(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=Z(r)?[]:{};return se(r,(o,c)=>{const l=n(o,s+1);!re(l)&&(i[c]=l)}),t[s]=void 0,i}}return r};return n(e,0)},wn=D("AsyncFunction"),yn=e=>e&&(de(e)||P(e))&&P(e.then)&&P(e.catch),Ge=((e,t)=>e?setImmediate:t?((n,r)=>(G.addEventListener("message",({source:s,data:i})=>{s===G&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),G.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(G.postMessage)),En=typeof queueMicrotask<"u"?queueMicrotask.bind(G):typeof process<"u"&&process.nextTick||Ge,a={isArray:Z,isArrayBuffer:$e,isBuffer:It,isFormData:Vt,isArrayBufferView:Ft,isString:Dt,isNumber:qe,isBoolean:jt,isObject:de,isPlainObject:fe,isReadableStream:Gt,isRequest:Wt,isResponse:Kt,isHeaders:Xt,isUndefined:re,isDate:Mt,isFile:$t,isBlob:qt,isRegExp:un,isFunction:P,isStream:zt,isURLSearchParams:Jt,isTypedArray:sn,isFileList:Ht,forEach:se,merge:Ae,extend:Yt,trim:Zt,stripBOM:Qt,inherits:en,toFlatObject:tn,kindOf:le,kindOfTest:D,endsWith:nn,toArray:rn,forEachEntry:on,matchAll:an,isHTMLForm:cn,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Je,freezeMethods:dn,toObjectSet:fn,toCamelCase:ln,noop:pn,toFiniteNumber:hn,findKey:He,global:G,isContextDefined:ze,isSpecCompliantForm:mn,toJSONObject:gn,isAsyncFn:wn,isThenable:yn,setImmediate:Ge,asap:En,isIterable:e=>e!=null&&P(e[ce])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const We=y.prototype,Ke={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ke[e]={value:e}}),Object.defineProperties(y,Ke),Object.defineProperty(We,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(We);return a.toFlatObject(e,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),y.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const bn=null;function Re(e){return a.isPlainObject(e)||a.isArray(e)}function Xe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,i){return s=Xe(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Sn(e){return a.isArray(e)&&!e.some(Re)}const _n=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function pe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||d,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!l&&a.isBlob(f))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,g,h){let _=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Sn(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(_=a.toArray(f)))return g=Xe(g),_.forEach(function(T,B){!(a.isUndefined(T)||T===null)&&t.append(o===!0?Ze([g],B,i):o===null?g:g+"[]",u(T))}),!1}return Re(f)?!0:(t.append(Ze(h,g,i),u(f)),!1)}const p=[],E=Object.assign(_n,{defaultVisitor:d,convertValue:u,isVisitable:Re});function b(f,g){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(f),a.forEach(f,function(_,R){(!(a.isUndefined(_)||_===null)&&s.call(t,_,a.isString(R)?R.trim():R,g,E))===!0&&b(_,g?g.concat(R):[R])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ye(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Oe(e,t){this._pairs=[],e&&pe(e,this,t)}const Qe=Oe.prototype;Qe.append=function(t,n){this._pairs.push([t,n])},Qe.toString=function(t){const n=t?function(r){return t.call(this,r,Ye)}:Ye;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Tn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function et(e,t,n){if(!t)return e;const r=n&&n.encode||Tn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Oe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class tt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},An={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Oe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Le=typeof window<"u"&&typeof document<"u",xe=typeof navigator=="object"&&navigator||void 0,Rn=Le&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),On=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ln=Le&&window.location.href||"http://localhost",v={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Le,hasStandardBrowserEnv:Rn,hasStandardBrowserWebWorkerEnv:On,navigator:xe,origin:Ln},Symbol.toStringTag,{value:"Module"})),...An};function xn(e,t){return pe(e,new v.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return v.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Cn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Bn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function rt(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),l=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,l?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Bn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Cn(r),s,n,0)}),n}return null}function vn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const oe={transitional:nt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(rt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return pe(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),vn(t)):t}],transformResponse:[function(t){const n=this.transitional||oe.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:v.classes.FormData,Blob:v.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{oe.headers[e]={}});const kn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nn=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&kn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},st=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function he(e){return e===!1||e==null?e:a.isArray(e)?e.map(he):String(e)}function Pn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Un=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ce(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function In(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Fn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let U=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,l,u){const d=ie(l);if(!d)throw new Error("header name must be a non-empty string");const p=a.findKey(s,d);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||l]=he(c))}const o=(c,l)=>a.forEach(c,(u,d)=>i(u,d,l));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Un(t))o(Nn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},l,u;for(const d of t){if(!a.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[u=d[0]]=(l=c[u])?a.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=ie(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Pn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ie(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ce(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=ie(o),o){const c=a.findKey(r,o);c&&(!n||Ce(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Ce(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=he(s),delete n[i];return}const c=t?In(i):String(i).trim();c!==i&&delete n[i],n[c]=he(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[st]=this[st]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=ie(o);r[c]||(Fn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(U.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(U);function Be(e,t){const n=this||oe,r=t||n,s=U.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ot(e){return!!(e&&e.__CANCEL__)}function Y(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(Y,y,{__CANCEL__:!0});function it(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Dn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function jn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=r[i];o||(o=u),n[s]=l,r[s]=u;let p=i,E=0;for(;p!==s;)E+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const b=d&&u-d;return b?Math.round(E*1e3/b):void 0}}function Mn(e,t){let n=0,r=1e3/t,s,i;const o=(u,d=Date.now())=>{n=d,s=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),p=d-n;p>=r?o(u,d):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const me=(e,t,n=3)=>{let r=0;const s=jn(50,250);return Mn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,l=o-r,u=s(l),d=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&d?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},at=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ct=e=>(...t)=>a.asap(()=>e(...t)),$n=v.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,v.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(v.origin),v.navigator&&/(msie|trident)/i.test(v.navigator.userAgent)):()=>!0,qn=v.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lt(e,t,n){let r=!Hn(t);return e&&(r||n==!1)?zn(e,t):t}const ut=e=>e instanceof U?{...e}:e;function W(e,t){t=t||{};const n={};function r(u,d,p,E){return a.isPlainObject(u)&&a.isPlainObject(d)?a.merge.call({caseless:E},u,d):a.isPlainObject(d)?a.merge({},d):a.isArray(d)?d.slice():d}function s(u,d,p,E){if(a.isUndefined(d)){if(!a.isUndefined(u))return r(void 0,u,p,E)}else return r(u,d,p,E)}function i(u,d){if(!a.isUndefined(d))return r(void 0,d)}function o(u,d){if(a.isUndefined(d)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function c(u,d,p){if(p in t)return r(u,d);if(p in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,d,p)=>s(ut(u),ut(d),p,!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(d){const p=l[d]||s,E=p(e[d],t[d],d);a.isUndefined(E)&&p!==c||(n[d]=E)}),n}const dt=e=>{const t=W({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;t.headers=o=U.from(o),t.url=et(lt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(a.isFormData(n)){if(v.hasStandardBrowserEnv||v.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(v.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&$n(t.url))){const u=s&&i&&qn.read(i);u&&o.set(s,u)}return t},Vn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=dt(e);let i=s.data;const o=U.from(s.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=s,d,p,E,b,f;function g(){b&&b(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function _(){if(!h)return;const T=U.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:T,config:e,request:h};it(function(j){n(j),g()},function(j){r(j),g()},x),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let B=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||nt;s.timeoutErrorMessage&&(B=s.timeoutErrorMessage),r(new y(B,x.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(B,x){h.setRequestHeader(x,B)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([E,f]=me(u,!0),h.addEventListener("progress",E)),l&&h.upload&&([p,b]=me(l),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(d=T=>{h&&(r(!T||T.type?new Y(null,e,h):T),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const R=Dn(s.url);if(R&&v.protocols.indexOf(R)===-1){r(new y("Unsupported protocol "+R+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Jn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,c();const d=u instanceof Error?u:this.reason;r.abort(d instanceof y?d:new Y(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>a.asap(c),l}},Gn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Wn=async function*(e,t){for await(const n of Kn(e))yield*Gn(n,t)},Kn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ft=(e,t,n,r)=>{const s=Wn(e,t);let i=0,o,c=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await s.next();if(u){c(),l.close();return}let p=d.byteLength;if(n){let E=i+=p;n(E)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),s.return()}},{highWaterMark:2})},ge=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pt=ge&&typeof ReadableStream=="function",Xn=ge&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ht=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Zn=pt&&ht(()=>{let e=!1;const t=new Request(v.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),mt=64*1024,ve=pt&&ht(()=>a.isReadableStream(new Response("").body)),we={stream:ve&&(e=>e.body)};ge&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!we[t]&&(we[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Yn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(v.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Xn(e)).byteLength},Qn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Yn(t)},ke={http:bn,xhr:Vn,fetch:ge&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:d,withCredentials:p="same-origin",fetchOptions:E}=dt(e);u=u?(u+"").toLowerCase():"text";let b=Jn([s,i&&i.toAbortSignal()],o),f;const g=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let h;try{if(l&&Zn&&n!=="get"&&n!=="head"&&(h=await Qn(d,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(a.isFormData(r)&&(k=x.headers.get("content-type"))&&d.setContentType(k),x.body){const[j,S]=at(h,me(ct(l)));r=ft(x.body,mt,j,S)}}a.isString(p)||(p=p?"include":"omit");const _="credentials"in Request.prototype;f=new Request(t,{...E,signal:b,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:_?p:void 0});let R=await fetch(f,E);const T=ve&&(u==="stream"||u==="response");if(ve&&(c||T&&g)){const x={};["status","statusText","headers"].forEach(O=>{x[O]=R[O]});const k=a.toFiniteNumber(R.headers.get("content-length")),[j,S]=c&&at(k,me(ct(c),!0))||[];R=new Response(ft(R.body,mt,j,()=>{S&&S(),g&&g()}),x)}u=u||"text";let B=await we[a.findKey(we,u)||"text"](R,e);return!T&&g&&g(),await new Promise((x,k)=>{it(x,k,{data:B,headers:U.from(R.headers),status:R.status,statusText:R.statusText,config:e,request:f})})}catch(_){throw g&&g(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,f),{cause:_.cause||_}):y.from(_,_&&_.code,e,f)}})};a.forEach(ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const gt=e=>`- ${e}`,er=e=>a.isFunction(e)||e===null||e===!1,wt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!er(n)&&(r=ke[(o=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
4
4
  `+i.map(gt).join(`
5
- `):" "+gt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Ne};function ke(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Y(null,e)}function yt(e){return ke(e),e.headers=U.from(e.headers),e.data=Le.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wt.getAdapter(e.adapter||se.adapter)(e).then(function(r){return ke(e),r.data=Le.call(e,e.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return ot(r)||(ke(e),r&&r.response&&(r.response.data=Le.call(e,e.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Et="1.10.0",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const bt={};ye.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Et+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!bt[o]&&(bt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ye.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function nr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],l=c===void 0||o(c,i,e);if(l!==!0)throw new y("option "+i+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const Ee={assertOptions:nr,validators:ye},M=Ee.validators;let K=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=W(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Ee.assertOptions(r,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Ee.assertOptions(s,{encode:M.function,serialize:M.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ee.assertOptions(n,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=U.concat(o,i);const c=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,h=0,E;if(!l){const p=[yt.bind(this),void 0];for(p.unshift.apply(p,c),p.push.apply(p,u),E=p.length,d=Promise.resolve(n);h<E;)d=d.then(p[h++],p[h++]);return d}E=c.length;let b=n;for(h=0;h<E;){const p=c[h++],g=c[h++];try{b=p(b)}catch(m){g.call(this,m);break}}try{d=yt.call(this,b)}catch(p){return Promise.reject(p)}for(h=0,E=u.length;h<E;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=W(this.defaults,t);const n=lt(t.baseURL,t.url,t.allowAbsoluteUrls);return et(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){K.prototype[t]=function(n,r){return this.request(W(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(W(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}K.prototype[t]=n(),K.prototype[t+"Form"]=n(!0)});let rr=class kt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new Y(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kt(function(s){t=s}),cancel:t}}};function sr(e){return function(n){return e.apply(null,n)}}function or(e){return a.isObject(e)&&e.isAxiosError===!0}const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach(([e,t])=>{Pe[t]=e});function St(e){const t=new K(e),n=je(K.prototype.request,t);return a.extend(n,K.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return St(W(e,s))},n}const C=St(se);C.Axios=K,C.CanceledError=Y,C.CancelToken=rr,C.isCancel=ot,C.VERSION=Et,C.toFormData=pe,C.AxiosError=y,C.Cancel=C.CanceledError,C.all=function(t){return Promise.all(t)},C.spread=sr,C.isAxiosError=or,C.mergeConfig=W,C.AxiosHeaders=U,C.formToJSON=e=>rt(a.isHTMLForm(e)?new FormData(e):e),C.getAdapter=wt.getAdapter,C.HttpStatusCode=Pe,C.default=C;const{Axios:Br,AxiosError:Nr,CanceledError:kr,isCancel:Pr,CancelToken:Ur,VERSION:Ir,all:Fr,Cancel:Dr,isAxiosError:jr,spread:Mr,toFormData:$r,AxiosHeaders:qr,HttpStatusCode:Hr,formToJSON:zr,getAdapter:Vr,mergeConfig:Jr}=C;function Ue(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function ir(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=Ue(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let Ie;function _t(){return Ie||(Ie=ir("keyval-store","keyval")),Ie}function ar(e,t=_t()){return t("readonly",n=>Ue(n.get(e)))}function cr(e,t,n=_t()){return n("readwrite",r=>(r.put(t,e),Ue(r.transaction)))}async function lr(e){return await ar(e)??null}async function ur(e,t){await cr(e,t)}function dr(e){const[t,n]=w.useState({isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0,avatars:e.avatars,error:null}),[r,s]=w.useState(e.autoAdvance||!1),[i,o]=w.useState(!1),[,c]=w.useState(0),l=w.useRef(null),u=w.useRef(null),d=w.useRef(r),h=w.useRef(!1),E=w.useRef(null);w.useEffect(()=>{d.current=r},[r]);const b=S=>{if(e.avatars.length<=1)return 0;const v=e.avatars.length,$=100/v;return Math.min(Math.floor(S/$),v-1)},p=()=>{u.current&&(clearInterval(u.current),u.current=null)},g=()=>{l.current&&(u.current=setInterval(()=>{if(l.current&&l.current.duration){const S=l.current.currentTime,v=l.current.duration,$=S/v*100;n(ee=>({...ee,progress:Math.min($,100),currentPNGTuber:b($)}))}},100))},m=()=>{var S;l.current&&!t.isPaused&&(l.current.pause(),p(),n(v=>({...v,isPlaying:!1,isPaused:!0})),(S=e.onPause)==null||S.call(e))},A=async()=>{if(l.current&&t.isPaused)try{await l.current.play(),g(),n(S=>({...S,isPlaying:!0,isPaused:!1}))}catch(S){console.error("Error al reanudar audio:",S),n(v=>({...v,error:{type:"audio",message:"Error al reanudar la reproducción"}}))}},R=()=>{B(!0)},T=()=>{s(S=>!S)},B=(S=!1)=>{p(),l.current&&(E.current&&(l.current.removeEventListener("ended",E.current),E.current=null),l.current.removeEventListener("error",x),l.current.removeEventListener("pause",k),l.current.pause(),l.current.currentTime=0,l.current.src="",l.current.load(),l.current=null),n(v=>({...v,isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0})),d.current&&!h.current&&(h.current=!0,c(v=>v+1)),S||setTimeout(()=>{var v;(v=e.onStop)==null||v.call(e)},50)},x=()=>{n(S=>({...S,error:{type:"audio",message:"Error al reproducir el audio"}})),B()},k=()=>{l.current&&l.current.currentTime<l.current.duration&&n(S=>({...S,isPlaying:!1,isPaused:!0}))},j=async()=>{var v,$,ee;if(!e.text.trim()){n(L=>({...L,error:{type:"synthesis",message:"No hay contenido para reproducir"}}));return}h.current=!1,B(!0);const S=`${e.voiceId}-${e.lang??"auto"}-${e.model??"multilingual"}-${e.text}`;try{o(!0),n(I=>({...I,isPlaying:!1,progress:0,currentPNGTuber:0,error:null}));let L=await lr(S);if(!L){const I=e.model==="standard"?"eleven_monolingual_v1":e.model==="enhanced"?"eleven_turbo_v2":"eleven_multilingual_v2";L=(await C.post(`${ae.ELEVENLABS_API_BASE}/text-to-speech/${e.voiceId}`,{text:e.text,model_id:I,voice_settings:{stability:e.stability??.7,similarity_boost:e.similarityBoost??.8,style:0,use_speaker_boost:!0}},{headers:{"xi-api-key":e.apiKey,"Content-Type":"application/json"},responseType:"blob"})).data,L&&await ur(S,L)}if(L){const I=URL.createObjectURL(L);l.current=new Audio(I);const z=()=>{B(!1),URL.revokeObjectURL(I)};E.current=z,l.current.addEventListener("ended",z),l.current.addEventListener("error",x),l.current.addEventListener("pause",k),l.current.addEventListener("canplaythrough",async()=>{var be;o(!1),n(V=>({...V,isPlaying:!0})),g();try{await((be=l.current)==null?void 0:be.play())}catch(V){console.error("Error al iniciar reproducción:",V),n(q=>({...q,error:{type:"audio",message:"Error al iniciar la reproducción"}})),B()}})}}catch(L){console.error("Error al reproducir TTS:",L),n(I=>({...I,error:{type:"network",message:`Error en la API: ${L.message}`},isPlaying:!1})),p(),o(!1),C.isAxiosError(L)?(console.error("Código de estado:",(v=L.response)==null?void 0:v.status),(($=L.response)==null?void 0:$.data)instanceof Blob?L.response.data.text().then(I=>{console.error("Respuesta de error (texto):",I);try{const z=JSON.parse(I);console.error("Respuesta de error (JSON):",z)}catch{console.error("No es JSON válido")}}):console.error("Respuesta de error:",(ee=L.response)==null?void 0:ee.data)):console.error("Error inesperado:",L)}};return w.useEffect(()=>()=>{p(),l.current&&(l.current.pause(),l.current.src="",l.current.load(),l.current=null)},[]),w.useEffect(()=>{e.voiceId&&(l.current&&(l.current.pause(),l.current.src="",l.current.load(),l.current=null),p(),n(S=>({...S,isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0})))},[e.voiceId]),{...t,play:j,pause:m,resume:A,stop:R,toggleAutoAdvance:T,isAutoAdvancing:r,isLoadingAudio:i,avatars:e.avatars}}const Q={selectorWrapper:"_selectorWrapper_1kmif_1",iconButton:"_iconButton_1kmif_6",dropdown:"_dropdown_1kmif_18",dropdownItem:"_dropdownItem_1kmif_31",active:"_active_1kmif_44"},Tt=({languages:e,current:t,onChange:n})=>{const[r,s]=w.useState(!1),[i,o]=w.useState(t||e[0].code),c=w.useRef(null);return w.useEffect(()=>{const l=u=>{c.current&&!c.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),f.jsxs("div",{className:Q.selectorWrapper,ref:c,children:[f.jsx("button",{className:Q.iconButton,title:"Cambiar idioma",onClick:()=>s(!r),children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"white",width:"30px",height:"30px",viewBox:"0 0 24 24",children:f.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"})})}),r&&f.jsx("div",{className:Q.dropdown,children:e.map(l=>f.jsx("button",{className:`${Q.dropdownItem} ${l.code===i?Q.active:""}`,onClick:()=>{o(l.code),n==null||n(l.code),s(!1)},children:l.label},l.code))})]})},_={controlsRow:"_controlsRow_8wakc_1",select:"_select_8wakc_9",autoAdvanceButton:"_autoAdvanceButton_8wakc_15",section:"_section_8wakc_26",textarea:"_textarea_8wakc_36",input:"_input_8wakc_46",error:"_error_8wakc_54",buttonPrimary:"_buttonPrimary_8wakc_59",buttonSuccess:"_buttonSuccess_8wakc_69",infoBox:"_infoBox_8wakc_78",viewer:"_viewer_8wakc_86",viewerTopBar:"_viewerTopBar_8wakc_97",topRightControls:"_topRightControls_8wakc_110",itemCounter:"_itemCounter_8wakc_118",iconButton:"_iconButton_8wakc_126",navButton:"_navButton_8wakc_146",navButtonLeft:"_navButtonLeft_8wakc_163",navButtonRight:"_navButtonRight_8wakc_167",backgroundImage:"_backgroundImage_8wakc_171",avatar:"_avatar_8wakc_178",caption:"_caption_8wakc_188",captionTitle:"_captionTitle_8wakc_201",captionText:"_captionText_8wakc_211",loadingOverlay:"_loadingOverlay_8wakc_217",loadingSpinner:"_loadingSpinner_8wakc_232",spin:"_spin_8wakc_251",loadingButton:"_loadingButton_8wakc_242",spinner:"_spinner_8wakc_251",progressBar:"_progressBar_8wakc_264",progressFill:"_progressFill_8wakc_273",playbackControls:"_playbackControls_8wakc_279",playButton:"_playButton_8wakc_292",pauseButton:"_pauseButton_8wakc_293"},At=[{id:"21m00Tcm4TlvDq8ikWAM",name:"Voz Mujer"},{id:"Nh2zY9kknu6z4pZy6FhD",name:"Voz Hombre Joven"}],Ot=ae.DEFAULT_IMAGE_URL,fr=({heritageItems:e=[],targetLanguage:t="es",descriptionLength:n="extended",autoAdvance:r=!1,voiceIds:s=[],avatars:i=[]})=>{const[o]=w.useState(e),[c,l]=w.useState(0),[u,d]=w.useState(n),[h,E]=w.useState(t),[b,p]=w.useState(""),[g,m]=w.useState([]),[A,R]=w.useState(0),[T,B]=w.useState(r),[x,k]=w.useState(!1),[j,S]=w.useState(s.length>0?s[0]:""),v=j||(s.length>0?s[c%s.length]:""),$=i[c%i.length],[ee,L]=w.useState(!1),[I,z]=w.useState(!1),[be,V]=w.useState(!0),q=w.useRef(null),Rt=w.useRef(T),vt=w.useRef(c),Fe=w.useRef(o),X=w.useRef(null),Se=w.useRef(!1);w.useEffect(()=>{Rt.current=T,vt.current=c,Fe.current=o},[T,c,o]);const _e=o[c]||{id:"default",name:"Patrimonio Cultural",description:{local:{short:"Ingrese un JSON válido para comenzar",extended:"Ingrese un JSON válido para comenzar"}},imageUrl:""},{isPlaying:J,isPaused:Ct,isLoadingAudio:pr,progress:xt,play:hr,pause:mr,resume:gr,stop:wr}=dr({text:b,lang:h,onStop:()=>{V(!0),Rt.current&&Fe.current.length>1&&!Se.current&&setTimeout(()=>{k(!0);const O=(vt.current+1)%Fe.current.length;l(O)},100),Se.current=!1},voiceId:v,avatars:[$],apiKey:ae.ELEVENLABS_API_KEY});w.useEffect(()=>{if(x&&b&&!b.includes("JSON válido")){const O=setTimeout(()=>{J||Lt(),k(!1)},500);return()=>clearTimeout(O)}},[x,b,J]),w.useEffect(()=>{(async()=>{const H=_e.description.local[u];if(H)try{const ie=await Ut(H,h);p(ie)}catch(ie){console.error("Error en traducción:",ie),p(H)}})()},[_e,u,h]);const De=()=>{V(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{V(!1)},4e3)},Lt=()=>{if(!b.trim()||b.includes("JSON válido")){alert("No hay contenido para reproducir");return}hr(),De()},yr=()=>{mr()},Er=()=>{gr(),De()},Bt=()=>{wr(),k(!1),q.current&&clearTimeout(q.current),X.current&&clearTimeout(X.current),V(!0)},br=()=>{Se.current=!0,Bt(),c>0&&l(O=>O-1)},Sr=()=>{Se.current=!0,Bt(),c<o.length-1&&l(O=>O+1)};w.useEffect(()=>()=>{q.current&&clearTimeout(q.current),X.current&&clearTimeout(X.current)},[]),w.useEffect(()=>{if(b){const O=b.split(new RegExp("(?<=[.!?])\\s+","g")).map(H=>H.trim()).filter(H=>H.length>0);m(O),R(0)}},[b]),w.useEffect(()=>{if(!J||g.length===0)return;q.current&&clearTimeout(q.current);const H=1500+g[A].length*50;q.current=setTimeout(()=>{R(ie=>(ie+1)%g.length)},H)},[J,g,A]);const[Nt,_r]=w.useState(!1),Tr=O=>{S(O),_r(!0)};return w.useEffect(()=>{!Nt&&s.length>0&&S(s[c%s.length])},[c,s,Nt]),f.jsxs("div",{children:[f.jsxs("div",{className:_.controlsRow,children:[f.jsxs("select",{value:u,onChange:O=>d(O.target.value),className:_.select,children:[f.jsx("option",{value:"short",children:"Descripción Corta"}),f.jsx("option",{value:"extended",children:"Descripción Extendida"})]}),f.jsxs("select",{value:h,onChange:O=>E(O.target.value),className:_.select,children:[f.jsx("option",{value:"en",children:"Inglés"}),f.jsx("option",{value:"es",children:"Español"}),f.jsx("option",{value:"fr",children:"Francés"})]}),f.jsx("select",{value:v,onChange:O=>Tr(O.target.value),className:_.select,children:At.map(O=>f.jsx("option",{value:O.id,children:O.name},O.id))}),f.jsx("button",{onClick:()=>B(!T),className:_.autoAdvanceButton,style:{backgroundColor:T?"#34a853":"#ea4335"},children:T?"⏩ AUTO ON":"⏩ AUTO OFF"})]}),f.jsxs("div",{className:_.viewer,onClick:De,children:[f.jsxs("div",{className:_.viewerTopBar,children:[f.jsx("div",{className:_.itemCounter,children:o.length>0?`${c+1}/${o.length}`:"0/0"}),f.jsxs("div",{className:_.topRightControls,children:[f.jsx("button",{onClick:()=>B(!T),className:_.iconButton,title:"Autoplay",style:{backgroundColor:T?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)"},children:f.jsx("svg",{width:"20px",height:"20px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{style:{fill:T?"black":"white"},d:"M5.23331,0.493645 C6.8801,-0.113331 8.6808,-0.161915 10.3579,0.355379 C11.4019,0.6773972 12.361984,1.20757325 13.1838415,1.90671757 L13.4526,2.14597 L14.2929,1.30564 C14.8955087,0.703065739 15.9071843,1.0850774 15.994017,1.89911843 L16,2.01275 L16,6.00002 L12.0127,6.00002 C11.1605348,6.00002 10.7153321,5.01450817 11.2294893,4.37749065 L11.3056,4.29291 L12.0372,3.56137 C11.389,2.97184 10.6156,2.52782 9.76845,2.26653 C8.5106,1.87856 7.16008,1.915 5.92498,2.37023 C4.68989,2.82547 3.63877,3.67423 2.93361,4.78573 C2.22844,5.89723 1.90836,7.20978 2.02268,8.52112 C2.13701,9.83246 2.6794,11.0698 3.56627,12.0425 C4.45315,13.0152 5.63528,13.6693 6.93052,13.9039 C8.22576,14.1385 9.56221,13.9407 10.7339,13.3409 C11.9057,12.7412 12.8476,11.7727 13.4147,10.5848 C13.6526,10.0864 14.2495,9.8752 14.748,10.1131 C15.2464,10.351 15.4575,10.948 15.2196,11.4464 C14.4635,13.0302 13.2076,14.3215 11.6453,15.1213 C10.0829,15.921 8.30101,16.1847 6.57402,15.8719 C4.84704,15.559 3.27086,14.687 2.08836,13.39 C0.905861,12.0931 0.182675,10.4433 0.0302394,8.69483 C-0.122195,6.94637 0.304581,5.1963 1.2448,3.7143 C2.18503,2.2323 3.58652,1.10062 5.23331,0.493645 Z M6,5.46077 C6,5.09472714 6.37499031,4.86235811 6.69509872,5.0000726 L6.7678,5.03853 L10.7714,7.57776 C11.0528545,7.75626909 11.0784413,8.14585256 10.8481603,8.36273881 L10.7714,8.42224 L6.7678,10.9615 C6.45867857,11.1575214 6.06160816,10.965274 6.00646097,10.6211914 L6,10.5392 L6,5.46077 Z"})})}),f.jsx(Tt,{languages:[{code:"es",label:"Español"},{code:"en",label:"English"},{code:"fr",label:"Français"}],current:"es",onChange:O=>E(O)})]})]}),f.jsx("button",{onClick:br,disabled:o.length===0,className:`${_.navButton} ${_.navButtonLeft}`,title:"Anterior",onMouseOver:()=>L(!0),onMouseOut:()=>L(!1),children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{width:"24px",height:"24px",transition:"transform 0.2s ease-in-out",transform:ee?"scale(1.5)":"scale(1)"},children:f.jsx("path",{d:"M15 18l-6-6 6-6"})})}),f.jsx("button",{onClick:Sr,disabled:o.length===0,className:`${_.navButton} ${_.navButtonRight}`,title:"Siguiente",onMouseOver:()=>z(!0),onMouseOut:()=>z(!1),children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{width:"24px",height:"24px",transition:"transform 0.2s ease-in-out",transform:I?"scale(1.5)":"scale(1)"},children:f.jsx("path",{d:"M9 6l6 6-6 6"})})}),f.jsx("img",{src:_e.imageUrl||Ot,alt:"Background",className:_.backgroundImage,style:{opacity:J?1:.7},onError:O=>O.currentTarget.src=Ot}),J&&f.jsx(f.Fragment,{children:f.jsx("img",{src:$,alt:"Avatar",className:_.avatar,style:{transform:`scale(${xt%10<5?4:4.05})`}})}),f.jsxs("div",{className:_.caption,children:[f.jsx("h4",{className:_.captionTitle,children:_e.name}),J&&f.jsx(f.Fragment,{children:f.jsx("p",{className:_.captionText,children:g.length>0&&g[A]})})]}),x&&f.jsxs("div",{className:_.loadingOverlay,children:[f.jsx("div",{className:_.loadingSpinner}),f.jsx("p",{children:"Cargando siguiente patrimonio..."})]}),be&&f.jsx("div",{className:_.playbackControls,children:pr?f.jsx("button",{disabled:!0,className:_.loadingButton,children:f.jsxs("svg",{className:_.spinner,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}):!J&&!Ct?f.jsx("button",{onClick:Lt,disabled:o.length===0||x,className:_.playButton,children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"white",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M9 8.5 L9 15.5 L16 12 Z"})})}):Ct?f.jsx("button",{onClick:Er,className:_.playButton,children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"white",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M9 8.5 L9 15.5 L16 12 Z"})})}):f.jsx("button",{onClick:yr,className:_.pauseButton,children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"16"}),f.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"16"})]})})}),f.jsx("div",{className:_.progressBar,children:f.jsx("div",{className:_.progressFill,style:{width:`${xt}%`}})})]})]})};F.LanguageSelector=Tt,F.LanguageSelectorStyles=Q,F.StoryVisualizer=fr,F.StoryVisualizerStyles=_,F.voices=At,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
5
+ `):" "+gt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:ke};function Ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Y(null,e)}function yt(e){return Ne(e),e.headers=U.from(e.headers),e.data=Be.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wt.getAdapter(e.adapter||oe.adapter)(e).then(function(r){return Ne(e),r.data=Be.call(e,e.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return ot(r)||(Ne(e),r&&r.response&&(r.response.data=Be.call(e,e.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Et="1.10.0",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const bt={};ye.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Et+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!bt[o]&&(bt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ye.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function tr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],l=c===void 0||o(c,i,e);if(l!==!0)throw new y("option "+i+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const Ee={assertOptions:tr,validators:ye},M=Ee.validators;let K=class{constructor(t){this.defaults=t||{},this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=W(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Ee.assertOptions(r,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Ee.assertOptions(s,{encode:M.function,serialize:M.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ee.assertOptions(n,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=U.concat(o,i);const c=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,p=0,E;if(!l){const f=[yt.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,u),E=f.length,d=Promise.resolve(n);p<E;)d=d.then(f[p++],f[p++]);return d}E=c.length;let b=n;for(p=0;p<E;){const f=c[p++],g=c[p++];try{b=f(b)}catch(h){g.call(this,h);break}}try{d=yt.call(this,b)}catch(f){return Promise.reject(f)}for(p=0,E=u.length;p<E;)d=d.then(u[p++],u[p++]);return d}getUri(t){t=W(this.defaults,t);const n=lt(t.baseURL,t.url,t.allowAbsoluteUrls);return et(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){K.prototype[t]=function(n,r){return this.request(W(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(W(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}K.prototype[t]=n(),K.prototype[t+"Form"]=n(!0)});let nr=class kt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new Y(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kt(function(s){t=s}),cancel:t}}};function rr(e){return function(n){return e.apply(null,n)}}function sr(e){return a.isObject(e)&&e.isAxiosError===!0}const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach(([e,t])=>{Pe[t]=e});function St(e){const t=new K(e),n=je(K.prototype.request,t);return a.extend(n,K.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return St(W(e,s))},n}const L=St(oe);L.Axios=K,L.CanceledError=Y,L.CancelToken=nr,L.isCancel=ot,L.VERSION=Et,L.toFormData=pe,L.AxiosError=y,L.Cancel=L.CanceledError,L.all=function(t){return Promise.all(t)},L.spread=rr,L.isAxiosError=sr,L.mergeConfig=W,L.AxiosHeaders=U,L.formToJSON=e=>rt(a.isHTMLForm(e)?new FormData(e):e),L.getAdapter=wt.getAdapter,L.HttpStatusCode=Pe,L.default=L;const{Axios:Cr,AxiosError:Br,CanceledError:vr,isCancel:kr,CancelToken:Nr,VERSION:Pr,all:Ur,Cancel:Ir,isAxiosError:Fr,spread:Dr,toFormData:jr,AxiosHeaders:Mr,HttpStatusCode:$r,formToJSON:qr,getAdapter:Hr,mergeConfig:zr}=L;function Ue(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function or(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=Ue(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let Ie;function _t(){return Ie||(Ie=or("keyval-store","keyval")),Ie}function ir(e,t=_t()){return t("readonly",n=>Ue(n.get(e)))}function ar(e,t,n=_t()){return n("readwrite",r=>(r.put(t,e),Ue(r.transaction)))}async function cr(e){return await ir(e)??null}async function lr(e,t){await ar(e,t)}function ur(e){const[t,n]=w.useState({isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0,avatars:e.avatars,error:null}),[r,s]=w.useState(e.autoAdvance||!1),[i,o]=w.useState(!1),[,c]=w.useState(0),l=w.useRef(null),u=w.useRef(null),d=w.useRef(r),p=w.useRef(!1),E=w.useRef(null);w.useEffect(()=>{d.current=r},[r]);const b=S=>{if(e.avatars.length<=1)return 0;const O=e.avatars.length,$=100/O;return Math.min(Math.floor(S/$),O-1)},f=()=>{u.current&&(clearInterval(u.current),u.current=null)},g=()=>{l.current&&(u.current=setInterval(()=>{if(l.current&&l.current.duration){const S=l.current.currentTime,O=l.current.duration,$=S/O*100;n(ee=>({...ee,progress:Math.min($,100),currentPNGTuber:b($)}))}},100))},h=()=>{var S;l.current&&!t.isPaused&&(l.current.pause(),f(),n(O=>({...O,isPlaying:!1,isPaused:!0})),(S=e.onPause)==null||S.call(e))},_=async()=>{if(l.current&&t.isPaused)try{await l.current.play(),g(),n(S=>({...S,isPlaying:!0,isPaused:!1}))}catch(S){console.error("Error al reanudar audio:",S),n(O=>({...O,error:{type:"audio",message:"Error al reanudar la reproducción"}}))}},R=()=>{B(!0)},T=()=>{s(S=>!S)},B=(S=!1)=>{f(),l.current&&(E.current&&(l.current.removeEventListener("ended",E.current),E.current=null),l.current.removeEventListener("error",x),l.current.removeEventListener("pause",k),l.current.pause(),l.current.currentTime=0,l.current.src="",l.current.load(),l.current=null),n(O=>({...O,isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0})),d.current&&!p.current&&(p.current=!0,c(O=>O+1)),S||setTimeout(()=>{var O;(O=e.onStop)==null||O.call(e)},50)},x=()=>{n(S=>({...S,error:{type:"audio",message:"Error al reproducir el audio"}})),B()},k=()=>{l.current&&l.current.currentTime<l.current.duration&&n(S=>({...S,isPlaying:!1,isPaused:!0}))},j=async()=>{var O,$,ee;if(!e.text.trim()){n(C=>({...C,error:{type:"synthesis",message:"No hay contenido para reproducir"}}));return}p.current=!1,B(!0);const S=`${e.voiceId}-${e.lang??"auto"}-${e.model??"multilingual"}-${e.text}`;try{o(!0),n(I=>({...I,isPlaying:!1,progress:0,currentPNGTuber:0,error:null}));let C=await cr(S);if(!C){const I=e.model==="standard"?"eleven_monolingual_v1":e.model==="enhanced"?"eleven_turbo_v2":"eleven_multilingual_v2";C=(await L.post(`${ne.ELEVENLABS_API_BASE}/text-to-speech/${e.voiceId}`,{text:e.text,model_id:I,voice_settings:{stability:e.stability??.7,similarity_boost:e.similarityBoost??.8,style:0,use_speaker_boost:!0}},{headers:{"xi-api-key":e.apiKey,"Content-Type":"application/json"},responseType:"blob"})).data,C&&await lr(S,C)}if(C){const I=URL.createObjectURL(C);l.current=new Audio(I);const z=()=>{B(!1),URL.revokeObjectURL(I)};E.current=z,l.current.addEventListener("ended",z),l.current.addEventListener("error",x),l.current.addEventListener("pause",k),l.current.addEventListener("canplaythrough",async()=>{var be;o(!1),n(V=>({...V,isPlaying:!0})),g();try{await((be=l.current)==null?void 0:be.play())}catch(V){console.error("Error al iniciar reproducción:",V),n(q=>({...q,error:{type:"audio",message:"Error al iniciar la reproducción"}})),B()}})}}catch(C){console.error("Error al reproducir TTS:",C),n(I=>({...I,error:{type:"network",message:`Error en la API: ${C.message}`},isPlaying:!1})),f(),o(!1),L.isAxiosError(C)?(console.error("Código de estado:",(O=C.response)==null?void 0:O.status),(($=C.response)==null?void 0:$.data)instanceof Blob?C.response.data.text().then(I=>{console.error("Respuesta de error (texto):",I);try{const z=JSON.parse(I);console.error("Respuesta de error (JSON):",z)}catch{console.error("No es JSON válido")}}):console.error("Respuesta de error:",(ee=C.response)==null?void 0:ee.data)):console.error("Error inesperado:",C)}};return w.useEffect(()=>()=>{f(),l.current&&(l.current.pause(),l.current.src="",l.current.load(),l.current=null)},[]),w.useEffect(()=>{e.voiceId&&(l.current&&(l.current.pause(),l.current.src="",l.current.load(),l.current=null),f(),n(S=>({...S,isPlaying:!1,isPaused:!1,progress:0,currentPNGTuber:0})))},[e.voiceId]),{...t,play:j,pause:h,resume:_,stop:R,toggleAutoAdvance:T,isAutoAdvancing:r,isLoadingAudio:i,avatars:e.avatars}}const Q={selectorWrapper:"_selectorWrapper_1kmif_1",iconButton:"_iconButton_1kmif_6",dropdown:"_dropdown_1kmif_18",dropdownItem:"_dropdownItem_1kmif_31",active:"_active_1kmif_44"},Tt=({languages:e,current:t,onChange:n})=>{const[r,s]=w.useState(!1),[i,o]=w.useState(t||e[0].code),c=w.useRef(null);return w.useEffect(()=>{const l=u=>{c.current&&!c.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),m.jsxs("div",{className:Q.selectorWrapper,ref:c,children:[m.jsx("button",{className:Q.iconButton,title:"Cambiar idioma",onClick:()=>s(!r),children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"white",width:"30px",height:"30px",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"})})}),r&&m.jsx("div",{className:Q.dropdown,children:e.map(l=>m.jsx("button",{className:`${Q.dropdownItem} ${l.code===i?Q.active:""}`,onClick:()=>{o(l.code),n==null||n(l.code),s(!1)},children:l.label},l.code))})]})},A={controlsRow:"_controlsRow_8wakc_1",select:"_select_8wakc_9",autoAdvanceButton:"_autoAdvanceButton_8wakc_15",section:"_section_8wakc_26",textarea:"_textarea_8wakc_36",input:"_input_8wakc_46",error:"_error_8wakc_54",buttonPrimary:"_buttonPrimary_8wakc_59",buttonSuccess:"_buttonSuccess_8wakc_69",infoBox:"_infoBox_8wakc_78",viewer:"_viewer_8wakc_86",viewerTopBar:"_viewerTopBar_8wakc_97",topRightControls:"_topRightControls_8wakc_110",itemCounter:"_itemCounter_8wakc_118",iconButton:"_iconButton_8wakc_126",navButton:"_navButton_8wakc_146",navButtonLeft:"_navButtonLeft_8wakc_163",navButtonRight:"_navButtonRight_8wakc_167",backgroundImage:"_backgroundImage_8wakc_171",avatar:"_avatar_8wakc_178",caption:"_caption_8wakc_188",captionTitle:"_captionTitle_8wakc_201",captionText:"_captionText_8wakc_211",loadingOverlay:"_loadingOverlay_8wakc_217",loadingSpinner:"_loadingSpinner_8wakc_232",spin:"_spin_8wakc_251",loadingButton:"_loadingButton_8wakc_242",spinner:"_spinner_8wakc_251",progressBar:"_progressBar_8wakc_264",progressFill:"_progressFill_8wakc_273",playbackControls:"_playbackControls_8wakc_279",playButton:"_playButton_8wakc_292",pauseButton:"_pauseButton_8wakc_293"},dr=[{id:"21m00Tcm4TlvDq8ikWAM",name:"Voz Mujer"},{id:"Nh2zY9kknu6z4pZy6FhD",name:"Voz Hombre Joven"}],At=ne.DEFAULT_IMAGE_URL,fr=({heritageItems:e=[],targetLanguage:t="es",descriptionLength:n="extended",autoAdvance:r=!1,voiceIds:s=[],avatars:i=[]})=>{const[o]=w.useState(e),[c,l]=w.useState(0),[u,d]=w.useState(n),[p,E]=w.useState(t),[b,f]=w.useState(""),[g,h]=w.useState([]),[_,R]=w.useState(0),[T,B]=w.useState(r),[x,k]=w.useState(!1),[j,S]=w.useState(s.length>0?s[0]:""),O=j||(s.length>0?s[c%s.length]:""),$=i[c%i.length],[ee,C]=w.useState(!1),[I,z]=w.useState(!1),[be,V]=w.useState(!0),q=w.useRef(null),Rt=w.useRef(T),Ot=w.useRef(c),Fe=w.useRef(o),X=w.useRef(null),Se=w.useRef(!1);w.useEffect(()=>{Rt.current=T,Ot.current=c,Fe.current=o},[T,c,o]);const _e=o[c]||{id:"default",name:"Patrimonio Cultural",description:{local:{short:"Ingrese un JSON válido para comenzar",extended:"Ingrese un JSON válido para comenzar"}},imageUrl:""},{isPlaying:J,isPaused:Lt,isLoadingAudio:pr,progress:xt,play:hr,pause:mr,resume:gr,stop:wr}=ur({text:b,lang:p,onStop:()=>{V(!0),Rt.current&&Fe.current.length>1&&!Se.current&&setTimeout(()=>{k(!0);const N=(Ot.current+1)%Fe.current.length;l(N)},100),Se.current=!1},voiceId:O,avatars:[$],apiKey:ne.ELEVENLABS_API_KEY});w.useEffect(()=>{if(x&&b&&!b.includes("JSON válido")){const N=setTimeout(()=>{J||Ct(),k(!1)},500);return()=>clearTimeout(N)}},[x,b,J]),w.useEffect(()=>{(async()=>{const H=_e.description.local[u];if(H)try{const ae=await Pt(H,p);f(ae)}catch(ae){console.error("Error en traducción:",ae),f(H)}})()},[_e,u,p]);const De=()=>{V(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{V(!1)},4e3)},Ct=()=>{if(!b.trim()||b.includes("JSON válido")){alert("No hay contenido para reproducir");return}hr(),De()},yr=()=>{mr()},Er=()=>{gr(),De()},Bt=()=>{wr(),k(!1),q.current&&clearTimeout(q.current),X.current&&clearTimeout(X.current),V(!0)},br=()=>{Se.current=!0,Bt(),c>0&&l(N=>N-1)},Sr=()=>{Se.current=!0,Bt(),c<o.length-1&&l(N=>N+1)};w.useEffect(()=>()=>{q.current&&clearTimeout(q.current),X.current&&clearTimeout(X.current)},[]),w.useEffect(()=>{if(b){const N=b.split(new RegExp("(?<=[.!?])\\s+","g")).map(H=>H.trim()).filter(H=>H.length>0);h(N),R(0)}},[b]),w.useEffect(()=>{if(!J||g.length===0)return;q.current&&clearTimeout(q.current);const H=1500+g[_].length*50;q.current=setTimeout(()=>{R(ae=>(ae+1)%g.length)},H)},[J,g,_]);const[vt,Cs]=w.useState(!1);return w.useEffect(()=>{!vt&&s.length>0&&S(s[c%s.length])},[c,s,vt]),m.jsxs("div",{children:[ne.DEBUG_MODE,m.jsxs("div",{className:A.viewer,onClick:De,children:[m.jsxs("div",{className:A.viewerTopBar,children:[m.jsx("div",{className:A.itemCounter,children:o.length>0?`${c+1}/${o.length}`:"0/0"}),m.jsxs("div",{className:A.topRightControls,children:[m.jsx("button",{onClick:()=>B(!T),className:A.iconButton,title:"Autoplay",style:{backgroundColor:T?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)"},children:m.jsx("svg",{width:"20px",height:"20px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{style:{fill:T?"black":"white"},d:"M5.23331,0.493645 C6.8801,-0.113331 8.6808,-0.161915 10.3579,0.355379 C11.4019,0.6773972 12.361984,1.20757325 13.1838415,1.90671757 L13.4526,2.14597 L14.2929,1.30564 C14.8955087,0.703065739 15.9071843,1.0850774 15.994017,1.89911843 L16,2.01275 L16,6.00002 L12.0127,6.00002 C11.1605348,6.00002 10.7153321,5.01450817 11.2294893,4.37749065 L11.3056,4.29291 L12.0372,3.56137 C11.389,2.97184 10.6156,2.52782 9.76845,2.26653 C8.5106,1.87856 7.16008,1.915 5.92498,2.37023 C4.68989,2.82547 3.63877,3.67423 2.93361,4.78573 C2.22844,5.89723 1.90836,7.20978 2.02268,8.52112 C2.13701,9.83246 2.6794,11.0698 3.56627,12.0425 C4.45315,13.0152 5.63528,13.6693 6.93052,13.9039 C8.22576,14.1385 9.56221,13.9407 10.7339,13.3409 C11.9057,12.7412 12.8476,11.7727 13.4147,10.5848 C13.6526,10.0864 14.2495,9.8752 14.748,10.1131 C15.2464,10.351 15.4575,10.948 15.2196,11.4464 C14.4635,13.0302 13.2076,14.3215 11.6453,15.1213 C10.0829,15.921 8.30101,16.1847 6.57402,15.8719 C4.84704,15.559 3.27086,14.687 2.08836,13.39 C0.905861,12.0931 0.182675,10.4433 0.0302394,8.69483 C-0.122195,6.94637 0.304581,5.1963 1.2448,3.7143 C2.18503,2.2323 3.58652,1.10062 5.23331,0.493645 Z M6,5.46077 C6,5.09472714 6.37499031,4.86235811 6.69509872,5.0000726 L6.7678,5.03853 L10.7714,7.57776 C11.0528545,7.75626909 11.0784413,8.14585256 10.8481603,8.36273881 L10.7714,8.42224 L6.7678,10.9615 C6.45867857,11.1575214 6.06160816,10.965274 6.00646097,10.6211914 L6,10.5392 L6,5.46077 Z"})})}),m.jsx(Tt,{languages:[{code:"es",label:"Español"},{code:"en",label:"English"},{code:"fr",label:"Français"}],current:"es",onChange:N=>E(N)})]})]}),m.jsx("button",{onClick:br,disabled:o.length===0,className:`${A.navButton} ${A.navButtonLeft}`,title:"Anterior",onMouseOver:()=>C(!0),onMouseOut:()=>C(!1),children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{width:"24px",height:"24px",transition:"transform 0.2s ease-in-out",transform:ee?"scale(1.5)":"scale(1)"},children:m.jsx("path",{d:"M15 18l-6-6 6-6"})})}),m.jsx("button",{onClick:Sr,disabled:o.length===0,className:`${A.navButton} ${A.navButtonRight}`,title:"Siguiente",onMouseOver:()=>z(!0),onMouseOut:()=>z(!1),children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{width:"24px",height:"24px",transition:"transform 0.2s ease-in-out",transform:I?"scale(1.5)":"scale(1)"},children:m.jsx("path",{d:"M9 6l6 6-6 6"})})}),m.jsx("img",{src:_e.imageUrl||At,alt:"Background",className:A.backgroundImage,style:{opacity:J?1:.7},onError:N=>N.currentTarget.src=At}),J&&m.jsx(m.Fragment,{children:m.jsx("img",{src:$,alt:"Avatar",className:A.avatar,style:{transform:`scale(${xt%10<5?4:4.05})`}})}),m.jsxs("div",{className:A.caption,children:[m.jsx("h4",{className:A.captionTitle,children:_e.name}),J&&m.jsx(m.Fragment,{children:m.jsx("p",{className:A.captionText,children:g.length>0&&g[_]})})]}),x&&m.jsxs("div",{className:A.loadingOverlay,children:[m.jsx("div",{className:A.loadingSpinner}),m.jsx("p",{children:"Cargando siguiente patrimonio..."})]}),be&&m.jsx("div",{className:A.playbackControls,children:pr?m.jsx("button",{disabled:!0,className:A.loadingButton,children:m.jsxs("svg",{className:A.spinner,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}):!J&&!Lt?m.jsx("button",{onClick:Ct,disabled:o.length===0||x,className:A.playButton,children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"white",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M9 8.5 L9 15.5 L16 12 Z"})})}):Lt?m.jsx("button",{onClick:Er,className:A.playButton,children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"white",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M9 8.5 L9 15.5 L16 12 Z"})})}):m.jsx("button",{onClick:yr,className:A.pauseButton,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"16"}),m.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"16"})]})})}),m.jsx("div",{className:A.progressBar,children:m.jsx("div",{className:A.progressFill,style:{width:`${xt}%`}})})]})]})};F.LanguageSelector=Tt,F.LanguageSelectorStyles=Q,F.StoryVisualizer=fr,F.StoryVisualizerStyles=A,F.voices=dr,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
7
7
  //# sourceMappingURL=ocity-heritage-visualizer.umd.js.map