@iai-lib/any-chat-widget 0.1.0-alpha.43 → 0.1.0-alpha.44
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/any-chat-widget.es.js +287 -273
- package/dist/any-chat-widget.umd.js +13 -13
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Te,_e){typeof exports=="object"&&typeof module<"u"?_e(exports):typeof define=="function"&&define.amd?define(["exports"],_e):(Te=typeof globalThis<"u"?globalThis:Te||self,_e(Te.AnyChatbot={}))})(this,function(Te){"use strict";var Eu=(Te,_e,Oe)=>{if(!_e.has(Te))throw TypeError("Cannot "+Oe)};var Ri=(Te,_e,Oe)=>(Eu(Te,_e,"read from private field"),Oe?Oe.call(Te):_e.get(Te)),zl=(Te,_e,Oe)=>{if(_e.has(Te))throw TypeError("Cannot add the same private member more than once");_e instanceof WeakSet?_e.add(Te):_e.set(Te,Oe)},sn=(Te,_e,Oe,Ir)=>(Eu(Te,_e,"write to private field"),Ir?Ir.call(Te,Oe):_e.set(Te,Oe),Oe);var Tu,Rt,Zn;var _e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oe=function(n,e,t,s,r,i,l,a,o,u){var c=this;c.numeralDecimalMark=n||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=t>=0?t:2,c.numeralThousandsGroupStyle=s||Oe.groupStyle.thousand,c.numeralPositiveOnly=!!r,c.stripLeadingZeroes=i!==!1,c.prefix=l||l===""?l:"",c.signBeforePrefix=!!a,c.tailPrefix=!!o,c.delimiter=u||u===""?u:",",c.delimiterRE=u?new RegExp("\\"+u,"g"):""};Oe.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Oe.prototype={getRawValue:function(n){return n.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(n){var e=this,t,s,r,i,l="";switch(n=n.replace(/[A-Za-z]/g,"").replace(e.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",e.numeralPositiveOnly?"":"-").replace("M",e.numeralDecimalMark),e.stripLeadingZeroes&&(n=n.replace(/^(-)?0+(?=\d)/,"$1")),s=n.slice(0,1)==="-"?"-":"",typeof e.prefix<"u"?e.signBeforePrefix?r=s+e.prefix:r=e.prefix+s:r=s,i=n,n.indexOf(e.numeralDecimalMark)>=0&&(t=n.split(e.numeralDecimalMark),i=t[0],l=e.numeralDecimalMark+t[1].slice(0,e.numeralDecimalScale)),s==="-"&&(i=i.slice(1)),e.numeralIntegerScale>0&&(i=i.slice(0,e.numeralIntegerScale)),e.numeralThousandsGroupStyle){case Oe.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+e.delimiter);break;case Oe.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+e.delimiter);break;case Oe.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+e.delimiter);break}return e.tailPrefix?s+i.toString()+(e.numeralDecimalScale>0?l.toString():"")+e.prefix:r+i.toString()+(e.numeralDecimalScale>0?l.toString():"")}};var Ir=Oe,Hl=function(n,e,t){var s=this;s.date=[],s.blocks=[],s.datePattern=n,s.dateMin=e.split("-").reverse().map(function(r){return parseInt(r,10)}),s.dateMin.length===2&&s.dateMin.unshift(0),s.dateMax=t.split("-").reverse().map(function(r){return parseInt(r,10)}),s.dateMax.length===2&&s.dateMax.unshift(0),s.initBlocks()};Hl.prototype={initBlocks:function(){var n=this;n.datePattern.forEach(function(e){e==="Y"?n.blocks.push(4):n.blocks.push(2)})},getISOFormatDate:function(){var n=this,e=n.date;return e[2]?e[2]+"-"+n.addLeadingZero(e[1])+"-"+n.addLeadingZero(e[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(n){var e=this,t="";return n=n.replace(/[^\d]/g,""),e.blocks.forEach(function(s,r){if(n.length>0){var i=n.slice(0,s),l=i.slice(0,1),a=n.slice(s);switch(e.datePattern[r]){case"d":i==="00"?i="01":parseInt(l,10)>3?i="0"+l:parseInt(i,10)>31&&(i="31");break;case"m":i==="00"?i="01":parseInt(l,10)>1?i="0"+l:parseInt(i,10)>12&&(i="12");break}t+=i,n=a}}),this.getFixedDateString(t)},getFixedDateString:function(n){var e=this,t=e.datePattern,s=[],r=0,i=0,l=0,a=0,o=0,u=0,c,p,d,g=!1;n.length===4&&t[0].toLowerCase()!=="y"&&t[1].toLowerCase()!=="y"&&(a=t[0]==="d"?0:2,o=2-a,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),s=this.getFixedDate(c,p,0)),n.length===8&&(t.forEach(function(W,se){switch(W){case"d":r=se;break;case"m":i=se;break;default:l=se;break}}),u=l*2,a=r<=l?r*2:r*2+2,o=i<=l?i*2:i*2+2,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+4),10),g=n.slice(u,u+4).length===4,s=this.getFixedDate(c,p,d)),n.length===4&&(t[0]==="y"||t[1]==="y")&&(o=t[0]==="m"?0:2,u=2-o,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),g=n.slice(u,u+2).length===2,s=[0,p,d]),n.length===6&&(t[0]==="Y"||t[1]==="Y")&&(o=t[0]==="m"?0:4,u=2-.5*o,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+4),10),g=n.slice(u,u+4).length===4,s=[0,p,d]),s=e.getRangeFixedDate(s),e.date=s;var _=s.length===0?n:t.reduce(function(W,se){switch(se){case"d":return W+(s[0]===0?"":e.addLeadingZero(s[0]));case"m":return W+(s[1]===0?"":e.addLeadingZero(s[1]));case"y":return W+(g?e.addLeadingZeroForYear(s[2],!1):"");case"Y":return W+(g?e.addLeadingZeroForYear(s[2],!0):"")}},"");return _},getRangeFixedDate:function(n){var e=this,t=e.datePattern,s=e.dateMin||[],r=e.dateMax||[];return!n.length||s.length<3&&r.length<3||t.find(function(i){return i.toLowerCase()==="y"})&&n[2]===0?n:r.length&&(r[2]<n[2]||r[2]===n[2]&&(r[1]<n[1]||r[1]===n[1]&&r[0]<n[0]))?r:s.length&&(s[2]>n[2]||s[2]===n[2]&&(s[1]>n[1]||s[1]===n[1]&&s[0]>n[0]))?s:n},getFixedDate:function(n,e,t){return n=Math.min(n,31),e=Math.min(e,12),t=parseInt(t||0,10),(e<7&&e%2===0||e>8&&e%2===1)&&(n=Math.min(n,e===2?this.isLeapYear(t)?29:28:30)),[n,e,t]},isLeapYear:function(n){return n%4===0&&n%100!==0||n%400===0},addLeadingZero:function(n){return(n<10?"0":"")+n},addLeadingZeroForYear:function(n,e){return e?(n<10?"000":n<100?"00":n<1e3?"0":"")+n:(n<10?"0":"")+n}};var Du=Hl,Ul=function(n,e){var t=this;t.time=[],t.blocks=[],t.timePattern=n,t.timeFormat=e,t.initBlocks()};Ul.prototype={initBlocks:function(){var n=this;n.timePattern.forEach(function(){n.blocks.push(2)})},getISOFormatTime:function(){var n=this,e=n.time;return e[2]?n.addLeadingZero(e[0])+":"+n.addLeadingZero(e[1])+":"+n.addLeadingZero(e[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){var n=this;return String(n.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(n){var e=this,t="";n=n.replace(/[^\d]/g,"");var s=e.getTimeFormatOptions();return e.blocks.forEach(function(r,i){if(n.length>0){var l=n.slice(0,r),a=l.slice(0,1),o=n.slice(r);switch(e.timePattern[i]){case"h":parseInt(a,10)>s.maxHourFirstDigit?l="0"+a:parseInt(l,10)>s.maxHours&&(l=s.maxHours+"");break;case"m":case"s":parseInt(a,10)>s.maxMinutesFirstDigit?l="0"+a:parseInt(l,10)>s.maxMinutes&&(l=s.maxMinutes+"");break}t+=l,n=o}}),this.getFixedTimeString(t)},getFixedTimeString:function(n){var e=this,t=e.timePattern,s=[],r=0,i=0,l=0,a=0,o=0,u=0,c,p,d;return n.length===6&&(t.forEach(function(g,_){switch(g){case"s":r=_*2;break;case"m":i=_*2;break;case"h":l=_*2;break}}),u=l,o=i,a=r,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),s=this.getFixedTime(d,p,c)),n.length===4&&e.timePattern.indexOf("s")<0&&(t.forEach(function(g,_){switch(g){case"m":i=_*2;break;case"h":l=_*2;break}}),u=l,o=i,c=0,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),s=this.getFixedTime(d,p,c)),e.time=s,s.length===0?n:t.reduce(function(g,_){switch(_){case"s":return g+e.addLeadingZero(s[2]);case"m":return g+e.addLeadingZero(s[1]);case"h":return g+e.addLeadingZero(s[0])}},"")},getFixedTime:function(n,e,t){return t=Math.min(parseInt(t||0,10),60),e=Math.min(e,60),n=Math.min(n,60),[n,e,t]},addLeadingZero:function(n){return(n<10?"0":"")+n}};var Zu=Ul,Bl=function(n,e){var t=this;t.delimiter=e||e===""?e:" ",t.delimiterRE=e?new RegExp("\\"+e,"g"):"",t.formatter=n};Bl.prototype={setFormatter:function(n){this.formatter=n},format:function(n){var e=this;e.formatter.clear(),n=n.replace(/[^\d+]/g,""),n=n.replace(/^\+/,"B").replace(/\+/g,"").replace("B","+"),n=n.replace(e.delimiterRE,"");for(var t="",s,r=!1,i=0,l=n.length;i<l;i++)s=e.formatter.inputDigit(n.charAt(i)),/[\s()-]/g.test(s)?(t=s,r=!0):r||(t=s);return t=t.replace(/[()]/g,""),t=t.replace(/[\s-]/g,e.delimiter),t}};var Lu=Bl,ji={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(n){var e=n.reduce(function(t,s){return t+s},0);return n.concat(19-e)},getInfo:function(n,e){var t=ji.blocks,s=ji.re;e=!!e;for(var r in s)if(s[r].test(n)){var i=t[r];return{type:r,blocks:e?this.getStrictBlocks(i):i}}return{type:"unknown",blocks:e?this.getStrictBlocks(t.general):t.general}}},zu=ji,Hu={noop:function(){},strip:function(n,e){return n.replace(e,"")},getPostDelimiter:function(n,e,t){if(t.length===0)return n.slice(-e.length)===e?e:"";var s="";return t.forEach(function(r){n.slice(-r.length)===r&&(s=r)}),s},getDelimiterREByDelimiter:function(n){return new RegExp(n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(n,e,t,s,r){return e.length===n?t.length:n+this.getPositionOffset(n,e,t,s,r)},getPositionOffset:function(n,e,t,s,r){var i,l,a;return i=this.stripDelimiters(e.slice(0,n),s,r),l=this.stripDelimiters(t.slice(0,n),s,r),a=i.length-l.length,a!==0?a/Math.abs(a):0},stripDelimiters:function(n,e,t){var s=this;if(t.length===0){var r=e?s.getDelimiterREByDelimiter(e):"";return n.replace(r,"")}return t.forEach(function(i){i.split("").forEach(function(l){n=n.replace(s.getDelimiterREByDelimiter(l),"")})}),n},headStr:function(n,e){return n.slice(0,e)},getMaxLength:function(n){return n.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(n,e,t,s,r,i,l,a,o){if(t===0)return n;if(n===e&&n!=="")return"";if(o&&n.slice(0,1)=="-"){var u=s.slice(0,1)=="-"?s.slice(1):s;return"-"+this.getPrefixStrippedValue(n.slice(1),e,t,u,r,i,l,a,o)}if(s.slice(0,t)!==e&&!a)return l&&!s&&n?n:"";if(s.slice(-t)!==e&&a)return l&&!s&&n?n:"";var c=this.stripDelimiters(s,r,i);return n.slice(0,t)!==e&&!a?c.slice(t):n.slice(-t)!==e&&a?c.slice(0,-t-1):a?n.slice(0,-t):n.slice(t)},getFirstDiffIndex:function(n,e){for(var t=0;n.charAt(t)===e.charAt(t);)if(n.charAt(t++)==="")return-1;return t},getFormattedValue:function(n,e,t,s,r,i){var l="",a=r.length>0,o="";return t===0?n:(e.forEach(function(u,c){if(n.length>0){var p=n.slice(0,u),d=n.slice(u);a?o=r[i?c-1:c]||o:o=s,i?(c>0&&(l+=o),l+=p):(l+=p,p.length===u&&c<t-1&&(l+=o)),n=d}}),l)},fixPrefixCursor:function(n,e,t,s){if(n){var r=n.value,i=t||s[0]||" ";if(!(!n.setSelectionRange||!e||e.length+i.length<=r.length)){var l=r.length*2;setTimeout(function(){n.setSelectionRange(l,l)},1)}}},checkFullSelection:function(n){try{var e=window.getSelection()||document.getSelection()||{};return e.toString().length===n.length}catch{}return!1},setSelection:function(n,e,t){if(n===this.getActiveElement(t)&&!(n&&n.value.length<=e))if(n.createTextRange){var s=n.createTextRange();s.move("character",e),s.select()}else try{n.setSelectionRange(e,e)}catch{console.warn("The input element type does not support selection")}},getActiveElement:function(n){var e=n.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(n,e){return!this.isAndroid()||!n||!e?!1:e===n.slice(0,-1)}},Uu=Hu,Bu={assign:function(n,e){return n=n||{},e=e||{},n.creditCard=!!e.creditCard,n.creditCardStrictMode=!!e.creditCardStrictMode,n.creditCardType="",n.onCreditCardTypeChanged=e.onCreditCardTypeChanged||function(){},n.phone=!!e.phone,n.phoneRegionCode=e.phoneRegionCode||"AU",n.phoneFormatter={},n.time=!!e.time,n.timePattern=e.timePattern||["h","m","s"],n.timeFormat=e.timeFormat||"24",n.timeFormatter={},n.date=!!e.date,n.datePattern=e.datePattern||["d","m","Y"],n.dateMin=e.dateMin||"",n.dateMax=e.dateMax||"",n.dateFormatter={},n.numeral=!!e.numeral,n.numeralIntegerScale=e.numeralIntegerScale>0?e.numeralIntegerScale:0,n.numeralDecimalScale=e.numeralDecimalScale>=0?e.numeralDecimalScale:2,n.numeralDecimalMark=e.numeralDecimalMark||".",n.numeralThousandsGroupStyle=e.numeralThousandsGroupStyle||"thousand",n.numeralPositiveOnly=!!e.numeralPositiveOnly,n.stripLeadingZeroes=e.stripLeadingZeroes!==!1,n.signBeforePrefix=!!e.signBeforePrefix,n.tailPrefix=!!e.tailPrefix,n.swapHiddenInput=!!e.swapHiddenInput,n.numericOnly=n.creditCard||n.date||!!e.numericOnly,n.uppercase=!!e.uppercase,n.lowercase=!!e.lowercase,n.prefix=n.creditCard||n.date?"":e.prefix||"",n.noImmediatePrefix=!!e.noImmediatePrefix,n.prefixLength=n.prefix.length,n.rawValueTrimPrefix=!!e.rawValueTrimPrefix,n.copyDelimiter=!!e.copyDelimiter,n.initValue=e.initValue!==void 0&&e.initValue!==null?e.initValue.toString():"",n.delimiter=e.delimiter||e.delimiter===""?e.delimiter:e.date?"/":e.time?":":e.numeral?",":(e.phone," "),n.delimiterLength=n.delimiter.length,n.delimiterLazyShow=!!e.delimiterLazyShow,n.delimiters=e.delimiters||[],n.blocks=e.blocks||[],n.blocksLength=n.blocks.length,n.root=typeof _e=="object"&&_e?_e:window,n.document=e.document||n.root.document,n.maxLength=0,n.backspace=!1,n.result="",n.onValueChanged=e.onValueChanged||function(){},n}},Vu=Bu,de=function(n,e){var t=this,s=!1;if(typeof n=="string"?(t.element=document.querySelector(n),s=document.querySelectorAll(n).length>1):typeof n.length<"u"&&n.length>0?(t.element=n[0],s=n.length>1):t.element=n,!t.element)throw new Error("[cleave.js] Please check the element");if(s)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch{}e.initValue=t.element.value,t.properties=de.DefaultProperties.assign({},e),t.init()};de.prototype={init:function(){var n=this,e=n.properties;if(!e.numeral&&!e.phone&&!e.creditCard&&!e.time&&!e.date&&e.blocksLength===0&&!e.prefix){n.onInput(e.initValue);return}e.maxLength=de.Util.getMaxLength(e.blocks),n.isAndroid=de.Util.isAndroid(),n.lastInputValue="",n.isBackward="",n.onChangeListener=n.onChange.bind(n),n.onKeyDownListener=n.onKeyDown.bind(n),n.onFocusListener=n.onFocus.bind(n),n.onCutListener=n.onCut.bind(n),n.onCopyListener=n.onCopy.bind(n),n.initSwapHiddenInput(),n.element.addEventListener("input",n.onChangeListener),n.element.addEventListener("keydown",n.onKeyDownListener),n.element.addEventListener("focus",n.onFocusListener),n.element.addEventListener("cut",n.onCutListener),n.element.addEventListener("copy",n.onCopyListener),n.initPhoneFormatter(),n.initDateFormatter(),n.initTimeFormatter(),n.initNumeralFormatter(),(e.initValue||e.prefix&&!e.noImmediatePrefix)&&n.onInput(e.initValue)},initSwapHiddenInput:function(){var n=this,e=n.properties;if(e.swapHiddenInput){var t=n.element.cloneNode(!0);n.element.parentNode.insertBefore(t,n.element),n.elementSwapHidden=n.element,n.elementSwapHidden.type="hidden",n.element=t,n.element.id=""}},initNumeralFormatter:function(){var n=this,e=n.properties;e.numeral&&(e.numeralFormatter=new de.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var n=this,e=n.properties;e.time&&(e.timeFormatter=new de.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=de.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var n=this,e=n.properties;e.date&&(e.dateFormatter=new de.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=de.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var n=this,e=n.properties;if(e.phone)try{e.phoneFormatter=new de.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(n){var e=this,t=n.which||n.keyCode;e.lastInputValue=e.element.value,e.isBackward=t===8},onChange:function(n){var e=this,t=e.properties,s=de.Util;e.isBackward=e.isBackward||n.inputType==="deleteContentBackward";var r=s.getPostDelimiter(e.lastInputValue,t.delimiter,t.delimiters);e.isBackward&&r?t.postDelimiterBackspace=r:t.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var n=this,e=n.properties;n.lastInputValue=n.element.value,e.prefix&&e.noImmediatePrefix&&!n.element.value&&this.onInput(e.prefix),de.Util.fixPrefixCursor(n.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(n){de.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(n),this.onInput(""))},onCopy:function(n){de.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(n)},copyClipboardData:function(n){var e=this,t=e.properties,s=de.Util,r=e.element.value,i="";t.copyDelimiter?i=r:i=s.stripDelimiters(r,t.delimiter,t.delimiters);try{n.clipboardData?n.clipboardData.setData("Text",i):window.clipboardData.setData("Text",i),n.preventDefault()}catch{}},onInput:function(n){var e=this,t=e.properties,s=de.Util,r=s.getPostDelimiter(n,t.delimiter,t.delimiters);if(!t.numeral&&t.postDelimiterBackspace&&!r&&(n=s.headStr(n,n.length-t.postDelimiterBackspace.length)),t.phone){t.prefix&&(!t.noImmediatePrefix||n.length)?t.result=t.prefix+t.phoneFormatter.format(n).slice(t.prefix.length):t.result=t.phoneFormatter.format(n),e.updateValueState();return}if(t.numeral){t.prefix&&t.noImmediatePrefix&&n.length===0?t.result="":t.result=t.numeralFormatter.format(n),e.updateValueState();return}if(t.date&&(n=t.dateFormatter.getValidatedDate(n)),t.time&&(n=t.timeFormatter.getValidatedTime(n)),n=s.stripDelimiters(n,t.delimiter,t.delimiters),n=s.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix),n=t.numericOnly?s.strip(n,/[^\d]/g):n,n=t.uppercase?n.toUpperCase():n,n=t.lowercase?n.toLowerCase():n,t.prefix&&(t.tailPrefix?n=n+t.prefix:n=t.prefix+n,t.blocksLength===0)){t.result=n,e.updateValueState();return}t.creditCard&&e.updateCreditCardPropsByValue(n),n=s.headStr(n,t.maxLength),t.result=s.getFormattedValue(n,t.blocks,t.blocksLength,t.delimiter,t.delimiters,t.delimiterLazyShow),e.updateValueState()},updateCreditCardPropsByValue:function(n){var e=this,t=e.properties,s=de.Util,r;s.headStr(t.result,4)!==s.headStr(n,4)&&(r=de.CreditCardDetector.getInfo(n,t.creditCardStrictMode),t.blocks=r.blocks,t.blocksLength=t.blocks.length,t.maxLength=s.getMaxLength(t.blocks),t.creditCardType!==r.type&&(t.creditCardType=r.type,t.onCreditCardTypeChanged.call(e,t.creditCardType)))},updateValueState:function(){var n=this,e=de.Util,t=n.properties;if(n.element){var s=n.element.selectionEnd,r=n.element.value,i=t.result;if(s=e.getNextCursorPosition(s,r,i,t.delimiter,t.delimiters),n.isAndroid){window.setTimeout(function(){n.element.value=i,e.setSelection(n.element,s,t.document,!1),n.callOnValueChanged()},1);return}n.element.value=i,t.swapHiddenInput&&(n.elementSwapHidden.value=n.getRawValue()),e.setSelection(n.element,s,t.document,!1),n.callOnValueChanged()}},callOnValueChanged:function(){var n=this,e=n.properties;e.onValueChanged.call(n,{target:{name:n.element.name,value:e.result,rawValue:n.getRawValue()}})},setPhoneRegionCode:function(n){var e=this,t=e.properties;t.phoneRegionCode=n,e.initPhoneFormatter(),e.onChange()},setRawValue:function(n){var e=this,t=e.properties;n=n!=null?n.toString():"",t.numeral&&(n=n.replace(".",t.numeralDecimalMark)),t.postDelimiterBackspace=!1,e.element.value=n,e.onInput(n)},getRawValue:function(){var n=this,e=n.properties,t=de.Util,s=n.element.value;return e.rawValueTrimPrefix&&(s=t.getPrefixStrippedValue(s,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),e.numeral?s=e.numeralFormatter.getRawValue(s):s=t.stripDelimiters(s,e.delimiter,e.delimiters),s},getISOFormatDate:function(){var n=this,e=n.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var n=this,e=n.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var n=this;n.element.removeEventListener("input",n.onChangeListener),n.element.removeEventListener("keydown",n.onKeyDownListener),n.element.removeEventListener("focus",n.onFocusListener),n.element.removeEventListener("cut",n.onCutListener),n.element.removeEventListener("copy",n.onCopyListener)},toString:function(){return"[Cleave Object]"}},de.NumeralFormatter=Ir,de.DateFormatter=Du,de.TimeFormatter=Zu,de.PhoneFormatter=Lu,de.CreditCardDetector=zu,de.Util=Uu,de.DefaultProperties=Vu,(typeof _e=="object"&&_e?_e:window).Cleave=de;var Fu=de;/**
|
|
1
|
+
(function(Te,_e){typeof exports=="object"&&typeof module<"u"?_e(exports):typeof define=="function"&&define.amd?define(["exports"],_e):(Te=typeof globalThis<"u"?globalThis:Te||self,_e(Te.AnyChatbot={}))})(this,function(Te){"use strict";var Eu=(Te,_e,Oe)=>{if(!_e.has(Te))throw TypeError("Cannot "+Oe)};var Ri=(Te,_e,Oe)=>(Eu(Te,_e,"read from private field"),Oe?Oe.call(Te):_e.get(Te)),zl=(Te,_e,Oe)=>{if(_e.has(Te))throw TypeError("Cannot add the same private member more than once");_e instanceof WeakSet?_e.add(Te):_e.set(Te,Oe)},sn=(Te,_e,Oe,Ir)=>(Eu(Te,_e,"write to private field"),Ir?Ir.call(Te,Oe):_e.set(Te,Oe),Oe);var Tu,Rt,Zn;var _e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oe=function(n,e,t,s,r,i,l,a,o,u){var c=this;c.numeralDecimalMark=n||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=t>=0?t:2,c.numeralThousandsGroupStyle=s||Oe.groupStyle.thousand,c.numeralPositiveOnly=!!r,c.stripLeadingZeroes=i!==!1,c.prefix=l||l===""?l:"",c.signBeforePrefix=!!a,c.tailPrefix=!!o,c.delimiter=u||u===""?u:",",c.delimiterRE=u?new RegExp("\\"+u,"g"):""};Oe.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Oe.prototype={getRawValue:function(n){return n.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(n){var e=this,t,s,r,i,l="";switch(n=n.replace(/[A-Za-z]/g,"").replace(e.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",e.numeralPositiveOnly?"":"-").replace("M",e.numeralDecimalMark),e.stripLeadingZeroes&&(n=n.replace(/^(-)?0+(?=\d)/,"$1")),s=n.slice(0,1)==="-"?"-":"",typeof e.prefix<"u"?e.signBeforePrefix?r=s+e.prefix:r=e.prefix+s:r=s,i=n,n.indexOf(e.numeralDecimalMark)>=0&&(t=n.split(e.numeralDecimalMark),i=t[0],l=e.numeralDecimalMark+t[1].slice(0,e.numeralDecimalScale)),s==="-"&&(i=i.slice(1)),e.numeralIntegerScale>0&&(i=i.slice(0,e.numeralIntegerScale)),e.numeralThousandsGroupStyle){case Oe.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+e.delimiter);break;case Oe.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+e.delimiter);break;case Oe.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+e.delimiter);break}return e.tailPrefix?s+i.toString()+(e.numeralDecimalScale>0?l.toString():"")+e.prefix:r+i.toString()+(e.numeralDecimalScale>0?l.toString():"")}};var Ir=Oe,Hl=function(n,e,t){var s=this;s.date=[],s.blocks=[],s.datePattern=n,s.dateMin=e.split("-").reverse().map(function(r){return parseInt(r,10)}),s.dateMin.length===2&&s.dateMin.unshift(0),s.dateMax=t.split("-").reverse().map(function(r){return parseInt(r,10)}),s.dateMax.length===2&&s.dateMax.unshift(0),s.initBlocks()};Hl.prototype={initBlocks:function(){var n=this;n.datePattern.forEach(function(e){e==="Y"?n.blocks.push(4):n.blocks.push(2)})},getISOFormatDate:function(){var n=this,e=n.date;return e[2]?e[2]+"-"+n.addLeadingZero(e[1])+"-"+n.addLeadingZero(e[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(n){var e=this,t="";return n=n.replace(/[^\d]/g,""),e.blocks.forEach(function(s,r){if(n.length>0){var i=n.slice(0,s),l=i.slice(0,1),a=n.slice(s);switch(e.datePattern[r]){case"d":i==="00"?i="01":parseInt(l,10)>3?i="0"+l:parseInt(i,10)>31&&(i="31");break;case"m":i==="00"?i="01":parseInt(l,10)>1?i="0"+l:parseInt(i,10)>12&&(i="12");break}t+=i,n=a}}),this.getFixedDateString(t)},getFixedDateString:function(n){var e=this,t=e.datePattern,s=[],r=0,i=0,l=0,a=0,o=0,u=0,c,p,d,g=!1;n.length===4&&t[0].toLowerCase()!=="y"&&t[1].toLowerCase()!=="y"&&(a=t[0]==="d"?0:2,o=2-a,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),s=this.getFixedDate(c,p,0)),n.length===8&&(t.forEach(function(V,te){switch(V){case"d":r=te;break;case"m":i=te;break;default:l=te;break}}),u=l*2,a=r<=l?r*2:r*2+2,o=i<=l?i*2:i*2+2,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+4),10),g=n.slice(u,u+4).length===4,s=this.getFixedDate(c,p,d)),n.length===4&&(t[0]==="y"||t[1]==="y")&&(o=t[0]==="m"?0:2,u=2-o,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),g=n.slice(u,u+2).length===2,s=[0,p,d]),n.length===6&&(t[0]==="Y"||t[1]==="Y")&&(o=t[0]==="m"?0:4,u=2-.5*o,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+4),10),g=n.slice(u,u+4).length===4,s=[0,p,d]),s=e.getRangeFixedDate(s),e.date=s;var _=s.length===0?n:t.reduce(function(V,te){switch(te){case"d":return V+(s[0]===0?"":e.addLeadingZero(s[0]));case"m":return V+(s[1]===0?"":e.addLeadingZero(s[1]));case"y":return V+(g?e.addLeadingZeroForYear(s[2],!1):"");case"Y":return V+(g?e.addLeadingZeroForYear(s[2],!0):"")}},"");return _},getRangeFixedDate:function(n){var e=this,t=e.datePattern,s=e.dateMin||[],r=e.dateMax||[];return!n.length||s.length<3&&r.length<3||t.find(function(i){return i.toLowerCase()==="y"})&&n[2]===0?n:r.length&&(r[2]<n[2]||r[2]===n[2]&&(r[1]<n[1]||r[1]===n[1]&&r[0]<n[0]))?r:s.length&&(s[2]>n[2]||s[2]===n[2]&&(s[1]>n[1]||s[1]===n[1]&&s[0]>n[0]))?s:n},getFixedDate:function(n,e,t){return n=Math.min(n,31),e=Math.min(e,12),t=parseInt(t||0,10),(e<7&&e%2===0||e>8&&e%2===1)&&(n=Math.min(n,e===2?this.isLeapYear(t)?29:28:30)),[n,e,t]},isLeapYear:function(n){return n%4===0&&n%100!==0||n%400===0},addLeadingZero:function(n){return(n<10?"0":"")+n},addLeadingZeroForYear:function(n,e){return e?(n<10?"000":n<100?"00":n<1e3?"0":"")+n:(n<10?"0":"")+n}};var Du=Hl,Ul=function(n,e){var t=this;t.time=[],t.blocks=[],t.timePattern=n,t.timeFormat=e,t.initBlocks()};Ul.prototype={initBlocks:function(){var n=this;n.timePattern.forEach(function(){n.blocks.push(2)})},getISOFormatTime:function(){var n=this,e=n.time;return e[2]?n.addLeadingZero(e[0])+":"+n.addLeadingZero(e[1])+":"+n.addLeadingZero(e[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){var n=this;return String(n.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(n){var e=this,t="";n=n.replace(/[^\d]/g,"");var s=e.getTimeFormatOptions();return e.blocks.forEach(function(r,i){if(n.length>0){var l=n.slice(0,r),a=l.slice(0,1),o=n.slice(r);switch(e.timePattern[i]){case"h":parseInt(a,10)>s.maxHourFirstDigit?l="0"+a:parseInt(l,10)>s.maxHours&&(l=s.maxHours+"");break;case"m":case"s":parseInt(a,10)>s.maxMinutesFirstDigit?l="0"+a:parseInt(l,10)>s.maxMinutes&&(l=s.maxMinutes+"");break}t+=l,n=o}}),this.getFixedTimeString(t)},getFixedTimeString:function(n){var e=this,t=e.timePattern,s=[],r=0,i=0,l=0,a=0,o=0,u=0,c,p,d;return n.length===6&&(t.forEach(function(g,_){switch(g){case"s":r=_*2;break;case"m":i=_*2;break;case"h":l=_*2;break}}),u=l,o=i,a=r,c=parseInt(n.slice(a,a+2),10),p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),s=this.getFixedTime(d,p,c)),n.length===4&&e.timePattern.indexOf("s")<0&&(t.forEach(function(g,_){switch(g){case"m":i=_*2;break;case"h":l=_*2;break}}),u=l,o=i,c=0,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),s=this.getFixedTime(d,p,c)),e.time=s,s.length===0?n:t.reduce(function(g,_){switch(_){case"s":return g+e.addLeadingZero(s[2]);case"m":return g+e.addLeadingZero(s[1]);case"h":return g+e.addLeadingZero(s[0])}},"")},getFixedTime:function(n,e,t){return t=Math.min(parseInt(t||0,10),60),e=Math.min(e,60),n=Math.min(n,60),[n,e,t]},addLeadingZero:function(n){return(n<10?"0":"")+n}};var Zu=Ul,Bl=function(n,e){var t=this;t.delimiter=e||e===""?e:" ",t.delimiterRE=e?new RegExp("\\"+e,"g"):"",t.formatter=n};Bl.prototype={setFormatter:function(n){this.formatter=n},format:function(n){var e=this;e.formatter.clear(),n=n.replace(/[^\d+]/g,""),n=n.replace(/^\+/,"B").replace(/\+/g,"").replace("B","+"),n=n.replace(e.delimiterRE,"");for(var t="",s,r=!1,i=0,l=n.length;i<l;i++)s=e.formatter.inputDigit(n.charAt(i)),/[\s()-]/g.test(s)?(t=s,r=!0):r||(t=s);return t=t.replace(/[()]/g,""),t=t.replace(/[\s-]/g,e.delimiter),t}};var Lu=Bl,ji={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(n){var e=n.reduce(function(t,s){return t+s},0);return n.concat(19-e)},getInfo:function(n,e){var t=ji.blocks,s=ji.re;e=!!e;for(var r in s)if(s[r].test(n)){var i=t[r];return{type:r,blocks:e?this.getStrictBlocks(i):i}}return{type:"unknown",blocks:e?this.getStrictBlocks(t.general):t.general}}},zu=ji,Hu={noop:function(){},strip:function(n,e){return n.replace(e,"")},getPostDelimiter:function(n,e,t){if(t.length===0)return n.slice(-e.length)===e?e:"";var s="";return t.forEach(function(r){n.slice(-r.length)===r&&(s=r)}),s},getDelimiterREByDelimiter:function(n){return new RegExp(n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(n,e,t,s,r){return e.length===n?t.length:n+this.getPositionOffset(n,e,t,s,r)},getPositionOffset:function(n,e,t,s,r){var i,l,a;return i=this.stripDelimiters(e.slice(0,n),s,r),l=this.stripDelimiters(t.slice(0,n),s,r),a=i.length-l.length,a!==0?a/Math.abs(a):0},stripDelimiters:function(n,e,t){var s=this;if(t.length===0){var r=e?s.getDelimiterREByDelimiter(e):"";return n.replace(r,"")}return t.forEach(function(i){i.split("").forEach(function(l){n=n.replace(s.getDelimiterREByDelimiter(l),"")})}),n},headStr:function(n,e){return n.slice(0,e)},getMaxLength:function(n){return n.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(n,e,t,s,r,i,l,a,o){if(t===0)return n;if(n===e&&n!=="")return"";if(o&&n.slice(0,1)=="-"){var u=s.slice(0,1)=="-"?s.slice(1):s;return"-"+this.getPrefixStrippedValue(n.slice(1),e,t,u,r,i,l,a,o)}if(s.slice(0,t)!==e&&!a)return l&&!s&&n?n:"";if(s.slice(-t)!==e&&a)return l&&!s&&n?n:"";var c=this.stripDelimiters(s,r,i);return n.slice(0,t)!==e&&!a?c.slice(t):n.slice(-t)!==e&&a?c.slice(0,-t-1):a?n.slice(0,-t):n.slice(t)},getFirstDiffIndex:function(n,e){for(var t=0;n.charAt(t)===e.charAt(t);)if(n.charAt(t++)==="")return-1;return t},getFormattedValue:function(n,e,t,s,r,i){var l="",a=r.length>0,o="";return t===0?n:(e.forEach(function(u,c){if(n.length>0){var p=n.slice(0,u),d=n.slice(u);a?o=r[i?c-1:c]||o:o=s,i?(c>0&&(l+=o),l+=p):(l+=p,p.length===u&&c<t-1&&(l+=o)),n=d}}),l)},fixPrefixCursor:function(n,e,t,s){if(n){var r=n.value,i=t||s[0]||" ";if(!(!n.setSelectionRange||!e||e.length+i.length<=r.length)){var l=r.length*2;setTimeout(function(){n.setSelectionRange(l,l)},1)}}},checkFullSelection:function(n){try{var e=window.getSelection()||document.getSelection()||{};return e.toString().length===n.length}catch{}return!1},setSelection:function(n,e,t){if(n===this.getActiveElement(t)&&!(n&&n.value.length<=e))if(n.createTextRange){var s=n.createTextRange();s.move("character",e),s.select()}else try{n.setSelectionRange(e,e)}catch{console.warn("The input element type does not support selection")}},getActiveElement:function(n){var e=n.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(n,e){return!this.isAndroid()||!n||!e?!1:e===n.slice(0,-1)}},Uu=Hu,Bu={assign:function(n,e){return n=n||{},e=e||{},n.creditCard=!!e.creditCard,n.creditCardStrictMode=!!e.creditCardStrictMode,n.creditCardType="",n.onCreditCardTypeChanged=e.onCreditCardTypeChanged||function(){},n.phone=!!e.phone,n.phoneRegionCode=e.phoneRegionCode||"AU",n.phoneFormatter={},n.time=!!e.time,n.timePattern=e.timePattern||["h","m","s"],n.timeFormat=e.timeFormat||"24",n.timeFormatter={},n.date=!!e.date,n.datePattern=e.datePattern||["d","m","Y"],n.dateMin=e.dateMin||"",n.dateMax=e.dateMax||"",n.dateFormatter={},n.numeral=!!e.numeral,n.numeralIntegerScale=e.numeralIntegerScale>0?e.numeralIntegerScale:0,n.numeralDecimalScale=e.numeralDecimalScale>=0?e.numeralDecimalScale:2,n.numeralDecimalMark=e.numeralDecimalMark||".",n.numeralThousandsGroupStyle=e.numeralThousandsGroupStyle||"thousand",n.numeralPositiveOnly=!!e.numeralPositiveOnly,n.stripLeadingZeroes=e.stripLeadingZeroes!==!1,n.signBeforePrefix=!!e.signBeforePrefix,n.tailPrefix=!!e.tailPrefix,n.swapHiddenInput=!!e.swapHiddenInput,n.numericOnly=n.creditCard||n.date||!!e.numericOnly,n.uppercase=!!e.uppercase,n.lowercase=!!e.lowercase,n.prefix=n.creditCard||n.date?"":e.prefix||"",n.noImmediatePrefix=!!e.noImmediatePrefix,n.prefixLength=n.prefix.length,n.rawValueTrimPrefix=!!e.rawValueTrimPrefix,n.copyDelimiter=!!e.copyDelimiter,n.initValue=e.initValue!==void 0&&e.initValue!==null?e.initValue.toString():"",n.delimiter=e.delimiter||e.delimiter===""?e.delimiter:e.date?"/":e.time?":":e.numeral?",":(e.phone," "),n.delimiterLength=n.delimiter.length,n.delimiterLazyShow=!!e.delimiterLazyShow,n.delimiters=e.delimiters||[],n.blocks=e.blocks||[],n.blocksLength=n.blocks.length,n.root=typeof _e=="object"&&_e?_e:window,n.document=e.document||n.root.document,n.maxLength=0,n.backspace=!1,n.result="",n.onValueChanged=e.onValueChanged||function(){},n}},Vu=Bu,de=function(n,e){var t=this,s=!1;if(typeof n=="string"?(t.element=document.querySelector(n),s=document.querySelectorAll(n).length>1):typeof n.length<"u"&&n.length>0?(t.element=n[0],s=n.length>1):t.element=n,!t.element)throw new Error("[cleave.js] Please check the element");if(s)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch{}e.initValue=t.element.value,t.properties=de.DefaultProperties.assign({},e),t.init()};de.prototype={init:function(){var n=this,e=n.properties;if(!e.numeral&&!e.phone&&!e.creditCard&&!e.time&&!e.date&&e.blocksLength===0&&!e.prefix){n.onInput(e.initValue);return}e.maxLength=de.Util.getMaxLength(e.blocks),n.isAndroid=de.Util.isAndroid(),n.lastInputValue="",n.isBackward="",n.onChangeListener=n.onChange.bind(n),n.onKeyDownListener=n.onKeyDown.bind(n),n.onFocusListener=n.onFocus.bind(n),n.onCutListener=n.onCut.bind(n),n.onCopyListener=n.onCopy.bind(n),n.initSwapHiddenInput(),n.element.addEventListener("input",n.onChangeListener),n.element.addEventListener("keydown",n.onKeyDownListener),n.element.addEventListener("focus",n.onFocusListener),n.element.addEventListener("cut",n.onCutListener),n.element.addEventListener("copy",n.onCopyListener),n.initPhoneFormatter(),n.initDateFormatter(),n.initTimeFormatter(),n.initNumeralFormatter(),(e.initValue||e.prefix&&!e.noImmediatePrefix)&&n.onInput(e.initValue)},initSwapHiddenInput:function(){var n=this,e=n.properties;if(e.swapHiddenInput){var t=n.element.cloneNode(!0);n.element.parentNode.insertBefore(t,n.element),n.elementSwapHidden=n.element,n.elementSwapHidden.type="hidden",n.element=t,n.element.id=""}},initNumeralFormatter:function(){var n=this,e=n.properties;e.numeral&&(e.numeralFormatter=new de.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var n=this,e=n.properties;e.time&&(e.timeFormatter=new de.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=de.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var n=this,e=n.properties;e.date&&(e.dateFormatter=new de.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=de.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var n=this,e=n.properties;if(e.phone)try{e.phoneFormatter=new de.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(n){var e=this,t=n.which||n.keyCode;e.lastInputValue=e.element.value,e.isBackward=t===8},onChange:function(n){var e=this,t=e.properties,s=de.Util;e.isBackward=e.isBackward||n.inputType==="deleteContentBackward";var r=s.getPostDelimiter(e.lastInputValue,t.delimiter,t.delimiters);e.isBackward&&r?t.postDelimiterBackspace=r:t.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var n=this,e=n.properties;n.lastInputValue=n.element.value,e.prefix&&e.noImmediatePrefix&&!n.element.value&&this.onInput(e.prefix),de.Util.fixPrefixCursor(n.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(n){de.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(n),this.onInput(""))},onCopy:function(n){de.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(n)},copyClipboardData:function(n){var e=this,t=e.properties,s=de.Util,r=e.element.value,i="";t.copyDelimiter?i=r:i=s.stripDelimiters(r,t.delimiter,t.delimiters);try{n.clipboardData?n.clipboardData.setData("Text",i):window.clipboardData.setData("Text",i),n.preventDefault()}catch{}},onInput:function(n){var e=this,t=e.properties,s=de.Util,r=s.getPostDelimiter(n,t.delimiter,t.delimiters);if(!t.numeral&&t.postDelimiterBackspace&&!r&&(n=s.headStr(n,n.length-t.postDelimiterBackspace.length)),t.phone){t.prefix&&(!t.noImmediatePrefix||n.length)?t.result=t.prefix+t.phoneFormatter.format(n).slice(t.prefix.length):t.result=t.phoneFormatter.format(n),e.updateValueState();return}if(t.numeral){t.prefix&&t.noImmediatePrefix&&n.length===0?t.result="":t.result=t.numeralFormatter.format(n),e.updateValueState();return}if(t.date&&(n=t.dateFormatter.getValidatedDate(n)),t.time&&(n=t.timeFormatter.getValidatedTime(n)),n=s.stripDelimiters(n,t.delimiter,t.delimiters),n=s.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix),n=t.numericOnly?s.strip(n,/[^\d]/g):n,n=t.uppercase?n.toUpperCase():n,n=t.lowercase?n.toLowerCase():n,t.prefix&&(t.tailPrefix?n=n+t.prefix:n=t.prefix+n,t.blocksLength===0)){t.result=n,e.updateValueState();return}t.creditCard&&e.updateCreditCardPropsByValue(n),n=s.headStr(n,t.maxLength),t.result=s.getFormattedValue(n,t.blocks,t.blocksLength,t.delimiter,t.delimiters,t.delimiterLazyShow),e.updateValueState()},updateCreditCardPropsByValue:function(n){var e=this,t=e.properties,s=de.Util,r;s.headStr(t.result,4)!==s.headStr(n,4)&&(r=de.CreditCardDetector.getInfo(n,t.creditCardStrictMode),t.blocks=r.blocks,t.blocksLength=t.blocks.length,t.maxLength=s.getMaxLength(t.blocks),t.creditCardType!==r.type&&(t.creditCardType=r.type,t.onCreditCardTypeChanged.call(e,t.creditCardType)))},updateValueState:function(){var n=this,e=de.Util,t=n.properties;if(n.element){var s=n.element.selectionEnd,r=n.element.value,i=t.result;if(s=e.getNextCursorPosition(s,r,i,t.delimiter,t.delimiters),n.isAndroid){window.setTimeout(function(){n.element.value=i,e.setSelection(n.element,s,t.document,!1),n.callOnValueChanged()},1);return}n.element.value=i,t.swapHiddenInput&&(n.elementSwapHidden.value=n.getRawValue()),e.setSelection(n.element,s,t.document,!1),n.callOnValueChanged()}},callOnValueChanged:function(){var n=this,e=n.properties;e.onValueChanged.call(n,{target:{name:n.element.name,value:e.result,rawValue:n.getRawValue()}})},setPhoneRegionCode:function(n){var e=this,t=e.properties;t.phoneRegionCode=n,e.initPhoneFormatter(),e.onChange()},setRawValue:function(n){var e=this,t=e.properties;n=n!=null?n.toString():"",t.numeral&&(n=n.replace(".",t.numeralDecimalMark)),t.postDelimiterBackspace=!1,e.element.value=n,e.onInput(n)},getRawValue:function(){var n=this,e=n.properties,t=de.Util,s=n.element.value;return e.rawValueTrimPrefix&&(s=t.getPrefixStrippedValue(s,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),e.numeral?s=e.numeralFormatter.getRawValue(s):s=t.stripDelimiters(s,e.delimiter,e.delimiters),s},getISOFormatDate:function(){var n=this,e=n.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var n=this,e=n.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var n=this;n.element.removeEventListener("input",n.onChangeListener),n.element.removeEventListener("keydown",n.onKeyDownListener),n.element.removeEventListener("focus",n.onFocusListener),n.element.removeEventListener("cut",n.onCutListener),n.element.removeEventListener("copy",n.onCopyListener)},toString:function(){return"[Cleave Object]"}},de.NumeralFormatter=Ir,de.DateFormatter=Du,de.TimeFormatter=Zu,de.PhoneFormatter=Lu,de.CreditCardDetector=zu,de.Util=Uu,de.DefaultProperties=Vu,(typeof _e=="object"&&_e?_e:window).Cleave=de;var Fu=de;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright 2021 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
|
-
*/function kc(n,e,t){return n?e(n):t==null?void 0:t(n)}var ne;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const i={};for(const l of r)i[l]=l;return i},n.getValidEnumValues=r=>{const i=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of i)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(i){return r[i]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const i=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&i.push(l);return i},n.find=(r,i)=>{for(const l of r)if(i(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function s(r,i=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}n.joinValues=s,n.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(ne||(ne={}));var Ki;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ki||(Ki={}));const S=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ut=n=>{switch(typeof n){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(n)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(n)?S.array:n===null?S.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?S.promise:typeof Map<"u"&&n instanceof Map?S.map:typeof Set<"u"&&n instanceof Set?S.set:typeof Date<"u"&&n instanceof Date?S.date:S.object;default:return S.unknown}},b=ne.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"]),Ac=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Ke extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(i){return i.message},s={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let a=s,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return r(this),s}static assert(e){if(!(e instanceof Ke))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}Ke.create=n=>new Ke(n);const Vn=(n,e)=>{let t;switch(n.code){case b.invalid_type:n.received===S.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case b.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ne.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:t=`Unrecognized key(s) in object: ${ne.joinValues(n.keys,", ")}`;break;case b.invalid_union:t="Invalid input";break;case b.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ne.joinValues(n.options)}`;break;case b.invalid_enum_value:t=`Invalid enum value. Expected ${ne.joinValues(n.options)}, received '${n.received}'`;break;case b.invalid_arguments:t="Invalid function arguments";break;case b.invalid_return_type:t="Invalid function return type";break;case b.invalid_date:t="Invalid date";break;case b.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ne.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case b.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case b.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case b.custom:t="Invalid input";break;case b.invalid_intersection_types:t="Intersection results could not be merged";break;case b.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case b.not_finite:t="Number must be finite";break;default:t=e.defaultError,ne.assertNever(n)}return{message:t}};let wa=Vn;function Sc(n){wa=n}function Lr(){return wa}const zr=n=>{const{data:e,path:t,errorMaps:s,issueData:r}=n,i=[...t,...r.path||[]],l={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="";const o=s.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:i,message:a}},Tc=[];function $(n,e){const t=Lr(),s=zr({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Vn?void 0:Vn].filter(r=>!!r)});n.common.issues.push(s)}class Le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const r of t){if(r.status==="aborted")return B;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const r of t){const i=await r.key,l=await r.value;s.push({key:i,value:l})}return Le.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const r of t){const{key:i,value:l}=r;if(i.status==="aborted"||l.status==="aborted")return B;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[i.value]=l.value)}return{status:e.value,value:s}}}const B=Object.freeze({status:"aborted"}),Fn=n=>({status:"dirty",value:n}),Ue=n=>({status:"valid",value:n}),Yi=n=>n.status==="aborted",Ji=n=>n.status==="dirty",$s=n=>n.status==="valid",ks=n=>typeof Promise<"u"&&n instanceof Promise;function Hr(n,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(n):s?s.value:e.get(n)}function xa(n,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var P;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(P||(P={}));var As,Ss;class vt{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}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}}const $a=(n,e)=>{if($s(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ke(n.common.issues);return this._error=t,this._error}}};function K(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,a)=>{var o,u;const{message:c}=n;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(o=c??s)!==null&&o!==void 0?o:a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??t)!==null&&u!==void 0?u:a.defaultError}},description:r}}class G{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 Ut(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Le,ctx:{common:e.parent.common,data:e.data,parsedType:Ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ks(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const r={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ut(e)},i=this._parseSync({data:e,path:r.path,parent:r});return $a(r,i)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ut(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(ks(r)?r:Promise.resolve(r));return $a(s,i)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const l=e(r),a=()=>i.addIssue({code:b.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new rt({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return _t.create(this,this._def)}nullable(){return Wt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return st.create(this,this._def)}promise(){return Yn.create(this,this._def)}or(e){return Is.create([this,e],this._def)}and(e){return Os.create(this,e,this._def)}transform(e){return new rt({...K(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new js({...K(this._def),innerType:this,defaultValue:t,typeName:z.ZodDefault})}brand(){return new Xi({typeName:z.ZodBranded,type:this,...K(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ds({...K(this._def),innerType:this,catchValue:t,typeName:z.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Zs.create(this,e)}readonly(){return Ls.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Cc=/^c[^\s-]{8,}$/i,Ec=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Z]{26}$/,Oc=/^[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,Mc=/^[a-z0-9_-]{21}$/i,Nc=/^[-+]?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)?)??$/,Pc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Gi;const jc=/^(?:(?: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])$/,Dc=/^(([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})))$/,Zc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ka="((\\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])))",Lc=new RegExp(`^${ka}$`);function Aa(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function zc(n){return new RegExp(`^${Aa(n)}$`)}function Sa(n){let e=`${ka}T${Aa(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Hc(n,e){return!!((e==="v4"||!e)&&jc.test(n)||(e==="v6"||!e)&&Dc.test(n))}class nt extends G{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.string,received:i.parsedType}),B}const s=new Le;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,a=e.data.length<i.value;(l||a)&&(r=this._getOrReturnCtx(e,r),l?$(r,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&$(r,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")Pc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"email",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")Gi||(Gi=new RegExp(Rc,"u")),Gi.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"emoji",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Oc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"uuid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")Mc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"nanoid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Cc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Ec.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid2",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Ic.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ulid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),$(r,{validation:"url",code:b.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"regex",code:b.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Sa(i).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?Lc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?zc(i).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?Nc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"duration",code:b.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?Hc(e.data,i.version)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ip",code:b.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Zc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"base64",code:b.invalid_string,message:i.message}),s.dirty()):ne.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:b.invalid_string,...P.errToObj(s)})}_addCheck(e){return new nt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...P.errToObj(e)})}url(e){return this._addCheck({kind:"url",...P.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...P.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...P.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...P.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...P.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...P.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...P.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...P.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...P.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...P.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...P.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...P.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...P.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...P.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...P.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...P.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...P.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...P.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...P.errToObj(t)})}nonempty(e){return this.min(1,P.errToObj(e))}trim(){return new nt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}nt.create=n=>{var e;return new nt({checks:[],typeName:z.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...K(n)})};function Uc(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,i=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return i%l/Math.pow(10,r)}class Bt extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.number,received:i.parsedType}),B}let s;const r=new Le;for(const i of this._def.checks)i.kind==="int"?ne.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:b.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?Uc(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_finite,message:i.message}),r.dirty()):ne.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,s,r){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:P.toString(r)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:P.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:P.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Bt.create=n=>new Bt({checks:[],typeName:z.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...K(n)});class Vt extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==S.bigint){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.bigint,received:i.parsedType}),B}let s;const r=new Le;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):ne.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,s,r){return new Vt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:P.toString(r)}]})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Vt.create=n=>{var e;return new Vt({checks:[],typeName:z.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...K(n)})};class Ts extends G{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.boolean,received:s.parsedType}),B}return Ue(e.data)}}Ts.create=n=>new Ts({typeName:z.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...K(n)});class dn extends G{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.date,received:i.parsedType}),B}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_date}),B}const s=new Le;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):ne.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new dn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:P.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:P.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}dn.create=n=>new dn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:z.ZodDate,...K(n)});class Ur extends G{_parse(e){if(this._getType(e)!==S.symbol){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.symbol,received:s.parsedType}),B}return Ue(e.data)}}Ur.create=n=>new Ur({typeName:z.ZodSymbol,...K(n)});class Cs extends G{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.undefined,received:s.parsedType}),B}return Ue(e.data)}}Cs.create=n=>new Cs({typeName:z.ZodUndefined,...K(n)});class Es extends G{_parse(e){if(this._getType(e)!==S.null){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.null,received:s.parsedType}),B}return Ue(e.data)}}Es.create=n=>new Es({typeName:z.ZodNull,...K(n)});class Wn extends G{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}Wn.create=n=>new Wn({typeName:z.ZodAny,...K(n)});class hn extends G{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}hn.create=n=>new hn({typeName:z.ZodUnknown,...K(n)});class Tt extends G{_parse(e){const t=this._getOrReturnCtx(e);return $(t,{code:b.invalid_type,expected:S.never,received:t.parsedType}),B}}Tt.create=n=>new Tt({typeName:z.ZodNever,...K(n)});class Br extends G{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.void,received:s.parsedType}),B}return Ue(e.data)}}Br.create=n=>new Br({typeName:z.ZodVoid,...K(n)});class st extends G{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==S.array)return $(t,{code:b.invalid_type,expected:S.array,received:t.parsedType}),B;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&($(t,{code:l?b.too_big:b.too_small,minimum:a?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&($(t,{code:b.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&($(t,{code:b.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new vt(t,l,t.path,a)))).then(l=>Le.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new vt(t,l,t.path,a)));return Le.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new st({...this._def,minLength:{value:e,message:P.toString(t)}})}max(e,t){return new st({...this._def,maxLength:{value:e,message:P.toString(t)}})}length(e,t){return new st({...this._def,exactLength:{value:e,message:P.toString(t)}})}nonempty(e){return this.min(1,e)}}st.create=(n,e)=>new st({type:n,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...K(e)});function qn(n){if(n instanceof we){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=_t.create(qn(s))}return new we({...n._def,shape:()=>e})}else return n instanceof st?new st({...n._def,type:qn(n.element)}):n instanceof _t?_t.create(qn(n.unwrap())):n instanceof Wt?Wt.create(qn(n.unwrap())):n instanceof bt?bt.create(n.items.map(e=>qn(e))):n}class we extends G{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ne.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==S.object){const u=this._getOrReturnCtx(e);return $(u,{code:b.invalid_type,expected:S.object,received:u.parsedType}),B}const{status:s,ctx:r}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Tt&&this._def.unknownKeys==="strip"))for(const u in r.data)l.includes(u)||a.push(u);const o=[];for(const u of l){const c=i[u],p=r.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new vt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Tt){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)o.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(u==="strict")a.length>0&&($(r,{code:b.unrecognized_keys,keys:a}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const p=r.data[c];o.push({key:{status:"valid",value:c},value:u._parse(new vt(r,p,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of o){const p=await c.key,d=await c.value;u.push({key:p,value:d,alwaysSet:c.alwaysSet})}return u}).then(u=>Le.mergeObjectSync(s,u)):Le.mergeObjectSync(s,o)}get shape(){return this._def.shape()}strict(e){return P.errToObj,new we({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var r,i,l,a;const o=(l=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,s).message)!==null&&l!==void 0?l:s.defaultError;return t.code==="unrecognized_keys"?{message:(a=P.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new we({...this._def,unknownKeys:"strip"})}passthrough(){return new we({...this._def,unknownKeys:"passthrough"})}extend(e){return new we({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new we({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new we({...this._def,catchall:e})}pick(e){const t={};return ne.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new we({...this._def,shape:()=>t})}omit(e){const t={};return ne.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new we({...this._def,shape:()=>t})}deepPartial(){return qn(this)}partial(e){const t={};return ne.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new we({...this._def,shape:()=>t})}required(e){const t={};return ne.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof _t;)i=i._def.innerType;t[s]=i}}),new we({...this._def,shape:()=>t})}keyof(){return Ta(ne.objectKeys(this.shape))}}we.create=(n,e)=>new we({shape:()=>n,unknownKeys:"strip",catchall:Tt.create(),typeName:z.ZodObject,...K(e)}),we.strictCreate=(n,e)=>new we({shape:()=>n,unknownKeys:"strict",catchall:Tt.create(),typeName:z.ZodObject,...K(e)}),we.lazycreate=(n,e)=>new we({shape:n,unknownKeys:"strip",catchall:Tt.create(),typeName:z.ZodObject,...K(e)});class Is extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new Ke(a.ctx.common.issues));return $(t,{code:b.invalid_union,unionErrors:l}),B}if(t.common.async)return Promise.all(s.map(async i=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let i;const l=[];for(const o of s){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(o=>new Ke(o));return $(t,{code:b.invalid_union,unionErrors:a}),B}}get options(){return this._def.options}}Is.create=(n,e)=>new Is({options:n,typeName:z.ZodUnion,...K(e)});const Ct=n=>n instanceof Ns?Ct(n.schema):n instanceof rt?Ct(n.innerType()):n instanceof Ps?[n.value]:n instanceof Ft?n.options:n instanceof Rs?ne.objectValues(n.enum):n instanceof js?Ct(n._def.innerType):n instanceof Cs?[void 0]:n instanceof Es?[null]:n instanceof _t?[void 0,...Ct(n.unwrap())]:n instanceof Wt?[null,...Ct(n.unwrap())]:n instanceof Xi||n instanceof Ls?Ct(n.unwrap()):n instanceof Ds?Ct(n._def.innerType):[];class Vr extends G{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return $(t,{code:b.invalid_type,expected:S.object,received:t.parsedType}),B;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const i of t){const l=Ct(i.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,i)}}return new Vr({typeName:z.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...K(s)})}}function Qi(n,e){const t=Ut(n),s=Ut(e);if(n===e)return{valid:!0,data:n};if(t===S.object&&s===S.object){const r=ne.objectKeys(e),i=ne.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=Qi(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===S.array&&s===S.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<n.length;i++){const l=n[i],a=e[i],o=Qi(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===S.date&&s===S.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Os extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(Yi(i)||Yi(l))return B;const a=Qi(i.value,l.value);return a.valid?((Ji(i)||Ji(l))&&t.dirty(),{status:t.value,value:a.data}):($(s,{code:b.invalid_intersection_types}),B)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,l])=>r(i,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Os.create=(n,e,t)=>new Os({left:n,right:e,typeName:z.ZodIntersection,...K(t)});class bt extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.array)return $(s,{code:b.invalid_type,expected:S.array,received:s.parsedType}),B;if(s.data.length<this._def.items.length)return $(s,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&s.data.length>this._def.items.length&&($(s,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map((l,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new vt(s,l,s.path,a)):null}).filter(l=>!!l);return s.common.async?Promise.all(i).then(l=>Le.mergeArray(t,l)):Le.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new bt({...this._def,rest:e})}}bt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bt({items:n,typeName:z.ZodTuple,rest:null,...K(e)})};class Ms extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.object)return $(s,{code:b.invalid_type,expected:S.object,received:s.parsedType}),B;const r=[],i=this._def.keyType,l=this._def.valueType;for(const a in s.data)r.push({key:i._parse(new vt(s,a,s.path,a)),value:l._parse(new vt(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Le.mergeObjectAsync(t,r):Le.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof G?new Ms({keyType:e,valueType:t,typeName:z.ZodRecord,...K(s)}):new Ms({keyType:nt.create(),valueType:e,typeName:z.ZodRecord,...K(t)})}}class Fr extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.map)return $(s,{code:b.invalid_type,expected:S.map,received:s.parsedType}),B;const r=this._def.keyType,i=this._def.valueType,l=[...s.data.entries()].map(([a,o],u)=>({key:r._parse(new vt(s,a,s.path,[u,"key"])),value:i._parse(new vt(s,o,s.path,[u,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return B;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return B;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}Fr.create=(n,e,t)=>new Fr({valueType:e,keyType:n,typeName:z.ZodMap,...K(t)});class pn extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.set)return $(s,{code:b.invalid_type,expected:S.set,received:s.parsedType}),B;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&($(s,{code:b.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&($(s,{code:b.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return B;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...s.data.values()].map((o,u)=>i._parse(new vt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new pn({...this._def,minSize:{value:e,message:P.toString(t)}})}max(e,t){return new pn({...this._def,maxSize:{value:e,message:P.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}pn.create=(n,e)=>new pn({valueType:n,minSize:null,maxSize:null,typeName:z.ZodSet,...K(e)});class Kn extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return $(t,{code:b.invalid_type,expected:S.function,received:t.parsedType}),B;function s(a,o){return zr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lr(),Vn].filter(u=>!!u),issueData:{code:b.invalid_arguments,argumentsError:o}})}function r(a,o){return zr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lr(),Vn].filter(u=>!!u),issueData:{code:b.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Yn){const a=this;return Ue(async function(...o){const u=new Ke([]),c=await a._def.args.parseAsync(o,i).catch(g=>{throw u.addIssue(s(o,g)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,i).catch(g=>{throw u.addIssue(r(p,g)),u})})}else{const a=this;return Ue(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new Ke([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new Ke([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Kn({...this._def,args:bt.create(e).rest(hn.create())})}returns(e){return new Kn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Kn({args:e||bt.create([]).rest(hn.create()),returns:t||hn.create(),typeName:z.ZodFunction,...K(s)})}}class Ns extends G{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ns.create=(n,e)=>new Ns({getter:n,typeName:z.ZodLazy,...K(e)});class Ps extends G{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:b.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ps.create=(n,e)=>new Ps({value:n,typeName:z.ZodLiteral,...K(e)});function Ta(n,e){return new Ft({values:n,typeName:z.ZodEnum,...K(e)})}class Ft extends G{constructor(){super(...arguments),As.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return $(t,{expected:ne.joinValues(s),received:t.parsedType,code:b.invalid_type}),B}if(Hr(this,As,"f")||xa(this,As,new Set(this._def.values),"f"),!Hr(this,As,"f").has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return $(t,{received:t.data,code:b.invalid_enum_value,options:s}),B}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ft.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ft.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}As=new WeakMap,Ft.create=Ta;class Rs extends G{constructor(){super(...arguments),Ss.set(this,void 0)}_parse(e){const t=ne.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==S.string&&s.parsedType!==S.number){const r=ne.objectValues(t);return $(s,{expected:ne.joinValues(r),received:s.parsedType,code:b.invalid_type}),B}if(Hr(this,Ss,"f")||xa(this,Ss,new Set(ne.getValidEnumValues(this._def.values)),"f"),!Hr(this,Ss,"f").has(e.data)){const r=ne.objectValues(t);return $(s,{received:s.data,code:b.invalid_enum_value,options:r}),B}return Ue(e.data)}get enum(){return this._def.values}}Ss=new WeakMap,Rs.create=(n,e)=>new Rs({values:n,typeName:z.ZodNativeEnum,...K(e)});class Yn extends G{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return $(t,{code:b.invalid_type,expected:S.promise,received:t.parsedType}),B;const s=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return Ue(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yn.create=(n,e)=>new Yn({type:n,typeName:z.ZodPromise,...K(e)});class rt extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:l=>{$(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const l=r.transform(s.data,i);if(s.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return B;const o=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return o.status==="aborted"?B:o.status==="dirty"||t.value==="dirty"?Fn(o.value):o});{if(t.value==="aborted")return B;const a=this._def.schema._parseSync({data:l,path:s.path,parent:s});return a.status==="aborted"?B:a.status==="dirty"||t.value==="dirty"?Fn(a.value):a}}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,i);if(s.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?B:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?B:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!$s(l))return l;const a=r.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>$s(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);ne.assertNever(r)}}rt.create=(n,e,t)=>new rt({schema:n,typeName:z.ZodEffects,effect:e,...K(t)}),rt.createWithPreprocess=(n,e,t)=>new rt({schema:e,effect:{type:"preprocess",transform:n},typeName:z.ZodEffects,...K(t)});class _t extends G{_parse(e){return this._getType(e)===S.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_t.create=(n,e)=>new _t({innerType:n,typeName:z.ZodOptional,...K(e)});class Wt extends G{_parse(e){return this._getType(e)===S.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wt.create=(n,e)=>new Wt({innerType:n,typeName:z.ZodNullable,...K(e)});class js extends G{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===S.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}js.create=(n,e)=>new js({innerType:n,typeName:z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class Ds extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ks(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ke(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ke(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ds.create=(n,e)=>new Ds({innerType:n,typeName:z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Wr extends G{_parse(e){if(this._getType(e)!==S.nan){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.nan,received:s.parsedType}),B}return{status:"valid",value:e.data}}}Wr.create=n=>new Wr({typeName:z.ZodNaN,...K(n)});const Bc=Symbol("zod_brand");class Xi extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Zs extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?B:i.status==="dirty"?(t.dirty(),Fn(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?B:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new Zs({in:e,out:t,typeName:z.ZodPipeline})}}class Ls extends G{_parse(e){const t=this._def.innerType._parse(e),s=r=>($s(r)&&(r.value=Object.freeze(r.value)),r);return ks(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}}Ls.create=(n,e)=>new Ls({innerType:n,typeName:z.ZodReadonly,...K(e)});function Ca(n,e={},t){return n?Wn.create().superRefine((s,r)=>{var i,l;if(!n(s)){const a=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,o=(l=(i=a.fatal)!==null&&i!==void 0?i:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):Wn.create()}const Vc={object:we.lazycreate};var z;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(z||(z={}));const Fc=(n,e={message:`Input not instance of ${n.name}`})=>Ca(t=>t instanceof n,e),Ea=nt.create,Ia=Bt.create,Wc=Wr.create,qc=Vt.create,Oa=Ts.create,Kc=dn.create,Yc=Ur.create,Jc=Cs.create,Gc=Es.create,Qc=Wn.create,Xc=hn.create,ed=Tt.create,td=Br.create,nd=st.create,sd=we.create,rd=we.strictCreate,id=Is.create,ld=Vr.create,ad=Os.create,od=bt.create,ud=Ms.create,cd=Fr.create,dd=pn.create,hd=Kn.create,pd=Ns.create,fd=Ps.create,md=Ft.create,gd=Rs.create,yd=Yn.create,Ma=rt.create,vd=_t.create,bd=Wt.create,_d=rt.createWithPreprocess,wd=Zs.create;var zs=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:Sc,getErrorMap:Lr,makeIssue:zr,EMPTY_PATH:Tc,addIssueToContext:$,ParseStatus:Le,INVALID:B,DIRTY:Fn,OK:Ue,isAborted:Yi,isDirty:Ji,isValid:$s,isAsync:ks,get util(){return ne},get objectUtil(){return Ki},ZodParsedType:S,getParsedType:Ut,ZodType:G,datetimeRegex:Sa,ZodString:nt,ZodNumber:Bt,ZodBigInt:Vt,ZodBoolean:Ts,ZodDate:dn,ZodSymbol:Ur,ZodUndefined:Cs,ZodNull:Es,ZodAny:Wn,ZodUnknown:hn,ZodNever:Tt,ZodVoid:Br,ZodArray:st,ZodObject:we,ZodUnion:Is,ZodDiscriminatedUnion:Vr,ZodIntersection:Os,ZodTuple:bt,ZodRecord:Ms,ZodMap:Fr,ZodSet:pn,ZodFunction:Kn,ZodLazy:Ns,ZodLiteral:Ps,ZodEnum:Ft,ZodNativeEnum:Rs,ZodPromise:Yn,ZodEffects:rt,ZodTransformer:rt,ZodOptional:_t,ZodNullable:Wt,ZodDefault:js,ZodCatch:Ds,ZodNaN:Wr,BRAND:Bc,ZodBranded:Xi,ZodPipeline:Zs,ZodReadonly:Ls,custom:Ca,Schema:G,ZodSchema:G,late:Vc,get ZodFirstPartyTypeKind(){return z},coerce:{string:n=>nt.create({...n,coerce:!0}),number:n=>Bt.create({...n,coerce:!0}),boolean:n=>Ts.create({...n,coerce:!0}),bigint:n=>Vt.create({...n,coerce:!0}),date:n=>dn.create({...n,coerce:!0})},any:Qc,array:nd,bigint:qc,boolean:Oa,date:Kc,discriminatedUnion:ld,effect:Ma,enum:md,function:hd,instanceof:Fc,intersection:ad,lazy:pd,literal:fd,map:cd,nan:Wc,nativeEnum:gd,never:ed,null:Gc,nullable:bd,number:Ia,object:sd,oboolean:()=>Oa().optional(),onumber:()=>Ia().optional(),optional:vd,ostring:()=>Ea().optional(),pipeline:wd,preprocess:_d,promise:yd,record:ud,set:dd,strictObject:rd,string:Ea,symbol:Yc,transformer:Ma,tuple:od,undefined:Jc,union:id,unknown:Xc,void:td,NEVER:B,ZodIssueCode:b,quotelessJson:Ac,ZodError:Ke});const Na=qu`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.relative{position:relative}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;border-width:1px;padding:.5rem .75rem;line-height:1.25;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}label{margin-bottom:.5rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{opacity:.95}.btn-primary:disabled{pointer-events:none;opacity:.5}.btn-primary{background-color:var(--iai-chat-i-button-bg);color:var(--iai-chat-i-button-fg)}.btn-secondary{padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-secondary:hover{opacity:.95}.btn-secondary:disabled{pointer-events:none;opacity:.5}`;var el=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){function n(h,f){var m=h.split("."),v=St;m[0]in v||!v.execScript||v.execScript("var "+m[0]);for(var M;m.length&&(M=m.shift());)m.length||f===void 0?v=v[M]?v[M]:v[M]={}:v[M]=f}function e(h,f){function m(){}m.prototype=f.prototype,h.M=f.prototype,h.prototype=new m,h.prototype.constructor=h,h.N=function(v,M,D){for(var ue=Array(arguments.length-2),Se=2;Se<arguments.length;Se++)ue[Se-2]=arguments[Se];return f.prototype[M].apply(v,ue)}}function t(h,f){h!=null&&this.a.apply(this,arguments)}function s(h){h.b=""}function r(h,f){h.sort(f||i)}function i(h,f){return h>f?1:h<f?-1:0}function l(h){var f,m=[],v=0;for(f in h)m[v++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var v=f[m];this.a[v.b]=v}}function o(h){return h=l(h.a),r(h,function(f,m){return f.b-m.b}),h}function u(h,f){switch(this.b=h,this.g=!!f.v,this.a=f.c,this.i=f.type,this.h=!1,this.a){case Xe:case Ie:case et:case ht:case nn:case jt:case dt:this.h=!0}this.f=f.defaultValue}function c(){this.a={},this.f=this.j().a,this.b=this.g=null}function p(h,f){for(var m=o(h.j()),v=0;v<m.length;v++){var M=m[v],D=M.b;if(f.a[D]!=null){h.b&&delete h.b[M.b];var ue=M.a==11||M.a==10;if(M.g)for(var M=d(f,D)||[],Se=0;Se<M.length;Se++){var je=h,gt=D,Er=ue?M[Se].clone():M[Se];je.a[gt]||(je.a[gt]=[]),je.a[gt].push(Er),je.b&&delete je.b[gt]}else M=d(f,D),ue?(ue=d(h,D))?p(ue,M):se(h,D,M.clone()):se(h,D,M)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var v=h.g,M=h.f[f];if(m!=null)if(M.g){for(var D=[],ue=0;ue<m.length;ue++)D[ue]=v.b(M,m[ue]);m=D}else m=v.b(M,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var v=d(h,f);return h.f[f].g?v[m||0]:v}function _(h,f){var m;if(h.a[f]!=null)m=g(h,f,void 0);else e:{if(m=h.f[f],m.f===void 0){var v=m.i;if(v===Boolean)m.f=!1;else if(v===Number)m.f=0;else{if(v!==String){m=new v;break e}m.f=m.h?"0":""}}m=m.f}return m}function W(h,f){return h.f[f].g?h.a[f]!=null?h.a[f].length:0:h.a[f]!=null?1:0}function se(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function He(h,f){var m,v=[];for(m in f)m!=0&&v.push(new u(m,f[m]));return new a(h,v)}function We(){c.call(this)}function oe(){c.call(this)}function qe(){c.call(this)}function De(){}function V(){}function ut(){}function Ae(){this.a={}}function ct(h){return h.length==0||ft.test(h)}function ve(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=ae[f],m==null)return null;m=new ut().a(qe.j(),m),h.a[f]=m}return m}function te(h){return h=ee[h],h==null?"ZZ":h[0]}function Ge(h){this.H=RegExp(" "),this.C="",this.m=new t,this.w="",this.i=new t,this.u=new t,this.l=!0,this.A=this.o=this.F=!1,this.G=Ae.b(),this.s=0,this.b=new t,this.B=!1,this.h="",this.a=new t,this.f=[],this.D=h,this.J=this.g=At(this,this.D)}function At(h,f){var m;if(f!=null&&isNaN(f)&&f.toUpperCase()in ae){if(m=ve(h.G,f),m==null)throw Error("Invalid region code: "+f);m=_(m,10)}else m=0;return m=ve(h.G,te(m)),m??mt}function L(h){for(var f=h.f.length,m=0;m<f;++m){var v=h.f[m],M=_(v,1);if(h.w==M)return!1;var D;D=h;var ue=v,Se=_(ue,1);if(Se.indexOf("|")!=-1)D=!1;else{Se=Se.replace(Tr,"\\d"),Se=Se.replace(ds,"\\d"),s(D.m);var je;je=D;var ue=_(ue,2),gt="999999999999999".match(Se)[0];gt.length<je.a.b.length?je="":(je=gt.replace(new RegExp(Se,"g"),ue),je=je.replace(RegExp("9","g")," ")),0<je.length?(D.m.a(je),D=!0):D=!1}if(D)return h.w=M,h.B=hs.test(g(v,4)),h.s=0,!0}return h.l=!1}function A(h,f){for(var m=[],v=f.length-3,M=h.f.length,D=0;D<M;++D){var ue=h.f[D];W(ue,3)==0?m.push(h.f[D]):(ue=g(ue,3,Math.min(v,W(ue,3)-1)),f.search(ue)==0&&m.push(h.f[D]))}h.f=m}function x(h,f){h.i.a(f);var m=f;if(pt.test(m)||h.i.b.length==1&&Dt.test(m)){var v,m=f;m=="+"?(v=m,h.u.a(m)):(v=tt[m],h.u.a(v),h.a.a(v)),f=v}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(be(h)){if($e(h))return N(h)}else if(0<h.h.length&&(m=h.a.toString(),s(h.a),h.a.a(h.h),h.a.a(m),m=h.b.toString(),v=m.lastIndexOf(h.h),s(h.b),h.b.a(m.substring(0,v))),h.h!=me(h))return h.b.a(" "),N(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!be(h))return h.h=me(h),R(h);h.A=!0;default:return h.A?($e(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=Ee(h,f),v=k(h),0<v.length?v:(A(h,h.a.toString()),L(h)?le(h):h.l?U(h,m):h.i.toString())):R(h)}}function N(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,s(h.m),h.w="",R(h)}function k(h){for(var f=h.a.toString(),m=h.f.length,v=0;v<m;++v){var M=h.f[v],D=_(M,1);if(new RegExp("^(?:"+D+")$").test(f))return h.B=hs.test(g(M,4)),f=f.replace(new RegExp(D,"g"),g(M,2)),U(h,f)}return""}function U(h,f){var m=h.b.b.length;return h.B&&0<m&&h.b.toString().charAt(m-1)!=" "?h.b+" "+f:h.b+f}function R(h){var f=h.a.toString();if(3<=f.length){for(var m=h.o&&h.h.length==0&&0<W(h.g,20)?d(h.g,20)||[]:d(h.g,19)||[],v=m.length,M=0;M<v;++M){var D=m[M];0<h.h.length&&ct(_(D,4))&&!g(D,6)&&D.a[5]==null||(h.h.length!=0||h.o||ct(_(D,4))||g(D,6))&&Cr.test(_(D,2))&&h.f.push(D)}return A(h,f),f=k(h),0<f.length?f:L(h)?le(h):h.i.toString()}return U(h,f)}function le(h){var f=h.a.toString(),m=f.length;if(0<m){for(var v="",M=0;M<m;M++)v=Ee(h,f.charAt(M));return h.l?U(h,v):h.i.toString()}return h.b.toString()}function me(h){var f,m=h.a.toString(),v=0;return g(h.g,10)!=1?f=!1:(f=h.a.toString(),f=f.charAt(0)=="1"&&f.charAt(1)!="0"&&f.charAt(1)!="1"),f?(v=1,h.b.a("1").a(" "),h.o=!0):h.g.a[15]!=null&&(f=new RegExp("^(?:"+g(h.g,15)+")"),f=m.match(f),f!=null&&f[0]!=null&&0<f[0].length&&(h.o=!0,v=f[0].length,h.b.a(m.substring(0,v)))),s(h.a),h.a.a(m.substring(v)),m.substring(0,v)}function be(h){var f=h.u.toString(),m=new RegExp("^(?:\\+|"+g(h.g,11)+")"),m=f.match(m);return m!=null&&m[0]!=null&&0<m[0].length&&(h.o=!0,m=m[0].length,s(h.a),h.a.a(f.substring(m)),s(h.b),h.b.a(f.substring(0,m)),f.charAt(0)!="+"&&h.b.a(" "),!0)}function $e(h){if(h.a.b.length==0)return!1;var f,m=new t;e:{if(f=h.a.toString(),f.length!=0&&f.charAt(0)!="0"){for(var v,M=f.length,D=1;3>=D&&D<=M;++D)if(v=parseInt(f.substring(0,D),10),v in ee){m.a(f.substring(D)),f=v;break e}}f=0}return f!=0&&(s(h.a),h.a.a(m.toString()),m=te(f),m=="001"?h.g=ve(h.G,""+f):m!=h.D&&(h.g=At(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function Ee(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var v=m.search(h.H),m=m.replace(h.H,f);return s(h.m),h.m.a(m),h.s=v,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var St=this;t.prototype.b="",t.prototype.set=function(h){this.b=""+h},t.prototype.a=function(h,f,m){if(this.b+=String(h),f!=null)for(var v=1;v<arguments.length;v++)this.b+=arguments[v];return this},t.prototype.toString=function(){return this.b};var dt=1,jt=2,Xe=3,Ie=4,et=6,ht=16,nn=18;c.prototype.set=function(h,f){se(this,h.b,f)},c.prototype.clone=function(){var h=new this.constructor;return h!=this&&(h.a={},h.b&&(h.b={}),p(h,this)),h},e(We,c);var y=null;e(oe,c);var C=null;e(qe,c);var X=null;We.prototype.j=function(){var h=y;return h||(y=h=He(We,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),h},We.j=We.prototype.j,oe.prototype.j=function(){var h=C;return h||(C=h=He(oe,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),h},oe.j=oe.prototype.j,qe.prototype.j=function(){var h=X;return h||(X=h=He(qe,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:oe},2:{name:"fixed_line",c:11,type:oe},3:{name:"mobile",c:11,type:oe},4:{name:"toll_free",c:11,type:oe},5:{name:"premium_rate",c:11,type:oe},6:{name:"shared_cost",c:11,type:oe},7:{name:"personal_number",c:11,type:oe},8:{name:"voip",c:11,type:oe},21:{name:"pager",c:11,type:oe},25:{name:"uan",c:11,type:oe},27:{name:"emergency",c:11,type:oe},28:{name:"voicemail",c:11,type:oe},29:{name:"short_code",c:11,type:oe},30:{name:"standard_rate",c:11,type:oe},31:{name:"carrier_specific",c:11,type:oe},33:{name:"sms_services",c:11,type:oe},24:{name:"no_international_dialling",c:11,type:oe},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:We},20:{name:"intl_number_format",v:!0,c:11,type:We},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),h},qe.j=qe.prototype.j,De.prototype.a=function(h){throw new h.b,Error("Unimplemented")},De.prototype.b=function(h,f){if(h.a==11||h.a==10)return f instanceof c?f:this.a(h.i.prototype.j(),f);if(h.a==14){if(typeof f=="string"&&j.test(f)){var m=Number(f);if(0<m)return m}return f}if(!h.h)return f;if(m=h.i,m===String){if(typeof f=="number")return String(f)}else if(m===Number&&typeof f=="string"&&(f==="Infinity"||f==="-Infinity"||f==="NaN"||j.test(f)))return Number(f);return f};var j=/^-?[0-9]+$/;e(V,De),V.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(ut,V),ut.prototype.b=function(h,f){return h.a==8?!!f:De.prototype.b.apply(this,arguments)},ut.prototype.a=function(h,f){return ut.M.a.call(this,h,f)};var ee={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" ")},ae={AG:[null,[null,null,"(?:268|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",null,null,null,"2684601234",null,null,null,[7]],[null,null,"268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}",null,null,null,"2684641234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"26848[01]\\d{4}",null,null,null,"2684801234",null,null,null,[7]],"AG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"26840[69]\\d{4}",null,null,null,"2684061234",null,null,null,[7]],null,"268",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AI:[null,[null,null,"(?:264|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"2644(?:6[12]|9[78])\\d{4}",null,null,null,"2644612345",null,null,null,[7]],[null,null,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",null,null,null,"2642351234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AI",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"264",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AS:[null,[null,null,"(?:[58]\\d\\d|684|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"6846(?:22|33|44|55|77|88|9[19])\\d{4}",null,null,null,"6846221234",null,null,null,[7]],[null,null,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}",null,null,null,"6847331234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"684",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BB:[null,[null,null,"(?:246|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}",null,null,null,"2464123456",null,null,null,[7]],[null,null,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}",null,null,null,"2462501234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"(?:246976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002123456",null,null,null,[7]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"24631\\d{5}",null,null,null,"2463101234",null,null,null,[7]],"BB",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"246",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}",null,null,null,"2464301234",null,null,null,[7]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BM:[null,[null,null,"(?:441|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}",null,null,null,"4412345678",null,null,null,[7]],[null,null,"441(?:[37]\\d|5[0-39])\\d{5}",null,null,null,"4413701234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"441",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BS:[null,[null,null,"(?:242|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}",null,null,null,"2423456789",null,null,null,[7]],[null,null,"242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}",null,null,null,"2423591234",null,null,null,[7]],[null,null,"(?:242300|8(?:00|33|44|55|66|77|88)[2-9]\\d\\d)\\d{4}",null,null,null,"8002123456",null,null,null,[7]],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"242",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"242225[0-46-9]\\d{3}",null,null,null,"2422250123"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],CA:[null,[null,null,"(?:[2-8]\\d|90)\\d{8}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"600[2-9]\\d{6}",null,null,null,"6002012345"],"CA",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DM:[null,[null,null,"(?:[58]\\d\\d|767|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}",null,null,null,"7674201234",null,null,null,[7]],[null,null,"767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}",null,null,null,"7672251234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"767",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DO:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8[024]9[2-9]\\d{6}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DO",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"8[024]9",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GD:[null,[null,null,"(?:473|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}",null,null,null,"4732691234",null,null,null,[7]],[null,null,"473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}",null,null,null,"4734031234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GD",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"473",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GU:[null,[null,null,"(?:[58]\\d\\d|671|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GU",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"671",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],JM:[null,[null,null,"(?:[58]\\d\\d|658|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:658[2-9]\\d\\d|876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}",null,null,null,"8765230123",null,null,null,[7]],[null,null,"876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[3-9]|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}",null,null,null,"8762101234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"JM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"658|876",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KN:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}",null,null,null,"8692361234",null,null,null,[7]],[null,null,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}",null,null,null,"8697652917",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KN",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"869",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KY:[null,[null,null,"(?:345|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}",null,null,null,"3452221234",null,null,null,[7]],[null,null,"345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}",null,null,null,"3453231234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"(?:345976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KY",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"345849\\d{4}",null,null,null,"3458491234"],null,"345",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],LC:[null,[null,null,"(?:[58]\\d\\d|758|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}",null,null,null,"7584305678",null,null,null,[7]],[null,null,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}",null,null,null,"7582845678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"LC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"758",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MP:[null,[null,null,"(?:[58]\\d\\d|(?:67|90)0)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MP",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"670",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MS:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d\\d|66449)\\d{5}",null,null,null,null,null,null,[10],[7]],[null,null,"664491\\d{4}",null,null,null,"6644912345",null,null,null,[7]],[null,null,"66449[2-6]\\d{4}",null,null,null,"6644923456",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"664",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],PR:[null,[null,null,"(?:[589]\\d\\d|787)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"PR",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"787|939",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],SX:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d|7215)\\d{6}",null,null,null,null,null,null,[10],[7]],[null,null,"7215(?:4[2-8]|8[239]|9[056])\\d{4}",null,null,null,"7215425678",null,null,null,[7]],[null,null,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}",null,null,null,"7215205678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"SX",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"721",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TC:[null,[null,null,"(?:[58]\\d\\d|649|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"649(?:712|9(?:4\\d|50))\\d{4}",null,null,null,"6497121234",null,null,null,[7]],[null,null,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}",null,null,null,"6492311234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"64971[01]\\d{4}",null,null,null,"6497101234",null,null,null,[7]],"TC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"649",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TT:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"868(?:2(?:01|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}",null,null,null,"8682211234",null,null,null,[7]],[null,null,"868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}",null,null,null,"8682911234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"TT",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"868",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,"868619\\d{4}",null,null,null,"8686191234",null,null,null,[7]]],US:[null,[null,null,"[2-9]\\d{9}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"US",1,"011","1",null,null,"1",null,null,1,[[null,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"]],[null,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],null,null,1]],[[null,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[2-9]"]]],[null,null,null,null,null,null,null,null,null,[-1]],1,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"710[2-9]\\d{6}",null,null,null,"7102123456"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VC:[null,[null,null,"(?:[58]\\d\\d|784|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}",null,null,null,"7842661234",null,null,null,[7]],[null,null,"784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}",null,null,null,"7844301234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"784",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VG:[null,[null,null,"(?:284|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"284(?:(?:229|774|8(?:52|6[459]))\\d|4(?:22\\d|9(?:[45]\\d|6[0-5])))\\d{3}",null,null,null,"2842291234",null,null,null,[7]],[null,null,"284(?:(?:3(?:0[0-3]|4[0-7]|68|9[34])|54[0-57])\\d|4(?:(?:4[0-6]|68)\\d|9(?:6[6-9]|9\\d)))\\d{3}",null,null,null,"2843001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"284",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VI:[null,[null,null,"(?:(?:34|90)0|[58]\\d\\d)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VI",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"340",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};Ae.b=function(){return Ae.a?Ae.a:Ae.a=new Ae};var tt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},Dt=RegExp("[++]+"),pt=RegExp("([0-90-9٠-٩۰-۹])"),ft=/^\(?\$1\)?$/,mt=new qe;se(mt,11,"NA");var Tr=/\[([^\[\]])*\]/g,ds=/\d(?=[^,}][^,}])/g,Cr=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),hs=/[- ]/;Ge.prototype.K=function(){this.C="",s(this.i),s(this.u),s(this.m),this.s=0,this.w="",s(this.b),this.h="",s(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=At(this,this.D))},Ge.prototype.L=function(h){return this.C=x(this,h)},n("Cleave.AsYouTypeFormatter",Ge),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",Ge.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",Ge.prototype.K)}).call(typeof el=="object"&&el?el:window);var xd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,qr=(n,e,t,s)=>{for(var r=s>1?void 0:s?$d(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&xd(e,t,r),r};const kd=zs.object({firstName:zs.string().min(1,{message:"First name is required"}),lastName:zs.string().min(1,{message:"Last name is required"}),email:zs.string().email({message:"Invalid email address"}),phone:zs.string().regex(/^(1-)?\d{3}-\d{3}-\d{4}$/,{message:"Invalid phone number"}).transform(n=>n.replace(/-/g,"").replace(/^1/,""))});let Jn=class extends Bn{constructor(){super(...arguments),this.params={firstName:"",lastName:"",email:"",phone:""},this.errors=[]}firstUpdated(){this.phoneCleave=new Fu(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=kd.parse(this.params)}catch(e){this.errors=e.errors;return}this.dispatchEvent(new CustomEvent("submit",{composed:!0,detail:this.params}))}cancel(){this.dispatchEvent(new CustomEvent("cancel"))}updateField(n,e){this.params={...this.params,[n]:e}}render(){return Dr`
|
|
49
|
+
*/function kc(n,e,t){return n?e(n):t==null?void 0:t(n)}var se;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const i={};for(const l of r)i[l]=l;return i},n.getValidEnumValues=r=>{const i=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of i)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(i){return r[i]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const i=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&i.push(l);return i},n.find=(r,i)=>{for(const l of r)if(i(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function s(r,i=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}n.joinValues=s,n.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(se||(se={}));var Ki;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ki||(Ki={}));const S=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ut=n=>{switch(typeof n){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(n)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(n)?S.array:n===null?S.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?S.promise:typeof Map<"u"&&n instanceof Map?S.map:typeof Set<"u"&&n instanceof Set?S.set:typeof Date<"u"&&n instanceof Date?S.date:S.object;default:return S.unknown}},b=se.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"]),Ac=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Ke extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(i){return i.message},s={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let a=s,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return r(this),s}static assert(e){if(!(e instanceof Ke))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}Ke.create=n=>new Ke(n);const Vn=(n,e)=>{let t;switch(n.code){case b.invalid_type:n.received===S.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case b.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,se.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:t=`Unrecognized key(s) in object: ${se.joinValues(n.keys,", ")}`;break;case b.invalid_union:t="Invalid input";break;case b.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${se.joinValues(n.options)}`;break;case b.invalid_enum_value:t=`Invalid enum value. Expected ${se.joinValues(n.options)}, received '${n.received}'`;break;case b.invalid_arguments:t="Invalid function arguments";break;case b.invalid_return_type:t="Invalid function return type";break;case b.invalid_date:t="Invalid date";break;case b.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:se.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case b.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case b.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case b.custom:t="Invalid input";break;case b.invalid_intersection_types:t="Intersection results could not be merged";break;case b.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case b.not_finite:t="Number must be finite";break;default:t=e.defaultError,se.assertNever(n)}return{message:t}};let wa=Vn;function Sc(n){wa=n}function Lr(){return wa}const zr=n=>{const{data:e,path:t,errorMaps:s,issueData:r}=n,i=[...t,...r.path||[]],l={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="";const o=s.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:i,message:a}},Tc=[];function $(n,e){const t=Lr(),s=zr({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Vn?void 0:Vn].filter(r=>!!r)});n.common.issues.push(s)}class ze{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const r of t){if(r.status==="aborted")return B;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const r of t){const i=await r.key,l=await r.value;s.push({key:i,value:l})}return ze.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const r of t){const{key:i,value:l}=r;if(i.status==="aborted"||l.status==="aborted")return B;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[i.value]=l.value)}return{status:e.value,value:s}}}const B=Object.freeze({status:"aborted"}),Fn=n=>({status:"dirty",value:n}),Ue=n=>({status:"valid",value:n}),Yi=n=>n.status==="aborted",Ji=n=>n.status==="dirty",$s=n=>n.status==="valid",ks=n=>typeof Promise<"u"&&n instanceof Promise;function Hr(n,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(n):s?s.value:e.get(n)}function xa(n,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var P;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(P||(P={}));var As,Ss;class vt{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}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}}const $a=(n,e)=>{if($s(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ke(n.common.issues);return this._error=t,this._error}}};function K(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,a)=>{var o,u;const{message:c}=n;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(o=c??s)!==null&&o!==void 0?o:a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??t)!==null&&u!==void 0?u:a.defaultError}},description:r}}class G{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 Ut(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ze,ctx:{common:e.parent.common,data:e.data,parsedType:Ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ks(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const r={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ut(e)},i=this._parseSync({data:e,path:r.path,parent:r});return $a(r,i)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ut(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(ks(r)?r:Promise.resolve(r));return $a(s,i)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const l=e(r),a=()=>i.addIssue({code:b.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new rt({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return _t.create(this,this._def)}nullable(){return Wt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return st.create(this,this._def)}promise(){return Yn.create(this,this._def)}or(e){return Is.create([this,e],this._def)}and(e){return Os.create(this,e,this._def)}transform(e){return new rt({...K(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new js({...K(this._def),innerType:this,defaultValue:t,typeName:z.ZodDefault})}brand(){return new Xi({typeName:z.ZodBranded,type:this,...K(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ds({...K(this._def),innerType:this,catchValue:t,typeName:z.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Zs.create(this,e)}readonly(){return Ls.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Cc=/^c[^\s-]{8,}$/i,Ec=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Z]{26}$/,Oc=/^[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,Mc=/^[a-z0-9_-]{21}$/i,Nc=/^[-+]?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)?)??$/,Pc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Gi;const jc=/^(?:(?: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])$/,Dc=/^(([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})))$/,Zc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ka="((\\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])))",Lc=new RegExp(`^${ka}$`);function Aa(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function zc(n){return new RegExp(`^${Aa(n)}$`)}function Sa(n){let e=`${ka}T${Aa(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Hc(n,e){return!!((e==="v4"||!e)&&jc.test(n)||(e==="v6"||!e)&&Dc.test(n))}class nt extends G{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.string,received:i.parsedType}),B}const s=new ze;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,a=e.data.length<i.value;(l||a)&&(r=this._getOrReturnCtx(e,r),l?$(r,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&$(r,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")Pc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"email",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")Gi||(Gi=new RegExp(Rc,"u")),Gi.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"emoji",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Oc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"uuid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")Mc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"nanoid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Cc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Ec.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"cuid2",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Ic.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ulid",code:b.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),$(r,{validation:"url",code:b.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"regex",code:b.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Sa(i).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?Lc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?zc(i).test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:b.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?Nc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"duration",code:b.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?Hc(e.data,i.version)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"ip",code:b.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Zc.test(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{validation:"base64",code:b.invalid_string,message:i.message}),s.dirty()):se.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:b.invalid_string,...P.errToObj(s)})}_addCheck(e){return new nt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...P.errToObj(e)})}url(e){return this._addCheck({kind:"url",...P.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...P.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...P.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...P.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...P.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...P.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...P.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...P.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...P.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...P.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...P.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...P.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...P.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...P.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...P.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...P.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...P.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...P.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...P.errToObj(t)})}nonempty(e){return this.min(1,P.errToObj(e))}trim(){return new nt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}nt.create=n=>{var e;return new nt({checks:[],typeName:z.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...K(n)})};function Uc(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,i=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return i%l/Math.pow(10,r)}class Bt extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.number,received:i.parsedType}),B}let s;const r=new ze;for(const i of this._def.checks)i.kind==="int"?se.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:b.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?Uc(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_finite,message:i.message}),r.dirty()):se.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,s,r){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:P.toString(r)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:P.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:P.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&se.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Bt.create=n=>new Bt({checks:[],typeName:z.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...K(n)});class Vt extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==S.bigint){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.bigint,received:i.parsedType}),B}let s;const r=new ze;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),$(s,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):se.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,s,r){return new Vt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:P.toString(r)}]})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Vt.create=n=>{var e;return new Vt({checks:[],typeName:z.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...K(n)})};class Ts extends G{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.boolean,received:s.parsedType}),B}return Ue(e.data)}}Ts.create=n=>new Ts({typeName:z.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...K(n)});class dn extends G{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_type,expected:S.date,received:i.parsedType}),B}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return $(i,{code:b.invalid_date}),B}const s=new ze;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),$(r,{code:b.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):se.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new dn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:P.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:P.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}dn.create=n=>new dn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:z.ZodDate,...K(n)});class Ur extends G{_parse(e){if(this._getType(e)!==S.symbol){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.symbol,received:s.parsedType}),B}return Ue(e.data)}}Ur.create=n=>new Ur({typeName:z.ZodSymbol,...K(n)});class Cs extends G{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.undefined,received:s.parsedType}),B}return Ue(e.data)}}Cs.create=n=>new Cs({typeName:z.ZodUndefined,...K(n)});class Es extends G{_parse(e){if(this._getType(e)!==S.null){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.null,received:s.parsedType}),B}return Ue(e.data)}}Es.create=n=>new Es({typeName:z.ZodNull,...K(n)});class Wn extends G{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}Wn.create=n=>new Wn({typeName:z.ZodAny,...K(n)});class hn extends G{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}hn.create=n=>new hn({typeName:z.ZodUnknown,...K(n)});class Tt extends G{_parse(e){const t=this._getOrReturnCtx(e);return $(t,{code:b.invalid_type,expected:S.never,received:t.parsedType}),B}}Tt.create=n=>new Tt({typeName:z.ZodNever,...K(n)});class Br extends G{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.void,received:s.parsedType}),B}return Ue(e.data)}}Br.create=n=>new Br({typeName:z.ZodVoid,...K(n)});class st extends G{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==S.array)return $(t,{code:b.invalid_type,expected:S.array,received:t.parsedType}),B;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&($(t,{code:l?b.too_big:b.too_small,minimum:a?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&($(t,{code:b.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&($(t,{code:b.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new vt(t,l,t.path,a)))).then(l=>ze.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new vt(t,l,t.path,a)));return ze.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new st({...this._def,minLength:{value:e,message:P.toString(t)}})}max(e,t){return new st({...this._def,maxLength:{value:e,message:P.toString(t)}})}length(e,t){return new st({...this._def,exactLength:{value:e,message:P.toString(t)}})}nonempty(e){return this.min(1,e)}}st.create=(n,e)=>new st({type:n,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...K(e)});function qn(n){if(n instanceof we){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=_t.create(qn(s))}return new we({...n._def,shape:()=>e})}else return n instanceof st?new st({...n._def,type:qn(n.element)}):n instanceof _t?_t.create(qn(n.unwrap())):n instanceof Wt?Wt.create(qn(n.unwrap())):n instanceof bt?bt.create(n.items.map(e=>qn(e))):n}class we extends G{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=se.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==S.object){const u=this._getOrReturnCtx(e);return $(u,{code:b.invalid_type,expected:S.object,received:u.parsedType}),B}const{status:s,ctx:r}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Tt&&this._def.unknownKeys==="strip"))for(const u in r.data)l.includes(u)||a.push(u);const o=[];for(const u of l){const c=i[u],p=r.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new vt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Tt){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)o.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(u==="strict")a.length>0&&($(r,{code:b.unrecognized_keys,keys:a}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const p=r.data[c];o.push({key:{status:"valid",value:c},value:u._parse(new vt(r,p,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of o){const p=await c.key,d=await c.value;u.push({key:p,value:d,alwaysSet:c.alwaysSet})}return u}).then(u=>ze.mergeObjectSync(s,u)):ze.mergeObjectSync(s,o)}get shape(){return this._def.shape()}strict(e){return P.errToObj,new we({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var r,i,l,a;const o=(l=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,s).message)!==null&&l!==void 0?l:s.defaultError;return t.code==="unrecognized_keys"?{message:(a=P.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new we({...this._def,unknownKeys:"strip"})}passthrough(){return new we({...this._def,unknownKeys:"passthrough"})}extend(e){return new we({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new we({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new we({...this._def,catchall:e})}pick(e){const t={};return se.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new we({...this._def,shape:()=>t})}omit(e){const t={};return se.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new we({...this._def,shape:()=>t})}deepPartial(){return qn(this)}partial(e){const t={};return se.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new we({...this._def,shape:()=>t})}required(e){const t={};return se.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof _t;)i=i._def.innerType;t[s]=i}}),new we({...this._def,shape:()=>t})}keyof(){return Ta(se.objectKeys(this.shape))}}we.create=(n,e)=>new we({shape:()=>n,unknownKeys:"strip",catchall:Tt.create(),typeName:z.ZodObject,...K(e)}),we.strictCreate=(n,e)=>new we({shape:()=>n,unknownKeys:"strict",catchall:Tt.create(),typeName:z.ZodObject,...K(e)}),we.lazycreate=(n,e)=>new we({shape:n,unknownKeys:"strip",catchall:Tt.create(),typeName:z.ZodObject,...K(e)});class Is extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new Ke(a.ctx.common.issues));return $(t,{code:b.invalid_union,unionErrors:l}),B}if(t.common.async)return Promise.all(s.map(async i=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let i;const l=[];for(const o of s){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(o=>new Ke(o));return $(t,{code:b.invalid_union,unionErrors:a}),B}}get options(){return this._def.options}}Is.create=(n,e)=>new Is({options:n,typeName:z.ZodUnion,...K(e)});const Ct=n=>n instanceof Ns?Ct(n.schema):n instanceof rt?Ct(n.innerType()):n instanceof Ps?[n.value]:n instanceof Ft?n.options:n instanceof Rs?se.objectValues(n.enum):n instanceof js?Ct(n._def.innerType):n instanceof Cs?[void 0]:n instanceof Es?[null]:n instanceof _t?[void 0,...Ct(n.unwrap())]:n instanceof Wt?[null,...Ct(n.unwrap())]:n instanceof Xi||n instanceof Ls?Ct(n.unwrap()):n instanceof Ds?Ct(n._def.innerType):[];class Vr extends G{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return $(t,{code:b.invalid_type,expected:S.object,received:t.parsedType}),B;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const i of t){const l=Ct(i.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,i)}}return new Vr({typeName:z.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...K(s)})}}function Qi(n,e){const t=Ut(n),s=Ut(e);if(n===e)return{valid:!0,data:n};if(t===S.object&&s===S.object){const r=se.objectKeys(e),i=se.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=Qi(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===S.array&&s===S.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<n.length;i++){const l=n[i],a=e[i],o=Qi(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===S.date&&s===S.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Os extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(Yi(i)||Yi(l))return B;const a=Qi(i.value,l.value);return a.valid?((Ji(i)||Ji(l))&&t.dirty(),{status:t.value,value:a.data}):($(s,{code:b.invalid_intersection_types}),B)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,l])=>r(i,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Os.create=(n,e,t)=>new Os({left:n,right:e,typeName:z.ZodIntersection,...K(t)});class bt extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.array)return $(s,{code:b.invalid_type,expected:S.array,received:s.parsedType}),B;if(s.data.length<this._def.items.length)return $(s,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&s.data.length>this._def.items.length&&($(s,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map((l,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new vt(s,l,s.path,a)):null}).filter(l=>!!l);return s.common.async?Promise.all(i).then(l=>ze.mergeArray(t,l)):ze.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new bt({...this._def,rest:e})}}bt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bt({items:n,typeName:z.ZodTuple,rest:null,...K(e)})};class Ms extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.object)return $(s,{code:b.invalid_type,expected:S.object,received:s.parsedType}),B;const r=[],i=this._def.keyType,l=this._def.valueType;for(const a in s.data)r.push({key:i._parse(new vt(s,a,s.path,a)),value:l._parse(new vt(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?ze.mergeObjectAsync(t,r):ze.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof G?new Ms({keyType:e,valueType:t,typeName:z.ZodRecord,...K(s)}):new Ms({keyType:nt.create(),valueType:e,typeName:z.ZodRecord,...K(t)})}}class Fr extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.map)return $(s,{code:b.invalid_type,expected:S.map,received:s.parsedType}),B;const r=this._def.keyType,i=this._def.valueType,l=[...s.data.entries()].map(([a,o],u)=>({key:r._parse(new vt(s,a,s.path,[u,"key"])),value:i._parse(new vt(s,o,s.path,[u,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return B;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return B;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}Fr.create=(n,e,t)=>new Fr({valueType:e,keyType:n,typeName:z.ZodMap,...K(t)});class pn extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.set)return $(s,{code:b.invalid_type,expected:S.set,received:s.parsedType}),B;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&($(s,{code:b.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&($(s,{code:b.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return B;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...s.data.values()].map((o,u)=>i._parse(new vt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new pn({...this._def,minSize:{value:e,message:P.toString(t)}})}max(e,t){return new pn({...this._def,maxSize:{value:e,message:P.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}pn.create=(n,e)=>new pn({valueType:n,minSize:null,maxSize:null,typeName:z.ZodSet,...K(e)});class Kn extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return $(t,{code:b.invalid_type,expected:S.function,received:t.parsedType}),B;function s(a,o){return zr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lr(),Vn].filter(u=>!!u),issueData:{code:b.invalid_arguments,argumentsError:o}})}function r(a,o){return zr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lr(),Vn].filter(u=>!!u),issueData:{code:b.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Yn){const a=this;return Ue(async function(...o){const u=new Ke([]),c=await a._def.args.parseAsync(o,i).catch(g=>{throw u.addIssue(s(o,g)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,i).catch(g=>{throw u.addIssue(r(p,g)),u})})}else{const a=this;return Ue(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new Ke([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new Ke([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Kn({...this._def,args:bt.create(e).rest(hn.create())})}returns(e){return new Kn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Kn({args:e||bt.create([]).rest(hn.create()),returns:t||hn.create(),typeName:z.ZodFunction,...K(s)})}}class Ns extends G{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ns.create=(n,e)=>new Ns({getter:n,typeName:z.ZodLazy,...K(e)});class Ps extends G{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:b.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ps.create=(n,e)=>new Ps({value:n,typeName:z.ZodLiteral,...K(e)});function Ta(n,e){return new Ft({values:n,typeName:z.ZodEnum,...K(e)})}class Ft extends G{constructor(){super(...arguments),As.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return $(t,{expected:se.joinValues(s),received:t.parsedType,code:b.invalid_type}),B}if(Hr(this,As,"f")||xa(this,As,new Set(this._def.values),"f"),!Hr(this,As,"f").has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return $(t,{received:t.data,code:b.invalid_enum_value,options:s}),B}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ft.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ft.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}As=new WeakMap,Ft.create=Ta;class Rs extends G{constructor(){super(...arguments),Ss.set(this,void 0)}_parse(e){const t=se.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==S.string&&s.parsedType!==S.number){const r=se.objectValues(t);return $(s,{expected:se.joinValues(r),received:s.parsedType,code:b.invalid_type}),B}if(Hr(this,Ss,"f")||xa(this,Ss,new Set(se.getValidEnumValues(this._def.values)),"f"),!Hr(this,Ss,"f").has(e.data)){const r=se.objectValues(t);return $(s,{received:s.data,code:b.invalid_enum_value,options:r}),B}return Ue(e.data)}get enum(){return this._def.values}}Ss=new WeakMap,Rs.create=(n,e)=>new Rs({values:n,typeName:z.ZodNativeEnum,...K(e)});class Yn extends G{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return $(t,{code:b.invalid_type,expected:S.promise,received:t.parsedType}),B;const s=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return Ue(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yn.create=(n,e)=>new Yn({type:n,typeName:z.ZodPromise,...K(e)});class rt extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:l=>{$(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const l=r.transform(s.data,i);if(s.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return B;const o=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return o.status==="aborted"?B:o.status==="dirty"||t.value==="dirty"?Fn(o.value):o});{if(t.value==="aborted")return B;const a=this._def.schema._parseSync({data:l,path:s.path,parent:s});return a.status==="aborted"?B:a.status==="dirty"||t.value==="dirty"?Fn(a.value):a}}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,i);if(s.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?B:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?B:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!$s(l))return l;const a=r.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>$s(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);se.assertNever(r)}}rt.create=(n,e,t)=>new rt({schema:n,typeName:z.ZodEffects,effect:e,...K(t)}),rt.createWithPreprocess=(n,e,t)=>new rt({schema:e,effect:{type:"preprocess",transform:n},typeName:z.ZodEffects,...K(t)});class _t extends G{_parse(e){return this._getType(e)===S.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_t.create=(n,e)=>new _t({innerType:n,typeName:z.ZodOptional,...K(e)});class Wt extends G{_parse(e){return this._getType(e)===S.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wt.create=(n,e)=>new Wt({innerType:n,typeName:z.ZodNullable,...K(e)});class js extends G{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===S.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}js.create=(n,e)=>new js({innerType:n,typeName:z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class Ds extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ks(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ke(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ke(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ds.create=(n,e)=>new Ds({innerType:n,typeName:z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Wr extends G{_parse(e){if(this._getType(e)!==S.nan){const s=this._getOrReturnCtx(e);return $(s,{code:b.invalid_type,expected:S.nan,received:s.parsedType}),B}return{status:"valid",value:e.data}}}Wr.create=n=>new Wr({typeName:z.ZodNaN,...K(n)});const Bc=Symbol("zod_brand");class Xi extends G{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Zs extends G{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?B:i.status==="dirty"?(t.dirty(),Fn(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?B:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new Zs({in:e,out:t,typeName:z.ZodPipeline})}}class Ls extends G{_parse(e){const t=this._def.innerType._parse(e),s=r=>($s(r)&&(r.value=Object.freeze(r.value)),r);return ks(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}}Ls.create=(n,e)=>new Ls({innerType:n,typeName:z.ZodReadonly,...K(e)});function Ca(n,e={},t){return n?Wn.create().superRefine((s,r)=>{var i,l;if(!n(s)){const a=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,o=(l=(i=a.fatal)!==null&&i!==void 0?i:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):Wn.create()}const Vc={object:we.lazycreate};var z;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(z||(z={}));const Fc=(n,e={message:`Input not instance of ${n.name}`})=>Ca(t=>t instanceof n,e),Ea=nt.create,Ia=Bt.create,Wc=Wr.create,qc=Vt.create,Oa=Ts.create,Kc=dn.create,Yc=Ur.create,Jc=Cs.create,Gc=Es.create,Qc=Wn.create,Xc=hn.create,ed=Tt.create,td=Br.create,nd=st.create,sd=we.create,rd=we.strictCreate,id=Is.create,ld=Vr.create,ad=Os.create,od=bt.create,ud=Ms.create,cd=Fr.create,dd=pn.create,hd=Kn.create,pd=Ns.create,fd=Ps.create,md=Ft.create,gd=Rs.create,yd=Yn.create,Ma=rt.create,vd=_t.create,bd=Wt.create,_d=rt.createWithPreprocess,wd=Zs.create;var zs=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:Sc,getErrorMap:Lr,makeIssue:zr,EMPTY_PATH:Tc,addIssueToContext:$,ParseStatus:ze,INVALID:B,DIRTY:Fn,OK:Ue,isAborted:Yi,isDirty:Ji,isValid:$s,isAsync:ks,get util(){return se},get objectUtil(){return Ki},ZodParsedType:S,getParsedType:Ut,ZodType:G,datetimeRegex:Sa,ZodString:nt,ZodNumber:Bt,ZodBigInt:Vt,ZodBoolean:Ts,ZodDate:dn,ZodSymbol:Ur,ZodUndefined:Cs,ZodNull:Es,ZodAny:Wn,ZodUnknown:hn,ZodNever:Tt,ZodVoid:Br,ZodArray:st,ZodObject:we,ZodUnion:Is,ZodDiscriminatedUnion:Vr,ZodIntersection:Os,ZodTuple:bt,ZodRecord:Ms,ZodMap:Fr,ZodSet:pn,ZodFunction:Kn,ZodLazy:Ns,ZodLiteral:Ps,ZodEnum:Ft,ZodNativeEnum:Rs,ZodPromise:Yn,ZodEffects:rt,ZodTransformer:rt,ZodOptional:_t,ZodNullable:Wt,ZodDefault:js,ZodCatch:Ds,ZodNaN:Wr,BRAND:Bc,ZodBranded:Xi,ZodPipeline:Zs,ZodReadonly:Ls,custom:Ca,Schema:G,ZodSchema:G,late:Vc,get ZodFirstPartyTypeKind(){return z},coerce:{string:n=>nt.create({...n,coerce:!0}),number:n=>Bt.create({...n,coerce:!0}),boolean:n=>Ts.create({...n,coerce:!0}),bigint:n=>Vt.create({...n,coerce:!0}),date:n=>dn.create({...n,coerce:!0})},any:Qc,array:nd,bigint:qc,boolean:Oa,date:Kc,discriminatedUnion:ld,effect:Ma,enum:md,function:hd,instanceof:Fc,intersection:ad,lazy:pd,literal:fd,map:cd,nan:Wc,nativeEnum:gd,never:ed,null:Gc,nullable:bd,number:Ia,object:sd,oboolean:()=>Oa().optional(),onumber:()=>Ia().optional(),optional:vd,ostring:()=>Ea().optional(),pipeline:wd,preprocess:_d,promise:yd,record:ud,set:dd,strictObject:rd,string:Ea,symbol:Yc,transformer:Ma,tuple:od,undefined:Jc,union:id,unknown:Xc,void:td,NEVER:B,ZodIssueCode:b,quotelessJson:Ac,ZodError:Ke});const Na=qu`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.relative{position:relative}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;border-width:1px;padding:.5rem .75rem;line-height:1.25;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}label{margin-bottom:.5rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{opacity:.95}.btn-primary:disabled{pointer-events:none;opacity:.5}.btn-primary{background-color:var(--iai-chat-i-button-bg);color:var(--iai-chat-i-button-fg)}.btn-secondary{padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-secondary:hover{opacity:.95}.btn-secondary:disabled{pointer-events:none;opacity:.5}`;var el=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){function n(h,f){var m=h.split("."),v=St;m[0]in v||!v.execScript||v.execScript("var "+m[0]);for(var M;m.length&&(M=m.shift());)m.length||f===void 0?v=v[M]?v[M]:v[M]={}:v[M]=f}function e(h,f){function m(){}m.prototype=f.prototype,h.M=f.prototype,h.prototype=new m,h.prototype.constructor=h,h.N=function(v,M,D){for(var ue=Array(arguments.length-2),Se=2;Se<arguments.length;Se++)ue[Se-2]=arguments[Se];return f.prototype[M].apply(v,ue)}}function t(h,f){h!=null&&this.a.apply(this,arguments)}function s(h){h.b=""}function r(h,f){h.sort(f||i)}function i(h,f){return h>f?1:h<f?-1:0}function l(h){var f,m=[],v=0;for(f in h)m[v++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var v=f[m];this.a[v.b]=v}}function o(h){return h=l(h.a),r(h,function(f,m){return f.b-m.b}),h}function u(h,f){switch(this.b=h,this.g=!!f.v,this.a=f.c,this.i=f.type,this.h=!1,this.a){case Xe:case Ie:case et:case ht:case nn:case jt:case dt:this.h=!0}this.f=f.defaultValue}function c(){this.a={},this.f=this.j().a,this.b=this.g=null}function p(h,f){for(var m=o(h.j()),v=0;v<m.length;v++){var M=m[v],D=M.b;if(f.a[D]!=null){h.b&&delete h.b[M.b];var ue=M.a==11||M.a==10;if(M.g)for(var M=d(f,D)||[],Se=0;Se<M.length;Se++){var De=h,gt=D,Er=ue?M[Se].clone():M[Se];De.a[gt]||(De.a[gt]=[]),De.a[gt].push(Er),De.b&&delete De.b[gt]}else M=d(f,D),ue?(ue=d(h,D))?p(ue,M):te(h,D,M.clone()):te(h,D,M)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var v=h.g,M=h.f[f];if(m!=null)if(M.g){for(var D=[],ue=0;ue<m.length;ue++)D[ue]=v.b(M,m[ue]);m=D}else m=v.b(M,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var v=d(h,f);return h.f[f].g?v[m||0]:v}function _(h,f){var m;if(h.a[f]!=null)m=g(h,f,void 0);else e:{if(m=h.f[f],m.f===void 0){var v=m.i;if(v===Boolean)m.f=!1;else if(v===Number)m.f=0;else{if(v!==String){m=new v;break e}m.f=m.h?"0":""}}m=m.f}return m}function V(h,f){return h.f[f].g?h.a[f]!=null?h.a[f].length:0:h.a[f]!=null?1:0}function te(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function je(h,f){var m,v=[];for(m in f)m!=0&&v.push(new u(m,f[m]));return new a(h,v)}function We(){c.call(this)}function oe(){c.call(this)}function qe(){c.call(this)}function Ze(){}function F(){}function ut(){}function Ae(){this.a={}}function ct(h){return h.length==0||ft.test(h)}function ve(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=ae[f],m==null)return null;m=new ut().a(qe.j(),m),h.a[f]=m}return m}function ne(h){return h=ee[h],h==null?"ZZ":h[0]}function Ge(h){this.H=RegExp(" "),this.C="",this.m=new t,this.w="",this.i=new t,this.u=new t,this.l=!0,this.A=this.o=this.F=!1,this.G=Ae.b(),this.s=0,this.b=new t,this.B=!1,this.h="",this.a=new t,this.f=[],this.D=h,this.J=this.g=At(this,this.D)}function At(h,f){var m;if(f!=null&&isNaN(f)&&f.toUpperCase()in ae){if(m=ve(h.G,f),m==null)throw Error("Invalid region code: "+f);m=_(m,10)}else m=0;return m=ve(h.G,ne(m)),m??mt}function L(h){for(var f=h.f.length,m=0;m<f;++m){var v=h.f[m],M=_(v,1);if(h.w==M)return!1;var D;D=h;var ue=v,Se=_(ue,1);if(Se.indexOf("|")!=-1)D=!1;else{Se=Se.replace(Tr,"\\d"),Se=Se.replace(ds,"\\d"),s(D.m);var De;De=D;var ue=_(ue,2),gt="999999999999999".match(Se)[0];gt.length<De.a.b.length?De="":(De=gt.replace(new RegExp(Se,"g"),ue),De=De.replace(RegExp("9","g")," ")),0<De.length?(D.m.a(De),D=!0):D=!1}if(D)return h.w=M,h.B=hs.test(g(v,4)),h.s=0,!0}return h.l=!1}function A(h,f){for(var m=[],v=f.length-3,M=h.f.length,D=0;D<M;++D){var ue=h.f[D];V(ue,3)==0?m.push(h.f[D]):(ue=g(ue,3,Math.min(v,V(ue,3)-1)),f.search(ue)==0&&m.push(h.f[D]))}h.f=m}function x(h,f){h.i.a(f);var m=f;if(pt.test(m)||h.i.b.length==1&&Dt.test(m)){var v,m=f;m=="+"?(v=m,h.u.a(m)):(v=tt[m],h.u.a(v),h.a.a(v)),f=v}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(be(h)){if($e(h))return N(h)}else if(0<h.h.length&&(m=h.a.toString(),s(h.a),h.a.a(h.h),h.a.a(m),m=h.b.toString(),v=m.lastIndexOf(h.h),s(h.b),h.b.a(m.substring(0,v))),h.h!=me(h))return h.b.a(" "),N(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!be(h))return h.h=me(h),R(h);h.A=!0;default:return h.A?($e(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=Ee(h,f),v=k(h),0<v.length?v:(A(h,h.a.toString()),L(h)?le(h):h.l?U(h,m):h.i.toString())):R(h)}}function N(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,s(h.m),h.w="",R(h)}function k(h){for(var f=h.a.toString(),m=h.f.length,v=0;v<m;++v){var M=h.f[v],D=_(M,1);if(new RegExp("^(?:"+D+")$").test(f))return h.B=hs.test(g(M,4)),f=f.replace(new RegExp(D,"g"),g(M,2)),U(h,f)}return""}function U(h,f){var m=h.b.b.length;return h.B&&0<m&&h.b.toString().charAt(m-1)!=" "?h.b+" "+f:h.b+f}function R(h){var f=h.a.toString();if(3<=f.length){for(var m=h.o&&h.h.length==0&&0<V(h.g,20)?d(h.g,20)||[]:d(h.g,19)||[],v=m.length,M=0;M<v;++M){var D=m[M];0<h.h.length&&ct(_(D,4))&&!g(D,6)&&D.a[5]==null||(h.h.length!=0||h.o||ct(_(D,4))||g(D,6))&&Cr.test(_(D,2))&&h.f.push(D)}return A(h,f),f=k(h),0<f.length?f:L(h)?le(h):h.i.toString()}return U(h,f)}function le(h){var f=h.a.toString(),m=f.length;if(0<m){for(var v="",M=0;M<m;M++)v=Ee(h,f.charAt(M));return h.l?U(h,v):h.i.toString()}return h.b.toString()}function me(h){var f,m=h.a.toString(),v=0;return g(h.g,10)!=1?f=!1:(f=h.a.toString(),f=f.charAt(0)=="1"&&f.charAt(1)!="0"&&f.charAt(1)!="1"),f?(v=1,h.b.a("1").a(" "),h.o=!0):h.g.a[15]!=null&&(f=new RegExp("^(?:"+g(h.g,15)+")"),f=m.match(f),f!=null&&f[0]!=null&&0<f[0].length&&(h.o=!0,v=f[0].length,h.b.a(m.substring(0,v)))),s(h.a),h.a.a(m.substring(v)),m.substring(0,v)}function be(h){var f=h.u.toString(),m=new RegExp("^(?:\\+|"+g(h.g,11)+")"),m=f.match(m);return m!=null&&m[0]!=null&&0<m[0].length&&(h.o=!0,m=m[0].length,s(h.a),h.a.a(f.substring(m)),s(h.b),h.b.a(f.substring(0,m)),f.charAt(0)!="+"&&h.b.a(" "),!0)}function $e(h){if(h.a.b.length==0)return!1;var f,m=new t;e:{if(f=h.a.toString(),f.length!=0&&f.charAt(0)!="0"){for(var v,M=f.length,D=1;3>=D&&D<=M;++D)if(v=parseInt(f.substring(0,D),10),v in ee){m.a(f.substring(D)),f=v;break e}}f=0}return f!=0&&(s(h.a),h.a.a(m.toString()),m=ne(f),m=="001"?h.g=ve(h.G,""+f):m!=h.D&&(h.g=At(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function Ee(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var v=m.search(h.H),m=m.replace(h.H,f);return s(h.m),h.m.a(m),h.s=v,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var St=this;t.prototype.b="",t.prototype.set=function(h){this.b=""+h},t.prototype.a=function(h,f,m){if(this.b+=String(h),f!=null)for(var v=1;v<arguments.length;v++)this.b+=arguments[v];return this},t.prototype.toString=function(){return this.b};var dt=1,jt=2,Xe=3,Ie=4,et=6,ht=16,nn=18;c.prototype.set=function(h,f){te(this,h.b,f)},c.prototype.clone=function(){var h=new this.constructor;return h!=this&&(h.a={},h.b&&(h.b={}),p(h,this)),h},e(We,c);var y=null;e(oe,c);var C=null;e(qe,c);var X=null;We.prototype.j=function(){var h=y;return h||(y=h=je(We,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),h},We.j=We.prototype.j,oe.prototype.j=function(){var h=C;return h||(C=h=je(oe,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),h},oe.j=oe.prototype.j,qe.prototype.j=function(){var h=X;return h||(X=h=je(qe,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:oe},2:{name:"fixed_line",c:11,type:oe},3:{name:"mobile",c:11,type:oe},4:{name:"toll_free",c:11,type:oe},5:{name:"premium_rate",c:11,type:oe},6:{name:"shared_cost",c:11,type:oe},7:{name:"personal_number",c:11,type:oe},8:{name:"voip",c:11,type:oe},21:{name:"pager",c:11,type:oe},25:{name:"uan",c:11,type:oe},27:{name:"emergency",c:11,type:oe},28:{name:"voicemail",c:11,type:oe},29:{name:"short_code",c:11,type:oe},30:{name:"standard_rate",c:11,type:oe},31:{name:"carrier_specific",c:11,type:oe},33:{name:"sms_services",c:11,type:oe},24:{name:"no_international_dialling",c:11,type:oe},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:We},20:{name:"intl_number_format",v:!0,c:11,type:We},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),h},qe.j=qe.prototype.j,Ze.prototype.a=function(h){throw new h.b,Error("Unimplemented")},Ze.prototype.b=function(h,f){if(h.a==11||h.a==10)return f instanceof c?f:this.a(h.i.prototype.j(),f);if(h.a==14){if(typeof f=="string"&&j.test(f)){var m=Number(f);if(0<m)return m}return f}if(!h.h)return f;if(m=h.i,m===String){if(typeof f=="number")return String(f)}else if(m===Number&&typeof f=="string"&&(f==="Infinity"||f==="-Infinity"||f==="NaN"||j.test(f)))return Number(f);return f};var j=/^-?[0-9]+$/;e(F,Ze),F.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(ut,F),ut.prototype.b=function(h,f){return h.a==8?!!f:Ze.prototype.b.apply(this,arguments)},ut.prototype.a=function(h,f){return ut.M.a.call(this,h,f)};var ee={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" ")},ae={AG:[null,[null,null,"(?:268|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",null,null,null,"2684601234",null,null,null,[7]],[null,null,"268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}",null,null,null,"2684641234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"26848[01]\\d{4}",null,null,null,"2684801234",null,null,null,[7]],"AG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"26840[69]\\d{4}",null,null,null,"2684061234",null,null,null,[7]],null,"268",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AI:[null,[null,null,"(?:264|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"2644(?:6[12]|9[78])\\d{4}",null,null,null,"2644612345",null,null,null,[7]],[null,null,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",null,null,null,"2642351234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AI",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"264",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AS:[null,[null,null,"(?:[58]\\d\\d|684|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"6846(?:22|33|44|55|77|88|9[19])\\d{4}",null,null,null,"6846221234",null,null,null,[7]],[null,null,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}",null,null,null,"6847331234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"684",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BB:[null,[null,null,"(?:246|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}",null,null,null,"2464123456",null,null,null,[7]],[null,null,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}",null,null,null,"2462501234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"(?:246976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002123456",null,null,null,[7]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"24631\\d{5}",null,null,null,"2463101234",null,null,null,[7]],"BB",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"246",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}",null,null,null,"2464301234",null,null,null,[7]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BM:[null,[null,null,"(?:441|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}",null,null,null,"4412345678",null,null,null,[7]],[null,null,"441(?:[37]\\d|5[0-39])\\d{5}",null,null,null,"4413701234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"441",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BS:[null,[null,null,"(?:242|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}",null,null,null,"2423456789",null,null,null,[7]],[null,null,"242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}",null,null,null,"2423591234",null,null,null,[7]],[null,null,"(?:242300|8(?:00|33|44|55|66|77|88)[2-9]\\d\\d)\\d{4}",null,null,null,"8002123456",null,null,null,[7]],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"242",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"242225[0-46-9]\\d{3}",null,null,null,"2422250123"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],CA:[null,[null,null,"(?:[2-8]\\d|90)\\d{8}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"600[2-9]\\d{6}",null,null,null,"6002012345"],"CA",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DM:[null,[null,null,"(?:[58]\\d\\d|767|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}",null,null,null,"7674201234",null,null,null,[7]],[null,null,"767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}",null,null,null,"7672251234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"767",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DO:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8[024]9[2-9]\\d{6}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DO",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"8[024]9",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GD:[null,[null,null,"(?:473|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}",null,null,null,"4732691234",null,null,null,[7]],[null,null,"473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}",null,null,null,"4734031234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GD",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"473",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GU:[null,[null,null,"(?:[58]\\d\\d|671|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GU",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"671",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],JM:[null,[null,null,"(?:[58]\\d\\d|658|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:658[2-9]\\d\\d|876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}",null,null,null,"8765230123",null,null,null,[7]],[null,null,"876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[3-9]|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}",null,null,null,"8762101234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"JM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"658|876",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KN:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}",null,null,null,"8692361234",null,null,null,[7]],[null,null,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}",null,null,null,"8697652917",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KN",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"869",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KY:[null,[null,null,"(?:345|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}",null,null,null,"3452221234",null,null,null,[7]],[null,null,"345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}",null,null,null,"3453231234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"(?:345976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KY",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"345849\\d{4}",null,null,null,"3458491234"],null,"345",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],LC:[null,[null,null,"(?:[58]\\d\\d|758|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}",null,null,null,"7584305678",null,null,null,[7]],[null,null,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}",null,null,null,"7582845678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"LC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"758",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MP:[null,[null,null,"(?:[58]\\d\\d|(?:67|90)0)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MP",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"670",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MS:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d\\d|66449)\\d{5}",null,null,null,null,null,null,[10],[7]],[null,null,"664491\\d{4}",null,null,null,"6644912345",null,null,null,[7]],[null,null,"66449[2-6]\\d{4}",null,null,null,"6644923456",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"664",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],PR:[null,[null,null,"(?:[589]\\d\\d|787)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"PR",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"787|939",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],SX:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d|7215)\\d{6}",null,null,null,null,null,null,[10],[7]],[null,null,"7215(?:4[2-8]|8[239]|9[056])\\d{4}",null,null,null,"7215425678",null,null,null,[7]],[null,null,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}",null,null,null,"7215205678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"SX",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"721",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TC:[null,[null,null,"(?:[58]\\d\\d|649|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"649(?:712|9(?:4\\d|50))\\d{4}",null,null,null,"6497121234",null,null,null,[7]],[null,null,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}",null,null,null,"6492311234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"64971[01]\\d{4}",null,null,null,"6497101234",null,null,null,[7]],"TC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"649",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TT:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"868(?:2(?:01|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}",null,null,null,"8682211234",null,null,null,[7]],[null,null,"868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}",null,null,null,"8682911234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"TT",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"868",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,"868619\\d{4}",null,null,null,"8686191234",null,null,null,[7]]],US:[null,[null,null,"[2-9]\\d{9}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"US",1,"011","1",null,null,"1",null,null,1,[[null,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"]],[null,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],null,null,1]],[[null,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[2-9]"]]],[null,null,null,null,null,null,null,null,null,[-1]],1,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"710[2-9]\\d{6}",null,null,null,"7102123456"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VC:[null,[null,null,"(?:[58]\\d\\d|784|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}",null,null,null,"7842661234",null,null,null,[7]],[null,null,"784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}",null,null,null,"7844301234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"784",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VG:[null,[null,null,"(?:284|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"284(?:(?:229|774|8(?:52|6[459]))\\d|4(?:22\\d|9(?:[45]\\d|6[0-5])))\\d{3}",null,null,null,"2842291234",null,null,null,[7]],[null,null,"284(?:(?:3(?:0[0-3]|4[0-7]|68|9[34])|54[0-57])\\d|4(?:(?:4[0-6]|68)\\d|9(?:6[6-9]|9\\d)))\\d{3}",null,null,null,"2843001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"284",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VI:[null,[null,null,"(?:(?:34|90)0|[58]\\d\\d)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VI",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"340",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};Ae.b=function(){return Ae.a?Ae.a:Ae.a=new Ae};var tt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},Dt=RegExp("[++]+"),pt=RegExp("([0-90-9٠-٩۰-۹])"),ft=/^\(?\$1\)?$/,mt=new qe;te(mt,11,"NA");var Tr=/\[([^\[\]])*\]/g,ds=/\d(?=[^,}][^,}])/g,Cr=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),hs=/[- ]/;Ge.prototype.K=function(){this.C="",s(this.i),s(this.u),s(this.m),this.s=0,this.w="",s(this.b),this.h="",s(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=At(this,this.D))},Ge.prototype.L=function(h){return this.C=x(this,h)},n("Cleave.AsYouTypeFormatter",Ge),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",Ge.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",Ge.prototype.K)}).call(typeof el=="object"&&el?el:window);var xd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,qr=(n,e,t,s)=>{for(var r=s>1?void 0:s?$d(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&xd(e,t,r),r};const kd=zs.object({firstName:zs.string().min(1,{message:"First name is required"}),lastName:zs.string().min(1,{message:"Last name is required"}),email:zs.string().email({message:"Invalid email address"}),phone:zs.string().regex(/^(1-)?\d{3}-\d{3}-\d{4}$/,{message:"Invalid phone number"}).transform(n=>n.replace(/-/g,"").replace(/^1/,""))});let Jn=class extends Bn{constructor(){super(...arguments),this.params={firstName:"",lastName:"",email:"",phone:""},this.errors=[]}firstUpdated(){this.phoneCleave=new Fu(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=kd.parse(this.params)}catch(e){this.errors=e.errors;return}this.dispatchEvent(new CustomEvent("submit",{composed:!0,detail:this.params}))}cancel(){this.dispatchEvent(new CustomEvent("cancel"))}updateField(n,e){this.params={...this.params,[n]:e}}render(){return Dr`
|
|
50
50
|
<div>
|
|
51
51
|
<iai-chat-message-assistant
|
|
52
52
|
content="Your contact information is required to transfer to a live agent."
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
* @license
|
|
198
198
|
* Copyright 2017 Google LLC
|
|
199
199
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
200
|
-
*/const Po=(n,e,t)=>{const s=new Map;for(let r=e;r<=t;r++)s.set(n[r],r);return s},Ro=uh(class extends ch{constructor(n){if(super(n),n.type!==oh.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);const r=[],i=[];let l=0;for(const a of n)r[l]=s?s(a,l):l,i[l]=t(a,l),l++;return{values:i,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,s]){const r=fh(n),{values:i,keys:l}=this.dt(e,t,s);if(!Array.isArray(r))return this.ut=l,i;const a=this.ut??(this.ut=[]),o=[];let u,c,p=0,d=r.length-1,g=0,_=i.length-1;for(;p<=d&&g<=_;)if(r[p]===null)p++;else if(r[d]===null)d--;else if(a[p]===l[g])o[g]=Sn(r[p],i[g]),p++,g++;else if(a[d]===l[_])o[_]=Sn(r[d],i[_]),d--,_--;else if(a[p]===l[_])o[_]=Sn(r[p],i[_]),Qs(n,o[_+1],r[p]),p++,_--;else if(a[d]===l[g])o[g]=Sn(r[d],i[g]),Qs(n,r[p],r[d]),d--,g++;else if(u===void 0&&(u=Po(l,g,_),c=Po(a,p,d)),u.has(a[p]))if(u.has(a[d])){const W=c.get(l[g]),se=W!==void 0?r[W]:null;if(se===null){const He=Qs(n,r[p]);Sn(He,i[g]),o[g]=He}else o[g]=Sn(se,i[g]),Qs(n,r[p],se),r[W]=null;g++}else fl(r[d]),d--;else fl(r[p]),p++;for(;g<=_;){const W=Qs(n,o[_+1]);Sn(W,i[g]),o[g++]=W}for(;p<=d;){const W=r[p++];W!==null&&fl(W)}return this.ut=l,ph(n,o),ns}}),Ot=fn`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-8{bottom:2rem}.bottom-\\[-1px\\]{bottom:-1px}.left-0{left:0}.left-8{left:2rem}.right-0{right:0}.right-8{right:2rem}.top-0{top:0}.top-12{top:3rem}.z-10{z-index:10}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.m-4{margin:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-4{margin-top:1rem}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-link-color: var(--iai-chat-link-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}a{color:var(--iai-chat-i-link-color)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:bottom-8{bottom:2rem}.md\\:left-8{left:2rem}.md\\:right-8{right:2rem}.md\\:flex{display:flex}.md\\:h-\\[500px\\]{height:500px}.md\\:h-fit{height:-moz-fit-content;height:fit-content}.md\\:w-\\[350px\\]{width:350px}.md\\:w-fit{width:-moz-fit-content;width:fit-content}.md\\:p-0{padding:0}.md\\:px-0{padding-left:0;padding-right:0}.md\\:pb-0{padding-bottom:0}}`;var mh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,ai=(n,e,t,s)=>{for(var r=s>1?void 0:s?gh(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&mh(e,t,r),r};let ss=class extends Ye{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return re`
|
|
200
|
+
*/const Po=(n,e,t)=>{const s=new Map;for(let r=e;r<=t;r++)s.set(n[r],r);return s},Ro=uh(class extends ch{constructor(n){if(super(n),n.type!==oh.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);const r=[],i=[];let l=0;for(const a of n)r[l]=s?s(a,l):l,i[l]=t(a,l),l++;return{values:i,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,s]){const r=fh(n),{values:i,keys:l}=this.dt(e,t,s);if(!Array.isArray(r))return this.ut=l,i;const a=this.ut??(this.ut=[]),o=[];let u,c,p=0,d=r.length-1,g=0,_=i.length-1;for(;p<=d&&g<=_;)if(r[p]===null)p++;else if(r[d]===null)d--;else if(a[p]===l[g])o[g]=Sn(r[p],i[g]),p++,g++;else if(a[d]===l[_])o[_]=Sn(r[d],i[_]),d--,_--;else if(a[p]===l[_])o[_]=Sn(r[p],i[_]),Qs(n,o[_+1],r[p]),p++,_--;else if(a[d]===l[g])o[g]=Sn(r[d],i[g]),Qs(n,r[p],r[d]),d--,g++;else if(u===void 0&&(u=Po(l,g,_),c=Po(a,p,d)),u.has(a[p]))if(u.has(a[d])){const V=c.get(l[g]),te=V!==void 0?r[V]:null;if(te===null){const je=Qs(n,r[p]);Sn(je,i[g]),o[g]=je}else o[g]=Sn(te,i[g]),Qs(n,r[p],te),r[V]=null;g++}else fl(r[d]),d--;else fl(r[p]),p++;for(;g<=_;){const V=Qs(n,o[_+1]);Sn(V,i[g]),o[g++]=V}for(;p<=d;){const V=r[p++];V!==null&&fl(V)}return this.ut=l,ph(n,o),ns}}),Ot=fn`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-8{bottom:2rem}.bottom-\\[-1px\\]{bottom:-1px}.left-0{left:0}.left-8{left:2rem}.right-0{right:0}.right-8{right:2rem}.top-0{top:0}.top-12{top:3rem}.z-10{z-index:10}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.m-4{margin:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-4{margin-top:1rem}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-link-color: var(--iai-chat-link-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}a{color:var(--iai-chat-i-link-color)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:bottom-8{bottom:2rem}.md\\:left-8{left:2rem}.md\\:right-8{right:2rem}.md\\:flex{display:flex}.md\\:h-\\[500px\\]{height:500px}.md\\:h-fit{height:-moz-fit-content;height:fit-content}.md\\:w-\\[350px\\]{width:350px}.md\\:w-fit{width:-moz-fit-content;width:fit-content}.md\\:p-0{padding:0}.md\\:px-0{padding-left:0;padding-right:0}.md\\:pb-0{padding-bottom:0}}`;var mh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,ai=(n,e,t,s)=>{for(var r=s>1?void 0:s?gh(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&mh(e,t,r),r};let ss=class extends Ye{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return re`
|
|
201
201
|
<div>
|
|
202
202
|
<div
|
|
203
203
|
id="carousel"
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
* @license
|
|
269
269
|
* Copyright 2018 Google LLC
|
|
270
270
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
|
-
*/const Ho="important",Ah=" !"+Ho,En=vl(class extends bl{constructor(n){var e;if(super(n),n.type!==yl.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const s=n[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const r=e[s];if(r!=null){this.ft.add(s);const i=typeof r=="string"&&r.endsWith(Ah);s.includes("-")||i?t.setProperty(s,i?r.slice(0,-11):r,i?Ho:""):t[s]=r}}return Kt}});var Sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _l={};(function(n){function e(a){a&&a.options&&clearTimeout(a.options.timer)}function t(a,o,u,c){var p={timer:void 0,lastArgs:[]},d=function(){for(var g=this,_=[],W=0;W<arguments.length;W++)_[W]=arguments[W];p.lastArgs=_,p.timer?clearTimeout(p.timer):o&&u.apply(this,p.lastArgs),p.timer=setTimeout(function(){o||u.apply(g,p.lastArgs),p.timer=void 0},a)};return c&&(d=d.bind(c)),d.options=p,d}function s(a,o,u,c){var p;Object.defineProperty(u,c,{configurable:!0,enumerable:!1,get:function(){return p},set:function(d){p=t(a,o,d,this)}})}function r(a,o,u){var c=u.value;return u.value=t(a,o,c),u}function i(a,o){for(var u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(u.length===0)throw new Error("function applied debounce decorator should be a method");if(u.length===1)throw new Error("method applied debounce decorator should have valid name");var p=u[0],d=u[1],g=u.length===3&&u[2]?u[2]:Object.getOwnPropertyDescriptor(p,d);if(g)return r(a,o,g);s(a,o,p,d)}function l(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=500,c=!1;if(a.length&&(typeof a[0]=="number"||typeof a[0]=="object"&&a[0].leading!==void 0)){typeof a[0]=="number"&&(u=a[0]);var p=void 0;return typeof a[0]=="object"&&a[0].leading!==void 0&&(p=a[0]),1<a.length&&typeof a[1]=="object"&&a[1].leading!==void 0&&(p=a[1]),p&&(c=p.leading),function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];return i.apply(void 0,[u,c].concat(d))}}return i.apply(void 0,[u,c].concat(a))}Object.defineProperty(n,"__esModule",{value:!0}),n.cancel=e,n.debounce=l})(_l);var ie;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const i={};for(const l of r)i[l]=l;return i},n.getValidEnumValues=r=>{const i=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of i)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(i){return r[i]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const i=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&i.push(l);return i},n.find=(r,i)=>{for(const l of r)if(i(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function s(r,i=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}n.joinValues=s,n.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(ie||(ie={}));var wl;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(wl||(wl={}));const T=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jt=n=>{switch(typeof n){case"undefined":return T.undefined;case"string":return T.string;case"number":return isNaN(n)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(n)?T.array:n===null?T.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?T.promise:typeof Map<"u"&&n instanceof Map?T.map:typeof Set<"u"&&n instanceof Set?T.set:typeof Date<"u"&&n instanceof Date?T.date:T.object;default:return T.unknown}},w=ie.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"]),Th=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class it extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(i){return i.message},s={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let a=s,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return r(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}it.create=n=>new it(n);const tr=(n,e)=>{let t;switch(n.code){case w.invalid_type:n.received===T.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case w.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ie.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:t=`Unrecognized key(s) in object: ${ie.joinValues(n.keys,", ")}`;break;case w.invalid_union:t="Invalid input";break;case w.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ie.joinValues(n.options)}`;break;case w.invalid_enum_value:t=`Invalid enum value. Expected ${ie.joinValues(n.options)}, received '${n.received}'`;break;case w.invalid_arguments:t="Invalid function arguments";break;case w.invalid_return_type:t="Invalid function return type";break;case w.invalid_date:t="Invalid date";break;case w.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ie.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case w.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case w.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case w.custom:t="Invalid input";break;case w.invalid_intersection_types:t="Intersection results could not be merged";break;case w.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case w.not_finite:t="Number must be finite";break;default:t=e.defaultError,ie.assertNever(n)}return{message:t}};let Bo=tr;function Ch(n){Bo=n}function ci(){return Bo}const di=n=>{const{data:e,path:t,errorMaps:s,issueData:r}=n,i=[...t,...r.path||[]],l={...r,path:i};let a="";const o=s.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:i,message:r.message||a}},Eh=[];function E(n,e){const t=di({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ci(),tr].filter(s=>!!s)});n.common.issues.push(t)}class ze{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const r of t){if(r.status==="aborted")return q;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const r of t)s.push({key:await r.key,value:await r.value});return ze.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const r of t){const{key:i,value:l}=r;if(i.status==="aborted"||l.status==="aborted")return q;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[i.value]=l.value)}return{status:e.value,value:s}}}const q=Object.freeze({status:"aborted"}),Vo=n=>({status:"dirty",value:n}),Be=n=>({status:"valid",value:n}),xl=n=>n.status==="aborted",$l=n=>n.status==="dirty",nr=n=>n.status==="valid",hi=n=>typeof Promise<"u"&&n instanceof Promise;var Z;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Z||(Z={}));class wt{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}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}}const Fo=(n,e)=>{if(nr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new it(n.common.issues);return this._error=t,this._error}}};function Y(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,l)=>i.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:s??l.defaultError}:{message:t??l.defaultError},description:r}}class Q{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 Jt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ze,ctx:{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const r={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fo(r,i)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(hi(r)?r:Promise.resolve(r));return Fo(s,i)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const l=e(r),a=()=>i.addIssue({code:w.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new ot({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Nt.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this,this._def)}promise(){return as.create(this,this._def)}or(e){return lr.create([this,e],this._def)}and(e){return ar.create(this,e,this._def)}transform(e){return new ot({...Y(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new hr({...Y(this._def),innerType:this,defaultValue:t,typeName:H.ZodDefault})}brand(){return new qo({typeName:H.ZodBranded,type:this,...Y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new vi({...Y(this._def),innerType:this,catchValue:t,typeName:H.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pr.create(this,e)}readonly(){return _i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ih=/^c[^\s-]{8,}$/i,Oh=/^[a-z][a-z0-9]*$/,Mh=/^[0-9A-HJKMNP-TV-Z]{26}$/,Nh=/^[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,Ph=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kl;const jh=/^(((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}))$/,Dh=/^(([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})))$/,Zh=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Lh(n,e){return!!((e==="v4"||!e)&&jh.test(n)||(e==="v6"||!e)&&Dh.test(n))}class lt extends Q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.string,received:r.parsedType}),q}const t=new ze;let s;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind==="max")e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind==="length"){const i=e.data.length>r.value,l=e.data.length<r.value;(i||l)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):l&&E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind==="email")Ph.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="emoji")kl||(kl=new RegExp(Rh,"u")),kl.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="uuid")Nh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid")Ih.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid2")Oh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="ulid")Mh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind==="datetime"?Zh(r).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty()):r.kind==="ip"?Lh(e.data,r.version)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty()):ie.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:w.invalid_string,...Z.errToObj(s)})}_addCheck(e){return new lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...Z.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Z.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Z.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Z.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Z.errToObj(t)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}lt.create=n=>{var e;return new lt({checks:[],typeName:H.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Y(n)})};function zh(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,i=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return i%l/Math.pow(10,r)}class Gt extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.number,received:r.parsedType}),q}let t;const s=new ze;for(const r of this._def.checks)r.kind==="int"?ie.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?zh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_finite,message:r.message}),s.dirty()):ie.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,s,r){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:Z.toString(r)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ie.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Gt.create=n=>new Gt({checks:[],typeName:H.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Y(n)});class Qt extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==T.bigint){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.bigint,received:r.parsedType}),q}let t;const s=new ze;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):ie.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,s,r){return new Qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:Z.toString(r)}]})}_addCheck(e){return new Qt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Qt.create=n=>{var e;return new Qt({checks:[],typeName:H.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Y(n)})};class sr extends Q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.boolean,received:t.parsedType}),q}return Be(e.data)}}sr.create=n=>new sr({typeName:H.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Y(n)});class In extends Q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.date,received:r.parsedType}),q}if(isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_date}),q}const t=new ze;let s;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):ie.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new In({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}In.create=n=>new In({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:H.ZodDate,...Y(n)});class pi extends Q{_parse(e){if(this._getType(e)!==T.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.symbol,received:t.parsedType}),q}return Be(e.data)}}pi.create=n=>new pi({typeName:H.ZodSymbol,...Y(n)});class rr extends Q{_parse(e){if(this._getType(e)!==T.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.undefined,received:t.parsedType}),q}return Be(e.data)}}rr.create=n=>new rr({typeName:H.ZodUndefined,...Y(n)});class ir extends Q{_parse(e){if(this._getType(e)!==T.null){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.null,received:t.parsedType}),q}return Be(e.data)}}ir.create=n=>new ir({typeName:H.ZodNull,...Y(n)});class rs extends Q{constructor(){super(...arguments),this._any=!0}_parse(e){return Be(e.data)}}rs.create=n=>new rs({typeName:H.ZodAny,...Y(n)});class On extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Be(e.data)}}On.create=n=>new On({typeName:H.ZodUnknown,...Y(n)});class Mt extends Q{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.never,received:t.parsedType}),q}}Mt.create=n=>new Mt({typeName:H.ZodNever,...Y(n)});class fi extends Q{_parse(e){if(this._getType(e)!==T.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.void,received:t.parsedType}),q}return Be(e.data)}}fi.create=n=>new fi({typeName:H.ZodVoid,...Y(n)});class at extends Q{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==T.array)return E(t,{code:w.invalid_type,expected:T.array,received:t.parsedType}),q;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&(E(t,{code:l?w.too_big:w.too_small,minimum:a?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(E(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(E(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new wt(t,l,t.path,a)))).then(l=>ze.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new wt(t,l,t.path,a)));return ze.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new at({...this._def,minLength:{value:e,message:Z.toString(t)}})}max(e,t){return new at({...this._def,maxLength:{value:e,message:Z.toString(t)}})}length(e,t){return new at({...this._def,exactLength:{value:e,message:Z.toString(t)}})}nonempty(e){return this.min(1,e)}}at.create=(n,e)=>new at({type:n,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...Y(e)});function is(n){if(n instanceof xe){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=Nt.create(is(s))}return new xe({...n._def,shape:()=>e})}else return n instanceof at?new at({...n._def,type:is(n.element)}):n instanceof Nt?Nt.create(is(n.unwrap())):n instanceof Nn?Nn.create(is(n.unwrap())):n instanceof xt?xt.create(n.items.map(e=>is(e))):n}class xe extends Q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ie.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==T.object){const o=this._getOrReturnCtx(e);return E(o,{code:w.invalid_type,expected:T.object,received:o.parsedType}),q}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof Mt&&this._def.unknownKeys==="strip"))for(const o in s.data)i.includes(o)||l.push(o);const a=[];for(const o of i){const u=r[o],c=s.data[o];a.push({key:{status:"valid",value:o},value:u._parse(new wt(s,c,s.path,o)),alwaysSet:o in s.data})}if(this._def.catchall instanceof Mt){const o=this._def.unknownKeys;if(o==="passthrough")for(const u of l)a.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(o==="strict")l.length>0&&(E(s,{code:w.unrecognized_keys,keys:l}),t.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const o=this._def.catchall;for(const u of l){const c=s.data[u];a.push({key:{status:"valid",value:u},value:o._parse(new wt(s,c,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const o=[];for(const u of a){const c=await u.key;o.push({key:c,value:await u.value,alwaysSet:u.alwaysSet})}return o}).then(o=>ze.mergeObjectSync(t,o)):ze.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var r,i,l,a;const o=(l=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,s).message)!==null&&l!==void 0?l:s.defaultError;return t.code==="unrecognized_keys"?{message:(a=Z.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new xe({...this._def,unknownKeys:"strip"})}passthrough(){return new xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:H.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xe({...this._def,catchall:e})}pick(e){const t={};return ie.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new xe({...this._def,shape:()=>t})}omit(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new xe({...this._def,shape:()=>t})}deepPartial(){return is(this)}partial(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new xe({...this._def,shape:()=>t})}required(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let r=this.shape[s];for(;r instanceof Nt;)r=r._def.innerType;t[s]=r}}),new xe({...this._def,shape:()=>t})}keyof(){return Wo(ie.objectKeys(this.shape))}}xe.create=(n,e)=>new xe({shape:()=>n,unknownKeys:"strip",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)}),xe.strictCreate=(n,e)=>new xe({shape:()=>n,unknownKeys:"strict",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)}),xe.lazycreate=(n,e)=>new xe({shape:n,unknownKeys:"strip",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)});class lr extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new it(a.ctx.common.issues));return E(t,{code:w.invalid_union,unionErrors:l}),q}if(t.common.async)return Promise.all(s.map(async i=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let i;const l=[];for(const o of s){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(o=>new it(o));return E(t,{code:w.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}}lr.create=(n,e)=>new lr({options:n,typeName:H.ZodUnion,...Y(e)});const mi=n=>n instanceof ur?mi(n.schema):n instanceof ot?mi(n.innerType()):n instanceof cr?[n.value]:n instanceof Xt?n.options:n instanceof dr?Object.keys(n.enum):n instanceof hr?mi(n._def.innerType):n instanceof rr?[void 0]:n instanceof ir?[null]:null;class gi extends Q{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.object)return E(t,{code:w.invalid_type,expected:T.object,received:t.parsedType}),q;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const i of t){const l=mi(i.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,i)}}return new gi({typeName:H.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Y(s)})}}function Al(n,e){const t=Jt(n),s=Jt(e);if(n===e)return{valid:!0,data:n};if(t===T.object&&s===T.object){const r=ie.objectKeys(e),i=ie.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=Al(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===T.array&&s===T.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<n.length;i++){const l=n[i],a=e[i],o=Al(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===T.date&&s===T.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ar extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(xl(i)||xl(l))return q;const a=Al(i.value,l.value);return a.valid?(($l(i)||$l(l))&&t.dirty(),{status:t.value,value:a.data}):(E(s,{code:w.invalid_intersection_types}),q)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,l])=>r(i,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ar.create=(n,e,t)=>new ar({left:n,right:e,typeName:H.ZodIntersection,...Y(t)});class xt extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.array)return E(s,{code:w.invalid_type,expected:T.array,received:s.parsedType}),q;if(s.data.length<this._def.items.length)return E(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...s.data].map((i,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new wt(s,i,s.path,l)):null}).filter(i=>!!i);return s.common.async?Promise.all(r).then(i=>ze.mergeArray(t,i)):ze.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xt({...this._def,rest:e})}}xt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:n,typeName:H.ZodTuple,rest:null,...Y(e)})};class or extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.object)return E(s,{code:w.invalid_type,expected:T.object,received:s.parsedType}),q;const r=[],i=this._def.keyType,l=this._def.valueType;for(const a in s.data)r.push({key:i._parse(new wt(s,a,s.path,a)),value:l._parse(new wt(s,s.data[a],s.path,a))});return s.common.async?ze.mergeObjectAsync(t,r):ze.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof Q?new or({keyType:e,valueType:t,typeName:H.ZodRecord,...Y(s)}):new or({keyType:lt.create(),valueType:e,typeName:H.ZodRecord,...Y(t)})}}class yi extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.map)return E(s,{code:w.invalid_type,expected:T.map,received:s.parsedType}),q;const r=this._def.keyType,i=this._def.valueType,l=[...s.data.entries()].map(([a,o],u)=>({key:r._parse(new wt(s,a,s.path,[u,"key"])),value:i._parse(new wt(s,o,s.path,[u,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}yi.create=(n,e,t)=>new yi({valueType:e,keyType:n,typeName:H.ZodMap,...Y(t)});class Mn extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.set)return E(s,{code:w.invalid_type,expected:T.set,received:s.parsedType}),q;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(E(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(E(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return q;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...s.data.values()].map((o,u)=>i._parse(new wt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new Mn({...this._def,minSize:{value:e,message:Z.toString(t)}})}max(e,t){return new Mn({...this._def,maxSize:{value:e,message:Z.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Mn.create=(n,e)=>new Mn({valueType:n,minSize:null,maxSize:null,typeName:H.ZodSet,...Y(e)});class ls extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.function)return E(t,{code:w.invalid_type,expected:T.function,received:t.parsedType}),q;function s(a,o){return di({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ci(),tr].filter(u=>!!u),issueData:{code:w.invalid_arguments,argumentsError:o}})}function r(a,o){return di({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ci(),tr].filter(u=>!!u),issueData:{code:w.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof as){const a=this;return Be(async function(...o){const u=new it([]),c=await a._def.args.parseAsync(o,i).catch(d=>{throw u.addIssue(s(o,d)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,i).catch(d=>{throw u.addIssue(r(p,d)),u})})}else{const a=this;return Be(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new it([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new it([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ls({...this._def,args:xt.create(e).rest(On.create())})}returns(e){return new ls({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new ls({args:e||xt.create([]).rest(On.create()),returns:t||On.create(),typeName:H.ZodFunction,...Y(s)})}}class ur extends Q{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ur.create=(n,e)=>new ur({getter:n,typeName:H.ZodLazy,...Y(e)});class cr extends Q{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}cr.create=(n,e)=>new cr({value:n,typeName:H.ZodLiteral,...Y(e)});function Wo(n,e){return new Xt({values:n,typeName:H.ZodEnum,...Y(e)})}class Xt extends Q{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{expected:ie.joinValues(s),received:t.parsedType,code:w.invalid_type}),q}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{received:t.data,code:w.invalid_enum_value,options:s}),q}return Be(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Xt.create(e)}exclude(e){return Xt.create(this.options.filter(t=>!e.includes(t)))}}Xt.create=Wo;class dr extends Q{_parse(e){const t=ie.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==T.string&&s.parsedType!==T.number){const r=ie.objectValues(t);return E(s,{expected:ie.joinValues(r),received:s.parsedType,code:w.invalid_type}),q}if(t.indexOf(e.data)===-1){const r=ie.objectValues(t);return E(s,{received:s.data,code:w.invalid_enum_value,options:r}),q}return Be(e.data)}get enum(){return this._def.values}}dr.create=(n,e)=>new dr({values:n,typeName:H.ZodNativeEnum,...Y(e)});class as extends Q{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.promise&&t.common.async===!1)return E(t,{code:w.invalid_type,expected:T.promise,received:t.parsedType}),q;const s=t.parsedType===T.promise?t.data:Promise.resolve(t.data);return Be(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}as.create=(n,e)=>new as({type:n,typeName:H.ZodPromise,...Y(e)});class ot extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:l=>{E(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const l=r.transform(s.data,i);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:s.path,parent:s})):this._def.schema._parseSync({data:l,path:s.path,parent:s})}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,i);if(s.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?q:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!nr(l))return l;const a=r.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>nr(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);ie.assertNever(r)}}ot.create=(n,e,t)=>new ot({schema:n,typeName:H.ZodEffects,effect:e,...Y(t)}),ot.createWithPreprocess=(n,e,t)=>new ot({schema:e,effect:{type:"preprocess",transform:n},typeName:H.ZodEffects,...Y(t)});class Nt extends Q{_parse(e){return this._getType(e)===T.undefined?Be(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nt.create=(n,e)=>new Nt({innerType:n,typeName:H.ZodOptional,...Y(e)});class Nn extends Q{_parse(e){return this._getType(e)===T.null?Be(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(n,e)=>new Nn({innerType:n,typeName:H.ZodNullable,...Y(e)});class hr extends Q{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===T.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}hr.create=(n,e)=>new hr({innerType:n,typeName:H.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});class vi extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return hi(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new it(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new it(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}vi.create=(n,e)=>new vi({innerType:n,typeName:H.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});class bi extends Q{_parse(e){if(this._getType(e)!==T.nan){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.nan,received:t.parsedType}),q}return{status:"valid",value:e.data}}}bi.create=n=>new bi({typeName:H.ZodNaN,...Y(n)});const Hh=Symbol("zod_brand");class qo extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class pr extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?q:r.status==="dirty"?(t.dirty(),Vo(r.value)):this._def.out._parseAsync({data:r.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?q:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new pr({in:e,out:t,typeName:H.ZodPipeline})}}class _i extends Q{_parse(e){const t=this._def.innerType._parse(e);return nr(t)&&(t.value=Object.freeze(t.value)),t}}_i.create=(n,e)=>new _i({innerType:n,typeName:H.ZodReadonly,...Y(e)});const Ko=(n,e={},t)=>n?rs.create().superRefine((s,r)=>{var i,l;if(!n(s)){const a=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,o=(l=(i=a.fatal)!==null&&i!==void 0?i:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):rs.create(),Uh={object:xe.lazycreate};var H;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(H||(H={}));const Bh=(n,e={message:`Input not instance of ${n.name}`})=>Ko(t=>t instanceof n,e),Yo=lt.create,Jo=Gt.create,Vh=bi.create,Fh=Qt.create,Go=sr.create,Wh=In.create,qh=pi.create,Kh=rr.create,Yh=ir.create,Jh=rs.create,Gh=On.create,Qh=Mt.create,Xh=fi.create,ep=at.create,tp=xe.create,np=xe.strictCreate,sp=lr.create,rp=gi.create,ip=ar.create,lp=xt.create,ap=or.create,op=yi.create,up=Mn.create,cp=ls.create,dp=ur.create,hp=cr.create,pp=Xt.create,fp=dr.create,mp=as.create,Qo=ot.create,gp=Nt.create,yp=Nn.create,vp=ot.createWithPreprocess,bp=pr.create;var I=Object.freeze({__proto__:null,defaultErrorMap:tr,setErrorMap:Ch,getErrorMap:ci,makeIssue:di,EMPTY_PATH:Eh,addIssueToContext:E,ParseStatus:ze,INVALID:q,DIRTY:Vo,OK:Be,isAborted:xl,isDirty:$l,isValid:nr,isAsync:hi,get util(){return ie},get objectUtil(){return wl},ZodParsedType:T,getParsedType:Jt,ZodType:Q,ZodString:lt,ZodNumber:Gt,ZodBigInt:Qt,ZodBoolean:sr,ZodDate:In,ZodSymbol:pi,ZodUndefined:rr,ZodNull:ir,ZodAny:rs,ZodUnknown:On,ZodNever:Mt,ZodVoid:fi,ZodArray:at,ZodObject:xe,ZodUnion:lr,ZodDiscriminatedUnion:gi,ZodIntersection:ar,ZodTuple:xt,ZodRecord:or,ZodMap:yi,ZodSet:Mn,ZodFunction:ls,ZodLazy:ur,ZodLiteral:cr,ZodEnum:Xt,ZodNativeEnum:dr,ZodPromise:as,ZodEffects:ot,ZodTransformer:ot,ZodOptional:Nt,ZodNullable:Nn,ZodDefault:hr,ZodCatch:vi,ZodNaN:bi,BRAND:Hh,ZodBranded:qo,ZodPipeline:pr,ZodReadonly:_i,custom:Ko,Schema:Q,ZodSchema:Q,late:Uh,get ZodFirstPartyTypeKind(){return H},coerce:{string:n=>lt.create({...n,coerce:!0}),number:n=>Gt.create({...n,coerce:!0}),boolean:n=>sr.create({...n,coerce:!0}),bigint:n=>Qt.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:Jh,array:ep,bigint:Fh,boolean:Go,date:Wh,discriminatedUnion:rp,effect:Qo,enum:pp,function:cp,instanceof:Bh,intersection:ip,lazy:dp,literal:hp,map:op,nan:Vh,nativeEnum:fp,never:Qh,null:Yh,nullable:yp,number:Jo,object:tp,oboolean:()=>Go().optional(),onumber:()=>Jo().optional(),optional:gp,ostring:()=>Yo().optional(),pipeline:bp,preprocess:vp,promise:mp,record:ap,set:up,strictObject:np,string:Yo,symbol:qh,transformer:Qo,tuple:lp,undefined:Kh,union:sp,unknown:Gh,void:Xh,NEVER:q,ZodIssueCode:w,quotelessJson:Th,ZodError:it});const wi=I.object({assistantId:I.string(),params:I.record(I.any()).default({}),config:I.object({historyKey:I.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:I.string().default("Hello! How can I help you today?"),inactivityWarningMessage:I.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:I.string().default("The chat has ended. Please restart the chat to continue."),resetEndedChatOnLoad:I.boolean().default(!1),initialReplyMessage:I.string().nullable().default(null),disclaimerMessage:I.string().nullable().default(null),disclaimerPopover:I.object({message:I.string().nullable().default(null),agreeButtonText:I.string().default("I Agree"),rememberDurationMinutes:I.number().default(60*24*3)}).default({}),simulateDelays:I.boolean().default(!0),placement:I.enum(["left","right"]).default("right"),openChatButton:I.object({imageSrc:I.string().nullable().default(null),width:I.union([I.string(),I.number()]).default("48px"),height:I.union([I.string(),I.number()]).default("48px"),cta:I.string().nullable().default(null)}).default({}),chatWindow:I.object({header:I.object({text:I.string().nullable().default("AI Chat"),imageSrc:I.string().nullable().default(null)}).default({}),showCloseButton:I.boolean().default(!0)}).default({}),styles:I.object({primaryColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null),linkColor:I.string().nullable().default(null),openChatButton:I.object({backgroundColor:I.string().nullable().default(null),iconColor:I.string().nullable().default(null)}).default({}),header:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),button:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),messages:I.object({user:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),assistant:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:I.object({functionCalls:I.record(I.function().returns(I.union([I.any(),I.promise(I.any())]))).default({}),enhancedContent:I.record(I.function().returns(I.union([I.any(),I.promise(I.any())]))).default({})}).default({})});var _p=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,fr=(n,e,t,s)=>{for(var r=s>1?void 0:s?wp(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&_p(e,t,r),r};let Pn=class extends Ye{constructor(){super(...arguments),this.isOpen=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?kh(this):Lo(this)}}connectedCallback(){super.connectedCallback(),this.cleanOptions=wi.parse(this.options),this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),Lo(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const n=this.cleanOptions.config.placement!=="left",e=zo({fixed:!0,"bottom-0":!0,"w-full":this.isOpen,"h-full":this.isOpen,...n&&{"right-0":!0,"md:right-8":!0},...!n&&{"left-0":!0,"md:left-8":!0},"md:bottom-8":!0,"md:w-fit":!0,"md:h-fit":!0}),t=zo({"mt-4":!0,"px-8":!0,"pb-8":!0,"w-full":!0,hidden:this.isOpen,flex:!this.isOpen,"md:px-0":!0,"md:pb-0":!0,"md:w-[350px]":!0,"md:flex":!0});return re`
|
|
271
|
+
*/const Ho="important",Ah=" !"+Ho,En=vl(class extends bl{constructor(n){var e;if(super(n),n.type!==yl.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const s=n[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const r=e[s];if(r!=null){this.ft.add(s);const i=typeof r=="string"&&r.endsWith(Ah);s.includes("-")||i?t.setProperty(s,i?r.slice(0,-11):r,i?Ho:""):t[s]=r}}return Kt}});var Sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _l={};(function(n){function e(a){a&&a.options&&clearTimeout(a.options.timer)}function t(a,o,u,c){var p={timer:void 0,lastArgs:[]},d=function(){for(var g=this,_=[],V=0;V<arguments.length;V++)_[V]=arguments[V];p.lastArgs=_,p.timer?clearTimeout(p.timer):o&&u.apply(this,p.lastArgs),p.timer=setTimeout(function(){o||u.apply(g,p.lastArgs),p.timer=void 0},a)};return c&&(d=d.bind(c)),d.options=p,d}function s(a,o,u,c){var p;Object.defineProperty(u,c,{configurable:!0,enumerable:!1,get:function(){return p},set:function(d){p=t(a,o,d,this)}})}function r(a,o,u){var c=u.value;return u.value=t(a,o,c),u}function i(a,o){for(var u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(u.length===0)throw new Error("function applied debounce decorator should be a method");if(u.length===1)throw new Error("method applied debounce decorator should have valid name");var p=u[0],d=u[1],g=u.length===3&&u[2]?u[2]:Object.getOwnPropertyDescriptor(p,d);if(g)return r(a,o,g);s(a,o,p,d)}function l(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=500,c=!1;if(a.length&&(typeof a[0]=="number"||typeof a[0]=="object"&&a[0].leading!==void 0)){typeof a[0]=="number"&&(u=a[0]);var p=void 0;return typeof a[0]=="object"&&a[0].leading!==void 0&&(p=a[0]),1<a.length&&typeof a[1]=="object"&&a[1].leading!==void 0&&(p=a[1]),p&&(c=p.leading),function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];return i.apply(void 0,[u,c].concat(d))}}return i.apply(void 0,[u,c].concat(a))}Object.defineProperty(n,"__esModule",{value:!0}),n.cancel=e,n.debounce=l})(_l);var ie;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const i={};for(const l of r)i[l]=l;return i},n.getValidEnumValues=r=>{const i=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of i)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(i){return r[i]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const i=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&i.push(l);return i},n.find=(r,i)=>{for(const l of r)if(i(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function s(r,i=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}n.joinValues=s,n.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(ie||(ie={}));var wl;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(wl||(wl={}));const T=ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jt=n=>{switch(typeof n){case"undefined":return T.undefined;case"string":return T.string;case"number":return isNaN(n)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(n)?T.array:n===null?T.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?T.promise:typeof Map<"u"&&n instanceof Map?T.map:typeof Set<"u"&&n instanceof Set?T.set:typeof Date<"u"&&n instanceof Date?T.date:T.object;default:return T.unknown}},w=ie.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"]),Th=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class it extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(i){return i.message},s={_errors:[]},r=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let a=s,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return r(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}it.create=n=>new it(n);const tr=(n,e)=>{let t;switch(n.code){case w.invalid_type:n.received===T.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case w.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ie.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:t=`Unrecognized key(s) in object: ${ie.joinValues(n.keys,", ")}`;break;case w.invalid_union:t="Invalid input";break;case w.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ie.joinValues(n.options)}`;break;case w.invalid_enum_value:t=`Invalid enum value. Expected ${ie.joinValues(n.options)}, received '${n.received}'`;break;case w.invalid_arguments:t="Invalid function arguments";break;case w.invalid_return_type:t="Invalid function return type";break;case w.invalid_date:t="Invalid date";break;case w.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ie.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case w.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case w.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case w.custom:t="Invalid input";break;case w.invalid_intersection_types:t="Intersection results could not be merged";break;case w.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case w.not_finite:t="Number must be finite";break;default:t=e.defaultError,ie.assertNever(n)}return{message:t}};let Bo=tr;function Ch(n){Bo=n}function ci(){return Bo}const di=n=>{const{data:e,path:t,errorMaps:s,issueData:r}=n,i=[...t,...r.path||[]],l={...r,path:i};let a="";const o=s.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:i,message:r.message||a}},Eh=[];function E(n,e){const t=di({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ci(),tr].filter(s=>!!s)});n.common.issues.push(t)}class He{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const r of t){if(r.status==="aborted")return q;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const r of t)s.push({key:await r.key,value:await r.value});return He.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const r of t){const{key:i,value:l}=r;if(i.status==="aborted"||l.status==="aborted")return q;i.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[i.value]=l.value)}return{status:e.value,value:s}}}const q=Object.freeze({status:"aborted"}),Vo=n=>({status:"dirty",value:n}),Be=n=>({status:"valid",value:n}),xl=n=>n.status==="aborted",$l=n=>n.status==="dirty",nr=n=>n.status==="valid",hi=n=>typeof Promise<"u"&&n instanceof Promise;var Z;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Z||(Z={}));class wt{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}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}}const Fo=(n,e)=>{if(nr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new it(n.common.issues);return this._error=t,this._error}}};function Y(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:r}=n;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,l)=>i.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:s??l.defaultError}:{message:t??l.defaultError},description:r}}class Q{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 Jt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new He,ctx:{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const r={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fo(r,i)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(hi(r)?r:Promise.resolve(r));return Fo(s,i)}refine(e,t){const s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const l=e(r),a=()=>i.addIssue({code:w.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new ot({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Nt.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return at.create(this,this._def)}promise(){return as.create(this,this._def)}or(e){return lr.create([this,e],this._def)}and(e){return ar.create(this,e,this._def)}transform(e){return new ot({...Y(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new hr({...Y(this._def),innerType:this,defaultValue:t,typeName:H.ZodDefault})}brand(){return new qo({typeName:H.ZodBranded,type:this,...Y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new vi({...Y(this._def),innerType:this,catchValue:t,typeName:H.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pr.create(this,e)}readonly(){return _i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ih=/^c[^\s-]{8,}$/i,Oh=/^[a-z][a-z0-9]*$/,Mh=/^[0-9A-HJKMNP-TV-Z]{26}$/,Nh=/^[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,Ph=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kl;const jh=/^(((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}))$/,Dh=/^(([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})))$/,Zh=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Lh(n,e){return!!((e==="v4"||!e)&&jh.test(n)||(e==="v6"||!e)&&Dh.test(n))}class lt extends Q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.string,received:r.parsedType}),q}const t=new He;let s;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind==="max")e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind==="length"){const i=e.data.length>r.value,l=e.data.length<r.value;(i||l)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):l&&E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind==="email")Ph.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="emoji")kl||(kl=new RegExp(Rh,"u")),kl.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="uuid")Nh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid")Ih.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid2")Oh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="ulid")Mh.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind==="datetime"?Zh(r).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty()):r.kind==="ip"?Lh(e.data,r.version)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty()):ie.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:w.invalid_string,...Z.errToObj(s)})}_addCheck(e){return new lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...Z.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Z.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Z.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Z.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Z.errToObj(t)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}lt.create=n=>{var e;return new lt({checks:[],typeName:H.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Y(n)})};function zh(n,e){const t=(n.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,i=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return i%l/Math.pow(10,r)}class Gt extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.number,received:r.parsedType}),q}let t;const s=new He;for(const r of this._def.checks)r.kind==="int"?ie.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?zh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_finite,message:r.message}),s.dirty()):ie.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,s,r){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:Z.toString(r)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ie.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Gt.create=n=>new Gt({checks:[],typeName:H.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Y(n)});class Qt extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==T.bigint){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.bigint,received:r.parsedType}),q}let t;const s=new He;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):ie.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,s,r){return new Qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:Z.toString(r)}]})}_addCheck(e){return new Qt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Qt.create=n=>{var e;return new Qt({checks:[],typeName:H.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Y(n)})};class sr extends Q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.boolean,received:t.parsedType}),q}return Be(e.data)}}sr.create=n=>new sr({typeName:H.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Y(n)});class In extends Q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_type,expected:T.date,received:r.parsedType}),q}if(isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return E(r,{code:w.invalid_date}),q}const t=new He;let s;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):ie.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new In({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}In.create=n=>new In({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:H.ZodDate,...Y(n)});class pi extends Q{_parse(e){if(this._getType(e)!==T.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.symbol,received:t.parsedType}),q}return Be(e.data)}}pi.create=n=>new pi({typeName:H.ZodSymbol,...Y(n)});class rr extends Q{_parse(e){if(this._getType(e)!==T.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.undefined,received:t.parsedType}),q}return Be(e.data)}}rr.create=n=>new rr({typeName:H.ZodUndefined,...Y(n)});class ir extends Q{_parse(e){if(this._getType(e)!==T.null){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.null,received:t.parsedType}),q}return Be(e.data)}}ir.create=n=>new ir({typeName:H.ZodNull,...Y(n)});class rs extends Q{constructor(){super(...arguments),this._any=!0}_parse(e){return Be(e.data)}}rs.create=n=>new rs({typeName:H.ZodAny,...Y(n)});class On extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Be(e.data)}}On.create=n=>new On({typeName:H.ZodUnknown,...Y(n)});class Mt extends Q{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.never,received:t.parsedType}),q}}Mt.create=n=>new Mt({typeName:H.ZodNever,...Y(n)});class fi extends Q{_parse(e){if(this._getType(e)!==T.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.void,received:t.parsedType}),q}return Be(e.data)}}fi.create=n=>new fi({typeName:H.ZodVoid,...Y(n)});class at extends Q{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==T.array)return E(t,{code:w.invalid_type,expected:T.array,received:t.parsedType}),q;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&(E(t,{code:l?w.too_big:w.too_small,minimum:a?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(E(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(E(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new wt(t,l,t.path,a)))).then(l=>He.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new wt(t,l,t.path,a)));return He.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new at({...this._def,minLength:{value:e,message:Z.toString(t)}})}max(e,t){return new at({...this._def,maxLength:{value:e,message:Z.toString(t)}})}length(e,t){return new at({...this._def,exactLength:{value:e,message:Z.toString(t)}})}nonempty(e){return this.min(1,e)}}at.create=(n,e)=>new at({type:n,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...Y(e)});function is(n){if(n instanceof xe){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=Nt.create(is(s))}return new xe({...n._def,shape:()=>e})}else return n instanceof at?new at({...n._def,type:is(n.element)}):n instanceof Nt?Nt.create(is(n.unwrap())):n instanceof Nn?Nn.create(is(n.unwrap())):n instanceof xt?xt.create(n.items.map(e=>is(e))):n}class xe extends Q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ie.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==T.object){const o=this._getOrReturnCtx(e);return E(o,{code:w.invalid_type,expected:T.object,received:o.parsedType}),q}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof Mt&&this._def.unknownKeys==="strip"))for(const o in s.data)i.includes(o)||l.push(o);const a=[];for(const o of i){const u=r[o],c=s.data[o];a.push({key:{status:"valid",value:o},value:u._parse(new wt(s,c,s.path,o)),alwaysSet:o in s.data})}if(this._def.catchall instanceof Mt){const o=this._def.unknownKeys;if(o==="passthrough")for(const u of l)a.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(o==="strict")l.length>0&&(E(s,{code:w.unrecognized_keys,keys:l}),t.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const o=this._def.catchall;for(const u of l){const c=s.data[u];a.push({key:{status:"valid",value:u},value:o._parse(new wt(s,c,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const o=[];for(const u of a){const c=await u.key;o.push({key:c,value:await u.value,alwaysSet:u.alwaysSet})}return o}).then(o=>He.mergeObjectSync(t,o)):He.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var r,i,l,a;const o=(l=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,s).message)!==null&&l!==void 0?l:s.defaultError;return t.code==="unrecognized_keys"?{message:(a=Z.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new xe({...this._def,unknownKeys:"strip"})}passthrough(){return new xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:H.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xe({...this._def,catchall:e})}pick(e){const t={};return ie.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new xe({...this._def,shape:()=>t})}omit(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new xe({...this._def,shape:()=>t})}deepPartial(){return is(this)}partial(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new xe({...this._def,shape:()=>t})}required(e){const t={};return ie.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let r=this.shape[s];for(;r instanceof Nt;)r=r._def.innerType;t[s]=r}}),new xe({...this._def,shape:()=>t})}keyof(){return Wo(ie.objectKeys(this.shape))}}xe.create=(n,e)=>new xe({shape:()=>n,unknownKeys:"strip",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)}),xe.strictCreate=(n,e)=>new xe({shape:()=>n,unknownKeys:"strict",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)}),xe.lazycreate=(n,e)=>new xe({shape:n,unknownKeys:"strip",catchall:Mt.create(),typeName:H.ZodObject,...Y(e)});class lr extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function r(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new it(a.ctx.common.issues));return E(t,{code:w.invalid_union,unionErrors:l}),q}if(t.common.async)return Promise.all(s.map(async i=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let i;const l=[];for(const o of s){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(o=>new it(o));return E(t,{code:w.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}}lr.create=(n,e)=>new lr({options:n,typeName:H.ZodUnion,...Y(e)});const mi=n=>n instanceof ur?mi(n.schema):n instanceof ot?mi(n.innerType()):n instanceof cr?[n.value]:n instanceof Xt?n.options:n instanceof dr?Object.keys(n.enum):n instanceof hr?mi(n._def.innerType):n instanceof rr?[void 0]:n instanceof ir?[null]:null;class gi extends Q{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.object)return E(t,{code:w.invalid_type,expected:T.object,received:t.parsedType}),q;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const r=new Map;for(const i of t){const l=mi(i.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,i)}}return new gi({typeName:H.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Y(s)})}}function Al(n,e){const t=Jt(n),s=Jt(e);if(n===e)return{valid:!0,data:n};if(t===T.object&&s===T.object){const r=ie.objectKeys(e),i=ie.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=Al(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===T.array&&s===T.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<n.length;i++){const l=n[i],a=e[i],o=Al(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===T.date&&s===T.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ar extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(xl(i)||xl(l))return q;const a=Al(i.value,l.value);return a.valid?(($l(i)||$l(l))&&t.dirty(),{status:t.value,value:a.data}):(E(s,{code:w.invalid_intersection_types}),q)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,l])=>r(i,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ar.create=(n,e,t)=>new ar({left:n,right:e,typeName:H.ZodIntersection,...Y(t)});class xt extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.array)return E(s,{code:w.invalid_type,expected:T.array,received:s.parsedType}),q;if(s.data.length<this._def.items.length)return E(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...s.data].map((i,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new wt(s,i,s.path,l)):null}).filter(i=>!!i);return s.common.async?Promise.all(r).then(i=>He.mergeArray(t,i)):He.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xt({...this._def,rest:e})}}xt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:n,typeName:H.ZodTuple,rest:null,...Y(e)})};class or extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.object)return E(s,{code:w.invalid_type,expected:T.object,received:s.parsedType}),q;const r=[],i=this._def.keyType,l=this._def.valueType;for(const a in s.data)r.push({key:i._parse(new wt(s,a,s.path,a)),value:l._parse(new wt(s,s.data[a],s.path,a))});return s.common.async?He.mergeObjectAsync(t,r):He.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof Q?new or({keyType:e,valueType:t,typeName:H.ZodRecord,...Y(s)}):new or({keyType:lt.create(),valueType:e,typeName:H.ZodRecord,...Y(t)})}}class yi extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.map)return E(s,{code:w.invalid_type,expected:T.map,received:s.parsedType}),q;const r=this._def.keyType,i=this._def.valueType,l=[...s.data.entries()].map(([a,o],u)=>({key:r._parse(new wt(s,a,s.path,[u,"key"])),value:i._parse(new wt(s,o,s.path,[u,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}yi.create=(n,e,t)=>new yi({valueType:e,keyType:n,typeName:H.ZodMap,...Y(t)});class Mn extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==T.set)return E(s,{code:w.invalid_type,expected:T.set,received:s.parsedType}),q;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(E(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(E(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return q;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...s.data.values()].map((o,u)=>i._parse(new wt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new Mn({...this._def,minSize:{value:e,message:Z.toString(t)}})}max(e,t){return new Mn({...this._def,maxSize:{value:e,message:Z.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Mn.create=(n,e)=>new Mn({valueType:n,minSize:null,maxSize:null,typeName:H.ZodSet,...Y(e)});class ls extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.function)return E(t,{code:w.invalid_type,expected:T.function,received:t.parsedType}),q;function s(a,o){return di({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ci(),tr].filter(u=>!!u),issueData:{code:w.invalid_arguments,argumentsError:o}})}function r(a,o){return di({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ci(),tr].filter(u=>!!u),issueData:{code:w.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof as){const a=this;return Be(async function(...o){const u=new it([]),c=await a._def.args.parseAsync(o,i).catch(d=>{throw u.addIssue(s(o,d)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,i).catch(d=>{throw u.addIssue(r(p,d)),u})})}else{const a=this;return Be(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new it([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new it([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ls({...this._def,args:xt.create(e).rest(On.create())})}returns(e){return new ls({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new ls({args:e||xt.create([]).rest(On.create()),returns:t||On.create(),typeName:H.ZodFunction,...Y(s)})}}class ur extends Q{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ur.create=(n,e)=>new ur({getter:n,typeName:H.ZodLazy,...Y(e)});class cr extends Q{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}cr.create=(n,e)=>new cr({value:n,typeName:H.ZodLiteral,...Y(e)});function Wo(n,e){return new Xt({values:n,typeName:H.ZodEnum,...Y(e)})}class Xt extends Q{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{expected:ie.joinValues(s),received:t.parsedType,code:w.invalid_type}),q}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{received:t.data,code:w.invalid_enum_value,options:s}),q}return Be(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Xt.create(e)}exclude(e){return Xt.create(this.options.filter(t=>!e.includes(t)))}}Xt.create=Wo;class dr extends Q{_parse(e){const t=ie.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==T.string&&s.parsedType!==T.number){const r=ie.objectValues(t);return E(s,{expected:ie.joinValues(r),received:s.parsedType,code:w.invalid_type}),q}if(t.indexOf(e.data)===-1){const r=ie.objectValues(t);return E(s,{received:s.data,code:w.invalid_enum_value,options:r}),q}return Be(e.data)}get enum(){return this._def.values}}dr.create=(n,e)=>new dr({values:n,typeName:H.ZodNativeEnum,...Y(e)});class as extends Q{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.promise&&t.common.async===!1)return E(t,{code:w.invalid_type,expected:T.promise,received:t.parsedType}),q;const s=t.parsedType===T.promise?t.data:Promise.resolve(t.data);return Be(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}as.create=(n,e)=>new as({type:n,typeName:H.ZodPromise,...Y(e)});class ot extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:l=>{E(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const l=r.transform(s.data,i);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:s.path,parent:s})):this._def.schema._parseSync({data:l,path:s.path,parent:s})}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,i);if(s.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?q:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!nr(l))return l;const a=r.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>nr(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);ie.assertNever(r)}}ot.create=(n,e,t)=>new ot({schema:n,typeName:H.ZodEffects,effect:e,...Y(t)}),ot.createWithPreprocess=(n,e,t)=>new ot({schema:e,effect:{type:"preprocess",transform:n},typeName:H.ZodEffects,...Y(t)});class Nt extends Q{_parse(e){return this._getType(e)===T.undefined?Be(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nt.create=(n,e)=>new Nt({innerType:n,typeName:H.ZodOptional,...Y(e)});class Nn extends Q{_parse(e){return this._getType(e)===T.null?Be(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(n,e)=>new Nn({innerType:n,typeName:H.ZodNullable,...Y(e)});class hr extends Q{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===T.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}hr.create=(n,e)=>new hr({innerType:n,typeName:H.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});class vi extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return hi(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new it(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new it(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}vi.create=(n,e)=>new vi({innerType:n,typeName:H.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});class bi extends Q{_parse(e){if(this._getType(e)!==T.nan){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:T.nan,received:t.parsedType}),q}return{status:"valid",value:e.data}}}bi.create=n=>new bi({typeName:H.ZodNaN,...Y(n)});const Hh=Symbol("zod_brand");class qo extends Q{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class pr extends Q{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?q:r.status==="dirty"?(t.dirty(),Vo(r.value)):this._def.out._parseAsync({data:r.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?q:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new pr({in:e,out:t,typeName:H.ZodPipeline})}}class _i extends Q{_parse(e){const t=this._def.innerType._parse(e);return nr(t)&&(t.value=Object.freeze(t.value)),t}}_i.create=(n,e)=>new _i({innerType:n,typeName:H.ZodReadonly,...Y(e)});const Ko=(n,e={},t)=>n?rs.create().superRefine((s,r)=>{var i,l;if(!n(s)){const a=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,o=(l=(i=a.fatal)!==null&&i!==void 0?i:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):rs.create(),Uh={object:xe.lazycreate};var H;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(H||(H={}));const Bh=(n,e={message:`Input not instance of ${n.name}`})=>Ko(t=>t instanceof n,e),Yo=lt.create,Jo=Gt.create,Vh=bi.create,Fh=Qt.create,Go=sr.create,Wh=In.create,qh=pi.create,Kh=rr.create,Yh=ir.create,Jh=rs.create,Gh=On.create,Qh=Mt.create,Xh=fi.create,ep=at.create,tp=xe.create,np=xe.strictCreate,sp=lr.create,rp=gi.create,ip=ar.create,lp=xt.create,ap=or.create,op=yi.create,up=Mn.create,cp=ls.create,dp=ur.create,hp=cr.create,pp=Xt.create,fp=dr.create,mp=as.create,Qo=ot.create,gp=Nt.create,yp=Nn.create,vp=ot.createWithPreprocess,bp=pr.create;var I=Object.freeze({__proto__:null,defaultErrorMap:tr,setErrorMap:Ch,getErrorMap:ci,makeIssue:di,EMPTY_PATH:Eh,addIssueToContext:E,ParseStatus:He,INVALID:q,DIRTY:Vo,OK:Be,isAborted:xl,isDirty:$l,isValid:nr,isAsync:hi,get util(){return ie},get objectUtil(){return wl},ZodParsedType:T,getParsedType:Jt,ZodType:Q,ZodString:lt,ZodNumber:Gt,ZodBigInt:Qt,ZodBoolean:sr,ZodDate:In,ZodSymbol:pi,ZodUndefined:rr,ZodNull:ir,ZodAny:rs,ZodUnknown:On,ZodNever:Mt,ZodVoid:fi,ZodArray:at,ZodObject:xe,ZodUnion:lr,ZodDiscriminatedUnion:gi,ZodIntersection:ar,ZodTuple:xt,ZodRecord:or,ZodMap:yi,ZodSet:Mn,ZodFunction:ls,ZodLazy:ur,ZodLiteral:cr,ZodEnum:Xt,ZodNativeEnum:dr,ZodPromise:as,ZodEffects:ot,ZodTransformer:ot,ZodOptional:Nt,ZodNullable:Nn,ZodDefault:hr,ZodCatch:vi,ZodNaN:bi,BRAND:Hh,ZodBranded:qo,ZodPipeline:pr,ZodReadonly:_i,custom:Ko,Schema:Q,ZodSchema:Q,late:Uh,get ZodFirstPartyTypeKind(){return H},coerce:{string:n=>lt.create({...n,coerce:!0}),number:n=>Gt.create({...n,coerce:!0}),boolean:n=>sr.create({...n,coerce:!0}),bigint:n=>Qt.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:Jh,array:ep,bigint:Fh,boolean:Go,date:Wh,discriminatedUnion:rp,effect:Qo,enum:pp,function:cp,instanceof:Bh,intersection:ip,lazy:dp,literal:hp,map:op,nan:Vh,nativeEnum:fp,never:Qh,null:Yh,nullable:yp,number:Jo,object:tp,oboolean:()=>Go().optional(),onumber:()=>Jo().optional(),optional:gp,ostring:()=>Yo().optional(),pipeline:bp,preprocess:vp,promise:mp,record:ap,set:up,strictObject:np,string:Yo,symbol:qh,transformer:Qo,tuple:lp,undefined:Kh,union:sp,unknown:Gh,void:Xh,NEVER:q,ZodIssueCode:w,quotelessJson:Th,ZodError:it});const wi=I.object({assistantId:I.string(),params:I.record(I.any()).default({}),config:I.object({historyKey:I.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:I.string().default("Hello! How can I help you today?"),inactivityWarningMessage:I.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:I.string().default("The chat has ended. Please restart the chat to continue."),resetEndedChatOnLoad:I.boolean().default(!1),initialReplyMessage:I.string().nullable().default(null),disclaimerMessage:I.string().nullable().default(null),disclaimerPopover:I.object({message:I.string().nullable().default(null),agreeButtonText:I.string().default("I Agree"),rememberDurationMinutes:I.number().default(60*24*3)}).default({}),simulateDelays:I.boolean().default(!0),placement:I.enum(["left","right"]).default("right"),openChatButton:I.object({imageSrc:I.string().nullable().default(null),width:I.union([I.string(),I.number()]).default("48px"),height:I.union([I.string(),I.number()]).default("48px"),cta:I.string().nullable().default(null)}).default({}),chatWindow:I.object({header:I.object({text:I.string().nullable().default("AI Chat"),imageSrc:I.string().nullable().default(null)}).default({}),showCloseButton:I.boolean().default(!0)}).default({}),styles:I.object({primaryColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null),linkColor:I.string().nullable().default(null),openChatButton:I.object({backgroundColor:I.string().nullable().default(null),iconColor:I.string().nullable().default(null)}).default({}),header:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),button:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),messages:I.object({user:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({}),assistant:I.object({backgroundColor:I.string().nullable().default(null),textColor:I.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:I.object({functionCalls:I.record(I.function().returns(I.union([I.any(),I.promise(I.any())]))).default({}),enhancedContent:I.record(I.function().returns(I.union([I.any(),I.promise(I.any())]))).default({})}).default({})});var _p=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,fr=(n,e,t,s)=>{for(var r=s>1?void 0:s?wp(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&_p(e,t,r),r};let Pn=class extends Ye{constructor(){super(...arguments),this.isOpen=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?kh(this):Lo(this)}}connectedCallback(){super.connectedCallback(),this.cleanOptions=wi.parse(this.options),this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),Lo(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const n=this.cleanOptions.config.placement!=="left",e=zo({fixed:!0,"bottom-0":!0,"w-full":this.isOpen,"h-full":this.isOpen,...n&&{"right-0":!0,"md:right-8":!0},...!n&&{"left-0":!0,"md:left-8":!0},"md:bottom-8":!0,"md:w-fit":!0,"md:h-fit":!0}),t=zo({"mt-4":!0,"px-8":!0,"pb-8":!0,"w-full":!0,hidden:this.isOpen,flex:!this.isOpen,"md:px-0":!0,"md:pb-0":!0,"md:w-[350px]":!0,"md:flex":!0});return re`
|
|
272
272
|
<div
|
|
273
273
|
class=${e}
|
|
274
274
|
style=${En({zIndex:"9999",colorScheme:"normal"})}
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
/>
|
|
295
295
|
</div>
|
|
296
296
|
</div>
|
|
297
|
-
`}toggleChat(){this.isOpen=!this.isOpen,this.onResizeHandler()}};Pn.styles=[Ot],fr([ke({type:Object})],Pn.prototype,"options",2),fr([wn()],Pn.prototype,"isOpen",2),fr([si("iai-chat")],Pn.prototype,"chatWindow",2),fr([_l.debounce(250)],Pn.prototype,"onResizeHandler",2),Pn=fr([Et("iai-chat-popup")],Pn);const xi="https://api.ai.inhabit.services";async function xp(n,e={}){const t=await fetch(`${xi}/threads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistantId:n,params:e})});if(!t.ok)throw new Error(`Failed to create thread: ${t.statusText} (${t.status})`);return t.json()}async function $p(n,e="No reason provided"){const t=await fetch(`${xi}/threads/${n}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e})});if(!t.ok)throw new Error(`Failed to end thread: ${t.statusText} (${t.status})`)}async function kp(n,e){const t=await fetch(`${xi}/threads/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to send message: ${t.statusText} (${t.status})`);return t.json()}async function Ap(n,e,t,s=!1){const r=await fetch(`${xi}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:s})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}function Sp(n){return{all:n=n||new Map,on:function(e,t){var s=n.get(e);s?s.push(t):n.set(e,[t])},off:function(e,t){var s=n.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var s=n.get(e);s&&s.slice().map(function(r){r(t)}),(s=n.get("*"))&&s.slice().map(function(r){r(e,t)})}}}class Tp{constructor(e,t={}){if(this._assistantId="",this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this.onStorageEvent=s=>{var r;const[i,l,a]=((r=s.key)==null?void 0:r.split("-"))||[];if(!(i!=="iaiChat"||l!==this.options.historyKey))switch(a){case"messageHistory":this.onMessageHistoryStorageEvent(s);break;case"conversation":this.setConversationDetails(JSON.parse(s.newValue||"null"),!0);break;case"lastActivity":this.keepAlive(JSON.parse(s.newValue||"null"),!0);break;case"chatEndingWarningSent":this.setChatEndingWarningSent(JSON.parse(s.newValue||"false"),!0);break;case"chatEnded":this.setChatEnded(JSON.parse(s.newValue||"false"),!0);break;case"typing":this.setTyping(JSON.parse(s.newValue||"false"),!0);break;case"inputDisabled":this.setInputDisabled(JSON.parse(s.newValue||"false"),!0);break}},this._assistantId=e,this.options={params:{},simulateDelays:!1,resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=Sp(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),t.events&&Object.entries(t.events).forEach(([s,r])=>{this._emitter.on(s,r)}),t.historyKey){this._messages=this.storageGet("messageHistory",[]);const s=this.storageGet("conversation");s&&this.setConversationDetails(s,!0);const r=this.storageGet("chatEndingWarningSent");r&&this.setChatEndingWarningSent(r,!0);const i=this.storageGet("chatEnded");i&&this.setChatEnded(i,!0);const l=this.storageGet("typing");l&&this.setTyping(l,!0);const a=this.storageGet("inputDisabled");a&&this.setInputDisabled(a,!0);const o=this.storageGet("lastActivity");o&&setTimeout(()=>this.keepAlive(o,!0),0),setTimeout(()=>{this.chatEnded&&this.options.resetEndedChatOnLoad&&this.reset()},0),window.addEventListener("storage",this.onStorageEvent)}}onMessageHistoryStorageEvent(e){if(!e.newValue){this.reset();return}const t=JSON.parse(e.newValue),s=this._messages.map(i=>i.id),r=t.map(i=>i.id);this._messages.forEach(i=>{r.includes(i.id)||this._emitter.emit("messageRemoved",i.id)}),t.forEach(i=>{s.includes(i.id)||this._emitter.emit("message",i)}),this._messages=t}async endChat(e,t=!0){!this.threadId||this.chatEnded||(t&&(this._emitter.emit("chatEnded"),this.setChatEnded(!0)),this.stopInactivityTimers(),await $p(this.threadId,e))}reset(e){this.endChat(e,!1).then(()=>{}),this._messages=[],this.setConversationDetails(null),this.setTyping(!1),this.setInputDisabled(!1),this.setChatEnded(!1),this.stopInactivityTimers(),this.storageRemoveAll(),this._emitter.emit("reset")}destroy(){this._emitter.all.clear(),window.removeEventListener("storage",this.onStorageEvent),this.stopInactivityTimers(),this._emitter.emit("destroy")}stopInactivityTimers(){this._inactivityTimeout&&(clearTimeout(this._inactivityTimeout),this._inactivityTimeout=null),this._inactivityWarningTimeout&&(clearTimeout(this._inactivityWarningTimeout),this._inactivityWarningTimeout=null)}keepAlive(e=Date.now(),t=!1){if(this.stopInactivityTimers(),this.chatEnded||!e)return;const{timeUntilChatEnds:s,timeUntilWarnAboutChatEnding:r}=this;if(!s)return;t||this.storageSet("lastActivity",e);const i=Date.now()-e;i>s?(this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)):i>r?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},s-i)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),r-i),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},s-i))}async startChat(){if(this.chatStarted)return;const{id:e,inactivityWaitTime:t,inactivityWarningTime:s}=await xp(this.assistantId,this.params);if(!e)throw new Error("Could not start chat");this.setConversationDetails({threadId:e,inactivityWaitTime:t,inactivityWarningTime:s})}addMessage(e){const t={...e,id:e.id||Math.random().toString(36).substring(7)};return this._messages.push(t),this.storageSet("messageHistory",this._messages),this._emitter.emit("message",t),t}removeMessage(e){this._messages.find(t=>t.id===e)&&(this._messages=this._messages.filter(t=>t.id!==e),this.storageSet("messageHistory",this._messages),this._emitter.emit("messageRemoved",e))}async respondToFunctionCall(e,t,s){if(!this.threadId)throw new Error("Thread not started");try{this.simulateDelay(1800).then(()=>this.setTyping(!0));const r=this.simulateDelay(2e3);this.keepAlive(),await this.insertMessagesWithSimulatedDelays(Promise.all([Ap(this.threadId,e,t,s),r]).then(([i])=>i))}catch(r){this.addMessage({role:"assistant",content:"There was an unexpected error. Please try again later."}),this.setTyping(!1),console.error("Error sending message:",r)}}async sendUserMessage(e){try{this.addMessage({role:"user",content:e}),this.simulateDelay(1800).then(()=>this.setTyping(!0));let t=this.simulateDelay(4800);if(!this.chatStarted){const{initialReplyMessage:i}=this.options;i&&(this.simulateDelay(3800).then(()=>{this.addMessage({role:"assistant",content:i}),this.setTyping(!1)}),this.simulateDelay(6200).then(()=>this.setTyping(!0)),t=this.simulateDelay(8200)),await this.startChat()}this.keepAlive();const{messages:s,functions:r}=await this.insertMessagesWithSimulatedDelays(Promise.all([kp(this.threadId,e),t]).then(([i])=>i));return{messages:s,functions:r}}catch(t){this.addMessage({role:"assistant",content:"There was an unexpected error. Please try again later."}),this.setTyping(!1),console.error("Error sending message:",t)}}setTyping(e,t=!1){this.isTyping=e,this._emitter.emit("typing",e),t||this.storageSet("typing",e)}setConversationDetails(e,t=!1){this._conversationDetails=e,t||this.storageSet("conversation",e)}setInputDisabled(e,t=!1){this.inputDisabled=e,this._emitter.emit("inputDisabled",e),t||this.storageSet("inputDisabled",e)}setChatEnded(e,t=!1){this.chatEnded=e,t||this.storageSet("chatEnded",e)}setChatEndingWarningSent(e,t=!1){this.chatEndingWarningSent=e,t||this.storageSet("chatEndingWarningSent",e)}sendChatEndingWarning(){this.chatEndingWarningSent||(this._emitter.emit("inactivityWarning"),this.setChatEndingWarningSent(!0))}async insertMessagesWithSimulatedDelays(e){const t=await e,{messages:s,functions:r}=t;return await Promise.all(s.map(async(i,l)=>(await this.simulateDelay(1e3*l),this.addMessage(i)))),this.setTyping(!1),r.forEach(i=>this._emitter.emit("functionCall",i)),{messages:s,functions:r}}simulateDelay(e){return this.options.simulateDelays?new Promise(t=>{setTimeout(t,e)}):Promise.resolve()}get assistantId(){return this._assistantId}get params(){return this.options.params}get threadId(){var e;return(e=this._conversationDetails)==null?void 0:e.threadId}get timeUntilChatEnds(){const{inactivityWaitTime:e}=this._conversationDetails||{};return e?e*60*1e3:null}get timeUntilWarnAboutChatEnding(){const{inactivityWaitTime:e=0,inactivityWarningTime:t=0}=this._conversationDetails||{};return(e-t)*60*1e3}get messages(){return this._messages}get chatStarted(){return!!this.threadId}storageSet(e,t){this.options.historyKey&&localStorage.setItem(`iaiChat-${this.options.historyKey}-${e}`,JSON.stringify(t))}storageGet(e,t=null){if(!this.options.historyKey)return null;const s=localStorage.getItem(`iaiChat-${this.options.historyKey}-${e}`);return s?JSON.parse(s):t}storageRemove(e){localStorage.removeItem(`iaiChat-${this.options.historyKey}-${e}`)}storageRemoveAll(){this.options.historyKey&&Object.keys(localStorage).forEach(e=>{e.startsWith(`iaiChat-${this.options.historyKey}-`)&&localStorage.removeItem(e)})}}var Xo={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(Sh,function(){var t=1e3,s=6e4,r=36e5,i="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",_="date",W="Invalid Date",se=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,He=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,We={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var A=["th","st","nd","rd"],x=L%100;return"["+L+(A[(x-20)%10]||A[x]||A[0])+"]"}},oe=function(L,A,x){var N=String(L);return!N||N.length>=A?L:""+Array(A+1-N.length).join(x)+L},qe={s:oe,z:function(L){var A=-L.utcOffset(),x=Math.abs(A),N=Math.floor(x/60),k=x%60;return(A<=0?"+":"-")+oe(N,2,"0")+":"+oe(k,2,"0")},m:function L(A,x){if(A.date()<x.date())return-L(x,A);var N=12*(x.year()-A.year())+(x.month()-A.month()),k=A.clone().add(N,p),U=x-k<0,R=A.clone().add(N+(U?-1:1),p);return+(-(N+(x-k)/(U?k-R:R-k))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:p,y:g,w:c,d:u,D:_,h:o,m:a,s:l,ms:i,Q:d}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},De="en",V={};V[De]=We;var ut="$isDayjsObject",Ae=function(L){return L instanceof Ge||!(!L||!L[ut])},ct=function L(A,x,N){var k;if(!A)return De;if(typeof A=="string"){var U=A.toLowerCase();V[U]&&(k=U),x&&(V[U]=x,k=U);var R=A.split("-");if(!k&&R.length>1)return L(R[0])}else{var le=A.name;V[le]=A,k=le}return!N&&k&&(De=k),k||!N&&De},ve=function(L,A){if(Ae(L))return L.clone();var x=typeof A=="object"?A:{};return x.date=L,x.args=arguments,new Ge(x)},te=qe;te.l=ct,te.i=Ae,te.w=function(L,A){return ve(L,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var Ge=function(){function L(x){this.$L=ct(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[ut]=!0}var A=L.prototype;return A.parse=function(x){this.$d=function(N){var k=N.date,U=N.utc;if(k===null)return new Date(NaN);if(te.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var R=k.match(se);if(R){var le=R[2]-1||0,me=(R[7]||"0").substring(0,3);return U?new Date(Date.UTC(R[1],le,R[3]||1,R[4]||0,R[5]||0,R[6]||0,me)):new Date(R[1],le,R[3]||1,R[4]||0,R[5]||0,R[6]||0,me)}}return new Date(k)}(x),this.init()},A.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},A.$utils=function(){return te},A.isValid=function(){return this.$d.toString()!==W},A.isSame=function(x,N){var k=ve(x);return this.startOf(N)<=k&&k<=this.endOf(N)},A.isAfter=function(x,N){return ve(x)<this.startOf(N)},A.isBefore=function(x,N){return this.endOf(N)<ve(x)},A.$g=function(x,N,k){return te.u(x)?this[N]:this.set(k,x)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(x,N){var k=this,U=!!te.u(N)||N,R=te.p(x),le=function(Xe,Ie){var et=te.w(k.$u?Date.UTC(k.$y,Ie,Xe):new Date(k.$y,Ie,Xe),k);return U?et:et.endOf(u)},me=function(Xe,Ie){return te.w(k.toDate()[Xe].apply(k.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(Ie)),k)},be=this.$W,$e=this.$M,Ee=this.$D,St="set"+(this.$u?"UTC":"");switch(R){case g:return U?le(1,0):le(31,11);case p:return U?le(1,$e):le(0,$e+1);case c:var dt=this.$locale().weekStart||0,jt=(be<dt?be+7:be)-dt;return le(U?Ee-jt:Ee+(6-jt),$e);case u:case _:return me(St+"Hours",0);case o:return me(St+"Minutes",1);case a:return me(St+"Seconds",2);case l:return me(St+"Milliseconds",3);default:return this.clone()}},A.endOf=function(x){return this.startOf(x,!1)},A.$set=function(x,N){var k,U=te.p(x),R="set"+(this.$u?"UTC":""),le=(k={},k[u]=R+"Date",k[_]=R+"Date",k[p]=R+"Month",k[g]=R+"FullYear",k[o]=R+"Hours",k[a]=R+"Minutes",k[l]=R+"Seconds",k[i]=R+"Milliseconds",k)[U],me=U===u?this.$D+(N-this.$W):N;if(U===p||U===g){var be=this.clone().set(_,1);be.$d[le](me),be.init(),this.$d=be.set(_,Math.min(this.$D,be.daysInMonth())).$d}else le&&this.$d[le](me);return this.init(),this},A.set=function(x,N){return this.clone().$set(x,N)},A.get=function(x){return this[te.p(x)]()},A.add=function(x,N){var k,U=this;x=Number(x);var R=te.p(N),le=function($e){var Ee=ve(U);return te.w(Ee.date(Ee.date()+Math.round($e*x)),U)};if(R===p)return this.set(p,this.$M+x);if(R===g)return this.set(g,this.$y+x);if(R===u)return le(1);if(R===c)return le(7);var me=(k={},k[a]=s,k[o]=r,k[l]=t,k)[R]||1,be=this.$d.getTime()+x*me;return te.w(be,this)},A.subtract=function(x,N){return this.add(-1*x,N)},A.format=function(x){var N=this,k=this.$locale();if(!this.isValid())return k.invalidDate||W;var U=x||"YYYY-MM-DDTHH:mm:ssZ",R=te.z(this),le=this.$H,me=this.$m,be=this.$M,$e=k.weekdays,Ee=k.months,St=k.meridiem,dt=function(Ie,et,ht,nn){return Ie&&(Ie[et]||Ie(N,U))||ht[et].slice(0,nn)},jt=function(Ie){return te.s(le%12||12,Ie,"0")},Xe=St||function(Ie,et,ht){var nn=Ie<12?"AM":"PM";return ht?nn.toLowerCase():nn};return U.replace(He,function(Ie,et){return et||function(ht){switch(ht){case"YY":return String(N.$y).slice(-2);case"YYYY":return te.s(N.$y,4,"0");case"M":return be+1;case"MM":return te.s(be+1,2,"0");case"MMM":return dt(k.monthsShort,be,Ee,3);case"MMMM":return dt(Ee,be);case"D":return N.$D;case"DD":return te.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return dt(k.weekdaysMin,N.$W,$e,2);case"ddd":return dt(k.weekdaysShort,N.$W,$e,3);case"dddd":return $e[N.$W];case"H":return String(le);case"HH":return te.s(le,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Xe(le,me,!0);case"A":return Xe(le,me,!1);case"m":return String(me);case"mm":return te.s(me,2,"0");case"s":return String(N.$s);case"ss":return te.s(N.$s,2,"0");case"SSS":return te.s(N.$ms,3,"0");case"Z":return R}return null}(Ie)||R.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(x,N,k){var U,R=this,le=te.p(N),me=ve(x),be=(me.utcOffset()-this.utcOffset())*s,$e=this-me,Ee=function(){return te.m(R,me)};switch(le){case g:U=Ee()/12;break;case p:U=Ee();break;case d:U=Ee()/3;break;case c:U=($e-be)/6048e5;break;case u:U=($e-be)/864e5;break;case o:U=$e/r;break;case a:U=$e/s;break;case l:U=$e/t;break;default:U=$e}return k?U:te.a(U)},A.daysInMonth=function(){return this.endOf(p).$D},A.$locale=function(){return V[this.$L]},A.locale=function(x,N){if(!x)return this.$L;var k=this.clone(),U=ct(x,N,!0);return U&&(k.$L=U),k},A.clone=function(){return te.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},L}(),At=Ge.prototype;return ve.prototype=At,[["$ms",i],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",_]].forEach(function(L){At[L[1]]=function(A){return this.$g(A,L[0],L[1])}}),ve.extend=function(L,A){return L.$i||(L(A,Ge,ve),L.$i=!0),ve},ve.locale=ct,ve.isDayjs=Ae,ve.unix=function(L){return ve(1e3*L)},ve.en=V[De],ve.Ls=V,ve.p={},ve})})(Xo);var Cp=Xo.exports;const eu=Uo(Cp);/**
|
|
297
|
+
`}toggleChat(){this.isOpen=!this.isOpen,this.onResizeHandler()}};Pn.styles=[Ot],fr([ke({type:Object})],Pn.prototype,"options",2),fr([wn()],Pn.prototype,"isOpen",2),fr([si("iai-chat")],Pn.prototype,"chatWindow",2),fr([_l.debounce(250)],Pn.prototype,"onResizeHandler",2),Pn=fr([Et("iai-chat-popup")],Pn);const xi="https://api.ai.inhabit.services";async function xp(n,e={}){const t=await fetch(`${xi}/threads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistantId:n,params:e})});if(!t.ok)throw new Error(`Failed to create thread: ${t.statusText} (${t.status})`);return t.json()}async function $p(n,e="No reason provided"){const t=await fetch(`${xi}/threads/${n}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e})});if(!t.ok)throw new Error(`Failed to end thread: ${t.statusText} (${t.status})`)}async function kp(n,e){const t=await fetch(`${xi}/threads/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to send message: ${t.statusText} (${t.status})`);return t.json()}async function Ap(n,e,t,s=!1){const r=await fetch(`${xi}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:s})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}function Sp(n){return{all:n=n||new Map,on:function(e,t){var s=n.get(e);s?s.push(t):n.set(e,[t])},off:function(e,t){var s=n.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var s=n.get(e);s&&s.slice().map(function(r){r(t)}),(s=n.get("*"))&&s.slice().map(function(r){r(e,t)})}}}class Tp{constructor(e,t={}){if(this._assistantId="",this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this.onStorageEvent=s=>{var r;const[i,l,a]=((r=s.key)==null?void 0:r.split("-"))||[];if(!(i!=="iaiChat"||l!==this.options.historyKey))switch(a){case"messageHistory":this.onMessageHistoryStorageEvent(s);break;case"conversation":this.setConversationDetails(JSON.parse(s.newValue||"null"),!0);break;case"lastActivity":this.keepAlive(JSON.parse(s.newValue||"null"),!0);break;case"chatEndingWarningSent":this.setChatEndingWarningSent(JSON.parse(s.newValue||"false"),!0);break;case"chatEnded":this.setChatEnded(JSON.parse(s.newValue||"false"),!0);break;case"typing":this.setTyping(JSON.parse(s.newValue||"false"),!0);break;case"inputDisabled":this.setInputDisabled(JSON.parse(s.newValue||"false"),!0);break}},this._assistantId=e,this.options={params:{},simulateDelays:!1,resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=Sp(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),t.events&&Object.entries(t.events).forEach(([s,r])=>{this._emitter.on(s,r)}),t.historyKey){this._messages=this.storageGet("messageHistory",[]);const s=this.storageGet("conversation");s&&this.setConversationDetails(s,!0);const r=this.storageGet("chatEndingWarningSent");r&&this.setChatEndingWarningSent(r,!0);const i=this.storageGet("chatEnded");i&&this.setChatEnded(i,!0);const l=this.storageGet("typing");l&&this.setTyping(l,!0);const a=this.storageGet("inputDisabled");a&&this.setInputDisabled(a,!0);const o=this.storageGet("lastActivity");o&&setTimeout(()=>this.keepAlive(o,!0),0),setTimeout(()=>{this.chatEnded&&this.options.resetEndedChatOnLoad&&this.reset()},0),window.addEventListener("storage",this.onStorageEvent)}}onMessageHistoryStorageEvent(e){if(!e.newValue){this.reset();return}const t=JSON.parse(e.newValue),s=this._messages.map(i=>i.id),r=t.map(i=>i.id);this._messages.forEach(i=>{r.includes(i.id)||this._emitter.emit("messageRemoved",i.id)}),t.forEach(i=>{s.includes(i.id)||this._emitter.emit("message",i)}),this._messages=t}async endChat(e,t=!0){!this.threadId||this.chatEnded||(t&&(this._emitter.emit("chatEnded"),this.setChatEnded(!0)),this.stopInactivityTimers(),await $p(this.threadId,e))}reset(e){this.endChat(e,!1).then(()=>{}),this._messages=[],this.setConversationDetails(null),this.setTyping(!1),this.setInputDisabled(!1),this.setChatEnded(!1),this.stopInactivityTimers(),this.storageRemoveAll(),this._emitter.emit("reset")}destroy(){this._emitter.all.clear(),window.removeEventListener("storage",this.onStorageEvent),this.stopInactivityTimers(),this._emitter.emit("destroy")}stopInactivityTimers(){this._inactivityTimeout&&(clearTimeout(this._inactivityTimeout),this._inactivityTimeout=null),this._inactivityWarningTimeout&&(clearTimeout(this._inactivityWarningTimeout),this._inactivityWarningTimeout=null)}keepAlive(e=Date.now(),t=!1){if(this.stopInactivityTimers(),this.chatEnded||!e)return;const{timeUntilChatEnds:s,timeUntilWarnAboutChatEnding:r}=this;if(!s)return;t||this.storageSet("lastActivity",e);const i=Date.now()-e;i>s?(this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)):i>r?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},s-i)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),r-i),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},s-i))}async startChat(){if(this.chatStarted)return;const{id:e,inactivityWaitTime:t,inactivityWarningTime:s}=await xp(this.assistantId,this.params);if(!e)throw new Error("Could not start chat");this.setConversationDetails({threadId:e,inactivityWaitTime:t,inactivityWarningTime:s})}addMessage(e){const t={...e,id:e.id||Math.random().toString(36).substring(7)};return this._messages.push(t),this.storageSet("messageHistory",this._messages),this._emitter.emit("message",t),t}removeMessage(e){this._messages.find(t=>t.id===e)&&(this._messages=this._messages.filter(t=>t.id!==e),this.storageSet("messageHistory",this._messages),this._emitter.emit("messageRemoved",e))}async respondToFunctionCall(e,t,s){if(!this.threadId)throw new Error("Thread not started");try{this.simulateDelay(1800).then(()=>this.setTyping(!0));const r=this.simulateDelay(2e3);this.keepAlive(),await this.insertMessagesWithSimulatedDelays(Promise.all([Ap(this.threadId,e,t,s),r]).then(([i])=>i))}catch(r){this.addMessage({role:"assistant",content:"There was an unexpected error. Please try again later."}),this.setTyping(!1),console.error("Error sending message:",r)}}async sendUserMessage(e){try{this.addMessage({role:"user",content:e}),this.simulateDelay(1800).then(()=>this.setTyping(!0));let t=this.simulateDelay(4800);if(!this.chatStarted){const{initialReplyMessage:i}=this.options;i&&(this.simulateDelay(3800).then(()=>{this.addMessage({role:"assistant",content:i}),this.setTyping(!1)}),this.simulateDelay(6200).then(()=>this.setTyping(!0)),t=this.simulateDelay(8200)),await this.startChat()}this.keepAlive();const{messages:s,functions:r}=await this.insertMessagesWithSimulatedDelays(Promise.all([kp(this.threadId,e),t]).then(([i])=>i));return{messages:s,functions:r}}catch(t){this.addMessage({role:"assistant",content:"There was an unexpected error. Please try again later."}),this.setTyping(!1),console.error("Error sending message:",t)}}setTyping(e,t=!1){this.isTyping=e,this._emitter.emit("typing",e),t||this.storageSet("typing",e)}setConversationDetails(e,t=!1){this._conversationDetails=e,t||this.storageSet("conversation",e)}setInputDisabled(e,t=!1){this.inputDisabled=e,this._emitter.emit("inputDisabled",e),t||this.storageSet("inputDisabled",e)}setChatEnded(e,t=!1){this.chatEnded=e,t||this.storageSet("chatEnded",e)}setChatEndingWarningSent(e,t=!1){this.chatEndingWarningSent=e,t||this.storageSet("chatEndingWarningSent",e)}sendChatEndingWarning(){this.chatEndingWarningSent||(this._emitter.emit("inactivityWarning"),this.setChatEndingWarningSent(!0))}async insertMessagesWithSimulatedDelays(e){const t=await e,{messages:s,functions:r}=t;return await Promise.all(s.map(async(i,l)=>(await this.simulateDelay(1e3*l),this.addMessage(i)))),this.setTyping(!1),r.forEach(i=>this._emitter.emit("functionCall",i)),{messages:s,functions:r}}simulateDelay(e){return this.options.simulateDelays?new Promise(t=>{setTimeout(t,e)}):Promise.resolve()}get assistantId(){return this._assistantId}get params(){return this.options.params}get threadId(){var e;return(e=this._conversationDetails)==null?void 0:e.threadId}get timeUntilChatEnds(){const{inactivityWaitTime:e}=this._conversationDetails||{};return e?e*60*1e3:null}get timeUntilWarnAboutChatEnding(){const{inactivityWaitTime:e=0,inactivityWarningTime:t=0}=this._conversationDetails||{};return(e-t)*60*1e3}get messages(){return this._messages}get chatStarted(){return!!this.threadId}storageSet(e,t){this.options.historyKey&&localStorage.setItem(`iaiChat-${this.options.historyKey}-${e}`,JSON.stringify(t))}storageGet(e,t=null){if(!this.options.historyKey)return null;const s=localStorage.getItem(`iaiChat-${this.options.historyKey}-${e}`);return s?JSON.parse(s):t}storageRemove(e){localStorage.removeItem(`iaiChat-${this.options.historyKey}-${e}`)}storageRemoveAll(){this.options.historyKey&&Object.keys(localStorage).forEach(e=>{e.startsWith(`iaiChat-${this.options.historyKey}-`)&&localStorage.removeItem(e)})}}var Xo={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(Sh,function(){var t=1e3,s=6e4,r=36e5,i="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",_="date",V="Invalid Date",te=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,je=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,We={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var A=["th","st","nd","rd"],x=L%100;return"["+L+(A[(x-20)%10]||A[x]||A[0])+"]"}},oe=function(L,A,x){var N=String(L);return!N||N.length>=A?L:""+Array(A+1-N.length).join(x)+L},qe={s:oe,z:function(L){var A=-L.utcOffset(),x=Math.abs(A),N=Math.floor(x/60),k=x%60;return(A<=0?"+":"-")+oe(N,2,"0")+":"+oe(k,2,"0")},m:function L(A,x){if(A.date()<x.date())return-L(x,A);var N=12*(x.year()-A.year())+(x.month()-A.month()),k=A.clone().add(N,p),U=x-k<0,R=A.clone().add(N+(U?-1:1),p);return+(-(N+(x-k)/(U?k-R:R-k))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:p,y:g,w:c,d:u,D:_,h:o,m:a,s:l,ms:i,Q:d}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},Ze="en",F={};F[Ze]=We;var ut="$isDayjsObject",Ae=function(L){return L instanceof Ge||!(!L||!L[ut])},ct=function L(A,x,N){var k;if(!A)return Ze;if(typeof A=="string"){var U=A.toLowerCase();F[U]&&(k=U),x&&(F[U]=x,k=U);var R=A.split("-");if(!k&&R.length>1)return L(R[0])}else{var le=A.name;F[le]=A,k=le}return!N&&k&&(Ze=k),k||!N&&Ze},ve=function(L,A){if(Ae(L))return L.clone();var x=typeof A=="object"?A:{};return x.date=L,x.args=arguments,new Ge(x)},ne=qe;ne.l=ct,ne.i=Ae,ne.w=function(L,A){return ve(L,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var Ge=function(){function L(x){this.$L=ct(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[ut]=!0}var A=L.prototype;return A.parse=function(x){this.$d=function(N){var k=N.date,U=N.utc;if(k===null)return new Date(NaN);if(ne.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var R=k.match(te);if(R){var le=R[2]-1||0,me=(R[7]||"0").substring(0,3);return U?new Date(Date.UTC(R[1],le,R[3]||1,R[4]||0,R[5]||0,R[6]||0,me)):new Date(R[1],le,R[3]||1,R[4]||0,R[5]||0,R[6]||0,me)}}return new Date(k)}(x),this.init()},A.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},A.$utils=function(){return ne},A.isValid=function(){return this.$d.toString()!==V},A.isSame=function(x,N){var k=ve(x);return this.startOf(N)<=k&&k<=this.endOf(N)},A.isAfter=function(x,N){return ve(x)<this.startOf(N)},A.isBefore=function(x,N){return this.endOf(N)<ve(x)},A.$g=function(x,N,k){return ne.u(x)?this[N]:this.set(k,x)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(x,N){var k=this,U=!!ne.u(N)||N,R=ne.p(x),le=function(Xe,Ie){var et=ne.w(k.$u?Date.UTC(k.$y,Ie,Xe):new Date(k.$y,Ie,Xe),k);return U?et:et.endOf(u)},me=function(Xe,Ie){return ne.w(k.toDate()[Xe].apply(k.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(Ie)),k)},be=this.$W,$e=this.$M,Ee=this.$D,St="set"+(this.$u?"UTC":"");switch(R){case g:return U?le(1,0):le(31,11);case p:return U?le(1,$e):le(0,$e+1);case c:var dt=this.$locale().weekStart||0,jt=(be<dt?be+7:be)-dt;return le(U?Ee-jt:Ee+(6-jt),$e);case u:case _:return me(St+"Hours",0);case o:return me(St+"Minutes",1);case a:return me(St+"Seconds",2);case l:return me(St+"Milliseconds",3);default:return this.clone()}},A.endOf=function(x){return this.startOf(x,!1)},A.$set=function(x,N){var k,U=ne.p(x),R="set"+(this.$u?"UTC":""),le=(k={},k[u]=R+"Date",k[_]=R+"Date",k[p]=R+"Month",k[g]=R+"FullYear",k[o]=R+"Hours",k[a]=R+"Minutes",k[l]=R+"Seconds",k[i]=R+"Milliseconds",k)[U],me=U===u?this.$D+(N-this.$W):N;if(U===p||U===g){var be=this.clone().set(_,1);be.$d[le](me),be.init(),this.$d=be.set(_,Math.min(this.$D,be.daysInMonth())).$d}else le&&this.$d[le](me);return this.init(),this},A.set=function(x,N){return this.clone().$set(x,N)},A.get=function(x){return this[ne.p(x)]()},A.add=function(x,N){var k,U=this;x=Number(x);var R=ne.p(N),le=function($e){var Ee=ve(U);return ne.w(Ee.date(Ee.date()+Math.round($e*x)),U)};if(R===p)return this.set(p,this.$M+x);if(R===g)return this.set(g,this.$y+x);if(R===u)return le(1);if(R===c)return le(7);var me=(k={},k[a]=s,k[o]=r,k[l]=t,k)[R]||1,be=this.$d.getTime()+x*me;return ne.w(be,this)},A.subtract=function(x,N){return this.add(-1*x,N)},A.format=function(x){var N=this,k=this.$locale();if(!this.isValid())return k.invalidDate||V;var U=x||"YYYY-MM-DDTHH:mm:ssZ",R=ne.z(this),le=this.$H,me=this.$m,be=this.$M,$e=k.weekdays,Ee=k.months,St=k.meridiem,dt=function(Ie,et,ht,nn){return Ie&&(Ie[et]||Ie(N,U))||ht[et].slice(0,nn)},jt=function(Ie){return ne.s(le%12||12,Ie,"0")},Xe=St||function(Ie,et,ht){var nn=Ie<12?"AM":"PM";return ht?nn.toLowerCase():nn};return U.replace(je,function(Ie,et){return et||function(ht){switch(ht){case"YY":return String(N.$y).slice(-2);case"YYYY":return ne.s(N.$y,4,"0");case"M":return be+1;case"MM":return ne.s(be+1,2,"0");case"MMM":return dt(k.monthsShort,be,Ee,3);case"MMMM":return dt(Ee,be);case"D":return N.$D;case"DD":return ne.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return dt(k.weekdaysMin,N.$W,$e,2);case"ddd":return dt(k.weekdaysShort,N.$W,$e,3);case"dddd":return $e[N.$W];case"H":return String(le);case"HH":return ne.s(le,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Xe(le,me,!0);case"A":return Xe(le,me,!1);case"m":return String(me);case"mm":return ne.s(me,2,"0");case"s":return String(N.$s);case"ss":return ne.s(N.$s,2,"0");case"SSS":return ne.s(N.$ms,3,"0");case"Z":return R}return null}(Ie)||R.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(x,N,k){var U,R=this,le=ne.p(N),me=ve(x),be=(me.utcOffset()-this.utcOffset())*s,$e=this-me,Ee=function(){return ne.m(R,me)};switch(le){case g:U=Ee()/12;break;case p:U=Ee();break;case d:U=Ee()/3;break;case c:U=($e-be)/6048e5;break;case u:U=($e-be)/864e5;break;case o:U=$e/r;break;case a:U=$e/s;break;case l:U=$e/t;break;default:U=$e}return k?U:ne.a(U)},A.daysInMonth=function(){return this.endOf(p).$D},A.$locale=function(){return F[this.$L]},A.locale=function(x,N){if(!x)return this.$L;var k=this.clone(),U=ct(x,N,!0);return U&&(k.$L=U),k},A.clone=function(){return ne.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},L}(),At=Ge.prototype;return ve.prototype=At,[["$ms",i],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",_]].forEach(function(L){At[L[1]]=function(A){return this.$g(A,L[0],L[1])}}),ve.extend=function(L,A){return L.$i||(L(A,Ge,ve),L.$i=!0),ve},ve.locale=ct,ve.isDayjs=Ae,ve.unix=function(L){return ve(1e3*L)},ve.en=F[Ze],ve.Ls=F,ve.p={},ve})})(Xo);var Cp=Xo.exports;const eu=Uo(Cp);/**
|
|
298
298
|
* @license
|
|
299
299
|
* Copyright 2021 Google LLC
|
|
300
300
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -354,13 +354,13 @@
|
|
|
354
354
|
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],r=Hp(s,t[3]||"");return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(/#$/.test(s)){const r=$i(s,"#");(this.options.pedantic||!r||/ $/.test(r))&&(s=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
355
355
|
$1`);s=$i(s.replace(/^ *>[ \t]?/gm,""),`
|
|
356
356
|
`);const r=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(s);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const r=s.length>1,i={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");const l=new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",o="",u=!1;for(;e;){let c=!1;if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let p=t[2].split(`
|
|
357
|
-
`,1)[0].replace(/^\t+/,
|
|
357
|
+
`,1)[0].replace(/^\t+/,je=>" ".repeat(3*je.length)),d=e.split(`
|
|
358
358
|
`,1)[0],g=0;this.options.pedantic?(g=2,o=p.trimStart()):(g=t[2].search(/[^ ]/),g=g>4?1:g,o=p.slice(g),g+=t[1].length);let _=!1;if(!p&&/^ *$/.test(d)&&(a+=d+`
|
|
359
|
-
`,e=e.substring(d.length+1),c=!0),!c){const
|
|
360
|
-
`,1)[0];if(d=
|
|
359
|
+
`,e=e.substring(d.length+1),c=!0),!c){const je=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),We=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),oe=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),qe=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){const Ze=e.split(`
|
|
360
|
+
`,1)[0];if(d=Ze,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),oe.test(d)||qe.test(d)||je.test(d)||We.test(e))break;if(d.search(/[^ ]/)>=g||!d.trim())o+=`
|
|
361
361
|
`+d.slice(g);else{if(_||p.search(/[^ ]/)>=4||oe.test(p)||qe.test(p)||We.test(p))break;o+=`
|
|
362
|
-
`+d}!_&&!d.trim()&&(_=!0),a+=
|
|
363
|
-
`,e=e.substring(
|
|
362
|
+
`+d}!_&&!d.trim()&&(_=!0),a+=Ze+`
|
|
363
|
+
`,e=e.substring(Ze.length+1),p=d.slice(g)}}i.loose||(u?i.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let V=null,te;this.options.gfm&&(V=/^\[[ xX]\] /.exec(o),V&&(te=V[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!V,checked:te,loose:!1,text:o,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=o.trimEnd(),i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const p=i.items[c].tokens.filter(g=>g.type==="space"),d=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));i.loose=d}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(e){const 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){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:r,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const s=lu(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
364
364
|
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===r.length){for(const a of r)/^ *-+: *$/.test(a)?l.align.push("right"):/^ *:-+: *$/.test(a)?l.align.push("center"):/^ *:-+ *$/.test(a)?l.align.push("left"):l.align.push(null);for(const a of s)l.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of i)l.rows.push(lu(a,l.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return l}}lheading(e){const 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){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
|
|
365
365
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const 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){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Je(t[1])}}tag(e){const 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){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;const l=$i(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{const l=zp(t[2],"()");if(l>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],i=l[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(s)?r=r.slice(1):r=r.slice(1,-1)),au(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const r=(s[2]||s[1]).replace(/\s+/g," "),i=t[r.toLowerCase()];if(!i){const l=s[0].charAt(0);return{type:"text",raw:l,text:l}}return au(s,i,s[0],this.lexer)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&s.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!s||this.rules.inline.punctuation.exec(s))){const i=[...r[0]].length-1;let l,a,o=i,u=0;const c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);(r=c.exec(t))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(a=[...l].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){u+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+u);const p=[...r[0]][0].length,d=e.slice(0,i+r.index+p+a);if(Math.min(i,a)%2){const _=d.slice(1,-1);return{type:"em",raw:d,text:_,tokens:this.lexer.inlineTokens(_)}}const g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(/\n/g," ");const r=/[^ ]/.test(s),i=/^ /.test(s)&&/ $/.test(s);return r&&i&&(s=s.substring(1,s.length-1)),s=Je(s,!0),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const 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){const t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=Je(t[1]),r="mailto:"+s):(s=Je(t[1]),r=s),{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var t;let s;if(s=this.rules.inline.url.exec(e)){let r,i;if(s[2]==="@")r=Je(s[0]),i="mailto:"+r;else{let l;do l=s[0],s[0]=((t=this.rules.inline._backpedal.exec(s[0]))==null?void 0:t[0])??"";while(l!==s[0]);r=Je(s[0]),s[1]==="www."?i="http://"+s[0]:i=s[0]}return{type:"link",raw:s[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let s;return this.lexer.state.inRawBlock?s=t[0]:s=Je(t[0]),{type:"text",raw:t[0],text:s}}}}const Up=/^(?: *(?:\n|$))+/,Bp=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Vp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ou=/(?:[*+-]|\d{1,9}[.)])/,uu=he(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ou).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Cl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wp=/^[^\n]+/,El=/(?!\s*\])(?:\\.|[^\[\]\\])+/,qp=he(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",El).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kp=he(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ou).getRegex(),Ai="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Il=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yp=he("^ {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|$))","i").replace("comment",Il).replace("tag",Ai).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cu=he(Cl).replace("hr",yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",Ai).getRegex(),Jp=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cu).getRegex(),Ol={blockquote:Jp,code:Bp,def:qp,fences:Vp,heading:Fp,hr:yr,html:Yp,lheading:uu,list:Kp,newline:Up,paragraph:cu,table:gr,text:Wp},du=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",Ai).getRegex(),Gp={...Ol,table:du,paragraph:he(Cl).replace("hr",yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",du).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",Ai).getRegex()},Qp={...Ol,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Il).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:gr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he(Cl).replace("hr",yr).replace("heading",` *#{1,6} *[^
|
|
366
366
|
]`).replace("lheading",uu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pu=/^( {2,}|\\)\n(?!\s*$)/,ef=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vr="\\p{P}\\p{S}",tf=he(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,vr).getRegex(),nf=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,sf=he(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,vr).getRegex(),rf=he("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,vr).getRegex(),lf=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,vr).getRegex(),af=he(/\\([punct])/,"gu").replace(/punct/g,vr).getRegex(),of=he(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),uf=he(Il).replace("(?:-->|$)","-->").getRegex(),cf=he("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",uf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Si=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,df=he(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Si).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fu=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Si).replace("ref",El).getRegex(),mu=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",El).getRegex(),hf=he("reflink|nolink(?!\\()","g").replace("reflink",fu).replace("nolink",mu).getRegex(),Ml={_backpedal:gr,anyPunctuation:af,autolink:of,blockSkip:nf,br:pu,code:Xp,del:gr,emStrongLDelim:sf,emStrongRDelimAst:rf,emStrongRDelimUnd:lf,escape:hu,link:df,nolink:mu,punctuation:tf,reflink:fu,reflinkSearch:hf,tag:cf,text:ef,url:gr},pf={...Ml,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Si).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Si).getRegex()},Nl={...Ml,escape:he(hu).replace("])","~|])").getRegex(),url:he(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ff={...Nl,br:he(pu).replace("{2,}","*").getRegex(),text:he(Nl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ti={normal:Ol,gfm:Gp,pedantic:Qp},br={normal:Ml,gfm:Nl,breaks:ff,pedantic:pf};class $t{constructor(e){ye(this,"tokens"),ye(this,"options"),ye(this,"state"),ye(this,"tokenizer"),ye(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rn,this.options.tokenizer=this.options.tokenizer||new ki,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Ti.normal,inline:br.normal};this.options.pedantic?(t.block=Ti.pedantic,t.inline=br.pedantic):this.options.gfm&&(t.block=Ti.gfm,this.options.breaks?t.inline=br.breaks:t.inline=br.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ti,inline:br}}static lex(e,t){return new $t(t).lex(e)}static lexInline(e,t){return new $t(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
@@ -391,7 +391,7 @@ ${e}</blockquote>
|
|
|
391
391
|
`}tablerow(e){return`<tr>
|
|
392
392
|
${e}</tr>
|
|
393
393
|
`}tablecell(e,t){const s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
|
|
394
|
-
`}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,s){const r=iu(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+s+"</a>",i}image(e,t,s){const r=iu(e);if(r===null)return s;e=r;let i=`<img src="${e}" alt="${s}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class Pl{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,s){return""+s}image(e,t,s){return""+s}br(){return""}}class kt{constructor(e){ye(this,"options"),ye(this,"renderer"),ye(this,"textRenderer"),this.options=e||Rn,this.options.renderer=this.options.renderer||new _r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pl}static parse(e,t){return new kt(t).parse(e)}static parseInline(e,t){return new kt(t).parseInline(e)}parse(e,t=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=i,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{s+=this.renderer.hr();continue}case"heading":{const l=i;s+=this.renderer.heading(this.parseInline(l.tokens),l.depth,Zp(this.parseInline(l.tokens,this.textRenderer)));continue}case"code":{const l=i;s+=this.renderer.code(l.text,l.lang,!!l.escaped);continue}case"table":{const l=i;let a="",o="";for(let c=0;c<l.header.length;c++)o+=this.renderer.tablecell(this.parseInline(l.header[c].tokens),{header:!0,align:l.align[c]});a+=this.renderer.tablerow(o);let u="";for(let c=0;c<l.rows.length;c++){const p=l.rows[c];o="";for(let d=0;d<p.length;d++)o+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:l.align[d]});u+=this.renderer.tablerow(o)}s+=this.renderer.table(a,u);continue}case"blockquote":{const l=i,a=this.parse(l.tokens);s+=this.renderer.blockquote(a);continue}case"list":{const l=i,a=l.ordered,o=l.start,u=l.loose;let c="";for(let p=0;p<l.items.length;p++){const d=l.items[p],g=d.checked,_=d.task;let
|
|
394
|
+
`}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,s){const r=iu(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+s+"</a>",i}image(e,t,s){const r=iu(e);if(r===null)return s;e=r;let i=`<img src="${e}" alt="${s}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class Pl{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,s){return""+s}image(e,t,s){return""+s}br(){return""}}class kt{constructor(e){ye(this,"options"),ye(this,"renderer"),ye(this,"textRenderer"),this.options=e||Rn,this.options.renderer=this.options.renderer||new _r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pl}static parse(e,t){return new kt(t).parse(e)}static parseInline(e,t){return new kt(t).parseInline(e)}parse(e,t=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=i,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{s+=this.renderer.hr();continue}case"heading":{const l=i;s+=this.renderer.heading(this.parseInline(l.tokens),l.depth,Zp(this.parseInline(l.tokens,this.textRenderer)));continue}case"code":{const l=i;s+=this.renderer.code(l.text,l.lang,!!l.escaped);continue}case"table":{const l=i;let a="",o="";for(let c=0;c<l.header.length;c++)o+=this.renderer.tablecell(this.parseInline(l.header[c].tokens),{header:!0,align:l.align[c]});a+=this.renderer.tablerow(o);let u="";for(let c=0;c<l.rows.length;c++){const p=l.rows[c];o="";for(let d=0;d<p.length;d++)o+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:l.align[d]});u+=this.renderer.tablerow(o)}s+=this.renderer.table(a,u);continue}case"blockquote":{const l=i,a=this.parse(l.tokens);s+=this.renderer.blockquote(a);continue}case"list":{const l=i,a=l.ordered,o=l.start,u=l.loose;let c="";for(let p=0;p<l.items.length;p++){const d=l.items[p],g=d.checked,_=d.task;let V="";if(d.task){const te=this.renderer.checkbox(!!g);u?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=te+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=te+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:te+" "}):V+=te+" "}V+=this.parse(d.tokens,u),c+=this.renderer.listitem(V,_,!!g)}s+=this.renderer.list(c,a,o);continue}case"html":{const l=i;s+=this.renderer.html(l.text,l.block);continue}case"paragraph":{const l=i;s+=this.renderer.paragraph(this.parseInline(l.tokens));continue}case"text":{let l=i,a=l.tokens?this.parseInline(l.tokens):l.text;for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],a+=`
|
|
395
395
|
`+(l.tokens?this.parseInline(l.tokens):l.text);s+=t?this.renderer.paragraph(a):a;continue}default:{const l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,t){t=t||this.renderer;let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}switch(i.type){case"escape":{const l=i;s+=t.text(l.text);break}case"html":{const l=i;s+=t.html(l.text);break}case"link":{const l=i;s+=t.link(l.href,l.title,this.parseInline(l.tokens,t));break}case"image":{const l=i;s+=t.image(l.href,l.title,l.text);break}case"strong":{const l=i;s+=t.strong(this.parseInline(l.tokens,t));break}case"em":{const l=i;s+=t.em(this.parseInline(l.tokens,t));break}case"codespan":{const l=i;s+=t.codespan(l.text);break}case"br":{s+=t.br();break}case"del":{const l=i;s+=t.del(this.parseInline(l.tokens,t));break}case"text":{const l=i;s+=t.text(l.text);break}default:{const l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}}class wr{constructor(e){ye(this,"options"),this.options=e||Rn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ye(wr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ci,Rl,jl,gu;class yu{constructor(...e){Pa(this,Ci),Pa(this,jl),ye(this,"defaults",Tl()),ye(this,"options",this.setOptions),ye(this,"parse",nl(this,Ci,Rl).call(this,$t.lex,kt.parse)),ye(this,"parseInline",nl(this,Ci,Rl).call(this,$t.lexInline,kt.parseInline)),ye(this,"Parser",kt),ye(this,"Renderer",_r),ye(this,"TextRenderer",Pl),ye(this,"Lexer",$t),ye(this,"Tokenizer",ki),ye(this,"Hooks",wr),this.use(...e)}walkTokens(e,t){var s,r;let i=[];for(const l of e)switch(i=i.concat(t.call(this,l)),l.type){case"table":{const a=l;for(const o of a.header)i=i.concat(this.walkTokens(o.tokens,t));for(const o of a.rows)for(const u of o)i=i.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=l;i=i.concat(this.walkTokens(a.items,t));break}default:{const a=l;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{const u=a[o].flat(1/0);i=i.concat(this.walkTokens(u,t))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const l=t.renderers[i.name];l?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=l.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[i.level];l?l.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){const i=this.defaults.renderer||new _r(this.defaults);for(const l in s.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(l==="options")continue;const a=l,o=s.renderer[a],u=i[a];i[a]=(...c)=>{let p=o.apply(i,c);return p===!1&&(p=u.apply(i,c)),p||""}}r.renderer=i}if(s.tokenizer){const i=this.defaults.tokenizer||new ki(this.defaults);for(const l in s.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const a=l,o=s.tokenizer[a],u=i[a];i[a]=(...c)=>{let p=o.apply(i,c);return p===!1&&(p=u.apply(i,c)),p}}r.tokenizer=i}if(s.hooks){const i=this.defaults.hooks||new wr;for(const l in s.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(l==="options")continue;const a=l,o=s.hooks[a],u=i[a];wr.passThroughHooks.has(l)?i[a]=c=>{if(this.defaults.async)return Promise.resolve(o.call(i,c)).then(d=>u.call(i,d));const p=o.call(i,c);return u.call(i,p)}:i[a]=(...c)=>{let p=o.apply(i,c);return p===!1&&(p=u.apply(i,c)),p}}r.hooks=i}if(s.walkTokens){const i=this.defaults.walkTokens,l=s.walkTokens;r.walkTokens=function(a){let o=[];return o.push(l.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $t.lex(e,t??this.defaults)}parser(e,t){return kt.parse(e,t??this.defaults)}}Ci=new WeakSet,Rl=function(n,e){return(t,s)=>{const r={...s},i={...this.defaults,...r};this.defaults.async===!0&&r.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);const l=nl(this,jl,gu).call(this,!!i.silent,!!i.async);if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(a=>n(a,i)).then(a=>i.hooks?i.hooks.processAllTokens(a):a).then(a=>i.walkTokens?Promise.all(this.walkTokens(a,i.walkTokens)).then(()=>a):a).then(a=>e(a,i)).then(a=>i.hooks?i.hooks.postprocess(a):a).catch(l);try{i.hooks&&(t=i.hooks.preprocess(t));let a=n(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=e(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return l(a)}}},jl=new WeakSet,gu=function(n,e){return t=>{if(t.message+=`
|
|
396
396
|
Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An error occurred:</p><pre>"+Je(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}};const jn=new yu;function pe(n,e){return jn.parse(n,e)}pe.options=pe.setOptions=function(n){return jn.setOptions(n),pe.defaults=jn.defaults,tu(pe.defaults),pe},pe.getDefaults=Tl,pe.defaults=Rn,pe.use=function(...n){return jn.use(...n),pe.defaults=jn.defaults,tu(pe.defaults),pe},pe.walkTokens=function(n,e){return jn.walkTokens(n,e)},pe.parseInline=jn.parseInline,pe.Parser=kt,pe.parser=kt.parse,pe.Renderer=_r,pe.TextRenderer=Pl,pe.Lexer=$t,pe.lexer=$t.lex,pe.Tokenizer=ki,pe.Hooks=wr,pe.parse=pe,pe.options,pe.setOptions,pe.use,pe.walkTokens,pe.parseInline,kt.parse,$t.lex;const Dl=new _r;Dl.link=(n,e,t)=>{const s=document.createElement("a");return s.setAttribute("href",n),s.setAttribute("target","_blank"),s.setAttribute("rel","noopener nofollow"),s.textContent=t,e&&s.setAttribute("title",e),s.outerHTML};const mf=new yu({renderer:Dl});function gf(n){const e=yf(n);return mf.parse(e,{renderer:Dl})}function Zl(n){const e=gf(n);return re`
|
|
397
397
|
<div class="flex flex-col gap-3">
|
|
@@ -524,7 +524,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An err
|
|
|
524
524
|
.name {
|
|
525
525
|
color: #8c8c8c;
|
|
526
526
|
}
|
|
527
|
-
`],Qe([ke({type:Object})],Fe.prototype,"options",2),Qe([ke()],Fe.prototype,"disableInput",2),Qe([ke()],Fe.prototype,"showTyping",2),Qe([wn()],Fe.prototype,"messages",2),Qe([wn()],Fe.prototype,"inputValue",2),Qe([wn()],Fe.prototype,"internalDisableInput",2),Qe([wn()],Fe.prototype,"internalShowTyping",2),Qe([wn()],Fe.prototype,"showPopoverDisclaimer",2),Qe([si("#chat-container")],Fe.prototype,"chatContainer",2),Qe([si("#message-input")],Fe.prototype,"inputElement",2),Qe([_l.debounce(1)],Fe.prototype,"scrollChatToBottom",1),Fe=Qe([Et("iai-chat")],Fe);var wu={exports:{}};(function(n){(function(e){if(typeof window>"u")return;var t=0,s=!1,r=!1,i="message",l=i.length,a="[iFrameSizer]",o=a.length,u=null,c=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},g=null,_=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){Ae("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function W(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function se(y,C,X){y.addEventListener(C,X,!1)}function He(y,C,X){y.removeEventListener(C,X,!1)}function We(){var y=["moz","webkit","o","ms"],C;for(C=0;C<y.length&&!c;C+=1)c=window[y[C]+"RequestAnimationFrame"];c?c=c.bind(window):V("setup","RequestAnimationFrame not supported")}function oe(y){var C="Host page: "+y;return window.top!==window.self&&(C=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+y:"Nested host page: "+y),C}function qe(y){return a+"["+oe(y)+"]"}function De(y){return d[y]?d[y].log:s}function V(y,C){ct("log",y,C,De(y))}function ut(y,C){ct("info",y,C,De(y))}function Ae(y,C){ct("warn",y,C,!0)}function ct(y,C,X,j){j===!0&&typeof window.console=="object"&&console[y](qe(C),X)}function ve(y){function C(){function O(){k(ce),A(F),ue("onResized",ce)}ae("Height"),ae("Width"),U(O,ce,"init")}function X(){var O=yt.slice(o).split(":"),J=O[1]?parseInt(O[1],10):0,fe=d[O[0]]&&d[O[0]].iframe,ge=getComputedStyle(fe);return{iframe:fe,id:O[0],height:J+j(ge)+ee(ge),width:O[2],type:O[3]}}function j(O){if(O.boxSizing!=="border-box")return 0;var J=O.paddingTop?parseInt(O.paddingTop,10):0,fe=O.paddingBottom?parseInt(O.paddingBottom,10):0;return J+fe}function ee(O){if(O.boxSizing!=="border-box")return 0;var J=O.borderTopWidth?parseInt(O.borderTopWidth,10):0,fe=O.borderBottomWidth?parseInt(O.borderBottomWidth,10):0;return J+fe}function ae(O){var J=Number(d[F]["max"+O]),fe=Number(d[F]["min"+O]),ge=O.toLowerCase(),Ze=Number(ce[ge]);V(F,"Checking "+ge+" is in range "+fe+"-"+J),Ze<fe&&(Ze=fe,V(F,"Set "+ge+" to min value")),Ze>J&&(Ze=J,V(F,"Set "+ge+" to max value")),ce[ge]=""+Ze}function tt(){function O(){function ge(){var Ve=0,Zt=!1;for(V(F,"Checking connection is from allowed list of origins: "+fe);Ve<fe.length;Ve++)if(fe[Ve]===J){Zt=!0;break}return Zt}function Ze(){var Ve=d[F]&&d[F].remoteHost;return V(F,"Checking connection is from: "+Ve),J===Ve}return fe.constructor===Array?ge():Ze()}var J=y.origin,fe=d[F]&&d[F].checkOrigin;if(fe&&""+J!="null"&&!O())throw new Error("Unexpected message received from: "+J+" for "+ce.iframe.id+". Message was: "+y.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Dt(){return a===(""+yt).slice(0,o)&&yt.slice(o).split(":")[0]in d}function pt(){var O=ce.type in{true:1,false:1,undefined:1};return O&&V(F,"Ignoring init message from meta parent page"),O}function ft(O){return yt.slice(yt.indexOf(":")+l+O)}function mt(O){V(F,"onMessage passed: {iframe: "+ce.iframe.id+", message: "+O+"}"),ue("onMessage",{iframe:ce.iframe,message:JSON.parse(O)}),V(F,"--")}function Tr(){var O=document.body.getBoundingClientRect(),J=ce.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:J.height,iframeWidth:J.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(J.top-O.top,10),offsetLeft:parseInt(J.left-O.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function ds(O,J){function fe(){R("Send Page Info","pageInfo:"+Tr(),O,J)}St(fe,32,J)}function Cr(){function O(Ze,Ve){function Zt(){d[ge]?ds(d[ge].iframe,ge):J()}["scroll","resize"].forEach(function(Cu){V(ge,Ze+Cu+" listener for sendPageInfo"),Ve(window,Cu,Zt)})}function J(){O("Remove ",He)}function fe(){O("Add ",se)}var ge=F;fe(),d[ge]&&(d[ge].stopPageInfo=J)}function hs(){d[F]&&d[F].stopPageInfo&&(d[F].stopPageInfo(),delete d[F].stopPageInfo)}function h(){var O=!0;return ce.iframe===null&&(Ae(F,"IFrame ("+ce.id+") not found"),O=!1),O}function f(O){var J=O.getBoundingClientRect();return L(F),{x:Math.floor(Number(J.left)+Number(u.x)),y:Math.floor(Number(J.top)+Number(u.y))}}function m(O){function J(){u=Ve,v(),V(F,"--")}function fe(){return{x:Number(ce.width)+Ze.x,y:Number(ce.height)+Ze.y}}function ge(){window.parentIFrame?window.parentIFrame["scrollTo"+(O?"Offset":"")](Ve.x,Ve.y):Ae(F,"Unable to scroll to requested position, window.parentIFrame not found")}var Ze=O?f(ce.iframe):{x:0,y:0},Ve=fe();V(F,"Reposition requested from iFrame (offset x:"+Ze.x+" y:"+Ze.y+")"),window.top===window.self?J():ge()}function v(){ue("onScroll",u)===!1?x():A(F)}function M(O){function J(){var Zt=f(Ve);V(F,"Moving to in page link (#"+ge+") at x: "+Zt.x+" y: "+Zt.y),u={x:Zt.x,y:Zt.y},v(),V(F,"--")}function fe(){window.parentIFrame?window.parentIFrame.moveToAnchor(ge):V(F,"In page link #"+ge+" not found and window.parentIFrame not found")}var ge=O.split("#")[1]||"",Ze=decodeURIComponent(ge),Ve=document.getElementById(Ze)||document.getElementsByName(Ze)[0];Ve?J():window.top===window.self?V(F,"In page link #"+ge+" not found"):fe()}function D(O){var J={};if(Number(ce.width)===0&&Number(ce.height)===0){var fe=ft(9).split(":");J={x:fe[1],y:fe[0]}}else J={x:ce.width,y:ce.height};ue(O,{iframe:ce.iframe,screenX:Number(J.x),screenY:Number(J.y),type:ce.type})}function ue(O,J){return te(F,O,J)}function Se(){switch(d[F]&&d[F].firstRun&&Er(),ce.type){case"close":{At(ce.iframe);break}case"message":{mt(ft(6));break}case"mouseenter":{D("onMouseEnter");break}case"mouseleave":{D("onMouseLeave");break}case"autoResize":{d[F].autoResize=JSON.parse(ft(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{ds(d[F]&&d[F].iframe,F),Cr();break}case"pageInfoStop":{hs();break}case"inPageLink":{M(ft(9));break}case"reset":{N(ce);break}case"init":{C(),ue("onInit",ce.iframe);break}default:Number(ce.width)===0&&Number(ce.height)===0?Ae("Unsupported message received ("+ce.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):C()}}function je(O){var J=!0;return d[O]||(J=!1,Ae(ce.type+" No settings for "+O+". Message was: "+yt)),J}function gt(){for(var O in d)R("iFrame requested init",le(O),d[O].iframe,O)}function Er(){d[F]&&(d[F].firstRun=!1)}var yt=y.data,ce={},F=null;yt==="[iFrameResizerChild]Ready"?gt():Dt()?(ce=X(),F=ce.id,d[F]&&(d[F].loaded=!0),!pt()&&je(F)&&(V(F,"Received: "+yt),h()&&tt()&&Se())):ut(F,"Ignored: "+yt)}function te(y,C,X){var j=null,ee=null;if(d[y])if(j=d[y][C],typeof j=="function")ee=j(X);else throw new TypeError(C+" on iFrame["+y+"] is not a function");return ee}function Ge(y){var C=y.id;delete d[C]}function At(y){var C=y.id;if(te(C,"onClose",C)===!1){V(C,"Close iframe cancelled by onClose event");return}V(C,"Removing iFrame: "+C);try{y.parentNode&&y.parentNode.removeChild(y)}catch(X){Ae(X)}te(C,"onClosed",C),V(C,"--"),Ge(y)}function L(y){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},V(y,"Get page position: "+u.x+","+u.y))}function A(y){u!==null&&(window.scrollTo(u.x,u.y),V(y,"Set page position: "+u.x+","+u.y),x())}function x(){u=null}function N(y){function C(){k(y),R("reset","reset",y.iframe,y.id)}V(y.id,"Size reset requested by "+(y.type==="init"?"host page":"iFrame")),L(y.id),U(C,y,"reset")}function k(y){function C(ae){if(!y.id){V("undefined","messageData id not set");return}y.iframe.style[ae]=y[ae]+"px",V(y.id,"IFrame ("+ee+") "+ae+" set to "+y[ae]+"px")}function X(ae){!r&&y[ae]==="0"&&(r=!0,V(ee,"Hidden iFrame detected, creating visibility listener"),dt())}function j(ae){C(ae),X(ae)}var ee=y.iframe.id;d[ee]&&(d[ee].sizeHeight&&j("height"),d[ee].sizeWidth&&j("width"))}function U(y,C,X){X!==C.type&&c&&!window.jasmine?(V(C.id,"Requesting animation frame"),c(y)):y()}function R(y,C,X,j,ee){function ae(){var mt=d[j]&&d[j].targetOrigin;V(j,"["+y+"] Sending msg to iframe["+j+"] ("+C+") targetOrigin: "+mt),X.contentWindow.postMessage(a+C,mt)}function tt(){Ae(j,"["+y+"] IFrame("+j+") not found")}function Dt(){X&&"contentWindow"in X&&X.contentWindow!==null?ae():tt()}function pt(){function mt(){d[j]&&!d[j].loaded&&!ft&&(ft=!0,Ae(j,"IFrame has not responded within "+d[j].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}ee&&d[j]&&d[j].warningTimeout&&(d[j].msgTimeout=setTimeout(mt,d[j].warningTimeout))}var ft=!1;j=j||X.id,d[j]&&(Dt(),pt())}function le(y){return y+":"+d[y].bodyMarginV1+":"+d[y].sizeWidth+":"+d[y].log+":"+d[y].interval+":"+d[y].enablePublicMethods+":"+d[y].autoResize+":"+d[y].bodyMargin+":"+d[y].heightCalculationMethod+":"+d[y].bodyBackground+":"+d[y].bodyPadding+":"+d[y].tolerance+":"+d[y].inPageLinks+":"+d[y].resizeFrom+":"+d[y].widthCalculationMethod+":"+d[y].mouseEvents}function me(y){return typeof y=="number"}function be(y,C){function X(){function m(M){var D=d[f][M];D!==1/0&&D!==0&&(y.style[M]=me(D)?D+"px":D,V(f,"Set "+M+" = "+y.style[M]))}function v(M){if(d[f]["min"+M]>d[f]["max"+M])throw new Error("Value for min"+M+" can not be greater than max"+M)}v("Height"),v("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function j(){var m=C&&C.id||_.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function ee(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(y.id=m=j(),s=(C||{}).log,V(m,"Added missing iframe ID: "+m+" ("+y.src+")")),m}function ae(){switch(V(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),y.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{y.scrolling="yes";break}case!1:{y.scrolling="no";break}default:y.scrolling=d[f]?d[f].scrolling:"no"}}function tt(){(typeof(d[f]&&d[f].bodyMargin)=="number"||(d[f]&&d[f].bodyMargin)==="0")&&(d[f].bodyMarginV1=d[f].bodyMargin,d[f].bodyMargin=""+d[f].bodyMargin+"px")}function Dt(){var m=d[f]&&d[f].firstRun,v=d[f]&&d[f].heightCalculationMethod in p;!m&&v&&N({iframe:y,height:0,width:0,type:"init"})}function pt(){d[f]&&(d[f].iframe.iFrameResizer={close:At.bind(null,d[f].iframe),removeListeners:Ge.bind(null,d[f].iframe),resize:R.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){R("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),R("Send Message","message:"+m,d[f].iframe,f)}})}function ft(m){function v(){R("iFrame.onload",m,y,e,!0),Dt()}function M(ue){if(y.parentNode){var Se=new ue(function(je){je.forEach(function(gt){var Er=Array.prototype.slice.call(gt.removedNodes);Er.forEach(function(yt){yt===y&&At(y)})})});Se.observe(y.parentNode,{childList:!0})}}var D=W();D&&M(D),se(y,"load",v),R("init",m,y,e,!0)}function mt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Tr(m){for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(d[f][v]=Object.prototype.hasOwnProperty.call(m,v)?m[v]:_[v])}function ds(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Cr(m){var v=m.split("Callback");if(v.length===2){var M="on"+v[0].charAt(0).toUpperCase()+v[0].slice(1);this[M]=this[m],delete this[m],Ae(f,"Deprecated: '"+m+"' has been renamed '"+M+"'. The old method will be removed in the next major version.")}}function hs(m){m=m||{},d[f]=Object.create(null),d[f].iframe=y,d[f].firstRun=!0,d[f].remoteHost=y.src&&y.src.split("/").slice(0,3).join("/"),mt(m),Object.keys(m).forEach(Cr,m),Tr(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?ds(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in y}var f=ee(y.id);h()?Ae(f,"Ignored iFrame, already setup."):(hs(C),ae(),X(),tt(),ft(le(f)),pt())}function $e(y,C){g===null&&(g=setTimeout(function(){g=null,y()},C))}var Ee={};function St(y,C,X){Ee[X]||(Ee[X]=setTimeout(function(){Ee[X]=null,y()},C))}function dt(){function y(){function ee(ae){function tt(pt){return(d[ae]&&d[ae].iframe.style[pt])==="0px"}function Dt(pt){return pt.offsetParent!==null}d[ae]&&Dt(d[ae].iframe)&&(tt("height")||tt("width"))&&R("Visibility change","resize",d[ae].iframe,ae)}Object.keys(d).forEach(function(ae){ee(ae)})}function C(ee){V("window","Mutation observed: "+ee[0].target+" "+ee[0].type),$e(y,16)}function X(){var ee=document.querySelector("body"),ae={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},tt=new j(C);tt.observe(ee,ae)}var j=W();j&&X()}function jt(y){function C(){Ie("Window "+y,"resize")}V("window","Trigger event: "+y),$e(C,16)}function Xe(){function y(){Ie("Tab Visible","resize")}document.visibilityState!=="hidden"&&(V("document","Trigger event: Visibility change"),$e(y,16))}function Ie(y,C){function X(j){return d[j]&&d[j].resizeFrom==="parent"&&d[j].autoResize&&!d[j].firstRun}Object.keys(d).forEach(function(j){X(j)&&R(y,C,d[j].iframe,j)})}function et(){se(window,"message",ve),se(window,"resize",function(){jt("resize")}),se(document,"visibilitychange",Xe),se(document,"-webkit-visibilitychange",Xe)}function ht(){function y(j,ee){function ae(){if(ee.tagName){if(ee.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+ee.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}ee&&(ae(),be(ee,j),X.push(ee))}function C(j){j&&j.enablePublicMethods&&Ae("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var X;return We(),et(),function(j,ee){switch(X=[],C(j),typeof ee){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(ee||"iframe"),y.bind(e,j));break}case"object":{y(j,ee);break}default:throw new TypeError("Unexpected data type ("+typeof ee+")")}return X}}function nn(y){y.fn?y.fn.iFrameResize||(y.fn.iFrameResize=function(C){function X(j,ee){be(ee,C)}return this.filter("iframe").each(X).end()}):ut("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&nn(window.jQuery),typeof e=="function"&&e.amd?e([],ht):n.exports=ht(),window.iFrameResize=window.iFrameResize||ht()})()})(wu);var _f=wu.exports;const wf=Uo(_f);var xf=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,Ll=(n,e,t,s)=>{for(var r=s>1?void 0:s?$f(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&xf(e,t,r),r};let xr=class extends Ye{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){wf({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},n.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return re`
|
|
527
|
+
`],Qe([ke({type:Object})],Fe.prototype,"options",2),Qe([ke()],Fe.prototype,"disableInput",2),Qe([ke()],Fe.prototype,"showTyping",2),Qe([wn()],Fe.prototype,"messages",2),Qe([wn()],Fe.prototype,"inputValue",2),Qe([wn()],Fe.prototype,"internalDisableInput",2),Qe([wn()],Fe.prototype,"internalShowTyping",2),Qe([wn()],Fe.prototype,"showPopoverDisclaimer",2),Qe([si("#chat-container")],Fe.prototype,"chatContainer",2),Qe([si("#message-input")],Fe.prototype,"inputElement",2),Qe([_l.debounce(1)],Fe.prototype,"scrollChatToBottom",1),Fe=Qe([Et("iai-chat")],Fe);var wu={exports:{}};(function(n){(function(e){if(typeof window>"u")return;var t=0,s=!1,r=!1,i="message",l=i.length,a="[iFrameSizer]",o=a.length,u=null,c=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},g=null,_=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){Ae("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function V(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function te(y,C,X){y.addEventListener(C,X,!1)}function je(y,C,X){y.removeEventListener(C,X,!1)}function We(){var y=["moz","webkit","o","ms"],C;for(C=0;C<y.length&&!c;C+=1)c=window[y[C]+"RequestAnimationFrame"];c?c=c.bind(window):F("setup","RequestAnimationFrame not supported")}function oe(y){var C="Host page: "+y;return window.top!==window.self&&(C=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+y:"Nested host page: "+y),C}function qe(y){return a+"["+oe(y)+"]"}function Ze(y){return d[y]?d[y].log:s}function F(y,C){ct("log",y,C,Ze(y))}function ut(y,C){ct("info",y,C,Ze(y))}function Ae(y,C){ct("warn",y,C,!0)}function ct(y,C,X,j){j===!0&&typeof window.console=="object"&&console[y](qe(C),X)}function ve(y){function C(){function O(){k(ce),A(W),ue("onResized",ce)}ae("Height"),ae("Width"),U(O,ce,"init")}function X(){var O=yt.slice(o).split(":"),J=O[1]?parseInt(O[1],10):0,fe=d[O[0]]&&d[O[0]].iframe,ge=getComputedStyle(fe);return{iframe:fe,id:O[0],height:J+j(ge)+ee(ge),width:O[2],type:O[3]}}function j(O){if(O.boxSizing!=="border-box")return 0;var J=O.paddingTop?parseInt(O.paddingTop,10):0,fe=O.paddingBottom?parseInt(O.paddingBottom,10):0;return J+fe}function ee(O){if(O.boxSizing!=="border-box")return 0;var J=O.borderTopWidth?parseInt(O.borderTopWidth,10):0,fe=O.borderBottomWidth?parseInt(O.borderBottomWidth,10):0;return J+fe}function ae(O){var J=Number(d[W]["max"+O]),fe=Number(d[W]["min"+O]),ge=O.toLowerCase(),Le=Number(ce[ge]);F(W,"Checking "+ge+" is in range "+fe+"-"+J),Le<fe&&(Le=fe,F(W,"Set "+ge+" to min value")),Le>J&&(Le=J,F(W,"Set "+ge+" to max value")),ce[ge]=""+Le}function tt(){function O(){function ge(){var Ve=0,Zt=!1;for(F(W,"Checking connection is from allowed list of origins: "+fe);Ve<fe.length;Ve++)if(fe[Ve]===J){Zt=!0;break}return Zt}function Le(){var Ve=d[W]&&d[W].remoteHost;return F(W,"Checking connection is from: "+Ve),J===Ve}return fe.constructor===Array?ge():Le()}var J=y.origin,fe=d[W]&&d[W].checkOrigin;if(fe&&""+J!="null"&&!O())throw new Error("Unexpected message received from: "+J+" for "+ce.iframe.id+". Message was: "+y.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Dt(){return a===(""+yt).slice(0,o)&&yt.slice(o).split(":")[0]in d}function pt(){var O=ce.type in{true:1,false:1,undefined:1};return O&&F(W,"Ignoring init message from meta parent page"),O}function ft(O){return yt.slice(yt.indexOf(":")+l+O)}function mt(O){F(W,"onMessage passed: {iframe: "+ce.iframe.id+", message: "+O+"}"),ue("onMessage",{iframe:ce.iframe,message:JSON.parse(O)}),F(W,"--")}function Tr(){var O=document.body.getBoundingClientRect(),J=ce.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:J.height,iframeWidth:J.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(J.top-O.top,10),offsetLeft:parseInt(J.left-O.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function ds(O,J){function fe(){R("Send Page Info","pageInfo:"+Tr(),O,J)}St(fe,32,J)}function Cr(){function O(Le,Ve){function Zt(){d[ge]?ds(d[ge].iframe,ge):J()}["scroll","resize"].forEach(function(Cu){F(ge,Le+Cu+" listener for sendPageInfo"),Ve(window,Cu,Zt)})}function J(){O("Remove ",je)}function fe(){O("Add ",te)}var ge=W;fe(),d[ge]&&(d[ge].stopPageInfo=J)}function hs(){d[W]&&d[W].stopPageInfo&&(d[W].stopPageInfo(),delete d[W].stopPageInfo)}function h(){var O=!0;return ce.iframe===null&&(Ae(W,"IFrame ("+ce.id+") not found"),O=!1),O}function f(O){var J=O.getBoundingClientRect();return L(W),{x:Math.floor(Number(J.left)+Number(u.x)),y:Math.floor(Number(J.top)+Number(u.y))}}function m(O){function J(){u=Ve,v(),F(W,"--")}function fe(){return{x:Number(ce.width)+Le.x,y:Number(ce.height)+Le.y}}function ge(){window.parentIFrame?window.parentIFrame["scrollTo"+(O?"Offset":"")](Ve.x,Ve.y):Ae(W,"Unable to scroll to requested position, window.parentIFrame not found")}var Le=O?f(ce.iframe):{x:0,y:0},Ve=fe();F(W,"Reposition requested from iFrame (offset x:"+Le.x+" y:"+Le.y+")"),window.top===window.self?J():ge()}function v(){ue("onScroll",u)===!1?x():A(W)}function M(O){function J(){var Zt=f(Ve);F(W,"Moving to in page link (#"+ge+") at x: "+Zt.x+" y: "+Zt.y),u={x:Zt.x,y:Zt.y},v(),F(W,"--")}function fe(){window.parentIFrame?window.parentIFrame.moveToAnchor(ge):F(W,"In page link #"+ge+" not found and window.parentIFrame not found")}var ge=O.split("#")[1]||"",Le=decodeURIComponent(ge),Ve=document.getElementById(Le)||document.getElementsByName(Le)[0];Ve?J():window.top===window.self?F(W,"In page link #"+ge+" not found"):fe()}function D(O){var J={};if(Number(ce.width)===0&&Number(ce.height)===0){var fe=ft(9).split(":");J={x:fe[1],y:fe[0]}}else J={x:ce.width,y:ce.height};ue(O,{iframe:ce.iframe,screenX:Number(J.x),screenY:Number(J.y),type:ce.type})}function ue(O,J){return ne(W,O,J)}function Se(){switch(d[W]&&d[W].firstRun&&Er(),ce.type){case"close":{At(ce.iframe);break}case"message":{mt(ft(6));break}case"mouseenter":{D("onMouseEnter");break}case"mouseleave":{D("onMouseLeave");break}case"autoResize":{d[W].autoResize=JSON.parse(ft(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{ds(d[W]&&d[W].iframe,W),Cr();break}case"pageInfoStop":{hs();break}case"inPageLink":{M(ft(9));break}case"reset":{N(ce);break}case"init":{C(),ue("onInit",ce.iframe);break}default:Number(ce.width)===0&&Number(ce.height)===0?Ae("Unsupported message received ("+ce.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):C()}}function De(O){var J=!0;return d[O]||(J=!1,Ae(ce.type+" No settings for "+O+". Message was: "+yt)),J}function gt(){for(var O in d)R("iFrame requested init",le(O),d[O].iframe,O)}function Er(){d[W]&&(d[W].firstRun=!1)}var yt=y.data,ce={},W=null;yt==="[iFrameResizerChild]Ready"?gt():Dt()?(ce=X(),W=ce.id,d[W]&&(d[W].loaded=!0),!pt()&&De(W)&&(F(W,"Received: "+yt),h()&&tt()&&Se())):ut(W,"Ignored: "+yt)}function ne(y,C,X){var j=null,ee=null;if(d[y])if(j=d[y][C],typeof j=="function")ee=j(X);else throw new TypeError(C+" on iFrame["+y+"] is not a function");return ee}function Ge(y){var C=y.id;delete d[C]}function At(y){var C=y.id;if(ne(C,"onClose",C)===!1){F(C,"Close iframe cancelled by onClose event");return}F(C,"Removing iFrame: "+C);try{y.parentNode&&y.parentNode.removeChild(y)}catch(X){Ae(X)}ne(C,"onClosed",C),F(C,"--"),Ge(y)}function L(y){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},F(y,"Get page position: "+u.x+","+u.y))}function A(y){u!==null&&(window.scrollTo(u.x,u.y),F(y,"Set page position: "+u.x+","+u.y),x())}function x(){u=null}function N(y){function C(){k(y),R("reset","reset",y.iframe,y.id)}F(y.id,"Size reset requested by "+(y.type==="init"?"host page":"iFrame")),L(y.id),U(C,y,"reset")}function k(y){function C(ae){if(!y.id){F("undefined","messageData id not set");return}y.iframe.style[ae]=y[ae]+"px",F(y.id,"IFrame ("+ee+") "+ae+" set to "+y[ae]+"px")}function X(ae){!r&&y[ae]==="0"&&(r=!0,F(ee,"Hidden iFrame detected, creating visibility listener"),dt())}function j(ae){C(ae),X(ae)}var ee=y.iframe.id;d[ee]&&(d[ee].sizeHeight&&j("height"),d[ee].sizeWidth&&j("width"))}function U(y,C,X){X!==C.type&&c&&!window.jasmine?(F(C.id,"Requesting animation frame"),c(y)):y()}function R(y,C,X,j,ee){function ae(){var mt=d[j]&&d[j].targetOrigin;F(j,"["+y+"] Sending msg to iframe["+j+"] ("+C+") targetOrigin: "+mt),X.contentWindow.postMessage(a+C,mt)}function tt(){Ae(j,"["+y+"] IFrame("+j+") not found")}function Dt(){X&&"contentWindow"in X&&X.contentWindow!==null?ae():tt()}function pt(){function mt(){d[j]&&!d[j].loaded&&!ft&&(ft=!0,Ae(j,"IFrame has not responded within "+d[j].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}ee&&d[j]&&d[j].warningTimeout&&(d[j].msgTimeout=setTimeout(mt,d[j].warningTimeout))}var ft=!1;j=j||X.id,d[j]&&(Dt(),pt())}function le(y){return y+":"+d[y].bodyMarginV1+":"+d[y].sizeWidth+":"+d[y].log+":"+d[y].interval+":"+d[y].enablePublicMethods+":"+d[y].autoResize+":"+d[y].bodyMargin+":"+d[y].heightCalculationMethod+":"+d[y].bodyBackground+":"+d[y].bodyPadding+":"+d[y].tolerance+":"+d[y].inPageLinks+":"+d[y].resizeFrom+":"+d[y].widthCalculationMethod+":"+d[y].mouseEvents}function me(y){return typeof y=="number"}function be(y,C){function X(){function m(M){var D=d[f][M];D!==1/0&&D!==0&&(y.style[M]=me(D)?D+"px":D,F(f,"Set "+M+" = "+y.style[M]))}function v(M){if(d[f]["min"+M]>d[f]["max"+M])throw new Error("Value for min"+M+" can not be greater than max"+M)}v("Height"),v("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function j(){var m=C&&C.id||_.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function ee(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(y.id=m=j(),s=(C||{}).log,F(m,"Added missing iframe ID: "+m+" ("+y.src+")")),m}function ae(){switch(F(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),y.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{y.scrolling="yes";break}case!1:{y.scrolling="no";break}default:y.scrolling=d[f]?d[f].scrolling:"no"}}function tt(){(typeof(d[f]&&d[f].bodyMargin)=="number"||(d[f]&&d[f].bodyMargin)==="0")&&(d[f].bodyMarginV1=d[f].bodyMargin,d[f].bodyMargin=""+d[f].bodyMargin+"px")}function Dt(){var m=d[f]&&d[f].firstRun,v=d[f]&&d[f].heightCalculationMethod in p;!m&&v&&N({iframe:y,height:0,width:0,type:"init"})}function pt(){d[f]&&(d[f].iframe.iFrameResizer={close:At.bind(null,d[f].iframe),removeListeners:Ge.bind(null,d[f].iframe),resize:R.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){R("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),R("Send Message","message:"+m,d[f].iframe,f)}})}function ft(m){function v(){R("iFrame.onload",m,y,e,!0),Dt()}function M(ue){if(y.parentNode){var Se=new ue(function(De){De.forEach(function(gt){var Er=Array.prototype.slice.call(gt.removedNodes);Er.forEach(function(yt){yt===y&&At(y)})})});Se.observe(y.parentNode,{childList:!0})}}var D=V();D&&M(D),te(y,"load",v),R("init",m,y,e,!0)}function mt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Tr(m){for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(d[f][v]=Object.prototype.hasOwnProperty.call(m,v)?m[v]:_[v])}function ds(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Cr(m){var v=m.split("Callback");if(v.length===2){var M="on"+v[0].charAt(0).toUpperCase()+v[0].slice(1);this[M]=this[m],delete this[m],Ae(f,"Deprecated: '"+m+"' has been renamed '"+M+"'. The old method will be removed in the next major version.")}}function hs(m){m=m||{},d[f]=Object.create(null),d[f].iframe=y,d[f].firstRun=!0,d[f].remoteHost=y.src&&y.src.split("/").slice(0,3).join("/"),mt(m),Object.keys(m).forEach(Cr,m),Tr(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?ds(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in y}var f=ee(y.id);h()?Ae(f,"Ignored iFrame, already setup."):(hs(C),ae(),X(),tt(),ft(le(f)),pt())}function $e(y,C){g===null&&(g=setTimeout(function(){g=null,y()},C))}var Ee={};function St(y,C,X){Ee[X]||(Ee[X]=setTimeout(function(){Ee[X]=null,y()},C))}function dt(){function y(){function ee(ae){function tt(pt){return(d[ae]&&d[ae].iframe.style[pt])==="0px"}function Dt(pt){return pt.offsetParent!==null}d[ae]&&Dt(d[ae].iframe)&&(tt("height")||tt("width"))&&R("Visibility change","resize",d[ae].iframe,ae)}Object.keys(d).forEach(function(ae){ee(ae)})}function C(ee){F("window","Mutation observed: "+ee[0].target+" "+ee[0].type),$e(y,16)}function X(){var ee=document.querySelector("body"),ae={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},tt=new j(C);tt.observe(ee,ae)}var j=V();j&&X()}function jt(y){function C(){Ie("Window "+y,"resize")}F("window","Trigger event: "+y),$e(C,16)}function Xe(){function y(){Ie("Tab Visible","resize")}document.visibilityState!=="hidden"&&(F("document","Trigger event: Visibility change"),$e(y,16))}function Ie(y,C){function X(j){return d[j]&&d[j].resizeFrom==="parent"&&d[j].autoResize&&!d[j].firstRun}Object.keys(d).forEach(function(j){X(j)&&R(y,C,d[j].iframe,j)})}function et(){te(window,"message",ve),te(window,"resize",function(){jt("resize")}),te(document,"visibilitychange",Xe),te(document,"-webkit-visibilitychange",Xe)}function ht(){function y(j,ee){function ae(){if(ee.tagName){if(ee.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+ee.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}ee&&(ae(),be(ee,j),X.push(ee))}function C(j){j&&j.enablePublicMethods&&Ae("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var X;return We(),et(),function(j,ee){switch(X=[],C(j),typeof ee){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(ee||"iframe"),y.bind(e,j));break}case"object":{y(j,ee);break}default:throw new TypeError("Unexpected data type ("+typeof ee+")")}return X}}function nn(y){y.fn?y.fn.iFrameResize||(y.fn.iFrameResize=function(C){function X(j,ee){be(ee,C)}return this.filter("iframe").each(X).end()}):ut("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&nn(window.jQuery),typeof e=="function"&&e.amd?e([],ht):n.exports=ht(),window.iFrameResize=window.iFrameResize||ht()})()})(wu);var _f=wu.exports;const wf=Uo(_f);var xf=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,Ll=(n,e,t,s)=>{for(var r=s>1?void 0:s?$f(e,t):e,i=n.length-1,l;i>=0;i--)(l=n[i])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&xf(e,t,r),r};let xr=class extends Ye{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){wf({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},n.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return re`
|
|
528
528
|
<div class="relative">
|
|
529
529
|
${Pt(this.showCloseButton,()=>re`
|
|
530
530
|
<button class="absolute top-0 right-0 m-2 h-6 text-white focus:outline-none" @click="${this.close}">
|
|
@@ -652,7 +652,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An err
|
|
|
652
652
|
`})}
|
|
653
653
|
</iai-chat-carousel>
|
|
654
654
|
</div>
|
|
655
|
-
`}function Zf(n){return async function({id:t,params:s,chatWindow:r}){r.setInputDisabled(!0);const i={...s.guestCardId&&{guestCardId:s.guestCardId},...s.customerFirstName&&{firstName:s.customerFirstName},...s.customerLastName&&{lastName:s.customerLastName},...s.customerEmail&&{email:s.customerEmail},...s.customerPhoneNumber&&{phone:s.customerPhoneNumber},...s.desiredMoveInDate&&{moveInDate:s.desiredMoveInDate}},l=document.createElement("iai-chat-iframe-modal");l.title="Schedule a Tour",l.src=`${n}?${new URLSearchParams(i).toString()}`,l.showHeader=!1;const a=()=>{l.remove(),window.removeEventListener("beforeunload",c),r.setInputDisabled(!1)},o=async({detail:p})=>{if(p.type!=="tourScheduled")return;const{tourType:d,tourDate:g,tourTime:_,guestCardId:W}=p;a(),r.addMessage({role:"system",content:"Your tour has been scheduled!"}),await r.sendFunctionCallResponse(t,{status:"scheduled",tourType:d,tourDate:g,tourTime:_,guestCardId:W},!0)},u=async()=>{a(),r.addMessage({role:"system",content:"Tour Scheduler Closed"}),await r.sendFunctionCallResponse(t,{status:"canceled"},!0)},c=async()=>{a(),r.addMessage({role:"system",content:"Tour Scheduler Closed"})};l.addEventListener("message-received",o),l.addEventListener("close",u),window.addEventListener("beforeunload",c),document.body.appendChild(l),r.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const kr="https://api.ai.inhabit.services";async function Lf(n,e={}){const t=await fetch(`${kr}/threads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistantId:n,params:e})});if(!t.ok)throw new Error(`Failed to create thread: ${t.statusText} (${t.status})`);return t.json()}async function zf(n,e="No reason provided"){const t=await fetch(`${kr}/threads/${n}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e})});if(!t.ok)throw new Error(`Failed to end thread: ${t.statusText} (${t.status})`)}async function Hf(n,e){const t=await fetch(`${kr}/threads/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to send message: ${t.statusText} (${t.status})`);return t.json()}async function Uf(n,e,t,s=!1){const r=await fetch(`${kr}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:s})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}const Bf=Object.freeze(Object.defineProperty({__proto__:null,baseUrl:kr,createThread:Lf,endThread:zf,respondToFunctionCall:Uf,sendUserMessage:Hf},Symbol.toStringTag,{value:"Module"}));function Au(n){return{all:n=n||new Map,on:function(e,t){var s=n.get(e);s?s.push(t):n.set(e,[t])},off:function(e,t){var s=n.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var s=n.get(e);s&&s.slice().map(function(r){r(t)}),(s=n.get("*"))&&s.slice().map(function(r){r(e,t)})}}}class Vf{constructor(e){this.chatWsUrl=e,this._emitter=Au(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const s=JSON.parse(t.data);this._emitter.emit(s.type,s.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Ni;(n=>{(e=>{e.TEXT="TEXT"})(n.MessageType||(n.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(n.AcknowledgeType||(n.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(n.ContentType||(n.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(n.ConversationEventOrigin||(n.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(n.ConversationStatus||(n.ConversationStatus={}))})(Ni||(Ni={}));const Ff=Ni.AcknowledgeType,Wf="Anyone Home",qf="IB Chat Leasing - Development";let Kf="https://five9.ah.inhabit.service";const Yf="https://five9.ah.inhabit.service".replace("http","ws").replace(/\/$/,""),Sr=class Sr{constructor(){zl(this,Rt,void 0);zl(this,Zn,void 0);this._emitter=Au(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),sn(this,Rt,null),sn(this,Zn,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),s=new Sr;return t.sessionToken&&s.setSession(t.sessionToken),t.conversationId&&s.setConversationId(t.conversationId),s.conversationStarted=t.conversationStarted||!1,s}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Sr.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Wf})});return sn(this,Rt,await e.json()),Ri(this,Rt)}setSession(e){sn(this,Rt,e)}setConversationId(e){sn(this,Zn,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Vf(`${Yf}/conversations/${this.conversationId}/ws`);e.on("*",(t,s)=>{this._emitter.emit(t,s)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Ff.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:s}=this;if(!s)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const r=s.metadata.dataCenters[0].apiUrls[0].host,i=await fetch(`${Sr.generateBaseUrl(r)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:s.tokenId,farmId:s.context.farmId}});return i.status===204?null:i.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(i=>{const l=i;t[l]||delete t[l]});const s={...e,campaignName:qf,tenantId:this.tenantId,callbackUrl:Kf};console.log("body",s);const r=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(s)});return this.setConversationId(r.id),r}async sendMessage(e){const{conversationId:t,conversationStarted:s}=this;if(!t||!s)throw new Error("Conversation not started");const r={messageType:Ni.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(r)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),sn(this,Rt,null),sn(this,Zn,null)}get sessionToken(){return Ri(this,Rt)}get conversationId(){return Ri(this,Zn)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};Rt=new WeakMap,Zn=new WeakMap;let Pi=Sr;const{baseUrl:Jf}=Bf;function Ar(n){return`any-${n||"main"}-chatSession`}async function Gf({id:n,params:e,chatWindow:t,html:s}){t=t;const r=async()=>{const{firstName:c,lastName:p,phone:d,email:g,propertyId:_}=e,W={propertyId:_,customerFirstName:c,customerLastName:p,customerPhoneNumber:d,customerEmail:g},se=await fetch(`${Jf}/anyone-home/newGuestCard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)}),{guestCardId:He}=await se.json();e.guestCardId=He},i=async()=>{t.removeMessage("transferMessageId"),t.removeMessage("guestCardFormId"),await t.sendFunctionCallResponse(n,{transfer:"Declined"},!0),t.setInputDisabled(!1)},l=async()=>{t.removeMessage("transferMessageId"),e.guestCardId?(a(),await o()):await u()},a=()=>{t.addMessage({id:"waitMessageId",role:"system",content:"Please wait while we connect you to a live agent"}),t.setInputDisabled(!0)},o=async()=>{await t.chatManager.endChat("Transferred to live agent",!1);const c=new Pi;await c.createSession();const{summary:p,subject:d,guestCardId:g,..._}=e;await c.createConversation({contact:_,attributes:{"Chat.gc_id":g,Question:d,"AI Summary":p}}),localStorage.setItem(Ar(t.cleanOptions.config.historyKey),c.serialize()),Su(t,c)},u=async()=>{const c=async p=>{e=p.detail,t.removeMessage("guestCardFormId"),a();try{await r()}catch(d){console.log(d)}await o()};t.addMessage({id:"guestCardFormId",role:"system",contentHtmlTemplate:s`
|
|
655
|
+
`}function Zf(n){return async function({id:t,params:s,chatWindow:r}){r.setInputDisabled(!0);const i={...s.guestCardId&&{guestCardId:s.guestCardId},...s.customerFirstName&&{firstName:s.customerFirstName},...s.customerLastName&&{lastName:s.customerLastName},...s.customerEmail&&{email:s.customerEmail},...s.customerPhoneNumber&&{phone:s.customerPhoneNumber},...s.desiredMoveInDate&&{moveInDate:s.desiredMoveInDate}},l=document.createElement("iai-chat-iframe-modal");l.title="Schedule a Tour",l.src=`${n}?${new URLSearchParams(i).toString()}`,l.showHeader=!1;const a=()=>{l.remove(),window.removeEventListener("beforeunload",c),r.setInputDisabled(!1)},o=async({detail:p})=>{if(p.type!=="tourScheduled")return;const{tourType:d,tourDate:g,tourTime:_,guestCardId:V}=p;a(),r.addMessage({role:"system",content:"Your tour has been scheduled!"}),await r.sendFunctionCallResponse(t,{status:"scheduled",tourType:d,tourDate:g,tourTime:_,guestCardId:V},!0)},u=async()=>{a(),r.addMessage({role:"system",content:"Tour Scheduler Closed"}),await r.sendFunctionCallResponse(t,{status:"canceled"},!0)},c=async()=>{a(),r.addMessage({role:"system",content:"Tour Scheduler Closed"})};l.addEventListener("message-received",o),l.addEventListener("close",u),window.addEventListener("beforeunload",c),document.body.appendChild(l),r.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const kr="https://api.ai.inhabit.services";async function Lf(n,e={}){const t=await fetch(`${kr}/threads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assistantId:n,params:e})});if(!t.ok)throw new Error(`Failed to create thread: ${t.statusText} (${t.status})`);return t.json()}async function zf(n,e="No reason provided"){const t=await fetch(`${kr}/threads/${n}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:e})});if(!t.ok)throw new Error(`Failed to end thread: ${t.statusText} (${t.status})`)}async function Hf(n,e){const t=await fetch(`${kr}/threads/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to send message: ${t.statusText} (${t.status})`);return t.json()}async function Uf(n,e,t,s=!1){const r=await fetch(`${kr}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:s})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}const Bf=Object.freeze(Object.defineProperty({__proto__:null,baseUrl:kr,createThread:Lf,endThread:zf,respondToFunctionCall:Uf,sendUserMessage:Hf},Symbol.toStringTag,{value:"Module"}));function Au(n){return{all:n=n||new Map,on:function(e,t){var s=n.get(e);s?s.push(t):n.set(e,[t])},off:function(e,t){var s=n.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var s=n.get(e);s&&s.slice().map(function(r){r(t)}),(s=n.get("*"))&&s.slice().map(function(r){r(e,t)})}}}class Vf{constructor(e){this.chatWsUrl=e,this._emitter=Au(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const s=JSON.parse(t.data);this._emitter.emit(s.type,s.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Ni;(n=>{(e=>{e.TEXT="TEXT"})(n.MessageType||(n.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(n.AcknowledgeType||(n.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(n.ContentType||(n.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(n.ConversationEventOrigin||(n.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(n.ConversationStatus||(n.ConversationStatus={}))})(Ni||(Ni={}));const Ff=Ni.AcknowledgeType,Wf="Anyone Home",qf="IB Chat Leasing";let Kf="https://five9.ah.inhabit.service";const Yf="https://five9.ah.inhabit.service".replace("http","ws").replace(/\/$/,""),Sr=class Sr{constructor(){zl(this,Rt,void 0);zl(this,Zn,void 0);this._emitter=Au(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),sn(this,Rt,null),sn(this,Zn,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),s=new Sr;return t.sessionToken&&s.setSession(t.sessionToken),t.conversationId&&s.setConversationId(t.conversationId),s.conversationStarted=t.conversationStarted||!1,s}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Sr.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Wf})});return sn(this,Rt,await e.json()),Ri(this,Rt)}setSession(e){sn(this,Rt,e)}setConversationId(e){sn(this,Zn,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Vf(`${Yf}/conversations/${this.conversationId}/ws`);e.on("*",(t,s)=>{this._emitter.emit(t,s)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Ff.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:s}=this;if(!s)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const r=s.metadata.dataCenters[0].apiUrls[0].host,i=await fetch(`${Sr.generateBaseUrl(r)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:s.tokenId,farmId:s.context.farmId}});return i.status===204?null:i.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(i=>{const l=i;t[l]||delete t[l]});const s={...e,campaignName:qf,tenantId:this.tenantId,callbackUrl:Kf};console.log("body",s);const r=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(s)});return this.setConversationId(r.id),r}async sendMessage(e){const{conversationId:t,conversationStarted:s}=this;if(!t||!s)throw new Error("Conversation not started");const r={messageType:Ni.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(r)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),sn(this,Rt,null),sn(this,Zn,null)}get sessionToken(){return Ri(this,Rt)}get conversationId(){return Ri(this,Zn)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};Rt=new WeakMap,Zn=new WeakMap;let Pi=Sr;const{baseUrl:Jf}=Bf;function Ar(n){return`any-${n||"main"}-chatSession`}async function Gf({id:n,params:e,chatWindow:t,html:s}){t=t;const r=async()=>{const{firstName:c,lastName:p,phone:d,email:g,propertyId:_}=e,V={propertyId:_,customerFirstName:c,customerLastName:p,customerPhoneNumber:d,customerEmail:g},te=await fetch(`${Jf}/anyone-home/newGuestCard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)}),{guestCardId:je}=await te.json();e.guestCardId=je},i=async()=>{t.removeMessage("transferMessageId"),t.removeMessage("guestCardFormId"),await t.sendFunctionCallResponse(n,{transfer:"Declined"},!0),t.setInputDisabled(!1)},l=async()=>{t.removeMessage("transferMessageId"),e.guestCardId?(a(),await o()):await u()},a=()=>{t.addMessage({id:"waitMessageId",role:"system",content:"Please wait while we connect you to a live agent"}),t.setInputDisabled(!0)},o=async()=>{await t.sendFunctionCallResponse(n,{transfer:"Accepted",guestCardId:e.guestCardId},!1),await t.chatManager.endChat("Transferred to live agent",!1);const c=new Pi;await c.createSession();const{summary:p,subject:d,guestCardId:g,firstName:_,lastName:V,phoneNumber:te,email:je}=e;await c.createConversation({contact:{firstName:_,lastName:V,number1:te,email:je},attributes:{"Chat.gc_id":g,Question:d,"AI Summary":p}}),localStorage.setItem(Ar(t.cleanOptions.config.historyKey),c.serialize()),Su(t,c)},u=async()=>{const c=async p=>{e={...e,...p.detail},t.removeMessage("guestCardFormId"),a();try{await r()}catch(d){console.log(d)}await o()};t.addMessage({id:"guestCardFormId",role:"system",contentHtmlTemplate:s`
|
|
656
656
|
<any-contact-form
|
|
657
657
|
.params=${e}
|
|
658
658
|
@submit=${c}
|