svix-react
Version:
React components for using Svix in your dashboard.
34 lines (28 loc) • 41.1 kB
JavaScript
(function(U,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("svix")):typeof define=="function"&&define.amd?define(["exports","react","svix"],w):(U=typeof globalThis<"u"?globalThis:U||self,w(U.SvixReact={},U.React,U.svix))})(this,function(U,w,mt){"use strict";function gt(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const oe=gt(w);function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ze={exports:{}};(function(e){console.info(`
IFRAME-RESIZER
Iframe-Resizer 5 is now available via the following two packages:
* @iframe-resizer/parent
* @iframe-resizer/child
Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery.
Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.
Please see https://iframe-resizer.com/upgrade for more details.
`),function(i){if(typeof window>"u")return;var r=0,o,s=!1,c=!1,l="message",a=l.length,h="[iFrameSizer]",y=h.length,f=null,b=window.requestAnimationFrame,R=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),t={},N=null,H=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){ne("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function k(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function X(n,p,I){n.addEventListener(p,I,!1)}function be(n,p,I){n.removeEventListener(p,I,!1)}function G(){var n=["moz","webkit","o","ms"],p;for(p=0;p<n.length&&!b;p+=1)b=window[n[p]+"RequestAnimationFrame"];b?b=b.bind(window):F("setup","RequestAnimationFrame not supported")}function Q(n){var p="Host page: "+n;return window.top!==window.self&&(p=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+n:"Nested host page: "+n),p}function d(n){return h+"["+Q(n)+"]"}function fe(n){return t[n]?t[n].log:s}function F(n,p){we("log",n,p,fe(n))}function xe(n,p){we("info",n,p,fe(n))}function ne(n,p){we("warn",n,p,!0)}function we(n,p,I,T){T===!0&&typeof window.console=="object"&&console[n](d(p),I)}function Fe(n){function p(){function m(){u(D),ve(O),Pe("onResized",D)}z("Height"),z("Width"),g(m,D,"init")}function I(){var m=ce.slice(y).split(":"),P=m[1]?parseInt(m[1],10):0,V=t[m[0]]&&t[m[0]].iframe,J=getComputedStyle(V);return{iframe:V,id:m[0],height:P+T(J)+L(J),width:m[2],type:m[3]}}function T(m){if(m.boxSizing!=="border-box")return 0;var P=m.paddingTop?parseInt(m.paddingTop,10):0,V=m.paddingBottom?parseInt(m.paddingBottom,10):0;return P+V}function L(m){if(m.boxSizing!=="border-box")return 0;var P=m.borderTopWidth?parseInt(m.borderTopWidth,10):0,V=m.borderBottomWidth?parseInt(m.borderBottomWidth,10):0;return P+V}function z(m){var P=Number(t[O]["max"+m]),V=Number(t[O]["min"+m]),J=m.toLowerCase(),K=Number(D[J]);F(O,"Checking "+J+" is in range "+V+"-"+P),K<V&&(K=V,F(O,"Set "+J+" to min value")),K>P&&(K=P,F(O,"Set "+J+" to max value")),D[J]=""+K}function le(){function m(){function J(){var re=0,ge=!1;for(F(O,"Checking connection is from allowed list of origins: "+V);re<V.length;re++)if(V[re]===P){ge=!0;break}return ge}function K(){var re=t[O]&&t[O].remoteHost;return F(O,"Checking connection is from: "+re),P===re}return V.constructor===Array?J():K()}var P=n.origin,V=t[O]&&t[O].checkOrigin;if(V&&""+P!="null"&&!m())throw new Error("Unexpected message received from: "+P+" for "+D.iframe.id+". Message was: "+n.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Se(){return h===(""+ce).slice(0,y)&&ce.slice(y).split(":")[0]in t}function pe(){var m=D.type in{true:1,false:1,undefined:1};return m&&F(O,"Ignoring init message from meta parent page"),m}function me(m){return ce.slice(ce.indexOf(":")+a+m)}function he(m){F(O,"onMessage passed: {iframe: "+D.iframe.id+", message: "+m+"}"),Pe("onMessage",{iframe:D.iframe,message:JSON.parse(m)}),F(O,"--")}function Be(){var m=document.body.getBoundingClientRect(),P=D.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:P.height,iframeWidth:P.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(P.top-m.top,10),offsetLeft:parseInt(P.left-m.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function ze(m,P){function V(){S("Send Page Info","pageInfo:"+Be(),m,P)}j(V,32,P)}function Ve(){function m(K,re){function ge(){t[J]?ze(t[J].iframe,J):P()}["scroll","resize"].forEach(function(pt){F(J,K+pt+" listener for sendPageInfo"),re(window,pt,ge)})}function P(){m("Remove ",be)}function V(){m("Add ",X)}var J=O;V(),t[J]&&(t[J].stopPageInfo=P)}function Ue(){t[O]&&t[O].stopPageInfo&&(t[O].stopPageInfo(),delete t[O].stopPageInfo)}function Je(){var m=!0;return D.iframe===null&&(ne(O,"IFrame ("+D.id+") not found"),m=!1),m}function E(m){var P=m.getBoundingClientRect();return ae(O),{x:Math.floor(Number(P.left)+Number(f.x)),y:Math.floor(Number(P.top)+Number(f.y))}}function M(m){function P(){f=re,Z(),F(O,"--")}function V(){return{x:Number(D.width)+K.x,y:Number(D.height)+K.y}}function J(){window.parentIFrame?window.parentIFrame["scrollTo"+(m?"Offset":"")](re.x,re.y):ne(O,"Unable to scroll to requested position, window.parentIFrame not found")}var K=m?E(D.iframe):{x:0,y:0},re=V();F(O,"Reposition requested from iFrame (offset x:"+K.x+" y:"+K.y+")"),window.top===window.self?P():J()}function Z(){Pe("onScroll",f)===!1?Ce():ve(O)}function te(m){function P(){var ge=E(re);F(O,"Moving to in page link (#"+J+") at x: "+ge.x+" y: "+ge.y),f={x:ge.x,y:ge.y},Z(),F(O,"--")}function V(){window.parentIFrame?window.parentIFrame.moveToAnchor(J):F(O,"In page link #"+J+" not found and window.parentIFrame not found")}var J=m.split("#")[1]||"",K=decodeURIComponent(J),re=document.getElementById(K)||document.getElementsByName(K)[0];re?P():window.top===window.self?F(O,"In page link #"+J+" not found"):V()}function ue(m){var P={};if(Number(D.width)===0&&Number(D.height)===0){var V=me(9).split(":");P={x:V[1],y:V[0]}}else P={x:D.width,y:D.height};Pe(m,{iframe:D.iframe,screenX:Number(P.x),screenY:Number(P.y),type:D.type})}function Pe(m,P){return Ee(O,m,P)}function je(){switch(t[O]&&t[O].firstRun&&Ge(),D.type){case"close":{Te(D.iframe);break}case"message":{he(me(6));break}case"mouseenter":{ue("onMouseEnter");break}case"mouseleave":{ue("onMouseLeave");break}case"autoResize":{t[O].autoResize=JSON.parse(me(9));break}case"scrollTo":{M(!1);break}case"scrollToOffset":{M(!0);break}case"pageInfo":{ze(t[O]&&t[O].iframe,O),Ve();break}case"pageInfoStop":{Ue();break}case"inPageLink":{te(me(9));break}case"reset":{Me(D);break}case"init":{p(),Pe("onInit",D.iframe);break}default:Number(D.width)===0&&Number(D.height)===0?ne("Unsupported message received ("+D.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):p()}}function Xe(m){var P=!0;return t[m]||(P=!1,ne(D.type+" No settings for "+m+". Message was: "+ce)),P}function Qe(){for(var m in t)S("iFrame requested init",A(m),t[m].iframe,m)}function Ge(){t[O]&&(t[O].firstRun=!1)}var ce=n.data,D={},O=null;ce==="[iFrameResizerChild]Ready"?Qe():Se()?(D=I(),O=D.id,t[O]&&(t[O].loaded=!0),!pe()&&Xe(O)&&(F(O,"Received: "+ce),Je()&&le()&&je())):xe(O,"Ignored: "+ce)}function Ee(n,p,I){var T=null,L=null;if(t[n])if(T=t[n][p],typeof T=="function")L=T(I);else throw new TypeError(p+" on iFrame["+n+"] is not a function");return L}function de(n){var p=n.id;delete t[p]}function Te(n){var p=n.id;if(Ee(p,"onClose",p)===!1){F(p,"Close iframe cancelled by onClose event");return}F(p,"Removing iFrame: "+p);try{n.parentNode&&n.parentNode.removeChild(n)}catch(I){ne(I)}Ee(p,"onClosed",p),F(p,"--"),de(n),o&&(o.disconnect(),o=null)}function ae(n){f===null&&(f={x:window.pageXOffset===i?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===i?document.documentElement.scrollTop:window.pageYOffset},F(n,"Get page position: "+f.x+","+f.y))}function ve(n){f!==null&&(window.scrollTo(f.x,f.y),F(n,"Set page position: "+f.x+","+f.y),Ce())}function Ce(){f=null}function Me(n){function p(){u(n),S("reset","reset",n.iframe,n.id)}F(n.id,"Size reset requested by "+(n.type==="init"?"host page":"iFrame")),ae(n.id),g(p,n,"reset")}function u(n){function p(z){if(!n.id){F("undefined","messageData id not set");return}n.iframe.style[z]=n[z]+"px",F(n.id,"IFrame ("+L+") "+z+" set to "+n[z]+"px")}function I(z){!c&&n[z]==="0"&&(c=!0,F(L,"Hidden iFrame detected, creating visibility listener"),Y())}function T(z){p(z),I(z)}var L=n.iframe.id;t[L]&&(t[L].sizeHeight&&T("height"),t[L].sizeWidth&&T("width"))}function g(n,p,I){I!==p.type&&b&&!window.jasmine?(F(p.id,"Requesting animation frame"),b(n)):n()}function S(n,p,I,T,L){function z(){var he=t[T]&&t[T].targetOrigin;F(T,"["+n+"] Sending msg to iframe["+T+"] ("+p+") targetOrigin: "+he),I.contentWindow.postMessage(h+p,he)}function le(){ne(T,"["+n+"] IFrame("+T+") not found")}function Se(){I&&"contentWindow"in I&&I.contentWindow!==null?z():le()}function pe(){function he(){t[T]&&!t[T].loaded&&!me&&(me=!0,ne(T,"IFrame has not responded within "+t[T].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}L&&t[T]&&t[T].warningTimeout&&(t[T].msgTimeout=setTimeout(he,t[T].warningTimeout))}var me=!1;T=T||I.id,t[T]&&(Se(),pe())}function A(n){return n+":"+t[n].bodyMarginV1+":"+t[n].sizeWidth+":"+t[n].log+":"+t[n].interval+":"+t[n].enablePublicMethods+":"+t[n].autoResize+":"+t[n].bodyMargin+":"+t[n].heightCalculationMethod+":"+t[n].bodyBackground+":"+t[n].bodyPadding+":"+t[n].tolerance+":"+t[n].inPageLinks+":"+t[n].resizeFrom+":"+t[n].widthCalculationMethod+":"+t[n].mouseEvents}function _(n){return typeof n=="number"}function W(n,p){function I(){function M(te){var ue=t[E][te];ue!==1/0&&ue!==0&&(n.style[te]=_(ue)?ue+"px":ue,F(E,"Set "+te+" = "+n.style[te]))}function Z(te){if(t[E]["min"+te]>t[E]["max"+te])throw new Error("Value for min"+te+" can not be greater than max"+te)}Z("Height"),Z("Width"),M("maxHeight"),M("minHeight"),M("maxWidth"),M("minWidth")}function T(){var M=p&&p.id||H.id+r++;return document.getElementById(M)!==null&&(M+=r++),M}function L(M){if(typeof M!="string")throw new TypeError("Invaild id for iFrame. Expected String");return M===""&&(n.id=M=T(),s=(p||{}).log,F(M,"Added missing iframe ID: "+M+" ("+n.src+")")),M}function z(){switch(F(E,"IFrame scrolling "+(t[E]&&t[E].scrolling?"enabled":"disabled")+" for "+E),n.style.overflow=(t[E]&&t[E].scrolling)===!1?"hidden":"auto",t[E]&&t[E].scrolling){case"omit":break;case!0:{n.scrolling="yes";break}case!1:{n.scrolling="no";break}default:n.scrolling=t[E]?t[E].scrolling:"no"}}function le(){(typeof(t[E]&&t[E].bodyMargin)=="number"||(t[E]&&t[E].bodyMargin)==="0")&&(t[E].bodyMarginV1=t[E].bodyMargin,t[E].bodyMargin=""+t[E].bodyMargin+"px")}function Se(){var M=t[E]&&t[E].firstRun,Z=t[E]&&t[E].heightCalculationMethod in R;!M&&Z&&Me({iframe:n,height:0,width:0,type:"init"})}function pe(){t[E]&&(t[E].iframe.iFrameResizer={close:Te.bind(null,t[E].iframe),removeListeners:de.bind(null,t[E].iframe),resize:S.bind(null,"Window resize","resize",t[E].iframe),moveToAnchor:function(M){S("Move to anchor","moveToAnchor:"+M,t[E].iframe,E)},sendMessage:function(M){M=JSON.stringify(M),S("Send Message","message:"+M,t[E].iframe,E)}})}function me(M){function Z(){S("iFrame.onload",M,n,i,!0),Se()}function te(Pe){if(!n.parentNode)return null;var je=new Pe(function(Xe){Xe.forEach(function(Qe){var Ge=Array.prototype.slice.call(Qe.removedNodes);Ge.forEach(function(ce){ce===n&&Te(n)})})});return je.observe(n.parentNode,{childList:!0}),je}var ue=k();ue&&(o=te(ue)),X(n,"load",Z),S("init",M,n,i,!0)}function he(M){if(typeof M!="object")throw new TypeError("Options is not an object")}function Be(M){for(var Z in H)Object.prototype.hasOwnProperty.call(H,Z)&&(t[E][Z]=Object.prototype.hasOwnProperty.call(M,Z)?M[Z]:H[Z])}function ze(M){return M===""||M.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":M}function Ve(M){var Z=M.split("Callback");if(Z.length===2){var te="on"+Z[0].charAt(0).toUpperCase()+Z[0].slice(1);this[te]=this[M],delete this[M],ne(E,"Deprecated: '"+M+"' has been renamed '"+te+"'. The old method will be removed in the next major version.")}}function Ue(M){M=M||{},t[E]=Object.create(null),t[E].iframe=n,t[E].firstRun=!0,t[E].remoteHost=n.src&&n.src.split("/").slice(0,3).join("/"),he(M),Object.keys(M).forEach(Ve,M),Be(M),t[E]&&(t[E].targetOrigin=t[E].checkOrigin===!0?ze(t[E].remoteHost):"*")}function Je(){return E in t&&"iFrameResizer"in n}var E=L(n.id);Je()?ne(E,"Ignored iFrame, already setup."):(Ue(p),z(),I(),le(),me(A(E)),pe())}function C(n,p){N===null&&(N=setTimeout(function(){N=null,n()},p))}var x={};function j(n,p,I){x[I]||(x[I]=setTimeout(function(){x[I]=null,n()},p))}function Y(){function n(){function L(z){function le(pe){return(t[z]&&t[z].iframe.style[pe])==="0px"}function Se(pe){return pe.offsetParent!==null}t[z]&&Se(t[z].iframe)&&(le("height")||le("width"))&&S("Visibility change","resize",t[z].iframe,z)}Object.keys(t).forEach(function(z){L(z)})}function p(L){F("window","Mutation observed: "+L[0].target+" "+L[0].type),C(n,16)}function I(){var L=document.querySelector("body"),z={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},le=new T(p);le.observe(L,z)}var T=k();T&&I()}function B(n){function p(){ie("Window "+n,"resize")}F("window","Trigger event: "+n),C(p,16)}function se(){function n(){ie("Tab Visible","resize")}document.visibilityState!=="hidden"&&(F("document","Trigger event: Visibility change"),C(n,16))}function ie(n,p){function I(T){return t[T]&&t[T].resizeFrom==="parent"&&t[T].autoResize&&!t[T].firstRun}Object.keys(t).forEach(function(T){I(T)&&S(n,p,t[T].iframe,T)})}function v(){X(window,"message",Fe),X(window,"resize",function(){B("resize")}),X(document,"visibilitychange",se),X(document,"-webkit-visibilitychange",se)}function Oe(){function n(T,L){function z(){if(L.tagName){if(L.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+L.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}L&&(z(),W(L,T),I.push(L))}function p(T){T&&T.enablePublicMethods&&ne("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var I;return G(),v(),function(L,z){switch(I=[],p(L),typeof z){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(z||"iframe"),n.bind(i,L));break}case"object":{n(L,z);break}default:throw new TypeError("Unexpected data type ("+typeof z+")")}return I}}function Re(n){n.fn?n.fn.iFrameResize||(n.fn.iFrameResize=function(I){function T(L,z){W(z,I)}return this.filter("iframe").each(T).end()}):xe("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==i&&Re(window.jQuery),typeof i=="function"&&i.amd?i([],Oe):e.exports=Oe(),window.iFrameResize=window.iFrameResize||Oe()}()})(Ze);var vt=Ze.exports;const ht=We(vt);var Le={exports:{}},_e={exports:{}},q={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ke;function yt(){if(Ke)return q;Ke=1;var e=typeof Symbol=="function"&&Symbol.for,i=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,y=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,R=e?Symbol.for("react.suspense_list"):60120,t=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,H=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,X=e?Symbol.for("react.responder"):60118,be=e?Symbol.for("react.scope"):60119;function G(d){if(typeof d=="object"&&d!==null){var fe=d.$$typeof;switch(fe){case i:switch(d=d.type,d){case h:case y:case o:case c:case s:case b:return d;default:switch(d=d&&d.$$typeof,d){case a:case f:case N:case t:case l:return d;default:return fe}}case r:return fe}}}function Q(d){return G(d)===y}return q.AsyncMode=h,q.ConcurrentMode=y,q.ContextConsumer=a,q.ContextProvider=l,q.Element=i,q.ForwardRef=f,q.Fragment=o,q.Lazy=N,q.Memo=t,q.Portal=r,q.Profiler=c,q.StrictMode=s,q.Suspense=b,q.isAsyncMode=function(d){return Q(d)||G(d)===h},q.isConcurrentMode=Q,q.isContextConsumer=function(d){return G(d)===a},q.isContextProvider=function(d){return G(d)===l},q.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===i},q.isForwardRef=function(d){return G(d)===f},q.isFragment=function(d){return G(d)===o},q.isLazy=function(d){return G(d)===N},q.isMemo=function(d){return G(d)===t},q.isPortal=function(d){return G(d)===r},q.isProfiler=function(d){return G(d)===c},q.isStrictMode=function(d){return G(d)===s},q.isSuspense=function(d){return G(d)===b},q.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===o||d===y||d===c||d===s||d===b||d===R||typeof d=="object"&&d!==null&&(d.$$typeof===N||d.$$typeof===t||d.$$typeof===l||d.$$typeof===a||d.$$typeof===f||d.$$typeof===k||d.$$typeof===X||d.$$typeof===be||d.$$typeof===H)},q.typeOf=G,q}var $={};/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var et;function bt(){return et||(et=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,i=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,y=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,R=e?Symbol.for("react.suspense_list"):60120,t=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,H=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,X=e?Symbol.for("react.responder"):60118,be=e?Symbol.for("react.scope"):60119;function G(v){return typeof v=="string"||typeof v=="function"||v===o||v===y||v===c||v===s||v===b||v===R||typeof v=="object"&&v!==null&&(v.$$typeof===N||v.$$typeof===t||v.$$typeof===l||v.$$typeof===a||v.$$typeof===f||v.$$typeof===k||v.$$typeof===X||v.$$typeof===be||v.$$typeof===H)}function Q(v){if(typeof v=="object"&&v!==null){var Oe=v.$$typeof;switch(Oe){case i:var Re=v.type;switch(Re){case h:case y:case o:case c:case s:case b:return Re;default:var n=Re&&Re.$$typeof;switch(n){case a:case f:case N:case t:case l:return n;default:return Oe}}case r:return Oe}}}var d=h,fe=y,F=a,xe=l,ne=i,we=f,Fe=o,Ee=N,de=t,Te=r,ae=c,ve=s,Ce=b,Me=!1;function u(v){return Me||(Me=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),g(v)||Q(v)===h}function g(v){return Q(v)===y}function S(v){return Q(v)===a}function A(v){return Q(v)===l}function _(v){return typeof v=="object"&&v!==null&&v.$$typeof===i}function W(v){return Q(v)===f}function C(v){return Q(v)===o}function x(v){return Q(v)===N}function j(v){return Q(v)===t}function Y(v){return Q(v)===r}function B(v){return Q(v)===c}function se(v){return Q(v)===s}function ie(v){return Q(v)===b}$.AsyncMode=d,$.ConcurrentMode=fe,$.ContextConsumer=F,$.ContextProvider=xe,$.Element=ne,$.ForwardRef=we,$.Fragment=Fe,$.Lazy=Ee,$.Memo=de,$.Portal=Te,$.Profiler=ae,$.StrictMode=ve,$.Suspense=Ce,$.isAsyncMode=u,$.isConcurrentMode=g,$.isContextConsumer=S,$.isContextProvider=A,$.isElement=_,$.isForwardRef=W,$.isFragment=C,$.isLazy=x,$.isMemo=j,$.isPortal=Y,$.isProfiler=B,$.isStrictMode=se,$.isSuspense=ie,$.isValidElementType=G,$.typeOf=Q}()),$}var tt;function nt(){return tt||(tt=1,process.env.NODE_ENV==="production"?_e.exports=yt():_e.exports=bt()),_e.exports}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Ne,rt;function wt(){if(rt)return Ne;rt=1;var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(c){if(c==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function s(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de",Object.getOwnPropertyNames(c)[0]==="5")return!1;for(var l={},a=0;a<10;a++)l["_"+String.fromCharCode(a)]=a;var h=Object.getOwnPropertyNames(l).map(function(f){return l[f]});if(h.join("")!=="0123456789")return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(f){y[f]=f}),Object.keys(Object.assign({},y)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ne=s()?Object.assign:function(c,l){for(var a,h=o(c),y,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var b in a)i.call(a,b)&&(h[b]=a[b]);if(e){y=e(a);for(var R=0;R<y.length;R++)r.call(a,y[R])&&(h[y[R]]=a[y[R]])}}return h},Ne}var He,it;function De(){if(it)return He;it=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return He=e,He}var qe,ot;function Et(){if(ot)return qe;ot=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var i=De(),r={},o=Function.call.bind(Object.prototype.hasOwnProperty);e=function(c){var l="Warning: "+c;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function s(c,l,a,h,y){if(process.env.NODE_ENV!=="production"){for(var f in c)if(o(c,f)){var b;try{if(typeof c[f]!="function"){var R=Error((h||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[f]+"`.");throw R.name="Invariant Violation",R}b=c[f](l,f,h,a,null,i)}catch(N){b=N}if(b&&!(b instanceof Error)&&e((h||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof b+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),b instanceof Error&&!(b.message in r)){r[b.message]=!0;var t=y?y():"";e("Failed "+a+" type: "+b.message+(t??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},qe=s,qe}var $e,at;function Tt(){if(at)return $e;at=1;var e=nt(),i=wt(),r=De(),o=Et(),s=Function.call.bind(Object.prototype.hasOwnProperty),c=function(){};process.env.NODE_ENV!=="production"&&(c=function(a){var h="Warning: "+a;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function l(){return null}return $e=function(a,h){var y=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function b(u){var g=u&&(y&&u[y]||u[f]);if(typeof g=="function")return g}var R="<<anonymous>>",t={array:X("array"),bool:X("boolean"),func:X("function"),number:X("number"),object:X("object"),string:X("string"),symbol:X("symbol"),any:be(),arrayOf:G,element:Q(),elementType:d(),instanceOf:fe,node:we(),objectOf:xe,oneOf:F,oneOfType:ne,shape:Fe,exact:Ee};function N(u,g){return u===g?u!==0||1/u===1/g:u!==u&&g!==g}function H(u){this.message=u,this.stack=""}H.prototype=Error.prototype;function k(u){if(process.env.NODE_ENV!=="production")var g={},S=0;function A(W,C,x,j,Y,B,se){if(j=j||R,B=B||x,se!==r){if(h){var ie=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ie.name="Invariant Violation",ie}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var v=j+":"+x;!g[v]&&S<3&&(c("You are manually calling a React.PropTypes validation function for the `"+B+"` prop on `"+j+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),g[v]=!0,S++)}}return C[x]==null?W?C[x]===null?new H("The "+Y+" `"+B+"` is marked as required "+("in `"+j+"`, but its value is `null`.")):new H("The "+Y+" `"+B+"` is marked as required in "+("`"+j+"`, but its value is `undefined`.")):null:u(C,x,j,Y,B)}var _=A.bind(null,!1);return _.isRequired=A.bind(null,!0),_}function X(u){function g(S,A,_,W,C,x){var j=S[A],Y=ae(j);if(Y!==u){var B=ve(j);return new H("Invalid "+W+" `"+C+"` of type "+("`"+B+"` supplied to `"+_+"`, expected ")+("`"+u+"`."))}return null}return k(g)}function be(){return k(l)}function G(u){function g(S,A,_,W,C){if(typeof u!="function")return new H("Property `"+C+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var x=S[A];if(!Array.isArray(x)){var j=ae(x);return new H("Invalid "+W+" `"+C+"` of type "+("`"+j+"` supplied to `"+_+"`, expected an array."))}for(var Y=0;Y<x.length;Y++){var B=u(x,Y,_,W,C+"["+Y+"]",r);if(B instanceof Error)return B}return null}return k(g)}function Q(){function u(g,S,A,_,W){var C=g[S];if(!a(C)){var x=ae(C);return new H("Invalid "+_+" `"+W+"` of type "+("`"+x+"` supplied to `"+A+"`, expected a single ReactElement."))}return null}return k(u)}function d(){function u(g,S,A,_,W){var C=g[S];if(!e.isValidElementType(C)){var x=ae(C);return new H("Invalid "+_+" `"+W+"` of type "+("`"+x+"` supplied to `"+A+"`, expected a single ReactElement type."))}return null}return k(u)}function fe(u){function g(S,A,_,W,C){if(!(S[A]instanceof u)){var x=u.name||R,j=Me(S[A]);return new H("Invalid "+W+" `"+C+"` of type "+("`"+j+"` supplied to `"+_+"`, expected ")+("instance of `"+x+"`."))}return null}return k(g)}function F(u){if(!Array.isArray(u))return process.env.NODE_ENV!=="production"&&(arguments.length>1?c("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):c("Invalid argument supplied to oneOf, expected an array.")),l;function g(S,A,_,W,C){for(var x=S[A],j=0;j<u.length;j++)if(N(x,u[j]))return null;var Y=JSON.stringify(u,function(se,ie){var v=ve(ie);return v==="symbol"?String(ie):ie});return new H("Invalid "+W+" `"+C+"` of value `"+String(x)+"` "+("supplied to `"+_+"`, expected one of "+Y+"."))}return k(g)}function xe(u){function g(S,A,_,W,C){if(typeof u!="function")return new H("Property `"+C+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var x=S[A],j=ae(x);if(j!=="object")return new H("Invalid "+W+" `"+C+"` of type "+("`"+j+"` supplied to `"+_+"`, expected an object."));for(var Y in x)if(s(x,Y)){var B=u(x,Y,_,W,C+"."+Y,r);if(B instanceof Error)return B}return null}return k(g)}function ne(u){if(!Array.isArray(u))return process.env.NODE_ENV!=="production"&&c("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var g=0;g<u.length;g++){var S=u[g];if(typeof S!="function")return c("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ce(S)+" at index "+g+"."),l}function A(_,W,C,x,j){for(var Y=0;Y<u.length;Y++){var B=u[Y];if(B(_,W,C,x,j,r)==null)return null}return new H("Invalid "+x+" `"+j+"` supplied to "+("`"+C+"`."))}return k(A)}function we(){function u(g,S,A,_,W){return de(g[S])?null:new H("Invalid "+_+" `"+W+"` supplied to "+("`"+A+"`, expected a ReactNode."))}return k(u)}function Fe(u){function g(S,A,_,W,C){var x=S[A],j=ae(x);if(j!=="object")return new H("Invalid "+W+" `"+C+"` of type `"+j+"` "+("supplied to `"+_+"`, expected `object`."));for(var Y in u){var B=u[Y];if(B){var se=B(x,Y,_,W,C+"."+Y,r);if(se)return se}}return null}return k(g)}function Ee(u){function g(S,A,_,W,C){var x=S[A],j=ae(x);if(j!=="object")return new H("Invalid "+W+" `"+C+"` of type `"+j+"` "+("supplied to `"+_+"`, expected `object`."));var Y=i({},S[A],u);for(var B in Y){var se=u[B];if(!se)return new H("Invalid "+W+" `"+C+"` key `"+B+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(S[A],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(u),null," "));var ie=se(x,B,_,W,C+"."+B,r);if(ie)return ie}return null}return k(g)}function de(u){switch(typeof u){case"number":case"string":case"undefined":return!0;case"boolean":return!u;case"object":if(Array.isArray(u))return u.every(de);if(u===null||a(u))return!0;var g=b(u);if(g){var S=g.call(u),A;if(g!==u.entries){for(;!(A=S.next()).done;)if(!de(A.value))return!1}else for(;!(A=S.next()).done;){var _=A.value;if(_&&!de(_[1]))return!1}}else return!1;return!0;default:return!1}}function Te(u,g){return u==="symbol"?!0:g?g["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&g instanceof Symbol:!1}function ae(u){var g=typeof u;return Array.isArray(u)?"array":u instanceof RegExp?"object":Te(g,u)?"symbol":g}function ve(u){if(typeof u>"u"||u===null)return""+u;var g=ae(u);if(g==="object"){if(u instanceof Date)return"date";if(u instanceof RegExp)return"regexp"}return g}function Ce(u){var g=ve(u);switch(g){case"array":case"object":return"an "+g;case"boolean":case"date":case"regexp":return"a "+g;default:return g}}function Me(u){return!u.constructor||!u.constructor.name?R:u.constructor.name}return t.checkPropTypes=o,t.resetWarningCache=o.resetWarningCache,t.PropTypes=t,t},$e}var Ye,st;function Mt(){if(st)return Ye;st=1;var e=De();function i(){}function r(){}return r.resetWarningCache=i,Ye=function(){function o(l,a,h,y,f,b){if(b!==e){var R=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw R.name="Invariant Violation",R}}o.isRequired=o;function s(){return o}var c={array:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:s,element:o,elementType:o,instanceOf:s,node:o,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:i};return c.PropTypes=c,c},Ye}if(process.env.NODE_ENV!=="production"){var Ot=nt(),St=!0;Le.exports=Tt()(Ot.isElement,St)}else Le.exports=Mt()();var Pt=Le.exports;const xt=We(Pt);var Ct=process.env.NODE_ENV!=="production",ut=function(){};if(Ct){var Rt=function(i,r){var o=arguments.length;r=new Array(o>1?o-1:0);for(var s=1;s<o;s++)r[s-1]=arguments[s];var c=0,l="Warning: "+i.replace(/%s/g,function(){return r[c++]});typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}};ut=function(e,i,r){var o=arguments.length;r=new Array(o>2?o-2:0);for(var s=2;s<o;s++)r[s-2]=arguments[s];if(i===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||Rt.apply(null,[i].concat(r))}}var kt=ut;const Ft=We(kt);function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ae.apply(this,arguments)}function ct(e,i){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(i.indexOf(o)>=0)continue;r[o]=e[o]}return r}var _t=["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onResized"],At=function(e){e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onResized;var i=ct(e,_t);return i},It=["title","forwardRef"],ft=function(i){var r=i.title,o=r===void 0?"iframe":r,s=i.forwardRef,c=ct(i,It),l=At(c),a=w.useRef(null),h=function(){var f;return Ft(!(a!=null&&a.current),"[iframeSizerReact]["+(a==null||(f=a.current)==null?void 0:f.id)+"] Close event ignored, to remove the iframe update your React component"),!(a!=null&&a.current)};return w.useEffect(function(){var y=a.current;return ht(Ae({},c,{onClose:h}),y),function(){var f;return y==null||(f=y.iFrameResizer)==null?void 0:f.removeListeners()}},[]),w.useImperativeHandle(s,function(){return{getIframeElement:function(){return a.current},resize:function(){return a.current.iFrameResizer.resize()},moveToAnchor:function(f){return a.current.iFrameResizer.moveToAnchor(f)},sendMessage:function(f,b){a.current.iFrameResizer.sendMessage(f,b)}}}),w.createElement("iframe",Ae({title:o},l,{ref:a}))};ft.propTypes={title:xt.string};function lt(e,i){if(!e)return;const r=new URL(e);return i.darkMode!==void 0&&r.searchParams.append("darkMode",i.darkMode.toString()),i.fontFamily!==void 0&&r.searchParams.append("fontFamily",i.fontFamily),i.icon!==void 0&&r.searchParams.append("icon",i.icon),i.primaryColor!==void 0&&r.searchParams.append("primaryColor",i.primaryColor),r.href}const en="";function zt(){const e=oe.useRef(!1);return oe.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),(i,r)=>{window.setTimeout(()=>{e.current&&i()},r)}}const jt="650px";function Wt(e){const{url:i,...r}=e,[o,s]=oe.useState(!1),c=zt();function l(){c(()=>{s(!0)},1e4)}const a=o?null:oe.createElement("div",{className:`Svix__mask ${r.darkMode?"Svix__dark":"Svix__light"}`});return oe.createElement(oe.Fragment,null,oe.createElement("div",{style:{borderRadius:"8px",overflow:"hidden",display:"flex",position:"relative",width:"100%",minHeight:jt,height:"fit-content",...e.style}},a,e.fullSize?oe.createElement(ft,{allow:"clipboard-write",src:lt(i,r),checkOrigin:!1,resizeFrom:"parent",heightCalculationMethod:"taggedElement",onLoad:l,style:{width:"1px",minWidth:"100%",display:"block",zIndex:2,border:"none"}}):oe.createElement("iframe",{allow:"clipboard-write",onLoad:l,style:{bottom:0,height:"100%",left:0,position:"absolute",right:0,top:0,width:"100%",zIndex:2,border:"none"},src:lt(i,r)})))}function Lt(e){if(!e.token)throw new Error("Missing SvixProvider token property");if(!e.appId)throw new Error("Missing SvixProvider appId property");const i=oe.useMemo(()=>e.appId,[e.appId]),r=oe.useMemo(()=>new mt.Svix(e.token,e.options),[e.token,e.options]);return oe.createElement(dt.Provider,{value:{svix:r,appId:i}},e.children)}const dt=oe.createContext(null);function Nt(e){const{svix:i,appId:r}=ee(),{iterator:o,limit:s}=e||{},c=w.useCallback(a=>i.endpoint.list(r,{iterator:o||a,limit:s}),[i,r,o,s]);return ye(c)}function Ht(e){const{svix:i,appId:r}=ee(),o=w.useCallback(()=>i.endpoint.get(r,e),[i,r,e]);return ke(o)}function Dt(e){const{svix:i,appId:r}=ee(),o=w.useCallback(()=>i.endpoint.getSecret(r,e),[i,r,e]),s=ke(o),c=w.useCallback(async l=>{await i.endpoint.rotateSecret(r,e,l),s.reload()},[i,r,e,s]);return{...s,rotateSecret:c}}function qt(e){const{svix:i,appId:r}=ee(),o=w.useCallback(l=>i.endpoint.recover(r,e,l),[i,r,e]),s=w.useCallback(l=>i.endpoint.update(r,e,l),[i,r,e]),c=w.useCallback(()=>i.endpoint.delete(r,e),[i,r,e]);return{recoverEndpointMessages:o,updateEndpoint:s,deleteEndpoint:c}}function $t(e){const{svix:i,appId:r}=ee(),o=w.useCallback(()=>i.endpoint.getStats(r,e),[i,r,e]);return ke(o)}function Yt(e){const{svix:i,appId:r}=ee(),o=w.useCallback(()=>i.endpoint.getHeaders(r,e),[i,r,e]),s=ke(o),c=w.useCallback(async a=>{await i.endpoint.updateHeaders(r,e,a),s.reload()},[i,r,e,s]),l=w.useCallback(async a=>{await i.endpoint.patchHeaders(r,e,a),s.reload()},[i,r,e,s]);return{...s,updateEndpointHeaders:c,patchEndpointHeaders:l}}function Bt(e,i){const{svix:r,appId:o}=ee(),{iterator:s,limit:c,status:l,eventTypes:a,before:h,after:y,statusCodeClass:f,channel:b,withContent:R,withMsg:t}=i||{},N=w.useMemo(()=>a==null?void 0:a.map(X=>X.name),[a]),H=w.useCallback(X=>r.messageAttempt.listByEndpoint(o,e,{iterator:s||X,limit:c,status:l,eventTypes:N,before:h,after:y,statusCodeClass:f,channel:b,withContent:R,withMsg:t}),[r,o,e,s,c,l,N,h,y,f,b,R,t]);return ye(H)}function Vt(e,i){const{svix:r,appId:o}=ee(),{iterator:s,limit:c,status:l,eventTypes:a,before:h,after:y,statusCodeClass:f,channel:b,withContent:R}=i||{},t=w.useMemo(()=>a==null?void 0:a.map(k=>k.name),[a]),N=w.useCallback(k=>r.messageAttempt.listAttemptedMessages(o,e,{iterator:s||k,limit:c,status:l,eventTypes:t,before:h,after:y,statusCodeClass:f,channel:b,withContent:R}),[r,o,e,s,c,l,t,h,y,f,b,R]);return ye(N)}function Ut(e){const{svix:i}=ee(),{iterator:r,limit:o}=e||{},s=w.useCallback(l=>i.eventType.list({iterator:r||l,limit:o,withContent:!0}),[i,o,r]);return ye(s)}function Jt(e){const{svix:i,appId:r}=ee(),{iterator:o,limit:s,before:c,after:l,channel:a,eventTypes:h,withContent:y,tag:f}=e||{},b=w.useMemo(()=>h==null?void 0:h.map(N=>N.name),[h]),R=w.useCallback(N=>i.message.list(r,{iterator:o||N,limit:s,before:c,after:l,channel:a,eventTypes:b,withContent:y,tag:f}),[i,r,o,s,c,l,a,b,y,f]);return ye(R)}function Xt(e){const{svix:i,appId:r}=ee(),o=w.useCallback(()=>i.message.get(r,e),[i,r,e]);return ke(o)}function Qt(e,i){const{svix:r,appId:o}=ee(),{iterator:s,limit:c,after:l,before:a,channel:h,status:y,statusCodeClass:f,withContent:b}=i||{},R=w.useCallback(N=>r.messageAttempt.listAttemptedDestinations(o,e,{iterator:s||N,limit:c,after:l,before:a,channel:h,status:y,statusCodeClass:f,withContent:b}),[r,o,e,s,c,l,a,h,y,f,b]);return ye(R)}function Gt(e,i){const{svix:r,appId:o}=ee(),{iterator:s,limit:c,status:l,eventTypes:a,before:h,after:y,statusCodeClass:f,channel:b,withContent:R}=i||{},t=w.useMemo(()=>a==null?void 0:a.map(k=>k.name),[a]),N=w.useCallback(k=>r.messageAttempt.listByMsg(o,e,{iterator:s||k,limit:c,status:l,eventTypes:t,before:h,after:y,statusCodeClass:f,channel:b,withContent:R}),[r,o,e,s,c,l,t,h,y,f,b,R]);return ye(N)}function Zt(e){const{svix:i,appId:r}=ee();return{resendAttempt:w.useCallback(async()=>{await i.messageAttempt.resend(r,e.msgId,e.endpointId)},[i,r,e])}}function Kt(){const{svix:e,appId:i}=ee(),r=Ie(""),o=Ie(""),s=Ie([]),c=Ie(void 0),l=w.useCallback(async()=>{if(r.value==="")return{error:new Error('Field "url" cannot be empty.')};const a=s.value;try{return{endpoint:await e.endpoint.create(i,{url:r.value,description:o.value,rateLimit:c.value,filterTypes:a,version:1})}}catch(h){return{error:h}}},[e,i,r.value,o.value,s.value,c.value]);return{url:r,description:o,eventTypes:s,rateLimitPerSecond:c,createEndpoint:l}}function ee(){return w.useContext(dt)}function Ie(e){const[i,r]=w.useState(e);return{value:i,setValue:o=>r(o)}}function ke(e){const[i,r]=w.useState(),[o,s]=w.useState(!1),[c,l]=w.useState(),a=w.useCallback(async()=>{s(!0);try{const h=await e();r(h)}catch(h){l(h)}s(!1)},[e]);return w.useEffect(()=>{a()},[a]),{data:i,reload:a,loading:o,error:c}}function ye(e){const[i,r]=w.useState(),[o,s]=w.useState([]),[c,l]=w.useState(),[a,h]=w.useState(!1),[y,f]=w.useState(),b=w.useMemo(()=>o.length>0,[o]),R=w.useMemo(()=>!!c,[c]),t=w.useCallback(async()=>{h(!0);try{const k=await e(o[0]);r(k.data),l(k.done===!1?k.iterator:void 0)}catch(k){f(k)}h(!1)},[e,o]);w.useEffect(()=>{t()},[t]);const N=w.useCallback(()=>{b&&s(k=>k.slice(1))},[b]),H=w.useCallback(()=>{R&&s(k=>[c,...k])},[R,c]);return{data:i,reload:t,hasPrevPage:b,hasNextPage:R,prevPage:N,nextPage:H,loading:a,error:y,iterator:c}}U.AppPortal=Wt,U.SvixProvider=Lt,U.useAttemptFunctions=Zt,U.useAttemptedMessages=Vt,U.useEndpoint=Ht,U.useEndpointFunctions=qt,U.useEndpointHeaders=Yt,U.useEndpointMessageAttempts=Bt,U.useEndpointSecret=Dt,U.useEndpointStats=$t,U.useEndpoints=Nt,U.useEventTypes=Ut,U.useMessage=Xt,U.useMessageAttempts=Gt,U.useMessageEndpoints=Qt,U.useMessages=Jt,U.useNewEndpoint=Kt,U.useSvix=ee,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});