@kya-os/consent 0.1.3 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAmloF,CAAC;AAEjnoF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAc,CAAC"}
1
+ {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAA+zoF,CAAC;AAE71oF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAc,CAAC"}
@@ -11,8 +11,8 @@
11
11
  * The bundled consent.js content as a string.
12
12
  * Use this to serve the bundle from a Worker.
13
13
  */
14
- export const CONSENT_BUNDLE = "var Je=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var n=(i,t,e,r)=>{for(var s=r>1?void 0:r?Qe(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(t,e,s):a(s))||s);return r&&s&&Je(t,e,s),s};var oe=globalThis,ne=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,pe=Symbol(),Ce=new WeakMap,K=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==pe)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(ne&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ce.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ce.set(e,t))}return t}toString(){return this.cssText}},Ee=i=>new K(typeof i==\"string\"?i:i+\"\",void 0,pe),v=(i,...t)=>{let e=i.length===1?i[0]:t.reduce(((r,s,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a==\"number\")return a;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+a+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+i[o+1]),i[0]);return new K(e,i,pe)},Ae=(i,t)=>{if(ne)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let r=document.createElement(\"style\"),s=oe.litNonce;s!==void 0&&r.setAttribute(\"nonce\",s),r.textContent=e.cssText,i.appendChild(r)}},ue=ne?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e=\"\";for(let r of t.cssRules)e+=r.cssText;return Ee(e)})(i):i;var{is:Xe,defineProperty:Ze,getOwnPropertyDescriptor:et,getOwnPropertyNames:tt,getOwnPropertySymbols:rt,getPrototypeOf:it}=Object,P=globalThis,Se=P.trustedTypes,st=Se?Se.emptyScript:\"\",ot=P.reactiveElementPolyfillSupport,W=(i,t)=>i,J={toAttribute(i,t){switch(t){case Boolean:i=i?st:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ae=(i,t)=>!Xe(i,t),_e={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??(Symbol.metadata=Symbol(\"metadata\")),P.litPropertyMetadata??(P.litPropertyMetadata=new WeakMap);var N=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_e){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Ze(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){let{get:s,set:o}=et(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:s,set(a){let p=s?.call(this);o?.call(this,a),this.requestUpdate(t,p,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_e}static _$Ei(){if(this.hasOwnProperty(W(\"elementProperties\")))return;let t=it(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W(\"properties\"))){let e=this.properties,r=[...tt(e),...rt(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(ue(s))}else t!==void 0&&e.push(ue(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r==\"string\"?r:typeof t==\"string\"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ae(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:J).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter==\"function\"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:J;this._$Em=s;let p=a.fromAttribute(e,o.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){let s=this.constructor,o=this[t];if(r??(r=s.getPropertyOptions(t)),!((r.hasChanged??ae)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:o},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??e??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[s,o]of r){let{wrapped:a}=o,p=this[s];a!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,o,p)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:\"open\"},N[W(\"elementProperties\")]=new Map,N[W(\"finalized\")]=new Map,ot?.({ReactiveElement:N}),(P.reactiveElementVersions??(P.reactiveElementVersions=[])).push(\"2.1.1\");var X=globalThis,le=X.trustedTypes,ke=le?le.createPolicy(\"lit-html\",{createHTML:i=>i}):void 0,Ne=\"$lit$\",M=`lit$${Math.random().toFixed(9).slice(2)}$`,Le=\"?\"+M,nt=`<${Le}>`,F=document,Z=()=>F.createComment(\"\"),ee=i=>i===null||typeof i!=\"object\"&&typeof i!=\"function\",ye=Array.isArray,at=i=>ye(i)||typeof i?.[Symbol.iterator]==\"function\",he=`[ \t\n\\f\\r]`,Q=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,Te=/-->/g,Re=/>/g,O=RegExp(`>|${he}(?:([^\\\\s\"'>=/]+)(${he}*=${he}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),Ue=/'/g,Ie=/\"/g,Pe=/^(?:script|style|textarea|title)$/i,xe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=xe(1),Ut=xe(2),It=xe(3),L=Symbol.for(\"lit-noChange\"),u=Symbol.for(\"lit-nothing\"),De=new WeakMap,B=F.createTreeWalker(F,129);function Me(i,t){if(!ye(i)||!i.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return ke!==void 0?ke.createHTML(t):t}var lt=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?\"<svg>\":t===3?\"<math>\":\"\",a=Q;for(let p=0;p<e;p++){let c=i[p],f,b,h=-1,T=0;for(;T<c.length&&(a.lastIndex=T,b=a.exec(c),b!==null);)T=a.lastIndex,a===Q?b[1]===\"!--\"?a=Te:b[1]!==void 0?a=Re:b[2]!==void 0?(Pe.test(b[2])&&(s=RegExp(\"</\"+b[2],\"g\")),a=O):b[3]!==void 0&&(a=O):a===O?b[0]===\">\"?(a=s??Q,h=-1):b[1]===void 0?h=-2:(h=a.lastIndex-b[2].length,f=b[1],a=b[3]===void 0?O:b[3]==='\"'?Ie:Ue):a===Ie||a===Ue?a=O:a===Te||a===Re?a=Q:(a=O,s=void 0);let R=a===O&&i[p+1].startsWith(\"/>\")?\" \":\"\";o+=a===Q?c+nt:h>=0?(r.push(f),c.slice(0,h)+Ne+c.slice(h)+M+R):c+M+(h===-2?p:R)}return[Me(i,o+(i[e]||\"<?>\")+(t===2?\"</svg>\":t===3?\"</math>\":\"\")),r]},te=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,a=0,p=t.length-1,c=this.parts,[f,b]=lt(t,e);if(this.el=i.createElement(f,r),B.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=B.nextNode())!==null&&c.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Ne)){let T=b[a++],R=s.getAttribute(h).split(M),q=/([.?@])?(.*)/.exec(T);c.push({type:1,index:o,name:q[2],strings:R,ctor:q[1]===\".\"?ge:q[1]===\"?\"?fe:q[1]===\"@\"?ve:j}),s.removeAttribute(h)}else h.startsWith(M)&&(c.push({type:6,index:o}),s.removeAttribute(h));if(Pe.test(s.tagName)){let h=s.textContent.split(M),T=h.length-1;if(T>0){s.textContent=le?le.emptyScript:\"\";for(let R=0;R<T;R++)s.append(h[R],Z()),B.nextNode(),c.push({type:2,index:++o});s.append(h[T],Z())}}}else if(s.nodeType===8)if(s.data===Le)c.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(M,h+1))!==-1;)c.push({type:7,index:o}),h+=M.length-1}o++}}static createElement(t,e){let r=F.createElement(\"template\");return r.innerHTML=t,r}};function z(i,t,e=i,r){if(t===L)return t;let s=r!==void 0?e._$Co?.[r]:e._$Cl,o=ee(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=s:e._$Cl=s),s!==void 0&&(t=z(i,s._$AS(i,t.values),s,r)),t}var me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??F).importNode(e,!0);B.currentNode=s;let o=B.nextNode(),a=0,p=0,c=r[0];for(;c!==void 0;){if(a===c.index){let f;c.type===2?f=new re(o,o.nextSibling,this,t):c.type===1?f=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(f=new be(o,this,t)),this._$AV.push(f),c=r[++p]}a!==c?.index&&(o=B.nextNode(),a++)}return B.currentNode=F,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},re=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),ee(t)?t===u||t==null||t===\"\"?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):at(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&ee(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,s=typeof r==\"number\"?this._$AC(t):(r.el===void 0&&(r.el=te.createElement(Me(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{let o=new me(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=De.get(t.strings);return e===void 0&&De.set(t.strings,e=new te(t)),e}k(t){ye(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Z()),this.O(Z()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==\"\"||r[1]!==\"\"?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(t,e=this,r,s){let o=this.strings,a=!1;if(o===void 0)t=z(this,t,e,0),a=!ee(t)||t!==this._$AH&&t!==L,a&&(this._$AH=t);else{let p=t,c,f;for(t=o[0],c=0;c<o.length-1;c++)f=z(this,p[r+c],e,c),f===L&&(f=this._$AH[c]),a||(a=!ee(f)||f!==this._$AH[c]),f===u?t=u:t!==u&&(t+=(f??\"\")+o[c+1]),this._$AH[c]=f}a&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}},ge=class extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},fe=class extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},ve=class extends j{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){if((t=z(this,t,e,0)??u)===L)return;let r=this._$AH,s=t===u&&r!==u||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==u&&(r===u||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH==\"function\"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},be=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var dt=X.litHtmlPolyfillSupport;dt?.(te,re),(X.litHtmlVersions??(X.litHtmlVersions=[])).push(\"3.3.1\");var Oe=(i,t,e)=>{let r=e?.renderBefore??t,s=r._$litPart$;if(s===void 0){let o=e?.renderBefore??null;r._$litPart$=s=new re(t.insertBefore(Z(),o),o,void 0,e??{})}return s._$AI(i),s};var ie=globalThis,g=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Oe(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};g._$litElement$=!0,g.finalized=!0,ie.litElementHydrateSupport?.({LitElement:g});var ct=ie.litElementPolyfillSupport;ct?.({LitElement:g});(ie.litElementVersions??(ie.litElementVersions=[])).push(\"4.2.1\");var y=i=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(i,t)})):customElements.define(i,t)};var pt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ae},ut=(i=pt,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r===\"setter\"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),r===\"accessor\"){let{name:a}=e;return{set(p){let c=t.get.call(this);t.set.call(this,p),this.requestUpdate(a,c,i)},init(p){return p!==void 0&&this.C(a,void 0,i,p),p}}}if(r===\"setter\"){let{name:a}=e;return function(p){let c=this[a];t.call(this,p),this.requestUpdate(a,c,i)}}throw Error(\"Unsupported decorator location: \"+r)};function l(i){return(t,e)=>typeof e==\"object\"?ut(i,t,e):((r,s,o)=>{let a=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function x(i){return l({...i,state:!0,attribute:!1})}var V=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!=\"object\"&&Object.defineProperty(i,t,e),e);var ht;function Be(i){return(t,e)=>V(t,e,{get(){return(this.renderRoot??ht??(ht=document.createDocumentFragment())).querySelectorAll(i)}})}var _=class extends g{constructor(){super();this.variant=\"primary\";this.type=\"button\";this.disabled=!1;this.fullWidth=!1;this.loading=!1;this.internals=this.attachInternals()}handleClick(){if(this.disabled||this.loading)return;let e=this.internals.form;e&&(this.type===\"submit\"?e.requestSubmit():this.type===\"reset\"&&e.reset())}render(){return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||this.loading}\n aria-busy=${this.loading}\n @click=${this.handleClick}\n >\n ${this.loading?d`<span class=\"spinner\"></span>`:null}\n <slot></slot>\n </button>\n `}};_.formAssociated=!0,_.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n /* Base styles - matches AgentShield PreviewButton exactly */\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: opacity 0.15s ease, background-color 0.15s ease;\n border: none;\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n }\n\n /* Primary variant */\n :host([variant='primary']) button {\n background-color: var(--consent-primary, #2563eb);\n color: white;\n }\n\n :host([variant='primary']) button:hover:not(:disabled) {\n opacity: 0.9;\n }\n\n /* Secondary variant */\n :host([variant='secondary']) button {\n background-color: transparent;\n color: #374151;\n border: 1px solid #d1d5db;\n }\n\n :host([variant='secondary']) button:hover:not(:disabled) {\n background-color: #f9fafb;\n }\n\n /* Disabled state */\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n `,n([l({type:String,reflect:!0})],_.prototype,\"variant\",2),n([l({type:String})],_.prototype,\"type\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],_.prototype,\"fullWidth\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"loading\",2),_=n([y(\"consent-button\")],_);var k=class extends g{constructor(){super();this.name=\"\";this.checked=!1;this.required=!1;this.disabled=!1;this.value=\"on\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}render(){return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n <slot></slot>\n </span>\n </label>\n `}};k.formAssociated=!0,k.styles=v`\n :host {\n display: block;\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n /* Reset */\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem; /* Align with text baseline */\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--consent-primary, #2563eb);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--consent-primary, #2563eb);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--consent-primary, #2563eb);\n border-color: var(--consent-primary, #2563eb);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links in label */\n ::slotted(a) {\n color: var(--consent-primary, #2563eb);\n text-decoration: underline;\n }\n\n ::slotted(a:hover) {\n text-decoration: none;\n }\n `,n([l({type:String})],k.prototype,\"name\",2),n([l({type:Boolean,reflect:!0})],k.prototype,\"checked\",2),n([l({type:Boolean})],k.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],k.prototype,\"disabled\",2),n([l({type:String})],k.prototype,\"value\",2),k=n([y(\"consent-checkbox\")],k);var $=class extends g{constructor(){super();this.type=\"text\";this.name=\"\";this.value=\"\";this.label=\"\";this.placeholder=\"\";this.required=!1;this.disabled=!1;this.autocomplete=\"\";this.showPassword=!1;this.internals=this.attachInternals()}updated(e){e.has(\"value\")&&this.internals.setFormValue(this.value||null)}handleInput(e){let r=e.target;this.value=r.value,this.internals.setFormValue(this.value||null),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value},bubbles:!0,composed:!0}))}handleChange(e){let r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))}togglePasswordVisibility(){this.showPassword=!this.showPassword}renderPasswordToggle(){if(this.type!==\"password\")return null;let e=this.showPassword?d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\"/>\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"/>\n </svg>\n `:d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/>\n <circle cx=\"12\" cy=\"12\" r=\"3\"/>\n </svg>\n `;return d`\n <button\n type=\"button\"\n class=\"password-toggle\"\n @click=${this.togglePasswordVisibility}\n tabindex=\"-1\"\n aria-label=${this.showPassword?\"Hide password\":\"Show password\"}\n >\n ${e}\n </button>\n `}render(){let e=this.type===\"password\"&&this.showPassword?\"text\":this.type;return d`\n <div class=\"field\">\n ${this.label?d`\n <label part=\"label\" for=\"input\">\n ${this.label}${this.required?d`<span class=\"required\">*</span>`:null}\n </label>\n `:null}\n <div class=\"input-wrapper${this.error?\" has-error\":\"\"}\">\n <input\n part=\"input\"\n id=\"input\"\n type=${e}\n name=${this.name}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.disabled}\n autocomplete=${this.autocomplete||\"off\"}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n ${this.renderPasswordToggle()}\n </div>\n ${this.error?d`<div class=\"error-message\">${this.error}</div>`:null}\n </div>\n `}};$.formAssociated=!0,$.styles=v`\n :host {\n display: block;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n\n label {\n font-size: 0.875rem;\n font-weight: 500;\n color: #374151;\n }\n\n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n /* Base input styles - use .input-wrapper for higher specificity */\n .input-wrapper input {\n width: 100%;\n padding: 0.625rem 0.75rem;\n font-size: 0.875rem;\n font-family: inherit;\n color: #111827;\n background-color: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n box-shadow: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .input-wrapper input:focus {\n border-color: var(--consent-primary, #2563eb);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n .input-wrapper input:disabled {\n background-color: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .input-wrapper input::placeholder {\n color: #9ca3af;\n }\n\n /* Prevent browser validation styling before user interaction */\n .input-wrapper input:invalid {\n border-color: #d1d5db;\n box-shadow: none;\n outline: none;\n background-color: white;\n }\n\n /* Override browser autofill styling */\n .input-wrapper input:-webkit-autofill,\n .input-wrapper input:-webkit-autofill:hover,\n .input-wrapper input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px white inset;\n -webkit-text-fill-color: #111827;\n border-color: #d1d5db;\n transition: background-color 5000s ease-in-out 0s;\n }\n\n /* Only show validation styling after user interaction */\n .input-wrapper input:user-invalid {\n border-color: #ef4444;\n }\n\n .input-wrapper input:user-invalid:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Password toggle */\n .input-wrapper input[type='password'] {\n padding-right: 2.5rem;\n }\n\n .password-toggle {\n position: absolute;\n right: 0.5rem;\n padding: 0.375rem;\n background: none;\n border: none;\n cursor: pointer;\n color: #6b7280;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .password-toggle:hover {\n color: #374151;\n }\n\n .password-toggle svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Error state - use class instead of attribute for proper specificity */\n .input-wrapper.has-error input {\n border-color: #ef4444;\n }\n\n .input-wrapper.has-error input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n .error-message {\n font-size: 0.75rem;\n color: #ef4444;\n margin-top: 0.25rem;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],$.prototype,\"type\",2),n([l({type:String})],$.prototype,\"name\",2),n([l({type:String})],$.prototype,\"value\",2),n([l({type:String})],$.prototype,\"label\",2),n([l({type:String})],$.prototype,\"placeholder\",2),n([l({type:Boolean})],$.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"disabled\",2),n([l({type:String})],$.prototype,\"autocomplete\",2),n([l({type:String})],$.prototype,\"error\",2),n([x()],$.prototype,\"showPassword\",2),$=n([y(\"consent-input\")],$);var U=class extends g{constructor(){super(...arguments);this.pageTitle=\"Permission Request\";this.primaryColor=\"#2563EB\";this.secondaryColor=\"#DBEAFE\"}renderLogo(){return this.logoUrl?d`\n <img\n class=\"logo\"\n src=${this.logoUrl}\n alt=${this.companyName||\"Company logo\"}\n />\n `:d`\n <div class=\"default-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"\n fill=\"currentColor\"\n opacity=\"0.2\"\n />\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `}updated(e){(e.has(\"primaryColor\")||e.has(\"secondaryColor\"))&&(this.style.setProperty(\"--consent-primary\",this.primaryColor),this.style.setProperty(\"--consent-secondary\",this.secondaryColor))}render(){return d`\n <div class=\"container\" part=\"container\">\n <header class=\"header\" part=\"header\">\n ${this.renderLogo()}\n ${this.companyName?d`<div class=\"company-name\">${this.companyName}</div>`:null}\n <h1 class=\"title\">${this.pageTitle}</h1>\n </header>\n\n <div class=\"content\" part=\"content\">\n <slot name=\"content\"></slot>\n </div>\n\n <footer class=\"footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n `}};U.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n /* Allow customization via CSS variables */\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Container - matches AgentShield PreviewShell exactly */\n .container {\n background: white;\n border-radius: 20px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow:\n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n max-width: 512px;\n width: 100%;\n margin: 0 auto;\n }\n\n /* Header */\n .header {\n padding: 1.25rem 2rem 0;\n text-align: center;\n }\n\n .logo {\n max-height: 48px;\n max-width: 200px;\n margin-bottom: 0.5rem;\n }\n\n .company-name {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .title {\n font-size: 1.5rem;\n font-weight: 700;\n color: #333333;\n margin: 0;\n }\n\n /* Content */\n .content {\n padding: 1rem 2rem 2rem;\n }\n\n /* Footer */\n .footer {\n padding: 0 2rem 2rem;\n display: flex;\n gap: 0.75rem;\n }\n\n .footer ::slotted(*) {\n flex: 1;\n }\n\n /* Default icon when no logo */\n .default-icon {\n width: 48px;\n height: 48px;\n margin: 0 auto 0.5rem;\n background: var(--_secondary);\n border-radius: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .default-icon svg {\n width: 24px;\n height: 24px;\n color: var(--_primary);\n }\n `,n([l({type:String,attribute:\"page-title\"})],U.prototype,\"pageTitle\",2),n([l({type:String,attribute:\"logo-url\"})],U.prototype,\"logoUrl\",2),n([l({type:String,attribute:\"company-name\"})],U.prototype,\"companyName\",2),n([l({type:String,attribute:\"primary-color\"})],U.prototype,\"primaryColor\",2),n([l({type:String,attribute:\"secondary-color\"})],U.prototype,\"secondaryColor\",2),U=n([y(\"consent-shell\")],U);var I=class extends g{constructor(){super(...arguments);this.scopes=[];this.interactive=!1;this.selectAll=!1;this.iconStyle=\"check\";this.selectedScopes=new Set;this.previousScopeIds=new Set}connectedCallback(){super.connectedCallback(),this.interactive&&this.initializeSelectedScopes()}updated(e){e.has(\"scopes\")&&this.interactive&&this.reinitializeSelectedScopes()}reinitializeSelectedScopes(){let e=new Set(this.normalizedScopes.map(o=>o.id)),r=new Set(Array.from(this.selectedScopes).filter(o=>e.has(o))),s=Array.from(e).filter(o=>!this.previousScopeIds.has(o));if(this.selectAll)this.selectedScopes=new Set([...r,...s]);else{let o=this.normalizedScopes.filter(a=>a.required).map(a=>a.id);this.selectedScopes=new Set([...r,...o])}this.previousScopeIds=e,this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}initializeSelectedScopes(){this.previousScopeIds=new Set(this.normalizedScopes.map(e=>e.id)),this.selectAll?this.selectedScopes=new Set(this.normalizedScopes.map(e=>e.id)):this.selectedScopes=new Set(this.normalizedScopes.filter(e=>e.required).map(e=>e.id))}get normalizedScopes(){return this.scopes.map(e=>typeof e==\"string\"?{id:e,label:this.formatScopeLabel(e)}:e)}formatScopeLabel(e){return e.replace(/[_:-]/g,\" \").replace(/\\b\\w/g,r=>r.toUpperCase())}getSelectedScopes(){return Array.from(this.selectedScopes)}handleCheckboxChange(e,r){r?this.selectedScopes.add(e):this.selectedScopes.delete(e),this.requestUpdate(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}renderIcon(){switch(this.iconStyle){case\"bullet\":return d`<div class=\"icon icon-bullet\"></div>`;case\"shield\":return d`\n <div class=\"icon icon-shield\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `;default:return d`\n <div class=\"icon icon-check\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n `}}renderPermissionItem(e){let r=this.selectedScopes.has(e.id);return d`\n <li class=\"permission-item\" part=\"item\">\n ${this.interactive?d`\n <input\n type=\"checkbox\"\n class=\"checkbox\"\n .checked=${r}\n ?disabled=${e.required}\n @change=${s=>this.handleCheckboxChange(e.id,s.target.checked)}\n aria-label=${e.label}\n />\n `:this.renderIcon()}\n <div class=\"content\">\n <span class=\"label\">\n ${e.label}\n ${e.required?d`<span class=\"required-badge\">Required</span>`:null}\n </span>\n ${e.description?d`<div class=\"description\">${e.description}</div>`:null}\n </div>\n </li>\n `}render(){let e=this.normalizedScopes;return e.length===0?d`<div class=\"empty\">No permissions requested</div>`:d`\n <ul class=\"permission-list\" part=\"list\" role=\"list\">\n ${e.map(r=>this.renderPermissionItem(r))}\n </ul>\n `}};I.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .permission-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .permission-item {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n padding: 0.625rem 0;\n font-size: 0.875rem;\n color: #374151;\n border-bottom: 1px solid #f3f4f6;\n }\n\n .permission-item:last-child {\n border-bottom: none;\n }\n\n /* Icon styles */\n .icon {\n flex-shrink: 0;\n width: 1.25rem;\n height: 1.25rem;\n margin-top: 0.0625rem;\n }\n\n .icon-check {\n background: var(--_primary);\n border-radius: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .icon-check svg {\n width: 0.75rem;\n height: 0.75rem;\n color: white;\n }\n\n .icon-bullet {\n background: var(--_primary);\n border-radius: 50%;\n width: 0.5rem;\n height: 0.5rem;\n margin: 0.375rem;\n }\n\n .icon-shield {\n color: var(--_primary);\n }\n\n .icon-shield svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Content */\n .content {\n flex: 1;\n }\n\n .label {\n font-weight: 500;\n color: #111827;\n }\n\n .description {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 0.125rem;\n }\n\n .required-badge {\n font-size: 0.625rem;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: #6b7280;\n background: #f3f4f6;\n padding: 0.125rem 0.375rem;\n border-radius: 0.25rem;\n margin-left: 0.5rem;\n }\n\n /* Interactive mode checkbox */\n .checkbox {\n appearance: none;\n -webkit-appearance: none;\n width: 1rem;\n height: 1rem;\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n background: white;\n cursor: pointer;\n position: relative;\n flex-shrink: 0;\n margin-top: 0.125rem;\n }\n\n .checkbox:checked {\n background: var(--_primary);\n border-color: var(--_primary);\n }\n\n .checkbox:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n .checkbox:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Empty state */\n .empty {\n text-align: center;\n color: #6b7280;\n font-size: 0.875rem;\n padding: 1rem 0;\n }\n `,n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r:(console.warn(\"[consent-permissions] Expected array, got:\",typeof r),[])}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],I.prototype,\"scopes\",2),n([l({type:Boolean})],I.prototype,\"interactive\",2),n([l({type:Boolean,attribute:\"select-all\"})],I.prototype,\"selectAll\",2),n([l({type:String,attribute:\"icon-style\"})],I.prototype,\"iconStyle\",2),n([x()],I.prototype,\"selectedScopes\",2),I=n([y(\"consent-permissions\")],I);var w=class extends g{constructor(){super();this.name=\"termsAccepted\";this.text=\"Terms and Conditions\";this.labelPrefix=\"I agree to the\";this.conjunction=\"and\";this.checked=!1;this.required=!0;this.disabled=!1;this.value=\"accepted\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}renderLink(e,r){return r?d`<a\n href=${r}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n part=\"link\"\n @click=${s=>s.stopPropagation()}\n >${e}</a\n >`:d`<span>${e}</span>`}render(){let e=this.privacyText&&this.privacyUrl;return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n ${this.labelPrefix} ${this.renderLink(this.text,this.url)}\n ${e?d`\n ${this.conjunction}\n ${this.renderLink(this.privacyText,this.privacyUrl)}\n `:u}\n ${this.required?d`<span class=\"required\">*</span>`:u}\n </span>\n </label>\n `}};w.formAssociated=!0,w.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem;\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--_primary);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--_primary);\n border-color: var(--_primary);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links */\n a {\n color: var(--_primary);\n text-decoration: underline;\n text-underline-offset: 2px;\n }\n\n a:hover {\n text-decoration: none;\n }\n\n a:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],w.prototype,\"name\",2),n([l({type:String})],w.prototype,\"text\",2),n([l({type:String})],w.prototype,\"url\",2),n([l({type:String,attribute:\"privacy-text\"})],w.prototype,\"privacyText\",2),n([l({type:String,attribute:\"privacy-url\"})],w.prototype,\"privacyUrl\",2),n([l({type:String,attribute:\"label-prefix\"})],w.prototype,\"labelPrefix\",2),n([l({type:String})],w.prototype,\"conjunction\",2),n([l({type:Boolean,reflect:!0})],w.prototype,\"checked\",2),n([l({type:Boolean})],w.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],w.prototype,\"disabled\",2),n([l({type:String})],w.prototype,\"value\",2),w=n([y(\"consent-terms\")],w);var Fe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ce=i=>(...t)=>({_$litDirective$:i,values:t}),de=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var H=class extends de{constructor(t){if(super(t),this.it=u,t.type!==Fe.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===L)return t;if(typeof t!=\"string\")throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};H.directiveName=\"unsafeHTML\",H.resultType=1;var Gr=ce(H);var se=class extends H{};se.directiveName=\"unsafeSVG\",se.resultType=2;var He=ce(se);function mt(i){if(!i||typeof i!=\"string\")return\"\";let t=i.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\"\");return t=t.replace(/\\s*on\\w+\\s*=\\s*[\"'][^\"']*[\"']/gi,\"\"),t=t.replace(/\\s*on\\w+\\s*=\\s*[^\\s>]*/gi,\"\"),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*javascript:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*data:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/data:text\\/html[^\"'>\\s]*/gi,\"\"),t}var qe={google:{name:\"Google\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"},microsoft:{name:\"Microsoft\",bgColor:\"#2f2f2f\",textColor:\"#ffffff\",borderColor:\"#2f2f2f\",hoverBgColor:\"#1f1f1f\"},apple:{name:\"Apple\",bgColor:\"#000000\",textColor:\"#ffffff\",borderColor:\"#000000\",hoverBgColor:\"#1a1a1a\"},github:{name:\"GitHub\",bgColor:\"#24292f\",textColor:\"#ffffff\",borderColor:\"#24292f\",hoverBgColor:\"#1b1f23\"},twitter:{name:\"Twitter\",bgColor:\"#1da1f2\",textColor:\"#ffffff\",borderColor:\"#1da1f2\",hoverBgColor:\"#0c8de4\"},facebook:{name:\"Facebook\",bgColor:\"#1877f2\",textColor:\"#ffffff\",borderColor:\"#1877f2\",hoverBgColor:\"#0b5ed7\"},custom:{name:\"Sign in\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"}},A=class extends g{constructor(){super(...arguments);this.provider=\"custom\";this.url=\"\";this.loading=!1;this.disabled=!1;this.fullWidth=!1;this.redirecting=!1}get config(){return qe[this.provider]||qe.custom}get displayName(){return this.providerName?this.providerName:this.config.name}get displayText(){return this.buttonText?this.buttonText:`Continue with ${this.displayName}`}handleClick(){this.disabled||this.loading||this.redirecting||(this.url&&(this.redirecting=!0,window.location.href=this.url),this.dispatchEvent(new CustomEvent(\"oauth-click\",{detail:{provider:this.provider,url:this.url},bubbles:!0,composed:!0})))}renderProviderIcon(){if(this.customIcon){let e=mt(this.customIcon);return d`<div class=\"icon\">${He(e)}</div>`}switch(this.provider){case\"google\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n </div>\n `;case\"microsoft\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 21 21\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"#f25022\" />\n <rect x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"#00a4ef\" />\n <rect x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"#7fba00\" />\n <rect x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"#ffb900\" />\n </svg>\n </div>\n `;case\"apple\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z\"\n />\n </svg>\n </div>\n `;case\"github\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z\"\n />\n </svg>\n </div>\n `;case\"twitter\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"\n />\n </svg>\n </div>\n `;case\"facebook\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\"\n />\n </svg>\n </div>\n `;default:return u}}updated(e){if(e.has(\"provider\")){let r=this.config;this.style.setProperty(\"--button-bg\",r.bgColor),this.style.setProperty(\"--button-text\",r.textColor),this.style.setProperty(\"--button-border\",r.borderColor),this.style.setProperty(\"--button-hover-bg\",r.hoverBgColor)}}render(){let e=this.loading||this.redirecting;return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||e}\n @click=${this.handleClick}\n style=\"\n background-color: var(--button-bg, ${this.config.bgColor});\n color: var(--button-text, ${this.config.textColor});\n border: 1px solid var(--button-border, ${this.config.borderColor});\n \"\n aria-busy=${e}\n >\n ${e?d`<span class=\"spinner\"></span>`:this.renderProviderIcon()}\n <span class=\"text\" part=\"text\">${this.displayText}</span>\n </button>\n `}};A.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n width: 100%;\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.15s ease;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n button:focus-visible {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n }\n\n .icon {\n width: 1.125rem;\n height: 1.125rem;\n flex-shrink: 0;\n }\n\n .icon svg {\n width: 100%;\n height: 100%;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .text {\n flex: 1;\n text-align: center;\n }\n `,n([l({type:String})],A.prototype,\"provider\",2),n([l({type:String,attribute:\"provider-name\"})],A.prototype,\"providerName\",2),n([l({type:String})],A.prototype,\"url\",2),n([l({type:String,attribute:\"button-text\"})],A.prototype,\"buttonText\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"loading\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],A.prototype,\"fullWidth\",2),n([l({type:String,attribute:\"custom-icon\"})],A.prototype,\"customIcon\",2),n([x()],A.prototype,\"redirecting\",2),A=n([y(\"consent-oauth-button\")],A);var E=class extends g{constructor(){super();this.length=6;this.name=\"otp\";this.value=\"\";this.disabled=!1;this.error=!1;this.autoFocus=!1;this.inputType=\"text\";this.digits=[];this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.initializeDigits()}initializeDigits(){this.digits=Array.from({length:this.length},()=>\"\"),this.value&&this.value.replace(/\\D/g,\"\").slice(0,this.length).split(\"\").forEach((s,o)=>{this.digits[o]=s})}firstUpdated(){this.autoFocus&&this.inputs.length>0&&this.inputs[0]?.focus()}updated(e){e.has(\"value\")&&!e.has(\"digits\")&&this.initializeDigits(),e.has(\"length\")&&this.initializeDigits();let r=this.digits.join(\"\");this.internals.setFormValue(r||null)}getFullValue(){return this.digits.join(\"\")}handleInput(e,r){let s=r.target,o=s.value;if(o.length>1&&(o=o.slice(-1)),o&&!/^\\d$/.test(o)){s.value=this.digits[e]??\"\";return}this.digits[e]=o,this.digits=[...this.digits],s.value=o;let a=this.getFullValue();this.value=a,this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:a,index:e,digit:o},bubbles:!0,composed:!0})),o&&e<this.length-1&&this.inputs[e+1]?.focus(),a.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:a},bubbles:!0,composed:!0}))}handleKeyDown(e,r){switch(r.key){case\"Backspace\":!this.digits[e]&&e>0?(r.preventDefault(),this.inputs[e-1]?.focus(),this.digits[e-1]=\"\",this.digits=[...this.digits]):(this.digits[e]=\"\",this.digits=[...this.digits]),this.value=this.getFullValue();break;case\"ArrowLeft\":r.preventDefault(),e>0&&this.inputs[e-1]?.focus();break;case\"ArrowRight\":r.preventDefault(),e<this.length-1&&this.inputs[e+1]?.focus();break;case\"Delete\":this.digits[e]=\"\",this.digits=[...this.digits],this.value=this.getFullValue();break}}handlePaste(e){e.preventDefault();let s=(e.clipboardData?.getData(\"text\")||\"\").replace(/\\D/g,\"\").slice(0,this.length);if(s){this.digits=Array.from({length:this.length},(a,p)=>s[p]||\"\"),this.value=this.getFullValue(),this.requestUpdate();let o=Math.min(s.length,this.length-1);setTimeout(()=>{this.inputs[o]?.focus()},0),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value,index:0,digit:s[0]||\"\"},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0})),s.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:this.value},bubbles:!0,composed:!0}))}}handleFocus(e){e.target.select()}focus(){let e=this.digits.findIndex(s=>!s),r=e>=0?e:this.length-1;this.inputs[r]?.focus()}clear(){this.digits=Array.from({length:this.length},()=>\"\"),this.value=\"\",this.inputs[0]?.focus()}renderDigitInput(e){let r=this.digits[e]||\"\",s=r!==\"\";return d`\n <input\n part=\"input\"\n type=${this.inputType}\n inputmode=\"numeric\"\n pattern=\"[0-9]*\"\n maxlength=\"1\"\n .value=${r}\n ?disabled=${this.disabled}\n placeholder=\"○\"\n class=${s?\"filled\":\"\"}\n @input=${o=>this.handleInput(e,o)}\n @keydown=${o=>this.handleKeyDown(e,o)}\n @paste=${this.handlePaste}\n @focus=${this.handleFocus}\n aria-label=${`Digit ${e+1} of ${this.length}`}\n />\n `}render(){return d`\n <div class=\"container\" part=\"container\" role=\"group\" aria-label=\"One-time password input\">\n ${Array.from({length:this.length},(e,r)=>this.renderDigitInput(r))}\n </div>\n `}};E.formAssociated=!0,E.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .container {\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n }\n\n input {\n width: 2.75rem;\n height: 3.5rem;\n text-align: center;\n font-size: 1.5rem;\n font-weight: 600;\n font-family: inherit;\n color: #111827;\n background: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n\n /* Hide spinner for number inputs */\n -moz-appearance: textfield;\n }\n\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input:focus {\n border-color: var(--_primary);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n input:disabled {\n background: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n input::placeholder {\n color: #d1d5db;\n }\n\n /* Error state */\n :host([error]) input {\n border-color: #ef4444;\n }\n\n :host([error]) input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Filled state */\n input.filled {\n border-color: var(--_primary);\n background: #f0f9ff;\n }\n\n /* Responsive: smaller on mobile */\n @media (max-width: 400px) {\n input {\n width: 2.25rem;\n height: 3rem;\n font-size: 1.25rem;\n }\n\n .container {\n gap: 0.375rem;\n }\n }\n `,n([l({type:Number})],E.prototype,\"length\",2),n([l({type:String})],E.prototype,\"name\",2),n([l({type:String})],E.prototype,\"value\",2),n([l({type:Boolean,reflect:!0})],E.prototype,\"disabled\",2),n([l({type:Boolean,reflect:!0})],E.prototype,\"error\",2),n([l({type:Boolean,attribute:\"auto-focus\"})],E.prototype,\"autoFocus\",2),n([l({type:String,attribute:\"input-type\"})],E.prototype,\"inputType\",2),n([x()],E.prototype,\"digits\",2),n([Be(\"input\")],E.prototype,\"inputs\",2),E=n([y(\"consent-otp-input\")],E);var S={CONSENT_ONLY:\"consent-only\",CREDENTIALS:\"credentials\",OAUTH:\"oauth\",MAGIC_LINK:\"magic-link\",OTP:\"otp\",QR_CODE:\"qr-code\",PASSKEY:\"passkey\",IDV:\"idv\"};var G={PRIMARY:\"#2563EB\",SECONDARY:\"#DBEAFE\",BACKGROUND:\"#F9FAFB\",TEXT_PRIMARY:\"#111827\",TEXT_SECONDARY:\"#6B7280\",TEXT_MUTED:\"#9CA3AF\",BORDER:\"#E5E7EB\",BORDER_DARK:\"#D1D5DB\",SUCCESS:\"#16A34A\",ERROR:\"#DC2626\",WARNING:\"#F59E0B\"};var hi={primaryColor:G.PRIMARY,secondaryColor:G.SECONDARY,logoUrl:void 0,companyName:void 0},C={title:\"Permission request\",description:\"It looks like you would like to use [AI Agent] to access resources on your behalf.\",expirationText:\"This delegation will expire in\",cancelButtonText:\"Cancel\",submitButtonText:\"Allow access\",permissionsHeader:\"The agent is requesting the following permissions:\",autoClose:!1,popupEnabled:!1,theme:\"auto\"},Y={text:\"Terms and Conditions\",url:void 0,version:void 0,required:!0},D={title:\"Access Granted\",description:\"The agent now has permission to act on your behalf.\",showCredential:!0,redirectUrl:void 0,redirectDelay:void 0,continueButtonText:\"Close\"};var ze=30;function gt(i){return i?/^#[0-9A-Fa-f]{6}$/.test(i):!1}function je(i,t){return gt(i)?i:t}function ft(i){if(!i)return!1;try{let t=new URL(i);return t.protocol===\"http:\"||t.protocol===\"https:\"}catch{return!1}}function vt(i){if(ft(i))return i}function Ve(i){let t=i.replace(/^#/,\"\"),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${e}, ${r}, ${s}`}function bt(i){return{\"--consent-primary\":i.primaryColor,\"--consent-secondary\":i.secondaryColor,\"--consent-primary-rgb\":Ve(i.primaryColor),\"--consent-secondary-rgb\":Ve(i.secondaryColor)}}function Ge(i){let t=je(i?.primaryColor,G.PRIMARY),e=je(i?.secondaryColor,G.SECONDARY),r=vt(i?.logoUrl),s=i?.companyName?.trim()||void 0,o=bt({primaryColor:t,secondaryColor:e});return{primaryColor:t,secondaryColor:e,logoUrl:r,companyName:s,cssVars:o}}var yt=\"[AI Agent]\";function Ye(i,t){return t?i.replace(new RegExp(xt(yt),\"g\"),t):i}function xt(i){return i.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Ke(i,t){let e=i?.ui??{},r=i?.terms??{},s=i?.success??{},o=e.title??C.title,a=e.description??C.description,p=e.expirationText??C.expirationText,c=e.cancelButtonText??C.cancelButtonText,f=e.submitButtonText??C.submitButtonText,b=e.permissionsHeader??C.permissionsHeader,h=r.text??Y.text,T=s.title??D.title,R=s.description??D.description,q=Ye(a,t),We=Ye(R,t);return{title:o,description:a,expirationText:p,cancelButtonText:c,submitButtonText:f,permissionsHeader:b,termsText:h,termsUrl:r.url,termsRequired:r.required??Y.required,resolvedDescription:q,successTitle:T,successDescription:R,resolvedSuccessDescription:We,showCredential:s.showCredential??D.showCredential,continueButtonText:s.continueButtonText??D.continueButtonText}}function wt(i){return!i||i.length===0?[]:i.slice(0,10).filter(e=>!(!e.name||!e.label||!/^[a-zA-Z0-9_]+$/.test(e.name)||e.type===\"select\"&&(!e.options||e.options.length===0)))}function $t(i){return i==null?ze:i<1?1:i>365?365:Math.floor(i)}function we(i){return i?.oauth?.providerId?S.OAUTH:i?.credentials?.usernameLabel||i?.credentials?.passwordLabel?S.CREDENTIALS:i?.magicLink?.enabled?S.MAGIC_LINK:i?.otp?.enabled?S.OTP:S.CONSENT_ONLY}function Ct(i){return{title:i?.title??C.title,description:i?.description??C.description,expirationText:i?.expirationText??C.expirationText,cancelButtonText:i?.cancelButtonText??C.cancelButtonText,submitButtonText:i?.submitButtonText??C.submitButtonText,permissionsHeader:i?.permissionsHeader??C.permissionsHeader,autoClose:i?.autoClose??C.autoClose,popupEnabled:i?.popupEnabled??C.popupEnabled,theme:i?.theme??C.theme}}function Et(i){return{text:i?.text??Y.text,url:i?.url,version:i?.version,required:i?.required??Y.required}}function At(i){return{title:i?.title??D.title,description:i?.description??D.description,showCredential:i?.showCredential??D.showCredential,redirectUrl:i?.redirectUrl,redirectDelay:i?.redirectDelay,continueButtonText:i?.continueButtonText??D.continueButtonText}}function $e(i,t){let e=Ge(i?.branding),r=Ke(i,t),s=Ct(i?.ui),o=Et(i?.terms),a=At(i?.success),p=wt(i?.customFields),c=$t(i?.expirationDays),f=we(i);return{branding:e,copy:r,ui:s,terms:o,success:a,customFields:p,expirationDays:c,authMode:f,credentials:i?.credentials,oauth:i?.oauth,magicLink:i?.magicLink,otp:i?.otp,qrCode:i?.qrCode,passkey:i?.passkey,idv:i?.idv}}var m=class extends g{constructor(){super(...arguments);this.tool=\"\";this.scopes=[];this.agentDid=\"\";this.sessionId=\"\";this.projectId=\"\";this.serverUrl=\"\";this.agentName=\"\";this.currentMode=S.CONSENT_ONLY;this.loading=!1;this.step=\"consent\";this.termsAccepted=!1;this.formData={};this.resendCooldown=0;this.selectedScopes=[]}connectedCallback(){super.connectedCallback(),this.resolved=$e(this.config,this.agentName),this.currentMode=this.mode??we(this.config)??S.CONSENT_ONLY,this.selectedScopes=[...this.scopes]}disconnectedCallback(){super.disconnectedCallback(),this.resendCooldownInterval!==void 0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)}updated(e){(e.has(\"config\")||e.has(\"agentName\"))&&(this.resolved=$e(this.config,this.agentName)),e.has(\"mode\")&&this.mode&&(this.currentMode=this.mode),e.has(\"scopes\")&&(this.selectedScopes=[...this.scopes]),this.resolved&&(this.style.setProperty(\"--consent-primary\",this.resolved.branding.primaryColor),this.style.setProperty(\"--consent-secondary\",this.resolved.branding.secondaryColor))}async handleApprove(e){if(e?.preventDefault(),!this.loading){if(!this.termsAccepted&&this.resolved?.terms.required){this.error=\"Please accept the terms to continue\";return}if(this.scopes.length>0&&this.selectedScopes.length===0){this.error=\"Please select at least one permission\";return}this.loading=!0,this.error=void 0;try{let r=new FormData;r.append(\"tool\",this.tool),r.append(\"scopes\",JSON.stringify(this.selectedScopes)),r.append(\"agent_did\",this.agentDid),r.append(\"session_id\",this.sessionId),r.append(\"project_id\",this.projectId),r.append(\"auth_mode\",this.currentMode),r.append(\"provider_type\",this.oauthIdentity?.provider??\"none\"),r.append(\"termsAccepted\",String(this.termsAccepted)),Object.entries(this.formData).forEach(([a,p])=>{r.append(a,p)});let s=await fetch(`${this.serverUrl}/consent/approve`,{method:\"POST\",body:r});if(!s.ok){let a=await s.json().catch(()=>({}));throw new Error(a.message||\"Approval failed\")}let o=await s.json();this.step=\"success\",this.dispatchEvent(new CustomEvent(\"mcp-consent:approve\",{detail:{success:!0,redirectUrl:o.redirectUrl},bubbles:!0,composed:!0}))}catch(r){this.error=r instanceof Error?r.message:\"Unknown error\",this.dispatchEvent(new CustomEvent(\"mcp-consent:error\",{detail:{error:this.error},bubbles:!0,composed:!0}))}finally{this.loading=!1}}}handleDeny(){this.dispatchEvent(new CustomEvent(\"mcp-consent:deny\",{bubbles:!0,composed:!0})),window.close()}handleTermsChange(e){this.termsAccepted=e.detail.checked}handleInputChange(e,r){this.formData={...this.formData,[e]:r}}handleResendOtp(){if(this.resendCooldown>0)return;let e=this.resolved?.otp?.resendCooldown??60;this.resendCooldown=e,this.resendCooldownInterval!==void 0&&clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=setInterval(()=>{this.resendCooldown--,this.resendCooldown<=0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)},1e3),this.dispatchEvent(new CustomEvent(\"mcp-consent:resend-otp\",{bubbles:!0,composed:!0}))}renderAgentInfo(){let e=this.agentName||\"this agent\";return d`\n <div class=\"agent-info\">\n <div class=\"agent-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4M12 8h.01\" />\n </svg>\n </div>\n <div class=\"agent-text\">\n <p>\n <strong>${e}</strong> is requesting permission to\n ${this.tool?d`use the <strong>${this.tool}</strong> tool`:\"access your data\"}\n on your behalf.\n </p>\n </div>\n </div>\n `}handlePermissionsChange(e){this.selectedScopes=e.detail.selected}renderPermissions(){return this.scopes.length===0?u:d`\n <p class=\"permissions-header\">\n ${this.resolved?.ui.permissionsHeader??\"The agent is requesting the following permissions:\"}\n </p>\n <div class=\"permissions\">\n <consent-permissions\n .scopes=${this.scopes}\n interactive\n select-all\n @change=${this.handlePermissionsChange}\n ></consent-permissions>\n </div>\n `}renderExpiration(){let e=this.resolved?.expirationDays??7;return d`\n <p class=\"expiration\">\n ${this.resolved?.ui.expirationText??\"This delegation will expire in\"}\n <strong>${e} ${e===1?\"day\":\"days\"}</strong>\n </p>\n `}renderTerms(){return this.resolved?.terms?d`\n <div class=\"terms\">\n <consent-terms\n name=\"termsAccepted\"\n text=${this.resolved.terms.text}\n url=${this.resolved.terms.url??\"\"}\n ?required=${this.resolved.terms.required}\n @change=${this.handleTermsChange}\n ></consent-terms>\n </div>\n `:u}renderError(){return this.error?d`<div class=\"error-message\">${this.error}</div>`:u}renderFooter(){return d`\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n ${this.resolved?.ui.cancelButtonText??\"Cancel\"}\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${this.resolved?.ui.submitButtonText??\"Allow access\"}\n </consent-button>\n </div>\n `}renderConsentOnly(){return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Permission Request\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderCredentials(){let e=this.resolved?.credentials;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"text\"\n name=\"username\"\n label=${e?.usernameLabel??\"Username\"}\n placeholder=${e?.usernamePlaceholder??\"Enter your username\"}\n autocomplete=\"username\"\n required\n @input=${r=>this.handleInputChange(\"username\",r.detail.value)}\n ></consent-input>\n\n <consent-input\n type=\"password\"\n name=\"password\"\n label=${e?.passwordLabel??\"Password\"}\n placeholder=${e?.passwordPlaceholder??\"Enter your password\"}\n autocomplete=\"current-password\"\n required\n @input=${r=>this.handleInputChange(\"password\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${e?.showForgotPassword&&e.forgotPasswordUrl?d`\n <p style=\"text-align: right; margin-bottom: 1rem;\">\n <a\n href=${e.forgotPasswordUrl}\n style=\"font-size: 0.75rem; color: var(--_primary);\"\n >\n Forgot password?\n </a>\n </p>\n `:u}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderOAuth(){let e=this.resolved?.oauth,r=e?.providerId??\"oauth\",s=e?.providerName??\"OAuth Provider\";return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <consent-oauth-button\n provider=${r}\n provider-name=${s}\n url=${`${this.serverUrl}/oauth/${encodeURIComponent(r)}?session_id=${encodeURIComponent(this.sessionId)}`}\n button-text=${e?.buttonText??`Continue with ${s}`}\n full-width\n ></consent-oauth-button>\n\n ${this.renderPermissions()}\n\n <div class=\"divider\">or</div>\n\n ${this.renderExpiration()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderMagicLink(){let e=this.resolved?.magicLink;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"email\"\n name=\"email\"\n label=${e?.emailLabel??\"Email\"}\n placeholder=${e?.emailPlaceholder??\"Enter your email address\"}\n autocomplete=\"email\"\n required\n @input=${r=>this.handleInputChange(\"email\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n Cancel\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${e?.buttonText??\"Send magic link\"}\n </consent-button>\n </div>\n </consent-shell>\n `}renderOTP(){let e=this.resolved?.otp;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Verify Code\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"otp-section\">\n <p class=\"otp-instructions\">\n ${e?.instructions??\"Enter the verification code sent to your device\"}\n </p>\n <consent-otp-input\n length=${e?.digits??6}\n name=\"otp\"\n auto-focus\n @complete=${r=>{this.handleInputChange(\"otp\",r.detail.value),this.handleApprove()}}\n @input=${r=>this.handleInputChange(\"otp\",r.detail.value)}\n ></consent-otp-input>\n <div class=\"otp-resend\">\n Didn't receive the code?\n <button\n type=\"button\"\n ?disabled=${this.resendCooldown>0}\n @click=${this.handleResendOtp}\n >\n ${this.resendCooldown>0?`Resend in ${this.resendCooldown}s`:\"Resend\"}\n </button>\n </div>\n </div>\n\n ${this.renderPermissions()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderSuccess(){let e=this.resolved?.success;return d`\n <consent-shell\n page-title=${e?.title??\"Access Granted\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n <div class=\"success-view\">\n <div class=\"success-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n <h2 class=\"success-title\">${e?.title??\"Access Granted\"}</h2>\n <p class=\"success-description\">\n ${e?.description??\"You have successfully granted access. You can now close this window.\"}\n </p>\n </div>\n </div>\n\n <div slot=\"footer\">\n <consent-button\n variant=\"primary\"\n full-width\n @click=${()=>window.close()}\n >\n ${e?.continueButtonText??\"Close\"}\n </consent-button>\n </div>\n </consent-shell>\n `}render(){if(this.step===\"success\")return this.renderSuccess();switch(this.currentMode){case S.CREDENTIALS:return this.renderCredentials();case S.OAUTH:return this.renderOAuth();case S.MAGIC_LINK:return this.renderMagicLink();case S.OTP:return this.renderOTP();case S.CONSENT_ONLY:default:return this.renderConsentOnly()}}};m.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Agent info box */\n .agent-info {\n display: flex;\n gap: 1rem;\n padding: 1rem;\n background: #f9fafb;\n border-radius: 0.5rem;\n margin-bottom: 1rem;\n }\n\n .agent-icon {\n width: 40px;\n height: 40px;\n background: var(--_secondary);\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .agent-icon svg {\n width: 20px;\n height: 20px;\n color: var(--_primary);\n }\n\n .agent-text {\n flex: 1;\n }\n\n .agent-text p {\n margin: 0;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n .agent-text strong {\n color: #111827;\n }\n\n /* Permissions section */\n .permissions-header {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .permissions {\n margin-bottom: 1rem;\n }\n\n /* Expiration */\n .expiration {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 1rem;\n }\n\n .expiration strong {\n color: #374151;\n }\n\n /* Terms */\n .terms {\n margin-top: 1.5rem;\n }\n\n /* Error message */\n .error-message {\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 0.5rem;\n padding: 0.75rem 1rem;\n margin-bottom: 1rem;\n color: #dc2626;\n font-size: 0.875rem;\n }\n\n /* Form fields */\n .form-fields {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin-bottom: 1rem;\n }\n\n /* Divider */\n .divider {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin: 1.5rem 0;\n color: #6b7280;\n font-size: 0.75rem;\n }\n\n .divider::before,\n .divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #e5e7eb;\n }\n\n /* Success view */\n .success-view {\n text-align: center;\n padding: 2rem 0;\n }\n\n .success-icon {\n width: 64px;\n height: 64px;\n background: #d1fae5;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 auto 1.5rem;\n }\n\n .success-icon svg {\n width: 32px;\n height: 32px;\n color: #059669;\n }\n\n .success-title {\n font-size: 1.25rem;\n font-weight: 600;\n color: #111827;\n margin: 0 0 0.5rem;\n }\n\n .success-description {\n font-size: 0.875rem;\n color: #6b7280;\n margin: 0 0 1.5rem;\n }\n\n /* OTP section */\n .otp-section {\n text-align: center;\n margin-bottom: 1.5rem;\n }\n\n .otp-instructions {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 1rem;\n }\n\n .otp-resend {\n margin-top: 1rem;\n font-size: 0.75rem;\n }\n\n .otp-resend button {\n background: none;\n border: none;\n color: var(--_primary);\n cursor: pointer;\n text-decoration: underline;\n }\n\n .otp-resend button:disabled {\n color: #9ca3af;\n cursor: not-allowed;\n }\n `,n([l({type:Object,converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"config\",2),n([l({type:String})],m.prototype,\"mode\",2),n([l({type:String})],m.prototype,\"tool\",2),n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],m.prototype,\"scopes\",2),n([l({type:String,attribute:\"agent-did\"})],m.prototype,\"agentDid\",2),n([l({type:String,attribute:\"session-id\"})],m.prototype,\"sessionId\",2),n([l({type:String,attribute:\"project-id\"})],m.prototype,\"projectId\",2),n([l({type:String,attribute:\"server-url\"})],m.prototype,\"serverUrl\",2),n([l({type:String,attribute:\"agent-name\"})],m.prototype,\"agentName\",2),n([l({type:Object,attribute:\"oauth-identity\",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"oauthIdentity\",2),n([x()],m.prototype,\"resolved\",2),n([x()],m.prototype,\"currentMode\",2),n([x()],m.prototype,\"loading\",2),n([x()],m.prototype,\"error\",2),n([x()],m.prototype,\"step\",2),n([x()],m.prototype,\"termsAccepted\",2),n([x()],m.prototype,\"formData\",2),n([x()],m.prototype,\"resendCooldown\",2),n([x()],m.prototype,\"selectedScopes\",2),m=n([y(\"mcp-consent\")],m);export{_ as ConsentButton,k as ConsentCheckbox,$ as ConsentInput,A as ConsentOAuthButton,E as ConsentOTPInput,I as ConsentPermissions,U as ConsentShell,w as ConsentTerms,m as McpConsent};\n/*! Bundled license information:\n\n@lit/reactive-element/css-tag.js:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/reactive-element.js:\nlit-html/lit-html.js:\nlit-element/lit-element.js:\n@lit/reactive-element/decorators/custom-element.js:\n@lit/reactive-element/decorators/property.js:\n@lit/reactive-element/decorators/state.js:\n@lit/reactive-element/decorators/event-options.js:\n@lit/reactive-element/decorators/base.js:\n@lit/reactive-element/decorators/query.js:\n@lit/reactive-element/decorators/query-all.js:\n@lit/reactive-element/decorators/query-async.js:\n@lit/reactive-element/decorators/query-assigned-nodes.js:\nlit-html/directive.js:\nlit-html/directives/unsafe-html.js:\nlit-html/directives/unsafe-svg.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/is-server.js:\n (**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-assigned-elements.js:\n (**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n*/\n";
14
+ export const CONSENT_BUNDLE = "var Je=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var n=(i,t,e,r)=>{for(var s=r>1?void 0:r?Qe(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(t,e,s):a(s))||s);return r&&s&&Je(t,e,s),s};var oe=globalThis,ne=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,pe=Symbol(),Ce=new WeakMap,K=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==pe)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(ne&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ce.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ce.set(e,t))}return t}toString(){return this.cssText}},Ee=i=>new K(typeof i==\"string\"?i:i+\"\",void 0,pe),v=(i,...t)=>{let e=i.length===1?i[0]:t.reduce(((r,s,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a==\"number\")return a;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+a+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+i[o+1]),i[0]);return new K(e,i,pe)},Ae=(i,t)=>{if(ne)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let r=document.createElement(\"style\"),s=oe.litNonce;s!==void 0&&r.setAttribute(\"nonce\",s),r.textContent=e.cssText,i.appendChild(r)}},ue=ne?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e=\"\";for(let r of t.cssRules)e+=r.cssText;return Ee(e)})(i):i;var{is:Xe,defineProperty:Ze,getOwnPropertyDescriptor:et,getOwnPropertyNames:tt,getOwnPropertySymbols:rt,getPrototypeOf:it}=Object,P=globalThis,Se=P.trustedTypes,st=Se?Se.emptyScript:\"\",ot=P.reactiveElementPolyfillSupport,W=(i,t)=>i,J={toAttribute(i,t){switch(t){case Boolean:i=i?st:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ae=(i,t)=>!Xe(i,t),_e={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??(Symbol.metadata=Symbol(\"metadata\")),P.litPropertyMetadata??(P.litPropertyMetadata=new WeakMap);var N=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_e){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Ze(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){let{get:s,set:o}=et(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:s,set(a){let p=s?.call(this);o?.call(this,a),this.requestUpdate(t,p,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_e}static _$Ei(){if(this.hasOwnProperty(W(\"elementProperties\")))return;let t=it(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W(\"properties\"))){let e=this.properties,r=[...tt(e),...rt(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(ue(s))}else t!==void 0&&e.push(ue(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r==\"string\"?r:typeof t==\"string\"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ae(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:J).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter==\"function\"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:J;this._$Em=s;let p=a.fromAttribute(e,o.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){let s=this.constructor,o=this[t];if(r??(r=s.getPropertyOptions(t)),!((r.hasChanged??ae)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:o},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??e??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[s,o]of r){let{wrapped:a}=o,p=this[s];a!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,o,p)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:\"open\"},N[W(\"elementProperties\")]=new Map,N[W(\"finalized\")]=new Map,ot?.({ReactiveElement:N}),(P.reactiveElementVersions??(P.reactiveElementVersions=[])).push(\"2.1.1\");var X=globalThis,le=X.trustedTypes,Te=le?le.createPolicy(\"lit-html\",{createHTML:i=>i}):void 0,Ne=\"$lit$\",M=`lit$${Math.random().toFixed(9).slice(2)}$`,Le=\"?\"+M,nt=`<${Le}>`,F=document,Z=()=>F.createComment(\"\"),ee=i=>i===null||typeof i!=\"object\"&&typeof i!=\"function\",ye=Array.isArray,at=i=>ye(i)||typeof i?.[Symbol.iterator]==\"function\",he=`[ \t\n\\f\\r]`,Q=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,ke=/-->/g,Re=/>/g,O=RegExp(`>|${he}(?:([^\\\\s\"'>=/]+)(${he}*=${he}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),Ie=/'/g,Ue=/\"/g,Pe=/^(?:script|style|textarea|title)$/i,xe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=xe(1),It=xe(2),Ut=xe(3),L=Symbol.for(\"lit-noChange\"),u=Symbol.for(\"lit-nothing\"),De=new WeakMap,B=F.createTreeWalker(F,129);function Me(i,t){if(!ye(i)||!i.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return Te!==void 0?Te.createHTML(t):t}var lt=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?\"<svg>\":t===3?\"<math>\":\"\",a=Q;for(let p=0;p<e;p++){let c=i[p],f,y,h=-1,k=0;for(;k<c.length&&(a.lastIndex=k,y=a.exec(c),y!==null);)k=a.lastIndex,a===Q?y[1]===\"!--\"?a=ke:y[1]!==void 0?a=Re:y[2]!==void 0?(Pe.test(y[2])&&(s=RegExp(\"</\"+y[2],\"g\")),a=O):y[3]!==void 0&&(a=O):a===O?y[0]===\">\"?(a=s??Q,h=-1):y[1]===void 0?h=-2:(h=a.lastIndex-y[2].length,f=y[1],a=y[3]===void 0?O:y[3]==='\"'?Ue:Ie):a===Ue||a===Ie?a=O:a===ke||a===Re?a=Q:(a=O,s=void 0);let R=a===O&&i[p+1].startsWith(\"/>\")?\" \":\"\";o+=a===Q?c+nt:h>=0?(r.push(f),c.slice(0,h)+Ne+c.slice(h)+M+R):c+M+(h===-2?p:R)}return[Me(i,o+(i[e]||\"<?>\")+(t===2?\"</svg>\":t===3?\"</math>\":\"\")),r]},te=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,a=0,p=t.length-1,c=this.parts,[f,y]=lt(t,e);if(this.el=i.createElement(f,r),B.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=B.nextNode())!==null&&c.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Ne)){let k=y[a++],R=s.getAttribute(h).split(M),q=/([.?@])?(.*)/.exec(k);c.push({type:1,index:o,name:q[2],strings:R,ctor:q[1]===\".\"?ge:q[1]===\"?\"?fe:q[1]===\"@\"?ve:j}),s.removeAttribute(h)}else h.startsWith(M)&&(c.push({type:6,index:o}),s.removeAttribute(h));if(Pe.test(s.tagName)){let h=s.textContent.split(M),k=h.length-1;if(k>0){s.textContent=le?le.emptyScript:\"\";for(let R=0;R<k;R++)s.append(h[R],Z()),B.nextNode(),c.push({type:2,index:++o});s.append(h[k],Z())}}}else if(s.nodeType===8)if(s.data===Le)c.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(M,h+1))!==-1;)c.push({type:7,index:o}),h+=M.length-1}o++}}static createElement(t,e){let r=F.createElement(\"template\");return r.innerHTML=t,r}};function z(i,t,e=i,r){if(t===L)return t;let s=r!==void 0?e._$Co?.[r]:e._$Cl,o=ee(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=s:e._$Cl=s),s!==void 0&&(t=z(i,s._$AS(i,t.values),s,r)),t}var me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??F).importNode(e,!0);B.currentNode=s;let o=B.nextNode(),a=0,p=0,c=r[0];for(;c!==void 0;){if(a===c.index){let f;c.type===2?f=new re(o,o.nextSibling,this,t):c.type===1?f=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(f=new be(o,this,t)),this._$AV.push(f),c=r[++p]}a!==c?.index&&(o=B.nextNode(),a++)}return B.currentNode=F,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},re=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),ee(t)?t===u||t==null||t===\"\"?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):at(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&ee(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,s=typeof r==\"number\"?this._$AC(t):(r.el===void 0&&(r.el=te.createElement(Me(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{let o=new me(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=De.get(t.strings);return e===void 0&&De.set(t.strings,e=new te(t)),e}k(t){ye(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Z()),this.O(Z()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==\"\"||r[1]!==\"\"?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(t,e=this,r,s){let o=this.strings,a=!1;if(o===void 0)t=z(this,t,e,0),a=!ee(t)||t!==this._$AH&&t!==L,a&&(this._$AH=t);else{let p=t,c,f;for(t=o[0],c=0;c<o.length-1;c++)f=z(this,p[r+c],e,c),f===L&&(f=this._$AH[c]),a||(a=!ee(f)||f!==this._$AH[c]),f===u?t=u:t!==u&&(t+=(f??\"\")+o[c+1]),this._$AH[c]=f}a&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}},ge=class extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},fe=class extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},ve=class extends j{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){if((t=z(this,t,e,0)??u)===L)return;let r=this._$AH,s=t===u&&r!==u||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==u&&(r===u||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH==\"function\"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},be=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var dt=X.litHtmlPolyfillSupport;dt?.(te,re),(X.litHtmlVersions??(X.litHtmlVersions=[])).push(\"3.3.1\");var Oe=(i,t,e)=>{let r=e?.renderBefore??t,s=r._$litPart$;if(s===void 0){let o=e?.renderBefore??null;r._$litPart$=s=new re(t.insertBefore(Z(),o),o,void 0,e??{})}return s._$AI(i),s};var ie=globalThis,g=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Oe(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};g._$litElement$=!0,g.finalized=!0,ie.litElementHydrateSupport?.({LitElement:g});var ct=ie.litElementPolyfillSupport;ct?.({LitElement:g});(ie.litElementVersions??(ie.litElementVersions=[])).push(\"4.2.1\");var x=i=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(i,t)})):customElements.define(i,t)};var pt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ae},ut=(i=pt,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r===\"setter\"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),r===\"accessor\"){let{name:a}=e;return{set(p){let c=t.get.call(this);t.set.call(this,p),this.requestUpdate(a,c,i)},init(p){return p!==void 0&&this.C(a,void 0,i,p),p}}}if(r===\"setter\"){let{name:a}=e;return function(p){let c=this[a];t.call(this,p),this.requestUpdate(a,c,i)}}throw Error(\"Unsupported decorator location: \"+r)};function l(i){return(t,e)=>typeof e==\"object\"?ut(i,t,e):((r,s,o)=>{let a=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function w(i){return l({...i,state:!0,attribute:!1})}var V=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!=\"object\"&&Object.defineProperty(i,t,e),e);var ht;function Be(i){return(t,e)=>V(t,e,{get(){return(this.renderRoot??ht??(ht=document.createDocumentFragment())).querySelectorAll(i)}})}var _=class extends g{constructor(){super();this.variant=\"primary\";this.type=\"button\";this.disabled=!1;this.fullWidth=!1;this.loading=!1;this.internals=this.attachInternals()}handleClick(){if(this.disabled||this.loading)return;let e=this.internals.form;e&&(this.type===\"submit\"?e.requestSubmit():this.type===\"reset\"&&e.reset())}render(){return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||this.loading}\n aria-busy=${this.loading}\n @click=${this.handleClick}\n >\n ${this.loading?d`<span class=\"spinner\"></span>`:null}\n <slot></slot>\n </button>\n `}};_.formAssociated=!0,_.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n /* Base styles - matches AgentShield PreviewButton exactly */\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: opacity 0.15s ease, background-color 0.15s ease;\n border: none;\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n }\n\n /* Primary variant */\n :host([variant='primary']) button {\n background-color: var(--consent-primary, #2563eb);\n color: white;\n }\n\n :host([variant='primary']) button:hover:not(:disabled) {\n opacity: 0.9;\n }\n\n /* Secondary variant */\n :host([variant='secondary']) button {\n background-color: transparent;\n color: #374151;\n border: 1px solid #d1d5db;\n }\n\n :host([variant='secondary']) button:hover:not(:disabled) {\n background-color: #f9fafb;\n }\n\n /* Disabled state */\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n `,n([l({type:String,reflect:!0})],_.prototype,\"variant\",2),n([l({type:String})],_.prototype,\"type\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],_.prototype,\"fullWidth\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"loading\",2),_=n([x(\"consent-button\")],_);var T=class extends g{constructor(){super();this.name=\"\";this.checked=!1;this.required=!1;this.disabled=!1;this.value=\"on\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}render(){return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n <slot></slot>\n </span>\n </label>\n `}};T.formAssociated=!0,T.styles=v`\n :host {\n display: block;\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n /* Reset */\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem; /* Align with text baseline */\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--consent-primary, #2563eb);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--consent-primary, #2563eb);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--consent-primary, #2563eb);\n border-color: var(--consent-primary, #2563eb);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links in label */\n ::slotted(a) {\n color: var(--consent-primary, #2563eb);\n text-decoration: underline;\n }\n\n ::slotted(a:hover) {\n text-decoration: none;\n }\n `,n([l({type:String})],T.prototype,\"name\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"checked\",2),n([l({type:Boolean})],T.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"disabled\",2),n([l({type:String})],T.prototype,\"value\",2),T=n([x(\"consent-checkbox\")],T);var C=class extends g{constructor(){super();this.type=\"text\";this.name=\"\";this.value=\"\";this.label=\"\";this.placeholder=\"\";this.required=!1;this.disabled=!1;this.autocomplete=\"\";this.showPassword=!1;this.internals=this.attachInternals()}updated(e){e.has(\"value\")&&this.internals.setFormValue(this.value||null)}handleInput(e){let r=e.target;this.value=r.value,this.internals.setFormValue(this.value||null),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value},bubbles:!0,composed:!0}))}handleChange(e){let r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))}togglePasswordVisibility(){this.showPassword=!this.showPassword}renderPasswordToggle(){if(this.type!==\"password\")return null;let e=this.showPassword?d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\"/>\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"/>\n </svg>\n `:d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/>\n <circle cx=\"12\" cy=\"12\" r=\"3\"/>\n </svg>\n `;return d`\n <button\n type=\"button\"\n class=\"password-toggle\"\n @click=${this.togglePasswordVisibility}\n tabindex=\"-1\"\n aria-label=${this.showPassword?\"Hide password\":\"Show password\"}\n >\n ${e}\n </button>\n `}render(){let e=this.type===\"password\"&&this.showPassword?\"text\":this.type;return d`\n <div class=\"field\">\n ${this.label?d`\n <label part=\"label\" for=\"input\">\n ${this.label}${this.required?d`<span class=\"required\">*</span>`:null}\n </label>\n `:null}\n <div class=\"input-wrapper${this.error?\" has-error\":\"\"}\">\n <input\n part=\"input\"\n id=\"input\"\n type=${e}\n name=${this.name}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.disabled}\n autocomplete=${this.autocomplete||\"off\"}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n ${this.renderPasswordToggle()}\n </div>\n ${this.error?d`<div class=\"error-message\">${this.error}</div>`:null}\n </div>\n `}};C.formAssociated=!0,C.styles=v`\n :host {\n display: block;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n\n label {\n font-size: 0.875rem;\n font-weight: 500;\n color: #374151;\n }\n\n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n /* Base input styles - use .input-wrapper for higher specificity */\n .input-wrapper input {\n width: 100%;\n padding: 0.625rem 0.75rem;\n font-size: 0.875rem;\n font-family: inherit;\n color: #111827;\n background-color: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n box-shadow: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .input-wrapper input:focus {\n border-color: var(--consent-primary, #2563eb);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n .input-wrapper input:disabled {\n background-color: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .input-wrapper input::placeholder {\n color: #9ca3af;\n }\n\n /* Prevent browser validation styling before user interaction */\n .input-wrapper input:invalid {\n border-color: #d1d5db;\n box-shadow: none;\n outline: none;\n background-color: white;\n }\n\n /* Override browser autofill styling */\n .input-wrapper input:-webkit-autofill,\n .input-wrapper input:-webkit-autofill:hover,\n .input-wrapper input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px white inset;\n -webkit-text-fill-color: #111827;\n border-color: #d1d5db;\n transition: background-color 5000s ease-in-out 0s;\n }\n\n /* Only show validation styling after user interaction */\n .input-wrapper input:user-invalid {\n border-color: #ef4444;\n }\n\n .input-wrapper input:user-invalid:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Password toggle */\n .input-wrapper input[type='password'] {\n padding-right: 2.5rem;\n }\n\n .password-toggle {\n position: absolute;\n right: 0.5rem;\n padding: 0.375rem;\n background: none;\n border: none;\n cursor: pointer;\n color: #6b7280;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .password-toggle:hover {\n color: #374151;\n }\n\n .password-toggle svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Error state - use class instead of attribute for proper specificity */\n .input-wrapper.has-error input {\n border-color: #ef4444;\n }\n\n .input-wrapper.has-error input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n .error-message {\n font-size: 0.75rem;\n color: #ef4444;\n margin-top: 0.25rem;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],C.prototype,\"type\",2),n([l({type:String})],C.prototype,\"name\",2),n([l({type:String})],C.prototype,\"value\",2),n([l({type:String})],C.prototype,\"label\",2),n([l({type:String})],C.prototype,\"placeholder\",2),n([l({type:Boolean})],C.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],C.prototype,\"disabled\",2),n([l({type:String})],C.prototype,\"autocomplete\",2),n([l({type:String})],C.prototype,\"error\",2),n([w()],C.prototype,\"showPassword\",2),C=n([x(\"consent-input\")],C);var I=class extends g{constructor(){super(...arguments);this.pageTitle=\"Permission Request\";this.primaryColor=\"#2563EB\";this.secondaryColor=\"#DBEAFE\"}renderLogo(){return this.logoUrl?d`\n <img\n class=\"logo\"\n src=${this.logoUrl}\n alt=${this.companyName||\"Company logo\"}\n />\n `:d`\n <div class=\"default-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"\n fill=\"currentColor\"\n opacity=\"0.2\"\n />\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `}updated(e){(e.has(\"primaryColor\")||e.has(\"secondaryColor\"))&&(this.style.setProperty(\"--consent-primary\",this.primaryColor),this.style.setProperty(\"--consent-secondary\",this.secondaryColor))}render(){return d`\n <div class=\"container\" part=\"container\">\n <header class=\"header\" part=\"header\">\n ${this.renderLogo()}\n ${this.companyName?d`<div class=\"company-name\">${this.companyName}</div>`:null}\n <h1 class=\"title\">${this.pageTitle}</h1>\n </header>\n\n <div class=\"content\" part=\"content\">\n <slot name=\"content\"></slot>\n </div>\n\n <footer class=\"footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n `}};I.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n /* Allow customization via CSS variables */\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Container - matches AgentShield PreviewShell exactly */\n .container {\n background: white;\n border-radius: 20px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow:\n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n max-width: 512px;\n width: 100%;\n margin: 0 auto;\n }\n\n /* Header */\n .header {\n padding: 1.25rem 2rem 0;\n text-align: center;\n }\n\n .logo {\n max-height: 48px;\n max-width: 200px;\n margin-bottom: 0.5rem;\n }\n\n .company-name {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .title {\n font-size: 1.5rem;\n font-weight: 700;\n color: #333333;\n margin: 0;\n }\n\n /* Content */\n .content {\n padding: 1rem 2rem 2rem;\n }\n\n /* Footer */\n .footer {\n padding: 0 2rem 2rem;\n display: flex;\n gap: 0.75rem;\n }\n\n .footer ::slotted(*) {\n flex: 1;\n }\n\n /* Default icon when no logo */\n .default-icon {\n width: 48px;\n height: 48px;\n margin: 0 auto 0.5rem;\n background: var(--_secondary);\n border-radius: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .default-icon svg {\n width: 24px;\n height: 24px;\n color: var(--_primary);\n }\n `,n([l({type:String,attribute:\"page-title\"})],I.prototype,\"pageTitle\",2),n([l({type:String,attribute:\"logo-url\"})],I.prototype,\"logoUrl\",2),n([l({type:String,attribute:\"company-name\"})],I.prototype,\"companyName\",2),n([l({type:String,attribute:\"primary-color\"})],I.prototype,\"primaryColor\",2),n([l({type:String,attribute:\"secondary-color\"})],I.prototype,\"secondaryColor\",2),I=n([x(\"consent-shell\")],I);var U=class extends g{constructor(){super(...arguments);this.scopes=[];this.interactive=!1;this.selectAll=!1;this.iconStyle=\"check\";this.selectedScopes=new Set;this.previousScopeIds=new Set}connectedCallback(){super.connectedCallback(),this.interactive&&this.initializeSelectedScopes()}updated(e){e.has(\"scopes\")&&this.interactive&&this.reinitializeSelectedScopes()}reinitializeSelectedScopes(){let e=new Set(this.normalizedScopes.map(o=>o.id)),r=new Set(Array.from(this.selectedScopes).filter(o=>e.has(o))),s=Array.from(e).filter(o=>!this.previousScopeIds.has(o));if(this.selectAll)this.selectedScopes=new Set([...r,...s]);else{let o=this.normalizedScopes.filter(a=>a.required).map(a=>a.id);this.selectedScopes=new Set([...r,...o])}this.previousScopeIds=e,this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}initializeSelectedScopes(){this.previousScopeIds=new Set(this.normalizedScopes.map(e=>e.id)),this.selectAll?this.selectedScopes=new Set(this.normalizedScopes.map(e=>e.id)):this.selectedScopes=new Set(this.normalizedScopes.filter(e=>e.required).map(e=>e.id))}get normalizedScopes(){return this.scopes.map(e=>typeof e==\"string\"?{id:e,label:this.formatScopeLabel(e)}:e)}formatScopeLabel(e){return e.replace(/[_:-]/g,\" \").replace(/\\b\\w/g,r=>r.toUpperCase())}getSelectedScopes(){return Array.from(this.selectedScopes)}handleCheckboxChange(e,r){r?this.selectedScopes.add(e):this.selectedScopes.delete(e),this.requestUpdate(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}renderIcon(){switch(this.iconStyle){case\"bullet\":return d`<div class=\"icon icon-bullet\"></div>`;case\"shield\":return d`\n <div class=\"icon icon-shield\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `;default:return d`\n <div class=\"icon icon-check\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n `}}renderPermissionItem(e){let r=this.selectedScopes.has(e.id);return d`\n <li class=\"permission-item\" part=\"item\">\n ${this.interactive?d`\n <input\n type=\"checkbox\"\n class=\"checkbox\"\n .checked=${r}\n ?disabled=${e.required}\n @change=${s=>this.handleCheckboxChange(e.id,s.target.checked)}\n aria-label=${e.label}\n />\n `:this.renderIcon()}\n <div class=\"content\">\n <span class=\"label\">\n ${e.label}\n ${e.required?d`<span class=\"required-badge\">Required</span>`:null}\n </span>\n ${e.description?d`<div class=\"description\">${e.description}</div>`:null}\n </div>\n </li>\n `}render(){let e=this.normalizedScopes;return e.length===0?d`<div class=\"empty\">No permissions requested</div>`:d`\n <ul class=\"permission-list\" part=\"list\" role=\"list\">\n ${e.map(r=>this.renderPermissionItem(r))}\n </ul>\n `}};U.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .permission-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .permission-item {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n padding: 0.625rem 0;\n font-size: 0.875rem;\n color: #374151;\n border-bottom: 1px solid #f3f4f6;\n }\n\n .permission-item:last-child {\n border-bottom: none;\n }\n\n /* Icon styles */\n .icon {\n flex-shrink: 0;\n width: 1.25rem;\n height: 1.25rem;\n margin-top: 0.0625rem;\n }\n\n .icon-check {\n background: var(--_primary);\n border-radius: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .icon-check svg {\n width: 0.75rem;\n height: 0.75rem;\n color: white;\n }\n\n .icon-bullet {\n background: var(--_primary);\n border-radius: 50%;\n width: 0.5rem;\n height: 0.5rem;\n margin: 0.375rem;\n }\n\n .icon-shield {\n color: var(--_primary);\n }\n\n .icon-shield svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Content */\n .content {\n flex: 1;\n }\n\n .label {\n font-weight: 500;\n color: #111827;\n }\n\n .description {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 0.125rem;\n }\n\n .required-badge {\n font-size: 0.625rem;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: #6b7280;\n background: #f3f4f6;\n padding: 0.125rem 0.375rem;\n border-radius: 0.25rem;\n margin-left: 0.5rem;\n }\n\n /* Interactive mode checkbox */\n .checkbox {\n appearance: none;\n -webkit-appearance: none;\n width: 1rem;\n height: 1rem;\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n background: white;\n cursor: pointer;\n position: relative;\n flex-shrink: 0;\n margin-top: 0.125rem;\n }\n\n .checkbox:checked {\n background: var(--_primary);\n border-color: var(--_primary);\n }\n\n .checkbox:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n .checkbox:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Empty state */\n .empty {\n text-align: center;\n color: #6b7280;\n font-size: 0.875rem;\n padding: 1rem 0;\n }\n `,n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r:(console.warn(\"[consent-permissions] Expected array, got:\",typeof r),[])}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],U.prototype,\"scopes\",2),n([l({type:Boolean})],U.prototype,\"interactive\",2),n([l({type:Boolean,attribute:\"select-all\"})],U.prototype,\"selectAll\",2),n([l({type:String,attribute:\"icon-style\"})],U.prototype,\"iconStyle\",2),n([w()],U.prototype,\"selectedScopes\",2),U=n([x(\"consent-permissions\")],U);var $=class extends g{constructor(){super();this.name=\"termsAccepted\";this.text=\"Terms and Conditions\";this.labelPrefix=\"I agree to the\";this.conjunction=\"and\";this.checked=!1;this.required=!0;this.disabled=!1;this.value=\"accepted\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}renderLink(e,r){return r?d`<a\n href=${r}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n part=\"link\"\n @click=${s=>s.stopPropagation()}\n >${e}</a\n >`:d`<span>${e}</span>`}render(){let e=this.privacyText&&this.privacyUrl;return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n ${this.labelPrefix} ${this.renderLink(this.text,this.url)}\n ${e?d`\n ${this.conjunction}\n ${this.renderLink(this.privacyText,this.privacyUrl)}\n `:u}\n ${this.required?d`<span class=\"required\">*</span>`:u}\n </span>\n </label>\n `}};$.formAssociated=!0,$.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem;\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--_primary);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--_primary);\n border-color: var(--_primary);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links */\n a {\n color: var(--_primary);\n text-decoration: underline;\n text-underline-offset: 2px;\n }\n\n a:hover {\n text-decoration: none;\n }\n\n a:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],$.prototype,\"name\",2),n([l({type:String})],$.prototype,\"text\",2),n([l({type:String})],$.prototype,\"url\",2),n([l({type:String,attribute:\"privacy-text\"})],$.prototype,\"privacyText\",2),n([l({type:String,attribute:\"privacy-url\"})],$.prototype,\"privacyUrl\",2),n([l({type:String,attribute:\"label-prefix\"})],$.prototype,\"labelPrefix\",2),n([l({type:String})],$.prototype,\"conjunction\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"checked\",2),n([l({type:Boolean})],$.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"disabled\",2),n([l({type:String})],$.prototype,\"value\",2),$=n([x(\"consent-terms\")],$);var Fe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ce=i=>(...t)=>({_$litDirective$:i,values:t}),de=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var H=class extends de{constructor(t){if(super(t),this.it=u,t.type!==Fe.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===L)return t;if(typeof t!=\"string\")throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};H.directiveName=\"unsafeHTML\",H.resultType=1;var Gr=ce(H);var se=class extends H{};se.directiveName=\"unsafeSVG\",se.resultType=2;var He=ce(se);function mt(i){if(!i||typeof i!=\"string\")return\"\";let t=i.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\"\");return t=t.replace(/\\s*on\\w+\\s*=\\s*[\"'][^\"']*[\"']/gi,\"\"),t=t.replace(/\\s*on\\w+\\s*=\\s*[^\\s>]*/gi,\"\"),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*javascript:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*data:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/data:text\\/html[^\"'>\\s]*/gi,\"\"),t}var qe={google:{name:\"Google\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"},microsoft:{name:\"Microsoft\",bgColor:\"#2f2f2f\",textColor:\"#ffffff\",borderColor:\"#2f2f2f\",hoverBgColor:\"#1f1f1f\"},apple:{name:\"Apple\",bgColor:\"#000000\",textColor:\"#ffffff\",borderColor:\"#000000\",hoverBgColor:\"#1a1a1a\"},github:{name:\"GitHub\",bgColor:\"#24292f\",textColor:\"#ffffff\",borderColor:\"#24292f\",hoverBgColor:\"#1b1f23\"},twitter:{name:\"Twitter\",bgColor:\"#1da1f2\",textColor:\"#ffffff\",borderColor:\"#1da1f2\",hoverBgColor:\"#0c8de4\"},facebook:{name:\"Facebook\",bgColor:\"#1877f2\",textColor:\"#ffffff\",borderColor:\"#1877f2\",hoverBgColor:\"#0b5ed7\"},custom:{name:\"Sign in\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"}},S=class extends g{constructor(){super(...arguments);this.provider=\"custom\";this.url=\"\";this.loading=!1;this.disabled=!1;this.fullWidth=!1;this.redirecting=!1}get config(){return qe[this.provider]||qe.custom}get displayName(){return this.providerName?this.providerName:this.config.name}get displayText(){return this.buttonText?this.buttonText:`Continue with ${this.displayName}`}handleClick(){this.disabled||this.loading||this.redirecting||(this.url&&(this.redirecting=!0,window.location.href=this.url),this.dispatchEvent(new CustomEvent(\"oauth-click\",{detail:{provider:this.provider,url:this.url},bubbles:!0,composed:!0})))}renderProviderIcon(){if(this.customIcon){let e=mt(this.customIcon);return d`<div class=\"icon\">${He(e)}</div>`}switch(this.provider){case\"google\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n </div>\n `;case\"microsoft\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 21 21\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"#f25022\" />\n <rect x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"#00a4ef\" />\n <rect x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"#7fba00\" />\n <rect x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"#ffb900\" />\n </svg>\n </div>\n `;case\"apple\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z\"\n />\n </svg>\n </div>\n `;case\"github\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z\"\n />\n </svg>\n </div>\n `;case\"twitter\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"\n />\n </svg>\n </div>\n `;case\"facebook\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\"\n />\n </svg>\n </div>\n `;default:return u}}updated(e){if(e.has(\"provider\")){let r=this.config;this.style.setProperty(\"--button-bg\",r.bgColor),this.style.setProperty(\"--button-text\",r.textColor),this.style.setProperty(\"--button-border\",r.borderColor),this.style.setProperty(\"--button-hover-bg\",r.hoverBgColor)}}render(){let e=this.loading||this.redirecting;return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||e}\n @click=${this.handleClick}\n style=\"\n background-color: var(--button-bg, ${this.config.bgColor});\n color: var(--button-text, ${this.config.textColor});\n border: 1px solid var(--button-border, ${this.config.borderColor});\n \"\n aria-busy=${e}\n >\n ${e?d`<span class=\"spinner\"></span>`:this.renderProviderIcon()}\n <span class=\"text\" part=\"text\">${this.displayText}</span>\n </button>\n `}};S.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n width: 100%;\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.15s ease;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n button:focus-visible {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n }\n\n .icon {\n width: 1.125rem;\n height: 1.125rem;\n flex-shrink: 0;\n }\n\n .icon svg {\n width: 100%;\n height: 100%;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .text {\n flex: 1;\n text-align: center;\n }\n `,n([l({type:String})],S.prototype,\"provider\",2),n([l({type:String,attribute:\"provider-name\"})],S.prototype,\"providerName\",2),n([l({type:String})],S.prototype,\"url\",2),n([l({type:String,attribute:\"button-text\"})],S.prototype,\"buttonText\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"loading\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],S.prototype,\"fullWidth\",2),n([l({type:String,attribute:\"custom-icon\"})],S.prototype,\"customIcon\",2),n([w()],S.prototype,\"redirecting\",2),S=n([x(\"consent-oauth-button\")],S);var A=class extends g{constructor(){super();this.length=6;this.name=\"otp\";this.value=\"\";this.disabled=!1;this.error=!1;this.autoFocus=!1;this.inputType=\"text\";this.digits=[];this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.initializeDigits()}initializeDigits(){this.digits=Array.from({length:this.length},()=>\"\"),this.value&&this.value.replace(/\\D/g,\"\").slice(0,this.length).split(\"\").forEach((s,o)=>{this.digits[o]=s})}firstUpdated(){this.autoFocus&&this.inputs.length>0&&this.inputs[0]?.focus()}updated(e){e.has(\"value\")&&!e.has(\"digits\")&&this.initializeDigits(),e.has(\"length\")&&this.initializeDigits();let r=this.digits.join(\"\");this.internals.setFormValue(r||null)}getFullValue(){return this.digits.join(\"\")}handleInput(e,r){let s=r.target,o=s.value;if(o.length>1&&(o=o.slice(-1)),o&&!/^\\d$/.test(o)){s.value=this.digits[e]??\"\";return}this.digits[e]=o,this.digits=[...this.digits],s.value=o;let a=this.getFullValue();this.value=a,this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:a,index:e,digit:o},bubbles:!0,composed:!0})),o&&e<this.length-1&&this.inputs[e+1]?.focus(),a.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:a},bubbles:!0,composed:!0}))}handleKeyDown(e,r){switch(r.key){case\"Backspace\":!this.digits[e]&&e>0?(r.preventDefault(),this.inputs[e-1]?.focus(),this.digits[e-1]=\"\",this.digits=[...this.digits]):(this.digits[e]=\"\",this.digits=[...this.digits]),this.value=this.getFullValue();break;case\"ArrowLeft\":r.preventDefault(),e>0&&this.inputs[e-1]?.focus();break;case\"ArrowRight\":r.preventDefault(),e<this.length-1&&this.inputs[e+1]?.focus();break;case\"Delete\":this.digits[e]=\"\",this.digits=[...this.digits],this.value=this.getFullValue();break}}handlePaste(e){e.preventDefault();let s=(e.clipboardData?.getData(\"text\")||\"\").replace(/\\D/g,\"\").slice(0,this.length);if(s){this.digits=Array.from({length:this.length},(a,p)=>s[p]||\"\"),this.value=this.getFullValue(),this.requestUpdate();let o=Math.min(s.length,this.length-1);setTimeout(()=>{this.inputs[o]?.focus()},0),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value,index:0,digit:s[0]||\"\"},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0})),s.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:this.value},bubbles:!0,composed:!0}))}}handleFocus(e){e.target.select()}focus(){let e=this.digits.findIndex(s=>!s),r=e>=0?e:this.length-1;this.inputs[r]?.focus()}clear(){this.digits=Array.from({length:this.length},()=>\"\"),this.value=\"\",this.inputs[0]?.focus()}renderDigitInput(e){let r=this.digits[e]||\"\",s=r!==\"\";return d`\n <input\n part=\"input\"\n type=${this.inputType}\n inputmode=\"numeric\"\n pattern=\"[0-9]*\"\n maxlength=\"1\"\n .value=${r}\n ?disabled=${this.disabled}\n placeholder=\"○\"\n class=${s?\"filled\":\"\"}\n @input=${o=>this.handleInput(e,o)}\n @keydown=${o=>this.handleKeyDown(e,o)}\n @paste=${this.handlePaste}\n @focus=${this.handleFocus}\n aria-label=${`Digit ${e+1} of ${this.length}`}\n />\n `}render(){return d`\n <div class=\"container\" part=\"container\" role=\"group\" aria-label=\"One-time password input\">\n ${Array.from({length:this.length},(e,r)=>this.renderDigitInput(r))}\n </div>\n `}};A.formAssociated=!0,A.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .container {\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n }\n\n input {\n width: 2.75rem;\n height: 3.5rem;\n text-align: center;\n font-size: 1.5rem;\n font-weight: 600;\n font-family: inherit;\n color: #111827;\n background: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n\n /* Hide spinner for number inputs */\n -moz-appearance: textfield;\n }\n\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input:focus {\n border-color: var(--_primary);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n input:disabled {\n background: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n input::placeholder {\n color: #d1d5db;\n }\n\n /* Error state */\n :host([error]) input {\n border-color: #ef4444;\n }\n\n :host([error]) input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Filled state */\n input.filled {\n border-color: var(--_primary);\n background: #f0f9ff;\n }\n\n /* Responsive: smaller on mobile */\n @media (max-width: 400px) {\n input {\n width: 2.25rem;\n height: 3rem;\n font-size: 1.25rem;\n }\n\n .container {\n gap: 0.375rem;\n }\n }\n `,n([l({type:Number})],A.prototype,\"length\",2),n([l({type:String})],A.prototype,\"name\",2),n([l({type:String})],A.prototype,\"value\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"disabled\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"error\",2),n([l({type:Boolean,attribute:\"auto-focus\"})],A.prototype,\"autoFocus\",2),n([l({type:String,attribute:\"input-type\"})],A.prototype,\"inputType\",2),n([w()],A.prototype,\"digits\",2),n([Be(\"input\")],A.prototype,\"inputs\",2),A=n([x(\"consent-otp-input\")],A);var b={CONSENT_ONLY:\"consent-only\",CREDENTIALS:\"credentials\",OAUTH:\"oauth\",MAGIC_LINK:\"magic-link\",OTP:\"otp\",QR_CODE:\"qr-code\",PASSKEY:\"passkey\",IDV:\"idv\"};var G={PRIMARY:\"#2563EB\",SECONDARY:\"#DBEAFE\",BACKGROUND:\"#F9FAFB\",TEXT_PRIMARY:\"#111827\",TEXT_SECONDARY:\"#6B7280\",TEXT_MUTED:\"#9CA3AF\",BORDER:\"#E5E7EB\",BORDER_DARK:\"#D1D5DB\",SUCCESS:\"#16A34A\",ERROR:\"#DC2626\",WARNING:\"#F59E0B\"};var hi={primaryColor:G.PRIMARY,secondaryColor:G.SECONDARY,logoUrl:void 0,companyName:void 0},E={title:\"Permission request\",description:\"It looks like you would like to use [AI Agent] to access resources on your behalf.\",expirationText:\"This delegation will expire in\",cancelButtonText:\"Cancel\",submitButtonText:\"Allow access\",permissionsHeader:\"The agent is requesting the following permissions:\",autoClose:!1,popupEnabled:!1,theme:\"auto\"},Y={text:\"Terms and Conditions\",url:void 0,version:void 0,required:!0},D={title:\"Access Granted\",description:\"The agent now has permission to act on your behalf.\",showCredential:!0,redirectUrl:void 0,redirectDelay:void 0,continueButtonText:\"Close\"};var ze=30;function gt(i){return i?/^#[0-9A-Fa-f]{6}$/.test(i):!1}function je(i,t){return gt(i)?i:t}function ft(i){if(!i)return!1;try{let t=new URL(i);return t.protocol===\"http:\"||t.protocol===\"https:\"}catch{return!1}}function vt(i){if(ft(i))return i}function Ve(i){let t=i.replace(/^#/,\"\"),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${e}, ${r}, ${s}`}function bt(i){return{\"--consent-primary\":i.primaryColor,\"--consent-secondary\":i.secondaryColor,\"--consent-primary-rgb\":Ve(i.primaryColor),\"--consent-secondary-rgb\":Ve(i.secondaryColor)}}function Ge(i){let t=je(i?.primaryColor,G.PRIMARY),e=je(i?.secondaryColor,G.SECONDARY),r=vt(i?.logoUrl),s=i?.companyName?.trim()||void 0,o=bt({primaryColor:t,secondaryColor:e});return{primaryColor:t,secondaryColor:e,logoUrl:r,companyName:s,cssVars:o}}var yt=\"[AI Agent]\";function Ye(i,t){return t?i.replace(new RegExp(xt(yt),\"g\"),t):i}function xt(i){return i.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Ke(i,t){let e=i?.ui??{},r=i?.terms??{},s=i?.success??{},o=e.title??E.title,a=e.description??E.description,p=e.expirationText??E.expirationText,c=e.cancelButtonText??E.cancelButtonText,f=e.submitButtonText??E.submitButtonText,y=e.permissionsHeader??E.permissionsHeader,h=r.text??Y.text,k=s.title??D.title,R=s.description??D.description,q=Ye(a,t),We=Ye(R,t);return{title:o,description:a,expirationText:p,cancelButtonText:c,submitButtonText:f,permissionsHeader:y,termsText:h,termsUrl:r.url,termsRequired:r.required??Y.required,resolvedDescription:q,successTitle:k,successDescription:R,resolvedSuccessDescription:We,showCredential:s.showCredential??D.showCredential,continueButtonText:s.continueButtonText??D.continueButtonText}}function wt(i){return!i||i.length===0?[]:i.slice(0,10).filter(e=>!(!e.name||!e.label||!/^[a-zA-Z0-9_]+$/.test(e.name)||e.type===\"select\"&&(!e.options||e.options.length===0)))}function $t(i){return i==null?ze:i<1?1:i>365?365:Math.floor(i)}function we(i){return i?.oauth?.providerId?b.OAUTH:i?.credentials?.usernameLabel||i?.credentials?.passwordLabel?b.CREDENTIALS:i?.magicLink?.enabled?b.MAGIC_LINK:i?.otp?.enabled?b.OTP:b.CONSENT_ONLY}function Ct(i){return{title:i?.title??E.title,description:i?.description??E.description,expirationText:i?.expirationText??E.expirationText,cancelButtonText:i?.cancelButtonText??E.cancelButtonText,submitButtonText:i?.submitButtonText??E.submitButtonText,permissionsHeader:i?.permissionsHeader??E.permissionsHeader,autoClose:i?.autoClose??E.autoClose,popupEnabled:i?.popupEnabled??E.popupEnabled,theme:i?.theme??E.theme}}function Et(i){return{text:i?.text??Y.text,url:i?.url,version:i?.version,required:i?.required??Y.required}}function At(i){return{title:i?.title??D.title,description:i?.description??D.description,showCredential:i?.showCredential??D.showCredential,redirectUrl:i?.redirectUrl,redirectDelay:i?.redirectDelay,continueButtonText:i?.continueButtonText??D.continueButtonText}}function $e(i,t){let e=Ge(i?.branding),r=Ke(i,t),s=Ct(i?.ui),o=Et(i?.terms),a=At(i?.success),p=wt(i?.customFields),c=$t(i?.expirationDays),f=we(i);return{branding:e,copy:r,ui:s,terms:o,success:a,customFields:p,expirationDays:c,authMode:f,credentials:i?.credentials,oauth:i?.oauth,magicLink:i?.magicLink,otp:i?.otp,qrCode:i?.qrCode,passkey:i?.passkey,idv:i?.idv}}var m=class extends g{constructor(){super(...arguments);this.tool=\"\";this.scopes=[];this.agentDid=\"\";this.sessionId=\"\";this.projectId=\"\";this.serverUrl=\"\";this.agentName=\"\";this.currentMode=b.CONSENT_ONLY;this.loading=!1;this.step=\"consent\";this.termsAccepted=!1;this.formData={};this.resendCooldown=0;this.selectedScopes=[]}connectedCallback(){super.connectedCallback(),this.resolved=$e(this.config,this.agentName),this.currentMode=this.mode??we(this.config)??b.CONSENT_ONLY,this.selectedScopes=[...this.scopes]}disconnectedCallback(){super.disconnectedCallback(),this.resendCooldownInterval!==void 0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)}updated(e){(e.has(\"config\")||e.has(\"agentName\"))&&(this.resolved=$e(this.config,this.agentName)),e.has(\"mode\")&&this.mode&&(this.currentMode=this.mode),e.has(\"scopes\")&&(this.selectedScopes=[...this.scopes]),this.resolved&&(this.style.setProperty(\"--consent-primary\",this.resolved.branding.primaryColor),this.style.setProperty(\"--consent-secondary\",this.resolved.branding.secondaryColor))}getProviderType(){switch(this.currentMode){case b.CREDENTIALS:return\"credential\";case b.OAUTH:return this.oauthIdentity?.provider??\"oauth2\";case b.MAGIC_LINK:return\"magic_link\";case b.OTP:return\"otp\";case b.CONSENT_ONLY:default:return\"none\"}}async handleApprove(e){if(e?.preventDefault(),!this.loading){if(!this.termsAccepted&&this.resolved?.terms.required){this.error=\"Please accept the terms to continue\";return}if(this.scopes.length>0&&this.selectedScopes.length===0){this.error=\"Please select at least one permission\";return}this.loading=!0,this.error=void 0;try{let r=new FormData;r.append(\"tool\",this.tool),r.append(\"scopes\",JSON.stringify(this.selectedScopes)),r.append(\"agent_did\",this.agentDid),r.append(\"session_id\",this.sessionId),r.append(\"project_id\",this.projectId),r.append(\"auth_mode\",this.currentMode),r.append(\"provider_type\",this.getProviderType()),r.append(\"termsAccepted\",String(this.termsAccepted)),Object.entries(this.formData).forEach(([a,p])=>{r.append(a,p)});let s=await fetch(`${this.serverUrl}/consent/approve`,{method:\"POST\",body:r});if(!s.ok){let a=await s.json().catch(()=>({}));throw new Error(a.message||\"Approval failed\")}let o=await s.json();this.step=\"success\",this.dispatchEvent(new CustomEvent(\"mcp-consent:approve\",{detail:{success:!0,redirectUrl:o.redirectUrl},bubbles:!0,composed:!0}))}catch(r){this.error=r instanceof Error?r.message:\"Unknown error\",this.dispatchEvent(new CustomEvent(\"mcp-consent:error\",{detail:{error:this.error},bubbles:!0,composed:!0}))}finally{this.loading=!1}}}handleDeny(){this.dispatchEvent(new CustomEvent(\"mcp-consent:deny\",{bubbles:!0,composed:!0})),window.close()}handleTermsChange(e){this.termsAccepted=e.detail.checked}handleInputChange(e,r){this.formData={...this.formData,[e]:r}}handleResendOtp(){if(this.resendCooldown>0)return;let e=this.resolved?.otp?.resendCooldown??60;this.resendCooldown=e,this.resendCooldownInterval!==void 0&&clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=setInterval(()=>{this.resendCooldown--,this.resendCooldown<=0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)},1e3),this.dispatchEvent(new CustomEvent(\"mcp-consent:resend-otp\",{bubbles:!0,composed:!0}))}renderAgentInfo(){let e=this.agentName||\"this agent\";return d`\n <div class=\"agent-info\">\n <div class=\"agent-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4M12 8h.01\" />\n </svg>\n </div>\n <div class=\"agent-text\">\n <p>\n <strong>${e}</strong> is requesting permission to\n ${this.tool?d`use the <strong>${this.tool}</strong> tool`:\"access your data\"}\n on your behalf.\n </p>\n </div>\n </div>\n `}handlePermissionsChange(e){this.selectedScopes=e.detail.selected}renderPermissions(){return this.scopes.length===0?u:d`\n <p class=\"permissions-header\">\n ${this.resolved?.ui.permissionsHeader??\"The agent is requesting the following permissions:\"}\n </p>\n <div class=\"permissions\">\n <consent-permissions\n .scopes=${this.scopes}\n interactive\n select-all\n @change=${this.handlePermissionsChange}\n ></consent-permissions>\n </div>\n `}renderExpiration(){let e=this.resolved?.expirationDays??7;return d`\n <p class=\"expiration\">\n ${this.resolved?.ui.expirationText??\"This delegation will expire in\"}\n <strong>${e} ${e===1?\"day\":\"days\"}</strong>\n </p>\n `}renderTerms(){return this.resolved?.terms?d`\n <div class=\"terms\">\n <consent-terms\n name=\"termsAccepted\"\n text=${this.resolved.terms.text}\n url=${this.resolved.terms.url??\"\"}\n ?required=${this.resolved.terms.required}\n @change=${this.handleTermsChange}\n ></consent-terms>\n </div>\n `:u}renderError(){return this.error?d`<div class=\"error-message\">${this.error}</div>`:u}renderFooter(){return d`\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n ${this.resolved?.ui.cancelButtonText??\"Cancel\"}\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${this.resolved?.ui.submitButtonText??\"Allow access\"}\n </consent-button>\n </div>\n `}renderConsentOnly(){return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Permission Request\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderCredentials(){let e=this.resolved?.credentials;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"text\"\n name=\"username\"\n label=${e?.usernameLabel??\"Username\"}\n placeholder=${e?.usernamePlaceholder??\"Enter your username\"}\n autocomplete=\"username\"\n required\n @input=${r=>this.handleInputChange(\"username\",r.detail.value)}\n ></consent-input>\n\n <consent-input\n type=\"password\"\n name=\"password\"\n label=${e?.passwordLabel??\"Password\"}\n placeholder=${e?.passwordPlaceholder??\"Enter your password\"}\n autocomplete=\"current-password\"\n required\n @input=${r=>this.handleInputChange(\"password\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${e?.showForgotPassword&&e.forgotPasswordUrl?d`\n <p style=\"text-align: right; margin-bottom: 1rem;\">\n <a\n href=${e.forgotPasswordUrl}\n style=\"font-size: 0.75rem; color: var(--_primary);\"\n >\n Forgot password?\n </a>\n </p>\n `:u}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderOAuth(){let e=this.resolved?.oauth,r=e?.providerId??\"oauth\",s=e?.providerName??\"OAuth Provider\";return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <consent-oauth-button\n provider=${r}\n provider-name=${s}\n url=${`${this.serverUrl}/oauth/${encodeURIComponent(r)}?session_id=${encodeURIComponent(this.sessionId)}`}\n button-text=${e?.buttonText??`Continue with ${s}`}\n full-width\n ></consent-oauth-button>\n\n ${this.renderPermissions()}\n\n <div class=\"divider\">or</div>\n\n ${this.renderExpiration()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderMagicLink(){let e=this.resolved?.magicLink;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"email\"\n name=\"email\"\n label=${e?.emailLabel??\"Email\"}\n placeholder=${e?.emailPlaceholder??\"Enter your email address\"}\n autocomplete=\"email\"\n required\n @input=${r=>this.handleInputChange(\"email\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n Cancel\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${e?.buttonText??\"Send magic link\"}\n </consent-button>\n </div>\n </consent-shell>\n `}renderOTP(){let e=this.resolved?.otp;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Verify Code\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"otp-section\">\n <p class=\"otp-instructions\">\n ${e?.instructions??\"Enter the verification code sent to your device\"}\n </p>\n <consent-otp-input\n length=${e?.digits??6}\n name=\"otp\"\n auto-focus\n @complete=${r=>{this.handleInputChange(\"otp\",r.detail.value),this.handleApprove()}}\n @input=${r=>this.handleInputChange(\"otp\",r.detail.value)}\n ></consent-otp-input>\n <div class=\"otp-resend\">\n Didn't receive the code?\n <button\n type=\"button\"\n ?disabled=${this.resendCooldown>0}\n @click=${this.handleResendOtp}\n >\n ${this.resendCooldown>0?`Resend in ${this.resendCooldown}s`:\"Resend\"}\n </button>\n </div>\n </div>\n\n ${this.renderPermissions()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderSuccess(){let e=this.resolved?.success;return d`\n <consent-shell\n page-title=${e?.title??\"Access Granted\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n <div class=\"success-view\">\n <div class=\"success-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n <h2 class=\"success-title\">${e?.title??\"Access Granted\"}</h2>\n <p class=\"success-description\">\n ${e?.description??\"You have successfully granted access. You can now close this window.\"}\n </p>\n </div>\n </div>\n\n <div slot=\"footer\">\n <consent-button\n variant=\"primary\"\n full-width\n @click=${()=>window.close()}\n >\n ${e?.continueButtonText??\"Close\"}\n </consent-button>\n </div>\n </consent-shell>\n `}render(){if(this.step===\"success\")return this.renderSuccess();switch(this.currentMode){case b.CREDENTIALS:return this.renderCredentials();case b.OAUTH:return this.renderOAuth();case b.MAGIC_LINK:return this.renderMagicLink();case b.OTP:return this.renderOTP();case b.CONSENT_ONLY:default:return this.renderConsentOnly()}}};m.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Agent info box */\n .agent-info {\n display: flex;\n gap: 1rem;\n padding: 1rem;\n background: #f9fafb;\n border-radius: 0.5rem;\n margin-bottom: 1rem;\n }\n\n .agent-icon {\n width: 40px;\n height: 40px;\n background: var(--_secondary);\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .agent-icon svg {\n width: 20px;\n height: 20px;\n color: var(--_primary);\n }\n\n .agent-text {\n flex: 1;\n }\n\n .agent-text p {\n margin: 0;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n .agent-text strong {\n color: #111827;\n }\n\n /* Permissions section */\n .permissions-header {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .permissions {\n margin-bottom: 1rem;\n }\n\n /* Expiration */\n .expiration {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 1rem;\n }\n\n .expiration strong {\n color: #374151;\n }\n\n /* Terms */\n .terms {\n margin-top: 1.5rem;\n }\n\n /* Error message */\n .error-message {\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 0.5rem;\n padding: 0.75rem 1rem;\n margin-bottom: 1rem;\n color: #dc2626;\n font-size: 0.875rem;\n }\n\n /* Form fields */\n .form-fields {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin-bottom: 1rem;\n }\n\n /* Divider */\n .divider {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin: 1.5rem 0;\n color: #6b7280;\n font-size: 0.75rem;\n }\n\n .divider::before,\n .divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #e5e7eb;\n }\n\n /* Success view */\n .success-view {\n text-align: center;\n padding: 2rem 0;\n }\n\n .success-icon {\n width: 64px;\n height: 64px;\n background: #d1fae5;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 auto 1.5rem;\n }\n\n .success-icon svg {\n width: 32px;\n height: 32px;\n color: #059669;\n }\n\n .success-title {\n font-size: 1.25rem;\n font-weight: 600;\n color: #111827;\n margin: 0 0 0.5rem;\n }\n\n .success-description {\n font-size: 0.875rem;\n color: #6b7280;\n margin: 0 0 1.5rem;\n }\n\n /* OTP section */\n .otp-section {\n text-align: center;\n margin-bottom: 1.5rem;\n }\n\n .otp-instructions {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 1rem;\n }\n\n .otp-resend {\n margin-top: 1rem;\n font-size: 0.75rem;\n }\n\n .otp-resend button {\n background: none;\n border: none;\n color: var(--_primary);\n cursor: pointer;\n text-decoration: underline;\n }\n\n .otp-resend button:disabled {\n color: #9ca3af;\n cursor: not-allowed;\n }\n `,n([l({type:Object,converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"config\",2),n([l({type:String})],m.prototype,\"mode\",2),n([l({type:String})],m.prototype,\"tool\",2),n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],m.prototype,\"scopes\",2),n([l({type:String,attribute:\"agent-did\"})],m.prototype,\"agentDid\",2),n([l({type:String,attribute:\"session-id\"})],m.prototype,\"sessionId\",2),n([l({type:String,attribute:\"project-id\"})],m.prototype,\"projectId\",2),n([l({type:String,attribute:\"server-url\"})],m.prototype,\"serverUrl\",2),n([l({type:String,attribute:\"agent-name\"})],m.prototype,\"agentName\",2),n([l({type:Object,attribute:\"oauth-identity\",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"oauthIdentity\",2),n([w()],m.prototype,\"resolved\",2),n([w()],m.prototype,\"currentMode\",2),n([w()],m.prototype,\"loading\",2),n([w()],m.prototype,\"error\",2),n([w()],m.prototype,\"step\",2),n([w()],m.prototype,\"termsAccepted\",2),n([w()],m.prototype,\"formData\",2),n([w()],m.prototype,\"resendCooldown\",2),n([w()],m.prototype,\"selectedScopes\",2),m=n([x(\"mcp-consent\")],m);export{_ as ConsentButton,T as ConsentCheckbox,C as ConsentInput,S as ConsentOAuthButton,A as ConsentOTPInput,U as ConsentPermissions,I as ConsentShell,$ as ConsentTerms,m as McpConsent};\n/*! Bundled license information:\n\n@lit/reactive-element/css-tag.js:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/reactive-element.js:\nlit-html/lit-html.js:\nlit-element/lit-element.js:\n@lit/reactive-element/decorators/custom-element.js:\n@lit/reactive-element/decorators/property.js:\n@lit/reactive-element/decorators/state.js:\n@lit/reactive-element/decorators/event-options.js:\n@lit/reactive-element/decorators/base.js:\n@lit/reactive-element/decorators/query.js:\n@lit/reactive-element/decorators/query-all.js:\n@lit/reactive-element/decorators/query-async.js:\n@lit/reactive-element/decorators/query-assigned-nodes.js:\nlit-html/directive.js:\nlit-html/directives/unsafe-html.js:\nlit-html/directives/unsafe-svg.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/is-server.js:\n (**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-assigned-elements.js:\n (**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n*/\n";
15
15
  /**
16
16
  * Size of the bundle in bytes (for logging/debugging)
17
17
  */
18
- export const CONSENT_BUNDLE_SIZE = 83084;
18
+ export const CONSENT_BUNDLE_SIZE = 83312;
@@ -1 +1 @@
1
- {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,0koFAA0koF,CAAC;AAEjnoF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAW,KAAK,CAAC"}
1
+ {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,szoFAAszoF,CAAC;AAE71oF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAW,KAAK,CAAC"}
@@ -124,6 +124,36 @@ export declare class McpConsent extends LitElement {
124
124
  connectedCallback(): void;
125
125
  disconnectedCallback(): void;
126
126
  protected updated(changedProperties: Map<string, unknown>): void;
127
+ /**
128
+ * Get the provider_type based on the current auth mode.
129
+ *
130
+ * This maps auth modes to the provider_type expected by the consent service:
131
+ * - consent-only → 'none'
132
+ * - credentials → 'credential'
133
+ * - oauth → 'oauth2' (or specific provider from oauthIdentity)
134
+ * - magic-link → 'magic_link'
135
+ * - otp → 'otp'
136
+ */
137
+ private getProviderType;
138
+ /**
139
+ * Handle consent approval - TRIGGERS DELEGATIONCREDENTIAL (VC) CREATION
140
+ *
141
+ * This is the critical method where the user's consent is submitted.
142
+ * When this succeeds, a DelegationCredential (W3C Verifiable Credential)
143
+ * is created on the server, authorizing the agent to act on behalf of the user.
144
+ *
145
+ * ## Flow Context
146
+ *
147
+ * This method is called when the user clicks "Approve" on the Consent Screen:
148
+ * - Consent Only: [Consent Screen] → handleApprove() → [Success Screen]
149
+ * - Auth flows: [Auth Screen] → [Consent Screen] → handleApprove() → [Success Screen]
150
+ *
151
+ * In both cases, the VC is created HERE, not during authentication.
152
+ * Authentication only verifies identity; consent grants the delegation.
153
+ *
154
+ * @fires mcp-consent:approve - Emitted when consent is successfully submitted
155
+ * @fires mcp-consent:error - Emitted if consent submission fails
156
+ */
127
157
  private handleApprove;
128
158
  private handleDeny;
129
159
  private handleTermsChange;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-consent.d.ts","sourceRoot":"","sources":["../../src/components/mcp-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAErE,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,UAAW,SAAQ,UAAU;IAGxC;;OAEG;IAiBH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;OAEG;IAEH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAIhB;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAiBH,MAAM,EAAE,MAAM,EAAE,CAAM;IAEtB;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAIf;;OAEG;IAkBH,aAAa,CAAC,EAAE,aAAa,CAAC;IAK9B,OAAO,CAAC,QAAQ,CAAC,CAAwB;IAGzC,OAAO,CAAC,WAAW,CAAqC;IAGxD,OAAO,CAAC,OAAO,CAAS;IAGxB,OAAO,CAAC,KAAK,CAAC,CAAS;IAGvB,OAAO,CAAC,IAAI,CAAmD;IAG/D,OAAO,CAAC,aAAa,CAAS;IAG9B,OAAO,CAAC,QAAQ,CAA8B;IAG9C,OAAO,CAAC,cAAc,CAAK;IAG3B,OAAO,CAAC,cAAc,CAAgB;IAEtC;;;OAGG;IACH,OAAO,CAAC,sBAAsB,CAAC,CAAiC;IAEhE,OAAgB,MAAM,0BAuLpB;IAIO,iBAAiB;IASjB,oBAAoB;cASV,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;YA6BpD,aAAa;IAuE3B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,iBAAiB;IA0DzB,OAAO,CAAC,WAAW;IAmCnB,OAAO,CAAC,eAAe;IAgDvB,OAAO,CAAC,SAAS;IAkDjB,OAAO,CAAC,aAAa;IA+CZ,MAAM;CAmBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"mcp-consent.d.ts","sourceRoot":"","sources":["../../src/components/mcp-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAErE,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,UAAW,SAAQ,UAAU;IAGxC;;OAEG;IAiBH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;OAEG;IAEH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAIhB;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAiBH,MAAM,EAAE,MAAM,EAAE,CAAM;IAEtB;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,SAAS,SAAM;IAIf;;OAEG;IAkBH,aAAa,CAAC,EAAE,aAAa,CAAC;IAK9B,OAAO,CAAC,QAAQ,CAAC,CAAwB;IAGzC,OAAO,CAAC,WAAW,CAAqC;IAGxD,OAAO,CAAC,OAAO,CAAS;IAGxB,OAAO,CAAC,KAAK,CAAC,CAAS;IAGvB,OAAO,CAAC,IAAI,CAAmD;IAG/D,OAAO,CAAC,aAAa,CAAS;IAG9B,OAAO,CAAC,QAAQ,CAA8B;IAG9C,OAAO,CAAC,cAAc,CAAK;IAG3B,OAAO,CAAC,cAAc,CAAgB;IAEtC;;;OAGG;IACH,OAAO,CAAC,sBAAsB,CAAC,CAAiC;IAEhE,OAAgB,MAAM,0BAuLpB;IAIO,iBAAiB;IASjB,oBAAoB;cASV,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IA6BlE;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IAgBvB;;;;;;;;;;;;;;;;;;OAkBG;YACW,aAAa;IA6E3B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,iBAAiB;IA0DzB,OAAO,CAAC,WAAW;IAmCnB,OAAO,CAAC,eAAe;IAgDvB,OAAO,CAAC,SAAS;IAkDjB,OAAO,CAAC,aAAa;IA+CZ,MAAM;CAmBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -121,6 +121,50 @@ let McpConsent = class McpConsent extends LitElement {
121
121
  }
122
122
  }
123
123
  // === FORM SUBMISSION ===
124
+ /**
125
+ * Get the provider_type based on the current auth mode.
126
+ *
127
+ * This maps auth modes to the provider_type expected by the consent service:
128
+ * - consent-only → 'none'
129
+ * - credentials → 'credential'
130
+ * - oauth → 'oauth2' (or specific provider from oauthIdentity)
131
+ * - magic-link → 'magic_link'
132
+ * - otp → 'otp'
133
+ */
134
+ getProviderType() {
135
+ switch (this.currentMode) {
136
+ case AUTH_MODES.CREDENTIALS:
137
+ return 'credential';
138
+ case AUTH_MODES.OAUTH:
139
+ return this.oauthIdentity?.provider ?? 'oauth2';
140
+ case AUTH_MODES.MAGIC_LINK:
141
+ return 'magic_link';
142
+ case AUTH_MODES.OTP:
143
+ return 'otp';
144
+ case AUTH_MODES.CONSENT_ONLY:
145
+ default:
146
+ return 'none';
147
+ }
148
+ }
149
+ /**
150
+ * Handle consent approval - TRIGGERS DELEGATIONCREDENTIAL (VC) CREATION
151
+ *
152
+ * This is the critical method where the user's consent is submitted.
153
+ * When this succeeds, a DelegationCredential (W3C Verifiable Credential)
154
+ * is created on the server, authorizing the agent to act on behalf of the user.
155
+ *
156
+ * ## Flow Context
157
+ *
158
+ * This method is called when the user clicks "Approve" on the Consent Screen:
159
+ * - Consent Only: [Consent Screen] → handleApprove() → [Success Screen]
160
+ * - Auth flows: [Auth Screen] → [Consent Screen] → handleApprove() → [Success Screen]
161
+ *
162
+ * In both cases, the VC is created HERE, not during authentication.
163
+ * Authentication only verifies identity; consent grants the delegation.
164
+ *
165
+ * @fires mcp-consent:approve - Emitted when consent is successfully submitted
166
+ * @fires mcp-consent:error - Emitted if consent submission fails
167
+ */
124
168
  async handleApprove(e) {
125
169
  e?.preventDefault();
126
170
  // Guard against duplicate submissions
@@ -138,6 +182,8 @@ let McpConsent = class McpConsent extends LitElement {
138
182
  this.loading = true;
139
183
  this.error = undefined;
140
184
  try {
185
+ // Build consent approval request
186
+ // The server creates the DelegationCredential (VC) when this request succeeds
141
187
  const formData = new FormData();
142
188
  formData.append('tool', this.tool);
143
189
  formData.append('scopes', JSON.stringify(this.selectedScopes));
@@ -145,12 +191,15 @@ let McpConsent = class McpConsent extends LitElement {
145
191
  formData.append('session_id', this.sessionId);
146
192
  formData.append('project_id', this.projectId);
147
193
  formData.append('auth_mode', this.currentMode);
148
- formData.append('provider_type', this.oauthIdentity?.provider ?? 'none');
194
+ // Set provider_type based on auth mode to ensure correct server-side routing
195
+ // This is stored in delegation metadata to track what auth method was used
196
+ formData.append('provider_type', this.getProviderType());
149
197
  formData.append('termsAccepted', String(this.termsAccepted));
150
- // Add custom form data
198
+ // Add custom form data (e.g., username/password for credential auth)
151
199
  Object.entries(this.formData).forEach(([key, value]) => {
152
200
  formData.append(key, value);
153
201
  });
202
+ // Submit consent - server creates DelegationCredential on success
154
203
  const response = await fetch(`${this.serverUrl}/consent/approve`, {
155
204
  method: 'POST',
156
205
  body: formData,
@@ -160,6 +209,7 @@ let McpConsent = class McpConsent extends LitElement {
160
209
  throw new Error(errorData.message || 'Approval failed');
161
210
  }
162
211
  const result = await response.json();
212
+ // VC created successfully - show success screen
163
213
  this.step = 'success';
164
214
  this.dispatchEvent(new CustomEvent('mcp-consent:approve', {
165
215
  detail: { success: true, redirectUrl: result.redirectUrl },