@avatarfactory/react 0.1.40 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{AvatarProvider-Cll_r1hx.d.ts → AvatarProvider-CItqTL0v.d.ts} +3 -0
- package/dist/{AvatarProvider-BXaeG3PZ.d.mts → AvatarProvider-DqD003D2.d.mts} +3 -0
- package/dist/chunk-3SRQGZJ5.js +4 -0
- package/dist/chunk-6Q2I7WKW.mjs +16 -0
- package/dist/{chunk-YOMHPKHO.js → chunk-FDZA3OHI.js} +3 -3
- package/dist/chunk-WOQBPJGB.mjs +4 -0
- package/dist/embed/embed.js +5 -5
- package/dist/embed/meeting.js +14 -14
- package/dist/embed/runtime.js +14 -14
- package/dist/framer/index.framer.mjs +42 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/page.js +1 -1
- package/dist/page.mjs +1 -1
- package/dist/unstable.d.mts +2 -2
- package/dist/unstable.d.ts +2 -2
- package/dist/unstable.js +1 -1
- package/dist/unstable.mjs +1 -1
- package/package.json +6 -4
- package/dist/chunk-E7HVSIHB.mjs +0 -4
- package/dist/chunk-HRSHBEAW.js +0 -4
- package/dist/chunk-OANDIUVQ.mjs +0 -16
package/dist/embed/embed.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(){'use strict';var ce=["hmm","hmmm","mhm","mhmm","mm","mmm","uh","um","umm","uh huh","yeah","yep","ok","okay","right","haan","han","achha","accha","theek hai","theek"];function Hn(e){return e.replace(/(.)\1+/g,"$1")}new Set(ce.filter(e=>!e.includes(" ")).map(Hn));ce.filter(e=>e.includes(" "));var Un=/^([xy])=([+-]?)(\d{1,5})(%?)$/;var Wn=e=>{let t=Un.exec(e);if(!t)return null;let[,n,i,r,s]=t,o=Number(r);return !s&&o>2e4||s&&o>100?null:{axis:n,move:{value:i==="-"?-o:o,percent:s==="%",relative:i!==""}}},j=e=>{let t=e.split(",");if(t.length>2)return null;let n={};for(let i of t){let r=Wn(i.trim());if(!r||n[r.axis])return null;n[r.axis]=r.move;}return n.x||n.y?n:null};var oi=new Set(["read","retag","scroll","navigate","click","fill","submit"]);function ue(e,t){let{method:n,args:i}=t!=null?t:{};if(typeof n!="string"||!oi.has(n))throw new Error(`not a page surface method: ${String(n)}`);if(!Array.isArray(i))throw new Error("page surface call has no args");return e[n].apply(e,i)}var ai={happy:[{shape:"mouthSmile",weight:.8},{shape:"cheekSquint",weight:.2}],surprised:[{shape:"browInnerUp",weight:.25},{shape:"browOuterUp",weight:.25},{shape:"eyeWide",weight:.1},{shape:"jawOpen",weight:.4,mouth:true}],angry:[{shape:"browDown",weight:.85},{shape:"noseSneer",weight:.15}],sad:[{shape:"mouthFrown",weight:.55,mouth:true},{shape:"browInnerUp",weight:.45}]};[...new Set([...Object.values(ai).flatMap(e=>e.map(t=>t.shape)),"eyeBlink"])];var li={top:"top",middle:"middle",center:"middle",centre:"middle",bottom:"bottom"},ci=new Set(["up","down"]),de=e=>{let t=e.trim().toLowerCase();if(!t)return null;let n=li[t];if(n)return {kind:"edge",edge:n};if(ci.has(t))return {kind:"step",direction:t};let i=j(t);return i?{kind:"axis",...i}:null};var gi="af-call:",je=(e,t=()=>Date.now())=>{let n=`${gi}${e}`,i=()=>{var s;try{let o=JSON.parse((s=window.sessionStorage.getItem(n))!=null?s:"null");return o&&typeof o.token=="string"&&typeof o.at=="number"?o:null}catch(o){return null}},r=s=>{try{s?window.sessionStorage.setItem(n,JSON.stringify(s)):window.sessionStorage.removeItem(n);}catch(o){}};return {hold:s=>{var o;return r({token:s,at:t(),led:(o=i())==null?void 0:o.led})},markLed:()=>{let s=i();s&&r({...s,led:true});},drop:()=>r(null),take:()=>{let s=i();return r(null),!s||t()-s.at>3e5?null:{token:s.token,led:s.led===true}}}};var vi=/^(cc-|new-password|current-password|one-time-code)/,Si=/\b(?:card (?:number|no|num)|cc (?:number|num|no)|cvv|cvc|csc|security code|iban|ssn|social security|otp)\b/,Ei=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase(),Y=(e,t="")=>{if(e.getAttribute("type")==="password"||vi.test(e.getAttribute("autocomplete")||""))return true;let n=["name","id","aria-label","placeholder"].map(i=>e.getAttribute(i)||"").concat(t).join(" ");return Si.test(Ei(n))},X=e=>(e instanceof HTMLButtonElement||e instanceof HTMLInputElement)&&(e.type==="submit"||e.type==="image")&&e.form!==null;var yi=/\bsponsored\b/i,bi="nav, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]",he=e=>{var n;if(e.closest(bi))return true;let t=e.closest("header, footer");return !!t&&!((n=t.parentElement)!=null&&n.closest("article, section, main, [role=main]"))},Ai=e=>{let t=e.getAttribute("role"),n=Array.from(e.classList).sort().slice(0,3).join(".");return `${e.tagName}${t?`[${t}]`:""}${n?`.${n}`:""}`},_i=e=>{var t;return [e,e.parentElement,(t=e.parentElement)==null?void 0:t.parentElement].map(n=>n?Ai(n):"").join("<")},Ti=e=>{let t=0;for(let n=e.parentElement;n;n=n.parentElement)t+=1;return t},qe=(e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Mi=e=>{let t=e.ownerDocument.defaultView;if(!t)return false;let n=e.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return i>=0&&r>=0&&i<=t.innerWidth&&r<=t.innerHeight},J=(e,t)=>{if(e.length<=t)return e;let n=e.slice(0,t),i=n.lastIndexOf(" ");return `${i>0?n.slice(0,i):n}\u2026`},wi=e=>{let t=new Map,n=new Map;for(let r of e){let s=r.el;for(let o=0;s&&o<=8&&s!==s.ownerDocument.body;o+=1){let a=_i(s),l=t.get(a);l||t.set(a,l=new Set),l.add(s);let p=n.get(s);p||n.set(s,p=[]),p.push(r),s=s.parentElement;}}let i=[];for(let r of t.values()){if(r.size<3)continue;let s=Array.from(r).sort(qe);s.some((o,a)=>a>0&&s[a-1].contains(o))||i.push({cards:s,depth:s.reduce((o,a)=>o+Ti(a),0)/s.length});}return {groups:i,controlsIn:n}},ki=e=>{var n;let t=new Set;for(let i of e){let r=new Set(i.cards);for(let s of e){let o=s.depth-i.depth;if(s===i||o<=0||o>8)continue;let a=new Map;for(let p of s.cards){let m=p.parentElement;for(let y=0;m&&y<8;y+=1,m=m.parentElement)if(r.has(m)){a.set(m,((n=a.get(m))!=null?n:0)+1);break}}if(a.size<3)continue;Array.from(a.values()).reduce((p,m)=>p+m,0)/a.size>=1.5?t.add(i):t.add(s);}}return e.filter(i=>!t.has(i))};function Ye(e,t){var b;let n=new Map,i=d=>{let c=n.get(d);return c===void 0&&n.set(d,c=t.textOf(d)),c},{groups:r,controlsIn:s}=wi(e),o=d=>{var u;if(he(d)||yi.test(i(d)))return false;let c=(u=s.get(d))!=null?u:[];return c.length!==1?c.length>1:i(d).length>c[0].name.length+3},a=d=>{var S,g;let c=(E,_)=>i(_.el).length-i(E.el).length,u=d.filter(({el:E})=>E.matches("a[href], [role=link]"));return (g=(S=[...u.filter(({el:E})=>t.pathOf(E))].sort(c)[0])!=null?S:[...u].sort(c)[0])!=null?g:d[0]},l=(d,c)=>{var f;let u=d[0].parentElement;for(let S=0;u&&S<3;S+=1,u=u.parentElement){let g=(f=u.getAttribute("aria-label"))==null?void 0:f.trim();if(g)return J(g,60);let E=u.previousElementSibling;for(let _=0;E&&_<3;_+=1){let C=E.matches("h1, h2, h3, [role=heading]")?E:E.querySelector("h1, h2, h3, [role=heading]"),O=C?i(C):"";if(O)return J(O,60);E=E.previousElementSibling;}}return `List ${c}`},p=ki(r.map(d=>({...d,cards:d.cards.filter(o)})).filter(d=>d.cards.length>=3)).sort((d,c)=>qe(d.cards[0],c.cards[0])),m={lists:[],primary:new Map,secondary:new Set},y=new Set;for(let d of p){if(m.lists.length>=6)break;let c=m.lists.length+1,u=[],f=[],S=0;for(let g of d.cards){let E=((b=s.get(g))!=null?b:[]).filter(({el:I})=>!y.has(I)),_=a(E);if(!_)continue;let C=i(_.el),O=J(i(g).replace(C," ").replace(/\s+/g," ").trim(),90);u.push([_.el,{list:c,position:u.length+1,...Mi(g)&&{screenPosition:++S},...O&&{detail:O},name:J(C,60)||_.name}]);for(let{el:I}of E)I!==_.el&&f.push(I);}if(!(u.length<3)){m.lists.push({id:c,name:l(d.cards,c),total:u.length});for(let[g,E]of u)m.primary.set(g,E),y.add(g);for(let g of f)m.secondary.add(g),y.add(g);}}return m}var pe=/^skip (?:to\b|navigation\b|nav\b|main\b|links\b)/i,Ri=25,Ii=60,Pi=40,Se={maxControls:Ii,reservedLinks:0,groupLists:false,maxItems:0,preferVisible:false};var rt=60,Ci=120,Oi=200,Je=2,st="main, section, article, aside, nav, header, footer, [role=region], [role=tabpanel], [role=main], [role=navigation], [role=banner], [role=contentinfo]",ot="h1, h2, h3, [role=heading]",at="button, summary, [role=button], [role=tab], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=option], input[type=submit], input[type=button], input[type=reset]",Ni=new Set(["option","menuitemradio","menuitemcheckbox"]),lt="a[href], [role=link]",ge="input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea, [contenteditable=''], [contenteditable=true], [role=textbox], [role=combobox]",Li="form, [role=form]",Qe={section:"s",button:"b",link:"l",field:"f",form:"frm"},A=(e,t)=>(e.getAttribute(t)||"").trim(),ct=/\s*[.(]?\s*opens? in (?:a )?new (?:tab|window)\)?\.?/gi,w=(e,t=rt)=>e.replace(ct,"").replace(/\s+/g," ").trim().slice(0,t),ut=(e,t)=>{let n=w(e,1/0);if(n.length<=t)return n;let i=n.slice(0,t),r=i.lastIndexOf(" ");return r>0?i.slice(0,r):i},xi=e=>!!e.body&&e.body.getBoundingClientRect().width>0,Ee=(e,t)=>{let n=e;if(typeof n.checkVisibility=="function"&&!n.checkVisibility({contentVisibilityAuto:true,visibilityProperty:true}))return false;if(!t)return true;let i=e.getBoundingClientRect();return i.width>=Je&&i.height>=Je},Di=(e,t)=>{let n=t.defaultView;if(!n)return false;let i=e.getBoundingClientRect(),r=i.left+i.width/2,s=i.top+i.height/2;if(r<0||s<0||r>n.innerWidth||s>n.innerHeight)return false;let o=t.elementFromPoint(r,s);return !!o&&o!==e&&!e.contains(o)&&!o.contains(e)},Fi=(e,t)=>{let n=t.defaultView;if(!n)return true;let i=e.getBoundingClientRect();return i.bottom>0&&i.right>0&&i.top<n.innerHeight&&i.left<n.innerWidth},Hi=(e,t)=>{if(e.closest("[inert]"))return true;let n=t.defaultView;return n?n.getComputedStyle(e).pointerEvents==="none":false},ee=e=>{let t=A(e,"aria-label");if(t)return w(t);let n=A(e,"aria-labelledby");if(!n)return "";let i=n.split(/\s+/).map(r=>{let s=e.ownerDocument.getElementById(r);return s?x(s):""}).join(" ");return w(i)},Bi=new Set(["A","ABBR","B","BDI","BDO","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","RUBY","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]),dt="script, style, [aria-hidden=true], [hidden]",x=(e,t,n=true)=>{if(e.nodeType===Node.TEXT_NODE)return e.nodeValue||"";if(e.nodeType!==Node.ELEMENT_NODE)return "";let i=e;if(!n&&t&&i.matches(t))return "";let r="";for(let s of Array.from(i.childNodes))r+=x(s,t,false);return Bi.has(i.tagName)?r:` ${r} `},ht=(e,t)=>{var r;let n=[],i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:s=>s!==e&&s.nodeType===Node.ELEMENT_NODE&&s.matches(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let s=i.nextNode();s;s=i.nextNode())s.nodeType===Node.TEXT_NODE&&n.push((r=s.nodeValue)!=null?r:"");return n},Ui=e=>{let t=w(x(e,dt));return t.length>Oi?"":t},Wi=e=>{let t=e.querySelector("img[alt], [role=img][aria-label]");return t?w(A(t,"alt")||A(t,"aria-label")):""},Vi=e=>{var i;let t=(i=e.labels)==null?void 0:i[0];if(t)return w(x(t));if(e.id){let r=e.ownerDocument.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(r)return w(x(r))}let n=e.closest("label");return n?w(x(n)):""},Gi=e=>e.length>=3&&/[a-z]/i.test(e)&&/[aeiou]/i.test(e)&&!/\d{3}/.test(e),H=e=>{if(!e)return "";let t=w(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase());return Gi(t)?t:""},$i=e=>{let t=A(e,"autocomplete");if(t&&t!=="off"&&t!=="on")return H(t);let n=A(e,"type");return n&&n!=="text"?`${n} field`:""},Xi=(e,t)=>{for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(n.matches(st))return false;return true},pt=e=>{for(let t of Array.from(e.querySelectorAll(ot)))if(Xi(e,t))return w(x(t));return ""},Ki=4,mt=30,K=e=>{for(let[t,n]of e){let i=n();if(i)return {name:i,namedBy:t}}return {name:"",namedBy:"none"}},zi={nav:"navigation",header:"header",footer:"footer",main:"main content",aside:"sidebar"},ji=e=>K([["aria",()=>ee(e)],["heading",()=>pt(e)],["id",()=>H(e.id)],["landmark",()=>{var t;return (t=zi[e.tagName.toLowerCase()])!=null?t:""}]]),Ze=e=>K([["aria",()=>ee(e)],["text",()=>Ui(e)],["img-alt",()=>Wi(e)],["title",()=>A(e,"title")],["id",()=>H(A(e,"name")||e.id)]]),qi=e=>K([["aria",()=>ee(e)],["label",()=>Vi(e)],["placeholder",()=>A(e,"placeholder")],["title",()=>A(e,"title")],["id",()=>H(A(e,"name")||e.id)],["type",()=>$i(e)]]),ft=e=>A(e,"role")==="combobox"&&!(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement),Yi=e=>e.hasAttribute("data-placeholder")?"":w(ht(e,"[aria-hidden=true]").join("")),Ji=(e,t)=>{if(!Ni.has(A(e,"role")))return null;let n=e.closest("[role=listbox], [role=menu]");if(!(n!=null&&n.id))return null;let i=CSS.escape(n.id);return t.querySelector(`[aria-controls~="${i}"], [aria-owns~="${i}"]`)},Qi=e=>{let t=A(e,"type");if(t==="checkbox"||t==="radio")return t;if(ft(e))return "combobox";let n=A(e,"autocomplete");if(n&&n!=="off"&&n!=="on")return n;if(t)return t;let i=e.tagName.toLowerCase();return i==="select"||i==="textarea"||i==="input"?i:A(e,"role")==="combobox"?"combobox":"text"},Zi=e=>e instanceof HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"),me=12,er=e=>{let t=Array.from(e.options).filter(i=>!i.disabled&&i.value!=="").map(i=>w(i.label||i.text,rt)).filter(Boolean);if(t.length<=me)return t;let n=t.length-me;return [...t.slice(0,me),`+${n} more`]},et=e=>e.disabled===true||A(e,"aria-disabled")==="true",tr=e=>{if(Zi(e))return {checked:e.checked};if(!ft(e))return {filled:nr(e)};let t=Yi(e);return t?{shows:t}:{filled:false}},nr=e=>{let t=e.value;return typeof t=="string"?t.trim().length>0:w(e.textContent||"").length>0},tt=(e,t)=>{let n=A(e,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,t.baseURI);return i.origin===t.location.origin?i.pathname+i.search:void 0}catch(i){return}},fe=60,ir=e=>{if(e.length<=fe)return e;let t=e.split("?")[0];return t.length<=fe?t:`${t.slice(0,fe)}\u2026`},rr=e=>{for(let t of ["q","url","u"]){let n=e.searchParams.get(t);if(!(!n||!/^https?:\/\//i.test(n)))try{let i=new URL(n);if(i.origin!==e.origin)return i}catch(i){}}},sr=e=>{var t,n,i,r;return (r=(i=(n=(t=e.querySelector("cite"))==null?void 0:t.textContent)==null?void 0:n.trim().match(/^(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+(?:\.[a-z0-9-]+)+)/i))==null?void 0:i[1])==null?void 0:r.toLowerCase()},or=(e,t)=>{var i;let n=A(e,"href");if(!(!n||n.startsWith("#")))try{let r=new URL(n,t.baseURI);if(!/^https?:$/.test(r.protocol))return;let s=r.origin===t.location.origin?rr(r):r;return (i=s==null?void 0:s.hostname.replace(/^www\./,""))!=null?i:sr(e)}catch(r){return}},nt=e=>e.split("?")[0].replace(/\/+$/,"")||"/",ar=/\s+[—–|·:]\s+/,lr=(e,t)=>K([["route",()=>ur(H(cr(e.location.pathname)))],["self-link",()=>w(t)],["title",()=>w(e.title.split(ar)[0]||"")]]),cr=e=>e.split("/").filter(Boolean).pop()||"",ur=e=>e?e[0].toUpperCase()+e.slice(1):"",dr=(e,t)=>{let n=e;for(let i=0;i<t&&n;i+=1)n=n.parentElement;return n?ut(x(n,`${at}, ${lt}, ${ge}`),mt):""},Q=(e,t=[])=>{let n=new Map;for(let r of e){let s=n.get(r.name);s?s.push(r):n.set(r.name,[r]);}let i=[];for(let r of n.values()){if(r.length===1){i.push(r[0]);continue}let s=A(r[0].el,"href");if(s&&r.every(l=>A(l.el,"href")===s)){i.push({...r[0],count:r.length});continue}let o=r.map(l=>ut(gt(l.el,t),mt));if(o.every(Boolean)&&new Set(o).size===r.length){r.forEach((l,p)=>{l.name=`${l.name} \u2014 in "${o[p]}"`;}),i.push(...r);continue}let a=false;for(let l=1;l<=Ki&&!a;l+=1){let p=r.map(m=>dr(m.el,l));p.some(m=>!m)||new Set(p).size===r.length&&(r.forEach((m,y)=>{m.name=`${m.name} \u2014 ${p[y]}`;}),a=true);}a?i.push(...r):i.push({...r[0],count:r.length});}return i.sort(ve)},Z=(e,t,n,i,r=false)=>{let s=[],o=[],a=0;for(let l of Array.from(e.querySelectorAll(t))){if(!Ee(l,n)||r&&n&&Hi(l,e))continue;let p=r&&n&&Di(l,e),m=i(l);if(p){m.name&&o.push(m.name);continue}if(!m.name){a+=1;continue}s.push({el:l,name:m.name,namedBy:m.namedBy});}return {named:s,unnamed:a,covered:o}},hr=e=>e.length>=2&&/[a-z]/i.test(e),pr=(e,t,n)=>{let i=[];for(let r of Array.from(e.querySelectorAll(ot))){if(!Ee(r,t)||n.some(o=>o.contains(r)))continue;let s=w(r.textContent||"");hr(s)&&i.push({el:r,name:s,namedBy:"heading-block"});}return i},ve=(e,t)=>e.el.compareDocumentPosition(t.el)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,mr=e=>{let t=[];for(let n of e)t.some(r=>r.name===n.name&&(r.el.contains(n.el)||n.el.contains(r.el)))||t.push(n);return t},gt=(e,t)=>{let n="",i="";for(let r of t)r.el.contains(e)?n=r.name:r.el.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(i=r.name);return n||i},fr=e=>ht(e,dt).join(" ").replace(ct,"").replace(/\s+/g," ").trim(),gr=(e,t)=>{let n=Array.from(e.primary).sort(([,i],[,r])=>(i.screenPosition?0:1)-(r.screenPosition?0:1)||i.list-r.list||i.position-r.position);return new Map(n.slice(0,t))},it=({list:e,position:t,screenPosition:n,detail:i})=>({list:e,position:t,...n&&{screenPosition:n},...i&&{detail:i}});function vt(e=document,t=1,n=Se){var We;let i=xi(e),r=new Map,s=[],o={},a={section:0,button:0,link:0,field:0,form:0},l=new Map,p=(h,v)=>{a[v]+=1;let M=`${Qe[v]}${a[v]}`;return r.set(M,h),l.set(h,M),M},m=Z(e,st,i,ji);o.section=m.unnamed;let y=mr([...m.named,...pr(e,i,m.named.map(h=>h.el))].sort(ve)),b=Q(y).slice(0,Ri),d=b.filter(h=>h.namedBy!=="landmark");for(let{el:h,name:v,namedBy:M}of d)s.push({handle:p(h,"section"),kind:"section",name:v,namedBy:M});let c=Z(e,at,i,Ze,true);c.named=c.named.filter(h=>!h.el.matches(ge));let u=Z(e,lt,i,Ze,true);c.named=c.named.filter(({name:h})=>!pe.test(h)),u.named=u.named.filter(({name:h})=>!pe.test(h));let f=Z(e,ge,i,qi,true);o.button=c.unnamed,o.link=u.unnamed,o.field=f.unnamed;let S=n.groupLists&&i?Ye([...c.named,...u.named],{textOf:fr,pathOf:h=>tt(h,e)}):null,g=S?gr(S,n.maxItems):null;if(S&&g){let h=v=>S.primary.has(v.el)&&!g.has(v.el);c.named=c.named.filter(v=>!h(v)),u.named=u.named.filter(v=>!h(v));for(let v of [...c.named,...u.named]){let M=g.get(v.el);M&&(v.name=M.name);}}let E=Q(f.named,b),_=Q(c.named,b),C=Q(u.named,b),O=Math.min(n.reservedLinks,C.length),I={left:n.maxControls-O},oe=h=>{let v=Fi(h.el,e)?0:3;return S!=null&&S.secondary.has(h.el)?v?7:6:g!=null&&g.has(h.el)?v:v+(he(h.el)?2:1)},F=h=>{let v=Math.max(0,I.left),M=h.slice(0,v);if(n.preferVisible&&i&&h.length>v){let k=h.map(T=>({candidate:T,rank:oe(T)}));k.sort((T,P)=>T.rank-P.rank),M=k.slice(0,v).map(({candidate:T})=>T).sort(ve);}return I.left-=M.length,M};for(let{el:h,name:v,namedBy:M,count:k}of F(E))s.push({handle:p(h,"field"),kind:"field",name:v,namedBy:M,fieldType:Qi(h),...tr(h),...h instanceof HTMLSelectElement&&{options:er(h)},...k&&{count:k},...et(h)&&{disabled:true},...Y(h,v)&&{sensitive:true}});for(let{el:h,name:v,namedBy:M,count:k}of F(_)){let T=Ji(h,e),P=T?l.get(T):void 0,G=g==null?void 0:g.get(h);s.push({handle:p(h,"button"),kind:"button",name:v,namedBy:M,...G&&{item:it(G)},...P&&{choiceOf:P},...k&&{count:k},...X(h)&&{submits:true},...et(h)&&{disabled:true}});}let an=nt(e.location.pathname),ae="";I.left+=O;for(let{el:h,name:v,namedBy:M,count:k}of F(C)){let T=tt(h,e),P=or(h,e),G=T!=null&&T.includes("?")?T.slice(T.indexOf("?")):"",Ve=!!T&&nt(T)===an&&(!G||G===e.location.search);Ve&&!ae&&(ae=v);let le=g==null?void 0:g.get(h);s.push({handle:p(h,"link"),kind:"link",name:v,namedBy:M,...le&&{item:it(le)},...k&&{count:k},...T&&!le&&!P&&{path:ir(T)},...P&&{site:P},...Ve&&{current:true}});}let ln=new Map(s.map(h=>[r.get(h.handle),h.handle]));for(let h of Array.from(e.querySelectorAll(Li))){if(!Ee(h,i))continue;let v=[];for(let[T,P]of ln)h.contains(T)&&!P.startsWith(Qe.section)&&v.push(P);if(v.length===0)continue;let{name:M,namedBy:k}=K([["aria",()=>ee(h)],["heading",()=>pt(h)],["section",()=>gt(h,b)],["id",()=>H(A(h,"name")||h.id)]]);s.push({handle:p(h,"form"),kind:"form",name:M||"form",namedBy:k,children:v});}let{name:cn,namedBy:un}=lr(e,ae),dn=new Set(s.map(h=>{var v;return (v=h.item)==null?void 0:v.list})),Ue=(We=S==null?void 0:S.lists.filter(h=>dn.has(h.id)))!=null?We:[],hn=[...new Set([...c.covered,...u.covered,...f.covered].filter(h=>!pe.test(h)))].slice(0,Pi);return {index:{generation:t,url:e.location.pathname+e.location.search,title:w(e.title,Ci),pageName:cn||"this",pageNamedBy:un,nodes:s,unnamed:o,...Ue.length>0&&{lists:Ue},...i&&{covered:hn}},elements:r}}var At=/^(?:true|yes|y|on|1|check|checked|tick|ticked|select|selected)$/i,vr=/^(?:false|no|n|off|0|uncheck|unchecked|untick|unticked|deselect)$/i,Sr={date:"dates go in as YYYY-MM-DD",time:"times go in as HH:MM, 24-hour","datetime-local":"a date and time goes in as YYYY-MM-DDTHH:MM",month:"a month goes in as YYYY-MM",week:"a week goes in as YYYY-Www",number:"only a plain number fits",range:"only a plain number fits",color:"a colour goes in as #rrggbb"},St=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim(),Et=(e,t)=>{let n=e.filter(t);return n.length===1?n[0]:void 0},_t=(e,t,n)=>{var s,o;let i=St(n);if(!i)return;let r=a=>t(a).map(St);return (o=(s=e.find(a=>r(a).includes(i)))!=null?s:Et(e,a=>r(a).some(l=>l.startsWith(i))))!=null?o:Et(e,a=>r(a).some(l=>l.includes(i)))},Er=(e,t)=>{var r;let n=Object.getPrototypeOf(e),i=(r=Object.getOwnPropertyDescriptor(n,"value"))==null?void 0:r.set;i?i.call(e,t):e.value=t;},Tt=(e,t)=>{e.focus({preventScroll:true}),Er(e,t),e.dispatchEvent(new Event("input",{bubbles:true})),e.dispatchEvent(new Event("change",{bubbles:true})),e.blur();},yt=(e,t)=>e.readOnly?{outcome:"read_only"}:(Tt(e,t),t&&e.value===""?{outcome:"rejected",detail:Sr[e.type]}:t&&!e.validity.valid?{outcome:"invalid",detail:e.validationMessage}:{outcome:"ok"}),yr=(e,t)=>{let n=Array.from(e.options).filter(r=>!r.disabled),i=_t(n,r=>[r.value,r.label||r.text],t);return i?(Tt(e,i.value),{outcome:"ok"}):{outcome:"no_such_option",detail:n.filter(r=>r.value!=="").map(r=>r.label||r.text).join(", ")}},bt=e=>{var t,n,i;return ((i=(n=(t=e.labels)==null?void 0:t[0])==null?void 0:n.textContent)==null?void 0:i.trim())||e.getAttribute("aria-label")||e.value},br=(e,t)=>{var s,o;let n=(s=e.form)!=null?s:e.ownerDocument,i=e.name?Array.from(n.querySelectorAll(`input[type=radio][name="${CSS.escape(e.name)}"]`)):[e],r=(o=_t(i,a=>[a.value,bt(a)],t))!=null?o:At.test(t.trim())?e:void 0;return r?r.disabled?{outcome:"disabled"}:(r.checked||r.click(),r.checked?{outcome:"ok"}:{outcome:"rejected"}):{outcome:"no_such_option",detail:i.map(bt).join(", ")}},Ar=(e,t)=>{let n=At.test(t.trim())?true:vr.test(t.trim())?false:void 0;return n===void 0?{outcome:"rejected",detail:'a tick box takes "yes" or "no"'}:(e.checked!==n&&e.click(),e.checked===n?{outcome:"ok"}:{outcome:"rejected"})},_r=(e,t)=>{var i;return e.focus({preventScroll:true}),(i=window.getSelection())==null||i.selectAllChildren(e),(t?document.execCommand("insertText",false,t):document.execCommand("delete"))||(e.textContent=t,e.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:t}))),e.blur(),{outcome:"ok"}},Mt=(e,t)=>e instanceof HTMLSelectElement?yr(e,t):e instanceof HTMLTextAreaElement?yt(e,t):e instanceof HTMLInputElement?e.type==="radio"?br(e,t):e.type==="checkbox"?Ar(e,t):e.type==="file"?{outcome:"not_fillable"}:yt(e,t):e instanceof HTMLElement&&e.isContentEditable?_r(e,t):{outcome:"not_fillable"},Tr=e=>"willValidate"in e&&e.willValidate,Mr=(e,t)=>{let n=Array.from(e.elements).find(r=>Tr(r)&&!r.validity.valid);if(!n)return;let i=n.validationMessage||"still needs a valid value";return `"${t(n)}": ${i}`},wt=(e,t,n=false)=>{let i=e.form;if(i&&!i.noValidate&&!e.formNoValidate){let a=Mr(i,t);if(a)return {outcome:"invalid",detail:a}}let r=false,s=false,o=a=>{r=true,s=a.defaultPrevented,n||a.preventDefault();};window.addEventListener("submit",o);try{e.click();}finally{window.removeEventListener("submit",o);}return !r||s||n?{outcome:"ok"}:{outcome:"requires_reload"}};var wr=new Set(["date","time","datetime-local","month","week","color"]),kr=e=>{let t=e.getBoundingClientRect();return {clientX:t.left+t.width/2,clientY:t.top+t.height/2}},z=(e,t,n,i)=>{let r={bubbles:true,cancelable:true,composed:true,view:window,button:0,buttons:i?1:0,...n};return t.startsWith("pointer")?typeof PointerEvent!="function"?true:e.dispatchEvent(new PointerEvent(t,{...r,pointerId:1,pointerType:"mouse",isPrimary:true})):e.dispatchEvent(new MouseEvent(t,r))},ye=e=>{let t=kr(e),n=z(e,"pointerdown",t,true),i=z(e,"mousedown",t,true);n&&i&&e instanceof HTMLElement&&e.focus({preventScroll:true}),z(e,"pointerup",t,false),z(e,"mouseup",t,false),e instanceof HTMLElement?e.click():z(e,"click",t,false);},Rr=e=>{var n;if(e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&wr.has(e.type))try{(n=e.showPicker)==null||n.call(e);}catch(i){}},kt=e=>{ye(e),Rr(e);};var B=0,D=0,te=null,Ir=()=>{let e=te;if(te=null,e==="forward"){B+=1,D=Math.max(0,D-1);return}e==="back"?D+=1:D=0,B=Math.max(0,B-1);},be={canGo:e=>e==="back"?B>0:D>0,go(e){te=e,e==="back"?window.history.back():window.history.forward();}};function Rt(e){let t=window.navigation;if(!t)return Pr(e);let n=null,i=()=>{n&&clearTimeout(n),n=setTimeout(e,500);};return t.addEventListener("navigatesuccess",i),()=>{n&&clearTimeout(n),t.removeEventListener("navigatesuccess",i);}}function Pr(e){if(typeof window=="undefined")return ()=>{};let t=null,n=()=>{t&&clearTimeout(t),t=setTimeout(e,500);};B=0,D=0,te=null;let{pushState:i,replaceState:r}=window.history,s=(p,m)=>function(...y){let b=p.apply(this,y);return m&&(B+=1,D=0),n(),b},o=()=>{Ir(),n();},a=s(i,true),l=s(r,false);return window.history.pushState=a,window.history.replaceState=l,window.addEventListener("popstate",o),window.addEventListener("hashchange",n),()=>{t&&clearTimeout(t),window.history.pushState===a&&(window.history.pushState=i),window.history.replaceState===l&&(window.history.replaceState=r),window.removeEventListener("popstate",o),window.removeEventListener("hashchange",n);}}var Cr=.8,Or="l",Me="b",Ae="f",Ot="s",Nr=new Set([Ot,Me]),U=e=>{var t,n;return (n=(t=/^([a-z]{1,4})\d{1,4}$/.exec(e))==null?void 0:t[1])!=null?n:""},Lr=/\s+—\s+.*$/,_e=e=>e.toLowerCase().replace(/\s+/g," ").trim(),xr=e=>{try{return new URL(e,window.location.href).origin===window.location.origin}catch(t){return false}},It=e=>e.replace(/\/+$/,"")||"/",Dr=e=>{try{return It(new URL(e,window.location.href).pathname)===It(window.location.pathname)}catch(t){return false}},Pt=(e,t,n)=>{let i=false,r=o=>{i=o.defaultPrevented,t||o.preventDefault();};window.addEventListener("click",r);try{e.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));}finally{window.removeEventListener("click",r);}if(i||t)return "ok";let s=e.href;return n===void 0||!s?"requires_reload":(setTimeout(()=>window.location.assign(s),n),"ok")},Te=e=>e.matches(":disabled")||e.getAttribute("aria-disabled")==="true",Fr=new Set(["back","forward"]),Nt=e=>be.canGo(e)?(be.go(e),"ok"):"no_history",Hr=e=>{let t=window.navigation;return t?(e==="back"?!t.canGoBack:!t.canGoForward)?"no_history":(e==="back"?t.back():t.forward(),"ok"):Nt(e)},Br=()=>{let e=document.documentElement;return {x:Math.max(0,e.scrollWidth-window.innerWidth),y:Math.max(0,e.scrollHeight-window.innerHeight)}},Ct=(e,t,n,i)=>{if(!e)return t;if(e.relative){let r=e.percent?i*e.value/100:e.value;return t+r}return e.percent?n*e.value/100:e.value},Ur=e=>{let t=Br();if(e.kind==="edge"){let n=e.edge==="top"?0:e.edge==="bottom"?t.y:t.y/2;window.scrollTo({top:n,behavior:"smooth"});return}if(e.kind==="step"){let n=window.innerHeight*Cr;window.scrollBy({top:e.direction==="up"?-n:n,behavior:"smooth"});return}window.scrollTo({left:Ct(e.x,window.scrollX,t.x,window.innerWidth),top:Ct(e.y,window.scrollY,t.y,window.innerHeight),behavior:"smooth"});};function we(e={}){var m,y,b;let t=(m=e.survivesDocumentLoad)!=null?m:false,n=(y=e.indexProfile)!=null?y:Se,i=(b=e.followLinksAnywhere)!=null?b:false,r=e.documentLoadAfterMs,s=null,o=(d,c)=>{var u;return !s||s.generation!==c?null:(u=s.elements.get(d))!=null?u:null},a=d=>{let c=s==null?void 0:s.elements.get(d);return c!=null&&c.isConnected?{element:c,isSection:U(d)===Ot}:null},l=d=>(s==null?void 0:s.generation)===d?"unknown_target":"stale",p=d=>{var c,u,f,S,g;for(let[E,_]of (c=s==null?void 0:s.elements)!=null?c:[])if(_===d)return (u=s==null?void 0:s.names.get(E))!=null?u:E;return ((g=(S=(f=d.labels)==null?void 0:f[0])==null?void 0:S.textContent)==null?void 0:g.trim())||d.getAttribute("aria-label")||d.getAttribute("placeholder")||d.getAttribute("name")||"a field"};return {elementNamed(d){let c=_e(d);if(!s||!c)return null;let u=null;for(let[f,S]of s.names)if(Nr.has(U(f))){if(_e(S)===c)return a(f);!u&&_e(S.replace(Lr,""))===c&&(u=f);}return u?a(u):null},read(d){let{index:c,elements:u}=vt(document,d,n),f=new Map(c.nodes.map(S=>[S.handle,S.name]));return s={generation:d,elements:u,names:f},c},retag(d){s&&(s.generation=d);},scroll(d,c){let u=de(d);if(u)return Ur(u),"ok";if(c===void 0)return "unknown_target";let f=o(d,c);return f?f.isConnected?(f.scrollIntoView({behavior:"smooth",block:"start"}),"ok"):"stale":l(c)},navigate(d,c){if(Fr.has(d)){let g=d;return t?Hr(g):Nt(g)}if(c===void 0)return "unknown_target";if(U(d)!==Or)return "not_navigable";let u=o(d,c);if(!u)return l(c);if(!u.isConnected)return "stale";let f=u.getAttribute("href");if(!f)return "not_navigable";let S=xr(f);return !S&&!i?"not_navigable":S&&Dr(f)?"already_here":Pt(u,t,r)},click(d,c){if(c===void 0)return "unknown_target";let u=U(d);if(u!==Me&&u!==Ae)return "not_clickable";let f=o(d,c);return f?f.isConnected?X(f)?"submits_form":Te(f)?"disabled":(f.scrollIntoView({behavior:"smooth",block:"center"}),u===Ae?(kt(f),"ok"):f.closest("a[href]")?Pt(f,t,r)==="ok"?"ok":"requires_reload":(ye(f),"ok")):"stale":l(c)},fill(d,c){let u=false;return d.map(({handle:f,value:S})=>{var I;let g=(I=s==null?void 0:s.names.get(f))!=null?I:f,E=(oe,F)=>({handle:f,name:g,outcome:oe,...F&&{detail:F}});if(c===void 0)return E("unknown_target");if(U(f)!==Ae)return E("not_fillable");let _=o(f,c);if(!_)return E(l(c));if(!_.isConnected)return E("stale");if(Y(_,g))return E("sensitive");if(Te(_))return E("disabled");u||(_.scrollIntoView({behavior:"smooth",block:"center"}),u=true);let{outcome:C,detail:O}=Mt(_,S);return E(C,O)})},submit(d,c){if(c===void 0)return {outcome:"unknown_target"};if(U(d)!==Me)return {outcome:"not_a_submit"};let u=o(d,c);return u?u.isConnected?X(u)?Te(u)?{outcome:"disabled"}:(u.scrollIntoView({behavior:"smooth",block:"center"}),wt(u,p,t)):{outcome:"not_a_submit"}:{outcome:"stale"}:{outcome:l(c)}}}}we();var Lt="avatarfactory";var xt="resume",Dt="resume";var Vr=new Set(["ready","resize","state","event","beacon","action.run","action.flow","action.check","page.call","tour.do"]),Gr=(e,t)=>({ns:Lt,v:1,deployId:e,...t}),Ft=(e,t)=>{if(e.origin!==t.origin||t.source!==void 0&&e.source!==t.source)return null;let n=e.data;return !n||typeof n!="object"||n.ns!==Lt||n.v!==1||n.deployId!==t.deployId||typeof n.type!="string"||!(Vr).has(n.type)?null:n},Ht=(e,t,n,i)=>{e.postMessage(Gr(n,i),t);};var $r=e=>e.top>=96&&e.bottom<=window.innerHeight-96,Xr=e=>new Promise(t=>{let n=Number.NaN,i=0,r=0,s=()=>{clearTimeout(o),cancelAnimationFrame(r),t();},o=setTimeout(s,1600),a=()=>{let l=e.getBoundingClientRect().top;i=Math.abs(l-n)<.5?i+1:0,n=l,i>=5?s():r=requestAnimationFrame(a);};r=requestAnimationFrame(a);}),ke=async e=>{let t=e.getBoundingClientRect();if($r(t))return;let n=t.height<=window.innerHeight-192;e.scrollIntoView({behavior:"smooth",block:n?"center":"start"}),await Xr(e);};var Kr=".af-widget, .af-tour-layer",zr="h1, h2, h3, h4, h5, h6, button, a, [role=button], label, li, p";var Pe=e=>e.toLowerCase().replace(/\s+/g," ").trim(),Re=e=>{if(e.closest(Kr)||e.closest("[aria-hidden='true'], [hidden]"))return false;let t=e.getBoundingClientRect();if(t.width<2||t.height<2)return false;let n=e.checkVisibility;return typeof n=="function"?n.call(e,{visibilityProperty:true}):true},Ut=e=>{var t,n;return Pe((n=(t=e.innerText)!=null?t:e.textContent)!=null?n:"")},Ie=e=>{let t=document.createRange();t.selectNodeContents(e);let n=t.getBoundingClientRect();return n.width>=2&&n.height>=2?n:e.getBoundingClientRect()},ne=e=>e.width*e.height;var Wt=e=>{let t=e.getBoundingClientRect(),n=Ie(e);return ne(t)<=ne(n)*4?t:n},jr=(e,t,n)=>{let i=e;for(;i.parentElement&&i.parentElement!==n;){let r=i.parentElement;if(Ut(r).length>t.length+40||ne(Ie(r))>ne(Ie(i))*4)break;i=r;}return i},qr=(e,t)=>{let n=Pe(e);return n===t?3:n.startsWith(t)?2:n.includes(t)?1:0},Yr="h1, h2, h3, h4, h5, h6, [role=heading]",Ce=(e,t)=>{var r,s,o;if(typeof document=="undefined"||!document.body)return null;let n=Pe(e);if(!n)return null;let i=t==null?void 0:t(e);if(i&&Re(i.element)){if(!i.isSection)return i.element;let a=l=>Array.from(i.element.querySelectorAll(l)).find(Re);return (o=(s=(r=Bt(i.element,n))!=null?r:a(Yr))!=null?s:a("p"))!=null?o:i.element}return Bt(document.body,n)},Bt=(e,t)=>{var a,l;let n=null,i=0,r=false,s=(p,m,y=false)=>{if(!p)return;let b=qr(m,t);b<=i||!Re(p)||(n=p,i=b,r=y);},o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let p=o.nextNode();p&&i<3;p=o.nextNode())s(p.parentElement,(a=p.textContent)!=null?a:"");for(let p of Array.from(e.querySelectorAll(zr))){if(i===3)break;s(p,Ut(p));}for(let p of Array.from(e.querySelectorAll("[aria-label], img[alt]"))){if(i===3)break;let m=p.getAttribute("aria-label");s(p,(l=m!=null?m:p.getAttribute("alt"))!=null?l:"",m!==null);}return n?r?n:jr(n,t,e):null};var Jr={min:4,max:16},Qr={min:2,max:8},Ne=50,Vt=(e,t)=>Math.min(t.max,Math.max(t.min,e)),Xt=e=>{let t=parseFloat(getComputedStyle(e).fontSize)||16;return {x:Vt(t*.3,Jr),y:Vt(t*.12,Qr)}},Le=220,Zr=4,xe="af-tour-ink",De="af-tour-ink-strong",ie="af-tour-ink-behind",Gt="af-tour-behind-style",es="#fef08a",ts="#facc15",ns="#171717",is="#ffffff",rs=.179,ss=.4,N,Kt=e=>{if(N!=null||(N=document.createElement("canvas").getContext("2d",{willReadFrequently:true})),!N)return null;let t="#010203";if(N.fillStyle=t,N.fillStyle=e,N.fillStyle===t&&e.trim().toLowerCase()!==t)return null;N.clearRect(0,0,1,1),N.fillRect(0,0,1,1);let[n,i,r,s]=N.getImageData(0,0,1,1).data;if(s<128)return null;let o=a=>Math.round(a*(s/255)+255*(1-s/255));return [o(n),o(i),o(r)]},$t=([e,t,n])=>{let i=r=>{let s=r/255;return s<=.04045?s/12.92:((s+.055)/1.055)**2.4};return .2126*i(e)+.7152*i(t)+.0722*i(n)},os=(e,t)=>e.map(n=>Math.round(n+(255-n)*t/100)),as=e=>{var n;let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=t.nextNode();i;i=t.nextNode())if((n=i.nodeValue)!=null&&n.trim()&&i.parentElement)return Kt(getComputedStyle(i.parentElement).color);return null},zt=()=>typeof CSS!="undefined"&&!!CSS.highlights&&typeof Highlight=="function",jt=(e,t,n)=>{if(!zt())return {behind:false};let i=Kt(n!=null?n:t?ts:es);if(!i)return {behind:false};let r=n&&!t?os(i,Ne):i,s=$t(r)>rs,o=as(e),a=!!o&&$t(o)>ss;return s&&!a?{behind:false}:{behind:true,background:`rgb(${r.join(" ")})`,ink:s?ns:is}},qt=(e,t)=>{let n=document.getElementById(Gt);n||(n=document.createElement("style"),n.id=Gt,document.head.appendChild(n));let i=t?`;text-shadow:.35px 0 0 ${e.ink}`:"";n.textContent=`::highlight(${ie}){background-color:${e.background};color:${e.ink}${i}}`;},Oe=Math.sqrt(51),ls=e=>{let t=e/1e3;return 1-Math.exp(-7*t)*(Math.cos(Oe*t)+7/Oe*Math.sin(Oe*t))},cs=e=>{for(let t=0;t<800;t+=4)if(ls(t)>=e)return t;return 800},re=e=>{let t=document.createRange();t.selectNodeContents(e);let n=[];for(let i of Array.from(t.getClientRects())){if(i.width<1||i.height<1)continue;let r=n.find(o=>Math.abs(o.top-i.top)<Zr);if(!r){n.push({left:i.left,top:i.top,width:i.width,height:i.height});continue}let s=Math.max(r.left+r.width,i.right);r.left=Math.min(r.left,i.left),r.width=s-r.left,r.height=Math.max(r.height,i.height);}return n},Yt=(e,t)=>e.length===t.length&&e.every((n,i)=>Math.abs(n.left-t[i].left)<.5&&Math.abs(n.top-t[i].top)<.5&&Math.abs(n.width-t[i].width)<.5),us=(e,t)=>{let n=0;return e.forEach((i,r)=>{Math.abs(i.top-t)<Math.abs(e[n].top-t)&&(n=r);}),n},ds=(e,t)=>{var r;let n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode()){let o=(r=s.nodeValue)!=null?r:"",a=t?/\S+\s*/g:/\S+/g;for(let l=a.exec(o);l;l=a.exec(o)){let p=document.createRange();p.setStart(s,l.index),p.setEnd(s,l.index+l[0].length),n.push(p);}}return n},Fe=(e,t,n)=>{var a;if(!zt()||!t.length)return ()=>{};let i=CSS.highlights,r=(a=i.get(n))!=null?a:new Highlight;i.set(n,r);let s=[],o=ds(e,n===ie).map(l=>{let p=l.getBoundingClientRect(),m=us(t,p.top),y=(p.left+p.width/2-t[m].left)/t[m].width,b=m*200+cs(Math.min(1,Math.max(0,y)));return setTimeout(()=>{r.add(l),s.push(l);},b)});return ()=>{o.forEach(clearTimeout),s.forEach(l=>r.delete(l)),r.size===0&&i.get(n)===r&&i.delete(n);}};var Jt=(e,t)=>{let n=0,i=performance.now()+1e3,r=()=>{n=0,t(),performance.now()<i&&(n=requestAnimationFrame(r));},s=()=>{n||(n=requestAnimationFrame(r));},o=()=>{i=Math.max(i,performance.now()+120),s();};t(),n=requestAnimationFrame(r),window.addEventListener("scroll",o,{capture:true,passive:true}),window.addEventListener("resize",s,{passive:true});let a=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return a==null||a.observe(e),()=>{n&&cancelAnimationFrame(n),window.removeEventListener("scroll",o,{capture:true}),window.removeEventListener("resize",s),a==null||a.disconnect();}};var Qt="afx-tour-style",Zt=e=>{let{left:t,top:n,width:i,height:r}=Wt(e);return {left:t,top:n,width:i,height:r}},ps=`
|
|
1
|
+
(function(){'use strict';var ue=["hmm","hmmm","mhm","mhmm","mm","mmm","uh","um","umm","uh huh","yeah","yep","ok","okay","right","haan","han","achha","accha","theek hai","theek"];function Gn(e){return e.replace(/(.)\1+/g,"$1")}new Set(ue.filter(e=>!e.includes(" ")).map(Gn));ue.filter(e=>e.includes(" "));var Xn=/^([xy])=([+-]?)(\d{1,5})(%?)$/;var Kn=e=>{let t=Xn.exec(e);if(!t)return null;let[,n,i,r,s]=t,o=Number(r);return !s&&o>2e4||s&&o>100?null:{axis:n,move:{value:i==="-"?-o:o,percent:s==="%",relative:i!==""}}},q=e=>{let t=e.split(",");if(t.length>2)return null;let n={};for(let i of t){let r=Kn(i.trim());if(!r||n[r.axis])return null;n[r.axis]=r.move;}return n.x||n.y?n:null};var di=new Set(["read","retag","scroll","navigate","click","fill","submit"]);function de(e,t){let{method:n,args:i}=t!=null?t:{};if(typeof n!="string"||!di.has(n))throw new Error(`not a page surface method: ${String(n)}`);if(!Array.isArray(i))throw new Error("page surface call has no args");return e[n].apply(e,i)}var hi={happy:[{shape:"mouthSmile",weight:.8},{shape:"cheekSquint",weight:.2}],surprised:[{shape:"browInnerUp",weight:.25},{shape:"browOuterUp",weight:.25},{shape:"eyeWide",weight:.1},{shape:"jawOpen",weight:.4,mouth:true}],angry:[{shape:"browDown",weight:.85},{shape:"noseSneer",weight:.15}],sad:[{shape:"mouthFrown",weight:.55,mouth:true},{shape:"browInnerUp",weight:.45}]};[...new Set([...Object.values(hi).flatMap(e=>e.map(t=>t.shape)),"eyeBlink"])];var pi={top:"top",middle:"middle",center:"middle",centre:"middle",bottom:"bottom"},mi=new Set(["up","down"]),he=e=>{let t=e.trim().toLowerCase();if(!t)return null;let n=pi[t];if(n)return {kind:"edge",edge:n};if(mi.has(t))return {kind:"step",direction:t};let i=q(t);return i?{kind:"axis",...i}:null};var Ai="af-call:",qe=(e,t=()=>Date.now())=>{let n=`${Ai}${e}`,i=()=>{var s;try{let o=JSON.parse((s=window.sessionStorage.getItem(n))!=null?s:"null");return o&&typeof o.token=="string"&&typeof o.at=="number"?o:null}catch(o){return null}},r=s=>{try{s?window.sessionStorage.setItem(n,JSON.stringify(s)):window.sessionStorage.removeItem(n);}catch(o){}};return {hold:s=>{var o;return r({token:s,at:t(),led:(o=i())==null?void 0:o.led})},markLed:()=>{let s=i();s&&r({...s,led:true});},drop:()=>r(null),take:()=>{let s=i();return r(null),!s||t()-s.at>3e5?null:{token:s.token,led:s.led===true}}}};var bi=/^(cc-|new-password|current-password|one-time-code)/,_i=/\b(?:card (?:number|no|num)|cc (?:number|num|no)|cvv|cvc|csc|security code|iban|ssn|social security|otp)\b/,Ti=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase(),J=(e,t="")=>{if(e.getAttribute("type")==="password"||bi.test(e.getAttribute("autocomplete")||""))return true;let n=["name","id","aria-label","placeholder"].map(i=>e.getAttribute(i)||"").concat(t).join(" ");return _i.test(Ti(n))},X=e=>(e instanceof HTMLButtonElement||e instanceof HTMLInputElement)&&(e.type==="submit"||e.type==="image")&&e.form!==null;var Mi=/\bsponsored\b/i,wi="nav, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]",pe=e=>{var n;if(e.closest(wi))return true;let t=e.closest("header, footer");return !!t&&!((n=t.parentElement)!=null&&n.closest("article, section, main, [role=main]"))},ki=e=>{let t=e.getAttribute("role"),n=Array.from(e.classList).sort().slice(0,3).join(".");return `${e.tagName}${t?`[${t}]`:""}${n?`.${n}`:""}`},Ri=e=>{var t;return [e,e.parentElement,(t=e.parentElement)==null?void 0:t.parentElement].map(n=>n?ki(n):"").join("<")},Ii=e=>{let t=0;for(let n=e.parentElement;n;n=n.parentElement)t+=1;return t},Ye=(e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Pi=e=>{let t=e.ownerDocument.defaultView;if(!t)return false;let n=e.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return i>=0&&r>=0&&i<=t.innerWidth&&r<=t.innerHeight},Q=(e,t)=>{if(e.length<=t)return e;let n=e.slice(0,t),i=n.lastIndexOf(" ");return `${i>0?n.slice(0,i):n}\u2026`},Ci=e=>{let t=new Map,n=new Map;for(let r of e){let s=r.el;for(let o=0;s&&o<=8&&s!==s.ownerDocument.body;o+=1){let a=Ri(s),c=t.get(a);c||t.set(a,c=new Set),c.add(s);let p=n.get(s);p||n.set(s,p=[]),p.push(r),s=s.parentElement;}}let i=[];for(let r of t.values()){if(r.size<3)continue;let s=Array.from(r).sort(Ye);s.some((o,a)=>a>0&&s[a-1].contains(o))||i.push({cards:s,depth:s.reduce((o,a)=>o+Ii(a),0)/s.length});}return {groups:i,controlsIn:n}},Oi=e=>{var n;let t=new Set;for(let i of e){let r=new Set(i.cards);for(let s of e){let o=s.depth-i.depth;if(s===i||o<=0||o>8)continue;let a=new Map;for(let p of s.cards){let m=p.parentElement;for(let E=0;m&&E<8;E+=1,m=m.parentElement)if(r.has(m)){a.set(m,((n=a.get(m))!=null?n:0)+1);break}}if(a.size<3)continue;Array.from(a.values()).reduce((p,m)=>p+m,0)/a.size>=1.5?t.add(i):t.add(s);}}return e.filter(i=>!t.has(i))};function Je(e,t){var A;let n=new Map,i=l=>{let u=n.get(l);return u===void 0&&n.set(l,u=t.textOf(l)),u},{groups:r,controlsIn:s}=Ci(e),o=l=>{var d;if(pe(l)||Mi.test(i(l)))return false;let u=(d=s.get(l))!=null?d:[];return u.length!==1?u.length>1:i(l).length>u[0].name.length+3},a=l=>{var v,g;let u=(y,b)=>i(b.el).length-i(y.el).length,d=l.filter(({el:y})=>y.matches("a[href], [role=link]"));return (g=(v=[...d.filter(({el:y})=>t.pathOf(y))].sort(u)[0])!=null?v:[...d].sort(u)[0])!=null?g:l[0]},c=(l,u)=>{var f;let d=l[0].parentElement;for(let v=0;d&&v<3;v+=1,d=d.parentElement){let g=(f=d.getAttribute("aria-label"))==null?void 0:f.trim();if(g)return Q(g,60);let y=d.previousElementSibling;for(let b=0;y&&b<3;b+=1){let C=y.matches("h1, h2, h3, [role=heading]")?y:y.querySelector("h1, h2, h3, [role=heading]"),O=C?i(C):"";if(O)return Q(O,60);y=y.previousElementSibling;}}return `List ${u}`},p=Oi(r.map(l=>({...l,cards:l.cards.filter(o)})).filter(l=>l.cards.length>=3)).sort((l,u)=>Ye(l.cards[0],u.cards[0])),m={lists:[],primary:new Map,secondary:new Set},E=new Set;for(let l of p){if(m.lists.length>=6)break;let u=m.lists.length+1,d=[],f=[],v=0;for(let g of l.cards){let y=((A=s.get(g))!=null?A:[]).filter(({el:I})=>!E.has(I)),b=a(y);if(!b)continue;let C=i(b.el),O=Q(i(g).replace(C," ").replace(/\s+/g," ").trim(),90);d.push([b.el,{list:u,position:d.length+1,...Pi(g)&&{screenPosition:++v},...O&&{detail:O},name:Q(C,60)||b.name}]);for(let{el:I}of y)I!==b.el&&f.push(I);}if(!(d.length<3)){m.lists.push({id:u,name:c(l.cards,u),total:d.length});for(let[g,y]of d)m.primary.set(g,y),E.add(g);for(let g of f)m.secondary.add(g),E.add(g);}}return m}var me=/^skip (?:to\b|navigation\b|nav\b|main\b|links\b)/i,Ni=25,Li=60,xi=40,Ee={maxControls:Li,reservedLinks:0,groupLists:false,maxItems:0,preferVisible:false};var st=60,Di=120,Fi=200,Qe=2,ot="main, section, article, aside, nav, header, footer, [role=region], [role=tabpanel], [role=main], [role=navigation], [role=banner], [role=contentinfo]",at="h1, h2, h3, [role=heading]",lt="button, summary, [role=button], [role=tab], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=option], input[type=submit], input[type=button], input[type=reset]",Hi=new Set(["option","menuitemradio","menuitemcheckbox"]),ct="a[href], [role=link]",ve="input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]), select, textarea, [contenteditable=''], [contenteditable=true], [role=textbox], [role=combobox]",Bi="form, [role=form]",Ze={section:"s",button:"b",link:"l",field:"f",form:"frm"},_=(e,t)=>(e.getAttribute(t)||"").trim(),ut=/\s*[.(]?\s*opens? in (?:a )?new (?:tab|window)\)?\.?/gi,w=(e,t=st)=>e.replace(ut,"").replace(/\s+/g," ").trim().slice(0,t),dt=(e,t)=>{let n=w(e,1/0);if(n.length<=t)return n;let i=n.slice(0,t),r=i.lastIndexOf(" ");return r>0?i.slice(0,r):i},Ui=e=>!!e.body&&e.body.getBoundingClientRect().width>0,ye=(e,t)=>{let n=e;if(typeof n.checkVisibility=="function"&&!n.checkVisibility({contentVisibilityAuto:true,visibilityProperty:true}))return false;if(!t)return true;let i=e.getBoundingClientRect();return i.width>=Qe&&i.height>=Qe},Wi=(e,t)=>{let n=t.defaultView;if(!n)return false;let i=e.getBoundingClientRect(),r=i.left+i.width/2,s=i.top+i.height/2;if(r<0||s<0||r>n.innerWidth||s>n.innerHeight)return false;let o=t.elementFromPoint(r,s);return !!o&&o!==e&&!e.contains(o)&&!o.contains(e)},Vi=(e,t)=>{let n=t.defaultView;if(!n)return true;let i=e.getBoundingClientRect();return i.bottom>0&&i.right>0&&i.top<n.innerHeight&&i.left<n.innerWidth},Gi=(e,t)=>{if(e.closest("[inert]"))return true;let n=t.defaultView;return n?n.getComputedStyle(e).pointerEvents==="none":false},te=e=>{let t=_(e,"aria-label");if(t)return w(t);let n=_(e,"aria-labelledby");if(!n)return "";let i=n.split(/\s+/).map(r=>{let s=e.ownerDocument.getElementById(r);return s?x(s):""}).join(" ");return w(i)},$i=new Set(["A","ABBR","B","BDI","BDO","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","RUBY","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]),ht="script, style, [aria-hidden=true], [hidden]",x=(e,t,n=true)=>{if(e.nodeType===Node.TEXT_NODE)return e.nodeValue||"";if(e.nodeType!==Node.ELEMENT_NODE)return "";let i=e;if(!n&&t&&i.matches(t))return "";let r="";for(let s of Array.from(i.childNodes))r+=x(s,t,false);return $i.has(i.tagName)?r:` ${r} `},pt=(e,t)=>{var r;let n=[],i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:s=>s!==e&&s.nodeType===Node.ELEMENT_NODE&&s.matches(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let s=i.nextNode();s;s=i.nextNode())s.nodeType===Node.TEXT_NODE&&n.push((r=s.nodeValue)!=null?r:"");return n},Xi=e=>{let t=w(x(e,ht));return t.length>Fi?"":t},Ki=e=>{let t=e.querySelector("img[alt], [role=img][aria-label]");return t?w(_(t,"alt")||_(t,"aria-label")):""},zi=e=>{var i;let t=(i=e.labels)==null?void 0:i[0];if(t)return w(x(t));if(e.id){let r=e.ownerDocument.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(r)return w(x(r))}let n=e.closest("label");return n?w(x(n)):""},ji=e=>e.length>=3&&/[a-z]/i.test(e)&&/[aeiou]/i.test(e)&&!/\d{3}/.test(e),H=e=>{if(!e)return "";let t=w(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase());return ji(t)?t:""},qi=e=>{let t=_(e,"autocomplete");if(t&&t!=="off"&&t!=="on")return H(t);let n=_(e,"type");return n&&n!=="text"?`${n} field`:""},Yi=(e,t)=>{for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(n.matches(ot))return false;return true},mt=e=>{for(let t of Array.from(e.querySelectorAll(at)))if(Yi(e,t))return w(x(t));return ""},Ji=4,ft=30,K=e=>{for(let[t,n]of e){let i=n();if(i)return {name:i,namedBy:t}}return {name:"",namedBy:"none"}},Qi={nav:"navigation",header:"header",footer:"footer",main:"main content",aside:"sidebar"},Zi=e=>K([["aria",()=>te(e)],["heading",()=>mt(e)],["id",()=>H(e.id)],["landmark",()=>{var t;return (t=Qi[e.tagName.toLowerCase()])!=null?t:""}]]),et=e=>K([["aria",()=>te(e)],["text",()=>Xi(e)],["img-alt",()=>Ki(e)],["title",()=>_(e,"title")],["id",()=>H(_(e,"name")||e.id)]]),er=e=>K([["aria",()=>te(e)],["label",()=>zi(e)],["placeholder",()=>_(e,"placeholder")],["title",()=>_(e,"title")],["id",()=>H(_(e,"name")||e.id)],["type",()=>qi(e)]]),gt=e=>_(e,"role")==="combobox"&&!(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement),tr=e=>e.hasAttribute("data-placeholder")?"":w(pt(e,"[aria-hidden=true]").join("")),nr=(e,t)=>{if(!Hi.has(_(e,"role")))return null;let n=e.closest("[role=listbox], [role=menu]");if(!(n!=null&&n.id))return null;let i=CSS.escape(n.id);return t.querySelector(`[aria-controls~="${i}"], [aria-owns~="${i}"]`)},ir=e=>{let t=_(e,"type");if(t==="checkbox"||t==="radio")return t;if(gt(e))return "combobox";let n=_(e,"autocomplete");if(n&&n!=="off"&&n!=="on")return n;if(t)return t;let i=e.tagName.toLowerCase();return i==="select"||i==="textarea"||i==="input"?i:_(e,"role")==="combobox"?"combobox":"text"},rr=e=>e instanceof HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"),fe=12,sr=e=>{let t=Array.from(e.options).filter(i=>!i.disabled&&i.value!=="").map(i=>w(i.label||i.text,st)).filter(Boolean);if(t.length<=fe)return t;let n=t.length-fe;return [...t.slice(0,fe),`+${n} more`]},tt=e=>e.disabled===true||_(e,"aria-disabled")==="true",or=e=>{if(rr(e))return {checked:e.checked};if(!gt(e))return {filled:ar(e)};let t=tr(e);return t?{shows:t}:{filled:false}},ar=e=>{let t=e.value;return typeof t=="string"?t.trim().length>0:w(e.textContent||"").length>0},nt=(e,t)=>{let n=_(e,"href");if(!(!n||n.startsWith("#")))try{let i=new URL(n,t.baseURI);return i.origin===t.location.origin?i.pathname+i.search:void 0}catch(i){return}},ge=60,lr=e=>{if(e.length<=ge)return e;let t=e.split("?")[0];return t.length<=ge?t:`${t.slice(0,ge)}\u2026`},cr=e=>{for(let t of ["q","url","u"]){let n=e.searchParams.get(t);if(!(!n||!/^https?:\/\//i.test(n)))try{let i=new URL(n);if(i.origin!==e.origin)return i}catch(i){}}},ur=e=>{var t,n,i,r;return (r=(i=(n=(t=e.querySelector("cite"))==null?void 0:t.textContent)==null?void 0:n.trim().match(/^(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+(?:\.[a-z0-9-]+)+)/i))==null?void 0:i[1])==null?void 0:r.toLowerCase()},dr=(e,t)=>{var i;let n=_(e,"href");if(!(!n||n.startsWith("#")))try{let r=new URL(n,t.baseURI);if(!/^https?:$/.test(r.protocol))return;let s=r.origin===t.location.origin?cr(r):r;return (i=s==null?void 0:s.hostname.replace(/^www\./,""))!=null?i:ur(e)}catch(r){return}},it=e=>e.split("?")[0].replace(/\/+$/,"")||"/",hr=/\s+[—–|·:]\s+/,pr=(e,t)=>K([["route",()=>fr(H(mr(e.location.pathname)))],["self-link",()=>w(t)],["title",()=>w(e.title.split(hr)[0]||"")]]),mr=e=>e.split("/").filter(Boolean).pop()||"",fr=e=>e?e[0].toUpperCase()+e.slice(1):"",gr=(e,t)=>{let n=e;for(let i=0;i<t&&n;i+=1)n=n.parentElement;return n?dt(x(n,`${lt}, ${ct}, ${ve}`),ft):""},Z=(e,t=[])=>{let n=new Map;for(let r of e){let s=n.get(r.name);s?s.push(r):n.set(r.name,[r]);}let i=[];for(let r of n.values()){if(r.length===1){i.push(r[0]);continue}let s=_(r[0].el,"href");if(s&&r.every(c=>_(c.el,"href")===s)){i.push({...r[0],count:r.length});continue}let o=r.map(c=>dt(vt(c.el,t),ft));if(o.every(Boolean)&&new Set(o).size===r.length){r.forEach((c,p)=>{c.name=`${c.name} \u2014 in "${o[p]}"`;}),i.push(...r);continue}let a=false;for(let c=1;c<=Ji&&!a;c+=1){let p=r.map(m=>gr(m.el,c));p.some(m=>!m)||new Set(p).size===r.length&&(r.forEach((m,E)=>{m.name=`${m.name} \u2014 ${p[E]}`;}),a=true);}a?i.push(...r):i.push({...r[0],count:r.length});}return i.sort(Se)},ee=(e,t,n,i,r=false)=>{let s=[],o=[],a=0;for(let c of Array.from(e.querySelectorAll(t))){if(!ye(c,n)||r&&n&&Gi(c,e))continue;let p=r&&n&&Wi(c,e),m=i(c);if(p){m.name&&o.push(m.name);continue}if(!m.name){a+=1;continue}s.push({el:c,name:m.name,namedBy:m.namedBy});}return {named:s,unnamed:a,covered:o}},vr=e=>e.length>=2&&/[a-z]/i.test(e),Sr=(e,t,n)=>{let i=[];for(let r of Array.from(e.querySelectorAll(at))){if(!ye(r,t)||n.some(o=>o.contains(r)))continue;let s=w(r.textContent||"");vr(s)&&i.push({el:r,name:s,namedBy:"heading-block"});}return i},Se=(e,t)=>e.el.compareDocumentPosition(t.el)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1,Er=e=>{let t=[];for(let n of e)t.some(r=>r.name===n.name&&(r.el.contains(n.el)||n.el.contains(r.el)))||t.push(n);return t},vt=(e,t)=>{let n="",i="";for(let r of t)r.el.contains(e)?n=r.name:r.el.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(i=r.name);return n||i},yr=e=>pt(e,ht).join(" ").replace(ut,"").replace(/\s+/g," ").trim(),Ar=(e,t)=>{let n=Array.from(e.primary).sort(([,i],[,r])=>(i.screenPosition?0:1)-(r.screenPosition?0:1)||i.list-r.list||i.position-r.position);return new Map(n.slice(0,t))},rt=({list:e,position:t,screenPosition:n,detail:i})=>({list:e,position:t,...n&&{screenPosition:n},...i&&{detail:i}});function St(e=document,t=1,n=Ee){var Ve;let i=Ui(e),r=new Map,s=[],o={},a={section:0,button:0,link:0,field:0,form:0},c=new Map,p=(h,S)=>{a[S]+=1;let M=`${Ze[S]}${a[S]}`;return r.set(M,h),c.set(h,M),M},m=ee(e,ot,i,Zi);o.section=m.unnamed;let E=Er([...m.named,...Sr(e,i,m.named.map(h=>h.el))].sort(Se)),A=Z(E).slice(0,Ni),l=A.filter(h=>h.namedBy!=="landmark");for(let{el:h,name:S,namedBy:M}of l)s.push({handle:p(h,"section"),kind:"section",name:S,namedBy:M});let u=ee(e,lt,i,et,true);u.named=u.named.filter(h=>!h.el.matches(ve));let d=ee(e,ct,i,et,true);u.named=u.named.filter(({name:h})=>!me.test(h)),d.named=d.named.filter(({name:h})=>!me.test(h));let f=ee(e,ve,i,er,true);o.button=u.unnamed,o.link=d.unnamed,o.field=f.unnamed;let v=n.groupLists&&i?Je([...u.named,...d.named],{textOf:yr,pathOf:h=>nt(h,e)}):null,g=v?Ar(v,n.maxItems):null;if(v&&g){let h=S=>v.primary.has(S.el)&&!g.has(S.el);u.named=u.named.filter(S=>!h(S)),d.named=d.named.filter(S=>!h(S));for(let S of [...u.named,...d.named]){let M=g.get(S.el);M&&(S.name=M.name);}}let y=Z(f.named,A),b=Z(u.named,A),C=Z(d.named,A),O=Math.min(n.reservedLinks,C.length),I={left:n.maxControls-O},ae=h=>{let S=Vi(h.el,e)?0:3;return v!=null&&v.secondary.has(h.el)?S?7:6:g!=null&&g.has(h.el)?S:S+(pe(h.el)?2:1)},F=h=>{let S=Math.max(0,I.left),M=h.slice(0,S);if(n.preferVisible&&i&&h.length>S){let k=h.map(T=>({candidate:T,rank:ae(T)}));k.sort((T,P)=>T.rank-P.rank),M=k.slice(0,S).map(({candidate:T})=>T).sort(Se);}return I.left-=M.length,M};for(let{el:h,name:S,namedBy:M,count:k}of F(y))s.push({handle:p(h,"field"),kind:"field",name:S,namedBy:M,fieldType:ir(h),...or(h),...h instanceof HTMLSelectElement&&{options:sr(h)},...k&&{count:k},...tt(h)&&{disabled:true},...J(h,S)&&{sensitive:true}});for(let{el:h,name:S,namedBy:M,count:k}of F(b)){let T=nr(h,e),P=T?c.get(T):void 0,G=g==null?void 0:g.get(h);s.push({handle:p(h,"button"),kind:"button",name:S,namedBy:M,...G&&{item:rt(G)},...P&&{choiceOf:P},...k&&{count:k},...X(h)&&{submits:true},...tt(h)&&{disabled:true}});}let hn=it(e.location.pathname),le="";I.left+=O;for(let{el:h,name:S,namedBy:M,count:k}of F(C)){let T=nt(h,e),P=dr(h,e),G=T!=null&&T.includes("?")?T.slice(T.indexOf("?")):"",Ge=!!T&&it(T)===hn&&(!G||G===e.location.search);Ge&&!le&&(le=S);let ce=g==null?void 0:g.get(h);s.push({handle:p(h,"link"),kind:"link",name:S,namedBy:M,...ce&&{item:rt(ce)},...k&&{count:k},...T&&!ce&&!P&&{path:lr(T)},...P&&{site:P},...Ge&&{current:true}});}let pn=new Map(s.map(h=>[r.get(h.handle),h.handle]));for(let h of Array.from(e.querySelectorAll(Bi))){if(!ye(h,i))continue;let S=[];for(let[T,P]of pn)h.contains(T)&&!P.startsWith(Ze.section)&&S.push(P);if(S.length===0)continue;let{name:M,namedBy:k}=K([["aria",()=>te(h)],["heading",()=>mt(h)],["section",()=>vt(h,A)],["id",()=>H(_(h,"name")||h.id)]]);s.push({handle:p(h,"form"),kind:"form",name:M||"form",namedBy:k,children:S});}let{name:mn,namedBy:fn}=pr(e,le),gn=new Set(s.map(h=>{var S;return (S=h.item)==null?void 0:S.list})),We=(Ve=v==null?void 0:v.lists.filter(h=>gn.has(h.id)))!=null?Ve:[],vn=[...new Set([...u.covered,...d.covered,...f.covered].filter(h=>!me.test(h)))].slice(0,xi);return {index:{generation:t,url:e.location.pathname+e.location.search,title:w(e.title,Di),pageName:mn||"this",pageNamedBy:fn,nodes:s,unnamed:o,...We.length>0&&{lists:We},...i&&{covered:vn}},elements:r}}var _t=/^(?:true|yes|y|on|1|check|checked|tick|ticked|select|selected)$/i,br=/^(?:false|no|n|off|0|uncheck|unchecked|untick|unticked|deselect)$/i,_r={date:"dates go in as YYYY-MM-DD",time:"times go in as HH:MM, 24-hour","datetime-local":"a date and time goes in as YYYY-MM-DDTHH:MM",month:"a month goes in as YYYY-MM",week:"a week goes in as YYYY-Www",number:"only a plain number fits",range:"only a plain number fits",color:"a colour goes in as #rrggbb"},Et=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim(),yt=(e,t)=>{let n=e.filter(t);return n.length===1?n[0]:void 0},Tt=(e,t,n)=>{var s,o;let i=Et(n);if(!i)return;let r=a=>t(a).map(Et);return (o=(s=e.find(a=>r(a).includes(i)))!=null?s:yt(e,a=>r(a).some(c=>c.startsWith(i))))!=null?o:yt(e,a=>r(a).some(c=>c.includes(i)))},Tr=(e,t)=>{var r;let n=Object.getPrototypeOf(e),i=(r=Object.getOwnPropertyDescriptor(n,"value"))==null?void 0:r.set;i?i.call(e,t):e.value=t;},Mt=(e,t)=>{e.focus({preventScroll:true}),Tr(e,t),e.dispatchEvent(new Event("input",{bubbles:true})),e.dispatchEvent(new Event("change",{bubbles:true})),e.blur();},At=(e,t)=>e.readOnly?{outcome:"read_only"}:(Mt(e,t),t&&e.value===""?{outcome:"rejected",detail:_r[e.type]}:t&&!e.validity.valid?{outcome:"invalid",detail:e.validationMessage}:{outcome:"ok"}),Mr=(e,t)=>{let n=Array.from(e.options).filter(r=>!r.disabled),i=Tt(n,r=>[r.value,r.label||r.text],t);return i?(Mt(e,i.value),{outcome:"ok"}):{outcome:"no_such_option",detail:n.filter(r=>r.value!=="").map(r=>r.label||r.text).join(", ")}},bt=e=>{var t,n,i;return ((i=(n=(t=e.labels)==null?void 0:t[0])==null?void 0:n.textContent)==null?void 0:i.trim())||e.getAttribute("aria-label")||e.value},wr=(e,t)=>{var s,o;let n=(s=e.form)!=null?s:e.ownerDocument,i=e.name?Array.from(n.querySelectorAll(`input[type=radio][name="${CSS.escape(e.name)}"]`)):[e],r=(o=Tt(i,a=>[a.value,bt(a)],t))!=null?o:_t.test(t.trim())?e:void 0;return r?r.disabled?{outcome:"disabled"}:(r.checked||r.click(),r.checked?{outcome:"ok"}:{outcome:"rejected"}):{outcome:"no_such_option",detail:i.map(bt).join(", ")}},kr=(e,t)=>{let n=_t.test(t.trim())?true:br.test(t.trim())?false:void 0;return n===void 0?{outcome:"rejected",detail:'a tick box takes "yes" or "no"'}:(e.checked!==n&&e.click(),e.checked===n?{outcome:"ok"}:{outcome:"rejected"})},Rr=(e,t)=>{var i;return e.focus({preventScroll:true}),(i=window.getSelection())==null||i.selectAllChildren(e),(t?document.execCommand("insertText",false,t):document.execCommand("delete"))||(e.textContent=t,e.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:t}))),e.blur(),{outcome:"ok"}},wt=(e,t)=>e instanceof HTMLSelectElement?Mr(e,t):e instanceof HTMLTextAreaElement?At(e,t):e instanceof HTMLInputElement?e.type==="radio"?wr(e,t):e.type==="checkbox"?kr(e,t):e.type==="file"?{outcome:"not_fillable"}:At(e,t):e instanceof HTMLElement&&e.isContentEditable?Rr(e,t):{outcome:"not_fillable"},Ir=e=>"willValidate"in e&&e.willValidate,Pr=(e,t)=>{let n=Array.from(e.elements).find(r=>Ir(r)&&!r.validity.valid);if(!n)return;let i=n.validationMessage||"still needs a valid value";return `"${t(n)}": ${i}`},kt=(e,t,n=false)=>{let i=e.form;if(i&&!i.noValidate&&!e.formNoValidate){let a=Pr(i,t);if(a)return {outcome:"invalid",detail:a}}let r=false,s=false,o=a=>{r=true,s=a.defaultPrevented,n||a.preventDefault();};window.addEventListener("submit",o);try{e.click();}finally{window.removeEventListener("submit",o);}return !r||s||n?{outcome:"ok"}:{outcome:"requires_reload"}};var Cr=new Set(["date","time","datetime-local","month","week","color"]),Or=e=>{let t=e.getBoundingClientRect();return {clientX:t.left+t.width/2,clientY:t.top+t.height/2}},z=(e,t,n,i)=>{let r={bubbles:true,cancelable:true,composed:true,view:window,button:0,buttons:i?1:0,...n};return t.startsWith("pointer")?typeof PointerEvent!="function"?true:e.dispatchEvent(new PointerEvent(t,{...r,pointerId:1,pointerType:"mouse",isPrimary:true})):e.dispatchEvent(new MouseEvent(t,r))},Ae=e=>{let t=Or(e),n=z(e,"pointerdown",t,true),i=z(e,"mousedown",t,true);n&&i&&e instanceof HTMLElement&&e.focus({preventScroll:true}),z(e,"pointerup",t,false),z(e,"mouseup",t,false),e instanceof HTMLElement?e.click():z(e,"click",t,false);},Nr=e=>{var n;if(e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&Cr.has(e.type))try{(n=e.showPicker)==null||n.call(e);}catch(i){}},Rt=e=>{Ae(e),Nr(e);};var B=0,D=0,ne=null,Lr=()=>{let e=ne;if(ne=null,e==="forward"){B+=1,D=Math.max(0,D-1);return}e==="back"?D+=1:D=0,B=Math.max(0,B-1);},be={canGo:e=>e==="back"?B>0:D>0,go(e){ne=e,e==="back"?window.history.back():window.history.forward();}};function It(e){let t=window.navigation;if(!t)return xr(e);let n=null,i=()=>{n&&clearTimeout(n),n=setTimeout(e,500);};return t.addEventListener("navigatesuccess",i),()=>{n&&clearTimeout(n),t.removeEventListener("navigatesuccess",i);}}function xr(e){if(typeof window=="undefined")return ()=>{};let t=null,n=()=>{t&&clearTimeout(t),t=setTimeout(e,500);};B=0,D=0,ne=null;let{pushState:i,replaceState:r}=window.history,s=(p,m)=>function(...E){let A=p.apply(this,E);return m&&(B+=1,D=0),n(),A},o=()=>{Lr(),n();},a=s(i,true),c=s(r,false);return window.history.pushState=a,window.history.replaceState=c,window.addEventListener("popstate",o),window.addEventListener("hashchange",n),()=>{t&&clearTimeout(t),window.history.pushState===a&&(window.history.pushState=i),window.history.replaceState===c&&(window.history.replaceState=r),window.removeEventListener("popstate",o),window.removeEventListener("hashchange",n);}}var Dr=.8,Fr="l",we="b",_e="f",Nt="s",Hr=new Set([Nt,we]),U=e=>{var t,n;return (n=(t=/^([a-z]{1,4})\d{1,4}$/.exec(e))==null?void 0:t[1])!=null?n:""},Br=/\s+—\s+.*$/,Te=e=>e.toLowerCase().replace(/\s+/g," ").trim(),Ur=e=>{try{return new URL(e,window.location.href).origin===window.location.origin}catch(t){return false}},Pt=e=>e.replace(/\/+$/,"")||"/",Wr=e=>{try{return Pt(new URL(e,window.location.href).pathname)===Pt(window.location.pathname)}catch(t){return false}},Ct=(e,t,n)=>{let i=false,r=o=>{i=o.defaultPrevented,t||o.preventDefault();};window.addEventListener("click",r);try{e.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));}finally{window.removeEventListener("click",r);}if(i||t)return "ok";let s=e.href;return n===void 0||!s?"requires_reload":(setTimeout(()=>window.location.assign(s),n),"ok")},Me=e=>e.matches(":disabled")||e.getAttribute("aria-disabled")==="true",Vr=new Set(["back","forward"]),Lt=e=>be.canGo(e)?(be.go(e),"ok"):"no_history",Gr=e=>{let t=window.navigation;return t?(e==="back"?!t.canGoBack:!t.canGoForward)?"no_history":(e==="back"?t.back():t.forward(),"ok"):Lt(e)},$r=()=>{let e=document.documentElement;return {x:Math.max(0,e.scrollWidth-window.innerWidth),y:Math.max(0,e.scrollHeight-window.innerHeight)}},Ot=(e,t,n,i)=>{if(!e)return t;if(e.relative){let r=e.percent?i*e.value/100:e.value;return t+r}return e.percent?n*e.value/100:e.value},Xr=e=>{let t=$r();if(e.kind==="edge"){let n=e.edge==="top"?0:e.edge==="bottom"?t.y:t.y/2;window.scrollTo({top:n,behavior:"smooth"});return}if(e.kind==="step"){let n=window.innerHeight*Dr;window.scrollBy({top:e.direction==="up"?-n:n,behavior:"smooth"});return}window.scrollTo({left:Ot(e.x,window.scrollX,t.x,window.innerWidth),top:Ot(e.y,window.scrollY,t.y,window.innerHeight),behavior:"smooth"});};function ke(e={}){var m,E,A;let t=(m=e.survivesDocumentLoad)!=null?m:false,n=(E=e.indexProfile)!=null?E:Ee,i=(A=e.followLinksAnywhere)!=null?A:false,r=e.documentLoadAfterMs,s=null,o=(l,u)=>{var d;return !s||s.generation!==u?null:(d=s.elements.get(l))!=null?d:null},a=l=>{let u=s==null?void 0:s.elements.get(l);return u!=null&&u.isConnected?{element:u,isSection:U(l)===Nt}:null},c=l=>(s==null?void 0:s.generation)===l?"unknown_target":"stale",p=l=>{var u,d,f,v,g;for(let[y,b]of (u=s==null?void 0:s.elements)!=null?u:[])if(b===l)return (d=s==null?void 0:s.names.get(y))!=null?d:y;return ((g=(v=(f=l.labels)==null?void 0:f[0])==null?void 0:v.textContent)==null?void 0:g.trim())||l.getAttribute("aria-label")||l.getAttribute("placeholder")||l.getAttribute("name")||"a field"};return {elementNamed(l){let u=Te(l);if(!s||!u)return null;let d=null;for(let[f,v]of s.names)if(Hr.has(U(f))){if(Te(v)===u)return a(f);!d&&Te(v.replace(Br,""))===u&&(d=f);}return d?a(d):null},read(l){let{index:u,elements:d}=St(document,l,n),f=new Map(u.nodes.map(v=>[v.handle,v.name]));return s={generation:l,elements:d,names:f},u},retag(l){s&&(s.generation=l);},scroll(l,u){let d=he(l);if(d)return Xr(d),"ok";if(u===void 0)return "unknown_target";let f=o(l,u);return f?f.isConnected?(f.scrollIntoView({behavior:"smooth",block:"start"}),"ok"):"stale":c(u)},navigate(l,u){if(Vr.has(l)){let g=l;return t?Gr(g):Lt(g)}if(u===void 0)return "unknown_target";if(U(l)!==Fr)return "not_navigable";let d=o(l,u);if(!d)return c(u);if(!d.isConnected)return "stale";let f=d.getAttribute("href");if(!f)return "not_navigable";let v=Ur(f);return !v&&!i?"not_navigable":v&&Wr(f)?"already_here":Ct(d,t,r)},click(l,u){if(u===void 0)return "unknown_target";let d=U(l);if(d!==we&&d!==_e)return "not_clickable";let f=o(l,u);return f?f.isConnected?X(f)?"submits_form":Me(f)?"disabled":(f.scrollIntoView({behavior:"smooth",block:"center"}),d===_e?(Rt(f),"ok"):f.closest("a[href]")?Ct(f,t,r)==="ok"?"ok":"requires_reload":(Ae(f),"ok")):"stale":c(u)},fill(l,u){let d=false;return l.map(({handle:f,value:v})=>{var I;let g=(I=s==null?void 0:s.names.get(f))!=null?I:f,y=(ae,F)=>({handle:f,name:g,outcome:ae,...F&&{detail:F}});if(u===void 0)return y("unknown_target");if(U(f)!==_e)return y("not_fillable");let b=o(f,u);if(!b)return y(c(u));if(!b.isConnected)return y("stale");if(J(b,g))return y("sensitive");if(Me(b))return y("disabled");d||(b.scrollIntoView({behavior:"smooth",block:"center"}),d=true);let{outcome:C,detail:O}=wt(b,v);return y(C,O)})},submit(l,u){if(u===void 0)return {outcome:"unknown_target"};if(U(l)!==we)return {outcome:"not_a_submit"};let d=o(l,u);return d?d.isConnected?X(d)?Me(d)?{outcome:"disabled"}:(d.scrollIntoView({behavior:"smooth",block:"center"}),kt(d,p,t)):{outcome:"not_a_submit"}:{outcome:"stale"}:{outcome:c(u)}}}}ke();var xt="avatarfactory";var Dt="resume",Ft="resume";var zr=new Set(["ready","resize","state","event","beacon","action.run","action.flow","action.check","page.call","tour.do"]),jr=(e,t)=>({ns:xt,v:1,deployId:e,...t}),Ht=(e,t)=>{if(e.origin!==t.origin||t.source!==void 0&&e.source!==t.source)return null;let n=e.data;return !n||typeof n!="object"||n.ns!==xt||n.v!==1||n.deployId!==t.deployId||typeof n.type!="string"||!(zr).has(n.type)?null:n},Bt=(e,t,n,i)=>{e.postMessage(jr(n,i),t);};var qr=e=>e.top>=96&&e.bottom<=window.innerHeight-96,Yr=e=>new Promise(t=>{let n=Number.NaN,i=0,r=0,s=()=>{clearTimeout(o),cancelAnimationFrame(r),t();},o=setTimeout(s,1600),a=()=>{let c=e.getBoundingClientRect().top;i=Math.abs(c-n)<.5?i+1:0,n=c,i>=5?s():r=requestAnimationFrame(a);};r=requestAnimationFrame(a);}),Re=async e=>{let t=e.getBoundingClientRect();if(qr(t))return;let n=t.height<=window.innerHeight-192;e.scrollIntoView({behavior:"smooth",block:n?"center":"start"}),await Yr(e);};var Jr=".af-widget, .af-tour-layer",Qr="h1, h2, h3, h4, h5, h6, button, a, [role=button], label, li, p";var Ce=e=>e.toLowerCase().replace(/\s+/g," ").trim(),Ie=e=>{if(e.closest(Jr)||e.closest("[aria-hidden='true'], [hidden]"))return false;let t=e.getBoundingClientRect();if(t.width<2||t.height<2)return false;let n=e.checkVisibility;return typeof n=="function"?n.call(e,{visibilityProperty:true}):true},Wt=e=>{var t,n;return Ce((n=(t=e.innerText)!=null?t:e.textContent)!=null?n:"")},Pe=e=>{let t=document.createRange();t.selectNodeContents(e);let n=t.getBoundingClientRect();return n.width>=2&&n.height>=2?n:e.getBoundingClientRect()},ie=e=>e.width*e.height;var Vt=e=>{let t=e.getBoundingClientRect(),n=Pe(e);return ie(t)<=ie(n)*4?t:n},Zr=(e,t,n)=>{let i=e;for(;i.parentElement&&i.parentElement!==n;){let r=i.parentElement;if(Wt(r).length>t.length+40||ie(Pe(r))>ie(Pe(i))*4)break;i=r;}return i},es=(e,t)=>{let n=Ce(e);return n===t?3:n.startsWith(t)?2:n.includes(t)?1:0},ts="h1, h2, h3, h4, h5, h6, [role=heading]",Oe=(e,t)=>{var r,s,o;if(typeof document=="undefined"||!document.body)return null;let n=Ce(e);if(!n)return null;let i=t==null?void 0:t(e);if(i&&Ie(i.element)){if(!i.isSection)return i.element;let a=c=>Array.from(i.element.querySelectorAll(c)).find(Ie);return (o=(s=(r=Ut(i.element,n))!=null?r:a(ts))!=null?s:a("p"))!=null?o:i.element}return Ut(document.body,n)},Ut=(e,t)=>{var a,c;let n=null,i=0,r=false,s=(p,m,E=false)=>{if(!p)return;let A=es(m,t);A<=i||!Ie(p)||(n=p,i=A,r=E);},o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let p=o.nextNode();p&&i<3;p=o.nextNode())s(p.parentElement,(a=p.textContent)!=null?a:"");for(let p of Array.from(e.querySelectorAll(Qr))){if(i===3)break;s(p,Wt(p));}for(let p of Array.from(e.querySelectorAll("[aria-label], img[alt]"))){if(i===3)break;let m=p.getAttribute("aria-label");s(p,(c=m!=null?m:p.getAttribute("alt"))!=null?c:"",m!==null);}return n?r?n:Zr(n,t,e):null};var ns={min:4,max:16},is={min:2,max:8},Le=50,Gt=(e,t)=>Math.min(t.max,Math.max(t.min,e)),Kt=e=>{let t=parseFloat(getComputedStyle(e).fontSize)||16;return {x:Gt(t*.3,ns),y:Gt(t*.12,is)}},xe=220,rs=4,De="af-tour-ink",Fe="af-tour-ink-strong",re="af-tour-ink-behind",$t="af-tour-behind-style",ss="#fef08a",os="#facc15",as="#171717",ls="#ffffff",cs=.179,us=.4,N,zt=e=>{if(N!=null||(N=document.createElement("canvas").getContext("2d",{willReadFrequently:true})),!N)return null;let t="#010203";if(N.fillStyle=t,N.fillStyle=e,N.fillStyle===t&&e.trim().toLowerCase()!==t)return null;N.clearRect(0,0,1,1),N.fillRect(0,0,1,1);let[n,i,r,s]=N.getImageData(0,0,1,1).data;if(s<128)return null;let o=a=>Math.round(a*(s/255)+255*(1-s/255));return [o(n),o(i),o(r)]},Xt=([e,t,n])=>{let i=r=>{let s=r/255;return s<=.04045?s/12.92:((s+.055)/1.055)**2.4};return .2126*i(e)+.7152*i(t)+.0722*i(n)},ds=(e,t)=>e.map(n=>Math.round(n+(255-n)*t/100)),hs=e=>{var n;let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=t.nextNode();i;i=t.nextNode())if((n=i.nodeValue)!=null&&n.trim()&&i.parentElement)return zt(getComputedStyle(i.parentElement).color);return null},jt=()=>typeof CSS!="undefined"&&!!CSS.highlights&&typeof Highlight=="function",qt=(e,t,n)=>{if(!jt())return {behind:false};let i=zt(n!=null?n:t?os:ss);if(!i)return {behind:false};let r=n&&!t?ds(i,Le):i,s=Xt(r)>cs,o=hs(e),a=!!o&&Xt(o)>us;return s&&!a?{behind:false}:{behind:true,background:`rgb(${r.join(" ")})`,ink:s?as:ls}},Yt=(e,t)=>{let n=document.getElementById($t);n||(n=document.createElement("style"),n.id=$t,document.head.appendChild(n));let i=t?`;text-shadow:.35px 0 0 ${e.ink}`:"";n.textContent=`::highlight(${re}){background-color:${e.background};color:${e.ink}${i}}`;},Ne=Math.sqrt(51),ps=e=>{let t=e/1e3;return 1-Math.exp(-7*t)*(Math.cos(Ne*t)+7/Ne*Math.sin(Ne*t))},ms=e=>{for(let t=0;t<800;t+=4)if(ps(t)>=e)return t;return 800},se=e=>{let t=document.createRange();t.selectNodeContents(e);let n=[];for(let i of Array.from(t.getClientRects())){if(i.width<1||i.height<1)continue;let r=n.find(o=>Math.abs(o.top-i.top)<rs);if(!r){n.push({left:i.left,top:i.top,width:i.width,height:i.height});continue}let s=Math.max(r.left+r.width,i.right);r.left=Math.min(r.left,i.left),r.width=s-r.left,r.height=Math.max(r.height,i.height);}return n},Jt=(e,t)=>e.length===t.length&&e.every((n,i)=>Math.abs(n.left-t[i].left)<.5&&Math.abs(n.top-t[i].top)<.5&&Math.abs(n.width-t[i].width)<.5),fs=(e,t)=>{let n=0;return e.forEach((i,r)=>{Math.abs(i.top-t)<Math.abs(e[n].top-t)&&(n=r);}),n},gs=(e,t)=>{var r;let n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode()){let o=(r=s.nodeValue)!=null?r:"",a=t?/\S+\s*/g:/\S+/g;for(let c=a.exec(o);c;c=a.exec(o)){let p=document.createRange();p.setStart(s,c.index),p.setEnd(s,c.index+c[0].length),n.push(p);}}return n},He=(e,t,n)=>{var a;if(!jt()||!t.length)return ()=>{};let i=CSS.highlights,r=(a=i.get(n))!=null?a:new Highlight;i.set(n,r);let s=[],o=gs(e,n===re).map(c=>{let p=c.getBoundingClientRect(),m=fs(t,p.top),E=(p.left+p.width/2-t[m].left)/t[m].width,A=m*200+ms(Math.min(1,Math.max(0,E)));return setTimeout(()=>{r.add(c),s.push(c);},A)});return ()=>{o.forEach(clearTimeout),s.forEach(c=>r.delete(c)),r.size===0&&i.get(n)===r&&i.delete(n);}};var Qt="data-af-pointed",j=new WeakMap,Zt=e=>{var n;j.set(e,((n=j.get(e))!=null?n:0)+1),e.setAttribute(Qt,"");let t=false;return ()=>{var r;if(t)return;t=true;let i=((r=j.get(e))!=null?r:1)-1;if(i>0){j.set(e,i);return}j.delete(e),e.removeAttribute(Qt);}};var en=["transitionrun","animationstart"],tn=["transitionend","transitioncancel","animationend","animationcancel"],nn=(e,t)=>{let n=0,i=performance.now()+1e3,r=0,s=0,o=()=>{n=0,t();let l=performance.now();(l<i||l<s)&&(n=requestAnimationFrame(o));},a=()=>{n||(n=requestAnimationFrame(o));},c=()=>{i=Math.max(i,performance.now()+120),a();},p=l=>l.target instanceof Node&&l.target.contains(e),m=l=>{p(l)&&(r+=1,s=performance.now()+1e3,a());},E=l=>{p(l)&&(r=Math.max(0,r-1),r===0&&(s=0),a());};t(),n=requestAnimationFrame(o),window.addEventListener("scroll",c,{capture:true,passive:true}),en.forEach(l=>document.addEventListener(l,m,{capture:true,passive:true})),tn.forEach(l=>document.addEventListener(l,E,{capture:true,passive:true})),window.addEventListener("resize",a,{passive:true});let A=typeof ResizeObserver=="function"?new ResizeObserver(a):null;return A==null||A.observe(e),()=>{n&&cancelAnimationFrame(n),window.removeEventListener("scroll",c,{capture:true}),window.removeEventListener("resize",a),en.forEach(l=>document.removeEventListener(l,m,{capture:true})),tn.forEach(l=>document.removeEventListener(l,E,{capture:true})),A==null||A.disconnect();}};var rn="afx-tour-style",sn=e=>{let{left:t,top:n,width:i,height:r}=Vt(e);return {left:t,top:n,width:i,height:r}},Ss=`
|
|
2
2
|
.af-tour-layer{position:fixed;inset:0;pointer-events:none;z-index:2147482999;mix-blend-mode:multiply}
|
|
3
3
|
.af-tour-mark{position:absolute;border-radius:4px;background:var(--af-highlight-color,#fef08a);transform-origin:left center;animation:af-tour-mark-in 800ms cubic-bezier(.3,1.25,.6,1) both}
|
|
4
4
|
@supports (animation-timing-function:linear(0,1)){.af-tour-mark{animation-timing-function:linear(0,.047,.161,.306,.458,.601,.726,.828,.907,.965,1.005,1.029,1.042,1.046,1.045,1.04,1.033,1.026,1.02,1.014,1.009,1.005,1.002,1,1)}}
|
|
5
5
|
.af-tour-mark--strong{background:var(--af-highlight-strong-color,#facc15)}
|
|
6
|
-
.af-tour-mark--out{animation:af-tour-mark-out ${
|
|
7
|
-
::highlight(${
|
|
8
|
-
::highlight(${
|
|
6
|
+
.af-tour-mark--out{animation:af-tour-mark-out ${xe}ms ease-in both}
|
|
7
|
+
::highlight(${De}){color:var(--af-highlight-ink,#171717)}
|
|
8
|
+
::highlight(${Fe}){color:var(--af-highlight-strong-ink,#0a0a0a);text-shadow:.35px 0 0 var(--af-highlight-strong-ink,#0a0a0a)}
|
|
9
9
|
@keyframes af-tour-mark-in{from{transform:scaleX(0)}to{transform:scaleX(1)}}
|
|
10
10
|
@keyframes af-tour-mark-out{from{opacity:1}to{opacity:0}}
|
|
11
11
|
@media (prefers-reduced-motion:reduce){.af-tour-mark{animation:none}}
|
|
12
|
-
`,ms=()=>{if(document.getElementById(Qt))return;let e=document.createElement("style");e.id=Qt,e.textContent=ps,document.head.appendChild(e);},en=e=>{let t=null,n=()=>{let s=t;t=null,s&&(s.stop(),s.layer.querySelectorAll(".af-tour-mark").forEach(o=>o.classList.add("af-tour-mark--out")),setTimeout(()=>s.layer.remove(),Le));},i=(s,o,a)=>{ms();let l=document.createElement("div");l.className="af-tour-layer",l.setAttribute("aria-hidden","true"),a&&(l.style.setProperty("--af-highlight-strong-color",a),l.style.setProperty("--af-highlight-color",`color-mix(in srgb, ${a} ${100-Ne}%, white)`)),document.body.appendChild(l);let p=jt(s,o,a);if(p.behind){qt(p,o);let f=Fe(s,re(s),ie);t={layer:l,stop:f};return}let m=Xt(s),y=[],b=false,d=f=>{l.replaceChildren(...f.map((S,g)=>{let E=document.createElement("span");return E.className=`af-tour-mark${o?" af-tour-mark--strong":""}`,Object.assign(E.style,{left:`${S.left-m.x}px`,top:`${S.top-m.y}px`,width:`${S.width+m.x*2}px`,height:`${S.height+m.y*2}px`,animationDelay:b?"":`${g*200}ms`,animationDuration:b?"0s":""}),E})),b=true;},c=Jt(s,()=>{let f=re(s);Yt(y,f)||(y=f,d(f));}),u=Fe(s,re(s),o?De:xe);t={layer:l,stop:()=>{c(),u();}};};return {run:async s=>{switch(s.op){case "clear":return n(),{found:true};case "top":return n(),window.scrollTo({top:0,behavior:"smooth"}),{found:true};case "scroll":{let o=Ce(s.target,e);return o?(await ke(o),{found:true,rect:Zt(o)}):{found:false}}case "mark":{n();let o=Ce(s.target,e);return o?(await ke(o),i(o,s.strong,s.color),{found:true,rect:Zt(o)}):{found:false}}}},clear:n}};var vs="2147483000",Ss=320,Es=500,ys=480,bs=2500,tn=e=>typeof e=="string"?e:JSON.stringify(e!=null?e:null),nn=e=>e instanceof Error?e.message:String(e),W=e=>{let t=e===void 0||e===""?NaN:Number(e);return Number.isFinite(t)?t:void 0},se=e=>e==="true"||e==="on"?true:e==="false"||e==="off"?false:void 0,As=e=>{var o,a;let t=W(e.offsetX),n=W(e.offsetY),i=W(e.panelWidth),r=W(e.panelHeight),s=se(e.tour)===true;return {layout:e.layout==="inline"?"inline":"widget",appearance:{position:e.position,offset:t!==void 0||n!==void 0?{x:(o=t!=null?t:n)!=null?o:0,y:(a=n!=null?n:t)!=null?a:0}:void 0,bubbleSize:W(e.size),panel:i!==void 0&&r!==void 0?{w:i,h:r}:void 0,accent:e.accent||void 0,draggable:se(e.draggable),mobile:e.mobile},tour:s?{once:se(e.tourOnce)===false?"session":"visitor"}:void 0,pageAccess:se(e.page)===true||s}},He=class{constructor(t,n,i,r){this.deployId=t;this.runtimeOrigin=n;this.config=i;this.actions=new Map;this.listeners=new Map;this.outbox=[];this.ready=false;this.viewportFrame=0;this.size={w:0,h:0};this.surface=null;this.stopWatchingPage=null;this.tour=en(t=>{var n,i;return (i=(n=this.surface)==null?void 0:n.elementNamed(t))!=null?i:null});this.leaving=false;this.onPageHide=()=>{this.leaving=true;};this.onViewportChange=()=>{cancelAnimationFrame(this.viewportFrame),this.viewportFrame=requestAnimationFrame(()=>this.sendHostInfo());};this.onMessage=t=>{let n=Ft(t,{origin:this.runtimeOrigin,deployId:this.deployId,source:this.frame.contentWindow});if(n)switch(n.type){case "ready":this.ready=true,this.inline&&(this.frame.style.visibility="visible"),this.sendHostInfo(),this.outbox.splice(0).forEach(i=>this.send(i)),this.emit("ready",n.payload);return;case "resize":this.inline||this.place(n.payload);return;case "state":this.emit("state",n.payload.stage);return;case "event":{let{name:i,detail:r}=n.payload;if(i===xt){typeof(r==null?void 0:r.token)=="string"&&this.keptCall.hold(r.token);return}i==="stop"&&!this.leaving&&this.keptCall.drop(),this.emit(i,r);return}case "beacon":n.payload.blocked&&console.warn(`[avatarfactory] blocked by this page's Content-Security-Policy (${n.payload.blocked})`);return;case "action.flow":this.emit("action.flow",n.payload.flow);return;case "action.run":this.runAction(n.payload);return;case "action.check":this.checkAction(n.payload);return;case "page.call":this.servePage(n.payload.callId,n.payload.call);return;case "tour.do":{let{seq:i,...r}=n.payload;this.tour.run(r).catch(()=>({found:false})).then(s=>this.send({type:"tour.result",payload:{seq:i,...s}}));return}}};var m;this.inline=i.layout==="inline"?r:null,this.frame=document.createElement("iframe");let s=new URLSearchParams({origin:window.location.origin});i.pageAccess&&s.set("page","1"),this.keptCall=je(t);let o=this.keptCall.take(),a=o?`#${new URLSearchParams({[Dt]:o.token,...o.led&&{led:"1"}})}`:"";if(this.frame.src=`${n}/w/${encodeURIComponent(t)}?${s}${a}`,window.addEventListener("pagehide",this.onPageHide),this.frame.title="Avatar assistant",this.frame.allow="microphone; camera; display-capture; autoplay",Object.assign(this.frame.style,{border:"0",margin:"0",padding:"0",background:"transparent",colorScheme:"normal",visibility:"hidden"}),this.inline){let y=(m=W(this.inline.dataset.height))!=null?m:ys;Object.assign(this.frame.style,{display:"block",width:"100%",height:`${y}px`});}else Object.assign(this.frame.style,{position:"fixed",width:"0",height:"0",zIndex:vs});window.addEventListener("message",this.onMessage),window.addEventListener("resize",this.onViewportChange),i.pageAccess&&(this.stopWatchingPage=Rt(()=>this.send({type:"page.changed",payload:{}})));let l=this.inline;if(l){l.appendChild(this.frame);return}let p=()=>document.body.appendChild(this.frame);document.body?p():document.addEventListener("DOMContentLoaded",p,{once:true});}carry(){this.keptCall.markLed();}send(t){let n=this.frame.contentWindow;if(!this.ready||!n){this.outbox.push(t);return}Ht(n,this.runtimeOrigin,this.deployId,t);}setContext(t){clearTimeout(this.contextTimer),this.contextTimer=setTimeout(()=>this.send({type:"context.set",payload:{context:tn(t)}}),Es);}addEvent(t,n){this.send({type:"context.event",payload:{name:t,context:tn(n)}});}registerAction(t){this.actions.set(t.name,t),this.syncActions();}on(t,n){var r;let i=(r=this.listeners.get(t))!=null?r:new Set;i.add(n),this.listeners.set(t,i);}off(t,n){var i;(i=this.listeners.get(t))==null||i.delete(n);}destroy(){var t;this.send({type:"cmd.destroy",payload:{}}),clearTimeout(this.shrinkTimer),clearTimeout(this.contextTimer),cancelAnimationFrame(this.viewportFrame),window.removeEventListener("message",this.onMessage),window.removeEventListener("resize",this.onViewportChange),window.removeEventListener("pagehide",this.onPageHide),this.keptCall.drop(),(t=this.stopWatchingPage)==null||t.call(this),this.tour.clear(),this.frame.remove();}syncActions(){let t=[...this.actions.values()].map(({handler:n,check:i,...r})=>r);this.send({type:"action.set",payload:{actions:t}});}emit(t,n){var i;(i=this.listeners.get(t))==null||i.forEach(r=>{try{r(n);}catch(s){console.error("[avatarfactory] listener failed",s);}});}sendHostInfo(){this.send({type:"host.info",payload:{url:window.location.origin+window.location.pathname,viewport:{w:document.documentElement.clientWidth||window.innerWidth,h:document.documentElement.clientHeight||window.innerHeight},reducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,theme:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",frameLayout:2,config:this.config}});}async servePage(t,n){var i;if(!this.config.pageAccess){this.send({type:"page.result",payload:{callId:t,ok:false,error:"page access is off"}});return}try{(i=this.surface)!=null||(this.surface=we({documentLoadAfterMs:bs}));let r=await ue(this.surface,n);this.send({type:"page.result",payload:{callId:t,ok:!0,value:r}});}catch(r){this.send({type:"page.result",payload:{callId:t,ok:false,error:nn(r)}});}}place(t){var l;clearTimeout(this.shrinkTimer);let n=this.frame.style,i=t.position.endsWith("right"),r=t.position.startsWith("bottom"),s=(l=t.gutter)!=null?l:0,o=(p,m)=>{if(this.size={w:p,h:m},t.sheet){Object.assign(n,{left:"0",top:"0",right:"auto",bottom:"auto",width:"100%",height:"100%"});return}let y=p+s*2,b=m+s*2,d={width:`${y}px`,height:`${b}px`};if(t.left==null||t.top==null){Object.assign(n,{left:i?"auto":`${t.offset.x-s}px`,right:i?`${t.offset.x-s}px`:"auto",top:r?"auto":`${t.offset.y-s}px`,bottom:r?`${t.offset.y-s}px`:"auto",...d});return}let c=i?t.left+t.w+s:t.left-s,u=r?t.top+t.h+s:t.top-s;Object.assign(n,{left:`${i?c-y:c}px`,top:`${r?u-b:u}px`,right:"auto",bottom:"auto",...d});},a=t.w<this.size.w||t.h<this.size.h;o(Math.max(t.w,this.size.w),Math.max(t.h,this.size.h)),n.visibility="visible",a&&!t.sheet?this.shrinkTimer=setTimeout(()=>o(t.w,t.h),Ss):o(t.w,t.h);}async runAction(t){let n=this.actions.get(t.name),i;if(!n)i={ok:false,error:"that action is not available on this page"};else try{i=await n.handler(t.args,{callId:t.callId,signal:new AbortController().signal});}catch(r){i={ok:false,error:nn(r)};}this.send({type:"action.result",payload:i.ok?{callId:t.callId,ok:true,result:i.result}:{callId:t.callId,ok:false,error:i.error}});}async checkAction(t){var r;let n=(r=this.actions.get(t.name))==null?void 0:r.check,i={ok:true};try{n&&(i=await n(t.param,t.value,t.args));}catch(s){}this.send({type:"action.check_result",payload:i.ok?{checkId:t.checkId,ok:true,value:i.value}:{checkId:t.checkId,ok:false,reason:i.reason,suggestions:i.suggestions,param:i.param}});}},sn,V=(sn=window.__avatarfactoryEmbed)!=null?sn:window.__avatarfactoryEmbed={instances:[],sticky:[]},Be=V.instances,_s=e=>{let[t]=e;t==="context"&&(V.sticky=V.sticky.filter(([n])=>n!=="context")),(t==="context"||t==="action"||t==="on"||t==="off")&&V.sticky.push(e),t==="destroy"&&(V.sticky=[]);},on=(e,t)=>{let[n]=t;switch(n){case "context":e.setContext(t[1]);break;case "event":e.addEvent(t[1],t[2]);break;case "open":e.send({type:"cmd.open",payload:{}});break;case "close":e.send({type:"cmd.close",payload:{}});break;case "start":e.send({type:"cmd.start",payload:{}});break;case "stop":e.send({type:"cmd.stop",payload:{}});break;case "destroy":e.destroy();break;case "carry":e.carry();break;case "action":e.registerAction(t[1]);break;case "on":e.on(t[1],t[2]);break;case "off":e.off(t[1],t[2]);break}},R=e=>{_s(e);for(let t of Be)on(t,e);e[0]==="destroy"&&(Be.length=0);},rn={push:R,context:e=>R(["context",e]),event:(e,t)=>R(["event",e,t]),open:()=>R(["open"]),close:()=>R(["close"]),start:()=>R(["start"]),stop:()=>R(["stop"]),destroy:()=>R(["destroy"]),action:e=>R(["action",e]),on:(e,t)=>R(["on",e,t]),off:(e,t)=>R(["off",e,t])},Ts=()=>{var a;let e=document.currentScript,t=e==null?void 0:e.dataset.deployId;if(!e||!t){console.error("[avatarfactory] embed.js needs a data-deploy-id attribute");return}let n=As(e.dataset),i=e.dataset.container,r=(a=i?document.getElementById(i):null)!=null?a:e.parentElement,s=new He(t,new URL(e.src).origin,n,r);Be.push(s),V.sticky.forEach(l=>on(s,l));let o=window.avatarfactory;Array.isArray(o)?(window.avatarfactory=rn,o.forEach(R)):o||(window.avatarfactory=rn);};Ts();})();
|
|
12
|
+
`,Es=()=>{if(document.getElementById(rn))return;let e=document.createElement("style");e.id=rn,e.textContent=Ss,document.head.appendChild(e);},on=e=>{let t=null,n=()=>{let s=t;t=null,s&&(s.stop(),s.layer.querySelectorAll(".af-tour-mark").forEach(o=>o.classList.add("af-tour-mark--out")),setTimeout(()=>s.layer.remove(),xe));},i=(s,o,a)=>{Es();let c=document.createElement("div");c.className="af-tour-layer",c.setAttribute("aria-hidden","true"),a&&(c.style.setProperty("--af-highlight-strong-color",a),c.style.setProperty("--af-highlight-color",`color-mix(in srgb, ${a} ${100-Le}%, white)`)),document.body.appendChild(c);let p=Zt(s),m=qt(s,o,a);if(m.behind){Yt(m,o);let v=He(s,se(s),re);t={layer:c,stop:()=>{v(),p();}};return}let E=Kt(s),A=[],l=false,u=v=>{c.replaceChildren(...v.map((g,y)=>{let b=document.createElement("span");return b.className=`af-tour-mark${o?" af-tour-mark--strong":""}`,Object.assign(b.style,{left:`${g.left-E.x}px`,top:`${g.top-E.y}px`,width:`${g.width+E.x*2}px`,height:`${g.height+E.y*2}px`,animationDelay:l?"":`${y*200}ms`,animationDuration:l?"0s":""}),b})),l=true;},d=nn(s,()=>{let v=se(s);Jt(A,v)||(A=v,u(v));}),f=He(s,se(s),o?Fe:De);t={layer:c,stop:()=>{d(),f(),p();}};};return {run:async s=>{switch(s.op){case "clear":return n(),{found:true};case "top":return n(),window.scrollTo({top:0,behavior:"smooth"}),{found:true};case "scroll":{let o=Oe(s.target,e);return o?(await Re(o),{found:true,rect:sn(o)}):{found:false}}case "mark":{n();let o=Oe(s.target,e);return o?(await Re(o),i(o,s.strong,s.color),{found:true,rect:sn(o)}):{found:false}}}},clear:n}};var bs="2147483000",_s=320,Ts=500,Ms=480,ws=2500,an=e=>typeof e=="string"?e:JSON.stringify(e!=null?e:null),ln=e=>e instanceof Error?e.message:String(e),W=e=>{let t=e===void 0||e===""?NaN:Number(e);return Number.isFinite(t)?t:void 0},oe=e=>e==="true"||e==="on"?true:e==="false"||e==="off"?false:void 0,ks=e=>{var o,a;let t=W(e.offsetX),n=W(e.offsetY),i=W(e.panelWidth),r=W(e.panelHeight),s=oe(e.tour)===true;return {layout:e.layout==="inline"?"inline":"widget",appearance:{position:e.position,offset:t!==void 0||n!==void 0?{x:(o=t!=null?t:n)!=null?o:0,y:(a=n!=null?n:t)!=null?a:0}:void 0,bubbleSize:W(e.size),panel:i!==void 0&&r!==void 0?{w:i,h:r}:void 0,accent:e.accent||void 0,draggable:oe(e.draggable),mobile:e.mobile},tour:s?{once:oe(e.tourOnce)===false?"session":"visitor"}:void 0,pageAccess:oe(e.page)===true||s}},Be=class{constructor(t,n,i,r){this.deployId=t;this.runtimeOrigin=n;this.config=i;this.actions=new Map;this.listeners=new Map;this.outbox=[];this.ready=false;this.viewportFrame=0;this.size={w:0,h:0};this.surface=null;this.stopWatchingPage=null;this.tour=on(t=>{var n,i;return (i=(n=this.surface)==null?void 0:n.elementNamed(t))!=null?i:null});this.leaving=false;this.onPageHide=()=>{this.leaving=true;};this.onViewportChange=()=>{cancelAnimationFrame(this.viewportFrame),this.viewportFrame=requestAnimationFrame(()=>this.sendHostInfo());};this.onMessage=t=>{let n=Ht(t,{origin:this.runtimeOrigin,deployId:this.deployId,source:this.frame.contentWindow});if(n)switch(n.type){case "ready":this.ready=true,this.inline&&(this.frame.style.visibility="visible"),this.sendHostInfo(),this.outbox.splice(0).forEach(i=>this.send(i)),this.emit("ready",n.payload);return;case "resize":this.inline||this.place(n.payload);return;case "state":this.emit("state",n.payload.stage);return;case "event":{let{name:i,detail:r}=n.payload;if(i===Dt){typeof(r==null?void 0:r.token)=="string"&&this.keptCall.hold(r.token);return}i==="stop"&&!this.leaving&&this.keptCall.drop(),this.emit(i,r);return}case "beacon":n.payload.blocked&&console.warn(`[avatarfactory] blocked by this page's Content-Security-Policy (${n.payload.blocked})`);return;case "action.flow":this.emit("action.flow",n.payload.flow);return;case "action.run":this.runAction(n.payload);return;case "action.check":this.checkAction(n.payload);return;case "page.call":this.servePage(n.payload.callId,n.payload.call);return;case "tour.do":{let{seq:i,...r}=n.payload;this.tour.run(r).catch(()=>({found:false})).then(s=>this.send({type:"tour.result",payload:{seq:i,...s}}));return}}};var m;this.inline=i.layout==="inline"?r:null,this.frame=document.createElement("iframe");let s=new URLSearchParams({origin:window.location.origin});i.pageAccess&&s.set("page","1"),this.keptCall=qe(t);let o=this.keptCall.take(),a=o?`#${new URLSearchParams({[Ft]:o.token,...o.led&&{led:"1"}})}`:"";if(this.frame.src=`${n}/w/${encodeURIComponent(t)}?${s}${a}`,window.addEventListener("pagehide",this.onPageHide),this.frame.title="Avatar assistant",this.frame.allow="microphone; camera; display-capture; autoplay",Object.assign(this.frame.style,{border:"0",margin:"0",padding:"0",background:"transparent",colorScheme:"normal",visibility:"hidden"}),this.inline){let E=(m=W(this.inline.dataset.height))!=null?m:Ms;Object.assign(this.frame.style,{display:"block",width:"100%",height:`${E}px`});}else Object.assign(this.frame.style,{position:"fixed",width:"0",height:"0",zIndex:bs});window.addEventListener("message",this.onMessage),window.addEventListener("resize",this.onViewportChange),i.pageAccess&&(this.stopWatchingPage=It(()=>this.send({type:"page.changed",payload:{}})));let c=this.inline;if(c){c.appendChild(this.frame);return}let p=()=>document.body.appendChild(this.frame);document.body?p():document.addEventListener("DOMContentLoaded",p,{once:true});}carry(){this.keptCall.markLed();}send(t){let n=this.frame.contentWindow;if(!this.ready||!n){this.outbox.push(t);return}Bt(n,this.runtimeOrigin,this.deployId,t);}setContext(t){clearTimeout(this.contextTimer),this.contextTimer=setTimeout(()=>this.send({type:"context.set",payload:{context:an(t)}}),Ts);}addEvent(t,n){this.send({type:"context.event",payload:{name:t,context:an(n)}});}registerAction(t){this.actions.set(t.name,t),this.syncActions();}on(t,n){var r;let i=(r=this.listeners.get(t))!=null?r:new Set;i.add(n),this.listeners.set(t,i);}off(t,n){var i;(i=this.listeners.get(t))==null||i.delete(n);}destroy(){var t;this.send({type:"cmd.destroy",payload:{}}),clearTimeout(this.shrinkTimer),clearTimeout(this.contextTimer),cancelAnimationFrame(this.viewportFrame),window.removeEventListener("message",this.onMessage),window.removeEventListener("resize",this.onViewportChange),window.removeEventListener("pagehide",this.onPageHide),this.keptCall.drop(),(t=this.stopWatchingPage)==null||t.call(this),this.tour.clear(),this.frame.remove();}syncActions(){let t=[...this.actions.values()].map(({handler:n,check:i,...r})=>r);this.send({type:"action.set",payload:{actions:t}});}emit(t,n){var i;(i=this.listeners.get(t))==null||i.forEach(r=>{try{r(n);}catch(s){console.error("[avatarfactory] listener failed",s);}});}sendHostInfo(){this.send({type:"host.info",payload:{url:window.location.origin+window.location.pathname,viewport:{w:document.documentElement.clientWidth||window.innerWidth,h:document.documentElement.clientHeight||window.innerHeight},reducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,theme:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",frameLayout:2,config:this.config}});}async servePage(t,n){var i;if(!this.config.pageAccess){this.send({type:"page.result",payload:{callId:t,ok:false,error:"page access is off"}});return}try{(i=this.surface)!=null||(this.surface=ke({documentLoadAfterMs:ws}));let r=await de(this.surface,n);this.send({type:"page.result",payload:{callId:t,ok:!0,value:r}});}catch(r){this.send({type:"page.result",payload:{callId:t,ok:false,error:ln(r)}});}}place(t){var c;clearTimeout(this.shrinkTimer);let n=this.frame.style,i=t.position.endsWith("right"),r=t.position.startsWith("bottom"),s=(c=t.gutter)!=null?c:0,o=(p,m)=>{if(this.size={w:p,h:m},t.sheet){Object.assign(n,{left:"0",top:"0",right:"auto",bottom:"auto",width:"100%",height:"100%"});return}let E=p+s*2,A=m+s*2,l={width:`${E}px`,height:`${A}px`};if(t.left==null||t.top==null){Object.assign(n,{left:i?"auto":`${t.offset.x-s}px`,right:i?`${t.offset.x-s}px`:"auto",top:r?"auto":`${t.offset.y-s}px`,bottom:r?`${t.offset.y-s}px`:"auto",...l});return}let u=i?t.left+t.w+s:t.left-s,d=r?t.top+t.h+s:t.top-s;Object.assign(n,{left:`${i?u-E:u}px`,top:`${r?d-A:d}px`,right:"auto",bottom:"auto",...l});},a=t.w<this.size.w||t.h<this.size.h;o(Math.max(t.w,this.size.w),Math.max(t.h,this.size.h)),n.visibility="visible",a&&!t.sheet?this.shrinkTimer=setTimeout(()=>o(t.w,t.h),_s):o(t.w,t.h);}async runAction(t){let n=this.actions.get(t.name),i;if(!n)i={ok:false,error:"that action is not available on this page"};else try{i=await n.handler(t.args,{callId:t.callId,signal:new AbortController().signal});}catch(r){i={ok:false,error:ln(r)};}this.send({type:"action.result",payload:i.ok?{callId:t.callId,ok:true,result:i.result}:{callId:t.callId,ok:false,error:i.error}});}async checkAction(t){var r;let n=(r=this.actions.get(t.name))==null?void 0:r.check,i={ok:true};try{n&&(i=await n(t.param,t.value,t.args));}catch(s){}this.send({type:"action.check_result",payload:i.ok?{checkId:t.checkId,ok:true,value:i.value}:{checkId:t.checkId,ok:false,reason:i.reason,suggestions:i.suggestions,param:i.param}});}},un,V=(un=window.__avatarfactoryEmbed)!=null?un:window.__avatarfactoryEmbed={instances:[],sticky:[]},Ue=V.instances,Rs=e=>{let[t]=e;t==="context"&&(V.sticky=V.sticky.filter(([n])=>n!=="context")),(t==="context"||t==="action"||t==="on"||t==="off")&&V.sticky.push(e),t==="destroy"&&(V.sticky=[]);},dn=(e,t)=>{let[n]=t;switch(n){case "context":e.setContext(t[1]);break;case "event":e.addEvent(t[1],t[2]);break;case "open":e.send({type:"cmd.open",payload:{}});break;case "close":e.send({type:"cmd.close",payload:{}});break;case "start":e.send({type:"cmd.start",payload:{}});break;case "stop":e.send({type:"cmd.stop",payload:{}});break;case "destroy":e.destroy();break;case "carry":e.carry();break;case "action":e.registerAction(t[1]);break;case "on":e.on(t[1],t[2]);break;case "off":e.off(t[1],t[2]);break}},R=e=>{Rs(e);for(let t of Ue)dn(t,e);e[0]==="destroy"&&(Ue.length=0);},cn={push:R,context:e=>R(["context",e]),event:(e,t)=>R(["event",e,t]),open:()=>R(["open"]),close:()=>R(["close"]),start:()=>R(["start"]),stop:()=>R(["stop"]),destroy:()=>R(["destroy"]),action:e=>R(["action",e]),on:(e,t)=>R(["on",e,t]),off:(e,t)=>R(["off",e,t])},Is=()=>{var a;let e=document.currentScript,t=e==null?void 0:e.dataset.deployId;if(!e||!t){console.error("[avatarfactory] embed.js needs a data-deploy-id attribute");return}let n=ks(e.dataset),i=e.dataset.container,r=(a=i?document.getElementById(i):null)!=null?a:e.parentElement,s=new Be(t,new URL(e.src).origin,n,r);Ue.push(s),V.sticky.forEach(c=>dn(s,c));let o=window.avatarfactory;Array.isArray(o)?(window.avatarfactory=cn,o.forEach(R)):o||(window.avatarfactory=cn);};Is();})();
|