@oim-media/player-oim 1.32.0 → 1.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +114 -19
- package/dist/oim-player.js +12 -12
- package/dist/vendor/oim-upgrade-0ed054cbda6a.js +1 -0
- package/package.json +2 -2
- package/dist/vendor/oim-upgrade-4a84a820616a.js +0 -1
- /package/dist/vendor/{oim-generative-4a84a820616a.js → oim-generative-0ed054cbda6a.js} +0 -0
- /package/dist/vendor/{oim-patterns-4a84a820616a.js → oim-patterns-0ed054cbda6a.js} +0 -0
package/dist/oim-player.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i,a=n((()=>{i=typeof document<`u`&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src||null}));a();function o(e,t={},n=!1){let r=e.getAttribute(`mode`)===`full`,i=(t,n)=>{if(t!==void 0)return t===!0;let i=e.getAttribute(n);return i===null?!r:i===`true`};return{disableAnimations:i(t.disableAnimations,`disable-animations`)||n,disableActions:i(t.disableActions,`disable-actions`)}}var s={activeConnections:0,MAX_CONCURRENT_DECOMPRESSIONS:3,queue:[],requestRender:function(e,t,n,r,i){this.queue.push({engine:e,blob:t,src:n,resolve:r,reject:i}),this.next()},next:function(){if(this.queue.length===0||this.activeConnections>=this.MAX_CONCURRENT_DECOMPRESSIONS)return;let e=this.queue.shift();e&&this.executeRender(e)},executeRender:function(e){let t=this;t.activeConnections++,e.engine._executeLoad(e.blob,e.src).then(function(n){t.activeConnections--,e.resolve(n),t.next()}).catch(function(n){t.activeConnections--,e.reject(n),t.next()})}};function c(e,t,n,r=``){e.setAttribute(t,r),e.setAttribute(n,r)}var l={tampered:{es:`Archivo alterado: no coincide con su firma. OIM no lo muestra.`,en:`Tampered file: it does not match its signature. OIM does not show it.`},button:{es:`Botón`,en:`Button`},image:{es:`Imagen`,en:`Image`},loadError:{es:`Error cargando OIM: `,en:`Could not load OIM: `}};function u(e,t){let n=(t??``).toLowerCase().startsWith(`es`);return l[e][n?`es`:`en`]}function d(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return!1;let i=n.userAgent||``;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i)||n.platform===`MacIntel`&&n.maxTouchPoints>1)return!0;if(n.maxTouchPoints>1&&r&&typeof r.matchMedia==`function`)try{let e=r.matchMedia(`(pointer: fine)`).matches,t=r.matchMedia(`(hover: hover)`).matches;if(!e&&!t)return!0}catch{}return!1}function f(e){let t=e??(typeof window<`u`?window:void 0);if(!t||typeof t.matchMedia!=`function`)return!1;try{return t.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function p(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return`high`;let i=n.connection;if(i&&i.saveData===!0)return`low`;let a=n.deviceMemory;if(typeof a==`number`&&a<=2)return`low`;let o=n.hardwareConcurrency||4;return o<=2?`low`:d(n,r)?o<=4||typeof a==`number`&&a<=4?`low`:`medium`:o>=8&&(typeof a!=`number`||a>=8)?`high`:`medium`}function m(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);return{tier:p(n,r),isMobile:d(n,r),prefersReducedMotion:f(r),cores:n?.hardwareConcurrency||4,memoryGb:n?.deviceMemory,saveData:!!n?.connection?.saveData}}var h=`OIM_Seal`,g=[`OIM_Data`,`OIM_JSON_DATA`],_=new Uint8Array([0,0,0,0,73,69,78,68,174,66,96,130]);function v(e){let t=e.indexOf(0);return t===-1?``:new TextDecoder(`latin1`).decode(e.subarray(0,t))}function y(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=8;r+8<=e.length;){let i=t.getUint32(r),a=r+12+i;if(a>e.length)return{done:!1};let o=new TextDecoder(`latin1`).decode(e.subarray(r+4,r+8)),s=e.subarray(r+8,r+8+i);if(o===`IDAT`)n.push(s);else if(o===`IEND`)return{done:!0,seal:null,idat:n,sealStart:r,end:a};else if(o===`tEXt`||o===`zTXt`||o===`iTXt`){let e=v(s);if(e===h){let t=null;try{t=JSON.parse(new TextDecoder().decode(s.subarray(e.length+1)))}catch{t=null}return{done:!0,seal:t&&typeof t==`object`?t:null,idat:n,sealStart:r,end:a}}if(g.includes(e))return{done:!0,seal:null,idat:n,sealStart:r,end:a}}r=a}return{done:!1}}function b(e,t){let n=new Uint8Array(t+_.length);return n.set(e.subarray(0,t),0),n.set(_,t),n}function x(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function S(e){let t=x(e,e.reduce((e,t)=>e+t.length,0)),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,t));return Array.from(n,e=>e.toString(16).padStart(2,`0`)).join(``)}async function C(e,t){let n=await fetch(e);if(!n.ok)return null;if(!n.body){let e=await n.blob();return t.bytes=e.size,t.blob=Promise.resolve(e),null}let r=n.body.getReader(),i=[],a=0;for(;;){let{value:e,done:n}=await r.read();e&&(i.push(e),a+=e.length);let o=x(i,a),s=n?{done:!0,seal:null}:y(o);if(s.done&&s.seal&&`idat`in s)return await r.cancel().catch(()=>{}),t.head=o,{png:new Blob([b(o,s.sealStart)],{type:`image/png`}),seal:s.seal,imageHash:await S(s.idat)};if(n||s.done){for(;!n;){let e=await r.read();if(e.done)break;i.push(e.value),a+=e.value.length}let e=new Blob([x(i,a)]);return t.bytes=e.size,t.blob=Promise.resolve(e),null}}}var w=20,T=52428800,E=new Map,D=new WeakMap,O=0,ee=0,k=0;function A(e){try{return new URL(e,typeof document<`u`?document.baseURI:void 0).href}catch{return e}}function j(e){if(typeof e!=`string`){let t=D.get(e);return t||(t={bytes:0,lastUsed:0,pending:0},D.set(e,t)),t.lastUsed=++k,t}let t=A(e),n=E.get(t);return n?n.lastUsed=++k:(n={bytes:0,lastUsed:0,pending:0},E.set(t,n)),n}function M(){let e=0;return E.forEach(t=>{e+=t.bytes}),e}function te(){for(;E.size>w||M()>T;){let e=null,t=1/0;if(E.forEach((n,r)=>{n.pending===0&&n.lastUsed<t&&(t=n.lastUsed,e=r)}),e===null)return;E.delete(e)}}function N(e,t){let n=typeof e==`string`?E.get(A(e)):D.get(e);n&&delete n[t]}var P={getBlob(e){if(typeof e!=`string`)return Promise.resolve(e);let t=j(e);if(!t.blob){O++,t.pending++,te();let n=t.head;t.head=void 0,t.blob=(n?fetch(e,{headers:{Range:`bytes=`+n.length+`-`}}).then(async e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.status===206?new Blob([n,await e.blob()]):e.blob()}):fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.blob()})).then(e=>(t.bytes=e.size,t.lastUsed=++k,te(),e)).catch(t=>{throw N(e,`blob`),t}).finally(()=>{t.pending--})}return t.blob},getVerified(e,t){let n=j(e);return n.verified||=(ee++,n.pending++,P.getBlob(e).then(t).catch(t=>{throw N(e,`verified`),t}).finally(()=>{n.pending--})),n.verified},readPoster(e){let t=j(e);return!t.poster&&t.blob?Promise.resolve(null):(t.poster||=(t.pending++,C(e,t).catch(()=>null).finally(()=>{t.pending--})),t.poster)},sniff(e){let t=e=>e.then(e=>e.slice(0,16).arrayBuffer()).then(e=>new Uint8Array(e));return typeof e==`string`?P.readPoster(e).then(()=>{let n=j(e);return n.head?n.head.slice(0,16):t(P.getBlob(e))}).catch(()=>null):t(Promise.resolve(e)).catch(()=>null)},stats(){return{fetches:O,verifications:ee,entries:E.size,bytes:M()}},clear(){E.clear(),O=0,ee=0,k=0}};typeof window<`u`&&window.__OIM_BENCH__===!0&&(window.__oimCacheStats=()=>P.stats());function
|
|
1
|
+
var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i,a=n((()=>{i=typeof document<`u`&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src||null}));a();function o(e,t={},n=!1){let r=e.getAttribute(`mode`)===`full`,i=(t,n)=>{if(t!==void 0)return t===!0;let i=e.getAttribute(n);return i===null?!r:i===`true`};return{disableAnimations:i(t.disableAnimations,`disable-animations`)||n,disableActions:i(t.disableActions,`disable-actions`)}}var s={activeConnections:0,MAX_CONCURRENT_DECOMPRESSIONS:3,queue:[],requestRender:function(e,t,n,r,i){this.queue.push({engine:e,blob:t,src:n,resolve:r,reject:i}),this.next()},next:function(){if(this.queue.length===0||this.activeConnections>=this.MAX_CONCURRENT_DECOMPRESSIONS)return;let e=this.queue.shift();e&&this.executeRender(e)},executeRender:function(e){let t=this;t.activeConnections++,e.engine._executeLoad(e.blob,e.src).then(function(n){t.activeConnections--,e.resolve(n),t.next()}).catch(function(n){t.activeConnections--,e.reject(n),t.next()})}};function c(e,t,n,r=``){e.setAttribute(t,r),e.setAttribute(n,r)}var l={tampered:{es:`Archivo alterado: no coincide con su firma. OIM no lo muestra.`,en:`Tampered file: it does not match its signature. OIM does not show it.`},button:{es:`Botón`,en:`Button`},image:{es:`Imagen`,en:`Image`},loadError:{es:`Error cargando OIM: `,en:`Could not load OIM: `}};function u(e,t){let n=(t??``).toLowerCase().startsWith(`es`);return l[e][n?`es`:`en`]}function d(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return!1;let i=n.userAgent||``;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i)||n.platform===`MacIntel`&&n.maxTouchPoints>1)return!0;if(n.maxTouchPoints>1&&r&&typeof r.matchMedia==`function`)try{let e=r.matchMedia(`(pointer: fine)`).matches,t=r.matchMedia(`(hover: hover)`).matches;if(!e&&!t)return!0}catch{}return!1}function f(e){let t=e??(typeof window<`u`?window:void 0);if(!t||typeof t.matchMedia!=`function`)return!1;try{return t.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function p(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return`high`;let i=n.connection;if(i&&i.saveData===!0)return`low`;let a=n.deviceMemory;if(typeof a==`number`&&a<=2)return`low`;let o=n.hardwareConcurrency||4;return o<=2?`low`:d(n,r)?o<=4||typeof a==`number`&&a<=4?`low`:`medium`:o>=8&&(typeof a!=`number`||a>=8)?`high`:`medium`}function m(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);return{tier:p(n,r),isMobile:d(n,r),prefersReducedMotion:f(r),cores:n?.hardwareConcurrency||4,memoryGb:n?.deviceMemory,saveData:!!n?.connection?.saveData}}var h=`OIM_Seal`,g=[`OIM_Data`,`OIM_JSON_DATA`],_=new Uint8Array([0,0,0,0,73,69,78,68,174,66,96,130]);function v(e){let t=e.indexOf(0);return t===-1?``:new TextDecoder(`latin1`).decode(e.subarray(0,t))}function y(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=8;r+8<=e.length;){let i=t.getUint32(r),a=r+12+i;if(a>e.length)return{done:!1};let o=new TextDecoder(`latin1`).decode(e.subarray(r+4,r+8)),s=e.subarray(r+8,r+8+i);if(o===`IDAT`)n.push(s);else if(o===`IEND`)return{done:!0,seal:null,idat:n,sealStart:r,end:a};else if(o===`tEXt`||o===`zTXt`||o===`iTXt`){let e=v(s);if(e===h){let t=null;try{t=JSON.parse(new TextDecoder().decode(s.subarray(e.length+1)))}catch{t=null}return{done:!0,seal:t&&typeof t==`object`?t:null,idat:n,sealStart:r,end:a}}if(g.includes(e))return{done:!0,seal:null,idat:n,sealStart:r,end:a}}r=a}return{done:!1}}function b(e,t){let n=new Uint8Array(t+_.length);return n.set(e.subarray(0,t),0),n.set(_,t),n}function x(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function S(e){let t=x(e,e.reduce((e,t)=>e+t.length,0)),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,t));return Array.from(n,e=>e.toString(16).padStart(2,`0`)).join(``)}async function C(e,t){let n=await fetch(e);if(!n.ok)return null;if(!n.body){let e=await n.blob();return t.bytes=e.size,t.blob=Promise.resolve(e),null}let r=n.body.getReader(),i=[],a=0;for(;;){let{value:e,done:n}=await r.read();e&&(i.push(e),a+=e.length);let o=x(i,a),s=n?{done:!0,seal:null}:y(o);if(s.done&&s.seal&&`idat`in s)return await r.cancel().catch(()=>{}),t.head=o,{png:new Blob([b(o,s.sealStart)],{type:`image/png`}),seal:s.seal,imageHash:await S(s.idat)};if(n||s.done){for(;!n;){let e=await r.read();if(e.done)break;i.push(e.value),a+=e.value.length}let e=new Blob([x(i,a)]);return t.bytes=e.size,t.blob=Promise.resolve(e),null}}}var w=20,T=52428800,E=new Map,D=new WeakMap,O=0,ee=0,k=0;function A(e){try{return new URL(e,typeof document<`u`?document.baseURI:void 0).href}catch{return e}}function j(e){if(typeof e!=`string`){let t=D.get(e);return t||(t={bytes:0,lastUsed:0,pending:0},D.set(e,t)),t.lastUsed=++k,t}let t=A(e),n=E.get(t);return n?n.lastUsed=++k:(n={bytes:0,lastUsed:0,pending:0},E.set(t,n)),n}function M(){let e=0;return E.forEach(t=>{e+=t.bytes}),e}function te(){for(;E.size>w||M()>T;){let e=null,t=1/0;if(E.forEach((n,r)=>{n.pending===0&&n.lastUsed<t&&(t=n.lastUsed,e=r)}),e===null)return;E.delete(e)}}function N(e,t){let n=typeof e==`string`?E.get(A(e)):D.get(e);n&&delete n[t]}var P={getBlob(e){if(typeof e!=`string`)return Promise.resolve(e);let t=j(e);if(!t.blob){O++,t.pending++,te();let n=t.head;t.head=void 0,t.blob=(n?fetch(e,{headers:{Range:`bytes=`+n.length+`-`}}).then(async e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.status===206?new Blob([n,await e.blob()]):e.blob()}):fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.blob()})).then(e=>(t.bytes=e.size,t.lastUsed=++k,te(),e)).catch(t=>{throw N(e,`blob`),t}).finally(()=>{t.pending--})}return t.blob},getVerified(e,t){let n=j(e);return n.verified||=(ee++,n.pending++,P.getBlob(e).then(t).catch(t=>{throw N(e,`verified`),t}).finally(()=>{n.pending--})),n.verified},readPoster(e){let t=j(e);return!t.poster&&t.blob?Promise.resolve(null):(t.poster||=(t.pending++,C(e,t).catch(()=>null).finally(()=>{t.pending--})),t.poster)},sniff(e){let t=e=>e.then(e=>e.slice(0,16).arrayBuffer()).then(e=>new Uint8Array(e));return typeof e==`string`?P.readPoster(e).then(()=>{let n=j(e);return n.head?n.head.slice(0,16):t(P.getBlob(e))}).catch(()=>null):t(Promise.resolve(e)).catch(()=>null)},stats(){return{fetches:O,verifications:ee,entries:E.size,bytes:M()}},clear(){E.clear(),O=0,ee=0,k=0}};typeof window<`u`&&window.__OIM_BENCH__===!0&&(window.__oimCacheStats=()=>P.stats());function ne(){return`:host { position: relative; display: flex !important; overflow: hidden; width: 100%; height: 100%; background: var(--oim-bg, transparent); user-select: none; content-visibility: auto; contain-intrinsic-size: auto 300px; }
|
|
2
2
|
:host(.oim-player-paused) { pointer-events: none !important; }
|
|
3
3
|
:host(.oim-player-paused[activate-on="hover"]) { pointer-events: auto !important; }
|
|
4
4
|
:host(.oim-player-paused) * { animation-play-state: paused !important; transition: none !important; }
|
|
@@ -48,19 +48,19 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
48
48
|
@keyframes background-animation-zoom-out { 0%, 100% { background-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); -webkit-mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); } 50% { background-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); -webkit-mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); } }
|
|
49
49
|
@keyframes background-animation-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
|
|
50
50
|
@keyframes background-animation-none { }
|
|
51
|
-
[data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function I(e){if(!e)return;let t=F();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function L(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var R=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),ne=new Set([`public`,`author_only`,`sealed`]);function re(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?R.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&ne.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var ie=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],ae=new Set(ie);function oe(e){return typeof e==`string`&&ae.has(e)}var z=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,se=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,ce=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),le=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,ue=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function de(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(z.test(n)||ce.has(n.toLowerCase())||se.test(n)||le.test(n))return!0;let r=ue.exec(n);return r?de(r[2],t+1):!1}function B(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of ie){let t=n[i][e];de(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function V(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&de(n)?n:void 0;if(oe(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function fe(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var pe={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function me(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function he(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(pe,t)?t:void 0,blur:me(e.filterBlur,0,100)??0,brightness:me(e.filterBrightness,0,500)??100,contrast:me(e.filterContrast,0,500)??100,saturate:me(e.filterSaturate,0,500)??100,hue:me(e.filterHueRotate,0,360)??0}}function ge(e){let t=he(e),n=[];return t.preset!==void 0&&n.push(pe[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}var _e=`author_only`,H=[`public`,`author_only`,`sealed`];function U(e){if(!e||typeof e!=`object`)return _e;let t=re(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&H.includes(n)?n:_e}function W(e){return e===`public`?`verified_authorless`:`verified`}function ve(e){return!!e&&e.type===`group`}function ye(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function be(e){let t=new Set;for(let n of e||[])ve(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||ve(r))continue;let e=ye(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}function G(e){let t=fe(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var xe=`oim:base`;function Se(e){let t=t=>{if(typeof t==`string`)return t===xe;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===xe}return t.value===xe||Object.values(t.modes??{}).includes(xe)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function Ce(e){let t=structuredClone(e),n=[],r=e.resources??{},i=e=>{if(!(`ref`in e))return e;if(Object.prototype.hasOwnProperty.call(r,e.ref))return structuredClone(r[e.ref]);n.includes(e.ref)||n.push(e.ref)},a=e=>e.flatMap(e=>i(e)??[]),o=e=>{for(let t of e){if(t.fills&&=a(t.fills),t.strokes&&=t.strokes.flatMap(e=>{let t=i(e.paint);return t?[{...e,paint:t}]:[]}),t.image&&typeof t.image.src==`object`&&`ref`in t.image.src){let e=t.image.src,i=Object.prototype.hasOwnProperty.call(r,e.ref)?r[e.ref]:void 0;i&&`kind`in i&&i.kind===`image`?t.image={...t.image,src:i.src}:(delete t.image,n.includes(e.ref)||n.push(e.ref))}t.children&&o(t.children)}};return t.canvas.fills&&(t.canvas.fills=a(t.canvas.fills)),o(t.layers),{document:t,missing:n}}var we=r({createExternalLottieLoader:()=>De,createExternalScriptLoader:()=>Ee,default:()=>J,vendorUrl:()=>Te});function Te(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return K+n}function Ee(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=K+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function De(e){return Ee({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var K,q,J,Oe=n((()=>{K=`https://cdn.oim.media/player/v1/`,q=De({scriptUrl:i,version:`5.13.0`}),J={__oimExternal:!0,load:q}}));a(),Oe();var ke=`__oimUpgrade`,Y=()=>globalThis[ke],Ae=Ee({scriptUrl:i,file:`vendor/oim-upgrade-4a84a820616a.js`,marker:`data-oim-upgrade`,read:()=>Y()}),je=e=>{let t=Y();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Me(){return Y()?Promise.resolve():Ae().then(()=>void 0)}function Ne(e){let t=e?.modes?.palette;if(!e||!t)return;let n=Object.fromEntries(t.map(e=>[e,{}]));for(let[t,r]of Object.entries(e.values??{}))for(let[e,i]of Object.entries(r))n[e]&&typeof i==`string`&&(n[e][t]=i);return n}function X(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?V(e.var,e.fallback):typeof e==`string`?V(null,e):``)||void 0,literal:n=>(t(n)?B(e)?.colors?.[n.var]??V(null,n.fallback):typeof n==`string`?V(null,n):``)||void 0}}a(),Oe();var Pe=()=>globalThis.__oimGenerative,Fe=Ee({scriptUrl:i,file:`vendor/oim-generative-4a84a820616a.js`,marker:`data-oim-generative`,read:()=>Pe()}),Ie=(e,t)=>Pe()?.renderGenerativeSVG(e,t)??``;a(),Oe();var Z=()=>globalThis.__oimPatterns,Le=Ee({scriptUrl:i,file:`vendor/oim-patterns-4a84a820616a.js`,marker:`data-oim-patterns`,read:()=>Z()}),Re=e=>Z()?.generatePatternSVG(e)??``,ze=(...e)=>Z()?.patternTileUri(...e)??``,Be=e=>Z()?.isMultiColorPattern(e)??!1,Ve=(...e)=>Z()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`},He={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(He).filter(e=>e!==`line`&&e!==`scribble`)];function Ue(e){if(e&&e!==`rect`&&e!==`rectangle`)return He[e]}function We(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var Ge=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,Ke=/^[A-Za-z0-9.%\s-]+$/,qe=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,Je=/^[A-Za-z]+$/,Ye=2048;function Xe(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`(`)n++;else if(a===`)`){if(--n<0)return null}else a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return n===0?(t.push(e.slice(r).trim()),t):null}function Ze(e){let t=qe.exec(e);if(!t)return!1;let n=t[1].trim();return Je.test(n)||de(n)}function Qe(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>Ye||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=Ge.exec(t);if(!n)return!1;let r=Xe(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=Ze(i)?r:Ke.test(i)?a:null;return!!o&&o.length>0&&o.every(Ze)}var $e=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,et=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,tt=`0 0 100 100`,nt=e=>e&&e.length<=2e4&&$e.test(e)?e:void 0,rt=e=>e&&e.length<=64&&et.test(e)?e:tt;function it(e){let t=Ue(e.geoShape),n=nt(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:tt}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&nt(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:tt}:n?{d:n,viewBox:rt(e.svgViewBox)}:null}var at=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function ot(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${Re({type:e.fillPatternType||`clouds`,bgColor:e.fillPatternBgColor||`transparent`,fgColor:e.fillPatternColor||`#000000`,scale:t,svgs:e.fillPatternSvgs,colors:e.fillPatternColors,sizes:e.fillPatternSizes,counts:e.fillPatternCounts,dispersions:e.fillPatternDispersions})}")`,backgroundSize:`${n}px ${n}px`,backgroundRepeat:`repeat`,"--oim-bg-tile":`${n}px`},i=e.fillPatternDirection||`right`,a=e.fillPatternSpeed;return a&&a>0&&at.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function st(e){let t=e.fillType||(e.fillColor?`color`:`none`);if(t===`none`)return{};let n=e.type===`text`,r={};return t===`generative`?r=e.fillGenerative?{backgroundImage:`url("${Ie(e.fillGenerative,{width:e.width||100,height:e.height||100})}")`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`pattern`?r=e.fillPatternType?ot(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=Qe(e.fillGradient)?{backgroundImage:e.fillGradient}:{}:(t===`color`||t===`image`)&&(r=e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}),n&&(t===`gradient`||t===`generative`&&e.fillGenerative||t===`pattern`&&e.fillPatternType)?{...r,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}:r}function ct(e,t){if(!e&&t?.svgPath){let e=it({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?lt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" preserveAspectRatio="none"><path d="${e.d}" fill="black"/></svg>`):{}}if(!e||e===`rectangle`)return{};let n=He[e];return!n||n.kind===`path`&&!n.fillable?{}:lt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${We(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function lt(e){let t=`url("data:image/svg+xml,${encodeURIComponent(e)}")`;return{maskImage:t,WebkitMaskImage:t,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`}}function ut(e){if(!/<svg\b/i.test(e))return{};let t=e.replace(/\bfill="[^"]*"/g,`fill="#000"`).replace(/\bstroke="(?!none")[^"]*"/g,`stroke="#000"`).replace(/([;"'\s{])fill\s*:\s*[^;"'}]+/g,`$1fill:#000`).replace(/([;"'\s{])stroke\s*:\s*(?!none\b)[^;"'}]+/g,`$1stroke:#000`);/xmlns=/.test(t)||(t=t.replace(/<svg\b/i,`<svg xmlns="http://www.w3.org/2000/svg"`));let n=`url("data:image/svg+xml,${encodeURIComponent(t)}")`;return{maskImage:n,WebkitMaskImage:n,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}}function dt(e){let t=ot(e);return Object.assign(t,ct(e.geoShape)),t}var ft=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,pt=(e,t)=>ft(e)?t.literal(e.fallback):t.literal(e);function mt(e,t){let n=(e.colors??[]).map(e=>pt(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:ft(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:pt(e.bg,t),fillPatternBgColorRole:ft(e.bg),fillPatternScale:e.scale,fillPatternSizes:e.sizes,fillPatternCounts:e.counts,fillPatternDispersions:e.dispersions,fillPatternSvgs:e.svgs,fillPatternDirection:e.motion?.direction,fillPatternSpeed:e.motion?.period}}var ht=e=>`${+(e*100).toFixed(4)}%`;function gt(e,t){let n=[];for(let r of e.stops){let e=t.css(r.color);if(!e)return;n.push(r.at===void 0?e:`${e} ${ht(r.at)}`)}let r=e.type===`linear`?e.angle===void 0?``:`${e.angle}deg, `:e.type===`conic`?e.angle===void 0?``:`from ${e.angle}deg, `:``;return`${e.type}-gradient(${r}${n.join(`, `)})`}var _t=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),vt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function yt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?yt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return vt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?gt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return vt(i?_t(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return vt(st({...mt(t,r),type:i?`text`:`shape`,fillType:`pattern`,fillPatternType:t.preset??`clouds`,fillPatternColor:n[0],fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:r.literal(t.bg)}),e.opacity)}case`generative`:return vt(st({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}function bt(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function xt(e,t){let n=e?.text;if(!n)return;let r={},i=bt(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=bt(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function St(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function Ct(e,t){let n=e||{};if(n[`*`]!==void 0){let e=St(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function wt(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function Tt(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Et=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function Dt(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Et.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function Ot(e,t){let n=e&&e.style||{},r=Ct(e&&e.content,t),i=wt(e,r);return{content:r,size:Dt(St(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:Tt(e)?`none`:St(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function kt(e,t,n){let r=Ot(e,t),i=Ot(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var At={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function jt(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function Mt(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(At,t)?t:void 0,blur:jt(e.filterBlur,0,100)??0,brightness:jt(e.filterBrightness,0,500)??100,contrast:jt(e.filterContrast,0,500)??100,saturate:jt(e.filterSaturate,0,500)??100,hue:jt(e.filterHueRotate,0,360)??0}}function Nt(e){let t=Mt(e),n=[];return t.preset!==void 0&&n.push(At[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function Pt(e){let t=e.shadowOpacity===void 0?1:Math.max(0,Math.min(100,e.shadowOpacity))/100,n=(e.shadowColor||`#000000`).replace(`#`,``),r=n.length===3?n.split(``).map(function(e){return e+e}).join(``):n,i=parseInt(r.substring(0,2),16)||0,a=parseInt(r.substring(2,4),16)||0,o=parseInt(r.substring(4,6),16)||0,s=`rgba(`+i+`, `+a+`, `+o+`, `+t+`)`;return e.shadowColorRole?t<1?`color-mix(in srgb, `+V(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:V(e.shadowColorRole,s):s}function Ft(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}var It=`#f59e0b`;function Lt(e,t){let n=[],r=[],i=[];for(let a of e??[])if(a.kind===`blur`)n.push(`blur(${a.radius}px)`);else if(a.kind===`glow`){let e=t.colorCss(a.color)||It,i=a.radius;t.isText?r.push(`0px 0px ${i*.4}px ${e}`,`0px 0px ${i}px ${e}`):n.push(`drop-shadow(0px 0px ${i*.4}px ${e}) drop-shadow(0px 0px ${i}px ${e})`)}else if(a.kind===`shadow`){let e=a.color&&typeof a.color==`object`?a.color:void 0,i=a.opacity===void 0?t.colorCss(a.color??`#000000`)||`#000000`:Pt({shadowColor:e?e.fallback:a.color,shadowOpacity:a.opacity*100,shadowColorRole:e?.var}),o=`${a.x||0}px ${a.y||0}px ${a.blur||0}px ${i}`;t.isText?r.push(o):n.push(`drop-shadow(${o})`)}else if(a.kind===`grain`){if(!t.grainable)continue;let e=`oim-grain-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`grain`,id:e,effect:a}),n.push(`url(#${e})`)}else a.kind===`texture`&&i.push({kind:`texture`,effect:a});let a=e?.find(e=>e.kind===`backdrop`),o;return a?.preset===`duotone`?i.push({kind:`duotone`}):o=Nt(Ft(a)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:o,defs:i}}var Rt=new WeakMap;function zt(e){let t=new Map,n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};return n(e),t}function Bt(e){let t=Rt.get(e);if(t)return t;try{t=zt(je(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return Rt.set(e,t),t}function Vt(e,t){Rt.set(e,zt(t.layers))}function Ht(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function Ut(e,t){let n=e.mask??{},r=e.fills?.[0],i=r&&`gradient`in r&&r.gradient?gt(r.gradient,t):void 0,a=e.geometry,o=a?.kind===`preset`?a.name:a?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[a?.kind??``],s=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},c=e.fills?.[0],l=s(c?.kind===`color`?c.value:void 0),u=e.strokes?.[0],d=s(u?.paint?.kind===`color`?u.paint.value:void 0);return{maskMode:n.mode===`cutout`?`cutout`:`window`,maskFeather:n.feather,maskCoverage:n.scope===`group`?`container`:`canvas`,maskShape:o,maskSvgPath:a?.kind===`paths`?a.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:l.literal,maskBgColorRole:l.role,fillType:i?`gradient`:void 0,fillGradient:i,fillColorRole:void 0,maskStrokeColor:d.literal,maskStrokeColorRole:d.role,strokeColorRole:void 0,maskStrokeWidth:u?.width,cuts:e.extensions?.studio?.maskCuts}}function Wt(e,t){if(typeof e==`string`)return e===`oim:base`?``:e;if(!(`value`in e)||typeof e.value!=`string`)return``;let n=St(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var Gt=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0;function Kt(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));for(let a of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,a.d);let o=Gt(a.fill===`currentColor`?t.fill??`currentColor`:a.fill),s=Gt(a.stroke===`currentColor`?t.stroke??`currentColor`:a.stroke);n?(e.setAttribute(`fill`,o??`none`),s&&e.setAttribute(`stroke`,s)):(e.setAttribute(`fill`,`none`),o&&e.style.setProperty(`fill`,o),s&&e.style.setProperty(`stroke`,s)),a.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(a.strokeWidth)),a.fillRule&&e.setAttribute(`fill-rule`,a.fillRule),a.cap&&e.setAttribute(`stroke-linecap`,a.cap),a.join&&e.setAttribute(`stroke-linejoin`,a.join),a.opacity!==void 0&&e.setAttribute(`opacity`,String(a.opacity)),a.transform&&e.setAttribute(`transform`,`matrix(${a.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function qt(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=n(e.strokes?.[0]?.paint);return{fill:r??i,stroke:i??r}}function Jt(e){if(typeof e==`number`)return{px:`${e}px`};if(e&&typeof e==`object`&&`value`in e){let{value:t,modes:n}=e,r=Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,`${t}px`]));return{px:`${t}px`,byLang:Object.keys(r).length>0?r:void 0}}return{}}function Yt(e,t){e.content=t.content;let n=Jt(t.font?.size),r=Jt(t.maxWidth);n.px&&(e.style.fontSize=n.px),n.byLang&&(e.style.fontSizes=n.byLang),r.px&&(e.style.maxWidth=r.px),r.byLang&&(e.style.maxWidths=r.byLang)}function Xt(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.type===`shape`&&!!i.effects?.some(e=>e.kind===`backdrop`),a=i.mask?`mask`:i.text?.artistic?`artistic-text`:e?`filter`:i.type,o={id:i.id,type:a,style:r?{groupId:r}:{}};i.text&&Yt(o,i.text),t.push(o),n(i.children??[],i.id)}};n(e.layers);let r={canvas_width:e.canvas.width,canvas_height:e.canvas.height,languages:e.languages,slots:t};e.canvas.fills?.length&&(r.canvasFills=e.canvas.fills),e.fonts&&(r.fonts=e.fonts);let i=Ne(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),Vt(r,e),r}var Zt="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),s=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function c(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?o.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&s.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction l(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst u=`author_only`,d=[`public`,`author_only`,`sealed`];function f(e){if(!e||typeof e!=`object`)return u;let t=c(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&d.includes(n)?n:u}function p(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction m(e){let t=l(e)?.oim;return typeof t==`string`&&/^2\\./.test(t)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst h=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function g(e){for(let t=0;t<h.length;t++)if(h[t].kid===e)return h[t];return null}let _=null;function v(e){_=typeof e==`string`&&e?e:null}function y(){if(_)return _;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function b(e,t){let n=g(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function x(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function S(e,t,n=Date.now()){let r=g(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!g(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=2**53-1;function w(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>C:typeof e==`object`&&e?Object.values(e).some(w):!1}const T=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function E(e){if(Array.isArray(e))return e.map(E);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=E(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function D(e){if(Array.isArray(e))return e.map(D);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=D(e[r]);return t}return e}function O(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))T.has(n)||(t[n]=e[n]);let n=D(E(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst k={};let A=null,j=!1,M=null;function N(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function P(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function F(e){let t=g(e);return t?t.jwk:(k[e]||!j&&(M||=N().then(e=>{e.forEach(e=>{k[e.kid]=e}),j=!0}),await M,k[e])||await I(),k[e])}function I(){return A||=(async function(){try{let e=y(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];k[t.kid]=t}await P(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),A}async function L(e){return await I(),k[e]||null}async function R(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await F(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(w(e))return!1;let n=O(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await L(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=b(e.key_version,t);if(!x({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function z(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:p(f(e.metadata)):`image_unsealed`}async function B(e,t=Date.now()){let n=e&&e.key_version;return n?g(n)?S(n,null,t):S(n,await L(n),t):!1}function V(e){return e===`image_mismatch`||e===`invalid_signature`}function H(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",Qt=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,Zt],{type:`text/javascript;charset=utf-8`});function $t(e){let t;try{if(t=Qt&&(self.URL||self.webkitURL).createObjectURL(Qt),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Zt),{type:`module`,name:e?.name})}}var en=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],tn=`https://api.oim.media/v1/media/keys`;function nn(e){for(let t=0;t<en.length;t++)if(en[t].kid===e)return en[t];return null}function rn(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||tn}function an(e,t){let n=nn(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function on(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var sn=6048e5;function cn(e,t,n=Date.now()){let r=nn(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!nn(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+sn}var ln=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function un(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new ln(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new ln(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:rn()})})},stats(){return{alive:t!==null,pending:i.size}}}}var dn=null;function fn(e,t,n){return dn||=un(()=>new $t),dn.verify(e,t,n)}var pn=10485760;async function mn(e,t=pn){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await hn(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await hn(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function hn(e,t,n=pn){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function gn(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function _n(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await hn(e,`deflate`)}catch{try{t=await hn(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await hn(t,`deflate`)}catch(e){try{i=await hn(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await hn(o,`deflate`)}catch(e){try{i=await hn(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await mn(i)),{image:s,metadata:c,imageHash:await gn(t)}}var vn=2**53-1;function yn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>vn:typeof e==`object`&&e?Object.values(e).some(yn):!1}var bn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function xn(e){if(Array.isArray(e))return e.map(xn);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=xn(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Sn(e){if(Array.isArray(e))return e.map(Sn);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=Sn(e[r]);return t}return e}function Cn(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))bn.has(n)||(t[n]=e[n]);let n=Sn(xn(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function wn(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function Tn(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!wn(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=Dn(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&On(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(kn(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function En(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function Dn(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function On(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function kn(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function An(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var jn={},Mn=null,Nn=!1,Pn=null;function Fn(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function In(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function Ln(e){let t=nn(e);return t?t.jwk:(jn[e]||!Nn&&(Pn||=Fn().then(e=>{e.forEach(e=>{jn[e.kid]=e}),Nn=!0}),await Pn,jn[e])||await Rn(),jn[e])}function Rn(){return Mn||=(async function(){try{let e=rn(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];jn[t.kid]=t}await In(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),Mn}async function zn(e){return await Rn(),jn[e]||null}async function Bn(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await Ln(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(yn(e))return!1;let r=Cn(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await zn(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=an(e.key_version,t);if(!on({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Vn(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:W(U(e.metadata)):`image_unsealed`}async function Hn(e,t=Date.now()){let n=e&&e.key_version;return n?nn(n)?cn(n,null,t):cn(n,await zn(n),t):!1}function Un(e){return e===`image_mismatch`||e===`invalid_signature`}var Wn=`OIM_ALTERED`;function Gn(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}async function Kn(e,t){if(!e||e.v!==1||e.alg!==`sha256-idat`||typeof e.image_hash!=`string`||typeof e.signature!=`string`||typeof e.key_version!=`string`||!t||e.image_hash.toLowerCase()!==t.toLowerCase())return`invalid`;let n=new TextEncoder().encode(JSON.stringify({alg:e.alg,image_hash:e.image_hash,key_version:e.key_version,v:e.v}));try{let t=atob(e.signature),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let i=async e=>{let t=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!1,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},t,r,n)},a=await Ln(e.key_version),o=!!a&&await i(a);if(!o){let t=await zn(e.key_version).catch(()=>null);t&&(!a||t.x!==a.x||t.y!==a.y)&&(o=await i(t))}if(!o)return`invalid`}catch{return`invalid`}return await Hn({key_version:e.key_version})?`expired_key`:`ok`}var qn=Math.log(1.05)/100,Jn=.01,Yn=16,Xn=800;function Zn(e,t,n,r){let i=n===1?t*Yn:n===2?t*Xn:t,a=e*Math.exp(-i*(r?Jn:qn));return Math.max(1,Math.min(4,a))}var Qn=`1.32.0`,$n=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function er(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function tr(e,t){let n=er(e),r=er(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function nr(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=tr(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function rr(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var ir=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,ar=546136,or={woff:`wOFF`,woff2:`wOF2`};function sr(e,t){try{return atob(e.slice(0,8)).startsWith(or[t])}catch{return!1}}function cr(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!ir.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>ar||!sr(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function lr(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function ur(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var dr=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function fr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=dr.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function pr(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of fr(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function mr(e,t){return pr(e,t).runs}function hr(e){return e.replace(/[{}]/g,e=>e+e)}function gr(e,t){return mr(e,t).map(e=>e.text).join(``)}function _r(e,t){let n=``,r=[];for(let i of mr(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function vr(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=hr(e.slice(r,t))+`{${i.mark}}`+hr(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+hr(e.slice(r))}function yr(e){let t={underline:e.underline===!0},n=V(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:V(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function br(e,t){return gr(e,Object.keys(t??{}))}function xr(e,t,n){e.textContent=``;for(let r of mr(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=yr(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Sr(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function Cr(e,t){let{plain:n,ranges:r}=_r(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:vr(n.slice(1),i)}}var wr=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Tr(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&wr.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var Er=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Dr=.35,Or=.05,kr=[`slide-up`,`reveal-mask`,`rise-words`];function Ar(e){return typeof e==`string`&&Er.includes(e)}function jr(e){return e===`reveal-mask`}function Mr(e,t){return kr.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Nr(e,t=Or,n=0){return n+e*t}function Pr(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function Fr(e,t=10){return Array.from({length:t+1},(n,r)=>Pr(e,r/t))}function Ir(){return Promise.resolve().then(()=>(Oe(),we)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function Lr(e){let t=[];return e.generative&&t.push(Fe()),e.patterns&&t.push(Le()),Promise.all(t).then(()=>void 0)}var Rr=/^(fill|background)Pattern/;function zr(e){let t={generative:!1,patterns:!1},n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e)||t.generative&&t.patterns)return;if(n.add(e),Array.isArray(e)){e.forEach(r);return}let i=e;(i.kind===`generative`||i.fillType===`generative`||i.fillGenerative)&&(t.generative=!0),(i.kind===`pattern`||i.fillType===`pattern`||`drawing`in i)&&(t.patterns=!0);for(let e in i)Rr.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var Br={silhouette:null,fillable:!0,round:!1};function Vr(e){if(!e||e.kind===`rect`)return Br;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Ue(t);return n?{silhouette:it({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Br}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=it({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Br}return Br}var Hr=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,Ur={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function Wr(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,ee=(-_-C)/u,k=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},A=k(1,0,E,D),j=k(E,D,O,ee);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),te=j/M,N=4/3*Math.tan(te/4),P=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],F=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],I=[];for(let e=0;e<M;e++){let t=A+e*te,n=t+te,r=P(t),i=P(n),a=F(t),o=F(n);I.push([r[0]+N*a[0],r[1]+N*a[1],i[0]-N*o[0],i[1]-N*o[1],i[0],i[1]])}return I}function Gr(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),Hr.lastIndex=n;let t=Hr.exec(e);return t?(n=Hr.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<Ur[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=Wr(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Kr(e,t){let n=Gr(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var qr=[0,0,100,100],Jr=[5,5,90,90],Yr={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function Xr(e,t){return e===`line`?Yr:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function Zr(e){if(e===void 0)return qr;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function Qr(e,[t,n,r,i],a){return Kr(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function $r(e,t){let n=e.geoShape,r=Ue(n);if(n&&r){let e=Xr(n,r);return Qr(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?qr:Jr,t)}if(e.svgPath){let n=Zr(e.svgViewBox);return n?Qr(e.svgPath,n,t):null}return null}var ei=new Set([`line`,`scribble`]),ti=.5523;function ni(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function ri(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=ti;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function ii(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?ri(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>ni(e,t.width,t.height))):ei.has(n)?null:$r({geoShape:n},t)}var ai={x:0,y:0,width:100,height:100};function oi(e){return`mask-clip-${e.id}`}function si(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function ci(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function li(e,t){return e===`rect`||e===`rectangle`?ci(t):$r({geoShape:e},t)}function ui(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?$r({svgPath:i},t):li(r||`circle`,t)}function di(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function fi(e,t){let n=di(e,t);return e.svgPath?$r({svgPath:e.svgPath},n):li(e.shape||`circle`,n)}function pi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function mi(e,t){let n=pi(e);return n.length>0?n.map(e=>fi(e,t)??ci(di(e,t))).join(` `):ui(e,t)??ci(t)}function hi(e){let t=pi(e);return t.length>0?t.every(e=>fi(e,ai)!==null):ui(e,ai)!==null}function gi(e,t){let{width:n,height:r}=t,i=e,a=si(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?ci(a):`M0 0H${n}V${r}H0Z`} ${mi(e,a)}`}function _i(e,t){let n=si(e,t);return ui(e,n)??ci(n)}function vi(e,t){if(!e||e===`rectangle`||e===`rect`)return{};let n=ii({geoShape:e},{x:0,y:0,width:t.width,height:t.height});return n===null?{}:{clipPath:`path("${n}")`}}var yi={shadows:`#1e1b4b`,lights:`#fbbf24`};function bi(e){return`duotone-filter-${e.id}`}function xi(e){return`mask-feather-${e.id}`}function Si(e,t){let{width:n,height:r}=t,i=si(e,t);return`${`M0 0H${n}V${r}H0Z`} ${ci(i)} ${mi(e,i)}`}function Ci(e){let t=[];for(let n of e)if(n.type===`mask`){let e=n.style||{};if(e.maskMode!==`cutout`){t=[...t,{kind:`shape`,shape:n}];continue}let r=e.maskFeather&&e.maskFeather>0?{maskStyle:`url(#${xi(n)})`}:{clipPath:`url(#${oi(n)})`};t=t.map(e=>e.clipPath||e.maskStyle?{kind:`filterGroup`,shape:n,children:[e],...r}:{...e,...r})}else t=[...t,{kind:`shape`,shape:n}];return t}var wi=6,Ti=5,Ei=8,Di=2*Math.PI/wi,Oi=`oim-wave-chars`;function ki(){let e=[];for(let t=0;t<=Ei;t++){let n=t/Ei,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*Ti,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${Oi} {\n${e.join(`
|
|
52
|
-
`)}\n}`}function
|
|
51
|
+
[data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function F(e){if(!e)return;let t=ne();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function I(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var L=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),re=new Set([`public`,`author_only`,`sealed`]);function ie(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?L.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&re.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var ae=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],oe=new Set(ae);function se(e){return typeof e==`string`&&oe.has(e)}var R=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,ce=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,le=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),ue=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,de=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function fe(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(R.test(n)||le.has(n.toLowerCase())||ce.test(n)||ue.test(n))return!0;let r=de.exec(n);return r?fe(r[2],t+1):!1}function pe(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of ae){let t=n[i][e];fe(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function z(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&fe(n)?n:void 0;if(se(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function me(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var he={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function ge(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function _e(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(he,t)?t:void 0,blur:ge(e.filterBlur,0,100)??0,brightness:ge(e.filterBrightness,0,500)??100,contrast:ge(e.filterContrast,0,500)??100,saturate:ge(e.filterSaturate,0,500)??100,hue:ge(e.filterHueRotate,0,360)??0}}function ve(e){let t=_e(e),n=[];return t.preset!==void 0&&n.push(he[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}var ye=`author_only`,be=[`public`,`author_only`,`sealed`];function B(e){if(!e||typeof e!=`object`)return ye;let t=ie(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&be.includes(n)?n:ye}function V(e){return e===`public`?`verified_authorless`:`verified`}function xe(e){return!!e&&e.type===`group`}function H(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function Se(e){let t=new Set;for(let n of e||[])xe(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||xe(r))continue;let e=H(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}function U(e){let t=me(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var W=`oim:base`;function Ce(e){let t=t=>{if(typeof t==`string`)return t===W;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===W}return t.value===W||Object.values(t.modes??{}).includes(W)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function we(e){let t=structuredClone(e),n=[],r=e.resources??{},i=e=>{if(!(`ref`in e))return e;if(Object.prototype.hasOwnProperty.call(r,e.ref))return structuredClone(r[e.ref]);n.includes(e.ref)||n.push(e.ref)},a=e=>e.flatMap(e=>i(e)??[]),o=e=>{for(let t of e){if(t.fills&&=a(t.fills),t.strokes&&=t.strokes.flatMap(e=>{let t=i(e.paint);return t?[{...e,paint:t}]:[]}),t.image&&typeof t.image.src==`object`&&`ref`in t.image.src){let e=t.image.src,i=Object.prototype.hasOwnProperty.call(r,e.ref)?r[e.ref]:void 0;i&&`kind`in i&&i.kind===`image`?t.image={...t.image,src:i.src}:(delete t.image,n.includes(e.ref)||n.push(e.ref))}t.children&&o(t.children)}};return t.canvas.fills&&(t.canvas.fills=a(t.canvas.fills)),o(t.layers),{document:t,missing:n}}var Te=r({createExternalLottieLoader:()=>Oe,createExternalScriptLoader:()=>De,default:()=>G,vendorUrl:()=>Ee});function Ee(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return ke+n}function De(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=ke+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function Oe(e){return De({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var ke,Ae,G,K=n((()=>{ke=`https://cdn.oim.media/player/v1/`,Ae=Oe({scriptUrl:i,version:`5.13.0`}),G={__oimExternal:!0,load:Ae}}));a(),K();var je=`__oimUpgrade`,Me=()=>globalThis[je],q=De({scriptUrl:i,file:`vendor/oim-upgrade-0ed054cbda6a.js`,marker:`data-oim-upgrade`,read:()=>Me()}),Ne=e=>{let t=Me();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Pe(){return Me()?Promise.resolve():q().then(()=>void 0)}function Fe(e){let t=e?.modes?.palette;if(!e||!t)return;let n=Object.fromEntries(t.map(e=>[e,{}]));for(let[t,r]of Object.entries(e.values??{}))for(let[e,i]of Object.entries(r))n[e]&&typeof i==`string`&&(n[e][t]=i);return n}function Ie(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?z(e.var,e.fallback):typeof e==`string`?z(null,e):``)||void 0,literal:n=>(t(n)?pe(e)?.colors?.[n.var]??z(null,n.fallback):typeof n==`string`?z(null,n):``)||void 0}}a(),K();var J=()=>globalThis.__oimGenerative,Le=De({scriptUrl:i,file:`vendor/oim-generative-0ed054cbda6a.js`,marker:`data-oim-generative`,read:()=>J()}),Re=(e,t)=>J()?.renderGenerativeSVG(e,t)??``;a(),K();var Y=()=>globalThis.__oimPatterns,ze=De({scriptUrl:i,file:`vendor/oim-patterns-0ed054cbda6a.js`,marker:`data-oim-patterns`,read:()=>Y()}),Be=e=>Y()?.generatePatternSVG(e)??``,Ve=(...e)=>Y()?.patternTileUri(...e)??``,He=e=>Y()?.isMultiColorPattern(e)??!1,Ue=(...e)=>Y()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`},We={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(We).filter(e=>e!==`line`&&e!==`scribble`)];function Ge(e){if(e&&e!==`rect`&&e!==`rectangle`)return We[e]}function Ke(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var qe=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,Je=/^[A-Za-z0-9.%\s-]+$/,Ye=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,Xe=/^[A-Za-z]+$/,Ze=2048;function Qe(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`(`)n++;else if(a===`)`){if(--n<0)return null}else a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return n===0?(t.push(e.slice(r).trim()),t):null}function $e(e){let t=Ye.exec(e);if(!t)return!1;let n=t[1].trim();return Xe.test(n)||fe(n)}function et(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>Ze||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=qe.exec(t);if(!n)return!1;let r=Qe(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=$e(i)?r:Je.test(i)?a:null;return!!o&&o.length>0&&o.every($e)}var tt=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,nt=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,rt=`0 0 100 100`,it=e=>e&&e.length<=2e4&&tt.test(e)?e:void 0,at=e=>e&&e.length<=64&&nt.test(e)?e:rt;function ot(e){let t=Ge(e.geoShape),n=it(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:rt}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&it(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:rt}:n?{d:n,viewBox:at(e.svgViewBox)}:null}var st=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function ct(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${Be({type:e.fillPatternType||`clouds`,bgColor:e.fillPatternBgColor||`transparent`,fgColor:e.fillPatternColor||`#000000`,scale:t,svgs:e.fillPatternSvgs,colors:e.fillPatternColors,sizes:e.fillPatternSizes,counts:e.fillPatternCounts,dispersions:e.fillPatternDispersions})}")`,backgroundSize:`${n}px ${n}px`,backgroundRepeat:`repeat`,"--oim-bg-tile":`${n}px`},i=e.fillPatternDirection||`right`,a=e.fillPatternSpeed;return a&&a>0&&st.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function lt(e){let t=e.fillType||(e.fillColor?`color`:`none`);if(t===`none`)return{};let n=e.type===`text`,r={};return t===`generative`?r=e.fillGenerative?{backgroundImage:`url("${Re(e.fillGenerative,{width:e.width||100,height:e.height||100})}")`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`pattern`?r=e.fillPatternType?ct(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=et(e.fillGradient)?{backgroundImage:e.fillGradient}:{}:(t===`color`||t===`image`)&&(r=e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}),n&&(t===`gradient`||t===`generative`&&e.fillGenerative||t===`pattern`&&e.fillPatternType)?{...r,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}:r}function ut(e,t){if(!e&&t?.svgPath){let e=ot({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" preserveAspectRatio="none"><path d="${e.d}" fill="black"/></svg>`):{}}if(!e||e===`rectangle`)return{};let n=We[e];return!n||n.kind===`path`&&!n.fillable?{}:dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${Ke(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function dt(e){let t=`url("data:image/svg+xml,${encodeURIComponent(e)}")`;return{maskImage:t,WebkitMaskImage:t,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`}}function ft(e){if(!/<svg\b/i.test(e))return{};let t=e.replace(/\bfill="[^"]*"/g,`fill="#000"`).replace(/\bstroke="(?!none")[^"]*"/g,`stroke="#000"`).replace(/([;"'\s{])fill\s*:\s*[^;"'}]+/g,`$1fill:#000`).replace(/([;"'\s{])stroke\s*:\s*(?!none\b)[^;"'}]+/g,`$1stroke:#000`);/xmlns=/.test(t)||(t=t.replace(/<svg\b/i,`<svg xmlns="http://www.w3.org/2000/svg"`));let n=`url("data:image/svg+xml,${encodeURIComponent(t)}")`;return{maskImage:n,WebkitMaskImage:n,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}}function pt(e){let t=ct(e);return Object.assign(t,ut(e.geoShape)),t}var mt=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,ht=(e,t)=>mt(e)?t.literal(e.fallback):t.literal(e);function gt(e,t){let n=(e.colors??[]).map(e=>ht(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:mt(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:ht(e.bg,t),fillPatternBgColorRole:mt(e.bg),fillPatternScale:e.scale,fillPatternSizes:e.sizes,fillPatternCounts:e.counts,fillPatternDispersions:e.dispersions,fillPatternSvgs:e.svgs,fillPatternDirection:e.motion?.direction,fillPatternSpeed:e.motion?.period}}var _t=e=>`${+(e*100).toFixed(4)}%`;function vt(e,t){let n=[];for(let r of e.stops){let e=t.css(r.color);if(!e)return;n.push(r.at===void 0?e:`${e} ${_t(r.at)}`)}let r=e.type===`linear`?e.angle===void 0?``:`${e.angle}deg, `:e.type===`conic`?e.angle===void 0?``:`from ${e.angle}deg, `:``;return`${e.type}-gradient(${r}${n.join(`, `)})`}var yt=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),bt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function xt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?xt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return bt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?vt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return bt(i?yt(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return bt(lt({...gt(t,r),type:i?`text`:`shape`,fillType:`pattern`,fillPatternType:t.preset??`clouds`,fillPatternColor:n[0],fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:r.literal(t.bg)}),e.opacity)}case`generative`:return bt(lt({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}function St(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function Ct(e,t){let n=e?.text;if(!n)return;let r={},i=St(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=St(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function wt(e,t){let[n,r,i,a]=t,o=n+i/2,s=r+a/2,c=e.stops.length,l=e.stops.map((e,t)=>({offset:`${Math.round((e.at??t/(c-1))*1e4)/100}%`,color:e.color}));if(e.type===`radial`)return{tag:`radialGradient`,attrs:{cx:o,cy:s,r:Math.hypot(i/2,a/2)},stops:l};let u=((e.angle??180)-90)*Math.PI/180,d=(Math.abs(i*Math.cos(u))+Math.abs(a*Math.sin(u)))/2,f=Math.cos(u)*d,p=Math.sin(u)*d;return{tag:`linearGradient`,attrs:{x1:o-f,y1:s-p,x2:o+f,y2:s+p},stops:l}}function X(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function Tt(e,t){let n=e||{};if(n[`*`]!==void 0){let e=X(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function Et(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function Dt(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Ot=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function kt(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Ot.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function At(e,t){let n=e&&e.style||{},r=Tt(e&&e.content,t),i=Et(e,r);return{content:r,size:kt(X(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:Dt(e)?`none`:X(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function jt(e,t,n){let r=At(e,t),i=At(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var Mt={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function Nt(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function Pt(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(Mt,t)?t:void 0,blur:Nt(e.filterBlur,0,100)??0,brightness:Nt(e.filterBrightness,0,500)??100,contrast:Nt(e.filterContrast,0,500)??100,saturate:Nt(e.filterSaturate,0,500)??100,hue:Nt(e.filterHueRotate,0,360)??0}}function Ft(e){let t=Pt(e),n=[];return t.preset!==void 0&&n.push(Mt[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function It(e){let t=e.shadowOpacity===void 0?1:Math.max(0,Math.min(100,e.shadowOpacity))/100,n=(e.shadowColor||`#000000`).replace(`#`,``),r=n.length===3?n.split(``).map(function(e){return e+e}).join(``):n,i=parseInt(r.substring(0,2),16)||0,a=parseInt(r.substring(2,4),16)||0,o=parseInt(r.substring(4,6),16)||0,s=`rgba(`+i+`, `+a+`, `+o+`, `+t+`)`;return e.shadowColorRole?t<1?`color-mix(in srgb, `+z(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:z(e.shadowColorRole,s):s}function Lt(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}var Rt=`#f59e0b`;function zt(e,t){let n=[],r=[],i=[];for(let a of e??[])if(a.kind===`blur`)n.push(`blur(${a.radius}px)`);else if(a.kind===`glow`){let e=t.colorCss(a.color)||Rt,i=a.radius;t.isText?r.push(`0px 0px ${i*.4}px ${e}`,`0px 0px ${i}px ${e}`):n.push(`drop-shadow(0px 0px ${i*.4}px ${e}) drop-shadow(0px 0px ${i}px ${e})`)}else if(a.kind===`shadow`){let e=a.color&&typeof a.color==`object`?a.color:void 0,i=a.opacity===void 0?t.colorCss(a.color??`#000000`)||`#000000`:It({shadowColor:e?e.fallback:a.color,shadowOpacity:a.opacity*100,shadowColorRole:e?.var}),o=`${a.x||0}px ${a.y||0}px ${a.blur||0}px ${i}`;t.isText?r.push(o):n.push(`drop-shadow(${o})`)}else if(a.kind===`grain`){if(!t.grainable)continue;let e=`oim-grain-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`grain`,id:e,effect:a}),n.push(`url(#${e})`)}else a.kind===`texture`&&i.push({kind:`texture`,effect:a});let a=e?.find(e=>e.kind===`backdrop`),o;return a?.preset===`duotone`?i.push({kind:`duotone`}):o=Ft(Lt(a)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:o,defs:i}}var Bt=new WeakMap;function Vt(e){let t=new Map,n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};return n(e),t}function Ht(e){let t=Bt.get(e);if(t)return t;try{t=Vt(Ne(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return Bt.set(e,t),t}function Ut(e,t){Bt.set(e,Vt(t.layers))}function Wt(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function Gt(e,t){let n=e.mask??{},r=e.fills?.[0],i=r&&`gradient`in r&&r.gradient?vt(r.gradient,t):void 0,a=e.geometry,o=a?.kind===`preset`?a.name:a?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[a?.kind??``],s=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},c=e.fills?.[0],l=s(c?.kind===`color`?c.value:void 0),u=e.strokes?.[0],d=s(u?.paint?.kind===`color`?u.paint.value:void 0);return{maskMode:n.mode===`cutout`?`cutout`:`window`,maskFeather:n.feather,maskCoverage:n.scope===`group`?`container`:`canvas`,maskShape:o,maskSvgPath:a?.kind===`paths`?a.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:l.literal,maskBgColorRole:l.role,fillType:i?`gradient`:void 0,fillGradient:i,fillColorRole:void 0,maskStrokeColor:d.literal,maskStrokeColorRole:d.role,strokeColorRole:void 0,maskStrokeWidth:u?.width,cuts:e.extensions?.studio?.maskCuts}}function Kt(e,t){if(typeof e==`string`)return e===`oim:base`?``:e;if(!(`value`in e)||typeof e.value!=`string`)return``;let n=X(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var qt=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0,Jt=0;function Yt(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));let a;if(t.strokeGradient){let{tag:n,attrs:o,stops:s}=wt(t.strokeGradient,e.viewBox),c=i.appendChild(document.createElementNS(r,`defs`)).appendChild(document.createElementNS(r,n));c.id=`oim-sg-${++Jt}`,c.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of Object.entries(o))c.setAttribute(e,String(t));for(let e of s){let t=c.appendChild(document.createElementNS(r,`stop`));t.setAttribute(`offset`,e.offset),t.setAttribute(`stop-color`,qt(e.color)??`#000`)}a=`url(#${c.id})`}for(let o of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,o.d);let s=qt(o.fill===`currentColor`?t.fill??`currentColor`:o.fill),c=a??qt(o.stroke===`currentColor`?t.stroke??`currentColor`:o.stroke);n?(e.setAttribute(`fill`,s??`none`),c&&e.setAttribute(`stroke`,c)):(e.setAttribute(`fill`,`none`),s&&e.style.setProperty(`fill`,s),c&&e.style.setProperty(`stroke`,c)),o.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(o.strokeWidth)),o.fillRule&&e.setAttribute(`fill-rule`,o.fillRule),o.cap&&e.setAttribute(`stroke-linecap`,o.cap),o.join&&e.setAttribute(`stroke-linejoin`,o.join),o.opacity!==void 0&&e.setAttribute(`opacity`,String(o.opacity)),o.transform&&e.setAttribute(`transform`,`matrix(${o.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function Xt(e){let t=e.fills?.[0]?.kind;return t===`gradient`||t===`pattern`||t===`generative`}function Zt(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=e.strokes?.[0]?.paint,a=n(i),o=i?.kind===`gradient`&&i.gradient?.type!==`conic`?i.gradient:void 0,s=o&&{...o,stops:o.stops.map(e=>({...e,color:t(e.color)??e.color}))};return{fill:r??a,stroke:a??r,...s&&{strokeGradient:s}}}function Qt(e){if(typeof e==`number`)return{px:`${e}px`};if(e&&typeof e==`object`&&`value`in e){let{value:t,modes:n}=e,r=Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,`${t}px`]));return{px:`${t}px`,byLang:Object.keys(r).length>0?r:void 0}}return{}}function $t(e,t){e.content=t.content;let n=Qt(t.font?.size),r=Qt(t.maxWidth);n.px&&(e.style.fontSize=n.px),n.byLang&&(e.style.fontSizes=n.byLang),r.px&&(e.style.maxWidth=r.px),r.byLang&&(e.style.maxWidths=r.byLang)}function en(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.type===`shape`&&!!i.effects?.some(e=>e.kind===`backdrop`),a=i.mask?`mask`:i.text?.artistic?`artistic-text`:e?`filter`:i.type,o={id:i.id,type:a,style:r?{groupId:r}:{}};i.text&&$t(o,i.text),t.push(o),n(i.children??[],i.id)}};n(e.layers);let r={canvas_width:e.canvas.width,canvas_height:e.canvas.height,languages:e.languages,slots:t};e.canvas.fills?.length&&(r.canvasFills=e.canvas.fills),e.fonts&&(r.fonts=e.fonts);let i=Fe(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),Ut(r,e),r}var tn="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),s=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function c(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?o.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&s.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction l(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst u=`author_only`,d=[`public`,`author_only`,`sealed`];function f(e){if(!e||typeof e!=`object`)return u;let t=c(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&d.includes(n)?n:u}function p(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction m(e){let t=l(e)?.oim;return typeof t==`string`&&/^2\\./.test(t)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst h=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function g(e){for(let t=0;t<h.length;t++)if(h[t].kid===e)return h[t];return null}let _=null;function v(e){_=typeof e==`string`&&e?e:null}function y(){if(_)return _;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function b(e,t){let n=g(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function x(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function S(e,t,n=Date.now()){let r=g(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!g(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=2**53-1;function w(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>C:typeof e==`object`&&e?Object.values(e).some(w):!1}const T=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function E(e){if(Array.isArray(e))return e.map(E);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=E(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function D(e){if(Array.isArray(e))return e.map(D);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=D(e[r]);return t}return e}function O(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))T.has(n)||(t[n]=e[n]);let n=D(E(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst k={};let A=null,j=!1,M=null;function N(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function P(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function F(e){let t=g(e);return t?t.jwk:(k[e]||!j&&(M||=N().then(e=>{e.forEach(e=>{k[e.kid]=e}),j=!0}),await M,k[e])||await I(),k[e])}function I(){return A||=(async function(){try{let e=y(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];k[t.kid]=t}await P(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),A}async function L(e){return await I(),k[e]||null}async function R(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await F(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(w(e))return!1;let n=O(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await L(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=b(e.key_version,t);if(!x({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function z(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:p(f(e.metadata)):`image_unsealed`}async function B(e,t=Date.now()){let n=e&&e.key_version;return n?g(n)?S(n,null,t):S(n,await L(n),t):!1}function V(e){return e===`image_mismatch`||e===`invalid_signature`}function H(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",nn=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,tn],{type:`text/javascript;charset=utf-8`});function rn(e){let t;try{if(t=nn&&(self.URL||self.webkitURL).createObjectURL(nn),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(tn),{type:`module`,name:e?.name})}}var an=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],on=`https://api.oim.media/v1/media/keys`;function sn(e){for(let t=0;t<an.length;t++)if(an[t].kid===e)return an[t];return null}function cn(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||on}function ln(e,t){let n=sn(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function un(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var dn=6048e5;function fn(e,t,n=Date.now()){let r=sn(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!sn(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+dn}var pn=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function mn(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new pn(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new pn(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:cn()})})},stats(){return{alive:t!==null,pending:i.size}}}}var hn=null;function gn(e,t,n){return hn||=mn(()=>new rn),hn.verify(e,t,n)}var _n=10485760;async function vn(e,t=_n){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await Z(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await Z(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function Z(e,t,n=_n){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function yn(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function bn(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await Z(e,`deflate`)}catch{try{t=await Z(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await Z(t,`deflate`)}catch(e){try{i=await Z(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await Z(o,`deflate`)}catch(e){try{i=await Z(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await vn(i)),{image:s,metadata:c,imageHash:await yn(t)}}var xn=2**53-1;function Sn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>xn:typeof e==`object`&&e?Object.values(e).some(Sn):!1}var Cn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function wn(e){if(Array.isArray(e))return e.map(wn);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=wn(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Tn(e){if(Array.isArray(e))return e.map(Tn);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=Tn(e[r]);return t}return e}function En(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Cn.has(n)||(t[n]=e[n]);let n=Tn(wn(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function Dn(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function On(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!Dn(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=An(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&jn(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(Mn(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function kn(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function An(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function jn(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function Mn(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function Nn(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var Pn={},Fn=null,In=!1,Ln=null;function Rn(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function zn(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function Bn(e){let t=sn(e);return t?t.jwk:(Pn[e]||!In&&(Ln||=Rn().then(e=>{e.forEach(e=>{Pn[e.kid]=e}),In=!0}),await Ln,Pn[e])||await Vn(),Pn[e])}function Vn(){return Fn||=(async function(){try{let e=cn(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];Pn[t.kid]=t}await zn(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),Fn}async function Hn(e){return await Vn(),Pn[e]||null}async function Un(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await Bn(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Sn(e))return!1;let r=En(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await Hn(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=ln(e.key_version,t);if(!un({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Wn(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:V(B(e.metadata)):`image_unsealed`}async function Gn(e,t=Date.now()){let n=e&&e.key_version;return n?sn(n)?fn(n,null,t):fn(n,await Hn(n),t):!1}function Kn(e){return e===`image_mismatch`||e===`invalid_signature`}var qn=`OIM_ALTERED`;function Jn(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}async function Yn(e,t){if(!e||e.v!==1||e.alg!==`sha256-idat`||typeof e.image_hash!=`string`||typeof e.signature!=`string`||typeof e.key_version!=`string`||!t||e.image_hash.toLowerCase()!==t.toLowerCase())return`invalid`;let n=new TextEncoder().encode(JSON.stringify({alg:e.alg,image_hash:e.image_hash,key_version:e.key_version,v:e.v}));try{let t=atob(e.signature),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let i=async e=>{let t=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!1,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},t,r,n)},a=await Bn(e.key_version),o=!!a&&await i(a);if(!o){let t=await Hn(e.key_version).catch(()=>null);t&&(!a||t.x!==a.x||t.y!==a.y)&&(o=await i(t))}if(!o)return`invalid`}catch{return`invalid`}return await Gn({key_version:e.key_version})?`expired_key`:`ok`}var Xn=Math.log(1.05)/100,Zn=.01,Qn=16,$n=800;function er(e,t,n,r){let i=n===1?t*Qn:n===2?t*$n:t,a=e*Math.exp(-i*(r?Zn:Xn));return Math.max(1,Math.min(4,a))}var tr=`1.32.2`,nr=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function rr(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function ir(e,t){let n=rr(e),r=rr(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function ar(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=ir(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function or(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var sr=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,cr=546136,lr={woff:`wOFF`,woff2:`wOF2`};function ur(e,t){try{return atob(e.slice(0,8)).startsWith(lr[t])}catch{return!1}}function dr(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!sr.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>cr||!ur(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function fr(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function pr(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var mr=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function hr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=mr.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function gr(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of hr(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function _r(e,t){return gr(e,t).runs}function vr(e){return e.replace(/[{}]/g,e=>e+e)}function yr(e,t){return _r(e,t).map(e=>e.text).join(``)}function br(e,t){let n=``,r=[];for(let i of _r(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function xr(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=vr(e.slice(r,t))+`{${i.mark}}`+vr(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+vr(e.slice(r))}function Sr(e){let t={underline:e.underline===!0},n=z(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:z(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function Cr(e,t){return yr(e,Object.keys(t??{}))}function wr(e,t,n){e.textContent=``;for(let r of _r(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=Sr(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Tr(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function Er(e,t){let{plain:n,ranges:r}=br(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:xr(n.slice(1),i)}}var Dr=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Or(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&Dr.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var kr=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Ar=.35,jr=.05,Mr=[`slide-up`,`reveal-mask`,`rise-words`];function Nr(e){return typeof e==`string`&&kr.includes(e)}function Pr(e){return e===`reveal-mask`}function Fr(e,t){return Mr.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Ir(e,t=jr,n=0){return n+e*t}function Lr(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function Rr(e,t=10){return Array.from({length:t+1},(n,r)=>Lr(e,r/t))}function zr(){return Promise.resolve().then(()=>(K(),Te)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function Br(e){let t=[];return e.generative&&t.push(Le()),e.patterns&&t.push(ze()),Promise.all(t).then(()=>void 0)}var Vr=/^(fill|background)Pattern/;function Hr(e){let t={generative:!1,patterns:!1},n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e)||t.generative&&t.patterns)return;if(n.add(e),Array.isArray(e)){e.forEach(r);return}let i=e;(i.kind===`generative`||i.fillType===`generative`||i.fillGenerative)&&(t.generative=!0),(i.kind===`pattern`||i.fillType===`pattern`||`drawing`in i)&&(t.patterns=!0);for(let e in i)Vr.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var Ur={silhouette:null,fillable:!0,round:!1};function Wr(e){if(!e||e.kind===`rect`)return Ur;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Ge(t);return n?{silhouette:ot({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Ur}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=ot({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Ur}return Ur}var Gr=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,Kr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function qr(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,ee=(-_-C)/u,k=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},A=k(1,0,E,D),j=k(E,D,O,ee);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),te=j/M,N=4/3*Math.tan(te/4),P=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],ne=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],F=[];for(let e=0;e<M;e++){let t=A+e*te,n=t+te,r=P(t),i=P(n),a=ne(t),o=ne(n);F.push([r[0]+N*a[0],r[1]+N*a[1],i[0]-N*o[0],i[1]-N*o[1],i[0],i[1]])}return F}function Jr(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),Gr.lastIndex=n;let t=Gr.exec(e);return t?(n=Gr.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<Kr[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=qr(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Yr(e,t){let n=Jr(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var Xr=[0,0,100,100],Zr=[5,5,90,90],Qr={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function $r(e,t){return e===`line`?Qr:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function ei(e){if(e===void 0)return Xr;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function ti(e,[t,n,r,i],a){return Yr(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function ni(e,t){let n=e.geoShape,r=Ge(n);if(n&&r){let e=$r(n,r);return ti(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?Xr:Zr,t)}if(e.svgPath){let n=ei(e.svgViewBox);return n?ti(e.svgPath,n,t):null}return null}var ri=new Set([`line`,`scribble`]),ii=.5523;function ai(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function oi(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=ii;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function si(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?oi(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>ai(e,t.width,t.height))):ri.has(n)?null:ni({geoShape:n},t)}var ci={x:0,y:0,width:100,height:100};function li(e){return`mask-clip-${e.id}`}function ui(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function di(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function fi(e,t){return e===`rect`||e===`rectangle`?di(t):ni({geoShape:e},t)}function pi(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?ni({svgPath:i},t):fi(r||`circle`,t)}function mi(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function hi(e,t){let n=mi(e,t);return e.svgPath?ni({svgPath:e.svgPath},n):fi(e.shape||`circle`,n)}function gi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function _i(e,t){let n=gi(e);return n.length>0?n.map(e=>hi(e,t)??di(mi(e,t))).join(` `):pi(e,t)??di(t)}function vi(e){let t=gi(e);return t.length>0?t.every(e=>hi(e,ci)!==null):pi(e,ci)!==null}function yi(e,t){let{width:n,height:r}=t,i=e,a=ui(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?di(a):`M0 0H${n}V${r}H0Z`} ${_i(e,a)}`}function bi(e,t){let n=ui(e,t);return pi(e,n)??di(n)}function xi(e,t){if(!e||e===`rectangle`||e===`rect`)return{};let n=si({geoShape:e},{x:0,y:0,width:t.width,height:t.height});return n===null?{}:{clipPath:`path("${n}")`}}var Si={shadows:`#1e1b4b`,lights:`#fbbf24`};function Ci(e){return`duotone-filter-${e.id}`}function wi(e){return`mask-feather-${e.id}`}function Ti(e,t){let{width:n,height:r}=t,i=ui(e,t);return`${`M0 0H${n}V${r}H0Z`} ${di(i)} ${_i(e,i)}`}function Ei(e){let t=[];for(let n of e)if(n.type===`mask`){let e=n.style||{};if(e.maskMode!==`cutout`){t=[...t,{kind:`shape`,shape:n}];continue}let r=e.maskFeather&&e.maskFeather>0?{maskStyle:`url(#${wi(n)})`}:{clipPath:`url(#${li(n)})`};t=t.map(e=>e.clipPath||e.maskStyle?{kind:`filterGroup`,shape:n,children:[e],...r}:{...e,...r})}else t=[...t,{kind:`shape`,shape:n}];return t}var Di=6,Oi=5,ki=8,Ai=2*Math.PI/Di,ji=`oim-wave-chars`;function Mi(){let e=[];for(let t=0;t<=ki;t++){let n=t/ki,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*Oi,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${ji} {\n${e.join(`
|
|
52
|
+
`)}\n}`}function Ni(e,t,n){return n-(Ai-(e*t%Ai+Ai)%Ai)%Ai}var Pi=.7,Fi={isActive:!1,cyanOffset:{x:0,y:0},magentaOffset:{x:0,y:0},jitterSkew:0,slices:[]};function Ii(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}function Li(e,t=1,n=0,r=50){if(e<=0||e<n)return Fi;let i=Math.max(.01,t),a=e-n,o=a*i%1;if(o<.7)return Fi;let s=Math.floor(a*i)*100+Math.floor((o-Pi)/.30000000000000004*6)*10,c=.08*Math.max(1,Math.min(100,r)),l=e=>Math.round(e*100)/100,u=Ii(s+5),d=s+10,f=l(Ii(d)*80),p=e=>({x:l((Ii(e)*2-1)*c),y:l((Ii(e+1)*2-1)*c*.4)});return{isActive:!0,cyanOffset:p(s+1),magentaOffset:p(s+3),jitterSkew:u>.6?l((u*2-1)*.03*r):0,slices:[{topPercent:f,bottomPercent:Math.min(100,l(f+5+Ii(d+1)*20)),shiftX:l((Ii(d+2)*2-1)*1.5*c)}]}}function Ri(e,t){if(e===`glitch-slice`){let e=t.slices[0];return{skewX:0,copies:[{dx:t.isActive&&e?e.shiftX:0,dy:0,opacity:t.isActive&&e?1:0,clip:{top:e?e.topPercent:0,bottom:e?e.bottomPercent:0}}]}}return{skewX:t.jitterSkew,copies:[{color:`#00ffff`,dx:t.cyanOffset.x,dy:t.cyanOffset.y,opacity:t.isActive?.85:0},{color:`#ff00ff`,dx:t.magentaOffset.x,dy:t.magentaOffset.y,opacity:t.isActive?.85:0}]}}var zi={effect:`fade`,durationIn:300,durationOut:250,easing:`ease`};function Bi(e,t){return e===void 0?t:Array.isArray(e)?`cubic-bezier(${e.join(`,`)})`:e}var Vi={"slide-up":`0 4cqw`,"slide-down":`0 -4cqw`,"slide-left":`4cqw 0`,"slide-right":`-4cqw 0`};function Hi(e,t){let n={opacity:0},r={opacity:1},i=Vi[e];return i?(n.translate=i,r.translate=`0 0`):e===`scale`&&(n.scale=`0.92`,r.scale=`1`),t?[n,r]:[r,n]}function Ui(e,t){return e?{duration:e.duration,easing:Bi(e.easing,`ease-out`),effect:e.effect}:{duration:t?zi.durationIn:zi.durationOut,easing:zi.easing,effect:zi.effect}}function Wi(e,t,n=20,r=0,i=!0,a=!1){if(a)return{visibleText:e,showCursor:!1,isComplete:!0};let o=t-r,s=o>0?Math.min(e.length,Math.floor(o*Math.max(.1,n))):0;return{visibleText:e.slice(0,s),showCursor:i&&(t%.8+.8)%.8<.4,isComplete:s>=e.length}}function Gi(e,t,n){let r=t.backgroundPatternColorRole||t.fillPatternColorRole,i=t.backgroundPatternBgColorRole||t.fillPatternBgColorRole,a=Ue(t,null);if(e.style.backgroundColor=i?z(i,a.bgColor):a.bgColor,r){let i=Ve(t,n,`transparent`,`#000000`,`transparent`);if(i){e.classList.add(`oim-pat-dyn`),e.style.setProperty(`--oim-pat-fg`,z(r,a.fgColor)),e.style.setProperty(`--oim-pat-mask`,`url("`+i+`")`),e.style.backgroundImage=He(t)?`url("`+Ve(t,n,`transparent`,`transparent`)+`")`:`none`;return}}e.classList.remove(`oim-pat-dyn`);let o=i?`transparent`:a.bgColor,s=a.fgColor+`|`+o;if(e.dataset.oimPat===s)return;let c=Ve(t,n,o,a.fgColor);c&&(e.style.backgroundImage=`url("`+c+`")`),e.dataset.oimPat=s}var Ki=`oim-trim-draw`,qi=`@keyframes oim-trim-draw {
|
|
53
53
|
from { stroke-dashoffset: var(--oim-trim-from); }
|
|
54
54
|
to { stroke-dashoffset: var(--oim-trim-to); }
|
|
55
|
-
}`;function
|
|
55
|
+
}`;function Ji(e,t){if(!t||t<=0||!e.strokeWidth)return{};let n=e.trimStart??0,r=e.trimEnd??100,i=e.trimDuration??0;if(n<=0&&r>=100&&i<=0)return{};let a=Math.max(0,(r-n)/100)*t,o=t,s=-(n/100)*t||0,c={strokeDasharray:`${a} ${o}`,strokeDashoffset:s};return i>0&&(c[`--oim-trim-from`]=`${s+a}px`,c[`--oim-trim-to`]=`${s}px`,c.animation=`${Ki} ${i}s ease-out forwards`),c}function Yi(e){if(!e)return;let t=`oim-trim-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=qi,e.appendChild(n)}function Xi(e,t){e.querySelectorAll(`path, circle, rect, polygon, polyline, ellipse, line`).forEach(function(e){try{let n=Ji(t,e.getTotalLength());n.strokeDasharray&&(e.style.strokeDasharray=n.strokeDasharray,e.style.strokeDashoffset=String(n.strokeDashoffset??0)),n.animation&&(e.style.setProperty(`--oim-trim-from`,n[`--oim-trim-from`]||`0px`),e.style.setProperty(`--oim-trim-to`,n[`--oim-trim-to`]||`0px`),e.style.animation=n.animation)}catch{}})}var Zi=/^#[0-9a-fA-F]{3,8}$|^rgba?\([\d.,\s%]+\)$/;function Qi(e,t){Math.max(1,Math.min(100,t?.intensity??15));let n=t?.baseFrequency??.8,r=`<feTurbulence type="fractalNoise" baseFrequency="${Math.max(.1,Math.min(2,n))}" numOctaves="${Math.max(1,Math.min(4,t?.numOctaves??3))}" stitchTiles="stitch"/>`,i=t?.color?.trim();return i&&Zi.test(i)?`<filter id="${e}">${r.replace(`/>`,` result="n"/>`)}<feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${i}"/><feComposite in2="a" operator="in"/></filter>`:`<filter id="${e}">${r}<feColorMatrix type="saturate" values="0"/></filter>`}var $i=[`overlay`,`soft-light`,`multiply`],ea=[`text`,`artistic-text`,`geo`,`shape`,`svg`,`draw`,`image`,`pattern`],ta=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(1,Math.min(100,e)):t;function na(e){let t=ta(e,50);return Math.round((2-(t-1)*1.8/99)*1e3)/1e3}function ra(e,t){let n=ta(t?.intensity,20),r=$i.includes(t?.blend)?t.blend:`overlay`,i=Math.round(n)/100;return`<filter id="${e}" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB"><feTurbulence type="fractalNoise" baseFrequency="${na(t?.size)}" numOctaves="3" seed="7" stitchTiles="stitch" result="n"/><feColorMatrix in="n" type="saturate" values="0" result="g"/><feComposite in="g" in2="SourceAlpha" operator="in" result="m"/><feComponentTransfer in="m" result="t"><feFuncA type="linear" slope="${i}"/></feComponentTransfer><feBlend in="t" in2="SourceGraphic" mode="${r}"/></filter>`}function ia(e){let t=(e||``).trim();return/^#[0-9a-fA-F]{3,8}$/.test(t)||/^rgba?\([\d.,\s%]+\)$/.test(t)?t:`#ffffff`}function aa(e=`#ffffff`,t=.35,n=.75,r=3){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="${n}" numOctaves="${r}" stitchTiles="stitch" result="n"/><feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${ia(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#g)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(i)}`}function oa(e=`#ffffff`,t=.3){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="d"><feTurbulence type="fractalNoise" baseFrequency="0.04 0.9" numOctaves="3" result="t1"/><feColorMatrix in="t1" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -15" result="scratches"/><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" result="t2"/><feColorMatrix in="t2" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 25 -22" result="dust"/><feMerge result="m"><feMergeNode in="scratches"/><feMergeNode in="dust"/></feMerge><feColorMatrix in="m" type="luminanceToAlpha" result="a"/><feFlood flood-color="${ia(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="256" height="256" filter="url(#d)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function sa(e=`#ffffff`,t=.25){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="vp"><feTurbulence type="fractalNoise" baseFrequency="0.02 0.04" numOctaves="4" result="t"/><feColorMatrix in="t" type="luminanceToAlpha" result="a"/><feFlood flood-color="${ia(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="256" height="256" filter="url(#vp)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function ca(e=`#ffffff`,t=.3){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="rc"><feTurbulence type="fractalNoise" baseFrequency="0.35 0.35" numOctaves="3" result="t"/><feColorMatrix in="t" type="luminanceToAlpha" result="a"/><feFlood flood-color="${ia(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#rc)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function la(e=`#ffffff`,t=.25,n=16,r=2.5){let i=ia(e),a=Math.max(.01,Math.min(1,t)),o=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><circle cx="${n/2}" cy="${n/2}" r="${r}" fill="${i}" opacity="${a}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(o)}`}function ua(e=`#ffffff`,t=.2,n=8,r=1){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><rect width="${n}" height="${r}" fill="${ia(e)}" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(i)}`}function da(e=`#ffffff`,t=.25,n=32){let r=ia(e),i=Math.max(.01,Math.min(1,t)),a=n/2-1,o=n/4,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><circle cx="${n/2}" cy="${n/2}" r="${a}" fill="none" stroke="${r}" stroke-width="1.5" opacity="${i}"/><circle cx="${n/2}" cy="${n/2}" r="${o}" fill="none" stroke="${r}" stroke-width="1.5" opacity="${i}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(s)}`}var fa={"film-grain-35mm":{defaultBlend:`overlay`,defaultIntensity:35,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>aa(e,(t===void 0?35:t)/100,.75,3)},"fine-noise":{defaultBlend:`overlay`,defaultIntensity:25,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>aa(e,(t===void 0?25:t)/100,.95,2)},"dust-scratches":{defaultBlend:`screen`,defaultIntensity:30,tileWidth:256,tileHeight:256,getDataUri:(e=`#ffffff`,t)=>oa(e,(t===void 0?30:t)/100)},"vintage-paper":{defaultBlend:`multiply`,defaultIntensity:25,tileWidth:256,tileHeight:256,getDataUri:(e=`#ffffff`,t)=>sa(e,(t===void 0?25:t)/100)},"rough-canvas":{defaultBlend:`overlay`,defaultIntensity:30,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>ca(e,(t===void 0?30:t)/100)},"halftone-dots":{defaultBlend:`overlay`,defaultIntensity:25,tileWidth:16,tileHeight:16,getDataUri:(e=`#ffffff`,t)=>la(e,(t===void 0?25:t)/100,16,2.5)},scanlines:{defaultBlend:`overlay`,defaultIntensity:20,tileWidth:8,tileHeight:8,getDataUri:(e=`#ffffff`,t)=>ua(e,(t===void 0?20:t)/100,8,1)},"concentric-rings":{defaultBlend:`soft-light`,defaultIntensity:25,tileWidth:32,tileHeight:32,getDataUri:(e=`#ffffff`,t)=>da(e,(t===void 0?25:t)/100,32)}},pa=`oim-parallax-track`,ma=`oim-parallax-pista`,ha=1,ga=`@keyframes oim-parallax-infinite {
|
|
56
56
|
0% { transform: translateX(0px); }
|
|
57
57
|
100% { transform: translateX(calc(-1 * var(--oim-parallax-unit, 0px))); }
|
|
58
58
|
}
|
|
59
|
-
.${
|
|
60
|
-
.${
|
|
59
|
+
.${pa}, .${ma} { display: flex; width: max-content; will-change: transform; }
|
|
60
|
+
.${pa}:hover, .${ma}:hover { animation-play-state: var(--oim-parallax-hover, running); }
|
|
61
61
|
@media (prefers-reduced-motion: reduce) {
|
|
62
|
-
.${
|
|
63
|
-
}`;function
|
|
62
|
+
.${pa}, .${ma} { animation: none !important; }
|
|
63
|
+
}`;function _a(e,t,n=t){if(!e||typeof e.speedPxSec!=`number`||!Number.isFinite(e.speedPxSec)||e.speedPxSec<=0||typeof t!=`number`||!Number.isFinite(t)||t<=0)return{duplicate:!1,copies:0,container:{},copy:{},secondCopy:{}};let r=e.mirror?2:1,i=t*r,a=Math.ceil((Number.isFinite(n)&&n>0?n:t)/t)+r;e.mirror&&a%2!=0&&(a+=1);let o=i/e.speedPxSec;if(!Number.isFinite(o)||o<=0)return{duplicate:!1,copies:0,container:{},copy:{},secondCopy:{}};let s={"align-self":`flex-start`,"flex-shrink":`0`,"--oim-parallax-unit":`${i}px`,"--oim-parallax-unidad":`${i}px`,"animation-name":`oim-parallax-infinite`,"animation-duration":`${o}s`,"animation-timing-function":`linear`,"animation-iteration-count":`infinite`,"animation-direction":e.direction===`left_to_right`?`reverse`:`normal`};e.pauseOnHover&&(s[`--oim-parallax-hover`]=`paused`);let c=(t+ha)/t,l={flex:`0 0 ${t}px`,"transform-origin":`0 0`,transform:`scaleX(${c})`},u={};return e.mirror&&(u.transform=`translateX(${t+ha}px) scaleX(-1) scaleX(${c})`),{duplicate:!0,copies:a,container:s,copy:l,secondCopy:u}}function va(e){if(!e)return;let t=`oim-parallax-styles`;if(e.getElementById(t))return;let n=e.head||e,r=(e.ownerDocument||e).createElement(`style`);r.id=t,r.textContent=ga,n.appendChild(r)}var ya=8;function ba(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[];for(let e of t){let t=n[n.length-1];t&&e.y-t[0].y<=ya?t.push(e):n.push([e])}return n.flatMap(e=>e.sort((e,t)=>e.x-t.x))}function xa(e,t,n){let r=X(e.alt,t)??X(e.alt,n);return typeof r==`string`?r.trim():``}function Sa(e,t,n,r=!0){let i=[];for(let a of e||[]){if(!a||a.type===`group`||a.type===`mask`||a.type===`filter`||Array.isArray(a.languages)&&!a.languages.includes(`*`)&&!a.languages.includes(t))continue;let e=a.style||{};if(e.isVisible===!1)continue;let o=e.decorative===!0?``:xa(e,t,n),s=a.type&&a.type!==`text`&&a.type!==`artistic-text`?``:Cr(Tt(a.content,t),e.marks).trim(),c=r&&(a.isInteractive===!0||e.isInteractive===!0||a.interaction&&a.interaction.action_type===`toggle_elements`),l=null;c?l={type:`button`,label:s||o||u(`button`,t),slotId:String(a.id)}:s&&e.decorative!==!0?l={type:`text`,lang:t,text:s}:o&&(l={type:`image`,label:o});let d=Array.isArray(a.position)?a.position:[0,0];l&&i.push({x:Number(d[0])||0,y:Number(d[1])||0,node:l})}return ba(i).map(e=>e.node)}function Ca(e,t,n,r=n){let i=X(e&&e.description,n)??X(e&&e.description,r);if(typeof i==`string`&&i.trim())return i.trim();let a=t.find(e=>e.type===`text`);return a&&a.type===`text`?a.text:u(`image`,n)}function wa(e){let t=`${e.x}% ${e.y}%`;return{objectFit:`cover`,objectPosition:t,transform:`scale(${e.zoom})`,transformOrigin:t}}function Ta(e,t){return!e&&!t?null:[e?-1:1,t?-1:1]}var Ea=`http://www.w3.org/2000/svg`,Da=0;function Oa(e,t,n,r,i){let a=`oim-image-fill-${++Da}`,[o,s,c,l]=n.viewBox.trim().split(/\s+/).map(Number),u=c===l?`scale(${1/c})`:`scale(${1/c} ${1/l})`,d=o||s?`${u} translate(${-o} ${-s})`:u,f=document.createElement(`div`);f.className=`oim-image-fill`,f.style.position=`absolute`,f.style.left=`0`,f.style.top=`0`,f.style.width=`100%`,f.style.height=`100%`,f.style.overflow=`hidden`,f.style.pointerEvents=`none`,f.style.clipPath=`url(#${a})`;let p=document.createElementNS(Ea,`svg`);p.setAttribute(`width`,`0`),p.setAttribute(`height`,`0`),p.style.position=`absolute`;let m=document.createElementNS(Ea,`clipPath`);m.setAttribute(`id`,a),m.setAttribute(`clipPathUnits`,`objectBoundingBox`);let h=document.createElementNS(Ea,n.rect?`rect`:`path`);n.rect?(h.setAttribute(`x`,`0`),h.setAttribute(`y`,`0`),h.setAttribute(`width`,`1`),h.setAttribute(`height`,`1`),h.setAttribute(`rx`,String(n.rect.rx)),h.setAttribute(`ry`,String(n.rect.ry))):(h.setAttribute(`d`,n.d),h.setAttribute(`transform`,d)),m.appendChild(h),p.appendChild(m),f.appendChild(p);let g=wa(t.crop??{x:50,y:50,zoom:1}),_=document.createElement(`img`);_.alt=``,_.draggable=!1,_.style.width=`100%`,_.style.height=`100%`,_.style.display=`block`,_.style.objectFit=g.objectFit,_.style.objectPosition=g.objectPosition;let v=Ta(t.flipX,t.flipY);_.style.transform=v?`${g.transform} scale(${v[0]}, ${v[1]})`.trim():g.transform,_.style.transformOrigin=g.transformOrigin,_.style.filter=ve(Lt(t.filters))??``,_.addEventListener(`error`,()=>{if(f.remove(),i){if(n.rect)e.style.backgroundColor=i;else for(let t of Array.from(e.children))if(t.tagName.toLowerCase()===`svg`)for(let e of Array.from(t.children))e.setAttribute(`fill`,i)}}),_.src=r,f.appendChild(_),e.insertBefore(f,e.firstChild)}function ka(e,t){return{left:`0px`,top:`0px`,width:t.width+`px`,height:t.height+`px`,transformOrigin:e.x+e.width/2+`px `+(e.y+e.height/2)+`px`,pointerEvents:`none`}}var Aa=1.25,ja=.5;function Ma(e){let t=e&&e.lineHeight,n;if(typeof t==`number`)n=t;else if(typeof t==`string`&&t.trim()!==``)n=Number(t);else return Aa;return!Number.isFinite(n)||n<=0?Aa:Math.min(3,Math.max(ja,n))}var Na=1.4;function Pa(e){(!Number.isFinite(e)||e<=0)&&(e=Aa);let t=Na-e;return t<=0?0:Math.round(t/2*1e4)/1e4}function Fa(e){return e.isParallaxGroup?`hidden`:e.isText||e.hasFilterOrShadow||e.hasKeyframes?`visible`:`hidden`}function Ia(e){e.style.minWidth=`24px`,e.style.minHeight=`24px`}function La(e,t,n,r,i){if(!t)return;let a={},o=t=>{let i=za(t||{});for(let t of Object.keys(i))a[t]===void 0&&(a[t]=e.style.getPropertyValue(t));n(e,i),t?.actions&&t.actions.length>0&&r&&r.run(t.actions,`hover`)},s=()=>{n(e,a),t.hover?.actions&&t.hover.actions.length>0&&r&&r.revert(t.hover.actions)},c=t.active?.actions;r&&(e.addEventListener(`click`,()=>{r.run(c||[],`click`)}),e.style.cursor=`pointer`),e.addEventListener(`mouseenter`,()=>o(t.hover)),e.addEventListener(`mouseleave`,s),e.addEventListener(`pointerdown`,n=>{n.pointerType!==`mouse`&&(o(t.hover),i&&i(e,s))})}function Ra(e){return e<=10?e:e/100}function za(e){let t={};return e.scale!==void 0&&(t[`--oim-slot-hover-scale`]=String(Ra(e.scale))),e.rotation!==void 0&&(t[`--oim-rot`]=`${e.rotation}deg`),e.opacity!==void 0&&(t.opacity=String(e.opacity/100)),e.color&&(t.color=e.color),e.transitionDuration!==void 0&&(t[`--oim-transition-duration`]=`${e.transitionDuration}s`),t}function Ba(e,t){let n={},r={};if(!e||e.length===0)return{visibility:n,texts:r};for(let i of e){let e=i.target;if(!e)continue;let a=t[e]===void 0||t[e];i.type===`show`?n[e]=!0:i.type===`hide`?n[e]=!1:i.type===`toggle`?n[e]=!a:i.type===`setText`&&(r[e]=i.value!==void 0&&i.value!==null?String(i.value):``)}return{visibility:n,texts:r}}function Va(e,t,n,r=`arc`){let i=t/2,a=Math.max(-100,Math.min(100,n));if(a===0)return`M 0 ${i} L ${e} ${i}`;let o=t*.45,s=a/100*o;if(r===`wave`)return`M 0 ${i} C ${e*.25} ${i-s}, ${e*.75} ${i+s}, ${e} ${i}`;let c=i+s*.5,l=i-s;return`M 0 ${c} Q ${e/2} ${l} ${e} ${c}`}function Ha(e,t,n){let r=String(e??``).split(/\r\n|\r|\n/),i=t*n,a=(r.length-1)/2;return r.map((e,t)=>({text:e,offset:(t-a)*i}))}function Ua(e,t){if(typeof e!=`string`||!e.startsWith(`#`))return e;let n=e.slice(1);if(n.length===3&&(n=n.split(``).map(e=>e+e).join(``)),n.length!==6)return e;let r=parseInt(n,16);if(Number.isNaN(r))return e;let i=e=>Math.max(0,Math.min(255,Math.floor(e*(1-t)))),a=i(r>>16),o=i(r>>8&255),s=i(r&255);return`#${((1<<24)+(a<<16)+(o<<8)+s).toString(16).slice(1)}`}function Wa(e,t,n=`#111827`,r=!0){let i=Math.max(0,Math.min(60,e));if(i===0)return[];let a=t*Math.PI/180,o=Math.cos(a),s=Math.sin(a),c=Math.max(1,Math.round(i)),l=[];for(let e=c;e>=1;e--){let t=e/c,i=Math.round(o*e*10)/10,a=Math.round(s*e*10)/10,u=r?Ua(n,1-t*.5):n;l.push({dx:i,dy:a,color:u,opacity:1})}return l}function Ga(e,t,n){let r=e.text,i=r.artistic??{},a=r.content,o=a[t]||a.es||a.en||Object.values(a)[0]||`CARTEL`,s=(e,t)=>typeof e==`number`?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:t,c=e.box,l=c.width||400,u=c.height||120,d=r.font?.size,f=(d&&typeof d==`object`&&`modes`in d?d.modes[t]:void 0)??s(d,48),p=r.font?.weight,m=e.fills?.[0],h=t=>e.strokes?.find(e=>e.align===t),g=h(`outside`),_=h(`inside`),v=i.curve?.amount??0,y=i.extrusion;return{text:String(o),width:l,height:u,fontFamily:r.font?.family||`Bangers`,fontSize:f,bold:p===`bold`||Number(p)>=700,letterSpacing:r.letterSpacing??0,lineHeight:Ma({lineHeight:r.lineHeight}),fillColor:(m?.kind===`color`?n(m.value):void 0)||`#FBBF24`,curvePathD:Va(l,u,v,i.curve?.type??`arc`),isCurved:v!==0,extrusionLayers:Wa(y?.depth??0,y?.angle??45,y?.color!==void 0&&n(y.color)||`#111827`,y?.shading!==!1),outerStrokeColor:g?n(g.paint.value):void 0,outerStrokeWidth:g?s(g.width,0):0,innerStrokeColor:_?n(_.paint.value):void 0,innerStrokeWidth:_?s(_.width,0):0,textGradientType:m?.kind===`gradient`&&m.preset?m.preset:`none`}}function Ka(e,t=`artistic-text`){let n=`curve-path-${t}`,r=`artistic-grad-${t}`,i=e.fillColor,a=``;e.textGradientType===`sunset-gold`?(i=`url(#${r})`,a=`
|
|
64
64
|
<linearGradient id="${r}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
65
65
|
<stop offset="0%" stop-color="#FDE047" />
|
|
66
66
|
<stop offset="50%" stop-color="#F97316" />
|
|
@@ -79,7 +79,7 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
79
79
|
<stop offset="100%" stop-color="#A5F3FC" />
|
|
80
80
|
</linearGradient>`);let o=`${e.fontFamily}, sans-serif`,s=e.bold?`bold`:`normal`,c=e.letterSpacing?`letter-spacing="${e.letterSpacing}px"`:``,l=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),u=t=>{let r=``;return r=e.isCurved?`${e.extrusionLayers.map(r=>`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="${r.color}" stroke="${r.color}" stroke-width="${e.outerStrokeWidth>0?e.outerStrokeWidth:1}" stroke-linejoin="round" transform="translate(${r.dx}, ${r.dy})" opacity="${r.opacity}"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`).join(`
|
|
81
81
|
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`:``}\n${`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`}`:`${e.extrusionLayers.map(n=>`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${n.color}" stroke="${n.color}" stroke-width="${e.outerStrokeWidth>0?e.outerStrokeWidth:1}" stroke-linejoin="round" transform="translate(${n.dx}, ${n.dy})" opacity="${n.opacity}">${t}</text>`).join(`
|
|
82
|
-
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round">${t}</text>`:``}\n${`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round">${t}</text>`}`,r},d=
|
|
82
|
+
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round">${t}</text>`:``}\n${`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round">${t}</text>`}`,r},d=Ha(e.text||``,e.fontSize,e.lineHeight).map(e=>`<g transform="translate(0, ${e.offset})">${u(l(e.text))}</g>`).join(`
|
|
83
83
|
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 ${e.width} ${e.height}" preserveAspectRatio="xMidYMid meet" overflow="visible" style="pointer-events:none;">
|
|
84
84
|
<defs>
|
|
85
85
|
${a}
|
|
@@ -88,6 +88,6 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
88
88
|
<g>
|
|
89
89
|
${d}
|
|
90
90
|
</g>
|
|
91
|
-
</svg>`}function
|
|
92
|
-
`){e.appendChild(document.createElement(`br`));continue}let o=document.createElement(`span`);o.textContent=a===` `?`\xA0`:a,o.style.display=`inline-block`,o.style.animationName=Oi,o.style.animationDuration=Di+`s`,o.style.animationTimingFunction=`linear`,o.style.animationIterationCount=`infinite`,o.style.animationDelay=Ai(t,n,r)+`s`,e.appendChild(o)}}function Ga(e,t,n,r,i){e.textContent=``,Mr(t,n).forEach((t,a)=>{if(/^\s+$/.test(t)){e.appendChild(document.createTextNode(t));return}let o=document.createElement(`span`);o.textContent=t,o.className=`oim-entrance`;let s=o.style;if(s.display=`inline-block`,s.animation=`oim-entrance-${n} ${Dr}s linear ${Nr(a,r,i)}s both`,!jr(n)){e.appendChild(o);return}let c=document.createElement(`span`);c.className=`oim-entrance-clip`,c.style.display=`inline-block`,c.style.overflow=`hidden`,c.style.verticalAlign=`top`,c.appendChild(o),e.appendChild(c)})}function Ka(e,t){if(!e)return;let n=`oim-entrance-`+t;if(e.getElementById(n))return;let r=Fr(t),i=r.some(e=>e.rotateDeg!==0),a=r.map((e,t)=>`${t*100/(r.length-1)}%{opacity:${e.opacity};transform:translateY(${e.translateYEm}em) scale(${e.scale})${i?` rotate(${e.rotateDeg}deg)`:``}}`).join(``),o=document.createElement(`style`);o.id=n,o.textContent=`@keyframes ${n}{${a}}@media (prefers-reduced-motion: reduce){.oim-entrance{animation:none!important}}`,e.appendChild(o)}function qa(e){if(!e)return;let t=`oim-wave-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=ki(),e.appendChild(n)}function Ja(e,t,n){let r=0,i=performance.now(),a=null,o=()=>r+(a===null?0:performance.now()-i),s=()=>t(o()/1e3),c=()=>{a===null&&(i=performance.now(),a=setInterval(s,e))},l=()=>{a!==null&&(r=o(),clearInterval(a),a=null)};return c(),{pause:l,play:c,stop:()=>{l(),n?.()}}}function Ya(e,t,n=20,r=0,i=!0){let a=a=>{let o=Vi(t,a,n,r,i,!1);e.textContent=o.visibleText+(o.showCursor?`|`:``)};return a(0),Ja(40,a)}function Xa(e,t,n,r=1,i=0,a=50){e.textContent=``,e.style.display=`inline-block`,e.style.position=`relative`;let o=()=>{let e=document.createElement(`span`);return e.textContent=t,e},s=Fi(n,Pi(0)).copies.map(e=>{let t=o();t.setAttribute(`aria-hidden`,`true`);let n=t.style;return n.position=`absolute`,n.left=`0`,n.top=`0`,n.width=`100%`,n.height=`100%`,n.pointerEvents=`none`,n.opacity=`0`,e.color&&(n.color=e.color),t}),c=o();c.style.position=`relative`,n===`glitch-slice`?e.append(c,...s):e.append(...s,c);let l=t=>{let o=Fi(n,Pi(t,r,i,a));e.style.transform=o.skewX?`skewX(${o.skewX}deg)`:`none`,o.copies.forEach((e,t)=>{let n=s[t].style;n.opacity=String(e.opacity),n.transform=`translate(${e.dx}px, ${e.dy}px)`,e.clip&&(n.clipPath=`inset(${e.clip.top}% 0 ${100-e.clip.bottom}% 0)`)})};return Ja(33,l,()=>l(0))}function Za(e,t){if(!t?.enabled)return;let n=t.color||`rgba(245,158,11,.35)`,r=t.style===`underline-thick`,i=e.style;i.backgroundColor=r?`transparent`:n,r&&(i.boxShadow=`inset 0 -.4em 0 ${n}`),i.borderRadius=t.style===`pill`?`9999px`:t.style===`box`?`0`:`${t.borderRadius??3}px`,i.padding=`${t.paddingY??2}px ${t.paddingX??4}px`,i.boxDecorationBreak=i.webkitBoxDecorationBreak=`clone`}function Qa(e,t,n,r){if(!n?.enabled||!t)return!1;let{letter:i,rest:a}=Cr(t,Object.keys(r??{}));if(!i)return!1;let o=document.createElement(`span`),s=o.style,c=Sr(n);return o.textContent=i,s.float=`left`,s.fontSize=`${c.scale}em`,s.lineHeight=String(c.lineHeight),s.marginRight=`${c.marginRight}px`,c.fontFamily&&(s.fontFamily=c.fontFamily),c.color&&(s.color=c.color),s.fontWeight=String(c.fontWeight),s.userSelect=`none`,xr(e,a,r),e.prepend(o),!0}function $a(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)}function eo(e,t){let n=(e||``).replace(`#`,``),r=parseInt(n.substring(t*2,t*2+2),16)||0;return Math.round(r/255*1e3)/1e3}function to(e,t,n){let r=`http://www.w3.org/2000/svg`,i=t.width,a=t.height,o=e.style||{},s=gi(e,t),{x:c,y:l}=si(e,t),u=document.createElement(`div`);u.className=`oim-mask-frame`,u.style.position=`absolute`,u.style.left=-c+`px`,u.style.top=-l+`px`,u.style.width=i+`px`,u.style.height=a+`px`,u.style.flex=`none`,u.style.display=`block`,u.style.pointerEvents=`none`;let d=document.createElement(`div`);d.className=`oim-mask-paint`,d.style.position=`absolute`,d.style.left=`0`,d.style.top=`0`,d.style.width=`100%`,d.style.height=`100%`,d.style.pointerEvents=`none`;for(let[e,t]of Object.entries(n.css))e.startsWith(`--`)?d.style.setProperty(e,t):d.style[e]=t;d.style.clipPath=`path(evenodd, "${s}")`,u.appendChild(d),n.photo&&Ta(d,n.photo.paint,{d:`M0 0H${i}V${a}H0Z`,viewBox:`0 0 ${i} ${a}`},n.photo.src,n.photo.underColor);let f=o.maskStrokeWidth??0,p=_i(e,t);if(f>0){let e=document.createElementNS(r,`svg`);e.setAttribute(`viewBox`,`0 0 `+i+` `+a),e.setAttribute(`preserveAspectRatio`,`none`),e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=i+`px`,e.style.height=a+`px`,e.style.overflow=`visible`,e.style.pointerEvents=`none`;let t=document.createElementNS(r,`path`);t.setAttribute(`d`,p),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,V(o.maskStrokeColorRole||o.strokeColorRole,o.maskStrokeColor||`#FFFFFF`)),t.setAttribute(`stroke-width`,String(f)),t.setAttribute(`stroke-linejoin`,`round`),e.appendChild(t),u.appendChild(e)}return u}var no=!1;function ro(e){no||(no=!0,console.warn(`[OimPlayer] A mask outline cannot be drawn (unknown shape and no path); the mask falls back to its box, slot:`,e))}function io(e,t){let n=`http://www.w3.org/2000/svg`,r=document.createElementNS(n,`svg`);r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`style`,`position:absolute`),r.setAttribute(`aria-hidden`,`true`);let i=document.createElementNS(n,`defs`);return r.appendChild(i),e.forEach(function(e){let r=e.style||{};if(e.type===`mask`&&r.maskMode===`cutout`){let a=r.maskFeather,o=Si(e,t);if(hi(e)||ro(String(e.id)),a&&a>0){let r=xi(e)+`-blur`,s=document.createElementNS(n,`filter`);s.setAttribute(`id`,r),s.setAttribute(`filterUnits`,`userSpaceOnUse`),s.setAttribute(`x`,`0`),s.setAttribute(`y`,`0`),s.setAttribute(`width`,String(t.width)),s.setAttribute(`height`,String(t.height));let c=document.createElementNS(n,`feGaussianBlur`);c.setAttribute(`stdDeviation`,String(a)),s.appendChild(c),i.appendChild(s);let l=document.createElementNS(n,`mask`);l.setAttribute(`id`,xi(e)),l.setAttribute(`maskUnits`,`userSpaceOnUse`);let u=document.createElementNS(n,`rect`);u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,String(t.width)),u.setAttribute(`height`,String(t.height)),u.setAttribute(`fill`,`black`),l.appendChild(u);let d=document.createElementNS(n,`g`);d.setAttribute(`filter`,`url(#`+r+`)`);let f=document.createElementNS(n,`path`);f.setAttribute(`d`,o),f.setAttribute(`fill`,`white`),f.setAttribute(`clip-rule`,`evenodd`),f.setAttribute(`fill-rule`,`evenodd`),d.appendChild(f),l.appendChild(d),i.appendChild(l)}else{let t=document.createElementNS(n,`clipPath`);t.setAttribute(`id`,oi(e)),t.setAttribute(`clipPathUnits`,`userSpaceOnUse`);let r=document.createElementNS(n,`path`);r.setAttribute(`d`,o),r.setAttribute(`clip-rule`,`evenodd`),t.appendChild(r),i.appendChild(t)}}if(e.type===`filter`&&e.duotone){let t=document.createElementNS(n,`filter`);t.setAttribute(`id`,bi(e)),t.setAttribute(`color-interpolation-filters`,`sRGB`);let r=document.createElementNS(n,`feColorMatrix`);r.setAttribute(`type`,`matrix`),r.setAttribute(`values`,`0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 1 0`),t.appendChild(r);let a=document.createElementNS(n,`feComponentTransfer`);[`R`,`G`,`B`].forEach(function(e,t){let r=document.createElementNS(n,`feFunc`+e);r.setAttribute(`type`,`table`);let i=t;r.setAttribute(`tableValues`,eo(yi.shadows,i)+` `+eo(yi.lights,i)),a.appendChild(r)}),t.appendChild(a),i.appendChild(t)}}),r}function ao(e,t,n){let r=n.get(e.shape.id);r&&(e.clipPath&&(r.style.clipPath=e.clipPath),e.maskStyle&&(r.style.mask=e.maskStyle),t.appendChild(r))}var oo=1200,so=class{updateScale(){}sceneReady(){}updateViewportSize(){}host;poster=`auto`;metadata=null;securityStatus=`unsigned`;embeddedFontFamilies=new Map;imageUrl=null;lang;showControls;activeSlotId=null;zoom=1;panX=0;panY=0;_stage=null;_viewport=null;_baseImg=null;_overlay=null;_lottieInstances=[];_onDragMove=null;_onDragEnd=null;_animations=[];_textAnimations=[];_paused=!1;_revealAnims=new Map;_timelines=new Map;_warnedPlay=new Set;_heldTimelines=new Set;_isStill(){let e=this.host;if(!this.disableAnimations||!e||typeof e.getAttribute!=`function`)return!1;let t=e.getAttribute(`disable-animations`);return t!==null&&t!==`false`||e.getAttribute(`mode`)===`image`}_resizeObserver=null;_onFullscreenChange=null;_retryViewportSize=!1;allowZoom;showLanguageSelector;showSlots;allowLottie;allowDynamicColors=!0;disableAnimations;disableActions;dropdownBlur;fit;align;_deviceProfile;applyPalette(){let e=this._viewport;if(!e)return;let t=typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches,n=this.allowDynamicColors?B(this.metadata??{},{requested:this.host.getAttribute(`palette`),prefersDark:t}):null;for(let t of ie){let r=n?.colors[t];r?e.style.setProperty(`--oim-palette-`+t,r):e.style.removeProperty(`--oim-palette-`+t)}}async renderSlots(e){if(!this.metadata||!this.host||this.poster===`only`)return;let t=(this.metadata.slots||this.metadata.elements||[]).some(function(e){return e.type===`mask`||e.type===`filter`}),n=e&&e.onlyIds&&e.onlyIds.size>0&&!t?e.onlyIds:null;if(this._viewport&&!this._revealed&&this._viewport.classList.remove(`oim-viewport--ready`),!this.showSlots){this._overlay&&(this._overlay.innerHTML=``),this._viewport&&this._viewport.classList.add(`oim-viewport--ready`),this.sceneReady();return}n?this._destroyLottiesIn(n):this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]);let r=this._overlay;if(!r)return;let i=this._viewport?this._viewport.querySelector(`.oim-noise-overlay`):null,a=Array.isArray(this.metadata?.effects)?this.metadata.effects.find(e=>e&&e.type===`texture`&&e.enabled!==!1):null;if(a){let e=la[a.preset];if(e){let t=i||document.createElement(`div`);t.className=`oim-noise-overlay`,t.style.position=`absolute`,t.style.inset=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.pointerEvents=`none`,t.style.mixBlendMode=a.blend||e.defaultBlend||`overlay`;let n=(a.intensity===void 0?e.defaultIntensity:a.intensity)/100;t.style.opacity=n.toFixed(2),t.style.zIndex=`999`;let r=a.scale||1,o=e.tileWidth*r,s=e.tileHeight*r;t.style.backgroundImage=`url("${e.getDataUri(a.color)}")`,t.style.backgroundRepeat=`repeat`,t.style.backgroundSize=`${o}px ${s}px`,!i&&this._viewport&&this._viewport.appendChild(t)}}else if(this.metadata&&this.metadata.grain&&this.metadata.grain.enabled){let e=this.metadata.grain,t=e.intensity??15,n=e.blendMode??`overlay`,r=e.baseFrequency??.8,a=i||document.createElement(`div`);a.className=`oim-noise-overlay`,a.style.position=`absolute`,a.style.inset=`0`,a.style.width=`100%`,a.style.height=`100%`,a.style.pointerEvents=`none`,a.style.mixBlendMode=n,a.style.opacity=(t/100).toFixed(2),a.style.zIndex=`999`;let o=`oim-global-noise-filter`,s=Yi(o,{intensity:t,baseFrequency:r,color:e.color}),c=`data:image/svg+xml;utf8,`+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs>${s}</defs><rect width="100%" height="100%" filter="url(#${o})"/></svg>`);a.style.backgroundImage=`url("${c}")`,!i&&this._viewport&&this._viewport.appendChild(a)}else i&&i.remove();let o=this,s=this.metadata.slots||this.metadata.elements||[],l=e=>{let t=String(e?.message??e);console.error(`[OimPlayer] A part of the player did not load; the work is shown without it.`,t),this.host.dispatchEvent(new CustomEvent(`oim:error`,{detail:{code:`chunk`,message:t}}))};await Me().catch(l),await Lr(zr([this.metadata,Array.from(Bt(this.metadata).values())])).catch(l);let u=Bt(o.metadata);s.forEach(function(e){let t=e&&e.type===`mask`?u.get(String(e.id)):void 0;if(t){e.style={...e.style,...Ut(t,X(o.metadata))};let{x:n,y:r,width:i,height:a}=t.box;Object.assign(e,{x:n,y:r,width:i??0,height:a??0})}});let d=[],f=o.metadata&&(o.metadata.artboardWidth||o.metadata.canvasWidth||o.metadata.canvas_width)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_width||o.metadata.canvas.width:0)||(o._baseImg&&o._baseImg.naturalWidth>0?o._baseImg.naturalWidth:1080),p=o.metadata&&(o.metadata.artboardHeight||o.metadata.canvasHeight||o.metadata.canvas_height)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_height||o.metadata.canvas.height:0)||(o._baseImg&&o._baseImg.naturalHeight>0?Math.round(f*(o._baseImg.naturalHeight/o._baseImg.naturalWidth)):1920);r.style.setProperty(`--oim-overlay-w`,f+`px`),r.style.setProperty(`--oim-overlay-h`,p+`px`);let m=document.createDocumentFragment(),h={},g=new Map,_=Bt(o.metadata);(this.metadata.zones||[]).forEach(e=>{let t=_.get(String(e?.id));if(!t||t.type!==`group`)return;let n=document.createElement(`div`);n.className=`oim-zone`,n.id=`oim-zone-`+t.id,n.style.position=`absolute`,n.style.inset=`0`;let r=t.children?.find(e=>e.id===t.id+`__background`),i=r?.fills?.[0],a=t.effects?.find(e=>e.kind===`backdrop`)?.blur;if(r||a){let e=t.box,s=document.createElement(`div`);s.className=`oim-zone-box`,s.style.position=`absolute`,s.style.left=e.x+`px`,s.style.top=e.y+`px`,s.style.width=(e.width??0)+`px`,s.style.height=(e.height??0)+`px`,i&&`kind`in i&&i.kind===`color`&&(s.style.background=X(o.metadata).css(i.value)||``),typeof r?.corners==`number`&&(s.style.borderRadius=r.corners+`px`),a&&(s.style.backdropFilter=`blur(`+a+`px)`,s.style.webkitBackdropFilter=s.style.backdropFilter),n.appendChild(s)}m.appendChild(n),h[t.id]=n;for(let e of t.children??[])g.set(e.id,t.id)});let v=be(s),y=Bt(o.metadata),b=X(o.metadata),x=o.metadata.canvasFills?.[0];if(x&&o._overlay&&!n){let e=yt(x,{colors:b,width:o.metadata.canvas_width,height:o.metadata.canvas_height});for(let[t,n]of Object.entries(e))o._overlay.style[t]=n}let S=e=>e&&typeof e==`object`&&typeof e.fallback==`string`?b.literal(e.fallback):b.literal(e),C=s.map(async e=>{let t=e.type,r=y.get(String(e.id));if(n&&!n.has(String(e.id)))return null;let i=e.style||{};if(e.tracking_data,t===`mask`&&i.maskMode===`cutout`){let t=g.get(String(e.id));return t&&h[t]&&console.warn(`[OimPlayer] Slot "`+e.id+`" is a mask layer inside zone "`+t+`". Mask layers are only supported in the top-level slot stack, so this one will neither render nor clip anything. Move it out of the zone.`),null}if(!r)return console.warn(`[OimPlayer] Slot "`+e.id+`" has no 2.0 layer; it is not painted.`),null;let a=r.box,s=Ot(e,o.lang),l=r.type===`text`?r.text?.content:void 0,u=t===`image`?r.image:void 0,d=r.type===`shape`&&r.geometry?.kind===`paths`&&!Vr(r.geometry).path?r.geometry:void 0,m=l?Ct(l,o.lang):u?Wt(u.src,o.lang):d&&!Tt(e)?Kt(d,qt(r,b.css)):r.type===`lottie`?r.lottie?.src??``:s.content,_=!o.disableActions&&(!!r.interactions?.length||!!r.animations?.some(e=>e.on===`hover`||e.on===`press`)),x=t===`mask`&&i.maskMode!==`cutout`,C=t===`artistic-text`,w=t===`geo`||t===`shape`||t===`draw`||t===`filter`||t===`container`||x||_||C,T=e.is_background_pattern===!0||e.id===`background-pattern-slot`;if(!(t===`group`&&v.has(String(e.id)))&&!(t===`pattern`||T)&&!m&&!(w&&(r.fills?.length||a.width!==void 0||t===`filter`||t===`container`||x||_||C)))return null;let E=wt(e,m),D=m,O=!1;E||(/<svg|<span|<div|<a|<img/i.test(D)&&(D=D.replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`)),O=!!d&&!Tt(e));let ee=!E&&(O||/<svg|<span|<div|<a|<img/i.test(D));D=D.replace(/\\n/g,`
|
|
93
|
-
`);let k=r.type===`text`?r.text?.align??`left`:`left`,A=`center`;k===`left`?A=`flex-start`:k===`right`&&(A=`flex-end`);let j=document.createElement(`div`);j.className=`oim-slot`,j.setAttribute(`part`,`slot`),j.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(j.style.display=`none`),j.style.zIndex=T?`0`:`1`;let M=r.animations?.find(e=>e.on===`enter`&&e.preset);j._oimReveal=M?{effect:M.preset,duration:M.duration,easing:M.easing}:void 0;let te=!!r.interactions?.length;_||te&&!o.disableActions||j.setAttribute(`data-oim-passthrough`,``);let N=r.fills?.[0],P=N?.kind===`pattern`?N.pattern:void 0,F=P?mt(P,b):{};if(T){j.style.pointerEvents=`none`;let e=d?Kt(d,qt(r,b.literal),!0):``;if(e||P){if(Hi(j,F,e),(P?.fit===`cover`?`cover`:`tile`)==`cover`)j.style.backgroundSize=`cover`,j.style.backgroundRepeat=`no-repeat`,j.style.backgroundPosition=`center`,j.style.setProperty(`--oim-pat-size`,`cover`),j.style.setProperty(`--oim-pat-repeat`,`no-repeat`),j.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(P?.scale||1)/f*100;j.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,j.style.backgroundRepeat=`repeat`,j.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=P?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(j.style.animation=n),D=``,O=!1}}if(t===`pattern`){let e=Vr(r.type===`shape`?r.geometry:void 0),t=dt({...F,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?j.style.setProperty(e,n):j.style[e]=n;(F.fillPatternColorRole||F.fillPatternBgColorRole)&&Hi(j,F,``)}let I=document.createElement(`div`);I.className=`oim-slot-loop-wrap`;let L=document.createElement(`div`);L.className=`oim-slot-hover-wrap`,(O||E||t===`lottie`||C)&&(I.style.height=`100%`,L.style.height=`100%`);let R=null,ne=t===`text`?r.fills?.[0]:void 0;if(ne){let e=yt(ne,{colors:b,isText:!0,width:r.box.width||f,height:r.box.height||p});R=Object.keys(e).length>0?e:null}let re=R!==null&&(R.backgroundClip===`text`||R.webkitBackgroundClip===`text`),ie=r.box.width!==void 0&&r.box.height!==void 0,ae=re&&ie;if(E){let t=D.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=En(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=xa(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,L.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?ge(Ft(r.image?.filters))??``:``,I.style.width=`100%`,I.style.height=`100%`,L.style.width=`100%`,L.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},L.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,L.appendChild(t),o.allowLottie?Ir().then(function(n){let r=typeof D==`string`&&(D.startsWith(`http`)||D.endsWith(`.json`)||D.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?D.trim():void 0,animationData:r?void 0:JSON.parse(D)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),j.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),j.style.display=`none`)}else if(C){I.style.width=`100%`,I.style.height=`100%`,L.style.width=`100%`,L.style.height=`100%`,L.style.display=`flex`,L.style.alignItems=`center`,L.style.justifyContent=`center`,L.style.pointerEvents=`none`;let t=Ha(r,o.lang,S),n=ur(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=Ua(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&L.appendChild(e)}else L.innerHTML=i}else if(ee){let e=L;if(ae){let t=document.createElement(`div`);t.className=`oim-slot-text`,L.appendChild(t),e=t}let t=Tn(D);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=L;if(ae){let t=document.createElement(`div`);t.className=`oim-slot-text`,L.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};Za(e,c.highlight);let l=c.marks,u=br(D,l);s===`wave-chars`&&!o.disableAnimations?(qa(o.host.shadowRoot),Wa(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):Ar(s)&&!o.disableAnimations?(Ka(o.host.shadowRoot,s),Ga(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,Ya(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,Xa(e,u,s,a.speed,a.delay,a.intensity)):Qa(e,D,c.dropCap,l)||xr(e,D,l)}I.appendChild(L);let oe=r.motion?.loop,z=oe?{enabled:!0,speedPxSec:oe.speedPxSec,direction:oe.direction,mirror:oe.mirror??!0,pauseOnHover:!!oe.pauseOnHover}:void 0,se=!1;if(z&&z.enabled){let e=z.infinite||{},t=e.enabled===!1||o._isStill()?0:z.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?z.mode===`infinite_horizontal`?z.speed===void 0?20:z.speed:0:e.speed_px_sec:e.speedPxSec:z.speedPxSec,n=z.direction||e.direction||`right_to_left`,i=z.mirror===void 0?z.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!z.seamlessTile:!!z.mirror,a=z.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!z.pauseOnHover,s=ma({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||f||f,f);if(s.duplicate){se=!0,ha(o.host.shadowRoot);let e=document.createElement(`div`);e.className=`${ua} ${da}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?I:I.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}j.appendChild(e)}}se||j.appendChild(I);let ce=r.geometry?.trim,le=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),ue=e=>+(e*100).toFixed(6),de=ce||le?{strokeWidth:1,trimStart:ue(ce?.start??0),trimEnd:ue(ce?.end??1),trimDuration:le?+(le.duration/1e3).toFixed(6):0}:void 0;ee&&de&&(de.trimDuration&&Ki(o.host.shadowRoot),qi(L,de));let B=xt(r,o.lang),V={lineHeight:r.text?.lineHeight},fe=B?.fontSize??`16px`,pe=B?.fontFamily,me=T?`none`:B?.maxWidth??(r.type===`text`&&!E?`80%`:`none`),he=C||!E&&!O&&t!==`lottie`&&D.trim()!==``;if(pe&&he){let e=An(pe),t=ur(e,o.embeddedFontFamilies);j.style.setProperty(`font-family`,t||e)}if(A=se||k===`left`?`flex-start`:k===`right`?`flex-end`:`center`,j.style.maxWidth=me,j.style.fontSize=fe,j.style.lineHeight=String(ka(V)),B)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])B[e]&&(j.style[e]=B[e]);if(t===`text`&&ne){let e=`kind`in ne&&ne.kind===`color`?b.css(ne.value):``;e&&j.style.setProperty(`color`,e)}if(R){if(ae){I.style.position=`absolute`,I.style.top=`0`,I.style.left=`0`,I.style.right=`0`,I.style.bottom=`0`,I.style.width=`100%`,I.style.height=`100%`,L.style.width=`100%`,L.style.height=`100%`,L.style.boxSizing=`border-box`,L.style.setProperty(`padding-right`,`0.25em`,`important`),L.style.display=`flex`,L.style.flexDirection=`column`,L.style.justifyContent=`center`,L.style.alignItems=A,Object.assign(L.style,R);let e=ja(ka(V));e>0&&(j.style.setProperty(`padding-top`,e+`em`,`important`),j.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(j.style,R),re){let e=ja(ka(V));e>0&&(j.style.setProperty(`padding-top`,e+`em`,`important`),j.style.setProperty(`padding-bottom`,e+`em`,`important`))}}j.style.textAlign=k,j.style.display=`flex`,j.style.flexDirection=`column`,j.style.justifyContent=`center`,j.style.alignItems=A,j.style.opacity=`0`,j.style.transition=`opacity 0.3s ease`,j.style.whiteSpace=`pre-line`,j.style.overflow=Ma({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(co)});let _e=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);_&&Na(j),a.width!==void 0&&a.height!==void 0?(j.style.width=(a.width/_e*100).toFixed(4)+`cqw`,j.style.height=(a.height/_e*100).toFixed(4)+`cqw`):(j.style.width=`max-content`,j.style.height=`auto`);let H=r.fills?.[0],U=H&&`kind`in H?H.kind:void 0,W=Vr(r.type===`shape`?r.geometry:void 0),ye=(t===`svg`||O)&&!x&&(U===`pattern`||U===`generative`),be=w&&!x&&U===`image`?String(H.src||``).trim():``,G=!!be&&En(be),xe=ye||(t===`geo`||t===`shape`)&&!x&&(G||U===`gradient`||U===`generative`||U===`pattern`&&!T),Se=r.fills?.[1],Ce=U===`image`&&Se?.kind===`color`?b.css(Se.value):void 0,we=U===`color`?b.css(H.value):G?void 0:Ce,Te=r?.type===`shape`&&r.geometry?.kind===`paths`;we&&w&&!x&&t!==`text`&&!C&&!xe&&!Te&&j.style.setProperty(`background-color`,we);let Ee=t===`svg`||O||r.geometry?.kind===`paths`||w&&!!W.silhouette,De=y.get(String(e.id)),K=De?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),q=De?.type===`text`?{color:``,width:0,style:void 0}:K?{color:b.css(K.paint.value)||``,width:K.width,style:K.style}:{color:``,width:0,style:void 0};q.color&&q.width&&!x&&!Ee&&j.style.setProperty(`border`,`${q.width}px ${q.style||`solid`} ${q.color}`),be&&!G&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let J=w&&!x?W.silhouette:null;if(J){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,J.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,J.points?`polygon`:`path`);J.points?n.setAttribute(`points`,J.points):n.setAttribute(`d`,J.d);let r=W.fillable,i=r&&G;n.setAttribute(`fill`,r&&we&&!xe&&!i?we:`none`);let a=K?q.width:0,o=K?q.color:``;a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),q.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):q.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),j.appendChild(t),i&&Ta(j,H,{d:J.d??`M `+J.points.split(` `).join(` L `)+` Z`,viewBox:J.viewBox},be,Ce),j.style.backgroundColor=`transparent`,j.style.padding=`0`,j.style.overflow=`visible`}else w&&!x&&W.round&&(j.style.borderRadius=`50%`);if(G&&!J){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||f,n=r.box.height||p;Ta(j,H,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},be,Ce)}if(xe){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.borderRadius=`inherit`;let t={...H?yt(H,{colors:b,width:r.box.width||f,height:r.box.height||p}):{},...G&&Se?.kind===`color`&&S(Se.value)?{backgroundColor:S(Se.value)}:{},...ye?ut(D):ct(W.round?`circle`:W.preset,W.path?{svgPath:W.path.d,svgViewBox:W.path.viewBox}:void 0)};ye&&!I.style.position&&(I.style.position=`relative`);for(let[n,r]of Object.entries(t))n.startsWith(`--`)?e.style.setProperty(n,r):e.style[n]=r;j.insertBefore(e,j.firstChild)}if(x){j.style.overflow=`visible`,j.style.display=`block`,j.style.setProperty(`padding`,`0`,`important`);let t=H??{kind:`color`,value:`#38BDF8`},n=t.kind===`image`?String(t.src||``).trim():``,r=!!n&&En(n);n&&!r&&console.warn(`[OimPlayer] Frame image not embedded in the file (network URLs are not loaded), slot:`,e.id);let i=to(e,{width:f,height:p},{css:t.kind===`image`?Ce?{backgroundColor:Ce}:{}:yt(t,{colors:b,width:f,height:p}),photo:r?{paint:t,src:n,underColor:Ce}:void 0});j.appendChild(i),hi(e)||ro(String(e.id))}(!he&&!x||se)&&j.style.setProperty(`padding`,`0`,`important`);let Oe=g.get(String(e.id)),ke=null;{let e=a;j.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=se||k===`left`?`0%`:k===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;j.style.left=(e.x+e.width*n).toFixed(2)+`px`,n>0&&he&&!C&&(j.style.left=`calc(${j.style.left} + ${.25*n}em)`),j.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=Ht(e),se&&(t=`0%`),j.style.left=e.x.toFixed(2)+`px`,j.style.top=e.y.toFixed(2)+`px`;j.style.setProperty(`--oim-tx`,t),j.style.setProperty(`--oim-ty`,n),j.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),ke={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let Y=ve(e)&&!T&&ke?Ea(ke,{width:f,height:p}):null;T&&(j.style.left=`0`,j.style.top=`0`,j.style.width=`100%`,j.style.height=`100%`,j.style.maxWidth=`none`,j.style.maxHeight=`none`,j.style.padding=`0`,j.style.boxSizing=`border-box`,j.style.setProperty(`--oim-tx`,`0%`),j.style.setProperty(`--oim-ty`,`0%`),j.style.setProperty(`--oim-rot`,`0deg`));let Ae=y.get(String(e.id))?.type===`text`?(()=>{let t=y.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:b.css(t.paint.value)||``}:void 0})():void 0;Ae&&(j.style.setProperty(`-webkit-text-stroke`,Ae.width+`px `+Ae.color),j.style.setProperty(`paint-order`,`stroke fill`));let je=e=>{let n=la[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&b.css(o.value)||`#18181b`,c=o?.kind===`gradient`?yt(o,{colors:b}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(j.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,j.style.backgroundRepeat=`repeat, no-repeat`,j.style.backgroundSize=i+`px `+a+`px, 100% 100%`,j.style.backgroundBlendMode=l+`, normal`):(j.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,j.style.backgroundRepeat=`repeat, no-repeat`,j.style.backgroundSize=i+`px `+a+`px, 100% 100%`,j.style.backgroundBlendMode=l),j.style.webkitBackgroundClip=`text`,j.style.backgroundClip=`text`,j.style.webkitTextFillColor=`transparent`,j.style.color=`transparent`;let u=ja(ka(V));u>0&&(j.style.setProperty(`padding-top`,u+`em`,`important`),j.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=Tr({type:t,svg:O?D:void 0,image:E?D.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}j.appendChild(r)}}},Me=e=>{j.style.filter=(j.style.filter?j.style.filter+` `:``)+e},Ne=e=>{j.style.textShadow=j.style.textShadow?j.style.textShadow+`, `+e:e},X=Lt(r.effects,{isText:t===`text`,grainable:Zi.includes(t),layerId:String(e.id),colorCss:e=>b.css(e)});X.filter&&Me(X.filter),X.textShadow&&Ne(X.textShadow);for(let e of X.defs)e.kind===`grain`?o._defineLayerGrain(e.id,e.effect):e.kind===`texture`&&je({...e.effect,color:e.effect.color===void 0?void 0:S(e.effect.color)});let Pe=r.opacity??1;if(j.dataset.oimOpacity=String(Pe),j.style.setProperty(`--oim-target-opacity`,String(Pe)),r.visible===!1&&(j.style.display=`none`,j.style.opacity=`0`,j.style.pointerEvents=`none`),t===`filter`){let t=X.defs.some(e=>e.kind===`duotone`)?`url(#`+bi(e)+`)`:X.backdropFilter;t&&(j.style.backdropFilter=t,j.style.webkitBackdropFilter=t),Object.assign(j.style,vi(W.round?`circle`:W.preset,{width:r.box.width||0,height:r.box.height||0}))}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?yt(n,{colors:b,width:e,height:t}):{};Object.assign(j.style,i)}let Fe=r.corners;if(Fe!==void 0&&!W.round&&(j.style.borderRadius=(Array.isArray(Fe)?Fe:[Fe]).map(e=>e+`px`).join(` `)),Y){j.style.left=Y.left,j.style.top=Y.top,j.style.width=Y.width,j.style.height=Y.height,j.style.maxWidth=`none`,j.style.maxHeight=`none`,j.style.setProperty(`padding`,`0`,`important`),j.style.transformOrigin=Y.transformOrigin,j.style.pointerEvents=Y.pointerEvents,j.style.setProperty(`--oim-tx`,`0%`),j.style.setProperty(`--oim-ty`,`0%`),j.style.setProperty(`--oim-scale`,`1`);let t=!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop);j.style.overflow=t?`hidden`:`visible`,c(I,`data-oim-group`,`data-oim-grupo`,String(e.id)),I.style.transformOrigin=Y.transformOrigin,I.style.height=`100%`,I.style.overflow=`visible`}let Ie=r.animations?.find(co),Z=r.animations?.find(e=>e.on===`loop`&&e.preset),Le=r.animations?.find(e=>e.on===`hover`&&e.preset),Re=e=>e?+(e/1e3).toFixed(6):0,ze=Ie||Z||Le?{frames:Ie?po(Ie.tracks):void 0,duration:Ie?Re(Ie.duration):0,trigger:Ie?.on===`action`?`action`:void 0,loop:Z?.preset,loopDuration:Re(Z?.duration),loopDelay:Re(Z?.delay),hover:Le?.preset}:void 0;if(ze&&!o.disableAnimations){let t=ze;if(t.frames&&typeof I.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=I.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(I.classList.add(`oim-loop-`+t.loop),t.loopDuration&&I.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&I.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&L.classList.add(`oim-hover-`+t.hover)}let Be=r.animations?.find(e=>e.on===`hover`&&e.tracks),Ve=e=>{let t=Be?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},He=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),Ue={hover:{scale:Ve(`scale`),rotation:Ve(`rotation`),opacity:Ve(`opacity`)===void 0?void 0:+(Ve(`opacity`)*100).toFixed(6),transitionDuration:Be&&Be.duration>0?+(Be.duration/1e3).toFixed(6):void 0,actions:He(`hover`)},active:{actions:He(`press`)}};if(!o.disableActions&&(Be||r.interactions?.length)){let t={},n={},r=new Set;Pa(j,Ue,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=La(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}C&&(j.style.backgroundColor=`transparent`,j.style.overflow=`visible`,j.style.setProperty(`padding`,`0`,`important`));let We=Sa(a.flipX,a.flipY);if(We){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+We[0]+`, `+We[1]+`)`;j.firstChild;)e.appendChild(j.firstChild);j.appendChild(e)}return{slotEl:j,zoneId:Oe,slot:e}}),w=await Promise.all(C),T=[],E=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?E.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),E.add(r),T.push(r)});let D=new Map;w.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&h[r]?h[r].appendChild(n):D.set(T[t],n)});let O=[];s.forEach(function(e,t){let n=g.get(String(e.id));n&&h[n]||O.push({id:T[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&y.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let ee=Ci(O),k=O.some(function(e){return e.type===`mask`}),A=O.some(function(e){return!!e.duotone});if((k||A)&&m.appendChild(io(O,{width:f,height:p})),ee.forEach(function(e){ao(e,m,D)}),n?w.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(m)),v.size>0){let e=function(e){for(let t in h)if(h[t]&&h[t].contains(e))return!0;return!1};v.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(d)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0,o.sceneReady())}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=ea(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,oo)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=Bi(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=zi(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=ya((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,ba(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=kt(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=Ot(n,r.lang),o=n.type===`text`?xt(Bt(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function co(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>lo[e.property]!==void 0)}var lo={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},uo=[`x`,`y`,`rotation`,`scale`];function fo(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function po(e){let t=t=>e.find(e=>e.property===t),n=uo.some(e=>t(e)),r=new Map;for(let t of e)if(lo[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=Li(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>fo(t(n),e.offset,lo[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}function mo(e){if(!G(e))return e;let t=Ce(e);return t.missing.forEach(e=>console.warn(`[OimPlayer] resource "${e}" is not in the document`)),Xt(t.document)}var ho=class extends so{fileMetadata=null;_posterFade=!1;constructor(e,t){super();let n=t||{};this.host=e,this.poster=n.poster===`only`?`only`:`auto`,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous"`+(typeof e==`string`?``:` src="`+this.imageUrl+`"`)+` alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,I(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of ie)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,l=this._viewport;function d(){l&&o&&o.naturalWidth>0&&(l.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}if(o&&o.complete&&o.naturalWidth>0?d():o&&(o.onload=d),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),typeof e==`string`&&o){let i=await P.readPoster(e);if(i){let e=await Kn(i.seal,i.imageHash);if(e===`invalid`){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,I(n);let e=n.querySelector(`.oim-player-error`);return e&&(e.textContent=u(`tampered`,r.lang)),t.dispatchEvent(new CustomEvent(`error`,{detail:Error(Wn)})),!1}if(e===`expired_key`)try{c(t,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}if(this.imageUrl=URL.createObjectURL(i.png),o.src=this.imageUrl,this.poster===`only`)return this.securityStatus=e===`ok`?`verified`:`expired_key`,l?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),t.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:null,security:this.securityStatus}})),!0}else o.src=e}return P.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,I(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await _n(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=Gn(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await Bn(t.metadata),a=Vn({isSigned:r,isSigValid:i,keyExpired:r&&i?await Hn(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(Un(a))return{refused:!0,security:a,error:Wn+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,G(t.metadata)||L(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await fn(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this,n=this.poster===`only`;this._posterFade=!n&&G(e.metadata)&&!Se(e.metadata);let r=structuredClone(e.metadata);if(this.fileMetadata=r,this.metadata=n?structuredClone(r):mo(structuredClone(r)),n||this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return n?(this._viewport?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0):(e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await lr(cr(this.metadata)),this._posterFade&&this._viewport?.classList.add(`oim-viewport--poster`),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0)}sceneReady(){let e=this._baseImg;this._posterFade&&e&&(this._posterFade=!1,this._prefersLessMotion()?e.style.display=`none`:(e.classList.add(`oim-base--faded`),setTimeout(()=>{e.style.display=`none`},200)))}async _executeLoad(e,t){try{let n=await P.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=nr(e,{version:Qn,capabilities:$n})}catch{return}if(!t.hasNotice)return;let n=rr(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=$a(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=$a(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(Zn(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function go(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function _o(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function vo(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){vo(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`poster`)&&(this._oimOptions.poster=this.getAttribute(`poster`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n._engine?n._engine.metadata:null;if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`poster`&&t!==n)this._oimOptions||={},this._oimOptions.poster=n,this._engine&&this._initPlayer();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:_o(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`poster`)&&(e._oimOptions.poster=e.getAttribute(`poster`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):P.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=go(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new ho(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.fileMetadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var yo=[`src`,`placeholder`,`poster`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=yo,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var bo={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},xo=bo.mount;return window.OimPlayer=bo,e.OimPlayer=bo,e.default=bo,e.OimPlayerElement=Q,e.mount=xo,e})({});
|
|
91
|
+
</svg>`}function qa(e,t,n,r){e.textContent=``;let i=Array.from(t);for(let t=0;t<i.length;t++){let a=i[t];if(a===`
|
|
92
|
+
`){e.appendChild(document.createElement(`br`));continue}let o=document.createElement(`span`);o.textContent=a===` `?`\xA0`:a,o.style.display=`inline-block`,o.style.animationName=ji,o.style.animationDuration=Ai+`s`,o.style.animationTimingFunction=`linear`,o.style.animationIterationCount=`infinite`,o.style.animationDelay=Ni(t,n,r)+`s`,e.appendChild(o)}}function Ja(e,t,n,r,i){e.textContent=``,Fr(t,n).forEach((t,a)=>{if(/^\s+$/.test(t)){e.appendChild(document.createTextNode(t));return}let o=document.createElement(`span`);o.textContent=t,o.className=`oim-entrance`;let s=o.style;if(s.display=`inline-block`,s.animation=`oim-entrance-${n} ${Ar}s linear ${Ir(a,r,i)}s both`,!Pr(n)){e.appendChild(o);return}let c=document.createElement(`span`);c.className=`oim-entrance-clip`,c.style.display=`inline-block`,c.style.overflow=`hidden`,c.style.verticalAlign=`top`,c.appendChild(o),e.appendChild(c)})}function Ya(e,t){if(!e)return;let n=`oim-entrance-`+t;if(e.getElementById(n))return;let r=Rr(t),i=r.some(e=>e.rotateDeg!==0),a=r.map((e,t)=>`${t*100/(r.length-1)}%{opacity:${e.opacity};transform:translateY(${e.translateYEm}em) scale(${e.scale})${i?` rotate(${e.rotateDeg}deg)`:``}}`).join(``),o=document.createElement(`style`);o.id=n,o.textContent=`@keyframes ${n}{${a}}@media (prefers-reduced-motion: reduce){.oim-entrance{animation:none!important}}`,e.appendChild(o)}function Xa(e){if(!e)return;let t=`oim-wave-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=Mi(),e.appendChild(n)}function Za(e,t,n){let r=0,i=performance.now(),a=null,o=()=>r+(a===null?0:performance.now()-i),s=()=>t(o()/1e3),c=()=>{a===null&&(i=performance.now(),a=setInterval(s,e))},l=()=>{a!==null&&(r=o(),clearInterval(a),a=null)};return c(),{pause:l,play:c,stop:()=>{l(),n?.()}}}function Qa(e,t,n=20,r=0,i=!0){let a=a=>{let o=Wi(t,a,n,r,i,!1);e.textContent=o.visibleText+(o.showCursor?`|`:``)};return a(0),Za(40,a)}function $a(e,t,n,r=1,i=0,a=50){e.textContent=``,e.style.display=`inline-block`,e.style.position=`relative`;let o=()=>{let e=document.createElement(`span`);return e.textContent=t,e},s=Ri(n,Li(0)).copies.map(e=>{let t=o();t.setAttribute(`aria-hidden`,`true`);let n=t.style;return n.position=`absolute`,n.left=`0`,n.top=`0`,n.width=`100%`,n.height=`100%`,n.pointerEvents=`none`,n.opacity=`0`,e.color&&(n.color=e.color),t}),c=o();c.style.position=`relative`,n===`glitch-slice`?e.append(c,...s):e.append(...s,c);let l=t=>{let o=Ri(n,Li(t,r,i,a));e.style.transform=o.skewX?`skewX(${o.skewX}deg)`:`none`,o.copies.forEach((e,t)=>{let n=s[t].style;n.opacity=String(e.opacity),n.transform=`translate(${e.dx}px, ${e.dy}px)`,e.clip&&(n.clipPath=`inset(${e.clip.top}% 0 ${100-e.clip.bottom}% 0)`)})};return Za(33,l,()=>l(0))}function eo(e,t){if(!t?.enabled)return;let n=t.color||`rgba(245,158,11,.35)`,r=t.style===`underline-thick`,i=e.style;i.backgroundColor=r?`transparent`:n,r&&(i.boxShadow=`inset 0 -.4em 0 ${n}`),i.borderRadius=t.style===`pill`?`9999px`:t.style===`box`?`0`:`${t.borderRadius??3}px`,i.padding=`${t.paddingY??2}px ${t.paddingX??4}px`,i.boxDecorationBreak=i.webkitBoxDecorationBreak=`clone`}function to(e,t,n,r){if(!n?.enabled||!t)return!1;let{letter:i,rest:a}=Er(t,Object.keys(r??{}));if(!i)return!1;let o=document.createElement(`span`),s=o.style,c=Tr(n);return o.textContent=i,s.float=`left`,s.fontSize=`${c.scale}em`,s.lineHeight=String(c.lineHeight),s.marginRight=`${c.marginRight}px`,c.fontFamily&&(s.fontFamily=c.fontFamily),c.color&&(s.color=c.color),s.fontWeight=String(c.fontWeight),s.userSelect=`none`,wr(e,a,r),e.prepend(o),!0}function no(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)}function ro(e,t){let n=(e||``).replace(`#`,``),r=parseInt(n.substring(t*2,t*2+2),16)||0;return Math.round(r/255*1e3)/1e3}function io(e,t,n){let r=`http://www.w3.org/2000/svg`,i=t.width,a=t.height,o=e.style||{},s=yi(e,t),{x:c,y:l}=ui(e,t),u=document.createElement(`div`);u.className=`oim-mask-frame`,u.style.position=`absolute`,u.style.left=-c+`px`,u.style.top=-l+`px`,u.style.width=i+`px`,u.style.height=a+`px`,u.style.flex=`none`,u.style.display=`block`,u.style.pointerEvents=`none`;let d=document.createElement(`div`);d.className=`oim-mask-paint`,d.style.position=`absolute`,d.style.left=`0`,d.style.top=`0`,d.style.width=`100%`,d.style.height=`100%`,d.style.pointerEvents=`none`;for(let[e,t]of Object.entries(n.css))e.startsWith(`--`)?d.style.setProperty(e,t):d.style[e]=t;d.style.clipPath=`path(evenodd, "${s}")`,u.appendChild(d),n.photo&&Oa(d,n.photo.paint,{d:`M0 0H${i}V${a}H0Z`,viewBox:`0 0 ${i} ${a}`},n.photo.src,n.photo.underColor);let f=o.maskStrokeWidth??0,p=bi(e,t);if(f>0){let e=document.createElementNS(r,`svg`);e.setAttribute(`viewBox`,`0 0 `+i+` `+a),e.setAttribute(`preserveAspectRatio`,`none`),e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=i+`px`,e.style.height=a+`px`,e.style.overflow=`visible`,e.style.pointerEvents=`none`;let t=document.createElementNS(r,`path`);t.setAttribute(`d`,p),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,z(o.maskStrokeColorRole||o.strokeColorRole,o.maskStrokeColor||`#FFFFFF`)),t.setAttribute(`stroke-width`,String(f)),t.setAttribute(`stroke-linejoin`,`round`),e.appendChild(t),u.appendChild(e)}return u}var ao=!1;function oo(e){ao||(ao=!0,console.warn(`[OimPlayer] A mask outline cannot be drawn (unknown shape and no path); the mask falls back to its box, slot:`,e))}function so(e,t){let n=`http://www.w3.org/2000/svg`,r=document.createElementNS(n,`svg`);r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`style`,`position:absolute`),r.setAttribute(`aria-hidden`,`true`);let i=document.createElementNS(n,`defs`);return r.appendChild(i),e.forEach(function(e){let r=e.style||{};if(e.type===`mask`&&r.maskMode===`cutout`){let a=r.maskFeather,o=Ti(e,t);if(vi(e)||oo(String(e.id)),a&&a>0){let r=wi(e)+`-blur`,s=document.createElementNS(n,`filter`);s.setAttribute(`id`,r),s.setAttribute(`filterUnits`,`userSpaceOnUse`),s.setAttribute(`x`,`0`),s.setAttribute(`y`,`0`),s.setAttribute(`width`,String(t.width)),s.setAttribute(`height`,String(t.height));let c=document.createElementNS(n,`feGaussianBlur`);c.setAttribute(`stdDeviation`,String(a)),s.appendChild(c),i.appendChild(s);let l=document.createElementNS(n,`mask`);l.setAttribute(`id`,wi(e)),l.setAttribute(`maskUnits`,`userSpaceOnUse`);let u=document.createElementNS(n,`rect`);u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,String(t.width)),u.setAttribute(`height`,String(t.height)),u.setAttribute(`fill`,`black`),l.appendChild(u);let d=document.createElementNS(n,`g`);d.setAttribute(`filter`,`url(#`+r+`)`);let f=document.createElementNS(n,`path`);f.setAttribute(`d`,o),f.setAttribute(`fill`,`white`),f.setAttribute(`clip-rule`,`evenodd`),f.setAttribute(`fill-rule`,`evenodd`),d.appendChild(f),l.appendChild(d),i.appendChild(l)}else{let t=document.createElementNS(n,`clipPath`);t.setAttribute(`id`,li(e)),t.setAttribute(`clipPathUnits`,`userSpaceOnUse`);let r=document.createElementNS(n,`path`);r.setAttribute(`d`,o),r.setAttribute(`clip-rule`,`evenodd`),t.appendChild(r),i.appendChild(t)}}if(e.type===`filter`&&e.duotone){let t=document.createElementNS(n,`filter`);t.setAttribute(`id`,Ci(e)),t.setAttribute(`color-interpolation-filters`,`sRGB`);let r=document.createElementNS(n,`feColorMatrix`);r.setAttribute(`type`,`matrix`),r.setAttribute(`values`,`0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 1 0`),t.appendChild(r);let a=document.createElementNS(n,`feComponentTransfer`);[`R`,`G`,`B`].forEach(function(e,t){let r=document.createElementNS(n,`feFunc`+e);r.setAttribute(`type`,`table`);let i=t;r.setAttribute(`tableValues`,ro(Si.shadows,i)+` `+ro(Si.lights,i)),a.appendChild(r)}),t.appendChild(a),i.appendChild(t)}}),r}function co(e,t,n){let r=n.get(e.shape.id);r&&(e.clipPath&&(r.style.clipPath=e.clipPath),e.maskStyle&&(r.style.mask=e.maskStyle),t.appendChild(r))}var lo=1200,uo=class{updateScale(){}sceneReady(){}updateViewportSize(){}host;poster=`auto`;metadata=null;securityStatus=`unsigned`;embeddedFontFamilies=new Map;imageUrl=null;lang;showControls;activeSlotId=null;zoom=1;panX=0;panY=0;_stage=null;_viewport=null;_baseImg=null;_overlay=null;_lottieInstances=[];_onDragMove=null;_onDragEnd=null;_animations=[];_textAnimations=[];_paused=!1;_revealAnims=new Map;_timelines=new Map;_warnedPlay=new Set;_heldTimelines=new Set;_isStill(){let e=this.host;if(!this.disableAnimations||!e||typeof e.getAttribute!=`function`)return!1;let t=e.getAttribute(`disable-animations`);return t!==null&&t!==`false`||e.getAttribute(`mode`)===`image`}_resizeObserver=null;_onFullscreenChange=null;_retryViewportSize=!1;allowZoom;showLanguageSelector;showSlots;allowLottie;allowDynamicColors=!0;disableAnimations;disableActions;dropdownBlur;fit;align;_deviceProfile;applyPalette(){let e=this._viewport;if(!e)return;let t=typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches,n=this.allowDynamicColors?pe(this.metadata??{},{requested:this.host.getAttribute(`palette`),prefersDark:t}):null;for(let t of ae){let r=n?.colors[t];r?e.style.setProperty(`--oim-palette-`+t,r):e.style.removeProperty(`--oim-palette-`+t)}}async renderSlots(e){if(!this.metadata||!this.host||this.poster===`only`)return;let t=(this.metadata.slots||this.metadata.elements||[]).some(function(e){return e.type===`mask`||e.type===`filter`}),n=e&&e.onlyIds&&e.onlyIds.size>0&&!t?e.onlyIds:null;if(this._viewport&&!this._revealed&&this._viewport.classList.remove(`oim-viewport--ready`),!this.showSlots){this._overlay&&(this._overlay.innerHTML=``),this._viewport&&this._viewport.classList.add(`oim-viewport--ready`),this.sceneReady();return}n?this._destroyLottiesIn(n):this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]);let r=this._overlay;if(!r)return;let i=this._viewport?this._viewport.querySelector(`.oim-noise-overlay`):null,a=Array.isArray(this.metadata?.effects)?this.metadata.effects.find(e=>e&&e.type===`texture`&&e.enabled!==!1):null;if(a){let e=fa[a.preset];if(e){let t=i||document.createElement(`div`);t.className=`oim-noise-overlay`,t.style.position=`absolute`,t.style.inset=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.pointerEvents=`none`,t.style.mixBlendMode=a.blend||e.defaultBlend||`overlay`;let n=(a.intensity===void 0?e.defaultIntensity:a.intensity)/100;t.style.opacity=n.toFixed(2),t.style.zIndex=`999`;let r=a.scale||1,o=e.tileWidth*r,s=e.tileHeight*r;t.style.backgroundImage=`url("${e.getDataUri(a.color)}")`,t.style.backgroundRepeat=`repeat`,t.style.backgroundSize=`${o}px ${s}px`,!i&&this._viewport&&this._viewport.appendChild(t)}}else if(this.metadata&&this.metadata.grain&&this.metadata.grain.enabled){let e=this.metadata.grain,t=e.intensity??15,n=e.blendMode??`overlay`,r=e.baseFrequency??.8,a=i||document.createElement(`div`);a.className=`oim-noise-overlay`,a.style.position=`absolute`,a.style.inset=`0`,a.style.width=`100%`,a.style.height=`100%`,a.style.pointerEvents=`none`,a.style.mixBlendMode=n,a.style.opacity=(t/100).toFixed(2),a.style.zIndex=`999`;let o=`oim-global-noise-filter`,s=Qi(o,{intensity:t,baseFrequency:r,color:e.color}),c=`data:image/svg+xml;utf8,`+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs>${s}</defs><rect width="100%" height="100%" filter="url(#${o})"/></svg>`);a.style.backgroundImage=`url("${c}")`,!i&&this._viewport&&this._viewport.appendChild(a)}else i&&i.remove();let o=this,s=this.metadata.slots||this.metadata.elements||[],l=e=>{let t=String(e?.message??e);console.error(`[OimPlayer] A part of the player did not load; the work is shown without it.`,t),this.host.dispatchEvent(new CustomEvent(`oim:error`,{detail:{code:`chunk`,message:t}}))};await Pe().catch(l),await Br(Hr([this.metadata,Array.from(Ht(this.metadata).values())])).catch(l);let u=Ht(o.metadata);s.forEach(function(e){let t=e&&e.type===`mask`?u.get(String(e.id)):void 0;if(t){e.style={...e.style,...Gt(t,Ie(o.metadata))};let{x:n,y:r,width:i,height:a}=t.box;Object.assign(e,{x:n,y:r,width:i??0,height:a??0})}});let d=[],f=o.metadata&&(o.metadata.artboardWidth||o.metadata.canvasWidth||o.metadata.canvas_width)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_width||o.metadata.canvas.width:0)||(o._baseImg&&o._baseImg.naturalWidth>0?o._baseImg.naturalWidth:1080),p=o.metadata&&(o.metadata.artboardHeight||o.metadata.canvasHeight||o.metadata.canvas_height)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_height||o.metadata.canvas.height:0)||(o._baseImg&&o._baseImg.naturalHeight>0?Math.round(f*(o._baseImg.naturalHeight/o._baseImg.naturalWidth)):1920);r.style.setProperty(`--oim-overlay-w`,f+`px`),r.style.setProperty(`--oim-overlay-h`,p+`px`);let m=document.createDocumentFragment(),h={},g=new Map,_=Ht(o.metadata);(this.metadata.zones||[]).forEach(e=>{let t=_.get(String(e?.id));if(!t||t.type!==`group`)return;let n=document.createElement(`div`);n.className=`oim-zone`,n.id=`oim-zone-`+t.id,n.style.position=`absolute`,n.style.inset=`0`;let r=t.children?.find(e=>e.id===t.id+`__background`),i=r?.fills?.[0],a=t.effects?.find(e=>e.kind===`backdrop`)?.blur;if(r||a){let e=t.box,s=document.createElement(`div`);s.className=`oim-zone-box`,s.style.position=`absolute`,s.style.left=e.x+`px`,s.style.top=e.y+`px`,s.style.width=(e.width??0)+`px`,s.style.height=(e.height??0)+`px`,i&&`kind`in i&&i.kind===`color`&&(s.style.background=Ie(o.metadata).css(i.value)||``),typeof r?.corners==`number`&&(s.style.borderRadius=r.corners+`px`),a&&(s.style.backdropFilter=`blur(`+a+`px)`,s.style.webkitBackdropFilter=s.style.backdropFilter),n.appendChild(s)}m.appendChild(n),h[t.id]=n;for(let e of t.children??[])g.set(e.id,t.id)});let v=Se(s),y=Ht(o.metadata),b=Ie(o.metadata),x=o.metadata.canvasFills?.[0];if(x&&o._overlay&&!n){let e=xt(x,{colors:b,width:o.metadata.canvas_width,height:o.metadata.canvas_height});for(let[t,n]of Object.entries(e))o._overlay.style[t]=n}let S=e=>e&&typeof e==`object`&&typeof e.fallback==`string`?b.literal(e.fallback):b.literal(e),C=s.map(async e=>{let t=e.type,r=y.get(String(e.id));if(n&&!n.has(String(e.id)))return null;let i=e.style||{};if(e.tracking_data,t===`mask`&&i.maskMode===`cutout`){let t=g.get(String(e.id));return t&&h[t]&&console.warn(`[OimPlayer] Slot "`+e.id+`" is a mask layer inside zone "`+t+`". Mask layers are only supported in the top-level slot stack, so this one will neither render nor clip anything. Move it out of the zone.`),null}if(!r)return console.warn(`[OimPlayer] Slot "`+e.id+`" has no 2.0 layer; it is not painted.`),null;let a=r.box,s=At(e,o.lang),l=r.type===`text`?r.text?.content:void 0,u=t===`image`?r.image:void 0,d=r.type===`shape`&&r.geometry?.kind===`paths`&&!Wr(r.geometry).path?r.geometry:void 0,m=l?Tt(l,o.lang):u?Kt(u.src,o.lang):d&&!Dt(e)?Yt(d,Xt(r)?{...Zt(r,b.css),fill:`none`}:Zt(r,b.css)):r.type===`lottie`?r.lottie?.src??``:s.content,_=!o.disableActions&&(!!r.interactions?.length||!!r.animations?.some(e=>e.on===`hover`||e.on===`press`)),x=t===`mask`&&i.maskMode!==`cutout`,C=t===`artistic-text`,w=t===`geo`||t===`shape`||t===`draw`||t===`filter`||t===`container`||x||_||C,T=e.is_background_pattern===!0||e.id===`background-pattern-slot`;if(!(t===`group`&&v.has(String(e.id)))&&!(t===`pattern`||T)&&!m&&!(w&&(r.fills?.length||a.width!==void 0||t===`filter`||t===`container`||x||_||C)))return null;let E=Et(e,m),D=m,O=!1;E||(/<svg|<span|<div|<a|<img/i.test(D)&&(D=D.replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`)),O=!!d&&!Dt(e));let ee=!E&&(O||/<svg|<span|<div|<a|<img/i.test(D));D=D.replace(/\\n/g,`
|
|
93
|
+
`);let k=r.type===`text`?r.text?.align??`left`:`left`,A=`center`;k===`left`?A=`flex-start`:k===`right`&&(A=`flex-end`);let j=document.createElement(`div`);j.className=`oim-slot`,j.setAttribute(`part`,`slot`),j.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(j.style.display=`none`),j.style.zIndex=T?`0`:`1`;let M=r.animations?.find(e=>e.on===`enter`&&e.preset);j._oimReveal=M?{effect:M.preset,duration:M.duration,easing:M.easing}:void 0;let te=!!r.interactions?.length;_||te&&!o.disableActions||j.setAttribute(`data-oim-passthrough`,``);let N=r.fills?.[0],P=N?.kind===`pattern`?N.pattern:void 0,ne=P?gt(P,b):{};if(T){j.style.pointerEvents=`none`;let e=d?Yt(d,Zt(r,b.literal),!0):``;if(e||P){if(Gi(j,ne,e),(P?.fit===`cover`?`cover`:`tile`)==`cover`)j.style.backgroundSize=`cover`,j.style.backgroundRepeat=`no-repeat`,j.style.backgroundPosition=`center`,j.style.setProperty(`--oim-pat-size`,`cover`),j.style.setProperty(`--oim-pat-repeat`,`no-repeat`),j.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(P?.scale||1)/f*100;j.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,j.style.backgroundRepeat=`repeat`,j.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=P?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(j.style.animation=n),D=``,O=!1}}if(t===`pattern`){let e=Wr(r.type===`shape`?r.geometry:void 0),t=pt({...ne,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?j.style.setProperty(e,n):j.style[e]=n;(ne.fillPatternColorRole||ne.fillPatternBgColorRole)&&Gi(j,ne,``)}let F=document.createElement(`div`);F.className=`oim-slot-loop-wrap`;let I=document.createElement(`div`);I.className=`oim-slot-hover-wrap`,(O||E||t===`lottie`||C)&&(F.style.height=`100%`,I.style.height=`100%`);let L=null,re=t===`text`?r.fills?.[0]:void 0;if(re){let e=xt(re,{colors:b,isText:!0,width:r.box.width||f,height:r.box.height||p});L=Object.keys(e).length>0?e:null}let ie=L!==null&&(L.backgroundClip===`text`||L.webkitBackgroundClip===`text`),ae=r.box.width!==void 0&&r.box.height!==void 0,oe=ie&&ae;if(E){let t=D.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=kn(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=wa(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,I.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?ve(Lt(r.image?.filters))??``:``,F.style.width=`100%`,F.style.height=`100%`,I.style.width=`100%`,I.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},I.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,I.appendChild(t),o.allowLottie?zr().then(function(n){let r=typeof D==`string`&&(D.startsWith(`http`)||D.endsWith(`.json`)||D.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?D.trim():void 0,animationData:r?void 0:JSON.parse(D)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),j.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),j.style.display=`none`)}else if(C){F.style.width=`100%`,F.style.height=`100%`,I.style.width=`100%`,I.style.height=`100%`,I.style.display=`flex`,I.style.alignItems=`center`,I.style.justifyContent=`center`,I.style.pointerEvents=`none`;let t=Ga(r,o.lang,S),n=pr(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=Ka(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&I.appendChild(e)}else I.innerHTML=i}else if(ee){let e=I;if(oe){let t=document.createElement(`div`);t.className=`oim-slot-text`,I.appendChild(t),e=t}let t=On(D);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=I;if(oe){let t=document.createElement(`div`);t.className=`oim-slot-text`,I.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};eo(e,c.highlight);let l=c.marks,u=Cr(D,l);s===`wave-chars`&&!o.disableAnimations?(Xa(o.host.shadowRoot),qa(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):Nr(s)&&!o.disableAnimations?(Ya(o.host.shadowRoot,s),Ja(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,Qa(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,$a(e,u,s,a.speed,a.delay,a.intensity)):to(e,D,c.dropCap,l)||wr(e,D,l)}F.appendChild(I);let se=r.motion?.loop,R=se?{enabled:!0,speedPxSec:se.speedPxSec,direction:se.direction,mirror:se.mirror??!0,pauseOnHover:!!se.pauseOnHover}:void 0,ce=!1,le;if(R&&R.enabled){let e=R.infinite||{},t=e.enabled===!1||o._isStill()?0:R.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?R.mode===`infinite_horizontal`?R.speed===void 0?20:R.speed:0:e.speed_px_sec:e.speedPxSec:R.speedPxSec,n=R.direction||e.direction||`right_to_left`,i=R.mirror===void 0?R.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!R.seamlessTile:!!R.mirror,a=R.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!R.pauseOnHover,s=_a({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||f||f,f);if(s.duplicate){ce=!0,va(o.host.shadowRoot);let e=le=document.createElement(`div`);e.className=`${pa} ${ma}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?F:F.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}j.appendChild(e)}}ce||j.appendChild(F);let ue=r.geometry?.trim,de=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),fe=e=>+(e*100).toFixed(6),pe=ue||de?{strokeWidth:1,trimStart:fe(ue?.start??0),trimEnd:fe(ue?.end??1),trimDuration:de?+(de.duration/1e3).toFixed(6):0}:void 0;ee&&pe&&(pe.trimDuration&&Yi(o.host.shadowRoot),Xi(I,pe));let z=Ct(r,o.lang),me={lineHeight:r.text?.lineHeight},he=z?.fontSize??`16px`,ge=z?.fontFamily,_e=T?`none`:z?.maxWidth??(r.type===`text`&&!E?`80%`:`none`),ye=C||!E&&!O&&t!==`lottie`&&D.trim()!==``;if(ge&&ye){let e=Nn(ge),t=pr(e,o.embeddedFontFamilies);j.style.setProperty(`font-family`,t||e)}if(A=ce||k===`left`?`flex-start`:k===`right`?`flex-end`:`center`,j.style.maxWidth=_e,j.style.fontSize=he,j.style.lineHeight=String(Ma(me)),z)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])z[e]&&(j.style[e]=z[e]);if(t===`text`&&re){let e=`kind`in re&&re.kind===`color`?b.css(re.value):``;e&&j.style.setProperty(`color`,e)}if(L){if(oe){F.style.position=`absolute`,F.style.top=`0`,F.style.left=`0`,F.style.right=`0`,F.style.bottom=`0`,F.style.width=`100%`,F.style.height=`100%`,I.style.width=`100%`,I.style.height=`100%`,I.style.boxSizing=`border-box`,I.style.setProperty(`padding-right`,`0.25em`,`important`),I.style.display=`flex`,I.style.flexDirection=`column`,I.style.justifyContent=`center`,I.style.alignItems=A,Object.assign(I.style,L);let e=Pa(Ma(me));e>0&&(j.style.setProperty(`padding-top`,e+`em`,`important`),j.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(j.style,L),ie){let e=Pa(Ma(me));e>0&&(j.style.setProperty(`padding-top`,e+`em`,`important`),j.style.setProperty(`padding-bottom`,e+`em`,`important`))}}j.style.textAlign=k,j.style.display=`flex`,j.style.flexDirection=`column`,j.style.justifyContent=`center`,j.style.alignItems=A,j.style.opacity=`0`,j.style.transition=`opacity 0.3s ease`,j.style.whiteSpace=`pre-line`,j.style.overflow=Fa({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(fo)});let be=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);_&&Ia(j),a.width!==void 0&&a.height!==void 0?(j.style.width=(a.width/be*100).toFixed(4)+`cqw`,j.style.height=(a.height/be*100).toFixed(4)+`cqw`):(j.style.width=`max-content`,j.style.height=`auto`);let B=r.fills?.[0],V=B&&`kind`in B?B.kind:void 0,H=Wr(r.type===`shape`?r.geometry:void 0),Se=(t===`svg`||O)&&!x&&(V===`pattern`||V===`generative`||V===`gradient`&&!!d),U=w&&!x&&V===`image`?String(B.src||``).trim():``,W=!!U&&kn(U),Ce=Se||(t===`geo`||t===`shape`)&&!x&&(W||V===`gradient`||V===`generative`||V===`pattern`&&!T),we=r.fills?.[1],Te=V===`image`&&we?.kind===`color`?b.css(we.value):void 0,Ee=V===`color`?b.css(B.value):W?void 0:Te,De=r?.type===`shape`&&r.geometry?.kind===`paths`;Ee&&w&&!x&&t!==`text`&&!C&&!Ce&&!De&&j.style.setProperty(`background-color`,Ee);let Oe=t===`svg`||O||r.geometry?.kind===`paths`||w&&!!H.silhouette,ke=y.get(String(e.id)),Ae=ke?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),G=ke?.type===`text`?{color:``,width:0,style:void 0}:Ae?{color:b.css(Ae.paint.value)||``,width:Ae.width,style:Ae.style}:{color:``,width:0,style:void 0};G.color&&G.width&&!x&&!Oe&&j.style.setProperty(`border`,`${G.width}px ${G.style||`solid`} ${G.color}`),U&&!W&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let K=w&&!x?H.silhouette:null;if(K){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,K.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,K.points?`polygon`:`path`);K.points?n.setAttribute(`points`,K.points):n.setAttribute(`d`,K.d);let r=H.fillable,i=r&&W;n.setAttribute(`fill`,r&&Ee&&!Ce&&!i?Ee:`none`);let a=Ae?G.width:0,o=Ae?G.color:``;if(a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),G.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):G.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),le){le.style.height=`100%`;for(let e of le.children)e.style.cssText+=`position:relative;height:100%`,e.append(t.cloneNode(!0))}else j.append(t);i&&Oa(j,B,{d:K.d??`M `+K.points.split(` `).join(` L `)+` Z`,viewBox:K.viewBox},U,Te),j.style.backgroundColor=`transparent`,j.style.padding=`0`,j.style.overflow=`visible`}else w&&!x&&H.round&&(j.style.borderRadius=`50%`);if(W&&!K){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||f,n=r.box.height||p;Oa(j,B,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},U,Te)}if(Ce){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.cssText=`position:absolute;inset:0;pointer-events:none;border-radius:inherit`;let t={...B?xt(B,{colors:b,width:r.box.width||f,height:r.box.height||p}):{},...W&&we?.kind===`color`&&S(we.value)?{backgroundColor:S(we.value)}:{},...Se?ft(D):ut(H.round?`circle`:H.preset,H.path?{svgPath:H.path.d,svgViewBox:H.path.viewBox}:void 0)};Se&&!F.style.position&&(F.style.position=`relative`);let n=t.animation&&t.maskImage,i=n?e.appendChild(document.createElement(`div`)):e;n&&(i.style.cssText=e.style.cssText);for(let[r,a]of Object.entries(t)){let t=n&&/mask/i.test(r)?e:i;r.startsWith(`--`)?t.style.setProperty(r,a):t.style[r]=a}j.insertBefore(e,j.firstChild)}if(x){j.style.overflow=`visible`,j.style.display=`block`,j.style.setProperty(`padding`,`0`,`important`);let t=B??{kind:`color`,value:`#38BDF8`},n=t.kind===`image`?String(t.src||``).trim():``,r=!!n&&kn(n);n&&!r&&console.warn(`[OimPlayer] Frame image not embedded in the file (network URLs are not loaded), slot:`,e.id);let i=io(e,{width:f,height:p},{css:t.kind===`image`?Te?{backgroundColor:Te}:{}:xt(t,{colors:b,width:f,height:p}),photo:r?{paint:t,src:n,underColor:Te}:void 0});j.appendChild(i),vi(e)||oo(String(e.id))}(!ye&&!x||ce)&&j.style.setProperty(`padding`,`0`,`important`);let je=g.get(String(e.id)),Me=null;{let e=a;j.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=ce||k===`left`?`0%`:k===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;j.style.left=(e.x+e.width*n).toFixed(2)+`px`,n>0&&ye&&!C&&(j.style.left=`calc(${j.style.left} + ${.25*n}em)`),j.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=Wt(e),ce&&(t=`0%`),j.style.left=e.x.toFixed(2)+`px`,j.style.top=e.y.toFixed(2)+`px`;j.style.setProperty(`--oim-tx`,t),j.style.setProperty(`--oim-ty`,n),j.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),Me={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let q=xe(e)&&!T&&Me?ka(Me,{width:f,height:p}):null;T&&(j.style.left=`0`,j.style.top=`0`,j.style.width=`100%`,j.style.height=`100%`,j.style.maxWidth=`none`,j.style.maxHeight=`none`,j.style.padding=`0`,j.style.boxSizing=`border-box`,j.style.setProperty(`--oim-tx`,`0%`),j.style.setProperty(`--oim-ty`,`0%`),j.style.setProperty(`--oim-rot`,`0deg`));let Ne=y.get(String(e.id))?.type===`text`?(()=>{let t=y.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:b.css(t.paint.value)||``}:void 0})():void 0;Ne&&(j.style.setProperty(`-webkit-text-stroke`,Ne.width+`px `+Ne.color),j.style.setProperty(`paint-order`,`stroke fill`));let Pe=e=>{let n=fa[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&b.css(o.value)||`#18181b`,c=o?.kind===`gradient`?xt(o,{colors:b}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(j.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,j.style.backgroundRepeat=`repeat, no-repeat`,j.style.backgroundSize=i+`px `+a+`px, 100% 100%`,j.style.backgroundBlendMode=l+`, normal`):(j.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,j.style.backgroundRepeat=`repeat, no-repeat`,j.style.backgroundSize=i+`px `+a+`px, 100% 100%`,j.style.backgroundBlendMode=l),j.style.webkitBackgroundClip=`text`,j.style.backgroundClip=`text`,j.style.webkitTextFillColor=`transparent`,j.style.color=`transparent`;let u=Pa(Ma(me));u>0&&(j.style.setProperty(`padding-top`,u+`em`,`important`),j.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=Or({type:t,svg:O?D:void 0,image:E?D.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}j.appendChild(r)}}},Fe=e=>{j.style.filter=(j.style.filter?j.style.filter+` `:``)+e},Ie=e=>{j.style.textShadow=j.style.textShadow?j.style.textShadow+`, `+e:e},J=zt(r.effects,{isText:t===`text`,grainable:ea.includes(t),layerId:String(e.id),colorCss:e=>b.css(e)});J.filter&&Fe(J.filter),J.textShadow&&Ie(J.textShadow);for(let e of J.defs)e.kind===`grain`?o._defineLayerGrain(e.id,e.effect):e.kind===`texture`&&Pe({...e.effect,color:e.effect.color===void 0?void 0:S(e.effect.color)});let Le=r.opacity??1;if(j.dataset.oimOpacity=String(Le),j.style.setProperty(`--oim-target-opacity`,String(Le)),r.visible===!1&&(j.style.display=`none`,j.style.opacity=`0`,j.style.pointerEvents=`none`),t===`filter`){let t=J.defs.some(e=>e.kind===`duotone`)?`url(#`+Ci(e)+`)`:J.backdropFilter;t&&(j.style.backdropFilter=t,j.style.webkitBackdropFilter=t),Object.assign(j.style,xi(H.round?`circle`:H.preset,{width:r.box.width||0,height:r.box.height||0}))}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?xt(n,{colors:b,width:e,height:t}):{};Object.assign(j.style,i)}let Re=r.corners;if(Re!==void 0&&!H.round&&(j.style.borderRadius=(Array.isArray(Re)?Re:[Re]).map(e=>e+`px`).join(` `)),q){j.style.left=q.left,j.style.top=q.top,j.style.width=q.width,j.style.height=q.height,j.style.maxWidth=`none`,j.style.maxHeight=`none`,j.style.setProperty(`padding`,`0`,`important`),j.style.transformOrigin=q.transformOrigin,j.style.pointerEvents=q.pointerEvents,j.style.setProperty(`--oim-tx`,`0%`),j.style.setProperty(`--oim-ty`,`0%`),j.style.setProperty(`--oim-scale`,`1`);let t=!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop);j.style.overflow=t?`hidden`:`visible`,c(F,`data-oim-group`,`data-oim-grupo`,String(e.id)),F.style.transformOrigin=q.transformOrigin,F.style.height=`100%`,F.style.overflow=`visible`}let Y=r.animations?.find(fo),ze=r.animations?.find(e=>e.on===`loop`&&e.preset),Be=r.animations?.find(e=>e.on===`hover`&&e.preset),Ve=e=>e?+(e/1e3).toFixed(6):0,He=Y||ze||Be?{frames:Y?go(Y.tracks):void 0,duration:Y?Ve(Y.duration):0,trigger:Y?.on===`action`?`action`:void 0,loop:ze?.preset,loopDuration:Ve(ze?.duration),loopDelay:Ve(ze?.delay),hover:Be?.preset}:void 0;if(He&&!o.disableAnimations){let t=He;if(t.frames&&typeof F.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=F.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(F.classList.add(`oim-loop-`+t.loop),t.loopDuration&&F.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&F.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&I.classList.add(`oim-hover-`+t.hover)}let Ue=r.animations?.find(e=>e.on===`hover`&&e.tracks),We=e=>{let t=Ue?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},Ge=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),Ke={hover:{scale:We(`scale`),rotation:We(`rotation`),opacity:We(`opacity`)===void 0?void 0:+(We(`opacity`)*100).toFixed(6),transitionDuration:Ue&&Ue.duration>0?+(Ue.duration/1e3).toFixed(6):void 0,actions:Ge(`hover`)},active:{actions:Ge(`press`)}};if(!o.disableActions&&(Ue||r.interactions?.length)){let t={},n={},r=new Set;La(j,Ke,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=Ba(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}C&&(j.style.backgroundColor=`transparent`,j.style.overflow=`visible`,j.style.setProperty(`padding`,`0`,`important`));let qe=Ta(a.flipX,a.flipY);if(qe){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+qe[0]+`, `+qe[1]+`)`;j.firstChild;)e.appendChild(j.firstChild);j.appendChild(e)}return{slotEl:j,zoneId:je,slot:e}}),w=await Promise.all(C),T=[],E=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?E.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),E.add(r),T.push(r)});let D=new Map;w.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&h[r]?h[r].appendChild(n):D.set(T[t],n)});let O=[];s.forEach(function(e,t){let n=g.get(String(e.id));n&&h[n]||O.push({id:T[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&y.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let ee=Ei(O),k=O.some(function(e){return e.type===`mask`}),A=O.some(function(e){return!!e.duotone});if((k||A)&&m.appendChild(so(O,{width:f,height:p})),ee.forEach(function(e){co(e,m,D)}),n?w.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(m)),v.size>0){let e=function(e){for(let t in h)if(h[t]&&h[t].contains(e))return!0;return!1};v.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(d)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0,o.sceneReady())}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=ra(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,lo)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=Ui(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=Hi(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=Sa((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,Ca(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=jt(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=At(n,r.lang),o=n.type===`text`?Ct(Ht(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function fo(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>po[e.property]!==void 0)}var po={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},mo=[`x`,`y`,`rotation`,`scale`];function ho(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function go(e){let t=t=>e.find(e=>e.property===t),n=mo.some(e=>t(e)),r=new Map;for(let t of e)if(po[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=Bi(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>ho(t(n),e.offset,po[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}function _o(e){if(!U(e))return e;let t=we(e);return t.missing.forEach(e=>console.warn(`[OimPlayer] resource "${e}" is not in the document`)),en(t.document)}var vo=class extends uo{fileMetadata=null;_posterFade=!1;constructor(e,t){super();let n=t||{};this.host=e,this.poster=n.poster===`only`?`only`:`auto`,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous"`+(typeof e==`string`?``:` src="`+this.imageUrl+`"`)+` alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,F(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of ae)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,l=this._viewport;function d(){l&&o&&o.naturalWidth>0&&(l.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}if(o&&o.complete&&o.naturalWidth>0?d():o&&(o.onload=d),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),typeof e==`string`&&o){let i=await P.readPoster(e);if(i){let e=await Yn(i.seal,i.imageHash);if(e===`invalid`){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,F(n);let e=n.querySelector(`.oim-player-error`);return e&&(e.textContent=u(`tampered`,r.lang)),t.dispatchEvent(new CustomEvent(`error`,{detail:Error(qn)})),!1}if(e===`expired_key`)try{c(t,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}if(this.imageUrl=URL.createObjectURL(i.png),o.src=this.imageUrl,this.poster===`only`)return this.securityStatus=e===`ok`?`verified`:`expired_key`,l?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),t.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:null,security:this.securityStatus}})),!0}else o.src=e}return P.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,F(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await bn(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=Jn(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await Un(t.metadata),a=Wn({isSigned:r,isSigValid:i,keyExpired:r&&i?await Gn(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(Kn(a))return{refused:!0,security:a,error:qn+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,U(t.metadata)||I(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await gn(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this,n=this.poster===`only`;this._posterFade=!n&&U(e.metadata)&&!Ce(e.metadata);let r=structuredClone(e.metadata);if(this.fileMetadata=r,this.metadata=n?structuredClone(r):_o(structuredClone(r)),n||this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return n?(this._viewport?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0):(e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await fr(dr(this.metadata)),this._posterFade&&this._viewport?.classList.add(`oim-viewport--poster`),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0)}sceneReady(){let e=this._baseImg;this._posterFade&&e&&(this._posterFade=!1,this._prefersLessMotion()?e.style.display=`none`:(e.classList.add(`oim-base--faded`),setTimeout(()=>{e.style.display=`none`},200)))}async _executeLoad(e,t){try{let n=await P.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=ar(e,{version:tr,capabilities:nr})}catch{return}if(!t.hasNotice)return;let n=or(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=no(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=no(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(er(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function yo(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function bo(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function xo(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){xo(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`poster`)&&(this._oimOptions.poster=this.getAttribute(`poster`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n._engine?n._engine.metadata:null;if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`poster`&&t!==n)this._oimOptions||={},this._oimOptions.poster=n,this._engine&&this._initPlayer();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:bo(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`poster`)&&(e._oimOptions.poster=e.getAttribute(`poster`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):P.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=yo(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new vo(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.fileMetadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var So=[`src`,`placeholder`,`poster`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=So,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var Co={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},wo=Co.mount;return window.OimPlayer=Co,e.OimPlayer=Co,e.default=Co,e.OimPlayerElement=Q,e.mount=wo,e})({});
|