1'use strict';(()=>{function e(){return document.querySelectorAll('.frc-captcha')}function t(e,t,n){''===e.style[t]&&(e.style[t]=n)}function n(e){'loading'!==document.readyState?e():document.addEventListener('DOMContentLoaded',e)}function i(e){let t,n;const i=new Promise((e,i)=>{t=e,n=i});return e&&e(t,n),{promise:i,resolve:t,reject:n}}function s(e,t){return 0===e.lastIndexOf(t,0)}function r(e){let t=[];const n=Object.keys(e),i=encodeURIComponent;for(let s=0;s<n.length;s++)t.push(`${i(n[s])}=${i(e[n[s]])}`);return t.join('&')}function o(e){const t=document.location;if(s(e,'/')||s(e,'.'))return t.origin?t.origin:t.protocol+'//'+t.host;const n=e.match(O);if(!n)throw new Error('Invalid URL: '+e);return n[1]}function a(e,t='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'){let n='';for(let i=0;i<e;i++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}function c(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function d(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const i=c(n);return(e,n)=>i.then(i=>n(i.transaction(t,e).objectStore(t)))}function h(){return D||(D=d('keyval-store','keyval')),D}function l(e){if(!X){let n=0;try{n=parseInt(sessionStorage.getItem(N)||'',10)}catch(t){}isNaN(n)&&(n=0),e&&n++,Y=n.toString();try{sessionStorage.setItem(N,Y)}catch(t){}}return Y}function u(){let e;try{e=sessionStorage.getItem(L)}catch(t){return j}return e||(e=a(12),sessionStorage.setItem(L,e)),e}function m(e){return e.toLowerCase().split('-')[0].split('_')[0]}function g(e){return e=m(e),(B[e]||B.en)+' - Widget'}function p(e){return e=m(e),-1!==U.indexOf(e)}function f(e){e.textDecoration=e.fontStyle='none',e.fontWeight='500',e.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',e.lineHeight='1',e.letterSpacing='-0.0125rem'}function y(e){let t=e.language;return t&&'html'!==t||(t=function(e){for(;!e.lang;)if(!(e=e.parentElement))return null;return e.lang}(e.element)||''),t}function v(){const e=window.performance;return e?e.now():0}function w(e,...t){for(let i=0;i<t.length;i++){const s=t[i];for(var n in s)s.hasOwnProperty(n)&&(e[n]=s[n])}return e}function b(){const e=[0,0,0,0,0,0,0];return{s:e,add(t){const n=++e[0],i=t-e[1],s=i/n,r=s*s,o=i*s*(n-1);e[1]+=s,e[4]+=o*r*(n*n-3*n+3)+6*r*e[2]-4*s*e[3],e[3]+=o*s*(n-2)-3*s*e[2],e[2]+=o,1==n?e[5]=e[6]=t:(t<e[5]&&(e[5]=t),t>e[6]&&(e[6]=t))}}}function _(){return/Android/i.test(navigator.userAgent)}function E(e,t,i=!1,s){const r=b();let o,a=!1;return n(()=>{(s=s||document.body)[G](e,e=>{a&&!i||(o=e.timeStamp,a=!0)}),s[G](t,e=>{a&&(r.add(e.timeStamp-o),a=!1)})}),r.s}function S(e){const t=[];for(let n=0;n<e.length;n++)t.push(0),document[G](e[n],()=>t[n]++);return t}function R(){const e=[0,0,0,0,0,0,0,0],t={8:1,46:1,9:2,45:3,17:4,13:5,37:6,38:6,39:6,40:6,33:7,34:7};return document[G]('keydown',n=>{const i=n.keyCode;t[i]?e[t[i]]++:i>=112&&i<=123&&e[0]++}),e}function k(e,t,n,i){return K.sqrt(K.pow(e-t,2)+K.pow(n-i,2))}function M(e,t,n){return K.sqrt(K.pow(e,2)+K.pow(t,2)+K.pow(n,2))}function x(e,t){let n=t-e;return n+=n>180?-360:n<-180?360:0,n}function A(e){let t=e;return t?J[t]&&(t=J[t]):t=J.global,o(t)}function C(){const e=document.querySelector('meta[name="frc-disable-eval-patching"]');return!!e&&!!e.content}function F(){const e=document.querySelector('meta[name="frc-api-endpoint"]');if(e)return e.content;const t=document.currentScript;if(t){const e=t.dataset.frcApiEndpoint;if(e)return e}
1const n=document.querySelector('.frc-captcha[data-api-endpoint]');if(n){const e=n.dataset.apiEndpoint;if(e)return e}}var D,T,I,O=/^((?:\w+:)?\/\/([^\/]+))/,W=class{constructor(e){this.ready=!1,this.buffer=[],this.id=e.id,this.type=e.type,this.element=e.element,this.onReady=e.onReady,this.origin=o(e.element.src)}send(e){this.ready?this.element.contentWindow.postMessage(e,this.origin):this.buffer.push(e)}setReady(e){this.onReady(),this.ready=e,this.ready&&this.flush()}flush(){for(let e=0;e<this.buffer.length;e++)this.element.contentWindow.postMessage(this.buffer[e],this.origin);this.buffer=[]}},P=class{constructor(){this.origins=new Set,this.targets={},this.answered=new Set,this.onReceiveRootMessage=()=>{},window.addEventListener('message',e=>{this.onReceive(e)})}listen(e){let t=this.onReceiveRootMessage;this.onReceiveRootMessage=n=>{t(n),e(n)}}addOrigin(e){this.origins.add(e)}send(e){if(e.from_id){const t=this.targets[e.from_id];if(!t)return void console.error(`[bus] Unexpected message from unknown sender ${e.from_id}`,e);'widget_announce'!==e.type&&'agent_announce'!==e.type||t.setReady(!0)}const t=e.rid;if(t){if(this.answered.has(t+e.to_id))return;this.answered.add(t+e.to_id)}if(''===e.to_id)return void this.onReceiveRootMessage(e);const n=this.targets[e.to_id];n?n.send(e):console.error(`[bus] Unexpected message to unknown target ${e.to_id}`,e)}onReceive(e){if(t=e.origin,n=this.origins,'*'!==t&&!n.has(t))return;var t,n;const i=e.data;i&&i._frc&&this.send(i)}registerTarget(e){this.targets[e.id]=e}registerTargetIFrame(e,t,n,s){const r=i();let o=new Promise(e=>setTimeout(()=>e('timeout'),s));const a=new W({id:t,element:n,type:e,onReady:()=>r.resolve('registered')});return this.registerTarget(a),Promise.race([r.promise,o])}removeTarget(e){delete this.targets[e]}},N='frc_sc',L='frc_sid',X=!1,Y='0',j='__'+a(10),q=class{constructor(e){this.mem=new Map,this.storePrefix=e}setup(){return new Promise((e,t)=>{if(void 0!==this._hasSA)return e(this._hasSA);try{indexedDB.open('')}catch(n){return e(this._hasSA=!1)}if(!document.hasStorageAccess)return e(this._hasSA=!0);document.hasStorageAccess().then(t=>(this._hasSA=t,this._hasSA?this.idb=d('friendlycaptcha','frc'):console.debug('FRC has no storage access'),e(this._hasSA))).catch(t)})}get(e,t){return this.setup().then(n=>{const i=this.storePrefix+'__'+e;if(t.p)return n?function(e,t=h()){return t('readonly',t=>c(t.get(e)))}(i,this.idb):this.mem.get(e);try{const e=sessionStorage.getItem(i);return null===e?void 0:e}catch(s){}return this.mem.get(e)})}set(e,t,n){return this.setup().then(i=>{const s=this.storePrefix+'__'+e;if(n.p){if(i)return function(e,t,n=h()){return n('readwrite',n=>(n.put(t,e),c(n.transaction)))}(s,t,this.idb);void 0===t?this.mem.delete(e):this.mem.set(e,t)}else try{void 0===t?(this.mem.delete(e),sessionStorage.removeItem(s)):(this.mem.set(e,t),sessionStorage.setItem(s,t))}catch(r){}})}hasSA(){return this._hasSA}},$='undefined'!=typeof navigator&&void 0!==navigator.userAgentData,H='FrcFrameId',z='frc-i-agent',B={cs:'OvÄÅenà proti botům',da:'Anti-robot verificering',nl:'Anti-robotverificatie',en:'Anti-Robot verification',fr:'Vérification Anti-Robot',de:'Anti-Roboter-Verifizierung',hu:'Anti-Robot ellenÅrzés',it:'Verifica anti-robot',pl:'Weryfikacja antybotowa',pt:'Verificação Anti-Robô',ru:'ÐÑовеÑка на ÐнÑи-РобоÑа',es:'Verificación anti-robot',sv:'Anti-Robot Verifiering',tr:'Anti-Robot doÄrulaması'},U=['ar','he','fa','ur','ps','sd','yi'],V=class{constructor(e){this.state='init',this.response='.UNINITIALIZED',this.focusEventPending=!1,this.isDestroyed=!1,this.id=e.id;const t=e.createOpts;if(this.e=t.element,this.ready=e.registered,!this.e)throw new Error('No element provided to mount widget under.');if(this.e.frcWidget=this,this.formFieldName=void 0===t.formFieldName?'frc-captcha-response':t.formFieldName,this.sitekey=t.sitekey,this._reset=e.callbacks.onReset,this._destroy=e.callbacks.onDestroy,this._trigger=e.callbacks.onTrigger,this.startMode=e.createOpts.startMode||'focus',null!==this.formFieldName){const e=document.createElement('input');e.type='hidden',e.style.display='none',e.name=this.formFieldName,this.hiddenFormEl=e,this.e.a
1ppendChild(e)}this.setState({response:'.UNCONNECTED',state:'init'}),this.ready.then(()=>{this.handleStartMode()})}handleStartMode(){if('focus'!==this.startMode||this.focusEventPending||this.isDestroyed)'auto'===this.startMode&&this.trigger('auto');else{const t=function(e){for(;'FORM'!==e.tagName;)if(!(e=e.parentElement))return null;return e}(this.e);t&&(this.focusEventPending=!0,e=e=>{this.trigger('focus',{ev:e}),this.focusEventPending=!1},t.addEventListener('focusin',e,{once:!0,passive:!0}))}var e}reset(e={trigger:'root'}){if(this.isDestroyed)throw new Error('Can not reset destroyed widget.');this.setState({response:'.RESET',state:'reset',resetTrigger:e.trigger}),this._reset(e),this.handleStartMode()}destroy(){this.isDestroyed=!0,this.hiddenFormEl&&this.hiddenFormEl.remove(),this.hiddenFormEl=void 0,this.setState({response:'.DESTROYED',state:'destroyed'}),this._destroy()}trigger(e,t={}){if(this.isDestroyed)throw new Error('Can not start destroyed widget.');const n=function(e,t,n,i){const s=v(),r=n.getBoundingClientRect(),o={v:1,tt:e,pnow:s,sm:t,el:{bcr:[r.left,r.top,r.width,r.height],con:document.body.contains(n)},stack:new Error().stack||'',we:!!window.event,weit:!!window.event&&!!window.event.isTrusted};return i&&(o.ev={ts:i.timeStamp,rt:!!i.relatedTarget,eot:!!i.explicitOriginalTarget,it:i.isTrusted}),o}(e,this.startMode,this.e,t.ev);this._trigger({trigger:n})}start(){this.trigger('programmatic')}setState(e){const t=this.state!==e.state;this.response=e.response,this.state=e.state,this.hiddenFormEl&&!1!==this.e.isConnected&&(this.hiddenFormEl.value=e.response),t&&this.dispatchWidgetEvent({name:'frc:widget.statechange',error:e.error}),'expired'===this.state?this.dispatchWidgetEvent({name:'frc:widget.expire'}):'completed'===this.state?this.dispatchWidgetEvent({name:'frc:widget.complete'}):'error'===this.state?this.dispatchWidgetEvent({name:'frc:widget.error',error:e.error}):'reset'===this.state&&this.dispatchWidgetEvent({name:'frc:widget.reset',trigger:e.resetTrigger})}dispatchWidgetEvent(e){const t={response:this.response,state:this.state,id:this.id};w(t,e),function(e,t){let n;'function'==typeof window.CustomEvent?n=new CustomEvent(t.name,{bubbles:!0,detail:t}):(n=document.createEvent('CustomEvent'),n.initCustomEvent(t.name,!0,!1,t)),e.dispatchEvent(n)}(this.e,t)}addEventListener(e,t,n){this.e.addEventListener(e,t,n)}removeEventListener(e,t,n){this.e.removeEventListener(e,t,n)}getState(){return this.state}getResponse(){return this.response}getElement(){return this.e}},G='addEventListener',K=Math,Z=class{constructor(e){this.rn=0,this.i=0,this.smel={n:0,ts:0,d:0};const t='mouse',i=this.smel,s=e=>{i.n||(i.fts=e.timeStamp,i.fxy=[e.clientX,e.clientY,e.screenX,e.screenY]),i.n++,e.type===t+'leave'&&(i.d+=e.timeStamp-i.ts),i.ts=e.timeStamp,i.xy=[e.clientX,e.clientY]},r=document;n(()=>{const e=r.body;e[G](t+'enter',s),e[G](t+'leave',s)}),this.bh={onoff:{kdu:E('keydown','keyup'),cse:E('compositionstart','compositionend'),mdu:E(t+'down',t+'up'),mle:E(t+'leave',t+'enter'),med:E(t+'enter',t+'down',!0),semd:E('scrollend',t+'down',!0,r),se:E('scroll','scrollend',!1,r),pdc:E('pointerdown','pointercancel',!0),mmc:E(t+'move','click',!0),tse:E('touchstart','touchend'),fikd:E('focusin','keydown',!0)},nev:S([t+'out','pointercancel','focus','focusin','blur','visibilitychange','copy','paste','cut','contextmenu','click','auxclick','wheel','resize']),nk:R(),mov:this.setupMovementMetrics(),dm:this.setupMotionMetrics(),do:this.setupOrientationMetrics()},this.dep=e.disableEvalPatching||!1,this.takeTraceRecords=function(e){const t=[],n=new Map,i=window,s=function(){try{const e=document.createElement('iframe');e.style.display='none',(document.body||document.head).appendChild(e);const t=e?e.contentWindow:0;return e.remove(),t||i}catch(e){return i}}(),r=Function.prototype.toString,o=function(...e){const t='function'==typeof this&&n.get(this),i=this===o?r:t||this;return r.apply(i,e)};Function.prototype.toString=o;const a='prototype',c=i.EventTarget?i.EventTarget[a].dispatchEvent:{},d=[['Document.'+a+'.documentElement',i.Document[a],'documentElement'],['Element.'+a+'.shadowRoot',i.Element[a],'shadowRoot'],['Node.'+a+'.nodeType',i.Node[a],'nodeType'],['Object.is',i.Object,'is'],['Array.'+a+'.slice',i.Array[a],'slice'],['Document.'+a+'.querySelectorAll',i.Document[a],'querySelectorAll'],['Document.'+a+'.createElement',i.Document[a],'createElement'],['EventTarget.'+a+'.dispatchEvent',c,'dispatchEvent']];return e.disableEvalPatching||d.push(['eval',i,'eval']),d.forEach(function([e,r,o]){const a=Object.getOwnPropertyDescriptor(r,o),c=a&&(a.get||a.set);if(!a)return;if(c){if(!a.get)return}else if('object'!=typeof a.value&&'function'!=typeof a.value)return;let d=0,h=0;const l=function(...n){const r=Date.now();if(r-d>=1000&&(h=0,d=r),h<50){const n={d:r,pnow:v(),n:e,st:(s.Error||i.Error)('FriendlyCaptcha_DummyTrace').stack||''};t.length>20000&&t.splice(0,1000),t.push(n),h++}return(c?a.get:a.value).apply(this,n)};
1try{const e=c?a.get?a.get():void 0:a.value();e&&(l.length=e.length,l.name=e.name)}catch(u){}try{const e=w({},a);c?e.get=l:e.value=l,Object.defineProperty(r,o,e),n.set(l,c?a.get:a.value)}catch(u){}}),function(){return t.splice(0,t.length)}}(e)}setupMovementMetrics(){let e,t=[];const i=b(),s=b(),r=b(),o={t:i.s,v:r.s,d:s.s,ns:0},a=()=>{const n=t[t.length-1];if(t.length>=200||n&&(n[0]&&this.tm.timeStamp===n[1]||!n[0]&&this.mm.timeStamp===n[1])){if(clearInterval(e),e=void 0,1===t.length)return o.ns++,void(t=[]);const a=t[0];i.add(n[1]-a[1]),s.add(k(n[2],a[2],n[3],a[3]));for(let e=1;e<t.length;e++){const n=t[e],i=t[e-1],s=1000*k(n[2],i[2],n[3],i[3]),o=n[1]-i[1];r.add(s/o)}return void(t=[])}let a=0;if(n?a=n[0]:this.mm&&this.tm?a=this.mm.timeStamp>this.tm.timeStamp?0:1:this.mm||(a=1),a){const e=this.tm.touches[0];e&&t.push([1,this.tm.timeStamp,e.screenX,e.screenY])}else t.push([0,this.mm.timeStamp,this.mm.screenX,this.mm.screenY])};let c=-1;return n(()=>{const t=document.body;t[G]('mousemove',t=>{this.mm=t,void 0===e&&(a(),e=setInterval(a,50))}),t[G]('touchmove',t=>{this.tm=t;const n=t.touches[0];if(n){const e=n.radiusX+1.234*n.radiusY;e!==c&&(c=e,this.rn++)}void 0===e&&(a(),e=setInterval(a,50))})}),o}setupMotionMetrics(){const e=b(),t=b(),n={n:0,ts:0,ac:e.s,rr:t.s,i:0,g:!1};return _()?(window[G]('devicemotion',i=>{n.ts=i.timeStamp,n.i=i.interval,n.g=!i.acceleration;const s=i.acceleration||i.accelerationIncludingGravity;s&&e.add(M(s.x,s.y,s.z));const r=i.rotationRate;r&&t.add(M(r.alpha,r.beta,r.gamma))}),n):n}setupOrientationMetrics(){const e=b(),t=b(),n={fts:0,ts:0,gd:e.s,bd:t.s};if(!_())return n;let i;return window[G]('deviceorientation',s=>{null!=s.gamma&&null!=s.beta&&null!=s.alpha&&(n.ts=s.timeStamp,n.a=s.alpha,n.b=s.beta,n.g=s.gamma,i?(e.add(x(s.gamma,n.g)),t.add(x(n.b,s.beta))):(n.fts=n.ts,i=!0))}),n}gmm(){const e=this.mm;return e&&{xy:[e.clientX,e.clientY,e.screenX,e.screenY,e.offsetX,e.offsetY,e.pageX,e.pageY,e.movementX,e.movementY],ts:e.timeStamp}}gtm(){const e=this.tm,t=e&&e.touches,n=t&&t[0];return e&&n&&{id:n.identifier,xy:[n.clientX,n.clientY,n.screenX,n.screenY,n.pageX,n.pageY],r:[n.radiusX,n.radiusX,n.rotationAngle,n.force],n:t.length,ts:e.timeStamp,rn:this.rn}}get(e){const t=document.body,n=window,i=n.performance;return{v:1,i:++this.i,hl:history.length,fe:!!window.frameElement,dep:this.dep,wid:e,sc:parseInt(l(!1)),sid:u(),conv:0,t:{pnow:v(),pto:i&&i.timeOrigin||0,ts:Date.now()},dims:{d:[n.innerWidth,n.innerHeight,n.outerWidth,n.outerHeight,n.screenX,n.screenY,n.pageXOffset,n.pageYOffset,t.clientWidth,t.clientHeight],dpr:n.devicePixelRatio},mel:this.smel,mm:this.gmm(),tm:this.gtm(),bh:this.bh,stack:new Error().stack||'',trc:this.takeTraceRecords()}}},J={eu:'https://eu.frcapi.com',global:'https://global.frcapi.com'},Q='FrcFrameId',ee=0;window.frcaptcha=new class{constructor(e={}){if(this.agents=new Map,this.agentState=new Map,this.widgets=new Map,this._attached=i(),this.attached=this._attached.promise,this.apiEndpoint=e.apiEndpoint,(I=I||new P()).listen(e=>this.onReceiveMessage(e)),this.bus=I,++ee>1&&console.warn('Multiple Friendly Captcha SDKs created, this is not recommended. Please use a single SDK instance.'),this.signals=function(e){return T||(T=new Z(e))}({disableEvalPatching:e.disableEvalPatching||C()}),e.startAgent){const e=A(this.apiEndpoint||F());this.ensureAgentIFrame(e)}this.setupPeriodicRefresh()}onReceiveMessage(e){if('root_set_response'===e.type){const t=this.widgets.get(e.widget_id);if(!t)return void(1===ee&&console.warn(`Received set response message for widget ${e.widget_id} that doesn't exist`));t.setState(e)}else if(s(e.type,'root_store'))this.handleStoreMessage(e);else if('root_signals_get'===e.type)this.handleSignalsGetMessage(e);else if('widget_language_change'===e.type)this.handleWidgetLanguageChange(e);else if('widget_reset'===e.type){const t=this.widgets.get(e.from_id);if(!t)return void(1===ee&&console.warn(`Received reset message for widget ${e.from_id} that doesn't exist`));t.reset({trigger:'widget'})}}handleWidgetLanguageChange(e){const t=this.widgets.get(e.from_id);if(!t)return void(1===ee&&console.warn(`Received language change message for widget ${e.from_id} that doesn't exist`));const n=t.getElement(),i=n.querySelector('iframe');i&&(i.title=g(e.language));const s=n.querySelector('.frc-banner');if(s){const t=s.style;p(e.language)?(t.left='6px',t.right='auto'):(t.left='auto',t.right='6px')}}handleSignalsGetMessage(e){const t=this.signals.get(e.widget_id);this.bus.send({type:'root_signals_get_reply',from_id:'',to_id:e.from_id,_frc:1,rid:e.rid,value:t})}handleStoreMessage(e){const t=e.from_id,n=this.agentState.get(t);n?'root_store_get'===e.type?n.store.get(e.key,{p:e.p}).then(i=>{this.bus.send({type:'root_store_get_reply',from_id:'',to_id:t,_frc:1,rid:e.rid,value:i,sa:n.store.hasSA()})}):'root_store_set'===e.type&&n.store.set(e.key,e.value,{p:e.p}).then(()=>{this.bus.send({type:'root_store_set_reply',from_id:'',to_id:t,_frc:1,rid:e.rid,sa:n.store.hasSA()})}):console.error(`Store not found ${t}`)}ensureAgentIFrame(e){const t=e+'/api/v2/captcha/agent';let n=document.getElementsByClassName(z);for(let r=0;r<n.length;r++){const t=n[r];if(o(t.src)===e&&t.dataset[Q])return t.dataset[Q]}const i='a_'+a(12),s=function(e,t,n){const i={origin:document.location.origin,sess_id:u(),sess_c:l(!0),comm_id:t,sdk_v:'0.1.26',v:'1',agent_id:t,ts:Date.now().toString()},s=document.createElement('iframe');s.className=z,s.dataset[H]=t,s.src=n+'?'+r(i),s.frcSDK=e;const o=s.style;return o.width=o.height=o.border=o.visibility='0',o.display='none',s}(this,i,t);this.agents.set(e,s),this.agentState.set(i,{store:new q(e),origin:e}),document.body.appendChild(s);let c=1;const d=()=>{this.bus.registerTargetIFrame('agent',i,s,this.getRetryTimeout(c)).then(t=>{if('timeout'===t){if(c>4)return console.error('[Friendly Captcha] Failed to load agent iframe after 4 retries.'),s.remove(),void this.agents.delete(e);console.warn('[Friendly Captcha] Retrying agent iframe load.'),s.src+='&retry='
1+c++,d()}})};return d(),i}setupPeriodicRefresh(){let e=1;setInterval(()=>{const t='&expire='+e++;this.agents.forEach(e=>{e.src+=t}),this.widgets.forEach(e=>{e.getElement().querySelector('iframe').src+=t})},129600000)}getRetryTimeout(e){return 1000*Math.pow(e,2)+4000}attach(t){void 0===t&&(t=e()),Array.isArray(t)||t instanceof NodeList||(t=[t]);const n=[];for(let e=0;e<t.length;e++){const i=t[e];if(i&&!i.frcWidget){const e=i.dataset,t={element:i,sitekey:e.sitekey,formFieldName:e.formFieldName,apiEndpoint:e.apiEndpoint,language:e.lang,theme:e.theme,startMode:e.start};n.push(this.createWidget(t))}}const i=this.getAllWidgets();return this._attached.resolve(i),this.attached=Promise.resolve(i),n}createWidget(e){const n=A(e.apiEndpoint||this.apiEndpoint||F());this.bus.addOrigin(n);const s=this.ensureAgentIFrame(n),c='w_'+a(12),d=e=>{const t={from_id:c,to_id:s,_frc:1};this.bus.send(w(t,e))},h={onDestroy:()=>{d({type:'root_destroy_widget'}),this.bus.removeTarget(c),this.widgets.delete(c),e.element.innerHTML='',e.element.removeAttribute('style')},onReset:()=>{d({type:'root_reset_widget'})},onTrigger:e=>{d({type:'root_trigger_widget',trigger:e.trigger})}},m=i(),v=new V({id:c,createOpts:e,callbacks:h,registered:m.promise});this.widgets.set(c,v);const b=function(e,t,n,i){const s=document.createElement('iframe'),o=y(i),a={origin:document.location.origin,sess_id:u(),sess_c:l(!0),comm_id:t,sdk_v:'0.1.26',v:'1',agent_id:e,lang:o,sitekey:i.sitekey||'',ts:Date.now().toString()};i.theme&&(a.theme=i.theme),$&&(s.allow='clipboard-write'),s.frameBorder='0',s.src=n+'?'+r(a),s.className='frc-i-widget',s.title=g(o),s.dataset[H]=t;const c=s.style;return c.border=c.visibility='0',c.position='absolute',c.height=c.width='100%',c.display='none',i.element.appendChild(s),s}(s,c,n+'/api/v2/captcha/widget',e),_=function(e){const t=document.createElement('div');t.classList.add('frc-widget-placeholder');const n=t.style,i='dark'===e.theme||'auto'===e.theme&&window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;return n.color=i?'#fff':'#222',n.backgroundColor=i?'#171717':'#fafafa',n.borderRadius='4px',n.border='1px solid',n.borderColor='#ddd',n.padding='8px',n.height=n.width='100%',n.fontSize='14px',f(n),e.element.appendChild(t),t}(e);!function(e){const n=t;n(e,'position','relative'),n(e,'height','70px'),n(e,'padding','0'),n(e,'width','316px'),n(e,'maxWidth','100%'),n(e,'maxHeight','100%'),n(e,'overflow','hidden'),n(e,'borderRadius','4px')}(e.element),function(e){const t=document.createElement('div');t.classList.add('frc-banner');const n=y(e),i=t.style;i.position='absolute',i.bottom='2px',p(n)?i.left='6px':i.right='6px',i.lineHeight='1';const s=document.createElement('a');s.href='https://friendlycaptcha.com',s.rel='noopener';const r=s.style;f(r),r.fontSize='10px';const o='dark'===e.theme||'auto'===e.theme&&window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;r.color=o?'#a2a2a2':'#565656',r.letterSpacing='-0.0125rem',s.target='_blank',s.textContent='Friendly Captcha',s.onmouseenter=()=>r.textDecoration='underline',s.onmouseleave=()=>r.textDecoration='none',t.appendChild(s),e.element.appendChild(t)}(e);const E=_.style;_.textContent='Anti-Robot check connecting...';let S=1;const R=()=>{this.bus.registerTargetIFrame('widget',c,b,this.getRetryTimeout(S)).then(t=>{if('timeout'===t){if(S>4)return console.error('[Friendly Captcha] Failed to load widget iframe after 4 retries.'),v.setState({state:'error',response:'.ERROR',error:{code:'network_error',detail:'Widget load timeout, stopped retrying'}}),E.borderColor='#f00',E.fontSize='12px',void(_.textContent=`Anti-Robot check failed to connect to page or ${o(b.src)}\nCheck your connection and try again.`);E.backgroundColor='#fee',E.color='#222',_.textContent=`Anti-Robot check took too long to connect.\n\nRetrying... (${S})`,console.warn(`[Friendly Captcha] Retrying widget ${c} iframe load.`),v.setState({state:'error',response:'.ERROR',error:{code:'network_error',detail:'Widget load timeout, will retry.'}}),b.src+='&retry='+S++,R()}else'registered'===t&&(e.element.removeChild(_),b.style.display='')})};return R(),m.resolve(),v}getAllWidgets(){const e=[];
1return this.widgets.forEach(t=>{e.push(t)}),e}getWidgetById(e){return this.widgets.get(e)}clear(){this.widgets.forEach(e=>{e.destroy()}),this.agents.forEach(e=>{e.remove()}),this.agents.clear()}},n(function(){const t=e();window.frcaptcha.attach(t)})})()/*! 2 * Copyright (c) Friendly Captcha GmbH 2023. 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. 6 */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.