@amp-labs/react 2.13.1 → 2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/amp-react.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
component is wrapped with AmpersandProvider`);return e}const Vx=new gx({defaultOptions:{queries:{retry:(e,t)=>{if(t instanceof Oa){const n=t.response.status;if(n>=400&&n<500)return!1}return e<3}}}});function Ux(e){const{options:{apiKey:t,projectId:n,project:r,getToken:i},children:o}=e,s=r||n;if(n&&r)throw new Error("Use AmpersandProvider either with projectId or project but not both.");if(!s)throw new Error("Cannot use AmpersandProvider without a projectId or name.");if(!t&&!i)throw new Error("Cannot use AmpersandProvider without an apiKey or getToken.");if(t&&i)throw new Error("Cannot use AmpersandProvider with both apiKey and getToken.");const a={options:e.options,projectIdOrName:s};return d.jsx(yx,{client:Vx,children:d.jsx(Ra.Provider,{value:a,children:d.jsx(Rx,{children:d.jsx($x,{getTokenCallback:i||null,children:d.jsx(Tx,{value:t||null,children:o})})})})})}var Vd=Symbol.for("immer-nothing"),vc=Symbol.for("immer-draftable"),Bt=Symbol.for("immer-state"),zx=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Rt(e,...t){if(process.env.NODE_ENV!=="production"){const n=zx[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var mi=Object.getPrototypeOf;function kr(e){return!!e&&!!e[Bt]}function lr(e){return e?Ud(e)||Array.isArray(e)||!!e[vc]||!!e.constructor?.[vc]||Ci(e)||Po(e):!1}var Kx=Object.prototype.constructor.toString(),bc=new WeakMap;function Ud(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=bc.get(n);return r===void 0&&(r=Function.toString.call(n),bc.set(n,r)),r===Kx}function go(e,t,n=!0){Fo(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Fo(e){const t=e[Bt];return t?t.type_:Array.isArray(e)?1:Ci(e)?2:Po(e)?3:0}function Ws(e,t){return Fo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zd(e,t,n){const r=Fo(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Hx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ci(e){return e instanceof Map}function Po(e){return e instanceof Set}function nr(e){return e.copy_||e.base_}function Qs(e,t){if(Ci(e))return new Map(e);if(Po(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Ud(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Bt];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(mi(e),r)}else{const r=mi(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Aa(e,t=!1){return jo(e)||kr(e)||!lr(e)||(Fo(e)>1&&Object.defineProperties(e,{set:Ji,add:Ji,clear:Ji,delete:Ji}),Object.freeze(e),t&&Object.values(e).forEach(n=>Aa(n,!0))),e}function Jx(){Rt(2)}var Ji={value:Jx};function jo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Wx={};function cr(e){const t=Wx[e];return t||Rt(0,e),t}var gi;function Kd(){return gi}function Qx(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wc(e,t){t&&(cr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gs(e){Xs(e),e.drafts_.forEach(Gx),e.drafts_=null}function Xs(e){e===gi&&(gi=e.parent_)}function xc(e){return gi=Qx(gi,e)}function Gx(e){const t=e[Bt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ic(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Bt].modified_&&(Gs(t),Rt(4)),lr(e)&&(e=yo(t,e),t.parent_||vo(t,e)),t.patches_&&cr("Patches").generateReplacementPatches_(n[Bt].base_,e,t.patches_,t.inversePatches_)):e=yo(t,n,[]),Gs(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Vd?e:void 0}function yo(e,t,n){if(jo(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Bt];if(!i)return go(t,(o,s)=>Cc(e,i,t,o,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return vo(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let s=o,a=!1;i.type_===3&&(s=new Set(o),o.clear(),a=!0),go(s,(l,c)=>Cc(e,i,o,l,c,n,a),r),vo(e,o,!1),n&&e.patches_&&cr("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function Cc(e,t,n,r,i,o,s){if(i==null||typeof i!="object"&&!s)return;const a=jo(i);if(!(a&&!s)){if(process.env.NODE_ENV!=="production"&&i===n&&Rt(5),kr(i)){const l=o&&t&&t.type_!==3&&!Ws(t.assigned_,r)?o.concat(r):void 0,c=yo(e,i,l);if(zd(n,r,c),kr(c))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(lr(i)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&a)return;yo(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Ci(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&vo(e,i)}}}function vo(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Aa(t,n)}function Xx(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Kd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Fa;n&&(i=[r],o=yi);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Fa={get(e,t){if(t===Bt)return e;const n=nr(e);if(!Ws(n,t))return Yx(e,n,t);const r=n[t];return e.finalized_||!lr(r)?r:r===os(e.base_,t)?(ss(e),e.copy_[t]=Zs(r,e)):r},has(e,t){return t in nr(e)},ownKeys(e){return Reflect.ownKeys(nr(e))},set(e,t,n){const r=Hd(nr(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=os(nr(e),t),o=i?.[Bt];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Hx(n,i)&&(n!==void 0||Ws(e.base_,t)))return!0;ss(e),Ys(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return os(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ss(e),Ys(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=nr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Rt(11)},getPrototypeOf(e){return mi(e.base_)},setPrototypeOf(){Rt(12)}},yi={};go(Fa,(e,t)=>{yi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yi.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Rt(13),yi.set.call(this,e,t,void 0)};yi.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Rt(14),Fa.set.call(this,e[0],t,n,e[0])};function os(e,t){const n=e[Bt];return(n?nr(n):e)[t]}function Yx(e,t,n){const r=Hd(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function Hd(e,t){if(!(t in e))return;let n=mi(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=mi(n)}}function Ys(e){e.modified_||(e.modified_=!0,e.parent_&&Ys(e.parent_))}function ss(e){e.copy_||(e.copy_=Qs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Rt(6),r!==void 0&&typeof r!="function"&&Rt(7);let i;if(lr(t)){const o=xc(this),s=Zs(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Gs(o):Xs(o)}return wc(o,r),Ic(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Vd&&(i=void 0),this.autoFreeze_&&Aa(i,!0),r){const o=[],s=[];cr("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else Rt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){lr(e)||Rt(8),kr(e)&&(e=eI(e));const t=xc(this),n=Zs(e,void 0);return n[Bt].isManual_=!0,Xs(t),n}finishDraft(e,t){const n=e&&e[Bt];(!n||!n.isManual_)&&Rt(9);const{scope_:r}=n;return wc(r,t),Ic(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=cr("Patches").applyPatches_;return kr(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Zs(e,t){const n=Ci(e)?cr("MapSet").proxyMap_(e,t):Po(e)?cr("MapSet").proxySet_(e,t):Xx(e,t);return(t?t.scope_:Kd()).drafts_.push(n),n}function eI(e){return kr(e)||Rt(10,e),Jd(e)}function Jd(e){if(!lr(e)||jo(e))return e;const t=e[Bt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Qs(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Qs(e,!0);return go(n,(i,o)=>{zd(n,i,Jd(o))},r),t&&(t.finalized_=!1),n}var tI=new Zx,ct=tI.produce,$n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var si={exports:{}};si.exports;var Sc;function nI(){return Sc||(Sc=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",p="[object Date]",h="[object Error]",f="[object Function]",m="[object GeneratorFunction]",v="[object Map]",y="[object Number]",x="[object Null]",g="[object Object]",b="[object Promise]",I="[object Proxy]",O="[object RegExp]",_="[object Set]",R="[object String]",k="[object Symbol]",A="[object Undefined]",F="[object WeakMap]",j="[object ArrayBuffer]",L="[object DataView]",H="[object Float32Array]",P="[object Float64Array]",B="[object Int8Array]",X="[object Int16Array]",le="[object Int32Array]",fe="[object Uint8Array]",ge="[object Uint8ClampedArray]",C="[object Uint16Array]",W="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,S=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,V={};V[H]=V[P]=V[B]=V[X]=V[le]=V[fe]=V[ge]=V[C]=V[W]=!0,V[a]=V[l]=V[j]=V[u]=V[L]=V[p]=V[h]=V[f]=V[v]=V[y]=V[g]=V[O]=V[_]=V[R]=V[F]=!1;var Y=typeof $n=="object"&&$n&&$n.Object===Object&&$n,ie=typeof self=="object"&&self&&self.Object===Object&&self,ne=Y||ie||Function("return this")(),se=t&&!t.nodeType&&t,ee=se&&!0&&e&&!e.nodeType&&e,me=ee&&ee.exports===se,q=me&&Y.process,ye=(function(){try{return q&&q.binding&&q.binding("util")}catch{}})(),Z=ye&&ye.isTypedArray;function $e(E,T){for(var z=-1,oe=E==null?0:E.length,qe=0,ve=[];++z<oe;){var Je=E[z];T(Je,z,E)&&(ve[qe++]=Je)}return ve}function Fe(E,T){for(var z=-1,oe=T.length,qe=E.length;++z<oe;)E[qe+z]=T[z];return E}function Ae(E,T){for(var z=-1,oe=E==null?0:E.length;++z<oe;)if(T(E[z],z,E))return!0;return!1}function We(E,T){for(var z=-1,oe=Array(E);++z<E;)oe[z]=T(z);return oe}function et(E){return function(T){return E(T)}}function tt(E,T){return E.has(T)}function xe(E,T){return E?.[T]}function at(E){var T=-1,z=Array(E.size);return E.forEach(function(oe,qe){z[++T]=[qe,oe]}),z}function It(E,T){return function(z){return E(T(z))}}function dt(E){var T=-1,z=Array(E.size);return E.forEach(function(oe){z[++T]=oe}),z}var Ge=Array.prototype,D=Function.prototype,K=Object.prototype,M=ne["__core-js_shared__"],re=D.toString,ce=K.hasOwnProperty,Ue=(function(){var E=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||"");return E?"Symbol(src)_1."+E:""})(),Ct=K.toString,pt=RegExp("^"+re.call(ce).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=me?ne.Buffer:void 0,Pe=ne.Symbol,Oe=ne.Uint8Array,St=K.propertyIsEnumerable,ft=Ge.splice,Et=Pe?Pe.toStringTag:void 0,An=Object.getOwnPropertySymbols,Fn=gt?gt.isBuffer:void 0,Pn=It(Object.keys,Object),dn=br(ne,"DataView"),Yt=br(ne,"Map"),jn=br(ne,"Promise"),ze=br(ne,"Set"),nt=br(ne,"WeakMap"),de=br(Object,"create"),Ce=Yn(dn),Ot=Yn(Yt),xn=Yn(jn),te=Yn(ze),pe=Yn(nt),ue=Pe?Pe.prototype:void 0,Se=ue?ue.valueOf:void 0;function Me(E){var T=-1,z=E==null?0:E.length;for(this.clear();++T<z;){var oe=E[T];this.set(oe[0],oe[1])}}function Vt(){this.__data__=de?de(null):{},this.size=0}function Ut(E){var T=this.has(E)&&delete this.__data__[E];return this.size-=T?1:0,T}function ht(E){var T=this.__data__;if(de){var z=T[E];return z===r?void 0:z}return ce.call(T,E)?T[E]:void 0}function Nt(E){var T=this.__data__;return de?T[E]!==void 0:ce.call(T,E)}function De(E,T){var z=this.__data__;return this.size+=this.has(E)?0:1,z[E]=de&&T===void 0?r:T,this}Me.prototype.clear=Vt,Me.prototype.delete=Ut,Me.prototype.get=ht,Me.prototype.has=Nt,Me.prototype.set=De;function yt(E){var T=-1,z=E==null?0:E.length;for(this.clear();++T<z;){var oe=E[T];this.set(oe[0],oe[1])}}function Zo(){this.__data__=[],this.size=0}function es(E){var T=this.__data__,z=Bi(T,E);if(z<0)return!1;var oe=T.length-1;return z==oe?T.pop():ft.call(T,z,1),--this.size,!0}function ji(E){var T=this.__data__,z=Bi(T,E);return z<0?void 0:T[z][1]}function Mi(E){return Bi(this.__data__,E)>-1}function Di(E,T){var z=this.__data__,oe=Bi(z,E);return oe<0?(++this.size,z.push([E,T])):z[oe][1]=T,this}yt.prototype.clear=Zo,yt.prototype.delete=es,yt.prototype.get=ji,yt.prototype.has=Mi,yt.prototype.set=Di;function pn(E){var T=-1,z=E==null?0:E.length;for(this.clear();++T<z;){var oe=E[T];this.set(oe[0],oe[1])}}function Li(){this.size=0,this.__data__={hash:new Me,map:new(Yt||yt),string:new Me}}function _e(E){var T=$i(this,E).delete(E);return this.size-=T?1:0,T}function Zt(E){return $i(this,E).get(E)}function Jr(E){return $i(this,E).has(E)}function Xn(E,T){var z=$i(this,E),oe=z.size;return z.set(E,T),this.size+=z.size==oe?0:1,this}pn.prototype.clear=Li,pn.prototype.delete=_e,pn.prototype.get=Zt,pn.prototype.has=Jr,pn.prototype.set=Xn;function vr(E){var T=-1,z=E==null?0:E.length;for(this.__data__=new pn;++T<z;)this.add(E[T])}function Wr(E){return this.__data__.set(E,r),this}function dm(E){return this.__data__.has(E)}vr.prototype.add=vr.prototype.push=Wr,vr.prototype.has=dm;function Mn(E){var T=this.__data__=new yt(E);this.size=T.size}function pm(){this.__data__=new yt,this.size=0}function fm(E){var T=this.__data__,z=T.delete(E);return this.size=T.size,z}function hm(E){return this.__data__.get(E)}function mm(E){return this.__data__.has(E)}function gm(E,T){var z=this.__data__;if(z instanceof yt){var oe=z.__data__;if(!Yt||oe.length<n-1)return oe.push([E,T]),this.size=++z.size,this;z=this.__data__=new pn(oe)}return z.set(E,T),this.size=z.size,this}Mn.prototype.clear=pm,Mn.prototype.delete=fm,Mn.prototype.get=hm,Mn.prototype.has=mm,Mn.prototype.set=gm;function ym(E,T){var z=qi(E),oe=!z&&Am(E),qe=!z&&!oe&&ts(E),ve=!z&&!oe&&!qe&&Zl(E),Je=z||oe||qe||ve,lt=Je?We(E.length,String):[],mt=lt.length;for(var He in E)ce.call(E,He)&&!(Je&&(He=="length"||qe&&(He=="offset"||He=="parent")||ve&&(He=="buffer"||He=="byteLength"||He=="byteOffset")||Em(He,mt)))&<.push(He);return lt}function Bi(E,T){for(var z=E.length;z--;)if(Ql(E[z][0],T))return z;return-1}function vm(E,T,z){var oe=T(E);return qi(E)?oe:Fe(oe,z(E))}function Qr(E){return E==null?E===void 0?A:x:Et&&Et in Object(E)?Om(E):Rm(E)}function Kl(E){return Gr(E)&&Qr(E)==a}function Hl(E,T,z,oe,qe){return E===T?!0:E==null||T==null||!Gr(E)&&!Gr(T)?E!==E&&T!==T:bm(E,T,z,oe,Hl,qe)}function bm(E,T,z,oe,qe,ve){var Je=qi(E),lt=qi(T),mt=Je?l:Dn(E),He=lt?l:Dn(T);mt=mt==a?g:mt,He=He==a?g:He;var Pt=mt==g,en=He==g,vt=mt==He;if(vt&&ts(E)){if(!ts(T))return!1;Je=!0,Pt=!1}if(vt&&!Pt)return ve||(ve=new Mn),Je||Zl(E)?Jl(E,T,z,oe,qe,ve):Cm(E,T,mt,z,oe,qe,ve);if(!(z&i)){var zt=Pt&&ce.call(E,"__wrapped__"),Kt=en&&ce.call(T,"__wrapped__");if(zt||Kt){var Ln=zt?E.value():E,In=Kt?T.value():T;return ve||(ve=new Mn),qe(Ln,In,z,oe,ve)}}return vt?(ve||(ve=new Mn),Sm(E,T,z,oe,qe,ve)):!1}function wm(E){if(!Yl(E)||Tm(E))return!1;var T=Gl(E)?pt:S;return T.test(Yn(E))}function xm(E){return Gr(E)&&Xl(E.length)&&!!V[Qr(E)]}function Im(E){if(!km(E))return Pn(E);var T=[];for(var z in Object(E))ce.call(E,z)&&z!="constructor"&&T.push(z);return T}function Jl(E,T,z,oe,qe,ve){var Je=z&i,lt=E.length,mt=T.length;if(lt!=mt&&!(Je&&mt>lt))return!1;var He=ve.get(E);if(He&&ve.get(T))return He==T;var Pt=-1,en=!0,vt=z&o?new vr:void 0;for(ve.set(E,T),ve.set(T,E);++Pt<lt;){var zt=E[Pt],Kt=T[Pt];if(oe)var Ln=Je?oe(Kt,zt,Pt,T,E,ve):oe(zt,Kt,Pt,E,T,ve);if(Ln!==void 0){if(Ln)continue;en=!1;break}if(vt){if(!Ae(T,function(In,Zn){if(!tt(vt,Zn)&&(zt===In||qe(zt,In,z,oe,ve)))return vt.push(Zn)})){en=!1;break}}else if(!(zt===Kt||qe(zt,Kt,z,oe,ve))){en=!1;break}}return ve.delete(E),ve.delete(T),en}function Cm(E,T,z,oe,qe,ve,Je){switch(z){case L:if(E.byteLength!=T.byteLength||E.byteOffset!=T.byteOffset)return!1;E=E.buffer,T=T.buffer;case j:return!(E.byteLength!=T.byteLength||!ve(new Oe(E),new Oe(T)));case u:case p:case y:return Ql(+E,+T);case h:return E.name==T.name&&E.message==T.message;case O:case R:return E==T+"";case v:var lt=at;case _:var mt=oe&i;if(lt||(lt=dt),E.size!=T.size&&!mt)return!1;var He=Je.get(E);if(He)return He==T;oe|=o,Je.set(E,T);var Pt=Jl(lt(E),lt(T),oe,qe,ve,Je);return Je.delete(E),Pt;case k:if(Se)return Se.call(E)==Se.call(T)}return!1}function Sm(E,T,z,oe,qe,ve){var Je=z&i,lt=Wl(E),mt=lt.length,He=Wl(T),Pt=He.length;if(mt!=Pt&&!Je)return!1;for(var en=mt;en--;){var vt=lt[en];if(!(Je?vt in T:ce.call(T,vt)))return!1}var zt=ve.get(E);if(zt&&ve.get(T))return zt==T;var Kt=!0;ve.set(E,T),ve.set(T,E);for(var Ln=Je;++en<mt;){vt=lt[en];var In=E[vt],Zn=T[vt];if(oe)var ec=Je?oe(Zn,In,vt,T,E,ve):oe(In,Zn,vt,E,T,ve);if(!(ec===void 0?In===Zn||qe(In,Zn,z,oe,ve):ec)){Kt=!1;break}Ln||(Ln=vt=="constructor")}if(Kt&&!Ln){var Vi=E.constructor,Ui=T.constructor;Vi!=Ui&&"constructor"in E&&"constructor"in T&&!(typeof Vi=="function"&&Vi instanceof Vi&&typeof Ui=="function"&&Ui instanceof Ui)&&(Kt=!1)}return ve.delete(E),ve.delete(T),Kt}function Wl(E){return vm(E,jm,_m)}function $i(E,T){var z=E.__data__;return Nm(T)?z[typeof T=="string"?"string":"hash"]:z.map}function br(E,T){var z=xe(E,T);return wm(z)?z:void 0}function Om(E){var T=ce.call(E,Et),z=E[Et];try{E[Et]=void 0;var oe=!0}catch{}var qe=Ct.call(E);return oe&&(T?E[Et]=z:delete E[Et]),qe}var _m=An?function(E){return E==null?[]:(E=Object(E),$e(An(E),function(T){return St.call(E,T)}))}:Mm,Dn=Qr;(dn&&Dn(new dn(new ArrayBuffer(1)))!=L||Yt&&Dn(new Yt)!=v||jn&&Dn(jn.resolve())!=b||ze&&Dn(new ze)!=_||nt&&Dn(new nt)!=F)&&(Dn=function(E){var T=Qr(E),z=T==g?E.constructor:void 0,oe=z?Yn(z):"";if(oe)switch(oe){case Ce:return L;case Ot:return v;case xn:return b;case te:return _;case pe:return F}return T});function Em(E,T){return T=T??s,!!T&&(typeof E=="number"||U.test(E))&&E>-1&&E%1==0&&E<T}function Nm(E){var T=typeof E;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?E!=="__proto__":E===null}function Tm(E){return!!Ue&&Ue in E}function km(E){var T=E&&E.constructor,z=typeof T=="function"&&T.prototype||K;return E===z}function Rm(E){return Ct.call(E)}function Yn(E){if(E!=null){try{return re.call(E)}catch{}try{return E+""}catch{}}return""}function Ql(E,T){return E===T||E!==E&&T!==T}var Am=Kl((function(){return arguments})())?Kl:function(E){return Gr(E)&&ce.call(E,"callee")&&!St.call(E,"callee")},qi=Array.isArray;function Fm(E){return E!=null&&Xl(E.length)&&!Gl(E)}var ts=Fn||Dm;function Pm(E,T){return Hl(E,T)}function Gl(E){if(!Yl(E))return!1;var T=Qr(E);return T==f||T==m||T==c||T==I}function Xl(E){return typeof E=="number"&&E>-1&&E%1==0&&E<=s}function Yl(E){var T=typeof E;return E!=null&&(T=="object"||T=="function")}function Gr(E){return E!=null&&typeof E=="object"}var Zl=Z?et(Z):xm;function jm(E){return Fm(E)?ym(E):Im(E)}function Mm(){return[]}function Dm(){return!1}e.exports=Pm})(si,si.exports)),si.exports}var rI=nI();const Wd=$r(rI),Ye=async(e,t)=>{if(e instanceof Oa){const{status:n,statusText:r}=e.response;console.error(n===500?"Internal Server Error (500):":n===400?"Bad Request (400):":`Error (${n}):`,r);try{const o=await e.response.clone().json(),s=o?.causes?.join(`
|
|
3
3
|
`)||o?.detail;s?(console.error("[Error Message]",s),o?.remedy&&console.error("[Remedy]",o.remedy)):console.error("Unexpected error response:",o);const a=`${s} ${o?.remedy?`
|
|
4
4
|
|
|
5
|
-
[Remedy] ${o.remedy}`:""}`;t&&t(a)}catch(i){console.error("Error parsing error response body:",i)}}else console.error("Unexpected error:",e.message)};function Si(e,t){const n=wt(e,t),{projectIdOrName:r}=Ke(),{setError:i,removeError:o}=vn(),s=pr({queryKey:["amp","integrations",r],queryFn:async()=>{if(!r)throw new Error("Project ID or name is required");return(await n()).integrationApi.listIntegrations({projectIdOrName:r})},enabled:!!r});return w.useEffect(()=>{s.isError?(Ye(s.error),i(Ie.INTEGRATION_LIST,r)):o(Ie.INTEGRATION_LIST,r)},[s.isError,s.error,r,i,o]),s}const Pa=(e,t,n)=>{const r=wt(t,n),{projectIdOrName:i}=Ke(),{data:o,isError:s,error:a}=Si(t,n),l=o?.find(u=>u.name===e)?.id,c=pr({queryKey:["amp","installations",i,l,t],queryFn:async()=>{if(!i)throw new Error("Project ID is required");if(!l)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await r()).installationApi.listInstallations({projectIdOrName:i,integrationId:l,groupRef:t})},enabled:!s&&!!i&&!!l&&!!t&&!!o&&o.length>0});return{...c,isError:c.isError||s,error:c.error||a}},an=()=>{const{setError:e}=vn(),t=wt(),{projectIdOrName:n}=Ke(),r=pr({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return w.useEffect(()=>{r.isError&&e(Ie.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:r.data?.name,projectId:r.data?.id}};function ln(){const{integrationNameOrId:e,groupRef:t}=Jn(),n=Pa(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l?.[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}function fr(e){return!e.fieldName}function iI(e){return e?.requiredFields?.filter(t=>!fr(t)&&!!t.fieldName)||null}function ja(e){return e?.optionalFields?.filter(t=>!fr(t)&&!!t.fieldName)||null}function Qd(e){return e?.requiredFields?.filter(n=>fr(n)&&!!n.mapToName)||[]}function Gd(e){return e?.optionalFields?.filter(n=>fr(n)&&!!n.mapToName)||[]}const hr=e=>{const t=Si(),r=t.data?.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r?.provider}},Ma=()=>{const{groupRef:e,integrationNameOrId:t}=Jn(),{provider:n}=hr(t),r=La({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c?.[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},Xd=()=>{const e=wt(),{connection:t,isPending:n,isFetching:r}=Ma(),{projectIdOrName:i}=Ke(),{integrationNameOrId:o}=Jn(),{data:s}=hr(o),a=t?.id,l=s?.id,c=s?.latestRevision?.id;return pr({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function Tn(){const e=Xd(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a?.content,c=w.useMemo(()=>({getReadObjects:()=>l?.read?.objects??[],getReadObject:u=>{const p=l?.read?.objects?.find(m=>m.objectName===u);if(!p)return console.error(`Object ${u} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null,getRequiredMapFields:()=>null,getOptionalMapFields:()=>null};const h=(m="raw")=>m==="mappings"?Qd(p)??[]:m==="no-mappings"?iI(p)??[]:p.requiredFields??[],f=(m="raw")=>m==="mappings"?Gd(p)??[]:m==="no-mappings"?ja(p)??[]:p.optionalFields??[];return{object:p,getRequiredFields:h,getOptionalFields:f,getRequiredMapFields:()=>h("mappings"),getOptionalMapFields:()=>f("mappings")}},getWriteObject:u=>{const p=l?.write?.objects?.find(h=>h.objectName===u);return p?{object:p}:(console.error(`Object ${u} not found`),{object:null})},getCustomerFieldsForObject:u=>{const p=l?.read?.objects?.find(h=>h.objectName===u);return p?{allFields:p.allFieldsMetadata??{},getField:h=>{const f=p.allFieldsMetadata?.[h];return f||(console.error(`Field ${h} not found`),null)}}:(console.error(`Object ${u} not found`),{allFields:null,getField:()=>null})}}),[l?.read?.objects,l?.write?.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function oI(e){const[t,n]=w.useState(e),r=w.useRef(void 0),{data:i}=Tn(),{installation:o}=ln(),s=w.useCallback(()=>t,[t]),a=w.useCallback((f,m)=>{m.provider=m.provider||i?.content?.provider||"";const v=m.read||{objects:{}},y=v.objects||{},x=y[f]||{};return x.objectName=x.objectName||f,y[f]=x,v.objects=y,m.read=v,{read:v,objects:y,obj:x}},[i?.content?.provider]),l=w.useCallback(f=>{n(m=>ct(m,v=>{v.read?.objects?.[f]&&delete v.read.objects[f],v.write?.objects?.[f]&&delete v.write.objects[f]}))},[]),c=w.useCallback(f=>({object:t.read?.objects?.[f],setEnableRead:()=>{n(m=>ct(m,v=>{const{obj:y}=a(f,v);y.disabled=!1}))},setDisableRead:()=>{n(m=>ct(m,v=>{const{obj:y}=a(f,v);y.disabled=!0}))},getSelectedField:m=>!!t.read?.objects?.[f]?.selectedFields?.[m],setSelectedField:({fieldName:m,selected:v})=>{n(y=>ct(y,x=>{const{obj:g}=a(f,x);g.selectedFields=g.selectedFields||{},g.selectedFields[m]=v,g.selectedFields[m]===!1&&delete g.selectedFields[m]}))},getFieldMapping:m=>t.read?.objects?.[f]?.selectedFieldMappings?.[m],setFieldMapping:({fieldName:m,mapToName:v})=>{n(y=>ct(y,x=>{const{obj:g}=a(f,x);g.selectedFieldMappings=g.selectedFieldMappings||{},g.selectedFieldMappings[v]=m}))},deleteFieldMapping:m=>{n(v=>ct(v,y=>{const x=y.read?.objects?.[f]?.selectedFieldMappings;x&&m in x&&delete x[m]}))}}),[t.read?.objects,a]),u=w.useCallback(f=>{const m=t.write?.objects?.[f],v=g=>{const b=g.write||{},I=b.objects||{},O=I[f]||{objectName:f};return I[f]=O,b.objects=I,g.write=b,{write:b,objects:I,obj:O}},y=(g,b)=>m?.selectedFieldSettings?.[g]?.[b],x=(g,b,I)=>{n(O=>ct(O,_=>{const{obj:R}=v(_);R.selectedFieldSettings={...R.selectedFieldSettings,[g]:{...R.selectedFieldSettings?.[g],[b]:I}}}))};return{object:m,setEnableWrite:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.objectName=f}))},setDisableWrite:()=>{n(g=>ct(g,b=>{const{objects:I}=v(b);delete I[f]}))},getWriteObject:()=>t.write?.objects?.[f],getSelectedFieldSettings:g=>m?.selectedFieldSettings?.[g],setSelectedFieldSettings:({fieldName:g,settings:b})=>{n(I=>ct(I,O=>{const{obj:_}=v(O),R=_.selectedFieldSettings||{};_.selectedFieldSettings={...R,[g]:b},b===void 0&&delete _.selectedFieldSettings[g]}))},getDefaultValues:g=>y(g,"default"),setDefaultValues:({fieldName:g,value:b})=>x(g,"default",b),getWriteOnCreateSetting:g=>y(g,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:g,value:b})=>x(g,"writeOnCreate",b),getWriteOnUpdateSetting:g=>y(g,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:g,value:b})=>x(g,"writeOnUpdate",b),setEnableDeletion:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.deletionSettings={enabled:!0}}))},setDisableDeletion:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.deletionSettings={enabled:!1}}))}}},[t.write?.objects]),p=w.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(f=>ct(f,m=>{m.proxy={enabled:!0}}))},setDisableProxy:()=>{n(f=>ct(f,m=>{m.proxy={enabled:!1}}))},getProxyEnabled:()=>t.proxy?.enabled||!1}),[t.proxy]),h=w.useCallback(()=>{n(f=>ct(f,m=>{Object.assign(m,o?.config?.content)}))},[o?.config?.content]);return w.useEffect(()=>{o&&(console.debug("Installation found",{installation:o}),r.current?Wd(r.current,o)||(console.debug("Installation changed, resetting config",{previous:r.current,current:o}),h(),r.current=o):(r.current=o,h()))},[o,h]),{draft:t,get:s,reset:h,setDraft:n,removeObject:l,readObject:c,writeObject:u,proxy:p}}const Da=w.createContext(null);function sI({children:e,initialConfig:t}){const n=oI(t);return d.jsx(Da.Provider,{value:n,children:e})}function Mo(){const e=w.useContext(Da);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function aI(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=w.useContext(Da);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const Yd=w.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function Jn(){const e=w.useContext(Yd);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function Do({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=w.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return d.jsx(Yd.Provider,{value:s,children:d.jsx(sI,{initialConfig:{},children:e})})}class ea{constructor(t){this.connectionApi=new $w(t),this.installationApi=new qw(t),this.integrationApi=new Vw(t),this.oAuthApi=new Uw(t),this.projectApi=new zw(t),this.providerApi=new Kw(t),this.providerAppApi=new Hw(t),this.revisionApi=new Jw(t)}}const Zd="2.13.1",lI="v1",Wi="https://api.withampersand.com";function ep(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Wi;case"mock":return"http://127.0.0.1:4010";case"":return Wi;default:return e??Wi}}catch{return Wi}}const cI=(e,t)=>`${e}/${t}`;function uI(){return cI(ep(),lI)}const tp=ep(),np=uI(),dI=new Sa({basePath:np,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Zd}});new ea(dI);const pI=e=>({header:"X-Api-Key",value:e}),fI=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},Oc=(e,t)=>new Sa({basePath:np,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Zd,[e]:t}});function wt(e,t){const n=Bd(),{getToken:r}=qx(),i=Jn(),o=t||i.consumerRef,s=e||i.groupRef;return w.useCallback(async()=>{if(n){const l=pI(n),c=Oc(l.header,l.value);return new ea(c)}if(r){if(!o||!s)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:o,groupRef:s}),new Error("Unable to create JWT API service without consumerRef or groupRef. Provide via InstallationProvider or useAPI parameters.");const l=await r({consumerRef:o,groupRef:s}),c=fI(l),u=Oc(c.header,c.value);return new ea(u)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[n,r,o,s])}const La=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Ke(),r=wt();return pr({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function hI({height:e="48",width:t="48"}){return d.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const mI="_box_1p7c5_1",_c={box:mI};function kn({children:e,className:t,style:n}){return d.jsx("div",{className:t?`${_c.box} ${t}`:_c.box,style:n,children:e})}const gI="_container_1wvzr_1",Ec={container:gI};function qr({children:e,className:t,style:n}){return d.jsx("div",{className:t?`${Ec.container} ${t}`:Ec.container,style:n,children:e})}const yI="_errorBoxContainer_19655_1",vI="_errorBox_19655_1",bI="_errorIconWrapper_19655_23",wI="_errorText_19655_34",ao={errorBoxContainer:yI,errorBox:vI,errorIconWrapper:bI,errorText:wI};function rp({message:e}){return d.jsxs(kn,{className:ao.errorBox,children:[d.jsx("div",{className:ao.errorIconWrapper,children:d.jsx(hI,{width:"20",height:"20"})}),d.jsx("p",{className:ao.errorText,children:e})]})}function ip({message:e,children:t}){return d.jsxs(qr,{className:ao.errorBoxContainer,children:[d.jsx(rp,{message:e}),t]})}const xI="_loader_6ubm6_1",II={loader:xI};function CI(){return d.jsx("span",{className:II.loader})}function vi(){return d.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:d.jsx(CI,{})})}function op({children:e}){return d.jsx(qr,{style:{maxWidth:"55rem"},children:d.jsx(kn,{children:e})})}function mr(){return d.jsx(op,{children:d.jsx(vi,{})})}function ot({message:e,children:t}){return d.jsx(op,{children:d.jsx(ip,{message:e,children:t})})}function Ba(e,t){try{return process.env[e]}catch{return t}}function Xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function SI(e,t){return t?.displayName??Xt(e)}const OI=e=>e.split(`
|
|
5
|
+
[Remedy] ${o.remedy}`:""}`;t&&t(a)}catch(i){console.error("Error parsing error response body:",i)}}else console.error("Unexpected error:",e.message)};function Si(e,t){const n=wt(e,t),{projectIdOrName:r}=Ke(),{setError:i,removeError:o}=vn(),s=pr({queryKey:["amp","integrations",r],queryFn:async()=>{if(!r)throw new Error("Project ID or name is required");return(await n()).integrationApi.listIntegrations({projectIdOrName:r})},enabled:!!r});return w.useEffect(()=>{s.isError?(Ye(s.error),i(Ie.INTEGRATION_LIST,r)):o(Ie.INTEGRATION_LIST,r)},[s.isError,s.error,r,i,o]),s}const Pa=(e,t,n)=>{const r=wt(t,n),{projectIdOrName:i}=Ke(),{data:o,isError:s,error:a}=Si(t,n),l=o?.find(u=>u.name===e)?.id,c=pr({queryKey:["amp","installations",i,l,t],queryFn:async()=>{if(!i)throw new Error("Project ID is required");if(!l)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await r()).installationApi.listInstallations({projectIdOrName:i,integrationId:l,groupRef:t})},enabled:!s&&!!i&&!!l&&!!t&&!!o&&o.length>0});return{...c,isError:c.isError||s,error:c.error||a}},an=()=>{const{setError:e}=vn(),t=wt(),{projectIdOrName:n}=Ke(),r=pr({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return w.useEffect(()=>{r.isError&&e(Ie.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:r.data?.appName,projectId:r.data?.id}};function ln(){const{integrationNameOrId:e,groupRef:t}=Jn(),n=Pa(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l?.[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}function fr(e){return!e.fieldName}function iI(e){return e?.requiredFields?.filter(t=>!fr(t)&&!!t.fieldName)||null}function ja(e){return e?.optionalFields?.filter(t=>!fr(t)&&!!t.fieldName)||null}function Qd(e){return e?.requiredFields?.filter(n=>fr(n)&&!!n.mapToName)||[]}function Gd(e){return e?.optionalFields?.filter(n=>fr(n)&&!!n.mapToName)||[]}const hr=e=>{const t=Si(),r=t.data?.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r?.provider}},Ma=()=>{const{groupRef:e,integrationNameOrId:t}=Jn(),{provider:n}=hr(t),r=La({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c?.[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},Xd=()=>{const e=wt(),{connection:t,isPending:n,isFetching:r}=Ma(),{projectIdOrName:i}=Ke(),{integrationNameOrId:o}=Jn(),{data:s}=hr(o),a=t?.id,l=s?.id,c=s?.latestRevision?.id;return pr({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function Tn(){const e=Xd(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a?.content,c=w.useMemo(()=>({getReadObjects:()=>l?.read?.objects??[],getReadObject:u=>{const p=l?.read?.objects?.find(m=>m.objectName===u);if(!p)return console.error(`Object ${u} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null,getRequiredMapFields:()=>null,getOptionalMapFields:()=>null};const h=(m="raw")=>m==="mappings"?Qd(p)??[]:m==="no-mappings"?iI(p)??[]:p.requiredFields??[],f=(m="raw")=>m==="mappings"?Gd(p)??[]:m==="no-mappings"?ja(p)??[]:p.optionalFields??[];return{object:p,getRequiredFields:h,getOptionalFields:f,getRequiredMapFields:()=>h("mappings"),getOptionalMapFields:()=>f("mappings")}},getWriteObject:u=>{const p=l?.write?.objects?.find(h=>h.objectName===u);return p?{object:p}:(console.error(`Object ${u} not found`),{object:null})},getCustomerFieldsForObject:u=>{const p=l?.read?.objects?.find(h=>h.objectName===u);return p?{allFields:p.allFieldsMetadata??{},getField:h=>{const f=p.allFieldsMetadata?.[h];return f||(console.error(`Field ${h} not found`),null)}}:(console.error(`Object ${u} not found`),{allFields:null,getField:()=>null})}}),[l?.read?.objects,l?.write?.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function oI(e){const[t,n]=w.useState(e),r=w.useRef(void 0),{data:i}=Tn(),{installation:o}=ln(),s=w.useCallback(()=>t,[t]),a=w.useCallback((f,m)=>{m.provider=m.provider||i?.content?.provider||"";const v=m.read||{objects:{}},y=v.objects||{},x=y[f]||{};return x.objectName=x.objectName||f,y[f]=x,v.objects=y,m.read=v,{read:v,objects:y,obj:x}},[i?.content?.provider]),l=w.useCallback(f=>{n(m=>ct(m,v=>{v.read?.objects?.[f]&&delete v.read.objects[f],v.write?.objects?.[f]&&delete v.write.objects[f]}))},[]),c=w.useCallback(f=>({object:t.read?.objects?.[f],setEnableRead:()=>{n(m=>ct(m,v=>{const{obj:y}=a(f,v);y.disabled=!1}))},setDisableRead:()=>{n(m=>ct(m,v=>{const{obj:y}=a(f,v);y.disabled=!0}))},getSelectedField:m=>!!t.read?.objects?.[f]?.selectedFields?.[m],setSelectedField:({fieldName:m,selected:v})=>{n(y=>ct(y,x=>{const{obj:g}=a(f,x);g.selectedFields=g.selectedFields||{},g.selectedFields[m]=v,g.selectedFields[m]===!1&&delete g.selectedFields[m]}))},getFieldMapping:m=>t.read?.objects?.[f]?.selectedFieldMappings?.[m],setFieldMapping:({fieldName:m,mapToName:v})=>{n(y=>ct(y,x=>{const{obj:g}=a(f,x);g.selectedFieldMappings=g.selectedFieldMappings||{},g.selectedFieldMappings[v]=m}))},deleteFieldMapping:m=>{n(v=>ct(v,y=>{const x=y.read?.objects?.[f]?.selectedFieldMappings;x&&m in x&&delete x[m]}))}}),[t.read?.objects,a]),u=w.useCallback(f=>{const m=t.write?.objects?.[f],v=g=>{const b=g.write||{},I=b.objects||{},O=I[f]||{objectName:f};return I[f]=O,b.objects=I,g.write=b,{write:b,objects:I,obj:O}},y=(g,b)=>m?.selectedFieldSettings?.[g]?.[b],x=(g,b,I)=>{n(O=>ct(O,_=>{const{obj:R}=v(_);R.selectedFieldSettings={...R.selectedFieldSettings,[g]:{...R.selectedFieldSettings?.[g],[b]:I}}}))};return{object:m,setEnableWrite:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.objectName=f}))},setDisableWrite:()=>{n(g=>ct(g,b=>{const{objects:I}=v(b);delete I[f]}))},getWriteObject:()=>t.write?.objects?.[f],getSelectedFieldSettings:g=>m?.selectedFieldSettings?.[g],setSelectedFieldSettings:({fieldName:g,settings:b})=>{n(I=>ct(I,O=>{const{obj:_}=v(O),R=_.selectedFieldSettings||{};_.selectedFieldSettings={...R,[g]:b},b===void 0&&delete _.selectedFieldSettings[g]}))},getDefaultValues:g=>y(g,"default"),setDefaultValues:({fieldName:g,value:b})=>x(g,"default",b),getWriteOnCreateSetting:g=>y(g,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:g,value:b})=>x(g,"writeOnCreate",b),getWriteOnUpdateSetting:g=>y(g,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:g,value:b})=>x(g,"writeOnUpdate",b),setEnableDeletion:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.deletionSettings={enabled:!0}}))},setDisableDeletion:()=>{n(g=>ct(g,b=>{const{obj:I}=v(b);I.deletionSettings={enabled:!1}}))}}},[t.write?.objects]),p=w.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(f=>ct(f,m=>{m.proxy={enabled:!0}}))},setDisableProxy:()=>{n(f=>ct(f,m=>{m.proxy={enabled:!1}}))},getProxyEnabled:()=>t.proxy?.enabled||!1}),[t.proxy]),h=w.useCallback(()=>{n(f=>ct(f,m=>{Object.assign(m,o?.config?.content)}))},[o?.config?.content]);return w.useEffect(()=>{o&&(console.debug("Installation found",{installation:o}),r.current?Wd(r.current,o)||(console.debug("Installation changed, resetting config",{previous:r.current,current:o}),h(),r.current=o):(r.current=o,h()))},[o,h]),{draft:t,get:s,reset:h,setDraft:n,removeObject:l,readObject:c,writeObject:u,proxy:p}}const Da=w.createContext(null);function sI({children:e,initialConfig:t}){const n=oI(t);return d.jsx(Da.Provider,{value:n,children:e})}function Mo(){const e=w.useContext(Da);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function aI(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=w.useContext(Da);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const Yd=w.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function Jn(){const e=w.useContext(Yd);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function Do({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=w.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return d.jsx(Yd.Provider,{value:s,children:d.jsx(sI,{initialConfig:{},children:e})})}class ea{constructor(t){this.connectionApi=new $w(t),this.installationApi=new qw(t),this.integrationApi=new Vw(t),this.oAuthApi=new Uw(t),this.projectApi=new zw(t),this.providerApi=new Kw(t),this.providerAppApi=new Hw(t),this.revisionApi=new Jw(t)}}const Zd="2.13.2",lI="v1",Wi="https://api.withampersand.com";function ep(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Wi;case"mock":return"http://127.0.0.1:4010";case"":return Wi;default:return e??Wi}}catch{return Wi}}const cI=(e,t)=>`${e}/${t}`;function uI(){return cI(ep(),lI)}const tp=ep(),np=uI(),dI=new Sa({basePath:np,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Zd}});new ea(dI);const pI=e=>({header:"X-Api-Key",value:e}),fI=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},Oc=(e,t)=>new Sa({basePath:np,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":Zd,[e]:t}});function wt(e,t){const n=Bd(),{getToken:r}=qx(),i=Jn(),o=t||i.consumerRef,s=e||i.groupRef;return w.useCallback(async()=>{if(n){const l=pI(n),c=Oc(l.header,l.value);return new ea(c)}if(r){if(!o||!s)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:o,groupRef:s}),new Error("Unable to create JWT API service without consumerRef or groupRef. Provide via InstallationProvider or useAPI parameters.");const l=await r({consumerRef:o,groupRef:s}),c=fI(l),u=Oc(c.header,c.value);return new ea(u)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[n,r,o,s])}const La=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Ke(),r=wt();return pr({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function hI({height:e="48",width:t="48"}){return d.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const mI="_box_1p7c5_1",_c={box:mI};function kn({children:e,className:t,style:n}){return d.jsx("div",{className:t?`${_c.box} ${t}`:_c.box,style:n,children:e})}const gI="_container_1wvzr_1",Ec={container:gI};function qr({children:e,className:t,style:n}){return d.jsx("div",{className:t?`${Ec.container} ${t}`:Ec.container,style:n,children:e})}const yI="_errorBoxContainer_19655_1",vI="_errorBox_19655_1",bI="_errorIconWrapper_19655_23",wI="_errorText_19655_34",ao={errorBoxContainer:yI,errorBox:vI,errorIconWrapper:bI,errorText:wI};function rp({message:e}){return d.jsxs(kn,{className:ao.errorBox,children:[d.jsx("div",{className:ao.errorIconWrapper,children:d.jsx(hI,{width:"20",height:"20"})}),d.jsx("p",{className:ao.errorText,children:e})]})}function ip({message:e,children:t}){return d.jsxs(qr,{className:ao.errorBoxContainer,children:[d.jsx(rp,{message:e}),t]})}const xI="_loader_6ubm6_1",II={loader:xI};function CI(){return d.jsx("span",{className:II.loader})}function vi(){return d.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:d.jsx(CI,{})})}function op({children:e}){return d.jsx(qr,{style:{maxWidth:"55rem"},children:d.jsx(kn,{children:e})})}function mr(){return d.jsx(op,{children:d.jsx(vi,{})})}function ot({message:e,children:t}){return d.jsx(op,{children:d.jsx(ip,{message:e,children:t})})}function Ba(e,t){try{return process.env[e]}catch{return t}}function Xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function SI(e,t){return t?.displayName??Xt(e)}const OI=e=>e.split(`
|
|
6
6
|
`).filter(n=>n.trim()!==""),_I=(e,t)=>t?.length===0||!e?null:t.find(n=>n.name===e)??null;function EI(e){return!e||typeof e!="string"?"id_"+Math.random().toString(36).substr(2,9):e.toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^[^a-z]/,"id-").substring(0,50)}const NI=()=>{const[e,t]=w.useState(!1),n=w.useCallback(()=>{t(!0)},[t]),r=w.useCallback(()=>{t(!1)},[t]);return{isIntegrationDeleted:e,setIntegrationDeleted:n,resetIntegrationDeleted:r}},sp=w.createContext({integrationId:"",provider:"",integrationObj:void 0,consumerRef:"",consumerName:"",groupRef:"",groupName:"",installation:void 0,setInstallation:()=>{},resetInstallations:()=>{},onInstallSuccess:void 0,onUpdateSuccess:void 0,onUninstallSuccess:void 0,isIntegrationDeleted:!1,setIntegrationDeleted:()=>{},resetComponent:()=>{}});function st(){const e=w.useContext(sp);if(!e)throw new Error("useInstallIntegrationProps must be used within an InstallIntegrationProvider");return e}function ap({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,fieldMapping:c,resetComponent:u}){const{data:p}=Si(),{setError:h,isError:f,removeError:m}=vn(),{isIntegrationDeleted:v,setIntegrationDeleted:y,resetIntegrationDeleted:x}=NI(),g=w.useMemo(()=>_I(t,p||[]),[t,p]),{data:b,isLoading:I,isError:O,error:_}=Pa(t,i),R=b?.[0]||null;w.useEffect(()=>{x()},[t,n,r,i,o,c]),w.useEffect(()=>{g===null&&p?.length&&console.error(`Integration "${t}" not found in integration list`)},[t,g,p]),w.useEffect(()=>{O?(h(Ie.INSTALLATION_LIST,g?.id||""),Ye(_)):m(Ie.INSTALLATION_LIST,g?.id||"")},[O,g,h,m,_]);const k=Ze(),A=w.useCallback(()=>{k.invalidateQueries({queryKey:["amp","installations"]})},[k]),F=w.useCallback(H=>{k.setQueryData(["amp","installations"],[H]),k.invalidateQueries({queryKey:["amp","installations"]})},[k]),j=g?.id||"",L=w.useMemo(()=>({integrationId:g?.id||"",provider:g?.provider||"",integrationObj:g,consumerRef:n,consumerName:r,groupRef:i,groupName:o,installation:R||void 0,setInstallation:F,resetInstallations:A,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,isIntegrationDeleted:v,setIntegrationDeleted:y,fieldMapping:c,resetComponent:u}),[g,n,r,i,o,R,F,A,s,a,l,v,y,c,u]);if(I)return d.jsx(mr,{});if(g===null)return d.jsx(ot,{message:`Integration "${t}" not found`});if(f(Ie.INSTALLATION_LIST,j)){const H=`Error retrieving installation information for integration "${g?.name||"unknown"}"`;return d.jsx(ot,{message:H})}return d.jsx(sp.Provider,{value:L,children:e})}const lp=w.createContext({connections:null,isConnectionsLoading:!0,selectedConnection:null,setConnections:()=>{},setSelectedConnection:()=>{}}),cn=()=>{const e=w.useContext(lp);if(!e)throw new Error("useConnections must be used within a ConnectionsProvider");return e};function $a({groupRef:e,provider:t,children:n}){const r=Ze(),{setError:i,isError:o}=vn(),{projectIdOrName:s,isLoading:a}=an(),{integrationId:l,groupRef:c}=st(),{provider:u}=hr(l),{data:p,isLoading:h,isError:f,error:m}=La({groupRef:e||c,provider:u||t}),v=p?.[0],y=w.useCallback(b=>{r.setQueryData(["amp","connections"],()=>b),r.invalidateQueries({queryKey:["amp","connections"]})},[r]),x=w.useCallback(()=>{r.invalidateQueries({queryKey:["amp","connections"]})},[r]);w.useEffect(()=>{f?(i(Ie.CONNECTION_LIST,s,!0),Ye(m)):i(Ie.CONNECTION_LIST,s,!1)},[f,i,s,m]);const g=w.useMemo(()=>({connections:p||null,isConnectionsLoading:h,selectedConnection:v||null,setConnections:y,setSelectedConnection:x}),[p,h,v,y,x]);if(h||a)return d.jsx(mr,{});if(s&&o(Ie.PROJECT,s))return d.jsx(ot,{message:`Error loading project ${s}`});if(s&&o(Ie.CONNECTION_LIST,s))return d.jsx(ot,{message:"Error retrieving existing connections"});if(!s)throw new Error("Project ID or Project Name not found. ConnectionsProvider must be used within AmpersandProvider");return d.jsx(lp.Provider,{value:g,children:n})}const cp=()=>{const e=wt(),t=Ze(),[n,r]=w.useState(null);return{...Nn({mutationKey:["createInstallation"],mutationFn:async o=>(await e()).installationApi.createInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error creating installation"),Ye(o,r)}}),errorMsg:n}};function TI(e){return typeof e.provider=="string"}function kI(e){return TI(e)?{data:e}:{error:new Error("Config must have a provider field for creation")}}function qa(){const{projectIdOrName:e}=Ke(),{groupRef:t,integrationNameOrId:n}=Jn(),{data:r}=hr(n),{connection:i}=Ma(),{installation:o}=ln(),s=Ze(),{mutate:a,isIdle:l,isPending:c,error:u,errorMsg:p}=cp();return{createInstallation:({config:f,onSuccess:m,onError:v,onSettled:y})=>{if(o){const I=new Error("Installation already created. Try updating instead.");v?.(I),y?.();return}if(!r){const I=new Error("No integration found");v?.(I),y?.();return}const x={...f,provider:f.provider||r.provider||""},g=kI(x);if(g.error||!g.data){v?.(g.error||new Error("Invalid configuration data")),y?.();return}const b={projectIdOrName:e,integrationId:r?.id,installation:{groupRef:t,connectionId:i?.id,config:{content:g.data}}};return a(b,{onSuccess:I=>{m?.(I)},onError:I=>{v?.(I)},onSettled:()=>{y?.(),s.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:l,isPending:c,error:u,errorMsg:p}}const up=()=>{const e=wt(),t=Ze(),[n,r]=w.useState(null);return{...Nn({mutationKey:["updateInstallation"],mutationFn:async o=>(await e()).installationApi.updateInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error updating installation"),Ye(o,r)}}),errorMsg:n}};function dp(){const{projectIdOrName:e}=Ke(),{integrationNameOrId:t}=Jn(),{data:n}=hr(t),{installation:r}=ln(),i=Ze(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=up();return{updateInstallation:({config:p,onSuccess:h,onError:f,onSettled:m})=>{if(!r){const x=new Error("Installation not created yet. Try creating the installation first.");f?.(x),m?.();return}if(!n){const x=new Error("No integration found");f?.(x),m?.();return}const v=[];if(p?.write?.objects){const x=Object.keys(p.write.objects).length,g=Object.keys(r?.config?.content?.write?.objects||{}).length;(x>0||x===0&&g>0)&&v.push("config.content.write.objects")}if(p?.read?.objects){const x=Object.keys(p.read.objects);v.push(...x.map(g=>`config.content.read.objects.${g}`))}const y={projectIdOrName:e,integrationId:n?.id,installationId:r.id,installationUpdate:{updateMask:v,installation:{config:{content:p}}}};return o(y,{onSuccess:x=>{h?.(x)},onError:x=>{f?.(x)},onSettled:()=>{m?.(),i.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}const RI=()=>{const e=wt(),t=Ze(),[n,r]=w.useState(null);return{...Nn({mutationKey:["deleteInstallation"],mutationFn:async o=>(await e()).installationApi.deleteInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error deleting installation"),Ye(o,r)}}),errorMsg:n}};function AI(){const{projectIdOrName:e}=Ke(),{integrationNameOrId:t}=Jn(),{data:n}=hr(t),{installation:r}=ln(),i=Ze(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=RI();return{deleteInstallation:({onSuccess:p,onError:h,onSettled:f})=>{if(!r){const m=new Error("Installation not found. Not able to delete installation.");h?.(m),f?.();return}if(!n){const m=new Error("No integration found");h?.(m),f?.();return}return o({projectIdOrName:e,integrationId:n?.id,installationId:r.id},{onSuccess:()=>{p?.()},onError:m=>{h?.(m)},onSettled:()=>{f?.(),i.invalidateQueries({queryKey:["amp","installations"]}),i.invalidateQueries({queryKey:["amp","connections"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}function Va(){const[e,t]=w.useState(1);return{seed:e,reset:()=>{t(Math.random())}}}class Lo extends w.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Ampersand Error Boundary caught an error:",t),console.error("[Error Info]:",n),this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:d.jsx(ot,{message:this.state.error?.message||"Something went wrong. Please try again later."}):this.props.children}}const pp=e=>{const t=wt(),{provider:n}=st(),r=e||n;return pr({queryKey:["amp","providerInfo",r],queryFn:async()=>{if(!r)throw new Error("Provider not found");return(await t()).providerApi.getProvider({provider:r})},enabled:!!r})},ut=e=>{const t=pp(e),{data:n}=t,{provider:r}=st(),i=n&&SI(n?.name,n);return{...t,providerName:i,selectedProvider:e||r}};var Qt=(e=>(e[e.Connect=0]="Connect",e[e.SelectObjects=1]="SelectObjects",e[e.ConfigureObjects=2]="ConfigureObjects",e[e.Review=3]="Review",e[e.Success=4]="Success",e))(Qt||{});const FI={0:"Connect",1:"Select Objects",2:"Configure",3:"Review"},Nc=4;function PI(e,t){switch(t.type){case"SET_STEP":return{...e,currentStep:t.step};case"NEXT_STEP":return{...e,currentStep:Math.min(e.currentStep+1,4)};case"PREV_STEP":return{...e,currentStep:Math.max(e.currentStep-1,0)};case"SET_SELECTED_OBJECTS":return{...e,selectedObjects:t.objects,currentObjectIndex:0};case"SET_CURRENT_OBJECT_INDEX":return{...e,currentObjectIndex:t.index};case"NEXT_OBJECT":return{...e,currentObjectIndex:Math.min(e.currentObjectIndex+1,e.selectedObjects.length-1)};case"PREV_OBJECT":return{...e,currentObjectIndex:Math.max(e.currentObjectIndex-1,0)};case"SET_SUBMITTING":return{...e,isSubmitting:t.isSubmitting};case"SET_SUBMISSION_ERROR":return{...e,submissionError:t.error};default:return e}}const jI={currentStep:0,selectedObjects:[],currentObjectIndex:0,isSubmitting:!1,submissionError:null},fp=w.createContext(null);function MI({children:e}){const[t,n]=w.useReducer(PI,jI),r=w.useCallback(y=>n({type:"SET_STEP",step:y}),[]),i=w.useCallback(()=>n({type:"NEXT_STEP"}),[]),o=w.useCallback(()=>n({type:"PREV_STEP"}),[]),s=w.useCallback(y=>n({type:"SET_SELECTED_OBJECTS",objects:y}),[]),a=w.useCallback(()=>n({type:"NEXT_OBJECT"}),[]),l=w.useCallback(()=>n({type:"PREV_OBJECT"}),[]),c=w.useCallback(y=>n({type:"SET_CURRENT_OBJECT_INDEX",index:y}),[]),u=w.useCallback(y=>n({type:"SET_SUBMITTING",isSubmitting:y}),[]),p=w.useCallback(y=>n({type:"SET_SUBMISSION_ERROR",error:y}),[]),h=t.currentObjectIndex===0,f=t.currentObjectIndex===t.selectedObjects.length-1,m=t.selectedObjects[t.currentObjectIndex],v=w.useMemo(()=>({state:t,goToStep:r,nextStep:i,prevStep:o,setSelectedObjects:s,nextObject:a,prevObject:l,setCurrentObjectIndex:c,setSubmitting:u,setSubmissionError:p,isFirstObject:h,isLastObject:f,currentObjectName:m}),[t,r,i,o,s,a,l,c,u,p,h,f,m]);return d.jsx(fp.Provider,{value:v,children:e})}function un(){const e=w.useContext(fp);if(!e)throw new Error("useWizard must be used within a WizardProvider");return e}var as={exports:{}};var Tc;function DI(){return Tc||(Tc=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(as)),as.exports}var LI=DI();const Gt=$r(LI),BI="_button_kwfiu_1",$I="_danger_kwfiu_42",qI="_ghost_kwfiu_47",ls={button:BI,danger:$I,ghost:qI};function je({className:e,style:t,type:n,children:r,variant:i,...o}){const s=Gt(ls.button,{[ls.danger]:i==="danger",[ls.ghost]:i==="ghost",[e||""]:!!e});return d.jsx("button",{type:n,className:s,style:t,...o,children:r})}const VI="_navigation_oq8uj_1",UI="_backButton_oq8uj_10",zI="_nextButton_oq8uj_14",cs={navigation:VI,backButton:UI,nextButton:zI};function bo({onNext:e,onBack:t,nextLabel:n,backLabel:r="Back",nextDisabled:i=!1,showBack:o=!0,showNext:s=!0}){const{state:a,nextStep:l,prevStep:c}=un(),{currentStep:u}=a,p=t||c,h=e||l,f=u===Qt.Connect;return d.jsxs("div",{className:cs.navigation,children:[o&&!f?d.jsx(je,{type:"button",variant:"ghost",className:cs.backButton,onClick:p,children:r}):d.jsx("div",{}),s&&d.jsx(je,{type:"button",className:cs.nextButton,onClick:h,disabled:i,children:n||"Next"})]})}const KI="_input_1ymb7_1",HI="_inputError_1ymb7_27",us={input:KI,inputError:HI};function hp({id:e,type:t,className:n,isError:r=!1,...i}){const o=r?Gt(us.inputError,us.input):us.input;return d.jsx("input",{id:e,type:t,className:Gt(o,n),...i})}function kc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mp(...e){return t=>{let n=!1;const r=e.map(i=>{const o=kc(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():kc(e[i],null)}}}}function Rr(...e){return J.useCallback(mp(...e),e)}function Bo(e,t=[]){let n=[];function r(o,s){const a=J.createContext(s),l=n.length;n=[...n,s];const c=p=>{const{scope:h,children:f,...m}=p,v=h?.[e]?.[l]||a,y=J.useMemo(()=>m,Object.values(m));return d.jsx(v.Provider,{value:y,children:f})};c.displayName=o+"Provider";function u(p,h){const f=h?.[e]?.[l]||a,m=J.useContext(f);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>J.createContext(s));return function(a){const l=a?.[e]||o;return J.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,JI(i,...t)]}function JI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const p=l(o)[`__scope${c}`];return{...a,...p}},{});return J.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var bi=globalThis?.document?J.useLayoutEffect:()=>{},WI=J[" useInsertionEffect ".trim().toString()]||bi;function Ua({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=QI({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const u=J.useRef(e!==void 0);J.useEffect(()=>{const p=u.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=J.useCallback(u=>{if(a){const p=GI(u)?u(e):u;p!==e&&s.current?.(p)}else o(u)},[a,e,o,s]);return[l,c]}function QI({defaultProp:e,onChange:t}){const[n,r]=J.useState(e),i=J.useRef(n),o=J.useRef(t);return WI(()=>{o.current=t},[t]),J.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function GI(e){return typeof e=="function"}function XI(e){const t=J.useRef({value:e,previous:e});return J.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function YI(e){const[t,n]=J.useState(void 0);return bi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function ZI(e,t){return J.useReducer((n,r)=>t[n][r]??n,e)}var za=e=>{const{present:t,children:n}=e,r=eC(t),i=typeof n=="function"?n({present:r.isPresent}):J.Children.only(n),o=Rr(r.ref,tC(i));return typeof n=="function"||r.isPresent?J.cloneElement(i,{ref:o}):null};za.displayName="Presence";function eC(e){const[t,n]=J.useState(),r=J.useRef(null),i=J.useRef(e),o=J.useRef("none"),s=e?"mounted":"unmounted",[a,l]=ZI(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return J.useEffect(()=>{const c=Qi(r.current);o.current=a==="mounted"?c:"none"},[a]),bi(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Qi(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),bi(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,p=f=>{const v=Qi(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&v&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=f=>{f.target===t&&(o.current=Qi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:J.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Qi(e){return e?.animationName||"none"}function tC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ta(e){const t=nC(e),n=J.forwardRef((r,i)=>{const{children:o,...s}=r,a=J.Children.toArray(o),l=a.find(iC);if(l){const c=l.props.children,u=a.map(p=>p===l?J.Children.count(c)>1?J.Children.only(null):J.isValidElement(c)?c.props.children:null:p);return d.jsx(t,{...s,ref:i,children:J.isValidElement(c)?J.cloneElement(c,void 0,u):null})}return d.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function nC(e){const t=J.forwardRef((n,r)=>{const{children:i,...o}=n;if(J.isValidElement(i)){const s=sC(i),a=oC(o,i.props);return i.type!==J.Fragment&&(a.ref=r?mp(r,s):s),J.cloneElement(i,a)}return J.Children.count(i)>1?J.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rC=Symbol("radix.slottable");function iC(e){return J.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rC}function oC(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function sC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rn=aC.reduce((e,t)=>{const n=ta(`Primitive.${t}`),r=J.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),$o="Checkbox",[lC]=Bo($o),[cC,Ka]=lC($o);function uC(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:s,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:p}=e,[h,f]=Ua({prop:n,defaultProp:i??!1,onChange:l,caller:$o}),[m,v]=J.useState(null),[y,x]=J.useState(null),g=J.useRef(!1),b=m?!!s||!!m.closest("form"):!0,I={checked:h,disabled:o,setChecked:f,control:m,setControl:v,name:a,form:s,value:u,hasConsumerStoppedPropagationRef:g,required:c,defaultChecked:Vn(i)?!1:i,isFormControl:b,bubbleInput:y,setBubbleInput:x};return d.jsx(cC,{scope:t,...I,children:dC(p)?p(I):r})}var gp="CheckboxTrigger",yp=J.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:s,disabled:a,checked:l,required:c,setControl:u,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:f,bubbleInput:m}=Ka(gp,e),v=Rr(i,u),y=J.useRef(l);return J.useEffect(()=>{const x=o?.form;if(x){const g=()=>p(y.current);return x.addEventListener("reset",g),()=>x.removeEventListener("reset",g)}},[o,p]),d.jsx(Rn.button,{type:"button",role:"checkbox","aria-checked":Vn(l)?"mixed":l,"aria-required":c,"data-state":xp(l),"data-disabled":a?"":void 0,disabled:a,value:s,...r,ref:v,onKeyDown:rn(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:rn(n,x=>{p(g=>Vn(g)?!0:!g),m&&f&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});yp.displayName=gp;var Ha=J.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l,onCheckedChange:c,form:u,...p}=e;return d.jsx(uC,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:a,required:s,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:h})=>d.jsxs(d.Fragment,{children:[d.jsx(yp,{...p,ref:t,__scopeCheckbox:n}),h&&d.jsx(wp,{__scopeCheckbox:n})]})})});Ha.displayName=$o;var vp="CheckboxIndicator",Ja=J.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Ka(vp,n);return d.jsx(za,{present:r||Vn(o.checked)||o.checked===!0,children:d.jsx(Rn.span,{"data-state":xp(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});Ja.displayName=vp;var bp="CheckboxBubbleInput",wp=J.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:a,disabled:l,name:c,value:u,form:p,bubbleInput:h,setBubbleInput:f}=Ka(bp,e),m=Rr(n,f),v=XI(o),y=YI(r);J.useEffect(()=>{const g=h;if(!g)return;const b=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(b,"checked").set,_=!i.current;if(v!==o&&O){const R=new Event("click",{bubbles:_});g.indeterminate=Vn(o),O.call(g,Vn(o)?!1:o),g.dispatchEvent(R)}},[h,v,o,i]);const x=J.useRef(Vn(o)?!1:o);return d.jsx(Rn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??x.current,required:a,disabled:l,name:c,value:u,form:p,...t,tabIndex:-1,ref:m,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});wp.displayName=bp;function dC(e){return typeof e=="function"}function Vn(e){return e==="indeterminate"}function xp(e){return Vn(e)?"indeterminate":e?"checked":"unchecked"}function Vr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var pC=["color"],Ip=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,pC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),fC=["color"],Cp=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,fC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),hC=["color"],mC=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,hC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gC=["color"],Sp=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,gC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yC=["color"],vC=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,yC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bC=["color"],Wa=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Vr(e,bC);return w.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),w.createElement("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const wC="_checkboxGroupContainer_hqfeu_1",xC="_stack_hqfeu_6",IC="_selectAllContainer_hqfeu_10",CC="_fieldContainer_hqfeu_17",SC="_checkbox_hqfeu_1",Ar={checkboxGroupContainer:wC,stack:xC,selectAllContainer:IC,fieldContainer:CC,checkbox:SC};function OC({id:e,isChecked:t,label:n,onCheckedChange:r}){return d.jsxs("div",{className:Ar.fieldContainer,children:[d.jsx(Ha,{className:Ar.checkbox,id:e,onCheckedChange:r,checked:t,children:d.jsx(Ja,{children:d.jsx(Cp,{})})}),d.jsx("label",{htmlFor:e,style:{overflowWrap:"anywhere"},children:n})]})}function _C({id:e,isChecked:t,label:n,onCheckedChange:r,isIndeterminate:i}){return d.jsxs("div",{className:Ar.selectAllContainer,children:[d.jsx(Ha,{className:Ar.checkbox,id:e,onCheckedChange:r,checked:i?"indeterminate":t,children:d.jsxs(Ja,{children:[i&&d.jsx(mC,{}),t===!0&&d.jsx(Cp,{})]})}),d.jsx("label",{htmlFor:e,children:n})]})}function EC({children:e}){return d.jsx("div",{className:Ar.checkboxGroupContainer,children:e})}function NC({children:e}){return d.jsx("div",{className:Ar.stack,children:e})}const TC="_paginationContainer_1p51x_1",kC="_pageInfo_1p51x_7",RC="_searchContainer_1p51x_13",AC="_searchInput_1p51x_17",FC="_noResults_1p51x_21",Xr={paginationContainer:TC,pageInfo:kC,searchContainer:RC,searchInput:AC,noResults:FC};function Qa({items:e,onItemChange:t,itemsPerPage:n=8,showSelectAll:r=!0,showSearch:i=!0,searchPlaceholder:o="Search fields...",itemName:s="fields"}){const[a,l]=w.useState(1),[c,u]=w.useState(""),p=e.filter(I=>I.label.toLowerCase().includes(c.toLowerCase())),h=Math.ceil(p.length/n),f=(a-1)*n,m=f+n,v=p.slice(f,m),y=I=>{u(I),l(1)},x=I=>{p.forEach(O=>{t(O.id,I)})},g=p.length>0&&p.every(I=>I.isChecked),b=p.some(I=>I.isChecked);return d.jsxs(EC,{children:[i&&d.jsx("div",{className:Xr.searchContainer,children:d.jsx(hp,{id:"field-search",type:"text",placeholder:o,value:c,onChange:I=>y(I.target.value),className:Xr.searchInput})}),r&&e.length>=2&&d.jsx(_C,{id:"select-all-fields",isChecked:g,label:`Select all ${p.length} ${c?"matching ":""}${s}`,onCheckedChange:x,isIndeterminate:b&&!g}),d.jsx(NC,{children:v.map(I=>d.jsx(OC,{id:I.id,isChecked:I.isChecked,label:I.label,onCheckedChange:O=>t(I.id,O===!0)},I.id))}),h>1&&d.jsxs("div",{className:Xr.paginationContainer,children:[d.jsx(je,{type:"button",onClick:()=>l(I=>Math.max(1,I-1)),disabled:a===1,variant:"ghost",children:"<"}),d.jsxs("span",{className:Xr.pageInfo,children:[a," of ",h]}),d.jsx(je,{type:"button",onClick:()=>l(I=>Math.min(h,I+1)),disabled:a===h,variant:"ghost",children:">"})]}),p.length===0&&c&&d.jsxs("div",{className:Xr.noResults,children:["No ",s,' found matching "',c,'"']})]})}const PC="_sectionTitle_1e9ty_1",jC="_helperText_1e9ty_10",Rc={sectionTitle:PC,helperText:jC};function wo({title:e,description:t}){return d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:Rc.sectionTitle,children:e}),d.jsx("p",{className:Rc.helperText,children:t})]})}function MC({providerDisplayName:e,appName:t,optionalFieldItems:n,onItemChange:r}){return d.jsxs(d.Fragment,{children:[d.jsx(wo,{title:"Additional Fields",description:`Would you like to share any optional ${e} fields with ${t}?`}),d.jsx(Qa,{items:n,onItemChange:r})]})}function Op(e){return"fieldName"in e}function na(e){return Op(e)?e.fieldName:""}function _p(e){return Op(e)?e.displayName||e.fieldName:""}function DC(e,t){return qo(e,t)[0]}function Ac(e,t){const n=qo(e,t);return n[n.length-1]}function qo(e,t){const n=e.getReadObject(t);if(!n)return["fields"];const r=[],i=(n.getRequiredFields("no-mappings")?.length??0)>0,o=!!n.object?.mapToName;return(i||o)&&r.push("fields"),((n.getRequiredMapFields()?.length??0)>0||(n.getOptionalMapFields()?.length??0)>0)&&r.push("mappings"),(n.getOptionalFields("no-mappings")?.length??0)>0&&r.push("additional"),r.length>0?r:["fields"]}const LC="_configureObjects_1di5e_1",BC="_objectConfigPanel_1di5e_10",$C="_objectName_1di5e_18",qC="_objectDescription_1di5e_26",VC="_empty_1di5e_33",UC="_mappingDisabledInput_1di5e_47",zC="_mappingDisabledInputText_1di5e_62",nn={configureObjects:LC,objectConfigPanel:BC,objectName:$C,objectDescription:qC,empty:VC,mappingDisabledInput:UC,mappingDisabledInputText:zC},KC="_fieldSection_186dk_1",HC="_fieldCardGrid_186dk_6",JC="_fieldCard_186dk_6",WC="_fieldCardDisabled_186dk_29",QC="_fieldCardName_186dk_41",GC="_noFields_186dk_47",XC="_objectMappingInline_186dk_58",YC="_objectMappingArrow_186dk_65",Cn={fieldSection:KC,fieldCardGrid:HC,fieldCard:JC,fieldCardDisabled:WC,fieldCardName:QC,noFields:GC,objectMappingInline:XC,objectMappingArrow:YC};function ZC({objectDisplayName:e,providerDisplayName:t,appName:n,hasObjectMapping:r,objectMapToDisplayName:i,isMappingBidirectional:o,hasRequiredFields:s,requiredFields:a,hasFieldsContent:l}){return d.jsxs(d.Fragment,{children:[r&&d.jsxs("div",{className:Cn.fieldSection,children:[d.jsx(wo,{title:"Object Mapping",description:`This ${t} object is mapped to the corresponding ${n} object.`}),d.jsxs("div",{className:Cn.objectMappingInline,children:[d.jsx("div",{className:nn.mappingDisabledInput,children:d.jsx("span",{className:nn.mappingDisabledInputText,children:e})}),d.jsx("div",{className:Cn.objectMappingArrow,children:o?d.jsx(Wa,{}):d.jsx(Ip,{})}),d.jsx("div",{className:nn.mappingDisabledInput,children:d.jsx("span",{className:nn.mappingDisabledInputText,children:i})})]})]}),s&&d.jsxs("div",{className:Cn.fieldSection,children:[d.jsx(wo,{title:"Included Fields",description:"These fields are always read and require no configuration."}),d.jsx("div",{className:Cn.fieldCardGrid,children:a.map(c=>{const u=na(c),p=_p(c);return d.jsx("div",{className:`${Cn.fieldCard} ${Cn.fieldCardDisabled}`,children:d.jsx("span",{className:Cn.fieldCardName,children:p})},u)})})]}),!l&&d.jsxs("p",{className:Cn.noFields,children:["No configurable fields for ",e,"."]})]})}const eS="_trigger_1dvzj_1",tS="_tooltip_1dvzj_10",Fc={trigger:eS,tooltip:tS};function Ep({text:e}){return d.jsxs("span",{className:Fc.trigger,children:[d.jsx(vC,{}),d.jsx("span",{className:Fc.tooltip,children:e})]})}const nS="_mappingRow_7xcae_2",rS="_mappingField_7xcae_15",iS="_mappingSelect_7xcae_23",oS="_requiredAsterisk_7xcae_36",sS="_mappingArrow_7xcae_41",xr={mappingRow:nS,mappingField:rS,mappingSelect:iS,requiredAsterisk:oS,mappingArrow:sS};function Pc({objectName:e,mapping:t,required:n,bidirectional:r,customerFieldOptions:i,configHandlers:o}){const s=o.getFieldMapping(t.mapToName)??"";return d.jsxs("div",{className:xr.mappingRow,children:[d.jsx("div",{className:xr.mappingField,children:d.jsxs("select",{id:`mapping-${e}-${t.mapToName}`,className:xr.mappingSelect,value:s,onChange:a=>{const l=a.target.value;l?o.setFieldMapping({fieldName:l,mapToName:t.mapToName}):o.deleteFieldMapping(t.mapToName)},children:[d.jsx("option",{value:"",children:"Select a field..."}),i.map(a=>d.jsx("option",{value:a.fieldName,children:a.displayName},a.fieldName))]})}),d.jsx("div",{className:xr.mappingArrow,children:r?d.jsx(Wa,{}):d.jsx(Ip,{})}),d.jsx("div",{className:xr.mappingField,children:d.jsxs("div",{className:nn.mappingDisabledInput,children:[d.jsxs("span",{className:nn.mappingDisabledInputText,children:[t.mapToDisplayName??t.mapToName,n&&d.jsx("span",{className:xr.requiredAsterisk,children:"*"})]}),t.prompt&&d.jsx(Ep,{text:t.prompt})]})})]})}const aS="_mappingContent_pg19z_1",lS="_mappingColumnHeaders_pg19z_5",cS="_mappingColumnTitle_pg19z_13",uS="_mappingColumnArrow_pg19z_21",Yr={mappingContent:aS,mappingColumnHeaders:lS,mappingColumnTitle:cS,mappingColumnArrow:uS};function dS({objectName:e,providerDisplayName:t,appName:n,isMappingBidirectional:r,requiredMapFields:i,optionalMapFields:o,customerFieldOptions:s,configHandlers:a}){return d.jsxs(d.Fragment,{children:[d.jsx(wo,{title:"Field Mappings",description:`Map ${t} fields to the corresponding ${n} fields for read${r?" and write":""}.`}),d.jsxs("div",{className:Yr.mappingContent,children:[d.jsxs("div",{className:Yr.mappingColumnHeaders,children:[d.jsxs("span",{className:Yr.mappingColumnTitle,children:[t," Field"]}),d.jsx("span",{className:Yr.mappingColumnArrow}),d.jsxs("span",{className:Yr.mappingColumnTitle,children:[n," Field"]})]}),i.map(l=>d.jsx(Pc,{objectName:e,mapping:l,required:!0,bidirectional:r,customerFieldOptions:s,configHandlers:a},l.mapToName)),o.map(l=>d.jsx(Pc,{objectName:e,mapping:l,required:!1,bidirectional:r,customerFieldOptions:s,configHandlers:a},l.mapToName))]})]})}const pS="_objectTabs_bcy6q_1",fS="_objectTab_bcy6q_1",hS="_objectTabActive_bcy6q_34",mS="_objectTabLabel_bcy6q_38",gS="_objectTabDots_bcy6q_45",yS="_dot_bcy6q_50",vS="_dotComplete_bcy6q_56",bS="_dotActive_bcy6q_60",wS="_dotPending_bcy6q_64",Sn={objectTabs:pS,objectTab:fS,objectTabActive:hS,objectTabLabel:mS,objectTabDots:gS,dot:yS,dotComplete:vS,dotActive:bS,dotPending:wS};function xS({currentPageIndex:e,onTabClick:t}){const n=Tn(),{state:r}=un(),{selectedObjects:i,currentObjectIndex:o}=r,s=w.useMemo(()=>i.map((a,l)=>{const c=qo(n,a),u=n.getReadObject(a)?.object?.displayName||a,p=c.map((h,f)=>l<o?"complete":l===o?f<e?"complete":f===e?"active":"pending":"pending");return{objName:a,displayName:u,dots:p,objIndex:l}}),[i,n,o,e]);return d.jsx("div",{className:Sn.objectTabs,children:s.map(a=>d.jsxs("button",{type:"button",className:`${Sn.objectTab}${a.objIndex===o?` ${Sn.objectTabActive}`:""}`,disabled:a.objIndex>o,onClick:()=>t(a.objIndex),children:[d.jsx("span",{className:Sn.objectTabLabel,children:a.displayName}),d.jsx("span",{className:Sn.objectTabDots,children:a.dots.map((l,c)=>d.jsx("span",{className:`${Sn.dot} ${l==="complete"?Sn.dotComplete:l==="active"?Sn.dotActive:Sn.dotPending}`},c))})]},a.objName))})}function IS(){const e=Tn(),{state:t,isFirstObject:n,isLastObject:r,currentObjectName:i,nextObject:o,prevObject:s,nextStep:a,prevStep:l,setCurrentObjectIndex:c}=un(),{selectedObjects:u,currentObjectIndex:p}=t,[h,f]=w.useState("fields"),m=w.useRef(null),v=w.useRef(i);w.useEffect(()=>{i!==v.current&&(v.current=i,m.current!==null?(f(m.current),m.current=null):i&&f(DC(e,i)))},[i,e]);const y=w.useMemo(()=>i?e.getReadObject(i):null,[e,i]),x=w.useMemo(()=>{const A=y?.getRequiredMapFields()?.length??0,F=y?.getOptionalMapFields()?.length??0;return A>0||F>0},[y]),g=w.useMemo(()=>(y?.getOptionalFields("no-mappings")?.length??0)>0,[y]),b=w.useMemo(()=>{const A=(y?.getRequiredFields("no-mappings")?.length??0)>0,F=!!y?.object?.mapToName;return A||F},[y]),I=w.useCallback(()=>{if(h==="fields"){if(x){f("mappings");return}if(g){f("additional");return}}else if(h==="mappings"&&g){f("additional");return}r?a():o()},[h,x,g,r,a,o]),O=w.useCallback(()=>{if(h==="additional"){if(x){f("mappings");return}if(b){f("fields");return}}else if(h==="mappings"&&b){f("fields");return}if(n)l();else{const A=p-1,F=u[A];F&&(m.current=Ac(e,F)),s()}},[h,x,b,n,l,p,u,e,s]),R=w.useMemo(()=>i?qo(e,i):[],[e,i]).indexOf(h),k=w.useCallback(A=>{if(A>=p)return;const F=u[A];F&&(m.current=Ac(e,F)),c(A)},[p,u,e,c]);return{subPage:h,currentPageIndex:R,currentManifestObject:y,hasFieldsContent:b,handleNext:I,handleBack:O,handleTabClick:k}}function CS(){const e=Tn(),t=Mo(),{provider:n}=st(),{providerName:r}=ut(),{appName:i}=an(),{currentObjectName:o}=un(),{subPage:s,currentPageIndex:a,currentManifestObject:l,hasFieldsContent:c,handleNext:u,handleBack:p,handleTabClick:h}=IS(),f=w.useMemo(()=>l?.getRequiredFields("no-mappings")??[],[l]),m=w.useMemo(()=>l?.getOptionalFields("no-mappings")??[],[l]),v=w.useMemo(()=>l?.getRequiredMapFields()??[],[l]),y=w.useMemo(()=>l?.getOptionalMapFields()??[],[l]),x=w.useMemo(()=>o?e.getCustomerFieldsForObject(o).allFields??{}:{},[e,o]),g=f.length>0,b=l?.object?.mapToName,I=l?.object?.mapToDisplayName||b,O=!!b,_=!!o&&!!t.writeObject(o).object,R=w.useMemo(()=>o?t.readObject(o):null,[t,o]),k=w.useMemo(()=>Object.entries(x).map(([B,X])=>({fieldName:B,displayName:X.displayName||B})),[x]),A=w.useCallback((B,X)=>{R?.setSelectedField({fieldName:B,selected:X})},[R]),F=w.useMemo(()=>m.map(B=>({id:na(B),label:_p(B),isChecked:R?.getSelectedField(na(B))??!1})),[m,R]),j=w.useMemo(()=>v.every(B=>!!R?.getFieldMapping(B.mapToName)),[v,R]);if(!o||!l)return d.jsx("div",{className:nn.empty,children:"No objects to configure."});const L=l.object?.displayName||o,H=i||"Your App",P=r||n||"Provider";return d.jsxs("div",{className:nn.configureObjects,children:[d.jsx(xS,{currentPageIndex:a,onTabClick:h}),d.jsxs("div",{className:nn.objectConfigPanel,children:[d.jsx("h2",{className:nn.objectName,children:L}),d.jsxs("p",{className:nn.objectDescription,children:["Confirm which ",P," fields ",H," can read",_?" and write":"","."]}),s==="fields"&&d.jsx(ZC,{objectDisplayName:L,providerDisplayName:P,appName:H,hasObjectMapping:O,objectMapToDisplayName:I,isMappingBidirectional:_,hasRequiredFields:g,requiredFields:f,hasFieldsContent:c}),s==="mappings"&&R&&d.jsx(dS,{objectName:o,providerDisplayName:P,appName:H,isMappingBidirectional:_,requiredMapFields:v,optionalMapFields:y,customerFieldOptions:k,configHandlers:R}),s==="additional"&&d.jsx(MC,{providerDisplayName:P,appName:H,optionalFieldItems:F,onItemChange:A})]}),d.jsx(bo,{onBack:p,onNext:u,backLabel:"Back",nextLabel:"Next",nextDisabled:s==="mappings"&&!j})]})}function SS(){const{state:e,goToStep:t}=un();return w.useEffect(()=>{e.selectedObjects.length===0&&t(Qt.SelectObjects)},[e.selectedObjects.length,t]),e.selectedObjects.length===0?null:d.jsx(CS,{})}function Np(){return d.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("circle",{cx:"24",cy:"24",r:"24",fill:"#BBF7D0"}),d.jsx("path",{d:"M34.6666 18.6667L20 32.0001L13.3333 25.9395",stroke:"#16A34A",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ga({text:e,children:t}){return d.jsx(qr,{children:d.jsxs(kn,{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"3rem",gap:"3rem"},children:[d.jsx(Np,{}),d.jsx("p",{children:e}),t]})})}const OS={backgroundColor:"var(--amp-colors-status-critical-muted)",borderColor:"var(--amp-colors-status-critical-muted)",color:"var(--amp-colors-status-critical-dark)",padding:".5rem 1rem"};function Oi({children:e,style:t}){return d.jsx(kn,{style:{...OS,...t},children:e})}function bn({error:e}){return e?d.jsx(Oi,{style:{marginTop:"2em"},children:e}):null}function _S(){return d.jsx("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsxs("g",{opacity:"0.5",children:[d.jsx("path",{d:"M14.2821 11.0004C14.2821 12.8154 12.8154 14.2821 11.0004 14.2821C9.18542 14.2821 7.71875 12.8154 7.71875 11.0004C7.71875 9.18542 9.18542 7.71875 11.0004 7.71875C12.8154 7.71875 14.2821 9.18542 14.2821 11.0004Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M10.9999 18.581C14.2357 18.581 17.2515 16.6743 19.3507 13.3743C20.1757 12.0818 20.1757 9.90932 19.3507 8.61682C17.2515 5.31682 14.2357 3.41016 10.9999 3.41016C7.76402 3.41016 4.74819 5.31682 2.64902 8.61682C1.82402 9.90932 1.82402 12.0818 2.64902 13.3743C4.74819 16.6743 7.76402 18.581 10.9999 18.581Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function ES(){return d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[d.jsx("path",{d:"M13.3187 8.68036L8.68036 13.3187C8.06528 12.7036 7.71973 11.8694 7.71973 10.9995C7.71973 10.5688 7.80456 10.1423 7.96939 9.7444C8.13421 9.34648 8.3758 8.98491 8.68036 8.68036C8.98491 8.3758 9.34648 8.13421 9.7444 7.96939C10.1423 7.80456 10.5688 7.71973 10.9995 7.71973C11.8694 7.71973 12.7036 8.06528 13.3187 8.68036Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M16.3349 5.28895C14.7307 4.07895 12.8974 3.41895 10.9999 3.41895C7.76402 3.41895 4.74819 5.32561 2.64902 8.62561C1.82402 9.91811 1.82402 12.0906 2.64902 13.3831C3.37319 14.5198 4.21652 15.5006 5.13319 16.2889M7.71819 17.9023C8.76319 18.3423 9.87236 18.5806 10.9999 18.5806C14.2357 18.5806 17.2515 16.6739 19.3507 13.3739C20.1757 12.0814 20.1757 9.90895 19.3507 8.61645C19.0482 8.13978 18.7182 7.69061 18.379 7.26895",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M14.2172 11.6413C14.093 12.2808 13.7806 12.8685 13.32 13.3291C12.8594 13.7897 12.2716 14.1022 11.6322 14.2263M8.68051 13.3188L1.83301 20.1663M20.1663 1.83301L13.3188 8.68051",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function NS({id:e,name:t,placeholder:n="Password",onChange:r,value:i,className:o,isError:s}){const[a,l]=w.useState(!1),c=()=>l(u=>!u);return d.jsxs("div",{style:{display:"flex",gap:".5rem"},children:[d.jsx(En.Input,{id:e,name:t,type:a?"text":"password",placeholder:n,onChange:r,value:i,className:o,isError:s}),d.jsx(je,{type:"button","aria-label":a?"Hide password":"Show password",style:{height:"2.5rem",width:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"},onClick:c,variant:"ghost",children:d.jsx("span",{style:{height:"1.5rem",width:"1.5rem"},children:a?d.jsx(ES,{}):d.jsx(_S,{})})})]})}const TS="_textarea_18zl4_1",kS="_textareaError_18zl4_14",ds={textarea:TS,textareaError:kS};function RS({className:e,isError:t=!1,...n}){const r=t?Gt(ds.textareaError,ds.textarea):ds.textarea;return d.jsx("textarea",{className:Gt(e,r),...n})}const En={Input:hp,Textarea:RS,PasswordInput:NS},AS=()=>{const{projectIdOrName:e}=Ke(),t=wt();return pr({queryKey:["project",e,"entitlements"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return(await t()).projectApi.getProject({projectIdOrName:e,includeEntitlements:!0})},enabled:!!e})};function Tp(){const{data:e}=AS();return e?.entitlements?.brandingRemoval?.value===!0?null:d.jsxs("footer",{style:{backgroundColor:"light-dark(#EFEFEF, #646266)",padding:"1em",fontSize:"0.8em",color:"gray",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"0 0 4px 4px",gap:"0.4em"},children:[d.jsx("p",{style:{color:"light-dark(gray, #EFEFEF)"},children:"Secured by"}),d.jsx("a",{href:"https://www.withampersand.com/",target:"_blank","aria-label":"Go to Ampersand",rel:"noreferrer noopener",children:d.jsx("img",{style:{height:".8em"},src:"https://res.cloudinary.com/dycvts6vp/image/upload/v1723671980/ampersand-logo-black.svg",alt:"Ampersand"})})]})}function Wn({children:e}){return d.jsx(qr,{children:d.jsxs(kn,{children:[d.jsx("div",{style:{padding:"3rem 2rem"},children:e}),d.jsx(Tp,{})]})})}function Qn({children:e}){return d.jsx("h1",{style:{fontWeight:600,lineHeight:1.2,fontSize:"1.2em"},children:e})}function FS({children:e}){return d.jsx("p",{style:{padding:".5em 0"},children:e})}const PS="_link_oo2kv_1",jS={link:PS};function kp({href:e,className:t,style:n,label:r,children:i,newTab:o=!1}){return d.jsx("a",{className:Gt(jS.link,t),style:n,href:e,"aria-label":r||void 0,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,children:i})}function MS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const DS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BS={};function jc(e,t){return(BS.jsx?LS:DS).test(e)}const $S=/[ \t\n\f\r]/g;function qS(e){return typeof e=="object"?e.type==="text"?Mc(e.value):!1:Mc(e)}function Mc(e){return e.replace($S,"")===""}class _i{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_i.prototype.normal={};_i.prototype.property={};_i.prototype.space=void 0;function Rp(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new _i(n,r,t)}function ra(e){return e.toLowerCase()}class Ft{constructor(t,n){this.attribute=n,this.property=t}}Ft.prototype.attribute="";Ft.prototype.booleanish=!1;Ft.prototype.boolean=!1;Ft.prototype.commaOrSpaceSeparated=!1;Ft.prototype.commaSeparated=!1;Ft.prototype.defined=!1;Ft.prototype.mustUseProperty=!1;Ft.prototype.number=!1;Ft.prototype.overloadedBoolean=!1;Ft.prototype.property="";Ft.prototype.spaceSeparated=!1;Ft.prototype.space=void 0;let VS=0;const be=gr(),Xe=gr(),ia=gr(),Q=gr(),Le=gr(),_r=gr(),jt=gr();function gr(){return 2**++VS}const oa=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:Xe,commaOrSpaceSeparated:jt,commaSeparated:_r,number:Q,overloadedBoolean:ia,spaceSeparated:Le},Symbol.toStringTag,{value:"Module"})),ps=Object.keys(oa);class Xa extends Ft{constructor(t,n,r,i){let o=-1;if(super(t,n),Dc(this,"space",i),typeof r=="number")for(;++o<ps.length;){const s=ps[o];Dc(this,ps[o],(r&oa[s])===oa[s])}}}Xa.prototype.defined=!0;function Dc(e,t,n){n&&(e[t]=n)}function Ur(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Xa(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ra(r)]=r,n[ra(o.attribute)]=r}return new _i(t,n,e.space)}const Ap=Ur({properties:{ariaActiveDescendant:null,ariaAtomic:Xe,ariaAutoComplete:null,ariaBusy:Xe,ariaChecked:Xe,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Le,ariaCurrent:null,ariaDescribedBy:Le,ariaDetails:null,ariaDisabled:Xe,ariaDropEffect:Le,ariaErrorMessage:null,ariaExpanded:Xe,ariaFlowTo:Le,ariaGrabbed:Xe,ariaHasPopup:null,ariaHidden:Xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Le,ariaLevel:Q,ariaLive:null,ariaModal:Xe,ariaMultiLine:Xe,ariaMultiSelectable:Xe,ariaOrientation:null,ariaOwns:Le,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Xe,ariaReadOnly:Xe,ariaRelevant:null,ariaRequired:Xe,ariaRoleDescription:Le,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Xe,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Fp(e,t){return t in e?e[t]:t}function Pp(e,t){return Fp(e,t.toLowerCase())}const US=Ur({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_r,acceptCharset:Le,accessKey:Le,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Le,autoFocus:be,autoPlay:be,blocking:Le,capture:null,charSet:null,checked:be,cite:null,className:Le,cols:Q,colSpan:null,content:null,contentEditable:Xe,controls:be,controlsList:Le,coords:Q|_r,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:ia,draggable:Xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Le,height:Q,hidden:ia,high:Q,href:null,hrefLang:null,htmlFor:Le,httpEquiv:Le,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Le,itemRef:Le,itemScope:be,itemType:Le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:Q,pattern:null,ping:Le,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Le,required:be,reversed:be,rows:Q,rowSpan:Q,sandbox:Le,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Xe,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Le,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Xe,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:Pp}),zS=Ur({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:jt,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_r,g2:_r,glyphName:_r,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:jt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jt,rev:jt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jt,requiredFeatures:jt,requiredFonts:jt,requiredFormats:jt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:jt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jt,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Fp}),jp=Ur({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Mp=Ur({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pp}),Dp=Ur({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),KS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},HS=/[A-Z]/g,Lc=/-[a-z]/g,JS=/^data[-\w.:]+$/i;function WS(e,t){const n=ra(t);let r=t,i=Ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&JS.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Lc,GS);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Lc.test(o)){let s=o.replace(HS,QS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Xa}return new i(r,t)}function QS(e){return"-"+e.toLowerCase()}function GS(e){return e.charAt(1).toUpperCase()}const XS=Rp([Ap,US,jp,Mp,Dp],"html"),Ya=Rp([Ap,zS,jp,Mp,Dp],"svg");function YS(e){return e.join(" ").trim()}var Ir={},fs,Bc;function ZS(){if(Bc)return fs;Bc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
7
7
|
`,c="/",u="*",p="",h="comment",f="declaration";function m(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var g=1,b=1;function I(P){var B=P.match(t);B&&(g+=B.length);var X=P.lastIndexOf(l);b=~X?P.length-X:b+P.length}function O(){var P={line:g,column:b};return function(B){return B.position=new _(P),A(),B}}function _(P){this.start=P,this.end={line:g,column:b},this.source=x.source}_.prototype.content=y;function R(P){var B=new Error(x.source+":"+g+":"+b+": "+P);if(B.reason=P,B.filename=x.source,B.line=g,B.column=b,B.source=y,!x.silent)throw B}function k(P){var B=P.exec(y);if(B){var X=B[0];return I(X),y=y.slice(X.length),B}}function A(){k(n)}function F(P){var B;for(P=P||[];B=j();)B!==!1&&P.push(B);return P}function j(){var P=O();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var B=2;p!=y.charAt(B)&&(u!=y.charAt(B)||c!=y.charAt(B+1));)++B;if(B+=2,p===y.charAt(B-1))return R("End of comment missing");var X=y.slice(2,B-2);return b+=2,I(X),y=y.slice(B),b+=2,P({type:h,comment:X})}}function L(){var P=O(),B=k(r);if(B){if(j(),!k(i))return R("property missing ':'");var X=k(o),le=P({type:f,property:v(B[0].replace(e,p)),value:X?v(X[0].replace(e,p)):p});return k(s),le}}function H(){var P=[];F(P);for(var B;B=L();)B!==!1&&(P.push(B),F(P));return P}return A(),H()}function v(y){return y?y.replace(a,p):p}return fs=m,fs}var $c;function e0(){if($c)return Ir;$c=1;var e=Ir&&Ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.default=n;const t=e(ZS());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),a=typeof i=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?i(c,u,l):u&&(o=o||{},o[c]=u)}),o}return Ir}var Zr={},qc;function t0(){if(qc)return Zr;qc=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,s))};return Zr.camelCase=l,Zr}var ei,Vc;function n0(){if(Vc)return ei;Vc=1;var e=ei&&ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(e0()),n=t0();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(s[(0,n.camelCase)(a,o)]=l)}),s}return r.default=r,ei=r,ei}var r0=n0();const i0=$r(r0),Lp=Bp("end"),Za=Bp("start");function Bp(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function o0(e){const t=Za(e),n=Lp(e);if(t&&n)return{start:t,end:n}}function li(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uc(e.position):"start"in e||"end"in e?Uc(e):"line"in e||"column"in e?sa(e):""}function sa(e){return zc(e&&e.line)+":"+zc(e&&e.column)}function Uc(e){return sa(e&&e.start)+"-"+sa(e&&e.end)}function zc(e){return e&&typeof e=="number"?e:1}class xt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=li(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xt.prototype.file="";xt.prototype.name="";xt.prototype.reason="";xt.prototype.message="";xt.prototype.stack="";xt.prototype.column=void 0;xt.prototype.line=void 0;xt.prototype.ancestors=void 0;xt.prototype.cause=void 0;xt.prototype.fatal=void 0;xt.prototype.place=void 0;xt.prototype.ruleId=void 0;xt.prototype.source=void 0;const el={}.hasOwnProperty,s0=new Map,a0=/[A-Z]/g,l0=new Set(["table","tbody","thead","tfoot","tr"]),c0=new Set(["td","th"]),$p="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function u0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=v0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=y0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ya:XS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=qp(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function qp(e,t,n){if(t.type==="element")return d0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return p0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return h0(e,t,n);if(t.type==="mdxjsEsm")return f0(e,t);if(t.type==="root")return m0(e,t,n);if(t.type==="text")return g0(e,t)}function d0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ya,e.schema=i),e.ancestors.push(t);const o=Up(e,t.tagName,!1),s=b0(e,t);let a=nl(e,t);return l0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!qS(l):!0})),Vp(e,s,o,t),tl(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function p0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}wi(e,t.position)}function f0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wi(e,t.position)}function h0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ya,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Up(e,t.name,!0),s=w0(e,t),a=nl(e,t);return Vp(e,s,o,t),tl(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function m0(e,t,n){const r={};return tl(r,nl(e,t)),e.create(t,e.Fragment,r,n)}function g0(e,t){return t.value}function Vp(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function y0(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function v0(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Za(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function b0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&el.call(t.properties,i)){const o=x0(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&c0.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function w0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else wi(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else wi(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function nl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:s0;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=qp(e,o,s);a!==void 0&&n.push(a)}return n}function x0(e,t,n){const r=WS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?MS(n):YS(n)),r.property==="style"){let i=typeof n=="object"?n:I0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=C0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?KS[r.property]||r.property:r.attribute,n]}}function I0(e,t){try{return i0(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=$p+"#cannot-parse-style-attribute",i}}function Up(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=jc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=jc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return el.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);wi(e)}function wi(e,t){const n=new xt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$p+"#cannot-handle-mdx-estrees-without-createevaluater",n}function C0(e){const t={};let n;for(n in e)el.call(e,n)&&(t[S0(n)]=e[n]);return t}function S0(e){let t=e.replace(a0,O0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function O0(e){return"-"+e.toLowerCase()}const hs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_0={};function E0(e,t){const n=_0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zp(e,r,i)}function zp(e,t,n){if(N0(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kc(e.children,t,n)}return Array.isArray(e)?Kc(e,t,n):""}function Kc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=zp(e[i],t,n);return r.join("")}function N0(e){return!!(e&&typeof e=="object")}const Hc=document.createElement("i");function rl(e){const t="&"+e+";";Hc.innerHTML=t;const n=Hc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Wt(e,t){return e.length>0?(gn(e,e.length,0,t),e):t}const Jc={}.hasOwnProperty;function T0(e){const t={};let n=-1;for(;++n<e.length;)k0(t,e[n]);return t}function k0(e,t){let n;for(n in t){const i=(Jc.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Jc.call(i,s)||(i[s]=[]);const a=o[s];R0(i[s],Array.isArray(a)?a:a?[a]:[])}}}function R0(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gn(e,0,0,r)}function Kp(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Er(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Gn(/[A-Za-z]/),Dt=Gn(/[\dA-Za-z]/),A0=Gn(/[#-'*+\--9=?A-Z^-~]/);function aa(e){return e!==null&&(e<32||e===127)}const la=Gn(/\d/),F0=Gn(/[\dA-Fa-f]/),P0=Gn(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function Ee(e){return e===-2||e===-1||e===32}const j0=Gn(new RegExp("\\p{P}|\\p{S}","u")),M0=Gn(/\s/);function Gn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Dt(e.charCodeAt(n+1))&&Dt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ee(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ee(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const D0={tokenize:L0};function L0(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Be(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return he(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const B0={tokenize:$0},Wc={tokenize:q0};function $0(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&g();const I=t.events.length;let O=I,_;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){_=t.events[O][1].end;break}x(r);let R=I;for(;R<t.events.length;)t.events[R][1].end={..._},R++;return gn(t.events,O+1,0,t.events.slice(I)),t.events.length=R,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wc,u,p)(b)}function u(b){return i&&g(),x(r),h(b)}function p(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(Wc,f,m)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&g(),x(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(b)}function v(b){if(b===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(b);return}return he(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),v)}function y(b,I){const O=t.sliceStream(b);if(I&&O.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(O),t.parser.lazy[b.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const R=t.events.length;let k=R,A,F;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(A){F=t.events[k][1].end;break}A=!0}for(x(r),_=R;_<t.events.length;)t.events[_][1].end={...F},_++;gn(t.events,k+1,0,t.events.slice(R)),t.events.length=_}}function x(b){let I=n.length;for(;I-- >b;){const O=n[I];t.containerState=O[1],O[0].exit.call(t,e)}n.length=b}function g(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function q0(e,t,n){return Be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qc(e){if(e===null||At(e)||M0(e))return 1;if(j0(e))return 2}function il(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ca={name:"attention",resolveAll:V0,tokenize:U0};function V0(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},h={...e[n][1].start};Gc(p,-l),Gc(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Wt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Wt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Wt(c,il(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Wt(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Wt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,gn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function U0(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Qc(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Qc(l),p=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?p:p&&(i||!h)),c._close=!!(o===42?h:h&&(u||!p)),t(l)}}function Gc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const z0={name:"autolink",tokenize:K0};function K0(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return hn(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||Dt(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||Dt(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||aa(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):A0(f)?(e.consume(f),c):n(f)}function u(f){return Dt(f)?p(f):n(f)}function p(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Dt(f))&&r++<63){const m=f===45?h:p;return e.consume(f),m}return n(f)}}const Vo={partial:!0,tokenize:H0};function H0(e,t,n){return r;function r(o){return Ee(o)?Be(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||he(o)?t(o):n(o)}}const Hp={continuation:{tokenize:W0},exit:Q0,name:"blockQuote",tokenize:J0};function J0(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Ee(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function W0(e,t,n){const r=this;return i;function i(s){return Ee(s)?Be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Hp,t,n)(s)}}function Q0(e){e.exit("blockQuote")}const Jp={name:"characterEscape",tokenize:G0};function G0(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return P0(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Wp={name:"characterReference",tokenize:X0};function X0(e,t,n){const r=this;let i=0,o,s;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),l}function l(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Dt,u(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=F0,u):(e.enter("characterReferenceValue"),o=7,s=la,u(p))}function u(p){if(p===59&&i){const h=e.exit("characterReferenceValue");return s===Dt&&!rl(r.sliceSerialize(h))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&i++<o?(e.consume(p),u):n(p)}}const Xc={partial:!0,tokenize:Z0},Yc={concrete:!0,name:"codeFenced",tokenize:Y0};function Y0(e,t,n){const r=this,i={partial:!0,tokenize:O};let o=0,s=0,a;return l;function l(_){return c(_)}function c(_){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(s++,e.consume(_),u):s<3?n(_):(e.exit("codeFencedFenceSequence"),Ee(_)?Be(e,p,"whitespace")(_):p(_))}function p(_){return _===null||he(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Xc,v,I)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||he(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(_)):Ee(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Be(e,f,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),h)}function f(_){return _===null||he(_)?p(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||he(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(_)):_===96&&_===a?n(_):(e.consume(_),m)}function v(_){return e.attempt(i,I,y)(_)}function y(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),x}function x(_){return o>0&&Ee(_)?Be(e,g,"linePrefix",o+1)(_):g(_)}function g(_){return _===null||he(_)?e.check(Xc,v,I)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||he(_)?(e.exit("codeFlowValue"),g(_)):(e.consume(_),b)}function I(_){return e.exit("codeFenced"),t(_)}function O(_,R,k){let A=0;return F;function F(B){return _.enter("lineEnding"),_.consume(B),_.exit("lineEnding"),j}function j(B){return _.enter("codeFencedFence"),Ee(B)?Be(_,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):L(B)}function L(B){return B===a?(_.enter("codeFencedFenceSequence"),H(B)):k(B)}function H(B){return B===a?(A++,_.consume(B),H):A>=s?(_.exit("codeFencedFenceSequence"),Ee(B)?Be(_,P,"whitespace")(B):P(B)):k(B)}function P(B){return B===null||he(B)?(_.exit("codeFencedFence"),R(B)):k(B)}}}function Z0(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ms={name:"codeIndented",tokenize:tO},eO={partial:!0,tokenize:nO};function tO(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Be(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):he(c)?e.attempt(eO,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||he(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function nO(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Be(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):he(s)?i(s):n(s)}}const rO={name:"codeText",previous:oO,resolve:iO,tokenize:sO};function iO(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function oO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sO(e,t,n){let r=0,i,o;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),a(p)}function a(p){return p===96?(e.consume(p),r++,a):(e.exit("codeTextSequence"),l(p))}function l(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),l):p===96?(o=e.enter("codeTextSequence"),i=0,u(p)):he(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||he(p)?(e.exit("codeTextData"),l(p)):(e.consume(p),c)}function u(p){return p===96?(e.consume(p),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",c(p))}}class aO{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ti(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ti(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ti(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ti(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ti(this.left,n.reverse())}}}function ti(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Qp(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new aO(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lO(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return gn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function lO(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,p,h=-1,f=n,m=0,v=0;const y=[v];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),p&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(v=h+1,y.push(v),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),g=o.pop();l.push([g,g+x.length-1]),e.splice(g,2,x)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const cO={resolve:dO,tokenize:pO},uO={partial:!0,tokenize:fO};function dO(e){return Qp(e),e}function pO(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):he(a)?e.check(uO,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function fO(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Be(e,o,"linePrefix")}function o(s){if(s===null||he(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Gp(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return p;function p(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),h):x===null||x===32||x===41||aa(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(x))}function h(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(x))}function f(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||he(x)?n(x):(e.consume(x),x===92?m:f)}function m(x){return x===60||x===62||x===92?(e.consume(x),f):f(x)}function v(x){return!u&&(x===null||x===41||At(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,v):x===41?(e.consume(x),u--,v):x===null||x===32||x===40||aa(x)?n(x):(e.consume(x),x===92?y:v)}function y(x){return x===40||x===41||x===92?(e.consume(x),v):v(x)}}function Xp(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||he(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Ee(f)),f===92?h:p)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,p):p(f)}}function Yp(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),l(s)):h===null?n(h):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Be(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||he(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?p:u)}function p(h){return h===s||h===92?(e.consume(h),u):u(h)}}function ci(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ee(i)?Be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const hO={name:"definition",tokenize:gO},mO={partial:!0,tokenize:yO};function gO(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return Xp.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Er(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return At(f)?ci(e,c)(f):c(f)}function c(f){return Gp(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(mO,p,p)(f)}function p(f){return Ee(f)?Be(e,h,"whitespace")(f):h(f)}function h(f){return f===null||he(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function yO(e,t,n){return r;function r(a){return At(a)?ci(e,i)(a):n(a)}function i(a){return Yp(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ee(a)?Be(e,s,"whitespace")(a):s(a)}function s(a){return a===null||he(a)?t(a):n(a)}}const vO={name:"hardBreakEscape",tokenize:bO};function bO(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return he(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const wO={name:"headingAtx",resolve:xO,tokenize:IO};function xO(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function IO(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||At(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||he(u)?(e.exit("atxHeading"),t(u)):Ee(u)?Be(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||At(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const CO=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zc=["pre","script","style","textarea"],SO={concrete:!0,name:"htmlFlow",resolveTo:EO,tokenize:NO},OO={partial:!0,tokenize:kO},_O={partial:!0,tokenize:TO};function EO(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function NO(e,t,n){const r=this;let i,o,s,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),p}function p(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,v):S===63?(e.consume(S),i=3,r.interrupt?t:C):hn(S)?(e.consume(S),s=String.fromCharCode(S),y):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,m):hn(S)?(e.consume(S),i=4,r.interrupt?t:C):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:C):n(S)}function m(S){const U="CDATA[";return S===U.charCodeAt(a++)?(e.consume(S),a===U.length?r.interrupt?t:L:m):n(S)}function v(S){return hn(S)?(e.consume(S),s=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||At(S)){const U=S===47,V=s.toLowerCase();return!U&&!o&&Zc.includes(V)?(i=1,r.interrupt?t(S):L(S)):CO.includes(s.toLowerCase())?(i=6,U?(e.consume(S),x):r.interrupt?t(S):L(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?g(S):b(S))}return S===45||Dt(S)?(e.consume(S),s+=String.fromCharCode(S),y):n(S)}function x(S){return S===62?(e.consume(S),r.interrupt?t:L):n(S)}function g(S){return Ee(S)?(e.consume(S),g):F(S)}function b(S){return S===47?(e.consume(S),F):S===58||S===95||hn(S)?(e.consume(S),I):Ee(S)?(e.consume(S),b):F(S)}function I(S){return S===45||S===46||S===58||S===95||Dt(S)?(e.consume(S),I):O(S)}function O(S){return S===61?(e.consume(S),_):Ee(S)?(e.consume(S),O):b(S)}function _(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,R):Ee(S)?(e.consume(S),_):k(S)}function R(S){return S===l?(e.consume(S),l=null,A):S===null||he(S)?n(S):(e.consume(S),R)}function k(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||At(S)?O(S):(e.consume(S),k)}function A(S){return S===47||S===62||Ee(S)?b(S):n(S)}function F(S){return S===62?(e.consume(S),j):n(S)}function j(S){return S===null||he(S)?L(S):Ee(S)?(e.consume(S),j):n(S)}function L(S){return S===45&&i===2?(e.consume(S),X):S===60&&i===1?(e.consume(S),le):S===62&&i===4?(e.consume(S),W):S===63&&i===3?(e.consume(S),C):S===93&&i===5?(e.consume(S),ge):he(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(OO,$,H)(S)):S===null||he(S)?(e.exit("htmlFlowData"),H(S)):(e.consume(S),L)}function H(S){return e.check(_O,P,$)(S)}function P(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return S===null||he(S)?H(S):(e.enter("htmlFlowData"),L(S))}function X(S){return S===45?(e.consume(S),C):L(S)}function le(S){return S===47?(e.consume(S),s="",fe):L(S)}function fe(S){if(S===62){const U=s.toLowerCase();return Zc.includes(U)?(e.consume(S),W):L(S)}return hn(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),fe):L(S)}function ge(S){return S===93?(e.consume(S),C):L(S)}function C(S){return S===62?(e.consume(S),W):S===45&&i===2?(e.consume(S),C):L(S)}function W(S){return S===null||he(S)?(e.exit("htmlFlowData"),$(S)):(e.consume(S),W)}function $(S){return e.exit("htmlFlow"),t(S)}}function TO(e,t,n){const r=this;return i;function i(s){return he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function kO(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Vo,t,n)}}const RO={name:"htmlText",tokenize:AO};function AO(e,t,n){const r=this;let i,o,s;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),l}function l(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),O):C===63?(e.consume(C),b):hn(C)?(e.consume(C),k):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),o=0,m):hn(C)?(e.consume(C),g):n(C)}function u(C){return C===45?(e.consume(C),f):n(C)}function p(C){return C===null?n(C):C===45?(e.consume(C),h):he(C)?(s=p,le(C)):(e.consume(C),p)}function h(C){return C===45?(e.consume(C),f):p(C)}function f(C){return C===62?X(C):C===45?h(C):p(C)}function m(C){const W="CDATA[";return C===W.charCodeAt(o++)?(e.consume(C),o===W.length?v:m):n(C)}function v(C){return C===null?n(C):C===93?(e.consume(C),y):he(C)?(s=v,le(C)):(e.consume(C),v)}function y(C){return C===93?(e.consume(C),x):v(C)}function x(C){return C===62?X(C):C===93?(e.consume(C),x):v(C)}function g(C){return C===null||C===62?X(C):he(C)?(s=g,le(C)):(e.consume(C),g)}function b(C){return C===null?n(C):C===63?(e.consume(C),I):he(C)?(s=b,le(C)):(e.consume(C),b)}function I(C){return C===62?X(C):b(C)}function O(C){return hn(C)?(e.consume(C),_):n(C)}function _(C){return C===45||Dt(C)?(e.consume(C),_):R(C)}function R(C){return he(C)?(s=R,le(C)):Ee(C)?(e.consume(C),R):X(C)}function k(C){return C===45||Dt(C)?(e.consume(C),k):C===47||C===62||At(C)?A(C):n(C)}function A(C){return C===47?(e.consume(C),X):C===58||C===95||hn(C)?(e.consume(C),F):he(C)?(s=A,le(C)):Ee(C)?(e.consume(C),A):X(C)}function F(C){return C===45||C===46||C===58||C===95||Dt(C)?(e.consume(C),F):j(C)}function j(C){return C===61?(e.consume(C),L):he(C)?(s=j,le(C)):Ee(C)?(e.consume(C),j):A(C)}function L(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,H):he(C)?(s=L,le(C)):Ee(C)?(e.consume(C),L):(e.consume(C),P)}function H(C){return C===i?(e.consume(C),i=void 0,B):C===null?n(C):he(C)?(s=H,le(C)):(e.consume(C),H)}function P(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||At(C)?A(C):(e.consume(C),P)}function B(C){return C===47||C===62||At(C)?A(C):n(C)}function X(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function le(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),fe}function fe(C){return Ee(C)?Be(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ge(C)}function ge(C){return e.enter("htmlTextData"),s(C)}}const ol={name:"labelEnd",resolveAll:MO,resolveTo:DO,tokenize:LO},FO={tokenize:BO},PO={tokenize:$O},jO={tokenize:qO};function MO(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&gn(e,0,e.length,n),e}function DO(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Wt(a,e.slice(o+1,o+r+3)),a=Wt(a,[["enter",u,t]]),a=Wt(a,il(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Wt(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Wt(a,e.slice(s+1)),a=Wt(a,[["exit",l,t]]),gn(e,o,e.length,a),e}function LO(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?p(h):(s=r.parser.defined.includes(Er(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(FO,u,s?u:p)(h):h===91?e.attempt(PO,u,s?c:p)(h):s?u(h):p(h)}function c(h){return e.attempt(jO,u,p)(h)}function u(h){return t(h)}function p(h){return o._balanced=!0,n(h)}}function BO(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return At(p)?ci(e,o)(p):o(p)}function o(p){return p===41?u(p):Gp(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return At(p)?ci(e,l)(p):u(p)}function a(p){return n(p)}function l(p){return p===34||p===39||p===40?Yp(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):u(p)}function c(p){return At(p)?ci(e,u)(p):u(p)}function u(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function $O(e,t,n){const r=this;return i;function i(a){return Xp.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Er(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function qO(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const VO={name:"labelStartImage",resolveAll:ol.resolveAll,tokenize:UO};function UO(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const zO={name:"labelStartLink",resolveAll:ol.resolveAll,tokenize:KO};function KO(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const gs={name:"lineEnding",tokenize:HO};function HO(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Be(e,t,"linePrefix")}}const lo={name:"thematicBreak",tokenize:JO};function JO(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ee(c)?Be(e,a,"whitespace")(c):a(c))}}const kt={continuation:{tokenize:XO},exit:ZO,name:"list",tokenize:GO},WO={partial:!0,tokenize:e1},QO={partial:!0,tokenize:YO};function GO(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:la(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(lo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return la(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Vo,r.interrupt?n:u,e.attempt(WO,h,p))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function p(f){return Ee(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function XO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vo,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Be(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ee(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(QO,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Be(e,e.attempt(kt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function YO(e,t,n){const r=this;return Be(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function ZO(e){e.exit(this.containerState.type)}function e1(e,t,n){const r=this;return Be(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ee(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const eu={name:"setextUnderline",resolveTo:t1,tokenize:n1};function t1(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function n1(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,p;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){p=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ee(c)?Be(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const r1={tokenize:i1};function i1(e){const t=this,n=e.attempt(Vo,r,e.attempt(this.parser.constructs.flowInitial,i,Be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cO,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const o1={resolveAll:ef()},s1=Zp("string"),a1=Zp("text");function Zp(e){return{resolveAll:ef(e==="text"?l1:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const p=i[u];let h=-1;if(p)for(;++h<p.length;){const f=p[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function ef(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function l1(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const c1={42:kt,43:kt,45:kt,48:kt,49:kt,50:kt,51:kt,52:kt,53:kt,54:kt,55:kt,56:kt,57:kt,62:Hp},u1={91:hO},d1={[-2]:ms,[-1]:ms,32:ms},p1={35:wO,42:lo,45:[eu,lo],60:SO,61:eu,95:lo,96:Yc,126:Yc},f1={38:Wp,92:Jp},h1={[-5]:gs,[-4]:gs,[-3]:gs,33:VO,38:Wp,42:ca,60:[z0,RO],91:zO,92:[vO,Jp],93:ol,95:ca,96:rO},m1={null:[ca,o1]},g1={null:[42,95]},y1={null:[]},v1=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:g1,contentInitial:u1,disable:y1,document:c1,flow:p1,flowInitial:d1,insideSpan:m1,string:f1,text:h1},Symbol.toStringTag,{value:"Module"}));function b1(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:R(O),check:R(_),consume:g,enter:b,exit:I,interrupt:R(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:p};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function p(j){return s=Wt(s,j),y(),s[s.length-1]!==null?[]:(k(t,0),c.events=il(o,c.events,c),c.events)}function h(j,L){return x1(f(j),L)}function f(j){return w1(s,j)}function m(){const{_bufferIndex:j,_index:L,line:H,column:P,offset:B}=r;return{_bufferIndex:j,_index:L,line:H,column:P,offset:B}}function v(j){i[j.line]=j.column,F()}function y(){let j;for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(j){u=u(j)}function g(j){he(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,F()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=j}function b(j,L){const H=L||{};return H.type=j,H.start=m(),c.events.push(["enter",H,c]),a.push(H),H}function I(j){const L=a.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function O(j,L){k(j,L.from)}function _(j,L){L.restore()}function R(j,L){return H;function H(P,B,X){let le,fe,ge,C;return Array.isArray(P)?$(P):"tokenize"in P?$([P]):W(P);function W(Y){return ie;function ie(ne){const se=ne!==null&&Y[ne],ee=ne!==null&&Y.null,me=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return $(me)(ne)}}function $(Y){return le=Y,fe=0,Y.length===0?X:S(Y[fe])}function S(Y){return ie;function ie(ne){return C=A(),ge=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?V():Y.tokenize.call(L?Object.assign(Object.create(c),L):c,l,U,V)(ne)}}function U(Y){return j(ge,C),B}function V(Y){return C.restore(),++fe<le.length?S(le[fe]):X}}}function k(j,L){j.resolveAll&&!o.includes(j)&&o.push(j),j.resolve&&gn(c.events,L,c.events.length-L,j.resolve(c.events.slice(L),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function A(){const j=m(),L=c.previous,H=c.currentConstruct,P=c.events.length,B=Array.from(a);return{from:P,restore:X};function X(){r=j,c.previous=L,c.currentConstruct=H,c.events.length=P,a=B,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function w1(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function x1(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
8
8
|
`;break}case-3:{s=`\r
|