@makebot.it/react 1.0.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/dist/Bubble.d.ts +17 -0
- package/dist/Bubble.d.ts.map +1 -0
- package/dist/Popup.d.ts +15 -0
- package/dist/Popup.d.ts.map +1 -0
- package/dist/Standard.d.ts +18 -0
- package/dist/Standard.d.ts.map +1 -0
- package/dist/chunk-GFIEK2FB.js +1 -0
- package/dist/commands.d.ts +2 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/web.d.ts +2 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +1901 -0
- package/package.json +31 -0
package/dist/web.js
ADDED
|
@@ -0,0 +1,1901 @@
|
|
|
1
|
+
var jb=Object.create,Fs=Object.defineProperty,Bb=Object.getOwnPropertyDescriptor,zb=Object.getOwnPropertyNames,Vb=Object.getPrototypeOf,Hb=Object.prototype.hasOwnProperty,Zb=(e,t)=>()=>(e&&(t=e(e=0)),t),yt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gb=(e,t)=>{for(var r in t)Fs(e,r,{get:t[r],enumerable:!0})},Lh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of zb(t))!Hb.call(e,a)&&a!==r&&Fs(e,a,{get:()=>t[a],enumerable:!(n=Bb(t,a))||n.enumerable});return e},Fh=(e,t,r)=>(r=e!=null?jb(Vb(e)):{},Lh(t||!e||!e.__esModule?Fs(r,"default",{value:e,enumerable:!0}):r,e)),$s=e=>Lh(Fs({},"__esModule",{value:!0}),e),Wb=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(m)}var r="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",i=function(){for(var m=document.querySelectorAll('script[src^="'.concat(r,'"]')),v=0;v<m.length;v++){var w=m[v];if(n.test(w.src))return w}return null},o=function(m){var v=m&&!m.advancedFraudSignals?"?advancedFraudSignals=false":"",w=document.createElement("script");w.src="".concat(r).concat(v);var b=document.head||document.body;if(!b)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return b.appendChild(w),w},s=function(m,v){!m||!m._registerWrapper||m._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:v})},l=null,c=function(m){return l!==null||(l=new Promise(function(v,w){if(typeof window>"u"||typeof document>"u"){v(null);return}if(window.Stripe&&m&&console.warn(a),window.Stripe){v(window.Stripe);return}try{var b=i();b&&m?console.warn(a):b||(b=o(m)),b.addEventListener("load",function(){window.Stripe?v(window.Stripe):w(new Error("Stripe.js not available"))}),b.addEventListener("error",function(){w(new Error("Failed to load Stripe.js"))})}catch(x){w(x);return}})),l},u=function(m,v,w){if(m===null)return null;var b=m.apply(void 0,v);return s(b,w),b},d=function(m){var v=`invalid load parameters; expected object of shape
|
|
2
|
+
|
|
3
|
+
{advancedFraudSignals: boolean}
|
|
4
|
+
|
|
5
|
+
but received
|
|
6
|
+
|
|
7
|
+
`.concat(JSON.stringify(m),`
|
|
8
|
+
`);if(m===null||t(m)!=="object")throw new Error(v);if(Object.keys(m).length===1&&typeof m.advancedFraudSignals=="boolean")return m;throw new Error(v)},p,h=!1,y=function(){for(var m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];h=!0;var b=Date.now();return c(p).then(function(x){return u(x,v,b)})};y.setLoadParameters=function(m){if(h&&p){var v=d(m),w=Object.keys(v),b=w.reduce(function(x,f){var k;return x&&m[f]===((k=p)===null||k===void 0?void 0:k[f])},!0);if(b)return}if(h)throw new Error("You cannot change load parameters after calling loadStripe");p=d(m)},e.loadStripe=y}),qb=yt((e,t)=>{t.exports=Wb()}),Zi={};Gb(Zi,{__addDisposableResource:()=>lg,__assign:()=>Wa,__asyncDelegator:()=>eg,__asyncGenerator:()=>Qh,__asyncValues:()=>tg,__await:()=>ma,__awaiter:()=>Wh,__classPrivateFieldGet:()=>ig,__classPrivateFieldIn:()=>sg,__classPrivateFieldSet:()=>og,__createBinding:()=>li,__decorate:()=>jh,__disposeResources:()=>cg,__esDecorate:()=>zh,__exportStar:()=>Kh,__extends:()=>$h,__generator:()=>qh,__importDefault:()=>ag,__importStar:()=>ng,__makeTemplateObject:()=>rg,__metadata:()=>Gh,__param:()=>Bh,__propKey:()=>Hh,__read:()=>hu,__rest:()=>Uh,__rewriteRelativeImportExtension:()=>ug,__runInitializers:()=>Vh,__setFunctionName:()=>Zh,__spread:()=>Yh,__spreadArray:()=>Jh,__spreadArrays:()=>Xh,__values:()=>Ko,default:()=>hg});function $h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$o(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Uh(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function jh(e,t,r,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function Bh(e,t){return function(r,n){t(r,n,e)}}function zh(e,t,r,n,a,i){function o(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var s=n.kind,l=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),d,p=!1,h=r.length-1;h>=0;h--){var y={};for(var m in n)y[m]=m==="access"?{}:n[m];for(var m in n.access)y.access[m]=n.access[m];y.addInitializer=function(w){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(w||null))};var v=(0,r[h])(s==="accessor"?{get:u.get,set:u.set}:u[l],y);if(s==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(d=o(v.get))&&(u.get=d),(d=o(v.set))&&(u.set=d),(d=o(v.init))&&a.unshift(d)}else(d=o(v))&&(s==="field"?a.unshift(d):u[l]=d)}c&&Object.defineProperty(c,n.name,u),p=!0}function Vh(e,t,r){for(var n=arguments.length>2,a=0;a<t.length;a++)r=n?t[a].call(e,r):t[a].call(e);return n?r:void 0}function Hh(e){return typeof e=="symbol"?e:"".concat(e)}function Zh(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function Gh(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Wh(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(u){try{c(n.next(u))}catch(d){o(d)}}function l(u){try{c(n.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):a(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function qh(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,a=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Kh(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&li(t,e,r)}function Ko(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hu(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,i=[],o;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function Yh(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hu(arguments[t]));return e}function Xh(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],o=0,s=i.length;o<s;o++,a++)n[a]=i[o];return n}function Jh(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function ma(e){return this instanceof ma?(this.v=e,this):new ma(e)}function Qh(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,i=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(h){return function(y){return Promise.resolve(y).then(h,d)}}function s(h,y){n[h]&&(a[h]=function(m){return new Promise(function(v,w){i.push([h,m,v,w])>1||l(h,m)})},y&&(a[h]=y(a[h])))}function l(h,y){try{c(n[h](y))}catch(m){p(i[0][3],m)}}function c(h){h.value instanceof ma?Promise.resolve(h.value.v).then(u,d):p(i[0][2],h)}function u(h){l("next",h)}function d(h){l("throw",h)}function p(h,y){h(y),i.shift(),i.length&&l(i[0][0],i[0][1])}}function eg(e){var t,r;return t={},n("next"),n("throw",function(a){throw a}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(a,i){t[a]=e[a]?function(o){return(r=!r)?{value:ma(e[a](o)),done:!1}:i?i(o):o}:i}}function tg(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ko=="function"?Ko(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(s,l){o=e[i](o),a(s,l,o.done,o.value)})}}function a(i,o,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},o)}}function rg(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ng(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Uo(e),n=0;n<r.length;n++)r[n]!=="default"&&li(t,e,r[n]);return dg(t,e),t}function ag(e){return e&&e.__esModule?e:{default:e}}function ig(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function og(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}function sg(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function lg(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,a;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(a=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");a&&(n=function(){try{a.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function cg(e){function t(i){e.error=e.hasError?new pg(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var r,n=0;function a(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(a);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(a,function(o){return t(o),a()})}else n|=1}catch(o){t(o)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a()}function ug(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,a,i,o){return n?t?".jsx":".js":a&&(!i||!o)?r:a+i+"."+o.toLowerCase()+"js"}):e}var $o,Wa,li,dg,Uo,pg,hg,Us=Zb(()=>{$o=function(e,t){return $o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},$o(e,t)},Wa=function(){return Wa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Wa.apply(this,arguments)},li=Object.create?(function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),dg=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Uo=function(e){return Uo=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Uo(e)},pg=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n},hg={__extends:$h,__assign:Wa,__rest:Uh,__decorate:jh,__param:Bh,__esDecorate:zh,__runInitializers:Vh,__propKey:Hh,__setFunctionName:Zh,__metadata:Gh,__awaiter:Wh,__generator:qh,__createBinding:li,__exportStar:Kh,__values:Ko,__read:hu,__spread:Yh,__spreadArrays:Xh,__spreadArray:Jh,__await:ma,__asyncGenerator:Qh,__asyncDelegator:eg,__asyncValues:tg,__makeTemplateObject:rg,__importStar:ng,__importDefault:ag,__classPrivateFieldGet:ig,__classPrivateFieldSet:og,__classPrivateFieldIn:sg,__addDisposableResource:lg,__disposeResources:cg,__rewriteRelativeImportExtension:ug}}),Gi=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmBase=void 0;var t=class{constructor(r="Unknown",n=0){this.name=r,this.start=n}getType(){return"Unknown"}updateBySource(){}setSource(r){this.source=r,this.updateBySource()}updateByData(){}setData(r){this.data=r,this.updateByData()}getValue(){return this.data}setValue(r){this.setData(r)}};e.WebmBase=t}),gu=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SectionType=void 0;var t;(function(r){r.Container="Container",r.Uint="Uint",r.Int="Int",r.Float="Float",r.String="String",r.Date="Date",r.Binary="Binary"})(t||(e.SectionType=t={}))}),gg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sections=void 0;var t=gu();e.sections={172351395:{name:"EBML",type:t.SectionType.Container},646:{name:"EBMLVersion",type:t.SectionType.Uint},759:{name:"EBMLReadVersion",type:t.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:t.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:t.SectionType.Uint},642:{name:"DocType",type:t.SectionType.String},647:{name:"DocTypeVersion",type:t.SectionType.Uint},645:{name:"DocTypeReadVersion",type:t.SectionType.Uint},108:{name:"Void",type:t.SectionType.Binary},63:{name:"CRC-32",type:t.SectionType.Binary},190023271:{name:"SignatureSlot",type:t.SectionType.Container},16010:{name:"SignatureAlgo",type:t.SectionType.Uint},16026:{name:"SignatureHash",type:t.SectionType.Uint},16037:{name:"SignaturePublicKey",type:t.SectionType.Binary},16053:{name:"Signature",type:t.SectionType.Binary},15963:{name:"SignatureElements",type:t.SectionType.Container},15995:{name:"SignatureElementList",type:t.SectionType.Container},9522:{name:"SignedElement",type:t.SectionType.Binary},139690087:{name:"Segment",type:t.SectionType.Container},21863284:{name:"SeekHead",type:t.SectionType.Container},3515:{name:"Seek",type:t.SectionType.Container},5035:{name:"SeekID",type:t.SectionType.Binary},5036:{name:"SeekPosition",type:t.SectionType.Uint},88713574:{name:"Info",type:t.SectionType.Container},13220:{name:"SegmentUID",type:t.SectionType.Binary},13188:{name:"SegmentFilename",type:t.SectionType.String},1882403:{name:"PrevUID",type:t.SectionType.Binary},1868715:{name:"PrevFilename",type:t.SectionType.String},2013475:{name:"NextUID",type:t.SectionType.Binary},1999803:{name:"NextFilename",type:t.SectionType.String},1092:{name:"SegmentFamily",type:t.SectionType.Binary},10532:{name:"ChapterTranslate",type:t.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:t.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:t.SectionType.Uint},10661:{name:"ChapterTranslateID",type:t.SectionType.Binary},710577:{name:"TimecodeScale",type:t.SectionType.Uint},1161:{name:"Duration",type:t.SectionType.Float},1121:{name:"DateUTC",type:t.SectionType.Date},15273:{name:"Title",type:t.SectionType.String},3456:{name:"MuxingApp",type:t.SectionType.String},5953:{name:"WritingApp",type:t.SectionType.String},103:{name:"Timecode",type:t.SectionType.Uint},6228:{name:"SilentTracks",type:t.SectionType.Container},6359:{name:"SilentTrackNumber",type:t.SectionType.Uint},39:{name:"Position",type:t.SectionType.Uint},43:{name:"PrevSize",type:t.SectionType.Uint},35:{name:"SimpleBlock",type:t.SectionType.Binary},32:{name:"BlockGroup",type:t.SectionType.Container},33:{name:"Block",type:t.SectionType.Binary},34:{name:"BlockVirtual",type:t.SectionType.Binary},13729:{name:"BlockAdditions",type:t.SectionType.Container},38:{name:"BlockMore",type:t.SectionType.Container},110:{name:"BlockAddID",type:t.SectionType.Uint},37:{name:"BlockAdditional",type:t.SectionType.Binary},27:{name:"BlockDuration",type:t.SectionType.Uint},122:{name:"ReferencePriority",type:t.SectionType.Uint},123:{name:"ReferenceBlock",type:t.SectionType.Int},125:{name:"ReferenceVirtual",type:t.SectionType.Int},36:{name:"CodecState",type:t.SectionType.Binary},13730:{name:"DiscardPadding",type:t.SectionType.Int},14:{name:"Slices",type:t.SectionType.Container},104:{name:"TimeSlice",type:t.SectionType.Container},76:{name:"LaceNumber",type:t.SectionType.Uint},77:{name:"FrameNumber",type:t.SectionType.Uint},75:{name:"BlockAdditionID",type:t.SectionType.Uint},78:{name:"Delay",type:t.SectionType.Uint},79:{name:"SliceDuration",type:t.SectionType.Uint},72:{name:"ReferenceFrame",type:t.SectionType.Container},73:{name:"ReferenceOffset",type:t.SectionType.Uint},74:{name:"ReferenceTimeCode",type:t.SectionType.Uint},47:{name:"EncryptedBlock",type:t.SectionType.Binary},106212971:{name:"Tracks",type:t.SectionType.Container},46:{name:"TrackEntry",type:t.SectionType.Container},87:{name:"TrackNumber",type:t.SectionType.Uint},13253:{name:"TrackUID",type:t.SectionType.Uint},3:{name:"TrackType",type:t.SectionType.Uint},57:{name:"FlagEnabled",type:t.SectionType.Uint},8:{name:"FlagDefault",type:t.SectionType.Uint},5546:{name:"FlagForced",type:t.SectionType.Uint},28:{name:"FlagLacing",type:t.SectionType.Uint},11751:{name:"MinCache",type:t.SectionType.Uint},11768:{name:"MaxCache",type:t.SectionType.Uint},254851:{name:"DefaultDuration",type:t.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:t.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:t.SectionType.Float},4991:{name:"TrackOffset",type:t.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:t.SectionType.Uint},4974:{name:"Name",type:t.SectionType.String},177564:{name:"Language",type:t.SectionType.String},6:{name:"CodecID",type:t.SectionType.String},9122:{name:"CodecPrivate",type:t.SectionType.Binary},362120:{name:"CodecName",type:t.SectionType.String},13382:{name:"AttachmentLink",type:t.SectionType.Uint},1742487:{name:"CodecSettings",type:t.SectionType.String},1785920:{name:"CodecInfoURL",type:t.SectionType.String},438848:{name:"CodecDownloadURL",type:t.SectionType.String},42:{name:"CodecDecodeAll",type:t.SectionType.Uint},12203:{name:"TrackOverlay",type:t.SectionType.Uint},5802:{name:"CodecDelay",type:t.SectionType.Uint},5819:{name:"SeekPreRoll",type:t.SectionType.Uint},9764:{name:"TrackTranslate",type:t.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:t.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:t.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:t.SectionType.Binary},96:{name:"Video",type:t.SectionType.Container},26:{name:"FlagInterlaced",type:t.SectionType.Uint},5048:{name:"StereoMode",type:t.SectionType.Uint},5056:{name:"AlphaMode",type:t.SectionType.Uint},5049:{name:"OldStereoMode",type:t.SectionType.Uint},48:{name:"PixelWidth",type:t.SectionType.Uint},58:{name:"PixelHeight",type:t.SectionType.Uint},5290:{name:"PixelCropBottom",type:t.SectionType.Uint},5307:{name:"PixelCropTop",type:t.SectionType.Uint},5324:{name:"PixelCropLeft",type:t.SectionType.Uint},5341:{name:"PixelCropRight",type:t.SectionType.Uint},5296:{name:"DisplayWidth",type:t.SectionType.Uint},5306:{name:"DisplayHeight",type:t.SectionType.Uint},5298:{name:"DisplayUnit",type:t.SectionType.Uint},5299:{name:"AspectRatioType",type:t.SectionType.Uint},963876:{name:"ColourSpace",type:t.SectionType.Binary},1029411:{name:"GammaValue",type:t.SectionType.Float},230371:{name:"FrameRate",type:t.SectionType.Float},97:{name:"Audio",type:t.SectionType.Container},53:{name:"SamplingFrequency",type:t.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:t.SectionType.Float},31:{name:"Channels",type:t.SectionType.Uint},15739:{name:"ChannelPositions",type:t.SectionType.Binary},8804:{name:"BitDepth",type:t.SectionType.Uint},98:{name:"TrackOperation",type:t.SectionType.Container},99:{name:"TrackCombinePlanes",type:t.SectionType.Container},100:{name:"TrackPlane",type:t.SectionType.Container},101:{name:"TrackPlaneUID",type:t.SectionType.Uint},102:{name:"TrackPlaneType",type:t.SectionType.Uint},105:{name:"TrackJoinBlocks",type:t.SectionType.Container},109:{name:"TrackJoinUID",type:t.SectionType.Uint},64:{name:"TrickTrackUID",type:t.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:t.SectionType.Binary},70:{name:"TrickTrackFlag",type:t.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:t.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:t.SectionType.Binary},11648:{name:"ContentEncodings",type:t.SectionType.Container},8768:{name:"ContentEncoding",type:t.SectionType.Container},4145:{name:"ContentEncodingOrder",type:t.SectionType.Uint},4146:{name:"ContentEncodingScope",type:t.SectionType.Uint},4147:{name:"ContentEncodingType",type:t.SectionType.Uint},4148:{name:"ContentCompression",type:t.SectionType.Container},596:{name:"ContentCompAlgo",type:t.SectionType.Uint},597:{name:"ContentCompSettings",type:t.SectionType.Binary},4149:{name:"ContentEncryption",type:t.SectionType.Container},2017:{name:"ContentEncAlgo",type:t.SectionType.Uint},2018:{name:"ContentEncKeyID",type:t.SectionType.Binary},2019:{name:"ContentSignature",type:t.SectionType.Binary},2020:{name:"ContentSigKeyID",type:t.SectionType.Binary},2021:{name:"ContentSigAlgo",type:t.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:t.SectionType.Uint},206814059:{name:"Cues",type:t.SectionType.Container},59:{name:"CuePoint",type:t.SectionType.Container},51:{name:"CueTime",type:t.SectionType.Uint},55:{name:"CueTrackPositions",type:t.SectionType.Container},119:{name:"CueTrack",type:t.SectionType.Uint},113:{name:"CueClusterPosition",type:t.SectionType.Uint},112:{name:"CueRelativePosition",type:t.SectionType.Uint},50:{name:"CueDuration",type:t.SectionType.Uint},4984:{name:"CueBlockNumber",type:t.SectionType.Uint},106:{name:"CueCodecState",type:t.SectionType.Uint},91:{name:"CueReference",type:t.SectionType.Container},22:{name:"CueRefTime",type:t.SectionType.Uint},23:{name:"CueRefCluster",type:t.SectionType.Uint},4959:{name:"CueRefNumber",type:t.SectionType.Uint},107:{name:"CueRefCodecState",type:t.SectionType.Uint},155296873:{name:"Attachments",type:t.SectionType.Container},8615:{name:"AttachedFile",type:t.SectionType.Container},1662:{name:"FileDescription",type:t.SectionType.String},1646:{name:"FileName",type:t.SectionType.String},1632:{name:"FileMimeType",type:t.SectionType.String},1628:{name:"FileData",type:t.SectionType.Binary},1710:{name:"FileUID",type:t.SectionType.Uint},1653:{name:"FileReferral",type:t.SectionType.Binary},1633:{name:"FileUsedStartTime",type:t.SectionType.Uint},1634:{name:"FileUsedEndTime",type:t.SectionType.Uint},4433776:{name:"Chapters",type:t.SectionType.Container},1465:{name:"EditionEntry",type:t.SectionType.Container},1468:{name:"EditionUID",type:t.SectionType.Uint},1469:{name:"EditionFlagHidden",type:t.SectionType.Uint},1499:{name:"EditionFlagDefault",type:t.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:t.SectionType.Uint},54:{name:"ChapterAtom",type:t.SectionType.Container},13252:{name:"ChapterUID",type:t.SectionType.Uint},5716:{name:"ChapterStringUID",type:t.SectionType.String},17:{name:"ChapterTimeStart",type:t.SectionType.Uint},18:{name:"ChapterTimeEnd",type:t.SectionType.Uint},24:{name:"ChapterFlagHidden",type:t.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:t.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:t.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:t.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:t.SectionType.Uint},15:{name:"ChapterTrack",type:t.SectionType.Container},9:{name:"ChapterTrackNumber",type:t.SectionType.Uint},0:{name:"ChapterDisplay",type:t.SectionType.Container},5:{name:"ChapString",type:t.SectionType.String},892:{name:"ChapLanguage",type:t.SectionType.String},894:{name:"ChapCountry",type:t.SectionType.String},10564:{name:"ChapProcess",type:t.SectionType.Container},10581:{name:"ChapProcessCodecID",type:t.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:t.SectionType.Binary},10513:{name:"ChapProcessCommand",type:t.SectionType.Container},10530:{name:"ChapProcessTime",type:t.SectionType.Uint},10547:{name:"ChapProcessData",type:t.SectionType.Binary},39109479:{name:"Tags",type:t.SectionType.Container},13171:{name:"Tag",type:t.SectionType.Container},9152:{name:"Targets",type:t.SectionType.Container},10442:{name:"TargetTypeValue",type:t.SectionType.Uint},9162:{name:"TargetType",type:t.SectionType.String},9157:{name:"TagTrackUID",type:t.SectionType.Uint},9161:{name:"TagEditionUID",type:t.SectionType.Uint},9156:{name:"TagChapterUID",type:t.SectionType.Uint},9158:{name:"TagAttachmentUID",type:t.SectionType.Uint},10184:{name:"SimpleTag",type:t.SectionType.Container},1443:{name:"TagName",type:t.SectionType.String},1146:{name:"TagLanguage",type:t.SectionType.String},1156:{name:"TagDefault",type:t.SectionType.Uint},1159:{name:"TagString",type:t.SectionType.String},1157:{name:"TagBinary",type:t.SectionType.Binary},5552:{name:"Colour",type:t.SectionType.Container},5553:{name:"MatrixCoefficients",type:t.SectionType.Uint},5554:{name:"BitsPerChannel",type:t.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:t.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:t.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:t.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:t.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:t.SectionType.Uint},5560:{name:"ChromaSitingVert",type:t.SectionType.Uint},5561:{name:"Range",type:t.SectionType.Uint},5562:{name:"TransferCharacteristics",type:t.SectionType.Uint},5563:{name:"Primaries",type:t.SectionType.Uint},5564:{name:"MaxCLL",type:t.SectionType.Uint},5565:{name:"MaxFALL",type:t.SectionType.Uint}}}),mg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmUint=void 0;var t=Gi();function r(a){return a.length%2===1?"0"+a:a}var n=class extends t.WebmBase{constructor(a,i=0){super(a,i)}getType(){return"Uint"}updateBySource(){this.data="";for(let a=0;a<this.source.length;a++){let i=this.source[a].toString(16);this.data+=r(i)}}updateByData(){let a=this.data.length/2;this.source=new Uint8Array(a);for(let i=0;i<a;i++){let o=this.data.substring(i*2,i*2+2);this.source[i]=parseInt(o,16)}}getValue(){return parseInt(this.data,16)}setValue(a){this.setData(r(a.toString(16)))}};e.WebmUint=n}),fg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmFloat=void 0;var t=Gi(),r=class extends t.WebmBase{constructor(n,a=0){super(n,a)}getType(){return"Float"}getFloatArrayType(){return this.source&&this.source.length===4?Float32Array:Float64Array}updateBySource(){let n=this.source.reverse(),a=this.getFloatArrayType(),i=new a(n.buffer);this.data=i[0]}updateByData(){let n=this.getFloatArrayType(),a=new n([this.data]),i=new Uint8Array(a.buffer);this.source=i.reverse()}};e.WebmFloat=r}),bg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmString=void 0;var t=Gi(),r=class extends t.WebmBase{constructor(n,a=0){super(n,a)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let n="";return this.source.forEach(a=>{n+=String.fromCharCode(a)}),n}};e.WebmString=r}),yg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmContainer=void 0;var t=Gi(),r=gg(),n=gu(),a=mg(),i=fg(),o=bg(),s=class tc extends t.WebmBase{constructor(c,u=!1,d=0){super(c,d),this.isInfinite=u,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){let c=this.readByte(),u=8-c.toString(2).length,d=c-(1<<7-u);for(let p=0;p<u;p++)d<<=8,d|=this.readByte();return d}updateBySource(){var c;this.data=[];let u;for(this.offset=0;this.offset<this.source.length;this.offset=u){let d=this.offset,p=this.readUint(),{name:h,type:y}=(c=r.sections[p])!==null&&c!==void 0?c:{},m=this.readUint();u=this.source.length,m>=0&&(u=Math.min(this.offset+m,u));let v=this.source.slice(this.offset,u),w;switch(y){case n.SectionType.Container:w=new tc(h,m<0,d);break;case n.SectionType.Uint:w=new a.WebmUint(h,d);break;case n.SectionType.Float:w=new i.WebmFloat(h,d);break;case n.SectionType.String:w=new o.WebmString(h,d);break;default:w=new t.WebmBase(h,d);break}w.setSource(v),this.data.push({id:p,idHex:p.toString(16),data:w})}}writeUint(c,u=!1){let d;for(d=1;(c<0||c>=1<<7*d)&&d<8;d++);if(!u){for(let p=0;p<d;p++)this.source[this.offset+p]=c>>8*(d-1-p)&255;this.source[this.offset]&=(1<<8-d)-1,this.source[this.offset]|=1<<8-d}this.offset+=d}writeSections(c=!1){this.offset=0;for(let u=0;u<this.data.length;u++){let d=this.data[u],p=d.data.source,h=p.length;this.writeUint(d.id,c),this.writeUint(d.data instanceof tc&&d.data.isInfinite?-1:h,c),c||this.source.set(p,this.offset),this.offset+=h}return this.offset}updateByData(){let c=this.writeSections(!0);this.source=new Uint8Array(c),this.writeSections()}getSectionById(c){for(let u=0;u<this.data.length;u++){let d=this.data[u];if(d.id===c)return d.data}return null}};e.WebmContainer=s}),Kb=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebmFile=void 0;var t=(Us(),$s(Zi)),r=yg(),n=class rc extends r.WebmContainer{constructor(i){super("File"),this.setSource(i)}getType(){return"File"}toBlob(i="video/webm"){return new Blob([this.source.buffer],{type:i})}static blobToArray(i){return new Promise((o,s)=>{try{let l=new FileReader;l.onloadend=()=>{try{o(new Uint8Array(l.result))}catch(c){s(c)}},l.readAsArrayBuffer(i)}catch(l){s(l)}})}static fromBlob(i){return t.__awaiter(this,void 0,void 0,function*(){let o=yield rc.blobToArray(i);return new rc(o)})}};e.WebmFile=n}),Yb=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})}),vg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=(Us(),$s(Zi));t.__exportStar(Gi(),e),t.__exportStar(yg(),e),t.__exportStar(Kb(),e),t.__exportStar(fg(),e),t.__exportStar(bg(),e),t.__exportStar(mg(),e),t.__exportStar(gu(),e),t.__exportStar(Yb(),e),t.__exportStar(gg(),e)}),xg=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fixParsedWebmDuration=void 0;var t=vg(),r=(n,a,i={})=>{let o=i.logger;o===void 0?o=d=>console.debug(d):o||(o=()=>{});let s=n.getSectionById(139690087);if(!s)return o("[fix-webm-duration] Segment section is missing"),!1;let l=s.getSectionById(88713574);if(!l)return o("[fix-webm-duration] Info section is missing"),!1;let c=l.getSectionById(710577);if(!c)return o("[fix-webm-duration] TimecodeScale section is missing"),!1;let u=l.getSectionById(1161);if(u)if(u.getValue()<=0)o(`[fix-webm-duration] Duration section is present, but the value is ${u.getValue()}`),u.setValue(a);else return o(`[fix-webm-duration] Duration section is present, and the value is ${u.getValue()}`),!1;else o("[fix-webm-duration] Duration section is missing"),u=new t.WebmFloat("Duration"),u.setValue(a),l.data.push({id:1161,data:u});return c.setValue(1e6),l.updateByData(),s.updateByData(),n.updateByData(),!0};e.fixParsedWebmDuration=r}),Xb=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fixWebmDuration=void 0;var t=(Us(),$s(Zi)),r=vg(),n=xg(),a=(i,o,s)=>t.__awaiter(void 0,void 0,void 0,function*(){try{let l=yield r.WebmFile.fromBlob(i);if((0,n.fixParsedWebmDuration)(l,o,s))return l.toBlob(i.type)}catch{}return i});e.fixWebmDuration=a}),Jb=yt(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=(Us(),$s(Zi));t.__exportStar(Xb(),e),t.__exportStar(xg(),e)});function Qb(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return t[r]=Object.assign({},n),kg(n.value)&&!ay(n.value)&&!Array.isArray(n.value)&&(t[r].value=Object.assign({},n.value)),Array.isArray(n.value)&&(t[r].value=n.value.slice(0)),t},{})}function ey(e){return e?Object.keys(e).reduce((t,r)=>{let n=e[r];return t[r]=kg(n)&&"value"in n?n:{value:n},t[r].attribute||(t[r].attribute=ny(r)),t[r].parse="parse"in t[r]?t[r].parse:typeof t[r].value!="string",t},{}):{}}function ty(e){return Object.keys(e).reduce((t,r)=>(t[r]=e[r].value,t),{})}function ry(e,t){let r=Qb(t);return Object.keys(t).forEach(n=>{let a=r[n],i=e.getAttribute(a.attribute),o=e[n];i!=null&&(a.value=a.parse?wg(i):i),o!=null&&(a.value=Array.isArray(o)?o.slice(0):o),a.reflect&&kd(e,a.attribute,a.value,!!a.parse),Object.defineProperty(e,n,{get(){return a.value},set(s){let l=a.value;a.value=s,a.reflect&&kd(this,a.attribute,a.value,!!a.parse);for(let c=0,u=this.__propertyChangedCallbacks.length;c<u;c++)this.__propertyChangedCallbacks[c](n,s,l)},enumerable:!0,configurable:!0})}),r}function wg(e){if(e)try{return JSON.parse(e)}catch{return e}}function kd(e,t,r,n){if(r==null||r===!1)return e.removeAttribute(t);let a=n?JSON.stringify(r):r;e.__updating[t]=!0,a==="true"&&(a=""),e.setAttribute(t,a),Promise.resolve().then(()=>delete e.__updating[t])}function ny(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function kg(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ay(e){return Object.prototype.toString.call(e)==="[object Function]"}function iy(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var hl;function oy(e,t){let r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(n=>t[n].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let n of r)this[n]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=ry(this,t);let n=ty(this.props),a=this.Component,i=hl;try{hl=this,this.__initialized=!0,iy(a)?new a(n,{element:this}):a(n,{element:this})}finally{hl=i}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let n=null;for(;n=this.__releaseCallbacks.pop();)n(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(n,a,i){if(this.__initialized&&!this.__updating[n]&&(n=this.lookupProp(n),n in t)){if(i==null&&!this[n])return;this[n]=t[n].parse?wg(i):i}}lookupProp(n){if(t)return r.find(a=>n===a||n===t[a].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(n){this.__releaseCallbacks.push(n)}addPropertyChangedCallback(n){this.__propertyChangedCallbacks.push(n)}}}function sy(e,t={},r={}){let{BaseElement:n=HTMLElement,extension:a,customElements:i=window.customElements}=r;return o=>{if(!e)throw new Error("tag is required to register a Component");let s=i.get(e);return s?(s.prototype.Component=o,s):(s=oy(n,ey(t)),s.prototype.Component=o,s.prototype.registeredTag=e,i.define(e,s,a),s)}}var Ne={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return _d(this.context.count)},getNextContextId(){return _d(this.context.count++)}};function _d(e){let t=String(e),r=t.length-1;return Ne.context.id+(r?String.fromCharCode(96+r):"")+t}function nc(e){Ne.context=e}function ly(){return{...Ne.context,id:Ne.getNextContextId(),count:0}}var cy=(e,t)=>e===t,ci=Symbol("solid-proxy"),_g=typeof Proxy=="function",mu=Symbol("solid-track"),Yo={equals:cy},Td=null,Tg=Pg,At=1,ui=2,Sg={owned:null,cleanups:null,context:null,owner:null},Ce=null,Z=null,Wi=null,pa=null,Ue=null,Qe=null,dt=null,js=0;function _r(e,t){let r=Ue,n=Ce,a=e.length===0,i=t===void 0?n:t,o=a?Sg:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=a?e:()=>e(()=>nt(()=>Xr(o)));Ce=o,Ue=null;try{return or(s,!0)}finally{Ue=r,Ce=n}}function N(e,t){t=t?Object.assign({},Yo,t):Yo;let r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=a=>(typeof a=="function"&&(Z&&Z.running&&Z.sources.has(r)?a=a(r.tValue):a=a(r.value)),Cg(r,a));return[Eg.bind(r),n]}function U(e,t,r){let n=yu(e,t,!1,At);Wi&&Z&&Z.running?Qe.push(n):qi(n)}function Ye(e,t,r){Tg=gy;let n=yu(e,t,!1,At),a=ic&&Bs(ic);a&&(n.suspense=a),(!r||!r.render)&&(n.user=!0),dt?dt.push(n):qi(n)}function he(e,t,r){r=r?Object.assign({},Yo,r):Yo;let n=yu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Wi&&Z&&Z.running?(n.tState=At,Qe.push(n)):qi(n),Eg.bind(n)}function nt(e){if(!pa&&Ue===null)return e();let t=Ue;Ue=null;try{return pa?pa.untrack(e):e()}finally{Ue=t}}function $e(e){Ye(()=>nt(e))}function Ie(e){return Ce===null||(Ce.cleanups===null?Ce.cleanups=[e]:Ce.cleanups.push(e)),e}function ac(){return Ce}function uy(e,t){let r=Ce,n=Ue;Ce=e,Ue=null;try{return or(t,!0)}catch(a){zs(a)}finally{Ce=r,Ue=n}}function dy(e){if(Z&&Z.running)return e(),Z.done;let t=Ue,r=Ce;return Promise.resolve().then(()=>{Ue=t,Ce=r;let n;return(Wi||ic)&&(n=Z||(Z={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),n.done||(n.done=new Promise(a=>n.resolve=a)),n.running=!0),or(e,!1),Ue=Ce=null,n?n.done:void 0})}var[RN,Sd]=N(!1);function fu(e,t){let r=Symbol("context");return{id:r,Provider:fy(r),defaultValue:e}}function Bs(e){let t;return Ce&&Ce.context&&(t=Ce.context[e.id])!==void 0?t:e.defaultValue}function bu(e){let t=he(e),r=he(()=>oc(t()));return r.toArray=()=>{let n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var ic;function Eg(){let e=Z&&Z.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===At)qi(this);else{let t=Qe;Qe=null,or(()=>Xo(this),!1),Qe=t}if(Ue){let t=this.observers?this.observers.length:0;Ue.sources?(Ue.sources.push(this),Ue.sourceSlots.push(t)):(Ue.sources=[this],Ue.sourceSlots=[t]),this.observers?(this.observers.push(Ue),this.observerSlots.push(Ue.sources.length-1)):(this.observers=[Ue],this.observerSlots=[Ue.sources.length-1])}return e&&Z.sources.has(this)?this.tValue:this.value}function Cg(e,t,r){let n=Z&&Z.running&&Z.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(n,t)){if(Z){let a=Z.running;(a||!r&&Z.sources.has(e))&&(Z.sources.add(e),e.tValue=t),a||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&or(()=>{for(let a=0;a<e.observers.length;a+=1){let i=e.observers[a],o=Z&&Z.running;o&&Z.disposed.has(i)||((o?!i.tState:!i.state)&&(i.pure?Qe.push(i):dt.push(i),i.observers&&Og(i)),o?i.tState=At:i.state=At)}if(Qe.length>1e6)throw Qe=[],new Error},!1)}return t}function qi(e){if(!e.fn)return;Xr(e);let t=js;Ed(e,Z&&Z.running&&Z.sources.has(e)?e.tValue:e.value,t),Z&&!Z.running&&Z.sources.has(e)&&queueMicrotask(()=>{or(()=>{Z&&(Z.running=!0),Ue=Ce=e,Ed(e,e.tValue,t),Ue=Ce=null},!1)})}function Ed(e,t,r){let n,a=Ce,i=Ue;Ue=Ce=e;try{n=e.fn(t)}catch(o){return e.pure&&(Z&&Z.running?(e.tState=At,e.tOwned&&e.tOwned.forEach(Xr),e.tOwned=void 0):(e.state=At,e.owned&&e.owned.forEach(Xr),e.owned=null)),e.updatedAt=r+1,zs(o)}finally{Ue=i,Ce=a}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Cg(e,n,!0):Z&&Z.running&&e.pure?(Z.sources.add(e),e.tValue=n):e.value=n,e.updatedAt=r)}function yu(e,t,r,n=At,a){let i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ce,context:Ce?Ce.context:null,pure:r};if(Z&&Z.running&&(i.state=0,i.tState=n),Ce===null||Ce!==Sg&&(Z&&Z.running&&Ce.pure?Ce.tOwned?Ce.tOwned.push(i):Ce.tOwned=[i]:Ce.owned?Ce.owned.push(i):Ce.owned=[i]),pa&&i.fn){let[o,s]=N(void 0,{equals:!1}),l=pa.factory(i.fn,s);Ie(()=>l.dispose());let c=()=>dy(s).then(()=>u.dispose()),u=pa.factory(i.fn,c);i.fn=d=>(o(),Z&&Z.running?u.track(d):l.track(d))}return i}function di(e){let t=Z&&Z.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===ui)return Xo(e);if(e.suspense&&nt(e.suspense.inFallback))return e.suspense.effects.push(e);let r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<js);){if(t&&Z.disposed.has(e))return;(t?e.tState:e.state)&&r.push(e)}for(let n=r.length-1;n>=0;n--){if(e=r[n],t){let a=e,i=r[n+1];for(;(a=a.owner)&&a!==i;)if(Z.disposed.has(a))return}if((t?e.tState:e.state)===At)qi(e);else if((t?e.tState:e.state)===ui){let a=Qe;Qe=null,or(()=>Xo(e,r[0]),!1),Qe=a}}}function or(e,t){if(Qe)return e();let r=!1;t||(Qe=[]),dt?r=!0:dt=[],js++;try{let n=e();return py(r),n}catch(n){r||(dt=null),Qe=null,zs(n)}}function py(e){if(Qe&&(Wi&&Z&&Z.running?hy(Qe):Pg(Qe),Qe=null),e)return;let t;if(Z){if(!Z.promises.size&&!Z.queue.size){let n=Z.sources,a=Z.disposed;dt.push.apply(dt,Z.effects),t=Z.resolve;for(let i of dt)"tState"in i&&(i.state=i.tState),delete i.tState;Z=null,or(()=>{for(let i of a)Xr(i);for(let i of n){if(i.value=i.tValue,i.owned)for(let o=0,s=i.owned.length;o<s;o++)Xr(i.owned[o]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}Sd(!1)},!1)}else if(Z.running){Z.running=!1,Z.effects.push.apply(Z.effects,dt),dt=null,Sd(!0);return}}let r=dt;dt=null,r.length&&or(()=>Tg(r),!1),t&&t()}function Pg(e){for(let t=0;t<e.length;t++)di(e[t])}function hy(e){for(let t=0;t<e.length;t++){let r=e[t],n=Z.queue;n.has(r)||(n.add(r),Wi(()=>{n.delete(r),or(()=>{Z.running=!0,di(r)},!1),Z&&(Z.running=!1)}))}}function gy(e){let t,r=0;for(t=0;t<e.length;t++){let n=e[t];n.user?e[r++]=n:di(n)}if(Ne.context){if(Ne.count){Ne.effects||(Ne.effects=[]),Ne.effects.push(...e.slice(0,r));return}nc()}for(Ne.effects&&(Ne.done||!Ne.count)&&(e=[...Ne.effects,...e],r+=Ne.effects.length,delete Ne.effects),t=0;t<r;t++)di(e[t])}function Xo(e,t){let r=Z&&Z.running;r?e.tState=0:e.state=0;for(let n=0;n<e.sources.length;n+=1){let a=e.sources[n];if(a.sources){let i=r?a.tState:a.state;i===At?a!==t&&(!a.updatedAt||a.updatedAt<js)&&di(a):i===ui&&Xo(a,t)}}}function Og(e){let t=Z&&Z.running;for(let r=0;r<e.observers.length;r+=1){let n=e.observers[r];(t?!n.tState:!n.state)&&(t?n.tState=ui:n.state=ui,n.pure?Qe.push(n):dt.push(n),n.observers&&Og(n))}}function Xr(e){let t;if(e.sources)for(;e.sources.length;){let r=e.sources.pop(),n=e.sourceSlots.pop(),a=r.observers;if(a&&a.length){let i=a.pop(),o=r.observerSlots.pop();n<a.length&&(i.sourceSlots[o]=n,a[n]=i,r.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Xr(e.tOwned[t]);delete e.tOwned}if(Z&&Z.running&&e.pure)Ig(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Z&&Z.running?e.tState=0:e.state=0}function Ig(e,t){if(t||(e.tState=0,Z.disposed.add(e)),e.owned)for(let r=0;r<e.owned.length;r++)Ig(e.owned[r])}function my(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Cd(e,t,r){try{for(let n of t)n(e)}catch(n){zs(n,r&&r.owner||null)}}function zs(e,t=Ce){let r=Td&&t&&t.context&&t.context[Td],n=my(e);if(!r)throw n;dt?dt.push({fn(){Cd(n,r,t)},state:At}):Cd(n,r,t)}function oc(e){if(typeof e=="function"&&!e.length)return oc(e());if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=oc(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function fy(e,t){return function(r){let n;return U(()=>n=nt(()=>(Ce.context={...Ce.context,[e]:r.value},bu(()=>r.children))),void 0),n}}var sc=Symbol("fallback");function Jo(e){for(let t=0;t<e.length;t++)e[t]()}function by(e,t,r={}){let n=[],a=[],i=[],o=0,s=t.length>1?[]:null;return Ie(()=>Jo(i)),()=>{let l=e()||[],c=l.length,u,d;return l[mu],nt(()=>{let h,y,m,v,w,b,x,f,k;if(c===0)o!==0&&(Jo(i),i=[],n=[],a=[],o=0,s&&(s=[])),r.fallback&&(n=[sc],a[0]=_r(_=>(i[0]=_,r.fallback())),o=1);else if(o===0){for(a=new Array(c),d=0;d<c;d++)n[d]=l[d],a[d]=_r(p);o=c}else{for(m=new Array(c),v=new Array(c),s&&(w=new Array(c)),b=0,x=Math.min(o,c);b<x&&n[b]===l[b];b++);for(x=o-1,f=c-1;x>=b&&f>=b&&n[x]===l[f];x--,f--)m[f]=a[x],v[f]=i[x],s&&(w[f]=s[x]);for(h=new Map,y=new Array(f+1),d=f;d>=b;d--)k=l[d],u=h.get(k),y[d]=u===void 0?-1:u,h.set(k,d);for(u=b;u<=x;u++)k=n[u],d=h.get(k),d!==void 0&&d!==-1?(m[d]=a[u],v[d]=i[u],s&&(w[d]=s[u]),d=y[d],h.set(k,d)):i[u]();for(d=b;d<c;d++)d in m?(a[d]=m[d],i[d]=v[d],s&&(s[d]=w[d],s[d](d))):a[d]=_r(p);a=a.slice(0,o=c),n=l.slice(0)}return a});function p(h){if(i[d]=h,s){let[y,m]=N(d);return s[d]=m,t(l[d],y)}return t(l[d])}}}function yy(e,t,r={}){let n=[],a=[],i=[],o=[],s=0,l;return Ie(()=>Jo(i)),()=>{let c=e()||[],u=c.length;return c[mu],nt(()=>{if(u===0)return s!==0&&(Jo(i),i=[],n=[],a=[],s=0,o=[]),r.fallback&&(n=[sc],a[0]=_r(p=>(i[0]=p,r.fallback())),s=1),a;for(n[0]===sc&&(i[0](),i=[],n=[],a=[],s=0),l=0;l<u;l++)l<n.length&&n[l]!==c[l]?o[l](()=>c[l]):l>=n.length&&(a[l]=_r(d));for(;l<n.length;l++)i[l]();return s=o.length=i.length=u,n=c.slice(0),a=a.slice(0,s)});function d(p){i[l]=p;let[h,y]=N(c[l]);return o[l]=y,t(h,l)}}}var vy=!1;function g(e,t){if(vy&&Ne.context){let r=Ne.context;nc(ly());let n=nt(()=>e(t||{}));return nc(r),n}return nt(()=>e(t||{}))}function mo(){return!0}var lc={get(e,t,r){return t===ci?r:e.get(t)},has(e,t){return t===ci?!0:e.has(t)},set:mo,deleteProperty:mo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:mo,deleteProperty:mo}},ownKeys(e){return e.keys()}};function gl(e){return(e=typeof e=="function"?e():e)?e:{}}function xy(){for(let e=0,t=this.length;e<t;++e){let r=this[e]();if(r!==void 0)return r}}function De(...e){let t=!1;for(let o=0;o<e.length;o++){let s=e[o];t=t||!!s&&ci in s,e[o]=typeof s=="function"?(t=!0,he(s)):s}if(_g&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){let l=gl(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in gl(e[s]))return!0;return!1},keys(){let o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(gl(e[s])));return[...new Set(o)]}},lc);let r={},n=Object.create(null);for(let o=e.length-1;o>=0;o--){let s=e[o];if(!s)continue;let l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){let u=l[c];if(u==="__proto__"||u==="constructor")continue;let d=Object.getOwnPropertyDescriptor(s,u);if(!n[u])n[u]=d.get?{enumerable:!0,configurable:!0,get:xy.bind(r[u]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{let p=r[u];p&&(d.get?p.push(d.get.bind(s)):d.value!==void 0&&p.push(()=>d.value))}}}let a={},i=Object.keys(n);for(let o=i.length-1;o>=0;o--){let s=i[o],l=n[s];l&&l.get?Object.defineProperty(a,s,l):a[s]=l?l.value:void 0}return a}function Rt(e,...t){if(_g&&ci in e){let a=new Set(t.length>1?t.flat():t[0]),i=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},lc));return i.push(new Proxy({get(o){return a.has(o)?void 0:e[o]},has(o){return a.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!a.has(o))}},lc)),i}let r={},n=t.map(()=>({}));for(let a of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,a),o=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=!1,l=0;for(let c of t)c.includes(a)&&(s=!0,o?n[l][a]=i.value:Object.defineProperty(n[l],a,i)),++l;s||(o?r[a]=i.value:Object.defineProperty(r,a,i))}return[...n,r]}var wy=0;function qt(){return Ne.context?Ne.getNextContextId():`cl-${wy++}`}var Ng=e=>`Stale read from <${e}>.`;function Je(e){let t="fallback"in e&&{fallback:()=>e.fallback};return he(by(()=>e.each,e.children,t||void 0))}function Ag(e){let t="fallback"in e&&{fallback:()=>e.fallback};return he(yy(()=>e.each,e.children,t||void 0))}function X(e){let t=e.keyed,r=he(()=>e.when,void 0,void 0),n=t?r:he(r,void 0,{equals:(a,i)=>!a==!i});return he(()=>{let a=n();if(a){let i=e.children;return typeof i=="function"&&i.length>0?nt(()=>i(t?a:()=>{if(!nt(n))throw Ng("Show");return r()})):i}return e.fallback},void 0,void 0)}function lt(e){let t=bu(()=>e.children),r=he(()=>{let n=t(),a=Array.isArray(n)?n:[n],i=()=>{};for(let o=0;o<a.length;o++){let s=o,l=a[o],c=i,u=he(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:he(u,void 0,{equals:(p,h)=>!p==!h});i=()=>c()||(d()?[s,u,l]:void 0)}return i});return he(()=>{let n=r()();if(!n)return e.fallback;let[a,i,o]=n,s=o.children;return typeof s=="function"&&s.length>0?nt(()=>s(o.keyed?i():()=>{if(nt(r)()?.[0]!==a)throw Ng("Match");return i()})):s},void 0,void 0)}function se(e){return e}var ky=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],_y=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...ky]),Ty=new Set(["innerHTML","textContent","innerText","children"]),Sy=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Ey=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Cy(e,t){let r=Ey[e];return typeof r=="object"?r[t]?r.$:void 0:r}var Py=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Oy=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Iy={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},j=e=>he(()=>e());function Ny(e,t,r){let n=r.length,a=t.length,i=n,o=0,s=0,l=t[a-1].nextSibling,c=null;for(;o<a||s<i;){if(t[o]===r[s]){o++,s++;continue}for(;t[a-1]===r[i-1];)a--,i--;if(a===o){let u=i<n?s?r[s-1].nextSibling:r[i-s]:l;for(;s<i;)e.insertBefore(r[s++],u)}else if(i===s)for(;o<a;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===r[i-1]&&r[s]===t[a-1]){let u=t[--a].nextSibling;e.insertBefore(r[s++],t[o++].nextSibling),e.insertBefore(r[--i],u),t[a]=r[i]}else{if(!c){c=new Map;let d=s;for(;d<i;)c.set(r[d],d++)}let u=c.get(t[o]);if(u!=null)if(s<u&&u<i){let d=o,p=1,h;for(;++d<a&&d<i&&!((h=c.get(t[d]))==null||h!==u+p);)p++;if(p>u-s){let y=t[o];for(;s<u;)e.insertBefore(r[s++],y)}else e.replaceChild(r[s++],t[o++])}else o++;else t[o++].remove()}}}var Pd="_$DX_DELEGATE";function E(e,t,r,n){let a,i=()=>{let s=n?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,r?s.content.firstChild.firstChild:n?s.firstChild:s.content.firstChild},o=t?()=>nt(()=>document.importNode(a||(a=i()),!0)):()=>(a||(a=i())).cloneNode(!0);return o.cloneNode=o,o}function at(e,t=window.document){let r=t[Pd]||(t[Pd]=new Set);for(let n=0,a=e.length;n<a;n++){let i=e[n];r.has(i)||(r.add(i),t.addEventListener(i,$y))}}function de(e,t,r){Un(e)||(r==null?e.removeAttribute(t):e.setAttribute(t,r))}function Ay(e,t,r,n){Un(e)||(n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n))}function Ry(e,t,r){Un(e)||(r?e.setAttribute(t,""):e.removeAttribute(t))}function ne(e,t){Un(e)||(t==null?e.removeAttribute("class"):e.className=t)}function sr(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){let a=r[0];e.addEventListener(t,r[0]=i=>a.call(e,r[1],i))}else e.addEventListener(t,r,typeof r!="function"&&r)}function Dy(e,t,r={}){let n=Object.keys(t||{}),a=Object.keys(r),i,o;for(i=0,o=a.length;i<o;i++){let s=a[i];!s||s==="undefined"||t[s]||(Od(e,s,!1),delete r[s])}for(i=0,o=n.length;i<o;i++){let s=n[i],l=!!t[s];!s||s==="undefined"||r[s]===l||!l||(Od(e,s,!0),r[s]=l)}return r}function vu(e,t,r){if(!t)return r?de(e,"style"):t;let n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let a,i;for(i in r)t[i]==null&&n.removeProperty(i),delete r[i];for(i in t)a=t[i],a!==r[i]&&(n.setProperty(i,a),r[i]=a);return r}function we(e,t,r){r!=null?e.style.setProperty(t,r):e.style.removeProperty(t)}function Ke(e,t={},r,n){let a={};return n||U(()=>a.children=fa(e,t.children,a.children)),U(()=>typeof t.ref=="function"&&Ve(t.ref,e)),U(()=>My(e,t,r,!0,a,!0)),a}function Ve(e,t,r){return nt(()=>e(t,r))}function T(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return fa(e,t,n,r);U(a=>fa(e,t(),a,r),n)}function My(e,t,r,n,a={},i=!1){t||(t={});for(let o in a)if(!(o in t)){if(o==="children")continue;a[o]=Id(e,o,null,a[o],r,i,t)}for(let o in t){if(o==="children"){n||fa(e,t.children);continue}let s=t[o];a[o]=Id(e,o,s,a[o],r,i,t)}}function Ly(e){let t,r;return!Un()||!(t=Ne.registry.get(r=Uy()))?e():(Ne.completed&&Ne.completed.add(t),Ne.registry.delete(r),t)}function Un(e){return!!Ne.context&&!Ne.done&&(!e||e.isConnected)}function Fy(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Od(e,t,r){let n=t.trim().split(/\s+/);for(let a=0,i=n.length;a<i;a++)e.classList.toggle(n[a],r)}function Id(e,t,r,n,a,i,o){let s,l,c,u,d;if(t==="style")return vu(e,r,n);if(t==="classList")return Dy(e,r,n);if(r===n)return n;if(t==="ref")i||r(e);else if(t.slice(0,3)==="on:"){let p=t.slice(3);n&&e.removeEventListener(p,n,typeof n!="function"&&n),r&&e.addEventListener(p,r,typeof r!="function"&&r)}else if(t.slice(0,10)==="oncapture:"){let p=t.slice(10);n&&e.removeEventListener(p,n,!0),r&&e.addEventListener(p,r,!0)}else if(t.slice(0,2)==="on"){let p=t.slice(2).toLowerCase(),h=Py.has(p);if(!h&&n){let y=Array.isArray(n)?n[0]:n;e.removeEventListener(p,y)}(h||r)&&(sr(e,p,r,h),h&&at([p]))}else if(t.slice(0,5)==="attr:")de(e,t.slice(5),r);else if(t.slice(0,5)==="bool:")Ry(e,t.slice(5),r);else if((d=t.slice(0,5)==="prop:")||(c=Ty.has(t))||!a&&((u=Cy(t,e.tagName))||(l=_y.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Un(e))return r;t==="class"||t==="className"?ne(e,r):s&&!l&&!c?e[Fy(t)]=r:e[u||t]=r}else{let p=a&&t.indexOf(":")>-1&&Iy[t.split(":")[0]];p?Ay(e,p,t,r):de(e,Sy[t]||t,r)}return r}function $y(e){if(Ne.registry&&Ne.events&&Ne.events.find(([l,c])=>c===e))return;let t=e.target,r=`$$${e.type}`,n=e.target,a=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{let l=t[r];if(l&&!t.disabled){let c=t[`${r}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ne.registry&&!Ne.done&&(Ne.done=_$HY.done=!0),e.composedPath){let l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===a)break}}else s();i(n)}function fa(e,t,r,n,a){let i=Un(e);if(i){!r&&(r=[...e.childNodes]);let l=[];for(let c=0;c<r.length;c++){let u=r[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}r=l}for(;typeof r=="function";)r=r();if(t===r)return r;let o=typeof t,s=n!==void 0;if(e=s&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(i||o==="number"&&(t=t.toString(),t===r))return r;if(s){let l=r[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),r=qn(e,r,n,l)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(i)return r;r=qn(e,r,n)}else{if(o==="function")return U(()=>{let l=t();for(;typeof l=="function";)l=l();r=fa(e,l,r,n)}),()=>r;if(Array.isArray(t)){let l=[],c=r&&Array.isArray(r);if(cc(l,t,r,a))return U(()=>r=fa(e,l,r,n,!0)),()=>r;if(i){if(!l.length)return r;if(n===void 0)return r=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return r;let d=[u];for(;(u=u.nextSibling)!==n;)d.push(u);return r=d}if(l.length===0){if(r=qn(e,r,n),s)return r}else c?r.length===0?Nd(e,l,n):Ny(e,r,l):(r&&qn(e),Nd(e,l));r=l}else if(t.nodeType){if(i&&t.parentNode)return r=s?[t]:t;if(Array.isArray(r)){if(s)return r=qn(e,r,n,t);qn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function cc(e,t,r,n){let a=!1;for(let i=0,o=t.length;i<o;i++){let s=t[i],l=r&&r[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))a=cc(e,s,l)||a;else if(c==="function")if(n){for(;typeof s=="function";)s=s();a=cc(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||a}else e.push(s),a=!0;else{let u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return a}function Nd(e,t,r=null){for(let n=0,a=t.length;n<a;n++)e.insertBefore(t[n],r)}function qn(e,t,r,n){if(r===void 0)return e.textContent="";let a=n||document.createTextNode("");if(t.length){let i=!1;for(let o=t.length-1;o>=0;o--){let s=t[o];if(a!==s){let l=s.parentNode===e;!i&&!o?l?e.replaceChild(a,s):e.insertBefore(a,r):l&&s.remove()}else i=!0}}else e.insertBefore(a,r);return[a]}function Uy(){return Ne.getNextContextId()}var jy=!1,By="http://www.w3.org/2000/svg";function Rg(e,t=!1,r=void 0){return t?document.createElementNS(By,e):document.createElement(e,{is:r})}function Dg(e){let{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,a=ac(),i,o=!!Ne.context;return Ye(()=>{o&&(ac().user=o=!1),i||(i=uy(a,()=>he(()=>e.children)));let s=n();if(s instanceof HTMLHeadElement){let[l,c]=N(!1),u=()=>c(!0);_r(d=>T(s,()=>l()?d():i(),null)),Ie(u)}else{let l=Rg(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:!0}),T(c,i),s.appendChild(l),e.ref&&e.ref(l),Ie(()=>s.removeChild(l))}},void 0,{render:!o}),r}function zy(e,t){let r=he(e);return he(()=>{let n=r();switch(typeof n){case"function":return nt(()=>n(t));case"string":let a=Oy.has(n),i=Ne.context?Ly():Rg(n,a,nt(()=>t.is));return Ke(i,t,a),i}})}function Vy(e){let[,t]=Rt(e,["component"]);return zy(()=>e.component,t)}function Hy(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let[a,i]=N(e[t[n]]);Object.defineProperty(r,t[n],{get:a,set(o){i(()=>o)}})}return r}function Zy(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Gy(e){return(t,r)=>{let{element:n}=r;return _r(a=>{let i=Hy(t);n.addPropertyChangedCallback((s,l)=>i[s]=l),n.addReleaseCallback(()=>{n.renderRoot.textContent="",a()});let o=e(i,r);return T(n.renderRoot,o)},Zy(n))}}function ml(e,t,r){return arguments.length===2&&(r=t,t={}),sy(e,t)(Gy(r))}var xu={makebot:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,onChatStatePersisted:void 0,onScriptExecutionSuccess:void 0,font:void 0,progressBarRef:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,wsHost:void 0,resultId:void 0,sessionId:void 0},Wy={...xu,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},qy={...xu,isOpen:void 0,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,onPreviewMessageDismissed:void 0,autoShowDelay:void 0,inlineStyle:void 0},fo={xs:440,sm:640,md:768,lg:1024,xl:1280},Mg=fu(()=>{}),Lg=()=>Bs(Mg),Ky=e=>{sessionStorage.setItem("makebotPaymentInProgress",JSON.stringify(e))},wu=()=>sessionStorage.getItem("makebotPaymentInProgress"),Fg=()=>{sessionStorage.removeItem("makebotPaymentInProgress")},An=(e,t)=>{if(typeof window<"u"){if(!window.__ENV)return;let n=window.__ENV[e];return n===""?t:n??t}if(typeof process>"u")return;let r=process.env[e];return r===""?t:r??t},Yy="https://makebot.it",Pr=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{let t=An("NEXT_PUBLIC_CHAT_API_URL"),r=An("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!r||r.some(a=>a===window.location.href)))return t;let n=An("NEXT_PUBLIC_VIEWER_URL")?.split(",");return n?.find(a=>window.location.href.startsWith(a))??n?.[0]??Yy},Xy=async e=>{let t;try{let r=typeof e=="string"?e:e.url;t=await fetch(r,{method:typeof e=="string"?"GET":e.method,mode:"cors",headers:typeof e!="string"&&Se(e.body)?{"Content-Type":"application/json"}:void 0,body:typeof e!="string"&&Se(e.body)?JSON.stringify(e.body):void 0});let n=await t.json();if(!t.ok)throw"error"in n?n.error:n;return{data:n,response:t}}catch(r){return console.error(r),{error:r,response:t}}},Se=e=>e!=null,Vt=e=>e==null,jt=e=>e==null||e==="",ot=e=>e!=null&&e!=="",Jy=e=>{e.split("</noscript>").forEach(t=>{let[r,n]=t.split("<noscript>"),a=document.createRange().createContextualFragment(r??"");if(document.head.append(a),Vt(n))return;let i=document.createElement("noscript"),o=document.createRange().createContextualFragment(n);i.append(o),document.head.append(i)})},pi=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg"),Qo=class extends Error{response;request;options;constructor(e,t,r){let n=e.status||e.status===0?e.status:"",a=e.statusText??"",i=`${n} ${a}`.trim(),o=i?`status code ${i}`:"an unknown error";super(`Request failed with ${o}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},$g=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{typeof e=="string"?t=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(t=e.message)}catch{}super(t),this.value=e}},fl=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new $g(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},Ad=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(a){if(a instanceof Error&&a.message==="unsupported BodyInit type")return!1;throw a}return e&&!t})(),Qy=typeof globalThis.AbortController=="function",Ug=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",ev=typeof globalThis.ReadableStream=="function",tv=typeof globalThis.FormData=="function",jg=["get","post","put","patch","head","delete"],rv=()=>{};rv();var nv={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},bl=2147483647,av=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Bg=Symbol("stop"),zg=class{options;constructor(e){this.options=e}},iv=e=>new zg(e),ov={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},sv={next:!0},lv={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},cv=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=av,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Vg=(e,t,r)=>{let n,a=0;return e.pipeThrough(new TransformStream({transform(i,o){if(o.enqueue(i),n){a+=n.byteLength;let s=t===0?0:a/t;s>=1&&(s=1-Number.EPSILON),r?.({percent:s,totalBytes:Math.max(t,a),transferredBytes:a},n)}n=i},flush(){n&&(a+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,a),transferredBytes:a},n))}}))},uv=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Vg(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},dv=(e,t,r)=>{if(!e.body)return e;let n=cv(r??e.body);return new Request(e,{duplex:"half",body:Vg(e.body,n,t)})},Pn=e=>e!==null&&typeof e=="object",bo=(...e)=>{for(let t of e)if((!Pn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return ku({},...e)},Hg=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,a=new globalThis.Headers(t);for(let[i,o]of a.entries())n&&o==="undefined"||o===void 0?r.delete(i):r.set(i,o);return r};function yo(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:ku(e[r]??[],t[r]??[])}var Zg=(e={},t={})=>({beforeRequest:yo(e,t,"beforeRequest"),beforeRetry:yo(e,t,"beforeRetry"),afterResponse:yo(e,t,"afterResponse"),beforeError:yo(e,t,"beforeError")}),pv=(e,t)=>{let r=new URLSearchParams;for(let n of[e,t])if(n!==void 0)if(n instanceof URLSearchParams)for(let[a,i]of n.entries())r.append(a,i);else if(Array.isArray(n))for(let a of n){if(!Array.isArray(a)||a.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(a[0]),String(a[1]))}else if(Pn(n))for(let[a,i]of Object.entries(n))i!==void 0&&r.append(a,String(i));else{let a=new URLSearchParams(n);for(let[i,o]of a.entries())r.append(i,o)}return r},ku=(...e)=>{let t={},r={},n={},a,i=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Pn(o)){for(let[s,l]of Object.entries(o)){if(s==="signal"&&l instanceof globalThis.AbortSignal){i.push(l);continue}if(s==="context"){if(l!=null&&(!Pn(l)||Array.isArray(l)))throw new TypeError("The `context` option must be an object");t={...t,context:l==null?{}:{...t.context,...l}};continue}if(s==="searchParams"){l==null?a=void 0:a=a===void 0?l:pv(a,l);continue}Pn(l)&&s in t&&(l=ku(t[s],l)),t={...t,[s]:l}}Pn(o.hooks)&&(n=Zg(n,o.hooks),t.hooks=n),Pn(o.headers)&&(r=Hg(r,o.headers),t.headers=r)}return a!==void 0&&(t.searchParams=a),i.length>0&&(i.length===1?t.signal=i[0]:Ug?t.signal=AbortSignal.any(i):t.signal=i.at(-1)),t},hv=e=>jg.includes(e)?e.toUpperCase():e,gv=["get","put","head","delete","options","trace"],mv=[408,413,429,500,502,503,504],fv=[413,429,503],Rd={limit:2,methods:gv,statusCodes:mv,afterStatusCodes:fv,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},bv=(e={})=>{if(typeof e=="number")return{...Rd,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(r=>r.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");let t=Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));return{...Rd,...t}},uc=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};async function yv(e,t,r,n){return new Promise((a,i)=>{let o=setTimeout(()=>{r&&r.abort(),i(new uc(e))},n.timeout);n.fetch(e,t).then(a).catch(i).then(()=>{clearTimeout(o)})})}async function vv(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",a,{once:!0}));function a(){clearTimeout(i),n(t.reason)}let i=setTimeout(()=>{t?.removeEventListener("abort",a),r()},e)})}var xv=(e,t)=>{let r={};for(let n in t)Object.hasOwn(t,n)&&!(n in lv)&&!(n in ov)&&(!(n in e)||n in sv)&&(r[n]=t[n]);return r},wv=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;function kv(e){return e instanceof Qo||e?.name===Qo.name}function _v(e){return e instanceof uc||e?.name===uc.name}var Dd=class dc{static create(t,r){let n=new dc(t,r),a=async()=>{if(typeof n.#e.timeout=="number"&&n.#e.timeout>bl)throw new RangeError(`The \`timeout\` option cannot be greater than ${bl}`);await Promise.resolve();let o=await n.#b();for(let s of n.#e.hooks.afterResponse){let l=n.#h(o.clone()),c;try{c=await s(n.request,n.#c(),l,{retryCount:n.#n})}catch(d){throw n.#i(l),n.#i(o),d}if(c instanceof zg)throw n.#i(l),n.#i(o),new fl(c.options);let u=c instanceof globalThis.Response?c:o;l!==u&&n.#i(l),o!==u&&n.#i(o),o=u}if(n.#h(o),!o.ok&&(typeof n.#e.throwHttpErrors=="function"?n.#e.throwHttpErrors(o.status):n.#e.throwHttpErrors)){let s=new Qo(o,n.request,n.#c());for(let l of n.#e.hooks.beforeError)s=await l(s,{retryCount:n.#n});throw s}if(n.#e.onDownloadProgress){if(typeof n.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!ev)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let s=o.clone();return n.#i(o),uv(s,n.#e.onDownloadProgress)}return o},i=n.#g(a).finally(()=>{let o=n.#o;n.#d(o?.body??void 0),n.#d(n.request.body??void 0)});for(let[o,s]of Object.entries(nv))o==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[o]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||s);let l=await i;if(o==="json"){if(l.status===204)return"";let c=await l.text();return c===""?"":r.parseJson?r.parseJson(c):JSON.parse(c)}return l[o]()});return i}static#s(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;#r;#n=0;#t;#e;#o;#a;#l;constructor(t,r={}){if(this.#t=t,this.#e={...r,headers:Hg(this.#t.headers,r.headers),hooks:Zg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:hv(r.method??this.#t.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:bv(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Qy&&Ug&&(this.#a=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#r.signal]):this.#r.signal),Ad&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(tv&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),wv(this.#e.searchParams)){let a="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(dc.#s(this.#e.searchParams)).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);this.request=new globalThis.Request(i,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Ad)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#m(this.request,this.#e.body??void 0)}}#u(){let t=this.#e.retry.delay(this.#n),r=t;this.#e.retry.jitter===!0?r=Math.random()*t:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(t),(!Number.isFinite(r)||r<0)&&(r=t));let n=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(n,r)}async#f(t){if(this.#n++,this.#n>this.#e.retry.limit)throw t;let r=t instanceof Error?t:new $g(t);if(r instanceof fl)return r.customDelay??this.#u();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(this.#e.retry.shouldRetry!==void 0){let n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#n});if(n===!1)throw t;if(n===!0)return this.#u()}if(_v(t)&&!this.#e.retry.retryOnTimeout)throw t;if(kv(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;let n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let a=Number(n)*1e3;Number.isNaN(a)?a=Date.parse(n)-Date.now():a>=Date.parse("2024-01-01")&&(a-=Date.now());let i=this.#e.retry.maxRetryAfter??a;return a<i?a:i}if(t.response.status===413)throw t}return this.#u()}#h(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#d(t){t&&t.cancel().catch(()=>{})}#i(t){this.#d(t.body??void 0)}async#g(t){try{return await t()}catch(r){let n=Math.min(await this.#f(r),bl);if(this.#n<1)throw r;if(await vv(n,this.#a?{signal:this.#a}:{}),r instanceof fl&&r.customRequest){let a=this.#e.signal?new globalThis.Request(r.customRequest,{signal:this.#e.signal}):new globalThis.Request(r.customRequest);this.#p(a)}for(let a of this.#e.hooks.beforeRetry){let i=await a({request:this.request,options:this.#c(),error:r,retryCount:this.#n});if(i instanceof globalThis.Request){this.#p(i);break}if(i instanceof globalThis.Response)return i;if(i===Bg)return}return this.#g(t)}}async#b(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#a?AbortSignal.any([this.#a,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let r of this.#e.hooks.beforeRequest){let n=await r(this.request,this.#c(),{retryCount:this.#n});if(n instanceof Response)return n;if(n instanceof globalThis.Request){this.#p(n);break}}let t=xv(this.request,this.#e);return this.#o=this.request,this.request=this.#o.clone(),this.#e.timeout===!1?this.#e.fetch(this.#o,t):yv(this.#o,t,this.#r,this.#e)}#c(){if(!this.#l){let{hooks:t,...r}=this.#e;this.#l=Object.freeze(r)}return this.#l}#p(t){this.#l=void 0,this.request=this.#m(t)}#m(t,r){return!this.#e.onUploadProgress||!t.body?t:dv(t,this.#e.onUploadProgress,r??this.#e.body??void 0)}},pc=e=>{let t=(r,n)=>Dd.create(r,bo(e,n));for(let r of jg)t[r]=(n,a)=>Dd.create(n,bo(e,a,{method:r}));return t.create=r=>pc(bo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),pc(bo(e,r))),t.stop=Bg,t.retry=iv,t},Tv=pc(),Ki=Tv;async function Sv({makebot:e,isPreview:t,apiHost:r,prefilledVariables:n,resultId:a,stripeRedirectStatus:i,startFrom:o,sessionId:s}){if(Vt(e))throw new Error("Makebot ID is required to get initial messages");let l=wu()??void 0,c=l?JSON.parse(l):void 0;if(c)return Ev({apiHost:r,stripeRedirectStatus:i,paymentInProgressState:c});let u=typeof e=="string"?e:e.id;if(t)return Cv({apiHost:r,makebotId:u,startFrom:o,makebot:e,prefilledVariables:n,sessionId:s});try{let d=parent!==window&&ot(document.referrer)?new URL(document.referrer).origin:void 0;return{data:await(await Ki.post(`${_u(r)}/api/v1/makebots/${u}/startChat`,{headers:{"x-makebot-iframe-referrer-origin":d},json:{isStreamEnabled:!0,prefilledVariables:n,resultId:a,isOnlyRegistering:!1},timeout:!1})).json()}}catch(d){return{error:d}}}var Ev=async({apiHost:e,stripeRedirectStatus:t,paymentInProgressState:r})=>{Fg();try{return{data:{...await Ki.post(`${_u(e)}/api/v1/sessions/${r.sessionId}/continueChat`,{json:{message:t==="failed"?"fail":"Success"},timeout:!1}).json(),...r}}}catch(n){return{error:n}}},Cv=async({apiHost:e,makebotId:t,startFrom:r,makebot:n,prefilledVariables:a,sessionId:i})=>{try{return{data:await Ki.post(`${_u(e)}/api/v1/makebots/${t}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:r,makebot:n,prefilledVariables:a,sessionId:i},timeout:!1}).json()}}catch(o){return{error:o}}},_u=e=>ot(e)?e:Pr(),Pv=class extends Error{constructor(e){super("Este bot s\xF3 pode ser executado em "+e)}},hc=(e,t)=>({...e,general:e.general?{...e.general,background:e.general.background?{...e.general.background,content:t?.backgroundUrl??e.general.background?.content}:void 0}:void 0,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}),We={blue:{light:{1:"#fcfdfe",2:"#f6f9ff",3:"#ebf2ff",4:"#ddeaff",5:"#ccdfff",6:"#b7d2ff",7:"#a0bfff",8:"#7fa5fd",9:"#3566fc",10:"#2f5be1",11:"#2c57dd",12:"#172c65"},dark:{1:"#070d1a",2:"#0f1627",3:"#12234e",4:"#162c6a",5:"#1d377e",6:"#25428f",7:"#2e4ea4",8:"#365bc1",9:"#3566fc",10:"#2a57ec",11:"#8db4ff",12:"#d1e2ff"}},orange:{light:{1:"#fefcfb",2:"#fff4f0",3:"#ffe8de",4:"#ffd6c7",5:"#ffc8b5",6:"#ffb8a0",7:"#ffa286",8:"#f98868",9:"#ff5924",10:"#f24905",11:"#dc3b00",12:"#5b2a1c"},dark:{1:"#120b09",2:"#1f1411",3:"#371810",4:"#4e1606",5:"#5e1e0b",6:"#6e2c18",7:"#873c26",8:"#ad4d31",9:"#ff5924",10:"#f14b0f",11:"#ff9776",12:"#ffd7ca"}},green:{light:{1:"#fbfefc",2:"#f2fcf5",3:"#e9f9ee",4:"#ddf3e4",5:"#ccebd7",6:"#b4dfc4",7:"#92ceac",8:"#5bb98c",9:"#30a46c",10:"#299764",11:"#18794e",12:"#153226"},dark:{1:"#0d1912",2:"#0c1f17",3:"#0f291e",4:"#113123",5:"#133929",6:"#164430",7:"#1b543a",8:"#236e4a",9:"#30a46c",10:"#3cb179",11:"#4cc38a",12:"#e5fbeb"}},purple:{light:{1:"#fcfcff",2:"#f9f8ff",3:"#f2f0ff",4:"#e7e4ff",5:"#ddd8ff",6:"#d0c9ff",7:"#bdb3ff",8:"#a595ff",9:"#8055fd",10:"#7447ec",11:"#6841d3",12:"#321e6c"},dark:{1:"#0d0a1b",2:"#17132a",3:"#261b4f",4:"#321d6c",5:"#3b257c",6:"#46318b",7:"#543ea2",8:"#684cc7",9:"#8055fd",10:"#7446ee",11:"#b4a6ff",12:"#e0dcff"}},red:{light:{1:"#fffcfc",2:"#fff7f6",3:"#ffebe9",4:"#ffdad6",5:"#ffcbc6",6:"#ffbab5",7:"#fca5a0",8:"#f48984",9:"#f83b45",10:"#ea2638",11:"#d8062a",12:"#6a0d14"},dark:{1:"#130a0a",2:"#201211",3:"#3e0e0f",4:"#55050c",5:"#670b13",6:"#791b1f",7:"#932b2d",8:"#be3a3c",9:"#f83b45",10:"#e92939",11:"#ff8f89",12:"#ffd0cb"}},gray:{light:{1:"#ffffff",2:"#f1f1f1",3:"#f0f0f0",4:"#e8e8e8",5:"#e0e0e0",6:"#dfdfdf",7:"#cecece",8:"#bbbbbb",9:"#8d8d8d",10:"#838383",11:"#464646",12:"#202020"},dark:{1:"#0D0D0D",2:"#1D1D1D",3:"#222222",4:"#2a2a2a",5:"#313131",6:"#3a3a3a",7:"#484848",8:"#606060",9:"#6e6e6e",10:"#7b7b7b",11:"#b4b4b4",12:"#eeeeee"}}},Ov="Google",Tu="Open Sans",es="Color",Iv={6:"#FFFFFF","6.1":We.gray.light[2]},Nv={6:"#e0edff","6.1":We.green.light[9]},Av={6:We.gray.light[3],"6.1":We.gray.light[9]},Rv=4,Gg="absolute",Dv="Top",Ta="medium",Et=1,Wg=0,Mv="800px",Lv="100%",Vs="transparent",Fv={6:"#F7F8FF","6.1":We.gray.light[1]},$v=We.gray.light[12],Uv={6:0,"6.1":1},jv=We.gray.light[6],Bv={6:"#FF8E21","6.1":We.green.light[9]},zv=We.gray.light[1],Vv={6:0,"6.1":1},Hv=We.green.light[6],qg={6:"#0042DA","6.1":We.green.light[9]},Zv=We.gray.light[1],Gv={6:0,"6.1":1},Wv=We.green.light[8],qv="#FFFFFF",Kv=We.gray.light[12],Yv="#9095A0",Xv={6:0,"6.1":1},Jv={6:void 0,"6.1":We.gray.light[7]},Qv={6:"md","6.1":void 0},hi=!0,gc=!1,e0="wrap",ee={general:{bgImage:"--makebot-container-bg-image",bgColor:"--makebot-container-bg-color",fontFamily:"--makebot-container-font-family",progressBar:{position:"--makebot-progress-bar-position",color:"--makebot-progress-bar-color",colorRgb:"--makebot-progress-bar-bg-rgb",height:"--makebot-progress-bar-height",top:"--makebot-progress-bar-top",bottom:"--makebot-progress-bar-bottom"}},chat:{container:{maxWidth:"--makebot-chat-container-max-width",maxHeight:"--makebot-chat-container-max-height",bgColor:"--makebot-chat-container-bg-rgb",color:"--makebot-chat-container-color",borderRadius:"--makebot-chat-container-border-radius",borderWidth:"--makebot-chat-container-border-width",borderColor:"--makebot-chat-container-border-rgb",borderOpacity:"--makebot-chat-container-border-opacity",opacity:"--makebot-chat-container-opacity",blur:"--makebot-chat-container-blur",boxShadow:"--makebot-chat-container-box-shadow"},hostBubbles:{bgColor:"--makebot-host-bubble-bg-rgb",color:"--makebot-host-bubble-color",borderRadius:"--makebot-host-bubble-border-radius",borderWidth:"--makebot-host-bubble-border-width",borderColor:"--makebot-host-bubble-border-rgb",borderOpacity:"--makebot-host-bubble-border-opacity",opacity:"--makebot-host-bubble-opacity",blur:"--makebot-host-bubble-blur",boxShadow:"--makebot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--makebot-guest-bubble-bg-rgb",color:"--makebot-guest-bubble-color",borderRadius:"--makebot-guest-bubble-border-radius",borderWidth:"--makebot-guest-bubble-border-width",borderColor:"--makebot-guest-bubble-border-rgb",borderOpacity:"--makebot-guest-bubble-border-opacity",opacity:"--makebot-guest-bubble-opacity",blur:"--makebot-guest-bubble-blur",boxShadow:"--makebot-guest-bubble-box-shadow"},inputs:{bgColor:"--makebot-input-bg-rgb",color:"--makebot-input-color",placeholderColor:"--makebot-input-placeholder-color",borderRadius:"--makebot-input-border-radius",borderWidth:"--makebot-input-border-width",borderColor:"--makebot-input-border-rgb",borderOpacity:"--makebot-input-border-opacity",opacity:"--makebot-input-opacity",blur:"--makebot-input-blur",boxShadow:"--makebot-input-box-shadow"},buttons:{bgRgb:"--makebot-button-bg-rgb",color:"--makebot-button-color",borderRadius:"--makebot-button-border-radius",borderWidth:"--makebot-button-border-width",borderColor:"--makebot-button-border-rgb",borderOpacity:"--makebot-button-border-opacity",opacity:"--makebot-button-opacity",blur:"--makebot-button-blur",boxShadow:"--makebot-button-box-shadow",flexDirection:"--makebot-buttons-input-flex-direction"},checkbox:{bgRgb:"--makebot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}}},t0="#F7F8FF",r0="#303235",n0="#F7F8FF",a0="#303235",i0="https://fonts.bunny.net/css2",vo="makebot-font",Kg=e=>{let t=document.getElementById(vo);if(typeof e=="string"||e.type==="Google"){let r=(typeof e=="string"?e:e.family)??Tu;if(t?.getAttribute("href")?.includes(r))return;t?.remove();let n=document.createElement("link");n.href=`${i0}?family=${r}:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap`,n.rel="stylesheet",n.id=vo,document.head.appendChild(n);return}if(e.type==="Custom"){if(ot(e.css)){if(t?.innerHTML===e.css)return;t?.remove();let r=document.createElement("style");r.innerHTML=e.css,r.id=vo,document.head.appendChild(r)}if(ot(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();let r=document.createElement("link");r.href=e.url,r.rel="stylesheet",r.id=vo,document.head.appendChild(r)}}},Nt={general:{isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},typingEmulation:{enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},metadata:{description:"Crie formul\xE1rios de conversa\xE7\xE3o atraentes e incorpore-os diretamente aos seus aplicativos, sem uma linha de c\xF3digo. Triplique sua taxa de resposta e colete respostas com mais valor em compara\xE7\xE3o com um formul\xE1rio tradicional.",favIconUrl:e=>e+"/favicon.svg",imageUrl:e=>e+"/site-preview.png"}},Kr={invalidMessage:"Mensagem inv\xE1lida. Tente novamente.",botClosed:"Este bot est\xE1 fechado agora",networkErrorTitle:"Erro de rede",networkErrorMessage:"Verifique sua conex\xE3o com a internet e tente novamente.",popupBlockedTitle:"Pop-up bloqueado",popupBlockedDescription:"O bot quer abrir uma nova aba, mas foi bloqueado pelo seu navegador. \xC9 necess\xE1ria uma aprova\xE7\xE3o manual.",popupBlockedButtonLabel:"Continuar em nova aba",fileUploadError:"Ocorreu um erro ao carregar os arquivos",fileUploadSizeError:"[[file]] \xE9 maior que [[limit]]MB",sessionFinalized:"Sess\xE3o finalizada pelo administrador."},o0=Symbol("store-raw"),s0=Symbol("store-node"),Kn=Symbol("store-has"),l0=Symbol("store-self");function gi(e){let t;return e!=null&&typeof e=="object"&&(e[ci]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function mc(e,t=new Set){let r,n,a,i;if(r=e!=null&&e[o0])return r;if(!gi(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)a=e[o],(n=mc(a,t))!==a&&(e[o]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=o.length;l<c;l++)i=o[l],!s[i].get&&(a=e[i],(n=mc(a,t))!==a&&(e[i]=n))}return e}function c0(e,t){let r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function Md(e,t,r){if(e[t])return e[t];let[n,a]=N(r,{equals:!1,internal:!0});return n.$=a,e[t]=n}function Ur(e,t,r,n=!1){if(!n&&e[t]===r)return;let a=e[t],i=e.length;r===void 0?(delete e[t],e[Kn]&&e[Kn][t]&&a!==void 0&&e[Kn][t].$()):(e[t]=r,e[Kn]&&e[Kn][t]&&a===void 0&&e[Kn][t].$());let o=c0(e,s0),s;if((s=Md(o,t,a))&&s.$(()=>r),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(s=o[l])&&s.$();(s=Md(o,"length",i))&&s.$(e.length)}(s=o[l0])&&s.$()}var fc=Symbol("store-root");function ta(e,t,r,n,a){let i=t[r];if(e===i)return;let o=Array.isArray(e);if(r!==fc&&(!gi(e)||!gi(i)||o!==Array.isArray(i)||a&&e[a]!==i[a])){Ur(t,r,e);return}if(o){if(e.length&&i.length&&(!n||a&&e[0]&&e[0][a]!=null)){let c,u,d,p,h,y,m,v;for(d=0,p=Math.min(i.length,e.length);d<p&&(i[d]===e[d]||a&&i[d]&&e[d]&&i[d][a]&&i[d][a]===e[d][a]);d++)ta(e[d],i,d,n,a);let w=new Array(e.length),b=new Map;for(p=i.length-1,h=e.length-1;p>=d&&h>=d&&(i[p]===e[h]||a&&i[p]&&e[h]&&i[p][a]&&i[p][a]===e[h][a]);p--,h--)w[h]=i[p];if(d>h||d>p){for(u=d;u<=h;u++)Ur(i,u,e[u]);for(;u<e.length;u++)Ur(i,u,w[u]),ta(e[u],i,u,n,a);i.length>e.length&&Ur(i,"length",e.length);return}for(m=new Array(h+1),u=h;u>=d;u--)y=e[u],v=a&&y?y[a]:y,c=b.get(v),m[u]=c===void 0?-1:c,b.set(v,u);for(c=d;c<=p;c++)y=i[c],v=a&&y?y[a]:y,u=b.get(v),u!==void 0&&u!==-1&&(w[u]=i[c],u=m[u],b.set(v,u));for(u=d;u<e.length;u++)u in w?(Ur(i,u,w[u]),ta(e[u],i,u,n,a)):Ur(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)ta(e[c],i,c,n,a);i.length>e.length&&Ur(i,"length",e.length);return}let s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)ta(e[s[c]],i,s[c],n,a);let l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Ur(i,l[c],void 0)}function u0(e,t={}){let{merge:r,key:n="id"}=t,a=mc(e);return i=>{if(!gi(i)||!gi(a))return a;let o=ta(a,{[fc]:i},fc,r,n);return o===void 0?i:o}}var bc="resultId",d0=e=>{if(e)try{return sessionStorage.getItem(`${bc}-${e}`)??localStorage.getItem(`${bc}-${e}`)??void 0}catch{}},p0=(e="session")=>(t,r)=>{try{Hs(e).setItem(`${bc}-${t}`,r)}catch{}},h0=e=>{if(e)try{let t=sessionStorage.getItem(`makebot-${e}-initialChatReply`)??localStorage.getItem(`makebot-${e}-initialChatReply`);return t?JSON.parse(t):void 0}catch{}},Ld=(e,{makebotId:t,storage:r})=>{try{let n=JSON.stringify(e);Hs(r).setItem(`makebot-${t}-initialChatReply`,n)}catch{}},Yg=()=>{try{sessionStorage.setItem("makebot-botOpened","true")}catch{}},Xg=()=>{try{sessionStorage.removeItem("makebot-botOpened")}catch{}},Jg=()=>{try{return sessionStorage.getItem("makebot-botOpened")==="true"}catch{return!1}},Hs=e=>(e??Nt.general.rememberUser.storage)==="session"?sessionStorage:localStorage,yl=e=>{Object.keys(localStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith(`makebot-${e}`)&&sessionStorage.removeItem(t)})};function yc(e,t){if(!t.storage)return[...e];let r=Hs(t.storage||Nt.general.rememberUser.storage),n=o=>{let s=JSON.parse(JSON.stringify(o));return typeof s!="object"||("blobUrl"in s&&(s.blobUrl=void 0),"attachments"in s&&Array.isArray(s.attachments)&&s.attachments.forEach(l=>{l&&"blobUrl"in l&&(l.blobUrl=void 0)})),JSON.stringify(s)},a=JSON.parse.bind(JSON),i=r.getItem(t.key);if(i){let o=typeof e[0]=="function"?l=>e[1](()=>l):l=>e[1](u0(l)),s=a(i);t.transformInitDataFromStorage&&(s=t.transformInitDataFromStorage(s),r.setItem(t.key,n(s))),o(s),t.onRecovered?.()}return[e[0],typeof e[0]=="function"?o=>{let s=e[1](o);return o?r.setItem(t.key,n(s)):r.removeItem(t.key),s}:(...o)=>{e[1](...o);let s=n(nt(()=>e[0]));r.setItem(t.key,s)}]}var st=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(n,a,i,o)=>a+a+i+i+o+o);let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?[Number.parseInt(r[1]??"",16),Number.parseInt(r[2]??"",16),Number.parseInt(r[3]??"",16)]:[0,0,0]},mi=e=>(([t,r,n])=>(t*299+r*587+n*114)/1e3>155)(st(e)),Su=({chatContainer:e,generalBackground:t})=>{let r=e?.backgroundColor??Vs;if((e?.opacity??Et)<=.3||r==="transparent"||jt(r)){let n=t?.type??es,a=n==="Image"?"#000000":n==="Color"&&ot(t?.content)?t.content:"#ffffff";return mi(a)}return mi(r)},g0=({theme:e,container:t,isPreview:r,makebotVersion:n})=>{if(!e)return;let a=t?.style;a&&(m0({generalTheme:e.general,documentStyle:a,isPreview:r,makebotVersion:n}),b0({chatTheme:e.chat,generalBackground:e.general?.background,documentStyle:a,makebotVersion:n}))},m0=({generalTheme:e,documentStyle:t,isPreview:r,makebotVersion:n})=>{Qg({background:e?.background,documentStyle:t,makebotVersion:n}),t.setProperty(ee.general.fontFamily,(typeof e?.font=="string"?e.font:e?.font?.family)??Tu),f0({progressBar:e?.progressBar,documentStyle:t,isPreview:r,makebotVersion:n})},f0=({progressBar:e,documentStyle:t,isPreview:r,makebotVersion:n})=>{let a=e?.position??Gg;t.setProperty(ee.general.progressBar.position,a==="fixed"?r?"absolute":"fixed":a),t.setProperty(ee.general.progressBar.color,e?.color??Nv[n]),t.setProperty(ee.general.progressBar.colorRgb,st(e?.backgroundColor??Av[n]).join(", ")),t.setProperty(ee.general.progressBar.height,`${e?.thickness??Rv}px`);let i=e?.placement??Dv;t.setProperty(ee.general.progressBar.top,i==="Top"?"0":"auto"),t.setProperty(ee.general.progressBar.bottom,i==="Bottom"?"0":"auto")},b0=({chatTheme:e,generalBackground:t,documentStyle:r,makebotVersion:n})=>{y0({container:e?.container,generalBackground:t,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),v0({hostBubbles:e?.hostBubbles,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),x0({guestBubbles:e?.guestBubbles,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),w0({buttons:e?.buttons,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),_0({inputs:e?.inputs,documentStyle:r,legacyRoundness:e?.roundness,makebotVersion:n}),T0(e?.container,t,r),k0({buttonsInput:e?.buttonsInput,documentStyle:r,makebotVersion:n})},y0=({container:e,generalBackground:t,documentStyle:r,legacyRoundness:n})=>{let a=e?.backgroundColor??Vs,i=a==="transparent"||jt(a);r.setProperty(ee.chat.container.bgColor,i?"0, 0, 0":st(a).join(", ")),r.setProperty(ee.chat.container.color,st(e?.color??(Su({chatContainer:e,generalBackground:t})?We.gray.light[12]:We.gray.dark[12])).join(", ")),r.setProperty(ee.chat.container.maxWidth,e?.maxWidth??Mv),r.setProperty(ee.chat.container.maxHeight,e?.maxHeight??Lv);let o=i?"1":(e?.opacity??Et).toString();r.setProperty(ee.chat.container.opacity,i?"0":(e?.opacity??Et).toString()),r.setProperty(ee.chat.container.blur,o==="1"||i?"0xp":`${e?.blur??Wg}px`),Xi(e?.shadow,r,ee.chat.container.boxShadow),Yi(e?.border??{roundeness:n??Ta},r,ee.chat.container.borderRadius),r.setProperty(ee.chat.container.borderWidth,Se(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),r.setProperty(ee.chat.container.borderOpacity,Se(e?.border?.opacity)?e.border.opacity.toString():Et.toString()),r.setProperty(ee.chat.container.borderColor,st(e?.border?.color??"").join(", "))},v0=({hostBubbles:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(ee.chat.hostBubbles.bgColor,st(e?.backgroundColor??Fv[n]).join(", ")),t.setProperty(ee.chat.hostBubbles.color,e?.color??$v),Yi(e?.border??{roundeness:r??Ta},t,ee.chat.hostBubbles.borderRadius);let a=e?.border?.thickness??Uv[n];Se(a)&&t.setProperty(ee.chat.hostBubbles.borderWidth,a+"px"),t.setProperty(ee.chat.hostBubbles.borderColor,st(e?.border?.color??jv).join(", ")),t.setProperty(ee.chat.hostBubbles.opacity,e?.backgroundColor==="transparent"?"0":Se(e?.opacity)?e.opacity.toString():Et.toString()),t.setProperty(ee.chat.hostBubbles.borderOpacity,Se(e?.border?.opacity)?e.border.opacity.toString():Et.toString()),t.setProperty(ee.chat.hostBubbles.blur,Se(e?.blur)?`${e.blur??0}px`:"none"),Xi(e?.shadow,t,ee.chat.hostBubbles.boxShadow)},x0=({guestBubbles:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(ee.chat.guestBubbles.bgColor,st(e?.backgroundColor??Bv[n]).join(", ")),t.setProperty(ee.chat.guestBubbles.color,e?.color??zv),Yi(e?.border??{roundeness:r??Ta},t,ee.chat.guestBubbles.borderRadius);let a=e?.border?.thickness??Vv[n];Se(a)&&t.setProperty(ee.chat.guestBubbles.borderWidth,a+"px"),t.setProperty(ee.chat.guestBubbles.borderColor,st(e?.border?.color??Hv).join(", ")),t.setProperty(ee.chat.guestBubbles.borderOpacity,Se(e?.border?.opacity)?e.border.opacity.toString():Et.toString()),t.setProperty(ee.chat.guestBubbles.opacity,e?.backgroundColor==="transparent"?"0":Se(e?.opacity)?e.opacity.toString():Et.toString()),t.setProperty(ee.chat.guestBubbles.blur,Se(e?.blur)?`${e.blur??0}px`:"none"),Xi(e?.shadow,t,ee.chat.guestBubbles.boxShadow)},w0=({buttons:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{let a=e?.backgroundColor??qg[n];t.setProperty(ee.chat.buttons.bgRgb,st(a).join(", ")),t.setProperty(ee.chat.buttons.bgRgb,st(a).join(", ")),t.setProperty(ee.chat.buttons.color,e?.color??Zv),Yi(e?.border??{roundeness:r??Ta},t,ee.chat.buttons.borderRadius),t.setProperty(ee.chat.buttons.borderWidth,Se(e?.border?.thickness)?`${e?.border?.thickness}px`:`${Gv[n]}px`),t.setProperty(ee.chat.buttons.borderColor,st(e?.border?.color??e?.backgroundColor??Wv).join(", ")),t.setProperty(ee.chat.buttons.borderOpacity,Se(e?.border?.opacity)?e.border.opacity.toString():Et.toString()),t.setProperty(ee.chat.buttons.opacity,e?.backgroundColor==="transparent"?"0":Se(e?.opacity)?e.opacity.toString():Et.toString()),t.setProperty(ee.chat.buttons.blur,Se(e?.blur)?`${e.blur??0}px`:Wg.toString()),Xi(e?.shadow,t,ee.chat.buttons.boxShadow)},k0=({buttonsInput:e,documentStyle:t})=>{t.setProperty(ee.chat.buttons.flexDirection,(e?.layout??e0)==="vertical"?"column":"unset")},_0=({inputs:e,documentStyle:t,legacyRoundness:r,makebotVersion:n})=>{t.setProperty(ee.chat.inputs.bgColor,st(e?.backgroundColor??qv).join(", ")),t.setProperty(ee.chat.inputs.color,e?.color??Kv),t.setProperty(ee.chat.inputs.placeholderColor,e?.placeholderColor??Yv),Yi(e?.border??{roundeness:r??Ta},t,ee.chat.inputs.borderRadius),t.setProperty(ee.chat.inputs.borderWidth,`${e?.border?.thickness??Xv[n]}px`);let a=e?.border?.color??Jv[n];Se(a)&&t.setProperty(ee.chat.inputs.borderColor,st(a).join(", ")),t.setProperty(ee.chat.inputs.borderOpacity,Se(e?.border?.opacity)?e.border.opacity.toString():Et.toString()),t.setProperty(ee.chat.inputs.opacity,e?.backgroundColor==="transparent"?"0":Se(e?.opacity)?e.opacity.toString():Et.toString()),t.setProperty(ee.chat.inputs.blur,Se(e?.blur)?`${e.blur??0}px`:"none"),Xi(e?.shadow??Qv[n],t,ee.chat.inputs.boxShadow)},T0=(e,t,r)=>{let n=e?.backgroundColor??Vs;if(n==="transparent"||jt(n)||(e?.opacity??Et)<=.2){let a=t?.type??es;r.setProperty(ee.chat.checkbox.bgRgb,a==="Image"?"rgba(255, 255, 255, 0.75)":st((a==="Color"?t?.content:"#ffffff")??"#ffffff").join(", ")),a==="Image"?r.setProperty(ee.chat.checkbox.alphaRatio,"3"):r.setProperty(ee.chat.checkbox.alphaRatio,t?.content&&mi(t?.content)?"1":"2")}else r.setProperty(ee.chat.checkbox.bgRgb,st(n).concat(e?.opacity??1).join(", ")),r.setProperty(ee.chat.checkbox.alphaRatio,mi(n)?"1":"2")},Qg=({background:e,documentStyle:t,makebotVersion:r})=>{t.setProperty(ee.general.bgImage,null),t.setProperty(ee.general.bgColor,null),t.setProperty((e?.type??es)==="Image"?ee.general.bgImage:ee.general.bgColor,S0({type:e?.type??es,content:e?.content??Iv[r]}))},S0=({type:e,content:t})=>{switch(e){case"None":return"transparent";case void 0:case"Color":return t;case"Image":return`url(${t})`}},Yi=(e,t,r)=>{switch(e?.roundeness??Ta){case"none":{t.setProperty(r,"0");break}case"medium":{t.setProperty(r,"6px");break}case"large":{t.setProperty(r,"20px");break}case"custom":{t.setProperty(r,`${e.customRoundeness??6}px`);break}}},Xi=(e,t,r)=>{if(e===void 0){t.setProperty(r,"0 0 #0000");return}switch(e){case"none":t.setProperty(r,"0 0 #0000");break;case"sm":t.setProperty(r,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(r,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(r,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(r,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(r,"0 25px 50px -12px rgb(0 0 0 / 0.25)");break}},E0=e=>typeof e=="function";function C0(e,t){E0(e)&&e(t)}function Ji(...e){return t=>{for(let r of e)C0(r,t)}}var qe=()=>(e,t)=>Rt(e,t);function P0(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ut(e={}){let{strict:t=!0,hookName:r="useContext",providerName:n="Provider",errorMessage:a,defaultValue:i}=e,o=fu(i);function s(){let l=Bs(o);if(!l&&t){let c=new Error(a??P0(r,n));throw c.name="ContextError",Error.captureStackTrace?.(c,s),c}return l}return[o.Provider,s,o]}var[em,O0]=ut({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),Eu=e=>qe()(e,["lazyMount","unmountOnExit"]),vl=Symbol("fallback");function Fd(e){for(let t of e)t.dispose()}function I0(e,t,r,n={}){if(jy){let o=e(),s=[];if(o&&o.length)for(let l=0,c=o.length;l<c;l++)s.push(r(()=>o[l],()=>l));else n.fallback&&(s=[n.fallback()]);return()=>s}let a=new Map;return Ie(()=>Fd(a.values())),()=>{let o=e()||[];return o[mu],nt(()=>{if(!o.length)return Fd(a.values()),a.clear(),n.fallback?[_r(u=>(a.set(vl,{dispose:u}),n.fallback()))]:[];let s=new Array(o.length),l=a.get(vl);if(!a.size||l){l?.dispose(),a.delete(vl);for(let u=0;u<o.length;u++){let d=o[u],p=t(d,u);i(s,d,u,p)}return s}let c=new Set(a.keys());for(let u=0;u<o.length;u++){let d=o[u],p=t(d,u);c.delete(p);let h=a.get(p);h?(s[u]=h.mapped,h.setIndex?.(u),h.setItem(()=>d)):i(s,d,u,p)}for(let u of c)a.get(u)?.dispose(),a.delete(u);return s})};function i(o,s,l,c){_r(u=>{let[d,p]=N(s),h={setItem:p,dispose:u};if(r.length>1){let[y,m]=N(l);h.setIndex=m,h.mapped=r(d,y)}else h.mapped=r(d);a.set(c,h),o[l]=h.mapped})}}function N0(e){let{by:t}=e;return he(I0(()=>e.each,typeof t=="function"?t:r=>r[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function A0(e){return e?Array.isArray(e)?e:[e]:[]}var R0=e=>e[0],D0=e=>e[e.length-1],M0=(e,...t)=>e.concat(t),L0=(e,...t)=>e.filter(r=>!t.includes(r)),F0=e=>Array.from(new Set(e));function Cu(e,t,r={}){let{step:n=1,loop:a=!0}=r,i=t+n,o=e.length,s=o-1;return t===-1?n>0?0:s:i<0?a?s:0:i>=o?a?0:t>o?o:t:i}function $0(e,t,r={}){return e[Cu(e,t,r)]}function tm(e,t,r={}){let{step:n=1,loop:a=!0}=r;return Cu(e,t,{step:-n,loop:a})}function U0(e,t,r={}){return e[tm(e,t,r)]}var $d=e=>e?.constructor.name==="Array",j0=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Qi(e[r],t[r]))return!1;return!0},Qi=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if($d(e)&&$d(t))return j0(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(t??Object.create(null)),n=r.length;for(let a=0;a<n;a++)if(!Reflect.has(e,r[a]))return!1;for(let a=0;a<n;a++){let i=r[a];if(!Qi(e[i],t[i]))return!1}return!0},B0=e=>Array.isArray(e),z0=e=>e!=null&&typeof e=="object",rm=e=>z0(e)&&!B0(e),Pu=e=>typeof e=="number"&&!Number.isNaN(e),Tr=e=>typeof e=="string",er=e=>typeof e=="function",V0=e=>e==null,H0=Function.prototype.toString,DN=H0.call(Object),qa=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,Z0=()=>{},fi=(...e)=>(...t)=>{e.forEach(function(r){r?.(...t)})},nm=(()=>{let e=0;return()=>(e++,e.toString(36))})();function G0(e,t=0){let r=0,n=null;return(...a)=>{let i=Date.now(),o=i-r;o>=t?(n&&(clearTimeout(n),n=null),e(...a),r=i):n||(n=setTimeout(()=>{e(...a),r=Date.now(),n=null},t-o))}}var{floor:W0,abs:MN,round:q0,min:K0,max:Y0,pow:LN,sign:FN}=Math,X0=e=>Number.isNaN(e),Jr=e=>X0(e)?0:e,J0=(e,t)=>(e%t+t)%t,Q0=(e,t)=>Jr(e)>=t,ex=(e,t)=>Jr(e)<=t,tx=(e,t,r)=>Jr(e)>=t&&Jr(e)<=r,ca=(e,t,r)=>K0(Y0(Jr(e),t),r),rx=(e,t,r)=>(Jr(e)-t)/(r-t),oi=(e,t)=>typeof t=="number"?W0(e*t+.5)/t:q0(e),Ud=e=>{if(!Number.isFinite(e))return 0;let t=1,r=0;for(;Math.round(e*t)/t!==e;)t*=10,r+=1;return r},am=(e,t,r)=>{let n=t==="+"?e+r:e-r;if(e%1!==0||r%1!==0){let a=10**Math.max(Ud(e),Ud(r));e=Math.round(e*a),r=Math.round(r*a),n=t==="+"?e+r:e-r,n/=a}return n},nx=(e,t)=>am(Jr(e),"+",t),ax=(e,t)=>am(Jr(e),"-",t);function Zs(e){if(!ix(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(let n of t){let a=e[n];a!==void 0&&(r[n]=Zs(a))}return r}var ix=e=>e&&typeof e=="object"&&e.constructor===Object;function ox(e,t){let r={},n={},a=new Set(t);for(let i in e)a.has(i)?n[i]=e[i]:r[i]=e[i];return[n,r]}var Kt=e=>function(t){return ox(t,e)};function xl(e,t){let r=performance.now(),n;function a(i){n=requestAnimationFrame(a),i-r>=t&&e()}return n=requestAnimationFrame(a),()=>cancelAnimationFrame(n)}function ts(...e){let t=e.length===1?e[0]:e[1],r=e.length===2?e[0]:!0}function sx(e,t){if(e==null)throw new Error(t())}function im(e,t,r){let n=[];for(let a of t)e[a]==null&&n.push(a);if(n.length>0)throw new Error(`[zag-js${r?` > ${r}`:""}] missing required props: ${n.join(", ")}`)}var lx=(e,t)=>e.map((r,n)=>e[(Math.max(t,0)+n)%e.length]),om=()=>{},Gs=e=>typeof e=="object"&&e!==null,sm=2147483647,be=e=>e?"":void 0,bi=e=>e?"true":void 0,cx=1,ux=9,dx=11,ct=e=>Gs(e)&&e.nodeType===cx&&typeof e.nodeName=="string",Ou=e=>Gs(e)&&e.nodeType===ux,px=e=>Gs(e)&&e===e.window,lm=e=>ct(e)?e.localName||"":"#document";function hx(e){return["html","body","#document"].includes(lm(e))}var gx=e=>Gs(e)&&e.nodeType!==void 0,yi=e=>gx(e)&&e.nodeType===dx&&"host"in e,mx=e=>ct(e)&&e.localName==="input",fx=e=>!!e?.matches("a[href]"),bx=e=>ct(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,yx=/(textarea|select)/;function Iu(e){if(e==null||!ct(e))return!1;try{return mx(e)&&e.selectionStart!=null||yx.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function Or(e,t){if(!e||!t||!ct(e)||!ct(t))return!1;let r=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(r&&yi(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pr(e){return Ou(e)?e:px(e)?e.document:e?.ownerDocument??document}function vx(e){return pr(e).documentElement}function Yt(e){return yi(e)?Yt(e.host):Ou(e)?e.defaultView??window:ct(e)?e.ownerDocument?.defaultView??window:window}function cm(e){let t=e.activeElement;for(;t?.shadowRoot;){let r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}function xx(e){if(lm(e)==="html")return e;let t=e.assignedSlot||e.parentNode||yi(e)&&e.host||vx(e);return yi(t)?t.host:t}var wl=new WeakMap;function Sa(e){return wl.has(e)||wl.set(e,Yt(e).getComputedStyle(e)),wl.get(e)}var Ws=()=>typeof document<"u";function wx(){return navigator.userAgentData?.platform??navigator.platform}function kx(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}var Nu=e=>Ws()&&e.test(wx()),_x=e=>Ws()&&e.test(kx()),Tx=e=>Ws()&&e.test(navigator.vendor),jd=()=>Ws()&&!!navigator.maxTouchPoints,Sx=()=>Nu(/^iPhone/i),Ex=()=>Nu(/^iPad/i)||Au()&&navigator.maxTouchPoints>1,qs=()=>Sx()||Ex(),um=()=>Au()||qs(),Au=()=>Nu(/^Mac/i),dm=()=>um()&&Tx(/apple/i),Cx=()=>_x(/Firefox/i);function Px(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function St(e){return Px(e)?.[0]??e.target}var pm=e=>Or(e.currentTarget,St(e));function Bd(e){let t=e.currentTarget;if(!t)return!1;let r=um();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.localName;return n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit"}function zd(e){let t=e.currentTarget;if(!t)return!1;let r=t.localName;return e.altKey?r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit":!1}function Ox(e){return Rx(e).isComposing||e.keyCode===229}function Ix(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Vd=e=>e.button===0,hm=e=>e.button===2||Au()&&e.ctrlKey&&e.button===0,vc=e=>e.ctrlKey||e.altKey||e.metaKey,Nx=e=>"touches"in e&&e.touches.length>0,Ax={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Hd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function xc(e,t={}){let{dir:r="ltr",orientation:n="horizontal"}=t,a=e.key;return a=Ax[a]??a,r==="rtl"&&n==="horizontal"&&a in Hd&&(a=Hd[a]),a}function Rx(e){return e.nativeEvent??e}var Dx=new Set(["PageUp","PageDown"]),Mx=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Lx(e){return e.ctrlKey||e.metaKey?.1:Dx.has(e.key)||e.shiftKey&&Mx.has(e.key)?10:1}function ua(e,t="client"){let r=Nx(e)?e.touches[0]||e.changedTouches[0]:e;return{x:r[`${t}X`],y:r[`${t}Y`]}}var He=(e,t,r,n)=>{let a=typeof e=="function"?e():e;return a?.addEventListener(t,r,n),()=>{a?.removeEventListener(t,r,n)}};function Fx(e,t){let{type:r="HTMLInputElement",property:n="value"}=t,a=Yt(e)[r].prototype;return Object.getOwnPropertyDescriptor(a,n)??{}}function $x(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Ux(e,t,r="value"){if(!e)return;let n=$x(e);n&&Fx(e,{type:n,property:r}).set?.call(e,t),e.setAttribute(r,t)}function jx(e){return Bx(e)?e.form:e.closest("form")}function Bx(e){return e.matches("textarea, input, select, button")}function zx(e,t){if(!e)return;let r=jx(e),n=a=>{a.defaultPrevented||t()};return r?.addEventListener("reset",n,{passive:!0}),()=>r?.removeEventListener("reset",n)}function Vx(e,t){let r=e?.closest("fieldset");if(!r)return;t(r.disabled);let n=Yt(r),a=new n.MutationObserver(()=>t(r.disabled));return a.observe(r,{attributes:!0,attributeFilter:["disabled"]}),()=>a.disconnect()}function Hx(e,t){if(!e)return;let{onFieldsetDisabledChange:r,onFormReset:n}=t,a=[zx(e,n),Vx(e,r)];return()=>a.forEach(i=>i?.())}var gm=e=>ct(e)&&e.tagName==="IFRAME",Zx=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),Gx=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Ru="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",mm=(e,t=!1)=>{if(!e)return[];let r=Array.from(e.querySelectorAll(Ru));(t==!0||t=="if-empty"&&r.length===0)&&ct(e)&&Sr(e)&&r.unshift(e);let n=r.filter(Sr);return n.forEach((a,i)=>{if(gm(a)&&a.contentDocument){let o=a.contentDocument.body;n.splice(i,1,...mm(o))}}),n};function Sr(e){return!e||e.closest("[inert]")?!1:e.matches(Ru)&&bx(e)}function eo(e,t){if(!e)return[];let r=Array.from(e.querySelectorAll(Ru)),n=r.filter(Gr);return t&&Gr(e)&&n.unshift(e),n.forEach((a,i)=>{if(gm(a)&&a.contentDocument){let o=a.contentDocument.body,s=eo(o);n.splice(i,1,...s)}}),!n.length&&t?r:n}function Gr(e){return e!=null&&e.tabIndex>0?!0:Sr(e)&&!Gx(e)}function Wx(e,t){let r=eo(e,t),n=r[0]||null,a=r[r.length-1]||null;return[n,a]}function Ma(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Iu(e))&&!Zx(e)?0:e.tabIndex}function qx(e){let{root:t,getInitialEl:r,filter:n,enabled:a=!0}=e;if(!a)return;let i=null;if(i||(i=typeof r=="function"?r():r),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){let o=eo(t);i=n?o.filter(n)[0]:o[0]}return i||t||void 0}function Kx(e){let t=e.currentTarget;if(!t)return!1;let[r,n]=Wx(t),a=t.ownerDocument||document;return!(a.activeElement===r&&e.shiftKey||a.activeElement===n&&!e.shiftKey||!r&&!n)}function fm(e){let t=new Set;function r(n){let a=globalThis.requestAnimationFrame(n);t.add(()=>globalThis.cancelAnimationFrame(a))}return r(()=>r(e)),function(){t.forEach(n=>n())}}function ze(e){let t,r=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(r),t?.()}}function Yx(e,t,r){let n=ze(()=>{e.removeEventListener(t,a,!0),r()}),a=()=>{n(),r()};return e.addEventListener(t,a,{once:!0,capture:!0}),n}function Xx(e,t){if(!e)return;let{attributes:r,callback:n}=t,a=e.ownerDocument.defaultView||window,i=new a.MutationObserver(o=>{for(let s of o)s.type==="attributes"&&s.attributeName&&r.includes(s.attributeName)&&n(s)});return i.observe(e,{attributes:!0,attributeFilter:r}),()=>i.disconnect()}function bm(e,t){let{defer:r}=t,n=r?ze:i=>i(),a=[];return a.push(n(()=>{let i=typeof e=="function"?e():e;a.push(Xx(i,t))})),()=>{a.forEach(i=>i?.())}}function Jx(e){let t=()=>e.click();Cx()?Yx(e,"keyup",t):queueMicrotask(t)}function wc(e){let t=xx(e);return hx(t)?pr(t).body:ct(t)&&ym(t)?t:wc(t)}var Qx=/auto|scroll|overlay|hidden|clip/;function ym(e){let t=Yt(e),{overflow:r,overflowX:n,overflowY:a,display:i}=t.getComputedStyle(e);return Qx.test(r+a+n)&&!["inline","contents"].includes(i)}function e1(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function t1(e,t){let{rootEl:r,...n}=t||{};!e||!r||!ym(r)||!e1(r)||e.scrollIntoView(n)}function r1(e,t){let r=e.body,n="pointerLockElement"in e||"mozPointerLockElement"in e,a=()=>!!e.pointerLockElement;function i(){t?.(a())}function o(l){a()&&t?.(!1),console.error("PointerLock error occurred:",l),e.exitPointerLock()}if(!n)return;try{r.requestPointerLock()}catch{}let s=[He(e,"pointerlockchange",i,!1),He(e,"pointerlockerror",o,!1)];return()=>{s.forEach(l=>l()),e.exitPointerLock()}}var da="default",kc="",jo=new WeakMap;function n1(e={}){let{target:t,doc:r}=e,n=r??document,a=n.documentElement;return qs()?(da==="default"&&(kc=a.style.webkitUserSelect,a.style.webkitUserSelect="none"),da="disabled"):t&&(jo.set(t,t.style.userSelect),t.style.userSelect="none"),()=>a1({target:t,doc:n})}function a1(e={}){let{target:t,doc:r}=e,n=(r??document).documentElement;if(qs()){if(da!=="disabled")return;da="restoring",setTimeout(()=>{fm(()=>{da==="restoring"&&(n.style.webkitUserSelect==="none"&&(n.style.webkitUserSelect=kc||""),kc="",da="default")})},300)}else if(t&&jo.has(t)){let a=jo.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a??""),t.getAttribute("style")===""&&t.removeAttribute("style"),jo.delete(t)}}function i1(e={}){let{defer:t,target:r,...n}=e,a=t?ze:o=>o(),i=[];return i.push(a(()=>{let o=typeof r=="function"?r():r;i.push(n1({...n,target:o}))})),()=>{i.forEach(o=>o?.())}}function o1(e,t){let{onPointerMove:r,onPointerUp:n}=t,a=[He(e,"pointermove",i=>{let o=ua(i),s=Math.sqrt(o.x**2+o.y**2),l=i.pointerType==="touch"?10:5;if(!(s<l)){if(i.pointerType==="mouse"&&i.button===0){n();return}r({point:o,event:i})}},!1),He(e,"pointerup",n,!1),He(e,"pointercancel",n,!1),He(e,"contextmenu",n,!1),i1({doc:e})];return()=>{a.forEach(i=>i())}}function vm(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Du=e=>e.id;function s1(e,t,r=Du){return e.find(n=>r(n)===t)}function l1(e,t,r=Du){let n=s1(e,t,r);return n?e.indexOf(n):-1}var c1=e=>e.split("").map(t=>{let r=t.charCodeAt(0);return r>0&&r<128?t:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),u1=e=>c1(e.dataset?.valuetext??e.textContent??""),d1=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function p1(e,t,r,n=Du){let a=r?l1(e,r,n):-1,i=r?lx(e,a):e;return t.length===1&&(i=i.filter(o=>n(o)!==r)),i.find(o=>d1(u1(o),t))}function rs(e,t){if(!e)return om;let r=Object.keys(t).reduce((n,a)=>(n[a]=e.style.getPropertyValue(a),n),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,r),e.style.length===0&&e.removeAttribute("style")}}function h1(e,t,r){if(!e)return om;let n=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{e.style.setProperty(t,n),e.style.length===0&&e.removeAttribute("style")}}function g1(e,t){let{state:r,activeId:n,key:a,timeout:i=350,itemToId:o}=t,s=r.keysSoFar+a,l=s.length>1&&Array.from(s).every(h=>h===s[0])?s[0]:s,c=e.slice(),u=p1(c,l,n,o);function d(){clearTimeout(r.timer),r.timer=-1}function p(h){r.keysSoFar=h,d(),h!==""&&(r.timer=+setTimeout(()=>{p(""),d()},i))}return p(s),u}var xm=Object.assign(g1,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:m1});function m1(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var f1=1e3/60;function b1(e,t){let r=e();if(ct(r)&&r.isConnected)return t(r),()=>{};{let n=setInterval(()=>{let a=e();ct(a)&&a.isConnected&&(t(a),clearInterval(n))},f1);return()=>clearInterval(n)}}function y1(e,t){let r=[];return e?.forEach(n=>{let a=b1(n,t);r.push(a)}),()=>{r.forEach(n=>n())}}var v1=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),x1=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Zd=e=>{let t={},r;for(;r=x1.exec(e);)t[r[1]]=r[2];return t},w1=(e,t)=>{if(Tr(e)){if(Tr(t))return`${e};${t}`;e=Zd(e)}else Tr(t)&&(t=Zd(t));return Object.assign({},e??{},t??{})};function k1(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=fi(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=v1(t[n],r[n]);continue}if(n==="style"){t[n]=w1(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n]}for(let n in r)t[n]===void 0&&(t[n]=r[n])}return t}var ra=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(ra||{}),kl="__init__";function _1(e){let t=()=>e.getRootNode?.()??document,r=()=>pr(t()),n=()=>r().defaultView??window,a=()=>cm(t());return{...e,getRootNode:t,getDoc:r,getWin:n,getActiveElement:a,isActiveElement:i=>i===a(),getById:i=>t().getElementById(i)}}function T1(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var Lt=()=>e=>Array.from(new Set(e));function ns(e){let t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n,a]=N(t),i=he(()=>e().value!=null),o={current:n()},s={current:void 0};Ye(()=>{let u=i()?e().value:n();s.current=u,o.current=u});let l=u=>{let d=s.current,p=er(u)?u(o.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:p,prev:d}),i()||a(p),r(p,d)||e().onChange?.(p,d)};function c(){let u=i()?e().value:n;return er(u)?u():u}return{initial:t,ref:o,get:c,set:l,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}ns.cleanup=e=>{Ie(()=>e())};ns.ref=e=>{let t=e;return{get:()=>t,set:r=>{t=r}}};function S1(e){let[t,r]=N(e);return{get(n){return t()[n]},set(n,a){r(i=>({...i,[n]:a}))}}}function _l(e){return er(e)?e():e}var E1=(e,t)=>{let r=[],n=!0;Ye(()=>{if(n){r=e.map(i=>_l(i)),n=!1;return}let a=!1;for(let i=0;i<e.length;i++)if(!Qi(r[i],_l(e[i]))){a=!0;break}a&&(r=e.map(i=>_l(i)),t())})};function an(e,t={}){let r=he(()=>{let{id:P,ids:I,getRootNode:L}=Tl(t);return _1({id:P,ids:I,getRootNode:L})}),n=(...P)=>{e.debug&&console.log(...P)},a=he(()=>e.props?.({props:Zs(Tl(t)),scope:r()})??Tl(t)),i=C1(a),o=e.context?.({prop:i,bindable:ns,get scope(){return r()},flush:Gd,getContext(){return s},getComputed(){return f},getRefs(){return y}}),s={get(P){return o?.[P].get()},set(P,I){o?.[P].set(I)},initial(P){return o?.[P].initial},hash(P){let I=o?.[P].get();return o?.[P].hash(I)}},l={current:new Map},c={current:null},u={current:null},d={current:{type:""}},p=()=>De(d.current,{current(){return d.current},previous(){return u.current}}),h=()=>De(k,{matches(...P){let I=k.get();return P.includes(I)},hasTag(P){let I=k.get();return!!e.states[I]?.tags?.includes(P)}}),y=S1(e.refs?.({prop:i,context:s})??{}),m=()=>({state:h(),context:s,event:p(),prop:i,send:C,action:v,guard:w,track:E1,refs:y,computed:f,flush:Gd,get scope(){return r()},choose:x}),v=P=>{let I=er(P)?P(m()):P;if(!I)return;let L=I.map(R=>{let D=e.implementations?.actions?.[R];return D||ts(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),D});for(let R of L)R?.(m())},w=P=>er(P)?P(m()):e.implementations?.guards?.[P](m()),b=P=>{let I=er(P)?P(m()):P;if(!I)return;let L=I.map(D=>{let V=e.implementations?.effects?.[D];return V||ts(`[zag-js] No implementation found for effect "${JSON.stringify(D)}"`),V}),R=[];for(let D of L){let V=D?.(m());V&&R.push(V)}return()=>R.forEach(D=>D?.())},x=P=>A0(P).find(I=>{let L=!I.guard;return Tr(I.guard)?L=!!w(I.guard):er(I.guard)&&(L=I.guard(m())),L}),f=P=>{sx(e.computed,()=>"[zag-js] No computed object found on machine");let I=e.computed[P];return I({context:s,event:d.current,prop:i,refs:y,scope:r(),computed:f})},k=ns(()=>({defaultValue:e.initialState({prop:i}),onChange(P,I){I&&(l.current.get(I)?.(),l.current.delete(I)),I&&v(e.states[I]?.exit),v(c.current?.actions);let L=b(e.states[P]?.effects);if(L&&l.current.set(P,L),I===kl){v(e.entry);let R=b(e.effects);R&&l.current.set(kl,R)}v(e.states[P]?.entry)}})),_=ra.NotStarted;$e(()=>{let P=_===ra.Started;_=ra.Started,n(P?"rehydrating...":"initializing..."),k.invoke(k.initial,kl)}),Ie(()=>{n("unmounting..."),_=ra.Stopped,l.current.forEach(P=>P?.()),l.current=new Map,c.current=null,v(e.exit)});let C=P=>{if(_!==ra.Started)return;u.current=d.current,d.current=P,n("send",P);let I=k.get(),L=e.states[I].on?.[P.type]??e.on?.[P.type],R=x(L);if(!R)return;n("transition",R),c.current=R;let D=R.target??I,V=D!==I;V?k.set(D):R.reenter&&!V?k.invoke(I,I):v(R.actions)};return e.watch?.(m()),{state:h(),send:C,context:s,prop:i,get scope(){return r()},refs:y,computed:f,event:p(),getStatus:()=>_}}function Gd(e){e()}function Tl(e){return er(e)?e():e}function C1(e){return function(t){return e()[t]}}function B(...e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"&&(n=n()),n){let a=Object.getOwnPropertyDescriptors(n);for(let i in a)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let o={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let s=0;s<e.length;s++){let l=e[s];typeof l=="function"&&(l=l()),o=k1(o,{[i]:(l||{})[i]})}return o[i]}for(let s=e.length-1;s>=0;s--){let l,c=e[s];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var Wd={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},P1=e=>e.startsWith("--")?e:D1(e);function O1(e){return e in Wd?Wd[e]:e}var on=T1(e=>{let t={};for(let r in e){let n=e[r];if(!(r==="readOnly"&&n===!1)){if(r==="style"&&rm(n)){t.style=I1(n);continue}if(r==="children"){Tr(n)&&(t.textContent=n);continue}t[O1(r)]=n}}return t});function I1(e){let t={};for(let r in e){let n=e[r];!Tr(n)&&!Pu(n)||(t[P1(r)]=n)}return t}var N1=/[A-Z]/g,A1=/^ms-/;function R1(e){return"-"+e.toLowerCase()}var Sl={};function D1(e){if(Sl.hasOwnProperty(e))return Sl[e];var t=e.replace(N1,R1);return Sl[e]=A1.test(t)?"-"+t:t}var El=e=>t=>{let[r,n]=Rt(t,["asChild"]);if(r.asChild){let a=i=>{let[,o]=Rt(n,["ref"]);return B(o,i)};return r.asChild(a)}return g(Vy,De({component:e},n))};function M1(){let e=new Map;return new Proxy(El,{apply(t,r,n){return El(n[0])},get(t,r){let n=r;return e.has(n)||e.set(n,El(n)),e.get(n)}})}var K=M1(),L1=e=>typeof e=="function",sn=(e,...t)=>L1(e)?e(...t):e;function F1(e,t){let{state:r,send:n,context:a}=e,i=r.matches("mounted","unmountSuspended");return{skip:!a.get("initial"),present:i,setNode(o){o&&n({type:"NODE.SET",node:o})},unmount(){n({type:"UNMOUNT"})}}}var $1={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,action:t,prop:r}){e([()=>r("present")],()=>{t(["setInitial","syncPresence"])})},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},setNode:({refs:e,event:t})=>{e.set("node",t.node)},setStyles:({refs:e,event:t})=>{e.set("styles",Sa(t.node))},syncPresence:({context:e,refs:t,send:r,prop:n})=>{let a=n("present");if(a)return r({type:"MOUNT",src:"presence.changed"});let i=t.get("node");if(!a&&i?.ownerDocument.visibilityState==="hidden")return r({type:"UNMOUNT",src:"visibilitychange"});ze(()=>{let o=xo(t.get("styles"));e.set("unmountAnimationName",o),o==="none"||o===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{ze(()=>{e.set("prevAnimationName",xo(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:r})=>{let n=t.get("node");if(!n)return;let a=s=>{(s.composedPath?.()?.[0]??s.target)===n&&e.set("prevAnimationName",xo(t.get("styles")))},i=s=>{let l=xo(t.get("styles"));St(s)===n&&l===e.get("unmountAnimationName")&&r({type:"UNMOUNT",src:"animationend"})};n.addEventListener("animationstart",a),n.addEventListener("animationcancel",i),n.addEventListener("animationend",i);let o=rs(n,{animationFillMode:"forwards"});return()=>{n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",i),n.removeEventListener("animationend",i),fm(()=>o())}}}}};function xo(e){return e?.animationName||"none"}var $N=Lt()(["onExitComplete","present","immediate"]),Ks=e=>qe()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),to=e=>{let[t,r]=Eu(sn(e)),[n,a]=N(!1),i=an($1,e),o=he(()=>F1(i,on));return Ye(()=>{o().present&&a(!0)}),he(()=>({unmounted:!o().present&&!n()&&t.lazyMount||t.unmountOnExit&&!o().present&&n(),present:o().present,ref:o().setNode,presenceProps:{hidden:!o().present,"data-state":o().skip&&r.skipAnimationOnMount?void 0:r.present?"open":"closed"}}))},[Ys,Ea]=ut({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),[UN,Ca]=ut({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),[U1,Dr]=ut({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),j1=E("<span hidden>"),Mu=e=>{let[t,r]=N(),n=()=>sn(e.value)??t()?.getRootNode()??document,a=he(()=>({getRootNode:n,getDocument:()=>pr(n()),getWindow:()=>Yt(n())}));return g(U1,{value:a,get children(){return[j(()=>e.children),g(X,{get when(){return!e.value},get children(){var i=j1();return Ve(r,i),i}})]}})},B1=Object.defineProperty,ln=(e,t)=>{for(var r in t)B1(e,r,{get:t[r],enumerable:!0})},Bt=(e,t=[])=>({parts:(...r)=>{if(z1(t))return Bt(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Bt(e,[...t,...r]),rename:r=>Bt(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Yn(e)}"][data-part="${Yn(n)}"]`,`& [data-scope="${Yn(e)}"][data-part="${Yn(n)}"]`].join(", "),attrs:{"data-scope":Yn(e),"data-part":Yn(n)}}}),{})}),Yn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),z1=e=>e.length===0,V1=["top","right","bottom","left"],Qr=Math.min,Tt=Math.max,as=Math.round,wo=Math.floor,rr=e=>({x:e,y:e}),H1={left:"right",right:"left",bottom:"top",top:"bottom"};function _c(e,t,r){return Tt(e,Qr(t,r))}function Ir(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Pa(e){return e.split("-")[1]}function Lu(e){return e==="x"?"y":"x"}function Fu(e){return e==="y"?"height":"width"}function tr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function $u(e){return Lu(tr(e))}function Z1(e,t,r){r===void 0&&(r=!1);let n=Pa(e),a=$u(e),i=Fu(a),o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=is(o)),[o,is(o)]}function G1(e){let t=is(e);return[Tc(e),t,Tc(t)]}function Tc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var qd=["left","right"],Kd=["right","left"],W1=["top","bottom"],q1=["bottom","top"];function K1(e,t,r){switch(e){case"top":case"bottom":return r?t?Kd:qd:t?qd:Kd;case"left":case"right":return t?W1:q1;default:return[]}}function Y1(e,t,r,n){let a=Pa(e),i=K1(Nr(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Tc)))),i}function is(e){let t=Nr(e);return H1[t]+e.slice(t.length)}function X1(e){return{top:0,right:0,bottom:0,left:0,...e}}function wm(e){return typeof e!="number"?X1(e):{top:e,right:e,bottom:e,left:e}}function os(e){let{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Yd(e,t,r){let{reference:n,floating:a}=e,i=tr(t),o=$u(t),s=Fu(o),l=Nr(t),c=i==="y",u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,p=n[s]/2-a[s]/2,h;switch(l){case"top":h={x:u,y:n.y-a.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-a.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Pa(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}async function J1(e,t){var r;t===void 0&&(t={});let{x:n,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Ir(t,e),y=wm(h),m=s[p?d==="floating"?"reference":"floating":d],v=os(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(m)))==null||r?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),x=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},f=os(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:l}):w);return{top:(v.top-f.top+y.top)/x.y,bottom:(f.bottom-v.bottom+y.bottom)/x.y,left:(v.left-f.left+y.left)/x.x,right:(f.right-v.right+y.right)/x.x}}var Q1=50,ew=async(e,t,r)=>{let{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=o.detectOverflow?o:{...o,detectOverflow:J1},l=await(o.isRTL==null?void 0:o.isRTL(t)),c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Yd(c,n,l),p=n,h=0,y={};for(let m=0;m<i.length;m++){let v=i[m];if(!v)continue;let{name:w,fn:b}=v,{x,y:f,data:k,reset:_}=await b({x:u,y:d,initialPlacement:n,placement:p,strategy:a,middlewareData:y,rects:c,platform:s,elements:{reference:e,floating:t}});u=x??u,d=f??d,y[w]={...y[w],...k},_&&h<Q1&&(h++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(c=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:u,y:d}=Yd(c,p,l)),m=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:y}},tw=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Ir(e,t)||{};if(c==null)return{};let d=wm(u),p={x:r,y:n},h=$u(a),y=Fu(h),m=await o.getDimensions(c),v=h==="y",w=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",f=i.reference[y]+i.reference[h]-p[h]-i.floating[y],k=p[h]-i.reference[h],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),C=_?_[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(_)))&&(C=s.floating[x]||i.floating[y]);let P=f/2-k/2,I=C/2-m[y]/2-1,L=Qr(d[w],I),R=Qr(d[b],I),D=L,V=C-m[y]-R,F=C/2-m[y]/2+P,le=_c(D,F,V),O=!l.arrow&&Pa(a)!=null&&F!==le&&i.reference[y]/2-(F<D?L:R)-m[y]/2<0,A=O?F<D?F-D:F-V:0;return{[h]:p[h]+A,data:{[h]:le,centerOffset:F-le-A,...O&&{alignmentOffset:A}},reset:O}}}),rw=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...v}=Ir(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};let w=Nr(a),b=tr(s),x=Nr(s)===s,f=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=p||(x||!m?[is(s)]:G1(s)),_=y!=="none";!p&&_&&k.push(...Y1(s,m,y,f));let C=[s,...k],P=await l.detectOverflow(t,v),I=[],L=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&I.push(P[w]),d){let F=Z1(a,o,f);I.push(P[F[0]],P[F[1]])}if(L=[...L,{placement:a,overflows:I}],!I.every(F=>F<=0)){var R,D;let F=(((R=i.flip)==null?void 0:R.index)||0)+1,le=C[F];if(le&&(!(d==="alignment"&&b!==tr(le))||L.every(A=>tr(A.placement)===b?A.overflows[0]>0:!0)))return{data:{index:F,overflows:L},reset:{placement:le}};let O=(D=L.filter(A=>A.overflows[0]<=0).sort((A,z)=>A.overflows[1]-z.overflows[1])[0])==null?void 0:D.placement;if(!O)switch(h){case"bestFit":{var V;let A=(V=L.filter(z=>{if(_){let ge=tr(z.placement);return ge===b||ge==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(ge=>ge>0).reduce((ge,me)=>ge+me,0)]).sort((z,ge)=>z[1]-ge[1])[0])==null?void 0:V[0];A&&(O=A);break}case"initialPlacement":O=s;break}if(a!==O)return{reset:{placement:O}}}return{}}}};function Xd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jd(e){return V1.some(t=>e[t]>=0)}var nw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=Ir(e,t);switch(a){case"referenceHidden":{let o=await n.detectOverflow(t,{...i,elementContext:"reference"}),s=Xd(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Jd(s)}}}case"escaped":{let o=await n.detectOverflow(t,{...i,altBoundary:!0}),s=Xd(o,r.floating);return{data:{escapedOffsets:s,escaped:Jd(s)}}}default:return{}}}}},km=new Set(["left","top"]);async function aw(e,t){let{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=Nr(r),s=Pa(r),l=tr(r)==="y",c=km.has(o)?-1:1,u=i&&l?-1:1,d=Ir(t,e),{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(h=s==="end"?y*-1:y),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}var iw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:a,y:i,placement:o,middlewareData:s}=t,l=await aw(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},ow=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:b,y:x}=w;return{x:b,y:x}}},...c}=Ir(e,t),u={x:r,y:n},d=await i.detectOverflow(t,c),p=tr(Nr(a)),h=Lu(p),y=u[h],m=u[p];if(o){let w=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=y+d[w],f=y-d[b];y=_c(x,y,f)}if(s){let w=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=m+d[w],f=m-d[b];m=_c(x,m,f)}let v=l.fn({...t,[h]:y,[p]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[h]:o,[p]:s}}}}}},sw=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Ir(e,t),u={x:r,y:n},d=tr(a),p=Lu(d),h=u[p],y=u[d],m=Ir(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let x=p==="y"?"height":"width",f=i.reference[p]-i.floating[x]+v.mainAxis,k=i.reference[p]+i.reference[x]-v.mainAxis;h<f?h=f:h>k&&(h=k)}if(c){var w,b;let x=p==="y"?"width":"height",f=km.has(Nr(a)),k=i.reference[d]-i.floating[x]+(f&&((w=o.offset)==null?void 0:w[d])||0)+(f?0:v.crossAxis),_=i.reference[d]+i.reference[x]+(f?0:((b=o.offset)==null?void 0:b[d])||0)-(f?v.crossAxis:0);y<k?y=k:y>_&&(y=_)}return{[p]:h,[d]:y}}}},lw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;let{placement:a,rects:i,platform:o,elements:s}=t,{apply:l=()=>{},...c}=Ir(e,t),u=await o.detectOverflow(t,c),d=Nr(a),p=Pa(a),h=tr(a)==="y",{width:y,height:m}=i.floating,v,w;d==="top"||d==="bottom"?(v=d,w=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,v=p==="end"?"top":"bottom");let b=m-u.top-u.bottom,x=y-u.left-u.right,f=Qr(m-u[v],b),k=Qr(y-u[w],x),_=!t.middlewareData.shift,C=f,P=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=b),_&&!p){let L=Tt(u.left,0),R=Tt(u.right,0),D=Tt(u.top,0),V=Tt(u.bottom,0);h?P=y-2*(L!==0||R!==0?L+R:Tt(u.left,u.right)):C=m-2*(D!==0||V!==0?D+V:Tt(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:C});let I=await o.getDimensions(s.floating);return y!==I.width||m!==I.height?{reset:{rects:!0}}:{}}}};function Xs(){return typeof window<"u"}function Oa(e){return _m(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hr(e){var t;return(t=(_m(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _m(e){return Xs()?e instanceof Node||e instanceof Ct(e).Node:!1}function Ht(e){return Xs()?e instanceof Element||e instanceof Ct(e).Element:!1}function lr(e){return Xs()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function Qd(e){return!Xs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}function ro(e){let{overflow:t,overflowX:r,overflowY:n,display:a}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&a!=="inline"&&a!=="contents"}function cw(e){return/^(table|td|th)$/.test(Oa(e))}function Js(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var uw=/transform|translate|scale|rotate|perspective|filter/,dw=/paint|layout|strict|content/,gn=e=>!!e&&e!=="none",Cl;function Uu(e){let t=Ht(e)?Zt(e):e;return gn(t.transform)||gn(t.translate)||gn(t.scale)||gn(t.rotate)||gn(t.perspective)||!ju()&&(gn(t.backdropFilter)||gn(t.filter))||uw.test(t.willChange||"")||dw.test(t.contain||"")}function pw(e){let t=en(e);for(;lr(t)&&!ba(t);){if(Uu(t))return t;if(Js(t))return null;t=en(t)}return null}function ju(){return Cl==null&&(Cl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Cl}function ba(e){return/^(html|body|#document)$/.test(Oa(e))}function Zt(e){return Ct(e).getComputedStyle(e)}function Qs(e){return Ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function en(e){if(Oa(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Qd(e)&&e.host||hr(e);return Qd(t)?t.host:t}function Tm(e){let t=en(e);return ba(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&ro(t)?t:Tm(t)}function vi(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let a=Tm(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=Ct(a);if(i){let s=Sc(o);return t.concat(o,o.visualViewport||[],ro(a)?a:[],s&&r?vi(s):[])}else return t.concat(a,vi(a,[],r))}function Sc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sm(e){let t=Zt(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=lr(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,s=as(r)!==i||as(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function Bu(e){return Ht(e)?e:e.contextElement}function ha(e){let t=Bu(e);if(!lr(t))return rr(1);let r=t.getBoundingClientRect(),{width:n,height:a,$:i}=Sm(t),o=(i?as(r.width):r.width)/n,s=(i?as(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var hw=rr(0);function Em(e){let t=Ct(e);return!ju()||!t.visualViewport?hw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gw(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ct(e)?!1:t}function Dn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let a=e.getBoundingClientRect(),i=Bu(e),o=rr(1);t&&(n?Ht(n)&&(o=ha(n)):o=ha(e));let s=gw(i,r,n)?Em(i):rr(0),l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,u=a.width/o.x,d=a.height/o.y;if(i){let p=Ct(i),h=n&&Ht(n)?Ct(n):n,y=p,m=Sc(y);for(;m&&n&&h!==y;){let v=ha(m),w=m.getBoundingClientRect(),b=Zt(m),x=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,f=w.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=f,y=Ct(m),m=Sc(y)}}return os({width:u,height:d,x:l,y:c})}function zu(e,t){let r=Qs(e).scrollLeft;return t?t.left+r:Dn(hr(e)).left+r}function Cm(e,t,r){r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:zu(e,n)),i=n.top+t.scrollTop;return{x:a,y:i}}function mw(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e,i=a==="fixed",o=hr(n),s=t?Js(t.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=rr(1),u=rr(0),d=lr(n);if((d||!d&&!i)&&((Oa(n)!=="body"||ro(o))&&(l=Qs(n)),lr(n))){let h=Dn(n);c=ha(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}let p=o&&!d&&!i?Cm(o,l,!0):rr(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function fw(e){return Array.from(e.getClientRects())}function bw(e){let t=hr(e),r=Qs(e),n=e.ownerDocument.body,a=Tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),o=-r.scrollLeft+zu(e),s=-r.scrollTop;return Zt(n).direction==="rtl"&&(o+=Tt(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}function yw(e,t){let r=Ct(e),n=hr(e),a=r.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;let c=ju();(!c||c&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}return{width:i,height:o,x:s,y:l}}function vw(e,t){let r=Dn(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=lr(e)?ha(e):rr(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,c=n*i.y;return{width:o,height:s,x:l,y:c}}function ep(e,t,r){let n;if(t==="viewport")n=yw(e,r);else if(t==="document")n=bw(hr(e));else if(Ht(t))n=vw(t,r);else{let a=Em(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return os(n)}function Pm(e,t){let r=en(e);return r===t||!Ht(r)||ba(r)?!1:Zt(r).position==="fixed"||Pm(r,t)}function xw(e,t){let r=t.get(e);if(r)return r;let n=vi(e,[],!1).filter(s=>Ht(s)&&Oa(s)!=="body"),a=null,i=Zt(e).position==="fixed",o=i?en(e):e;for(;Ht(o)&&!ba(o);){let s=Zt(o),l=Uu(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&a&&["absolute","fixed"].includes(a.position)||ro(o)&&!l&&Pm(e,o))?n=n.filter(c=>c!==o):a=s,o=en(o)}return t.set(e,n),n}function ww(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e,i=[...r==="clippingAncestors"?Js(t)?[]:xw(t,this._c):[].concat(r),n],o=i[0],s=i.reduce((l,c)=>{let u=ep(t,c,a);return l.top=Tt(u.top,l.top),l.right=Qr(u.right,l.right),l.bottom=Qr(u.bottom,l.bottom),l.left=Tt(u.left,l.left),l},ep(t,o,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function kw(e){let{width:t,height:r}=Sm(e);return{width:t,height:r}}function _w(e,t,r){let n=lr(t),a=hr(t),i=r==="fixed",o=Dn(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=rr(0);function c(){l.x=zu(a)}if(n||!n&&!i)if((Oa(t)!=="body"||ro(a))&&(s=Qs(t)),n){let h=Dn(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&c();i&&!n&&a&&c();let u=a&&!n&&!i?Cm(a,s):rr(0),d=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:d,y:p,width:o.width,height:o.height}}function Pl(e){return Zt(e).position==="static"}function tp(e,t){if(!lr(e)||Zt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return hr(e)===r&&(r=r.ownerDocument.body),r}function Om(e,t){let r=Ct(e);if(Js(e))return r;if(!lr(e)){let a=en(e);for(;a&&!ba(a);){if(Ht(a)&&!Pl(a))return a;a=en(a)}return r}let n=tp(e,t);for(;n&&cw(n)&&Pl(n);)n=tp(n,t);return n&&ba(n)&&Pl(n)&&!Uu(n)?r:n||pw(e)||r}var Tw=async function(e){let t=this.getOffsetParent||Om,r=this.getDimensions,n=await r(e.floating);return{reference:_w(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Sw(e){return Zt(e).direction==="rtl"}var Ew={convertOffsetParentRelativeRectToViewportRelativeRect:mw,getDocumentElement:hr,getClippingRect:ww,getOffsetParent:Om,getElementRects:Tw,getClientRects:fw,getDimensions:kw,getScale:ha,isElement:Ht,isRTL:Sw};function Im(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cw(e,t){let r=null,n,a=hr(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();let c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;let y=wo(d),m=wo(a.clientWidth-(u+p)),v=wo(a.clientHeight-(d+h)),w=wo(u),b={rootMargin:-y+"px "+-m+"px "+-v+"px "+-w+"px",threshold:Tt(0,Qr(1,l))||1},x=!0;function f(k){let _=k[0].intersectionRatio;if(_!==l){if(!x)return o();_?o(!1,_):n=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!Im(c,e.getBoundingClientRect())&&o(),x=!1}try{r=new IntersectionObserver(f,{...b,root:a.ownerDocument})}catch{r=new IntersectionObserver(f,b)}r.observe(e)}return o(!0),i}function Pw(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Bu(e),u=a||i?[...c?vi(c):[],...vi(t)]:[];u.forEach(w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});let d=c&&s?Cw(c,r):null,p=-1,h=null;o&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let y,m=l?Dn(e):null;l&&v();function v(){let w=Dn(e);m&&!Im(m,w)&&r(),m=w,y=requestAnimationFrame(v)}return r(),()=>{var w;u.forEach(b=>{a&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),d?.(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(y)}}var Ow=iw,Iw=ow,Nw=rw,Aw=lw,Rw=nw,Dw=tw,Mw=sw,Lw=(e,t,r)=>{let n=new Map,a={platform:Ew,...r},i={...a.platform,_c:n};return ew(e,t,{...a,platform:i})};function rp(e=0,t=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(e,t,r,n);let a={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...a,toJSON:()=>a}}function Fw(e){if(!e)return rp();let{x:t,y:r,width:n,height:a}=e;return rp(t,r,n,a)}function $w(e,t){return{contextElement:ct(e)?e:void 0,getBoundingClientRect:()=>{let r=e,n=t?.(r);return n||!r?Fw(n):r.getBoundingClientRect()}}}var La=e=>({variable:e,reference:`var(${e})`}),kr={arrowSize:La("--arrow-size"),arrowSizeHalf:La("--arrow-size-half"),arrowBg:La("--arrow-background"),transformOrigin:La("--transform-origin"),arrowOffset:La("--arrow-offset")},Uw=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),jw={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:r}){let{arrow:n}=r,a=Uw(n)[e],{floating:i}=t;return i.style.setProperty(kr.transformOrigin.variable,a),{data:{transformOrigin:a}}}},Bw={name:"rects",fn({rects:e}){return{data:e}}},zw=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:r}){if(!r.arrow)return{};let{x:n,y:a}=r.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:n!=null?`${n}px`:"",top:a!=null?`${a}px`:"",[i]:`calc(100% + ${kr.arrowOffset.reference})`}),{}}}};function Vw(e){let[t,r]=e.split("-");return{side:t,align:r,hasAlign:r!=null}}function Hw(e){return e.split("-")[0]}var Zw={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function np(e,t){let r=e.devicePixelRatio||1;return Math.round(t*r)/r}function Nm(e){return qa(e.boundary)}function Gw(e,t){if(e)return Dw({element:e,padding:t.arrowPadding})}function Ww(e,t){if(!V0(t.offset??t.gutter))return Ow(({placement:r})=>{let n=(e?.clientHeight||0)/2,a=t.offset?.mainAxis??t.gutter,i=typeof a=="number"?a+n:a??n,{hasAlign:o}=Vw(r),s=o?void 0:t.shift,l=t.offset?.crossAxis??s;return Zs({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function qw(e){if(e.flip)return Nw({boundary:Nm(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function Kw(e){if(!(!e.slide&&!e.overlap))return Iw({boundary:Nm(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Mw()})}function Yw(e){return Aw({padding:e.overflowPadding,apply({elements:t,rects:r,availableHeight:n,availableWidth:a}){let i=t.floating,o=Math.round(r.reference.width);a=Math.floor(a),n=Math.floor(n),i.style.setProperty("--reference-width",`${o}px`),i.style.setProperty("--available-width",`${a}px`),i.style.setProperty("--available-height",`${n}px`)}})}function Xw(e){if(e.hideWhenDetached)return Rw({strategy:"referenceHidden",boundary:e.boundary?.()??"clippingAncestors"})}function Jw(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function Qw(e,t,r={}){let n=$w(e,r.getAnchorRect);if(!t||!n)return;let a=Object.assign({},Zw,r),i=t.querySelector("[data-part=arrow]"),o=[Ww(i,a),qw(a),Kw(a),Gw(i,a),zw(i),jw,Yw(a),Xw(a),Bw],{placement:s,strategy:l,onComplete:c,onPositioned:u}=a,d=async()=>{if(!n||!t)return;let m=await Lw(n,t,{placement:s,middleware:o,strategy:l});c?.(m),u?.({placed:!0});let v=Yt(t),w=np(v,m.x),b=np(v,m.y);t.style.setProperty("--x",`${w}px`),t.style.setProperty("--y",`${b}px`),a.hideWhenDetached&&(m.middlewareData.hide?.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));let x=t.firstElementChild;if(x){let f=Sa(x);t.style.setProperty("--z-index",f.zIndex)}},p=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:d}),u?.({placed:!0})):await d()},h=Jw(a.listeners),y=a.listeners?Pw(n,t,p,h):Z0;return p(),()=>{y?.(),u?.({placed:!1})}}function ap(e,t,r={}){let{defer:n,...a}=r,i=n?ze:s=>s(),o=[];return o.push(i(()=>{let s=typeof e=="function"?e():e,l=typeof t=="function"?t():t;o.push(Qw(s,l,a))})),()=>{o.forEach(s=>s?.())}}var ek={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function tk(e={}){let{placement:t,sameWidth:r,fitViewport:n,strategy:a="absolute"}=e;return{arrow:{position:"absolute",width:kr.arrowSize.reference,height:kr.arrowSize.reference,[kr.arrowSizeHalf.variable]:`calc(${kr.arrowSize.reference} / 2)`,[kr.arrowOffset.variable]:`calc(${kr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?ek[t.split("-")[0]]:void 0,background:kr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:a,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function rk(e){let t={each(r){for(let n=0;n<e.frames?.length;n+=1){let a=e.frames[n];a&&r(a)}},addEventListener(r,n,a){return t.each(i=>{try{i.document.addEventListener(r,n,a)}catch{}}),()=>{try{t.removeEventListener(r,n,a)}catch{}}},removeEventListener(r,n,a){t.each(i=>{try{i.document.removeEventListener(r,n,a)}catch{}})}};return t}function nk(e){let t=e.frameElement!=null?e.parent:null;return{addEventListener:(r,n,a)=>{try{t?.addEventListener(r,n,a)}catch{}return()=>{try{t?.removeEventListener(r,n,a)}catch{}}},removeEventListener:(r,n,a)=>{try{t?.removeEventListener(r,n,a)}catch{}}}}var ip="pointerdown.outside",op="focus.outside";function ak(e){for(let t of e)if(ct(t)&&Sr(t))return!0;return!1}var Am=e=>"clientY"in e;function ik(e,t){if(!Am(t)||!e)return!1;let r=e.getBoundingClientRect();return r.width===0||r.height===0?!1:r.top<=t.clientY&&t.clientY<=r.top+r.height&&r.left<=t.clientX&&t.clientX<=r.left+r.width}function ok(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function sp(e,t){if(!t||!Am(e))return!1;let r=t.scrollHeight>t.clientHeight,n=r&&e.clientX>t.offsetLeft+t.clientWidth,a=t.scrollWidth>t.clientWidth,i=a&&e.clientY>t.offsetTop+t.clientHeight,o={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(r?16:0),height:t.clientHeight+(a?16:0)},s={x:e.clientX,y:e.clientY};return ok(o,s)?n||i:!1}function sk(e,t){let{exclude:r,onFocusOutside:n,onPointerDownOutside:a,onInteractOutside:i,defer:o}=t;if(!e)return;let s=pr(e),l=Yt(e),c=rk(l),u=nk(l);function d(b,x){if(!ct(x)||!x.isConnected||Or(e,x)||ik(e,b))return!1;let f=s.querySelector(`[aria-controls="${e.id}"]`);if(f){let _=wc(f);if(sp(b,_))return!1}let k=wc(e);return sp(b,k)?!1:!r?.(x)}let p=new Set,h=yi(e?.getRootNode());function y(b){function x(f){let k=o&&!jd()?ze:P=>P(),_=f??b,C=_?.composedPath?.()??[_?.target];k(()=>{let P=h?C[0]:St(b);if(!(!e||!d(b,P))){if(a||i){let I=fi(a,i);e.addEventListener(ip,I,{once:!0})}lp(e,ip,{bubbles:!1,cancelable:!0,detail:{originalEvent:_,contextmenu:hm(_),focusable:ak(C),target:P}})}})}b.pointerType==="touch"?(p.forEach(f=>f()),p.add(He(s,"click",x,{once:!0})),p.add(u.addEventListener("click",x,{once:!0})),p.add(c.addEventListener("click",x,{once:!0}))):x()}let m=new Set,v=setTimeout(()=>{m.add(He(s,"pointerdown",y,!0)),m.add(u.addEventListener("pointerdown",y,!0)),m.add(c.addEventListener("pointerdown",y,!0))},0);function w(b){(o?ze:x=>x())(()=>{let x=St(b);if(!(!e||!d(b,x))){if(n||i){let f=fi(n,i);e.addEventListener(op,f,{once:!0})}lp(e,op,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:Sr(x),target:x}})}})}return jd()||(m.add(He(s,"focusin",w,!0)),m.add(u.addEventListener("focusin",w,!0)),m.add(c.addEventListener("focusin",w,!0))),()=>{clearTimeout(v),p.forEach(b=>b()),m.forEach(b=>b())}}function lk(e,t){let{defer:r}=t,n=r?ze:i=>i(),a=[];return a.push(n(()=>{let i=typeof e=="function"?e():e;a.push(sk(i,t))})),()=>{a.forEach(i=>i?.())}}function lp(e,t,r){let n=e.ownerDocument.defaultView||window,a=new n.CustomEvent(t,r);return e.dispatchEvent(a)}function ck(e,t){let r=n=>{n.key==="Escape"&&(n.isComposing||t?.(n))};return He(pr(e),"keydown",r,{capture:!0})}var kt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){let t=this.indexOf(e),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<r},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(r=>Or(r.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Or(t,e))},add(e){let t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>r.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}},cp;function up(){kt.layers.forEach(({node:e})=>{e.style.pointerEvents=kt.isBelowPointerBlockingLayer(e)?"none":"auto"})}function uk(e){e.style.pointerEvents=""}function dk(e,t){let r=pr(e),n=[];if(kt.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(cp=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","")})),t){let a=y1(t,i=>{n.push(rs(i,{pointerEvents:"auto"}))});n.push(a)}return()=>{kt.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=cp,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style")}),n.forEach(a=>a()))}}function pk(e,t){let{warnOnMissingNode:r=!0}=t;if(r&&!e){ts("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;let{onDismiss:n,pointerBlocking:a,exclude:i,debug:o}=t,s={dismiss:n,node:e,pointerBlocking:a};kt.add(s),up();function l(h){let y=St(h.detail.originalEvent);kt.isBelowPointerBlockingLayer(e)||kt.isInBranch(y)||(t.onPointerDownOutside?.(h),t.onInteractOutside?.(h),!h.defaultPrevented&&(o&&console.log("onPointerDownOutside:",h.detail.originalEvent),n?.()))}function c(h){let y=St(h.detail.originalEvent);kt.isInBranch(y)||(t.onFocusOutside?.(h),t.onInteractOutside?.(h),!h.defaultPrevented&&(o&&console.log("onFocusOutside:",h.detail.originalEvent),n?.()))}function u(h){kt.isTopMost(e)&&(t.onEscapeKeyDown?.(h),!h.defaultPrevented&&n&&(h.preventDefault(),n()))}function d(h){if(!e)return!1;let y=typeof i=="function"?i():i,m=Array.isArray(y)?y:[y],v=t.persistentElements?.map(w=>w()).filter(ct);return v&&m.push(...v),m.some(w=>Or(w,h))||kt.isInNestedLayer(e,h)}let p=[a?dk(e,t.persistentElements):void 0,ck(e,u),lk(e,{exclude:d,onFocusOutside:c,onPointerDownOutside:l,defer:t.defer})];return()=>{kt.remove(e),up(),uk(e),p.forEach(h=>h?.())}}function Rm(e,t){let{defer:r}=t,n=r?ze:i=>i(),a=[];return a.push(n(()=>{let i=er(e)?e():e;a.push(pk(i,t))})),()=>{a.forEach(i=>i?.())}}function hk(e,t={}){let{defer:r}=t,n=r?ze:i=>i(),a=[];return a.push(n(()=>{let i=er(e)?e():e;if(!i){ts("[@zag-js/dismissable] branch node is `null` or `undefined`");return}kt.addBranch(i),a.push(()=>{kt.removeBranch(i)})})),()=>{a.forEach(i=>i?.())}}var gk=Object.defineProperty,mk=(e,t,r)=>t in e?gk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ge=(e,t,r)=>mk(e,typeof t!="symbol"?t+"":t,r),dp={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause()}let r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t)},deactivateTrap(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},fk=[],bk=class{constructor(e,t){Ge(this,"trapStack"),Ge(this,"config"),Ge(this,"doc"),Ge(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ge(this,"listenerCleanups",[]),Ge(this,"handleFocus",n=>{let a=St(n),i=this.findContainerIndex(a,n)>=0;if(i||Ou(a))i&&(this.state.mostRecentlyFocusedNode=a);else{n.stopImmediatePropagation();let o,s=!0;if(this.state.mostRecentlyFocusedNode)if(Ma(this.state.mostRecentlyFocusedNode)>0){let l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[l];if(c.length>0){let u=c.findIndex(d=>d===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<c.length&&(o=c[u+1],s=!1):u-1>=0&&(o=c[u-1],s=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(c=>Ma(c)>0))||(s=!1);else s=!1;s&&(o=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),o?this.tryFocus(o):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ge(this,"handlePointerDown",n=>{let a=St(n);if(!(this.findContainerIndex(a,n)>=0)){if($a(this.config.clickOutsideDeactivates,n)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}$a(this.config.allowOutsideClick,n)||n.preventDefault()}}),Ge(this,"handleClick",n=>{let a=St(n);this.findContainerIndex(a,n)>=0||$a(this.config.clickOutsideDeactivates,n)||$a(this.config.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())}),Ge(this,"handleTabKey",n=>{if(this.config.isKeyForward(n)||this.config.isKeyBackward(n)){this.state.recentNavEvent=n;let a=this.config.isKeyBackward(n),i=this.findNextNavNode({event:n,isBackward:a});if(!i)return;Fa(n)&&n.preventDefault(),this.tryFocus(i)}}),Ge(this,"handleEscapeKey",n=>{yk(n)&&$a(this.config.escapeDeactivates,n)!==!1&&(n.preventDefault(),this.deactivate())}),Ge(this,"_mutationObserver"),Ge(this,"setupMutationObserver",()=>{let n=this.doc.defaultView||window;this._mutationObserver=new n.MutationObserver(a=>{a.some(i=>Array.from(i.removedNodes).some(o=>o===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),Ge(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(n=>{this._mutationObserver?.observe(n,{subtree:!0,childList:!0})})}),Ge(this,"getInitialFocusNode",()=>{let n=this.getNodeForOption("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!Sr(n))if(this.findContainerIndex(this.doc.activeElement)>=0)n=this.doc.activeElement;else{let a=this.state.tabbableGroups[0];n=a&&a.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else n===null&&(n=this.getNodeForOption("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n.isConnected||(n=this.getNodeForOption("fallbackFocus")),n}),Ge(this,"tryFocus",n=>{if(n!==!1&&n!==cm(this.doc)){if(!n||!n.focus){this.tryFocus(this.getInitialFocusNode());return}n.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=n,vk(n)&&n.select()}}),Ge(this,"deactivate",n=>{if(!this.state.active)return this;let a={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...n};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),dp.deactivateTrap(this.trapStack,this);let i=this.getOption(a,"onDeactivate"),o=this.getOption(a,"onPostDeactivate"),s=this.getOption(a,"checkCanReturnFocus"),l=this.getOption(a,"returnFocus","returnFocusOnDeactivate");i?.();let c=()=>{pp(()=>{if(l){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}o?.()})};if(l&&s){let u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return s(u).then(c,c),this}return c(),this}),Ge(this,"pause",n=>{if(this.state.paused||!this.state.active)return this;let a=this.getOption(n,"onPause"),i=this.getOption(n,"onPostPause");return this.state.paused=!0,a?.(),this.removeListeners(),this.updateObservedNodes(),i?.(),this}),Ge(this,"unpause",n=>{if(!this.state.paused||!this.state.active)return this;let a=this.getOption(n,"onUnpause"),i=this.getOption(n,"onPostUnpause");return this.state.paused=!1,a?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i?.(),this}),Ge(this,"updateContainerElements",n=>(this.state.containers=Array.isArray(n)?n.filter(Boolean):[n].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ge(this,"getReturnFocusNode",n=>{let a=this.getNodeForOption("setReturnFocus",{params:[n]});return a||(a===!1?!1:n)}),Ge(this,"getOption",(n,a,i)=>n&&n[a]!==void 0?n[a]:this.config[i||a]),Ge(this,"getNodeForOption",(n,{hasFallback:a=!1,params:i=[]}={})=>{let o=this.config[n];if(typeof o=="function"&&(o=o(...i)),o===!0&&(o=void 0),!o){if(o===void 0||o===!1)return o;throw new Error(`\`${n}\` was specified but was not a node, or did not return a node`)}let s=o;if(typeof o=="string"){try{s=this.doc.querySelector(o)}catch(l){throw new Error(`\`${n}\` appears to be an invalid selector; error="${l.message}"`)}if(!s&&!a)throw new Error(`\`${n}\` as selector refers to no known node`)}return s}),Ge(this,"findNextNavNode",n=>{let{event:a,isBackward:i=!1}=n,o=n.target||St(a);this.updateTabbableNodes();let s=null;if(this.state.tabbableGroups.length>0){let l=this.findContainerIndex(o,a),c=l>=0?this.state.containerGroups[l]:void 0;if(l<0)i?s=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:s=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:d})=>o===d);if(u<0&&(c?.container===o||Sr(o)&&!Gr(o)&&!c?.nextTabbableNode(o,!1))&&(u=l),u>=0){let d=u===0?this.state.tabbableGroups.length-1:u-1,p=this.state.tabbableGroups[d];s=Ma(o)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else Fa(a)||(s=c?.nextTabbableNode(o,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:d})=>o===d);if(u<0&&(c?.container===o||Sr(o)&&!Gr(o)&&!c?.nextTabbableNode(o))&&(u=l),u>=0){let d=u===this.state.tabbableGroups.length-1?0:u+1,p=this.state.tabbableGroups[d];s=Ma(o)>=0?p.firstTabbableNode:p.firstDomTabbableNode}else Fa(a)||(s=c?.nextTabbableNode(o))}}else s=this.getNodeForOption("fallbackFocus");return s}),this.trapStack=t.trapStack||fk;let r={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(n){return Fa(n)&&!n.shiftKey},isKeyBackward(n){return Fa(n)&&n.shiftKey},...t};this.doc=r.document||pr(Array.isArray(e)?e[0]:e),this.config=r,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let r=typeof t?.composedPath=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:n,tabbableNodes:a})=>n.contains(e)||r?.includes(n)||a.find(i=>i===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=eo(e),r=mm(e),n=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,i=r.find(c=>Gr(c)),o=r.slice().reverse().find(c=>Gr(c)),s=!!t.find(c=>Ma(c)>0);function l(c,u=!0){let d=t.indexOf(c);return d<0?u?r.slice(r.indexOf(c)+1).find(p=>Gr(p)):r.slice(0,r.indexOf(c)).reverse().find(p=>Gr(p)):t[d+(u?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:r,posTabIndexesFound:s,firstTabbableNode:n,lastTabbableNode:a,firstDomTabbableNode:i,lastDomTabbableNode:o,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return dp.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?pp(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(He(this.doc,"focusin",this.handleFocus,!0),He(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),He(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),He(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),He(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),He(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;let t=this.getOption(e,"onActivate"),r=this.getOption(e,"onPostActivate"),n=this.getOption(e,"checkCanFocusTrap");n||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t?.();let a=()=>{n&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.()};return n?(n(this.state.containers.concat()).then(a,a),this):(a(),this)}},Fa=e=>e.key==="Tab",$a=(e,...t)=>typeof e=="function"?e(...t):e,yk=e=>!e.isComposing&&e.key==="Escape",pp=e=>setTimeout(e,0),vk=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function xk(e,t={}){let r,n=ze(()=>{let a=typeof e=="function"?e():e;if(a){r=new bk(a,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:a,...t,document:pr(a)});try{r.activate()}catch{}}});return function(){r?.deactivate(),n()}}var[Dm,no]=ut({hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),wk=e=>e.children(no()),kk=e=>{let t=no(),r=B(()=>t().getErrorTextProps(),e);return g(X,{get when(){return t().invalid},get children(){return g(K.span,r)}})},_k=e=>{let t=no(),r=B(()=>t().getHelperTextProps(),e);return g(K.span,r)},Tk=e=>{let t=no(),r=B(()=>t().getLegendProps(),e);return g(K.legend,r)},Sk=Bt("fieldset").parts("root","errorText","helperText","legend"),ko=Sk.build(),Ek=e=>{Dr();let t=De({disabled:!1,invalid:!1},sn(e)),r,n=t.id??qt(),a=`fieldset::${n}::error-text`,i=`fieldset::${n}::helper-text`,[o,s]=N(!1),[l,c]=N(!1);Ye(()=>{});let u=[];o()&&t.invalid&&u.push(a),l()&&u.push(i);let d=()=>({...ko.root.attrs,disabled:t.disabled,"data-disabled":be(t.disabled),"data-invalid":be(t.invalid),"aria-describedby":u.join(" ")||void 0}),p=()=>({...ko.legend.attrs,"data-disabled":be(t.disabled),"data-invalid":be(t.invalid)}),h=()=>({id:i,...ko.helperText.attrs}),y=()=>({id:a,...ko.errorText.attrs,"aria-live":"polite"});return he(()=>({refs:{rootRef:r},disabled:t.disabled,invalid:t.invalid,getRootProps:d,getLegendProps:p,getHelperTextProps:h,getErrorTextProps:y}))},Mm=e=>{let[t,r]=qe()(e,["id","disabled","invalid"]),n=Ek(t),a=B(()=>n().getRootProps(),r);return g(Dm,{value:n,get children(){return g(K.fieldset,a)}})};Mm.displayName="FieldsetRoot";var Ck=e=>{let[{value:t},r]=qe()(e,["value"]),n=B(()=>t().getRootProps(),r);return g(Dm,{value:t,get children(){return g(K.fieldset,n)}})},Pk={};ln(Pk,{Context:()=>wk,ErrorText:()=>kk,HelperText:()=>_k,Legend:()=>Tk,Root:()=>Mm,RootProvider:()=>Ck});var Ok=e=>{if(!e)return;let t=Sa(e),r=Yt(e),n=pr(e),a=()=>{requestAnimationFrame(()=>{e.style.height="auto";let c;t.boxSizing==="content-box"?c=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):c=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&c>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),c=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${c}px`})};e.addEventListener("input",a),e.form?.addEventListener("reset",a);let i=Object.getPrototypeOf(e),o=Object.getOwnPropertyDescriptor(i,"value");Object.defineProperty(e,"value",{...o,set(){o?.set?.apply(this,arguments),a()}});let s=new r.ResizeObserver(()=>{requestAnimationFrame(()=>a())});s.observe(e);let l=new r.MutationObserver(()=>a());return l.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),n.fonts?.addEventListener("loadingdone",a),()=>{e.removeEventListener("input",a),e.form?.removeEventListener("reset",a),n.fonts?.removeEventListener("loadingdone",a),s.disconnect(),l.disconnect()}},[Lm,gr]=ut({hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),Ik=e=>e.children(gr()),Nk=e=>{let t=gr(),r=B(()=>t().getErrorTextProps(),e);return g(X,{get when(){return t?.().invalid},get children(){return g(K.span,r)}})},Ak=e=>{let t=gr(),r=B(()=>t().getHelperTextProps(),e);return g(K.span,r)},Rk=e=>{let t=gr(),r=B(()=>t?.().getInputProps(),e);return g(K.input,r)},Dk=e=>{let t=gr(),r=B(()=>t?.().getLabelProps(),e);return g(K.label,r)},Mk=e=>{let t=gr(),r=B(()=>t().getRequiredIndicatorProps(),e);return g(X,{get when(){return t().required},get fallback(){return e.fallback},get children(){return g(K.span,De(r,{get children(){return e.children??"*"}}))}})},Lk=Bt("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator"),jr=Lk.build(),Fk=e=>{let t=no(),r=Dr(),n=De({disabled:!!t?.().disabled,required:!1,invalid:!1,readOnly:!1},e),[a,i]=N(!1),[o,s]=N(!1),l=n.id??qt(),[c,u]=N(void 0),d=n.ids?.control??`field::${l}`,p=n.ids?.errorText??`field::${l}::error-text`,h=n.ids?.helperText??`field::${l}::helper-text`,y=n.ids?.label??`field::${l}::label`;$e(()=>{let I=c();if(!I)return;let L=()=>{let V=r().getRootNode();i(!!V.getElementById(p)),s(!!V.getElementById(h))};L();let R=r().getWindow(),D=new R.MutationObserver(L);D.observe(I,{childList:!0,subtree:!0}),Ie(()=>D.disconnect())});let m=()=>({...jr.root.attrs,id:d,role:"group","data-disabled":be(n.disabled),"data-invalid":be(n.invalid),"data-readonly":be(n.readOnly)}),v=()=>({...jr.label.attrs,id:y,"data-disabled":be(n.disabled),"data-invalid":be(n.invalid),"data-readonly":be(n.readOnly),htmlFor:l}),w=he(()=>{let I=[];return a()&&n.invalid&&I.push(p),o()&&I.push(h),I}),b=()=>({"aria-describedby":w().join(" ")||void 0,"aria-invalid":bi(n.invalid),"data-invalid":be(n.invalid),"data-required":be(n.required),"data-readonly":be(n.readOnly),id:l,required:n.required,disabled:n.disabled,readOnly:n.readOnly||void 0}),x=()=>({...b(),...jr.input.attrs}),f=()=>({...b(),...jr.textarea.attrs}),k=()=>({...b(),...jr.select.attrs}),_=()=>({id:h,...jr.helperText.attrs,"data-disabled":be(n.disabled)}),C=()=>({id:p,...jr.errorText.attrs,"aria-live":"polite"}),P=()=>({"aria-hidden":!0,...jr.requiredIndicator.attrs});return he(()=>({ariaDescribedby:w().join(" "),ids:{control:l,label:y,errorText:p,helperText:h},refs:{rootRef:u},disabled:n.disabled,invalid:n.invalid,readOnly:n.readOnly,required:n.required,getLabelProps:v,getRootProps:m,getInputProps:x,getTextareaProps:f,getSelectProps:k,getHelperTextProps:_,getErrorTextProps:C,getRequiredIndicatorProps:P}))},$k=e=>{let[t,r]=qe()(e,["id","ids","disabled","invalid","readOnly","required"]),n=Fk(t),a=B(()=>n().getRootProps(),r);return g(Lm,{value:n,get children(){return g(K.div,De(a,{ref(i){var o=Ji(n().refs.rootRef,e.ref);typeof o=="function"&&o(i)}}))}})},Uk=e=>{let[{value:t},r]=qe()(e,["value"]),n=B(()=>t().getRootProps(),r);return g(Lm,{value:t,get children(){return g(K.div,n)}})},jk=e=>{let t=gr(),r=B(()=>t?.().getSelectProps(),e);return g(K.select,r)},Bk=e=>{let t=gr(),r,[n,a]=Rt(e,["autoresize"]),i=B(()=>t?.().getTextareaProps(),()=>({style:{resize:n.autoresize?"none":void 0}}),a);return $e(()=>{if(!n.autoresize)return;let o=Ok(r);Ie(()=>o?.())}),g(K.textarea,De(i,{ref(o){var s=Ji(l=>r=l,e.ref);typeof s=="function"&&s(o)}}))},zk={};ln(zk,{Context:()=>Ik,ErrorText:()=>Nk,HelperText:()=>Ak,Input:()=>Rk,Label:()=>Dk,RequiredIndicator:()=>Mk,Root:()=>$k,RootProvider:()=>Uk,Select:()=>jk,Textarea:()=>Bk});function Vk(){return{and:(...e)=>function(t){return e.every(r=>t.guard(r))},or:(...e)=>function(t){return e.some(r=>t.guard(r))},not:e=>function(t){return!t.guard(e)}}}var Hk=Bt("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),na=Hk.build(),Zk=e=>`toast-group:${e}`,hp=(e,t)=>e.getById(`toast-group:${t}`),Fm=e=>`toast:${e.id}`,gp=e=>e.getById(Fm(e)),mp=e=>`toast:${e.id}:title`,fp=e=>`toast:${e.id}:description`,Gk=e=>`toast${e.id}:close`,bp={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Ol(e,t){return e??bp[t]??bp.DEFAULT}var Wk=e=>typeof e=="string"?{left:e,right:e,bottom:e,top:e}:e;function qk(e,t){let{prop:r,computed:n,context:a}=e,{offsets:i,gap:o}=r("store").attrs,s=a.get("heights"),l=Wk(i),c=r("dir")==="rtl",u=t.replace("-start",c?"-right":"-left").replace("-end",c?"-left":"-right"),d=u.includes("right"),p=u.includes("left"),h={position:"fixed",pointerEvents:n("count")>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${o}px`,"--first-height":`${s[0]?.height||0}px`,zIndex:sm},y="center";if(d&&(y="flex-end"),p&&(y="flex-start"),h.alignItems=y,u.includes("top")){let m=l.top;h.top=`max(env(safe-area-inset-top, 0px), ${m})`}if(u.includes("bottom")){let m=l.bottom;h.bottom=`max(env(safe-area-inset-bottom, 0px), ${m})`}if(!u.includes("left")){let m=l.right;h.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${m})`}if(!u.includes("right")){let m=l.left;h.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${m})`}return h}function Kk(e,t){let{prop:r,context:n,computed:a}=e,i=r("parent"),o=i.computed("placement"),{gap:s}=i.prop("store").attrs,[l]=o.split("-"),c=n.get("mounted"),u=n.get("remainingTime"),d=a("height"),p=a("frontmost"),h=!p,y=!r("stacked"),m=r("stacked"),v=r("type")==="loading"?Number.MAX_SAFE_INTEGER:u,w=a("heightIndex")*s+a("heightBefore"),b={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${r("removeDelay")}ms`,"--duration":`${v}ms`,"--initial-height":`${d}px`,"--offset":`${w}px`,"--index":r("index"),"--z-index":a("zIndex"),"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},x=f=>Object.assign(b,f);return l==="top"?x({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):l==="bottom"&&x({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),c&&(x({"--y":"0","--opacity":"1"}),m&&x({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||x({"--opacity":"0",pointerEvents:"none"}),h&&y&&(x({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||x({"--y":"calc(var(--sign) * 40%)"})),h&&m&&!t&&x({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),p&&!t&&x({"--y":"calc(var(--lift) * -100%)"}),b}function Yk(e,t){let{computed:r}=e,n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},a=i=>Object.assign(n,i);return r("frontmost")&&!t&&a({height:"calc(var(--initial-height) + 80%)"}),n}function Xk(){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function Jk(e,t){let{context:r,prop:n,send:a,refs:i,computed:o}=e;return{getCount(){return r.get("toasts").length},getToasts(){return r.get("toasts")},getGroupProps(s={}){let{label:l="Notifications"}=s,{hotkey:c}=n("store").attrs,u=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=o("placement"),[p,h="center"]=d.split("-");return t.element({...na.group.attrs,dir:n("dir"),tabIndex:-1,"aria-label":`${d} ${l} ${u}`,id:Zk(d),"data-placement":d,"data-side":p,"data-align":h,"aria-live":"polite",role:"region",style:qk(e,d),onMouseMove(){a({type:"REGION.POINTER_ENTER",placement:d})},onMouseLeave(){a({type:"REGION.POINTER_LEAVE",placement:d})},onFocus(y){a({type:"REGION.FOCUS",target:y.relatedTarget})},onBlur(y){i.get("isFocusWithin")&&!Or(y.currentTarget,y.relatedTarget)&&queueMicrotask(()=>a({type:"REGION.BLUR"}))}})},subscribe(s){return n("store").subscribe(()=>s(r.get("toasts")))}}}var Qk={props({props:e}){return{dir:"ltr",id:nm(),...e,store:e.store}},initialState({prop:e}){return e("store").attrs.overlap?"overlap":"stack"},refs(){return{lastFocusedEl:null,isFocusWithin:!1,dismissableCleanup:void 0}},context({bindable:e}){return{toasts:e(()=>({defaultValue:[],sync:!0,hash:t=>t.map(r=>r.id).join(",")})),heights:e(()=>({defaultValue:[],sync:!0}))}},computed:{count:({context:e})=>e.get("toasts").length,overlap:({prop:e})=>e("store").attrs.overlap,placement:({prop:e})=>e("store").attrs.placement},effects:["subscribeToStore","trackDocumentVisibility","trackHotKeyPress"],watch({track:e,context:t,action:r}){e([()=>t.hash("toasts")],()=>{queueMicrotask(()=>{r(["collapsedIfEmpty","setDismissableBranch"])})})},exit:["clearDismissableBranch","clearLastFocusedEl"],on:{"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["collapseToasts","resumeToasts","restoreLastFocusedEl"]},{target:"stack",actions:["resumeToasts","restoreLastFocusedEl"]}],"TOAST.REMOVE":{actions:["removeToast","removeHeight"]},"TOAST.PAUSE":{actions:["pauseToasts"]}},states:{stack:{on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","collapseToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap",actions:["collapseToasts"]},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{on:{"REGION.STACK":{target:"stack",actions:["expandToasts"]},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts","expandToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts","expandToasts"]}}}},implementations:{guards:{isOverlapping:({computed:e})=>e("overlap")},effects:{subscribeToStore({context:e,prop:t}){return t("store").subscribe(r=>{if(r.dismiss){e.set("toasts",n=>n.filter(a=>a.id!==r.id));return}e.set("toasts",n=>{let a=n.findIndex(i=>i.id===r.id);return a!==-1?[...n.slice(0,a),{...n[a],...r},...n.slice(a+1)]:[r,...n]})})},trackHotKeyPress({prop:e,send:t}){return He(document,"keydown",r=>{let{hotkey:n}=e("store").attrs;n.every(a=>r[a]||r.code===a)&&t({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility({prop:e,send:t,scope:r}){let{pauseOnPageIdle:n}=e("store").attrs;if(!n)return;let a=r.getDoc();return He(a,"visibilitychange",()=>{let i=a.visibilityState==="hidden";t({type:i?"PAUSE_ALL":"RESUME_ALL"})})}},actions:{setDismissableBranch({refs:e,context:t,computed:r,scope:n}){let a=t.get("toasts"),i=r("placement"),o=a.length>0;if(!o){e.get("dismissableCleanup")?.();return}if(o&&e.get("dismissableCleanup"))return;let s=hk(()=>hp(n,i),{defer:!0});e.set("dismissableCleanup",s)},clearDismissableBranch({refs:e}){e.get("dismissableCleanup")?.()},focusRegionEl({scope:e,computed:t}){queueMicrotask(()=>{hp(e,t("placement"))?.focus()})},pauseToasts({prop:e}){e("store").pause()},resumeToasts({prop:e}){e("store").resume()},expandToasts({prop:e}){e("store").expand()},collapseToasts({prop:e}){e("store").collapse()},removeToast({prop:e,event:t}){e("store").remove(t.id)},removeHeight({event:e,context:t}){e?.id!=null&&queueMicrotask(()=>{t.set("heights",r=>r.filter(n=>n.id!==e.id))})},collapsedIfEmpty({send:e,computed:t}){!t("overlap")||t("count")>1||e({type:"REGION.OVERLAP"})},setLastFocusedEl({refs:e,event:t}){e.get("isFocusWithin")||!t.target||(e.set("isFocusWithin",!0),e.set("lastFocusedEl",t.target))},restoreLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))},clearLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))}}}};function e2(e,t){let{state:r,send:n,prop:a,scope:i,context:o,computed:s}=e,l=r.hasTag("visible"),c=r.hasTag("paused"),u=o.get("mounted"),d=s("frontmost"),p=a("parent").computed("placement"),h=a("type"),y=a("stacked"),m=a("title"),v=a("description"),w=a("action"),[b,x="center"]=p.split("-");return{type:h,title:m,description:v,placement:p,visible:l,paused:c,closable:!!a("closable"),pause(){n({type:"PAUSE"})},resume(){n({type:"RESUME"})},dismiss(){n({type:"DISMISS",src:"programmatic"})},getRootProps(){return t.element({...na.root.attrs,dir:a("dir"),id:Fm(i),"data-state":l?"open":"closed","data-type":h,"data-placement":p,"data-align":x,"data-side":b,"data-mounted":be(u),"data-paused":be(c),"data-first":be(d),"data-sibling":be(!d),"data-stack":be(y),"data-overlap":be(!y),role:"status","aria-atomic":"true","aria-describedby":v?fp(i):void 0,"aria-labelledby":m?mp(i):void 0,tabIndex:0,style:Kk(e,l),onKeyDown(f){f.defaultPrevented||f.key=="Escape"&&(n({type:"DISMISS",src:"keyboard"}),f.preventDefault())}})},getGhostBeforeProps(){return t.element({"data-ghost":"before",style:Yk(e,l)})},getGhostAfterProps(){return t.element({"data-ghost":"after",style:Xk()})},getTitleProps(){return t.element({...na.title.attrs,id:mp(i)})},getDescriptionProps(){return t.element({...na.description.attrs,id:fp(i)})},getActionTriggerProps(){return t.button({...na.actionTrigger.attrs,type:"button",onClick(f){f.defaultPrevented||(w?.onClick?.(),n({type:"DISMISS",src:"user"}))}})},getCloseTriggerProps(){return t.button({id:Gk(i),...na.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(f){f.defaultPrevented||n({type:"DISMISS",src:"user"})}})}}}var{not:t2}=Vk(),r2={props({props:e}){return im(e,["id","type","parent","removeDelay"],"toast"),{closable:!0,...e,duration:Ol(e.duration,e.type)}},initialState({prop:e}){return e("type")==="loading"||e("duration")===1/0?"visible:persist":"visible"},context({prop:e,bindable:t}){return{remainingTime:t(()=>({defaultValue:Ol(e("duration"),e("type"))})),createdAt:t(()=>({defaultValue:Date.now()})),mounted:t(()=>({defaultValue:!1})),initialHeight:t(()=>({defaultValue:0}))}},refs(){return{closeTimerStartTime:Date.now(),lastCloseStartTimerStartTime:0}},computed:{zIndex:({prop:e})=>{let t=e("parent").context.get("toasts"),r=t.findIndex(n=>n.id===e("id"));return t.length-r},height:({prop:e})=>e("parent").context.get("heights").find(t=>t.id===e("id"))?.height??0,heightIndex:({prop:e})=>e("parent").context.get("heights").findIndex(t=>t.id===e("id")),frontmost:({prop:e})=>e("index")===0,heightBefore:({prop:e})=>{let t=e("parent").context.get("heights"),r=t.findIndex(n=>n.id===e("id"));return t.reduce((n,a,i)=>i>=r?n:n+a.height,0)},shouldPersist:({prop:e})=>e("type")==="loading"||e("duration")===1/0},watch({track:e,prop:t,send:r}){e([()=>t("message")],()=>{let n=t("message");n&&r({type:n,src:"programmatic"})}),e([()=>t("type"),()=>t("duration")],()=>{r({type:"UPDATE"})})},on:{UPDATE:[{guard:"shouldPersist",target:"visible:persist",actions:["resetCloseTimer"]},{target:"visible:updating",actions:["resetCloseTimer"]}],MEASURE:{actions:["measureHeight"]}},entry:["setMounted","measureHeight","invokeOnVisible"],effects:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],effects:["waitForNextTick"],on:{SHOW:{target:"visible"}}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:t2("isLoadingType"),target:"visible",actions:["setCloseTimer"]},DISMISS:{target:"dismissing"}}},visible:{tags:["visible"],effects:["waitForDuration"],on:{DISMISS:{target:"dismissing"},PAUSE:{target:"visible:persist",actions:["syncRemainingTime"]}}},dismissing:{entry:["invokeOnDismiss"],effects:["waitForRemoveDelay"],on:{REMOVE:{target:"unmounted",actions:["notifyParentToRemove"]}}},unmounted:{entry:["invokeOnUnmount"]}},implementations:{effects:{waitForRemoveDelay({prop:e,send:t}){return xl(()=>{t({type:"REMOVE",src:"timer"})},e("removeDelay"))},waitForDuration({send:e,context:t,computed:r}){if(!r("shouldPersist"))return xl(()=>{e({type:"DISMISS",src:"timer"})},t.get("remainingTime"))},waitForNextTick({send:e}){return xl(()=>{e({type:"SHOW",src:"timer"})},0)},trackHeight({scope:e,prop:t}){let r;return ze(()=>{let n=gp(e);if(!n)return;let a=()=>{let s=n.style.height;n.style.height="auto";let l=n.getBoundingClientRect().height;n.style.height=s;let c={id:t("id"),height:l};yp(t("parent"),c)},i=e.getWin(),o=new i.MutationObserver(a);o.observe(n,{childList:!0,subtree:!0,characterData:!0}),r=()=>o.disconnect()}),()=>r?.()}},guards:{isLoadingType:({prop:e})=>e("type")==="loading",shouldPersist:({computed:e})=>e("shouldPersist")},actions:{setMounted({context:e}){ze(()=>{e.set("mounted",!0)})},measureHeight({scope:e,prop:t,context:r}){queueMicrotask(()=>{let n=gp(e);if(!n)return;let a=n.style.height;n.style.height="auto";let i=n.getBoundingClientRect().height;n.style.height=a,r.set("initialHeight",i);let o={id:t("id"),height:i};yp(t("parent"),o)})},setCloseTimer({refs:e}){e.set("closeTimerStartTime",Date.now())},resetCloseTimer({context:e,refs:t,prop:r}){t.set("closeTimerStartTime",Date.now()),e.set("remainingTime",Ol(r("duration"),r("type")))},syncRemainingTime({context:e,refs:t}){e.set("remainingTime",r=>{let n=t.get("closeTimerStartTime"),a=Date.now()-n;return t.set("lastCloseStartTimerStartTime",Date.now()),r-a})},notifyParentToRemove({prop:e}){e("parent").send({type:"TOAST.REMOVE",id:e("id")})},invokeOnDismiss({prop:e,event:t}){e("onStatusChange")?.({status:"dismissing",src:t.src})},invokeOnUnmount({prop:e}){e("onStatusChange")?.({status:"unmounted"})},invokeOnVisible({prop:e}){e("onStatusChange")?.({status:"visible"})}}}};function yp(e,t){let{id:r,height:n}=t;e.context.set("heights",a=>a.find(i=>i.id===r)?a.map(i=>i.id===r?{...i,height:n}:i):[{id:r,height:n},...a])}var n2=(e,t)=>({...t,...Zs(e)});function a2(e){let t=n2(e,{placement:"bottom",overlap:!1,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:!0}),r=[],n=[],a=new Set,i=[],o=p=>(r.push(p),()=>{let h=r.indexOf(p);r.splice(h,1)}),s=p=>(r.forEach(h=>h(p)),p),l=p=>{if(n.length>=t.max){i.push(p);return}s(p),n.unshift(p)},c=()=>{for(;i.length>0&&n.length<t.max;){let p=i.shift();p&&(s(p),n.unshift(p))}},u=p=>{let h=p.id??`toast:${nm()}`,y=n.find(m=>m.id===h);return a.has(h)&&a.delete(h),y?n=n.map(m=>m.id===h?s({...m,...p,id:h}):m):l({id:h,duration:t.duration,removeDelay:t.removeDelay,type:"info",...p,stacked:!t.overlap,gap:t.gap}),h},d=p=>(a.add(p),p?(r.forEach(h=>h({id:p,dismiss:!0})),n=n.filter(h=>h.id!==p),c()):(n.forEach(h=>{r.forEach(y=>y({id:h.id,dismiss:!0}))}),n=[],i=[]),p);return{attrs:t,subscribe:o,create:u,update:(p,h)=>u({id:p,...h}),remove:d,dismiss:p=>{p!=null?n=n.map(h=>h.id===p?s({...h,message:"DISMISS"}):h):n=n.map(h=>s({...h,message:"DISMISS"}))},error:p=>u({...p,type:"error"}),success:p=>u({...p,type:"success"}),info:p=>u({...p,type:"info"}),warning:p=>u({...p,type:"warning"}),loading:p=>u({...p,type:"loading"}),getVisibleToasts:()=>n.filter(p=>!a.has(p.id)),getCount:()=>n.length,promise:(p,h,y={})=>{if(!h)return;let m;h.loading!==void 0&&(m=u({...y,...h.loading,promise:p,type:"loading"}));let v=m!==void 0,w,b=qa(p).then(async x=>{if(w=["resolve",x],i2(x)&&!x.ok){v=!1;let f=qa(h.error,`HTTP Error! status: ${x.status}`);u({...y,...f,id:m,type:"error"})}else if(h.success!==void 0){v=!1;let f=qa(h.success,x);u({...y,...f,id:m,type:"success"})}}).catch(async x=>{if(w=["reject",x],h.error!==void 0){v=!1;let f=qa(h.error,x);u({...y,...f,id:m,type:"error"})}}).finally(()=>{v&&(d(m),m=void 0),h.finally?.()});return{id:m,unwrap:()=>new Promise((x,f)=>b.then(()=>w[0]==="reject"?f(w[1]):x(w[1])).catch(f))}},pause:p=>{p!=null?n=n.map(h=>h.id===p?s({...h,message:"PAUSE"}):h):n=n.map(h=>s({...h,message:"PAUSE"}))},resume:p=>{p!=null?n=n.map(h=>h.id===p?s({...h,message:"RESUME"}):h):n=n.map(h=>s({...h,message:"RESUME"}))},isVisible:p=>!a.has(p)&&!!n.find(h=>h.id===p),isDismissed:p=>a.has(p),expand:()=>{n=n.map(p=>s({...p,stacked:!0}))},collapse:()=>{n=n.map(p=>s({...p,stacked:!1}))}}}var i2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",vp={connect:Jk,machine:Qk},o2=e=>a2(e),[s2,Ia]=ut({hookName:"useToastContext",providerName:"<ToastProvider />"}),l2=e=>{let t=Ia(),r=B(()=>t().getActionTriggerProps(),e);return g(K.button,r)},c2=e=>{let t=Ia(),r=B(()=>t().getCloseTriggerProps(),e);return g(K.button,r)},u2=e=>e.children(Ia()),d2=e=>{let t=Ia(),r=B(()=>t().getDescriptionProps(),e);return g(K.div,r)},p2=E("<div><div></div><div>"),h2=e=>{let t=Ia(),r=B(()=>t().getRootProps(),e);return(()=>{var n=p2(),a=n.firstChild,i=a.nextSibling;return Ke(n,r,!1,!0),Ke(a,De(()=>t().getGhostBeforeProps()),!1,!1),T(n,()=>e.children,i),Ke(i,De(()=>t().getGhostAfterProps()),!1,!1),n})()},g2=e=>{let t=Ia(),r=B(()=>t().getTitleProps(),e);return g(K.div,r)},m2=e=>{let[t,r]=Rt(e,["toaster","children"]),n=Ca(),a=Dr(),i=an(vp.machine,()=>({store:t.toaster,id:qt(),dir:n()?.dir,getRootNode:a()?.getRootNode})),o=he(()=>vp.connect(i,on)),s=he(()=>o().getToasts()),l=B(()=>o().getGroupProps(),r);return g(K.div,De(l,{get children(){return g(N0,{get each(){return s()},by:"id",children:(c,u)=>g(f2,{value:c,index:u,parent:i,children:d=>t.children(d)})})}}))},f2=e=>{let t=Dr(),r=he(()=>({...e.value(),parent:e.parent,index:e.index(),getRootNode:t().getRootNode})),n=an(r2,r),a=he(()=>e2(n,on));return g(s2,{value:a,get children(){return e.children(e.value)}})},Ka={};ln(Ka,{ActionTrigger:()=>l2,CloseTrigger:()=>c2,Context:()=>u2,Description:()=>d2,Root:()=>h2,Title:()=>g2});var b2=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),y2=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,xp=e=>{let t={},r;for(;r=y2.exec(e);)t[r[1]]=r[2];return t},v2=(e,t)=>{if(Tr(e)){if(Tr(t))return`${e};${t}`;e=xp(e)}else Tr(t)&&(t=xp(t));return Object.assign({},e??{},t??{})};function x2(...e){let t={};for(let r of e){for(let n in t){if(n.startsWith("on")&&typeof t[n]=="function"&&typeof r[n]=="function"){t[n]=fi(r[n],t[n]);continue}if(n==="className"||n==="class"){t[n]=b2(t[n],r[n]);continue}if(n==="style"){t[n]=v2(t[n],r[n]);continue}t[n]=r[n]!==void 0?r[n]:t[n]}for(let n in r)t[n]===void 0&&(t[n]=r[n])}return t}function w2(){return{and:(...e)=>function(t){return e.every(r=>t.guard(r))},or:(...e)=>function(t){return e.some(r=>t.guard(r))},not:e=>function(t){return!t.guard(e)}}}var Ya=(e,t)=>({x:e,y:t});function k2(e){let{x:t,y:r,width:n,height:a}=e,i=t+n/2,o=r+a/2;return{x:t,y:r,width:n,height:a,minX:t,minY:r,maxX:t+n,maxY:r+a,midX:i,midY:o,center:Ya(i,o)}}function _2(e){let t=Ya(e.minX,e.minY),r=Ya(e.maxX,e.minY),n=Ya(e.maxX,e.maxY),a=Ya(e.minX,e.maxY);return{top:t,right:r,bottom:n,left:a}}var{min:jN,max:BN}=Math;function T2(e,t){let r=k2(e),{top:n,right:a,left:i,bottom:o}=_2(r),[s]=t.split("-");return{top:[i,n,a,o],right:[n,a,o,i],bottom:[n,i,o,a],left:[a,n,i,o]}[s]}function S2(e,t){let{x:r,y:n}=t,a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i].x,l=e[i].y,c=e[o].x,u=e[o].y;l>n!=u>n&&r<(c-s)*(n-l)/(u-l)+s&&(a=!a)}return a}var{sign:zN,abs:VN,min:HN}=Math,E2=Bt("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),ht=E2.build(),ss=e=>e.ids?.trigger??`menu:${e.id}:trigger`,$m=e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,si=e=>e.ids?.content??`menu:${e.id}:content`,C2=e=>e.ids?.arrow??`menu:${e.id}:arrow`,Um=e=>e.ids?.positioner??`menu:${e.id}:popper`,P2=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,xi=(e,t)=>`${e.id}/${t}`,mn=e=>e?.dataset.value??null,wp=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,Vr=e=>e.getById(si(e)),kp=e=>e.getById(Um(e)),_o=e=>e.getById(ss(e)),jm=(e,t)=>t?e.getById(xi(e,t)):null,_p=e=>e.getById($m(e)),ao=e=>{let t=`[role^="menuitem"][data-ownedby=${CSS.escape(si(e))}]:not([data-disabled])`;return vm(Vr(e),t)},O2=e=>R0(ao(e)),I2=e=>D0(ao(e)),Vu=(e,t)=>t?e.id===t||e.dataset.value===t:!1,N2=(e,t)=>{let r=ao(e),n=r.findIndex(a=>Vu(a,t.value));return $0(r,n,{loop:t.loop??t.loopFocus})},A2=(e,t)=>{let r=ao(e),n=r.findIndex(a=>Vu(a,t.value));return U0(r,n,{loop:t.loop??t.loopFocus})},R2=(e,t)=>{let r=ao(e),n=r.find(a=>Vu(a,t.value));return xm(r,{state:t.typeaheadState,key:t.key,activeId:n?.id??null})},To=e=>ct(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),D2=e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),Ec="menu:select";function M2(e,t){if(!e)return;let r=Yt(e),n=new r.CustomEvent(Ec,{detail:{value:t}});e.dispatchEvent(n)}function L2(e,t){let{context:r,send:n,state:a,computed:i,prop:o,scope:s}=e,l=a.hasTag("open"),c=i("isSubmenu"),u=i("isTypingAhead"),d=o("composite"),p=r.get("currentPlacement"),h=r.get("anchorPoint"),y=r.get("highlightedValue"),m=tk({...o("positioning"),placement:h?"bottom":p});function v(f){return{id:xi(s,f.value),disabled:!!f.disabled,highlighted:y===f.value}}function w(f){let k=f.valueText??f.value;return{...f,id:f.value,valueText:k}}function b(f){return{...v(w(f)),checked:!!f.checked}}function x(f){let{closeOnSelect:k,valueText:_,value:C}=f,P=v(f),I=xi(s,C);return t.element({...ht.item.attrs,id:I,role:"menuitem","aria-disabled":bi(P.disabled),"data-disabled":be(P.disabled),"data-ownedby":si(s),"data-highlighted":be(P.highlighted),"data-value":C,"data-valuetext":_,onDragStart(L){L.currentTarget.matches("a[href]")&&L.preventDefault()},onPointerMove(L){if(P.disabled||L.pointerType!=="mouse")return;let R=L.currentTarget;P.highlighted||n({type:"ITEM_POINTERMOVE",id:I,target:R,closeOnSelect:k})},onPointerLeave(L){if(P.disabled||L.pointerType!=="mouse"||!e.event.previous()?.type.includes("POINTER"))return;let R=L.currentTarget;n({type:"ITEM_POINTERLEAVE",id:I,target:R,closeOnSelect:k})},onPointerDown(L){if(P.disabled)return;let R=L.currentTarget;n({type:"ITEM_POINTERDOWN",target:R,id:I,closeOnSelect:k})},onClick(L){if(zd(L)||Bd(L)||P.disabled)return;let R=L.currentTarget;n({type:"ITEM_CLICK",target:R,id:I,closeOnSelect:k})}})}return{highlightedValue:y,open:l,setOpen(f){a.hasTag("open")!==f&&n({type:f?"OPEN":"CLOSE"})},setHighlightedValue(f){n({type:"HIGHLIGHTED.SET",value:f})},setParent(f){n({type:"PARENT.SET",value:f,id:f.prop("id")})},setChild(f){n({type:"CHILD.SET",value:f,id:f.prop("id")})},reposition(f={}){n({type:"POSITIONING.SET",options:f})},addItemListener(f){let k=s.getById(f.id);if(!k)return;let _=()=>f.onSelect?.();return k.addEventListener(Ec,_),()=>k.removeEventListener(Ec,_)},getContextTriggerProps(){return t.element({...ht.contextTrigger.attrs,dir:o("dir"),id:$m(s),onPointerDown(f){if(f.pointerType==="mouse")return;let k=ua(f);n({type:"CONTEXT_MENU_START",point:k})},onPointerCancel(f){f.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(f){f.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(f){f.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(f){let k=ua(f);n({type:"CONTEXT_MENU",point:k}),f.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(f){let k=f.getTriggerProps();return x2(x({value:k.id}),k)},getTriggerProps(){return t.button({...c?ht.triggerItem.attrs:ht.trigger.attrs,"data-placement":r.get("currentPlacement"),type:"button",dir:o("dir"),id:ss(s),"data-uid":o("id"),"aria-haspopup":d?"menu":"dialog","aria-controls":si(s),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(f){if(f.pointerType!=="mouse"||To(f.currentTarget)||!c)return;let k=ua(f);n({type:"TRIGGER_POINTERMOVE",target:f.currentTarget,point:k})},onPointerLeave(f){if(To(f.currentTarget)||f.pointerType!=="mouse"||!c)return;let k=ua(f);n({type:"TRIGGER_POINTERLEAVE",target:f.currentTarget,point:k})},onPointerDown(f){To(f.currentTarget)||hm(f)||f.preventDefault()},onClick(f){f.defaultPrevented||To(f.currentTarget)||n({type:"TRIGGER_CLICK",target:f.currentTarget})},onBlur(){n({type:"TRIGGER_BLUR"})},onFocus(){n({type:"TRIGGER_FOCUS"})},onKeyDown(f){if(f.defaultPrevented)return;let k={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},Enter(){n({type:"ARROW_DOWN",src:"enter"})},Space(){n({type:"ARROW_DOWN",src:"space"})}},_=xc(f,{orientation:"vertical",dir:o("dir")}),C=k[_];C&&(f.preventDefault(),C(f))}})},getIndicatorProps(){return t.element({...ht.indicator.attrs,dir:o("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...ht.positioner.attrs,dir:o("dir"),id:Um(s),style:m.floating})},getArrowProps(){return t.element({id:C2(s),...ht.arrow.attrs,dir:o("dir"),style:m.arrow})},getArrowTipProps(){return t.element({...ht.arrowTip.attrs,dir:o("dir"),style:m.arrowTip})},getContentProps(){return t.element({...ht.content.attrs,id:si(s),"aria-label":o("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:d?"menu":"dialog",tabIndex:0,dir:o("dir"),"aria-activedescendant":i("highlightedId")||void 0,"aria-labelledby":ss(s),"data-placement":p,onPointerEnter(f){f.pointerType==="mouse"&&n({type:"MENU_POINTERENTER"})},onKeyDown(f){if(f.defaultPrevented||!pm(f))return;let k=St(f);if(!(k?.closest("[role=menu]")===f.currentTarget||k===f.currentTarget))return;if(f.key==="Tab"&&!Kx(f)){f.preventDefault();return}let _=jm(s,y),C={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},ArrowLeft(){n({type:"ARROW_LEFT"})},ArrowRight(){n({type:"ARROW_RIGHT"})},Enter(){n({type:"ENTER"}),y!=null&&fx(_)&&o("navigate")?.({value:y,node:_,href:_.href})},Space(L){u?n({type:"TYPEAHEAD",key:L.key}):C.Enter?.(L)},Home(){n({type:"HOME"})},End(){n({type:"END"})}},P=xc(f,{dir:o("dir")}),I=C[P];if(I){I(f),f.stopPropagation(),f.preventDefault();return}o("typeahead")&&Ix(f)&&(vc(f)||Iu(k)||(n({type:"TYPEAHEAD",key:f.key}),f.preventDefault()))}})},getSeparatorProps(){return t.element({...ht.separator.attrs,role:"separator",dir:o("dir"),"aria-orientation":"horizontal"})},getItemState:v,getItemProps:x,getOptionItemState:b,getOptionItemProps(f){let{type:k,disabled:_,onCheckedChange:C,closeOnSelect:P}=f,I=w(f),L=b(f);return{...x(I),...t.element({"data-type":k,...ht.item.attrs,dir:o("dir"),"data-value":I.value,role:`menuitem${k}`,"aria-checked":!!L.checked,"data-state":L.checked?"checked":"unchecked",onClick(R){if(_||zd(R)||Bd(R))return;let D=R.currentTarget;n({type:"ITEM_CLICK",target:D,option:I,closeOnSelect:P}),C?.(!L.checked)}})}},getItemIndicatorProps(f){let k=b(f);return t.element({...ht.itemIndicator.attrs,dir:o("dir"),"data-disabled":be(k.disabled),"data-highlighted":be(k.highlighted),"data-state":k.checked?"checked":"unchecked",hidden:!k.checked})},getItemTextProps(f){let k=b(f);return t.element({...ht.itemText.attrs,dir:o("dir"),"data-disabled":be(k.disabled),"data-highlighted":be(k.highlighted),"data-state":k.checked?"checked":"unchecked"})},getItemGroupLabelProps(f){return t.element({...ht.itemGroupLabel.attrs,id:wp(s,f.htmlFor),dir:o("dir")})},getItemGroupProps(f){return t.element({id:P2(s,f.id),...ht.itemGroup.attrs,dir:o("dir"),"aria-labelledby":wp(s,f.id),role:"group"})}}}var{not:It,and:Xn,or:F2}=w2(),$2={props({props:e}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(t){Jx(t.node)},...e,positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},context({bindable:e,prop:t}){return{suspendPointer:e(()=>({defaultValue:!1})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(r){t("onHighlightChange")?.({highlightedValue:r})}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(r){return`x: ${r?.x}, y: ${r?.y}`}}))}},refs(){return{parent:null,children:{},typeaheadState:{...xm.defaultOptions},positioningOverride:{}}},computed:{isSubmenu:({refs:e})=>e.get("parent")!=null,isRtl:({prop:e})=>e("dir")==="rtl",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar!=="",highlightedId:({context:e,scope:t,refs:r})=>j2(r.get("children"),e.get("highlightedValue"),t)},watch({track:e,action:t,context:r,computed:n,prop:a}){e([()=>n("isSubmenu")],()=>{t(["setSubmenuPlacement"])}),e([()=>r.hash("anchorPoint")],()=>{t(["reposition"])}),e([()=>a("open")],()=>{t(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:It("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:F2("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Xn(It("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:It("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Xn("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:It("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:Xn(It("isPointerSuspended"),It("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:Xn(It("isTriggerItemHighlighted"),It("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Xn(It("isTriggerItemHighlighted"),It("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Xn(It("isTriggerItemHighlighted"),It("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e("closeOnSelect")),isTriggerItem:({event:e})=>D2(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:r})=>!!(e.target??t.getById(r("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({computed:e})=>e("isSubmenu"),isPointerSuspended:({context:e})=>e.get("suspendPointer"),isHighlightedItemEditable:({scope:e,computed:t})=>Iu(e.getById(t("highlightedId"))),isOpenControlled:({prop:e})=>e("open")!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:e})=>e.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:e})=>e.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.OPEN"})},100);return()=>clearTimeout(t)},waitForCloseDelay({send:e}){let t=setTimeout(()=>{e({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(t)},waitForLongPress({send:e}){let t=setTimeout(()=>{e({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(t)},trackPositioning({context:e,prop:t,scope:r,refs:n}){if(_p(r))return;let a={...t("positioning"),...n.get("positioningOverride")};e.set("currentPlacement",a.placement);let i=()=>kp(r);return ap(_o(r),i,{...a,defer:!0,onComplete(o){e.set("currentPlacement",o.placement)}})},trackInteractOutside({refs:e,scope:t,prop:r,computed:n,send:a}){let i=()=>Vr(t),o=!0;return Rm(i,{defer:!0,exclude:[_o(t)],onInteractOutside:r("onInteractOutside"),onFocusOutside:r("onFocusOutside"),onEscapeKeyDown(s){r("onEscapeKeyDown")?.(s),n("isSubmenu")&&s.preventDefault(),Tp({parent:e.get("parent")})},onPointerDownOutside(s){let l=St(s.detail.originalEvent);if(Or(_p(t),l)&&s.detail.contextmenu){s.preventDefault();return}o=!s.detail.focusable,r("onPointerDownOutside")?.(s)},onDismiss(){a({type:"CLOSE",src:"interact-outside",restoreFocus:o})}})},trackPointerMove({context:e,scope:t,send:r,refs:n,flush:a}){let i=n.get("parent");a(()=>{i.context.set("suspendPointer",!0)});let o=t.getDoc();return He(o,"pointermove",s=>{U2(e.get("intentPolygon"),{x:s.clientX,y:s.clientY})||(r({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),i.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:e,scope:t,computed:r}){let n=()=>{if(e.type.startsWith("ITEM_POINTER"))return;let a=t.getById(r("highlightedId")),i=Vr(t);t1(a,{rootEl:i,block:"nearest"})};return ze(()=>n()),bm(()=>Vr(t),{defer:!0,attributes:["aria-activedescendant"],callback:n})}},actions:{setAnchorPoint({context:e,event:t}){e.set("anchorPoint",t.point)},setSubmenuPlacement({computed:e,refs:t}){if(!e("isSubmenu"))return;let r=e("isRtl")?"left-start":"right-start";t.set("positioningOverride",{placement:r,gutter:0})},reposition({context:e,scope:t,prop:r,event:n,refs:a}){let i=()=>kp(t),o=e.get("anchorPoint"),s=o?()=>({width:0,height:0,...o}):void 0,l={...r("positioning"),...a.get("positioningOverride")};ap(_o(t),i,{...l,defer:!0,getAnchorRect:s,...n.options??{},listeners:!1,onComplete(c){e.set("currentPlacement",c.placement)}})},setOptionState({event:e}){if(!e.option)return;let{checked:t,onCheckedChange:r,type:n}=e.option;n==="radio"?r?.(!0):n==="checkbox"&&r?.(!t)},clickHighlightedItem({scope:e,computed:t}){let r=e.getById(t("highlightedId"));!r||r.dataset.disabled||queueMicrotask(()=>r.click())},setIntentPolygon({context:e,scope:t,event:r}){let n=Vr(t),a=e.get("currentPlacement");if(!n||!a)return;let i=n.getBoundingClientRect(),o=T2(i,a);if(!o)return;let s=Hw(a)==="right"?-5:5;e.set("intentPolygon",[{...r.point,x:r.point.x+s},...o])},clearIntentPolygon({context:e}){e.set("intentPolygon",null)},resumePointer({refs:e,flush:t}){let r=e.get("parent");r&&t(()=>{r.context.set("suspendPointer",!1)})},setHighlightedItem({context:e,event:t}){let r=t.value||mn(t.target);e.set("highlightedValue",r)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},focusMenu({scope:e}){ze(()=>{let t=Vr(e);qx({root:t,enabled:!Or(t,e.getActiveElement()),filter(r){return!r.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:e,scope:t}){(Vr(t)?queueMicrotask:ze)(()=>{let r=O2(t);r&&e.set("highlightedValue",mn(r))})},highlightLastItem({context:e,scope:t}){(Vr(t)?queueMicrotask:ze)(()=>{let r=I2(t);r&&e.set("highlightedValue",mn(r))})},highlightNextItem({context:e,scope:t,event:r,prop:n}){let a=N2(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",mn(a))},highlightPrevItem({context:e,scope:t,event:r,prop:n}){let a=A2(t,{loop:r.loop,value:e.get("highlightedValue"),loopFocus:n("loopFocus")});e.set("highlightedValue",mn(a))},invokeOnSelect({context:e,prop:t,scope:r}){let n=e.get("highlightedValue");if(n==null)return;let a=jm(r,n);M2(a,n),t("onSelect")?.({value:n})},focusTrigger({scope:e,context:t,event:r,computed:n}){n("isSubmenu")||t.get("anchorPoint")||r.restoreFocus===!1||queueMicrotask(()=>_o(e)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:e,context:t,event:r,refs:n}){let a=R2(e,{key:r.key,value:t.get("highlightedValue"),typeaheadState:n.get("typeaheadState")});a&&t.set("highlightedValue",mn(a))},setParentMenu({refs:e,event:t}){e.set("parent",t.value)},setChildMenu({refs:e,event:t}){let r=e.get("children");r[t.id]=t.value,e.set("children",r)},closeRootMenu({refs:e}){Tp({parent:e.get("parent")})},openSubmenu({refs:e,scope:t,computed:r}){let n=t.getById(r("highlightedId"))?.getAttribute("data-uid"),a=e.get("children");(n?a[n]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:e}){e.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:e,event:t}){e.set("lastHighlightedValue",mn(t.target))},restoreHighlightedItem({context:e}){e.get("lastHighlightedValue")&&(e.set("highlightedValue",e.get("lastHighlightedValue")),e.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:e}){e.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},toggleVisibility({prop:e,event:t,send:r}){r({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}};function Tp(e){let t=e.parent;for(;t&&t.computed("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"})}function U2(e,t){return e?S2(e,t):!1}function j2(e,t,r){let n=Object.keys(e).length>0;if(!t)return null;if(!n)return xi(r,t);for(let a in e){let i=e[a],o=ss(i.scope);if(o===t)return o}return xi(r,t)}var B2=Lt()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),ZN=Kt(B2),z2=Lt()(["closeOnSelect","disabled","value","valueText"]),GN=Kt(z2),V2=Lt()(["htmlFor"]),WN=Kt(V2),H2=Lt()(["id"]),qN=Kt(H2),Z2=Lt()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]),KN=Kt(Z2),[Bm,et]=ut({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),G2=e=>{let t=et(),r=B(()=>t().getArrowProps(),e);return g(K.div,r)},W2=e=>{let t=et(),r=B(()=>t().getArrowTipProps(),e);return g(K.div,r)},[Hu,q2]=ut({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[zm,Vm]=ut({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),K2=e=>{let[t,r]=qe()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),n=B(t,{type:"checkbox"}),a=et(),i=B(()=>a().getOptionItemProps(n),r),o=he(()=>a().getItemState(n));return g(zm,{value:n,get children(){return g(Hu,{value:o,get children(){return g(K.div,i)}})}})},Y2=e=>{let t=et(),r=Ea(),n=B(()=>t().getContentProps(),()=>r().presenceProps,e);return g(X,{get when(){return!r().unmounted},get children(){return g(K.div,De(n,{ref(a){var i=Ji(r().ref,e.ref);typeof i=="function"&&i(a)}}))}})},X2=e=>e.children(et()),J2=e=>{let t=et(),r=B(()=>t().getContextTriggerProps(),e);return g(K.button,r)},Q2=e=>{let t=et(),r=B(()=>t().getIndicatorProps(),e);return g(K.div,r)},e_=e=>{let[t,r]=qe()(e,["closeOnSelect","disabled","value","valueText","onSelect"]),n=et(),a=B(()=>n().getItemProps(t),r),i=he(()=>n().getItemState(t));return Ye(()=>{let o=n().addItemListener({id:i().id,onSelect:t.onSelect});Ie(()=>o?.())}),g(Hu,{value:i,get children(){return g(K.div,a)}})},t_=e=>e.children(q2()),[Hm,Zm]=ut({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),r_=e=>{let[t,r]=qe()(e,["id"]),n=B({id:qt()},t),a=et(),i=B(()=>a().getItemGroupProps(n),r);return g(Hm,{value:n,get children(){return g(K.div,i)}})},n_=e=>{let t=et(),r=Zm(),n=B(t().getItemGroupLabelProps({htmlFor:r.id}),e);return g(K.div,n)},a_=e=>{let t=et(),r=Vm(),n=B(()=>t().getItemIndicatorProps(r),e);return g(K.div,n)},i_=e=>{let t=et(),r=Vm(),n=B(()=>t().getItemTextProps(r),e);return g(K.div,n)},o_=e=>{let t=et(),r=Ea(),n=B(()=>t().getPositionerProps(),e);return g(X,{get when(){return!r().unmounted},get children(){return g(K.div,n)}})},s_=e=>{let[t,r]=qe()(e,["closeOnSelect","disabled","value","valueText"]),n=et(),a=Zm(),i=B(t,()=>({type:"radio",checked:a.value===t.value,onCheckedChange:()=>a.onValueChange?.({value:t.value})})),o=B(()=>n().getOptionItemProps(i),r),s=he(()=>n().getOptionItemState(i));return g(zm,{value:i,get children(){return g(Hu,{value:s,get children(){return g(K.div,o)}})}})},l_=e=>{let[t,r]=qe()(e,["id","onValueChange","value"]),n=et(),a=B({id:qt()},t),i=B(()=>n().getItemGroupProps(a),r);return g(Hm,{value:a,get children(){return g(K.div,i)}})},c_=e=>{let t=qt(),r=Ca(),n=Dr(),a=he(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...sn(e)})),i=an($2,a);return{api:he(()=>L2(i,on)),service:i}},[Gm,Wm]=ut({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[qm,u_]=ut({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),d_=e=>{let[t,r]=Ks(e),[n,a]=qe()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=et(),o=Wm(),s=c_(n),l=to(B(t,()=>({present:s.api().open})));return $e(()=>{o&&(i?.().setChild(s.service),s.api().setParent(o))}),g(qm,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return g(Gm,{get value(){return s.service},get children(){return g(Bm,{get value(){return s.api},get children(){return g(Ys,{value:l,get children(){return a.children}})}})}})}})},p_=e=>{let t=et(),r=Wm(),[n,a]=Ks(e),i=to(B(n,()=>({present:a.value.api().open})));return Ye(()=>{r&&(t?.().setChild(a.value.service),a.value.api().setParent(r))}),g(qm,{value:()=>t?.().getTriggerItemProps(a.value.api()),get children(){return g(Gm,{get value(){return a.value.service},get children(){return g(Bm,{get value(){return a.value.api},get children(){return g(Ys,{value:i,get children(){return a.children}})}})}})}})},h_=e=>{let t=et(),r=B(()=>t().getSeparatorProps(),e);return g(K.hr,r)},g_=e=>{let t=et(),r=Ea(),n=B(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return g(K.button,n)},m_=e=>{let t=u_(),r=B(()=>t?.(),e);return g(K.div,r)},Tn={};ln(Tn,{Arrow:()=>G2,ArrowTip:()=>W2,CheckboxItem:()=>K2,Content:()=>Y2,Context:()=>X2,ContextTrigger:()=>J2,Indicator:()=>Q2,Item:()=>e_,ItemContext:()=>t_,ItemGroup:()=>r_,ItemGroupLabel:()=>n_,ItemIndicator:()=>a_,ItemText:()=>i_,Positioner:()=>o_,RadioItem:()=>s_,RadioItemGroup:()=>l_,Root:()=>d_,RootProvider:()=>p_,Separator:()=>h_,Trigger:()=>g_,TriggerItem:()=>m_});var Jn=new WeakMap,So=new WeakMap,Eo={},Il=0,Km=e=>e&&(e.host||Km(e.parentNode)),f_=(e,t)=>t.map(r=>{if(e.contains(r))return r;let n=Km(r);return n&&e.contains(n)?n:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",e,". Doing nothing"),null)}).filter(r=>!!r),b_=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),y_=(e,t)=>{let{parentNode:r,markerName:n,controlAttribute:a}=t,i=f_(r,Array.isArray(e)?e:[e]);Eo[n]||(Eo[n]=new WeakMap);let o=Eo[n],s=[],l=new Set,c=new Set(i),u=p=>{!p||l.has(p)||(l.add(p),u(p.parentNode))};i.forEach(u);let d=p=>{!p||c.has(p)||Array.prototype.forEach.call(p.children,h=>{if(l.has(h))d(h);else try{if(b_(h))return;let y=h.getAttribute(a)==="true",m=(Jn.get(h)||0)+1,v=(o.get(h)||0)+1;Jn.set(h,m),o.set(h,v),s.push(h),m===1&&y&&So.set(h,!0),v===1&&h.setAttribute(n,""),y||h.setAttribute(a,"true")}catch(y){console.error("[zag-js > ariaHidden] cannot operate on ",h,y)}})};return d(r),l.clear(),Il++,()=>{s.forEach(p=>{let h=Jn.get(p)-1,y=o.get(p)-1;Jn.set(p,h),o.set(p,y),h||(So.has(p)||p.removeAttribute(a),So.delete(p)),y||p.removeAttribute(n)}),Il--,Il||(Jn=new WeakMap,Jn=new WeakMap,So=new WeakMap,Eo={})}},v_=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,x_=(e,t=v_(e),r="data-aria-hidden")=>{if(t)return y_(e,{parentNode:t,markerName:r,controlAttribute:"aria-hidden"})},w_=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function k_(e,t={}){let{defer:r=!0}=t,n=r?w_:i=>i(),a=[];return a.push(n(()=>{let i=(typeof e=="function"?e():e).filter(Boolean);i.length!==0&&a.push(x_(i))})),()=>{a.forEach(i=>i?.())}}var Nl="data-scroll-lock";function __(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function T_(e){let t=e??document,r=t.defaultView??window,{documentElement:n,body:a}=t;if(a.hasAttribute(Nl))return;a.setAttribute(Nl,"");let i=r.innerWidth-n.clientWidth,o=()=>h1(n,"--scrollbar-width",`${i}px`),s=__(n),l=()=>rs(a,{overflow:"hidden",[s]:`${i}px`}),c=()=>{let{scrollX:d,scrollY:p,visualViewport:h}=r,y=h?.offsetLeft??0,m=h?.offsetTop??0,v=rs(a,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(m))}px`,left:`${-(d-Math.floor(y))}px`,right:"0",[s]:`${i}px`});return()=>{v?.(),r.scrollTo({left:d,top:p,behavior:"instant"})}},u=[o(),qs()?c():l()];return()=>{u.forEach(d=>d?.()),a.removeAttribute(Nl)}}function S_(e,t,r){let n=[],a;return i=>{let o=e(i);return(o.length!==n.length||o.some((s,l)=>!Qi(n[l],s)))&&(n=o,a=t(...o),r?.onChange?.(a)),a}}var E_=Bt("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),xr=E_.build(),C_=e=>e.ids?.root??`progress-${e.id}`,P_=e=>e.ids?.track??`progress-${e.id}-track`,O_=e=>e.ids?.label??`progress-${e.id}-label`,I_=e=>e.ids?.circle??`progress-${e.id}-circle`;function N_(e,t){let{context:r,computed:n,prop:a,send:i,scope:o}=e,s=n("percent"),l=n("isIndeterminate")?"":n("formatter").format(n("percent")/100),c=a("max"),u=a("min"),d=a("orientation"),p=a("translations"),h=n("isIndeterminate"),y=r.get("value"),m=p?.value({value:y,max:c,percent:s,min:u})??"",v=A_(y,c),w={role:"progressbar","aria-label":m,"data-max":c,"aria-valuemin":u,"aria-valuemax":c,"aria-valuenow":y??void 0,"data-orientation":d,"data-state":v},b=D_(e);return{value:y,valueAsString:m,min:u,max:c,percent:s,percentAsString:l,indeterminate:h,setValue(x){i({type:"VALUE.SET",value:x})},setToMax(){i({type:"VALUE.SET",value:c})},setToMin(){i({type:"VALUE.SET",value:u})},getRootProps(){return t.element({dir:a("dir"),...xr.root.attrs,id:C_(o),"data-max":c,"data-value":y??void 0,"data-state":v,"data-orientation":d,style:{"--percent":h?void 0:s}})},getLabelProps(){return t.element({dir:a("dir"),id:O_(o),...xr.label.attrs,"data-orientation":d})},getValueTextProps(){return t.element({dir:a("dir"),"aria-live":"polite",...xr.valueText.attrs})},getTrackProps(){return t.element({dir:a("dir"),id:P_(o),...xr.track.attrs,...w})},getRangeProps(){return t.element({dir:a("dir"),...xr.range.attrs,"data-orientation":d,"data-state":v,style:{[n("isHorizontal")?"width":"height"]:h?void 0:`${s}%`}})},getCircleProps(){return t.element({dir:a("dir"),id:I_(o),...xr.circle.attrs,...w,...b.root})},getCircleTrackProps(){return t.element({dir:a("dir"),"data-orientation":d,...xr.circleTrack.attrs,...b.track})},getCircleRangeProps(){return t.element({dir:a("dir"),...xr.circleRange.attrs,...b.range,"data-state":v})},getViewProps(x){return t.element({dir:a("dir"),...xr.view.attrs,"data-state":x.state,hidden:x.state!==v})}}}function A_(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}var Sp={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}},R_={style:{width:"var(--size)",height:"var(--size)"}};function D_(e){let{context:t,computed:r}=e;return{root:R_,track:Sp,range:{opacity:t.get("value")===0?0:void 0,style:{...Sp.style,"--percent":r("percent"),"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:r("isIndeterminate")?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}var M_={props({props:e}){let t=e.min??0,r=e.max??100;return{...e,max:r,min:t,defaultValue:e.defaultValue??$_(t,r),orientation:"horizontal",formatOptions:{style:"percent",...e.formatOptions},translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...e.translations}}},initialState(){return"idle"},entry:["validateContext"],context({bindable:e,prop:t}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){t("onValueChange")?.({value:r})}}))}},computed:{isIndeterminate:({context:e})=>e.get("value")===null,percent({context:e,prop:t}){let r=e.get("value");return Pu(r)?rx(r,t("min"),t("max"))*100:-1},formatter:S_(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>new Intl.NumberFormat(e,t)),isHorizontal:({prop:e})=>e("orientation")==="horizontal"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}},implementations:{actions:{setValue:({context:e,event:t,prop:r})=>{let n=t.value===null?null:Math.max(0,Math.min(t.value,r("max")));e.set("value",n)},validateContext:({context:e,prop:t})=>{let r=t("max"),n=t("min"),a=e.get("value");if(a!=null){if(!Zu(r))throw new Error(`[progress] The max value passed \`${r}\` is not a valid number`);if(!L_(a,r))throw new Error(`[progress] The value passed \`${a}\` exceeds the max value \`${r}\``);if(!F_(a,n))throw new Error(`[progress] The value passed \`${a}\` exceeds the min value \`${n}\``)}}}}},Zu=e=>Pu(e)&&!isNaN(e),L_=(e,t)=>Zu(e)&&e<=t,F_=(e,t)=>Zu(e)&&e>=t,$_=(e,t)=>e+(t-e)/2,U_=Lt()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange","defaultValue","formatOptions","locale"]),YN=Kt(U_),[Ym,Mr]=ut({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),j_=e=>{let t=Mr(),r=B(()=>t().getCircleProps(),e);return g(K.svg,r)},B_=e=>{let t=Mr(),r=B(()=>t().getCircleRangeProps(),e);return g(K.circle,r)},z_=e=>{let t=Mr(),r=B(()=>t().getCircleTrackProps(),e);return g(K.circle,r)},V_=e=>e.children(Mr()),H_=e=>{let t=Mr(),r=B(()=>t().getLabelProps(),e);return g(K.label,r)},Z_=e=>{let t=Mr(),r=B(()=>t().getRangeProps(),e);return g(K.div,r)},G_=e=>{let t=qt(),r=Ca(),n=Dr(),a=he(()=>({id:t,dir:r().dir,locale:r().locale,getRootNode:n().getRootNode,...sn(e)})),i=an(M_,a);return he(()=>N_(i,on))},W_=e=>{let[t,r]=qe()(e,["defaultValue","formatOptions","id","ids","locale","max","min","onValueChange","orientation","translations","value"]),n=G_(t),a=B(()=>n().getRootProps(),r);return g(Ym,{value:n,get children(){return g(K.div,a)}})},q_=e=>{let[{value:t},r]=qe()(e,["value"]),n=B(()=>t().getRootProps(),r);return g(Ym,{value:t,get children(){return g(K.div,n)}})},K_=e=>{let t=Mr(),r=B(()=>t().getTrackProps(),e);return g(K.div,r)},Y_=e=>{let t=Mr(),r=B(()=>t().getValueTextProps(),e);return g(K.span,De(r,{get children(){return e.children||t().percentAsString}}))},X_=e=>{let[t,r]=qe()(e,["state"]),n=Mr(),a=B(()=>n().getViewProps(t),r);return g(K.span,a)},Xa={};ln(Xa,{Circle:()=>j_,CircleRange:()=>B_,CircleTrack:()=>z_,Context:()=>V_,Label:()=>H_,Range:()=>Z_,Root:()=>W_,RootProvider:()=>q_,Track:()=>K_,ValueText:()=>Y_,View:()=>X_});function Ep(e,t,r){let n=[],a;return i=>{let o=e(i);return(o.length!==n.length||o.some((s,l)=>!Qi(n[l],s)))&&(n=o,a=t(...o),r?.onChange?.(a)),a}}function J_(){return{and:(...e)=>function(t){return e.every(r=>t.guard(r))},or:(...e)=>function(t){return e.some(r=>t.guard(r))},not:e=>function(t){return!t.guard(e)}}}function Q_(){return{guards:J_(),createMachine:e=>e,choose:e=>function({choose:t}){return t(e)?.actions}}}var Al=new Map,Cc=!1;try{Cc=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}var ls=!1;try{ls=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}var Xm={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}},eT=class{format(e){let t="";if(!Cc&&this.options.signDisplay!=null?t=rT(this.numberFormatter,this.options.signDisplay,e):t=this.numberFormatter.format(e),this.options.style==="unit"&&!ls){var r;let{unit:n,unitDisplay:a="short",locale:i}=this.resolvedOptions();if(!n)return t;let o=(r=Xm[n])===null||r===void 0?void 0:r[a];t+=o[i]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} \u2013 ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),n=this.numberFormatter.formatToParts(t);return[...r.map(a=>({...a,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...n.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Cc&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!ls&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=tT(e,t),this.options=t}};function tT(e,t={}){let{numberingSystem:r}=t;if(r&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${r}`),t.style==="unit"&&!ls){var n;let{unit:o,unitDisplay:s="short"}=t;if(!o)throw new Error('unit option must be provided with style: "unit"');if(!(!((n=Xm[o])===null||n===void 0)&&n[s]))throw new Error(`Unsupported unit ${o} with unitDisplay = ${s}`);t={...t,style:"decimal"}}let a=e+(t?Object.entries(t).sort((o,s)=>o[0]<s[0]?-1:1).join():"");if(Al.has(a))return Al.get(a);let i=new Intl.NumberFormat(e,t);return Al.set(a,i),i}function rT(e,t,r){if(t==="auto")return e.format(r);if(t==="never")return e.format(Math.abs(r));{let n=!1;if(t==="always"?n=r>0||Object.is(r,0):t==="exceptZero"&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let a=e.format(-r),i=e.format(r),o=a.replace(i,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),a.replace(i,"!!!").replace(o,"+").replace("!!!",i)}else return e.format(r)}}var nT=new RegExp("^.*\\(.*\\).*$"),aT=["latn","arab","hanidec","deva","beng"],Jm=class{parse(e){return Rl(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,r){return Rl(this.locale,this.options,e).isValidPartialNumber(e,t,r)}getNumberingSystem(e){return Rl(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}},Cp=new Map;function Rl(e,t,r){let n=Pp(e,t);if(!e.includes("-nu-")&&!n.isValidPartialNumber(r)){for(let a of aT)if(a!==n.options.numberingSystem){let i=Pp(e+(e.includes("-u-")?"-nu-":"-u-nu-")+a,t);if(i.isValidPartialNumber(r))return i}}return n}function Pp(e,t){let r=e+(t?Object.entries(t).sort((a,i)=>a[0]<i[0]?-1:1).join():""),n=Cp.get(r);return n||(n=new iT(e,t),Cp.set(r,n)),n}var iT=class{parse(e){let t=this.sanitize(e);if(this.symbols.group&&(t=Ua(t,this.symbols.group,"")),this.symbols.decimal&&(t=t.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(t=t.replace(this.symbols.minusSign,"-")),t=t.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let i=t.indexOf("-");t=t.replace("-","");let o=t.indexOf(".");o===-1&&(o=t.length),t=t.replace(".",""),o-2===0?t=`0.${t}`:o-2===-1?t=`0.0${t}`:o-2===-2?t="0.00":t=`${t.slice(0,o-2)}.${t.slice(o-2)}`,i>-1&&(t=`-${t}`)}let r=t?+t:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var n,a;let i={...this.options,style:"decimal",minimumFractionDigits:Math.min(((n=this.options.minimumFractionDigits)!==null&&n!==void 0?n:0)+2,20),maximumFractionDigits:Math.min(((a=this.options.maximumFractionDigits)!==null&&a!==void 0?a:0)+2,20)};return new Jm(this.locale,i).parse(new eT(this.locale,i).format(r))}return this.options.currencySign==="accounting"&&nT.test(e)&&(r=-1*r),r}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("\u060C",this.symbols.decimal)),this.symbols.group&&(e=Ua(e,".",this.symbols.group))),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Ua(e," ",this.symbols.group),e=Ua(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,t=-1/0,r=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&r>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Ua(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits==null&&(t.minimumFractionDigits=t.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=sT(e,this.formatter,this.options,t);var r,n;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((n=this.options.maximumFractionDigits)!==null&&n!==void 0?n:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}},Op=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),oT=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function sT(e,t,r,n){var a,i,o,s;let l=new Intl.NumberFormat(e,{...r,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=oT.map(P=>l.formatToParts(P));var p;let h=(p=(a=c.find(P=>P.type==="minusSign"))===null||a===void 0?void 0:a.value)!==null&&p!==void 0?p:"-",y=(i=u.find(P=>P.type==="plusSign"))===null||i===void 0?void 0:i.value;!y&&(n?.signDisplay==="exceptZero"||n?.signDisplay==="always")&&(y="+");let m=(o=new Intl.NumberFormat(e,{...r,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(P=>P.type==="decimal"))===null||o===void 0?void 0:o.value,v=(s=c.find(P=>P.type==="group"))===null||s===void 0?void 0:s.value,w=c.filter(P=>!Op.has(P.type)).map(P=>Ip(P.value)),b=d.flatMap(P=>P.filter(I=>!Op.has(I.type)).map(I=>Ip(I.value))),x=[...new Set([...w,...b])].sort((P,I)=>I.length-P.length),f=x.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${x.join("|")}|[\\p{White_Space}]`,"gu"),k=[...new Intl.NumberFormat(r.locale,{useGrouping:!1}).format(9876543210)].reverse(),_=new Map(k.map((P,I)=>[P,I])),C=new RegExp(`[${k.join("")}]`,"g");return{minusSign:h,plusSign:y,decimal:m,group:v,literals:f,numeral:C,index:P=>String(_.get(P))}}function Ua(e,t,r){return e.replaceAll?e.replaceAll(t,r):e.split(t).join(r)}function Ip(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lT=Bt("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber"),Br=lT.build(),cT=e=>e.ids?.root??`number-input:${e.id}`,Ja=e=>e.ids?.input??`number-input:${e.id}:input`,Qm=e=>e.ids?.incrementTrigger??`number-input:${e.id}:inc`,ef=e=>e.ids?.decrementTrigger??`number-input:${e.id}:dec`,uT=e=>e.ids?.scrubber??`number-input:${e.id}:scrubber`,tf=e=>`number-input:${e.id}:cursor`,dT=e=>e.ids?.label??`number-input:${e.id}:label`,Qa=e=>e.getById(Ja(e)),pT=e=>e.getById(Qm(e)),hT=e=>e.getById(ef(e)),rf=e=>e.getDoc().getElementById(tf(e)),gT=(e,t)=>{let r=null;return t==="increment"&&(r=pT(e)),t==="decrement"&&(r=hT(e)),r},mT=(e,t)=>{if(!dm())return yT(e,t),()=>{rf(e)?.remove()}},fT=e=>{let t=e.getDoc(),r=t.documentElement,n=t.body;return n.style.pointerEvents="none",r.style.userSelect="none",r.style.cursor="ew-resize",()=>{n.style.pointerEvents="",r.style.userSelect="",r.style.cursor="",r.style.length||r.removeAttribute("style"),n.style.length||n.removeAttribute("style")}},bT=(e,t)=>{let{point:r,isRtl:n,event:a}=t,i=e.getWin(),o=oi(a.movementX,i.devicePixelRatio),s=oi(a.movementY,i.devicePixelRatio),l=o>0?"increment":o<0?"decrement":null;n&&l==="increment"&&(l="decrement"),n&&l==="decrement"&&(l="increment");let c={x:r.x+o,y:r.y+s},u=i.innerWidth,d=oi(7.5,i.devicePixelRatio);return c.x=J0(c.x+d,u)-d,{hint:l,point:c}},yT=(e,t)=>{let r=e.getDoc(),n=r.createElement("div");n.className="scrubber--cursor",n.id=tf(e),Object.assign(n.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:sm,transform:t?`translate3d(${t.x}px, ${t.y}px, 0px)`:void 0,willChange:"transform"}),n.innerHTML=`
|
|
9
|
+
<svg width="46" height="15" style="left: -15.5px; position: absolute; top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
|
|
10
|
+
<g transform="translate(2 3)">
|
|
11
|
+
<path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z" style="stroke-width: 2px; stroke: white;"></path>
|
|
12
|
+
<path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z"></path>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>`,r.body.appendChild(n)};function vT(e,t){let{state:r,send:n,prop:a,scope:i,computed:o}=e,s=r.hasTag("focus"),l=o("isDisabled"),c=a("readOnly"),u=o("isValueEmpty"),d=o("isOutOfRange")||!!a("invalid"),p=l||!o("canIncrement")||c,h=l||!o("canDecrement")||c,y=a("translations");return{focused:s,invalid:d,empty:u,value:o("formattedValue"),valueAsNumber:o("valueAsNumber"),setValue(m){n({type:"VALUE.SET",value:m})},clearValue(){n({type:"VALUE.CLEAR"})},increment(){n({type:"VALUE.INCREMENT"})},decrement(){n({type:"VALUE.DECREMENT"})},setToMax(){n({type:"VALUE.SET",value:a("max")})},setToMin(){n({type:"VALUE.SET",value:a("min")})},focus(){Qa(i)?.focus()},getRootProps(){return t.element({id:cT(i),...Br.root.attrs,dir:a("dir"),"data-disabled":be(l),"data-focus":be(s),"data-invalid":be(d)})},getLabelProps(){return t.label({...Br.label.attrs,dir:a("dir"),"data-disabled":be(l),"data-focus":be(s),"data-invalid":be(d),id:dT(i),htmlFor:Ja(i)})},getControlProps(){return t.element({...Br.control.attrs,dir:a("dir"),role:"group","aria-disabled":l,"data-focus":be(s),"data-disabled":be(l),"data-invalid":be(d),"aria-invalid":bi(d)})},getValueTextProps(){return t.element({...Br.valueText.attrs,dir:a("dir"),"data-disabled":be(l),"data-invalid":be(d),"data-focus":be(s)})},getInputProps(){return t.input({...Br.input.attrs,dir:a("dir"),name:a("name"),form:a("form"),id:Ja(i),role:"spinbutton",defaultValue:o("formattedValue"),pattern:a("pattern"),inputMode:a("inputMode"),"aria-invalid":bi(d),"data-invalid":be(d),disabled:l,"data-disabled":be(l),readOnly:c,required:a("required"),autoComplete:"off",autoCorrect:"off",spellCheck:"false",type:"text","aria-roledescription":"numberfield","aria-valuemin":a("min"),"aria-valuemax":a("max"),"aria-valuenow":Number.isNaN(o("valueAsNumber"))?void 0:o("valueAsNumber"),"aria-valuetext":o("valueText"),onFocus(){n({type:"INPUT.FOCUS"})},onBlur(){n({type:"INPUT.BLUR"})},onInput(m){n({type:"INPUT.CHANGE",target:m.currentTarget,hint:"set"})},onBeforeInput(m){try{let{selectionStart:v,selectionEnd:w,value:b}=m.currentTarget,x=b.slice(0,v)+(m.data??"")+b.slice(w);o("parser").isValidPartialNumber(x)||m.preventDefault()}catch{}},onKeyDown(m){if(m.defaultPrevented||c||Ox(m))return;let v=Lx(m)*a("step"),w={ArrowUp(){n({type:"INPUT.ARROW_UP",step:v}),m.preventDefault()},ArrowDown(){n({type:"INPUT.ARROW_DOWN",step:v}),m.preventDefault()},Home(){vc(m)||(n({type:"INPUT.HOME"}),m.preventDefault())},End(){vc(m)||(n({type:"INPUT.END"}),m.preventDefault())},Enter(){n({type:"INPUT.ENTER"})}}[m.key];w?.(m)}})},getDecrementTriggerProps(){return t.button({...Br.decrementTrigger.attrs,dir:a("dir"),id:ef(i),disabled:h,"data-disabled":be(h),"aria-label":y.decrementLabel,type:"button",tabIndex:-1,"aria-controls":Ja(i),onPointerDown(m){h||!Vd(m)||(n({type:"TRIGGER.PRESS_DOWN",hint:"decrement",pointerType:m.pointerType}),m.pointerType==="mouse"&&m.preventDefault(),m.pointerType==="touch"&&m.currentTarget?.focus({preventScroll:!0}))},onPointerUp(m){n({type:"TRIGGER.PRESS_UP",hint:"decrement",pointerType:m.pointerType})},onPointerLeave(){h||n({type:"TRIGGER.PRESS_UP",hint:"decrement"})}})},getIncrementTriggerProps(){return t.button({...Br.incrementTrigger.attrs,dir:a("dir"),id:Qm(i),disabled:p,"data-disabled":be(p),"aria-label":y.incrementLabel,type:"button",tabIndex:-1,"aria-controls":Ja(i),onPointerDown(m){p||!Vd(m)||(n({type:"TRIGGER.PRESS_DOWN",hint:"increment",pointerType:m.pointerType}),m.pointerType==="mouse"&&m.preventDefault(),m.pointerType==="touch"&&m.currentTarget?.focus({preventScroll:!0}))},onPointerUp(m){n({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:m.pointerType})},onPointerLeave(m){n({type:"TRIGGER.PRESS_UP",hint:"increment",pointerType:m.pointerType})}})},getScrubberProps(){return t.element({...Br.scrubber.attrs,dir:a("dir"),"data-disabled":be(l),id:uT(i),role:"presentation",onMouseDown(m){if(l)return;let v=ua(m),w=Yt(m.currentTarget).devicePixelRatio;v.x=v.x-oi(7.5,w),v.y=v.y-oi(7.5,w),n({type:"SCRUBBER.PRESS_DOWN",point:v}),m.preventDefault()},style:{cursor:l?void 0:"ew-resize"}})}}}function xT(e){if(!(!e||e.ownerDocument.activeElement!==e))try{let{selectionStart:t,selectionEnd:r,value:n}=e,a=n.substring(0,t),i=n.substring(r);return{start:t,end:r,value:n,beforeTxt:a,afterTxt:i}}catch{}}function wT(e,t){if(!(!e||e.ownerDocument.activeElement!==e)){if(!t){e.setSelectionRange(e.value.length,e.value.length);return}try{let{value:r}=e,{beforeTxt:n="",afterTxt:a="",start:i}=t,o=r.length;if(r.endsWith(a))o=r.length-a.length;else if(r.startsWith(n))o=n.length;else if(i!=null){let s=n[i-1],l=r.indexOf(s,i-1);l!==-1&&(o=l+1)}e.setSelectionRange(o,o)}catch{}}}var kT=(e,t={})=>new Intl.NumberFormat(e,t),_T=(e,t={})=>new Jm(e,t),Dl=(e,t)=>{let{prop:r,computed:n}=t;return r("formatOptions")?n("parser").parse(String(e)):parseFloat(e)},fn=(e,t)=>{let{prop:r,computed:n}=t;return Number.isNaN(e)?"":r("formatOptions")?n("formatter").format(e):e.toString()},TT=(e,t)=>{let r=e!==void 0&&!Number.isNaN(e)?e:1;return t?.style==="percent"&&(e===void 0||Number.isNaN(e))&&(r=.01),r},{choose:ST,guards:ET,createMachine:CT}=Q_(),{not:Np,and:Ap}=ET,PT=CT({props({props:e}){let t=TT(e.step,e.formatOptions);return{dir:"ltr",locale:"en-US",focusInputOnChange:!0,clampValueOnBlur:!e.allowOverflow,allowOverflow:!1,inputMode:"decimal",pattern:"[0-9]*(.[0-9]+)?",defaultValue:"",step:t,min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,spinOnPress:!0,...e,translations:{incrementLabel:"increment value",decrementLabel:"decrease value",...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t,getComputed:r}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){let a=r(),i=Dl(n,{computed:a,prop:e});e("onValueChange")?.({value:n,valueAsNumber:i})}})),hint:t(()=>({defaultValue:null})),scrubberCursorPoint:t(()=>({defaultValue:null,hash(n){return n?`x:${n.x}, y:${n.y}`:""}})),fieldsetDisabled:t(()=>({defaultValue:!1}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",valueAsNumber:({context:e,computed:t,prop:r})=>Dl(e.get("value"),{computed:t,prop:r}),formattedValue:({computed:e,prop:t})=>fn(e("valueAsNumber"),{computed:e,prop:t}),isAtMin:({computed:e,prop:t})=>ex(e("valueAsNumber"),t("min")),isAtMax:({computed:e,prop:t})=>Q0(e("valueAsNumber"),t("max")),isOutOfRange:({computed:e,prop:t})=>!tx(e("valueAsNumber"),t("min"),t("max")),isValueEmpty:({context:e})=>e.get("value")==="",isDisabled:({prop:e,context:t})=>!!e("disabled")||t.get("fieldsetDisabled"),canIncrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMax"),canDecrement:({prop:e,computed:t})=>e("allowOverflow")||!t("isAtMin"),valueText:({prop:e,context:t})=>e("translations").valueText?.(t.get("value")),formatter:Ep(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>kT(e,t)),parser:Ep(({prop:e})=>[e("locale"),e("formatOptions")],(e,t)=>_T(e,t))},watch({track:e,action:t,context:r,computed:n,prop:a}){e([()=>r.get("value"),()=>a("locale")],()=>{t(["syncInputElement"])}),e([()=>n("isOutOfRange")],()=>{t(["invokeOnInvalid"])}),e([()=>r.hash("scrubberCursorPoint")],()=>{t(["setVirtualCursorPosition"])})},effects:["trackFormControl"],on:{"VALUE.SET":{actions:["setRawValue"]},"VALUE.CLEAR":{actions:["clearValue"]},"VALUE.INCREMENT":{actions:["increment"]},"VALUE.DECREMENT":{actions:["decrement"]}},states:{idle:{on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","invokeOnFocus","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","invokeOnFocus","setHint","setCursorPoint"]},"INPUT.FOCUS":{target:"focused",actions:["focusInput","invokeOnFocus"]}}},focused:{tags:["focus"],effects:["attachWheelListener"],on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","setHint","setCursorPoint"]},"INPUT.ARROW_UP":{actions:["increment"]},"INPUT.ARROW_DOWN":{actions:["decrement"]},"INPUT.HOME":{actions:["decrementToMin"]},"INPUT.END":{actions:["incrementToMax"]},"INPUT.CHANGE":{actions:["setValue","setHint"]},"INPUT.BLUR":[{guard:Ap("clampValueOnBlur",Np("isInRange")),target:"idle",actions:["setClampedValue","clearHint","invokeOnBlur"]},{guard:Np("isInRange"),target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur","invokeOnInvalid"]},{target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur"]}],"INPUT.ENTER":{actions:["setFormattedValue","clearHint","invokeOnBlur"]}}},"before:spin":{tags:["focus"],effects:["trackButtonDisabled","waitForChangeDelay"],entry:ST([{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}]),on:{CHANGE_DELAY:{target:"spinning",guard:Ap("isInRange","spinOnPress")},"TRIGGER.PRESS_UP":[{guard:"isTouchPointer",target:"focused",actions:["clearHint"]},{target:"focused",actions:["focusInput","clearHint"]}]}},spinning:{tags:["focus"],effects:["trackButtonDisabled","spinValue"],on:{SPIN:[{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}],"TRIGGER.PRESS_UP":{target:"focused",actions:["focusInput","clearHint"]}}},scrubbing:{tags:["focus"],effects:["activatePointerLock","trackMousemove","setupVirtualCursor","preventTextSelection"],on:{"SCRUBBER.POINTER_UP":{target:"focused",actions:["focusInput","clearCursorPoint"]},"SCRUBBER.POINTER_MOVE":[{guard:"isIncrementHint",actions:["increment","setCursorPoint"]},{guard:"isDecrementHint",actions:["decrement","setCursorPoint"]}]}}},implementations:{guards:{clampValueOnBlur:({prop:e})=>e("clampValueOnBlur"),spinOnPress:({prop:e})=>!!e("spinOnPress"),isInRange:({computed:e})=>!e("isOutOfRange"),isDecrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="decrement",isIncrementHint:({context:e,event:t})=>(t.hint??e.get("hint"))==="increment",isTouchPointer:({event:e})=>e.pointerType==="touch"},effects:{waitForChangeDelay({send:e}){let t=setTimeout(()=>{e({type:"CHANGE_DELAY"})},300);return()=>clearTimeout(t)},spinValue({send:e}){let t=setInterval(()=>{e({type:"SPIN"})},50);return()=>clearInterval(t)},trackFormControl({context:e,scope:t}){let r=Qa(t);return Hx(r,{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("value",e.initial("value"))}})},setupVirtualCursor({context:e,scope:t}){let r=e.get("scrubberCursorPoint");return mT(t,r)},preventTextSelection({scope:e}){return fT(e)},trackButtonDisabled({context:e,scope:t,send:r}){let n=e.get("hint"),a=gT(t,n);return bm(a,{attributes:["disabled"],callback(){r({type:"TRIGGER.PRESS_UP",src:"attr"})}})},attachWheelListener({scope:e,send:t,prop:r}){let n=Qa(e);if(!n||!e.isActiveElement(n)||!r("allowMouseWheel"))return;function a(i){i.preventDefault();let o=Math.sign(i.deltaY)*-1;o===1?t({type:"VALUE.INCREMENT"}):o===-1&&t({type:"VALUE.DECREMENT"})}return He(n,"wheel",a,{passive:!1})},activatePointerLock({scope:e}){if(!dm())return r1(e.getDoc())},trackMousemove({scope:e,send:t,context:r,computed:n}){let a=e.getDoc();function i(s){let l=r.get("scrubberCursorPoint"),c=n("isRtl"),u=bT(e,{point:l,isRtl:c,event:s});u.hint&&t({type:"SCRUBBER.POINTER_MOVE",hint:u.hint,point:u.point})}function o(){t({type:"SCRUBBER.POINTER_UP"})}return fi(He(a,"mousemove",i,!1),He(a,"mouseup",o,!1))}},actions:{focusInput({scope:e,prop:t}){if(!t("focusInputOnChange"))return;let r=Qa(e);e.isActiveElement(r)||ze(()=>r?.focus({preventScroll:!0}))},increment({context:e,event:t,prop:r,computed:n}){let a=nx(n("valueAsNumber"),t.step??r("step"));r("allowOverflow")||(a=ca(a,r("min"),r("max"))),e.set("value",fn(a,{computed:n,prop:r}))},decrement({context:e,event:t,prop:r,computed:n}){let a=ax(n("valueAsNumber"),t.step??r("step"));r("allowOverflow")||(a=ca(a,r("min"),r("max"))),e.set("value",fn(a,{computed:n,prop:r}))},setClampedValue({context:e,prop:t,computed:r}){let n=ca(r("valueAsNumber"),t("min"),t("max"));e.set("value",fn(n,{computed:r,prop:t}))},setRawValue({context:e,event:t,prop:r,computed:n}){let a=Dl(t.value,{computed:n,prop:r});r("allowOverflow")||(a=ca(a,r("min"),r("max"))),e.set("value",fn(a,{computed:n,prop:r}))},setValue({context:e,event:t}){let r=t.target?.value??t.value;e.set("value",r)},clearValue({context:e}){e.set("value","")},incrementToMax({context:e,prop:t,computed:r}){let n=fn(t("max"),{computed:r,prop:t});e.set("value",n)},decrementToMin({context:e,prop:t,computed:r}){let n=fn(t("min"),{computed:r,prop:t});e.set("value",n)},setHint({context:e,event:t}){e.set("hint",t.hint)},clearHint({context:e}){e.set("hint",null)},invokeOnFocus({computed:e,prop:t}){t("onFocusChange")?.({focused:!0,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnBlur({computed:e,prop:t}){t("onFocusChange")?.({focused:!1,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},invokeOnInvalid({computed:e,prop:t,event:r}){if(r.type==="INPUT.CHANGE")return;let n=e("valueAsNumber")>t("max")?"rangeOverflow":"rangeUnderflow";t("onValueInvalid")?.({reason:n,value:e("formattedValue"),valueAsNumber:e("valueAsNumber")})},syncInputElement({context:e,event:t,computed:r,scope:n}){let a=t.type.endsWith("CHANGE")?e.get("value"):r("formattedValue"),i=Qa(n),o=xT(i);ze(()=>{Ux(i,a),wT(i,o)})},setFormattedValue({context:e,computed:t}){e.set("value",t("formattedValue"))},setCursorPoint({context:e,event:t}){e.set("scrubberCursorPoint",t.point)},clearCursorPoint({context:e}){e.set("scrubberCursorPoint",null)},setVirtualCursorPosition({context:e,scope:t}){let r=rf(t),n=e.get("scrubberCursorPoint");!r||!n||(r.style.transform=`translate3d(${n.x}px, ${n.y}px, 0px)`)}}}}),OT=Lt()(["allowMouseWheel","allowOverflow","clampValueOnBlur","dir","disabled","focusInputOnChange","form","formatOptions","getRootNode","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","required","readOnly","spinOnPress","step","translations","value","defaultValue"]),XN=Kt(OT),[nf,cn]=ut({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),IT=e=>e.children(cn()),NT=e=>{let t=cn(),r=B(()=>t().getControlProps(),e);return g(K.div,r)},AT=e=>{let t=cn(),r=B(()=>t().getDecrementTriggerProps(),e);return g(K.button,r)},RT=e=>{let t=cn(),r=B(()=>t().getIncrementTriggerProps(),e);return g(K.button,r)},DT=e=>{let t=cn(),r=B(()=>t().getInputProps(),e),n=gr();return g(K.input,De({get"aria-describedby"(){return n?.().ariaDescribedby}},r))},MT=e=>{let t=cn(),r=B(()=>t().getLabelProps(),e);return g(K.label,r)},af=e=>{let t=qt(),r=Ca(),n=Dr(),a=gr(),i=he(()=>({id:t,ids:{label:a?.().ids.label,input:a?.().ids.control},disabled:a?.().disabled,readOnly:a?.().readOnly,required:a?.().required,invalid:a?.().invalid,dir:r().dir,locale:r().locale,getRootNode:n().getRootNode,...sn(e)})),o=an(PT,i);return he(()=>vT(o,on))},LT=e=>{let[t,r]=qe()(e,["allowMouseWheel","allowOverflow","clampValueOnBlur","defaultValue","disabled","focusInputOnChange","form","formatOptions","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","readOnly","required","spinOnPress","step","translations","value"]),n=af(t),a=B(()=>n().getRootProps(),r);return g(nf,{value:n,get children(){return g(K.div,a)}})},FT=e=>{let[{value:t},r]=qe()(e,["value"]),n=B(()=>t().getRootProps(),r);return g(nf,{value:t,get children(){return g(K.div,n)}})},$T=e=>{let t=cn(),r=B(()=>t().getScrubberProps(),e);return g(K.div,r)},UT=e=>{let t=cn(),r=B(()=>t().getValueTextProps(),e);return g(K.span,r)},aa={};ln(aa,{Context:()=>IT,Control:()=>NT,DecrementTrigger:()=>AT,IncrementTrigger:()=>RT,Input:()=>DT,Label:()=>MT,Root:()=>LT,RootProvider:()=>FT,Scrubber:()=>$T,ValueText:()=>UT});var jT=Bt("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),bn=jT.build(),of=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,sf=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Pc=e=>e.ids?.content??`dialog:${e.id}:content`,lf=e=>e.ids?.trigger??`dialog:${e.id}:trigger`,Oc=e=>e.ids?.title??`dialog:${e.id}:title`,Ic=e=>e.ids?.description??`dialog:${e.id}:description`,cf=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,Co=e=>e.getById(Pc(e)),BT=e=>e.getById(of(e)),zT=e=>e.getById(sf(e)),VT=e=>e.getById(lf(e)),HT=e=>e.getById(Oc(e)),ZT=e=>e.getById(Ic(e)),GT=e=>e.getById(cf(e));function WT(e,t){let{state:r,send:n,context:a,prop:i,scope:o}=e,s=i("aria-label"),l=r.matches("open");return{open:l,setOpen(c){r.matches("open")!==c&&n({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...bn.trigger.attrs,dir:i("dir"),id:lf(o),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":Pc(o),onClick(c){c.defaultPrevented||n({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...bn.backdrop.attrs,dir:i("dir"),hidden:!l,id:sf(o),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...bn.positioner.attrs,dir:i("dir"),id:of(o),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){let c=a.get("rendered");return t.element({...bn.content.attrs,dir:i("dir"),role:i("role"),hidden:!l,id:Pc(o),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":s||void 0,"aria-labelledby":s||!c.title?void 0:Oc(o),"aria-describedby":c.description?Ic(o):void 0})},getTitleProps(){return t.element({...bn.title.attrs,dir:i("dir"),id:Oc(o)})},getDescriptionProps(){return t.element({...bn.description.attrs,dir:i("dir"),id:Ic(o)})},getCloseTriggerProps(){return t.button({...bn.closeTrigger.attrs,dir:i("dir"),id:cf(o),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),n({type:"CLOSE"}))}})}}}var qT={props({props:e,scope:t}){let r=e.role==="alertdialog";return{role:"dialog",modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!r,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r?()=>GT(t):void 0,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:r}){e([()=>r("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:r}){return Rm(()=>Co(e),{defer:!0,pointerBlocking:r("modal"),exclude:[VT(e)],onInteractOutside(n){r("onInteractOutside")?.(n),r("closeOnInteractOutside")||n.preventDefault()},persistentElements:r("persistentElements"),onFocusOutside:r("onFocusOutside"),onPointerDownOutside:r("onPointerDownOutside"),onEscapeKeyDown(n){r("onEscapeKeyDown")?.(n),r("closeOnEscape")||n.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return T_(e.getDoc())},trapFocus({scope:e,prop:t}){return!t("trapFocus")||!t("modal")?void 0:xk(()=>Co(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>t("finalFocusEl")?.()??r})},hideContentBelow({scope:e,prop:t}){return t("modal")?k_(()=>[Co(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){ze(()=>{e.set("rendered",{title:!!HT(t),description:!!ZT(t)})})},syncZIndex({scope:e}){ze(()=>{let t=Co(e);if(!t)return;let r=Sa(t);[BT(e),zT(e)].forEach(n=>{n?.style.setProperty("--z-index",r.zIndex)})})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},toggleVisibility({prop:e,send:t,event:r}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}}},KT=Lt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),JN=Kt(KT),[uf,un]=ut({hookName:"useDialogContext",providerName:"<DialogProvider />"}),YT=e=>{let t=un(),r=O0(),n=to(B(r,()=>({present:t().open}))),a=B(()=>t().getBackdropProps(),()=>n().presenceProps,e);return g(X,{get when(){return!n().unmounted},get children(){return g(K.div,De(a,{ref(i){var o=Ji(n().ref,e.ref);typeof o=="function"&&o(i)}}))}})},XT=e=>{let t=un(),r=B(()=>t().getCloseTriggerProps(),e);return g(K.button,r)},JT=e=>{let t=un(),r=Ea(),n=B(()=>t().getContentProps(),()=>r().presenceProps,e);return g(X,{get when(){return!r().unmounted},get children(){return g(K.div,De(n,{ref(a){var i=Ji(r().ref,e.ref);typeof i=="function"&&i(a)}}))}})},QT=e=>e.children(un()),eS=e=>{let t=un(),r=B(()=>t().getDescriptionProps(),e);return g(K.div,r)},tS=e=>{let t=un(),r=Ea(),n=B(()=>t().getPositionerProps(),e);return g(X,{get when(){return!r().unmounted},get children(){return g(K.div,n)}})},rS=e=>{let t=qt(),r=Ca(),n=Dr(),a=he(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...sn(e)})),i=an(qT,a);return he(()=>WT(i,on))},nS=e=>{let[t,r]=Ks(e),[n]=Eu(t),[a,i]=qe()(r,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),o=rS(a),s=to(B(t,()=>({present:o().open})));return g(uf,{value:o,get children(){return g(em,{value:n,get children(){return g(Ys,{value:s,get children(){return i.children}})}})}})},aS=e=>{let[t,r]=Ks(e),[n]=Eu(t),a=to(B(t,()=>({present:r.value().open})));return g(uf,{get value(){return r.value},get children(){return g(em,{value:n,get children(){return g(Ys,{value:a,get children(){return r.children}})}})}})},iS=e=>{let t=un(),r=B(()=>t().getTitleProps(),e);return g(K.h2,r)},oS=e=>{let t=un(),r=Ea(),n=B(()=>t().getTriggerProps(),()=>({"aria-controls":r().unmounted&&null}),e);return g(K.button,n)},ia={};ln(ia,{Backdrop:()=>YT,CloseTrigger:()=>XT,Content:()=>JT,Context:()=>QT,Description:()=>eS,Positioner:()=>tS,Root:()=>nS,RootProvider:()=>aS,Title:()=>iS,Trigger:()=>oS});function sS(e){let t=Sa(e),r=e.getBoundingClientRect(),n=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),i=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),o=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function s(p,h){let y=parseFloat(p);return/%/.test(p)&&(y/=100,y*=h),Number.isNaN(y)?0:y}let l=s(n,r.width),c=s(a,r.height),u=s(i,r.width),d=s(o,r.height);return{x:{before:l,after:u},y:{before:c,after:d}}}function lS(e,t,r="both"){return r==="x"&&e.right>=t.left&&e.left<=t.right||r==="y"&&e.bottom>=t.top&&e.top<=t.bottom||r==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function df(e){let t=[];for(let r of e.children)t=t.concat(r,df(r));return t}function pf(e,t=!1){let r=e.getBoundingClientRect(),n={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},a=t?df(e):e.children;for(let i of["x","y"]){let o=i==="x"?"y":"x",s=i==="x"?"left":"top",l=i==="x"?"width":"height",c=i==="x"?"scrollLeft":"scrollTop";for(let u of a){let d=u.getBoundingClientRect();if(!lS(r,d,o))continue;let p=Sa(u),[h,y]=p.getPropertyValue("scroll-snap-align").split(" ");typeof y>"u"&&(y=h);let m=i==="x"?y:h,v=d[s]-r[s]+e[c];switch(m){case"none":break;case"start":n[i].start.push({node:u,position:v});break;case"center":n[i].center.push({node:u,position:v+d[l]/2});break;case"end":n[i].end.push({node:u,position:v+d[l]});break}}}return n}function Rp(e){let t=e.getBoundingClientRect(),r=sS(e),n=pf(e),a={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Dp([...n.x.start.map(i=>i.position-r.x.before),...n.x.center.map(i=>i.position-t.width/2),...n.x.end.map(i=>i.position-t.width+r.x.after)].map(Mp(0,a.x))),y:Dp([...n.y.start.map(i=>i.position-r.y.before),...n.y.center.map(i=>i.position-t.height/2),...n.y.end.map(i=>i.position-t.height+r.y.after)].map(Mp(0,a.y)))}}function cS(e,t,r){let n=pf(e),a=[...n[t].start,...n[t].center,...n[t].end];for(let i of a)if(r(i.node))return i.position}var Dp=e=>[...new Set(e)],Mp=(e,t)=>r=>Math.max(e,Math.min(t,r)),uS=Bt("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),wr=uS.build(),dS=e=>e.ids?.root??`carousel:${e.id}`,pS=(e,t)=>e.ids?.item?.(t)??`carousel:${e.id}:item:${t}`,Bo=e=>e.ids?.itemGroup??`carousel:${e.id}:item-group`,hS=e=>e.ids?.nextTrigger??`carousel:${e.id}:next-trigger`,gS=e=>e.ids?.prevTrigger??`carousel:${e.id}:prev-trigger`,mS=e=>e.ids?.indicatorGroup??`carousel:${e.id}:indicator-group`,hf=(e,t)=>e.ids?.indicator?.(t)??`carousel:${e.id}:indicator:${t}`,vt=e=>e.getById(Bo(e)),Lp=e=>vm(vt(e),"[data-part=item]"),fS=(e,t)=>e.getById(hf(e,t)),Fp=e=>{let t=vt(e);if(!t)return;let r=eo(t);t.setAttribute("tabindex",r.length>0?"-1":"0")};function bS(e,t){let{state:r,context:n,computed:a,send:i,scope:o,prop:s}=e,l=r.matches("autoplay"),c=r.matches("dragging"),u=a("canScrollNext"),d=a("canScrollPrev"),p=a("isHorizontal"),h=Array.from(n.get("pageSnapPoints")),y=n.get("page"),m=s("slidesPerPage"),v=s("padding"),w=s("translations");return{isPlaying:l,isDragging:c,page:y,pageSnapPoints:h,canScrollNext:u,canScrollPrev:d,getProgress(){return y/h.length},scrollToIndex(b,x){i({type:"INDEX.SET",index:b,instant:x})},scrollTo(b,x){i({type:"PAGE.SET",index:b,instant:x})},scrollNext(b){i({type:"PAGE.NEXT",instant:b})},scrollPrev(b){i({type:"PAGE.PREV",instant:b})},play(){i({type:"AUTOPLAY.START"})},pause(){i({type:"AUTOPLAY.PAUSE"})},isInView(b){return Array.from(n.get("slidesInView")).includes(b)},refresh(){i({type:"SNAP.REFRESH"})},getRootProps(){return t.element({...wr.root.attrs,id:dS(o),role:"region","aria-roledescription":"carousel","data-orientation":s("orientation"),dir:s("dir"),style:{"--slides-per-page":m,"--slide-spacing":s("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}})},getItemGroupProps(){return t.element({...wr.itemGroup.attrs,id:Bo(o),"data-orientation":s("orientation"),"data-dragging":be(c),dir:s("dir"),"aria-live":l?"off":"polite",onFocus(b){pm(b)&&i({type:"VIEWPORT.FOCUS"})},onBlur(b){Or(b.currentTarget,b.relatedTarget)||i({type:"VIEWPORT.BLUR"})},onMouseDown(b){if(!s("allowMouseDrag")||b.button!==0||b.defaultPrevented)return;let x=St(b);Sr(x)&&x!==b.currentTarget||(b.preventDefault(),i({type:"DRAGGING.START"}))},onWheel:G0(b=>{let x=s("orientation")==="horizontal"?"deltaX":"deltaY";b[x]<0&&!a("canScrollPrev")||b[x]>0&&!a("canScrollNext")||i({type:"USER.SCROLL"})},150),onTouchStart(){i({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[p?"x":"y",s("snapType")].join(" "),gridAutoFlow:p?"column":"row",scrollbarWidth:"none",overscrollBehavior:"contain",[p?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[p?"scrollPaddingInline":"scrollPaddingBlock"]:v,[p?"paddingInline":"paddingBlock"]:v,[p?"overflowX":"overflowY"]:"auto"}})},getItemProps(b){let x=n.get("slidesInView").includes(b.index);return t.element({...wr.item.attrs,id:pS(o,b.index),dir:s("dir"),role:"group","data-index":b.index,"data-inview":be(x),"aria-roledescription":"slide","data-orientation":s("orientation"),"aria-label":w.item(b.index,s("slideCount")),"aria-hidden":bi(!x),style:{scrollSnapAlign:(()=>{let f=b.snapAlign??"start",k=s("slidesPerMove"),_=k==="auto"?Math.floor(s("slidesPerPage")):k;return(b.index+_)%_===0?f:void 0})()}})},getControlProps(){return t.element({...wr.control.attrs,"data-orientation":s("orientation")})},getPrevTriggerProps(){return t.button({...wr.prevTrigger.attrs,id:gS(o),type:"button",disabled:!d,dir:s("dir"),"aria-label":w.prevTrigger,"data-orientation":s("orientation"),"aria-controls":Bo(o),onClick(b){b.defaultPrevented||i({type:"PAGE.PREV",src:"trigger"})}})},getNextTriggerProps(){return t.button({...wr.nextTrigger.attrs,dir:s("dir"),id:hS(o),type:"button","aria-label":w.nextTrigger,"data-orientation":s("orientation"),"aria-controls":Bo(o),disabled:!u,onClick(b){b.defaultPrevented||i({type:"PAGE.NEXT",src:"trigger"})}})},getIndicatorGroupProps(){return t.element({...wr.indicatorGroup.attrs,dir:s("dir"),id:mS(o),"data-orientation":s("orientation"),onKeyDown(b){if(b.defaultPrevented)return;let x="indicator",f={ArrowDown(C){p||(i({type:"PAGE.NEXT",src:x}),C.preventDefault())},ArrowUp(C){p||(i({type:"PAGE.PREV",src:x}),C.preventDefault())},ArrowRight(C){p&&(i({type:"PAGE.NEXT",src:x}),C.preventDefault())},ArrowLeft(C){p&&(i({type:"PAGE.PREV",src:x}),C.preventDefault())},Home(C){i({type:"PAGE.SET",index:0,src:x}),C.preventDefault()},End(C){i({type:"PAGE.SET",index:h.length-1,src:x}),C.preventDefault()}},k=xc(b,{dir:s("dir"),orientation:s("orientation")}),_=f[k];_?.(b)}})},getIndicatorProps(b){return t.button({...wr.indicator.attrs,dir:s("dir"),id:hf(o,b.index),type:"button","data-orientation":s("orientation"),"data-index":b.index,"data-readonly":be(b.readOnly),"data-current":be(b.index===y),"aria-label":w.indicator(b.index),onClick(x){x.defaultPrevented||b.readOnly||i({type:"PAGE.SET",index:b.index,src:"indicator"})}})},getAutoplayTriggerProps(){return t.button({...wr.autoplayTrigger.attrs,type:"button","data-orientation":s("orientation"),"data-pressed":be(l),"aria-label":l?w.autoplayStop:w.autoplayStart,onClick(b){b.defaultPrevented||i({type:l?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}})}}}var yS={props({props:e}){return im(e,["slideCount"],"carousel"),{dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6,...e,translations:{nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,r)=>`${t+1} of ${r}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation",...e.translations}}},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:r}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(n){let a=r().get("pageSnapPoints");e("onPageChange")?.({page:n,pageSnapPoint:a[n]})}})),pageSnapPoints:t(()=>({defaultValue:vS(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{let t=e("autoplay");return rm(t)?t.delay:4e3}},watch({track:e,action:t,context:r,prop:n}){e([()=>n("slidesPerPage"),()=>n("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>r.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>n("orientation")],()=>{t(["setSnapPoints","scrollToPage"])})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(vt(e))},effects:{autoUpdateSlide({computed:e,send:t}){let r=setInterval(()=>{t({type:"AUTOPLAY.TICK",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(r)},trackSlideMutation({scope:e,send:t}){let r=vt(e);if(!r)return;let n=e.getWin(),a=new n.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),Fp(e)});return Fp(e),a.observe(r,{childList:!0,subtree:!0}),()=>a.disconnect()},trackSlideResize({scope:e,send:t}){if(!vt(e))return;let r=e.getWin(),n=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};ze(()=>{n(),ze(()=>{t({type:"PAGE.SCROLL",instant:!0})})});let a=new r.ResizeObserver(n);return Lp(e).forEach(i=>a.observe(i)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:r}){let n=vt(e),a=e.getWin(),i=new a.IntersectionObserver(o=>{let s=o.reduce((l,c)=>{let u=c.target,d=Number(u.dataset.index??"-1");return d==null||Number.isNaN(d)||d===-1?l:c.isIntersecting?M0(l,d):L0(l,d)},r.get("slidesInView"));r.set("slidesInView",F0(s))},{root:n,threshold:t("inViewThreshold")});return Lp(e).forEach(o=>i.observe(o)),()=>i.disconnect()},trackScroll({send:e,refs:t,scope:r}){let n=vt(r);return n?He(n,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){let r=e.getDoc();return He(r,"visibilitychange",()=>{r.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){let r=e.getDoc();return o1(r,{onPointerMove({event:n}){t({type:"DRAGGING",left:-n.movementX,top:-n.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:r}){let n=e.getWin();return He(n,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.preventDefault(),t({type:"PAGE.SET",index:r.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:r,computed:n,flush:a}){let i=t.instant?"instant":"smooth",o=ca(t.index??e.get("page"),0,e.get("pageSnapPoints").length-1),s=vt(r);if(!s)return;let l=n("isHorizontal")?"left":"top";a(()=>{s.scrollTo({[l]:e.get("pageSnapPoints")[o],behavior:i})})},setClosestPage({context:e,scope:t,computed:r}){let n=vt(t);if(!n)return;let a=r("isHorizontal")?n.scrollLeft:n.scrollTop,i=e.get("pageSnapPoints").findIndex(o=>Math.abs(o-a)<1);i!==-1&&e.set("page",i)},setNextPage({context:e,prop:t,state:r}){let n=r.matches("autoplay")||t("loop"),a=Cu(e.get("pageSnapPoints"),e.get("page"),{loop:n});e.set("page",a)},setPrevPage({context:e,prop:t,state:r}){let n=r.matches("autoplay")||t("loop"),a=tm(e.get("pageSnapPoints"),e.get("page"),{loop:n});e.set("page",a)},setMatchingPage({context:e,event:t,computed:r,scope:n}){let a=vt(n);if(!a)return;let i=cS(a,r("isHorizontal")?"x":"y",s=>s.dataset.index===t.index.toString());if(i==null)return;let o=e.get("pageSnapPoints").findIndex(s=>Math.abs(s-i)<1);e.set("page",o)},setPage({context:e,event:t}){let r=t.index??e.get("page");e.set("page",r)},clampPage({context:e}){let t=ca(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:r}){let n=vt(r);if(!n)return;let a=Rp(n);e.set("pageSnapPoints",t("isHorizontal")?a.x:a.y)},disableScrollSnap({scope:e}){let t=vt(e);if(!t)return;let r=getComputedStyle(t);t.dataset.scrollSnapType=r.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){vt(e)?.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:r}){let n=vt(e);if(!n)return;let a=n.scrollLeft,i=n.scrollTop,o=Rp(n),s=o.x.reduce((c,u)=>Math.abs(u-a)<Math.abs(c-a)?u:c,o.x[0]),l=o.y.reduce((c,u)=>Math.abs(u-i)<Math.abs(c-i)?u:c,o.y[0]);ze(()=>{n.scrollTo({left:s,top:l,behavior:"smooth"});let c=r("isHorizontal")?s:l;t.set("page",t.get("pageSnapPoints").indexOf(c));let u=n.dataset.scrollSnapType;u&&(n.style.setProperty("scroll-snap-type",u),delete n.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:r}){if(t.src!=="indicator")return;let n=fS(r,e.get("page"));n&&ze(()=>n.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){t("onDragStatusChange")?.({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){t("onAutoplayStatusChange")?.({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function vS(e,t,r){if(e==null)return[];let n=[],a=t==="auto"?Math.floor(r):t;for(let i=0;i<e-1;i+=a)n.push(i);return n}var xS=Lt()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),QN=Kt(xS),wS=Lt()(["index","readOnly"]),eA=Kt(wS),kS=Lt()(["index","snapAlign"]),tA=Kt(kS),[gf,Lr]=ut({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),_S=e=>{let t=Lr(),r=B(()=>t().getAutoplayTriggerProps(),e);return g(K.button,r)},TS=e=>e.children(Lr()),SS=e=>{let t=Lr(),r=B(()=>t().getControlProps(),e);return g(K.div,r)},ES=e=>{let[t,r]=qe()(e,["index","readOnly"]),n=Lr(),a=B(()=>n().getIndicatorProps(t),r);return g(K.button,a)},CS=e=>{let t=Lr(),r=B(()=>t().getIndicatorGroupProps(),e);return g(K.div,r)},PS=e=>{let[t,r]=qe()(e,["index","snapAlign"]),n=Lr(),a=B(()=>n().getItemProps(t),r);return g(K.div,a)},OS=e=>{let t=Lr(),r=B(()=>t().getItemGroupProps(),e);return g(K.div,r)},IS=e=>{let t=Lr(),r=B(()=>t().getNextTriggerProps(),e);return g(K.button,r)},NS=e=>{let t=Lr(),r=B(()=>t().getPrevTriggerProps(),e);return g(K.button,r)},AS=e=>{let t=qt(),r=Ca(),n=Dr(),a=he(()=>({id:t,dir:r().dir,getRootNode:n().getRootNode,...sn(e)})),i=an(yS,a);return he(()=>bS(i,on))},RS=e=>{let[t,r]=qe()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),n=AS(t),a=B(()=>n().getRootProps(),r);return g(gf,{value:n,get children(){return g(K.div,a)}})},DS=e=>{let[{value:t},r]=qe()(e,["value"]),n=B(()=>t().getRootProps(),r);return g(gf,{value:t,get children(){return g(K.div,n)}})},jn={};ln(jn,{AutoplayTrigger:()=>_S,Context:()=>TS,Control:()=>SS,Indicator:()=>ES,IndicatorGroup:()=>CS,Item:()=>PS,ItemGroup:()=>OS,NextTrigger:()=>IS,PrevTrigger:()=>NS,Root:()=>RS,RootProvider:()=>DS});var Er=o2({placement:"bottom-end",gap:24}),mf=e=>Number(e)>=6;function ff(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ff(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function MS(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ff(e))&&(n&&(n+=" "),n+=t);return n}var $p=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ae=MS,LS=(e,t)=>r=>{var n;if(t?.variants==null)return ae(e,r?.class,r?.className);let{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(c=>{let u=r?.[c],d=i?.[c];if(u===null)return null;let p=$p(u)||$p(d);return a[c][p]}),s=r&&Object.entries(r).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(y=>{let[m,v]=y;return Array.isArray(v)?v.includes({...i,...s}[m]):{...i,...s}[m]===v})?[...c,d,p]:c},[]);return ae(e,o,l,r?.class,r?.className)},FS=e=>{let t=US(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{let i=a.split("-");return i[0]===""&&i.length!==1&&i.shift(),bf(i,t)||$S(a)},getConflictingClassGroupIds:(a,i)=>{let o=r[a]||[];return i&&n[a]?[...o,...n[a]]:o}}},bf=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),a=n?bf(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;let i=e.join("-");return t.validators.find(({validator:o})=>o(i))?.classGroupId},Up=/^\[(.+)\]$/,$S=e=>{if(Up.test(e)){let t=Up.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},US=e=>{let{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(let a in r)Nc(r[a],n,a,t);return n},Nc=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){let i=a===""?t:jp(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(jS(a)){Nc(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{Nc(o,jp(t,i),r,n)})})},jp=(e,t)=>{let r=e;return t.split("-").forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},jS=e=>e.isThemeGetter,BS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map,a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},zS=e=>{let{prefix:t,experimentalParseClassName:r}=e,n=a=>{let i=[],o=0,s=0,l=0,c;for(let y=0;y<a.length;y++){let m=a[y];if(o===0&&s===0){if(m===":"){i.push(a.slice(l,y)),l=y+1;continue}if(m==="/"){c=y;continue}}m==="["?o++:m==="]"?o--:m==="("?s++:m===")"&&s--}let u=i.length===0?a:a.substring(l),d=VS(u),p=d!==u,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:h}};if(t){let a=t+":",i=n;n=o=>o.startsWith(a)?i(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){let a=n;n=i=>r({className:i,parseClassName:a})}return n},VS=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,HS=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;let n=[],a=[];return r.forEach(i=>{i[0]==="["||t[i]?(n.push(...a.sort(),i),a=[]):a.push(i)}),n.push(...a.sort()),n}},ZS=e=>({cache:BS(e.cacheSize),parseClassName:zS(e),sortModifiers:HS(e),...FS(e)}),GS=/\s+/,WS=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],s=e.trim().split(GS),l="";for(let c=s.length-1;c>=0;c-=1){let u=s[c],{isExternal:d,modifiers:p,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:m}=r(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,w=n(v?y.substring(0,m):y);if(!w){if(!v){l=u+(l.length>0?" "+l:l);continue}if(w=n(y),!w){l=u+(l.length>0?" "+l:l);continue}v=!1}let b=i(p).join(":"),x=h?b+"!":b,f=x+w;if(o.includes(f))continue;o.push(f);let k=a(w,v);for(let _=0;_<k.length;++_){let C=k[_];o.push(x+C)}l=u+(l.length>0?" "+l:l)}return l};function qS(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=yf(t))&&(n&&(n+=" "),n+=r);return n}var yf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=yf(e[n]))&&(r&&(r+=" "),r+=t);return r};function Bp(e,...t){let r,n,a,i=o;function o(l){let c=t.reduce((u,d)=>d(u),e());return r=ZS(c),n=r.cache.get,a=r.cache.set,i=s,s(l)}function s(l){let c=n(l);if(c)return c;let u=WS(l,r);return a(l,u),u}return function(){return i(qS.apply(null,arguments))}}var rt=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},vf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KS=/^\d+\/\d+$/,YS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,QS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qn=e=>KS.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),yn=e=>!!e&&Number.isInteger(Number(e)),zp=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),zr=e=>YS.test(e),tE=()=>!0,rE=e=>XS.test(e)&&!JS.test(e),Gu=()=>!1,nE=e=>QS.test(e),aE=e=>eE.test(e),iE=e=>!te(e)&&!re(e),oE=e=>Na(e,_f,Gu),te=e=>vf.test(e),vn=e=>Na(e,Tf,rE),Ml=e=>Na(e,bE,Oe),sE=e=>Na(e,wf,Gu),lE=e=>Na(e,kf,aE),cE=e=>Na(e,Gu,nE),re=e=>xf.test(e),Po=e=>Aa(e,Tf),uE=e=>Aa(e,yE),dE=e=>Aa(e,wf),pE=e=>Aa(e,_f),hE=e=>Aa(e,kf),gE=e=>Aa(e,vE,!0),Na=(e,t,r)=>{let n=vf.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Aa=(e,t,r=!1)=>{let n=xf.exec(e);return n?n[1]?t(n[1]):r:!1},wf=e=>e==="position",mE=new Set(["image","url"]),kf=e=>mE.has(e),fE=new Set(["length","size","percentage"]),_f=e=>fE.has(e),Tf=e=>e==="length",bE=e=>e==="number",yE=e=>e==="family-name",vE=e=>e==="shadow",Vp=()=>{let e=rt("color"),t=rt("font"),r=rt("text"),n=rt("font-weight"),a=rt("tracking"),i=rt("leading"),o=rt("breakpoint"),s=rt("container"),l=rt("spacing"),c=rt("radius"),u=rt("shadow"),d=rt("inset-shadow"),p=rt("drop-shadow"),h=rt("blur"),y=rt("perspective"),m=rt("aspect"),v=rt("ease"),w=rt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],f=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],_=()=>[re,te,l],C=()=>[Qn,"full","auto",..._()],P=()=>[yn,"none","subgrid",re,te],I=()=>["auto",{span:["full",yn,re,te]},re,te],L=()=>[yn,"auto",re,te],R=()=>["auto","min","max","fr",re,te],D=()=>["start","end","center","between","around","evenly","stretch","baseline"],V=()=>["start","end","center","stretch"],F=()=>["auto",..._()],le=()=>[Qn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],O=()=>[e,re,te],A=()=>[zp,vn],z=()=>["","none","full",c,re,te],ge=()=>["",Oe,Po,vn],me=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ze=()=>["","none",h,re,te],je=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re,te],dn=()=>["none",Oe,re,te],Be=()=>["none",Oe,re,te],fr=()=>[Oe,re,te],$r=()=>[Qn,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zr],breakpoint:[zr],color:[tE],container:[zr],"drop-shadow":[zr],ease:["in","out","in-out"],font:[iE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zr],shadow:[zr],spacing:["px",Oe],text:[zr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qn,te,re,m]}],container:["container"],columns:[{columns:[Oe,te,re,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...x(),te,re]}],overflow:[{overflow:f()}],"overflow-x":[{"overflow-x":f()}],"overflow-y":[{"overflow-y":f()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[yn,"auto",re,te]}],basis:[{basis:[Qn,"full","auto",s,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Qn,"auto","initial","none",te]}],grow:[{grow:["",Oe,re,te]}],shrink:[{shrink:["",Oe,re,te]}],order:[{order:[yn,"first","last","none",re,te]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),"baseline"]}],"align-self":[{self:["auto",...V(),"baseline"]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],w:[{w:[s,"screen",...le()]}],"min-w":[{"min-w":[s,"screen","none",...le()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...le()]}],h:[{h:["screen",...le()]}],"min-h":[{"min-h":["screen","none",...le()]}],"max-h":[{"max-h":["screen",...le()]}],"font-size":[{text:["base",r,Po,vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,re,Ml]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zp,te]}],"font-family":[{font:[uE,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,re,te]}],"line-clamp":[{"line-clamp":[Oe,"none",re,Ml]}],leading:[{leading:[i,..._()]}],"list-image":[{"list-image":["none",re,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",re,vn]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Oe,"auto",re,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),dE,sE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",pE,oE]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yn,re,te],radial:["",re,te],conic:[yn,re,te]},hE,lE]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:ge()}],"border-w-x":[{"border-x":ge()}],"border-w-y":[{"border-y":ge()}],"border-w-s":[{"border-s":ge()}],"border-w-e":[{"border-e":ge()}],"border-w-t":[{"border-t":ge()}],"border-w-r":[{"border-r":ge()}],"border-w-b":[{"border-b":ge()}],"border-w-l":[{"border-l":ge()}],"divide-x":[{"divide-x":ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,re,te]}],"outline-w":[{outline:["",Oe,Po,vn]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,gE,cE]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",re,te,d]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Oe,vn]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ge()}],"inset-ring-color":[{"inset-ring":O()}],opacity:[{opacity:[Oe,re,te]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none",re,te]}],blur:[{blur:Ze()}],brightness:[{brightness:[Oe,re,te]}],contrast:[{contrast:[Oe,re,te]}],"drop-shadow":[{"drop-shadow":["","none",p,re,te]}],grayscale:[{grayscale:["",Oe,re,te]}],"hue-rotate":[{"hue-rotate":[Oe,re,te]}],invert:[{invert:["",Oe,re,te]}],saturate:[{saturate:[Oe,re,te]}],sepia:[{sepia:["",Oe,re,te]}],"backdrop-filter":[{"backdrop-filter":["","none",re,te]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,re,te]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,re,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,re,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,re,te]}],"backdrop-invert":[{"backdrop-invert":["",Oe,re,te]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,re,te]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,re,te]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,re,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",re,te]}],ease:[{ease:["linear","initial",v,re,te]}],delay:[{delay:[Oe,re,te]}],animate:[{animate:["none",w,re,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,re,te]}],"perspective-origin":[{"perspective-origin":je()}],rotate:[{rotate:dn()}],"rotate-x":[{"rotate-x":dn()}],"rotate-y":[{"rotate-y":dn()}],"rotate-z":[{"rotate-z":dn()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:fr()}],"skew-x":[{"skew-x":fr()}],"skew-y":[{"skew-y":fr()}],transform:[{transform:[re,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:je()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$r()}],"translate-x":[{"translate-x":$r()}],"translate-y":[{"translate-y":$r()}],"translate-z":[{"translate-z":$r()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re,te]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[Oe,Po,vn,Ml]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},xE=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:a={},override:i={}})=>(ei(e,"cacheSize",t),ei(e,"prefix",r),ei(e,"experimentalParseClassName",n),Oo(e.theme,i.theme),Oo(e.classGroups,i.classGroups),Oo(e.conflictingClassGroups,i.conflictingClassGroups),Oo(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),ei(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Io(e.theme,a.theme),Io(e.classGroups,a.classGroups),Io(e.conflictingClassGroups,a.conflictingClassGroups),Io(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Sf(e,a,"orderSensitiveModifiers"),e),ei=(e,t,r)=>{r!==void 0&&(e[t]=r)},Oo=(e,t)=>{if(t)for(let r in t)ei(e,r,t[r])},Io=(e,t)=>{if(t)for(let r in t)Sf(e,t,r)},Sf=(e,t,r)=>{let n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},wE=(e,...t)=>typeof e=="function"?Bp(Vp,e,...t):Bp(()=>xE(Vp(),e),...t),kE=wE({extend:{classGroups:{"border-w":["border-host-bubble","border-button","border-input"],"border-color":["border-host-bubble-border","border-button-border","border-input-border"]}}});function wi(...e){return kE(ae(e))}var _E=E('<svg><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),Ef=e=>(()=>{var t=_E();return Ke(t,De(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})(),TE=E("<button>"),Ac=LS("font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center flex-shrink-0 transition-[filter] duration-200",{variants:{variant:{primary:"makebot-button bg-button-bg text-button-text border-button-border rounded-button border-button blur-button shadow-button",secondary:"secondary-button bg-host-bubble-bg text-host-bubble-text rounded-host-bubble border-host-bubble border-host-bubble-border"},size:{icon:"text-sm size-6 pt-[3px]",sm:"py-2 px-4 text-sm",md:"py-2 px-4"}},defaultVariants:{variant:"primary",size:"md"}}),nr=e=>{let t=bu(()=>e.children),[r,n]=Rt(e,["variant","size","isDisabled","isLoading"]);return(()=>{var a=TE();return Ke(a,De(n,{get disabled(){return r.isDisabled||r.isLoading},get class(){return wi(Ac({variant:r.variant,size:r.size}),n.class)}}),!1,!0),T(a,g(X,{get when(){return!r.isLoading},get fallback(){return g(Ef,{})},get children(){return t()}})),a})()},SE="lg",Cf=fu(()=>SE),Pf=()=>Bs(Cf),EE=e=>{let[t,r]=N("lg"),n=new ResizeObserver(()=>{let a=e();a&&r(Hp(a))});return $e(()=>{let a=e();a&&(r(Hp(a)),n.observe(a))}),Ie(()=>{let a=e();a&&n.unobserve(a)}),t},Hp=e=>{let t=e.clientWidth;return t<fo.xs?"xs":t<fo.sm?"sm":t<fo.md?"md":t<fo.lg?"lg":"xl"},Rc=async({apiHost:e,message:t,sessionId:r})=>{console.log("\u{1F50D} continueChatQuery - chamada:",{apiHost:e,message:t,sessionId:r});try{let n=`${ot(e)?e:Pr()}/api/v1/sessions/${r}/continueChat`;console.log("\u{1F50D} continueChatQuery - URL:",n),console.log("\u{1F50D} continueChatQuery - payload:",{message:t});let a=await Ki.post(n,{json:{message:t},timeout:!1}).json();return console.log("\u{1F50D} continueChatQuery - resposta:",a),{data:a}}catch(n){return n?.response&&n.response.status===404?{error:{code:"NOT_FOUND",message:"Sess\xE3o n\xE3o encontrada.",status:404,type:"HTTP_ERROR"}}:{error:n}}},Zp=async({apiHost:e,sessionId:t,clientLogs:r})=>{try{await Ki.post(`${ot(e)?e:Pr()}/api/v2/sessions/${t}/clientLogs`,{json:{clientLogs:r}})}catch(n){console.log(n)}},CE=e=>Se(window.gtag)?Promise.resolve():new Promise(t=>{let r=document.getElementById("gtag");if(!r){let n=document.createElement("script");n.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,n.id="gtag";let a=document.createElement("script");a.innerHTML=`window.dataLayer = window.dataLayer || [];
|
|
15
|
+
function gtag(){dataLayer.push(arguments);}
|
|
16
|
+
gtag('js', new Date());
|
|
17
|
+
|
|
18
|
+
gtag('config', '${e}');
|
|
19
|
+
`,document.body.appendChild(n),document.body.appendChild(a),n.onload=()=>{t()}}r&&t()}),PE=e=>{if(e){if(!window.gtag){console.error("Google Analytics was not properly initialized");return}window.gtag("event",e.action,{event_category:jt(e.category)?void 0:e.category,event_label:jt(e.label)?void 0:e.label,value:e.value,send_to:jt(e.sendTo)?void 0:e.sendTo})}},OE=async e=>{e?.trackingId&&PE(e)},IE=async e=>{let{url:t,method:r,body:n,headers:a}=e;try{let i=await fetch(t,{method:r,body:r!=="GET"&&n?JSON.stringify(n):void 0,headers:a}),o=i.status,s=await i.json();return JSON.stringify({statusCode:o,data:s})}catch(i){return console.error(i),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}},Re;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let i={};for(let o of a)i[o]=o;return i},e.getValidEnumValues=a=>{let i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(let s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(let o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Re||(Re={}));var Gp;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Gp||(Gp={}));var Q=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wr=e=>{switch(typeof e){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return Number.isNaN(e)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":return Array.isArray(e)?Q.array:e===null?Q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Q.promise:typeof Map<"u"&&e instanceof Map?Q.map:typeof Set<"u"&&e instanceof Set?Q.set:typeof Date<"u"&&e instanceof Date?Q.date:Q.object;default:return Q.unknown}},M=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ar=class Of extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return a(this),n}static assert(t){if(!(t instanceof Of))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ar.create=e=>new ar(e);var NE=(e,t)=>{let r;switch(e.code){case M.invalid_type:e.received===Q.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case M.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case M.invalid_union:r="Invalid input";break;case M.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case M.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case M.invalid_arguments:r="Invalid function arguments";break;case M.invalid_return_type:r="Invalid function return type";break;case M.invalid_date:r="Invalid date";break;case M.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case M.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case M.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case M.custom:r="Invalid input";break;case M.invalid_intersection_types:r="Intersection results could not be merged";break;case M.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case M.not_finite:r="Number must be finite";break;default:r=t.defaultError,Re.assertNever(e)}return{message:r}},ki=NE,AE=ki;function Dc(){return AE}var Mc=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)s=c(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}};function G(e,t){let r=Dc(),n=Mc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ki?void 0:ki].filter(a=>!!a)});e.common.issues.push(n)}var Pt=class If{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return ve;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let i=await a.key,o=await a.value;n.push({key:i,value:o})}return If.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return ve;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}},ve=Object.freeze({status:"aborted"}),ti=e=>({status:"dirty",value:e}),xt=e=>({status:"valid",value:e}),Wp=e=>e.status==="aborted",qp=e=>e.status==="dirty",ya=e=>e.status==="valid",cs=e=>typeof Promise<"u"&&e instanceof Promise,ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ie||(ie={}));var cr=class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Kp=(e,t)=>{if(ya(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ar(e.common.issues);return this._error=r,this._error}}};function ke(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{let{message:s}=e;return i.code==="invalid_enum_value"?{message:s??o.defaultError}:typeof o.data>"u"?{message:s??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:s??r??o.defaultError}},description:a}}var Pe=class{get description(){return this._def.description}_getType(e){return Wr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pt,ctx:{common:e.parent.common,data:e.data,parsedType:Wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(cs(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Kp(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return ya(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>ya(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wr(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(cs(n)?n:Promise.resolve(n));return Kp(r,a)}refine(e,t){let r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:M.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(s=>s?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new Ar({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Cr.create(this,this._def)}nullable(){return Ln.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return va.create(this)}promise(){return _i.create(this,this._def)}or(e){return hs.create([this,e],this._def)}and(e){return gs.create(this,e,this._def)}transform(e){return new Ar({...ke(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ys({...ke(this._def),innerType:this,defaultValue:t,typeName:ye.ZodDefault})}brand(){return new Ff({typeName:ye.ZodBranded,type:this,...ke(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new vs({...ke(this._def),innerType:this,catchValue:t,typeName:ye.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $f.create(this,e)}readonly(){return xs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RE=/^c[^\s-]{8,}$/i,DE=/^[0-9a-z]+$/,ME=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,FE=/^[a-z0-9_-]{21}$/i,$E=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ll,zE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,HE=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZE=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,WE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qE=new RegExp(`^${Nf}$`);function Af(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function KE(e){return new RegExp(`^${Af(e)}$`)}function YE(e){let t=`${Nf}T${Af(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function XE(e,t){return!!((t==="v4"||!t)&&zE.test(e)||(t==="v6"||!t)&&HE.test(e))}function JE(e,t){if(!$E.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function QE(e,t){return!!((t==="v4"||!t)&&VE.test(e)||(t==="v6"||!t)&&ZE.test(e))}var us=class ri extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Q.string){let a=this._getOrReturnCtx(t);return G(a,{code:M.invalid_type,expected:Q.string,received:a.parsedType}),ve}let r=new Pt,n;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),G(n,{code:M.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),G(n,{code:M.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(t,n),i?G(n,{code:M.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&G(n,{code:M.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")jE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"email",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ll||(Ll=new RegExp(BE,"u")),Ll.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"emoji",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")LE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"uuid",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")FE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"nanoid",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")RE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"cuid",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")DE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"cuid2",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")ME.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"ulid",code:M.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),G(n,{validation:"url",code:M.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"regex",code:M.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?YE(a).test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?qE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?KE(a).test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{code:M.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?UE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"duration",code:M.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?XE(t.data,a.version)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"ip",code:M.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?JE(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"jwt",code:M.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?QE(t.data,a.version)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"cidr",code:M.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?GE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"base64",code:M.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?WE.test(t.data)||(n=this._getOrReturnCtx(t,n),G(n,{validation:"base64url",code:M.invalid_string,message:a.message}),r.dirty()):Re.assertNever(a);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:M.invalid_string,...ie.errToObj(n)})}_addCheck(t){return new ri({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ie.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ie.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ie.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ie.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ie.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ie.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ie.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ie.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ie.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ie.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ie.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ie.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ie.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ie.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ie.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ie.errToObj(r)})}nonempty(t){return this.min(1,ie.errToObj(t))}trim(){return new ri({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ri({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ri({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};us.create=e=>new us({checks:[],typeName:ye.ZodString,coerce:e?.coerce??!1,...ke(e)});function eC(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}var Lc=class Fc extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Q.number){let a=this._getOrReturnCtx(t);return G(a,{code:M.invalid_type,expected:Q.number,received:a.parsedType}),ve}let r,n=new Pt;for(let a of this._def.checks)a.kind==="int"?Re.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),G(r,{code:M.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?eC(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),G(r,{code:M.not_finite,message:a.message}),n.dirty()):Re.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,a){return new Fc({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.toString(a)}]})}_addCheck(t){return new Fc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ie.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Re.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Lc.create=e=>new Lc({checks:[],typeName:ye.ZodNumber,coerce:e?.coerce||!1,...ke(e)});var $c=class Uc extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Q.bigint)return this._getInvalidInput(t);let r,n=new Pt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),G(r,{code:M.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):Re.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return G(r,{code:M.invalid_type,expected:Q.bigint,received:r.parsedType}),ve}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,a){return new Uc({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.toString(a)}]})}_addCheck(t){return new Uc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};$c.create=e=>new $c({checks:[],typeName:ye.ZodBigInt,coerce:e?.coerce??!1,...ke(e)});var jc=class extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Q.boolean){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.boolean,received:t.parsedType}),ve}return xt(e.data)}};jc.create=e=>new jc({typeName:ye.ZodBoolean,coerce:e?.coerce||!1,...ke(e)});var Bc=class Rf extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Q.date){let a=this._getOrReturnCtx(t);return G(a,{code:M.invalid_type,expected:Q.date,received:a.parsedType}),ve}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return G(a,{code:M.invalid_date}),ve}let r=new Pt,n;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),G(n,{code:M.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),G(n,{code:M.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Re.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rf({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ie.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ie.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Bc.create=e=>new Bc({checks:[],coerce:e?.coerce||!1,typeName:ye.ZodDate,...ke(e)});var zc=class extends Pe{_parse(e){if(this._getType(e)!==Q.symbol){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.symbol,received:t.parsedType}),ve}return xt(e.data)}};zc.create=e=>new zc({typeName:ye.ZodSymbol,...ke(e)});var ds=class extends Pe{_parse(e){if(this._getType(e)!==Q.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.undefined,received:t.parsedType}),ve}return xt(e.data)}};ds.create=e=>new ds({typeName:ye.ZodUndefined,...ke(e)});var ps=class extends Pe{_parse(e){if(this._getType(e)!==Q.null){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.null,received:t.parsedType}),ve}return xt(e.data)}};ps.create=e=>new ps({typeName:ye.ZodNull,...ke(e)});var Vc=class extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}};Vc.create=e=>new Vc({typeName:ye.ZodAny,...ke(e)});var ga=class extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}};ga.create=e=>new ga({typeName:ye.ZodUnknown,...ke(e)});var tn=class extends Pe{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.never,received:t.parsedType}),ve}};tn.create=e=>new tn({typeName:ye.ZodNever,...ke(e)});var Hc=class extends Pe{_parse(e){if(this._getType(e)!==Q.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.void,received:t.parsedType}),ve}return xt(e.data)}};Hc.create=e=>new Hc({typeName:ye.ZodVoid,...ke(e)});var va=class zo extends Pe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==Q.array)return G(r,{code:M.invalid_type,expected:Q.array,received:r.parsedType}),ve;if(a.exactLength!==null){let o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(G(r,{code:o?M.too_big:M.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(G(r,{code:M.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(G(r,{code:M.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new cr(r,o,r.path,s)))).then(o=>Pt.mergeArray(n,o));let i=[...r.data].map((o,s)=>a.type._parseSync(new cr(r,o,r.path,s)));return Pt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new zo({...this._def,minLength:{value:t,message:ie.toString(r)}})}max(t,r){return new zo({...this._def,maxLength:{value:t,message:ie.toString(r)}})}length(t,r){return new zo({...this._def,exactLength:{value:t,message:ie.toString(r)}})}nonempty(t){return this.min(1,t)}};va.create=(e,t)=>new va({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...ke(t)});function oa(e){if(e instanceof Gt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Cr.create(oa(n))}return new Gt({...e._def,shape:()=>t})}else return e instanceof va?new va({...e._def,type:oa(e.element)}):e instanceof Cr?Cr.create(oa(e.unwrap())):e instanceof Ln?Ln.create(oa(e.unwrap())):e instanceof Mn?Mn.create(e.items.map(t=>oa(t))):e}var Gt=class Ft extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Re.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Q.object){let l=this._getOrReturnCtx(t);return G(l,{code:M.invalid_type,expected:Q.object,received:l.parsedType}),ve}let{status:r,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof tn&&this._def.unknownKeys==="strip"))for(let l in n.data)i.includes(l)||o.push(l);let s=[];for(let l of i){let c=a[l],u=n.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new cr(n,u,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof tn){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of o)s.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(l==="strict")o.length>0&&(G(n,{code:M.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of o){let u=n.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new cr(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of s){let u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>Pt.mergeObjectSync(r,l)):Pt.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return ie.errToObj,new Ft({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ie.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Ft({...this._def,unknownKeys:"strip"})}passthrough(){return new Ft({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ft({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ft({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ft({...this._def,catchall:t})}pick(t){let r={};for(let n of Re.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ft({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Re.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ft({...this._def,shape:()=>r})}deepPartial(){return oa(this)}partial(t){let r={};for(let n of Re.objectKeys(this.shape)){let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new Ft({...this._def,shape:()=>r})}required(t){let r={};for(let n of Re.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Cr;)a=a._def.innerType;r[n]=a}return new Ft({...this._def,shape:()=>r})}keyof(){return Lf(Re.objectKeys(this.shape))}};Gt.create=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strip",catchall:tn.create(),typeName:ye.ZodObject,...ke(t)});Gt.strictCreate=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strict",catchall:tn.create(),typeName:ye.ZodObject,...ke(t)});Gt.lazycreate=(e,t)=>new Gt({shape:e,unknownKeys:"strip",catchall:tn.create(),typeName:ye.ZodObject,...ke(t)});var hs=class extends Pe{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new ar(o.ctx.common.issues));return G(t,{code:M.invalid_union,unionErrors:i}),ve}if(t.common.async)return Promise.all(r.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let s of r){let l={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(s=>new ar(s));return G(t,{code:M.invalid_union,unionErrors:o}),ve}}get options(){return this._def.options}};hs.create=(e,t)=>new hs({options:e,typeName:ye.ZodUnion,...ke(t)});var Hr=e=>e instanceof ms?Hr(e.schema):e instanceof Ar?Hr(e.innerType()):e instanceof fs?[e.value]:e instanceof el?e.options:e instanceof bs?Re.objectValues(e.enum):e instanceof ys?Hr(e._def.innerType):e instanceof ds?[void 0]:e instanceof ps?[null]:e instanceof Cr?[void 0,...Hr(e.unwrap())]:e instanceof Ln?[null,...Hr(e.unwrap())]:e instanceof Ff||e instanceof xs?Hr(e.unwrap()):e instanceof vs?Hr(e._def.innerType):[],tC=class Df extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.object)return G(r,{code:M.invalid_type,expected:Q.object,received:r.parsedType}),ve;let n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let i of r){let o=Hr(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new Df({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...ke(n)})}};function Zc(e,t){let r=Wr(e),n=Wr(t);if(e===t)return{valid:!0,data:e};if(r===Q.object&&n===Q.object){let a=Re.objectKeys(t),i=Re.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(let s of i){let l=Zc(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===Q.array&&n===Q.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let i=0;i<e.length;i++){let o=e[i],s=t[i],l=Zc(o,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return r===Q.date&&n===Q.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var gs=class extends Pe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(Wp(a)||Wp(i))return ve;let o=Zc(a.value,i.value);return o.valid?((qp(a)||qp(i))&&t.dirty(),{status:t.value,value:o.data}):(G(r,{code:M.invalid_intersection_types}),ve)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};gs.create=(e,t,r)=>new gs({left:e,right:t,typeName:ye.ZodIntersection,...ke(r)});var Mn=class Mf extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.array)return G(n,{code:M.invalid_type,expected:Q.array,received:n.parsedType}),ve;if(n.data.length<this._def.items.length)return G(n,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let s=this._def.items[o]||this._def.rest;return s?s._parse(new cr(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Pt.mergeArray(r,i)):Pt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Mf({...this._def,rest:t})}};Mn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Mn({items:e,typeName:ye.ZodTuple,rest:null,...ke(t)})};var rC=class Gc extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.object)return G(n,{code:M.invalid_type,expected:Q.object,received:n.parsedType}),ve;let a=[],i=this._def.keyType,o=this._def.valueType;for(let s in n.data)a.push({key:i._parse(new cr(n,s,n.path,s)),value:o._parse(new cr(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Pt.mergeObjectAsync(r,a):Pt.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pe?new Gc({keyType:t,valueType:r,typeName:ye.ZodRecord,...ke(n)}):new Gc({keyType:us.create(),valueType:t,typeName:ye.ZodRecord,...ke(r)})}},Wc=class extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.map)return G(r,{code:M.invalid_type,expected:Q.map,received:r.parsedType}),ve;let n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,s],l)=>({key:n._parse(new cr(r,o,r.path,[l,"key"])),value:a._parse(new cr(r,s,r.path,[l,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let s of i){let l=await s.key,c=await s.value;if(l.status==="aborted"||c.status==="aborted")return ve;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let s of i){let l=s.key,c=s.value;if(l.status==="aborted"||c.status==="aborted")return ve;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}}}};Wc.create=(e,t,r)=>new Wc({valueType:t,keyType:e,typeName:ye.ZodMap,...ke(r)});var qc=class Kc extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.set)return G(n,{code:M.invalid_type,expected:Q.set,received:n.parsedType}),ve;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(G(n,{code:M.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(G(n,{code:M.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let i=this._def.valueType;function o(l){let c=new Set;for(let u of l){if(u.status==="aborted")return ve;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((l,c)=>i._parse(new cr(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new Kc({...this._def,minSize:{value:t,message:ie.toString(r)}})}max(t,r){return new Kc({...this._def,maxSize:{value:t,message:ie.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};qc.create=(e,t)=>new qc({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...ke(t)});var nC=class Vo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.function)return G(r,{code:M.invalid_type,expected:Q.function,received:r.parsedType}),ve;function n(s,l){return Mc({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dc(),ki].filter(c=>!!c),issueData:{code:M.invalid_arguments,argumentsError:l}})}function a(s,l){return Mc({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Dc(),ki].filter(c=>!!c),issueData:{code:M.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof _i){let s=this;return xt(async function(...l){let c=new ar([]),u=await s._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(n(l,p)),c}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(a(d,p)),c})})}else{let s=this;return xt(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new ar([n(l,c.error)]);let u=Reflect.apply(o,this,c.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new ar([a(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vo({...this._def,args:Mn.create(t).rest(ga.create())})}returns(t){return new Vo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Vo({args:t||Mn.create([]).rest(ga.create()),returns:r||ga.create(),typeName:ye.ZodFunction,...ke(n)})}},ms=class extends Pe{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};ms.create=(e,t)=>new ms({getter:e,typeName:ye.ZodLazy,...ke(t)});var fs=class extends Pe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:M.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:e.data}}get value(){return this._def.value}};fs.create=(e,t)=>new fs({value:e,typeName:ye.ZodLiteral,...ke(t)});function Lf(e,t){return new el({values:e,typeName:ye.ZodEnum,...ke(t)})}var el=class Yc extends Pe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return G(r,{expected:Re.joinValues(n),received:r.parsedType,code:M.invalid_type}),ve}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return G(r,{received:r.data,code:M.invalid_enum_value,options:n}),ve}return xt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Yc.create(t,{...this._def,...r})}exclude(t,r=this._def){return Yc.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};el.create=Lf;var bs=class extends Pe{_parse(e){let t=Re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Q.string&&r.parsedType!==Q.number){let n=Re.objectValues(t);return G(r,{expected:Re.joinValues(n),received:r.parsedType,code:M.invalid_type}),ve}if(this._cache||(this._cache=new Set(Re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=Re.objectValues(t);return G(r,{received:r.data,code:M.invalid_enum_value,options:n}),ve}return xt(e.data)}get enum(){return this._def.values}};bs.create=(e,t)=>new bs({values:e,typeName:ye.ZodNativeEnum,...ke(t)});var _i=class extends Pe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Q.promise&&t.common.async===!1)return G(t,{code:M.invalid_type,expected:Q.promise,received:t.parsedType}),ve;let r=t.parsedType===Q.promise?t.data:Promise.resolve(t.data);return xt(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};_i.create=(e,t)=>new _i({type:e,typeName:ye.ZodPromise,...ke(t)});var Ar=class extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{G(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return ve;let s=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return s.status==="aborted"?ve:s.status==="dirty"||t.value==="dirty"?ti(s.value):s});{if(t.value==="aborted")return ve;let o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?ve:o.status==="dirty"||t.value==="dirty"?ti(o.value):o}}if(n.type==="refinement"){let i=o=>{let s=n.refinement(o,a);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ve:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?ve:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ya(i))return ve;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ya(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):ve);Re.assertNever(n)}};Ar.create=(e,t,r)=>new Ar({schema:e,typeName:ye.ZodEffects,effect:t,...ke(r)});Ar.createWithPreprocess=(e,t,r)=>new Ar({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...ke(r)});var Cr=class extends Pe{_parse(e){return this._getType(e)===Q.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Cr.create=(e,t)=>new Cr({innerType:e,typeName:ye.ZodOptional,...ke(t)});var Ln=class extends Pe{_parse(e){return this._getType(e)===Q.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ln.create=(e,t)=>new Ln({innerType:e,typeName:ye.ZodNullable,...ke(t)});var ys=class extends Pe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===Q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ys.create=(e,t)=>new ys({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ke(t)});var vs=class extends Pe{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return cs(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ar(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ar(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};vs.create=(e,t)=>new vs({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ke(t)});var Xc=class extends Pe{_parse(e){if(this._getType(e)!==Q.nan){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:Q.nan,received:t.parsedType}),ve}return{status:"valid",value:e.data}}};Xc.create=e=>new Xc({typeName:ye.ZodNaN,...ke(e)});var Ff=class extends Pe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},$f=class Uf extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),ti(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new Uf({in:t,out:r,typeName:ye.ZodPipeline})}},xs=class extends Pe{_parse(e){let t=this._def.innerType._parse(e),r=n=>(ya(n)&&(n.value=Object.freeze(n.value)),n);return cs(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};xs.create=(e,t)=>new xs({innerType:e,typeName:ye.ZodReadonly,...ke(t)});var rA={object:Gt.lazycreate},ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ye||(ye={}));var nA=us.create,aA=Lc.create,iA=Xc.create,oA=$c.create,sA=jc.create,lA=Bc.create,cA=zc.create,uA=ds.create,dA=ps.create,pA=Vc.create,hA=ga.create,gA=tn.create,mA=Hc.create,fA=va.create,bA=Gt.create,yA=Gt.strictCreate,vA=hs.create,xA=tC.create,wA=gs.create,kA=Mn.create,_A=rC.create,TA=Wc.create,SA=qc.create,EA=nC.create,CA=ms.create,PA=fs.create,OA=el.create,IA=bs.create,NA=_i.create,AA=Ar.create,RA=Cr.create,DA=Ln.create,MA=Ar.createWithPreprocess,LA=$f.create,FA=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"),Ti={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Si={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Ei={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Ci={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Pi={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},aC=[Ti,Si,Ei,Ci,Pi],$A={[Ti.code]:Ti,[Si.code]:Si,[Ei.code]:Ei,[Ci.code]:Ci,[Pi.code]:Pi},UA={[Ti.name]:Ti.code,[Si.name]:Si.code,[Ei.name]:Ei.code,[Ci.name]:Ci.code,[Pi.name]:Pi.code},jA=aC.map(e=>e.code),iC={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},oC={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},sC={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},lC={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},cC={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},uC={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},dC={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},pC={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},hC={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},gC={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},mC={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},fC={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},bC={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},yC={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},vC={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},xC={code:"k",name:"file",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string"||!("mimeType"in e)||typeof e.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}},Wu=[iC,oC,sC,lC,cC,uC,dC,pC,hC,gC,mC,fC,bC,yC,vC,xC],wC=Object.fromEntries(Wu.map(e=>[e.code,e])),BA=Object.fromEntries(Wu.map(e=>[e.name,e.code])),kC=Wu.map(e=>e.code),_C=e=>{let t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!kC.includes(r))throw new Error(`Failed to parse stream string. Invalid code ${r}.`);let n=r,a=e.slice(t+1),i=JSON.parse(a);return wC[n].parse(i)},TC=10;function SC(e,t){let r=new Uint8Array(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return e.length=0,r}async function EC({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:n,onRedactedReasoningPart:a,onSourcePart:i,onFilePart:o,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:c,onToolCallDeltaPart:u,onToolCallPart:d,onToolResultPart:p,onMessageAnnotationsPart:h,onFinishMessagePart:y,onFinishStepPart:m,onStartStepPart:v}){let w=e.getReader(),b=new TextDecoder,x=[],f=0;for(;;){let{value:k}=await w.read();if(k&&(x.push(k),f+=k.length,k[k.length-1]!==TC))continue;if(x.length===0)break;let _=SC(x,f);f=0;let C=b.decode(_,{stream:!0}).split(`
|
|
20
|
+
`).filter(P=>P!=="").map(_C);for(let{type:P,value:I}of C)switch(P){case"text":await t?.(I);break;case"reasoning":await r?.(I);break;case"reasoning_signature":await n?.(I);break;case"redacted_reasoning":await a?.(I);break;case"file":await o?.(I);break;case"source":await i?.(I);break;case"data":await s?.(I);break;case"error":await l?.(I);break;case"message_annotations":await h?.(I);break;case"tool_call_streaming_start":await c?.(I);break;case"tool_call_delta":await u?.(I);break;case"tool_call":await d?.(I);break;case"tool_result":await p?.(I);break;case"finish_message":await y?.(I);break;case"finish_step":await m?.(I);break;case"start_step":await v?.(I);break;default:{let L=P;throw new Error(`Unknown stream part type: ${L}`)}}}}var tl=async({err:e,context:t})=>{try{return typeof e=="string"?{context:t,description:e,details:void 0}:e instanceof Error?"response"in e&&typeof e.response=="object"&&e.response&&"text"in e.response&&typeof e.response.text=="function"?{context:t,description:e.message,details:JSON.stringify(await e.response.text())}:{context:t,description:e.message,details:typeof e.cause=="string"?e.cause:JSON.stringify(e.cause)}:{context:t,description:JSON.stringify(e)}}catch{return{context:t,description:"Erro desconhecido (falha na an\xE1lise)"}}},No=null,CC=3,PC=1,jf=e=>async({messages:t,onMessageStream:r,onError:n})=>{try{No=new AbortController;let a=e.apiHost,i=await fetch((ot(a)?a:Pr())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:No.signal});if(!i.ok)return(e.retryAttempt??0)<PC&&(i.status===403||i.status===500||i.status===503)?(await new Promise(l=>setTimeout(l,CC*1e3)),jf({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:r})):{error:{description:"Falha ao buscar o streaming do chat",details:await i.text(),context:"Durante o streaming do chat"}};if(!i.body)return{error:{description:"O corpo da resposta do fluxo do chat est\xE1 vazio"}};let o="",s=qt();return await EC({stream:i.body,onTextPart:async l=>{o+=l,r&&r({id:s,message:o})},onErrorPart:l=>{n?.(JSON.parse(l))}}),No=null,{message:o}}catch(a){return console.error(a),a.name==="AbortError"?(No=null,{error:{description:"Solicita\xE7\xE3o anulada"}}):{error:await tl({err:a,context:"Durante o streaming do chat"})}}},OC=e=>{let t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)
|
|
21
|
+
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
|
22
|
+
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
|
23
|
+
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
|
24
|
+
n.queue=[];t=b.createElement(e);t.async=!0;
|
|
25
|
+
t.src=v;s=b.getElementsByTagName(e)[0];
|
|
26
|
+
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|
27
|
+
'https://connect.facebook.net/en_US/fbevents.js');
|
|
28
|
+
${e.map(r=>`fbq('init', '${r}');`).join(`
|
|
29
|
+
`)}
|
|
30
|
+
fbq('track', 'PageView');`,document.head.appendChild(t)},IC=e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq){console.error("Facebook Pixel was not properly initialized");return}let t=e.params?.length?e.params.reduce((r,n)=>!n.key||!n.value?r:{...r,[n.key]:n.value},{}):void 0;if(e.eventType==="Custom"){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)},NC=async e=>{jt(e?.pixelId)||IC(e)},AC=({url:e,isNewTab:t}={})=>{if(e&&!window.open(e,t?"_blank":"_top"))return{blockedPopupUrl:e}},Bf=Object.getPrototypeOf(async()=>{}).constructor,RC=async({content:e,args:t})=>{try{let r=await Bf(...t.map(n=>n.id),DC(e))(...t.map(n=>n.value));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(r){return console.log(r),{logs:[await tl({err:r,context:"Durante a execu\xE7\xE3o do script"})]}}},DC=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),Jc=async({args:e,content:t})=>{try{let r=await Bf(...Object.keys(e),t)(...Object.keys(e).map(n=>e[n]));if(r&&typeof r=="string")return{scriptCallbackMessage:r}}catch(r){console.warn("Script erro:",r)}},Yp=e=>{if(Vt(e))return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return console.warn("Falha ao converter o valor da vari\xE1vel em string com seguran\xE7a",e),null}},MC=Object.getPrototypeOf(async()=>{}).constructor,LC=async({content:e,args:t,isCode:r})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};let n=await MC(...t.map(a=>a.id),e.includes("return ")?e:`return ${e}`)(...t.map(a=>a.value));return{replyToSend:Yp(n)??void 0}}catch(n){return console.error(n),{replyToSend:Yp(e)??void 0,logs:r?[await tl({err:n,context:"Ao executar a vari\xE1vel definida"})]:void 0}}},FC=async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,e*1e3))},$C="partykit.makebot.it",UC=e=>e??An("NEXT_PUBLIC_PARTYKIT_HOST")??$C;(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
|
|
31
|
+
PartySocket requires a global 'EventTarget' class to be available!
|
|
32
|
+
You can polyfill this global by adding this to your code before any partysocket imports:
|
|
33
|
+
|
|
34
|
+
\`\`\`
|
|
35
|
+
import 'partysocket/event-target-polyfill';
|
|
36
|
+
\`\`\`
|
|
37
|
+
Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
|
|
38
|
+
`);var zf=class extends Event{message;error;constructor(e,t){super("error",t),this.message=e.message,this.error=e}},Vf=class extends Event{code;reason;wasClean=!0;constructor(e=1e3,t="",r){super("close",r),this.code=e,this.reason=t}},Fl={Event,ErrorEvent:zf,CloseEvent:Vf};function jC(e,t){if(!e)throw new Error(t)}function BC(e){return new e.constructor(e.type,e)}function zC(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new Vf(e.code||1999,e.reason||"unknown reason",e):"error"in e?new zf(e.error,e):new Event(e.type,e)}var VC=typeof process<"u"&&typeof process.versions?.node<"u",HC=typeof navigator<"u"&&navigator.product==="ReactNative",Ao=VC||HC?zC:BC,xn={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:Number.POSITIVE_INFINITY,maxEnqueuedMessages:Number.POSITIVE_INFINITY,startClosed:!1,debug:!1},Xp=!1,ZC=class Sn extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType="blob";_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,r,n={}){super(),this._url=t,this._protocols=r,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Sn.CONNECTING}get OPEN(){return Sn.OPEN}get CLOSING(){return Sn.CLOSING}get CLOSED(){return Sn.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((t,r)=>(typeof r=="string"?t+=r.length:r instanceof Blob?t+=r.size:t+=r.byteLength,t),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Sn.CLOSED:Sn.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,r){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,r)}reconnect(t,r){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,r),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{let{maxEnqueuedMessages:r=xn.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){let{reconnectionDelayGrowFactor:t=xn.reconnectionDelayGrowFactor,minReconnectionDelay:r=xn.minReconnectionDelay,maxReconnectionDelay:n=xn.maxReconnectionDelay}=this._options,a=0;return this._retryCount>0&&(a=r*t**(this._retryCount-1),a>n&&(a=n)),this._debug("next delay",a),a}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_getNextProtocols(t){if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(typeof t=="function"){let r=t();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(t){if(typeof t=="string")return Promise.resolve(t);if(typeof t=="function"){let r=t();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:t=xn.maxRetries,connectionTimeout:r=xn.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t),this._connectLock=!1;return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([n,a])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Xp&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
|
|
39
|
+
|
|
40
|
+
For example, if you're using node.js, run \`npm install ws\`, and then in your code:
|
|
41
|
+
|
|
42
|
+
import PartySocket from 'partysocket';
|
|
43
|
+
import WS from 'ws';
|
|
44
|
+
|
|
45
|
+
const partysocket = new PartySocket({
|
|
46
|
+
host: "127.0.0.1:1999",
|
|
47
|
+
room: "test-room",
|
|
48
|
+
WebSocket: WS
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
`),Xp=!0);let i=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:a}),this._ws=a?new i(n,a):new i(n),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r)}).catch(n=>{this._connectLock=!1,this._handleError(new Fl.ErrorEvent(Error(n.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Fl.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{(this._ws.readyState===this.OPEN||this._ws.readyState===this.CONNECTING)&&this._ws.close(t,r),this._handleClose(new Fl.CloseEvent(t,r,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");let{minUptime:r=xn.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),jC(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(n=>{this._ws?.send(n)}),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Ao(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Ao(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Ao(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Ao(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}},GC=e=>e[1]!==null&&e[1]!==void 0;function WC(){if(crypto?.randomUUID)return crypto.randomUUID();let e=Date.now(),t=performance?.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function Hf(e,t,r={}){let{host:n,path:a,protocol:i,room:o,party:s,basePath:l,prefix:c,query:u}=e,d=n.replace(/^(http|https|ws|wss):\/\//,"");if(d.endsWith("/")&&(d=d.slice(0,-1)),a?.startsWith("/"))throw new Error("path must not start with a slash");let p=s??"main",h=a?`/${a}`:"",y=i||(d.startsWith("localhost:")||d.startsWith("127.0.0.1:")||d.startsWith("192.168.")||d.startsWith("10.")||d.startsWith("172.")&&d.split(".")[1]>="16"&&d.split(".")[1]<="31"||d.startsWith("[::ffff:7f00:1]:")?t:`${t}s`),m=`${y}://${d}/${l||`${c||"parties"}/${p}/${o}`}${h}`,v=(b={})=>`${m}?${new URLSearchParams([...Object.entries(r),...Object.entries(b).filter(GC)])}`,w=typeof u=="function"?async()=>v(await u()):v(u);return{host:d,path:h,room:o,name:p,protocol:y,partyUrl:m,urlProvider:w}}var qC=class extends ZC{_pk;_pkurl;name;room;host;path;basePath;constructor(e){let t=Jp(e);if(super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t),!e.startClosed&&!this.room&&!this.basePath)throw this.close(),new Error("Either room or basePath must be provided to connect. Use startClosed: true to create a socket and set them via updateProperties before calling reconnect().");e.disableNameValidation||(e.party?.includes("/")&&console.warn(`PartySocket: party name "${e.party}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`),e.room?.includes("/")&&console.warn(`PartySocket: room name "${e.room}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`))}updateProperties(e){let t=Jp({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path,basePath:e.basePath??this.basePath});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:r,name:n,room:a,host:i,path:o,basePath:s}=e;this._pk=t,this._pkurl=r,this.name=n,this.room=a,this.host=i,this.path=o,this.basePath=s}reconnect(e,t){if(!this.host)throw new Error("The host must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");if(!this.room&&!this.basePath)throw new Error("The room (or basePath) must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let r=Hf(e,"http"),n=typeof r.urlProvider=="string"?r.urlProvider:await r.urlProvider();return(e.fetch??fetch)(n,t)}};function Jp(e){let{id:t,host:r,path:n,party:a,room:i,protocol:o,query:s,protocols:l,...c}=e,u=t||WC(),d=Hf(e,"ws",{_pk:u});return{_pk:u,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,basePath:e.basePath,protocols:l,socketOptions:c,urlProvider:d.urlProvider}}var KC=({sessionId:e,resultId:t,context:r})=>{let n=new qC({host:UC(r.wsHost),room:YC({sessionId:e,resultId:t})});return new Promise(a=>{n.addEventListener("message",i=>{n.close(),a({replyToSend:i.data})}),n.addEventListener("error",i=>{a({logs:[{status:"error",description:"Websocket retornou um erro",details:JSON.stringify(i,null,2)}],replyToSend:void 0})})})},YC=({sessionId:e,resultId:t})=>{if(t)return`${t}/webhooks`;let[r,n]=e.split("-");return`${n}/${r}/webhooks`},XC=e=>{if(document.getElementById("gtm-noscript"))return"";let t=document.createElement("noscript");t.id="gtm-noscript";let r=document.createElement("iframe");return r.src=`https://www.googletagmanager.com/ns.html?id=${e}`,r.height="0",r.width="0",r.style.display="none",r.style.visibility="hidden",t.appendChild(r),t},JC=async e=>{let t=e.customHeadCode;ot(t)&&Jy(t);let r=e.gtmId;ot(r)&&document.body.prepend(XC(r));let n=e.googleAnalyticsId;ot(n)&&await CE(n);let a=e.pixelIds;Se(a)&&OC(a)},QC=async({clientSideAction:e,context:t,onMessageStream:r,onStreamError:n})=>{if("googleAnalytics"in e)return OE(e.googleAnalytics);if("scriptToExecute"in e)return RC(e.scriptToExecute);if("redirect"in e)return AC(e.redirect);if("wait"in e)return await FC(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return LC(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){let{error:a,message:i}=await jf(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:r,onError:n});return a?{replyToSend:void 0,logs:[{status:"error",description:"O streaming de mensagens retornou um erro",details:JSON.stringify(a,null,2)}]}:{replyToSend:i}}if("httpRequestToExecute"in e)return{replyToSend:await IE(e.httpRequestToExecute)};if("startPropsToInject"in e)return JC(e.startPropsToInject);if("pixel"in e)return NC(e.pixel);if("codeToExecute"in e)return Jc(e.codeToExecute);if(e.type==="listenForWebhook")return KC({sessionId:t.sessionId,resultId:t.resultId,context:t})},e3=e=>e.type==="text"?e.label??e.value:e.url,t3=(e,{storage:t,makebotId:r})=>{if(e.length===0)return[];if("version"in e[0])return e;let n=Hs(t),a=o3({storage:n,makebotId:r});return e.map((i,o)=>({version:"2",messages:i.messages,clientSideActions:o===e.length-1?a3({storage:n,makebotId:r}):[],input:n3({input:i.input,storage:n,makebotId:r,chunkIndex:o}),streamingMessage:i.streamingMessageId?r3({streamingMessageId:i.streamingMessageId,storage:n}):void 0,dynamicTheme:i3({chunkIndex:o,avatarsHistory:a})}))},r3=({streamingMessageId:e,storage:t})=>{let r=`makebot-streaming-message-${e}`,n=t.getItem(r)??void 0,a=n?JSON.parse(n):void 0;return t.removeItem(r),a},n3=({input:e,storage:t,makebotId:r,chunkIndex:n})=>{if(!e)return e;let a=`makebot-${r}-input-${n}`,i=t.getItem(a)??void 0,o=i?JSON.parse(i):void 0;return t.removeItem(a),{...e,answer:o}},a3=({storage:e,makebotId:t})=>{let r=`makebot-${t}-clientSideActions`,n=e.getItem(r);if(e.removeItem(r),n)return JSON.parse(n)},i3=({chunkIndex:e,avatarsHistory:t})=>{let r=t.filter(n=>n.chunkIndex===e);if(r.length>0)return{hostAvatarUrl:r.find(n=>n.role==="host")?.avatarUrl,guestAvatarUrl:r.find(n=>n.role==="guest")?.avatarUrl}},o3=({storage:e,makebotId:t})=>{let r=`makebot-${t}-avatarsHistory`,n=e.getItem(r);return e.removeItem(r),n?JSON.parse(n):[]},Fr="Enviar",s3="Ver opcoes",l3=E('<input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input"type=text>'),io=e=>{let[t,r]=Rt(e,["ref","onInput","inputmode"]);return(()=>{var n=l3();n.$$input=i=>t.onInput(i.currentTarget.value);var a=e.ref;return typeof a=="function"?Ve(a,n):e.ref=n,Ke(n,De({get inputmode(){return t.inputmode}},r),!1,!1),n})()};at(["input"]);var c3=E('<div class="sticky bottom-0 bg-input-bg border-t border-input-border z-10 w-full"><div class="w-full max-w-chat-container mx-auto flex gap-2 @xs:px-5 px-3 py-3"><div class=flex-1></div><button class="px-4 py-2 bg-button-primary text-button-primary-text rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-button-primary-hover transition-colors">'),u3=e=>{let[t,r]=N(""),n;Ye(()=>{let u=e.currentInputBlock?.id,d=e.defaultValue??"";r(d)});let a=()=>{let u=t().trim();u&&(e.currentInputBlock?e.onSubmit({type:"text",value:u,blockId:e.currentInputBlock.id}):e.onSubmit({type:"text",value:u}),r(""))},i=u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),a())},o=()=>{if(e.currentInputBlock){let u=e.currentInputBlock.options;return u?.labels?.placeholder??u?.placeholder??"Digite sua resposta..."}return"Digite sua mensagem..."},s=()=>e.currentInputBlock?.options?.labels?.button??"Enviar",l=()=>{switch(e.currentInputBlock?.type){case"email input":return"email";case"url input":return"url";case"phone number input":return"tel";default:return"text"}},c=()=>{switch(e.currentInputBlock?.type){case"number input":return"decimal";case"phone number input":return"tel";case"email input":return"email";case"url input":return"url";default:return}};return(()=>{var u=c3(),d=u.firstChild,p=d.firstChild,h=p.nextSibling;return T(p,g(io,{ref(y){var m=n;typeof m=="function"?m(y):n=y},get value(){return t()},onInput:y=>r(y),onKeyPress:i,get placeholder(){return o()},get disabled(){return e.isDisabled},get type(){return l()},get inputmode(){return c()},class:"w-full bg-input-bg text-input-text border border-input-border rounded-lg px-3 py-2"})),h.$$click=a,T(h,s),U(()=>h.disabled=!t().trim()||e.isDisabled),u})()};at(["click"]);var d3=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,p3=/CrOS/,h3=/android|ipad|playbook|silk/i,ur=e=>{let t=navigator.userAgent,r=d3.test(t)&&!p3.test(t)||!!e?.includeTablet&&h3.test(t);return!r&&e?.includeTablet&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r},g3=E('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),m3=E('<div class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),f3=E('<h2 class="px-4 font-semibold">'),b3=E("<p class=px-4>"),y3=E('<span class="flex items-center gap-2">'),v3=E("<span class=relative>"),x3=E('<svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd>'),w3=E('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),k3=E('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),_3=e=>{let t,r=e.options,n=r?.areInitialSearchButtonsVisible??!0,[a,i]=N(r?.isSearchable&&!n?[]:e.defaultItems),[o,s]=N({}),[l,c]=N(!1);$e(()=>{!ur()&&t&&t.focus({preventScroll:!0})});let u=p=>{if(l()){console.log("\u{1F50D} Button click ignorado - fluxo j\xE1 foi executado");return}let h=a()[p],{value:y,content:m}=h,v=`${p}`;s(w=>({...w,[v]:!0})),console.log("\u{1F50D} Button clicado - continuando fluxo"),e.onSubmit({type:"text",value:y||m||"",label:y?m:void 0}),c(!0),console.log("\u{1F50D} Fluxo executado - desabilitando outros bot\xF5es")},d=p=>{if(p===""||p.trim().length===0){i(n?e.defaultItems:[]);return}i(e.defaultItems.filter(h=>h.content?.toLowerCase().includes(p.toLowerCase())))};return(()=>{var p=m3(),h=p.firstChild,y=h.firstChild,m=y.firstChild,v=y.nextSibling;return T(h,g(X,{get when(){return r?.imageUrl},get children(){var w=g3();return U(()=>de(w,"src",r?.imageUrl)),w}}),y),T(m,g(X,{get when(){return r?.title},children:w=>(()=>{var b=f3();return T(b,w),b})()}),null),T(m,g(X,{get when(){return r?.description},children:w=>(()=>{var b=b3();return T(b,w),b})()}),null),T(v,g(Je,{get each(){return a()},children:(w,b)=>(()=>{var x=v3();return T(x,g(nr,{"on:click":()=>u(b()),get"data-itemid"(){return w.id},variant:"secondary",get class(){return ae("w-full font-normal text-sm border-host-bubble-border rounded-none",b()===0&&"rounded-t-host-bubble border border-b-0",b()!==0&&"border border-b-0",b()===(a().length??1)-1&&"rounded-b-host-bubble border-b",o()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",l()&&!o()[`${b()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm",get isDisabled(){return o()[`${b()}`]||l()&&!o()[`${b()}`]},get children(){var f=y3();return T(f,(()=>{var k=j(()=>!!o()[`${b()}`]);return()=>k()?[x3(),"Enviado"]:[w3(),j(()=>w.content)]})()),f}}),null),T(x,(()=>{var f=j(()=>e.chunkIndex===0&&e.defaultItems.length===1);return()=>f()&&k3()})(),null),x})()})),p})()},T3=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor stroke=currentColor stroke-width=0 stroke-linecap=round stroke-linejoin=round><path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"></path><path d="M6 12h16">'),S3=e=>(()=>{var t=T3();return Ke(t,e,!0,!0),t})(),Xt=e=>{let t=Pf(),[r,n]=Rt(e,["isDisabled","isLoading","disableIcon"]),a=t()==="sm"&&!r.disableIcon||!n.children||typeof n.children=="string"&&jt(n.children);return g(nr,De(n,{type:"submit",get class(){return ae(n.class,"flex items-center")},"aria-label":a?"Enviar":void 0,get children(){return g(lt,{get children(){return[g(se,{when:a,get children(){return g(S3,{get class(){return"send-icon flex w-6 h-6 "+(r.disableIcon?"hidden":"")}})}}),g(se,{when:!a,get children(){return e.children}})]}})}}))},E3={buttonLabel:Fr,imageUrl:"",title:"",description:"",isMultipleChoice:!1,isSearchable:!1,areInitialSearchButtonsVisible:!0},C3=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3px stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'),P3=e=>(()=>{var t=C3();return Ke(t,e,!0,!0),t})(),O3=E("<div>"),Qp=e=>(()=>{var t=O3();return T(t,g(X,{get when(){return e.isChecked},get children(){return g(P3,{})}})),U(()=>ne(t,"w-4 h-4 makebot-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:""))),t})(),I3=E('<img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer">'),N3=E('<form class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"></div></div><div class="px-3 pb-2">'),A3=E('<h2 class="px-4 font-semibold">'),R3=E("<p class=px-4>"),D3=E('<span class="relative w-full @xs:w-auto"><div role=checkbox><div class="flex items-center gap-2"><span>'),M3=E('<span class="relative w-full @xs:w-auto"><div role=checkbox aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable selected border-host-bubble-border rounded-none border border-b-0"><div class="flex items-center gap-2"><span>'),L3=e=>{let t,r=e.options,[n,a]=N(r?.isSearchable&&!r?.areInitialSearchButtonsVisible?[]:e.defaultItems),[i,o]=N([]),[s,l]=N({}),[c,u]=N(!1);$e(()=>{!ur()&&t&&t.focus({preventScroll:!0})});let d=m=>{p(m)},p=m=>{let v=i().indexOf(m);o(v!==-1?w=>w.filter(b=>b!==m):w=>[...w,m])},h=()=>{if(c()){console.log("\u{1F50D} Multiple choice submit ignorado - fluxo j\xE1 foi executado");return}let m=i().map(w=>e.defaultItems.find(b=>b.id===w)),v=m.some(w=>w?.value);console.log("\u{1F50D} Multiple choice submit - continuando fluxo"),e.onSubmit({type:"text",value:m.map(w=>w?.value??w?.content).join(", "),label:v?m.map(w=>w?.content??w?.value).join(", "):void 0}),u(!0),console.log("\u{1F50D} Fluxo executado - desabilitando m\xFAltipla escolha")},y=m=>{if(m===""||m.trim().length===0){a(r?.areInitialSearchButtonsVisible?e.defaultItems:[]);return}a(e.defaultItems.filter(v=>v.content?.toLowerCase().includes(m.toLowerCase())))};return(()=>{var m=N3(),v=m.firstChild,w=v.firstChild,b=w.firstChild,x=w.nextSibling;return m.addEventListener("submit",h),T(v,g(X,{get when(){return r?.imageUrl},get children(){var f=I3();return U(()=>de(f,"src",r?.imageUrl)),f}}),w),T(b,g(X,{get when(){return e.options?.title},children:f=>(()=>{var k=A3();return T(k,f),k})()}),null),T(b,g(X,{get when(){return e.options?.description},children:f=>(()=>{var k=R3();return T(k,f),k})()}),null),T(x,g(Je,{get each(){return n()},children:(f,k)=>(()=>{var _=D3(),C=_.firstChild,P=C.firstChild,I=P.firstChild;return sr(C,"click",()=>d(f.id)),T(P,g(Qp,{get isChecked(){return i().some(L=>L===f.id)},class:"flex-shrink-0"}),I),T(I,()=>f.content),U(L=>{var R=i().some(F=>F===f.id),D=ae("w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable border-host-bubble-border rounded-none",k()===0&&"rounded-t-host-bubble border border-b-0",k()!==0&&"border border-b-0",k()===(n().length??1)-1&&"rounded-b-host-bubble border-b",i().some(F=>F===f.id)&&"selected"),V=f.id;return R!==L.e&&de(C,"aria-checked",L.e=R),D!==L.t&&ne(C,L.t=D),V!==L.a&&de(C,"data-itemid",L.a=V),L},{e:void 0,t:void 0,a:void 0}),_})()}),null),T(x,g(Je,{get each(){return i().filter(f=>n().every(k=>k.id!==f))},children:f=>(()=>{var k=M3(),_=k.firstChild,C=_.firstChild,P=C.firstChild;return sr(_,"click",()=>d(f)),de(_,"data-itemid",f),T(C,g(Qp,{isChecked:!0}),P),T(P,()=>e.defaultItems.find(I=>I.id===f)?.content),k})()}),null),T(m,(()=>{var f=j(()=>i().length>0);return()=>f()&&g(Xt,{class:"h-[43px]",get children(){return e.options?.buttonLabel??E3.buttonLabel}})})(),null),m})()},F3=e=>g(jn.Root,e),$3=e=>g(jn.Control,e),U3=e=>g(jn.PrevTrigger,e),j3=e=>g(jn.NextTrigger,e),B3=e=>g(jn.ItemGroup,e),z3=e=>g(jn.Item,e),ea={Root:F3,Control:$3,PrevTrigger:U3,NextTrigger:j3,ItemGroup:B3,Item:z3},V3=E('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m12 19-7-7 7-7"></path><path d="M19 12H5">'),H3=e=>(()=>{var t=V3();return Ke(t,e,!0,!0),t})(),Z3=E('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M5 12h14"></path><path d="m12 5 7 7-7 7">'),G3=e=>(()=>{var t=Z3();return Ke(t,e,!0,!0),t})(),eh=E('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M13 7l5 5m0 0l-5 5m5-5H6">'),W3=E('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">'),q3=E('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">'),K3=E('<svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M15 11a3 3 0 11-6 0 3 3 0 016 0z">'),Y3=E('<div class="flex justify-end mb-2">'),X3=E('<div class="absolute inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-4"><img alt="Imagem ampliada"class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto object-contain">'),J3=E('<div class="flex flex-col gap-4"><img alt="Card image"class="aspect-[16/11] object-cover cursor-pointer"><div class="flex flex-col gap-2">'),Q3=E('<div class="px-3 pb-2">'),e4=E('<h2 class="px-4 font-semibold">'),t4=E("<p class=px-4>"),r4=E('<span class="flex items-center gap-2"><svg class="animate-spin h-4 w-4 text-current"xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"><circle class=opacity-25 cx=12 cy=12 r=10 stroke=currentColor stroke-width=4></circle><path class=opacity-75 fill=currentColor d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),n4=E('<span class="flex items-center gap-2"><svg class="h-4 w-4 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd></path></svg>Enviado'),a4=E('<span class="flex items-center gap-2">'),i4=E("<div>"),o4=e=>{if(console.log("\u{1F50D} convertSubmitContentToMessage - input:",e),!e){console.log("\u{1F50D} convertSubmitContentToMessage - answer \xE9 undefined");return}if(e.type==="text"){let t={type:"text",text:e.value};return console.log("\u{1F50D} convertSubmitContentToMessage - resultado:",t),t}console.log("\u{1F50D} convertSubmitContentToMessage - tipo n\xE3o suportado:",e.type)},s4=e=>{let[t,r]=N({}),[n,a]=N({}),[i,o]=N({}),[s,l]=N(!1),c=b=>{switch(b){case"quick_reply":return eh();case"cta_url":return W3();case"cta_copy":return q3();case"send_location":return K3();default:return eh()}},u=(b,x,f=3e3)=>{r(k=>({...k,[b]:!0})),a(k=>({...k,[b]:x})),setTimeout(()=>{a(k=>{let _={...k};return delete _[b],_}),r(k=>({...k,[b]:!1}))},f)},d=async b=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(b),!0;{let x=document.createElement("textarea");x.value=b,x.style.position="fixed",x.style.left="-999999px",x.style.top="-999999px",document.body.appendChild(x),x.focus(),x.select();let f=document.execCommand("copy");return x.remove(),f}}catch(x){return console.error("Erro ao copiar:",x),!1}},p=async b=>{if(!e.context?.sessionId){console.error("\u274C sessionId n\xE3o encontrado no contexto");return}try{console.log("\u{1F50D} Enviando mensagem diretamente para API:",b);let{data:x,error:f}=await Rc({apiHost:e.context.apiHost??Pr(),sessionId:e.context.sessionId,message:o4(b)});if(f){console.error("\u274C Erro ao enviar mensagem:",f);return}console.log("\u2705 Mensagem enviada com sucesso:",x);let k=new CustomEvent("makebot-api-response",{detail:{sessionId:e.context.sessionId,response:x}});window.dispatchEvent(k),console.log("\u2705 Evento de resposta da API disparado")}catch(x){console.error("\u274C Erro ao enviar mensagem:",x)}},[h,y]=N();console.log("\u{1F50D} CardsCaroussel renderizado:",{blockItems:e.block.items,firstItemPaths:e.block.items[0]?.paths,firstPathType:e.block.items[0]?.paths?.[0]?.type,firstPathConfig:e.block.items[0]?.paths?.[0]?.config}),console.log("\u{1F50D} Detalhes completos dos paths:",JSON.stringify(e.block.items.map(b=>({id:b.id,paths:b.paths?.map(x=>({id:x.id,text:x.text,type:x.type,config:x.config,outgoingEdgeId:x.outgoingEdgeId}))})),null,2));let m=async(b,x,f)=>{if(b.type==="quick_reply"&&s()){console.log("\u{1F50D} Quick reply ignorado - fluxo j\xE1 foi executado");return}switch(o(k=>({...k,[x]:!0})),b.type){case"cta_url":b.config?.url&&window.open(b.config.url,"_blank"),u(x,"Link aberto!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"cta_copy":let k=await d(b.config?.copyValue||"");u(x,k?"Copiado!":"Erro ao copiar"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"));break;case"send_location":"geolocation"in navigator?navigator.geolocation.getCurrentPosition(async C=>{let{latitude:P,longitude:I}=C.coords,L=`${P},${I}`;u(x,"Localiza\xE7\xE3o enviada!"),b.config?.continueFlow!==!1&&!s()&&(e.onSubmit({type:"text",value:b.id,label:b.text}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"))},C=>{console.error("Erro ao obter localiza\xE7\xE3o:",C),u(x,"Erro ao obter localiza\xE7\xE3o",3e3)}):u(x,"Geolocaliza\xE7\xE3o n\xE3o suportada",3e3);break;default:console.log("\u{1F50D} Bot\xE3o quick_reply clicado:",{pathId:b.id,pathText:b.text,outgoingEdgeId:b.outgoingEdgeId,imageUrl:e.block.items[f].imageUrl});let _=b.id;if(!_){console.log("\u{1F50D} Bot\xE3o quick_reply sem ID v\xE1lido - IGNORADO"),u(x,"Bot\xE3o n\xE3o configurado",2e3);return}console.log("\u{1F50D} Bot\xE3o quick_reply clicado - continuando fluxo"),e.onSubmit({type:"text",value:_,label:b.text??""}),l(!0),console.log("\u{1F50D} Fluxo executado - desabilitando quick_reply"),console.log("\u{1F50D} Bot\xE3o quick_reply marcado como clicado:",x);break}},v=Pf(),w=he(()=>c4(e.block.items.length,{containerSize:v()}));return[g(ea.Root,{get slideCount(){return e.block.items.length},get slidesPerPage(){return w()},slidesPerMove:1,spacing:"12px",class:"overflow-visible @xs:-mr-5 -mr-4",get children(){return[(()=>{var b=Y3();return T(b,g(ea.Control,{class:"flex gap-2 @xs:mr-5 mr-4",get children(){return[g(ea.PrevTrigger,{asChild:x=>g(nr,De({variant:"secondary"},x,{get children(){return g(H3,{class:"w-4 h-4"})}}))}),g(ea.NextTrigger,{asChild:x=>g(nr,De({variant:"secondary"},x,{get children(){return g(G3,{class:"w-4 h-4"})}}))})]}})),U(x=>we(b,"display",e.block.items.length>w()?void 0:"none")),b})(),g(ea.ItemGroup,{class:"rounded-l-host-bubble @xs:pr-5 pr-4 p-4",get children(){return g(Ag,{get each(){return e.block.items},children:(b,x)=>g(ea.Item,{index:x,get children(){return g(l4,{class:"h-full",get children(){return[(()=>{var f=J3(),k=f.firstChild,_=k.nextSibling;return k.$$click=()=>y(b().imageUrl??void 0),T(_,g(X,{get when(){return b().title},children:C=>(()=>{var P=e4();return T(P,C),P})()}),null),T(_,g(X,{get when(){return b().description},children:C=>(()=>{var P=t4();return T(P,C),P})()}),null),U(()=>de(k,"src",b().imageUrl??"")),f})(),(()=>{var f=Q3();return T(f,g(Je,{get each(){return b().paths},children:(k,_)=>g(nr,{variant:"secondary",get class(){return wi("w-full font-normal text-sm border-host-bubble-border rounded-none",_()===0&&"rounded-t-host-bubble border border-b-0",_()!==0&&"border border-b-0",_()===(b().paths?.length??1)-1&&"rounded-b-host-bubble border-b",k.type==="quick_reply"&&i()[`${x}-${_()}`]&&"opacity-50 cursor-not-allowed bg-gray-100",k.type==="quick_reply"&&s()&&!i()[`${x}-${_()}`]&&"opacity-50 cursor-not-allowed bg-gray-100 text-gray-500")},size:"sm","on:click":()=>m(k,`${x}-${_()}`,x),get isDisabled(){return t()[`${x}-${_()}`]||k.type==="quick_reply"&&i()[`${x}-${_()}`]||k.type==="quick_reply"&&s()&&!i()[`${x}-${_()}`]},get children(){return j(()=>!!t()[`${x}-${_()}`])()?(()=>{var C=r4(),P=C.firstChild;return T(C,()=>n()[`${x}-${_()}`],null),C})():j(()=>!!(k.type==="quick_reply"&&i()[`${x}-${_()}`]))()?n4():(()=>{var C=a4();return T(C,()=>c(k.type),null),T(C,()=>k.text,null),C})()}})})),f})()]}})}})})}})]}}),g(X,{get when(){return h()},get children(){var b=X3(),x=b.firstChild;return b.$$click=()=>y(void 0),U(()=>de(x,"src",h())),b}})]},l4=e=>(()=>{var t=i4();return T(t,()=>e.children),U(()=>ne(t,wi("makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden",e.class))),t})(),c4=(e,{containerSize:t})=>t==="xs"?e>1?1.2:1:t==="sm"?e>1?1.5:1:t==="md"||t==="lg"?e>2?2.2:e:e>3?3.2:e;at(["click"]);var $l={hasTime:!1,isRange:!1,labels:{button:Fr,from:"From:",to:"To:"},format:"dd/MM/yyyy",formatWithTime:"dd/MM/yyyy HH:mm"},u4=E('<div class="makebot-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input makebot-datetime-input"data-testid=from-date style=min-height:24px;min-width:100px;font-size:16px>'),th=E("<p class=font-semibold>"),d4=E('<div class="flex items-center p-2"><input class="focus:outline-none flex-1 w-full text-input ml-2 makebot-datetime-input"data-testid=to-date style=min-height:24px;min-width:100px;font-size:16px>'),p4=e=>{let[t,r]=N(h4(e.defaultValue??"")),n=()=>{t().from===""&&t().to===""||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})},a=i=>{i.key==="Enter"&&(i.preventDefault(),n())};return(()=>{var i=u4(),o=i.firstChild,s=o.firstChild,l=s.firstChild,c=l.firstChild;return o.addEventListener("submit",u=>{u.preventDefault(),n()}),T(l,(()=>{var u=j(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=th();return T(d,()=>e.options.labels?.from??$l.labels.from),d})()})(),c),c.$$keydown=a,c.addEventListener("change",u=>r({...t(),from:u.currentTarget.value})),T(s,(()=>{var u=j(()=>!!e.options?.isRange);return()=>u()&&(()=>{var d=d4(),p=d.firstChild;return T(d,(()=>{var h=j(()=>!!e.options.isRange);return()=>h()&&(()=>{var y=th();return T(y,()=>e.options.labels?.to??$l.labels.to),y})()})(),p),p.$$keydown=a,p.addEventListener("change",h=>r({...t(),to:h.currentTarget.value})),U(h=>{var y=e.options.hasTime?"datetime-local":"date",m=e.options?.min,v=e.options?.max;return y!==h.e&&de(p,"type",h.e=y),m!==h.t&&de(p,"min",h.t=m),v!==h.a&&de(p,"max",h.a=v),h},{e:void 0,t:void 0,a:void 0}),U(()=>p.value=t().to),d})()})(),null),T(i,g(Xt,{class:"h-[43px]","on:click":n,get children(){return e.options?.labels?.button??$l.labels.button}}),null),U(u=>{var d=ae("flex makebot-input",e.options?.isRange?"items-end":"items-center"),p="flex items-center p-2 "+(e.options?.isRange?"pb-0 gap-2":""),h=e.options?.hasTime?"datetime-local":"date",y=e.options?.min,m=e.options?.max;return d!==u.e&&ne(o,u.e=d),p!==u.t&&ne(l,u.t=p),h!==u.a&&de(c,"type",u.a=h),y!==u.o&&de(c,"min",u.o=y),m!==u.i&&de(c,"max",u.i=m),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),U(()=>c.value=t().from),i})()},h4=e=>{if(!e.includes("to"))return{from:e,to:""};let[t,r]=e.split(" to ");return{from:t,to:r}};at(["keydown"]);var rh={labels:{button:Fr,placeholder:"Digite seu e-mail..."},retryMessageContent:"Este e-mail parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"},g4=E('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),m4=e=>{let[t,r]=N(e.defaultValue??""),n,a=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),o=()=>{i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&o()};$e(()=>{!ur()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),Ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=g4(),u=c.firstChild;return c.$$keydown=s,T(u,g(io,{ref(d){var p=n;typeof p=="function"?p(d):n=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??rh.labels.placeholder},onInput:a,type:"email",autocomplete:"email"})),T(c,g(Xt,{type:"button",class:"h-[42px]","on:click":o,get children(){return e.block.options?.labels?.button??rh.labels.button}}),null),c})()};at(["keydown"]);var Qt={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:`<strong>Escolha uma imagem</strong>
|
|
52
|
+
ou arraste e solte<br>
|
|
53
|
+
(limite de tamanho: 10MB)`,button:"Upload",clear:"Limpar",skip:"Pular",success:{single:"Arquivo enviado",multiple:"{total} arquivos enviados"}}},Zf=({newFile:e,existingFiles:t,params:r,context:n,onError:a})=>{let i=r.sizeLimit??An("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(i&&e.size>Number(i)*1024*1024){a({description:(n.makebot.settings.general?.systemMessages?.fileUploadSizeError??Kr.fileUploadSizeError).replace("[[file]]",e.name).replace("[[limit]]",i)});return}if(t.length===0)return e;let o=e.name,s=1;for(;t.some(l=>l.name===o);){let l=e.name.lastIndexOf("."),c=l!==-1?e.name.slice(l):"";o=`${e.name.slice(0,l)}(${s})${c}`,s++}return new File([e],o,{type:e.type})},ws=async({apiHost:e,files:t,onUploadProgress:r})=>{let n=[],a=[],i=0;for(let{input:o,file:s}of t){r&&r({progress:i/t.length*100,fileIndex:i}),i+=1;let{data:l,error:c}=await Xy({method:"POST",url:`${e}/api/v3/generate-upload-url`,body:{fileName:o.fileName,sessionId:o.sessionId,fileType:s.type,blockId:o.blockId}});if(c){a.push(c.message);continue}if(l?.presignedUrl){let u=new FormData;if(Object.entries(l.formData).forEach(([d,p])=>{u.append(d,p)}),u.append("file",s),!(await fetch(l.presignedUrl,{method:"POST",body:u})).ok)continue;n.push({url:l.fileUrl,type:s.type})}else continue}return a.length>0?{type:"error",error:a.join(", ")}:{type:"success",urls:n}},f4=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),rl=e=>(()=>{var t=f4();return Ke(t,e,!0,!0),t})(),b4=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),Gf=e=>(()=>{var t=b4();return Ke(t,e,!0,!0),t})(),y4=E('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),Wf=e=>{let t=x4(e.file);return(()=>{var r=y4(),n=r.firstChild,a=n.nextSibling,i=a.firstChild,o=i.nextSibling;return T(n,g(Gf,{class:"w-6 h-6"})),T(i,()=>e.file.name),T(o,()=>v4(e.file)),U(()=>ne(n,ae("rounded-md text-white p-2 flex items-center",t==="pink"&&"bg-pink-400",t==="blue"&&"bg-blue-400",t==="green"&&"bg-green-400",t==="gray"&&"bg-gray-400",t==="orange"&&"bg-orange-400"))),r})()},v4=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},x4=e=>{let t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}},w4=E('<img class="rounded-md object-cover w-[58px] h-[58px]">'),k4=E('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity"aria-label="Remover anexo">'),_4=E('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),qf=e=>(()=>{var t=k4(),r=t.firstChild;return T(t,g(lt,{get children(){return[g(se,{get when(){return e.file.type.startsWith("image")},get children(){var n=w4();return U(a=>{var i=URL.createObjectURL(e.file),o=e.file.name;return i!==a.e&&de(n,"src",a.e=i),o!==a.t&&de(n,"alt",a.t=o),a},{e:void 0,t:void 0}),n}}),g(se,{when:!0,get children(){return g(Wf,{get file(){return e.file}})}})]}}),r),sr(r,"click",e.onRemoveClick),T(r,g(rl,{class:"w-4"})),T(t,g(X,{get when(){return j(()=>!!Se(e.uploadProgressPercent))()&&e.uploadProgressPercent!==100},get children(){return g(T4,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),T4=e=>{let[t,r]=N(e.progressPercent??0),n;return Ye(()=>{e.progressPercent===20&&(n=setInterval(()=>{t()<100&&r(a=>a+(Math.floor(Math.random()*10)+1))},1e3))}),Ie(()=>{clearInterval(n)}),(()=>{var a=_4();return T(a,g(Xa.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return g(Xa.Circle,{get children(){return[g(Xa.CircleTrack,{}),g(Xa.CircleRange,{})]}})}})),a})()},S4=E('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full"style="transition:width 150ms cubic-bezier(0.4, 0, 0.2, 1)">'),E4=E('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),C4=E('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),P4=E("<input id=dropzone-file type=file class=hidden>"),O4=E('<div class="flex justify-end">'),I4=E('<div class="flex justify-end"><div class="flex gap-2">'),N4=E('<form class="flex flex-col w-full gap-2"><label for=dropzone-file>'),A4=E('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=text-gray-500><polyline points="16 16 12 12 8 16"></polyline><line x1=12 y1=12 x2=12 y2=21></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),R4=e=>{let[t,r]=N([]),[n,a]=N(!1),[i,o]=N(0),[s,l]=N(!1),c=e.context.makebot.settings.general?.systemMessages?.fileUploadError??Kr.fileUploadError,u=f=>{let k=Array.from(f).map(_=>Zf({existingFiles:t(),newFile:_,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},context:e.context,onError:({description:C})=>Er.create({description:C})})).filter(Se);if(k.length!==0){if(!e.block.options?.isMultipleAllowed)return p(k[0]);r([...t(),...k])}},d=async f=>{f.preventDefault(),t().length!==0&&h(t())},p=async f=>{a(!0);let k=await ws({apiHost:e.context.apiHost??Pr({ignoreChatApiUrl:!0}),files:[{file:f,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:f.name}}]});if(a(!1),k.type==="success"&&k.urls.length&&k.urls[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??Qt.labels.success.single,value:k.urls[0]?nh(k.urls[0].url):"",attachments:[{type:f.type,url:k.urls[0].url,blobUrl:URL.createObjectURL(f)}]});k.type==="error"&&Er.create({description:k.error})},h=async f=>{a(!0);let k=await ws({apiHost:e.context.apiHost??Pr({ignoreChatApiUrl:!0}),files:f.map(_=>({file:_,input:{sessionId:e.context.sessionId,blockId:e.block.id,fileName:_.name}})),onUploadProgress:o});if(a(!1),o(0),k.type==="error")return Er.create({description:k.error});e.onSubmit({type:"text",label:k.urls.length>1?(e.block.options?.labels?.success?.multiple??Qt.labels.success.multiple).replaceAll("{total}",k.urls.length.toString()):e.block.options?.labels?.success?.single??Qt.labels.success.single,value:k.urls.filter(Se).map(({url:_})=>nh(_)).join(", "),attachments:k.urls.map((_,C)=>_?{..._,blobUrl:URL.createObjectURL(t()[C])}:null).filter(Se)})},y=f=>{f.preventDefault(),l(!0)},m=()=>l(!1),v=f=>{f.preventDefault(),f.stopPropagation(),f.dataTransfer?.files&&u(f.dataTransfer.files)},w=()=>r([]),b=()=>e.onSkip(e.block.options?.labels?.skip??Qt.labels.skip),x=f=>{r(k=>k.filter((_,C)=>C!==f))};return(()=>{var f=N4(),k=f.firstChild;return f.addEventListener("submit",d),k.addEventListener("drop",v),k.addEventListener("dragleave",m),k.addEventListener("dragover",y),T(k,g(lt,{get children(){return[g(se,{get when(){return n()},get children(){return g(X,{get when(){return t().length>1},get fallback(){return g(Ef,{})},get children(){var _=S4(),C=_.firstChild;return U(P=>we(C,"width",`${i()>0?i:10}%`)),_}})}}),g(se,{get when(){return!n()},get children(){return[(()=>{var _=C4(),C=_.firstChild;return T(_,g(X,{get when(){return t().length},get fallback(){return g(D4,{})},get children(){var P=E4();return sr(P,"click",I=>{I.preventDefault(),I.stopPropagation()}),T(P,g(Je,{get each(){return t()},children:(I,L)=>g(qf,{file:I,onRemoveClick:()=>x(L())})})),P}}),C),U(()=>C.innerHTML=e.block.options?.labels?.placeholder??Qt.labels.placeholder),_})(),(()=>{var _=P4();return _.addEventListener("change",C=>{C.currentTarget.files&&(u(C.currentTarget.files),C.currentTarget.value="")}),U(C=>{var P=e.block.options?.allowedFileTypes?.isEnabled?e.block.options?.allowedFileTypes?.types?.join(", "):void 0,I=e.block.options?.isMultipleAllowed??Qt.isMultipleAllowed;return P!==C.e&&de(_,"accept",C.e=P),I!==C.t&&(_.multiple=C.t=I),C},{e:void 0,t:void 0}),_})()]}})]}})),T(f,g(X,{get when(){return j(()=>t().length===0)()&&e.block.options?.isRequired===!1},get children(){var _=O4();return T(_,g(nr,{"on:click":b,get children(){return e.block.options?.labels?.skip??Qt.labels.skip}})),_}}),null),T(f,g(X,{get when(){return j(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!n()},get children(){var _=I4(),C=_.firstChild;return T(C,g(X,{get when(){return t().length},get children(){return g(nr,{variant:"secondary","on:click":w,get children(){return e.block.options?.labels?.clear??Qt.labels.clear}})}}),null),T(C,g(Xt,{type:"submit",disableIcon:!0,get children(){return j(()=>(e.block.options?.labels?.button??Qt.labels.button)===Qt.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),_}}),null),U(()=>ne(k,"makebot-upload-input py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8 "+(s()?"dragging-over":""))),f})()},D4=()=>A4(),nh=e=>{let t=e.split("/").pop();if(!t)return e;let r=encodeURIComponent(t);return e.replace(t,r)},qu=e=>g(ia.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,get onOpenChange(){return e.onClose},get children(){return g(Dg,{get mount(){return Lg()()},get children(){return[g(ia.Backdrop,{class:"absolute inset-0 bg-[rgba(0,0,0,0.8)] h-screen z-50"}),g(ia.Positioner,{class:"absolute inset-0 z-50 flex items-center justify-center px-2",get children(){return[g(ia.Content,{class:"focus:outline-none",get children(){return e.children}}),g(ia.CloseTrigger,{class:"fixed top-4 right-4 z-50 rounded-md bg-[#202020] p-2 text-white",get children(){return g(rl,{class:"w-6 h-6"})}})]}})]}})}}),M4="Op\xE7\xF5es",L4={buttonLabel:s3,title:"",description:"",footer:"",sectionTitle:M4},Ae;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let i={};for(let o of a)i[o]=o;return i},e.getValidEnumValues=a=>{let i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(let s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(let o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Ae||(Ae={}));var Qc;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Qc||(Qc={}));var Y=Ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yr=e=>{switch(typeof e){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return isNaN(e)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(e)?Y.array:e===null?Y.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Y.promise:typeof Map<"u"&&e instanceof Map?Y.map:typeof Set<"u"&&e instanceof Set?Y.set:typeof Date<"u"&&e instanceof Date?Y.date:Y.object;default:return Y.unknown}},$=Ae.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),F4=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),zt=class Kf extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return a(this),n}static assert(t){if(!(t instanceof Kf))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};zt.create=e=>new zt(e);var xa=(e,t)=>{let r;switch(e.code){case $.invalid_type:e.received===Y.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ae.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ae.joinValues(e.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ae.joinValues(e.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${Ae.joinValues(e.options)}, received '${e.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ae.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case $.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case $.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ae.assertNever(e)}return{message:r}},Yf=xa;function $4(e){Yf=e}function ks(){return Yf}var _s=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)s=c(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},U4=[];function W(e,t){let r=ks(),n=_s({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xa?void 0:xa].filter(a=>!!a)});e.common.issues.push(n)}var wt=class Xf{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return xe;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let i=await a.key,o=await a.value;n.push({key:i,value:o})}return Xf.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return xe;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}},xe=Object.freeze({status:"aborted"}),Ts=e=>({status:"dirty",value:e}),mt=e=>({status:"valid",value:e}),eu=e=>e.status==="aborted",tu=e=>e.status==="dirty",Oi=e=>e.status==="valid",Ii=e=>typeof Promise<"u"&&e instanceof Promise;function Ss(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Jf(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ce||(ce={}));var ni,ai,dr=class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ah=(e,t)=>{if(Oi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new zt(e.common.issues);return this._error=r,this._error}}};function _e(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{var s,l;let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:(s=c??n)!==null&&s!==void 0?s:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:o.defaultError}},description:a}}var Te=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Yr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Yr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:Yr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ii(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yr(e)},a=this._parseSync({data:e,path:n.path,parent:n});return ah(n,a)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yr(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Ii(n)?n:Promise.resolve(n));return ah(r,a)}refine(e,t){let r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:$.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(s=>s?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new Wt({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ir.create(this,this._def)}nullable(){return nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fn.create(this,this._def)}promise(){return _a.create(this,this._def)}or(e){return Fi.create([this,e],this._def)}and(e){return $i.create(this,e,this._def)}transform(e){return new Wt({..._e(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new zi({..._e(this._def),innerType:this,defaultValue:t,typeName:fe.ZodDefault})}brand(){return new Ku({typeName:fe.ZodBranded,type:this,..._e(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Vi({..._e(this._def),innerType:this,catchValue:t,typeName:fe.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Yu.create(this,e)}readonly(){return Hi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},j4=/^c[^\s-]{8,}$/i,B4=/^[0-9a-z]+$/,z4=/^[0-9A-HJKMNP-TV-Z]{26}$/,V4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,H4=/^[a-z0-9_-]{21}$/i,Z4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,G4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ul,q4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,K4=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Y4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",X4=new RegExp(`^${Qf}$`);function eb(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function J4(e){return new RegExp(`^${eb(e)}$`)}function tb(e){let t=`${Qf}T${eb(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Q4(e,t){return!!((t==="v4"||!t)&&q4.test(e)||(t==="v6"||!t)&&K4.test(e))}var wa=class ii extends Te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Y.string){let a=this._getOrReturnCtx(t);return W(a,{code:$.invalid_type,expected:Y.string,received:a.parsedType}),xe}let r=new wt,n;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),W(n,{code:$.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),W(n,{code:$.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(t,n),i?W(n,{code:$.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&W(n,{code:$.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")G4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"email",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ul||(Ul=new RegExp(W4,"u")),Ul.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"emoji",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")V4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"uuid",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")H4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"nanoid",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")j4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"cuid",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")B4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"cuid2",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")z4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"ulid",code:$.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),W(n,{validation:"url",code:$.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"regex",code:$.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?tb(a).test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?X4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?J4(a).test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{code:$.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?Z4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"duration",code:$.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Q4(t.data,a.version)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"ip",code:$.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Y4.test(t.data)||(n=this._getOrReturnCtx(t,n),W(n,{validation:"base64",code:$.invalid_string,message:a.message}),r.dirty()):Ae.assertNever(a);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:$.invalid_string,...ce.errToObj(n)})}_addCheck(t){return new ii({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,...ce.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ce.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ce.errToObj(r)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new ii({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ii({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ii({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wa.create=e=>{var t;return new wa({checks:[],typeName:fe.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};function eP(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}var Ni=class ru extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Y.number){let a=this._getOrReturnCtx(t);return W(a,{code:$.invalid_type,expected:Y.number,received:a.parsedType}),xe}let r,n=new wt;for(let a of this._def.checks)a.kind==="int"?Ae.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),W(r,{code:$.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?eP(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),W(r,{code:$.not_finite,message:a.message}),n.dirty()):Ae.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,a){return new ru({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(a)}]})}_addCheck(t){return new ru({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ae.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Ni.create=e=>new Ni({checks:[],typeName:fe.ZodNumber,coerce:e?.coerce||!1,..._e(e)});var Ai=class nu extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Y.bigint){let a=this._getOrReturnCtx(t);return W(a,{code:$.invalid_type,expected:Y.bigint,received:a.parsedType}),xe}let r,n=new wt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),W(r,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):Ae.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ce.toString(r))}setLimit(t,r,n,a){return new nu({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ce.toString(a)}]})}_addCheck(t){return new nu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ai.create=e=>{var t;return new Ai({checks:[],typeName:fe.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};var Ri=class extends Te{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.boolean,received:t.parsedType}),xe}return mt(e.data)}};Ri.create=e=>new Ri({typeName:fe.ZodBoolean,coerce:e?.coerce||!1,..._e(e)});var Di=class rb extends Te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Y.date){let a=this._getOrReturnCtx(t);return W(a,{code:$.invalid_type,expected:Y.date,received:a.parsedType}),xe}if(isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return W(a,{code:$.invalid_date}),xe}let r=new wt,n;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),W(n,{code:$.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),W(n,{code:$.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Ae.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new rb({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Di.create=e=>new Di({checks:[],coerce:e?.coerce||!1,typeName:fe.ZodDate,..._e(e)});var Es=class extends Te{_parse(e){if(this._getType(e)!==Y.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.symbol,received:t.parsedType}),xe}return mt(e.data)}};Es.create=e=>new Es({typeName:fe.ZodSymbol,..._e(e)});var Mi=class extends Te{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.undefined,received:t.parsedType}),xe}return mt(e.data)}};Mi.create=e=>new Mi({typeName:fe.ZodUndefined,..._e(e)});var Li=class extends Te{_parse(e){if(this._getType(e)!==Y.null){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.null,received:t.parsedType}),xe}return mt(e.data)}};Li.create=e=>new Li({typeName:fe.ZodNull,..._e(e)});var ka=class extends Te{constructor(){super(...arguments),this._any=!0}_parse(e){return mt(e.data)}};ka.create=e=>new ka({typeName:fe.ZodAny,..._e(e)});var Rn=class extends Te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mt(e.data)}};Rn.create=e=>new Rn({typeName:fe.ZodUnknown,..._e(e)});var Rr=class extends Te{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.never,received:t.parsedType}),xe}};Rr.create=e=>new Rr({typeName:fe.ZodNever,..._e(e)});var Cs=class extends Te{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.void,received:t.parsedType}),xe}return mt(e.data)}};Cs.create=e=>new Cs({typeName:fe.ZodVoid,..._e(e)});var Fn=class Ho extends Te{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==Y.array)return W(r,{code:$.invalid_type,expected:Y.array,received:r.parsedType}),xe;if(a.exactLength!==null){let o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(W(r,{code:o?$.too_big:$.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(W(r,{code:$.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(W(r,{code:$.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new dr(r,o,r.path,s)))).then(o=>wt.mergeArray(n,o));let i=[...r.data].map((o,s)=>a.type._parseSync(new dr(r,o,r.path,s)));return wt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Ho({...this._def,minLength:{value:t,message:ce.toString(r)}})}max(t,r){return new Ho({...this._def,maxLength:{value:t,message:ce.toString(r)}})}length(t,r){return new Ho({...this._def,exactLength:{value:t,message:ce.toString(r)}})}nonempty(t){return this.min(1,t)}};Fn.create=(e,t)=>new Fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,..._e(t)});function sa(e){if(e instanceof Dt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ir.create(sa(n))}return new Dt({...e._def,shape:()=>t})}else return e instanceof Fn?new Fn({...e._def,type:sa(e.element)}):e instanceof ir?ir.create(sa(e.unwrap())):e instanceof nn?nn.create(sa(e.unwrap())):e instanceof rn?rn.create(e.items.map(t=>sa(t))):e}var Dt=class $t extends Te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ae.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Y.object){let l=this._getOrReturnCtx(t);return W(l,{code:$.invalid_type,expected:Y.object,received:l.parsedType}),xe}let{status:r,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rr&&this._def.unknownKeys==="strip"))for(let l in n.data)i.includes(l)||o.push(l);let s=[];for(let l of i){let c=a[l],u=n.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new dr(n,u,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof Rr){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of o)s.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(l==="strict")o.length>0&&(W(n,{code:$.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of o){let u=n.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new dr(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of s){let u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>wt.mergeObjectSync(r,l)):wt.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new $t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,i,o,s;let l=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=ce.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new $t({...this._def,unknownKeys:"strip"})}passthrough(){return new $t({...this._def,unknownKeys:"passthrough"})}extend(t){return new $t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new $t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:fe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new $t({...this._def,catchall:t})}pick(t){let r={};return Ae.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new $t({...this._def,shape:()=>r})}omit(t){let r={};return Ae.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new $t({...this._def,shape:()=>r})}deepPartial(){return sa(this)}partial(t){let r={};return Ae.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new $t({...this._def,shape:()=>r})}required(t){let r={};return Ae.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof ir;)a=a._def.innerType;r[n]=a}}),new $t({...this._def,shape:()=>r})}keyof(){return lb(Ae.objectKeys(this.shape))}};Dt.create=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strip",catchall:Rr.create(),typeName:fe.ZodObject,..._e(t)});Dt.strictCreate=(e,t)=>new Dt({shape:()=>e,unknownKeys:"strict",catchall:Rr.create(),typeName:fe.ZodObject,..._e(t)});Dt.lazycreate=(e,t)=>new Dt({shape:e,unknownKeys:"strip",catchall:Rr.create(),typeName:fe.ZodObject,..._e(t)});var Fi=class extends Te{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new zt(o.ctx.common.issues));return W(t,{code:$.invalid_union,unionErrors:i}),xe}if(t.common.async)return Promise.all(r.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let s of r){let l={...t,common:{...t.common,issues:[]},parent:null},c=s._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(s=>new zt(s));return W(t,{code:$.invalid_union,unionErrors:o}),xe}}get options(){return this._def.options}};Fi.create=(e,t)=>new Fi({options:e,typeName:fe.ZodUnion,..._e(t)});var Zr=e=>e instanceof Ui?Zr(e.schema):e instanceof Wt?Zr(e.innerType()):e instanceof ji?[e.value]:e instanceof oo?e.options:e instanceof Bi?Ae.objectValues(e.enum):e instanceof zi?Zr(e._def.innerType):e instanceof Mi?[void 0]:e instanceof Li?[null]:e instanceof ir?[void 0,...Zr(e.unwrap())]:e instanceof nn?[null,...Zr(e.unwrap())]:e instanceof Ku||e instanceof Hi?Zr(e.unwrap()):e instanceof Vi?Zr(e._def.innerType):[],nb=class ab extends Te{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Y.object)return W(r,{code:$.invalid_type,expected:Y.object,received:r.parsedType}),xe;let n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(W(r,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let i of r){let o=Zr(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new ab({typeName:fe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,..._e(n)})}};function au(e,t){let r=Yr(e),n=Yr(t);if(e===t)return{valid:!0,data:e};if(r===Y.object&&n===Y.object){let a=Ae.objectKeys(t),i=Ae.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(let s of i){let l=au(e[s],t[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===Y.array&&n===Y.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let i=0;i<e.length;i++){let o=e[i],s=t[i],l=au(o,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return r===Y.date&&n===Y.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var $i=class extends Te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(eu(a)||eu(i))return xe;let o=au(a.value,i.value);return o.valid?((tu(a)||tu(i))&&t.dirty(),{status:t.value,value:o.data}):(W(r,{code:$.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};$i.create=(e,t,r)=>new $i({left:e,right:t,typeName:fe.ZodIntersection,..._e(r)});var rn=class ib extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Y.array)return W(n,{code:$.invalid_type,expected:Y.array,received:n.parsedType}),xe;if(n.data.length<this._def.items.length)return W(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let s=this._def.items[o]||this._def.rest;return s?s._parse(new dr(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>wt.mergeArray(r,i)):wt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new ib({...this._def,rest:t})}};rn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rn({items:e,typeName:fe.ZodTuple,rest:null,..._e(t)})};var ob=class iu extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Y.object)return W(n,{code:$.invalid_type,expected:Y.object,received:n.parsedType}),xe;let a=[],i=this._def.keyType,o=this._def.valueType;for(let s in n.data)a.push({key:i._parse(new dr(n,s,n.path,s)),value:o._parse(new dr(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?wt.mergeObjectAsync(r,a):wt.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Te?new iu({keyType:t,valueType:r,typeName:fe.ZodRecord,..._e(n)}):new iu({keyType:wa.create(),valueType:t,typeName:fe.ZodRecord,..._e(r)})}},Ps=class extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.map)return W(r,{code:$.invalid_type,expected:Y.map,received:r.parsedType}),xe;let n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,s],l)=>({key:n._parse(new dr(r,o,r.path,[l,"key"])),value:a._parse(new dr(r,s,r.path,[l,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let s of i){let l=await s.key,c=await s.value;if(l.status==="aborted"||c.status==="aborted")return xe;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let s of i){let l=s.key,c=s.value;if(l.status==="aborted"||c.status==="aborted")return xe;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}}}};Ps.create=(e,t,r)=>new Ps({valueType:t,keyType:e,typeName:fe.ZodMap,..._e(r)});var Os=class ou extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Y.set)return W(n,{code:$.invalid_type,expected:Y.set,received:n.parsedType}),xe;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(W(n,{code:$.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(W(n,{code:$.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let i=this._def.valueType;function o(l){let c=new Set;for(let u of l){if(u.status==="aborted")return xe;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((l,c)=>i._parse(new dr(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(t,r){return new ou({...this._def,minSize:{value:t,message:ce.toString(r)}})}max(t,r){return new ou({...this._def,maxSize:{value:t,message:ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Os.create=(e,t)=>new Os({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,..._e(t)});var sb=class Zo extends Te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Y.function)return W(r,{code:$.invalid_type,expected:Y.function,received:r.parsedType}),xe;function n(s,l){return _s({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ks(),xa].filter(c=>!!c),issueData:{code:$.invalid_arguments,argumentsError:l}})}function a(s,l){return _s({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ks(),xa].filter(c=>!!c),issueData:{code:$.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof _a){let s=this;return mt(async function(...l){let c=new zt([]),u=await s._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(n(l,p)),c}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(a(d,p)),c})})}else{let s=this;return mt(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new zt([n(l,c.error)]);let u=Reflect.apply(o,this,c.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new zt([a(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Zo({...this._def,args:rn.create(t).rest(Rn.create())})}returns(t){return new Zo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Zo({args:t||rn.create([]).rest(Rn.create()),returns:r||Rn.create(),typeName:fe.ZodFunction,..._e(n)})}},Ui=class extends Te{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ui.create=(e,t)=>new Ui({getter:e,typeName:fe.ZodLazy,..._e(t)});var ji=class extends Te{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:$.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}};ji.create=(e,t)=>new ji({value:e,typeName:fe.ZodLiteral,..._e(t)});function lb(e,t){return new oo({values:e,typeName:fe.ZodEnum,..._e(t)})}var oo=class su extends Te{constructor(){super(...arguments),ni.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return W(r,{expected:Ae.joinValues(n),received:r.parsedType,code:$.invalid_type}),xe}if(Ss(this,ni,"f")||Jf(this,ni,new Set(this._def.values),"f"),!Ss(this,ni,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return W(r,{received:r.data,code:$.invalid_enum_value,options:n}),xe}return mt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return su.create(t,{...this._def,...r})}exclude(t,r=this._def){return su.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ni=new WeakMap;oo.create=lb;var Bi=class extends Te{constructor(){super(...arguments),ai.set(this,void 0)}_parse(e){let t=Ae.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Y.string&&r.parsedType!==Y.number){let n=Ae.objectValues(t);return W(r,{expected:Ae.joinValues(n),received:r.parsedType,code:$.invalid_type}),xe}if(Ss(this,ai,"f")||Jf(this,ai,new Set(Ae.getValidEnumValues(this._def.values)),"f"),!Ss(this,ai,"f").has(e.data)){let n=Ae.objectValues(t);return W(r,{received:r.data,code:$.invalid_enum_value,options:n}),xe}return mt(e.data)}get enum(){return this._def.values}};ai=new WeakMap;Bi.create=(e,t)=>new Bi({values:e,typeName:fe.ZodNativeEnum,..._e(t)});var _a=class extends Te{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Y.promise&&t.common.async===!1)return W(t,{code:$.invalid_type,expected:Y.promise,received:t.parsedType}),xe;let r=t.parsedType===Y.promise?t.data:Promise.resolve(t.data);return mt(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};_a.create=(e,t)=>new _a({type:e,typeName:fe.ZodPromise,..._e(t)});var Wt=class extends Te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{W(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return xe;let s=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return s.status==="aborted"?xe:s.status==="dirty"||t.value==="dirty"?Ts(s.value):s});{if(t.value==="aborted")return xe;let o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?xe:o.status==="dirty"||t.value==="dirty"?Ts(o.value):o}}if(n.type==="refinement"){let i=o=>{let s=n.refinement(o,a);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xe:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?xe:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Oi(i))return i;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Oi(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);Ae.assertNever(n)}};Wt.create=(e,t,r)=>new Wt({schema:e,typeName:fe.ZodEffects,effect:t,..._e(r)});Wt.createWithPreprocess=(e,t,r)=>new Wt({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,..._e(r)});var ir=class extends Te{_parse(e){return this._getType(e)===Y.undefined?mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ir.create=(e,t)=>new ir({innerType:e,typeName:fe.ZodOptional,..._e(t)});var nn=class extends Te{_parse(e){return this._getType(e)===Y.null?mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};nn.create=(e,t)=>new nn({innerType:e,typeName:fe.ZodNullable,..._e(t)});var zi=class extends Te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===Y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};zi.create=(e,t)=>new zi({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._e(t)});var Vi=class extends Te{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ii(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new zt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new zt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Vi.create=(e,t)=>new Vi({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._e(t)});var Is=class extends Te{_parse(e){if(this._getType(e)!==Y.nan){let t=this._getOrReturnCtx(e);return W(t,{code:$.invalid_type,expected:Y.nan,received:t.parsedType}),xe}return{status:"valid",value:e.data}}};Is.create=e=>new Is({typeName:fe.ZodNaN,..._e(e)});var tP=Symbol("zod_brand"),Ku=class extends Te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},Yu=class cb extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?xe:a.status==="dirty"?(r.dirty(),Ts(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?xe:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new cb({in:t,out:r,typeName:fe.ZodPipeline})}},Hi=class extends Te{_parse(e){let t=this._def.innerType._parse(e),r=n=>(Oi(n)&&(n.value=Object.freeze(n.value)),n);return Ii(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};Hi.create=(e,t)=>new Hi({innerType:e,typeName:fe.ZodReadonly,..._e(t)});function ub(e,t={},r){return e?ka.create().superRefine((n,a)=>{var i,o;if(!e(n)){let s=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(o=(i=s.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...c,fatal:l})}}):ka.create()}var rP={object:Dt.lazycreate},fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));var nP=(e,t={message:`Input not instance of ${e.name}`})=>ub(r=>r instanceof e,t),db=wa.create,pb=Ni.create,aP=Is.create,iP=Ai.create,hb=Ri.create,oP=Di.create,sP=Es.create,lP=Mi.create,cP=Li.create,uP=ka.create,dP=Rn.create,pP=Rr.create,hP=Cs.create,gP=Fn.create,mP=Dt.create,fP=Dt.strictCreate,bP=Fi.create,yP=nb.create,vP=$i.create,xP=rn.create,wP=ob.create,kP=Ps.create,_P=Os.create,TP=sb.create,SP=Ui.create,EP=ji.create,CP=oo.create,PP=Bi.create,OP=_a.create,ih=Wt.create,IP=ir.create,NP=nn.create,AP=Wt.createWithPreprocess,RP=Yu.create,DP=()=>db().optional(),MP=()=>pb().optional(),LP=()=>hb().optional(),FP={string:(e=>wa.create({...e,coerce:!0})),number:(e=>Ni.create({...e,coerce:!0})),boolean:(e=>Ri.create({...e,coerce:!0})),bigint:(e=>Ai.create({...e,coerce:!0})),date:(e=>Di.create({...e,coerce:!0}))},$P=xe,ue=Object.freeze({__proto__:null,defaultErrorMap:xa,setErrorMap:$4,getErrorMap:ks,makeIssue:_s,EMPTY_PATH:U4,addIssueToContext:W,ParseStatus:wt,INVALID:xe,DIRTY:Ts,OK:mt,isAborted:eu,isDirty:tu,isValid:Oi,isAsync:Ii,get util(){return Ae},get objectUtil(){return Qc},ZodParsedType:Y,getParsedType:Yr,ZodType:Te,datetimeRegex:tb,ZodString:wa,ZodNumber:Ni,ZodBigInt:Ai,ZodBoolean:Ri,ZodDate:Di,ZodSymbol:Es,ZodUndefined:Mi,ZodNull:Li,ZodAny:ka,ZodUnknown:Rn,ZodNever:Rr,ZodVoid:Cs,ZodArray:Fn,ZodObject:Dt,ZodUnion:Fi,ZodDiscriminatedUnion:nb,ZodIntersection:$i,ZodTuple:rn,ZodRecord:ob,ZodMap:Ps,ZodSet:Os,ZodFunction:sb,ZodLazy:Ui,ZodLiteral:ji,ZodEnum:oo,ZodNativeEnum:Bi,ZodPromise:_a,ZodEffects:Wt,ZodTransformer:Wt,ZodOptional:ir,ZodNullable:nn,ZodDefault:zi,ZodCatch:Vi,ZodNaN:Is,BRAND:tP,ZodBranded:Ku,ZodPipeline:Yu,ZodReadonly:Hi,custom:ub,Schema:Te,ZodSchema:Te,late:rP,get ZodFirstPartyTypeKind(){return fe},coerce:FP,any:uP,array:gP,bigint:iP,boolean:hb,date:oP,discriminatedUnion:yP,effect:ih,enum:CP,function:TP,instanceof:nP,intersection:vP,lazy:SP,literal:EP,map:kP,nan:aP,nativeEnum:PP,never:pP,null:cP,nullable:NP,number:pb,object:mP,oboolean:LP,onumber:MP,optional:IP,ostring:DP,pipeline:RP,preprocess:AP,promise:OP,record:wP,set:_P,strictObject:fP,string:db,symbol:sP,transformer:ih,tuple:xP,undefined:lP,union:bP,unknown:dP,void:hP,NEVER:$P,ZodIssueCode:$,quotelessJson:F4,ZodError:zt});function UP(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(a){return new this.constructor({...this._def,openapi:a})};let t=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...a){let i=t.apply(this,a);return i._def.extendMetadata={extends:this},delete i._def.openapi,i};let r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...a){let i=r.apply(this,a);return delete i._def.extendMetadata,delete i._def.openapi,i};let n=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...a){let i=n.apply(this,a);return delete i._def.extendMetadata,delete i._def.openapi,i}}var jP=e=>{typeof e.ZodType.prototype.layout<"u"||(e.ZodType.prototype.layout=function(t){return new this.constructor({...this._def,layout:t})})};jP(ue);UP(ue);var BP=ue.object({id:ue.string(),outgoingEdgeId:ue.string().nullable().optional(),requiresValidation:ue.preprocess(e=>e===void 0?!0:e,ue.boolean().optional()).openapi({effectType:"input"})}),zP=ue.object({variableId:ue.string().optional()}),oh=ue.object({id:ue.string(),blockId:ue.string().optional(),outgoingEdgeId:ue.string().nullable().optional()}),Ns={v5:oh,v6:oh.omit({blockId:!0})},zA=ue.union([Ns.v5,Ns.v6]),gb=(e=>(e.OR="OR",e.AND="AND",e))(gb||{}),mb=(e=>(e.EQUAL="Equal to",e.NOT_EQUAL="Not equal",e.CONTAINS="Contains",e.NOT_CONTAINS="Does not contain",e.GREATER="Greater than",e.GREATER_OR_EQUAL="Greater or equal to",e.LESS="Less than",e.LESS_OR_EQUAL="Less or equal to",e.IS_SET="Is set",e.IS_EMPTY="Is empty",e.STARTS_WITH="Starts with",e.ENDS_WITH="Ends with",e.MATCHES_REGEX="Matches regex",e.NOT_MATCH_REGEX="Does not match regex",e))(mb||{}),VP=ue.object({id:ue.string(),variableId:ue.string().optional(),comparisonOperator:ue.nativeEnum(mb).optional(),value:ue.string().optional()}),fb={WEB:"web",WHATSAPP:"whatsapp"},HP=VP.extend({platform:ue.nativeEnum(fb).optional()}),sh=ue.object({logicalOperator:ue.nativeEnum(gb).optional(),comparisons:ue.array(HP).optional(),platforms:ue.array(ue.nativeEnum(fb)).optional()}),ZP=zP.merge(ue.object({title:ue.string().optional(),description:ue.string().optional(),footer:ue.string().optional(),buttonLabel:ue.string().optional(),sectionTitle:ue.string().optional(),sections:ue.array(ue.object({id:ue.string(),title:ue.string().optional()})).optional(),dynamicVariableId:ue.string().optional()})),As={v5:Ns.v5.extend({content:ue.string().optional(),value:ue.string().optional(),description:ue.string().optional(),sectionId:ue.string().optional(),displayCondition:ue.object({isEnabled:ue.boolean().optional(),condition:sh.optional()}).optional()}),v6:Ns.v6.extend({content:ue.string().optional(),value:ue.string().optional(),description:ue.string().optional(),sectionId:ue.string().optional(),displayCondition:ue.object({isEnabled:ue.boolean().optional(),condition:sh.optional()}).optional()})},VA=ue.union([As.v5,As.v6]),lh=BP.merge(ue.object({type:ue.enum(["list input"]),items:ue.array(As.v5),options:ZP.optional(),requiresValidation:ue.preprocess(e=>e===void 0?!1:e,ue.boolean().optional())})),ch={v5:lh.openapi({title:"List v5",ref:"listInputV5"}),v6:lh.extend({items:ue.array(As.v6)}).openapi({title:"List",ref:"listInput"})},HA=ue.union([ch.v5,ch.v6]),bb="default-section",GP=e=>{let t=e.options?.sections?.filter(r=>r.id)??[];return t.length>0?t:[{id:bb,title:e.options?.sectionTitle??"Op\xE7\xF5es"}]},WP=e=>{let t=GP(e),r=t[0]?.id??bb,n=t.map(i=>({id:i.id,title:i.title,items:[]})),a=new Map(n.map((i,o)=>[i.id,o]));return e.items.forEach(i=>{let o=i.sectionId&&a.has(i.sectionId)?i.sectionId:r,s=a.get(o);s!==void 0&&n[s].items.push(i)}),n.filter(i=>i.items.length>0)},qP=E('<div class="flex flex-col gap-2 pt-4">'),KP=E('<span class="flex items-center gap-2 justify-center"><svg class="w-4 h-4"fill=none stroke=currentColor viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4 6h16M4 12h16M4 18h16">'),YP=E('<div class="w-[min(92vw,360px)] max-h-[min(80vh,560px)] overflow-hidden rounded-2xl bg-host-bubble-bg text-host-bubble-text border-host-bubble border-host-bubble-border shadow-host-bubble"><div class="max-h-[360px] overflow-y-auto px-2 py-2">'),XP=E('<div class="flex flex-col items-end gap-2 w-full makebot-buttons-input"><div class="makebot-card flex flex-col justify-between gap-4 text-host-bubble-text bg-host-bubble-bg border-host-bubble-border border-host-bubble rounded-host-bubble shadow-host-bubble filter-host-bubble overflow-hidden"><div class="flex flex-col gap-4"><div class="px-3 pb-2">'),JP=E('<h2 class="px-4 font-semibold">'),QP=E("<p class=px-4>"),e5=E('<p class="px-4 text-xs opacity-70 leading-relaxed">'),t5=E('<div class="mb-3 last:mb-0">'),r5=E('<p class="px-3 pb-2 text-[11px] font-semibold uppercase tracking-wide opacity-55">'),n5=E('<svg class="h-4 w-4 flex-shrink-0 text-green-500"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"clip-rule=evenodd>'),a5=E('<button type=button class="w-full text-left rounded-xl px-3 py-3 flex items-start gap-3 hover:bg-black/5 transition-colors"><span class="mt-0.5 inline-flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full border border-host-bubble-border text-xs opacity-70">\u2022</span><span class="flex min-w-0 flex-1 flex-col"><span class="text-sm font-medium leading-tight">'),i5=E('<span class="mt-1 text-xs opacity-70 leading-relaxed">'),o5=e=>{let[t,r]=N(!1),[n,a]=N(),i=()=>WP(e.block),o=s=>{let l=s.value||s.content||"";a(s.id),r(!1),e.onSubmit({type:"text",value:l,label:s.value?s.content:void 0})};return(()=>{var s=XP(),l=s.firstChild,c=l.firstChild,u=c.firstChild;return T(c,g(X,{get when(){return e.block.options?.title||e.block.options?.description||e.block.options?.footer},get children(){var d=qP();return T(d,g(X,{get when(){return e.block.options?.title},children:p=>(()=>{var h=JP();return T(h,p),h})()}),null),T(d,g(X,{get when(){return e.block.options?.description},children:p=>(()=>{var h=QP();return T(h,p),h})()}),null),T(d,g(X,{get when(){return e.block.options?.footer},children:p=>(()=>{var h=e5();return T(h,p),h})()}),null),d}}),u),T(u,g(nr,{variant:"secondary",size:"sm",get class(){return ae("w-full font-normal text-sm border-host-bubble-border border rounded-t-host-bubble rounded-b-host-bubble")},"on:click":()=>r(!0),get children(){var d=KP(),p=d.firstChild;return T(d,()=>e.block.options?.buttonLabel??L4.buttonLabel,null),d}})),T(s,g(qu,{get isOpen(){return t()},onClose:()=>r(!1),get children(){var d=YP(),p=d.firstChild;return T(p,g(Je,{get each(){return i()},children:h=>(()=>{var y=t5();return T(y,g(X,{get when(){return h.title},children:m=>(()=>{var v=r5();return T(v,m),v})()}),null),T(y,g(Je,{get each(){return h.items},children:m=>(()=>{var v=a5(),w=v.firstChild,b=w.nextSibling,x=b.firstChild;return v.$$click=()=>o(m),T(x,()=>m.content||m.value||"Op\xE7\xE3o"),T(b,g(X,{get when(){return m.description},children:f=>(()=>{var k=i5();return T(k,f),k})()}),null),T(v,g(X,{get when(){return n()===m.id},get children(){return n5()}}),null),v})()}),null),y})()})),d}}),null),s})()};at(["click"]);var s5=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><polyline points="6 9 12 15 18 9">'),yb=e=>(()=>{var t=s5();return Ke(t,e,!0,!0),t})(),l5=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 15l-6-6-6 6">'),c5=e=>(()=>{var t=l5();return Ke(t,e,!0,!0),t})(),u5="decimal",d5=Fr,p5="Digite um n\xFAmero...",jl=e=>{if(typeof e=="number")return e;if(!e)return;let t=Number.parseFloat(e.toString().replace(",","."));return isNaN(t)?void 0:t},h5=E('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]">'),g5=e=>{let t=af({locale:navigator.language,formatOptions:m5(e.block.options),min:jl(e.block.options?.min),max:jl(e.block.options?.max),step:jl(e.block.options?.step)}),r,n=()=>t().invalid?(r?.reportValidity(),!1):!0,a=()=>{n()?e.onSubmit({type:"text",value:t().valueAsNumber.toString(),label:t().value.toString()}):t().focus()},i=s=>{s.key==="Enter"&&a()};$e(()=>{!ur()&&r&&r.focus({preventScroll:!0}),window.addEventListener("message",o)}),Ie(()=>{window.removeEventListener("message",o)});let o=s=>{let{data:l}=s;l.isFromMakebot&&l.command==="setInputValue"&&t().setValue(Number(l.value))};return(()=>{var s=h5();return s.$$keydown=i,T(s,g(aa.RootProvider,{value:t,class:"flex makebot-input w-full",get children(){return[g(aa.Input,{ref(l){var c=r;typeof c=="function"?c(l):r=l},class:"focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input ml-2",style:{"font-size":"16px",appearance:"auto"},get placeholder(){return e.block.options?.labels?.placeholder??p5}}),g(aa.Control,{class:"flex flex-col rounded-r-md overflow-hidden divide-y h-[42px]",get children(){return[g(aa.IncrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return g(c5,{class:"size-4"})}}),g(aa.DecrementTrigger,{class:"flex items-center justify-center h-7 w-8 border-input-border border-l",get children(){return g(yb,{class:"size-4"})}})]}})]}}),null),T(s,g(Xt,{type:"button",class:"h-[42px]","on:click":a,get children(){return e.block.options?.labels?.button??d5}}),null),s})()},m5=e=>{let t={style:u5};return e?.style==="currency"&&e.currency?{style:e.style,currency:e.currency}:e?.style==="unit"&&e.unit?{style:e.style,unit:e.unit}:t};at(["keydown"]);var vb={provider:"Stripe",labels:{button:"Pagar",success:"Sucesso"},retryMessageContent:"O pagamento falhou. Tente novamente.",currency:"BRL"},f5=Fh(qb(),1),b5=E('<div class="makebot-input-error-message mt-4 text-center animate-fade-in">'),y5=E('<form id=payment-form class="flex flex-col p-4 makebot-input w-full items-center"><slot name=stripe-payment-form>'),v5="stripe-payment-form",ja,Ba=null,Ro=null,x5=e=>{let[t,r]=N(),[n,a]=N(!1),[i,o]=N(!1);$e(async()=>{if(!ja)return;if(w5(ja),!e.options?.publicKey)return r("Missing Stripe public key");if(Ba=await(0,f5.loadStripe)(e.options?.publicKey),!Ba)return;Ro=Ba.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(ja).getPropertyValue("--makebot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});let l=Ro.create("payment",{layout:"tabs"});l.on("ready",()=>{a(!0),e.onTransitionEnd()}),l.mount("#payment-element")});let s=async l=>{if(l.preventDefault(),!Ba||!Ro)return;o(!0),Ky({sessionId:e.context.sessionId,resultId:e.context.resultId,makebot:e.context.makebot});let{postalCode:c,...u}=e.options?.additionalInformation?.address??{},{error:d,paymentIntent:p}=await Ba.confirmPayment({elements:Ro,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...u,postal_code:c}}}},redirect:"if_required"});if(Fg(),o(!1),d?.type!=="validation_error"){if(d?.type==="card_error")return r(d.message);if(!d&&p.status==="succeeded")return e.onSuccess()}};return(()=>{var l=y5(),c=l.firstChild;l.addEventListener("submit",s);var u=ja;return typeof u=="function"?Ve(u,c):ja=c,c._$owner=ac(),T(l,g(X,{get when(){return n()},get children(){return g(Xt,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[j(()=>e.options?.labels?.button??vb.labels.button)," ",j(()=>e.options?.amountLabel)]}})}}),null),T(l,g(X,{get when(){return t()},get children(){var d=b5();return T(d,t),d}}),null),l})()},w5=e=>{let t=e.getRootNode().host,r=document.createElement("div");r.style.width="100%",r.slot=v5,t.appendChild(r);let n=document.createElement("div");n.id="payment-element",r.appendChild(n)},k5=e=>g(x5,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}}),uh={labels:{button:Fr,placeholder:"Digite seu n\xFAmero de telefone..."},retryMessageContent:"Este n\xFAmero de telefone parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"},wn=[{name:"Internacional",flag:"/flags/m/INT.svg",code:"INT",dial_code:""},{name:"Brasil",flag:"/flags/m/BR.svg",code:"BR",dial_code:"+55"},{name:"Arg\xE9lia",flag:"/flags/m/DZ.svg",code:"DZ",dial_code:"+213"},{name:"Andorra",flag:"/flags/m/AD.svg",code:"AD",dial_code:"+376"},{name:"Angola",flag:"/flags/m/AO.svg",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"/flags/m/AI.svg",code:"AI",dial_code:"+1264"},{name:"Ant\xEDgua e Barbuda",flag:"/flags/m/AG.svg",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"/flags/m/AR.svg",code:"AR",dial_code:"+54"},{name:"Arm\xEAnia",flag:"/flags/m/AM.svg",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"/flags/m/AW.svg",code:"AW",dial_code:"+297"},{name:"Austr\xE1lia",flag:"/flags/m/AU.svg",code:"AU",dial_code:"+61"},{name:"\xC1ustria",flag:"/flags/m/AT.svg",code:"AT",dial_code:"+43"},{name:"Azerbaij\xE3o",flag:"/flags/m/AZ.svg",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"/flags/m/BS.svg",code:"BS",dial_code:"+1242"},{name:"Bahrein",flag:"/flags/m/BH.svg",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"/flags/m/BD.svg",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"/flags/m/BB.svg",code:"BB",dial_code:"+1246"},{name:"Bielorr\xFAssia",flag:"/flags/m/BY.svg",code:"BY",dial_code:"+375"},{name:"B\xE9lgica",flag:"/flags/m/BE.svg",code:"BE",dial_code:"+32"},{name:"Belize",flag:"/flags/m/BZ.svg",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"/flags/m/BJ.svg",code:"BJ",dial_code:"+229"},{name:"Bermudas",flag:"/flags/m/BM.svg",code:"BM",dial_code:"+1441"},{name:"But\xE3o",flag:"/flags/m/BT.svg",code:"BT",dial_code:"+975"},{name:"Bol\xEDvia",flag:"/flags/m/BO.svg",code:"BO",dial_code:"+591"},{name:"B\xF3snia e Herzegovina",flag:"/flags/m/BA.svg",code:"BA",dial_code:"+387"},{name:"Botsuana",flag:"/flags/m/BW.svg",code:"BW",dial_code:"+267"},{name:"Brunei",flag:"/flags/m/BN.svg",code:"BN",dial_code:"+673"},{name:"Bulg\xE1ria",flag:"/flags/m/BG.svg",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"/flags/m/BF.svg",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"/flags/m/BI.svg",code:"BI",dial_code:"+257"},{name:"Camboja",flag:"/flags/m/KH.svg",code:"KH",dial_code:"+855"},{name:"Camar\xF5es",flag:"/flags/m/CM.svg",code:"CM",dial_code:"+237"},{name:"Canad\xE1",flag:"/flags/m/CA.svg",code:"CA",dial_code:"+1"},{name:"Ilhas de Cabo Verde",flag:"/flags/m/CV.svg",code:"CV",dial_code:"+238"},{name:"Ilhas Cayman",flag:"/flags/m/KY.svg",code:"KY",dial_code:"+1345"},{name:"Rep\xFAblica Centro-Africana",flag:"/flags/m/CF.svg",code:"CF",dial_code:"+236"},{name:"Chile",flag:"/flags/m/CL.svg",code:"CL",dial_code:"+56"},{name:"China",flag:"/flags/m/CN.svg",code:"CN",dial_code:"+86"},{name:"Col\xF4mbia",flag:"/flags/m/CO.svg",code:"CO",dial_code:"+57"},{name:"Comores",flag:"/flags/m/KM.svg",code:"KM",dial_code:"+269"},{name:"Congo",flag:"/flags/m/CG.svg",code:"CG",dial_code:"+242"},{name:"Ilhas Cook",flag:"/flags/m/CK.svg",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"/flags/m/CR.svg",code:"CR",dial_code:"+506"},{name:"Costa do Marfim",flag:"/flags/m/CI.svg",code:"CI",dial_code:"+225"},{name:"Cro\xE1cia",flag:"/flags/m/HR.svg",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"/flags/m/CU.svg",code:"CU",dial_code:"+53"},{name:"Chipre Norte",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+90392"},{name:"Chipre Sul",flag:"/flags/m/CY.svg",code:"CY",dial_code:"+357"},{name:"Rep\xFAblica Tcheca",flag:"/flags/m/CZ.svg",code:"CZ",dial_code:"+420"},{name:"Dinamarca",flag:"/flags/m/DK.svg",code:"DK",dial_code:"+45"},{name:"Djibuti",flag:"/flags/m/DJ.svg",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"/flags/m/DM.svg",code:"DM",dial_code:"+1809"},{name:"Rep\xFAblica Dominicana",flag:"/flags/m/DO.svg",code:"DO",dial_code:"+1809"},{name:"Equador",flag:"/flags/m/EC.svg",code:"EC",dial_code:"+593"},{name:"Egito",flag:"/flags/m/EG.svg",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"/flags/m/SV.svg",code:"SV",dial_code:"+503"},{name:"Guin\xE9 Equatorial",flag:"/flags/m/GQ.svg",code:"GQ",dial_code:"+240"},{name:"Eritreia",flag:"/flags/m/ER.svg",code:"ER",dial_code:"+291"},{name:"Est\xF4nia",flag:"/flags/m/EE.svg",code:"EE",dial_code:"+372"},{name:"Eti\xF3pia",flag:"/flags/m/ET.svg",code:"ET",dial_code:"+251"},{name:"Ilhas Malvinas",flag:"/flags/m/FK.svg",code:"FK",dial_code:"+500"},{name:"Ilhas Faro\xE9",flag:"/flags/m/FO.svg",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"/flags/m/FJ.svg",code:"FJ",dial_code:"+679"},{name:"Finl\xE2ndia",flag:"/flags/m/FI.svg",code:"FI",dial_code:"+358"},{name:"Fran\xE7a",flag:"/flags/m/FR.svg",code:"FR",dial_code:"+33"},{name:"Guiana Francesa",flag:"/flags/m/GF.svg",code:"GF",dial_code:"+594"},{name:"Polin\xE9sia Francesa",flag:"/flags/m/PF.svg",code:"PF",dial_code:"+689"},{name:"Gab\xE3o",flag:"/flags/m/GA.svg",code:"GA",dial_code:"+241"},{name:"G\xE2mbia",flag:"/flags/m/GM.svg",code:"GM",dial_code:"+220"},{name:"Ge\xF3rgia",flag:"/flags/m/GE.svg",code:"GE",dial_code:"+995"},{name:"Alemanha",flag:"/flags/m/DE.svg",code:"DE",dial_code:"+49"},{name:"Gana",flag:"/flags/m/GH.svg",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"/flags/m/GI.svg",code:"GI",dial_code:"+350"},{name:"Gr\xE9cia",flag:"/flags/m/GR.svg",code:"GR",dial_code:"+30"},{name:"Groenl\xE2ndia",flag:"/flags/m/GL.svg",code:"GL",dial_code:"+299"},{name:"Granada",flag:"/flags/m/GD.svg",code:"GD",dial_code:"+1473"},{name:"Guadalupe",flag:"/flags/m/GP.svg",code:"GP",dial_code:"+590"},{name:"Guam",flag:"/flags/m/GU.svg",code:"GU",dial_code:"+671"},{name:"Guatemala",flag:"/flags/m/GT.svg",code:"GT",dial_code:"+502"},{name:"Guin\xE9",flag:"/flags/m/GN.svg",code:"GN",dial_code:"+224"},{name:"Guin\xE9-Bissau",flag:"/flags/m/GW.svg",code:"GW",dial_code:"+245"},{name:"Guiana",flag:"/flags/m/GY.svg",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"/flags/m/HT.svg",code:"HT",dial_code:"+509"},{name:"Honduras",flag:"/flags/m/HN.svg",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"/flags/m/HK.svg",code:"HK",dial_code:"+852"},{name:"Hungria",flag:"/flags/m/HU.svg",code:"HU",dial_code:"+36"},{name:"Isl\xE2ndia",flag:"/flags/m/IS.svg",code:"IS",dial_code:"+354"},{name:"\xCDndia",flag:"/flags/m/IN.svg",code:"IN",dial_code:"+91"},{name:"Indon\xE9sia",flag:"/flags/m/ID.svg",code:"ID",dial_code:"+62"},{name:"Ir\xE3",flag:"/flags/m/IR.svg",code:"IR",dial_code:"+98"},{name:"Iraque",flag:"/flags/m/IQ.svg",code:"IQ",dial_code:"+964"},{name:"Irlanda",flag:"/flags/m/IE.svg",code:"IE",dial_code:"+353"},{name:"Israel",flag:"/flags/m/IL.svg",code:"IL",dial_code:"+972"},{name:"It\xE1lia",flag:"/flags/m/IT.svg",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"/flags/m/JM.svg",code:"JM",dial_code:"+1876"},{name:"Jap\xE3o",flag:"/flags/m/JP.svg",code:"JP",dial_code:"+81"},{name:"Jord\xE2nia",flag:"/flags/m/JO.svg",code:"JO",dial_code:"+962"},{name:"Cazaquist\xE3o",flag:"/flags/m/KZ.svg",code:"KZ",dial_code:"+7"},{name:"Qu\xEAnia",flag:"/flags/m/KE.svg",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"/flags/m/KI.svg",code:"KI",dial_code:"+686"},{name:"Coreia do Norte",flag:"/flags/m/KP.svg",code:"KP",dial_code:"+850"},{name:"Coreia do Sul",flag:"/flags/m/KR.svg",code:"KR",dial_code:"+82"},{name:"Kuwait",flag:"/flags/m/KW.svg",code:"KW",dial_code:"+965"},{name:"Quirguist\xE3o",flag:"/flags/m/KG.svg",code:"KG",dial_code:"+996"},{name:"Laos",flag:"/flags/m/LA.svg",code:"LA",dial_code:"+856"},{name:"Let\xF4nia",flag:"/flags/m/LV.svg",code:"LV",dial_code:"+371"},{name:"L\xEDbano",flag:"/flags/m/LB.svg",code:"LB",dial_code:"+961"},{name:"Lesoto",flag:"/flags/m/LS.svg",code:"LS",dial_code:"+266"},{name:"Lib\xE9ria",flag:"/flags/m/LR.svg",code:"LR",dial_code:"+231"},{name:"L\xEDbia",flag:"/flags/m/LY.svg",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"/flags/m/LI.svg",code:"LI",dial_code:"+417"},{name:"Litu\xE2nia",flag:"/flags/m/LT.svg",code:"LT",dial_code:"+370"},{name:"Luxemburgo",flag:"/flags/m/LU.svg",code:"LU",dial_code:"+352"},{name:"Macau",flag:"/flags/m/MO.svg",code:"MO",dial_code:"+853"},{name:"Maced\xF4nia",flag:"/flags/m/MK.svg",code:"MK",dial_code:"+389"},{name:"Madag\xE1scar",flag:"/flags/m/MG.svg",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"/flags/m/MW.svg",code:"MW",dial_code:"+265"},{name:"Mal\xE1sia",flag:"/flags/m/MY.svg",code:"MY",dial_code:"+60"},{name:"Maldivas",flag:"/flags/m/MV.svg",code:"MV",dial_code:"+960"},{name:"Mali",flag:"/flags/m/ML.svg",code:"ML",dial_code:"+223"},{name:"Malta",flag:"/flags/m/MT.svg",code:"MT",dial_code:"+356"},{name:"Ilhas Marshall",flag:"/flags/m/MH.svg",code:"MH",dial_code:"+692"},{name:"Martinica",flag:"/flags/m/MQ.svg",code:"MQ",dial_code:"+596"},{name:"Maurit\xE2nia",flag:"/flags/m/MR.svg",code:"MR",dial_code:"+222"},{name:"Mayotte",flag:"/flags/m/YT.svg",code:"YT",dial_code:"+269"},{name:"M\xE9xico",flag:"/flags/m/MX.svg",code:"MX",dial_code:"+52"},{name:"Micron\xE9sia",flag:"/flags/m/FM.svg",code:"FM",dial_code:"+691"},{name:"Mold\xE1via",flag:"/flags/m/MD.svg",code:"MD",dial_code:"+373"},{name:"M\xF4naco",flag:"/flags/m/MC.svg",code:"MC",dial_code:"+377"},{name:"Mong\xF3lia",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+976"},{name:"Montserrat",flag:"/flags/m/MS.svg",code:"MS",dial_code:"+1664"},{name:"Marrocos",flag:"/flags/m/MA.svg",code:"MA",dial_code:"+212"},{name:"Mo\xE7ambique",flag:"/flags/m/MZ.svg",code:"MZ",dial_code:"+258"},{name:"Mianmar",flag:"/flags/m/MN.svg",code:"MN",dial_code:"+95"},{name:"Nam\xEDbia",flag:"/flags/m/NA.svg",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"/flags/m/NR.svg",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+977"},{name:"Holanda",flag:"/flags/m/NL.svg",code:"NL",dial_code:"+31"},{name:"Nova Caled\xF4nia",flag:"/flags/m/NC.svg",code:"NC",dial_code:"+687"},{name:"Nova Zel\xE2ndia",flag:"/flags/m/NZ.svg",code:"NZ",dial_code:"+64"},{name:"Nicar\xE1gua",flag:"/flags/m/NI.svg",code:"NI",dial_code:"+505"},{name:"N\xEDger",flag:"/flags/m/NE.svg",code:"NE",dial_code:"+227"},{name:"Nig\xE9ria",flag:"/flags/m/NG.svg",code:"NG",dial_code:"+234"},{name:"Niue",flag:"/flags/m/NU.svg",code:"NU",dial_code:"+683"},{name:"Ilhas Norfolk",flag:"/flags/m/NF.svg",code:"NF",dial_code:"+672"},{name:"Marianas do Norte",flag:"/flags/m/NP.svg",code:"NP",dial_code:"+670"},{name:"Noruega",flag:"/flags/m/NO.svg",code:"NO",dial_code:"+47"},{name:"Om\xE3",flag:"/flags/m/OM.svg",code:"OM",dial_code:"+968"},{name:"Palau",flag:"/flags/m/PW.svg",code:"PW",dial_code:"+680"},{name:"Panam\xE1",flag:"/flags/m/PA.svg",code:"PA",dial_code:"+507"},{name:"Papua Nova Guin\xE9",flag:"/flags/m/PG.svg",code:"PG",dial_code:"+675"},{name:"Paraguai",flag:"/flags/m/PY.svg",code:"PY",dial_code:"+595"},{name:"Peru",flag:"/flags/m/PE.svg",code:"PE",dial_code:"+51"},{name:"Filipinas",flag:"/flags/m/PH.svg",code:"PH",dial_code:"+63"},{name:"Pol\xF4nia",flag:"/flags/m/PL.svg",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"/flags/m/PT.svg",code:"PT",dial_code:"+351"},{name:"Porto Rico",flag:"/flags/m/PR.svg",code:"PR",dial_code:"+1787"},{name:"Catar",flag:"/flags/m/QA.svg",code:"QA",dial_code:"+974"},{name:"Reuni\xE3o",flag:"/flags/m/RE.svg",code:"RE",dial_code:"+262"},{name:"Rom\xEAnia",flag:"/flags/m/RO.svg",code:"RO",dial_code:"+40"},{name:"R\xFAssia",flag:"/flags/m/RU.svg",code:"RU",dial_code:"+7"},{name:"Ruanda",flag:"/flags/m/RW.svg",code:"RW",dial_code:"+250"},{name:"San Marino",flag:"/flags/m/SM.svg",code:"SM",dial_code:"+378"},{name:"S\xE3o Tom\xE9 e Pr\xEDncipe",flag:"/flags/m/ST.svg",code:"ST",dial_code:"+239"},{name:"Ar\xE1bia Saudita",flag:"/flags/m/SA.svg",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"/flags/m/SN.svg",code:"SN",dial_code:"+221"},{name:"S\xE9rvia",flag:"/flags/m/RS.svg",code:"RS",dial_code:"+381"},{name:"Seicheles",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+248"},{name:"Serra Leoa",flag:"/flags/m/SL.svg",code:"SL",dial_code:"+232"},{name:"Singapura",flag:"/flags/m/SG.svg",code:"SG",dial_code:"+65"},{name:"Rep\xFAblica Eslovaca",flag:"/flags/m/SK.svg",code:"SK",dial_code:"+421"},{name:"Eslov\xEAnia",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+386"},{name:"Ilhas Salom\xE3o",flag:"/flags/m/SB.svg",code:"SB",dial_code:"+677"},{name:"Som\xE1lia",flag:"/flags/m/SO.svg",code:"SO",dial_code:"+252"},{name:"\xC1frica do Sul",flag:"/flags/m/ZA.svg",code:"ZA",dial_code:"+27"},{name:"Espanha",flag:"/flags/m/ES.svg",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"/flags/m/LK.svg",code:"LK",dial_code:"+94"},{name:"Santa Helena",flag:"/flags/m/SH.svg",code:"SH",dial_code:"+290"},{name:"S\xE3o Crist\xF3v\xE3o",flag:"/flags/m/KN.svg",code:"KN",dial_code:"+1869"},{name:"Santa L\xFAcia",flag:"/flags/m/SC.svg",code:"SC",dial_code:"+1758"},{name:"Sud\xE3o",flag:"/flags/m/SD.svg",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"/flags/m/SR.svg",code:"SR",dial_code:"+597"},{name:"Suazil\xE2ndia",flag:"/flags/m/SZ.svg",code:"SZ",dial_code:"+268"},{name:"Su\xE9cia",flag:"/flags/m/SE.svg",code:"SE",dial_code:"+46"},{name:"Su\xED\xE7a",flag:"/flags/m/CH.svg",code:"CH",dial_code:"+41"},{name:"S\xEDria",flag:"/flags/m/SI.svg",code:"SI",dial_code:"+963"},{name:"Taiwan",flag:"/flags/m/TW.svg",code:"TW",dial_code:"+886"},{name:"Tajiquist\xE3o",flag:"/flags/m/TJ.svg",code:"TJ",dial_code:"+992"},{name:"Tail\xE2ndia",flag:"/flags/m/TH.svg",code:"TH",dial_code:"+66"},{name:"Tanz\xE2nia - Rep\xFAblica Unida",flag:"/flags/m/TZ.svg",code:"TZ",dial_code:"+255"},{name:"Togo",flag:"/flags/m/TG.svg",code:"TG",dial_code:"+228"},{name:"Tonga",flag:"/flags/m/TO.svg",code:"TO",dial_code:"+676"},{name:"Trinidad e Tobago",flag:"/flags/m/TT.svg",code:"TT",dial_code:"+1868"},{name:"Tun\xEDsia",flag:"/flags/m/TN.svg",code:"TN",dial_code:"+216"},{name:"Turquia",flag:"/flags/m/TR.svg",code:"TR",dial_code:"+90"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turcomenist\xE3o",flag:"/flags/m/TM.svg",code:"TM",dial_code:"+993"},{name:"Turks & Ilhas Caicos",flag:"/flags/m/TC.svg",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"/flags/m/TV.svg",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"/flags/m/UG.svg",code:"UG",dial_code:"+256"},{name:"Reino Unido",flag:"/flags/m/GB-UKM.svg",code:"GB-UKM",dial_code:"+44"},{name:"Ucr\xE2nia",flag:"/flags/m/UA.svg",code:"UA",dial_code:"+380"},{name:"Emirados \xC1rabes Unidos",flag:"/flags/m/AE.svg",code:"AE",dial_code:"+971"},{name:"Uruguai",flag:"/flags/m/UY.svg",code:"UY",dial_code:"+598"},{name:"Estados Unidos",flag:"/flags/m/US.svg",code:"US",dial_code:"+1"},{name:"Uzbequist\xE3o",flag:"/flags/m/UZ.svg",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"/flags/m/VU.svg",code:"VU",dial_code:"+678"},{name:"Cidade do Vaticano",flag:"/flags/m/VA.svg",code:"VA",dial_code:"+379"},{name:"Venezuela",flag:"/flags/m/VE.svg",code:"VE",dial_code:"+58"},{name:"Vietn\xE3",flag:"/flags/m/VN.svg",code:"VN",dial_code:"+84"},{name:"Ilhas Virgens Brit\xE2nicas",flag:"/flags/m/VG.svg",code:"VG",dial_code:"+1284"},{name:"Ilhas Virgens Americanas",flag:"/flags/m/VI.svg",code:"VI",dial_code:"+1340"},{name:"Wallis e Futuna",flag:"/flags/m/WF.svg",code:"WF",dial_code:"+681"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"I\xEAmen (Norte)",flag:"/flags/m/YE.svg",code:"YE",dial_code:"+969"},{name:"Z\xE2mbia",flag:"/flags/m/ZM.svg",code:"ZM",dial_code:"+260"},{name:"Zimb\xE1bue",flag:"/flags/m/ZW.svg",code:"ZW",dial_code:"+263"}],_5=E('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><div class="relative makebot-country-select flex justify-center items-center"><div class="pl-3 pr-0 flex items-center gap-1"><img alt=Bandeira class="w-8 h-6 rounded-sm"></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),T5=E("<option>"),S5=e=>{let[t,r]=N(jt(e.defaultCountryCode)?"INT":e.defaultCountryCode),[n,a]=N(e.defaultValue??""),i,o=p=>{if(a(p),p?.startsWith("+")&&p.length>2){let h=wn.reduce((y,m)=>!m?.dial_code||y!==null&&!y.dial_code?y:p?.startsWith(m.dial_code)&&m.dial_code.length>(y?.dial_code.length??0)?m:y,null);h&&r(h.code)}},s=()=>i?.value!==""&&i?.reportValidity(),l=()=>{let p=wn.find(h=>h.code===t())?.dial_code;if(s()){let h=i?.value??n();e.onSubmit({type:"text",value:h.startsWith("+")?h:`${p??""}${h}`})}else i?.focus()},c=p=>{p.key==="Enter"&&l()},u=p=>{let h=wn.find(m=>m.code===p.currentTarget.value);if(!h)return;let y=wn.find(m=>m.code===t());(n()===""||y&&n()===y.dial_code)&&a(h.dial_code),r(h.code),i?.focus()};$e(()=>{if(!ur()&&i&&i.focus({preventScroll:!0}),jt(n())){let p=wn.find(h=>h.code===t());p?.dial_code&&a(p.dial_code)}window.addEventListener("message",d)}),Ie(()=>{window.removeEventListener("message",d)});let d=p=>{let{data:h}=p;h.isFromMakebot&&h.command==="setInputValue"&&a(h.value)};return(()=>{var p=_5(),h=p.firstChild,y=h.firstChild,m=y.firstChild,v=m.firstChild,w=m.nextSibling;return p.$$keydown=c,T(m,g(yb,{class:"w-3"}),null),w.addEventListener("change",u),T(w,g(Je,{each:wn,children:b=>(()=>{var x=T5();return T(x,()=>b.name,null),T(x,(()=>{var f=j(()=>!!(b.dial_code&&String(b.dial_code).trim()!==""));return()=>f()?` (${b.dial_code})`:""})(),null),U(()=>x.selected=b.code===t()),U(()=>x.value=b.code),x})()})),T(h,g(io,{type:"tel",ref(b){var x=i;typeof x=="function"?x(b):i=b},get value(){return n()},onInput:o,get placeholder(){return e.labels?.placeholder??uh.labels.placeholder},get autofocus(){return!ur()}}),null),T(p,g(Xt,{type:"button",class:"h-[42px]","on:click":l,get children(){return e.labels?.button??uh.labels.button}}),null),U(()=>de(v,"src",wn.find(b=>t()===b.code)?.flag)),p})()};at(["keydown"]);var qr={buttonType:"Numbers",length:10,labels:{button:Fr},startsAt:0,customIcon:{isEnabled:!1},isOneClickSubmitEnabled:!1},E5=E('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),C5=E('<span class="text-sm w-full rating-label">'),P5=E('<span class="text-sm w-full text-right pr-2 rating-label">'),O5=E("<div role=checkbox>"),I5=E("<div>"),N5=e=>{let[t,r]=N(e.defaultValue?Number(e.defaultValue):void 0),n=l=>{l.preventDefault();let c=t();Vt(c)||e.onSubmit({type:"text",value:c.toString()})},a=l=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:l.toString()}),r(l)},i=e.block.options?.labels?.button,o=i==="",s=i??qr.labels.button;return(()=>{var l=E5(),c=l.firstChild,u=c.nextSibling;return l.addEventListener("submit",n),T(l,(()=>{var d=j(()=>!!e.block.options?.labels?.left);return()=>d()&&(()=>{var p=C5();return T(p,()=>e.block.options.labels.left),p})()})(),c),T(c,g(Je,{get each(){return Array.from(Array((e.block.options?.length??qr.length)+((e.block.options?.buttonType??qr.buttonType)==="Numbers"?-((e.block.options?.startsAt??qr.startsAt)-1):0)))},children:(d,p)=>g(A5,De(()=>e.block.options,{get rating(){return t()},get idx(){return p()+((e.block.options?.buttonType??qr.buttonType)==="Numbers"?e.block.options?.startsAt??qr.startsAt:1)},onClick:a}))})),T(l,(()=>{var d=j(()=>!!e.block.options?.labels?.right);return()=>d()&&(()=>{var p=P5();return T(p,()=>e.block.options.labels.right),p})()})(),u),T(u,(()=>{var d=j(()=>!!Se(t()));return()=>d()&&g(Xt,{disableIcon:!o,children:s})})()),l})()},A5=e=>{let t=r=>{r.preventDefault(),e.onClick(e.idx)};return g(lt,{get children(){return[g(se,{get when(){return(e.buttonType??qr.buttonType)==="Numbers"},get children(){return[g(X,{get when(){return e.isOneClickSubmitEnabled},get children(){return g(nr,{"on:click":t,get children(){return e.idx}})}}),g(X,{get when(){return!e.isOneClickSubmitEnabled},get children(){var r=O5();return sr(r,"click",t),T(r,()=>e.idx),U(n=>{var a=Se(e.rating)&&e.idx<=e.rating,i="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none makebot-selectable"+(Se(e.rating)&&e.idx<=e.rating?" selected":"");return a!==n.e&&de(r,"aria-checked",n.e=a),i!==n.t&&ne(r,n.t=i),n},{e:void 0,t:void 0}),r}})]}}),g(se,{get when(){return(e.buttonType??qr.buttonType)!=="Numbers"},get children(){var r=I5();return sr(r,"click",()=>e.onClick(e.idx)),U(n=>{var a="flex justify-center items-center rating-icon-container cursor-pointer "+(Se(e.rating)&&e.idx<=e.rating?"selected":""),i=e.customIcon?.isEnabled&&ot(e.customIcon?.svg?.trim())?e.customIcon.svg:R5;return a!==n.e&&ne(r,n.e=a),i!==n.t&&(r.innerHTML=n.t=i),n},{e:void 0,t:void 0}),r}})]}})},R5='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',D5=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),dh=e=>(()=>{var t=D5();return Ke(t,e,!0,!0),t})(),M5=E('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2px stroke-linecap=round stroke-linejoin=round><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx=10 cy=12 r=2></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),L5=e=>(()=>{var t=M5();return Ke(t,e,!0,!0),t})(),F5=E("<input type=file id=document-upload multiple class=hidden>"),$5=E('<input type=file id=photos-upload accept="image/avif, image/*, video/*"multiple class=hidden>'),U5=E('<label aria-label="Adicionar anexos"for=document-upload>'),j5=E("<label> Documento"),B5=E("<label> Fotos & v\xEDdeos"),z5=e=>[(()=>{var t=F5();return t.addEventListener("change",r=>{r.currentTarget.files&&(e.onNewFiles(r.currentTarget.files),r.currentTarget.value="")}),t})(),(()=>{var t=$5();return t.addEventListener("change",r=>{r.currentTarget.files&&(e.onNewFiles(r.currentTarget.files),r.currentTarget.value="")}),t})(),(()=>{var t=U5();return T(t,g(dh,{class:"w-5"})),U(()=>ne(t,ae("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:hidden",e.class))),t})(),g(Tn.Root,{get children(){return[g(Tn.Trigger,{get class(){return ae("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none @xs:block hidden",e.class)},"aria-label":"Adicionar anexos",get children(){return g(dh,{class:"w-5"})}}),g(Tn.Positioner,{get children(){return g(Tn.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[g(Tn.Item,{value:"document",asChild:t=>(()=>{var r=j5(),n=r.firstChild;return Ke(r,De(t,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),T(r,g(Gf,{class:"w-4"}),n),r})()}),g(Tn.Item,{value:"photos",asChild:t=>(()=>{var r=B5(),n=r.firstChild;return Ke(r,De(t,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),T(r,g(L5,{class:"w-4"}),n),r})()})]}})}})]}})],V5=E('<svg viewBox="0 0 384 512"stroke=currentColor fill=currentColor><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),H5=e=>(()=>{var t=V5();return Ke(t,e,!0,!0),t})(),Z5=E('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"rows=6 data-testid=textarea required>'),G5=e=>{let[t,r]=Rt(e,["ref","onInput","inputmode"]),n=ur();return(()=>{var a=Z5();a.$$input=o=>t.onInput(o.currentTarget.value);var i=t.ref;return typeof i=="function"?Ve(i,a):t.ref=a,a.autofocus=!n,Ke(a,De({get inputmode(){return t.inputmode}},r),!1,!1),a})()};at(["input"]);var W5=Fh(Jb(),1),Do={isLong:!1,labels:{button:Fr,placeholder:"Digite sua resposta..."},audioClip:{isEnabled:!1,visibility:"Auto"},attachments:{isEnabled:!1,visibility:"Auto"}},q5=`
|
|
54
|
+
const gainFactor = 3;
|
|
55
|
+
|
|
56
|
+
class VolumeProcessor extends AudioWorkletProcessor {
|
|
57
|
+
constructor() {
|
|
58
|
+
super();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
process(inputs) {
|
|
62
|
+
const input = inputs[0];
|
|
63
|
+
if (input.length > 0) {
|
|
64
|
+
const channelData = input[0];
|
|
65
|
+
let sum = 0;
|
|
66
|
+
for (let i = 0; i < channelData.length; i++) {
|
|
67
|
+
sum += channelData[i] * channelData[i];
|
|
68
|
+
}
|
|
69
|
+
const rms = Math.sqrt(sum / channelData.length);
|
|
70
|
+
this.port.postMessage(rms * 100 * gainFactor)
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
registerProcessor("volume-processor", VolumeProcessor);
|
|
77
|
+
|
|
78
|
+
`,K5=E('<div><button class="p-0.5 rounded-full"aria-label="Parar de gravar"></button><div class="relative flex w-full"><canvas class="w-full h-[42px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[42px]"></div><div class="absolute right-gradient w-3 right-0 h-[42px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),kn=3,_n=3,Y5=60,X5=10,J5=5,Q5=90,e9=e=>{let[t,r]=N(0),n,a,i,o,s,l,c,u=[],d,p,h=0,y=st(e.buttonsTheme?.backgroundColor??qg[mf(e.context.makebot.version)?e.context.makebot.version:"6"]).join(", "),m=()=>{if(!i||!n||!p)return;let b=performance.now(),x=b-p;p=b,i.clearRect(0,0,n.width,n.height),i.fillStyle=`rgba(${y}, 0.2)`;for(let f=0;f<(n.width+_n)/(kn+_n);f++){let k=f*(kn+_n)-h,_=n.height*(X5/100),C=(n.height-_)/2;i.beginPath(),i.roundRect(k,C,kn,_,5),i.fill()}i.fillStyle=`rgba(${y}, 1)`;for(let f=0;f<u.length;f++){let k=n.width+(f+1)*(kn+_n)-h,_=n.height*((u[f]??0)/100),C=(n.height-_)/2;i.beginPath(),i.roundRect(k,C,kn,_,5),i.fill()}h+=Y5*(x/1e3),a=requestAnimationFrame(m)},v=async()=>{n&&(c=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(c),i||(i=n.getContext("2d")??void 0),d=setInterval(()=>{r(b=>b+=1)},1e3),o=new AudioContext,s=await t9(o),l=o.createMediaStreamSource(c),l.connect(s),s.connect(o.destination),s.port.onmessage=b=>{((n.width+_n)/(kn+_n)+u.length)*(kn+_n)<n.width+h&&u.push(Math.min(Math.max(b.data,J5),Q5))},p=performance.now(),a=requestAnimationFrame(m))},w=()=>{i&&n&&i.clearRect(0,0,n.width,n.height),h=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,o?.close(),o=void 0,c?.getTracks().forEach(b=>b.stop()),c=void 0,u=[],clearTimeout(d),r(0),cancelAnimationFrame(a),e.onAbortRecording()};return Ye(()=>{e.recordingStatus==="asking"?v():e.recordingStatus==="stopped"&&w()}),Ie(()=>{w()}),(()=>{var b=K5(),x=b.firstChild,f=x.nextSibling,k=f.firstChild,_=f.nextSibling;sr(x,"click",w),T(x,g(rl,{class:"w-4"}));var C=n;return typeof C=="function"?Ve(C,k):n=k,T(_,()=>r9(t())),U(()=>ne(b,ae("w-full gap-2 items-center transition-opacity px-2 makebot-recorder",e.recordingStatus==="started"?"opacity-1 flex":"opacity-0 hidden"))),b})()},t9=async e=>{let t=new Blob([q5],{type:"application/javascript"}),r=URL.createObjectURL(t);return await e.audioWorklet.addModule(r),new AudioWorkletNode(e,"volume-processor")},r9=e=>{let t=Math.floor(e/60),r=(e%60).toString().padStart(2,"0");return`${t}:${r}`},n9=E('<div class="p-2 flex gap-2 border-input-border overflow-auto"style=border-bottom-width:1px>'),a9=E("<div>"),i9=E("<div><div>"),o9=e=>{let[t,r]=N(e.defaultValue??""),[n,a]=N([]),[i,o]=N(void 0),[s,l]=N(!1),[c,u]=N("stopped"),d,p,h=[],y=D=>r(D),m=()=>d?.value!==""&&d?.reportValidity(),v=async()=>{if(c()==="started"&&p){p.stop();return}if(m()){let D;if(n().length>0){o(void 0);let V=await ws({apiHost:e.context.apiHost??Pr({ignoreChatApiUrl:!0}),files:n().map(F=>({file:F,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:F.name}})),onUploadProgress:o});if(V.type==="error"){Er.create({description:V.error});return}D=V.urls?.map((F,le)=>F?{...F,blobUrl:URL.createObjectURL(n()[le])}:null).filter(Se)}e.onSubmit({type:"text",value:d?.value??t(),attachments:D})}else d?.focus()},w=D=>{e.block.options?.isLong||D.key==="Enter"&&v()},b=D=>{e.block.options?.isLong&&D.key==="Enter"&&(D.metaKey||D.ctrlKey)&&v()};$e(()=>{!ur()&&d&&d.focus({preventScroll:!0}),window.addEventListener("message",x)}),Ie(()=>{window.removeEventListener("message",x)});let x=D=>{let{data:V}=D;V.isFromMakebot&&V.command==="setInputValue"&&r(V.value)},f=D=>{D.preventDefault(),l(!0)},k=()=>l(!1),_=D=>{D.preventDefault(),D.stopPropagation(),D.dataTransfer?.files&&C(D.dataTransfer.files)},C=D=>{let V=Array.from(D).map(F=>Zf({existingFiles:n(),newFile:F,params:{sizeLimit:An("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")?Number(An("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")):void 0},context:e.context,onError:({description:le})=>{Er.create({description:le})}})).filter(Se);V.length!==0&&a(F=>[...V,...F])},P=D=>{a(V=>V.filter((F,le)=>le!==D))},I=()=>{u("asking")},L=D=>{let V,F=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";p=new MediaRecorder(D,{mimeType:F}),p.ondataavailable=le=>{le.data.size!==0&&h.push(le.data)},p.onstart=()=>{V=Date.now()},p.onstop=async()=>{if(c()!=="started"||h.length===0)return;let le=Date.now()-V,O=await(0,W5.fixWebmDuration)(new Blob(h,{type:F}),le),A=new File([O],`rec-${e.block.id}-${Date.now()}.${F==="audio/webm"?"webm":"mp4"}`,{type:F});o(void 0);let z=await ws({apiHost:e.context.apiHost??Pr({ignoreChatApiUrl:!0}),files:[{file:A,input:{blockId:e.block.id,sessionId:e.context.sessionId,fileName:A.name}}],onUploadProgress:o});if(z.type==="error"){Er.create({description:z.error});return}let ge=z.urls.filter(Se).map(me=>me.url);e.onSubmit({type:"recording",url:ge[0],blobUrl:URL.createObjectURL(A)})},p.start(),u("started")},R=()=>{p?.stop(),u("stopped"),p=void 0,h=[]};return(()=>{var D=i9(),V=D.firstChild;return D.addEventListener("dragleave",k),D.addEventListener("dragover",f),D.addEventListener("drop",_),D.$$keydown=w,T(V,g(e9,{get recordingStatus(){return c()},get buttonsTheme(){return e.context.makebot.theme.chat?.buttons},get context(){return e.context},onRecordingConfirmed:L,onAbortRecording:R}),null),T(V,g(X,{get when(){return c()!=="started"},get children(){return[g(X,{get when(){return n().length},get children(){var F=n9();return T(F,g(Je,{get each(){return n()},children:(le,O)=>g(qf,{file:le,get uploadProgressPercent(){return j(()=>!!i())()?j(()=>i()?.fileIndex===O())()?20:O()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>P(O())})})),F}}),(()=>{var F=a9();return T(F,(()=>{var le=j(()=>!!e.block.options?.isLong);return()=>le()?g(G5,{ref(O){var A=d;typeof A=="function"?A(O):d=O},onInput:y,onKeyDown:b,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??Do.labels.placeholder}}):g(io,{ref(O){var A=d;typeof A=="function"?A(O):d=O},onInput:y,get value(){return t()},get inputmode(){return e.block.options?.inputMode},get placeholder(){return e.block.options?.labels?.placeholder??Do.labels.placeholder}})})(),null),T(F,g(X,{get when(){return j(()=>!!(e.block.options?.attachments?.isEnabled??Do.attachments.isEnabled))()&&e.block.options?.attachments?.saveVariableId},get children(){return g(z5,{onNewFiles:C,get class(){return ae(e.block.options?.isLong?"ml-2":void 0)}})}}),null),U(()=>ne(F,ae("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center"))),F})()]}}),null),T(D,g(lt,{get children(){return[g(se,{get when(){return j(()=>!t()&&c()!=="started")()&&e.block.options?.audioClip?.isEnabled},get children(){return g(nr,{class:"h-[42px] flex items-center","on:click":I,"aria-label":"Gravar voz",get children(){return g(H5,{class:"flex w-6 h-6"})}})}}),g(se,{when:!0,get children(){return g(Xt,{type:"button","on:click":v,get isDisabled(){return!!i()},class:"h-[42px]",get children(){return e.block.options?.labels?.button??Do.labels.button}})}})]}}),null),U(F=>{var le=ae("makebot-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&c()!=="started"?"max-w-full":"max-w-[350px]"),O=ae("relative makebot-input flex-col w-full",s()&&"filter brightness-95");return le!==F.e&&ne(D,F.e=le),O!==F.t&&ne(V,F.t=O),F},{e:void 0,t:void 0}),D})()};at(["keydown"]);var s9={labels:{button:Fr},format:"HH:mm"},l9=E('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full"><input class="focus:outline-none bg-transparent px-2 py-2 flex-1 w-full text-input makebot-datetime-input "type=time data-testid=time style=font-size:16px>'),c9=e=>{let[t,r]=N(e.defaultValue??""),n,a=c=>r(c),i=()=>n?.value!==""&&n?.reportValidity(),o=()=>{i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&o()};$e(()=>{!ur()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),Ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=l9(),u=c.firstChild,d=u.firstChild;c.$$keydown=s,d.$$input=h=>{a(h.currentTarget.value)};var p=n;return typeof p=="function"?Ve(p,d):n=d,T(c,g(Xt,{type:"button",class:"h-[42px]","on:click":o,get children(){return e.options?.labels?.button??s9.labels.button}}),null),U(()=>d.value=t()),c})()};at(["keydown","input"]);var ph={labels:{button:Fr,placeholder:"Digite um URL..."},retryMessageContent:"Este URL parece inv\xE1lido. Voc\xEA pode digit\xE1-lo novamente?"},u9=E('<div class="makebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex makebot-input w-full">'),d9=e=>{let[t,r]=N(e.defaultValue??""),n,a=c=>{r(c)},i=()=>n?.value!==""&&n?.reportValidity(),o=()=>{n&&!n?.value.startsWith("http")&&(n.value=`https://${n.value}`),i()?e.onSubmit({type:"text",value:n?.value??t()}):n?.focus()},s=c=>{c.key==="Enter"&&o()};$e(()=>{!ur()&&n&&n.focus({preventScroll:!0}),window.addEventListener("message",l)}),Ie(()=>{window.removeEventListener("message",l)});let l=c=>{let{data:u}=c;u.isFromMakebot&&u.command==="setInputValue"&&r(u.value)};return(()=>{var c=u9(),u=c.firstChild;return c.$$keydown=s,T(u,g(io,{ref(d){var p=n;typeof p=="function"?p(d):n=d},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??ph.labels.placeholder},onInput:a,type:"url",autocomplete:"url"})),T(c,g(Xt,{type:"button",class:"h-[42px]","on:click":o,get children(){return e.block.options?.labels?.button??ph.labels.button}}),null),c})()};at(["keydown"]);var p9=E(`<svg viewBox="0 0 156 156"class="size-6 @xs:size-10"data-testid=default-avatar><path fill=#08240E d="M155.542,79.516c0-14.207-1.133-18.566-5.055-19.699c-3.922-1.133-4.271-2.179-5.491-9.675
|
|
79
|
+
c-1.22-7.496-5.451-11.321-13.803-14.269c-8.352-2.948-34.635-4.913-53.303-4.913c-18.668,0-43.969,3.193-43.969,3.193
|
|
80
|
+
C15.919,36.02,10.329,47.963,9.545,54.239c-0.784,6.276-4.881,5.84-6.973,6.537C0.48,61.473,0.306,65.57,0.044,80.039
|
|
81
|
+
s0.61,19.96,3.399,21.529c2.789,1.569,5.317-0.959,6.363,6.363s0.959,9.065,6.276,14.73c3.234,3.446,8.108,5.145,12.199,5.932
|
|
82
|
+
c0.174,0.017,2.697,0.262,6.666,0.603c0.623,0.002,1.094,0.048,1.436,0.122c10.119,0.854,27.64,2.153,40.553,2.153
|
|
83
|
+
c19.116,0,46.882-2.705,47.192-2.736c3.899-0.537,10.509-1.84,15.55-5.901c6.276-5.055,7.845-12.377,7.932-16.822
|
|
84
|
+
c0.087-4.445,3.051-4.445,6.363-5.993C157.285,98.473,155.542,93.723,155.542,79.516z"></path><path fill=#FFFFFF d="M74.475,37.829c26.681,0.283,51.209,2.596,56.465,5.711c5.256,3.115,8.76,11.162,9.164,21.675
|
|
85
|
+
s0.674,26.607-0.943,39.197s-7.816,17.133-21.966,18.171s-29.648,1.817-40.698,1.947c-11.05,0.13-44.471,0.13-52.287-4.932
|
|
86
|
+
c-7.816-5.062-8.759-12.979-9.299-26.478s0.27-28.944,1.078-35.952c0.809-7.009,4.043-14.926,15.093-16.484
|
|
87
|
+
C42.132,39.127,65.726,37.736,74.475,37.829z"></path><path fill=#77C367 d="M77.426,37.772c25.697,0.283,49.321,2.596,54.383,5.711c5.062,3.115,8.437,11.162,8.826,21.675
|
|
88
|
+
s0.649,26.607-0.909,39.197c-1.557,12.59-7.547,16.912-21.156,18.171c-13.347,1.235-40.301,2.489-53.842,1.98
|
|
89
|
+
c-10.636-0.4-28.186,0.096-35.714-4.965c-7.528-5.062-8.437-12.979-8.956-26.478c-0.519-13.498,0.26-28.944,1.038-35.952
|
|
90
|
+
s3.9-15.429,14.543-16.987C46.282,38.567,69,37.679,77.426,37.772z"></path><path fill=#08230D d="M77.047,52.191c2.479,0.152,8.891-2.876,13.467-4.184c4.576-1.307,15.943-2.883,26.933,4.838
|
|
91
|
+
c12.469,8.76,15.645,27.192,8.024,39.354c-6.145,9.806-17.389,13.597-25.674,13.597c-8.319,0-11.767-2.484-15.951-4.184
|
|
92
|
+
c-4.184-1.7-6.95-2.267-11.918-0.175c-4.968,2.092-8.038,4.359-16.976,4.359c-9.496,0-30.202-4.3-27.979-32.352
|
|
93
|
+
s26.066-28.575,35.039-26.352C68.927,48.805,70.641,51.798,77.047,52.191z"></path><path fill=#FFFFFF d="M75.886,57.076c2.278,0.126,8.168-2.393,12.372-3.481s14.647-2.399,24.744,4.025
|
|
94
|
+
c11.455,7.288,14.373,22.624,7.371,32.742c-5.645,8.158-15.975,11.313-23.587,11.313c-7.643,0-10.81-2.067-14.654-3.481
|
|
95
|
+
c-3.844-1.414-6.385-1.886-10.949-0.146c-4.564,1.74-7.384,3.627-15.597,3.627c-8.724,0-27.747-3.578-25.705-26.917
|
|
96
|
+
s23.947-23.774,32.191-21.925C68.426,54.259,70,56.749,75.886,57.076z"></path><path fill=#999999 d="M113.64,58.04c-0.24-0.165-0.492-0.373-0.741-0.531c-10.097-6.424-20.54-5.113-24.744-4.025
|
|
97
|
+
c-4.204,1.088-10.094,3.607-12.372,3.481c-5.886-0.326-7.46-2.817-13.813-4.242c-7.14-1.602-24.387-1.478-30.242,13.744
|
|
98
|
+
c2.42-2.656,12.927-13.636,22.951-13.036c12.391,0.742,12.88,5.578,20.202,5.143c7.322-0.436,11.769-5.175,21.374-4.968
|
|
99
|
+
C102.882,53.748,109.919,56.421,113.64,58.04z"></path><polygon fill=#08240E points="72.684,32.391 85.986,13.229 87.816,14.275 80.104,32.265 "></polygon><circle fill=#08240E cx=87.468 cy=12.837 r=5.317></circle><path fill=#77C367 d="M3.85,64.179c0,0-0.902,7.855-0.782,17.108c0.12,9.253,0.361,15.077,1.083,17.023
|
|
100
|
+
c0.722,1.946,3.128,1.777,3.128,1.777V62.405C7.279,62.405,5.182,62.459,3.85,64.179z"></path><path fill=#77C367 d="M150.906,64.779c0,0,1.18,7.351,1.387,16.054c0.208,8.703,0.173,14.188-0.479,16.044
|
|
101
|
+
c-0.652,1.857-3.063,1.789-3.063,1.789l-1.335-35.426C147.417,63.24,149.514,63.212,150.906,64.779z"></path><path fill=#000000 d="M58.793,65.088c-1.388-2.69-4.472-2.69-5.706,0c-0.925,1.883-1.079,14.526-1.079,17.755c0,1.345,0.154,2.69,0.617,4.035
|
|
102
|
+
c0.308,1.076,0.617,1.883,1.234,2.421c1.079,1.345,3.084,1.345,4.318,0c0.617-0.807,1.079-1.883,1.388-3.228
|
|
103
|
+
c0.154-1.076,0.308-2.152,0.463-3.228C60.027,79.615,59.718,66.971,58.793,65.088z"></path><path fill=#000000 d="M100.631,65.088c-1.388-2.69-4.472-2.69-5.706,0C94,66.971,93.846,79.615,93.846,82.843c0,1.345,0.154,2.69,0.617,4.035
|
|
104
|
+
c0.308,1.076,0.617,1.883,1.234,2.421c1.079,1.345,3.084,1.345,4.318,0c0.617-0.807,1.079-1.883,1.388-3.228
|
|
105
|
+
c0.154-1.076,0.308-2.152,0.463-3.228C101.865,79.615,101.556,66.971,100.631,65.088z">`),h9=({backgroundColor:e})=>p9(),g9=E("<span class=text-4xl>"),m9=E('<img alt="Avatar do bot"class="flex justify-center items-center relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"elementtiming="Bot avatar">'),f9=E('<figure class="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 w-6 h-6 text-sm @xs:w-10 @xs:h-10 @xs:text-xl"><img alt="Avatar do bot"class="rounded-full object-cover w-full h-full"elementtiming="Bot avatar"fetchpriority=high>'),xb=e=>g(X,{get when(){return ot(e.src)},keyed:!0,get fallback(){return g(h9,{get backgroundColor(){return j(()=>!!e.isChatContainerLight)()?We.gray.dark[2]:We.gray.dark[1]}})},get children(){return g(lt,{get children(){return[g(se,{get when(){return b9(e.src??"")},get children(){var t=g9();return T(t,()=>e.src),t}}),g(se,{get when(){return pi(e.src)},get children(){var t=m9();return U(()=>de(t,"src",e.src)),t}}),g(se,{when:!0,get children(){var t=f9(),r=t.firstChild;return U(()=>de(r,"src",e.src)),t}})]}})}}),b9=e=>/^\p{Emoji}$/u.test(e),y9=E("<div>"),hh=E('<div class="flex gap-1 overflow-auto max-w-[350px] flex-wrap justify-end @xs:items-center @xs:flex-nowrap">'),v9=E('<span class="px-[15px] py-[7px]">'),x9=E('<img alt=Attachment class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),w9=E('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full makebot-guest-bubble flex flex-col"data-testid=guest-bubble>'),k9=E("<img>"),_9=E('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap makebot-guest-bubble flex flex-col"data-testid=guest-bubble><audio controls>'),T9=e=>(()=>{var t=y9();return T(t,g(lt,{get children(){return[g(se,{get when(){return e.answer?.type==="text"},get children(){return g(S9,{get answer(){return e.answer}})}}),g(se,{get when(){return e.answer?.type==="recording"},get children(){return g(E9,{get answer(){return e.answer}})}})]}}),null),T(t,g(X,{get when(){return e.theme.chat?.guestAvatar?.isEnabled??gc},get children(){return g(xb,{get src(){return e.theme.chat?.guestAvatar?.url},get isChatContainerLight(){return Su({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})}}),null),U(()=>ne(t,ae("flex justify-end items-end animate-fade-in gap-2 guest-container",(e.theme.chat?.hostAvatar?.isEnabled??hi)&&"ml-7 @xs:ml-[50px]"))),t})(),S9=e=>{let[t,r]=N();return(()=>{var n=w9(),a=n.firstChild;return T(n,g(X,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{var i=hh();return T(i,g(Je,{get each(){return e.answer.attachments?.filter(o=>o.type.startsWith("image"))},children:(o,s)=>(()=>{var l=k9();return l.$$click=()=>r(o.blobUrl??o.url),U(c=>{var u=o.blobUrl??o.url,d=`Attached image ${s()+1}`,p=ae("makebot-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter(h=>h.type.startsWith("image")).length>1&&"max-w-[90%]");return u!==c.e&&de(l,"src",c.e=u),d!==c.t&&de(l,"alt",c.t=d),p!==c.a&&ne(l,c.a=p),c},{e:void 0,t:void 0,a:void 0}),l})()})),i})(),(()=>{var i=hh();return T(i,g(Je,{get each(){return e.answer.attachments?.filter(o=>!o.type.startsWith("image"))},children:o=>g(Wf,{get file(){return{name:o.url.split("/").at(-1)}}})})),i})()]}}),a),T(a,g(X,{get when(){return ot(e.answer.label??e.answer.value)},get children(){var i=v9();return T(i,()=>e.answer.label??e.answer.value),i}})),T(n,g(qu,{get isOpen(){return t()!==void 0},onClose:()=>r(void 0),get children(){var i=x9();return U(()=>de(i,"src",t())),i}}),null),n})()},E9=e=>(()=>{var t=_9(),r=t.firstChild,n=r.firstChild;return U(()=>de(n,"src",e.answer.blobUrl??e.answer.url)),t})();at(["click"]);var C9=E('<div class="flex flex-shrink-0 items-center w-6 h-6 @xs:w-10 @xs:h-10">'),P9=E('<div class="flex justify-end animate-fade-in gap-1 @xs:gap-2 makebot-input-container">'),O9=e=>{let[t,r]=N(!1),n=async i=>{e.input.type==="cards"||e.input.type==="choice input"||e.input.type==="list input"?console.log("\u{1F50D} Cards/Buttons block - mantendo vis\xEDvel ap\xF3s submit"):t()&&(console.log("\u{1F50D} Mantendo card vis\xEDvel ap\xF3s submit"),r(!1)),e.onSubmit(i)},a=i=>{e.onSkip(i)};return g(lt,{get children(){return[g(se,{get when(){return j(()=>!!(e.input.answer&&e.input.answer.status!=="retry"&&e.input.type!=="cards"&&e.input.type!=="choice input"))()&&e.input.type!=="list input"},get children(){return g(T9,{get answer(){return e.input.answer},get theme(){return e.theme}})}}),g(se,{get when(){return Vt(e.input.answer)||e.input.answer?.status==="retry"||e.input.type==="cards"||e.input.type==="choice input"||e.input.type==="list input"},get children(){var i=P9(),o=e.ref;return typeof o=="function"?Ve(o,i):e.ref=i,T(i,g(X,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??hi},get children(){return C9()}}),null),T(i,g(N9,{get context(){return e.context},get block(){return e.input},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return j(()=>e.input.answer?.status==="retry")()?I9(e.input.answer):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:n,onSkip:a}),null),U(()=>de(i,"data-blockid",e.input.id)),i}})]}})},I9=e=>{if(e)return e.type==="text"?e.value:e.url},N9=e=>{let t=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),r=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??vb.labels.success});return g(lt,{get children(){return[g(se,{get when(){return e.block.type==="text input"},get children(){return g(o9,{get block(){return e.block},get defaultValue(){return t()},get context(){return e.context},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="number input"},get children(){return g(g5,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="email input"},get children(){return g(m4,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="url input"},get children(){return g(d9,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="phone number input"},get children(){return g(S5,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="date input"},get children(){return g(p4,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="time input"},get children(){return g(c9,{get options(){return e.block.options},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return A9(e.block)},children:n=>{let a=n(),i=a.options;return g(lt,{get children(){return[g(se,{get when(){return!i?.isMultipleChoice},get children(){return g(_3,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return a.items},options:i,get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return i?.isMultipleChoice},get children(){return g(L3,{get defaultItems(){return a.items},options:i,get onSubmit(){return e.onSubmit}})}})]}})}}),g(se,{get when(){return R9(e.block)},children:n=>g(o5,{get block(){return n()},get onSubmit(){return e.onSubmit}})}),g(se,{get when(){return e.block.type==="rating input"},get children(){return g(N5,{get block(){return e.block},get defaultValue(){return t()},get onSubmit(){return e.onSubmit}})}}),g(se,{get when(){return e.block.type==="file input"},get children(){return g(R4,{get context(){return e.context},get block(){return e.block},get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}}),g(se,{get when(){return e.block.type==="payment input"},get children(){return g(k5,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:r,get onTransitionEnd(){return e.onTransitionEnd}})}}),g(se,{get when(){return e.block.type==="cards"},get children(){return g(s4,{get block(){return e.block},get onSubmit(){return e.onSubmit},get onTransitionEnd(){return e.onTransitionEnd},get context(){return{sessionId:e.context.sessionId,apiHost:e.context.apiHost}},onAction:n=>{console.log("\u{1F50D} CardsCaroussel onAction:",n),console.log("\u{1F50D} A\xE7\xE3o executada:",n)}})}})]}})},A9=e=>e?.type==="choice input"?e:void 0,R9=e=>e?.type==="list input"?e:void 0,D9=E('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),mr=()=>D9(),M9={isAutoplayEnabled:!0},L9=E('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>'),F9=400,$9=100,Bl,U9=e=>{let t=!1,r,n,[a,i]=N(!!e.onTransitionEnd);return $e(()=>{Bl=setTimeout(()=>{t||(t=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(r),F9))},$9)}),Ie(()=>{Bl&&clearTimeout(Bl)}),(()=>{var o=L9(),s=o.firstChild,l=s.firstChild,c=l.firstChild,u=c.nextSibling,d=r;typeof d=="function"?Ve(d,o):r=o,T(c,(()=>{var h=j(()=>!!a());return()=>h()&&g(mr,{})})());var p=n;return typeof p=="function"?Ve(p,u):n=u,U(h=>{var y=ae("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),m=a()?"64px":"100%",v=a()?"32px":"100%",w=e.content?.url,b=e.onTransitionEnd?e.content?.isAutoplayEnabled??M9.isAutoplayEnabled:!1,x=ae("z-10 text-fade-in",a()?"opacity-0 h-8 @xs:h-9":"opacity-100 m-2 h-[revert]");return y!==h.e&&ne(o,h.e=y),m!==h.t&&we(c,"width",h.t=m),v!==h.a&&we(c,"height",h.a=v),w!==h.o&&de(u,"src",h.o=w),b!==h.i&&(u.autoplay=h.i=b),x!==h.n&&ne(u,h.n=x),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),o})()},j9=E('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto max-h-[calc(var(--bot-container-height)-100px)]">'),zl,B9=400,z9=e=>{let t,[r,n]=N(!!e.onTransitionEnd),a;return $e(()=>{Jc({args:{...e.content.initFunction.args,makebotElement:a},content:e.content.initFunction.content}),e.content.waitForEventFunction&&Jc({args:{...e.content.waitForEventFunction.args,continueFlow:i=>e.onCompleted(i?{type:"text",value:i}:void 0)},content:e.content.waitForEventFunction.content}),zl=setTimeout(()=>{n(!1),setTimeout(()=>e.onTransitionEnd?.(t),B9)},2e3)}),Ie(()=>{zl&&clearTimeout(zl)}),(()=>{var i=j9(),o=i.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;typeof d=="function"?Ve(d,i):t=i,T(l,(()=>{var h=j(()=>!!r());return()=>h()&&g(mr,{})})());var p=a;return typeof p=="function"?Ve(p,u):a=u,U(h=>{var y=ae("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),m=r()?"64px":"100%",v=r()?"32px":"100%",w=ae("p-2 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100");return y!==h.e&&ne(i,h.e=y),m!==h.t&&we(l,"width",h.t=m),v!==h.a&&we(l,"height",h.a=v),w!==h.o&&ne(c,h.o=w),h},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},V9={height:400},H9=E('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id=embed-bubble-content class="w-full h-full">'),Vl,Z9=400,G9=e=>{let t,[r,n]=N(!!e.onTransitionEnd),a=i=>{e.content?.waitForEvent?.isEnabled&&ot(i.data.name)&&i.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&i.data.data?{type:"text",value:i.data.data}:void 0),window.removeEventListener("message",a))};return $e(()=>{Vl=setTimeout(()=>{n(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",a),setTimeout(()=>{e.onTransitionEnd?.(t)},Z9)},2e3)}),Ie(()=>{Vl&&clearTimeout(Vl),window.removeEventListener("message",a)}),(()=>{var i=H9(),o=i.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=c.firstChild,d=t;return typeof d=="function"?Ve(d,i):t=i,T(l,(()=>{var p=j(()=>!!r());return()=>p()&&g(mr,{})})()),U(p=>{var h=ae("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),y=r()?"64px":"100%",m=r()?"32px":"100%",v=ae("p-4 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--embed-bubble-height)]"),w=`${e.content?.height??V9.height}px`,b=e.content?.url;return h!==p.e&&ne(i,p.e=h),y!==p.t&&we(l,"width",p.t=y),m!==p.a&&we(l,"height",p.a=m),v!==p.o&&ne(c,p.o=v),w!==p.i&&we(c,"--embed-bubble-height",p.i=w),b!==p.n&&de(u,"src",p.n=b),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()},gh={clickLink:{alt:"Minha imagem"}},W9=E('<img elementtiming="Bubble image"fetchpriority=high>'),q9=E('<img class="max-h-[calc(100vh-1rem)] max-w-[calc(100%-1rem)] rounded-[6px] m-auto">'),K9=E('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),Y9=E("<a target=_blank rel=noreferrer>"),X9=E("<figure>"),J9=400,Q9=5e3,Mo,eO=e=>{let t,r,[n,a]=N(!1),[i,o]=N(!!e.onTransitionEnd),s=()=>{i()&&(o(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},J9))};$e(()=>{r&&(Mo=setTimeout(s,Q9),r.onload=()=>{clearTimeout(Mo),s()})}),Ie(()=>{Mo&&clearTimeout(Mo)});let l=()=>{a(!0)},c=()=>{a(!1)},u=(()=>{var d=W9(),p=r;return typeof p=="function"?Ve(p,d):r=d,U(h=>{var y=e.content?.url,m=e.content?.clickLink?.alt??gh.clickLink.alt,v=ae(i()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-96":void 0),w=e.content?.url?.startsWith("data:image/svg")?"100%":void 0,b=e.content?.url?.startsWith("data:image/svg")?"120px":"512px",x=i()?"32px":"auto";return y!==h.e&&de(d,"src",h.e=y),m!==h.t&&de(d,"alt",h.t=m),v!==h.a&&ne(d,h.a=v),w!==h.o&&we(d,"width",h.o=w),b!==h.i&&we(d,"max-height",h.i=b),x!==h.n&&we(d,"height",h.n=x),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),d})();return(()=>{var d=K9(),p=d.firstChild,h=p.firstChild,y=h.firstChild,m=t;return typeof m=="function"?Ve(m,d):t=d,T(y,(()=>{var v=j(()=>!!i());return()=>v()?g(mr,{}):null})()),T(h,(()=>{var v=j(()=>!!e.content?.clickLink);return()=>v()?(()=>{var w=Y9();return T(w,u),U(b=>{var x=e.content.clickLink.url,f=ae("z-10",i()?"h-8":"p-4");return x!==b.e&&de(w,"href",b.e=x),f!==b.t&&ne(w,b.t=f),b},{e:void 0,t:void 0}),w})():(()=>{var w=X9();return sr(w,"click",e.content?.url?.startsWith("data:image/svg")?void 0:l),T(w,u),U(()=>ne(w,ae("z-10 cursor-pointer",i()?"h-8 @xs:h-9":"p-4"))),w})()})(),null),T(d,g(qu,{get isOpen(){return n()},onClose:c,get children(){var v=q9();return U(w=>{var b=e.content?.url,x=e.content?.clickLink?.alt??gh.clickLink.alt;return b!==w.e&&de(v,"src",w.e=b),x!==w.t&&de(v,"alt",w.t=x),w},{e:void 0,t:void 0}),v}}),null),U(v=>{var w=ae("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=i()?"64px":"100%",x=i()?"32px":"100%";return w!==v.e&&ne(d,v.e=w),b!==v.t&&we(y,"width",v.t=b),x!==v.a&&we(y,"height",v.a=x),v},{e:void 0,t:void 0,a:void 0}),d})()},tO=E(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
|
|
106
|
+
.contact-error-card {
|
|
107
|
+
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
padding: 16px;
|
|
110
|
+
color: white;
|
|
111
|
+
box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
|
|
112
|
+
margin: 0;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: 16px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.contact-error-icon {
|
|
119
|
+
font-size: 24px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.contact-error-content {
|
|
123
|
+
flex: 1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.contact-error-title {
|
|
127
|
+
font-size: 16px;
|
|
128
|
+
font-weight: 600;
|
|
129
|
+
margin: 0 0 4px 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.contact-error-message {
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
margin: 0;
|
|
135
|
+
opacity: 0.9;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.contact-card {
|
|
139
|
+
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
|
|
140
|
+
border-radius: 12px;
|
|
141
|
+
padding: 20px;
|
|
142
|
+
color: white;
|
|
143
|
+
box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
|
|
144
|
+
max-width: 400px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.contact-header {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: 12px;
|
|
151
|
+
margin-bottom: 16px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.contact-icon {
|
|
155
|
+
font-size: 24px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.contact-title {
|
|
159
|
+
font-size: 20px;
|
|
160
|
+
font-weight: 600;
|
|
161
|
+
margin: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.contact-variable-warning {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 8px;
|
|
168
|
+
background: rgba(255, 255, 255, 0.2);
|
|
169
|
+
padding: 12px;
|
|
170
|
+
border-radius: 6px;
|
|
171
|
+
margin-bottom: 16px;
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.contact-warning-icon {
|
|
176
|
+
font-size: 16px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.contact-warning-text {
|
|
180
|
+
opacity: 0.9;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.contact-info {
|
|
184
|
+
margin: 16px 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.contact-info > div {
|
|
188
|
+
margin-bottom: 8px;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.contact-label {
|
|
193
|
+
font-weight: 600;
|
|
194
|
+
margin-right: 8px;
|
|
195
|
+
opacity: 0.9;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.contact-value {
|
|
199
|
+
font-weight: 500;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.contact-name {
|
|
203
|
+
font-size: 18px;
|
|
204
|
+
font-weight: bold;
|
|
205
|
+
margin-bottom: 12px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.contact-company {
|
|
209
|
+
font-size: 16px;
|
|
210
|
+
margin-bottom: 6px;
|
|
211
|
+
opacity: 0.9;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.contact-job-title {
|
|
215
|
+
font-size: 14px;
|
|
216
|
+
margin-bottom: 12px;
|
|
217
|
+
opacity: 0.8;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.contact-phone,
|
|
221
|
+
.contact-mobile,
|
|
222
|
+
.contact-email,
|
|
223
|
+
.contact-website {
|
|
224
|
+
font-size: 14px;
|
|
225
|
+
margin-bottom: 6px;
|
|
226
|
+
opacity: 0.9;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.contact-address {
|
|
230
|
+
font-size: 14px;
|
|
231
|
+
margin-bottom: 12px;
|
|
232
|
+
opacity: 0.9;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.contact-notes {
|
|
236
|
+
font-size: 14px;
|
|
237
|
+
margin-bottom: 6px;
|
|
238
|
+
opacity: 0.9;
|
|
239
|
+
font-style: italic;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.contact-actions {
|
|
243
|
+
display: flex;
|
|
244
|
+
gap: 12px;
|
|
245
|
+
margin-top: 16px;
|
|
246
|
+
flex-wrap: wrap;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.contact-action-btn {
|
|
250
|
+
flex: 1;
|
|
251
|
+
min-width: 120px;
|
|
252
|
+
padding: 12px;
|
|
253
|
+
border: none;
|
|
254
|
+
border-radius: 8px;
|
|
255
|
+
background: rgba(255, 255, 255, 0.2);
|
|
256
|
+
color: white;
|
|
257
|
+
font-weight: 600;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
transition: all 0.2s ease;
|
|
260
|
+
font-size: 14px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.contact-action-btn:hover {
|
|
264
|
+
background: rgba(255, 255, 255, 0.3);
|
|
265
|
+
transform: translateY(-1px);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.contact-action-success {
|
|
269
|
+
background: rgba(34, 197, 94, 0.8) !important;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.contact-action-error {
|
|
273
|
+
background: rgba(239, 68, 68, 0.8) !important;
|
|
274
|
+
}
|
|
275
|
+
`),rO=E("<div class=contact-error-card><div class=contact-error-icon>\u26A0\uFE0F</div><div class=contact-error-content><h3 class=contact-error-title>Aten\xE7\xE3o!</h3><p class=contact-error-message>Dados do contato n\xE3o definidos. Campos obrigat\xF3rios: "),nO=E('<div class=contact-card><div class=contact-header><div class=contact-icon aria-label="\xCDcone de contato">\u{1F464}</div><h3 class=contact-title>Cart\xE3o de Contato</h3></div><div class=contact-info>'),aO=E("<div class=contact-variable-warning><span class=contact-warning-icon>\u26A0\uFE0F</span><span class=contact-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),iO=E("<div class=contact-name><span class=contact-label>Nome:</span><span class=contact-value>"),oO=E("<div class=contact-company><span class=contact-label>Empresa:</span><span class=contact-value>"),sO=E("<div class=contact-job-title><span class=contact-label>Cargo:</span><span class=contact-value>"),lO=E("<div class=contact-phone><span class=contact-label>Telefone:</span><span class=contact-value>"),cO=E("<div class=contact-mobile><span class=contact-label>Celular:</span><span class=contact-value>"),uO=E("<div class=contact-email><span class=contact-label>Email:</span><span class=contact-value>"),dO=E("<div class=contact-website><span class=contact-label>Website:</span><span class=contact-value>"),pO=E("<div class=contact-address><span class=contact-label>Endere\xE7o:</span><span class=contact-value>"),hO=E("<div class=contact-notes><span class=contact-label>Notas:</span><span class=contact-value>"),gO=E("<div class=contact-actions><button>"),mh=E("<button>"),Hl,mO=400,On=e=>e?/{{[^}]+}}/.test(e):!1,fh=e=>{if(!e)return"";if(On(e))return e;let t=e.replace(/\D/g,"");return t.length===11?`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`:t.length===10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:e},fO=e=>e?On(e)?e:e.toLowerCase():"",bO=async e=>{try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},yO=e=>{let t=["BEGIN:VCARD","VERSION:3.0"];if(e?.firstName||e?.lastName){let r=`${e.firstName||""} ${e.lastName||""}`.trim();r&&t.push(`FN:${r}`)}if(e?.firstName||e?.lastName){let r=`${e.lastName||""};${e.firstName||""};;;`;t.push(`N:${r}`)}if(e?.company&&t.push(`ORG:${e.company}`),e?.jobTitle&&t.push(`TITLE:${e.jobTitle}`),e?.phone&&t.push(`TEL;TYPE=WORK:${e.phone.replace(/\D/g,"")}`),e?.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile.replace(/\D/g,"")}`),e?.email&&t.push(`EMAIL:${e.email}`),e?.website&&t.push(`URL:${e.website}`),e?.address||e?.city||e?.state||e?.zipCode||e?.country){let r=[e?.address||"",e?.city||"",e?.state||"",e?.zipCode||"",e?.country||""].filter(Boolean).join(";");r&&t.push(`ADR;TYPE=WORK:;;${r}`)}return e?.notes&&t.push(`NOTE:${e.notes}`),t.push("END:VCARD"),t.join(`\r
|
|
276
|
+
`)},vO=e=>{let t=[];return!e?.firstName&&!e?.lastName&&t.push("nome"),!e?.phone&&!e?.mobile&&!e?.email&&t.push("contato (telefone ou email)"),{isValid:t.length===0,missingFields:t}},xO=e=>{let t,[r,n]=N(!!e.onTransitionEnd),[a,i]=N({type:null,success:!1}),o=async(u,d)=>{try{await bO(u),i({type:d,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:d,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};$e(()=>{Hl=setTimeout(()=>{n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},mO)},2e3)}),Ie(()=>{Hl&&clearTimeout(Hl)});let s=vO(e.content),l=On(e.content?.firstName||"")||On(e.content?.lastName||"")||On(e.content?.phone||"")||On(e.content?.mobile||"")||On(e.content?.email||""),c=yO(e.content);return(()=>{var u=tO(),d=u.firstChild,p=d.firstChild,h=p.firstChild,y=h.nextSibling,m=t;return typeof m=="function"?Ve(m,u):t=u,T(h,(()=>{var v=j(()=>!!r());return()=>v()&&g(mr,{})})()),T(y,(()=>{var v=j(()=>!s.isValid);return()=>v()?(()=>{var w=rO(),b=w.firstChild,x=b.nextSibling,f=x.firstChild,k=f.nextSibling,_=k.firstChild;return T(k,()=>s.missingFields.join(", "),null),w})():(()=>{var w=nO(),b=w.firstChild,x=b.nextSibling;return T(w,l&&aO(),x),T(x,(()=>{var f=j(()=>!!(e.content?.firstName||e.content?.lastName));return()=>f()&&(()=>{var k=iO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>`${e.content?.firstName||""} ${e.content?.lastName||""}`.trim()),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.company);return()=>f()&&(()=>{var k=oO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>e.content.company),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.jobTitle);return()=>f()&&(()=>{var k=sO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>e.content.jobTitle),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.phone);return()=>f()&&(()=>{var k=lO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>fh(e.content.phone)),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.mobile);return()=>f()&&(()=>{var k=cO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>fh(e.content.mobile)),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.email);return()=>f()&&(()=>{var k=uO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>fO(e.content.email)),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.website);return()=>f()&&(()=>{var k=dO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>e.content.website),k})()})(),null),T(x,(()=>{var f=j(()=>!!(e.content?.address||e.content?.city||e.content?.state));return()=>f()&&(()=>{var k=pO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>[e.content?.address,e.content?.city,e.content?.state,e.content?.zipCode,e.content?.country].filter(Boolean).join(", ")),k})()})(),null),T(x,(()=>{var f=j(()=>!!e.content?.notes);return()=>f()&&(()=>{var k=hO(),_=k.firstChild,C=_.nextSibling;return T(C,()=>e.content.notes),k})()})(),null),T(w,(()=>{var f=j(()=>e.content?.showCopyButtons!==!1);return()=>f()&&(()=>{var k=gO(),_=k.firstChild;return T(k,(()=>{var C=j(()=>!!e.content?.phone);return()=>C()&&(()=>{var P=mh();return P.$$click=()=>e.content?.phone!=null&&o(e.content.phone,"phone"),T(P,()=>a().type==="phone"&&a().success?"\u2713 Copiado!":"\u{1F4DE} Copiar Telefone"),U(()=>ne(P,ae("contact-action-btn",a().type==="phone"&&a().success&&"contact-action-success",a().type==="phone"&&!a().success&&"contact-action-error"))),P})()})(),_),T(k,(()=>{var C=j(()=>!!e.content?.email);return()=>C()&&(()=>{var P=mh();return P.$$click=()=>e.content?.email!=null&&o(e.content.email,"email"),T(P,()=>a().type==="email"&&a().success?"\u2713 Copiado!":"\u{1F4E7} Copiar Email"),U(()=>ne(P,ae("contact-action-btn",a().type==="email"&&a().success&&"contact-action-success",a().type==="email"&&!a().success&&"contact-action-error"))),P})()})(),_),_.$$click=()=>o(c,"vcard"),T(_,()=>a().type==="vcard"&&a().success?"\u2713 Copiado!":"\u{1F4C7} Salvar Contato"),U(()=>ne(_,ae("contact-action-btn",a().type==="vcard"&&a().success&&"contact-action-success",a().type==="vcard"&&!a().success&&"contact-action-error"))),k})()})(),null),w})()})()),U(v=>{var w=ae("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),b=r()?"64px":"100%",x=r()?"32px":"100%",f=ae("p-4 z-20 text-fade-in",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4");return w!==v.e&&ne(u,v.e=w),b!==v.t&&we(h,"width",v.t=b),x!==v.a&&we(h,"height",v.a=x),f!==v.o&&ne(y,v.o=f),v},{e:void 0,t:void 0,a:void 0,o:void 0}),u})()};at(["click"]);var wO=E(`<div><style>
|
|
277
|
+
.location-variable-warning {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
gap: 8px;
|
|
281
|
+
background: rgba(255, 193, 7, 0.1);
|
|
282
|
+
padding: 12px;
|
|
283
|
+
border-radius: 6px;
|
|
284
|
+
margin-bottom: 16px;
|
|
285
|
+
font-size: 14px;
|
|
286
|
+
border: 1px solid rgba(255, 193, 7, 0.3);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.location-warning-icon {
|
|
290
|
+
font-size: 16px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.location-warning-text {
|
|
294
|
+
opacity: 0.9;
|
|
295
|
+
color: #856404;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.location-error-card {
|
|
299
|
+
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
|
300
|
+
border-radius: 8px;
|
|
301
|
+
padding: 16px;
|
|
302
|
+
color: white;
|
|
303
|
+
box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
|
|
304
|
+
margin: 0;
|
|
305
|
+
display: flex;
|
|
306
|
+
align-items: center;
|
|
307
|
+
gap: 16px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.location-error-icon {
|
|
311
|
+
font-size: 24px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.location-error-content {
|
|
315
|
+
flex: 1;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.location-error-title {
|
|
319
|
+
font-size: 16px;
|
|
320
|
+
font-weight: 600;
|
|
321
|
+
margin: 0 0 4px 0;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.location-error-message {
|
|
325
|
+
font-size: 13px;
|
|
326
|
+
opacity: 0.9;
|
|
327
|
+
margin: 0;
|
|
328
|
+
}
|
|
329
|
+
</style><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div>`),kO=E('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Carregando localiza\xE7\xE3o...'),_O=E("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Erro ao carregar localiza\xE7\xE3o: "),TO=E("<div class=location-variable-warning><span class=location-warning-icon>\u26A0\uFE0F</span><span class=location-warning-text>Localiza\xE7\xE3o ser\xE1 processada em tempo de execu\xE7\xE3o com vari\xE1veis"),SO=E("<div class=location-error-card><div class=location-error-icon>\u26A0\uFE0F</div><div class=location-error-content><h3 class=location-error-title>Aten\xE7\xE3o!</h3><p class=location-error-message>Nenhuma localiza\xE7\xE3o foi definida."),EO=E("<div class=location-map-container>"),bh=E("<iframe width=100% allowfullscreen loading=lazy referrerpolicy=no-referrer-when-downgrade style=border:0;border-radius:8px>",!0,!1,!1),CO=E('<div class="flex items-center justify-center p-4"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div><span class="ml-2 text-gray-600">Processando localiza\xE7\xE3o...'),PO=E("<div class=p-2>"),OO=E("<strong>"),IO=E("<br>"),NO=E('<span class="text-gray-500 font-light text-sm">'),Zl,AO=400,RO=e=>/\{\{.*?\}\}/.test(e),DO=e=>{let t=[];return e?.query||t.push("endere\xE7o"),{isValid:t.length===0,missingFields:t}},MO=e=>{let t,[r,n]=N(!!e.onTransitionEnd),[a,i]=N(""),[o,s]=N(!1),[l,c]=N(""),[u,d]=N(""),[p,h]=N(""),y=DO(e.content),m=()=>{let f=e.content?.query||"";return RO(f)},v=(f,k)=>f.replace(/\{\{([^}]+)\}\}/g,(_,C)=>k[C]||_),w=(f,k,_,C)=>{let P=_||e.content?.zoom||"15",I=C||e.content?.mapType||"roadmap";return`https://www.google.com/maps/embed/v1/place?key=${process.env.NEXT_PUBLIC_GOOGLE_PLACES_API_KEY}&q=${f},${k}&zoom=${P}&maptype=${I}`},b=async f=>{try{s(!0),c("");let k=await fetch(`/api/getCoordinates?query=${encodeURIComponent(f)}`);if(k.status===404){console.log(`\u{1F4CD} Endere\xE7o n\xE3o encontrado: "${f}"`),c("Endere\xE7o n\xE3o encontrado. Verifique se o endere\xE7o est\xE1 correto.");return}if(!k.ok){console.error(`\u274C Erro na API (${k.status}): ${k.statusText}`),c(`Erro na API: ${k.status}`);return}let _=await k.json();if(_.error){console.log(`\u26A0\uFE0F Erro retornado pela API: ${_.error}`),c(_.error);return}if(!_.latitude||!_.longitude){console.log(`\u{1F4CD} Local n\xE3o encontrado: "${f}"`),c("Local n\xE3o encontrado");return}let C=w(_.latitude,_.longitude,e.content?.zoom,e.content?.mapType);i(C),d(_.name||""),h(_.formatted_address||""),console.log(`\u2705 Localiza\xE7\xE3o encontrada: "${_.name||f}"`)}catch(k){console.error("\u274C Erro inesperado ao buscar localiza\xE7\xE3o:",k),c(k instanceof Error?k.message:"Erro desconhecido")}finally{s(!1)}},x=()=>{e.content?.query&&e.content.query.trim()!==""&&b(e.content.query)};return $e(()=>{Zl=setTimeout(()=>{n(!1),x(),setTimeout(()=>{e.onTransitionEnd?.(t)},AO)},2e3)}),Ie(()=>{Zl&&clearTimeout(Zl)}),Ye(()=>{e.content?.query&&e.content.query.trim()!==""&&!e.content?.url&&x()}),(()=>{var f=wO(),k=f.firstChild,_=k.nextSibling,C=_.firstChild,P=C.firstChild,I=P.nextSibling,L=t;return typeof L=="function"?Ve(L,f):t=f,T(P,(()=>{var R=j(()=>!!r());return()=>R()&&g(mr,{})})()),T(I,(()=>{var R=j(()=>!!o());return()=>R()&&kO()})(),null),T(I,(()=>{var R=j(()=>!!l());return()=>R()&&(()=>{var D=_O(),V=D.firstChild,F=V.nextSibling,le=F.firstChild,O=le.nextSibling,A=O.firstChild;return T(O,l,null),D})()})(),null),T(I,(()=>{var R=j(()=>!!m());return()=>R()&&TO()})(),null),T(I,(()=>{var R=j(()=>!y.isValid&&!o()&&!l());return()=>R()&&SO()})(),null),T(I,()=>!o()&&!l()&&(e.content?.url||m()||e.content?.query&&e.content.query.trim()!=="")?(()=>{var R=EO();return T(R,(()=>{var D=j(()=>!!(e.content?.url&&!a()));return()=>D()&&(()=>{var V=bh();return U(F=>{var le=e.content.url,O=e.content?.height||300;return le!==F.e&&de(V,"src",F.e=le),O!==F.t&&de(V,"height",F.t=O),F},{e:void 0,t:void 0}),V})()})(),null),T(R,(()=>{var D=j(()=>!!a());return()=>D()&&(()=>{var V=bh();return U(F=>{var le=a(),O=e.content?.height||300;return le!==F.e&&de(V,"src",F.e=le),O!==F.t&&de(V,"height",F.t=O),F},{e:void 0,t:void 0}),V})()})(),null),T(R,(()=>{var D=j(()=>!!(!e.content?.url&&!a()&&e.content?.query&&!m()));return()=>D()&&CO()})(),null),T(R,(()=>{var D=j(()=>!!(u()||p()));return()=>D()&&(()=>{var V=PO();return T(V,(()=>{var F=j(()=>!!u());return()=>F()&&(()=>{var le=OO();return T(le,u),le})()})(),null),T(V,(()=>{var F=j(()=>!!(u()&&p()));return()=>F()&&IO()})(),null),T(V,(()=>{var F=j(()=>!!p());return()=>F()&&(()=>{var le=NO();return T(le,p),le})()})(),null),V})()})(),null),R})():null,null),U(R=>{var D=ae("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),V=r()?"64px":"100%",F=r()?"32px":"100%",le=ae("p-4 z-20 text-fade-in w-full",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--location-bubble-height)]");return D!==R.e&&ne(f,R.e=D),V!==R.t&&we(P,"width",R.t=V),F!==R.a&&we(P,"height",R.a=F),le!==R.o&&ne(I,R.o=le),R},{e:void 0,t:void 0,a:void 0,o:void 0}),f})()},LO=E('<img alt="C\xF3digo QR do PIX"style="border-radius:8px;border:1px solid #e5e7eb">'),FO=E(`<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div style=width:fit-content;max-width:100%></div></div></div><style>
|
|
330
|
+
.pix-payment-card {
|
|
331
|
+
background: linear-gradient(135deg, #30a46c 0%, #2d8f5f 100%);
|
|
332
|
+
border-radius: 8px;
|
|
333
|
+
padding: 24px;
|
|
334
|
+
color: white;
|
|
335
|
+
box-shadow: 0 8px 32px rgba(48, 164, 108, 0.3);
|
|
336
|
+
margin: 16px 0;
|
|
337
|
+
min-width: 280px;
|
|
338
|
+
max-width: 380px;
|
|
339
|
+
width: 100%;
|
|
340
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.pix-header {
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
gap: 12px;
|
|
347
|
+
margin-bottom: 16px;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.pix-icon {
|
|
351
|
+
font-size: 24px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.pix-title {
|
|
355
|
+
font-size: 20px;
|
|
356
|
+
font-weight: 600;
|
|
357
|
+
margin: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.pix-variable-warning {
|
|
361
|
+
display: flex;
|
|
362
|
+
align-items: center;
|
|
363
|
+
gap: 8px;
|
|
364
|
+
background: rgba(255, 255, 255, 0.2);
|
|
365
|
+
padding: 12px;
|
|
366
|
+
border-radius: 6px;
|
|
367
|
+
margin-bottom: 16px;
|
|
368
|
+
font-size: 14px;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.pix-warning-icon {
|
|
372
|
+
font-size: 16px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.pix-warning-text {
|
|
376
|
+
opacity: 0.9;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.pix-qr-container {
|
|
380
|
+
display: flex;
|
|
381
|
+
justify-content: center;
|
|
382
|
+
margin: 16px 0;
|
|
383
|
+
background: white;
|
|
384
|
+
padding: 16px;
|
|
385
|
+
border-radius: 8px;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.pix-details {
|
|
389
|
+
margin: 16px 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.pix-details:first-child {
|
|
393
|
+
margin-top: 0;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.pix-label {
|
|
397
|
+
font-weight: 600;
|
|
398
|
+
margin-right: 8px;
|
|
399
|
+
opacity: 0.9;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.pix-value {
|
|
403
|
+
font-weight: 500;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.pix-amount {
|
|
407
|
+
font-size: 20px;
|
|
408
|
+
font-weight: bold;
|
|
409
|
+
margin-bottom: 6px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.pix-beneficiary {
|
|
413
|
+
font-size: 16px;
|
|
414
|
+
margin-bottom: 6px;
|
|
415
|
+
opacity: 0.9;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.pix-city {
|
|
419
|
+
font-size: 16px;
|
|
420
|
+
margin-bottom: 6px;
|
|
421
|
+
opacity: 0.9;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.pix-note {
|
|
425
|
+
margin-top: 4px;
|
|
426
|
+
font-size: 11px;
|
|
427
|
+
opacity: 0.7;
|
|
428
|
+
font-style: italic;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.pix-key-info {
|
|
432
|
+
font-size: 14px;
|
|
433
|
+
opacity: 0.8;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.pix-key-type {
|
|
437
|
+
margin-bottom: 3px;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.pix-key-value {
|
|
441
|
+
word-break: break-all;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.pix-actions {
|
|
445
|
+
display: flex;
|
|
446
|
+
gap: 12px;
|
|
447
|
+
margin-top: 16px;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.pix-action-btn {
|
|
451
|
+
flex: 1;
|
|
452
|
+
padding: 12px;
|
|
453
|
+
border: none;
|
|
454
|
+
border-radius: 8px;
|
|
455
|
+
background: rgba(255, 255, 255, 0.2);
|
|
456
|
+
color: white;
|
|
457
|
+
cursor: pointer;
|
|
458
|
+
transition: all 0.3s ease;
|
|
459
|
+
font-size: 14px;
|
|
460
|
+
font-weight: 500;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.pix-actions:has(.pix-action-btn:only-child) .pix-action-btn {
|
|
464
|
+
flex: 0 1 auto;
|
|
465
|
+
min-width: 200px;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.pix-action-btn:hover {
|
|
469
|
+
background: rgba(255, 255, 255, 0.3);
|
|
470
|
+
transform: translateY(-1px);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.pix-action-btn:active {
|
|
474
|
+
transform: translateY(0);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.pix-action-success {
|
|
478
|
+
background: rgba(34, 197, 94, 0.3) !important;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.pix-action-error {
|
|
482
|
+
background: rgba(239, 68, 68, 0.3) !important;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.pix-error-card {
|
|
486
|
+
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
|
487
|
+
border-radius: 8px;
|
|
488
|
+
padding: 16px;
|
|
489
|
+
color: white;
|
|
490
|
+
box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
|
|
491
|
+
margin: 0;
|
|
492
|
+
display: flex;
|
|
493
|
+
align-items: center;
|
|
494
|
+
gap: 16px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.pix-error-icon {
|
|
498
|
+
font-size: 24px;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.pix-error-content {
|
|
502
|
+
flex: 1;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.pix-error-title {
|
|
506
|
+
font-size: 16px;
|
|
507
|
+
font-weight: 600;
|
|
508
|
+
margin: 0 0 4px 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.pix-error-message {
|
|
512
|
+
font-size: 13px;
|
|
513
|
+
opacity: 0.9;
|
|
514
|
+
margin: 0;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.pix-loading-card {
|
|
518
|
+
background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
|
|
519
|
+
border-radius: 16px;
|
|
520
|
+
padding: 24px;
|
|
521
|
+
color: white;
|
|
522
|
+
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
|
|
523
|
+
margin: 16px 0;
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
gap: 16px;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.pix-loading-icon {
|
|
530
|
+
font-size: 32px;
|
|
531
|
+
animation: spin 2s linear infinite;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.pix-loading-content {
|
|
535
|
+
flex: 1;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.pix-loading-title {
|
|
539
|
+
font-size: 18px;
|
|
540
|
+
font-weight: 600;
|
|
541
|
+
margin: 0 0 8px 0;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.pix-loading-message {
|
|
545
|
+
font-size: 14px;
|
|
546
|
+
opacity: 0.9;
|
|
547
|
+
margin: 0;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
@keyframes spin {
|
|
551
|
+
from { transform: rotate(0deg); }
|
|
552
|
+
to { transform: rotate(360deg); }
|
|
553
|
+
}
|
|
554
|
+
`),$O=E("<div class=pix-error-card><div class=pix-error-icon>\u26A0\uFE0F</div><div class=pix-error-content><h3 class=pix-error-title>Aten\xE7\xE3o!</h3><p class=pix-error-message>Dados do PIX n\xE3o definidos."),UO=E('<div class=pix-payment-card><div class=pix-header><div class=pix-icon aria-label="\xCDcone de pagamento">\u{1F4B3}</div><h3 class=pix-title>Pagamento PIX</h3></div><div class=pix-details></div><div class=pix-actions><button aria-label="Copiar c\xF3digo PIX">Copiar C\xF3digo PIX'),jO=E("<div class=pix-variable-warning><span class=pix-warning-icon>\u26A0\uFE0F</span><span class=pix-warning-text>Alguns campos cont\xEAm vari\xE1veis e ser\xE3o processados em tempo de execu\xE7\xE3o"),BO=E("<div class=pix-qr-container>"),zO=E("<div class=pix-amount><span class=pix-label>Valor:</span><span class=pix-value>R$ "),VO=E("<div class=pix-beneficiary><span class=pix-label>Benefici\xE1rio:</span><span class=pix-value>"),HO=E("<div class=pix-city><span class=pix-label>Cidade:</span><span class=pix-value>"),ZO=E("<div class=pix-note><small>Nota: Cidade truncada no c\xF3digo PIX para atender ao padr\xE3o banc\xE1rio"),GO=E("<div class=pix-key-info><div class=pix-key-type><span class=pix-label>Tipo:</span><span class=pix-value></span></div><div class=pix-key-value><span class=pix-label>Chave:</span><span class=pix-value>"),WO=E('<button aria-label="Copiar chave PIX">Copiar Chave PIX'),qO=E("<div class=pix-loading-card><div class=pix-loading-icon>\u23F3</div><div class=pix-loading-content><h3 class=pix-loading-title>Gerando PIX...</h3><p class=pix-loading-message>Aguarde enquanto processamos os dados do pagamento"),KO=e=>{let t=`https://api.qrserver.com/v1/create-qr-code/?size=${e.size||200}x${e.size||200}&data=${encodeURIComponent(e.value)}&format=png&margin=10`;return(()=>{var r=LO();return r.addEventListener("error",n=>{let a=n.target;a.style.display="none";let i=document.createElement("div");i.innerHTML="QR Code n\xE3o dispon\xEDvel",i.style.cssText=`
|
|
555
|
+
width: ${e.size||200}px;
|
|
556
|
+
height: ${e.size||200}px;
|
|
557
|
+
background: #f3f4f6;
|
|
558
|
+
border: 2px dashed #d1d5db;
|
|
559
|
+
border-radius: 8px;
|
|
560
|
+
display: flex;
|
|
561
|
+
align-items: center;
|
|
562
|
+
justify-content: center;
|
|
563
|
+
color: #6b7280;
|
|
564
|
+
font-size: 14px;
|
|
565
|
+
`,a.parentNode?.appendChild(i)}),de(r,"src",t),U(n=>{var a=e.size||200,i=e.size||200;return a!==n.e&&de(r,"width",n.e=a),i!==n.t&&de(r,"height",n.t=i),n},{e:void 0,t:void 0}),r})()},Gl,YO=400,XO=e=>e?Number.parseFloat(e.replace(/[^\d,]/g,"").replace(",",".")).toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}):"0,00",JO=e=>({cpf:"CPF",cnpj:"CNPJ",telefone:"Telefone",email:"E-mail",aleatoria:"Chave Aleat\xF3ria"})[e]||e,QO=(e,t)=>{if(!e)return"";if(Go(e))return e;switch(t){case"cpf":return e.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4");case"cnpj":return e.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5");case"telefone":return e.replace(/(\+55)(\d{2})(\d{5})(\d{4})/,"$1 ($2) $3-$4");default:return e}},eI=async e=>{try{await navigator.clipboard.writeText(e)}catch(t){console.error("Erro ao copiar:",t)}},Go=e=>e?/{{[^}]+}}/.test(e):!1,tI=e=>{let t=[];return e?.pixCode||t.push("c\xF3digo PIX"),e?.valor||t.push("valor"),e?.nome||t.push("nome do benefici\xE1rio"),e?.chave||t.push("chave PIX"),e?.tipoChave||t.push("tipo de chave"),{isValid:t.length===0,missingFields:t}},rI=e=>{let t,[r,n]=N(!!e.onTransitionEnd),[a,i]=N({type:null,success:!1}),o=async(c,u)=>{try{await eI(c),i({type:u,success:!0}),setTimeout(()=>i({type:null,success:!1}),2e3)}catch{i({type:u,success:!1}),setTimeout(()=>i({type:null,success:!1}),2e3)}};$e(()=>{Gl=setTimeout(()=>{n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},YO)},2e3)}),Ie(()=>{Gl&&clearTimeout(Gl)});let s=tI(e.content),l=Go(e.content?.chave||"")||Go(e.content?.nome||"")||Go(e.content?.valor||"");return(()=>{var c=FO(),u=c.firstChild,d=u.firstChild,p=d.firstChild,h=p.nextSibling,y=t;return typeof y=="function"?Ve(y,c):t=c,T(p,(()=>{var m=j(()=>!!r());return()=>m()&&g(mr,{})})()),T(h,(()=>{var m=j(()=>!s.isValid);return()=>m()?$O():j(()=>!!e.content?.pixCode)()?(()=>{var v=UO(),w=v.firstChild,b=w.nextSibling,x=b.nextSibling,f=x.firstChild,k=f.firstChild;return T(v,l&&jO(),b),T(v,(()=>{var _=j(()=>e.content.showQrCode!==!1);return()=>_()&&(()=>{var C=BO();return T(C,g(KO,{get value(){return e.content.pixCode},size:200,level:"M",includeMargin:!0,"aria-label":"C\xF3digo QR do PIX"})),C})()})(),b),T(b,(()=>{var _=j(()=>!!e.content.valor);return()=>_()&&(()=>{var C=zO(),P=C.firstChild,I=P.nextSibling,L=I.firstChild;return T(I,()=>XO(e.content.valor),null),C})()})(),null),T(b,(()=>{var _=j(()=>!!e.content.nome);return()=>_()&&(()=>{var C=VO(),P=C.firstChild,I=P.nextSibling;return T(I,()=>e.content.nome),C})()})(),null),T(b,(()=>{var _=j(()=>!!e.content.cidade);return()=>_()&&(()=>{var C=HO(),P=C.firstChild,I=P.nextSibling;return T(I,()=>e.content.cidade),T(C,(()=>{var L=j(()=>e.content.cidade.length>15);return()=>L()&&ZO()})(),null),C})()})(),null),T(b,(()=>{var _=j(()=>!!(e.content.chave&&e.content.tipoChave));return()=>_()&&(()=>{var C=GO(),P=C.firstChild,I=P.firstChild,L=I.nextSibling,R=P.nextSibling,D=R.firstChild,V=D.nextSibling;return T(L,()=>JO(e.content.tipoChave)),T(V,()=>QO(e.content.chave,e.content.tipoChave)),C})()})(),null),f.$$click=()=>e.content?.pixCode!=null&&o(e.content.pixCode,"code"),T(f,()=>a().type==="code"&&a().success?"\u2705":"\u{1F4CB}",k),T(x,(()=>{var _=j(()=>!!(e.content.chave&&e.content.showCopyKeyButton!==!1));return()=>_()&&(()=>{var C=WO(),P=C.firstChild;return C.$$click=()=>e.content?.chave!=null&&o(e.content.chave,"key"),T(C,()=>a().type==="key"&&a().success?"\u2705":"\u{1F511}",P),U(()=>ne(C,ae("pix-action-btn",a().type==="key"&&a().success&&"pix-action-success",a().type==="key"&&!a().success&&"pix-action-error"))),C})()})(),null),U(()=>ne(f,ae("pix-action-btn",a().type==="code"&&a().success&&"pix-action-success",a().type==="code"&&!a().success&&"pix-action-error"))),v})():qO()})()),U(m=>{var v=ae("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),w=r()?"64px":"100%",b=r()?"32px":"100%",x=ae("p-4 z-20 text-fade-in",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 p-4 h-[var(--pix-bubble-height)]");return v!==m.e&&ne(c,m.e=v),w!==m.t&&we(p,"width",m.t=w),b!==m.a&&we(p,"height",m.a=b),x!==m.o&&ne(h,m.o=x),m},{e:void 0,t:void 0,a:void 0,o:void 0}),c})()};at(["click"]);var nI=({bubbleContent:e,typingSettings:t})=>{let r=e.match(/(\w+)/g)?.length??0;r===0&&(r=e.length);let{enabled:n,speed:a,maxDelay:i}={enabled:t?.enabled??Nt.typingEmulation.enabled,speed:t?.speed??Nt.typingEmulation.speed,maxDelay:t?.maxDelay??Nt.typingEmulation.maxDelay},o=n?r/a*6e4:0;return o>i*1e3&&(o=i*1e3),o},wb=e=>e.map(t=>t.text??wb(t.children)).join(""),aI=E("<br>"),iI=E("<span>"),oI=(e,t,r)=>{let n="";return e&&(n+="slate-bold"),t&&(n+=" slate-italic"),r&&(n+=" slate-underline"),n},sI=e=>(()=>{var t=iI();return T(t,()=>e.text,null),T(t,g(X,{get when(){return j(()=>!!e.isUniqueChild)()&&jt(e.text)},get children(){return aI()}}),null),U(()=>ne(t,oI(e.bold,e.italic,e.underline))),t})(),lI=E('<a target=_blank rel="noopener noreferrer">'),cI=E("<ol>"),uI=E("<ul>"),dI=E("<li>"),pI=E("<span>"),hI=E("<div>"),la=e=>g(lt,{get children(){return[g(se,{get when(){return Se(e.element.text)},get children(){return g(sI,De(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),g(se,{when:!0,get children(){return g(lt,{get children(){return[g(se,{get when(){return e.element.type==="a"},get children(){var t=lI();return T(t,g(Je,{get each(){return e.element.children},children:r=>g(la,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),U(()=>de(t,"href",e.element.url)),t}}),g(se,{get when(){return e.element.type==="ol"},get children(){var t=cI();return T(t,g(Je,{get each(){return e.element.children},children:r=>g(la,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),g(se,{get when(){return e.element.type==="ul"},get children(){var t=uI();return T(t,g(Je,{get each(){return e.element.children},children:r=>g(la,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),g(se,{get when(){return e.element.type==="li"},get children(){var t=dI();return T(t,g(Je,{get each(){return e.element.children},children:r=>g(la,{element:r,get isUniqueChild(){return e.element.children?.length===1}})})),t}}),g(se,{when:!0,get children(){return g(gI,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return g(Je,{get each(){return e.element.children},children:t=>g(la,{element:t,get isUniqueChild(){return e.element.children?.length===1},get insideInlineVariable(){return e.element.type==="inline-variable"}})})}})}})]}})}})]}}),gI=e=>g(lt,{get children(){return[g(se,{get when(){return e.element.type==="inline-variable"||e.insideInlineVariable},get children(){var t=pI();return T(t,()=>e.children),U(()=>de(t,"data-element-type",e.element.type)),t}}),g(se,{when:!0,get children(){var t=hI();return T(t,()=>e.children),U(()=>de(t,"data-element-type",e.element.type)),t}})]}}),mI=E('<div><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble></div><div>'),fI=400,Wl,bI=e=>{let t,[r,n]=N(!!e.onTransitionEnd),a=()=>{r()&&(n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},fI))};return $e(()=>{if(!r)return;let i=e.content?.richText?wb(e.content.richText):"",o=e.typingEmulation?.enabled===!1||e.isTypingSkipped?0:nI({bubbleContent:i,typingSettings:e.typingEmulation});Wl=setTimeout(a,o)}),Ie(()=>{Wl&&clearTimeout(Wl)}),(()=>{var i=mI(),o=i.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=t;return typeof u=="function"?Ve(u,i):t=i,T(l,(()=>{var d=j(()=>!!r());return()=>d()&&g(mr,{})})()),T(c,g(Je,{get each(){return e.content?.richText},children:d=>g(la,{element:d})})),U(d=>{var p=ae("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),h=r()?"64px":"100%",y=r()?"32px":"100%",m=ae("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",r()?"opacity-0 h-4 @xs:h-5":"opacity-100 h-full");return p!==d.e&&ne(i,d.e=p),h!==d.t&&we(l,"width",d.t=h),y!==d.a&&we(l,"height",d.a=y),m!==d.o&&ne(c,d.o=m),d},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},yh=["youtube","vimeo","tiktok","gumlet"],En={height:400,aspectRatio:"16/9",maxWidth:"100%",areControlsDisplayed:!0,isAutoplayEnabled:!0},yI="https://www.youtube.com/embed",vI="https://player.vimeo.com/video",xI="https://www.tiktok.com/embed/v2",wI="https://play.gumlet.io/embed",kI={vimeo:vI,youtube:yI,tiktok:xI,gumlet:wI},_I=e=>e?.isAutoplayEnabled??En.isAutoplayEnabled?e?.type==="youtube"||e?.type==="vimeo"?"autoplay=1":e?.type==="gumlet"?"autoplay=true":"":"",TI=E("<video>"),SI=E('<div><iframe class="w-full h-full"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen>'),EI=E('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start makebot-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),CI=400,ql,PI=e=>{let t,[r,n]=N(!!e.onTransitionEnd);return $e(()=>{let a=e.content?.type&&yh.includes(e.content?.type)?2e3:100;ql=setTimeout(()=>{r()&&(n(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},CI))},a)}),Ie(()=>{ql&&clearTimeout(ql)}),(()=>{var a=EI(),i=a.firstChild,o=i.firstChild,s=o.firstChild,l=t;return typeof l=="function"?Ve(l,a):t=a,T(s,(()=>{var c=j(()=>!!r());return()=>c()&&g(mr,{})})()),T(o,g(lt,{get children(){return[g(se,{get when(){return j(()=>!!e.content?.type)()&&e.content.type==="url"},get children(){var c=TI();return U(u=>{var d=e.onTransitionEnd?e.content?.isAutoplayEnabled??En.isAutoplayEnabled:!1,p=e.content?.url,h=e.content?.areControlsDisplayed??En.areControlsDisplayed,y=ae("p-4 focus:outline-none w-full z-10 text-fade-in rounded-md",r()?"opacity-0 h-8 @xs:h-9":"opacity-100 h-auto"),m=e.content?.aspectRatio,v=e.content?.maxWidth??En.maxWidth;return d!==u.e&&(c.autoplay=u.e=d),p!==u.t&&de(c,"src",u.t=p),h!==u.a&&(c.controls=u.a=h),y!==u.o&&ne(c,u.o=y),m!==u.i&&we(c,"aspect-ratio",u.i=m),v!==u.n&&we(c,"max-width",u.n=v),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),c}}),g(se,{get when(){return j(()=>!!e.content?.type)()&&yh.includes(e.content.type)},get children(){var c=SI(),u=c.firstChild;return U(d=>{var p=ae("p-4 z-10 text-fade-in w-full aspect-[var(--aspect-ratio)]",r()?"opacity-0 h-8 @xs:h-9":"opacity-100",!e.content?.aspectRatio&&"h-[var(--height)]"),h=e.content?.aspectRatio,y=`${e.content?.height??En.height}px`,m=e.content?.maxWidth??En.maxWidth,v=`${kI[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??`?${_I(e.content)}`}`;return p!==d.e&&ne(c,d.e=p),h!==d.t&&we(c,"--aspect-ratio",d.t=h),y!==d.a&&we(c,"--height",d.a=y),m!==d.o&&we(c,"max-width",d.o=m),v!==d.i&&de(u,"src",d.i=v),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c}})]}}),null),U(c=>{var u=ae("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),d=r()?"64px":"100%",p=r()?"32px":"100%",h=e.content?.maxWidth??En.maxWidth;return u!==c.e&&ne(a,c.e=u),d!==c.t&&we(s,"width",c.t=d),p!==c.a&&we(s,"height",c.a=p),h!==c.o&&we(s,"max-width",c.o=h),c},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()},OI=e=>(console.log("\u{1F50D} HostBubble - message type:",e.message.type),console.log("\u{1F50D} HostBubble - message content:",e.message.content),g(lt,{get children(){return[g(se,{get when(){return e.message.type==="text"},get children(){return g(bI,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),g(se,{get when(){return e.message.type==="image"},get children(){return g(eO,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),g(se,{get when(){return e.message.type==="video"},get children(){return g(PI,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),g(se,{get when(){return e.message.type==="embed"},get children(){return g(G9,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),g(se,{get when(){return e.message.type==="custom-embed"},get children(){return g(z9,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),g(se,{get when(){return e.message.type==="location"},get children(){return g(MO,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),g(se,{get when(){return e.message.type==="pix"},get children(){return g(rI,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),g(se,{get when(){return e.message.type==="contact"},get children(){return g(xO,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),g(se,{get when(){return e.message.type==="audio"},get children(){return g(U9,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}})),{entries:kb,setPrototypeOf:vh,isFrozen:II,getPrototypeOf:NI,getOwnPropertyDescriptor:AI}=Object,{freeze:ft,seal:Mt,create:_b}=Object,{apply:lu,construct:cu}=typeof Reflect<"u"&&Reflect;ft||(ft=function(e){return e});Mt||(Mt=function(e){return e});lu||(lu=function(e,t,r){return e.apply(t,r)});cu||(cu=function(e,t){return new e(...t)});var Lo=bt(Array.prototype.forEach),RI=bt(Array.prototype.lastIndexOf),xh=bt(Array.prototype.pop),za=bt(Array.prototype.push),DI=bt(Array.prototype.splice),Wo=bt(String.prototype.toLowerCase),Kl=bt(String.prototype.toString),wh=bt(String.prototype.match),Va=bt(String.prototype.replace),MI=bt(String.prototype.indexOf),LI=bt(String.prototype.trim),Ut=bt(Object.prototype.hasOwnProperty),gt=bt(RegExp.prototype.test),Ha=FI(TypeError);function bt(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return lu(e,t,n)}}function FI(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return cu(e,r)}}function Ee(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wo;vh&&vh(e,null);let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){let i=r(a);i!==a&&(II(t)||(t[n]=i),a=i)}e[a]=!0}return e}function $I(e){for(let t=0;t<e.length;t++)Ut(e,t)||(e[t]=null);return e}function Cn(e){let t=_b(null);for(let[r,n]of kb(e))Ut(e,r)&&(Array.isArray(n)?t[r]=$I(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Cn(n):t[r]=n);return t}function Za(e,t){for(;e!==null;){let n=AI(e,t);if(n){if(n.get)return bt(n.get);if(typeof n.value=="function")return bt(n.value)}e=NI(e)}function r(){return null}return r}var kh=ft(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yl=ft(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xl=ft(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),UI=ft(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Jl=ft(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jI=ft(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_h=ft(["#text"]),Th=ft(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ql=ft(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Sh=ft(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Fo=ft(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),BI=Mt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zI=Mt(/<%[\w\W]*|[\w\W]*%>/gm),VI=Mt(/\$\{[\w\W]*/gm),HI=Mt(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZI=Mt(/^aria-[\-\w]+$/),Tb=Mt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),GI=Mt(/^(?:\w+script|data):/i),WI=Mt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sb=Mt(/^html$/i),qI=Mt(/^[a-z][.\w]*(-[.\w]+)+$/i),Eh=Object.freeze({__proto__:null,ARIA_ATTR:ZI,ATTR_WHITESPACE:WI,CUSTOM_ELEMENT:qI,DATA_ATTR:HI,DOCTYPE_NAME:Sb,ERB_EXPR:zI,IS_ALLOWED_URI:Tb,IS_SCRIPT_OR_DATA:GI,MUSTACHE_EXPR:BI,TMPLIT_EXPR:VI}),Ga={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},KI=function(){return typeof window>"u"?null:window},YI=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Ch=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Eb(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:KI(),t=S=>Eb(S);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Ga.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e,n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,y=l.prototype,m=Za(y,"cloneNode"),v=Za(y,"remove"),w=Za(y,"nextSibling"),b=Za(y,"childNodes"),x=Za(y,"parentNode");if(typeof o=="function"){let S=r.createElement("template");S.content&&S.content.ownerDocument&&(r=S.content.ownerDocument)}let f,k="",{implementation:_,createNodeIterator:C,createDocumentFragment:P,getElementsByTagName:I}=r,{importNode:L}=n,R=Ch();t.isSupported=typeof kb=="function"&&typeof x=="function"&&_&&_.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:D,ERB_EXPR:V,TMPLIT_EXPR:F,DATA_ATTR:le,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:ge}=Eh,{IS_ALLOWED_URI:me}=Eh,oe=null,Ze=Ee({},[...kh,...Yl,...Xl,...Jl,..._h]),je=null,dn=Ee({},[...Th,...Ql,...Sh,...Fo]),Be=Object.seal(_b(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fr=null,$r=null,rd=!0,nl=!0,nd=!1,ad=!0,zn=!1,al=!0,pn=!1,il=!1,ol=!1,Vn=!1,so=!1,lo=!1,id=!0,od=!1,Nb="user-content-",sl=!0,Ra=!1,Hn={},Zn=null,sd=Ee({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ld=null,cd=Ee({},["audio","video","img","source","image","track"]),ll=null,ud=Ee({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),co="http://www.w3.org/1998/Math/MathML",uo="http://www.w3.org/2000/svg",br="http://www.w3.org/1999/xhtml",Gn=br,cl=!1,ul=null,Ab=Ee({},[co,uo,br],Kl),po=Ee({},["mi","mo","mn","ms","mtext"]),ho=Ee({},["annotation-xml"]),Rb=Ee({},["title","style","font","a","script"]),Da=null,Db=["application/xhtml+xml","text/html"],Mb="text/html",tt=null,Wn=null,Lb=r.createElement("form"),dd=function(S){return S instanceof RegExp||S instanceof Function},dl=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Wn&&Wn===S)){if((!S||typeof S!="object")&&(S={}),S=Cn(S),Da=Db.indexOf(S.PARSER_MEDIA_TYPE)===-1?Mb:S.PARSER_MEDIA_TYPE,tt=Da==="application/xhtml+xml"?Kl:Wo,oe=Ut(S,"ALLOWED_TAGS")?Ee({},S.ALLOWED_TAGS,tt):Ze,je=Ut(S,"ALLOWED_ATTR")?Ee({},S.ALLOWED_ATTR,tt):dn,ul=Ut(S,"ALLOWED_NAMESPACES")?Ee({},S.ALLOWED_NAMESPACES,Kl):Ab,ll=Ut(S,"ADD_URI_SAFE_ATTR")?Ee(Cn(ud),S.ADD_URI_SAFE_ATTR,tt):ud,ld=Ut(S,"ADD_DATA_URI_TAGS")?Ee(Cn(cd),S.ADD_DATA_URI_TAGS,tt):cd,Zn=Ut(S,"FORBID_CONTENTS")?Ee({},S.FORBID_CONTENTS,tt):sd,fr=Ut(S,"FORBID_TAGS")?Ee({},S.FORBID_TAGS,tt):{},$r=Ut(S,"FORBID_ATTR")?Ee({},S.FORBID_ATTR,tt):{},Hn=Ut(S,"USE_PROFILES")?S.USE_PROFILES:!1,rd=S.ALLOW_ARIA_ATTR!==!1,nl=S.ALLOW_DATA_ATTR!==!1,nd=S.ALLOW_UNKNOWN_PROTOCOLS||!1,ad=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zn=S.SAFE_FOR_TEMPLATES||!1,al=S.SAFE_FOR_XML!==!1,pn=S.WHOLE_DOCUMENT||!1,Vn=S.RETURN_DOM||!1,so=S.RETURN_DOM_FRAGMENT||!1,lo=S.RETURN_TRUSTED_TYPE||!1,ol=S.FORCE_BODY||!1,id=S.SANITIZE_DOM!==!1,od=S.SANITIZE_NAMED_PROPS||!1,sl=S.KEEP_CONTENT!==!1,Ra=S.IN_PLACE||!1,me=S.ALLOWED_URI_REGEXP||Tb,Gn=S.NAMESPACE||br,po=S.MATHML_TEXT_INTEGRATION_POINTS||po,ho=S.HTML_INTEGRATION_POINTS||ho,Be=S.CUSTOM_ELEMENT_HANDLING||{},S.CUSTOM_ELEMENT_HANDLING&&dd(S.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Be.tagNameCheck=S.CUSTOM_ELEMENT_HANDLING.tagNameCheck),S.CUSTOM_ELEMENT_HANDLING&&dd(S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Be.attributeNameCheck=S.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Be.allowCustomizedBuiltInElements=S.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),zn&&(nl=!1),so&&(Vn=!0),Hn&&(oe=Ee({},_h),je=[],Hn.html===!0&&(Ee(oe,kh),Ee(je,Th)),Hn.svg===!0&&(Ee(oe,Yl),Ee(je,Ql),Ee(je,Fo)),Hn.svgFilters===!0&&(Ee(oe,Xl),Ee(je,Ql),Ee(je,Fo)),Hn.mathMl===!0&&(Ee(oe,Jl),Ee(je,Sh),Ee(je,Fo))),S.ADD_TAGS&&(oe===Ze&&(oe=Cn(oe)),Ee(oe,S.ADD_TAGS,tt)),S.ADD_ATTR&&(je===dn&&(je=Cn(je)),Ee(je,S.ADD_ATTR,tt)),S.ADD_URI_SAFE_ATTR&&Ee(ll,S.ADD_URI_SAFE_ATTR,tt),S.FORBID_CONTENTS&&(Zn===sd&&(Zn=Cn(Zn)),Ee(Zn,S.FORBID_CONTENTS,tt)),sl&&(oe["#text"]=!0),pn&&Ee(oe,["html","head","body"]),oe.table&&(Ee(oe,["tbody"]),delete fr.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ha('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ha('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');f=S.TRUSTED_TYPES_POLICY,k=f.createHTML("")}else f===void 0&&(f=YI(h,a)),f!==null&&typeof k=="string"&&(k=f.createHTML(""));ft&&ft(S),Wn=S}},pd=Ee({},[...Yl,...Xl,...UI]),hd=Ee({},[...Jl,...jI]),Fb=function(S){let J=x(S);(!J||!J.tagName)&&(J={namespaceURI:Gn,tagName:"template"});let H=Wo(S.tagName),Fe=Wo(J.tagName);return ul[S.namespaceURI]?S.namespaceURI===uo?J.namespaceURI===br?H==="svg":J.namespaceURI===co?H==="svg"&&(Fe==="annotation-xml"||po[Fe]):!!pd[H]:S.namespaceURI===co?J.namespaceURI===br?H==="math":J.namespaceURI===uo?H==="math"&&ho[Fe]:!!hd[H]:S.namespaceURI===br?J.namespaceURI===uo&&!ho[Fe]||J.namespaceURI===co&&!po[Fe]?!1:!hd[H]&&(Rb[H]||!pd[H]):!!(Da==="application/xhtml+xml"&&ul[S.namespaceURI]):!1},hn=function(S){za(t.removed,{element:S});try{x(S).removeChild(S)}catch{v(S)}},go=function(S,J){try{za(t.removed,{attribute:J.getAttributeNode(S),from:J})}catch{za(t.removed,{attribute:null,from:J})}if(J.removeAttribute(S),S==="is")if(Vn||so)try{hn(J)}catch{}else try{J.setAttribute(S,"")}catch{}},gd=function(S){let J=null,H=null;if(ol)S="<remove></remove>"+S;else{let Xe=wh(S,/^[\r\n\t ]+/);H=Xe&&Xe[0]}Da==="application/xhtml+xml"&&Gn===br&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");let Fe=f?f.createHTML(S):S;if(Gn===br)try{J=new p().parseFromString(Fe,Da)}catch{}if(!J||!J.documentElement){J=_.createDocument(Gn,"template",null);try{J.documentElement.innerHTML=cl?k:Fe}catch{}}let it=J.body||J.documentElement;return S&&H&&it.insertBefore(r.createTextNode(H),it.childNodes[0]||null),Gn===br?I.call(J,pn?"html":"body")[0]:pn?J.documentElement:it},md=function(S){return C.call(S.ownerDocument||S,S,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pl=function(S){return S instanceof d&&(typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||!(S.attributes instanceof u)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function")},fd=function(S){return typeof s=="function"&&S instanceof s};function yr(S,J,H){Lo(S,Fe=>{Fe.call(t,J,H,Wn)})}let bd=function(S){let J=null;if(yr(R.beforeSanitizeElements,S,null),pl(S))return hn(S),!0;let H=tt(S.nodeName);if(yr(R.uponSanitizeElement,S,{tagName:H,allowedTags:oe}),S.hasChildNodes()&&!fd(S.firstElementChild)&>(/<[/\w]/g,S.innerHTML)&>(/<[/\w]/g,S.textContent)||S.nodeType===Ga.progressingInstruction||al&&S.nodeType===Ga.comment&>(/<[/\w]/g,S.data))return hn(S),!0;if(!oe[H]||fr[H]){if(!fr[H]&&vd(H)&&(Be.tagNameCheck instanceof RegExp&>(Be.tagNameCheck,H)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(H)))return!1;if(sl&&!Zn[H]){let Fe=x(S)||S.parentNode,it=b(S)||S.childNodes;if(it&&Fe){let Xe=it.length;for(let vr=Xe-1;vr>=0;--vr){let Ot=m(it[vr],!0);Ot.__removalCount=(S.__removalCount||0)+1,Fe.insertBefore(Ot,w(S))}}}return hn(S),!0}return S instanceof l&&!Fb(S)||(H==="noscript"||H==="noembed"||H==="noframes")&>(/<\/no(script|embed|frames)/i,S.innerHTML)?(hn(S),!0):(zn&&S.nodeType===Ga.text&&(J=S.textContent,Lo([D,V,F],Fe=>{J=Va(J,Fe," ")}),S.textContent!==J&&(za(t.removed,{element:S.cloneNode()}),S.textContent=J)),yr(R.afterSanitizeElements,S,null),!1)},yd=function(S,J,H){if(id&&(J==="id"||J==="name")&&(H in r||H in Lb))return!1;if(!(nl&&!$r[J]&>(le,J))&&!(rd&>(O,J))){if(!je[J]||$r[J]){if(!(vd(S)&&(Be.tagNameCheck instanceof RegExp&>(Be.tagNameCheck,S)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(S))&&(Be.attributeNameCheck instanceof RegExp&>(Be.attributeNameCheck,J)||Be.attributeNameCheck instanceof Function&&Be.attributeNameCheck(J))||J==="is"&&Be.allowCustomizedBuiltInElements&&(Be.tagNameCheck instanceof RegExp&>(Be.tagNameCheck,H)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(H))))return!1}else if(!ll[J]&&!gt(me,Va(H,z,""))&&!((J==="src"||J==="xlink:href"||J==="href")&&S!=="script"&&MI(H,"data:")===0&&ld[S])&&!(nd&&!gt(A,Va(H,z,"")))&&H)return!1}return!0},vd=function(S){return S!=="annotation-xml"&&wh(S,ge)},xd=function(S){yr(R.beforeSanitizeAttributes,S,null);let{attributes:J}=S;if(!J||pl(S))return;let H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je,forceKeepAttr:void 0},Fe=J.length;for(;Fe--;){let it=J[Fe],{name:Xe,namespaceURI:vr,value:Ot}=it,Jt=tt(Xe),pt=Xe==="value"?Ot:LI(Ot);if(H.attrName=Jt,H.attrValue=pt,H.keepAttr=!0,H.forceKeepAttr=void 0,yr(R.uponSanitizeAttribute,S,H),pt=H.attrValue,od&&(Jt==="id"||Jt==="name")&&(go(Xe,S),pt=Nb+pt),al&>(/((--!?|])>)|<\/(style|title)/i,pt)){go(Xe,S);continue}if(H.forceKeepAttr||(go(Xe,S),!H.keepAttr))continue;if(!ad&>(/\/>/i,pt)){go(Xe,S);continue}zn&&Lo([D,V,F],Ub=>{pt=Va(pt,Ub," ")});let wd=tt(S.nodeName);if(yd(wd,Jt,pt)){if(f&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!vr)switch(h.getAttributeType(wd,Jt)){case"TrustedHTML":{pt=f.createHTML(pt);break}case"TrustedScriptURL":{pt=f.createScriptURL(pt);break}}try{vr?S.setAttributeNS(vr,Xe,pt):S.setAttribute(Xe,pt),pl(S)?hn(S):xh(t.removed)}catch{}}}yr(R.afterSanitizeAttributes,S,null)},$b=function S(J){let H=null,Fe=md(J);for(yr(R.beforeSanitizeShadowDOM,J,null);H=Fe.nextNode();)yr(R.uponSanitizeShadowNode,H,null),bd(H),xd(H),H.content instanceof i&&S(H.content);yr(R.afterSanitizeShadowDOM,J,null)};return t.sanitize=function(S){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,Fe=null,it=null,Xe=null;if(cl=!S,cl&&(S="<!-->"),typeof S!="string"&&!fd(S))if(typeof S.toString=="function"){if(S=S.toString(),typeof S!="string")throw Ha("dirty is not a string, aborting")}else throw Ha("toString is not a function");if(!t.isSupported)return S;if(il||dl(J),t.removed=[],typeof S=="string"&&(Ra=!1),Ra){if(S.nodeName){let Jt=tt(S.nodeName);if(!oe[Jt]||fr[Jt])throw Ha("root node is forbidden and cannot be sanitized in-place")}}else if(S instanceof s)H=gd("<!---->"),Fe=H.ownerDocument.importNode(S,!0),Fe.nodeType===Ga.element&&Fe.nodeName==="BODY"||Fe.nodeName==="HTML"?H=Fe:H.appendChild(Fe);else{if(!Vn&&!zn&&!pn&&S.indexOf("<")===-1)return f&&lo?f.createHTML(S):S;if(H=gd(S),!H)return Vn?null:lo?k:""}H&&ol&&hn(H.firstChild);let vr=md(Ra?S:H);for(;it=vr.nextNode();)bd(it),xd(it),it.content instanceof i&&$b(it.content);if(Ra)return S;if(Vn){if(so)for(Xe=P.call(H.ownerDocument);H.firstChild;)Xe.appendChild(H.firstChild);else Xe=H;return(je.shadowroot||je.shadowrootmode)&&(Xe=L.call(n,Xe,!0)),Xe}let Ot=pn?H.outerHTML:H.innerHTML;return pn&&oe["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&>(Sb,H.ownerDocument.doctype.name)&&(Ot="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
|
|
566
|
+
`+Ot),zn&&Lo([D,V,F],Jt=>{Ot=Va(Ot,Jt," ")}),f&&lo?f.createHTML(Ot):Ot},t.setConfig=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dl(S),il=!0},t.clearConfig=function(){Wn=null,il=!1},t.isValidAttribute=function(S,J,H){Wn||dl({});let Fe=tt(S),it=tt(J);return yd(Fe,it,H)},t.addHook=function(S,J){typeof J=="function"&&za(R[S],J)},t.removeHook=function(S,J){if(J!==void 0){let H=RI(R[S],J);return H===-1?void 0:DI(R[S],H,1)[0]}return xh(R[S])},t.removeHooks=function(S){R[S]=[]},t.removeAllHooks=function(){R=Ch()},t}var Ph=Eb();function Xu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bn=Xu();function Cb(e){Bn=e}var Pb=/[&<>"']/,XI=new RegExp(Pb.source,"g"),Ob=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,JI=new RegExp(Ob.source,"g"),QI={"&":"&","<":"<",">":">",'"':""","'":"'"},Oh=e=>QI[e];function _t(e,t){if(t){if(Pb.test(e))return e.replace(XI,Oh)}else if(Ob.test(e))return e.replace(JI,Oh);return e}var e6=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t6(e){return e.replace(e6,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var r6=/(^|[^\[])\^/g;function Le(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(n,a)=>(a=typeof a=="object"&&"source"in a?a.source:a,a=a.replace(r6,"$1"),e=e.replace(n,a),r),getRegex:()=>new RegExp(e,t)};return r}function Ih(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}var Rs={exec:()=>null};function Nh(e,t){let r=e.replace(/\|/g,(i,o,s)=>{let l=!1,c=o;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/),a=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(/\\\|/g,"|");return n}function ec(e,t,r){let n=e.length;if(n===0)return"";let a=0;for(;a<n;){let i=e.charAt(n-a-1);if(i===t&&!r)a++;else if(i!==t&&r)a++;else break}return e.slice(0,n-a)}function n6(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}function Ah(e,t,r,n){let a=t.href,i=t.title?_t(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;let s={type:"link",raw:r,href:a,title:i,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,s}return{type:"image",raw:r,href:a,title:i,text:_t(o)}}function a6(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let n=r[1];return t.split(`
|
|
567
|
+
`).map(a=>{let i=a.match(/^\s+/);if(i===null)return a;let[o]=i;return o.length>=n.length?a.slice(n.length):a}).join(`
|
|
568
|
+
`)}var Ds=class{options;rules;lexer;constructor(e){this.options=e||Bn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ec(r,`
|
|
569
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=a6(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){let n=ec(r,"#");(this.options.pedantic||!n||/ $/.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;let a=this.lexer.blockTokens(r);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:a,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,a={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),o="",s="",l=!1;for(;e;){let c=!1;if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let u=t[2].split(`
|
|
570
|
+
`,1)[0].replace(/^\t+/,v=>" ".repeat(3*v.length)),d=e.split(`
|
|
571
|
+
`,1)[0],p=0;this.options.pedantic?(p=2,s=u.trimStart()):(p=t[2].search(/[^ ]/),p=p>4?1:p,s=u.slice(p),p+=t[1].length);let h=!1;if(!u&&/^ *$/.test(d)&&(o+=d+`
|
|
572
|
+
`,e=e.substring(d.length+1),c=!0),!c){let v=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),w=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),b=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),x=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){let f=e.split(`
|
|
573
|
+
`,1)[0];if(d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),b.test(d)||x.test(d)||v.test(d)||w.test(e))break;if(d.search(/[^ ]/)>=p||!d.trim())s+=`
|
|
574
|
+
`+d.slice(p);else{if(h||u.search(/[^ ]/)>=4||b.test(u)||x.test(u)||w.test(u))break;s+=`
|
|
575
|
+
`+d}!h&&!d.trim()&&(h=!0),o+=f+`
|
|
576
|
+
`,e=e.substring(f.length+1),u=d.slice(p)}}a.loose||(l?a.loose=!0:/\n *\n *$/.test(o)&&(l=!0));let y=null,m;this.options.gfm&&(y=/^\[[ xX]\] /.exec(s),y&&(m=y[0]!=="[ ] ",s=s.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:o,task:!!y,checked:m,loose:!1,text:s,tokens:[]}),a.raw+=o}a.items[a.items.length-1].raw=o.trimEnd(),a.items[a.items.length-1].text=s.trimEnd(),a.raw=a.raw.trimEnd();for(let c=0;c<a.items.length;c++)if(this.lexer.state.top=!1,a.items[c].tokens=this.lexer.blockTokens(a.items[c].text,[]),!a.loose){let u=a.items[c].tokens.filter(p=>p.type==="space"),d=u.length>0&&u.some(p=>/\n.*\n/.test(p.raw));a.loose=d}if(a.loose)for(let c=0;c<a.items.length;c++)a.items[c].loose=!0;return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;let r={type:"table",raw:t[0],header:Nh(t[1]).map(n=>({text:n,tokens:[]})),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
577
|
+
`):[]};if(r.header.length===r.align.length){let n=r.align.length,a,i,o,s;for(a=0;a<n;a++){let l=r.align[a];l&&(/^ *-+: *$/.test(l)?r.align[a]="right":/^ *:-+: *$/.test(l)?r.align[a]="center":/^ *:-+ *$/.test(l)?r.align[a]="left":r.align[a]=null)}for(n=r.rows.length,a=0;a<n;a++)r.rows[a]=Nh(r.rows[a],r.header.length).map(l=>({text:l,tokens:[]}));for(n=r.header.length,i=0;i<n;i++)r.header[i].tokens=this.lexer.inline(r.header[i].text);for(n=r.rows.length,i=0;i<n;i++)for(s=r.rows[i],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return r}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
|
|
578
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:_t(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let i=ec(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=n6(t[2],"()");if(i>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let n=t[2],a="";if(this.options.pedantic){let i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);i&&(n=i[1],a=i[3])}else a=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(r)?n=n.slice(1):n=n.slice(1,-1)),Ah(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:a&&a.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Ah(r,n,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!(!n||n[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let a=[...n[0]].length-1,i,o,s=a,l=0,c=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n[0].length-1);(n=c.exec(t))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){s+=o;continue}else if((n[5]||n[6])&&a%3&&!((a+o)%3)){l+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+l);let u=[...e].slice(0,a+n.index+o+1).join("");if(Math.min(a,o)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," "),n=/[^ ]/.test(r),a=/^ /.test(r)&&/ $/.test(r);return n&&a&&(r=r.substring(1,r.length-1)),r=_t(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=_t(t[1]),n="mailto:"+r):(r=_t(t[1]),n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=_t(t[0]),n="mailto:"+r;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0];while(a!==t[0]);r=_t(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=_t(t[0]),{type:"text",raw:t[0],text:r}}}},pe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Rs,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;pe.def=Le(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex();pe.bullet=/(?:[*+-]|\d{1,9}[.)])/;pe.listItemStart=Le(/^( *)(bull) */).replace("bull",pe.bullet).getRegex();pe.list=Le(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex();pe._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";pe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;pe.html=Le(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();pe.lheading=Le(pe.lheading).replace(/bull/g,pe.bullet).getRegex();pe.paragraph=Le(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex();pe.blockquote=Le(pe.blockquote).replace("paragraph",pe.paragraph).getRegex();pe.normal={...pe};pe.gfm={...pe.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};pe.gfm.table=Le(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex();pe.gfm.paragraph=Le(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",pe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe._tag).getRegex();pe.pedantic={...pe.normal,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
579
|
+
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Rs,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Rs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};q._punctuation="\\p{P}$+<=>`^|~";q.punctuation=Le(q.punctuation,"u").replace(/punctuation/g,q._punctuation).getRegex();q.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;q.anyPunctuation=/\\[punct]/g;q._escapes=/\\([punct])/g;q._comment=Le(pe._comment).replace("(?:-->|$)","-->").getRegex();q.emStrong.lDelim=Le(q.emStrong.lDelim,"u").replace(/punct/g,q._punctuation).getRegex();q.emStrong.rDelimAst=Le(q.emStrong.rDelimAst,"gu").replace(/punct/g,q._punctuation).getRegex();q.emStrong.rDelimUnd=Le(q.emStrong.rDelimUnd,"gu").replace(/punct/g,q._punctuation).getRegex();q.anyPunctuation=Le(q.anyPunctuation,"gu").replace(/punct/g,q._punctuation).getRegex();q._escapes=Le(q._escapes,"gu").replace(/punct/g,q._punctuation).getRegex();q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;q.autolink=Le(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex();q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;q.tag=Le(q.tag).replace("comment",q._comment).replace("attribute",q._attribute).getRegex();q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;q.link=Le(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex();q.reflink=Le(q.reflink).replace("label",q._label).replace("ref",pe._label).getRegex();q.nolink=Le(q.nolink).replace("ref",pe._label).getRegex();q.reflinkSearch=Le(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex();q.normal={...q};q.pedantic={...q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()};q.gfm={...q.normal,escape:Le(q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};q.gfm.url=Le(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex();q.breaks={...q.gfm,br:Le(q.br).replace("{2,}","*").getRegex(),text:Le(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};var In=class uu{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Bn,this.options.tokenizer=this.options.tokenizer||new Ds,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={block:pe.normal,inline:q.normal};this.options.pedantic?(r.block=pe.pedantic,r.inline=q.pedantic):this.options.gfm&&(r.block=pe.gfm,this.options.breaks?r.inline=q.breaks:r.inline=q.gfm),this.tokenizer.rules=r}static get rules(){return{block:pe,inline:q}}static lex(t,r){return new uu(r).lex(t)}static lexInline(t,r){return new uu(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
580
|
+
`),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,c)=>l+" ".repeat(c.length));let n,a,i,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(n=s.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
|
|
581
|
+
`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),a=r[r.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=`
|
|
582
|
+
`+n.raw,a.text+=`
|
|
583
|
+
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),a=r[r.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=`
|
|
584
|
+
`+n.raw,a.text+=`
|
|
585
|
+
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){a=r[r.length-1],o&&a.type==="paragraph"?(a.raw+=`
|
|
586
|
+
`+n.raw,a.text+=`
|
|
587
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(n),o=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),a=r[r.length-1],a&&a.type==="text"?(a.raw+=`
|
|
588
|
+
`+n.raw,a.text+=`
|
|
589
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):r.push(n);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,a,i,o=t,s,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,s.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),a=r[r.length-1],a&&n.type==="text"&&a.type==="text"?(a.raw+=n.raw,a.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),a=r[r.length-1],a&&n.type==="text"&&a.type==="text"?(a.raw+=n.raw,a.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,o,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,d=t.slice(1),p;this.options.extensions.startInline.forEach(h=>{p=h.call({lexer:this},d),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,a=r[r.length-1],a&&a.type==="text"?(a.raw+=n.raw,a.text+=n.text):r.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}},Ms=class{options;constructor(e){this.options=e||Bn}code(e,t,r){let n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+`
|
|
590
|
+
`,n?'<pre><code class="language-'+_t(n)+'">'+(r?e:_t(e,!0))+`</code></pre>
|
|
591
|
+
`:"<pre><code>"+(r?e:_t(e,!0))+`</code></pre>
|
|
592
|
+
`}blockquote(e){return`<blockquote>
|
|
593
|
+
${e}</blockquote>
|
|
594
|
+
`}html(e,t){return e}heading(e,t,r){return`<h${t}>${e}</h${t}>
|
|
595
|
+
`}hr(){return`<hr>
|
|
596
|
+
`}list(e,t,r){let n=t?"ol":"ul",a=t&&r!==1?' start="'+r+'"':"";return"<"+n+a+`>
|
|
597
|
+
`+e+"</"+n+`>
|
|
598
|
+
`}listitem(e,t,r){return`<li>${e}</li>
|
|
599
|
+
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
|
|
600
|
+
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
601
|
+
<thead>
|
|
602
|
+
`+e+`</thead>
|
|
603
|
+
`+t+`</table>
|
|
604
|
+
`}tablerow(e){return`<tr>
|
|
605
|
+
${e}</tr>
|
|
606
|
+
`}tablecell(e,t){let r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
607
|
+
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){let n=Ih(e);if(n===null)return r;e=n;let a='<a href="'+e+'"';return t&&(a+=' title="'+t+'"'),a+=">"+r+"</a>",a}image(e,t,r){let n=Ih(e);if(n===null)return r;e=n;let a=`<img src="${e}" alt="${r}"`;return t&&(a+=` title="${t}"`),a+=">",a}text(e){return e}},Ju=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}},Nn=class du{options;renderer;textRenderer;constructor(t){this.options=t||Bn,this.options.renderer=this.options.renderer||new Ms,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ju}static parse(t,r){return new du(r).parse(t)}static parseInline(t,r){return new du(r).parseInline(t)}parse(t,r=!0){let n="";for(let a=0;a<t.length;a++){let i=t[a];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let o=i,s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=s||"";continue}}switch(i.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{let o=i;n+=this.renderer.heading(this.parseInline(o.tokens),o.depth,t6(this.parseInline(o.tokens,this.textRenderer)));continue}case"code":{let o=i;n+=this.renderer.code(o.text,o.lang,!!o.escaped);continue}case"table":{let o=i,s="",l="";for(let u=0;u<o.header.length;u++)l+=this.renderer.tablecell(this.parseInline(o.header[u].tokens),{header:!0,align:o.align[u]});s+=this.renderer.tablerow(l);let c="";for(let u=0;u<o.rows.length;u++){let d=o.rows[u];l="";for(let p=0;p<d.length;p++)l+=this.renderer.tablecell(this.parseInline(d[p].tokens),{header:!1,align:o.align[p]});c+=this.renderer.tablerow(l)}n+=this.renderer.table(s,c);continue}case"blockquote":{let o=i,s=this.parse(o.tokens);n+=this.renderer.blockquote(s);continue}case"list":{let o=i,s=o.ordered,l=o.start,c=o.loose,u="";for(let d=0;d<o.items.length;d++){let p=o.items[d],h=p.checked,y=p.task,m="";if(p.task){let v=this.renderer.checkbox(!!h);c?p.tokens.length>0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=v+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=v+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:v+" "}):m+=v+" "}m+=this.parse(p.tokens,c),u+=this.renderer.listitem(m,y,!!h)}n+=this.renderer.list(u,s,l);continue}case"html":{let o=i;n+=this.renderer.html(o.text,o.block);continue}case"paragraph":{let o=i;n+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;a+1<t.length&&t[a+1].type==="text";)o=t[++a],s+=`
|
|
608
|
+
`+(o.tokens?this.parseInline(o.tokens):o.text);n+=r?this.renderer.paragraph(s):s;continue}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let a=0;a<t.length;a++){let i=t[a];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}switch(i.type){case"escape":{let o=i;n+=r.text(o.text);break}case"html":{let o=i;n+=r.html(o.text);break}case"link":{let o=i;n+=r.link(o.href,o.title,this.parseInline(o.tokens,r));break}case"image":{let o=i;n+=r.image(o.href,o.title,o.text);break}case"strong":{let o=i;n+=r.strong(this.parseInline(o.tokens,r));break}case"em":{let o=i;n+=r.em(this.parseInline(o.tokens,r));break}case"codespan":{let o=i;n+=r.codespan(o.text);break}case"br":{n+=r.br();break}case"del":{let o=i;n+=r.del(this.parseInline(o.tokens,r));break}case"text":{let o=i;n+=r.text(o.text);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},qo=class{options;constructor(e){this.options=e||Bn}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}},i6=class{defaults=Xu();options=this.setOptions;parse=this.#s(In.lex,Nn.parse);parseInline=this.#s(In.lexInline,Nn.parseInline);Parser=Nn;parser=Nn.parse;Renderer=Ms;TextRenderer=Ju;Lexer=In;lexer=In.lex;Tokenizer=Ds;Hooks=qo;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let a=n;for(let i of a.header)r=r.concat(this.walkTokens(i.tokens,t));for(let i of a.rows)for(let o of i)r=r.concat(this.walkTokens(o.tokens,t));break}case"list":{let a=n;r=r.concat(this.walkTokens(a.items,t));break}default:{let a=n;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{r=r.concat(this.walkTokens(a[i],t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let i=t.renderers[a.name];i?t.renderers[a.name]=function(...o){let s=a.renderer.apply(this,o);return s===!1&&(s=i.apply(this,o)),s}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[a.level];i?i.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),n.extensions=t),r.renderer){let a=this.defaults.renderer||new Ms(this.defaults);for(let i in r.renderer){let o=r.renderer[i],s=i,l=a[s];a[s]=(...c)=>{let u=o.apply(a,c);return u===!1&&(u=l.apply(a,c)),u||""}}n.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new Ds(this.defaults);for(let i in r.tokenizer){let o=r.tokenizer[i],s=i,l=a[s];a[s]=(...c)=>{let u=o.apply(a,c);return u===!1&&(u=l.apply(a,c)),u}}n.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new qo;for(let i in r.hooks){let o=r.hooks[i],s=i,l=a[s];qo.passThroughHooks.has(i)?a[s]=c=>{if(this.defaults.async)return Promise.resolve(o.call(a,c)).then(d=>l.call(a,d));let u=o.call(a,c);return l.call(a,u)}:a[s]=(...c)=>{let u=o.apply(a,c);return u===!1&&(u=l.apply(a,c)),u}}n.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(o){let s=[];return s.push(i.call(this,o)),a&&(s=s.concat(a.call(this,o))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#s(e,t){return(r,n)=>{let a={...n},i={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);let o=this.#r(!!i.silent,!!i.async);if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(s=>e(s,i)).then(s=>i.walkTokens?Promise.all(this.walkTokens(s,i.walkTokens)).then(()=>s):s).then(s=>t(s,i)).then(s=>i.hooks?i.hooks.postprocess(s):s).catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));let s=e(r,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let l=t(s,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(s){return o(s)}}}#r(e,t){return r=>{if(r.message+=`
|
|
609
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+_t(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},$n=new i6;function Me(e,t){return $n.parse(e,t)}Me.options=Me.setOptions=function(e){return $n.setOptions(e),Me.defaults=$n.defaults,Cb(Me.defaults),Me};Me.getDefaults=Xu;Me.defaults=Bn;Me.use=function(...e){return $n.use(...e),Me.defaults=$n.defaults,Cb(Me.defaults),Me};Me.walkTokens=function(e,t){return $n.walkTokens(e,t)};Me.parseInline=$n.parseInline;Me.Parser=Nn;Me.parser=Nn.parse;Me.Renderer=Ms;Me.TextRenderer=Ju;Me.Lexer=In;Me.lexer=In.lex;Me.Tokenizer=Ds;Me.Hooks=qo;Me.parse=Me;var ZA=Me.options,GA=Me.setOptions,WA=Me.use,qA=Me.walkTokens,KA=Me.parseInline,YA=Nn.parse,XA=In.lex,o6=E('<div class="flex flex-col animate-fade-in makebot-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:100%;height:100%></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),s6=E("<span>"),l6=e=>{Me.use({renderer:{link:(r,n,a)=>`<a href="${r}" target="_blank" rel="noopener noreferrer">${a}</a>`}});let t=he(()=>Array.isArray(e.content)?e.content:e.content.split("```").flatMap((r,n)=>n%2===0?r.split(`
|
|
610
|
+
|
|
611
|
+
`).map(a=>Ph.sanitize(Me.parse(a.replace(/【.+】/g,"").replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})):[Ph.sanitize(Me.parse("```"+r+"```".replace(/</g,"<").replace(/>/g,">"),{breaks:!0}),{ADD_ATTR:["target"]})])?.filter(ot)??[]);return(()=>{var r=o6(),n=r.firstChild,a=n.firstChild,i=a.firstChild,o=i.nextSibling;return T(o,g(Je,{get each(){return t()},children:s=>(()=>{var l=s6();return l.innerHTML=s,l})()})),r})()},c6=E('<div class="flex flex-shrink-0 items-center relative makebot-avatar-container w-6 @xs:w-10"><div>'),pu=e=>{let t,[r,n]=N(0),a=new ResizeObserver(i=>{n(i[0].target.clientHeight)});return $e(()=>{t&&a.observe(t)}),Ie(()=>{t&&a.unobserve(t)}),(()=>{var i=c6(),o=i.firstChild,s=t;return typeof s=="function"?Ve(s,i):t=i,T(o,g(xb,{get src(){return e.theme.chat?.hostAvatar?.url},get isChatContainerLight(){return Su({chatContainer:e.theme.chat?.container,generalBackground:e.theme.general?.background})}})),U(l=>{var c=`${r()}px`,u=ae("absolute flex items-center w-6 h-6 @xs:w-10 @xs:h-10 top-[max(0px,calc(var(--top)-24px))] @xs:top-[max(0px,calc(var(--top)-40px))]",e.hideAvatar?"opacity-0":"opacity-100"),d=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return c!==l.e&&we(i,"--top",l.e=c),u!==l.t&&ne(o,l.t=u),d!==l.a&&we(o,"transition",l.a=d),l},{e:void 0,t:void 0,a:void 0}),i})()},u6=E('<div class="flex gap-1 @xs:gap-2 w-full"><div>'),d6=E("<div>"),p6=E('<div class="flex gap-1 @xs:gap-2"><div>'),h6=E('<div class="flex flex-col w-full min-w-0 gap-2 makebot-chat-chunk">'),g6=e=>{let t,[r,n]=N(e.isTransitionDisabled?e.messages.length:0),[a,i]=N();$e(()=>{e.streamingMessage||(e.messages.length===0&&e.onAllBubblesDisplayed(),e.onScrollToBottom({lastElement:t,offset:50}))});let o=async s=>{(e.settings.typingEmulation?.delayBetweenBubbles??Nt.typingEmulation.delayBetweenBubbles)>0&&r()<e.messages.length-1&&await new Promise(c=>setTimeout(c,(e.settings.typingEmulation?.delayBetweenBubbles??Nt.typingEmulation.delayBetweenBubbles)*1e3));let l=e.messages[r()].id;await e.onNewBubbleDisplayed(l),n(r()===e.messages.length?r():r()+1),e.onScrollToBottom({lastElement:s}),r()===e.messages.length&&(i(s),e.onAllBubblesDisplayed())};return(()=>{var s=h6();return T(s,g(X,{get when(){return e.messages.length>0},get children(){var l=u6(),c=l.firstChild;return T(l,g(X,{get when(){return j(()=>!!(e.theme.chat?.hostAvatar?.isEnabled??hi))()&&e.messages.length>0},get children(){return g(pu,{get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled},get theme(){return e.theme}})}}),c),T(c,g(Je,{get each(){return e.messages.slice(0,r()+1)},children:(u,d)=>g(OI,{message:u,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return j(()=>!!((e.settings.typingEmulation?.isDisabledOnFirstMessage??Nt.typingEmulation.isDisabledOnFirstMessage)&&e.index===0))()&&d()===0},get onTransitionEnd(){return e.isTransitionDisabled?void 0:o},get onCompleted(){return e.onSubmit}})})),U(()=>ne(c,ae("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??gc?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),T(s,g(X,{get when(){return j(()=>!!(e.input&&r()===e.messages.length&&!e.input.isHidden))()&&!e.isSessionFinalized},get children(){return g(X,{get when(){return f6(e.input)},get fallback(){return g(O9,{ref(l){var c=t;typeof c=="function"?c(l):t=l},get input(){return e.input},get chunkIndex(){return e.index},get theme(){return e.theme},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??Nt.general.isInputPrefillEnabled},onTransitionEnd:()=>e.onScrollToBottom({lastElement:a()}),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})},get children(){var l=d6(),c=t;return typeof c=="function"?Ve(c,l):t=l,T(l,g(u3,{get currentInputBlock(){return e.input},get defaultValue(){return b6(e.input)},get onSubmit(){return e.onSubmit}})),l}})}}),null),T(s,g(X,{get when(){return e.streamingMessage},get children(){var l=p6(),c=l.firstChild;return T(l,g(X,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??hi},get children(){return g(pu,{get hideAvatar(){return e.hideAvatar},get theme(){return e.theme}})}}),c),T(c,g(X,{get when(){return e.streamingMessage},children:u=>g(l6,{get content(){return u()}})})),U(()=>ne(c,ae("flex flex-col flex-1 gap-2",e.theme.chat?.guestAvatar?.isEnabled??gc?"max-w-[calc(100%-60px)] sm:max-w-[calc(100%-48px-48px)]":"max-w-full"))),l}}),null),s})()},m6=new Set(["text input","number input","email input","url input","phone number input"]),f6=e=>!!e&&m6.has(e.type),b6=e=>{if(e)return e.answer?.status==="retry"&&e.answer.type==="text"?e.answer.value:e.prefilledValue},y6=E('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start makebot-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing "data-testid=host-bubble style=width:64px;height:32px></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),v6=()=>(()=>{var e=y6(),t=e.firstChild,r=t.firstChild,n=r.firstChild;return T(n,g(mr,{})),e})(),x6=E('<div class="flex w-full makebot-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),w6=e=>(()=>{var t=x6(),r=t.firstChild,n=r.firstChild;return T(n,g(X,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??hi},get children(){return g(pu,{get theme(){return e.theme}})}}),null),T(n,g(v6,{}),null),t})(),k6=E('<div><div><div class="w-full flex flex-col gap-2 @xs:px-5 px-3">'),_6=E('<div class="w-full flex-shrink-0 makebot-bottom-spacer h-5">'),T6=.6,S6=50,E6=e=>{let t,r=Lg(),[n,a]=yc(N([{version:"2",input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions,dynamicTheme:e.initialChatReply.dynamicTheme}]),{key:`makebot-${e.context.makebot.id}-chatChunks`,storage:e.context.storage,transformInitDataFromStorage:O=>t3(O,{storage:e.context.storage,makebotId:e.context.makebot.id}),onRecovered:()=>{setTimeout(()=>{h()?.scrollTo(0,h().scrollHeight)},200)}}),[i,o]=yc(N(!1),{key:`makebot-${e.context.makebot.id}-isEnded`,storage:e.context.storage}),[s,l]=N(!1),[c,u]=N(!0),[d,p]=N(!1);$e(()=>{window.addEventListener("message",P),window.addEventListener("makebot-api-response",O=>{console.log("\u{1F50D} Evento de resposta da API recebido:",O.detail),O.detail?.response&&x({data:O.detail.response,error:void 0})}),(async()=>{if(n().length>1){y();let O=n().findLast(A=>A.dynamicTheme?.backgroundUrl)?.dynamicTheme;O?.backgroundUrl&&Dh(O.backgroundUrl,r()?.style),n().at(-1)?.input?.answer&&b(n().at(-1)?.input?.answer)}await C()})()});let h=()=>r()?.querySelector(".scrollable-container"),y=()=>{n().at(-1)?.streamingMessage&&a(O=>O.slice(0,-1))},m=({message:O})=>{l(!1),u(!1),n().at(-1)?.streamingMessage?a(A=>A.map((z,ge)=>ge===A.length-1?{...z,messages:[],streamingMessage:O}:z)):a(A=>[...A,{version:"2",messages:[],streamingMessage:O}])},v=async O=>{if(!O||(e.onNewLogs?.(O),e.context.isPreview))return;let A=e.initialChatReply.sessionId;A&&await Zp({apiHost:e.context.apiHost,sessionId:A,clientLogs:O})},w=()=>{Er.create({title:e.context.makebot.settings.general?.systemMessages?.networkErrorTitle??Kr.networkErrorTitle,description:e.context.makebot.settings.general?.systemMessages?.networkErrorMessage??Kr.networkErrorMessage})},b=async O=>{if(d())return;let A=n().at(-1);if(O&&O.type!=="clientSideResult"&&a(Rh(O)),A?.clientSideActions&&A.clientSideActions.length>0&&A.input?.answer?.status==="retry"){await C();return}A?.input?.id&&O&&O.type!=="clientSideResult"&&e.onAnswer&&e.onAnswer({message:e3(O),blockId:A.input.id});let z=e.initialChatReply.sessionId;if(!z)return;let ge=setTimeout(()=>{l(!0)},1e3);f();let{data:me,error:oe}=await Rc({apiHost:e.context.apiHost,sessionId:z,message:P6(O)});clearTimeout(ge),l(!1),await x({data:me,error:oe})},x=async({data:O,error:A})=>{if(A){let z=A instanceof Error?A.message:String(A);if(z.includes("Sess\xE3o n\xE3o encontrada")||z.includes("NOT_FOUND")||A?.code==="NOT_FOUND"||A?.response?.status===404||A?.type==="HTTP_ERROR"){p(!0),o(!0);let oe=e.initialChatReply.makebot.settings.general?.systemMessages?.sessionFinalized??Kr.sessionFinalized;a(Ze=>[...Ze,{version:"2",messages:[{id:`finalization-${Date.now()}`,type:"text",content:{type:"richText",richText:[{type:"p",children:[{text:oe}]}]}}],input:void 0,clientSideActions:[]}]);return}let ge=[await tl({err:A,context:"Ao enviar mensagem"})];e.onNewLogs?.(ge);let me=e.initialChatReply.sessionId;me&&await Zp({apiHost:e.context.apiHost,sessionId:me,clientLogs:ge});return}O&&(O.progress&&e.onProgressUpdate?.(O.progress),O.lastMessageNewFormat&&a(I6(O.lastMessageNewFormat)),O.logs&&e.onNewLogs?.(O.logs),O.dynamicTheme?.backgroundUrl&&Dh(O.dynamicTheme.backgroundUrl,r()?.style),O.input&&e.onNewInputBlock&&e.onNewInputBlock(O.input),a(A6(O)),await C())},f=({lastElement:O,offset:A=0}={})=>{let z=h();if(!z||z.scrollTop+z.clientHeight<z.scrollHeight-z.clientHeight*T6&&!c())return;let ge=me=>{let oe,Ze=()=>{clearTimeout(oe),oe=window.setTimeout(()=>{me(),z?.removeEventListener("scroll",Ze)},100)};z?.addEventListener("scroll",Ze,{passive:!0})};setTimeout(()=>{ge(()=>{if(!z)return;let me=Math.abs(z.scrollHeight-z.scrollTop-z.clientHeight)<2;u(me)}),z?.scrollTo({top:O?O.offsetTop-A:z?.scrollHeight,behavior:"smooth"})},S6)},k=async()=>{let O=n().at(-1);O&&Vt(O.input)&&(o(!0),e.onEnd?.())},_=async O=>{await C(O)},C=async O=>{let A=!1,z=[];for(let me of n().at(-1)?.clientSideActions??[]){if(O!==me.lastBubbleBlockId)break;z.push(me)}if(z.length===0)return;let ge=e.initialChatReply.sessionId;if(ge)for(let me of z){("streamOpenAiChatCompletion"in me||"webhookToExecute"in me||"stream"in me)&&l(!0);let oe=await QC({clientSideAction:me,context:{apiHost:e.context.apiHost,wsHost:e.context.wsHost,sessionId:ge,resultId:e.initialChatReply.resultId},onMessageStream:m,onStreamError:async Ze=>{a(M6),A=!0,await v([Ze]),e.onNewLogs?.([Ze])}});if(("streamOpenAiChatCompletion"in me||"stream"in me)&&oe&&"replyToSend"in oe&&!oe.replyToSend){l(!1);continue}if(A)return;if(a(N6),oe&&"logs"in oe&&v(oe.logs),oe&&"replyToSend"in oe){l(!1),b(oe.replyToSend?{type:"clientSideResult",result:oe.replyToSend}:void 0);return}oe&&"blockedPopupUrl"in oe&&Er.create({title:e.context.makebot.settings.general?.systemMessages?.popupBlockedTitle??Kr.popupBlockedTitle,description:e.context.makebot.settings.general?.systemMessages?.popupBlockedDescription??Kr.popupBlockedDescription,meta:{link:oe.blockedPopupUrl}}),oe&&"scriptCallbackMessage"in oe&&e.onScriptExecutionSuccess?.(oe.scriptCallbackMessage)}};Ie(()=>{window.removeEventListener("message",P)});let P=async O=>{let{data:A}=O;!A.isFromMakebot||A.id&&e.context.makebot.id!==A.id||A.command==="sendCommand"&&!i()&&await I(A.text)},I=async(O,A=0,z=5)=>{if(s()){if(A>=z)throw new Error("O n\xFAmero m\xE1ximo de tentativas de repeti\xE7\xE3o para o comando foi atingido");return await new Promise(je=>setTimeout(je,5e3)),I(O,A+1,z)}let ge=e.initialChatReply.sessionId;if(!ge)return;let me=setTimeout(()=>{l(!0)},1e3);f();let{data:oe,error:Ze}=await Rc({apiHost:e.context.apiHost,sessionId:ge,message:{type:"command",command:O}});return clearTimeout(me),l(!1),n().at(-1)?.input?.id&&oe&&a(O6),x({data:oe,error:Ze})},L=O=>{a(Rh({type:"text",value:O})),b(void 0)},R=he(()=>hc(e.initialChatReply.makebot.theme,n().findLast(O=>O.dynamicTheme)?.dynamicTheme)),D=EE(()=>t),V=he(()=>(e.initialChatReply.makebot.theme.chat?.container?.backgroundColor??Vs)==="transparent"),F=he(()=>n().filter(D6)),le=he(()=>{let O=F(),A=s();return O.map((z,ge)=>{let me=O[ge+1];return((!z.input||z.input?.isHidden)&&((me?.messages?.length??0)>0||me?.streamingMessage!==void 0||z.messages.length>0&&A))??!1})});return g(Cf.Provider,{value:D,get children(){var O=k6(),A=O.firstChild,z=A.firstChild,ge=t;return typeof ge=="function"?Ve(ge,A):t=A,T(z,g(Ag,{get each(){return F()},children:(me,oe)=>{let Ze=me().messages.some(je=>je.id?.startsWith("finalization-"));return g(g6,{index:oe,get messages(){return me().messages},get input(){return me().input},get theme(){return hc(e.initialChatReply.makebot.theme,me().dynamicTheme)},get settings(){return e.initialChatReply.makebot.settings},get context(){return e.context},get hideAvatar(){return le()[oe]},get isTransitionDisabled(){return Ze||oe!==F().length-1},get streamingMessage(){return me().streamingMessage},get isSessionFinalized(){return d()},onNewBubbleDisplayed:_,onAllBubblesDisplayed:k,onSubmit:b,onScrollToBottom:f,onSkip:L})}}),null),T(z,g(X,{get when(){return s()},get children(){return g(w6,{get theme(){return R()}})}}),null),T(A,g(C6,{}),null),U(me=>{var oe=ae("w-full h-full px-[calc((100%-var(--makebot-chat-container-max-width))/2)]",V()?"overflow-y-auto scroll-smooth scrollable-container":"@container flex @xs:items-center"),Ze=ae("@container relative makebot-chat-view w-full flex flex-col items-center pt-5 max-w-chat-container",V()?void 0:ae("overflow-y-auto scroll-smooth scrollable-container","@xs:min-h-chat-container max-h-full @xs:max-h-chat-container @xs:rounded-chat-container"));return oe!==me.e&&ne(O,me.e=oe),Ze!==me.t&&ne(A,me.t=Ze),me},{e:void 0,t:void 0}),O}})},C6=()=>_6(),P6=e=>{if(e){if(e.type==="clientSideResult")return{type:"text",text:e.result};if(e.type==="text")return{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(t=>t.url)};if(e.type==="recording")return{type:"audio",url:e.url}}},O6=e=>{let t=e[e.length-1];return!t||!t.input||t.input.answer?e:e.map((r,n)=>n===e.length-1?{...r,input:{...r.input,isHidden:!0}}:r)},I6=e=>t=>{let r=t[t.length-1];return!r||!r.input||!r.input.answer||r.input.answer.type==="recording"||r.input.answer?.type==="text"&&r.input.answer.label?t:r.input.type!=="file input"?t.map((n,a)=>a===t.length-1?{...n,input:{...n.input,answer:{...n.input.answer,label:e}}}:n):t},Rh=e=>t=>{let r=t[t.length-1];return!r||!r.input?t:t.map((n,a)=>a===t.length-1?{...n,input:{...n.input,answer:e}}:n)},N6=e=>{let t=e[e.length-1];return!t||!t.clientSideActions?e:e.reduce((r,n,a)=>{if(a===e.length-1){let i=n.clientSideActions.slice(1);if(i.length===0&&n.messages.length===0&&!n.input)return r;r.push({...n,clientSideActions:i})}else r.push(n);return r},[])},Dh=(e,t)=>{Qg({background:{type:"Image",content:e},documentStyle:t??document.documentElement.style,makebotVersion:"6.1"})},A6=e=>t=>[...t,{version:"2",clientSideActions:e.clientSideActions,input:e.input,dynamicTheme:e.dynamicTheme,messages:R6(e.messages)}],R6=e=>e.filter(t=>t.type!=="text"||t.content.type!=="richText"||t.content.richText.length>1||t.content.richText[0].type!=="variable"||t.content.richText[0].children.length>0),D6=e=>!e.clientSideActions||e.clientSideActions.every(t=>t.lastBubbleBlockId),M6=e=>{let t=e[e.length-1];return!t||!t.input||!t.input.answer?e:e.map((r,n)=>n===e.length-1?{...r,input:{...r.input,answer:{...r.input.answer,status:"retry"}}}:r)},L6=E('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),F6=e=>(()=>{var t=L6(),r=t.firstChild,n=r.nextSibling;return T(r,()=>e.error.message),T(n,()=>JSON.stringify(e.error.cause,null,2)),t})(),$6=E(`<svg viewBox="0 0 234 38"width=120 fill=#000000><path fill=#22C55E d="M13.5489721,3.8939648c-5.0947256,0-9.4274693,3.2543087-11.0383406,7.7968044
|
|
612
|
+
c-1.3952296,0.2563066-2.4532197,1.4763889-2.4532197,2.9457264v4.2195015c0,1.4153919,0.9821827,2.5986042,2.3013499,2.9129047
|
|
613
|
+
c1.4411333,4.6643772,5.7187138,8.0823364,10.8184519,8.2417374v0.0031719c0,0,1.9996777,0.0249481,1.9996777,0.9279823
|
|
614
|
+
c0,0.9030628,0,2.4457989,0,2.4457989s-0.3786688,1.1664505,1.3898201,0.5267715
|
|
615
|
+
c1.7684898-0.6396751,12.1748581-4.5641861,12.1748581-4.5641861h-0.0061169
|
|
616
|
+
c3.4719601-1.2284069,6.1905193-4.0473537,7.2826328-7.5809078c1.3199043-0.3137627,2.3028221-1.4973717,2.3028221-2.9132729
|
|
617
|
+
v-4.2195015c0-1.4693375-1.0580177-2.6894484-2.4532738-2.9457264c-1.6108437-4.5425243-5.9435883-7.7968044-11.0383148-7.7968044
|
|
618
|
+
H13.5489721z M31.9824276,18.9303589c0,4.0361137-3.2719231,7.3080349-7.3080635,7.3080349H13.7039289
|
|
619
|
+
c-4.0361128,0-7.3080635-3.2719212-7.3080635-7.3080349v-4.1975536c0-4.0361128,3.2719507-7.308063,7.3080635-7.308063h10.9704351
|
|
620
|
+
c4.0361404,0,7.3080635,3.2719502,7.3080635,7.308063V18.9303589z"></path><path fill=#22C55E d="M13.1901875,13.8604603h-0.1002903c-0.6312008,0-1.1428757,0.8121099-1.1428757,1.8138523v2.2679863
|
|
621
|
+
c0,1.0017414,0.5116749,1.8138504,1.1428757,1.8138504h0.1002903c0.6312008,0,1.1428757-0.812109,1.1428757-1.8138504v-2.2679863
|
|
622
|
+
C14.3330631,14.6725702,13.8213882,13.8604603,13.1901875,13.8604603z"></path><path fill=#22C55E d="M25.5539169,13.9176788h-0.1002903c-0.6312008,0-1.1428757,0.812109-1.1428757,1.8138514v2.2679853
|
|
623
|
+
c0,1.0017433,0.5116749,1.8138523,1.1428757,1.8138523h0.1002903c0.6312027,0,1.1428776-0.812109,1.1428776-1.8138523v-2.2679853
|
|
624
|
+
C26.6967945,14.7297878,26.1851196,13.9176788,25.5539169,13.9176788z"></path><path d="M70.4791183,9.9121847c5.9700775,0,7.8605347,1.9238262,7.8605347,6.7327051v10.7462749
|
|
625
|
+
c0,0.4972973-0.232193,0.7294903-0.7297134,0.7294903h-3.2502594c-0.4975281,0-0.7297211-0.232193-0.7297211-0.7294903v-9.6186733
|
|
626
|
+
c0-2.7858677-0.5306625-3.6479092-3.4161682-3.6479092h-5.8372955v13.2665825c0,0.4972973-0.2653351,0.7294903-0.7628593,0.7294903
|
|
627
|
+
h-3.2502556c-0.4975281,0-0.7297211-0.232193-0.7297211-0.7294903V14.1245823h-5.6382408
|
|
628
|
+
c-2.8523712,0-3.6152267,0.8620415-3.6152267,3.6479092v9.6186733c0,0.4972973-0.2321968,0.7294903-0.7294922,0.7294903h-3.2504845
|
|
629
|
+
c-0.4975243,0-0.7626266-0.232193-0.7626266-0.7294903V16.6448898c0-4.8088789,1.9235954-6.7327051,7.8934441-6.7327051H70.4791183z
|
|
630
|
+
"></path><path d="M95.3227081,9.9121847c5.9700775,0,7.8936768,1.9238262,7.8936768,6.7327051v8.8224487
|
|
631
|
+
c0,2.1560192-0.5306625,2.6533165-2.4542618,2.6533165H84.9747772c-3.913475,0-5.1075821-1.4260712-5.1075821-4.7096939v-1.5919895
|
|
632
|
+
c0-2.7858677,1.1941071-4.3449497,5.1075821-4.3449497h13.4987717v-0.6298485c0-2.1226521-0.7294846-2.9517851-3.6149979-2.9517851
|
|
633
|
+
H80.9947968c-0.3978806,0-0.5969391-0.1659184-0.5969391-0.5969391v-2.7863255c0-0.3976545,0.1990585-0.5969391,0.5969391-0.5969391
|
|
634
|
+
H95.3227081z M98.4735489,23.3446846v-2.9184189H86.3345718c-1.3597946,0-1.8570938,0.5635719-1.8570938,1.6248989v0.6965809
|
|
635
|
+
c0,1.1938782,0.4972992,1.7245426,1.8570938,1.7245426h11.1772919
|
|
636
|
+
C98.2082214,24.4722881,98.4735489,24.1738186,98.4735489,23.3446846z"></path><path d="M108.8889008,9.8793449c0.4975281,0,0.7297211,0.2321939,0.7297211,0.7294903v6.5004425h6.1026306
|
|
637
|
+
c1.8904572,0,2.4211197-0.1659184,3.2833939-1.3927059l3.7144165-5.2403574
|
|
638
|
+
c0.2655563-0.3981113,0.4977493-0.5640297,0.9950485-0.5640297h3.7480087c0.4972992,0,0.6303024,0.4643879,0.3318329,0.8954086
|
|
639
|
+
l-4.2786713,5.8706636c-0.6632156,0.8954086-1.3264313,1.5919895-2.0563736,2.1226521
|
|
640
|
+
c0.928772,0.5306644,1.6916275,1.2272453,2.3548431,2.122654l4.7097015,6.36796
|
|
641
|
+
c0.2650909,0.3647442,0.0996399,0.8291321-0.3981171,0.8291321h-3.7146454c-0.5635681,0-0.7628555-0.0996418-1.0279617-0.4643879
|
|
642
|
+
l-4.0464783-5.5717354c-0.79599-1.061327-1.4923477-1.8335629-3.3165283-1.8335629h-6.4011002v7.1401958
|
|
643
|
+
c0,0.4972973-0.232193,0.7294903-0.7297211,0.7294903h-3.2502518c-0.4975281,0-0.7628555-0.232193-0.7628555-0.7294903V10.6088352
|
|
644
|
+
c0-0.4972963,0.2653275-0.7294903,0.7628555-0.7294903H108.8889008z"></path><path d="M145.6054535,9.9121847c4.5437775,0,5.7376556,1.4260721,5.7376556,5.4391851v3.1510696
|
|
645
|
+
c0,1.4260731-0.5969391,1.8904591-1.8904572,1.8904591h-16.7490387v0.7957668c0,2.0897446,0.7628632,2.951786,3.6483765,2.951786
|
|
646
|
+
h13.8301544c0.3981171,0,0.5973969,0.1992855,0.5973969,0.5973969v2.7858677c0,0.3981113-0.1992798,0.5969391-0.5973969,0.5969391
|
|
647
|
+
h-14.2945404c-5.9696198,0-7.8934479-1.8904591-7.8934479-6.6997948v-4.7759705
|
|
648
|
+
c0-4.8088789,1.9238281-6.7327051,7.8934479-6.7327051H145.6054535z M132.7036133,17.4411125h13.4325104
|
|
649
|
+
c0.3981018,0,0.5635681-0.1325512,0.5635681-0.5640297v-1.392705c0-1.3597956-0.4972992-1.8904591-2.0230103-1.8904591h-8.3246918
|
|
650
|
+
c-2.8855133,0-3.6483765,0.829133-3.6483765,2.9517851V17.4411125z"></path><path d="M156.949585,9.8793449c0.4972992,0,0.7294922,0.2321939,0.7294922,0.7294903v1.9567852h12.4374542
|
|
651
|
+
c5.9698486,0,7.8936615,1.9238262,7.8936615,6.7327042v2.1225357c0,4.8093357-1.9238129,6.6997948-7.8936615,6.6997948h-9.2863922
|
|
652
|
+
c-5.9702911,0-7.8936615-1.8904591-7.8936615-6.6997948V10.6088352c0-0.4972963,0.2650909-0.7294903,0.7628479-0.7294903H156.949585
|
|
653
|
+
z M157.6790771,16.5458241v3.9467182c0,2.7858677,0.7628479,3.6479092,3.6150055,3.6479092h8.3580475
|
|
654
|
+
c2.8855133,0,3.6483765-0.8620415,3.6483765-3.6479092V20.194191c0-2.7863255-0.7628632-3.6483669-3.6483765-3.6483669H157.6790771z
|
|
655
|
+
"></path><path d="M197.0487213,9.9121847c5.9703064,0,7.8936615,1.9238262,7.8936615,6.7327051v4.7759705
|
|
656
|
+
c0,4.8093357-1.9233551,6.6997948-7.8936615,6.6997948h-9.3860321c-5.9698486,0-7.8936615-1.8904591-7.8936615-6.6997948v-4.7759705
|
|
657
|
+
c0-4.8088789,1.9238129-6.7327051,7.8936615-6.7327051H197.0487213z M184.512085,20.5917263
|
|
658
|
+
c0,2.7863255,0.7628479,3.6483669,3.6149902,3.6483669h8.4577026c2.8850555,0,3.6479187-0.8620415,3.6479187-3.6483669v-3.1506138
|
|
659
|
+
c0-2.7858677-0.7628632-3.6149998-3.6479187-3.6149998h-8.4577026c-2.8521423,0-3.6149902,0.8291321-3.6149902,3.6149998V20.5917263
|
|
660
|
+
z"></path><path d="M206.7574005,15.2190561V10.841198c0-0.4977531,0.265564-0.7294903,0.72995-0.7294903h3.2831573
|
|
661
|
+
c0.4644012,0,0.72995,0.2317371,0.72995,0.7294903v4.3778582h5.8039398c0.431015,0,0.5969391,0.1992846,0.5969391,0.5969391
|
|
662
|
+
v2.7195921c0,0.3981113-0.1659241,0.5973969-0.5969391,0.5973969h-5.8039398v2.3875179
|
|
663
|
+
c0,1.8241825,0.5969391,2.6866817,2.7858734,2.6866817h3.2168884c0.4314728,0,0.5973969,0.1988277,0.5973969,0.5969391v2.719593
|
|
664
|
+
c0,0.3981113-0.1659241,0.5969391-0.5973969,0.5969391h-4.0131073c-5.3066406,0-6.7327118-1.8904591-6.7327118-6.600153V15.2190561"></path><path d="M223.6455231,24.1932678c0.4212189,0,0.6169891,0.1957626,0.6169891,0.6169872v2.6934128
|
|
665
|
+
c0,0.4212246-0.1957703,0.6169872-0.6169891,0.6169872h-2.7501221c-0.4198761,0-0.64534-0.1957626-0.64534-0.6169872v-2.6934128
|
|
666
|
+
c0-0.4212246,0.2254639-0.6169872,0.64534-0.6169872H223.6455231z"></path><path d="M228.026535,20.1896019c0.157959,0,0.2308655,0.074255,0.2308655,0.232214v1.0010853
|
|
667
|
+
c0,0.1579609-0.0729065,0.2430153-0.2308655,0.2430153h-1.0341644c-0.157959,0-0.2430115-0.0850544-0.2430115-0.2430153v-1.0010853
|
|
668
|
+
c0-0.157959,0.0850525-0.232214,0.2430115-0.232214H228.026535z M228.026535,22.3301563
|
|
669
|
+
c0.157959,0,0.2308655,0.0837059,0.2308655,0.2430153v5.3152695c0,0.157959-0.0729065,0.232214-0.2308655,0.232214h-1.0341644
|
|
670
|
+
c-0.157959,0-0.2322083-0.074255-0.2322083-0.232214v-5.3152695c0-0.1593094,0.0742493-0.2430153,0.2322083-0.2430153H228.026535z"></path><path d="M230.3351746,22.3301563v-1.3919334c0-0.1572838,0.0836945-0.2315388,0.2322083-0.2315388h1.0436096
|
|
671
|
+
c0.147171,0,0.2322235,0.074255,0.2322235,0.2315388v1.3919334h1.8455505c0.1377106,0,0.1903687,0.0634537,0.1903687,0.190361
|
|
672
|
+
v0.8640518c0,0.1269093-0.0526581,0.1903629-0.1903687,0.1903629h-1.8455505v2.4463463
|
|
673
|
+
c0,0.5805359,0.1890106,0.8546009,0.8856506,0.8546009h1.0233612c0.1363525,0,0.1903534,0.0634556,0.1903534,0.1903629v0.8640518
|
|
674
|
+
c0,0.1269073-0.0540009,0.190361-0.1903534,0.190361h-1.2758331c-1.6875916,0-2.1412201-0.6007862-2.1412201-2.0993767v-2.4463463
|
|
675
|
+
h-1.0031128c-0.1255646,0-0.1890106-0.0634537-0.1890106-0.1903629v-0.8640518c0-0.1269073,0.063446-0.190361,0.1890106-0.190361
|
|
676
|
+
H230.3351746z">`),U6=()=>$6(),j6=E('<a href="https://makebot.it/?utm_source=litebadge"target=_blank rel="noopener noreferrer"class=lite-badge id=lite-badge>'),B6=e=>{let t,r,n,a={display:"flex",opacity:"1",visibility:"visible","pointer-events":"auto",transform:"none","clip-path":"none",width:"auto",height:"auto",position:"absolute",padding:"4px 8px","background-color":"white","z-index":"50","border-radius":"4px",color:"rgb(17 24 39)",gap:"8px","font-size":"14px","line-height":"20px","font-weight":"600","border-width":"1px","border-color":"#cecece",top:"auto",right:"auto",left:"auto",bottom:"20px",transition:"background-color 0.2s ease-in-out","text-decoration":"none"};return $e(()=>{!document||!e.botContainer||!t||(r=new MutationObserver(i=>{i.forEach(o=>{o.removedNodes.forEach(s=>{"id"in s&&t&&s.id==="lite-badge"&&(console.log("Desculpe, voc\xEA n\xE3o pode remover a marca \u{1F605}"),e.botContainer?.append(t))})})}),r.observe(e.botContainer,{subtree:!1,childList:!0}),n=new MutationObserver(i=>{i.forEach(o=>{o.type==="attributes"&&t&&(o.attributeName==="style"&&Object.assign(t.style,a),o.attributeName==="class"&&(t.className="lite-badge"),o.attributeName==="href"&&(t.href="https://makebot.it/?utm_source=litebadge"),o.attributeName==="id"&&(t.id="lite-badge"))})}),n.observe(t,{attributes:!0,attributeFilter:["style","class","href","id"]}))}),Ie(()=>{r&&r.disconnect(),n&&n.disconnect()}),(()=>{var i=j6(),o=t;return typeof o=="function"?Ve(o,i):t=i,T(i,g(U6,{})),U(s=>vu(i,a,s)),i})()},z6=E("<div class=makebot-progress-bar-container part=progress-bar-container><div class=makebot-progress-bar>"),Mh=e=>(()=>{var t=z6(),r=t.firstChild;return U(n=>we(r,"width",`${e.value}%`)),t})(),V6=E("<style>"),H6=E("<div>"),Z6=E("<a target=_blank rel=noreferrer>"),Qu=e=>{let[t,r]=N(),[n,a]=N(""),[i,o]=N(!1),[s,l]=N(),c=async()=>{e.font&&Kg(e.font),o(!0);let u=new URLSearchParams(location.search);e.onInit?.();let d={};u.forEach((w,b)=>{d[b]=w});let p=typeof e.makebot=="string"?e.makebot:void 0,h=typeof e.makebot!="string"||(e.isPreview??!1),y=d0(p),{data:m,error:v}=await Sv({stripeRedirectStatus:u.get("redirect_status")??void 0,makebot:e.makebot,apiHost:e.apiHost,isPreview:h,resultId:ot(e.resultId)?e.resultId:y,prefilledVariables:{...d,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(v instanceof Qo)return h?l(new Error("Ocorreu um erro ao carregar o bot.",{cause:{status:v.response.status,body:await v.response.json()}})):v.response.status===400||v.response.status===403?l(new Error((await v.response.json()).message)):v.response.status===404?l(new Error("O bot que voc\xEA est\xE1 procurando n\xE3o existe.")):l(new Error(`Erro! N\xE3o foi poss\xEDvel iniciar o chat. (${v.response.statusText})`));if(v instanceof Pv)return l(new Error(v.message));if(!m)return v&&(console.error(v),h)?l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o.",{cause:v})):l(new Error("Erro! N\xE3o foi poss\xEDvel acessar o servidor. Verifique sua conex\xE3o."));if(m.resultId&&p&&(m.makebot.settings.general?.rememberUser?.isEnabled??Nt.general.rememberUser.isEnabled)){y&&y!==m.resultId&&yl(m.makebot.id);let w=m.makebot.settings.general?.rememberUser?.storage??Nt.general.rememberUser.storage;p0(w)(p,m.resultId);let b=h0(m.makebot.id);b&&b.makebot.publishedAt&&m.makebot.publishedAt?new Date(b.makebot.publishedAt).getTime()===new Date(m.makebot.publishedAt).getTime()?r({...b,sessionId:m.sessionId}):(yl(m.makebot.id),r(m),Ld(m,{makebotId:m.makebot.id,storage:w})):(r(m),Ld(m,{makebotId:m.makebot.id,storage:w})),e.onChatStatePersisted?.(!0)}else yl(m.makebot.id),r(m),m.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(m.input),m.logs&&e.onNewLogs?.(m.logs),e.onChatStatePersisted?.(!1);a(m.makebot.theme.customCss??"")};return Ye(()=>{Vt(e.makebot)||i()||c().then()}),Ye(()=>{Vt(e.makebot)||typeof e.makebot=="string"||(a(e.makebot.theme.customCss??""),e.makebot.theme.general?.progressBar?.isEnabled&&t()&&!t()?.makebot.theme.general?.progressBar?.isEnabled&&(o(!1),c().then()))}),Ie(()=>{o(!1)}),[g(X,{get when(){return n()},children:u=>(()=>{var d=V6();return T(d,u),d})()}),g(X,{get when(){return s()},keyed:!0,children:u=>g(F6,{error:u})}),g(X,{get when(){return t()},keyed:!0,children:u=>g(G6,{get class(){return e.class},get initialChatReply(){return{...u,makebot:{...u.makebot,settings:typeof e.makebot=="string"||!e.makebot?u.makebot.settings:e.makebot?.settings,theme:typeof e.makebot=="string"||!e.makebot?u.makebot.theme:e.makebot?.theme}}},get context(){return{apiHost:e.apiHost,wsHost:e.wsHost,isPreview:typeof e.makebot!="string"||(e.isPreview??!1),resultId:u.resultId,sessionId:u.sessionId||"",makebot:u.makebot,storage:u.makebot.settings.general?.rememberUser?.isEnabled&&!(typeof e.makebot!="string"||(e.isPreview??!1))?u.makebot.settings.general?.rememberUser?.storage??Nt.general.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}})})]},G6=e=>{let[t,r]=yc(N(e.initialChatReply.progress),{storage:e.context.storage,key:`makebot-${e.context.makebot.id}-progressValue`}),n,[a,i]=N("100%");return Ye(()=>{n&&i(`${n.clientHeight}px`)}),Ye(()=>{Kg(e.initialChatReply.makebot.theme.general?.font??{type:Ov,family:Tu}),n&&g0({theme:hc(e.initialChatReply.makebot.theme,e.initialChatReply.dynamicTheme),container:n,isPreview:e.context.isPreview,makebotVersion:mf(e.initialChatReply.makebot.version)?e.initialChatReply.makebot.version:"6"})}),g(Mg.Provider,{value:()=>n,get children(){var o=H6(),s=n;return typeof s=="function"?Ve(s,o):n=o,T(o,g(X,{get when(){return j(()=>!!Se(t()))()&&e.initialChatReply.makebot.theme.general?.progressBar?.isEnabled},get children(){return g(X,{get when(){return j(()=>!!e.progressBarRef)()&&(e.initialChatReply.makebot.theme.general?.progressBar?.position??Gg)==="fixed"},get fallback(){return g(Mh,{get value(){return t()}})},get children(){return g(Dg,{get mount(){return e.progressBarRef},get children(){return g(Mh,{get value(){return t()}})}})}})}}),null),T(o,g(E6,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:r,get onScriptExecutionSuccess(){return e.onScriptExecutionSuccess}}),null),T(o,g(X,{get when(){return e.initialChatReply.makebot.settings.general?.isBrandingEnabled},get children(){return g(B6,{botContainer:n})}}),null),T(o,g(m2,{toaster:Er,class:"w-full",children:l=>g(Ka.Root,{class:"flex flex-col pl-4 py-4 pr-8 gap-2 max-w-[350px] rounded-chat text-input-text border-input border-input-border bg-input-bg shadow-input data-[state=open]:animate-fade-in-from-bottom data-[state=closed]:animate-fade-out-from-bottom",get children(){return[g(Ka.Title,{class:"font-semibold",get children(){return l().title}}),g(Ka.Description,{class:"text-sm",get children(){return l().description}}),g(Ka.CloseTrigger,{get class(){return wi("absolute right-2 top-2",Ac({variant:"secondary",size:"icon"}))},get children(){return g(rl,{class:"w-4 h-4"})}}),g(X,{get when(){return l().meta?.link},children:c=>(()=>{var u=Z6();return T(u,()=>e.initialChatReply.makebot.settings.general?.systemMessages?.popupBlockedButtonLabel??Kr.popupBlockedButtonLabel),U(d=>{var p=c(),h=wi(Ac({variant:"primary",size:"sm"}),"no-underline");return p!==d.e&&de(u,"href",d.e=p),h!==d.t&&ne(u,d.t=h),d},{e:void 0,t:void 0}),u})()})]}})}),null),U(l=>{var c=ae("relative flex w-full overflow-hidden h-full text-base flex-col justify-center items-center makebot-container",e.class),u=a();return c!==l.e&&ne(o,l.e=c),u!==l.t&&we(o,"--bot-container-height",l.t=u),l},{e:void 0,t:void 0}),o}})},W6=(e,{isHidden:t=!1}={})=>t?"0px":e==="large"?"64px":e==="medium"||!e?"48px":typeof e=="string"&&/^\d+px$/.test(e.trim())?e.trim():(console.warn("[Makebot] Tamanho de bot\xE3o inv\xE1lido. Use 'm\xE9dio', 'grande' ou um valor em pixels expl\xEDcita (ex.: '52px')."),"48px"),ed=`:root,
|
|
677
|
+
.light {
|
|
678
|
+
--blue-1: 252 253 254;
|
|
679
|
+
--blue-2: 246 249 255;
|
|
680
|
+
--blue-3: 235 242 255;
|
|
681
|
+
--blue-4: 221 234 255;
|
|
682
|
+
--blue-5: 204 223 255;
|
|
683
|
+
--blue-6: 183 210 255;
|
|
684
|
+
--blue-7: 160 191 255;
|
|
685
|
+
--blue-8: 127 165 253;
|
|
686
|
+
--blue-9: 53 102 252;
|
|
687
|
+
--blue-10: 47 91 225;
|
|
688
|
+
--blue-11: 44 87 221;
|
|
689
|
+
--blue-12: 23 44 101;
|
|
690
|
+
|
|
691
|
+
--orange-1: 254 252 251;
|
|
692
|
+
--orange-2: 255 244 240;
|
|
693
|
+
--orange-3: 255 232 222;
|
|
694
|
+
--orange-4: 255 214 199;
|
|
695
|
+
--orange-5: 255 200 181;
|
|
696
|
+
--orange-6: 255 184 160;
|
|
697
|
+
--orange-7: 255 162 134;
|
|
698
|
+
--orange-8: 249 136 104;
|
|
699
|
+
--orange-9: 255 89 36;
|
|
700
|
+
--orange-10: 242 73 5;
|
|
701
|
+
--orange-11: 220 59 0;
|
|
702
|
+
--orange-12: 91 42 28;
|
|
703
|
+
|
|
704
|
+
--green-1: 251 254 252;
|
|
705
|
+
--green-2: 242 252 245;
|
|
706
|
+
--green-3: 233 249 238;
|
|
707
|
+
--green-4: 221 243 228;
|
|
708
|
+
--green-5: 204 235 215;
|
|
709
|
+
--green-6: 180 223 196;
|
|
710
|
+
--green-7: 146 206 172;
|
|
711
|
+
--green-8: 91 185 140;
|
|
712
|
+
--green-9: 48 164 108;
|
|
713
|
+
--green-10: 41 151 100;
|
|
714
|
+
--green-11: 24 121 78;
|
|
715
|
+
--green-12: 21 50 38;
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
--purple-1: 252 252 255;
|
|
719
|
+
--purple-2: 249 248 255;
|
|
720
|
+
--purple-3: 242 240 255;
|
|
721
|
+
--purple-4: 231 228 255;
|
|
722
|
+
--purple-5: 221 216 255;
|
|
723
|
+
--purple-6: 208 201 255;
|
|
724
|
+
--purple-7: 189 179 255;
|
|
725
|
+
--purple-8: 165 149 255;
|
|
726
|
+
--purple-9: 128 85 253;
|
|
727
|
+
--purple-10: 116 71 236;
|
|
728
|
+
--purple-11: 104 65 211;
|
|
729
|
+
--purple-12: 50 30 108;
|
|
730
|
+
|
|
731
|
+
--red-1: 255 252 252;
|
|
732
|
+
--red-2: 255 247 246;
|
|
733
|
+
--red-3: 255 235 233;
|
|
734
|
+
--red-4: 255 218 214;
|
|
735
|
+
--red-5: 255 203 198;
|
|
736
|
+
--red-6: 255 186 181;
|
|
737
|
+
--red-7: 252 165 160;
|
|
738
|
+
--red-8: 244 137 132;
|
|
739
|
+
--red-9: 248 59 69;
|
|
740
|
+
--red-10: 234 38 56;
|
|
741
|
+
--red-11: 216 6 42;
|
|
742
|
+
--red-12: 106 13 20;
|
|
743
|
+
|
|
744
|
+
--gray-1: 255 255 255;
|
|
745
|
+
--gray-2: 241 241 241;
|
|
746
|
+
--gray-3: 240 240 240;
|
|
747
|
+
--gray-4: 232 232 232;
|
|
748
|
+
--gray-5: 224 224 224;
|
|
749
|
+
--gray-6: 223 223 223;
|
|
750
|
+
--gray-7: 206 206 206;
|
|
751
|
+
--gray-8: 187 187 187;
|
|
752
|
+
--gray-9: 141 141 141;
|
|
753
|
+
--gray-10: 131 131 131;
|
|
754
|
+
--gray-11: 70 70 70;
|
|
755
|
+
--gray-12: 32 32 32;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.dark {
|
|
759
|
+
--blue-1: 7 13 26;
|
|
760
|
+
--blue-2: 15 22 39;
|
|
761
|
+
--blue-3: 18 35 78;
|
|
762
|
+
--blue-4: 22 44 106;
|
|
763
|
+
--blue-5: 29 55 126;
|
|
764
|
+
--blue-6: 37 66 143;
|
|
765
|
+
--blue-7: 46 78 164;
|
|
766
|
+
--blue-8: 54 91 193;
|
|
767
|
+
--blue-9: 53 102 252;
|
|
768
|
+
--blue-10: 42 87 236;
|
|
769
|
+
--blue-11: 141 180 255;
|
|
770
|
+
--blue-12: 209 226 255;
|
|
771
|
+
|
|
772
|
+
--orange-1: 18 11 9;
|
|
773
|
+
--orange-2: 31 20 17;
|
|
774
|
+
--orange-3: 55 24 16;
|
|
775
|
+
--orange-4: 78 22 6;
|
|
776
|
+
--orange-5: 94 30 11;
|
|
777
|
+
--orange-6: 110 44 24;
|
|
778
|
+
--orange-7: 135 60 38;
|
|
779
|
+
--orange-8: 173 77 49;
|
|
780
|
+
--orange-9: 255 89 36;
|
|
781
|
+
--orange-10: 241 75 15;
|
|
782
|
+
--orange-11: 255 151 118;
|
|
783
|
+
--orange-12: 255 215 202;
|
|
784
|
+
|
|
785
|
+
--purple-1: 13 10 27;
|
|
786
|
+
--purple-2: 23 19 42;
|
|
787
|
+
--purple-3: 38 27 79;
|
|
788
|
+
--purple-4: 50 30 108;
|
|
789
|
+
--purple-5: 59 37 124;
|
|
790
|
+
--purple-6: 70 49 139;
|
|
791
|
+
--purple-7: 84 62 162;
|
|
792
|
+
--purple-8: 104 76 199;
|
|
793
|
+
--purple-9: 128 85 253;
|
|
794
|
+
--purple-10: 116 70 238;
|
|
795
|
+
--purple-11: 180 166 255;
|
|
796
|
+
--purple-12: 224 220 255;
|
|
797
|
+
|
|
798
|
+
--red-1: 19 10 10;
|
|
799
|
+
--red-2: 32 18 17;
|
|
800
|
+
--red-3: 62 14 15;
|
|
801
|
+
--red-4: 85 5 12;
|
|
802
|
+
--red-5: 103 11 19;
|
|
803
|
+
--red-6: 121 27 31;
|
|
804
|
+
--red-7: 147 43 45;
|
|
805
|
+
--red-8: 190 58 60;
|
|
806
|
+
--red-9: 248 59 69;
|
|
807
|
+
--red-10: 233 41 57;
|
|
808
|
+
--red-11: 255 143 137;
|
|
809
|
+
--red-12: 255 208 203;
|
|
810
|
+
|
|
811
|
+
--gray-1: 13 13 13;
|
|
812
|
+
--gray-2: 23 23 23;
|
|
813
|
+
--gray-3: 34 34 34;
|
|
814
|
+
--gray-4: 42 42 42;
|
|
815
|
+
--gray-5: 49 49 49;
|
|
816
|
+
--gray-6: 58 58 58;
|
|
817
|
+
--gray-7: 72 72 72;
|
|
818
|
+
--gray-8: 96 96 96;
|
|
819
|
+
--gray-9: 110 110 110;
|
|
820
|
+
--gray-10: 123 123 123;
|
|
821
|
+
--gray-11: 180 180 180;
|
|
822
|
+
--gray-12: 238 238 238;
|
|
823
|
+
}
|
|
824
|
+
`,td=`*, ::before, ::after {
|
|
825
|
+
--tw-border-spacing-x: 0;
|
|
826
|
+
--tw-border-spacing-y: 0;
|
|
827
|
+
--tw-translate-x: 0;
|
|
828
|
+
--tw-translate-y: 0;
|
|
829
|
+
--tw-rotate: 0;
|
|
830
|
+
--tw-skew-x: 0;
|
|
831
|
+
--tw-skew-y: 0;
|
|
832
|
+
--tw-scale-x: 1;
|
|
833
|
+
--tw-scale-y: 1;
|
|
834
|
+
--tw-pan-x: ;
|
|
835
|
+
--tw-pan-y: ;
|
|
836
|
+
--tw-pinch-zoom: ;
|
|
837
|
+
--tw-scroll-snap-strictness: proximity;
|
|
838
|
+
--tw-gradient-from-position: ;
|
|
839
|
+
--tw-gradient-via-position: ;
|
|
840
|
+
--tw-gradient-to-position: ;
|
|
841
|
+
--tw-ordinal: ;
|
|
842
|
+
--tw-slashed-zero: ;
|
|
843
|
+
--tw-numeric-figure: ;
|
|
844
|
+
--tw-numeric-spacing: ;
|
|
845
|
+
--tw-numeric-fraction: ;
|
|
846
|
+
--tw-ring-inset: ;
|
|
847
|
+
--tw-ring-offset-width: 0px;
|
|
848
|
+
--tw-ring-offset-color: #fff;
|
|
849
|
+
--tw-ring-color: rgb(59 130 246 / 0.5);
|
|
850
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
851
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
852
|
+
--tw-shadow: 0 0 #0000;
|
|
853
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
854
|
+
--tw-blur: ;
|
|
855
|
+
--tw-brightness: ;
|
|
856
|
+
--tw-contrast: ;
|
|
857
|
+
--tw-grayscale: ;
|
|
858
|
+
--tw-hue-rotate: ;
|
|
859
|
+
--tw-invert: ;
|
|
860
|
+
--tw-saturate: ;
|
|
861
|
+
--tw-sepia: ;
|
|
862
|
+
--tw-drop-shadow: ;
|
|
863
|
+
--tw-backdrop-blur: ;
|
|
864
|
+
--tw-backdrop-brightness: ;
|
|
865
|
+
--tw-backdrop-contrast: ;
|
|
866
|
+
--tw-backdrop-grayscale: ;
|
|
867
|
+
--tw-backdrop-hue-rotate: ;
|
|
868
|
+
--tw-backdrop-invert: ;
|
|
869
|
+
--tw-backdrop-opacity: ;
|
|
870
|
+
--tw-backdrop-saturate: ;
|
|
871
|
+
--tw-backdrop-sepia: ;
|
|
872
|
+
--tw-contain-size: ;
|
|
873
|
+
--tw-contain-layout: ;
|
|
874
|
+
--tw-contain-paint: ;
|
|
875
|
+
--tw-contain-style: ;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
::backdrop {
|
|
879
|
+
--tw-border-spacing-x: 0;
|
|
880
|
+
--tw-border-spacing-y: 0;
|
|
881
|
+
--tw-translate-x: 0;
|
|
882
|
+
--tw-translate-y: 0;
|
|
883
|
+
--tw-rotate: 0;
|
|
884
|
+
--tw-skew-x: 0;
|
|
885
|
+
--tw-skew-y: 0;
|
|
886
|
+
--tw-scale-x: 1;
|
|
887
|
+
--tw-scale-y: 1;
|
|
888
|
+
--tw-pan-x: ;
|
|
889
|
+
--tw-pan-y: ;
|
|
890
|
+
--tw-pinch-zoom: ;
|
|
891
|
+
--tw-scroll-snap-strictness: proximity;
|
|
892
|
+
--tw-gradient-from-position: ;
|
|
893
|
+
--tw-gradient-via-position: ;
|
|
894
|
+
--tw-gradient-to-position: ;
|
|
895
|
+
--tw-ordinal: ;
|
|
896
|
+
--tw-slashed-zero: ;
|
|
897
|
+
--tw-numeric-figure: ;
|
|
898
|
+
--tw-numeric-spacing: ;
|
|
899
|
+
--tw-numeric-fraction: ;
|
|
900
|
+
--tw-ring-inset: ;
|
|
901
|
+
--tw-ring-offset-width: 0px;
|
|
902
|
+
--tw-ring-offset-color: #fff;
|
|
903
|
+
--tw-ring-color: rgb(59 130 246 / 0.5);
|
|
904
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
905
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
906
|
+
--tw-shadow: 0 0 #0000;
|
|
907
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
908
|
+
--tw-blur: ;
|
|
909
|
+
--tw-brightness: ;
|
|
910
|
+
--tw-contrast: ;
|
|
911
|
+
--tw-grayscale: ;
|
|
912
|
+
--tw-hue-rotate: ;
|
|
913
|
+
--tw-invert: ;
|
|
914
|
+
--tw-saturate: ;
|
|
915
|
+
--tw-sepia: ;
|
|
916
|
+
--tw-drop-shadow: ;
|
|
917
|
+
--tw-backdrop-blur: ;
|
|
918
|
+
--tw-backdrop-brightness: ;
|
|
919
|
+
--tw-backdrop-contrast: ;
|
|
920
|
+
--tw-backdrop-grayscale: ;
|
|
921
|
+
--tw-backdrop-hue-rotate: ;
|
|
922
|
+
--tw-backdrop-invert: ;
|
|
923
|
+
--tw-backdrop-opacity: ;
|
|
924
|
+
--tw-backdrop-saturate: ;
|
|
925
|
+
--tw-backdrop-sepia: ;
|
|
926
|
+
--tw-contain-size: ;
|
|
927
|
+
--tw-contain-layout: ;
|
|
928
|
+
--tw-contain-paint: ;
|
|
929
|
+
--tw-contain-style: ;
|
|
930
|
+
}/*
|
|
931
|
+
! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
|
|
932
|
+
*//*
|
|
933
|
+
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
934
|
+
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
|
935
|
+
*/
|
|
936
|
+
|
|
937
|
+
*,
|
|
938
|
+
::before,
|
|
939
|
+
::after {
|
|
940
|
+
box-sizing: border-box; /* 1 */
|
|
941
|
+
border-width: 0; /* 2 */
|
|
942
|
+
border-style: solid; /* 2 */
|
|
943
|
+
border-color: #e5e7eb; /* 2 */
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
::before,
|
|
947
|
+
::after {
|
|
948
|
+
--tw-content: '';
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/*
|
|
952
|
+
1. Use a consistent sensible line-height in all browsers.
|
|
953
|
+
2. Prevent adjustments of font size after orientation changes in iOS.
|
|
954
|
+
3. Use a more readable tab size.
|
|
955
|
+
4. Use the user's configured \`sans\` font-family by default.
|
|
956
|
+
5. Use the user's configured \`sans\` font-feature-settings by default.
|
|
957
|
+
6. Use the user's configured \`sans\` font-variation-settings by default.
|
|
958
|
+
7. Disable tap highlights on iOS
|
|
959
|
+
*/
|
|
960
|
+
|
|
961
|
+
html,
|
|
962
|
+
:host {
|
|
963
|
+
line-height: 1.5; /* 1 */
|
|
964
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
965
|
+
-moz-tab-size: 4; /* 3 */
|
|
966
|
+
-o-tab-size: 4;
|
|
967
|
+
tab-size: 4; /* 3 */
|
|
968
|
+
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
|
|
969
|
+
font-feature-settings: normal; /* 5 */
|
|
970
|
+
font-variation-settings: normal; /* 6 */
|
|
971
|
+
-webkit-tap-highlight-color: transparent; /* 7 */
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/*
|
|
975
|
+
1. Remove the margin in all browsers.
|
|
976
|
+
2. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.
|
|
977
|
+
*/
|
|
978
|
+
|
|
979
|
+
body {
|
|
980
|
+
margin: 0; /* 1 */
|
|
981
|
+
line-height: inherit; /* 2 */
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/*
|
|
985
|
+
1. Add the correct height in Firefox.
|
|
986
|
+
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
|
987
|
+
3. Ensure horizontal rules are visible by default.
|
|
988
|
+
*/
|
|
989
|
+
|
|
990
|
+
hr {
|
|
991
|
+
height: 0; /* 1 */
|
|
992
|
+
color: inherit; /* 2 */
|
|
993
|
+
border-top-width: 1px; /* 3 */
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/*
|
|
997
|
+
Add the correct text decoration in Chrome, Edge, and Safari.
|
|
998
|
+
*/
|
|
999
|
+
|
|
1000
|
+
abbr:where([title]) {
|
|
1001
|
+
-webkit-text-decoration: underline dotted;
|
|
1002
|
+
text-decoration: underline dotted;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/*
|
|
1006
|
+
Remove the default font size and weight for headings.
|
|
1007
|
+
*/
|
|
1008
|
+
|
|
1009
|
+
h1,
|
|
1010
|
+
h2,
|
|
1011
|
+
h3,
|
|
1012
|
+
h4,
|
|
1013
|
+
h5,
|
|
1014
|
+
h6 {
|
|
1015
|
+
font-size: inherit;
|
|
1016
|
+
font-weight: inherit;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/*
|
|
1020
|
+
Reset links to optimize for opt-in styling instead of opt-out.
|
|
1021
|
+
*/
|
|
1022
|
+
|
|
1023
|
+
a {
|
|
1024
|
+
color: inherit;
|
|
1025
|
+
text-decoration: inherit;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
/*
|
|
1029
|
+
Add the correct font weight in Edge and Safari.
|
|
1030
|
+
*/
|
|
1031
|
+
|
|
1032
|
+
b,
|
|
1033
|
+
strong {
|
|
1034
|
+
font-weight: bolder;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/*
|
|
1038
|
+
1. Use the user's configured \`mono\` font-family by default.
|
|
1039
|
+
2. Use the user's configured \`mono\` font-feature-settings by default.
|
|
1040
|
+
3. Use the user's configured \`mono\` font-variation-settings by default.
|
|
1041
|
+
4. Correct the odd \`em\` font sizing in all browsers.
|
|
1042
|
+
*/
|
|
1043
|
+
|
|
1044
|
+
code,
|
|
1045
|
+
kbd,
|
|
1046
|
+
samp,
|
|
1047
|
+
pre {
|
|
1048
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
|
|
1049
|
+
font-feature-settings: normal; /* 2 */
|
|
1050
|
+
font-variation-settings: normal; /* 3 */
|
|
1051
|
+
font-size: 1em; /* 4 */
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
/*
|
|
1055
|
+
Add the correct font size in all browsers.
|
|
1056
|
+
*/
|
|
1057
|
+
|
|
1058
|
+
small {
|
|
1059
|
+
font-size: 80%;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/*
|
|
1063
|
+
Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
|
|
1064
|
+
*/
|
|
1065
|
+
|
|
1066
|
+
sub,
|
|
1067
|
+
sup {
|
|
1068
|
+
font-size: 75%;
|
|
1069
|
+
line-height: 0;
|
|
1070
|
+
position: relative;
|
|
1071
|
+
vertical-align: baseline;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
sub {
|
|
1075
|
+
bottom: -0.25em;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
sup {
|
|
1079
|
+
top: -0.5em;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/*
|
|
1083
|
+
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
|
1084
|
+
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
|
1085
|
+
3. Remove gaps between table borders by default.
|
|
1086
|
+
*/
|
|
1087
|
+
|
|
1088
|
+
table {
|
|
1089
|
+
text-indent: 0; /* 1 */
|
|
1090
|
+
border-color: inherit; /* 2 */
|
|
1091
|
+
border-collapse: collapse; /* 3 */
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/*
|
|
1095
|
+
1. Change the font styles in all browsers.
|
|
1096
|
+
2. Remove the margin in Firefox and Safari.
|
|
1097
|
+
3. Remove default padding in all browsers.
|
|
1098
|
+
*/
|
|
1099
|
+
|
|
1100
|
+
button,
|
|
1101
|
+
input,
|
|
1102
|
+
optgroup,
|
|
1103
|
+
select,
|
|
1104
|
+
textarea {
|
|
1105
|
+
font-family: inherit; /* 1 */
|
|
1106
|
+
font-feature-settings: inherit; /* 1 */
|
|
1107
|
+
font-variation-settings: inherit; /* 1 */
|
|
1108
|
+
font-size: 100%; /* 1 */
|
|
1109
|
+
font-weight: inherit; /* 1 */
|
|
1110
|
+
line-height: inherit; /* 1 */
|
|
1111
|
+
letter-spacing: inherit; /* 1 */
|
|
1112
|
+
color: inherit; /* 1 */
|
|
1113
|
+
margin: 0; /* 2 */
|
|
1114
|
+
padding: 0; /* 3 */
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/*
|
|
1118
|
+
Remove the inheritance of text transform in Edge and Firefox.
|
|
1119
|
+
*/
|
|
1120
|
+
|
|
1121
|
+
button,
|
|
1122
|
+
select {
|
|
1123
|
+
text-transform: none;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/*
|
|
1127
|
+
1. Correct the inability to style clickable types in iOS and Safari.
|
|
1128
|
+
2. Remove default button styles.
|
|
1129
|
+
*/
|
|
1130
|
+
|
|
1131
|
+
button,
|
|
1132
|
+
input:where([type='button']),
|
|
1133
|
+
input:where([type='reset']),
|
|
1134
|
+
input:where([type='submit']) {
|
|
1135
|
+
-webkit-appearance: button; /* 1 */
|
|
1136
|
+
background-color: transparent; /* 2 */
|
|
1137
|
+
background-image: none; /* 2 */
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/*
|
|
1141
|
+
Use the modern Firefox focus style for all focusable elements.
|
|
1142
|
+
*/
|
|
1143
|
+
|
|
1144
|
+
:-moz-focusring {
|
|
1145
|
+
outline: auto;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/*
|
|
1149
|
+
Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
|
1150
|
+
*/
|
|
1151
|
+
|
|
1152
|
+
:-moz-ui-invalid {
|
|
1153
|
+
box-shadow: none;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/*
|
|
1157
|
+
Add the correct vertical alignment in Chrome and Firefox.
|
|
1158
|
+
*/
|
|
1159
|
+
|
|
1160
|
+
progress {
|
|
1161
|
+
vertical-align: baseline;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/*
|
|
1165
|
+
Correct the cursor style of increment and decrement buttons in Safari.
|
|
1166
|
+
*/
|
|
1167
|
+
|
|
1168
|
+
::-webkit-inner-spin-button,
|
|
1169
|
+
::-webkit-outer-spin-button {
|
|
1170
|
+
height: auto;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/*
|
|
1174
|
+
1. Correct the odd appearance in Chrome and Safari.
|
|
1175
|
+
2. Correct the outline style in Safari.
|
|
1176
|
+
*/
|
|
1177
|
+
|
|
1178
|
+
[type='search'] {
|
|
1179
|
+
-webkit-appearance: textfield; /* 1 */
|
|
1180
|
+
outline-offset: -2px; /* 2 */
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/*
|
|
1184
|
+
Remove the inner padding in Chrome and Safari on macOS.
|
|
1185
|
+
*/
|
|
1186
|
+
|
|
1187
|
+
::-webkit-search-decoration {
|
|
1188
|
+
-webkit-appearance: none;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/*
|
|
1192
|
+
1. Correct the inability to style clickable types in iOS and Safari.
|
|
1193
|
+
2. Change font properties to \`inherit\` in Safari.
|
|
1194
|
+
*/
|
|
1195
|
+
|
|
1196
|
+
::-webkit-file-upload-button {
|
|
1197
|
+
-webkit-appearance: button; /* 1 */
|
|
1198
|
+
font: inherit; /* 2 */
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/*
|
|
1202
|
+
Add the correct display in Chrome and Safari.
|
|
1203
|
+
*/
|
|
1204
|
+
|
|
1205
|
+
summary {
|
|
1206
|
+
display: list-item;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/*
|
|
1210
|
+
Removes the default spacing and border for appropriate elements.
|
|
1211
|
+
*/
|
|
1212
|
+
|
|
1213
|
+
blockquote,
|
|
1214
|
+
dl,
|
|
1215
|
+
dd,
|
|
1216
|
+
h1,
|
|
1217
|
+
h2,
|
|
1218
|
+
h3,
|
|
1219
|
+
h4,
|
|
1220
|
+
h5,
|
|
1221
|
+
h6,
|
|
1222
|
+
hr,
|
|
1223
|
+
figure,
|
|
1224
|
+
p,
|
|
1225
|
+
pre {
|
|
1226
|
+
margin: 0;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
fieldset {
|
|
1230
|
+
margin: 0;
|
|
1231
|
+
padding: 0;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
legend {
|
|
1235
|
+
padding: 0;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
ol,
|
|
1239
|
+
ul,
|
|
1240
|
+
menu {
|
|
1241
|
+
list-style: none;
|
|
1242
|
+
margin: 0;
|
|
1243
|
+
padding: 0;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/*
|
|
1247
|
+
Reset default styling for dialogs.
|
|
1248
|
+
*/
|
|
1249
|
+
dialog {
|
|
1250
|
+
padding: 0;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/*
|
|
1254
|
+
Prevent resizing textareas horizontally by default.
|
|
1255
|
+
*/
|
|
1256
|
+
|
|
1257
|
+
textarea {
|
|
1258
|
+
resize: vertical;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/*
|
|
1262
|
+
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
|
1263
|
+
2. Set the default placeholder color to the user's configured gray 400 color.
|
|
1264
|
+
*/
|
|
1265
|
+
|
|
1266
|
+
input::-moz-placeholder, textarea::-moz-placeholder {
|
|
1267
|
+
opacity: 1; /* 1 */
|
|
1268
|
+
color: #9ca3af; /* 2 */
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
input::placeholder,
|
|
1272
|
+
textarea::placeholder {
|
|
1273
|
+
opacity: 1; /* 1 */
|
|
1274
|
+
color: #9ca3af; /* 2 */
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/*
|
|
1278
|
+
Set the default cursor for buttons.
|
|
1279
|
+
*/
|
|
1280
|
+
|
|
1281
|
+
button,
|
|
1282
|
+
[role="button"] {
|
|
1283
|
+
cursor: pointer;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/*
|
|
1287
|
+
Make sure disabled buttons don't get the pointer cursor.
|
|
1288
|
+
*/
|
|
1289
|
+
:disabled {
|
|
1290
|
+
cursor: default;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/*
|
|
1294
|
+
1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
|
1295
|
+
2. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
|
1296
|
+
This can trigger a poorly considered lint error in some tools but is included by design.
|
|
1297
|
+
*/
|
|
1298
|
+
|
|
1299
|
+
img,
|
|
1300
|
+
svg,
|
|
1301
|
+
video,
|
|
1302
|
+
canvas,
|
|
1303
|
+
audio,
|
|
1304
|
+
iframe,
|
|
1305
|
+
embed,
|
|
1306
|
+
object {
|
|
1307
|
+
display: block; /* 1 */
|
|
1308
|
+
vertical-align: middle; /* 2 */
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/*
|
|
1312
|
+
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
|
1313
|
+
*/
|
|
1314
|
+
|
|
1315
|
+
img,
|
|
1316
|
+
video {
|
|
1317
|
+
max-width: 100%;
|
|
1318
|
+
height: auto;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/* Make elements with the HTML hidden attribute stay hidden by default */
|
|
1322
|
+
[hidden]:where(:not([hidden="until-found"])) {
|
|
1323
|
+
display: none;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/* Hide scrollbar for Chrome, Safari and Opera */
|
|
1327
|
+
.scrollable-container::-webkit-scrollbar {
|
|
1328
|
+
display: none;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/* Hide scrollbar for IE, Edge and Firefox */
|
|
1332
|
+
.scrollable-container {
|
|
1333
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
1334
|
+
scrollbar-width: none; /* Firefox */
|
|
1335
|
+
-webkit-overflow-scrolling: touch;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
.text-fade-in {
|
|
1339
|
+
transition: opacity 400ms ease-in 200ms;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
.bubble-typing {
|
|
1343
|
+
transition: width 400ms ease-out, height 400ms ease-out;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
.bubble1,
|
|
1347
|
+
.bubble2,
|
|
1348
|
+
.bubble3 {
|
|
1349
|
+
background-color: var(--makebot-host-bubble-color);
|
|
1350
|
+
opacity: 0.5;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
.bubble1 {
|
|
1354
|
+
animation: chatBubbles 1s ease-in-out infinite;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
.bubble2 {
|
|
1358
|
+
animation: chatBubbles 1s ease-in-out infinite;
|
|
1359
|
+
animation-delay: 0.3s;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
.bubble3 {
|
|
1363
|
+
animation: chatBubbles 1s ease-in-out infinite;
|
|
1364
|
+
animation-delay: 0.5s;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
@keyframes chatBubbles {
|
|
1368
|
+
0% {
|
|
1369
|
+
transform: translateY(2.5);
|
|
1370
|
+
}
|
|
1371
|
+
50% {
|
|
1372
|
+
transform: translateY(-2.5px);
|
|
1373
|
+
}
|
|
1374
|
+
100% {
|
|
1375
|
+
transform: translateY(0);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
button,
|
|
1380
|
+
input,
|
|
1381
|
+
textarea {
|
|
1382
|
+
font-weight: 300;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
a {
|
|
1386
|
+
text-decoration: underline;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
ul,
|
|
1390
|
+
ol {
|
|
1391
|
+
margin-inline-start: 0px;
|
|
1392
|
+
margin-inline-end: 0px;
|
|
1393
|
+
padding-inline-start: 40px;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
ol {
|
|
1397
|
+
list-style-type: decimal;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
ul {
|
|
1401
|
+
list-style-type: disc;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
li:not(:last-child) {
|
|
1405
|
+
margin-bottom: 8px;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
pre {
|
|
1409
|
+
white-space: pre-wrap;
|
|
1410
|
+
word-wrap: break-word;
|
|
1411
|
+
overflow-wrap: break-word;
|
|
1412
|
+
max-height: 100%;
|
|
1413
|
+
max-width: 100%;
|
|
1414
|
+
overflow: auto;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.slate-bold {
|
|
1418
|
+
font-weight: bold;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
.slate-italic {
|
|
1422
|
+
font-style: oblique;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.slate-underline {
|
|
1426
|
+
text-decoration: underline;
|
|
1427
|
+
}
|
|
1428
|
+
.text-input::-moz-placeholder {
|
|
1429
|
+
color: var(--makebot-input-placeholder-color) !important;
|
|
1430
|
+
opacity: 1 !important;
|
|
1431
|
+
}
|
|
1432
|
+
.text-input::placeholder {
|
|
1433
|
+
color: var(--makebot-input-placeholder-color) !important;
|
|
1434
|
+
opacity: 1 !important;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
.makebot-container {
|
|
1438
|
+
background-image: var(--makebot-container-bg-image);
|
|
1439
|
+
background-color: var(--makebot-container-bg-color);
|
|
1440
|
+
background-position: center;
|
|
1441
|
+
background-size: cover;
|
|
1442
|
+
font-family: var(--makebot-container-font-family), -apple-system,
|
|
1443
|
+
BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
|
|
1444
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
1445
|
+
container-type: size;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.makebot-chat-view {
|
|
1449
|
+
background-color: rgba(
|
|
1450
|
+
var(--makebot-chat-container-bg-rgb),
|
|
1451
|
+
var(--makebot-chat-container-opacity)
|
|
1452
|
+
);
|
|
1453
|
+
color: rgb(var(--makebot-chat-container-color));
|
|
1454
|
+
backdrop-filter: blur(var(--makebot-chat-container-blur));
|
|
1455
|
+
border-width: var(--makebot-chat-container-border-width);
|
|
1456
|
+
border-color: rgba(
|
|
1457
|
+
var(--makebot-chat-container-border-rgb),
|
|
1458
|
+
var(--makebot-chat-container-border-opacity)
|
|
1459
|
+
);
|
|
1460
|
+
box-shadow: var(--makebot-chat-container-box-shadow);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
@container (min-height: 500px) {
|
|
1464
|
+
.makebot-chat-view {
|
|
1465
|
+
padding-top: 2.5rem;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
@container (min-height: 300px) {
|
|
1470
|
+
.makebot-bottom-spacer {
|
|
1471
|
+
height: calc(0.2 * var(--bot-container-height));
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.makebot-selectable {
|
|
1476
|
+
border-width: var(--makebot-button-border-width);
|
|
1477
|
+
border-color: rgba(
|
|
1478
|
+
var(--makebot-button-border-rgb),
|
|
1479
|
+
calc(var(--selectable-alpha-ratio) * 0.25)
|
|
1480
|
+
);
|
|
1481
|
+
border-radius: var(--makebot-button-border-radius);
|
|
1482
|
+
color: rgb(var(--makebot-chat-container-color));
|
|
1483
|
+
background-color: rgba(
|
|
1484
|
+
var(--makebot-button-bg-rgb),
|
|
1485
|
+
calc(var(--selectable-alpha-ratio) * 0.08)
|
|
1486
|
+
);
|
|
1487
|
+
transition: all 0.3s ease;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.makebot-selectable:hover {
|
|
1491
|
+
background-color: rgba(
|
|
1492
|
+
var(--makebot-button-bg-rgb),
|
|
1493
|
+
calc(var(--selectable-alpha-ratio) * 0.12)
|
|
1494
|
+
);
|
|
1495
|
+
border-color: rgba(
|
|
1496
|
+
var(--makebot-button-border-rgb),
|
|
1497
|
+
calc(var(--selectable-alpha-ratio) * 0.3)
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.makebot-selectable.selected {
|
|
1502
|
+
background-color: rgba(
|
|
1503
|
+
var(--makebot-button-bg-rgb),
|
|
1504
|
+
calc(var(--selectable-alpha-ratio) * 0.18)
|
|
1505
|
+
);
|
|
1506
|
+
border-color: rgba(
|
|
1507
|
+
var(--makebot-button-border-rgb),
|
|
1508
|
+
calc(var(--selectable-alpha-ratio) * 0.35)
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.makebot-checkbox {
|
|
1513
|
+
border: 1px solid
|
|
1514
|
+
rgba(var(--makebot-button-bg-rgb), var(--makebot-button-opacity));
|
|
1515
|
+
border-radius: var(--makebot-button-border-radius);
|
|
1516
|
+
background-color: rgba(var(--makebot-checkbox-bg-rgb));
|
|
1517
|
+
color: var(--makebot-button-color);
|
|
1518
|
+
padding: 1px;
|
|
1519
|
+
border-radius: 2px;
|
|
1520
|
+
transition: all 0.3s ease;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.makebot-checkbox.checked {
|
|
1524
|
+
background-color: rgb(var(--makebot-button-bg-rgb));
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
.makebot-host-bubble {
|
|
1528
|
+
color: var(--makebot-host-bubble-color);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.makebot-host-bubble > .bubble-typing {
|
|
1532
|
+
background-color: rgba(
|
|
1533
|
+
var(--makebot-host-bubble-bg-rgb),
|
|
1534
|
+
var(--makebot-host-bubble-opacity)
|
|
1535
|
+
);
|
|
1536
|
+
border-width: var(--makebot-host-bubble-border-width);
|
|
1537
|
+
border-color: rgba(
|
|
1538
|
+
var(--makebot-host-bubble-border-rgb),
|
|
1539
|
+
var(--makebot-host-bubble-border-opacity)
|
|
1540
|
+
);
|
|
1541
|
+
border-radius: var(--makebot-host-bubble-border-radius);
|
|
1542
|
+
box-shadow: var(--makebot-host-bubble-box-shadow);
|
|
1543
|
+
backdrop-filter: blur(var(--makebot-host-bubble-blur));
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.makebot-host-bubble img,
|
|
1547
|
+
.makebot-host-bubble video,
|
|
1548
|
+
.makebot-host-bubble iframe {
|
|
1549
|
+
border-radius: 6px;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.makebot-guest-bubble {
|
|
1553
|
+
color: var(--makebot-guest-bubble-color);
|
|
1554
|
+
background-color: rgba(
|
|
1555
|
+
var(--makebot-guest-bubble-bg-rgb),
|
|
1556
|
+
var(--makebot-guest-bubble-opacity)
|
|
1557
|
+
);
|
|
1558
|
+
border-width: var(--makebot-guest-bubble-border-width);
|
|
1559
|
+
border-color: rgba(
|
|
1560
|
+
var(--makebot-guest-bubble-border-rgb),
|
|
1561
|
+
var(--makebot-guest-bubble-border-opacity)
|
|
1562
|
+
);
|
|
1563
|
+
border-radius: var(--makebot-guest-bubble-border-radius);
|
|
1564
|
+
box-shadow: var(--makebot-guest-bubble-box-shadow);
|
|
1565
|
+
backdrop-filter: blur(var(--makebot-guest-bubble-blur));
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
.makebot-guest-bubble-image-attachment {
|
|
1569
|
+
border-radius: var(--makebot-guest-bubble-border-radius);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
.makebot-input {
|
|
1573
|
+
color: var(--makebot-input-color);
|
|
1574
|
+
background-color: rgba(
|
|
1575
|
+
var(--makebot-input-bg-rgb),
|
|
1576
|
+
var(--makebot-input-opacity)
|
|
1577
|
+
);
|
|
1578
|
+
border-width: var(--makebot-input-border-width);
|
|
1579
|
+
border-color: rgba(
|
|
1580
|
+
var(--makebot-input-border-rgb),
|
|
1581
|
+
var(--makebot-input-border-opacity)
|
|
1582
|
+
);
|
|
1583
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1584
|
+
box-shadow: var(--makebot-input-box-shadow);
|
|
1585
|
+
backdrop-filter: blur(var(--makebot-input-blur));
|
|
1586
|
+
transition: filter 100ms ease;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.makebot-input-error-message {
|
|
1590
|
+
color: var(--makebot-input-color);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.makebot-input-form .makebot-button {
|
|
1594
|
+
box-shadow: var(--makebot-input-box-shadow);
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
.makebot-button > .send-icon {
|
|
1598
|
+
fill: var(--makebot-button-color);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.ping span {
|
|
1602
|
+
background-color: rgb(var(--makebot-button-bg-rgb));
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
.rating-icon-container svg {
|
|
1606
|
+
width: 42px;
|
|
1607
|
+
height: 42px;
|
|
1608
|
+
stroke: rgb(var(--makebot-button-bg-rgb));
|
|
1609
|
+
fill: rgba(
|
|
1610
|
+
var(--makebot-host-bubble-bg-rgb),
|
|
1611
|
+
var(--makebot-host-bubble-opacity)
|
|
1612
|
+
);
|
|
1613
|
+
transition: fill 100ms ease-out;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
.rating-icon-container.selected svg {
|
|
1617
|
+
fill: rgb(var(--makebot-button-bg-rgb));
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
.rating-icon-container:hover svg {
|
|
1621
|
+
filter: brightness(0.9);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
.rating-icon-container:active svg {
|
|
1625
|
+
filter: brightness(0.75);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
.upload-progress-bar {
|
|
1629
|
+
background-color: rgb(var(--makebot-button-bg-rgb));
|
|
1630
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
.total-files-indicator {
|
|
1634
|
+
background-color: rgb(var(--makebot-button-bg-rgb));
|
|
1635
|
+
color: var(--makebot-button-color);
|
|
1636
|
+
font-size: 10px;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
.makebot-upload-input {
|
|
1640
|
+
transition: border-color 100ms ease-out;
|
|
1641
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.makebot-upload-input.dragging-over {
|
|
1645
|
+
border-color: rgb(var(--makebot-button-bg-rgb));
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.makebot-country-select {
|
|
1649
|
+
color: var(--makebot-input-color);
|
|
1650
|
+
background-color: var(--makebot-input-bg-color);
|
|
1651
|
+
border-radius: var(--makebot-button-border-radius);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.makebot-datetime-input {
|
|
1655
|
+
color-scheme: light;
|
|
1656
|
+
color: var(--makebot-input-color);
|
|
1657
|
+
background-color: var(--makebot-input-bg-color);
|
|
1658
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.makebot-picture-button {
|
|
1662
|
+
color: var(--makebot-button-color);
|
|
1663
|
+
background-color: rgb(var(--makebot-button-bg-rgb));
|
|
1664
|
+
border-radius: var(--makebot-button-border-radius);
|
|
1665
|
+
transition: all 0.3s ease;
|
|
1666
|
+
width: 236px;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
.makebot-picture-button > img,
|
|
1670
|
+
.makebot-selectable-picture > img {
|
|
1671
|
+
border-radius: var(--makebot-button-border-radius)
|
|
1672
|
+
var(--makebot-button-border-radius) 0 0;
|
|
1673
|
+
min-width: 200px;
|
|
1674
|
+
width: 100%;
|
|
1675
|
+
max-height: 200px;
|
|
1676
|
+
height: 100%;
|
|
1677
|
+
-o-object-fit: cover;
|
|
1678
|
+
object-fit: cover;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.makebot-picture-button.has-svg > img,
|
|
1682
|
+
.makebot-selectable-picture.has-svg > img {
|
|
1683
|
+
max-height: 128px;
|
|
1684
|
+
-o-object-fit: contain;
|
|
1685
|
+
object-fit: contain;
|
|
1686
|
+
padding: 1rem;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.makebot-selectable-picture {
|
|
1690
|
+
border: 1px solid
|
|
1691
|
+
rgba(
|
|
1692
|
+
var(--makebot-button-bg-rgb),
|
|
1693
|
+
calc(var(--selectable-alpha-ratio) * 0.25)
|
|
1694
|
+
);
|
|
1695
|
+
border-radius: var(--makebot-button-border-radius);
|
|
1696
|
+
color: rgb(var(--makebot-chat-container-color));
|
|
1697
|
+
background-color: rgba(
|
|
1698
|
+
var(--makebot-button-bg-rgb),
|
|
1699
|
+
calc(var(--selectable-alpha-ratio) * 0.08)
|
|
1700
|
+
);
|
|
1701
|
+
transition: all 0.3s ease;
|
|
1702
|
+
width: 236px;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.makebot-selectable-picture:hover {
|
|
1706
|
+
background-color: rgba(
|
|
1707
|
+
var(--makebot-button-bg-rgb),
|
|
1708
|
+
calc(var(--selectable-alpha-ratio) * 0.12)
|
|
1709
|
+
);
|
|
1710
|
+
border-color: rgba(
|
|
1711
|
+
var(--makebot-button-bg-rgb),
|
|
1712
|
+
calc(var(--selectable-alpha-ratio) * 0.3)
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.makebot-selectable-picture.selected {
|
|
1717
|
+
background-color: rgba(
|
|
1718
|
+
var(--makebot-button-bg-rgb),
|
|
1719
|
+
calc(var(--selectable-alpha-ratio) * 0.18)
|
|
1720
|
+
);
|
|
1721
|
+
border-color: rgba(
|
|
1722
|
+
var(--makebot-button-bg-rgb),
|
|
1723
|
+
calc(var(--selectable-alpha-ratio) * 0.35)
|
|
1724
|
+
);
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
select option {
|
|
1728
|
+
color: var(--makebot-input-color);
|
|
1729
|
+
background-color: var(--makebot-input-bg-color);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
.makebot-progress-bar-container {
|
|
1733
|
+
background-color: rgba(
|
|
1734
|
+
var(--makebot-progress-bar-bg-rgb),
|
|
1735
|
+
calc(var(--selectable-alpha-ratio) * 0.12)
|
|
1736
|
+
);
|
|
1737
|
+
|
|
1738
|
+
height: var(--makebot-progress-bar-height);
|
|
1739
|
+
position: var(--makebot-progress-bar-position);
|
|
1740
|
+
top: var(--makebot-progress-bar-top);
|
|
1741
|
+
bottom: var(--makebot-progress-bar-bottom);
|
|
1742
|
+
left: 0;
|
|
1743
|
+
width: 100%;
|
|
1744
|
+
z-index: 1999;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
.makebot-progress-bar-container > .makebot-progress-bar {
|
|
1748
|
+
background-color: var(--makebot-progress-bar-color);
|
|
1749
|
+
position: absolute;
|
|
1750
|
+
height: 100%;
|
|
1751
|
+
transition: width 0.25s ease;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.makebot-recorder .left-gradient {
|
|
1755
|
+
background-image: linear-gradient(
|
|
1756
|
+
to right,
|
|
1757
|
+
rgba(var(--makebot-input-bg-rgb), 1),
|
|
1758
|
+
rgba(var(--makebot-input-bg-rgb), 0)
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.makebot-recorder .right-gradient {
|
|
1763
|
+
background-image: linear-gradient(
|
|
1764
|
+
to left,
|
|
1765
|
+
rgba(var(--makebot-input-bg-rgb), 1),
|
|
1766
|
+
rgba(var(--makebot-input-bg-rgb), 0)
|
|
1767
|
+
);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
.makebot-recorder button {
|
|
1771
|
+
color: rgba(var(--makebot-button-bg-rgb));
|
|
1772
|
+
background-color: rgba(var(--makebot-button-bg-rgb), 0.3);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
@keyframes fadeInFromTop {
|
|
1776
|
+
0% {
|
|
1777
|
+
opacity: 0;
|
|
1778
|
+
transform: translateY(-4px);
|
|
1779
|
+
}
|
|
1780
|
+
100% {
|
|
1781
|
+
opacity: 1;
|
|
1782
|
+
transform: translateY(0);
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
@keyframes fadeOutFromTop {
|
|
1787
|
+
0% {
|
|
1788
|
+
opacity: 1;
|
|
1789
|
+
transform: translateY(0);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
100% {
|
|
1793
|
+
opacity: 0;
|
|
1794
|
+
transform: translateY(-4px);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
@keyframes fadeInFromBottom {
|
|
1799
|
+
0% {
|
|
1800
|
+
opacity: 0;
|
|
1801
|
+
transform: translateY(4px);
|
|
1802
|
+
}
|
|
1803
|
+
100% {
|
|
1804
|
+
opacity: 1;
|
|
1805
|
+
transform: translateY(0);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
@keyframes fadeOutFromBottom {
|
|
1810
|
+
0% {
|
|
1811
|
+
opacity: 1;
|
|
1812
|
+
transform: translateY(0);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
100% {
|
|
1816
|
+
opacity: 0;
|
|
1817
|
+
transform: translateY(4px);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
[data-scope="menu"][data-part="content"] {
|
|
1822
|
+
color: var(--makebot-input-color);
|
|
1823
|
+
background-color: rgba(
|
|
1824
|
+
var(--makebot-input-bg-rgb),
|
|
1825
|
+
var(--makebot-input-opacity)
|
|
1826
|
+
);
|
|
1827
|
+
border-width: var(--makebot-input-border-width);
|
|
1828
|
+
border-color: rgba(
|
|
1829
|
+
var(--makebot-input-border-rgb),
|
|
1830
|
+
var(--makebot-input-border-opacity)
|
|
1831
|
+
);
|
|
1832
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1833
|
+
box-shadow: var(--makebot-input-box-shadow);
|
|
1834
|
+
backdrop-filter: blur(var(--makebot-input-blur));
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
[data-scope="menu"][data-part="item"] {
|
|
1838
|
+
cursor: pointer;
|
|
1839
|
+
background-color: rgba(
|
|
1840
|
+
var(--makebot-input-bg-rgb),
|
|
1841
|
+
var(--makebot-input-opacity)
|
|
1842
|
+
);
|
|
1843
|
+
border-radius: var(--makebot-input-border-radius);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
[data-scope="menu"][data-part="content"][data-state="open"] {
|
|
1847
|
+
animation: fadeInFromTop 150ms ease-out forwards;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
[data-scope="menu"][data-part="content"][data-state="closed"] {
|
|
1851
|
+
animation: fadeOutFromTop 50ms ease-out forwards;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
[data-scope="progress"][data-part="root"] {
|
|
1855
|
+
width: 100%;
|
|
1856
|
+
height: 100%;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
[data-scope="progress"][data-part="circle"] {
|
|
1860
|
+
--size: 40px;
|
|
1861
|
+
--thickness: 4px;
|
|
1862
|
+
--radius: calc(40px / 2 - 4px / 2);
|
|
1863
|
+
--circomference: calc(2 * 3.14159 * calc(40px / 2 - 4px / 2));
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
[data-scope="progress"][data-part="circle-range"] {
|
|
1867
|
+
stroke: white;
|
|
1868
|
+
--transition-prop: stroke-dasharray, stroke, stroke-dashoffset;
|
|
1869
|
+
transition-property: stroke-dasharray, stroke, stroke-dashoffset;
|
|
1870
|
+
--transition-duration: 0.2s;
|
|
1871
|
+
transition-duration: 0.2s;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
[data-scope="progress"][data-part="circle-track"] {
|
|
1875
|
+
stroke: rgba(0, 0, 0, 0.5);
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
.makebot-buttons-input > [data-slot="list"] {
|
|
1879
|
+
flex-direction: var(--makebot-buttons-input-flex-direction);
|
|
1880
|
+
flex-wrap: wrap;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
.makebot-buttons-input > .makebot-input {
|
|
1884
|
+
max-width: 350px;
|
|
1885
|
+
}
|
|
1886
|
+
`,q6=E("<button part=button>"),K6=E('<svg part=button-icon viewBox="0 0 16 16"><path d="M8 15C12.418 15 16 11.866 16 8C16 4.134 12.418 1 8 1C3.582 1 0 4.134 0 8C0 9.76 0.743 11.37 1.97 12.6C1.873 13.616 1.553 14.73 1.199 15.566C1.12 15.752 1.273 15.96 1.472 15.928C3.728 15.558 5.069 14.99 5.652 14.694C6.41791 14.8983 7.20732 15.0012 8 15Z"fill=currentColor>'),Y6=E('<img part=button-icon alt="Bubble button icon">'),Ib=E(`<span part=button-icon style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'">`),X6=E('<svg part=button-icon viewBox="0 0 24 24"style=fill:#fff><path fill-rule=evenodd clip-rule=evenodd d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),J6=E('<img part=button-icon alt="Bubble button close icon">'),Ls=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),Q6=e=>(()=>{var t=q6();return t.$$click=()=>e.toggleBot(),T(t,g(eN,e),null),T(t,g(tN,e),null),U(r=>{var n=ae("relative shadow-md rounded-2xl hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in size-[var(--button-size)]"),a=e.backgroundColor??We.gray.dark[2],i=e.backgroundColor&&mi(e.backgroundColor)?We.gray.light[12]:We.gray.dark[12],o=e.isBotOpen?"Fechar chatbot":"Abrir chatbot",s=e.isBotOpen;return n!==r.e&&ne(t,r.e=n),a!==r.t&&we(t,"background-color",r.t=a),i!==r.a&&we(t,"color",r.a=i),o!==r.o&&de(t,"aria-label",r.o=o),s!==r.i&&de(t,"aria-pressed",r.i=s),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})(),eN=e=>g(lt,{get children(){return[g(se,{get when(){return Vt(e.customIconSrc)},get children(){var t=K6();return U(()=>de(t,"class",ae("fill-transparent absolute duration-200 transition size-6",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}}),g(se,{get when(){return j(()=>!!e.customIconSrc)()&&Ls(e.customIconSrc)},get children(){var t=Y6();return U(r=>{var n=e.customIconSrc,a=ae("duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100",pi(e.customIconSrc)?"w-[60%]":"w-full h-full",pi(e.customIconSrc)?"":"object-cover rounded-2xl");return n!==r.e&&de(t,"src",r.e=n),a!==r.t&&ne(t,r.t=a),r},{e:void 0,t:void 0}),t}}),g(se,{get when(){return j(()=>!!e.customIconSrc)()&&!Ls(e.customIconSrc)},get children(){var t=Ib();return T(t,()=>e.customIconSrc),U(()=>ne(t,ae("text-4xl duration-200 transition",e.isBotOpen?"scale-0 opacity-0":"scale-100 opacity-100"))),t}})]}}),tN=e=>g(lt,{get children(){return[g(se,{get when(){return Vt(e.customCloseIconSrc)},get children(){var t=X6();return U(()=>de(t,"class",ae("absolute duration-200 transition w-[60%]",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}}),g(se,{get when(){return j(()=>!!e.customCloseIconSrc)()&&Ls(e.customCloseIconSrc)},get children(){var t=J6();return U(r=>{var n=e.customCloseIconSrc,a=ae("absolute duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",pi(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",pi(e.customCloseIconSrc)?"":"object-cover rounded-2xl");return n!==r.e&&de(t,"src",r.e=n),a!==r.t&&ne(t,r.t=a),r},{e:void 0,t:void 0}),t}}),g(se,{get when(){return j(()=>!!e.customCloseIconSrc)()&&!Ls(e.customCloseIconSrc)},get children(){var t=Ib();return T(t,()=>e.customCloseIconSrc),U(()=>ne(t,ae("absolute text-4xl duration-200 transition",e.isBotOpen?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"))),t}})]}});at(["click"]);var rN=E("<div part=preview-message><p>"),nN=E('<img class="rounded-full w-8 h-8 object-cover"alt="Avatar do bot"elementtiming="Bot avatar"fetchpriority=high>'),aN=E('<button part=preview-message-close-button aria-label=Fechar><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>'),iN=e=>{let[t,r]=N(!1),[n,a]=N({x:0,y:0}),i=s=>{a({x:s.touches[0]?.clientX??0,y:s.touches[0]?.clientY??0})},o=s=>{let l=s.changedTouches[0]?.clientX??0,c=s.changedTouches[0]?.clientY??0;(Math.abs(l-n().x)>10||c-n().y>10)&&e.onCloseClick(),a({x:0,y:0})};return(()=>{var s=rN(),l=s.firstChild;return s.$$touchend=o,s.$$touchstart=i,s.addEventListener("mouseleave",()=>r(!1)),s.addEventListener("mouseenter",()=>r(!0)),s.$$click=()=>e.onClick(),T(s,g(oN,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),l),T(s,g(X,{get when(){return e.avatarUrl},keyed:!0,children:c=>(()=>{var u=nN();return de(u,"src",c),u})()}),l),T(l,()=>e.message),U(c=>{var u=ae("absolute bottom-[calc(100%+12px)] w-64 rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4",e.placement==="left"?"left-0":"right-0"),d=e.previewMessageTheme?.backgroundColor??t0,p=e.previewMessageTheme?.textColor??r0;return u!==c.e&&ne(s,c.e=u),d!==c.t&&we(s,"background-color",c.t=d),p!==c.a&&we(s,"color",c.a=p),c},{e:void 0,t:void 0,a:void 0}),s})()},oN=e=>(()=>{var t=aN();return t.$$click=r=>(r.stopPropagation(),e.onClick()),U(r=>{var n="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),a=e.previewMessageTheme?.closeButtonBackgroundColor??n0,i=e.previewMessageTheme?.closeButtonIconColor??a0;return n!==r.e&&ne(t,r.e=n),a!==r.t&&we(t,"background-color",r.t=a),i!==r.a&&we(t,"color",r.a=i),r},{e:void 0,t:void 0,a:void 0}),t})();at(["click","touchstart","touchend"]);var sN=E("<style>"),lN=E("<div>"),cN=E('<div style=--container-bottom:20px;--button-gap:12px;--container-border-radius:7px><div part=bot style="transition:transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out">'),uN=(e,t)=>{let{element:r}=t,[n,a]=Rt(e,["isOpen","onOpen","onClose","previewMessage","onPreviewMessageClick","onPreviewMessageDismissed","theme","autoShowDelay","inlineStyle"]),[i,o]=N("idle"),[s,l]=N(!1),c=he(()=>Se(n.isOpen)),u=he(()=>c()?n.isOpen:i()==="open"),[d,p]=N(a.prefilledVariables),[h,y]=N({message:n.previewMessage?.message??"",avatarUrl:n.previewMessage?.avatarUrl}),[m,v]=N(!1),w=()=>{window.addEventListener("message",x)},b=()=>{window.removeEventListener("message",x)};Ye(()=>{i()!=="idle"||!a.makebot||(o("ready"),w(),D())}),Ie(()=>{o("idle"),b()}),Ye(()=>{n.isOpen&&!s()&&l(!0)});let x=O=>{let{data:A}=O;if(!(!A.isFromMakebot||A.id&&r.id!==A.id))switch(A.command){case"open":f();break;case"close":k();break;case"toggle":_();break;case"showPreviewMessage":I(A.message);break;case"hidePreviewMessage":L();break;case"setPrefilledVariables":p(z=>({...z,...A.variables}));break;case"unmount":R();break;case"reload":C();break}},f=()=>{n.onOpen?.(),!c()&&(l(!0),L(),o("open"))},k=()=>{n.onClose?.(),!c()&&(o("closed"),Xg())},_=()=>{u()?k():f()},C=()=>{l(!1),l(!0)},P=()=>{n.onPreviewMessageClick?.(),f()},I=O=>{if(u())return;let A=O??(n.previewMessage?{message:n.previewMessage.message,avatarUrl:n.previewMessage.avatarUrl}:void 0);A&&(y(A),v(!0))},L=()=>{v(!1),n.onPreviewMessageDismissed?.()},R=()=>{u()?(k(),setTimeout(()=>{o("unmounted")},200)):o("unmounted")},D=()=>{(Jg()||wu())&&f(),Se(n.autoShowDelay)&&setTimeout(f,n.autoShowDelay);let O=n.previewMessage?.autoShowDelay;Se(O)&&setTimeout(I,O)},V=O=>{a.onChatStatePersisted?.(O),O&&Yg()},F=O=>{a.onScriptExecutionSuccess?.(O)},le;return g(X,{get when(){return i()!=="unmounted"},get children(){return g(Mu,{get value(){return document.querySelector("makebot-bubble")?.shadowRoot},get children(){return[(()=>{var O=sN();return T(O,ed,null),T(O,td,null),O})(),(()=>{var O=lN(),A=le;return typeof A=="function"?Ve(A,O):le=O,O})(),(()=>{var O=cN(),A=O.firstChild;return T(O,g(X,{get when(){return m()},get children(){return g(iN,De(h,{get placement(){return n.theme?.placement},get previewMessageTheme(){return n.theme?.previewMessage},onClick:P,onCloseClick:L}))}}),A),T(O,g(X,{get when(){return!n.theme?.button?.isHidden},get children(){return g(Q6,De(()=>n.theme?.button,{get placement(){return n.theme?.placement},toggleBot:_,get isBotOpen(){return u()}}))}}),A),T(A,g(X,{get when(){return s()},get children(){return g(Qu,De(a,{onScriptExecutionSuccess:F,onChatStatePersisted:V,get prefilledVariables(){return d()}}))}})),U(z=>{var ge=ae(n.theme?.position==="static"?"relative":"z-[424242] fixed bottom-[var(--container-bottom)] right-5",n.theme?.placement==="left"&&"left-5"),me={"--button-size":W6(n.theme?.button?.size??"medium",{isHidden:n.theme?.button?.isHidden}),"--bot-bg-color":n.theme?.chatWindow?.backgroundColor,"--bot-max-width":n.theme?.chatWindow?.maxWidth??"400px","--bot-max-height":n.theme?.chatWindow?.maxHeight??"704px",...n.inlineStyle},oe=n.theme?.placement==="left"?"bottom left":"bottom right",Ze=u()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",je=ae("absolute rounded-lg max-h-[calc(100dvh-var(--container-bottom)-var(--button-gap)-var(--button-size))] shadow-lg bg-[var(--bot-bg-color)] h-[var(--bot-max-height)] max-w-[var(--bot-max-width)] overflow-hidden",u()?"opacity-1":"opacity-0 pointer-events-none",n.theme?.placement==="left"?"sm:left-0 -left-5":"sm:right-0 -right-5",n.theme?.button?.isHidden?"bottom-0 ml-2 sm:ml-0 w-[calc(100vw-16px)] sm:w-screen":"bottom-[calc(100%+var(--button-gap))] w-screen");return ge!==z.e&&ne(O,z.e=ge),z.t=vu(O,me,z.t),oe!==z.a&&we(A,"transform-origin",z.a=oe),Ze!==z.o&&we(A,"transform",z.o=Ze),je!==z.i&&ne(A,z.i=je),z},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),O})()]}})}})},dN=E("<style>"),pN=E('<div class=relative aria-labelledby=modal-title role=dialog aria-modal=true><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in"part=overlay></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),hN=(e,t)=>{let{element:r}=t,[n,a]=Rt(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[i,o]=N(a.prefilledVariables),[s,l]=N(n.isOpen??!1);$e(()=>{(n.defaultOpen||wu()||Jg())&&d(),window.addEventListener("message",u);let w=n.autoShowDelay;Se(w)&&setTimeout(()=>{d()},w)}),Ie(()=>{window.removeEventListener("message",u)}),Ye(()=>{Vt(e.isOpen)||e.isOpen===s()||h()}),Ye(()=>{e.prefilledVariables&&o(w=>({...w,...e.prefilledVariables}))});let c=w=>{w.stopPropagation()},u=w=>{let{data:b}=w;if(!(!b.isFromMakebot||b.id&&r.id!==b.id))switch(b.command){case"open":d();break;case"close":p();break;case"toggle":h();break;case"setPrefilledVariables":o(x=>({...x,...b.variables}));break;case"reload":y();break}},d=()=>{l(!0),n.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",p)},p=()=>{l(!1),n.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",p),Xg()},h=()=>{s()?p():d()},y=()=>{l(!1),l(!0)},m=w=>{a.onChatStatePersisted?.(w),w&&Yg()},v=w=>{e.onScriptExecutionSuccess?.(w)};return g(X,{get when(){return s()},get children(){return g(Mu,{get value(){return document.querySelector("makebot-popup")?.shadowRoot},get children(){return[(()=>{var w=dN();return T(w,ed,null),T(w,td,null),w})(),(()=>{var w=pN(),b=w.firstChild,x=b.nextSibling,f=x.firstChild,k=f.firstChild;return sr(k,"pointerdown",c),T(k,g(Qu,De(a,{onScriptExecutionSuccess:v,get prefilledVariables(){return i()},onChatStatePersisted:m}))),U(_=>{var C=e.theme?.zIndex??1999,P="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),I=e.theme?.backgroundColor??"transparent",L=e.theme?.width??"512px";return C!==_.e&&we(w,"z-index",_.e=C),P!==_.t&&ne(k,_.t=P),I!==_.a&&we(k,"background-color",_.a=I),L!==_.o&&we(k,"max-width",_.o=L),_},{e:void 0,t:void 0,a:void 0,o:void 0}),w})()]}})}})},gN=E(`<style>
|
|
1887
|
+
:host {
|
|
1888
|
+
display: block;
|
|
1889
|
+
width: 100%;
|
|
1890
|
+
height: 100%;
|
|
1891
|
+
overflow-y: hidden;
|
|
1892
|
+
}
|
|
1893
|
+
`),mN=(e,{element:t})=>{let[r,n]=N(!1),[a,i]=N(e.prefilledVariables),o=()=>{n(!0)},s=()=>{n(!1),setTimeout(()=>{n(!0)},1)},l=new IntersectionObserver(d=>{d.some(p=>p.isIntersecting)&&o()}),c=()=>{let d=t.getBoundingClientRect();return d.width>0&&d.height>0&&d.bottom>=0&&d.right>=0&&d.top<=window.innerHeight&&d.left<=window.innerWidth};$e(()=>{if(window.addEventListener("message",u),c()){o();return}l.observe(t)}),Ye(()=>{e.prefilledVariables&&i(d=>({...d,...e.prefilledVariables}))});let u=d=>{let{data:p}=d;if(!(!p.isFromMakebot||p.id&&t.id!==p.id))switch(p.command){case"setPrefilledVariables":i(h=>({...h,...p.variables}));break;case"reload":s();break}};return Ie(()=>{l.disconnect()}),g(Mu,{get value(){return document.querySelector("makebot-standard")?.shadowRoot},get children(){return[(()=>{var d=gN(),p=d.firstChild;return T(d,ed,p),T(d,td,p),d})(),g(X,{get when(){return r()},get children(){return g(Qu,De(e,{get prefilledVariables(){return a()}}))}})]}})},fN=()=>{typeof window>"u"||(ml("makebot-standard",xu,mN),ml("makebot-bubble",qy,uN),ml("makebot-popup",Wy,hN))},bN=({id:e}={})=>{let t={isFromMakebot:!0,command:"close",id:e};window.postMessage(t)},yN=({id:e}={})=>{let t={isFromMakebot:!0,command:"hidePreviewMessage",id:e};window.postMessage(t)},vN=({id:e}={})=>{let t={isFromMakebot:!0,command:"open",id:e};window.postMessage(t)},xN=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"sendCommand",text:e,id:t};window.postMessage(r)},wN=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"setInputValue",value:e,id:t};window.postMessage(r)},kN=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"setPrefilledVariables",variables:e,id:t};window.postMessage(r)},_N=(e,{id:t}={})=>{let r={isFromMakebot:!0,command:"showPreviewMessage",message:e,id:t};window.postMessage(r)},TN=({id:e}={})=>{let t={isFromMakebot:!0,command:"toggle",id:e};window.postMessage(t)},SN=({id:e}={})=>{let t={isFromMakebot:!0,command:"unmount",id:e};window.postMessage(t)},EN=({id:e}={})=>{let t={isFromMakebot:!0,command:"reload",id:e};window.postMessage(t)},CN=e=>{let t=e.id?document.getElementById(e.id):document.querySelector("makebot-standard");if(!t)throw new Error("<makebot-standard> element not found.");Object.assign(t,e)},PN=e=>{let t=document.createElement("makebot-popup");Object.assign(t,e),document.body.prepend(t)},ON=e=>{let t=document.createElement("makebot-bubble");Object.assign(t,e),document.body.prepend(t)},IN=()=>({initStandard:CN,initPopup:PN,initBubble:ON,close:bN,hidePreviewMessage:yN,open:vN,setPrefilledVariables:kN,showPreviewMessage:_N,toggle:TN,setInputValue:wN,unmount:SN,sendCommand:xN,reload:EN}),NN=e=>{typeof window>"u"||(window.Makebot={...e})};fN();var AN=IN();NN(AN);
|
|
1894
|
+
/*! Bundled license information:
|
|
1895
|
+
|
|
1896
|
+
ky/distribution/index.js:
|
|
1897
|
+
(*! MIT License © Sindre Sorhus *)
|
|
1898
|
+
|
|
1899
|
+
dompurify/dist/purify.es.mjs:
|
|
1900
|
+
(*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE *)
|
|
1901
|
+
*/
|