"use strict";const e=require("./emitEvent-CzZf80Am-DK60rvHR.cjs"),f=require("./InputText-C55stM8O-CKH_l31R.cjs"),I=require("classnames");try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="88d18207-179d-488b-9295-e90f981c9521",t._sentryDebugIdIdentifier="sentry-dbid-88d18207-179d-488b-9295-e90f981c9521")}catch{}const M={AllowMoreRolesForMainRootTrustee:"AllowMoreRolesForMainRootTrustee",ShowUnsupportedEntityType:"ShowUnsupportedEntityType",ShowExtraTaxExemptionReasons:"ShowExtraTaxExemptionReasons",EnableEInvoicingCodeField:"EnableEInvoicingCodeField",EnableCountryOfGoverningLawForUKCompanies:"EnableCountryOfGoverningLawForUKCompanies",HidePayoutAccountTask:"HidePayoutAccountTask",EnableAgeVerification:"EnableAgeVerification",EnableNationalitySGHK:"EnableNationalitySGHK",EnableFinancialInformationComponentV4:"EnableFinancialInformationComponentV4",StrictNameAndAddressValidationV4:"StrictNameAndAddressValidationV4",EnableDoingBusinessAsNameV4:"EnableDoingBusinessAsNameV4",EnablePhoneFieldScenario:"EnablePhoneFieldScenario",ShowCustomerSupportV4:"ShowCustomerSupportV4",EnableRegistrationAndTaxAbsentStatesV4:"EnableRegistrationAndTaxAbsentStatesV4",UseOnboardingComponentsForSingpass:"UseOnboardingComponentsForSingpass",EnableJapanLocalization:"EnableJapanLocalization",UseTaskStatusApiForPayout:"UseTaskStatusApiForPayout",EnableRevampedDecisionMakersTaskPage:"EnableRevampedDecisionMakersTaskPage",EnableMultiFormInTrustFlow:"EnableMultiFormInTrustFlow",EnableCrossBorderPayouts:"EnableCrossBorderPayouts",EnableModifyBusinessLines:"EnableModifyBusinessLines",EnableDeleteBusinessLines:"EnableDeleteBusinessLines",EnableLimitToSingleBusinessLine:"EnableLimitToSingleBusinessLine",EnablePayoutVerificationMethodPageRedesign:"EnablePayoutVerificationMethodPageRedesign",EnableBankDocumentClassification:"EnableBankDocumentClassification",EnableBankDocumentClassificationShadowMode:"EnableBankDocumentClassificationShadowMode",EnableURLRouterForHostedOnboarding:"EnableURLRouterForHostedOnboarding",EnableMemoryRouterForHostedOnboarding:"EnableMemoryRouterForHostedOnboarding",EnableVerifyByInvite:"EnableVerifyByInvite",EnableProviderAgnosticCompanySearchAndSelect:"EnableProviderAgnosticCompanySearchAndSelect",EnableOnboardingTogglesEndpoint:"EnableOnboardingTogglesEndpoint"};try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="d3d560fc-1879-4a5c-bbdf-08bb2d8c3fef",t._sentryDebugIdIdentifier="sentry-dbid-d3d560fc-1879-4a5c-bbdf-08bb2d8c3fef")}catch{}const $="adyen-kyc-tag",N="adyen-kyc-tag-grey",R="adyen-kyc-tag-blue",L="adyen-kyc-tag-orange",A="adyen-kyc-tag-red",O="adyen-kyc-tag-teal",B="adyen-kyc-tag-green",g={tag:$,tagGrey:N,tagBlue:R,tagOrange:L,tagRed:A,tagTeal:O,tagGreen:B},H={grey:g.tagGrey,teal:g.tagTeal,red:g.tagRed,green:g.tagGreen,orange:g.tagOrange,blue:g.tagBlue},k=({className:t,variant:n="blue",children:a})=>e.u("span",{className:I(g.tag,H[n],t),children:a}),F=(t,n)=>{const a=n.childNodes[0],s=a.textContent?.toLowerCase();if(!s)return[];const r=[];return[...s.matchAll(t)].forEach(i=>{r.push({s:i.index,e:i.index+i[0].length})}),r.map(i=>{const o=new Range;return o.setStart(a,i.s),o.setEnd(a,i.e),o})},_=(t,n,a,s)=>CSS.highlights.set(`${t}-${s}`,new Highlight(...F(n.regex,a))),P=(t,n,a)=>`::highlight(${t}-${a}) { color: var(${n.css}); }`,V=(t,n,a)=>Object.entries(t).map(([s,r])=>({apply:()=>_(s,r,n,a),css:P(s,r,a)})),l={text:"--mng-text",background:"--mng-background",string:"--mng-string",key:"--mng-key",number:"--mng-number",boolean:"--mng-boolean",null:"--mng-null",comment:"--mng-comment",curlyBrackets:"--mng-curly-brackets",squareBrackets:"--mng-square-brackets",keyword:"--mng-keyword",dashes:"--mng-dashes"},q=`
* {
  box-sizing: border-box;
}
:host {
  display: inline-grid;
  white-space: pre;
}
pre {
  width: 100%;
  height: inherit;
  overflow: auto;
  padding: 1em;
  margin: 0;
  background-color: var(${l.background});
  color: var(${l.text});
}
code {
  width: 100%;
  height: 100%;
  display: inline-block;
  outline: none;
  white-space: pre;
  word-wrap: normal;
}

:host {
  ${l.text}: #213547;
  ${l.background}: #f1f1f1;
  ${l.string}: #8b251e;
  ${l.key}: #c32b1d;
  ${l.number}: #4a845b;
  ${l.boolean}: #3716f5;
  ${l.null}: #3716f5;
  ${l.comment}: #4e862d;
  ${l.curlyBrackets}: #59913e;
  ${l.squareBrackets}: #59913e;
  ${l.keyword}: #666;
  ${l.dashes}: #444;
}

@media (prefers-color-scheme: dark) {
  :host {
    ${l.text}: #f1f1f1;
    ${l.background}: #1f1f1f;
    ${l.string}: #ce916f;
    ${l.key}: #9cdcfe;
    ${l.number}: #b5cea8;
    ${l.boolean}: #569cd6;
    ${l.null}: #569cd6;
    ${l.comment}: #438a55;
    ${l.curlyBrackets}: #ffd708;
    ${l.squareBrackets}: #da70b9;
    ${l.keyword}: #dcdcaa;
    ${l.dashes}: #ddd;
  }
}`,U=["plaintext","json","yaml","css"],p={plaintext:()=>Promise.resolve().then(()=>require("./plaintext-t5CGmSc3-CSePIadz.cjs")),json:()=>Promise.resolve().then(()=>require("./json-Bh-SPdZH-o7eimfHZ.cjs")),yaml:()=>Promise.resolve().then(()=>require("./yaml-CGptevkk-DClgW290.cjs")),css:()=>Promise.resolve().then(()=>require("./css-CrqZ87Qb-CC68Jh-b.cjs"))},G=async t=>{if(!U.includes(t))return(await p.plaintext()).default;const n=await p[t]();return n?n.default:(await p.plaintext()).default};var j=class extends HTMLElement{static observedAttributes=["content","lang","readonly"];constructor(){super()}value="";codeEl=null;styleEl=null;applyHighlights=()=>{};async connectedCallback(){await this.prepare(),setTimeout(async()=>{await this.refresh()},1)}async attributeChangedCallback(n,a){n!==a&&await this.refresh()}async prepare(){const n=this.shadowRoot||this.attachShadow({mode:"open"});n.innerHTML="";const a=document.createElement("style");a.textContent=q,n.appendChild(a);const s=document.createElement("pre"),r=document.createElement("code"),i=this.hasAttribute("readonly")?"false":"plaintext-only";r.setAttribute("contenteditable",i),r.setAttribute("spellcheck","false"),n.appendChild(s),s.appendChild(r),r.addEventListener("input",()=>{this.codeEl.normalize(),this.value=this.codeEl.textContent??"",this.applyHighlights()}),this.codeEl=r,this.styleEl=a}async refresh(){if(!this.codeEl)return;const n=await G(this.getAttribute("lang")??"plaintext"),a=this.getAttribute("content")??"";if(this.value=a,this.codeEl.textContent=n.format?n.format(a):a,!this.codeEl.childNodes?.[0])return;const s=window.crypto.randomUUID().substring(0,6),r=V(n.definitions,this.codeEl,s),i=r.map(o=>o.css).join(" ");this.styleEl.textContent+=`${i}`,this.applyHighlights=()=>{r.forEach(o=>{o.apply()})},this.applyHighlights()}};customElements.get("monogon-code")||customElements.define("monogon-code",j);const z=({content:t,lang:n,readonly:a})=>e.u("monogon-code",{content:t,lang:n,readonly:a});var J=z;try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="9a6cee7d-d372-4450-a2fd-84a2f55addf8",t._sentryDebugIdIdentifier="sentry-dbid-9a6cee7d-d372-4450-a2fd-84a2f55addf8")}catch{}const K="adyen-kyc-tabs",W={tabs:K},Z=({tabs:t,activeTab:n,onChange:a})=>e.u("div",{className:W.tabs,children:t.map(({name:s,label:r,disabled:i})=>{const o=n===s?"secondary":"tertiary";return e.u(e.Button,{onClick:()=>{a(s)},variant:o,disabled:i,children:r},s)})}),Q=(t,n)=>t.filter(({key:a})=>a.toLowerCase().includes(n.toLowerCase())),X=t=>[...t].sort(({key:n},{key:a})=>n.localeCompare(a)),m=({data:t,heading:n,searchTerm:a,tagPosition:s="after",sort:r=!1})=>{const i=e.T(()=>{const o=a?Q(t,a):t;return r?X(o):o},[t,a]);return e.u("div",{children:[n?e.u("h3",{children:n}):void 0,i.length===0?e.u("p",{children:["No results found for ",e.u("strong",{children:a})]}):e.u("table",{children:e.u("tbody",{children:i.map(({key:o,value:d,label:u,variant:b})=>e.u("tr",{children:[s==="before"?e.u("td",{children:e.u(k,{variant:b??"grey",children:d})}):void 0,e.u("td",{children:[e.u("span",{className:"adyen-kyc-debug-modal__table-key",children:o}),u&&e.u("span",{children:u})]}),s==="after"?e.u("td",{children:e.u(k,{variant:b??"grey",children:d})}):void 0]},o))})})]})},Y=t=>{switch(t){case void 0:return"orange";case!0:return"green";case!1:return"red";default:return"blue"}},ee=({experiments:t,settings:n})=>{const[a,s]=e.d(""),r=e.entriesOf(t).map(([o,d])=>({key:`${o}`,value:d?"Enabled":"Disabled",variant:d?"green":"red"})),i=e.entriesOf(n).map(([o,d])=>({key:o,value:`${d}`,variant:Y(d)}));return e.u(e.k,{children:[e.u(f.InputText,{name:"search",value:a,onInput:o=>s(o.currentTarget.value),placeholder:"Search for Experiments/Settings 🔎",trimOnBlur:!0,spellCheck:!1,"aria-label":"Search experiments or settings","aria-invalid":!1}),e.u(m,{tagPosition:"before",data:r,heading:"Experiments",searchTerm:a,sort:!0}),e.u(m,{data:i,heading:"Settings",searchTerm:a,sort:!0})]})},te="adyen-kyc-searchInput",ne="adyen-kyc-toolbar",ae="adyen-kyc-fieldHeader",se="adyen-kyc-status",oe="adyen-kyc-statusRequired",re="adyen-kyc-statusOptional",ie="adyen-kyc-statusHidden",le="adyen-kyc-statusInfo",de="adyen-kyc-reasonsList",ce="adyen-kyc-reasonItem",c={searchInput:te,toolbar:ne,fieldHeader:ae,status:se,statusRequired:oe,statusOptional:re,statusHidden:ie,statusInfo:le,reasonsList:de,reasonItem:ce},ue={REQUIRED:c.statusRequired,OPTIONAL:c.statusOptional,INFO:c.statusInfo,HIDDEN:c.statusHidden},ge=()=>{const t=f.formDebugInfo.value,[n,a]=e.d(""),[s,r]=e.d(!1),i=Object.keys(t).filter(o=>o.toLowerCase().includes(n.toLowerCase())).filter(o=>s||t[o].status!=="HIDDEN").sort((o,d)=>o==="__FORMS__"?-1:d==="__FORMS__"?1:o.localeCompare(d));return Object.keys(t).length===0?e.u("p",{children:"No form debug data available. Navigate to a form to see its debug info."}):e.u("div",{children:[e.u("div",{className:c.toolbar,children:[e.u("input",{type:"text",placeholder:"Search field...",value:n,onInput:o=>a(o.currentTarget.value),className:c.searchInput}),e.u(e.Checkbox,{id:"show-hidden-fields",name:"show-hidden-fields",label:"Show hidden fields",checked:s,onChange:()=>r(!s)})]}),i.map(o=>{const d=t[o];return e.u(e.Accordion,{onToggle:()=>{},children:[e.u("template",{slot:"title",children:e.u("div",{className:c.fieldHeader,children:[e.u("span",{className:c.status,children:o})," ",e.u("span",{className:ue[d.status],children:["(",d.status,")"]})]})}),e.u("template",{slot:"content",children:e.u("ul",{className:c.reasonsList,children:d.reasons.map((u,b)=>e.u("li",{className:c.reasonItem,children:u},b))})})]},o)})]})},be=({legalEntityData:t})=>{if(!t)return e.u(e.k,{});const{rootLegalEntity:n,rootLegalEntityType:a}=t,s=n.entityAssociations?.map(({name:r,type:i,jobTitle:o})=>r?{key:r,value:`${i}`,label:o,variant:"blue"}:null).filter(Boolean)??[];return e.u(e.k,{children:[e.u("span",{children:["Root legal entity type: ",e.u(k,{children:a})]}),s.length?e.u(m,{data:s,heading:"Decision Makers"}):void 0,n?e.u(J,{lang:"json",content:JSON.stringify(n,null,2)}):void 0]})},he=({metadata:{sdkVersion:t,locale:n,rootLegalEntityId:a}})=>{const s=[{key:"SDK version",value:t,variant:"green"},{key:"Locale",value:n,variant:"blue"},{key:"Root legal entity ID",value:a,variant:"teal"}];return e.u("div",{className:"adyen-kyc-debug-modal__meta",children:e.u(m,{data:s})})},ye="adyen-kyc-debug-modal",fe="adyen-kyc-debug-header",me="adyen-kyc-footer",pe="adyen-kyc-footer-copy-status",Ee="adyen-kyc-content",y={debugModal:ye,debugHeader:fe,footer:me,footerCopyStatus:pe,content:Ee},ke="adyen-kyc-header",ve="adyen-kyc-task-name",Ce="adyen-kyc-table",E={header:ke,taskName:ve,table:Ce},we=({taskStatuses:t})=>{const{t:n}=e.useTranslation("common");return e.u("table",{className:E.table,children:[e.u("thead",{children:e.u("tr",{className:E.header,children:[e.u("th",{children:n(a=>a.task)}),e.u("th",{children:n(a=>a.status)}),e.u("th",{children:n(a=>a.reason)})]})}),e.u("tbody",{children:e.entriesOf(t).sort(([a],[s])=>a.localeCompare(s)).map(([a,s])=>{const{taskType:r,id:i}=e.splitTaskIdentifier(a);return e.u("tr",{children:[e.u("td",{className:E.taskName,children:[r,i?`: ${i}`:""]}),s?e.u(e.k,{children:[e.u("td",{children:e.u(e.TaskVerificationStatus,{status:s.status})}),e.u("td",{children:[n(o=>o[s.reason]),e.u(Se,{status:s})]})]}):e.u(e.k,{})]},a)})})]})},Se=({status:t})=>{const{reason:n,details:a}=t;switch(n){case"invalidInputError":{const s=a.verificationError,r=s.subErrors;return e.u("div",{children:[s.code,": ",s.message,r?e.u("ul",{children:(s.subErrors??[]).map(i=>e.u("li",{children:[i.code,": ",i.message]},i.code))}):e.u(e.k,{})]})}case"dataMissingError":{const s=a.verificationError,r=s.subErrors;return e.u("div",{children:[s.code,": ",s.message,r?e.u("ul",{children:(s.subErrors??[]).map(i=>e.u("li",{children:[i.code,": ",i.message]},i.code))}):e.u(e.k,{})]})}case"pendingCapabilities":{const s=a.pendingCapabilities;return e.u("ul",{children:s.map(r=>e.u("li",{children:r},r))})}}},Te=e.createLogger(),De=({onExit:t})=>{const{isExperimentEnabled:n}=e.useExperimentsContext(),{getSetting:a}=e.useSettingsContext(),[s,r]=e.d(!1),{i18n:i}=e.useTranslation(),[o,d]=e.d("metadata"),u=e.useGlobalStore().rootLegalEntity.value,b=Object.keys(f.formDebugInfo.value).length>0,v={sdkVersion:"4.0.0-compact.9",locale:i.language,rootLegalEntityId:u.id},C=e.listToRecord(e.valuesOf(M),n),w=e.listToRecord(e.valuesOf(f.SettingNames),a),S=e.useGlobalStore().taskStatuses.value,T={rootLegalEntity:u,rootLegalEntityType:u.type},x=async()=>{const h={metadata:v,experiments:C,settings:w,taskStatuses:S,legalEntityData:T};await window.navigator.clipboard.writeText(JSON.stringify(h,null,2)),r(!0),setTimeout(()=>{r(!1)},5e3)},D=[{name:"metadata",label:"Metadata"},{name:"experimentsSettings",label:"Experiments & Settings"},{name:"taskStatuses",label:"Task Statuses"},{name:"legalEntityData",label:"Legal Entity Data"}];return b&&D.push({name:"formConfig",label:"Form Config"}),e.u(e.Modal,{size:"fullscreen",onClose:t,ariaLabel:"Debug",children:e.u("div",{className:y.debugModal,children:[e.u("div",{className:y.debugHeader,children:[e.u("h1",{children:"Debug"})," ",e.u(Z,{activeTab:o,onChange:h=>d(h),tabs:D})]}),e.u("div",{className:y.content,children:[o==="metadata"?e.u(he,{metadata:v}):void 0,o==="taskStatuses"?e.u(we,{taskStatuses:S}):void 0,o==="experimentsSettings"?e.u(ee,{experiments:C,settings:w}):void 0,o==="legalEntityData"?e.u(be,{legalEntityData:T}):void 0,o==="formConfig"?e.u(ge,{}):void 0]}),e.u("div",{className:y.footer,children:e.u("div",{children:[e.u(e.Button,{icon:"document",onClick:()=>{x().catch(h=>{Te.error("Error copying to clipboard:",h)})},children:"Copy debug info"}),s?e.u("span",{className:y.footerCopyStatus,children:[e.u(e.Icon,{name:"check"})," Copied!"]}):void 0]})})]})})},xe=Object.freeze(Object.defineProperty({__proto__:null,DebugModal:De},Symbol.toStringTag,{value:"Module"}));exports.DebugModalC7WSGJRZ=xe;exports.cssProps=l;
//# sourceMappingURL=DebugModal-C7WSGJRZ-C-yprrHT.cjs.map
