@iai-lib/any-chat-widget 0.1.0-alpha.46 → 0.1.0-alpha.48
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 +4315 -4245
- package/dist/any-chat-widget.umd.js +234 -193
- package/package.json +4 -4
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
(function(Oe,ke){typeof exports=="object"&&typeof module<"u"?ke(exports):typeof define=="function"&&define.amd?define(["exports"],ke):(Oe=typeof globalThis<"u"?globalThis:Oe||self,ke(Oe.AnyChatbot={}))})(this,function(Oe){"use strict";var Iu=(Oe,ke,De)=>{if(!ke.has(Oe))throw TypeError("Cannot "+De)};var Ds=(Oe,ke,De)=>(Iu(Oe,ke,"read from private field"),De?De.call(Oe):ke.get(Oe)),zl=(Oe,ke,De)=>{if(ke.has(Oe))throw TypeError("Cannot add the same private member more than once");ke instanceof WeakSet?ke.add(Oe):ke.set(Oe,De)},rn=(Oe,ke,De,Or)=>(Iu(Oe,ke,"write to private field"),Or?Or.call(Oe,De):ke.set(Oe,De),De);var Cu,jt,Zn;var ke=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},De=function(n,e,t,i,r,s,l,a,o,u){var c=this;c.numeralDecimalMark=n||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=t>=0?t:2,c.numeralThousandsGroupStyle=i||De.groupStyle.thousand,c.numeralPositiveOnly=!!r,c.stripLeadingZeroes=s!==!1,c.prefix=l||l===""?l:"",c.signBeforePrefix=!!a,c.tailPrefix=!!o,c.delimiter=u||u===""?u:",",c.delimiterRE=u?new RegExp("\\"+u,"g"):""};De.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},De.prototype={getRawValue:function(n){return n.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(n){var e=this,t,i,r,s,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")),i=n.slice(0,1)==="-"?"-":"",typeof e.prefix<"u"?e.signBeforePrefix?r=i+e.prefix:r=e.prefix+i:r=i,s=n,n.indexOf(e.numeralDecimalMark)>=0&&(t=n.split(e.numeralDecimalMark),s=t[0],l=e.numeralDecimalMark+t[1].slice(0,e.numeralDecimalScale)),i==="-"&&(s=s.slice(1)),e.numeralIntegerScale>0&&(s=s.slice(0,e.numeralIntegerScale)),e.numeralThousandsGroupStyle){case De.groupStyle.lakh:s=s.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+e.delimiter);break;case De.groupStyle.wan:s=s.replace(/(\d)(?=(\d{4})+$)/g,"$1"+e.delimiter);break;case De.groupStyle.thousand:s=s.replace(/(\d)(?=(\d{3})+$)/g,"$1"+e.delimiter);break}return e.tailPrefix?i+s.toString()+(e.numeralDecimalScale>0?l.toString():"")+e.prefix:r+s.toString()+(e.numeralDecimalScale>0?l.toString():"")}};var Or=De,Hl=function(n,e,t){var i=this;i.date=[],i.blocks=[],i.datePattern=n,i.dateMin=e.split("-").reverse().map(function(r){return parseInt(r,10)}),i.dateMin.length===2&&i.dateMin.unshift(0),i.dateMax=t.split("-").reverse().map(function(r){return parseInt(r,10)}),i.dateMax.length===2&&i.dateMax.unshift(0),i.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(i,r){if(n.length>0){var s=n.slice(0,i),l=s.slice(0,1),a=n.slice(i);switch(e.datePattern[r]){case"d":s==="00"?s="01":parseInt(l,10)>3?s="0"+l:parseInt(s,10)>31&&(s="31");break;case"m":s==="00"?s="01":parseInt(l,10)>1?s="0"+l:parseInt(s,10)>12&&(s="12");break}t+=s,n=a}}),this.getFixedDateString(t)},getFixedDateString:function(n){var e=this,t=e.datePattern,i=[],r=0,s=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),i=this.getFixedDate(c,p,0)),n.length===8&&(t.forEach(function(W,le){switch(W){case"d":r=le;break;case"m":s=le;break;default:l=le;break}}),u=l*2,a=r<=l?r*2:r*2+2,o=s<=l?s*2:s*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,i=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,i=[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,i=[0,p,d]),i=e.getRangeFixedDate(i),e.date=i;var $=i.length===0?n:t.reduce(function(W,le){switch(le){case"d":return W+(i[0]===0?"":e.addLeadingZero(i[0]));case"m":return W+(i[1]===0?"":e.addLeadingZero(i[1]));case"y":return W+(g?e.addLeadingZeroForYear(i[2],!1):"");case"Y":return W+(g?e.addLeadingZeroForYear(i[2],!0):"")}},"");return $},getRangeFixedDate:function(n){var e=this,t=e.datePattern,i=e.dateMin||[],r=e.dateMax||[];return!n.length||i.length<3&&r.length<3||t.find(function(s){return s.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:i.length&&(i[2]>n[2]||i[2]===n[2]&&(i[1]>n[1]||i[1]===n[1]&&i[0]>n[0]))?i: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 Zu=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 i=e.getTimeFormatOptions();return e.blocks.forEach(function(r,s){if(n.length>0){var l=n.slice(0,r),a=l.slice(0,1),o=n.slice(r);switch(e.timePattern[s]){case"h":parseInt(a,10)>i.maxHourFirstDigit?l="0"+a:parseInt(l,10)>i.maxHours&&(l=i.maxHours+"");break;case"m":case"s":parseInt(a,10)>i.maxMinutesFirstDigit?l="0"+a:parseInt(l,10)>i.maxMinutes&&(l=i.maxMinutes+"");break}t+=l,n=o}}),this.getFixedTimeString(t)},getFixedTimeString:function(n){var e=this,t=e.timePattern,i=[],r=0,s=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":s=$*2;break;case"h":l=$*2;break}}),u=l,o=s,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),i=this.getFixedTime(d,p,c)),n.length===4&&e.timePattern.indexOf("s")<0&&(t.forEach(function(g,$){switch(g){case"m":s=$*2;break;case"h":l=$*2;break}}),u=l,o=s,c=0,p=parseInt(n.slice(o,o+2),10),d=parseInt(n.slice(u,u+2),10),i=this.getFixedTime(d,p,c)),e.time=i,i.length===0?n:t.reduce(function(g,$){switch($){case"s":return g+e.addLeadingZero(i[2]);case"m":return g+e.addLeadingZero(i[1]);case"h":return g+e.addLeadingZero(i[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 Lu=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="",i,r=!1,s=0,l=n.length;s<l;s++)i=e.formatter.inputDigit(n.charAt(s)),/[\s()-]/g.test(i)?(t=i,r=!0):r||(t=i);return t=t.replace(/[()]/g,""),t=t.replace(/[\s-]/g,e.delimiter),t}};var zu=Bl,js={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,i){return t+i},0);return n.concat(19-e)},getInfo:function(n,e){var t=js.blocks,i=js.re;e=!!e;for(var r in i)if(i[r].test(n)){var s=t[r];return{type:r,blocks:e?this.getStrictBlocks(s):s}}return{type:"unknown",blocks:e?this.getStrictBlocks(t.general):t.general}}},Hu=js,Uu={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 i="";return t.forEach(function(r){n.slice(-r.length)===r&&(i=r)}),i},getDelimiterREByDelimiter:function(n){return new RegExp(n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(n,e,t,i,r){return e.length===n?t.length:n+this.getPositionOffset(n,e,t,i,r)},getPositionOffset:function(n,e,t,i,r){var s,l,a;return s=this.stripDelimiters(e.slice(0,n),i,r),l=this.stripDelimiters(t.slice(0,n),i,r),a=s.length-l.length,a!==0?a/Math.abs(a):0},stripDelimiters:function(n,e,t){var i=this;if(t.length===0){var r=e?i.getDelimiterREByDelimiter(e):"";return n.replace(r,"")}return t.forEach(function(s){s.split("").forEach(function(l){n=n.replace(i.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,i,r,s,l,a,o){if(t===0)return n;if(n===e&&n!=="")return"";if(o&&n.slice(0,1)=="-"){var u=i.slice(0,1)=="-"?i.slice(1):i;return"-"+this.getPrefixStrippedValue(n.slice(1),e,t,u,r,s,l,a,o)}if(i.slice(0,t)!==e&&!a)return l&&!i&&n?n:"";if(i.slice(-t)!==e&&a)return l&&!i&&n?n:"";var c=this.stripDelimiters(i,r,s);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,i,r,s){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[s?c-1:c]||o:o=i,s?(c>0&&(l+=o),l+=p):(l+=p,p.length===u&&c<t-1&&(l+=o)),n=d}}),l)},fixPrefixCursor:function(n,e,t,i){if(n){var r=n.value,s=t||i[0]||" ";if(!(!n.setSelectionRange||!e||e.length+s.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 i=n.createTextRange();i.move("character",e),i.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)}},Bu=Uu,Vu={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 ke=="object"&&ke?ke:window,n.document=e.document||n.root.document,n.maxLength=0,n.backspace=!1,n.result="",n.onValueChanged=e.onValueChanged||function(){},n}},Fu=Vu,ye=function(n,e){var t=this,i=!1;if(typeof n=="string"?(t.element=document.querySelector(n),i=document.querySelectorAll(n).length>1):typeof n.length<"u"&&n.length>0?(t.element=n[0],i=n.length>1):t.element=n,!t.element)throw new Error("[cleave.js] Please check the element");if(i)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=ye.DefaultProperties.assign({},e),t.init()};ye.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=ye.Util.getMaxLength(e.blocks),n.isAndroid=ye.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 ye.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 ye.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=ye.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var n=this,e=n.properties;e.date&&(e.dateFormatter=new ye.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=ye.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var n=this,e=n.properties;if(e.phone)try{e.phoneFormatter=new ye.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,i=ye.Util;e.isBackward=e.isBackward||n.inputType==="deleteContentBackward";var r=i.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),ye.Util.fixPrefixCursor(n.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(n){ye.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(n),this.onInput(""))},onCopy:function(n){ye.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(n)},copyClipboardData:function(n){var e=this,t=e.properties,i=ye.Util,r=e.element.value,s="";t.copyDelimiter?s=r:s=i.stripDelimiters(r,t.delimiter,t.delimiters);try{n.clipboardData?n.clipboardData.setData("Text",s):window.clipboardData.setData("Text",s),n.preventDefault()}catch{}},onInput:function(n){var e=this,t=e.properties,i=ye.Util,r=i.getPostDelimiter(n,t.delimiter,t.delimiters);if(!t.numeral&&t.postDelimiterBackspace&&!r&&(n=i.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=i.stripDelimiters(n,t.delimiter,t.delimiters),n=i.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix),n=t.numericOnly?i.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=i.headStr(n,t.maxLength),t.result=i.getFormattedValue(n,t.blocks,t.blocksLength,t.delimiter,t.delimiters,t.delimiterLazyShow),e.updateValueState()},updateCreditCardPropsByValue:function(n){var e=this,t=e.properties,i=ye.Util,r;i.headStr(t.result,4)!==i.headStr(n,4)&&(r=ye.CreditCardDetector.getInfo(n,t.creditCardStrictMode),t.blocks=r.blocks,t.blocksLength=t.blocks.length,t.maxLength=i.getMaxLength(t.blocks),t.creditCardType!==r.type&&(t.creditCardType=r.type,t.onCreditCardTypeChanged.call(e,t.creditCardType)))},updateValueState:function(){var n=this,e=ye.Util,t=n.properties;if(n.element){var i=n.element.selectionEnd,r=n.element.value,s=t.result;if(i=e.getNextCursorPosition(i,r,s,t.delimiter,t.delimiters),n.isAndroid){window.setTimeout(function(){n.element.value=s,e.setSelection(n.element,i,t.document,!1),n.callOnValueChanged()},1);return}n.element.value=s,t.swapHiddenInput&&(n.elementSwapHidden.value=n.getRawValue()),e.setSelection(n.element,i,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=ye.Util,i=n.element.value;return e.rawValueTrimPrefix&&(i=t.getPrefixStrippedValue(i,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),e.numeral?i=e.numeralFormatter.getRawValue(i):i=t.stripDelimiters(i,e.delimiter,e.delimiters),i},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]"}},ye.NumeralFormatter=Or,ye.DateFormatter=Zu,ye.TimeFormatter=Lu,ye.PhoneFormatter=zu,ye.CreditCardDetector=Hu,ye.Util=Bu,ye.DefaultProperties=Fu,(typeof ke=="object"&&ke?ke:window).Cleave=ye;var Wu=ye;/**
|
|
1
|
+
(function(Me,ke){typeof exports=="object"&&typeof module<"u"?ke(exports):typeof define=="function"&&define.amd?define(["exports"],ke):(Me=typeof globalThis<"u"?globalThis:Me||self,ke(Me.AnyChatbot={}))})(this,function(Me){"use strict";var Du=(Me,ke,Re)=>{if(!ke.has(Me))throw TypeError("Cannot "+Re)};var ji=(Me,ke,Re)=>(Du(Me,ke,"read from private field"),Re?Re.call(Me):ke.get(Me)),Wl=(Me,ke,Re)=>{if(ke.has(Me))throw TypeError("Cannot add the same private member more than once");ke instanceof WeakSet?ke.add(Me):ke.set(Me,Re)},an=(Me,ke,Re,Or)=>(Du(Me,ke,"write to private field"),Or?Or.call(Me,Re):ke.set(Me,Re),Re);var Pu,jt,jn;var ke=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Re=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||Re.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"):""};Re.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Re.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 Re.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+e.delimiter);break;case Re.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+e.delimiter);break;case Re.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 Or=Re,ql=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()};ql.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,le){switch(W){case"d":r=le;break;case"m":i=le;break;default:l=le;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,le){switch(le){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 Vu=ql,Kl=function(n,e){var t=this;t.time=[],t.blocks=[],t.timePattern=n,t.timeFormat=e,t.initBlocks()};Kl.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 Bu=Kl,Yl=function(n,e){var t=this;t.delimiter=e||e===""?e:" ",t.delimiterRE=e?new RegExp("\\"+e,"g"):"",t.formatter=n};Yl.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 Fu=Yl,Zi={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=Zi.blocks,s=Zi.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}}},Wu=Zi,qu={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)}},Ku=qu,Yu={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 ke=="object"&&ke?ke:window,n.document=e.document||n.root.document,n.maxLength=0,n.backspace=!1,n.result="",n.onValueChanged=e.onValueChanged||function(){},n}},Gu=Yu,ye=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=ye.DefaultProperties.assign({},e),t.init()};ye.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=ye.Util.getMaxLength(e.blocks),n.isAndroid=ye.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 ye.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 ye.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=ye.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var n=this,e=n.properties;e.date&&(e.dateFormatter=new ye.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=ye.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var n=this,e=n.properties;if(e.phone)try{e.phoneFormatter=new ye.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=ye.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),ye.Util.fixPrefixCursor(n.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(n){ye.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(n),this.onInput(""))},onCopy:function(n){ye.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(n)},copyClipboardData:function(n){var e=this,t=e.properties,s=ye.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=ye.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=ye.Util,r;s.headStr(t.result,4)!==s.headStr(n,4)&&(r=ye.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=ye.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=ye.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]"}},ye.NumeralFormatter=Or,ye.DateFormatter=Vu,ye.TimeFormatter=Bu,ye.PhoneFormatter=Fu,ye.CreditCardDetector=Wu,ye.Util=Ku,ye.DefaultProperties=Gu,(typeof ke=="object"&&ke?ke:window).Cleave=ye;var Ju=ye;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const Nr=globalThis,Li=Nr.ShadowRoot&&(Nr.ShadyCSS===void 0||Nr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zi=Symbol(),Gl=new WeakMap;let Jl=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==zi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Li&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=Gl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Gl.set(t,e))}return e}toString(){return this.cssText}};const Qu=n=>new Jl(typeof n=="string"?n:n+"",void 0,zi),Xu=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,r,i)=>s+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[i+1],n[0]);return new Jl(t,n,zi)},ec=(n,e)=>{if(Li)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),r=Nr.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=t.cssText,n.appendChild(s)}},Ql=Li?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Qu(t)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:tc,defineProperty:nc,getOwnPropertyDescriptor:sc,getOwnPropertyNames:rc,getOwnPropertySymbols:ic,getPrototypeOf:lc}=Object,zt=globalThis,Xl=zt.trustedTypes,ac=Xl?Xl.emptyScript:"",Hi=zt.reactiveElementPolyfillSupport,ps=(n,e)=>n,Pr={toAttribute(n,e){switch(e){case Boolean:n=n?ac:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ui=(n,e)=>!tc(n,e),ea={attribute:!0,type:String,converter:Pr,reflect:!1,hasChanged:Ui};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),zt.litPropertyMetadata??(zt.litPropertyMetadata=new WeakMap);class Zn extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ea){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,t);r!==void 0&&nc(this.prototype,e,r)}}static getPropertyDescriptor(e,t,s){const{get:r,set:i}=sc(this.prototype,e)??{get(){return this[t]},set(l){this[t]=l}};return{get(){return r==null?void 0:r.call(this)},set(l){const a=r==null?void 0:r.call(this);i.call(this,l),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ea}static _$Ei(){if(this.hasOwnProperty(ps("elementProperties")))return;const e=lc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ps("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ps("properties"))){const t=this.properties,s=[...rc(t),...ic(t)];for(const r of s)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,r]of t)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const r=this._$Eu(t,s);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)t.unshift(Ql(r))}else e!==void 0&&t.push(Ql(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ec(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$EC(e,t){var i;const s=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const l=(((i=s.converter)==null?void 0:i.toAttribute)!==void 0?s.converter:Pr).toAttribute(t,s.type);this._$Em=e,l==null?this.removeAttribute(r):this.setAttribute(r,l),this._$Em=null}}_$AK(e,t){var i;const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const l=s.getPropertyOptions(r),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((i=l.converter)==null?void 0:i.fromAttribute)!==void 0?l.converter:Pr;this._$Em=r,this[r]=a.fromAttribute(t,l.type),this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??Ui)(this[e],t))return;this.P(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,s){this._$AL.has(e)||this._$AL.set(e,t),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[i,l]of this._$Ep)this[i]=l;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,l]of r)l.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],l)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(s=this._$EO)==null||s.forEach(r=>{var i;return(i=r.hostUpdate)==null?void 0:i.call(r)}),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Zn.elementStyles=[],Zn.shadowRootOptions={mode:"open"},Zn[ps("elementProperties")]=new Map,Zn[ps("finalized")]=new Map,Hi==null||Hi({ReactiveElement:Zn}),(zt.reactiveElementVersions??(zt.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const fs=globalThis,Rr=fs.trustedTypes,ta=Rr?Rr.createPolicy("lit-html",{createHTML:n=>n}):void 0,na="$lit$",Ht=`lit$${(Math.random()+"").slice(9)}$`,sa="?"+Ht,oc=`<${sa}>`,on=document,Dr=()=>on.createComment(""),ms=n=>n===null||typeof n!="object"&&typeof n!="function",ra=Array.isArray,uc=n=>ra(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Vi=`[
|
|
14
|
+
\f\r]`,gs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ia=/-->/g,la=/>/g,un=RegExp(`>|${Vi}(?:([^\\s"'>=/]+)(${Vi}*=${Vi}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),aa=/'/g,oa=/"/g,ua=/^(?:script|style|textarea|title)$/i,ys=Symbol.for("lit-noChange"),De=Symbol.for("lit-nothing"),ca=new WeakMap,cn=on.createTreeWalker(on,129);function da(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ta!==void 0?ta.createHTML(e):e}const cc=(n,e)=>{const t=n.length-1,s=[];let r,i=e===2?"<svg>":"",l=gs;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===gs?c[1]==="!--"?l=ia:c[1]!==void 0?l=la:c[2]!==void 0?(ua.test(c[2])&&(r=RegExp("</"+c[2],"g")),l=un):c[3]!==void 0&&(l=un):l===un?c[0]===">"?(l=r??gs,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?un:c[3]==='"'?oa:aa):l===oa||l===aa?l=un:l===ia||l===la?l=gs:(l=un,r=void 0);const g=l===un&&n[a+1].startsWith("/>")?" ":"";i+=l===gs?o+oc:p>=0?(s.push(u),o.slice(0,p)+na+o.slice(p)+Ht+g):o+Ht+(p===-2?a:g)}return[da(n,i+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};let Bi=class ju{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let i=0,l=0;const a=e.length-1,o=this.parts,[u,c]=cc(e,t);if(this.el=ju.createElement(u,s),cn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=cn.nextNode())!==null&&o.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(na)){const d=c[l++],g=r.getAttribute(p).split(Ht),$=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:$[2],strings:g,ctor:$[1]==="."?hc:$[1]==="?"?pc:$[1]==="@"?fc:jr}),r.removeAttribute(p)}else p.startsWith(Ht)&&(o.push({type:6,index:i}),r.removeAttribute(p));if(ua.test(r.tagName)){const p=r.textContent.split(Ht),d=p.length-1;if(d>0){r.textContent=Rr?Rr.emptyScript:"";for(let g=0;g<d;g++)r.append(p[g],Dr()),cn.nextNode(),o.push({type:2,index:++i});r.append(p[d],Dr())}}}else if(r.nodeType===8)if(r.data===sa)o.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(Ht,p+1))!==-1;)o.push({type:7,index:i}),p+=Ht.length-1}i++}}static createElement(e,t){const s=on.createElement("template");return s.innerHTML=e,s}};function Ln(n,e,t=n,s){var l,a;if(e===ys)return e;let r=s!==void 0?(l=t._$Co)==null?void 0:l[s]:t._$Cl;const i=ms(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==i&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),i===void 0?r=void 0:(r=new i(n),r._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=r:t._$Cl=r),r!==void 0&&(e=Ln(n,r._$AS(n,e.values),r,s)),e}let dc=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=((e==null?void 0:e.creationScope)??on).importNode(t,!0);cn.currentNode=r;let i=cn.nextNode(),l=0,a=0,o=s[0];for(;o!==void 0;){if(l===o.index){let u;o.type===2?u=new ha(i,i.nextSibling,this,e):o.type===1?u=new o.ctor(i,o.name,o.strings,this,e):o.type===6&&(u=new mc(i,this,e)),this._$AV.push(u),o=s[++a]}l!==(o==null?void 0:o.index)&&(i=cn.nextNode(),l++)}return cn.currentNode=on,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},ha=class Zu{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=De,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ln(this,e,t),ms(e)?e===De||e==null||e===""?(this._$AH!==De&&this._$AR(),this._$AH=De):e!==this._$AH&&e!==ys&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):uc(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==De&&ms(this._$AH)?this._$AA.nextSibling.data=e:this.T(on.createTextNode(e)),this._$AH=e}$(e){var i;const{values:t,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Bi.createElement(da(s.h,s.h[0]),this.options)),s);if(((i=this._$AH)==null?void 0:i._$AD)===r)this._$AH.p(t);else{const l=new dc(r,this),a=l.u(this.options);l.p(t),this.T(a),this._$AH=l}}_$AC(e){let t=ca.get(e.strings);return t===void 0&&ca.set(e.strings,t=new Bi(e)),t}k(e){ra(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const i of e)r===t.length?t.push(s=new Zu(this.S(Dr()),this.S(Dr()),this,this.options)):s=t[r],s._$AI(i),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},jr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,i){this.type=1,this._$AH=De,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=De}_$AI(e,t=this,s,r){const i=this.strings;let l=!1;if(i===void 0)e=Ln(this,e,t,0),l=!ms(e)||e!==this._$AH&&e!==ys,l&&(this._$AH=e);else{const a=e;let o,u;for(e=i[0],o=0;o<i.length-1;o++)u=Ln(this,a[s+o],t,o),u===ys&&(u=this._$AH[o]),l||(l=!ms(u)||u!==this._$AH[o]),u===De?e=De:e!==De&&(e+=(u??"")+i[o+1]),this._$AH[o]=u}l&&!r&&this.j(e)}j(e){e===De?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},hc=class extends jr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===De?void 0:e}},pc=class extends jr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==De)}},fc=class extends jr{constructor(e,t,s,r,i){super(e,t,s,r,i),this.type=5}_$AI(e,t=this){if((e=Ln(this,e,t,0)??De)===ys)return;const s=this._$AH,r=e===De&&s!==De||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==De&&(s===De||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},mc=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Ln(this,e)}};const Fi=fs.litHtmlPolyfillSupport;Fi==null||Fi(Bi,ha),(fs.litHtmlVersions??(fs.litHtmlVersions=[])).push("3.1.2");/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
20
|
-
\f\r]`,
|
|
21
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
19
|
+
*/const vs=globalThis,Zr=vs.trustedTypes,pa=Zr?Zr.createPolicy("lit-html",{createHTML:n=>n}):void 0,fa="$lit$",Ut=`lit$${(Math.random()+"").slice(9)}$`,ma="?"+Ut,gc=`<${ma}>`,dn=document,bs=()=>dn.createComment(""),_s=n=>n===null||typeof n!="object"&&typeof n!="function",ga=Array.isArray,yc=n=>ga(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Wi=`[
|
|
20
|
+
\f\r]`,ws=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ya=/-->/g,va=/>/g,hn=RegExp(`>|${Wi}(?:([^\\s"'>=/]+)(${Wi}*=${Wi}*(?:[^
|
|
21
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ba=/'/g,_a=/"/g,wa=/^(?:script|style|textarea|title)$/i,vc=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Lr=vc(1),zn=Symbol.for("lit-noChange"),je=Symbol.for("lit-nothing"),xa=new WeakMap,pn=dn.createTreeWalker(dn,129);function $a(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return pa!==void 0?pa.createHTML(e):e}const bc=(n,e)=>{const t=n.length-1,s=[];let r,i=e===2?"<svg>":"",l=ws;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===ws?c[1]==="!--"?l=ya:c[1]!==void 0?l=va:c[2]!==void 0?(wa.test(c[2])&&(r=RegExp("</"+c[2],"g")),l=hn):c[3]!==void 0&&(l=hn):l===hn?c[0]===">"?(l=r??ws,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?hn:c[3]==='"'?_a:ba):l===_a||l===ba?l=hn:l===ya||l===va?l=ws:(l=hn,r=void 0);const g=l===hn&&n[a+1].startsWith("/>")?" ":"";i+=l===ws?o+gc:p>=0?(s.push(u),o.slice(0,p)+fa+o.slice(p)+Ut+g):o+Ut+(p===-2?a:g)}return[$a(n,i+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};class xs{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let i=0,l=0;const a=e.length-1,o=this.parts,[u,c]=bc(e,t);if(this.el=xs.createElement(u,s),pn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=pn.nextNode())!==null&&o.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(fa)){const d=c[l++],g=r.getAttribute(p).split(Ut),$=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:$[2],strings:g,ctor:$[1]==="."?wc:$[1]==="?"?xc:$[1]==="@"?$c:zr}),r.removeAttribute(p)}else p.startsWith(Ut)&&(o.push({type:6,index:i}),r.removeAttribute(p));if(wa.test(r.tagName)){const p=r.textContent.split(Ut),d=p.length-1;if(d>0){r.textContent=Zr?Zr.emptyScript:"";for(let g=0;g<d;g++)r.append(p[g],bs()),pn.nextNode(),o.push({type:2,index:++i});r.append(p[d],bs())}}}else if(r.nodeType===8)if(r.data===ma)o.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(Ut,p+1))!==-1;)o.push({type:7,index:i}),p+=Ut.length-1}i++}}static createElement(e,t){const s=dn.createElement("template");return s.innerHTML=e,s}}function Hn(n,e,t=n,s){var l,a;if(e===zn)return e;let r=s!==void 0?(l=t._$Co)==null?void 0:l[s]:t._$Cl;const i=_s(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==i&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),i===void 0?r=void 0:(r=new i(n),r._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=r:t._$Cl=r),r!==void 0&&(e=Hn(n,r._$AS(n,e.values),r,s)),e}class _c{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=((e==null?void 0:e.creationScope)??dn).importNode(t,!0);pn.currentNode=r;let i=pn.nextNode(),l=0,a=0,o=s[0];for(;o!==void 0;){if(l===o.index){let u;o.type===2?u=new $s(i,i.nextSibling,this,e):o.type===1?u=new o.ctor(i,o.name,o.strings,this,e):o.type===6&&(u=new kc(i,this,e)),this._$AV.push(u),o=s[++a]}l!==(o==null?void 0:o.index)&&(i=pn.nextNode(),l++)}return pn.currentNode=dn,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class $s{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=je,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Hn(this,e,t),_s(e)?e===je||e==null||e===""?(this._$AH!==je&&this._$AR(),this._$AH=je):e!==this._$AH&&e!==zn&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yc(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==je&&_s(this._$AH)?this._$AA.nextSibling.data=e:this.T(dn.createTextNode(e)),this._$AH=e}$(e){var i;const{values:t,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=xs.createElement($a(s.h,s.h[0]),this.options)),s);if(((i=this._$AH)==null?void 0:i._$AD)===r)this._$AH.p(t);else{const l=new _c(r,this),a=l.u(this.options);l.p(t),this.T(a),this._$AH=l}}_$AC(e){let t=xa.get(e.strings);return t===void 0&&xa.set(e.strings,t=new xs(e)),t}k(e){ga(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const i of e)r===t.length?t.push(s=new $s(this.S(bs()),this.S(bs()),this,this.options)):s=t[r],s._$AI(i),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class zr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,i){this.type=1,this._$AH=je,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=je}_$AI(e,t=this,s,r){const i=this.strings;let l=!1;if(i===void 0)e=Hn(this,e,t,0),l=!_s(e)||e!==this._$AH&&e!==zn,l&&(this._$AH=e);else{const a=e;let o,u;for(e=i[0],o=0;o<i.length-1;o++)u=Hn(this,a[s+o],t,o),u===zn&&(u=this._$AH[o]),l||(l=!_s(u)||u!==this._$AH[o]),u===je?e=je:e!==je&&(e+=(u??"")+i[o+1]),this._$AH[o]=u}l&&!r&&this.j(e)}j(e){e===je?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class wc extends zr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===je?void 0:e}}class xc extends zr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==je)}}class $c extends zr{constructor(e,t,s,r,i){super(e,t,s,r,i),this.type=5}_$AI(e,t=this){if((e=Hn(this,e,t,0)??je)===zn)return;const s=this._$AH,r=e===je&&s!==je||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==je&&(s===je||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}let kc=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Hn(this,e)}};const qi=vs.litHtmlPolyfillSupport;qi==null||qi(xs,$s),(vs.litHtmlVersions??(vs.litHtmlVersions=[])).push("3.1.2");const Ac=(n,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let r=s._$litPart$;if(r===void 0){const i=(t==null?void 0:t.renderBefore)??null;s._$litPart$=r=new $s(e.insertBefore(bs(),i),i,void 0,t??{})}return r._$AI(n),r};/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/class
|
|
25
|
+
*/class Un extends Zn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ac(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return zn}}Un._$litElement$=!0,Un.finalized=!0,(Pu=globalThis.litElementHydrateSupport)==null||Pu.call(globalThis,{LitElement:Un});const Ki=globalThis.litElementPolyfillSupport;Ki==null||Ki({LitElement:Un}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/const
|
|
29
|
+
*/const ka=n=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/const
|
|
33
|
+
*/const Sc={attribute:!0,type:String,converter:Pr,reflect:!1,hasChanged:Ui},Tc=(n=Sc,e,t)=>{const{kind:s,metadata:r}=t;let i=globalThis.litPropertyMetadata.get(r);if(i===void 0&&globalThis.litPropertyMetadata.set(r,i=new Map),i.set(t.name,n),s==="accessor"){const{name:l}=t;return{set(a){const o=e.get.call(this);e.set.call(this,a),this.requestUpdate(l,o,n)},init(a){return a!==void 0&&this.P(l,void 0,n),a}}}if(s==="setter"){const{name:l}=t;return function(a){const o=this[l];e.call(this,a),this.requestUpdate(l,o,n)}}throw Error("Unsupported decorator location: "+s)};function Aa(n){return(e,t)=>typeof t=="object"?Tc(n,e,t):((s,r,i)=>{const l=r.hasOwnProperty(i);return r.constructor.createProperty(i,l?{...s,wrapped:!0}:s),l?Object.getOwnPropertyDescriptor(r,i):void 0})(n,e,t)}/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/function
|
|
37
|
+
*/function Cc(n){return Aa({...n,state:!0,attribute:!1})}/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/const
|
|
41
|
+
*/const Sa=(n,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(n,e,t),t);/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/function
|
|
45
|
+
*/function Ec(n,e){return(t,s,r)=>{const i=l=>{var a;return((a=l.renderRoot)==null?void 0:a.querySelector(n))??null};if(e){const{get:l,set:a}=typeof s=="object"?t:r??(()=>{const o=Symbol();return{get(){return this[o]},set(u){this[o]=u}}})();return Sa(t,s,{get(){let o=l.call(this);return o===void 0&&(o=i(this),(o!==null||this.hasUpdated)&&a.call(this,o)),o}})}return Sa(t,s,{get(){return i(this)}})}}/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright 2021 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
|
-
*/function Ac(n,e,t){return n?e(n):t==null?void 0:t(n)}var ue;(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 s={};for(const l of r)s[l]=l;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of s)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&s.push(l);return s},n.find=(r,s)=>{for(const l of r)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(ue||(ue={}));var Ys;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ys||(Ys={}));const I=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bt=n=>{switch(typeof n){case"undefined":return I.undefined;case"string":return I.string;case"number":return isNaN(n)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(n)?I.array:n===null?I.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?I.promise:typeof Map<"u"&&n instanceof Map?I.map:typeof Set<"u"&&n instanceof Set?I.set:typeof Date<"u"&&n instanceof Date?I.date:I.object;default:return I.unknown}},S=ue.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"]),Sc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class it extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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(s){return s.message},i={_errors:[]},r=s=>{for(const l of s.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)i._errors.push(t(l));else{let a=i,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),i}static assert(e){if(!(e instanceof it))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];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))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}it.create=n=>new it(n);const Vn=(n,e)=>{let t;switch(n.code){case S.invalid_type:n.received===I.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case S.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ue.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:t=`Unrecognized key(s) in object: ${ue.joinValues(n.keys,", ")}`;break;case S.invalid_union:t="Invalid input";break;case S.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ue.joinValues(n.options)}`;break;case S.invalid_enum_value:t=`Invalid enum value. Expected ${ue.joinValues(n.options)}, received '${n.received}'`;break;case S.invalid_arguments:t="Invalid function arguments";break;case S.invalid_return_type:t="Invalid function return type";break;case S.invalid_date:t="Invalid date";break;case S.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}"`:ue.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case S.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 S.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 S.custom:t="Invalid input";break;case S.invalid_intersection_types:t="Intersection results could not be merged";break;case S.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case S.not_finite:t="Number must be finite";break;default:t=e.defaultError,ue.assertNever(n)}return{message:t}};let wa=Vn;function Tc(n){wa=n}function zr(){return wa}const Hr=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,s=[...t,...r.path||[]],l={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const o=i.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:s,message:a}},Cc=[];function E(n,e){const t=zr(),i=Hr({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(i)}class We{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return K;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const s=await r.key,l=await r.value;i.push({key:s,value:l})}return We.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:l}=r;if(s.status==="aborted"||l.status==="aborted")return K;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(i[s.value]=l.value)}return{status:e.value,value:i}}}const K=Object.freeze({status:"aborted"}),Fn=n=>({status:"dirty",value:n}),Ge=n=>({status:"valid",value:n}),Js=n=>n.status==="aborted",Gs=n=>n.status==="dirty",ki=n=>n.status==="valid",Ai=n=>typeof Promise<"u"&&n instanceof Promise;function Ur(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function xa(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="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 i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var L;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(L||(L={}));var Si,Ti;class xt{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,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(ki(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 X(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))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??i)!==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 ne{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 Bt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Bt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new We,ctx:{common:e.parent.common,data:e.data,parsedType:Bt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ai(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 i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bt(e)},s=this._parseSync({data:e,path:r.path,parent:r});return $a(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={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:Bt(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(Ai(r)?r:Promise.resolve(r));return $a(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const l=e(r),a=()=>s.addIssue({code:S.custom,...i(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((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new ht({schema:this,typeName:V.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return kt.create(this,this._def)}nullable(){return Kt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dt.create(this,this._def)}promise(){return Yn.create(this,this._def)}or(e){return Oi.create([this,e],this._def)}and(e){return Mi.create(this,e,this._def)}transform(e){return new ht({...X(this._def),schema:this,typeName:V.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ji({...X(this._def),innerType:this,defaultValue:t,typeName:V.ZodDefault})}brand(){return new el({typeName:V.ZodBranded,type:this,...X(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Zi({...X(this._def),innerType:this,catchValue:t,typeName:V.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ec=/^c[^\s-]{8,}$/i,Ic=/^[0-9a-z]+$/,Oc=/^[0-9A-HJKMNP-TV-Z]{26}$/,Mc=/^[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,Nc=/^[a-z0-9_-]{21}$/i,Pc=/^[-+]?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)?)??$/,Rc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qs;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])$/,Zc=/^(([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})))$/,Lc=/^([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])))",zc=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 Hc(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 Uc(n,e){return!!((e==="v4"||!e)&&jc.test(n)||(e==="v6"||!e)&&Zc.test(n))}class ct extends ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.string,received:s.parsedType}),K}const i=new We;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,a=e.data.length<s.value;(l||a)&&(r=this._getOrReturnCtx(e,r),l?E(r,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&E(r,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Rc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"email",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Qs||(Qs=new RegExp(Dc,"u")),Qs.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"emoji",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Mc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"uuid",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")Nc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"nanoid",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Ec.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"cuid",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Ic.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"cuid2",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Oc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"ulid",code:S.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),E(r,{validation:"url",code:S.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"regex",code:S.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Sa(s).test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?zc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?Hc(s).test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?Pc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"duration",code:S.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?Uc(e.data,s.version)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"ip",code:S.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?Lc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"base64",code:S.invalid_string,message:s.message}),i.dirty()):ue.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(r=>e.test(r),{validation:t,code:S.invalid_string,...L.errToObj(i)})}_addCheck(e){return new ct({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}datetime(e){var t,i;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:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...L.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,...L.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...L.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...L.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...L.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...L.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...L.errToObj(t)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new ct({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ct({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ct({...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}}ct.create=n=>{var e;return new ct({checks:[],typeName:V.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...X(n)})};function Bc(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,s=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return s%l/Math.pow(10,r)}class Vt extends ne{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)!==I.number){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.number,received:s.parsedType}),K}let i;const r=new We;for(const s of this._def.checks)s.kind==="int"?ue.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Bc(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:S.not_finite,message:s.message}),r.dirty()):ue.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,i,r){return new Vt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:L.toString(r)}]})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.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"&&ue.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Vt.create=n=>new Vt({checks:[],typeName:V.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...X(n)});class Ft extends ne{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)!==I.bigint){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.bigint,received:s.parsedType}),K}let i;const r=new We;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),E(i,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):ue.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,i,r){return new Ft({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:L.toString(r)}]})}_addCheck(e){return new Ft({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.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}}Ft.create=n=>{var e;return new Ft({checks:[],typeName:V.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...X(n)})};class Ci extends ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.boolean,received:i.parsedType}),K}return Ge(e.data)}}Ci.create=n=>new Ci({typeName:V.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...X(n)});class dn extends ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.date,received:s.parsedType}),K}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_date}),K}const i=new We;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ue.assertNever(s);return{status:i.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:L.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:L.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:V.ZodDate,...X(n)});class Br extends ne{_parse(e){if(this._getType(e)!==I.symbol){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.symbol,received:i.parsedType}),K}return Ge(e.data)}}Br.create=n=>new Br({typeName:V.ZodSymbol,...X(n)});class Ei extends ne{_parse(e){if(this._getType(e)!==I.undefined){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.undefined,received:i.parsedType}),K}return Ge(e.data)}}Ei.create=n=>new Ei({typeName:V.ZodUndefined,...X(n)});class Ii extends ne{_parse(e){if(this._getType(e)!==I.null){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.null,received:i.parsedType}),K}return Ge(e.data)}}Ii.create=n=>new Ii({typeName:V.ZodNull,...X(n)});class Wn extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return Ge(e.data)}}Wn.create=n=>new Wn({typeName:V.ZodAny,...X(n)});class hn extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ge(e.data)}}hn.create=n=>new hn({typeName:V.ZodUnknown,...X(n)});class Et extends ne{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:S.invalid_type,expected:I.never,received:t.parsedType}),K}}Et.create=n=>new Et({typeName:V.ZodNever,...X(n)});class Vr extends ne{_parse(e){if(this._getType(e)!==I.undefined){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.void,received:i.parsedType}),K}return Ge(e.data)}}Vr.create=n=>new Vr({typeName:V.ZodVoid,...X(n)});class dt extends ne{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==I.array)return E(t,{code:S.invalid_type,expected:I.array,received:t.parsedType}),K;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?S.too_big:S.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}),i.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(E(t,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(E(t,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new xt(t,l,t.path,a)))).then(l=>We.mergeArray(i,l));const s=[...t.data].map((l,a)=>r.type._parseSync(new xt(t,l,t.path,a)));return We.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new dt({...this._def,minLength:{value:e,message:L.toString(t)}})}max(e,t){return new dt({...this._def,maxLength:{value:e,message:L.toString(t)}})}length(e,t){return new dt({...this._def,exactLength:{value:e,message:L.toString(t)}})}nonempty(e){return this.min(1,e)}}dt.create=(n,e)=>new dt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:V.ZodArray,...X(e)});function Kn(n){if(n instanceof Ae){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=kt.create(Kn(i))}return new Ae({...n._def,shape:()=>e})}else return n instanceof dt?new dt({...n._def,type:Kn(n.element)}):n instanceof kt?kt.create(Kn(n.unwrap())):n instanceof Kt?Kt.create(Kn(n.unwrap())):n instanceof $t?$t.create(n.items.map(e=>Kn(e))):n}class Ae extends ne{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=ue.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==I.object){const u=this._getOrReturnCtx(e);return E(u,{code:S.invalid_type,expected:I.object,received:u.parsedType}),K}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Et&&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=s[u],p=r.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new xt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Et){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&&(E(r,{code:S.unrecognized_keys,keys:a}),i.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 xt(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=>We.mergeObjectSync(i,u)):We.mergeObjectSync(i,o)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new Ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var r,s,l,a;const o=(l=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,i).message)!==null&&l!==void 0?l:i.defaultError;return t.code==="unrecognized_keys"?{message:(a=L.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Ae({...this._def,unknownKeys:"strip"})}passthrough(){return new Ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:V.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ae({...this._def,catchall:e})}pick(e){const t={};return ue.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Ae({...this._def,shape:()=>t})}omit(e){const t={};return ue.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Ae({...this._def,shape:()=>t})}deepPartial(){return Kn(this)}partial(e){const t={};return ue.objectKeys(this.shape).forEach(i=>{const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new Ae({...this._def,shape:()=>t})}required(e){const t={};return ue.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof kt;)s=s._def.innerType;t[i]=s}}),new Ae({...this._def,shape:()=>t})}keyof(){return Ta(ue.objectKeys(this.shape))}}Ae.create=(n,e)=>new Ae({shape:()=>n,unknownKeys:"strip",catchall:Et.create(),typeName:V.ZodObject,...X(e)}),Ae.strictCreate=(n,e)=>new Ae({shape:()=>n,unknownKeys:"strict",catchall:Et.create(),typeName:V.ZodObject,...X(e)}),Ae.lazycreate=(n,e)=>new Ae({shape:n,unknownKeys:"strip",catchall:Et.create(),typeName:V.ZodObject,...X(e)});class Oi extends ne{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new it(a.ctx.common.issues));return E(t,{code:S.invalid_union,unionErrors:l}),K}if(t.common.async)return Promise.all(i.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let s;const l=[];for(const o of i){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"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new it(o));return E(t,{code:S.invalid_union,unionErrors:a}),K}}get options(){return this._def.options}}Oi.create=(n,e)=>new Oi({options:n,typeName:V.ZodUnion,...X(e)});const It=n=>n instanceof Pi?It(n.schema):n instanceof ht?It(n.innerType()):n instanceof Ri?[n.value]:n instanceof Wt?n.options:n instanceof Di?ue.objectValues(n.enum):n instanceof ji?It(n._def.innerType):n instanceof Ei?[void 0]:n instanceof Ii?[null]:n instanceof kt?[void 0,...It(n.unwrap())]:n instanceof Kt?[null,...It(n.unwrap())]:n instanceof el||n instanceof zi?It(n.unwrap()):n instanceof Zi?It(n._def.innerType):[];class Fr extends ne{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return E(t,{code:S.invalid_type,expected:I.object,received:t.parsedType}),K;const i=this.discriminator,r=t.data[i],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const r=new Map;for(const s of t){const l=It(s.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,s)}}return new Fr({typeName:V.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...X(i)})}}function Xs(n,e){const t=Bt(n),i=Bt(e);if(n===e)return{valid:!0,data:n};if(t===I.object&&i===I.object){const r=ue.objectKeys(e),s=ue.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of s){const o=Xs(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===I.array&&i===I.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Xs(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===I.date&&i===I.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Mi extends ne{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=(s,l)=>{if(Js(s)||Js(l))return K;const a=Xs(s.value,l.value);return a.valid?((Gs(s)||Gs(l))&&t.dirty(),{status:t.value,value:a.data}):(E(i,{code:S.invalid_intersection_types}),K)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,l])=>r(s,l)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Mi.create=(n,e,t)=>new Mi({left:n,right:e,typeName:V.ZodIntersection,...X(t)});class $t extends ne{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==I.array)return E(i,{code:S.invalid_type,expected:I.array,received:i.parsedType}),K;if(i.data.length<this._def.items.length)return E(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&i.data.length>this._def.items.length&&(E(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((l,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new xt(i,l,i.path,a)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>We.mergeArray(t,l)):We.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $t({...this._def,rest:e})}}$t.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:n,typeName:V.ZodTuple,rest:null,...X(e)})};class Ni extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==I.object)return E(i,{code:S.invalid_type,expected:I.object,received:i.parsedType}),K;const r=[],s=this._def.keyType,l=this._def.valueType;for(const a in i.data)r.push({key:s._parse(new xt(i,a,i.path,a)),value:l._parse(new xt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?We.mergeObjectAsync(t,r):We.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof ne?new Ni({keyType:e,valueType:t,typeName:V.ZodRecord,...X(i)}):new Ni({keyType:ct.create(),valueType:e,typeName:V.ZodRecord,...X(t)})}}class Wr extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==I.map)return E(i,{code:S.invalid_type,expected:I.map,received:i.parsedType}),K;const r=this._def.keyType,s=this._def.valueType,l=[...i.data.entries()].map(([a,o],u)=>({key:r._parse(new xt(i,a,i.path,[u,"key"])),value:s._parse(new xt(i,o,i.path,[u,"value"]))}));if(i.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 K;(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 K;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}Wr.create=(n,e,t)=>new Wr({valueType:e,keyType:n,typeName:V.ZodMap,...X(t)});class pn extends ne{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==I.set)return E(i,{code:S.invalid_type,expected:I.set,received:i.parsedType}),K;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(E(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(E(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return K;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...i.data.values()].map((o,u)=>s._parse(new xt(i,o,i.path,u)));return i.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new pn({...this._def,minSize:{value:e,message:L.toString(t)}})}max(e,t){return new pn({...this._def,maxSize:{value:e,message:L.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:V.ZodSet,...X(e)});class qn extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return E(t,{code:S.invalid_type,expected:I.function,received:t.parsedType}),K;function i(a,o){return Hr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zr(),Vn].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:o}})}function r(a,o){return Hr({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zr(),Vn].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Yn){const a=this;return Ge(async function(...o){const u=new it([]),c=await a._def.args.parseAsync(o,s).catch(g=>{throw u.addIssue(i(o,g)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(g=>{throw u.addIssue(r(p,g)),u})})}else{const a=this;return Ge(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new it([i(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);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 qn({...this._def,args:$t.create(e).rest(hn.create())})}returns(e){return new qn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new qn({args:e||$t.create([]).rest(hn.create()),returns:t||hn.create(),typeName:V.ZodFunction,...X(i)})}}class Pi extends ne{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})}}Pi.create=(n,e)=>new Pi({getter:n,typeName:V.ZodLazy,...X(e)});class Ri extends ne{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:S.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ri.create=(n,e)=>new Ri({value:n,typeName:V.ZodLiteral,...X(e)});function Ta(n,e){return new Wt({values:n,typeName:V.ZodEnum,...X(e)})}class Wt extends ne{constructor(){super(...arguments),Si.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return E(t,{expected:ue.joinValues(i),received:t.parsedType,code:S.invalid_type}),K}if(Ur(this,Si,"f")||xa(this,Si,new Set(this._def.values),"f"),!Ur(this,Si,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return E(t,{received:t.data,code:S.invalid_enum_value,options:i}),K}return Ge(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 Wt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wt.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Si=new WeakMap,Wt.create=Ta;class Di extends ne{constructor(){super(...arguments),Ti.set(this,void 0)}_parse(e){const t=ue.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==I.string&&i.parsedType!==I.number){const r=ue.objectValues(t);return E(i,{expected:ue.joinValues(r),received:i.parsedType,code:S.invalid_type}),K}if(Ur(this,Ti,"f")||xa(this,Ti,new Set(ue.getValidEnumValues(this._def.values)),"f"),!Ur(this,Ti,"f").has(e.data)){const r=ue.objectValues(t);return E(i,{received:i.data,code:S.invalid_enum_value,options:r}),K}return Ge(e.data)}get enum(){return this._def.values}}Ti=new WeakMap,Di.create=(n,e)=>new Di({values:n,typeName:V.ZodNativeEnum,...X(e)});class Yn extends ne{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return E(t,{code:S.invalid_type,expected:I.promise,received:t.parsedType}),K;const i=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return Ge(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yn.create=(n,e)=>new Yn({type:n,typeName:V.ZodPromise,...X(e)});class ht extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:l=>{E(i,l),l.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const l=r.transform(i.data,s);if(i.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return K;const o=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return o.status==="aborted"?K:o.status==="dirty"||t.value==="dirty"?Fn(o.value):o});{if(t.value==="aborted")return K;const a=this._def.schema._parseSync({data:l,path:i.path,parent:i});return a.status==="aborted"?K:a.status==="dirty"||t.value==="dirty"?Fn(a.value):a}}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,s);if(i.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(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ki(l))return l;const a=r.transform(l.value,s);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:i.data,path:i.path,parent:i}).then(l=>ki(l)?Promise.resolve(r.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);ue.assertNever(r)}}ht.create=(n,e,t)=>new ht({schema:n,typeName:V.ZodEffects,effect:e,...X(t)}),ht.createWithPreprocess=(n,e,t)=>new ht({schema:e,effect:{type:"preprocess",transform:n},typeName:V.ZodEffects,...X(t)});class kt extends ne{_parse(e){return this._getType(e)===I.undefined?Ge(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kt.create=(n,e)=>new kt({innerType:n,typeName:V.ZodOptional,...X(e)});class Kt extends ne{_parse(e){return this._getType(e)===I.null?Ge(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kt.create=(n,e)=>new Kt({innerType:n,typeName:V.ZodNullable,...X(e)});class ji extends ne{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===I.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ji.create=(n,e)=>new ji({innerType:n,typeName:V.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...X(e)});class Zi extends ne{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ai(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new it(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new it(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Zi.create=(n,e)=>new Zi({innerType:n,typeName:V.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...X(e)});class Kr extends ne{_parse(e){if(this._getType(e)!==I.nan){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.nan,received:i.parsedType}),K}return{status:"valid",value:e.data}}}Kr.create=n=>new Kr({typeName:V.ZodNaN,...X(n)});const Vc=Symbol("zod_brand");class el extends ne{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class Li extends ne{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?K:s.status==="dirty"?(t.dirty(),Fn(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?K:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new Li({in:e,out:t,typeName:V.ZodPipeline})}}class zi extends ne{_parse(e){const t=this._def.innerType._parse(e),i=r=>(ki(r)&&(r.value=Object.freeze(r.value)),r);return Ai(t)?t.then(r=>i(r)):i(t)}unwrap(){return this._def.innerType}}zi.create=(n,e)=>new zi({innerType:n,typeName:V.ZodReadonly,...X(e)});function Ca(n,e={},t){return n?Wn.create().superRefine((i,r)=>{var s,l;if(!n(i)){const a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):Wn.create()}const Fc={object:Ae.lazycreate};var V;(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"})(V||(V={}));const Wc=(n,e={message:`Input not instance of ${n.name}`})=>Ca(t=>t instanceof n,e),Ea=ct.create,Ia=Vt.create,Kc=Kr.create,qc=Ft.create,Oa=Ci.create,Yc=dn.create,Jc=Br.create,Gc=Ei.create,Qc=Ii.create,Xc=Wn.create,ed=hn.create,td=Et.create,nd=Vr.create,id=dt.create,rd=Ae.create,sd=Ae.strictCreate,ld=Oi.create,ad=Fr.create,od=Mi.create,ud=$t.create,cd=Ni.create,dd=Wr.create,hd=pn.create,pd=qn.create,fd=Pi.create,md=Ri.create,gd=Wt.create,yd=Di.create,vd=Yn.create,Ma=ht.create,bd=kt.create,_d=Kt.create,wd=ht.createWithPreprocess,xd=Li.create;var Hi=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:Tc,getErrorMap:zr,makeIssue:Hr,EMPTY_PATH:Cc,addIssueToContext:E,ParseStatus:We,INVALID:K,DIRTY:Fn,OK:Ge,isAborted:Js,isDirty:Gs,isValid:ki,isAsync:Ai,get util(){return ue},get objectUtil(){return Ys},ZodParsedType:I,getParsedType:Bt,ZodType:ne,datetimeRegex:Sa,ZodString:ct,ZodNumber:Vt,ZodBigInt:Ft,ZodBoolean:Ci,ZodDate:dn,ZodSymbol:Br,ZodUndefined:Ei,ZodNull:Ii,ZodAny:Wn,ZodUnknown:hn,ZodNever:Et,ZodVoid:Vr,ZodArray:dt,ZodObject:Ae,ZodUnion:Oi,ZodDiscriminatedUnion:Fr,ZodIntersection:Mi,ZodTuple:$t,ZodRecord:Ni,ZodMap:Wr,ZodSet:pn,ZodFunction:qn,ZodLazy:Pi,ZodLiteral:Ri,ZodEnum:Wt,ZodNativeEnum:Di,ZodPromise:Yn,ZodEffects:ht,ZodTransformer:ht,ZodOptional:kt,ZodNullable:Kt,ZodDefault:ji,ZodCatch:Zi,ZodNaN:Kr,BRAND:Vc,ZodBranded:el,ZodPipeline:Li,ZodReadonly:zi,custom:Ca,Schema:ne,ZodSchema:ne,late:Fc,get ZodFirstPartyTypeKind(){return V},coerce:{string:n=>ct.create({...n,coerce:!0}),number:n=>Vt.create({...n,coerce:!0}),boolean:n=>Ci.create({...n,coerce:!0}),bigint:n=>Ft.create({...n,coerce:!0}),date:n=>dn.create({...n,coerce:!0})},any:Xc,array:id,bigint:qc,boolean:Oa,date:Yc,discriminatedUnion:ad,effect:Ma,enum:gd,function:pd,instanceof:Wc,intersection:od,lazy:fd,literal:md,map:dd,nan:Kc,nativeEnum:yd,never:td,null:Qc,nullable:_d,number:Ia,object:rd,oboolean:()=>Oa().optional(),onumber:()=>Ia().optional(),optional:bd,ostring:()=>Ea().optional(),pipeline:xd,preprocess:wd,promise:vd,record:cd,set:hd,strictObject:sd,string:Ea,symbol:Jc,transformer:Ma,tuple:ud,undefined:Gc,union:ld,unknown:ed,void:nd,NEVER:K,ZodIssueCode:S,quotelessJson:Sc,ZodError:it});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 qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $d(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}(function(){function n(h,f){var m=h.split("."),A=Be;m[0]in A||!A.execScript||A.execScript("var "+m[0]);for(var j;m.length&&(j=m.shift());)m.length||f===void 0?A=A[j]?A[j]:A[j]={}:A[j]=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(A,j,H){for(var me=Array(arguments.length-2),Ie=2;Ie<arguments.length;Ie++)me[Ie-2]=arguments[Ie];return f.prototype[j].apply(A,me)}}function t(h,f){h!=null&&this.a.apply(this,arguments)}function i(h){h.b=""}function r(h,f){h.sort(f||s)}function s(h,f){return h>f?1:h<f?-1:0}function l(h){var f,m=[],A=0;for(f in h)m[A++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var A=f[m];this.a[A.b]=A}}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 Pe:case ce:case Ee:case Ve:case at:case Xe:case Re: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()),A=0;A<m.length;A++){var j=m[A],H=j.b;if(f.a[H]!=null){h.b&&delete h.b[j.b];var me=j.a==11||j.a==10;if(j.g)for(var j=d(f,H)||[],Ie=0;Ie<j.length;Ie++){var Ue=h,_t=H,Ir=me?j[Ie].clone():j[Ie];Ue.a[_t]||(Ue.a[_t]=[]),Ue.a[_t].push(Ir),Ue.b&&delete Ue.b[_t]}else j=d(f,H),me?(me=d(h,H))?p(me,j):le(h,H,j.clone()):le(h,H,j)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var A=h.g,j=h.f[f];if(m!=null)if(j.g){for(var H=[],me=0;me<m.length;me++)H[me]=A.b(j,m[me]);m=H}else m=A.b(j,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var A=d(h,f);return h.f[f].g?A[m||0]:A}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 A=m.i;if(A===Boolean)m.f=!1;else if(A===Number)m.f=0;else{if(A!==String){m=new A;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 le(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function Ne(h,f){var m,A=[];for(m in f)m!=0&&A.push(new u(m,f[m]));return new a(h,A)}function qe(){c.call(this)}function oe(){c.call(this)}function Ye(){c.call(this)}function Te(){}function U(){}function nt(){}function we(){this.a={}}function Je(h){return h.length==0||vt.test(h)}function G(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=fe[f],m==null)return null;m=new nt().a(Ye.j(),m),h.a[f]=m}return m}function R(h){return h=ae[h],h==null?"ZZ":h[0]}function He(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=we.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=lt(this,this.D)}function lt(h,f){var m;if(f!=null&&isNaN(f)&&f.toUpperCase()in fe){if(m=G(h.G,f),m==null)throw Error("Invalid region code: "+f);m=$(m,10)}else m=0;return m=G(h.G,R(m)),m??bt}function k(h){for(var f=h.f.length,m=0;m<f;++m){var A=h.f[m],j=$(A,1);if(h.w==j)return!1;var H;H=h;var me=A,Ie=$(me,1);if(Ie.indexOf("|")!=-1)H=!1;else{Ie=Ie.replace(Cr,"\\d"),Ie=Ie.replace(hi,"\\d"),i(H.m);var Ue;Ue=H;var me=$(me,2),_t="999999999999999".match(Ie)[0];_t.length<Ue.a.b.length?Ue="":(Ue=_t.replace(new RegExp(Ie,"g"),me),Ue=Ue.replace(RegExp("9","g")," ")),0<Ue.length?(H.m.a(Ue),H=!0):H=!1}if(H)return h.w=j,h.B=pi.test(g(A,4)),h.s=0,!0}return h.l=!1}function b(h,f){for(var m=[],A=f.length-3,j=h.f.length,H=0;H<j;++H){var me=h.f[H];W(me,3)==0?m.push(h.f[H]):(me=g(me,3,Math.min(A,W(me,3)-1)),f.search(me)==0&&m.push(h.f[H]))}h.f=m}function y(h,f){h.i.a(f);var m=f;if(yt.test(m)||h.i.b.length==1&&Zt.test(m)){var A,m=f;m=="+"?(A=m,h.u.a(m)):(A=ut[m],h.u.a(A),h.a.a(A)),f=A}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(Q(h)){if(re(h))return w(h)}else if(0<h.h.length&&(m=h.a.toString(),i(h.a),h.a.a(h.h),h.a.a(m),m=h.b.toString(),A=m.lastIndexOf(h.h),i(h.b),h.b.a(m.substring(0,A))),h.h!=q(h))return h.b.a(" "),w(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!Q(h))return h.h=q(h),x(h);h.A=!0;default:return h.A?(re(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=pe(h,f),A=v(h),0<A.length?A:(b(h,h.a.toString()),k(h)?Z(h):h.l?T(h,m):h.i.toString())):x(h)}}function w(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,i(h.m),h.w="",x(h)}function v(h){for(var f=h.a.toString(),m=h.f.length,A=0;A<m;++A){var j=h.f[A],H=$(j,1);if(new RegExp("^(?:"+H+")$").test(f))return h.B=pi.test(g(j,4)),f=f.replace(new RegExp(H,"g"),g(j,2)),T(h,f)}return""}function T(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 x(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)||[],A=m.length,j=0;j<A;++j){var H=m[j];0<h.h.length&&Je($(H,4))&&!g(H,6)&&H.a[5]==null||(h.h.length!=0||h.o||Je($(H,4))||g(H,6))&&Er.test($(H,2))&&h.f.push(H)}return b(h,f),f=v(h),0<f.length?f:k(h)?Z(h):h.i.toString()}return T(h,f)}function Z(h){var f=h.a.toString(),m=f.length;if(0<m){for(var A="",j=0;j<m;j++)A=pe(h,f.charAt(j));return h.l?T(h,A):h.i.toString()}return h.b.toString()}function q(h){var f,m=h.a.toString(),A=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?(A=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,A=f[0].length,h.b.a(m.substring(0,A)))),i(h.a),h.a.a(m.substring(A)),m.substring(0,A)}function Q(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,i(h.a),h.a.a(f.substring(m)),i(h.b),h.b.a(f.substring(0,m)),f.charAt(0)!="+"&&h.b.a(" "),!0)}function re(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 A,j=f.length,H=1;3>=H&&H<=j;++H)if(A=parseInt(f.substring(0,H),10),A in ae){m.a(f.substring(H)),f=A;break e}}f=0}return f!=0&&(i(h.a),h.a.a(m.toString()),m=R(f),m=="001"?h.g=G(h.G,""+f):m!=h.D&&(h.g=lt(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function pe(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var A=m.search(h.H),m=m.replace(h.H,f);return i(h.m),h.m.a(m),h.s=A,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var Be=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 A=1;A<arguments.length;A++)this.b+=arguments[A];return this},t.prototype.toString=function(){return this.b};var Re=1,Xe=2,Pe=3,ce=4,Ee=6,Ve=16,at=18;c.prototype.set=function(h,f){le(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(qe,c);var _=null;e(oe,c);var M=null;e(Ye,c);var se=null;qe.prototype.j=function(){var h=_;return h||(_=h=Ne(qe,{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},qe.j=qe.prototype.j,oe.prototype.j=function(){var h=M;return h||(M=h=Ne(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,Ye.prototype.j=function(){var h=se;return h||(se=h=Ne(Ye,{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:qe},20:{name:"intl_number_format",v:!0,c:11,type:qe},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},Ye.j=Ye.prototype.j,Te.prototype.a=function(h){throw new h.b,Error("Unimplemented")},Te.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"&&z.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"||z.test(f)))return Number(f);return f};var z=/^-?[0-9]+$/;e(U,Te),U.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(nt,U),nt.prototype.b=function(h,f){return h.a==8?!!f:Te.prototype.b.apply(this,arguments)},nt.prototype.a=function(h,f){return nt.M.a.call(this,h,f)};var ae={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(" ")},fe={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]]]};we.b=function(){return we.a?we.a:we.a=new we};var ut={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"},Zt=RegExp("[++]+"),yt=RegExp("([0-90-9٠-٩۰-۹])"),vt=/^\(?\$1\)?$/,bt=new Ye;le(bt,11,"NA");var Cr=/\[([^\[\]])*\]/g,hi=/\d(?=[^,}][^,}])/g,Er=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),pi=/[- ]/;He.prototype.K=function(){this.C="",i(this.i),i(this.u),i(this.m),this.s=0,this.w="",i(this.b),this.h="",i(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=lt(this,this.D))},He.prototype.L=function(h){return this.C=y(this,h)},n("Cleave.AsYouTypeFormatter",He),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",He.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",He.prototype.K)}).call(typeof qr=="object"&&qr?qr:window);var kd=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,Yr=(n,e,t,i)=>{for(var r=i>1?void 0:i?Ad(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&kd(e,t,r),r};const Sd=Hi.object({firstName:Hi.string().min(1,{message:"First name is required"}),lastName:Hi.string().min(1,{message:"Last name is required"}),email:Hi.string().email({message:"Invalid email address"}),phone:Hi.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 Wu(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=Sd.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 Zr`
|
|
49
|
+
*/function Ic(n,e,t){return n?e(n):t==null?void 0:t(n)}var ce;(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})(ce||(ce={}));var Yi;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Yi||(Yi={}));const I=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vt=n=>{switch(typeof n){case"undefined":return I.undefined;case"string":return I.string;case"number":return isNaN(n)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(n)?I.array:n===null?I.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?I.promise:typeof Map<"u"&&n instanceof Map?I.map:typeof Set<"u"&&n instanceof Set?I.set:typeof Date<"u"&&n instanceof Date?I.date:I.object;default:return I.unknown}},S=ce.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"]),Mc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class rt 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 rt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.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()}}rt.create=n=>new rt(n);const Vn=(n,e)=>{let t;switch(n.code){case S.invalid_type:n.received===I.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case S.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ce.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:t=`Unrecognized key(s) in object: ${ce.joinValues(n.keys,", ")}`;break;case S.invalid_union:t="Invalid input";break;case S.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ce.joinValues(n.options)}`;break;case S.invalid_enum_value:t=`Invalid enum value. Expected ${ce.joinValues(n.options)}, received '${n.received}'`;break;case S.invalid_arguments:t="Invalid function arguments";break;case S.invalid_return_type:t="Invalid function return type";break;case S.invalid_date:t="Invalid date";break;case S.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}"`:ce.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case S.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 S.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 S.custom:t="Invalid input";break;case S.invalid_intersection_types:t="Intersection results could not be merged";break;case S.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case S.not_finite:t="Number must be finite";break;default:t=e.defaultError,ce.assertNever(n)}return{message:t}};let Ta=Vn;function Oc(n){Ta=n}function Hr(){return Ta}const Ur=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}},Nc=[];function E(n,e){const t=Hr(),s=Ur({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 We{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){const i=await r.key,l=await r.value;s.push({key:i,value:l})}return We.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"}),Bn=n=>({status:"dirty",value:n}),Je=n=>({status:"valid",value:n}),Gi=n=>n.status==="aborted",Ji=n=>n.status==="dirty",ks=n=>n.status==="valid",As=n=>typeof Promise<"u"&&n instanceof Promise;function Vr(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 Ca(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 L;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(L||(L={}));var Ss,Ts;class xt{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 Ea=(n,e)=>{if(ks(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 rt(n.common.issues);return this._error=t,this._error}}};function X(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 ne{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 Vt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Vt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new We,ctx:{common:e.parent.common,data:e.data,parsedType:Vt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(As(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:Vt(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Ea(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:Vt(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(As(r)?r:Promise.resolve(r));return Ea(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:S.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 ht({schema:this,typeName:B.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return kt.create(this,this._def)}nullable(){return qt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dt.create(this,this._def)}promise(){return Kn.create(this,this._def)}or(e){return Ms.create([this,e],this._def)}and(e){return Os.create(this,e,this._def)}transform(e){return new ht({...X(this._def),schema:this,typeName:B.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new js({...X(this._def),innerType:this,defaultValue:t,typeName:B.ZodDefault})}brand(){return new el({typeName:B.ZodBranded,type:this,...X(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Zs({...X(this._def),innerType:this,catchValue:t,typeName:B.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ls.create(this,e)}readonly(){return zs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pc=/^c[^\s-]{8,}$/i,Rc=/^[0-9a-z]+$/,Dc=/^[0-9A-HJKMNP-TV-Z]{26}$/,jc=/^[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,Zc=/^[a-z0-9_-]{21}$/i,Lc=/^[-+]?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)?)??$/,zc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qi;const Uc=/^(?:(?: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])$/,Vc=/^(([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})))$/,Bc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ia="((\\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])))",Fc=new RegExp(`^${Ia}$`);function Ma(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 Wc(n){return new RegExp(`^${Ma(n)}$`)}function Oa(n){let e=`${Ia}T${Ma(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 qc(n,e){return!!((e==="v4"||!e)&&Uc.test(n)||(e==="v6"||!e)&&Vc.test(n))}class ct extends ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.string,received:i.parsedType}),q}const s=new We;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.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),E(r,{code:S.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?E(r,{code:S.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&E(r,{code:S.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")zc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"email",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")Qi||(Qi=new RegExp(Hc,"u")),Qi.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"emoji",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")jc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"uuid",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")Zc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"nanoid",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Pc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"cuid",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Rc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"cuid2",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Dc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"ulid",code:S.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),E(r,{validation:"url",code:S.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),E(r,{validation:"regex",code:S.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),E(r,{code:S.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),E(r,{code:S.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Oa(i).test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?Fc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?Wc(i).test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:S.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?Lc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"duration",code:S.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?qc(e.data,i.version)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"ip",code:S.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Bc.test(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{validation:"base64",code:S.invalid_string,message:i.message}),s.dirty()):ce.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:S.invalid_string,...L.errToObj(s)})}_addCheck(e){return new ct({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.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,...L.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,...L.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...L.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...L.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...L.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...L.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...L.errToObj(t)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new ct({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ct({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ct({...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}}ct.create=n=>{var e;return new ct({checks:[],typeName:B.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...X(n)})};function Kc(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 ne{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)!==I.number){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.number,received:i.parsedType}),q}let s;const r=new We;for(const i of this._def.checks)i.kind==="int"?ce.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:S.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),E(s,{code:S.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),E(s,{code:S.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?Kc(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),E(s,{code:S.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:S.not_finite,message:i.message}),r.dirty()):ce.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,s,r){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:L.toString(r)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.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"&&ce.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:B.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...X(n)});class Ft extends ne{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)!==I.bigint){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.bigint,received:i.parsedType}),q}let s;const r=new We;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),E(s,{code:S.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),E(s,{code:S.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),E(s,{code:S.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):ce.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,s,r){return new Ft({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:L.toString(r)}]})}_addCheck(e){return new Ft({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.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}}Ft.create=n=>{var e;return new Ft({checks:[],typeName:B.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...X(n)})};class Cs extends ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.boolean,received:s.parsedType}),q}return Je(e.data)}}Cs.create=n=>new Cs({typeName:B.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...X(n)});class fn extends ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_type,expected:I.date,received:i.parsedType}),q}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return E(i,{code:S.invalid_date}),q}const s=new We;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),E(r,{code:S.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),E(r,{code:S.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):ce.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:L.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}}fn.create=n=>new fn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:B.ZodDate,...X(n)});class Br extends ne{_parse(e){if(this._getType(e)!==I.symbol){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.symbol,received:s.parsedType}),q}return Je(e.data)}}Br.create=n=>new Br({typeName:B.ZodSymbol,...X(n)});class Es extends ne{_parse(e){if(this._getType(e)!==I.undefined){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.undefined,received:s.parsedType}),q}return Je(e.data)}}Es.create=n=>new Es({typeName:B.ZodUndefined,...X(n)});class Is extends ne{_parse(e){if(this._getType(e)!==I.null){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.null,received:s.parsedType}),q}return Je(e.data)}}Is.create=n=>new Is({typeName:B.ZodNull,...X(n)});class Fn extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return Je(e.data)}}Fn.create=n=>new Fn({typeName:B.ZodAny,...X(n)});class mn extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Je(e.data)}}mn.create=n=>new mn({typeName:B.ZodUnknown,...X(n)});class Mt extends ne{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:S.invalid_type,expected:I.never,received:t.parsedType}),q}}Mt.create=n=>new Mt({typeName:B.ZodNever,...X(n)});class Fr extends ne{_parse(e){if(this._getType(e)!==I.undefined){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.void,received:s.parsedType}),q}return Je(e.data)}}Fr.create=n=>new Fr({typeName:B.ZodVoid,...X(n)});class dt extends ne{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==I.array)return E(t,{code:S.invalid_type,expected:I.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?S.too_big:S.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:S.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:S.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 xt(t,l,t.path,a)))).then(l=>We.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new xt(t,l,t.path,a)));return We.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new dt({...this._def,minLength:{value:e,message:L.toString(t)}})}max(e,t){return new dt({...this._def,maxLength:{value:e,message:L.toString(t)}})}length(e,t){return new dt({...this._def,exactLength:{value:e,message:L.toString(t)}})}nonempty(e){return this.min(1,e)}}dt.create=(n,e)=>new dt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:B.ZodArray,...X(e)});function Wn(n){if(n instanceof Ae){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=kt.create(Wn(s))}return new Ae({...n._def,shape:()=>e})}else return n instanceof dt?new dt({...n._def,type:Wn(n.element)}):n instanceof kt?kt.create(Wn(n.unwrap())):n instanceof qt?qt.create(Wn(n.unwrap())):n instanceof $t?$t.create(n.items.map(e=>Wn(e))):n}class Ae extends ne{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=ce.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==I.object){const u=this._getOrReturnCtx(e);return E(u,{code:S.invalid_type,expected:I.object,received:u.parsedType}),q}const{status:s,ctx:r}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Mt&&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 xt(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Mt){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&&(E(r,{code:S.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 xt(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=>We.mergeObjectSync(s,u)):We.mergeObjectSync(s,o)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new Ae({...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=L.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Ae({...this._def,unknownKeys:"strip"})}passthrough(){return new Ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:B.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ae({...this._def,catchall:e})}pick(e){const t={};return ce.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new Ae({...this._def,shape:()=>t})}omit(e){const t={};return ce.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new Ae({...this._def,shape:()=>t})}deepPartial(){return Wn(this)}partial(e){const t={};return ce.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new Ae({...this._def,shape:()=>t})}required(e){const t={};return ce.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof kt;)i=i._def.innerType;t[s]=i}}),new Ae({...this._def,shape:()=>t})}keyof(){return Na(ce.objectKeys(this.shape))}}Ae.create=(n,e)=>new Ae({shape:()=>n,unknownKeys:"strip",catchall:Mt.create(),typeName:B.ZodObject,...X(e)}),Ae.strictCreate=(n,e)=>new Ae({shape:()=>n,unknownKeys:"strict",catchall:Mt.create(),typeName:B.ZodObject,...X(e)}),Ae.lazycreate=(n,e)=>new Ae({shape:n,unknownKeys:"strip",catchall:Mt.create(),typeName:B.ZodObject,...X(e)});class Ms extends ne{_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 rt(a.ctx.common.issues));return E(t,{code:S.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 rt(o));return E(t,{code:S.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}}Ms.create=(n,e)=>new Ms({options:n,typeName:B.ZodUnion,...X(e)});const Ot=n=>n instanceof Ps?Ot(n.schema):n instanceof ht?Ot(n.innerType()):n instanceof Rs?[n.value]:n instanceof Wt?n.options:n instanceof Ds?ce.objectValues(n.enum):n instanceof js?Ot(n._def.innerType):n instanceof Es?[void 0]:n instanceof Is?[null]:n instanceof kt?[void 0,...Ot(n.unwrap())]:n instanceof qt?[null,...Ot(n.unwrap())]:n instanceof el||n instanceof zs?Ot(n.unwrap()):n instanceof Zs?Ot(n._def.innerType):[];class Wr extends ne{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return E(t,{code:S.invalid_type,expected:I.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:S.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=Ot(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 Wr({typeName:B.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...X(s)})}}function Xi(n,e){const t=Vt(n),s=Vt(e);if(n===e)return{valid:!0,data:n};if(t===I.object&&s===I.object){const r=ce.objectKeys(e),i=ce.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=Xi(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===I.array&&s===I.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=Xi(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===I.date&&s===I.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Os extends ne{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(Gi(i)||Gi(l))return q;const a=Xi(i.value,l.value);return a.valid?((Ji(i)||Ji(l))&&t.dirty(),{status:t.value,value:a.data}):(E(s,{code:S.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}))}}Os.create=(n,e,t)=>new Os({left:n,right:e,typeName:B.ZodIntersection,...X(t)});class $t extends ne{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==I.array)return E(s,{code:S.invalid_type,expected:I.array,received:s.parsedType}),q;if(s.data.length<this._def.items.length)return E(s,{code:S.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:S.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 xt(s,l,s.path,a)):null}).filter(l=>!!l);return s.common.async?Promise.all(i).then(l=>We.mergeArray(t,l)):We.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new $t({...this._def,rest:e})}}$t.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:n,typeName:B.ZodTuple,rest:null,...X(e)})};class Ns extends ne{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!==I.object)return E(s,{code:S.invalid_type,expected:I.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 xt(s,a,s.path,a)),value:l._parse(new xt(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?We.mergeObjectAsync(t,r):We.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof ne?new Ns({keyType:e,valueType:t,typeName:B.ZodRecord,...X(s)}):new Ns({keyType:ct.create(),valueType:e,typeName:B.ZodRecord,...X(t)})}}class qr extends ne{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!==I.map)return E(s,{code:S.invalid_type,expected:I.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 xt(s,a,s.path,[u,"key"])),value:i._parse(new xt(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}}}}qr.create=(n,e,t)=>new qr({valueType:e,keyType:n,typeName:B.ZodMap,...X(t)});class gn extends ne{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==I.set)return E(s,{code:S.invalid_type,expected:I.set,received:s.parsedType}),q;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(E(s,{code:S.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:S.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 xt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new gn({...this._def,minSize:{value:e,message:L.toString(t)}})}max(e,t){return new gn({...this._def,maxSize:{value:e,message:L.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gn.create=(n,e)=>new gn({valueType:n,minSize:null,maxSize:null,typeName:B.ZodSet,...X(e)});class qn extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return E(t,{code:S.invalid_type,expected:I.function,received:t.parsedType}),q;function s(a,o){return Ur({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Hr(),Vn].filter(u=>!!u),issueData:{code:S.invalid_arguments,argumentsError:o}})}function r(a,o){return Ur({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Hr(),Vn].filter(u=>!!u),issueData:{code:S.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Kn){const a=this;return Je(async function(...o){const u=new rt([]),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 Je(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new rt([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new rt([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qn({...this._def,args:$t.create(e).rest(mn.create())})}returns(e){return new qn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new qn({args:e||$t.create([]).rest(mn.create()),returns:t||mn.create(),typeName:B.ZodFunction,...X(s)})}}class Ps extends ne{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})}}Ps.create=(n,e)=>new Ps({getter:n,typeName:B.ZodLazy,...X(e)});class Rs extends ne{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:S.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}Rs.create=(n,e)=>new Rs({value:n,typeName:B.ZodLiteral,...X(e)});function Na(n,e){return new Wt({values:n,typeName:B.ZodEnum,...X(e)})}class Wt extends ne{constructor(){super(...arguments),Ss.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{expected:ce.joinValues(s),received:t.parsedType,code:S.invalid_type}),q}if(Vr(this,Ss,"f")||Ca(this,Ss,new Set(this._def.values),"f"),!Vr(this,Ss,"f").has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return E(t,{received:t.data,code:S.invalid_enum_value,options:s}),q}return Je(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 Wt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wt.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}Ss=new WeakMap,Wt.create=Na;class Ds extends ne{constructor(){super(...arguments),Ts.set(this,void 0)}_parse(e){const t=ce.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==I.string&&s.parsedType!==I.number){const r=ce.objectValues(t);return E(s,{expected:ce.joinValues(r),received:s.parsedType,code:S.invalid_type}),q}if(Vr(this,Ts,"f")||Ca(this,Ts,new Set(ce.getValidEnumValues(this._def.values)),"f"),!Vr(this,Ts,"f").has(e.data)){const r=ce.objectValues(t);return E(s,{received:s.data,code:S.invalid_enum_value,options:r}),q}return Je(e.data)}get enum(){return this._def.values}}Ts=new WeakMap,Ds.create=(n,e)=>new Ds({values:n,typeName:B.ZodNativeEnum,...X(e)});class Kn extends ne{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return E(t,{code:S.invalid_type,expected:I.promise,received:t.parsedType}),q;const s=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return Je(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Kn.create=(n,e)=>new Kn({type:n,typeName:B.ZodPromise,...X(e)});class ht extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===B.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);if(s.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return q;const o=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return o.status==="aborted"?q:o.status==="dirty"||t.value==="dirty"?Bn(o.value):o});{if(t.value==="aborted")return q;const a=this._def.schema._parseSync({data:l,path:s.path,parent:s});return a.status==="aborted"?q:a.status==="dirty"||t.value==="dirty"?Bn(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"?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(!ks(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=>ks(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);ce.assertNever(r)}}ht.create=(n,e,t)=>new ht({schema:n,typeName:B.ZodEffects,effect:e,...X(t)}),ht.createWithPreprocess=(n,e,t)=>new ht({schema:e,effect:{type:"preprocess",transform:n},typeName:B.ZodEffects,...X(t)});class kt extends ne{_parse(e){return this._getType(e)===I.undefined?Je(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kt.create=(n,e)=>new kt({innerType:n,typeName:B.ZodOptional,...X(e)});class qt extends ne{_parse(e){return this._getType(e)===I.null?Je(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qt.create=(n,e)=>new qt({innerType:n,typeName:B.ZodNullable,...X(e)});class js extends ne{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===I.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:B.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...X(e)});class Zs extends ne{_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 As(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rt(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new rt(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Zs.create=(n,e)=>new Zs({innerType:n,typeName:B.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...X(e)});class Kr extends ne{_parse(e){if(this._getType(e)!==I.nan){const s=this._getOrReturnCtx(e);return E(s,{code:S.invalid_type,expected:I.nan,received:s.parsedType}),q}return{status:"valid",value:e.data}}}Kr.create=n=>new Kr({typeName:B.ZodNaN,...X(n)});const Yc=Symbol("zod_brand");class el extends ne{_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 Ls extends ne{_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"?q:i.status==="dirty"?(t.dirty(),Bn(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"?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 Ls({in:e,out:t,typeName:B.ZodPipeline})}}class zs extends ne{_parse(e){const t=this._def.innerType._parse(e),s=r=>(ks(r)&&(r.value=Object.freeze(r.value)),r);return As(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}}zs.create=(n,e)=>new zs({innerType:n,typeName:B.ZodReadonly,...X(e)});function Pa(n,e={},t){return n?Fn.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})}}):Fn.create()}const Gc={object:Ae.lazycreate};var B;(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"})(B||(B={}));const Jc=(n,e={message:`Input not instance of ${n.name}`})=>Pa(t=>t instanceof n,e),Ra=ct.create,Da=Bt.create,Qc=Kr.create,Xc=Ft.create,ja=Cs.create,ed=fn.create,td=Br.create,nd=Es.create,sd=Is.create,rd=Fn.create,id=mn.create,ld=Mt.create,ad=Fr.create,od=dt.create,ud=Ae.create,cd=Ae.strictCreate,dd=Ms.create,hd=Wr.create,pd=Os.create,fd=$t.create,md=Ns.create,gd=qr.create,yd=gn.create,vd=qn.create,bd=Ps.create,_d=Rs.create,wd=Wt.create,xd=Ds.create,$d=Kn.create,Za=ht.create,kd=kt.create,Ad=qt.create,Sd=ht.createWithPreprocess,Td=Ls.create;var Hs=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:Oc,getErrorMap:Hr,makeIssue:Ur,EMPTY_PATH:Nc,addIssueToContext:E,ParseStatus:We,INVALID:q,DIRTY:Bn,OK:Je,isAborted:Gi,isDirty:Ji,isValid:ks,isAsync:As,get util(){return ce},get objectUtil(){return Yi},ZodParsedType:I,getParsedType:Vt,ZodType:ne,datetimeRegex:Oa,ZodString:ct,ZodNumber:Bt,ZodBigInt:Ft,ZodBoolean:Cs,ZodDate:fn,ZodSymbol:Br,ZodUndefined:Es,ZodNull:Is,ZodAny:Fn,ZodUnknown:mn,ZodNever:Mt,ZodVoid:Fr,ZodArray:dt,ZodObject:Ae,ZodUnion:Ms,ZodDiscriminatedUnion:Wr,ZodIntersection:Os,ZodTuple:$t,ZodRecord:Ns,ZodMap:qr,ZodSet:gn,ZodFunction:qn,ZodLazy:Ps,ZodLiteral:Rs,ZodEnum:Wt,ZodNativeEnum:Ds,ZodPromise:Kn,ZodEffects:ht,ZodTransformer:ht,ZodOptional:kt,ZodNullable:qt,ZodDefault:js,ZodCatch:Zs,ZodNaN:Kr,BRAND:Yc,ZodBranded:el,ZodPipeline:Ls,ZodReadonly:zs,custom:Pa,Schema:ne,ZodSchema:ne,late:Gc,get ZodFirstPartyTypeKind(){return B},coerce:{string:n=>ct.create({...n,coerce:!0}),number:n=>Bt.create({...n,coerce:!0}),boolean:n=>Cs.create({...n,coerce:!0}),bigint:n=>Ft.create({...n,coerce:!0}),date:n=>fn.create({...n,coerce:!0})},any:rd,array:od,bigint:Xc,boolean:ja,date:ed,discriminatedUnion:hd,effect:Za,enum:wd,function:vd,instanceof:Jc,intersection:pd,lazy:bd,literal:_d,map:gd,nan:Qc,nativeEnum:xd,never:ld,null:sd,nullable:Ad,number:Da,object:ud,oboolean:()=>ja().optional(),onumber:()=>Da().optional(),optional:kd,ostring:()=>Ra().optional(),pipeline:Td,preprocess:Sd,promise:$d,record:md,set:yd,strictObject:cd,string:Ra,symbol:td,transformer:Za,tuple:fd,undefined:nd,union:dd,unknown:id,void:ad,NEVER:q,ZodIssueCode:S,quotelessJson:Mc,ZodError:rt});const La=Xu`*,: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 Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}(function(){function n(h,f){var m=h.split("."),A=Ve;m[0]in A||!A.execScript||A.execScript("var "+m[0]);for(var j;m.length&&(j=m.shift());)m.length||f===void 0?A=A[j]?A[j]:A[j]={}:A[j]=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(A,j,H){for(var me=Array(arguments.length-2),Ie=2;Ie<arguments.length;Ie++)me[Ie-2]=arguments[Ie];return f.prototype[j].apply(A,me)}}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=[],A=0;for(f in h)m[A++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var A=f[m];this.a[A.b]=A}}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 Ne:case de:case Ee:case Be:case ot:case et:case Pe: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()),A=0;A<m.length;A++){var j=m[A],H=j.b;if(f.a[H]!=null){h.b&&delete h.b[j.b];var me=j.a==11||j.a==10;if(j.g)for(var j=d(f,H)||[],Ie=0;Ie<j.length;Ie++){var Ue=h,_t=H,Mr=me?j[Ie].clone():j[Ie];Ue.a[_t]||(Ue.a[_t]=[]),Ue.a[_t].push(Mr),Ue.b&&delete Ue.b[_t]}else j=d(f,H),me?(me=d(h,H))?p(me,j):le(h,H,j.clone()):le(h,H,j)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var A=h.g,j=h.f[f];if(m!=null)if(j.g){for(var H=[],me=0;me<m.length;me++)H[me]=A.b(j,m[me]);m=H}else m=A.b(j,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var A=d(h,f);return h.f[f].g?A[m||0]:A}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 A=m.i;if(A===Boolean)m.f=!1;else if(A===Number)m.f=0;else{if(A!==String){m=new A;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 le(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function ze(h,f){var m,A=[];for(m in f)m!=0&&A.push(new u(m,f[m]));return new a(h,A)}function Ke(){c.call(this)}function ue(){c.call(this)}function Ye(){c.call(this)}function Ce(){}function U(){}function st(){}function we(){this.a={}}function Ge(h){return h.length==0||vt.test(h)}function J(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=fe[f],m==null)return null;m=new st().a(Ye.j(),m),h.a[f]=m}return m}function R(h){return h=ae[h],h==null?"ZZ":h[0]}function He(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=we.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 fe){if(m=J(h.G,f),m==null)throw Error("Invalid region code: "+f);m=$(m,10)}else m=0;return m=J(h.G,R(m)),m??bt}function k(h){for(var f=h.f.length,m=0;m<f;++m){var A=h.f[m],j=$(A,1);if(h.w==j)return!1;var H;H=h;var me=A,Ie=$(me,1);if(Ie.indexOf("|")!=-1)H=!1;else{Ie=Ie.replace(Er,"\\d"),Ie=Ie.replace(ds,"\\d"),s(H.m);var Ue;Ue=H;var me=$(me,2),_t="999999999999999".match(Ie)[0];_t.length<Ue.a.b.length?Ue="":(Ue=_t.replace(new RegExp(Ie,"g"),me),Ue=Ue.replace(RegExp("9","g")," ")),0<Ue.length?(H.m.a(Ue),H=!0):H=!1}if(H)return h.w=j,h.B=hs.test(g(A,4)),h.s=0,!0}return h.l=!1}function b(h,f){for(var m=[],A=f.length-3,j=h.f.length,H=0;H<j;++H){var me=h.f[H];W(me,3)==0?m.push(h.f[H]):(me=g(me,3,Math.min(A,W(me,3)-1)),f.search(me)==0&&m.push(h.f[H]))}h.f=m}function y(h,f){h.i.a(f);var m=f;if(yt.test(m)||h.i.b.length==1&&Zt.test(m)){var A,m=f;m=="+"?(A=m,h.u.a(m)):(A=ut[m],h.u.a(A),h.a.a(A)),f=A}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(Q(h)){if(re(h))return w(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(),A=m.lastIndexOf(h.h),s(h.b),h.b.a(m.substring(0,A))),h.h!=K(h))return h.b.a(" "),w(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!Q(h))return h.h=K(h),x(h);h.A=!0;default:return h.A?(re(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=pe(h,f),A=v(h),0<A.length?A:(b(h,h.a.toString()),k(h)?Z(h):h.l?T(h,m):h.i.toString())):x(h)}}function w(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,s(h.m),h.w="",x(h)}function v(h){for(var f=h.a.toString(),m=h.f.length,A=0;A<m;++A){var j=h.f[A],H=$(j,1);if(new RegExp("^(?:"+H+")$").test(f))return h.B=hs.test(g(j,4)),f=f.replace(new RegExp(H,"g"),g(j,2)),T(h,f)}return""}function T(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 x(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)||[],A=m.length,j=0;j<A;++j){var H=m[j];0<h.h.length&&Ge($(H,4))&&!g(H,6)&&H.a[5]==null||(h.h.length!=0||h.o||Ge($(H,4))||g(H,6))&&Ir.test($(H,2))&&h.f.push(H)}return b(h,f),f=v(h),0<f.length?f:k(h)?Z(h):h.i.toString()}return T(h,f)}function Z(h){var f=h.a.toString(),m=f.length;if(0<m){for(var A="",j=0;j<m;j++)A=pe(h,f.charAt(j));return h.l?T(h,A):h.i.toString()}return h.b.toString()}function K(h){var f,m=h.a.toString(),A=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?(A=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,A=f[0].length,h.b.a(m.substring(0,A)))),s(h.a),h.a.a(m.substring(A)),m.substring(0,A)}function Q(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 re(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 A,j=f.length,H=1;3>=H&&H<=j;++H)if(A=parseInt(f.substring(0,H),10),A in ae){m.a(f.substring(H)),f=A;break e}}f=0}return f!=0&&(s(h.a),h.a.a(m.toString()),m=R(f),m=="001"?h.g=J(h.G,""+f):m!=h.D&&(h.g=at(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function pe(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var A=m.search(h.H),m=m.replace(h.H,f);return s(h.m),h.m.a(m),h.s=A,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var Ve=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 A=1;A<arguments.length;A++)this.b+=arguments[A];return this},t.prototype.toString=function(){return this.b};var Pe=1,et=2,Ne=3,de=4,Ee=6,Be=16,ot=18;c.prototype.set=function(h,f){le(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(Ke,c);var _=null;e(ue,c);var O=null;e(Ye,c);var ie=null;Ke.prototype.j=function(){var h=_;return h||(_=h=ze(Ke,{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},Ke.j=Ke.prototype.j,ue.prototype.j=function(){var h=O;return h||(O=h=ze(ue,{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},ue.j=ue.prototype.j,Ye.prototype.j=function(){var h=ie;return h||(ie=h=ze(Ye,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:ue},2:{name:"fixed_line",c:11,type:ue},3:{name:"mobile",c:11,type:ue},4:{name:"toll_free",c:11,type:ue},5:{name:"premium_rate",c:11,type:ue},6:{name:"shared_cost",c:11,type:ue},7:{name:"personal_number",c:11,type:ue},8:{name:"voip",c:11,type:ue},21:{name:"pager",c:11,type:ue},25:{name:"uan",c:11,type:ue},27:{name:"emergency",c:11,type:ue},28:{name:"voicemail",c:11,type:ue},29:{name:"short_code",c:11,type:ue},30:{name:"standard_rate",c:11,type:ue},31:{name:"carrier_specific",c:11,type:ue},33:{name:"sms_services",c:11,type:ue},24:{name:"no_international_dialling",c:11,type:ue},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:Ke},20:{name:"intl_number_format",v:!0,c:11,type:Ke},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},Ye.j=Ye.prototype.j,Ce.prototype.a=function(h){throw new h.b,Error("Unimplemented")},Ce.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"&&z.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"||z.test(f)))return Number(f);return f};var z=/^-?[0-9]+$/;e(U,Ce),U.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(st,U),st.prototype.b=function(h,f){return h.a==8?!!f:Ce.prototype.b.apply(this,arguments)},st.prototype.a=function(h,f){return st.M.a.call(this,h,f)};var ae={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(" ")},fe={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]]]};we.b=function(){return we.a?we.a:we.a=new we};var ut={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"},Zt=RegExp("[++]+"),yt=RegExp("([0-90-9٠-٩۰-۹])"),vt=/^\(?\$1\)?$/,bt=new Ye;le(bt,11,"NA");var Er=/\[([^\[\]])*\]/g,ds=/\d(?=[^,}][^,}])/g,Ir=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),hs=/[- ]/;He.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))},He.prototype.L=function(h){return this.C=y(this,h)},n("Cleave.AsYouTypeFormatter",He),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",He.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",He.prototype.K)}).call(typeof Yr=="object"&&Yr?Yr:window);var Ed=Object.defineProperty,Id=Object.getOwnPropertyDescriptor,Gr=(n,e,t,s)=>{for(var r=s>1?void 0:s?Id(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&&Ed(e,t,r),r};const Md=Hs.object({firstName:Hs.string().min(1,{message:"First name is required"}),lastName:Hs.string().min(1,{message:"Last name is required"}),email:Hs.string().email({message:"Invalid email address"}),phone:Hs.string().regex(/^(1-)?\d{3}-\d{3}-\d{4}$/,{message:"Invalid phone number"}).transform(n=>n.replace(/-/g,"").replace(/^1/,""))});let Yn=class extends Un{constructor(){super(...arguments),this.params={firstName:"",lastName:"",email:"",phone:""},this.errors=[]}firstUpdated(){this.phoneCleave=new Ju(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=Md.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 Lr`
|
|
50
50
|
<div>
|
|
51
51
|
<iai-chat-message-assistant
|
|
52
52
|
content="Your contact information is required to transfer to a live agent."
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
>
|
|
101
101
|
</div>
|
|
102
102
|
|
|
103
|
-
${
|
|
103
|
+
${Ic(this.errors.length,()=>Lr`
|
|
104
104
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4" role="alert">
|
|
105
105
|
<ul>
|
|
106
|
-
${this.errors.map(n=>
|
|
106
|
+
${this.errors.map(n=>Lr`
|
|
107
107
|
<li>${n.message}</li>
|
|
108
108
|
`)}
|
|
109
109
|
</ul>
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
</button>
|
|
128
128
|
</form>
|
|
129
129
|
</div>
|
|
130
|
-
`}};
|
|
130
|
+
`}};Yn.styles=[La],Gr([Aa({type:Object})],Yn.prototype,"params",2),Gr([Cc()],Yn.prototype,"errors",2),Gr([Ec("#phone")],Yn.prototype,"phoneInput",2),Yn=Gr([ka("any-contact-form")],Yn);var Od=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Pd=(n,e,t,s)=>{for(var r=s>1?void 0:s?Nd(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&&Od(e,t,r),r};let tl=class extends Un{transfer(){this.dispatchEvent(new CustomEvent("transfer"))}cancel(){this.dispatchEvent(new CustomEvent("cancel"))}render(){return Lr`
|
|
131
131
|
<div class="my-4">
|
|
132
132
|
<strong>Would you like to transfer to an agent?</strong>
|
|
133
133
|
<div>
|
|
@@ -135,69 +135,69 @@
|
|
|
135
135
|
<button class="btn-secondary" @click=${this.cancel}>Cancel</button>
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
|
-
`}};tl.styles=[
|
|
138
|
+
`}};tl.styles=[La],tl=Pd([ka("any-transfer-confirmation")],tl);var Rd=Object.defineProperty,Dd=(n,e,t)=>e in n?Rd(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,$e=(n,e,t)=>(Dd(n,typeof e!="symbol"?e+"":e,t),t),jd=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},za=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},nl=(n,e,t)=>(jd(n,e,"access private method"),t);/**
|
|
139
139
|
* @license
|
|
140
140
|
* Copyright 2019 Google LLC
|
|
141
141
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
142
|
-
*/const Jr=globalThis,
|
|
142
|
+
*/const Jr=globalThis,sl=Jr.ShadowRoot&&(Jr.ShadyCSS===void 0||Jr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rl=Symbol(),Ha=new WeakMap;let Ua=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==rl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o;const e=this.t;if(sl&&n===void 0){const t=e!==void 0&&e.length===1;t&&(n=Ha.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&Ha.set(e,n))}return n}toString(){return this.cssText}};const Zd=n=>new Ua(typeof n=="string"?n:n+"",void 0,rl),Nt=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,r,i)=>s+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[i+1],n[0]);return new Ua(t,n,rl)},Ld=(n,e)=>{if(sl)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),r=Jr.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=t.cssText,n.appendChild(s)}},Va=sl?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Zd(t)})(n):n;/**
|
|
143
143
|
* @license
|
|
144
144
|
* Copyright 2017 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
|
-
*/const{is:
|
|
146
|
+
*/const{is:zd,defineProperty:Hd,getOwnPropertyDescriptor:Ud,getOwnPropertyNames:Vd,getOwnPropertySymbols:Bd,getPrototypeOf:Fd}=Object,Gn=globalThis,Ba=Gn.trustedTypes,Wd=Ba?Ba.emptyScript:"",Fa=Gn.reactiveElementPolyfillSupport,Us=(n,e)=>n,Qr={toAttribute(n,e){switch(e){case Boolean:n=n?Wd:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},il=(n,e)=>!zd(n,e),Wa={attribute:!0,type:String,converter:Qr,reflect:!1,hasChanged:il};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Gn.litPropertyMetadata??(Gn.litPropertyMetadata=new WeakMap);class Jn extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Wa){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,t);r!==void 0&&Hd(this.prototype,e,r)}}static getPropertyDescriptor(e,t,s){const{get:r,set:i}=Ud(this.prototype,e)??{get(){return this[t]},set(l){this[t]=l}};return{get(){return r==null?void 0:r.call(this)},set(l){const a=r==null?void 0:r.call(this);i.call(this,l),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Wa}static _$Ei(){if(this.hasOwnProperty(Us("elementProperties")))return;const e=Fd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Us("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Us("properties"))){const t=this.properties,s=[...Vd(t),...Bd(t)];for(const r of s)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,r]of t)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const r=this._$Eu(t,s);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)t.unshift(Va(r))}else e!==void 0&&t.push(Va(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ld(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$EC(e,t){var s;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const l=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:Qr).toAttribute(t,r.type);this._$Em=e,l==null?this.removeAttribute(i):this.setAttribute(i,l),this._$Em=null}}_$AK(e,t){var s;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const l=r.getPropertyOptions(i),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((s=l.converter)==null?void 0:s.fromAttribute)!==void 0?l.converter:Qr;this._$Em=i,this[i]=a.fromAttribute(t,l.type),this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??il)(this[e],t))return;this.P(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,s){this._$AL.has(e)||this._$AL.set(e,t),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[i,l]of this._$Ep)this[i]=l;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,l]of r)l.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],l)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostUpdate)==null?void 0:i.call(r)}),this.update(s)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(s)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Jn.elementStyles=[],Jn.shadowRootOptions={mode:"open"},Jn[Us("elementProperties")]=new Map,Jn[Us("finalized")]=new Map,Fa==null||Fa({ReactiveElement:Jn}),(Gn.reactiveElementVersions??(Gn.reactiveElementVersions=[])).push("2.0.4");/**
|
|
147
147
|
* @license
|
|
148
148
|
* Copyright 2017 Google LLC
|
|
149
149
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
150
|
-
*/const
|
|
151
|
-
\f\r]`,
|
|
152
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
150
|
+
*/const Xr=globalThis,ei=Xr.trustedTypes,qa=ei?ei.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ka="$lit$",Kt=`lit$${(Math.random()+"").slice(9)}$`,Ya="?"+Kt,qd=`<${Ya}>`,yn=document,ti=()=>yn.createComment(""),Vs=n=>n===null||typeof n!="object"&&typeof n!="function",Ga=Array.isArray,Kd=n=>Ga(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ll=`[
|
|
151
|
+
\f\r]`,Bs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ja=/-->/g,Qa=/>/g,vn=RegExp(`>|${ll}(?:([^\\s"'>=/]+)(${ll}*=${ll}*(?:[^
|
|
152
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xa=/'/g,eo=/"/g,to=/^(?:script|style|textarea|title)$/i,Yt=Symbol.for("lit-noChange"),Oe=Symbol.for("lit-nothing"),no=new WeakMap,bn=yn.createTreeWalker(yn,129);function so(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return qa!==void 0?qa.createHTML(e):e}const Yd=(n,e)=>{const t=n.length-1,s=[];let r,i=e===2?"<svg>":"",l=Bs;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===Bs?c[1]==="!--"?l=Ja:c[1]!==void 0?l=Qa:c[2]!==void 0?(to.test(c[2])&&(r=RegExp("</"+c[2],"g")),l=vn):c[3]!==void 0&&(l=vn):l===vn?c[0]===">"?(l=r??Bs,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?vn:c[3]==='"'?eo:Xa):l===eo||l===Xa?l=vn:l===Ja||l===Qa?l=Bs:(l=vn,r=void 0);const g=l===vn&&n[a+1].startsWith("/>")?" ":"";i+=l===Bs?o+qd:p>=0?(s.push(u),o.slice(0,p)+Ka+o.slice(p)+Kt+g):o+Kt+(p===-2?a:g)}return[so(n,i+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};let al=class Lu{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let i=0,l=0;const a=e.length-1,o=this.parts,[u,c]=Yd(e,t);if(this.el=Lu.createElement(u,s),bn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=bn.nextNode())!==null&&o.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(Ka)){const d=c[l++],g=r.getAttribute(p).split(Kt),$=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:$[2],strings:g,ctor:$[1]==="."?Jd:$[1]==="?"?Qd:$[1]==="@"?Xd:ni}),r.removeAttribute(p)}else p.startsWith(Kt)&&(o.push({type:6,index:i}),r.removeAttribute(p));if(to.test(r.tagName)){const p=r.textContent.split(Kt),d=p.length-1;if(d>0){r.textContent=ei?ei.emptyScript:"";for(let g=0;g<d;g++)r.append(p[g],ti()),bn.nextNode(),o.push({type:2,index:++i});r.append(p[d],ti())}}}else if(r.nodeType===8)if(r.data===Ya)o.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(Kt,p+1))!==-1;)o.push({type:7,index:i}),p+=Kt.length-1}i++}}static createElement(e,t){const s=yn.createElement("template");return s.innerHTML=e,s}};function Qn(n,e,t=n,s){var r,i;if(e===Yt)return e;let l=s!==void 0?(r=t._$Co)==null?void 0:r[s]:t._$Cl;const a=Vs(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((i=l==null?void 0:l._$AO)==null||i.call(l,!1),a===void 0?l=void 0:(l=new a(n),l._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=l:t._$Cl=l),l!==void 0&&(e=Qn(n,l._$AS(n,e.values),l,s)),e}let Gd=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:e},parts:t}=this._$AD,s=((n==null?void 0:n.creationScope)??yn).importNode(e,!0);bn.currentNode=s;let r=bn.nextNode(),i=0,l=0,a=t[0];for(;a!==void 0;){if(i===a.index){let o;a.type===2?o=new ro(r,r.nextSibling,this,n):a.type===1?o=new a.ctor(r,a.name,a.strings,this,n):a.type===6&&(o=new eh(r,this,n)),this._$AV.push(o),a=t[++l]}i!==(a==null?void 0:a.index)&&(r=bn.nextNode(),i++)}return bn.currentNode=yn,s}p(n){let e=0;for(const t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},ro=class zu{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=Oe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Qn(this,e,t),Vs(e)?e===Oe||e==null||e===""?(this._$AH!==Oe&&this._$AR(),this._$AH=Oe):e!==this._$AH&&e!==Yt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Kd(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==Oe&&Vs(this._$AH)?this._$AA.nextSibling.data=e:this.T(yn.createTextNode(e)),this._$AH=e}$(e){var t;const{values:s,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=al.createElement(so(r.h,r.h[0]),this.options)),r);if(((t=this._$AH)==null?void 0:t._$AD)===i)this._$AH.p(s);else{const l=new Gd(i,this),a=l.u(this.options);l.p(s),this.T(a),this._$AH=l}}_$AC(e){let t=no.get(e.strings);return t===void 0&&no.set(e.strings,t=new al(e)),t}k(e){Ga(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const i of e)r===t.length?t.push(s=new zu(this.S(ti()),this.S(ti()),this,this.options)):s=t[r],s._$AI(i),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},ni=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,s,r){this.type=1,this._$AH=Oe,this._$AN=void 0,this.element=n,this.name=e,this._$AM=s,this.options=r,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=Oe}_$AI(n,e=this,t,s){const r=this.strings;let i=!1;if(r===void 0)n=Qn(this,n,e,0),i=!Vs(n)||n!==this._$AH&&n!==Yt,i&&(this._$AH=n);else{const l=n;let a,o;for(n=r[0],a=0;a<r.length-1;a++)o=Qn(this,l[t+a],e,a),o===Yt&&(o=this._$AH[a]),i||(i=!Vs(o)||o!==this._$AH[a]),o===Oe?n=Oe:n!==Oe&&(n+=(o??"")+r[a+1]),this._$AH[a]=o}i&&!s&&this.j(n)}j(n){n===Oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},Jd=class extends ni{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===Oe?void 0:n}},Qd=class extends ni{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==Oe)}},Xd=class extends ni{constructor(n,e,t,s,r){super(n,e,t,s,r),this.type=5}_$AI(n,e=this){if((n=Qn(this,n,e,0)??Oe)===Yt)return;const t=this._$AH,s=n===Oe&&t!==Oe||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,r=n!==Oe&&(t===Oe||s);s&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,n):this._$AH.handleEvent(n)}},eh=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){Qn(this,n)}};const io=Xr.litHtmlPolyfillSupport;io==null||io(al,ro),(Xr.litHtmlVersions??(Xr.litHtmlVersions=[])).push("3.1.2");/**
|
|
153
153
|
* @license
|
|
154
154
|
* Copyright 2017 Google LLC
|
|
155
155
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
156
|
-
*/const
|
|
157
|
-
\f\r]`,
|
|
158
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
156
|
+
*/const si=globalThis,ri=si.trustedTypes,lo=ri?ri.createPolicy("lit-html",{createHTML:n=>n}):void 0,ao="$lit$",Gt=`lit$${(Math.random()+"").slice(9)}$`,oo="?"+Gt,th=`<${oo}>`,_n=document,Fs=()=>_n.createComment(""),Ws=n=>n===null||typeof n!="object"&&typeof n!="function",uo=Array.isArray,nh=n=>uo(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ol=`[
|
|
157
|
+
\f\r]`,qs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,co=/-->/g,ho=/>/g,wn=RegExp(`>|${ol}(?:([^\\s"'>=/]+)(${ol}*=${ol}*(?:[^
|
|
158
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),po=/'/g,fo=/"/g,mo=/^(?:script|style|textarea|title)$/i,sh=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),oe=sh(1),Xn=Symbol.for("lit-noChange"),Ze=Symbol.for("lit-nothing"),go=new WeakMap,xn=_n.createTreeWalker(_n,129);function yo(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return lo!==void 0?lo.createHTML(e):e}const rh=(n,e)=>{const t=n.length-1,s=[];let r,i=e===2?"<svg>":"",l=qs;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===qs?c[1]==="!--"?l=co:c[1]!==void 0?l=ho:c[2]!==void 0?(mo.test(c[2])&&(r=RegExp("</"+c[2],"g")),l=wn):c[3]!==void 0&&(l=wn):l===wn?c[0]===">"?(l=r??qs,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?wn:c[3]==='"'?fo:po):l===fo||l===po?l=wn:l===co||l===ho?l=qs:(l=wn,r=void 0);const g=l===wn&&n[a+1].startsWith("/>")?" ":"";i+=l===qs?o+th:p>=0?(s.push(u),o.slice(0,p)+ao+o.slice(p)+Gt+g):o+Gt+(p===-2?a:g)}return[yo(n,i+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};let ul=class Hu{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let i=0,l=0;const a=e.length-1,o=this.parts,[u,c]=rh(e,t);if(this.el=Hu.createElement(u,s),xn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=xn.nextNode())!==null&&o.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(ao)){const d=c[l++],g=r.getAttribute(p).split(Gt),$=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:$[2],strings:g,ctor:$[1]==="."?lh:$[1]==="?"?ah:$[1]==="@"?oh:ii}),r.removeAttribute(p)}else p.startsWith(Gt)&&(o.push({type:6,index:i}),r.removeAttribute(p));if(mo.test(r.tagName)){const p=r.textContent.split(Gt),d=p.length-1;if(d>0){r.textContent=ri?ri.emptyScript:"";for(let g=0;g<d;g++)r.append(p[g],Fs()),xn.nextNode(),o.push({type:2,index:++i});r.append(p[d],Fs())}}}else if(r.nodeType===8)if(r.data===oo)o.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(Gt,p+1))!==-1;)o.push({type:7,index:i}),p+=Gt.length-1}i++}}static createElement(e,t){const s=_n.createElement("template");return s.innerHTML=e,s}};function es(n,e,t=n,s){var r,i;if(e===Xn)return e;let l=s!==void 0?(r=t._$Co)==null?void 0:r[s]:t._$Cl;const a=Ws(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((i=l==null?void 0:l._$AO)==null||i.call(l,!1),a===void 0?l=void 0:(l=new a(n),l._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=l:t._$Cl=l),l!==void 0&&(e=es(n,l._$AS(n,e.values),l,s)),e}let ih=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:e},parts:t}=this._$AD,s=((n==null?void 0:n.creationScope)??_n).importNode(e,!0);xn.currentNode=s;let r=xn.nextNode(),i=0,l=0,a=t[0];for(;a!==void 0;){if(i===a.index){let o;a.type===2?o=new cl(r,r.nextSibling,this,n):a.type===1?o=new a.ctor(r,a.name,a.strings,this,n):a.type===6&&(o=new uh(r,this,n)),this._$AV.push(o),a=t[++l]}i!==(a==null?void 0:a.index)&&(r=xn.nextNode(),i++)}return xn.currentNode=_n,s}p(n){let e=0;for(const t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},cl=class Uu{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=Ze,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=es(this,e,t),Ws(e)?e===Ze||e==null||e===""?(this._$AH!==Ze&&this._$AR(),this._$AH=Ze):e!==this._$AH&&e!==Xn&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):nh(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==Ze&&Ws(this._$AH)?this._$AA.nextSibling.data=e:this.T(_n.createTextNode(e)),this._$AH=e}$(e){var t;const{values:s,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ul.createElement(yo(r.h,r.h[0]),this.options)),r);if(((t=this._$AH)==null?void 0:t._$AD)===i)this._$AH.p(s);else{const l=new ih(i,this),a=l.u(this.options);l.p(s),this.T(a),this._$AH=l}}_$AC(e){let t=go.get(e.strings);return t===void 0&&go.set(e.strings,t=new ul(e)),t}k(e){uo(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const i of e)r===t.length?t.push(s=new Uu(this.S(Fs()),this.S(Fs()),this,this.options)):s=t[r],s._$AI(i),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},ii=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,s,r){this.type=1,this._$AH=Ze,this._$AN=void 0,this.element=n,this.name=e,this._$AM=s,this.options=r,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=Ze}_$AI(n,e=this,t,s){const r=this.strings;let i=!1;if(r===void 0)n=es(this,n,e,0),i=!Ws(n)||n!==this._$AH&&n!==Xn,i&&(this._$AH=n);else{const l=n;let a,o;for(n=r[0],a=0;a<r.length-1;a++)o=es(this,l[t+a],e,a),o===Xn&&(o=this._$AH[a]),i||(i=!Ws(o)||o!==this._$AH[a]),o===Ze?n=Ze:n!==Ze&&(n+=(o??"")+r[a+1]),this._$AH[a]=o}i&&!s&&this.j(n)}j(n){n===Ze?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},lh=class extends ii{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===Ze?void 0:n}},ah=class extends ii{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==Ze)}},oh=class extends ii{constructor(n,e,t,s,r){super(n,e,t,s,r),this.type=5}_$AI(n,e=this){if((n=es(this,n,e,0)??Ze)===Xn)return;const t=this._$AH,s=n===Ze&&t!==Ze||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,r=n!==Ze&&(t===Ze||s);s&&this.element.removeEventListener(this.name,this,t),r&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,n):this._$AH.handleEvent(n)}},uh=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){es(this,n)}};const vo=si.litHtmlPolyfillSupport;vo==null||vo(ul,cl),(si.litHtmlVersions??(si.litHtmlVersions=[])).push("3.1.2");const ch=(n,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let r=s._$litPart$;if(r===void 0){const i=(t==null?void 0:t.renderBefore)??null;s._$litPart$=r=new cl(e.insertBefore(Fs(),i),i,void 0,t??{})}return r._$AI(n),r};/**
|
|
159
159
|
* @license
|
|
160
160
|
* Copyright 2017 Google LLC
|
|
161
161
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
162
|
-
*/let
|
|
162
|
+
*/let nt=class extends Jn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const e=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=e.firstChild),e}update(n){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=ch(e,this.renderRoot,this.renderOptions)}connectedCallback(){var n;super.connectedCallback(),(n=this._$Do)==null||n.setConnected(!0)}disconnectedCallback(){var n;super.disconnectedCallback(),(n=this._$Do)==null||n.setConnected(!1)}render(){return Xn}};var bo;nt._$litElement$=!0,nt.finalized=!0,(bo=globalThis.litElementHydrateSupport)==null||bo.call(globalThis,{LitElement:nt});const _o=globalThis.litElementPolyfillSupport;_o==null||_o({LitElement:nt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
|
|
163
163
|
* @license
|
|
164
164
|
* Copyright 2017 Google LLC
|
|
165
165
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
166
|
-
*/const
|
|
166
|
+
*/const At=n=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
|
|
167
167
|
* @license
|
|
168
168
|
* Copyright 2017 Google LLC
|
|
169
169
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
170
|
-
*/const
|
|
170
|
+
*/const dh={attribute:!0,type:String,converter:Qr,reflect:!1,hasChanged:il},hh=(n=dh,e,t)=>{const{kind:s,metadata:r}=t;let i=globalThis.litPropertyMetadata.get(r);if(i===void 0&&globalThis.litPropertyMetadata.set(r,i=new Map),i.set(t.name,n),s==="accessor"){const{name:l}=t;return{set(a){const o=e.get.call(this);e.set.call(this,a),this.requestUpdate(l,o,n)},init(a){return a!==void 0&&this.P(l,void 0,n),a}}}if(s==="setter"){const{name:l}=t;return function(a){const o=this[l];e.call(this,a),this.requestUpdate(l,o,n)}}throw Error("Unsupported decorator location: "+s)};function Se(n){return(e,t)=>typeof t=="object"?hh(n,e,t):((s,r,i)=>{const l=r.hasOwnProperty(i);return r.constructor.createProperty(i,l?{...s,wrapped:!0}:s),l?Object.getOwnPropertyDescriptor(r,i):void 0})(n,e,t)}/**
|
|
171
171
|
* @license
|
|
172
172
|
* Copyright 2017 Google LLC
|
|
173
173
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
|
-
*/function
|
|
174
|
+
*/function Jt(n){return Se({...n,state:!0,attribute:!1})}/**
|
|
175
175
|
* @license
|
|
176
176
|
* Copyright 2017 Google LLC
|
|
177
177
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
178
|
-
*/const
|
|
178
|
+
*/const wo=(n,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(n,e,t),t);/**
|
|
179
179
|
* @license
|
|
180
180
|
* Copyright 2017 Google LLC
|
|
181
181
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
182
|
-
*/function
|
|
182
|
+
*/function li(n,e){return(t,s,r)=>{const i=l=>{var a;return((a=l.renderRoot)==null?void 0:a.querySelector(n))??null};if(e){const{get:l,set:a}=typeof s=="object"?t:r??(()=>{const o=Symbol();return{get(){return this[o]},set(u){this[o]=u}}})();return wo(t,s,{get(){let o=l.call(this);return o===void 0&&(o=i(this),(o!==null||this.hasUpdated)&&a.call(this,o)),o}})}return wo(t,s,{get(){return i(this)}})}}/**
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2017 Google LLC
|
|
185
185
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
186
|
-
*/const
|
|
187
|
-
\f\r]`,
|
|
188
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
186
|
+
*/const ai=globalThis,oi=ai.trustedTypes,xo=oi?oi.createPolicy("lit-html",{createHTML:n=>n}):void 0,dl="$lit$",Pt=`lit$${Math.random().toFixed(9).slice(2)}$`,hl="?"+Pt,ph=`<${hl}>`,$n=document,ui=()=>$n.createComment(""),Ks=n=>n===null||typeof n!="object"&&typeof n!="function",$o=Array.isArray,ko=n=>$o(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",pl=`[
|
|
187
|
+
\f\r]`,Ys=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ao=/-->/g,So=/>/g,kn=RegExp(`>|${pl}(?:([^\\s"'>=/]+)(${pl}*=${pl}*(?:[^
|
|
188
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),To=/'/g,Co=/"/g,Eo=/^(?:script|style|textarea|title)$/i,ts=Symbol.for("lit-noChange"),Le=Symbol.for("lit-nothing"),Io=new WeakMap,An=$n.createTreeWalker($n,129);function Mo(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return xo!==void 0?xo.createHTML(e):e}const Oo=(n,e)=>{const t=n.length-1,s=[];let r,i=e===2?"<svg>":"",l=Ys;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===Ys?c[1]==="!--"?l=Ao:c[1]!==void 0?l=So:c[2]!==void 0?(Eo.test(c[2])&&(r=RegExp("</"+c[2],"g")),l=kn):c[3]!==void 0&&(l=kn):l===kn?c[0]===">"?(l=r??Ys,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?kn:c[3]==='"'?Co:To):l===Co||l===To?l=kn:l===Ao||l===So?l=Ys:(l=kn,r=void 0);const g=l===kn&&n[a+1].startsWith("/>")?" ":"";i+=l===Ys?o+ph:p>=0?(s.push(u),o.slice(0,p)+dl+o.slice(p)+Pt+g):o+Pt+(p===-2?a:g)}return[Mo(n,i+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};class Gs{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let i=0,l=0;const a=e.length-1,o=this.parts,[u,c]=Oo(e,t);if(this.el=Gs.createElement(u,s),An.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=An.nextNode())!==null&&o.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(dl)){const d=c[l++],g=r.getAttribute(p).split(Pt),$=/([.?@])?(.*)/.exec(d);o.push({type:1,index:i,name:$[2],strings:g,ctor:$[1]==="."?Po:$[1]==="?"?Ro:$[1]==="@"?Do:Qs}),r.removeAttribute(p)}else p.startsWith(Pt)&&(o.push({type:6,index:i}),r.removeAttribute(p));if(Eo.test(r.tagName)){const p=r.textContent.split(Pt),d=p.length-1;if(d>0){r.textContent=oi?oi.emptyScript:"";for(let g=0;g<d;g++)r.append(p[g],ui()),An.nextNode(),o.push({type:2,index:++i});r.append(p[d],ui())}}}else if(r.nodeType===8)if(r.data===hl)o.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(Pt,p+1))!==-1;)o.push({type:7,index:i}),p+=Pt.length-1}i++}}static createElement(e,t){const s=$n.createElement("template");return s.innerHTML=e,s}}function Sn(n,e,t=n,s){var r,i;if(e===ts)return e;let l=s!==void 0?(r=t._$Co)==null?void 0:r[s]:t._$Cl;const a=Ks(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((i=l==null?void 0:l._$AO)==null||i.call(l,!1),a===void 0?l=void 0:(l=new a(n),l._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=l:t._$Cl=l),l!==void 0&&(e=Sn(n,l._$AS(n,e.values),l,s)),e}class No{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=((e==null?void 0:e.creationScope)??$n).importNode(t,!0);An.currentNode=r;let i=An.nextNode(),l=0,a=0,o=s[0];for(;o!==void 0;){if(l===o.index){let u;o.type===2?u=new Js(i,i.nextSibling,this,e):o.type===1?u=new o.ctor(i,o.name,o.strings,this,e):o.type===6&&(u=new jo(i,this,e)),this._$AV.push(u),o=s[++a]}l!==(o==null?void 0:o.index)&&(i=An.nextNode(),l++)}return An.currentNode=$n,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class Js{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=Le,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Sn(this,e,t),Ks(e)?e===Le||e==null||e===""?(this._$AH!==Le&&this._$AR(),this._$AH=Le):e!==this._$AH&&e!==ts&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ko(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==Le&&Ks(this._$AH)?this._$AA.nextSibling.data=e:this.T($n.createTextNode(e)),this._$AH=e}$(e){var t;const{values:s,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Gs.createElement(Mo(r.h,r.h[0]),this.options)),r);if(((t=this._$AH)==null?void 0:t._$AD)===i)this._$AH.p(s);else{const l=new No(i,this),a=l.u(this.options);l.p(s),this.T(a),this._$AH=l}}_$AC(e){let t=Io.get(e.strings);return t===void 0&&Io.set(e.strings,t=new Gs(e)),t}k(e){$o(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const i of e)r===t.length?t.push(s=new Js(this.S(ui()),this.S(ui()),this,this.options)):s=t[r],s._$AI(i),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Qs{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,i){this.type=1,this._$AH=Le,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Le}_$AI(e,t=this,s,r){const i=this.strings;let l=!1;if(i===void 0)e=Sn(this,e,t,0),l=!Ks(e)||e!==this._$AH&&e!==ts,l&&(this._$AH=e);else{const a=e;let o,u;for(e=i[0],o=0;o<i.length-1;o++)u=Sn(this,a[s+o],t,o),u===ts&&(u=this._$AH[o]),l||(l=!Ks(u)||u!==this._$AH[o]),u===Le?e=Le:e!==Le&&(e+=(u??"")+i[o+1]),this._$AH[o]=u}l&&!r&&this.j(e)}j(e){e===Le?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Po extends Qs{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Le?void 0:e}}class Ro extends Qs{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Le)}}class Do extends Qs{constructor(e,t,s,r,i){super(e,t,s,r,i),this.type=5}_$AI(e,t=this){if((e=Sn(this,e,t,0)??Le)===ts)return;const s=this._$AH,r=e===Le&&s!==Le||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==Le&&(s===Le||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class jo{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Sn(this,e)}}const fh={P:dl,A:Pt,C:hl,M:1,L:Oo,R:No,D:ko,V:Sn,I:Js,H:Qs,N:Ro,U:Do,B:Po,F:jo},Zo=ai.litHtmlPolyfillSupport;Zo==null||Zo(Gs,Js),(ai.litHtmlVersions??(ai.litHtmlVersions=[])).push("3.1.3");/**
|
|
189
189
|
* @license
|
|
190
190
|
* Copyright 2017 Google LLC
|
|
191
191
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
192
|
-
*/const
|
|
192
|
+
*/const mh={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},gh=n=>(...e)=>({_$litDirective$:n,values:e});let yh=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};/**
|
|
193
193
|
* @license
|
|
194
194
|
* Copyright 2020 Google LLC
|
|
195
195
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
196
|
-
*/const{I:
|
|
196
|
+
*/const{I:vh}=fh,Lo=()=>document.createComment(""),Xs=(n,e,t)=>{var s;const r=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const l=r.insertBefore(Lo(),i),a=r.insertBefore(Lo(),i);t=new vh(l,a,n,n.options)}else{const l=t._$AB.nextSibling,a=t._$AM,o=a!==n;if(o){let u;(s=t._$AQ)==null||s.call(t,n),t._$AM=n,t._$AP!==void 0&&(u=n._$AU)!==a._$AU&&t._$AP(u)}if(l!==i||o){let u=t._$AA;for(;u!==l;){const c=u.nextSibling;r.insertBefore(u,i),u=c}}}return t},Tn=(n,e,t=n)=>(n._$AI(e,t),n),bh={},_h=(n,e=bh)=>n._$AH=e,wh=n=>n._$AH,fl=n=>{var e;(e=n._$AP)==null||e.call(n,!1,!0);let t=n._$AA;const s=n._$AB.nextSibling;for(;t!==s;){const r=t.nextSibling;t.remove(),t=r}};/**
|
|
197
197
|
* @license
|
|
198
198
|
* Copyright 2017 Google LLC
|
|
199
199
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
200
|
-
*/const Po=(n,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},Ro=dh(class extends hh{constructor(n){if(super(n),n.type!==ch.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],s=[];let l=0;for(const a of n)r[l]=i?i(a,l):l,s[l]=t(a,l),l++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){const r=gh(n),{values:s,keys:l}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=l,s;const a=this.ut??(this.ut=[]),o=[];let u,c,p=0,d=r.length-1,g=0,$=s.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],s[g]),p++,g++;else if(a[d]===l[$])o[$]=Sn(r[d],s[$]),d--,$--;else if(a[p]===l[$])o[$]=Sn(r[p],s[$]),Xi(n,o[$+1],r[p]),p++,$--;else if(a[d]===l[g])o[g]=Sn(r[d],s[g]),Xi(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]),le=W!==void 0?r[W]:null;if(le===null){const Ne=Xi(n,r[p]);Sn(Ne,s[g]),o[g]=Ne}else o[g]=Sn(le,s[g]),Xi(n,r[p],le),r[W]=null;g++}else fl(r[d]),d--;else fl(r[p]),p++;for(;g<=$;){const W=Xi(n,o[$+1]);Sn(W,s[g]),o[g++]=W}for(;p<=d;){const W=r[p++];W!==null&&fl(W)}return this.ut=l,mh(n,o),ni}}),Nt=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}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.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-40{z-index:40}.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\\:px-0{padding-left:0;padding-right:0}.md\\:pb-0{padding-bottom:0}}`;var yh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,us=(n,e,t,i)=>{for(var r=i>1?void 0:i?vh(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&yh(e,t,r),r};let ii=class extends rt{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return de`
|
|
200
|
+
*/const zo=(n,e,t)=>{const s=new Map;for(let r=e;r<=t;r++)s.set(n[r],r);return s},ml=gh(class extends yh{constructor(n){if(super(n),n.type!==mh.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=wh(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]=Tn(r[p],i[g]),p++,g++;else if(a[d]===l[$])o[$]=Tn(r[d],i[$]),d--,$--;else if(a[p]===l[$])o[$]=Tn(r[p],i[$]),Xs(n,o[$+1],r[p]),p++,$--;else if(a[d]===l[g])o[g]=Tn(r[d],i[g]),Xs(n,r[p],r[d]),d--,g++;else if(u===void 0&&(u=zo(l,g,$),c=zo(a,p,d)),u.has(a[p]))if(u.has(a[d])){const W=c.get(l[g]),le=W!==void 0?r[W]:null;if(le===null){const ze=Xs(n,r[p]);Tn(ze,i[g]),o[g]=ze}else o[g]=Tn(le,i[g]),Xs(n,r[p],le),r[W]=null;g++}else fl(r[d]),d--;else fl(r[p]),p++;for(;g<=$;){const W=Xs(n,o[$+1]);Tn(W,i[g]),o[g++]=W}for(;p<=d;){const W=r[p++];W!==null&&fl(W)}return this.ut=l,_h(n,o),ts}}),St=Nt`*,: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}.invisible{visibility:hidden}.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-\\[-1px\\]{bottom:-1px}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-12{top:3rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.m-4{margin:1rem}.m-8{margin:2rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.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}.block{display:block}.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-dvh{height:100dvh}.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-dvw{width:100dvw}.max-w-\\[350px\\]{max-width:350px}.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-start{align-items:flex-start}.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}.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-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-2{padding-bottom:.5rem}.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);text-decoration:underline}.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\\:mx-8{margin-left:2rem;margin-right:2rem}.md\\:block{display:block}.md\\:h-\\[500px\\]{height:500px}.md\\:w-\\[350px\\]{width:350px}}`;var xh=Object.defineProperty,$h=Object.getOwnPropertyDescriptor,ci=(n,e,t,s)=>{for(var r=s>1?void 0:s?$h(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&&xh(e,t,r),r};let ns=class extends nt{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return oe`
|
|
201
201
|
<div>
|
|
202
202
|
<div
|
|
203
203
|
id="carousel"
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
</button>
|
|
224
224
|
|
|
225
225
|
<div class="flex justify-center space-x-2">
|
|
226
|
-
${
|
|
226
|
+
${ml(this.items,(n,e)=>e,(n,e)=>oe`
|
|
227
227
|
<span
|
|
228
228
|
class="h-2.5 w-2.5 bg-gray-400 rounded-full inline-block ${this.activeIndex===e?"bg-gray-600":""}"
|
|
229
229
|
@click=${()=>this.scrollToIndex(e)}
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
</button>
|
|
246
246
|
</div>
|
|
247
247
|
</div>
|
|
248
|
-
`}onSlotChange(n){const e=n.target;this.items=(e==null?void 0:e.assignedElements())||[]}onScroll(){const{carousel:n}=this;if(!n)return;let e=0,t=1/0;this.items.forEach((
|
|
248
|
+
`}onSlotChange(n){const e=n.target;this.items=(e==null?void 0:e.assignedElements())||[]}onScroll(){const{carousel:n}=this;if(!n)return;let e=0,t=1/0;this.items.forEach((s,r)=>{const i=Math.abs(s.offsetLeft-n.scrollLeft);i<t&&(t=i,e=r)}),this.activeIndex=e}scrollCarousel(n){this.scrollToIndex(this.activeIndex+n)}scrollToIndex(n){n!==this.activeIndex&&(this.activeIndex=Math.max(0,Math.min(n,this.items.length-1)),this.scrollToActiveItem())}scrollToActiveItem(){const{carousel:n,items:e,activeIndex:t}=this;if(!n)return;const s=e[t];s&&n.scrollTo({left:s.offsetLeft-n.clientWidth/2+s.clientWidth/2,behavior:"smooth"})}};ns.styles=[St,Nt`
|
|
249
249
|
::slotted(div) {
|
|
250
250
|
flex: 0 0 auto;
|
|
251
251
|
scroll-snap-align: start;
|
|
@@ -256,49 +256,15 @@
|
|
|
256
256
|
border-radius: 0.25rem;
|
|
257
257
|
margin-right: 1rem;
|
|
258
258
|
}
|
|
259
|
-
`],
|
|
259
|
+
`],ci([Se({type:Number})],ns.prototype,"activeIndex",2),ci([Se({type:Array})],ns.prototype,"items",2),ci([li("#carousel")],ns.prototype,"carousel",2),ns=ci([At("iai-chat-carousel")],ns);/**
|
|
260
260
|
* @license
|
|
261
261
|
* Copyright 2017 Google LLC
|
|
262
262
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
263
|
-
*/const
|
|
263
|
+
*/const gl={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},yl=n=>(...e)=>({_$litDirective$:n,values:e});let vl=class{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,e,t){this._$Ct=n,this._$AM=e,this._$Ci=t}_$AS(n,e){return this.update(n,e)}update(n,e){return this.render(...e)}};/**
|
|
264
264
|
* @license
|
|
265
265
|
* Copyright 2018 Google LLC
|
|
266
266
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
267
|
-
*/const
|
|
268
|
-
* @license
|
|
269
|
-
* Copyright 2018 Google LLC
|
|
270
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
|
-
*/const Ho="important",Th=" !"+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 i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}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 i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ft.add(i);const s=typeof r=="string"&&r.endsWith(Th);i.includes("-")||s?t.setProperty(i,s?r.slice(0,-11):r,s?Ho:""):t[i]=r}}return Yt}});var Ch=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 i(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 s(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);i(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 s.apply(void 0,[u,c].concat(d))}}return s.apply(void 0,[u,c].concat(a))}Object.defineProperty(n,"__esModule",{value:!0}),n.cancel=e,n.debounce=l})(_l);var he;(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 s={};for(const l of r)s[l]=l;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of s)l[a]=r[a];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&s.push(l);return s},n.find=(r,s)=>{for(const l of r)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(he||(he={}));var wl;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(wl||(wl={}));const O=he.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gt=n=>{switch(typeof n){case"undefined":return O.undefined;case"string":return O.string;case"number":return isNaN(n)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":return Array.isArray(n)?O.array:n===null?O.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?O.promise:typeof Map<"u"&&n instanceof Map?O.map:typeof Set<"u"&&n instanceof Set?O.set:typeof Date<"u"&&n instanceof Date?O.date:O.object;default:return O.unknown}},C=he.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"]),Eh=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class pt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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(s){return s.message},i={_errors:[]},r=s=>{for(const l of s.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)i._errors.push(t(l));else{let a=i,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),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,he.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];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))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}pt.create=n=>new pt(n);const nr=(n,e)=>{let t;switch(n.code){case C.invalid_type:n.received===O.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,he.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${he.joinValues(n.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${he.joinValues(n.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${he.joinValues(n.options)}, received '${n.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.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}"`:he.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case C.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 C.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 C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,he.assertNever(n)}return{message:t}};let Bo=nr;function Ih(n){Bo=n}function hs(){return Bo}const ps=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,s=[...t,...r.path||[]],l={...r,path:s};let a="";const o=i.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...r,path:s,message:r.message||a}},Oh=[];function N(n,e){const t=ps({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,hs(),nr].filter(i=>!!i)});n.common.issues.push(t)}class Ke{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return J;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t)i.push({key:await r.key,value:await r.value});return Ke.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:l}=r;if(s.status==="aborted"||l.status==="aborted")return J;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(i[s.value]=l.value)}return{status:e.value,value:i}}}const J=Object.freeze({status:"aborted"}),Vo=n=>({status:"dirty",value:n}),Qe=n=>({status:"valid",value:n}),xl=n=>n.status==="aborted",$l=n=>n.status==="dirty",ir=n=>n.status==="valid",fs=n=>typeof Promise<"u"&&n instanceof Promise;var B;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(B||(B={}));class At{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,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(ir(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 pt(n.common.issues);return this._error=t,this._error}}};function ee(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))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:(s,l)=>s.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:i??l.defaultError}:{message:t??l.defaultError},description:r}}class ie{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 Gt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Gt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ke,ctx:{common:e.parent.common,data:e.data,parsedType:Gt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(fs(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 i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gt(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Fo(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={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:Gt(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(fs(r)?r:Promise.resolve(r));return Fo(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const l=e(r),a=()=>s.addIssue({code:C.custom,...i(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((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new gt({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Rt.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mt.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return ar.create([this,e],this._def)}and(e){return or.create(this,e,this._def)}transform(e){return new gt({...ee(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new pr({...ee(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Ko({typeName:F.ZodBranded,type:this,...ee(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _s({...ee(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return fr.create(this,e)}readonly(){return xs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Mh=/^c[^\s-]{8,}$/i,Nh=/^[a-z][a-z0-9]*$/,Ph=/^[0-9A-HJKMNP-TV-Z]{26}$/,Rh=/^[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,Dh=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kl;const Zh=/^(((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}))$/,Lh=/^(([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 Hh(n,e){return!!((e==="v4"||!e)&&Zh.test(n)||(e==="v6"||!e)&&Lh.test(n))}class ft extends ie{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==O.string){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:O.string,received:r.parsedType}),J}const t=new Ke;let i;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),N(i,{code:C.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&&(i=this._getOrReturnCtx(e,i),N(i,{code:C.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind==="length"){const s=e.data.length>r.value,l=e.data.length<r.value;(s||l)&&(i=this._getOrReturnCtx(e,i),s?N(i,{code:C.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):l&&N(i,{code:C.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind==="email")Dh.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"email",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="emoji")kl||(kl=new RegExp(jh,"u")),kl.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"emoji",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="uuid")Rh.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"uuid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid")Mh.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"cuid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid2")Nh.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"cuid2",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="ulid")Ph.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"ulid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),N(i,{validation:"url",code:C.invalid_string,message:r.message}),t.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"regex",code:C.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)||(i=this._getOrReturnCtx(e,i),N(i,{code:C.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)||(i=this._getOrReturnCtx(e,i),N(i,{code:C.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),N(i,{code:C.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind==="datetime"?zh(r).test(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:C.invalid_string,validation:"datetime",message:r.message}),t.dirty()):r.kind==="ip"?Hh(e.data,r.version)||(i=this._getOrReturnCtx(e,i),N(i,{validation:"ip",code:C.invalid_string,message:r.message}),t.dirty()):he.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,i){return this.refinement(r=>e.test(r),{validation:t,code:C.invalid_string,...B.errToObj(i)})}_addCheck(e){return new ft({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.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,...B.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...B.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...B.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...B.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...B.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...B.errToObj(t)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new ft({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ft({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ft({...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}}ft.create=n=>{var e;return new ft({checks:[],typeName:F.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ee(n)})};function Uh(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,s=parseInt(n.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return s%l/Math.pow(10,r)}class Qt extends ie{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)!==O.number){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:O.number,received:r.parsedType}),J}let t;const i=new Ke;for(const r of this._def.checks)r.kind==="int"?he.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:C.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?Uh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:C.not_finite,message:r.message}),i.dirty()):he.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,B.toString(t))}gt(e,t){return this.setLimit("min",e,!1,B.toString(t))}lte(e,t){return this.setLimit("max",e,!0,B.toString(t))}lt(e,t){return this.setLimit("max",e,!1,B.toString(t))}setLimit(e,t,i,r){return new Qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:B.toString(r)}]})}_addCheck(e){return new Qt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.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"&&he.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Qt.create=n=>new Qt({checks:[],typeName:F.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...ee(n)});class Xt extends ie{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)!==O.bigint){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:O.bigint,received:r.parsedType}),J}let t;const i=new Ke;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),N(t,{code:C.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):he.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,B.toString(t))}gt(e,t){return this.setLimit("min",e,!1,B.toString(t))}lte(e,t){return this.setLimit("max",e,!0,B.toString(t))}lt(e,t){return this.setLimit("max",e,!1,B.toString(t))}setLimit(e,t,i,r){return new Xt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:B.toString(r)}]})}_addCheck(e){return new Xt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:B.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}}Xt.create=n=>{var e;return new Xt({checks:[],typeName:F.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ee(n)})};class rr extends ie{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==O.boolean){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.boolean,received:t.parsedType}),J}return Qe(e.data)}}rr.create=n=>new rr({typeName:F.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...ee(n)});class In extends ie{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==O.date){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:O.date,received:r.parsedType}),J}if(isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_date}),J}const t=new Ke;let i;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),N(i,{code:C.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),N(i,{code:C.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):he.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:B.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:B.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:F.ZodDate,...ee(n)});class ms extends ie{_parse(e){if(this._getType(e)!==O.symbol){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.symbol,received:t.parsedType}),J}return Qe(e.data)}}ms.create=n=>new ms({typeName:F.ZodSymbol,...ee(n)});class sr extends ie{_parse(e){if(this._getType(e)!==O.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.undefined,received:t.parsedType}),J}return Qe(e.data)}}sr.create=n=>new sr({typeName:F.ZodUndefined,...ee(n)});class lr extends ie{_parse(e){if(this._getType(e)!==O.null){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.null,received:t.parsedType}),J}return Qe(e.data)}}lr.create=n=>new lr({typeName:F.ZodNull,...ee(n)});class ri extends ie{constructor(){super(...arguments),this._any=!0}_parse(e){return Qe(e.data)}}ri.create=n=>new ri({typeName:F.ZodAny,...ee(n)});class On extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qe(e.data)}}On.create=n=>new On({typeName:F.ZodUnknown,...ee(n)});class Pt extends ie{_parse(e){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.never,received:t.parsedType}),J}}Pt.create=n=>new Pt({typeName:F.ZodNever,...ee(n)});class gs extends ie{_parse(e){if(this._getType(e)!==O.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.void,received:t.parsedType}),J}return Qe(e.data)}}gs.create=n=>new gs({typeName:F.ZodVoid,...ee(n)});class mt extends ie{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==O.array)return N(t,{code:C.invalid_type,expected:O.array,received:t.parsedType}),J;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&(N(t,{code:l?C.too_big:C.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}),i.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(N(t,{code:C.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(N(t,{code:C.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>r.type._parseAsync(new At(t,l,t.path,a)))).then(l=>Ke.mergeArray(i,l));const s=[...t.data].map((l,a)=>r.type._parseSync(new At(t,l,t.path,a)));return Ke.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new mt({...this._def,minLength:{value:e,message:B.toString(t)}})}max(e,t){return new mt({...this._def,maxLength:{value:e,message:B.toString(t)}})}length(e,t){return new mt({...this._def,exactLength:{value:e,message:B.toString(t)}})}nonempty(e){return this.min(1,e)}}mt.create=(n,e)=>new mt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...ee(e)});function si(n){if(n instanceof Se){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Rt.create(si(i))}return new Se({...n._def,shape:()=>e})}else return n instanceof mt?new mt({...n._def,type:si(n.element)}):n instanceof Rt?Rt.create(si(n.unwrap())):n instanceof Nn?Nn.create(si(n.unwrap())):n instanceof St?St.create(n.items.map(e=>si(e))):n}class Se extends ie{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=he.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==O.object){const o=this._getOrReturnCtx(e);return N(o,{code:C.invalid_type,expected:O.object,received:o.parsedType}),J}const{status:t,ctx:i}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Pt&&this._def.unknownKeys==="strip"))for(const o in i.data)s.includes(o)||l.push(o);const a=[];for(const o of s){const u=r[o],c=i.data[o];a.push({key:{status:"valid",value:o},value:u._parse(new At(i,c,i.path,o)),alwaysSet:o in i.data})}if(this._def.catchall instanceof Pt){const o=this._def.unknownKeys;if(o==="passthrough")for(const u of l)a.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(o==="strict")l.length>0&&(N(i,{code:C.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=i.data[u];a.push({key:{status:"valid",value:u},value:o._parse(new At(i,c,i.path,u)),alwaysSet:u in i.data})}}return i.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=>Ke.mergeObjectSync(t,o)):Ke.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new Se({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var r,s,l,a;const o=(l=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,i).message)!==null&&l!==void 0?l:i.defaultError;return t.code==="unrecognized_keys"?{message:(a=B.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Se({...this._def,unknownKeys:"strip"})}passthrough(){return new Se({...this._def,unknownKeys:"passthrough"})}extend(e){return new Se({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Se({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Se({...this._def,catchall:e})}pick(e){const t={};return he.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Se({...this._def,shape:()=>t})}omit(e){const t={};return he.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Se({...this._def,shape:()=>t})}deepPartial(){return si(this)}partial(e){const t={};return he.objectKeys(this.shape).forEach(i=>{const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new Se({...this._def,shape:()=>t})}required(e){const t={};return he.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let r=this.shape[i];for(;r instanceof Rt;)r=r._def.innerType;t[i]=r}}),new Se({...this._def,shape:()=>t})}keyof(){return Wo(he.objectKeys(this.shape))}}Se.create=(n,e)=>new Se({shape:()=>n,unknownKeys:"strip",catchall:Pt.create(),typeName:F.ZodObject,...ee(e)}),Se.strictCreate=(n,e)=>new Se({shape:()=>n,unknownKeys:"strict",catchall:Pt.create(),typeName:F.ZodObject,...ee(e)}),Se.lazycreate=(n,e)=>new Se({shape:n,unknownKeys:"strip",catchall:Pt.create(),typeName:F.ZodObject,...ee(e)});class ar extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new pt(a.ctx.common.issues));return N(t,{code:C.invalid_union,unionErrors:l}),J}if(t.common.async)return Promise.all(i.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let s;const l=[];for(const o of i){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"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new pt(o));return N(t,{code:C.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}}ar.create=(n,e)=>new ar({options:n,typeName:F.ZodUnion,...ee(e)});const ys=n=>n instanceof cr?ys(n.schema):n instanceof gt?ys(n.innerType()):n instanceof dr?[n.value]:n instanceof en?n.options:n instanceof hr?Object.keys(n.enum):n instanceof pr?ys(n._def.innerType):n instanceof sr?[void 0]:n instanceof lr?[null]:null;class vs extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.object)return N(t,{code:C.invalid_type,expected:O.object,received:t.parsedType}),J;const i=this.discriminator,r=t.data[i],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(N(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const r=new Map;for(const s of t){const l=ys(s.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,s)}}return new vs({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...ee(i)})}}function Al(n,e){const t=Gt(n),i=Gt(e);if(n===e)return{valid:!0,data:n};if(t===O.object&&i===O.object){const r=he.objectKeys(e),s=he.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of s){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===O.array&&i===O.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Al(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===O.date&&i===O.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class or extends ie{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=(s,l)=>{if(xl(s)||xl(l))return J;const a=Al(s.value,l.value);return a.valid?(($l(s)||$l(l))&&t.dirty(),{status:t.value,value:a.data}):(N(i,{code:C.invalid_intersection_types}),J)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,l])=>r(s,l)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}or.create=(n,e,t)=>new or({left:n,right:e,typeName:F.ZodIntersection,...ee(t)});class St extends ie{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.array)return N(i,{code:C.invalid_type,expected:O.array,received:i.parsedType}),J;if(i.data.length<this._def.items.length)return N(i,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&i.data.length>this._def.items.length&&(N(i,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...i.data].map((s,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new At(i,s,i.path,l)):null}).filter(s=>!!s);return i.common.async?Promise.all(r).then(s=>Ke.mergeArray(t,s)):Ke.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new St({...this._def,rest:e})}}St.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new St({items:n,typeName:F.ZodTuple,rest:null,...ee(e)})};class ur extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.object)return N(i,{code:C.invalid_type,expected:O.object,received:i.parsedType}),J;const r=[],s=this._def.keyType,l=this._def.valueType;for(const a in i.data)r.push({key:s._parse(new At(i,a,i.path,a)),value:l._parse(new At(i,i.data[a],i.path,a))});return i.common.async?Ke.mergeObjectAsync(t,r):Ke.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof ie?new ur({keyType:e,valueType:t,typeName:F.ZodRecord,...ee(i)}):new ur({keyType:ft.create(),valueType:e,typeName:F.ZodRecord,...ee(t)})}}class bs extends ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.map)return N(i,{code:C.invalid_type,expected:O.map,received:i.parsedType}),J;const r=this._def.keyType,s=this._def.valueType,l=[...i.data.entries()].map(([a,o],u)=>({key:r._parse(new At(i,a,i.path,[u,"key"])),value:s._parse(new At(i,o,i.path,[u,"value"]))}));if(i.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 J;(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 J;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}bs.create=(n,e,t)=>new bs({valueType:e,keyType:n,typeName:F.ZodMap,...ee(t)});class Mn extends ie{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.set)return N(i,{code:C.invalid_type,expected:O.set,received:i.parsedType}),J;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(N(i,{code:C.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(N(i,{code:C.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return J;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...i.data.values()].map((o,u)=>s._parse(new At(i,o,i.path,u)));return i.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new Mn({...this._def,minSize:{value:e,message:B.toString(t)}})}max(e,t){return new Mn({...this._def,maxSize:{value:e,message:B.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:F.ZodSet,...ee(e)});class li extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.function)return N(t,{code:C.invalid_type,expected:O.function,received:t.parsedType}),J;function i(a,o){return ps({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,hs(),nr].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:o}})}function r(a,o){return ps({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,hs(),nr].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof ai){const a=this;return Qe(async function(...o){const u=new pt([]),c=await a._def.args.parseAsync(o,s).catch(d=>{throw u.addIssue(i(o,d)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(d=>{throw u.addIssue(r(p,d)),u})})}else{const a=this;return Qe(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new pt([i(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);if(!p.success)throw new pt([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new li({...this._def,args:St.create(e).rest(On.create())})}returns(e){return new li({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new li({args:e||St.create([]).rest(On.create()),returns:t||On.create(),typeName:F.ZodFunction,...ee(i)})}}class cr extends ie{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})}}cr.create=(n,e)=>new cr({getter:n,typeName:F.ZodLazy,...ee(e)});class dr extends ie{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return N(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}}dr.create=(n,e)=>new dr({value:n,typeName:F.ZodLiteral,...ee(e)});function Wo(n,e){return new en({values:n,typeName:F.ZodEnum,...ee(e)})}class en extends ie{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return N(t,{expected:he.joinValues(i),received:t.parsedType,code:C.invalid_type}),J}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),i=this._def.values;return N(t,{received:t.data,code:C.invalid_enum_value,options:i}),J}return Qe(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 en.create(e)}exclude(e){return en.create(this.options.filter(t=>!e.includes(t)))}}en.create=Wo;class hr extends ie{_parse(e){const t=he.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==O.string&&i.parsedType!==O.number){const r=he.objectValues(t);return N(i,{expected:he.joinValues(r),received:i.parsedType,code:C.invalid_type}),J}if(t.indexOf(e.data)===-1){const r=he.objectValues(t);return N(i,{received:i.data,code:C.invalid_enum_value,options:r}),J}return Qe(e.data)}get enum(){return this._def.values}}hr.create=(n,e)=>new hr({values:n,typeName:F.ZodNativeEnum,...ee(e)});class ai extends ie{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.promise&&t.common.async===!1)return N(t,{code:C.invalid_type,expected:O.promise,received:t.parsedType}),J;const i=t.parsedType===O.promise?t.data:Promise.resolve(t.data);return Qe(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ai.create=(n,e)=>new ai({type:n,typeName:F.ZodPromise,...ee(e)});class gt extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:l=>{N(i,l),l.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const l=r.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:l,path:i.path,parent:i})}if(r.type==="refinement"){const l=a=>{const o=r.refinement(a,s);if(i.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(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?J:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ir(l))return l;const a=r.transform(l.value,s);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:i.data,path:i.path,parent:i}).then(l=>ir(l)?Promise.resolve(r.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);he.assertNever(r)}}gt.create=(n,e,t)=>new gt({schema:n,typeName:F.ZodEffects,effect:e,...ee(t)}),gt.createWithPreprocess=(n,e,t)=>new gt({schema:e,effect:{type:"preprocess",transform:n},typeName:F.ZodEffects,...ee(t)});class Rt extends ie{_parse(e){return this._getType(e)===O.undefined?Qe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Rt.create=(n,e)=>new Rt({innerType:n,typeName:F.ZodOptional,...ee(e)});class Nn extends ie{_parse(e){return this._getType(e)===O.null?Qe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(n,e)=>new Nn({innerType:n,typeName:F.ZodNullable,...ee(e)});class pr extends ie{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===O.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}pr.create=(n,e)=>new pr({innerType:n,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ee(e)});class _s extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return fs(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}_s.create=(n,e)=>new _s({innerType:n,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ee(e)});class ws extends ie{_parse(e){if(this._getType(e)!==O.nan){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:O.nan,received:t.parsedType}),J}return{status:"valid",value:e.data}}}ws.create=n=>new ws({typeName:F.ZodNaN,...ee(n)});const Bh=Symbol("zod_brand");class Ko extends ie{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class fr extends ie{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?J:r.status==="dirty"?(t.dirty(),Vo(r.value)):this._def.out._parseAsync({data:r.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?J:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new fr({in:e,out:t,typeName:F.ZodPipeline})}}class xs extends ie{_parse(e){const t=this._def.innerType._parse(e);return ir(t)&&(t.value=Object.freeze(t.value)),t}}xs.create=(n,e)=>new xs({innerType:n,typeName:F.ZodReadonly,...ee(e)});const qo=(n,e={},t)=>n?ri.create().superRefine((i,r)=>{var s,l;if(!n(i)){const a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...u,fatal:o})}}):ri.create(),Vh={object:Se.lazycreate};var F;(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"})(F||(F={}));const Fh=(n,e={message:`Input not instance of ${n.name}`})=>qo(t=>t instanceof n,e),Yo=ft.create,Jo=Qt.create,Wh=ws.create,Kh=Xt.create,Go=rr.create,qh=In.create,Yh=ms.create,Jh=sr.create,Gh=lr.create,Qh=ri.create,Xh=On.create,ep=Pt.create,tp=gs.create,np=mt.create,ip=Se.create,rp=Se.strictCreate,sp=ar.create,lp=vs.create,ap=or.create,op=St.create,up=ur.create,cp=bs.create,dp=Mn.create,hp=li.create,pp=cr.create,fp=dr.create,mp=en.create,gp=hr.create,yp=ai.create,Qo=gt.create,vp=Rt.create,bp=Nn.create,_p=gt.createWithPreprocess,wp=fr.create;var P=Object.freeze({__proto__:null,defaultErrorMap:nr,setErrorMap:Ih,getErrorMap:hs,makeIssue:ps,EMPTY_PATH:Oh,addIssueToContext:N,ParseStatus:Ke,INVALID:J,DIRTY:Vo,OK:Qe,isAborted:xl,isDirty:$l,isValid:ir,isAsync:fs,get util(){return he},get objectUtil(){return wl},ZodParsedType:O,getParsedType:Gt,ZodType:ie,ZodString:ft,ZodNumber:Qt,ZodBigInt:Xt,ZodBoolean:rr,ZodDate:In,ZodSymbol:ms,ZodUndefined:sr,ZodNull:lr,ZodAny:ri,ZodUnknown:On,ZodNever:Pt,ZodVoid:gs,ZodArray:mt,ZodObject:Se,ZodUnion:ar,ZodDiscriminatedUnion:vs,ZodIntersection:or,ZodTuple:St,ZodRecord:ur,ZodMap:bs,ZodSet:Mn,ZodFunction:li,ZodLazy:cr,ZodLiteral:dr,ZodEnum:en,ZodNativeEnum:hr,ZodPromise:ai,ZodEffects:gt,ZodTransformer:gt,ZodOptional:Rt,ZodNullable:Nn,ZodDefault:pr,ZodCatch:_s,ZodNaN:ws,BRAND:Bh,ZodBranded:Ko,ZodPipeline:fr,ZodReadonly:xs,custom:qo,Schema:ie,ZodSchema:ie,late:Vh,get ZodFirstPartyTypeKind(){return F},coerce:{string:n=>ft.create({...n,coerce:!0}),number:n=>Qt.create({...n,coerce:!0}),boolean:n=>rr.create({...n,coerce:!0}),bigint:n=>Xt.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:Qh,array:np,bigint:Kh,boolean:Go,date:qh,discriminatedUnion:lp,effect:Qo,enum:mp,function:hp,instanceof:Fh,intersection:ap,lazy:pp,literal:fp,map:cp,nan:Wh,nativeEnum:gp,never:ep,null:Gh,nullable:bp,number:Jo,object:ip,oboolean:()=>Go().optional(),onumber:()=>Jo().optional(),optional:vp,ostring:()=>Yo().optional(),pipeline:wp,preprocess:_p,promise:yp,record:up,set:dp,strictObject:rp,string:Yo,symbol:Yh,transformer:Qo,tuple:op,undefined:Jh,union:sp,unknown:Xh,void:tp,NEVER:J,ZodIssueCode:C,quotelessJson:Eh,ZodError:pt});const $s=P.object({assistantId:P.string(),params:P.record(P.any()).default({}),config:P.object({historyKey:P.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:P.string().default("Hello! How can I help you today?"),inactivityWarningMessage:P.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:P.string().default("The chat has ended. Please restart the chat to continue."),resetEndedChatOnLoad:P.boolean().default(!1),initialReplyMessage:P.string().nullable().default(null),disclaimerMessage:P.string().nullable().default(null),disclaimerPopover:P.object({message:P.string().nullable().default(null),agreeButtonText:P.string().default("I Agree"),rememberDurationMinutes:P.number().default(60*24*3)}).default({}),placement:P.enum(["left","right"]).default("right"),openChatButton:P.object({imageSrc:P.string().nullable().default(null),width:P.union([P.string(),P.number()]).default("48px"),height:P.union([P.string(),P.number()]).default("48px"),cta:P.string().nullable().default(null)}).default({}),chatWindow:P.object({header:P.object({text:P.string().nullable().default("AI Chat"),imageSrc:P.string().nullable().default(null)}).default({}),showCloseButton:P.boolean().default(!0)}).default({}),styles:P.object({primaryColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null),linkColor:P.string().nullable().default(null),openChatButton:P.object({backgroundColor:P.string().nullable().default(null),iconColor:P.string().nullable().default(null)}).default({}),header:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),button:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),messages:P.object({user:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),assistant:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:P.object({functionCalls:P.record(P.function().returns(P.union([P.any(),P.promise(P.any())]))).default({}),enhancedContent:P.record(P.function().returns(P.union([P.any(),P.promise(P.any())]))).default({})}).default({})});var xp=Object.defineProperty,$p=Object.getOwnPropertyDescriptor,mr=(n,e,t,i)=>{for(var r=i>1?void 0:i?$p(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&xp(e,t,r),r};let Pn=class extends rt{constructor(){super(...arguments),this.isOpen=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?(Sh(this,{allowTouchMove:n=>n.nodeName==="IAI-CHAT-POPUP"}),this.isIosDevice||(document.documentElement.style.overflow="hidden")):(Lo(this),this.isIosDevice||(document.documentElement.style.overflow=this.initialHtmlOverflow))}}connectedCallback(){super.connectedCallback(),this.cleanOptions=$s.parse(this.options),this.identifyIosDevice(),this.setInitialHtmlOverflow(),this.initialScrollPosition={x:0,y:0},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,"z-40":!0,"pointer-events-none":!this.isOpen,"pointer-events-auto":this.isOpen}),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,"pointer-events-auto":!0});return de`
|
|
272
|
-
<div
|
|
273
|
-
class=${e}
|
|
274
|
-
style=${En({colorScheme:"normal"})}
|
|
275
|
-
>
|
|
276
|
-
<div
|
|
277
|
-
class="w-full h-full md:w-[350px] md:h-[500px]"
|
|
278
|
-
style=${En({visibility:this.isOpen?"visible":"hidden"})}
|
|
279
|
-
>
|
|
280
|
-
<iai-chat
|
|
281
|
-
.options=${this.options}
|
|
282
|
-
@iai-chat-close=${this.toggleChat}
|
|
283
|
-
/>
|
|
284
|
-
</div>
|
|
285
|
-
|
|
286
|
-
<div
|
|
287
|
-
class=${t}
|
|
288
|
-
style=${En({justifyContent:n?"flex-end":"flex-start"})}
|
|
289
|
-
>
|
|
290
|
-
<iai-chat-open-chat-button
|
|
291
|
-
.options=${this.cleanOptions}
|
|
292
|
-
.isChatWindowOpen=${this.isOpen}
|
|
293
|
-
@toggle-chat=${this.toggleChat}
|
|
294
|
-
/>
|
|
295
|
-
</div>
|
|
296
|
-
</div>
|
|
297
|
-
`}toggleChat(){this.isOpen=!this.isOpen;const n=this.isIosDevice&&window.innerWidth<768;n&&this.isOpen&&(this.initialScrollPosition={x:window.scrollX,y:window.scrollY}),this.onResizeHandler(),n&&!this.isOpen&&setTimeout(()=>{window.scrollTo(this.initialScrollPosition.x,this.initialScrollPosition.y)},500)}identifyIosDevice(){const{platform:n="",maxTouchPoints:e=0}=window.navigator||{};this.isIosDevice=typeof window<"u"&&!!window.navigator&&!!n&&(/iP(ad|hone|od)/.test(n)||n==="MacIntel"&&e>1)}setInitialHtmlOverflow(){var n;const{overflow:e="auto"}=((n=document.documentElement)==null?void 0:n.style)||{};this.initialHtmlOverflow=e}};Pn.styles=[Nt],mr([Ce({type:Object})],Pn.prototype,"options",2),mr([wn()],Pn.prototype,"isOpen",2),mr([ss("iai-chat")],Pn.prototype,"chatWindow",2),mr([_l.debounce(250)],Pn.prototype,"onResizeHandler",2),Pn=mr([Ot("iai-chat-popup")],Pn);const gr="https://api.ai.inhabit.services";async function kp(n,e={}){const t=await fetch(`${gr}/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 Ap(n,e="No reason provided"){const t=await fetch(`${gr}/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 Sp(n,e){const t=await fetch(`${gr}/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 Tp(n,e,t,i=!1){const r=await fetch(`${gr}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:i})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}async function Cp(n){const e=await fetch(`${gr}/threads/${n}/ping`,{method:"POST"});if(!e.ok)throw new Error(`Failed to ping thread: ${e.statusText} (${e.status})`)}function Ep(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(r){r(t)}),(i=n.get("*"))&&i.slice().map(function(r){r(e,t)})}}}class Ip{constructor(e,t={}){if(this._assistantId="",this._recurringKeepAliveInterval=null,this._recurringKeepAliveCallers=new Set,this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this._resetCounter=0,this.onStorageEvent=i=>{var r;const[s,l,a]=((r=i.key)==null?void 0:r.split("-"))||[];if(!(s!=="iaiChat"||l!==this.options.historyKey))switch(a){case"messageHistory":this.onMessageHistoryStorageEvent(i);break;case"conversation":this.setConversationDetails(JSON.parse(i.newValue||"null"),!0);break;case"lastActivity":this.keepAlive(JSON.parse(i.newValue||"null"),!0);break;case"chatEndingWarningSent":this.setChatEndingWarningSent(JSON.parse(i.newValue||"false"),!0);break;case"chatEnded":this.setChatEnded(JSON.parse(i.newValue||"false"),!0);break;case"typing":this.setTyping(JSON.parse(i.newValue||"false"),!0);break;case"inputDisabled":this.setInputDisabled(JSON.parse(i.newValue||"false"),!0);break}},this._assistantId=e,this.options={params:{},resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=Ep(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),t.events&&Object.entries(t.events).forEach(([i,r])=>{this._emitter.on(i,r)}),t.historyKey){this._messages=this.storageGet("messageHistory",[]);const i=this.storageGet("conversation");i&&this.setConversationDetails(i,!0);const r=this.storageGet("chatEndingWarningSent");r&&this.setChatEndingWarningSent(r,!0);const s=this.storageGet("chatEnded");s&&this.setChatEnded(s,!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),i=this._messages.map(s=>s.id),r=t.map(s=>s.id);this._messages.forEach(s=>{r.includes(s.id)||this._emitter.emit("messageRemoved",s.id)}),t.forEach(s=>{i.includes(s.id)||this._emitter.emit("message",s)}),this._messages=t}async endChat(e,t=!0){!this.threadId||this.chatEnded||(t&&(this._emitter.emit("chatEnded"),this.setChatEnded(!0)),this.stopInactivityTimers(),await Ap(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._recurringKeepAliveCallers.forEach(t=>t()),this.stopInactivityTimers(),this.storageRemoveAll(),this._emitter.emit("reset"),this._resetCounter+=1}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:i,timeUntilWarnAboutChatEnding:r}=this;if(!i)return;t||this.storageSet("lastActivity",e);const s=Date.now()-e;s>i?(this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)):s>r?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},i-s)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),r-s),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||this._emitter.emit("chatEnded"),this.setChatEnded(!0)},i-s))}registerRecurringKeepAlive(){if(!this.chatStarted)throw new Error("Chat not started");const e=()=>{this._recurringKeepAliveCallers.delete(e),this._recurringKeepAliveCallers.size===0&&this._recurringKeepAliveInterval&&(clearInterval(this._recurringKeepAliveInterval),this._recurringKeepAliveInterval=null)};return this._recurringKeepAliveCallers.add(e),this._recurringKeepAliveInterval||(this._recurringKeepAliveInterval=setInterval(()=>{this.chatStarted&&(this.keepAlive(),Cp(this.threadId).then(()=>{}))},3e4)),e}async startChat(){if(this.chatStarted)return;const e=this.getResetChecker(),{id:t,inactivityWaitTime:i,inactivityWarningTime:r}=await kp(this.assistantId,this.params);if(!t)throw new Error("Could not start chat");if(e.resetOccurred)throw new Error("Chat was reset");this.setConversationDetails({threadId:t,inactivityWaitTime:i,inactivityWarningTime:r})}handleSendUserMessageResponse({messages:e,functions:t}){this.addMessages(e),t.forEach(i=>this._emitter.emit("functionCall",i))}addMessages(e){e.forEach(t=>this.addMessage(t))}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,i){if(!this.threadId)throw new Error("Thread not started");try{const r=this.getResetChecker();this.setTyping(!0),this.keepAlive();const s=await Tp(this.threadId,e,t,i);if(r.resetOccurred)return;this.handleSendUserMessageResponse(s)}catch(r){this.sendErrorMessage(),console.error("Error sending message:",r)}finally{this.setTyping(!1)}}async sendUserMessage(e){try{const t=this.getResetChecker();if(this.addMessage({role:"user",content:e}),this.setTyping(!0),!this.chatStarted){const{initialReplyMessage:r}=this.options;r&&this.addMessage({role:"assistant",content:r});try{await this.startChat()}catch(s){if(s.message==="Chat was reset")return;this.sendErrorMessage(),console.error("Error starting chat",s)}}this.keepAlive();const i=await Sp(this.threadId,e);if(t.resetOccurred)return;this.handleSendUserMessageResponse(i)}catch(t){this.sendErrorMessage(),console.error("Error sending message:",t)}finally{this.setTyping(!1)}}sendErrorMessage(){this.addMessage({role:"assistant",content:"There was an unexpected error. Please try again later."})}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))}getResetChecker(){const e=this._resetCounter,t=this;return{get resetOccurred(){return e!==t._resetCounter}}}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 i=localStorage.getItem(`iaiChat-${this.options.historyKey}-${e}`);return i?JSON.parse(i):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,i){n.exports=i()})(Ch,function(){var t=1e3,i=6e4,r=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",$="date",W="Invalid Date",le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Ne=/\[([^\]]+)]|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,qe={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(k){var b=["th","st","nd","rd"],y=k%100;return"["+k+(b[(y-20)%10]||b[y]||b[0])+"]"}},oe=function(k,b,y){var w=String(k);return!w||w.length>=b?k:""+Array(b+1-w.length).join(y)+k},Ye={s:oe,z:function(k){var b=-k.utcOffset(),y=Math.abs(b),w=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+oe(w,2,"0")+":"+oe(v,2,"0")},m:function k(b,y){if(b.date()<y.date())return-k(y,b);var w=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(w,p),T=y-v<0,x=b.clone().add(w+(T?-1:1),p);return+(-(w+(y-v)/(T?v-x:x-v))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:p,y:g,w:c,d:u,D:$,h:o,m:a,s:l,ms:s,Q:d}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},Te="en",U={};U[Te]=qe;var nt="$isDayjsObject",we=function(k){return k instanceof He||!(!k||!k[nt])},Je=function k(b,y,w){var v;if(!b)return Te;if(typeof b=="string"){var T=b.toLowerCase();U[T]&&(v=T),y&&(U[T]=y,v=T);var x=b.split("-");if(!v&&x.length>1)return k(x[0])}else{var Z=b.name;U[Z]=b,v=Z}return!w&&v&&(Te=v),v||!w&&Te},G=function(k,b){if(we(k))return k.clone();var y=typeof b=="object"?b:{};return y.date=k,y.args=arguments,new He(y)},R=Ye;R.l=Je,R.i=we,R.w=function(k,b){return G(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var He=function(){function k(y){this.$L=Je(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[nt]=!0}var b=k.prototype;return b.parse=function(y){this.$d=function(w){var v=w.date,T=w.utc;if(v===null)return new Date(NaN);if(R.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var x=v.match(le);if(x){var Z=x[2]-1||0,q=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,q)):new Date(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,q)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return R},b.isValid=function(){return this.$d.toString()!==W},b.isSame=function(y,w){var v=G(y);return this.startOf(w)<=v&&v<=this.endOf(w)},b.isAfter=function(y,w){return G(y)<this.startOf(w)},b.isBefore=function(y,w){return this.endOf(w)<G(y)},b.$g=function(y,w,v){return R.u(y)?this[w]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,w){var v=this,T=!!R.u(w)||w,x=R.p(y),Z=function(Pe,ce){var Ee=R.w(v.$u?Date.UTC(v.$y,ce,Pe):new Date(v.$y,ce,Pe),v);return T?Ee:Ee.endOf(u)},q=function(Pe,ce){return R.w(v.toDate()[Pe].apply(v.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ce)),v)},Q=this.$W,re=this.$M,pe=this.$D,Be="set"+(this.$u?"UTC":"");switch(x){case g:return T?Z(1,0):Z(31,11);case p:return T?Z(1,re):Z(0,re+1);case c:var Re=this.$locale().weekStart||0,Xe=(Q<Re?Q+7:Q)-Re;return Z(T?pe-Xe:pe+(6-Xe),re);case u:case $:return q(Be+"Hours",0);case o:return q(Be+"Minutes",1);case a:return q(Be+"Seconds",2);case l:return q(Be+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,w){var v,T=R.p(y),x="set"+(this.$u?"UTC":""),Z=(v={},v[u]=x+"Date",v[$]=x+"Date",v[p]=x+"Month",v[g]=x+"FullYear",v[o]=x+"Hours",v[a]=x+"Minutes",v[l]=x+"Seconds",v[s]=x+"Milliseconds",v)[T],q=T===u?this.$D+(w-this.$W):w;if(T===p||T===g){var Q=this.clone().set($,1);Q.$d[Z](q),Q.init(),this.$d=Q.set($,Math.min(this.$D,Q.daysInMonth())).$d}else Z&&this.$d[Z](q);return this.init(),this},b.set=function(y,w){return this.clone().$set(y,w)},b.get=function(y){return this[R.p(y)]()},b.add=function(y,w){var v,T=this;y=Number(y);var x=R.p(w),Z=function(re){var pe=G(T);return R.w(pe.date(pe.date()+Math.round(re*y)),T)};if(x===p)return this.set(p,this.$M+y);if(x===g)return this.set(g,this.$y+y);if(x===u)return Z(1);if(x===c)return Z(7);var q=(v={},v[a]=i,v[o]=r,v[l]=t,v)[x]||1,Q=this.$d.getTime()+y*q;return R.w(Q,this)},b.subtract=function(y,w){return this.add(-1*y,w)},b.format=function(y){var w=this,v=this.$locale();if(!this.isValid())return v.invalidDate||W;var T=y||"YYYY-MM-DDTHH:mm:ssZ",x=R.z(this),Z=this.$H,q=this.$m,Q=this.$M,re=v.weekdays,pe=v.months,Be=v.meridiem,Re=function(ce,Ee,Ve,at){return ce&&(ce[Ee]||ce(w,T))||Ve[Ee].slice(0,at)},Xe=function(ce){return R.s(Z%12||12,ce,"0")},Pe=Be||function(ce,Ee,Ve){var at=ce<12?"AM":"PM";return Ve?at.toLowerCase():at};return T.replace(Ne,function(ce,Ee){return Ee||function(Ve){switch(Ve){case"YY":return String(w.$y).slice(-2);case"YYYY":return R.s(w.$y,4,"0");case"M":return Q+1;case"MM":return R.s(Q+1,2,"0");case"MMM":return Re(v.monthsShort,Q,pe,3);case"MMMM":return Re(pe,Q);case"D":return w.$D;case"DD":return R.s(w.$D,2,"0");case"d":return String(w.$W);case"dd":return Re(v.weekdaysMin,w.$W,re,2);case"ddd":return Re(v.weekdaysShort,w.$W,re,3);case"dddd":return re[w.$W];case"H":return String(Z);case"HH":return R.s(Z,2,"0");case"h":return Xe(1);case"hh":return Xe(2);case"a":return Pe(Z,q,!0);case"A":return Pe(Z,q,!1);case"m":return String(q);case"mm":return R.s(q,2,"0");case"s":return String(w.$s);case"ss":return R.s(w.$s,2,"0");case"SSS":return R.s(w.$ms,3,"0");case"Z":return x}return null}(ce)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,w,v){var T,x=this,Z=R.p(w),q=G(y),Q=(q.utcOffset()-this.utcOffset())*i,re=this-q,pe=function(){return R.m(x,q)};switch(Z){case g:T=pe()/12;break;case p:T=pe();break;case d:T=pe()/3;break;case c:T=(re-Q)/6048e5;break;case u:T=(re-Q)/864e5;break;case o:T=re/r;break;case a:T=re/i;break;case l:T=re/t;break;default:T=re}return v?T:R.a(T)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,w){if(!y)return this.$L;var v=this.clone(),T=Je(y,w,!0);return T&&(v.$L=T),v},b.clone=function(){return R.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),lt=He.prototype;return G.prototype=lt,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",$]].forEach(function(k){lt[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),G.extend=function(k,b){return k.$i||(k(b,He,G),k.$i=!0),G},G.locale=Je,G.isDayjs=we,G.unix=function(k){return G(1e3*k)},G.en=U[Te],G.Ls=U,G.p={},G})})(Xo);var Op=Xo.exports;const eu=Uo(Op);/**
|
|
298
|
-
* @license
|
|
299
|
-
* Copyright 2021 Google LLC
|
|
300
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
301
|
-
*/function Dt(n,e,t){return n?e(n):t==null?void 0:t(n)}function Mp(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(r){r(t)}),(i=n.get("*"))&&i.slice().map(function(r){r(e,t)})}}}const yr=de`
|
|
267
|
+
*/const Ho="important",kh=" !"+Ho,er=yl(class extends vl{constructor(n){var e;if(super(n),n.type!==gl.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(kh);s.includes("-")||i?t.setProperty(s,i?r.slice(0,-11):r,i?Ho:""):t[s]=r}}return Yt}}),bl=oe`
|
|
302
268
|
<svg
|
|
303
269
|
xmlns="http://www.w3.org/2000/svg"
|
|
304
270
|
viewBox="0 0 24 24"
|
|
@@ -310,7 +276,7 @@
|
|
|
310
276
|
<path
|
|
311
277
|
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/>
|
|
312
278
|
</svg>
|
|
313
|
-
`,
|
|
279
|
+
`,Ah=oe`
|
|
314
280
|
<svg
|
|
315
281
|
xmlns="http://www.w3.org/2000/svg"
|
|
316
282
|
viewBox="0 0 24 24"
|
|
@@ -322,7 +288,7 @@
|
|
|
322
288
|
<path
|
|
323
289
|
d="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z"/>
|
|
324
290
|
</svg>
|
|
325
|
-
`,
|
|
291
|
+
`,Sh=oe`
|
|
326
292
|
<svg
|
|
327
293
|
xmlns="http://www.w3.org/2000/svg"
|
|
328
294
|
viewBox="0 0 24 24"
|
|
@@ -333,7 +299,7 @@
|
|
|
333
299
|
<title>send</title>
|
|
334
300
|
<path d="M2,21L23,12L2,3V10L17,12L2,14V21Z"/>
|
|
335
301
|
</svg>
|
|
336
|
-
`,
|
|
302
|
+
`,Th=oe`
|
|
337
303
|
<svg
|
|
338
304
|
xmlns="http://www.w3.org/2000/svg"
|
|
339
305
|
viewBox="0 0 24 24"
|
|
@@ -344,45 +310,124 @@
|
|
|
344
310
|
<title>refresh</title>
|
|
345
311
|
<path d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z" />
|
|
346
312
|
</svg>
|
|
347
|
-
|
|
313
|
+
`,Ch=oe`
|
|
314
|
+
<svg
|
|
315
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
316
|
+
viewBox="0 0 24 24"
|
|
317
|
+
width="100%"
|
|
318
|
+
height="100%"
|
|
319
|
+
fill="currentColor"
|
|
320
|
+
>
|
|
321
|
+
<title>minus</title>
|
|
322
|
+
<path d="M19,13H5V11H19V13Z" />
|
|
323
|
+
</svg>
|
|
324
|
+
`;var Eh=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,_l=(n,e,t,s)=>{for(var r=s>1?void 0:s?Ih(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&&Eh(e,t,r),r};let tr=class extends nt{constructor(){super(...arguments),this.message="",this.pointerPosition="right"}render(){return oe`
|
|
325
|
+
<div class="relative rounded-lg p-5 shadow-md bg-white text-black max-w-[350px]">
|
|
326
|
+
<button
|
|
327
|
+
class="absolute top-0 right-0 w-5 h-5 m-0.5"
|
|
328
|
+
@click="${this.hide}"
|
|
329
|
+
>${bl}</button>
|
|
330
|
+
|
|
331
|
+
<span>${this.message}</span>
|
|
332
|
+
|
|
333
|
+
<div
|
|
334
|
+
class="absolute bottom-0 mx-4 mb-[-8px] w-0 h-0 border-x-8 border-t-8 border-x-transparent border-white"
|
|
335
|
+
style=${er({[this.pointerPosition]:0})}
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
`}hide(){this.dispatchEvent(new CustomEvent("hide"))}};tr.styles=[St,Nt`
|
|
339
|
+
:host {
|
|
340
|
+
display: inline-block;
|
|
341
|
+
}
|
|
342
|
+
`],_l([Se({type:String})],tr.prototype,"message",2),_l([Se({type:String})],tr.prototype,"pointerPosition",2),tr=_l([At("iai-chat-cta-bubble")],tr);function Mh(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e<n.length;e++)t[e]=n[e];return t}else return Array.from(n)}var wl=!1;if(typeof window<"u"){var Uo={get passive(){wl=!0}};window.addEventListener("testPassive",null,Uo),window.removeEventListener("testPassive",null,Uo)}var di=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Cn=[],hi=!1,Vo=-1,nr=void 0,En=void 0,sr=void 0,Bo=function(n){return Cn.some(function(e){return!!(e.options.allowTouchMove&&e.options.allowTouchMove(n))})},xl=function(n){var e=n||window.event;return Bo(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},Oh=function(n){if(sr===void 0){var e=!!n&&n.reserveScrollBarGap===!0,t=window.innerWidth-document.documentElement.clientWidth;if(e&&t>0){var s=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);sr=document.body.style.paddingRight,document.body.style.paddingRight=s+t+"px"}}nr===void 0&&(nr=document.body.style.overflow,document.body.style.overflow="hidden")},Nh=function(){sr!==void 0&&(document.body.style.paddingRight=sr,sr=void 0),nr!==void 0&&(document.body.style.overflow=nr,nr=void 0)},Ph=function(){return window.requestAnimationFrame(function(){if(En===void 0){En={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var n=window,e=n.scrollY,t=n.scrollX,s=n.innerHeight;document.body.style.position="fixed",document.body.style.top=-e,document.body.style.left=-t,setTimeout(function(){return window.requestAnimationFrame(function(){var r=s-window.innerHeight;r&&e>=s&&(document.body.style.top=-(e+r))})},300)}})},Rh=function(){if(En!==void 0){var n=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=En.position,document.body.style.top=En.top,document.body.style.left=En.left,window.scrollTo(e,n),En=void 0}},Dh=function(n){return n?n.scrollHeight-n.scrollTop<=n.clientHeight:!1},jh=function(n,e){var t=n.targetTouches[0].clientY-Vo;return Bo(n.target)?!1:e&&e.scrollTop===0&&t>0||Dh(e)&&t<0?xl(n):(n.stopPropagation(),!0)},Zh=function(n,e){if(!n){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Cn.some(function(s){return s.targetElement===n})){var t={targetElement:n,options:e||{}};Cn=[].concat(Mh(Cn),[t]),di?Ph():Oh(e),di&&(n.ontouchstart=function(s){s.targetTouches.length===1&&(Vo=s.targetTouches[0].clientY)},n.ontouchmove=function(s){s.targetTouches.length===1&&jh(s,n)},hi||(document.addEventListener("touchmove",xl,wl?{passive:!1}:void 0),hi=!0))}},Fo=function(n){if(!n){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Cn=Cn.filter(function(e){return e.targetElement!==n}),di&&(n.ontouchstart=null,n.ontouchmove=null,hi&&Cn.length===0&&(document.removeEventListener("touchmove",xl,wl?{passive:!1}:void 0),hi=!1)),di?Rh():Nh()};/**
|
|
343
|
+
* @license
|
|
344
|
+
* Copyright 2018 Google LLC
|
|
345
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
346
|
+
*/const $l=yl(class extends vl{constructor(n){var e;if(super(n),n.type!==gl.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var t,s;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(const i in e)e[i]&&!((t=this.nt)!=null&&t.has(i))&&this.st.add(i);return this.render(e)}const r=n.element.classList;for(const i of this.st)i in e||(r.remove(i),this.st.delete(i));for(const i in e){const l=!!e[i];l===this.st.has(i)||(s=this.nt)!=null&&s.has(i)||(l?(r.add(i),this.st.add(i)):(r.remove(i),this.st.delete(i)))}return Yt}});/**
|
|
347
|
+
* @license
|
|
348
|
+
* Copyright 2021 Google LLC
|
|
349
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
350
|
+
*/function Qt(n,e,t){return n?e(n):t==null?void 0:t(n)}var Lh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kl={};(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})(kl);var he;(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})(he||(he={}));var Al;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Al||(Al={}));const M=he.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xt=n=>{switch(typeof n){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(n)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(n)?M.array:n===null?M.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?M.promise:typeof Map<"u"&&n instanceof Map?M.map:typeof Set<"u"&&n instanceof Set?M.set:typeof Date<"u"&&n instanceof Date?M.date:M.object;default:return M.unknown}},C=he.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"]),zh=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class pt 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,he.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()}}pt.create=n=>new pt(n);const rr=(n,e)=>{let t;switch(n.code){case C.invalid_type:n.received===M.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,he.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${he.joinValues(n.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${he.joinValues(n.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${he.joinValues(n.options)}, received '${n.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.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}"`:he.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case C.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 C.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 C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,he.assertNever(n)}return{message:t}};let qo=rr;function Hh(n){qo=n}function pi(){return qo}const fi=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}},Uh=[];function N(n,e){const t=fi({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,pi(),rr].filter(s=>!!s)});n.common.issues.push(t)}class qe{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 G;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 qe.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 G;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 G=Object.freeze({status:"aborted"}),Ko=n=>({status:"dirty",value:n}),Qe=n=>({status:"valid",value:n}),Sl=n=>n.status==="aborted",Tl=n=>n.status==="dirty",ir=n=>n.status==="valid",mi=n=>typeof Promise<"u"&&n instanceof Promise;var V;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(V||(V={}));class Tt{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 Yo=(n,e)=>{if(ir(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 pt(n.common.issues);return this._error=t,this._error}}};function ee(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 se{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 Xt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qe,ctx:{common:e.parent.common,data:e.data,parsedType:Xt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(mi(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:Xt(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Yo(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:Xt(e)},r=this._parse({data:e,path:s.path,parent:s}),i=await(mi(r)?r:Promise.resolve(r));return Yo(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:C.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 gt({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dt.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mt.create(this,this._def)}promise(){return ls.create(this,this._def)}or(e){return ur.create([this,e],this._def)}and(e){return cr.create(this,e,this._def)}transform(e){return new gt({...ee(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new mr({...ee(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Jo({typeName:F.ZodBranded,type:this,...ee(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new wi({...ee(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return gr.create(this,e)}readonly(){return $i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vh=/^c[^\s-]{8,}$/i,Bh=/^[a-z][a-z0-9]*$/,Fh=/^[0-9A-HJKMNP-TV-Z]{26}$/,Wh=/^[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,qh=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cl;const Yh=/^(((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}))$/,Gh=/^(([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})))$/,Jh=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 Qh(n,e){return!!((e==="v4"||!e)&&Yh.test(n)||(e==="v6"||!e)&&Gh.test(n))}class ft extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:M.string,received:r.parsedType}),G}const t=new qe;let s;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),N(s,{code:C.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),N(s,{code:C.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?N(s,{code:C.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):l&&N(s,{code:C.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind==="email")qh.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"email",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="emoji")Cl||(Cl=new RegExp(Kh,"u")),Cl.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"emoji",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="uuid")Wh.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"uuid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid")Vh.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"cuid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="cuid2")Bh.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"cuid2",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="ulid")Fh.test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"ulid",code:C.invalid_string,message:r.message}),t.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),N(s,{validation:"url",code:C.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),N(s,{validation:"regex",code:C.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),N(s,{code:C.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),N(s,{code:C.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),N(s,{code:C.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind==="datetime"?Jh(r).test(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{code:C.invalid_string,validation:"datetime",message:r.message}),t.dirty()):r.kind==="ip"?Qh(e.data,r.version)||(s=this._getOrReturnCtx(e,s),N(s,{validation:"ip",code:C.invalid_string,message:r.message}),t.dirty()):he.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:C.invalid_string,...V.errToObj(s)})}_addCheck(e){return new ft({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.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,...V.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...V.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new ft({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ft({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ft({...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}}ft.create=n=>{var e;return new ft({checks:[],typeName:F.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ee(n)})};function Xh(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 en extends se{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)!==M.number){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:M.number,received:r.parsedType}),G}let t;const s=new qe;for(const r of this._def.checks)r.kind==="int"?he.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:C.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),N(t,{code:C.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),N(t,{code:C.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?Xh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),N(t,{code:C.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:C.not_finite,message:r.message}),s.dirty()):he.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new en({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.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"&&he.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)}}en.create=n=>new en({checks:[],typeName:F.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...ee(n)});class tn extends se{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)!==M.bigint){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:M.bigint,received:r.parsedType}),G}let t;const s=new qe;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),N(t,{code:C.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),N(t,{code:C.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),N(t,{code:C.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):he.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,s,r){return new tn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:V.toString(r)}]})}_addCheck(e){return new tn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.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}}tn.create=n=>{var e;return new tn({checks:[],typeName:F.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ee(n)})};class lr extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.boolean,received:t.parsedType}),G}return Qe(e.data)}}lr.create=n=>new lr({typeName:F.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...ee(n)});class In extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_type,expected:M.date,received:r.parsedType}),G}if(isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return N(r,{code:C.invalid_date}),G}const t=new qe;let s;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),N(s,{code:C.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),N(s,{code:C.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):he.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:V.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:V.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:F.ZodDate,...ee(n)});class gi extends se{_parse(e){if(this._getType(e)!==M.symbol){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.symbol,received:t.parsedType}),G}return Qe(e.data)}}gi.create=n=>new gi({typeName:F.ZodSymbol,...ee(n)});class ar extends se{_parse(e){if(this._getType(e)!==M.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.undefined,received:t.parsedType}),G}return Qe(e.data)}}ar.create=n=>new ar({typeName:F.ZodUndefined,...ee(n)});class or extends se{_parse(e){if(this._getType(e)!==M.null){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.null,received:t.parsedType}),G}return Qe(e.data)}}or.create=n=>new or({typeName:F.ZodNull,...ee(n)});class ss extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return Qe(e.data)}}ss.create=n=>new ss({typeName:F.ZodAny,...ee(n)});class Mn extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qe(e.data)}}Mn.create=n=>new Mn({typeName:F.ZodUnknown,...ee(n)});class Rt extends se{_parse(e){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.never,received:t.parsedType}),G}}Rt.create=n=>new Rt({typeName:F.ZodNever,...ee(n)});class yi extends se{_parse(e){if(this._getType(e)!==M.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.void,received:t.parsedType}),G}return Qe(e.data)}}yi.create=n=>new yi({typeName:F.ZodVoid,...ee(n)});class mt extends se{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==M.array)return N(t,{code:C.invalid_type,expected:M.array,received:t.parsedType}),G;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(l||a)&&(N(t,{code:l?C.too_big:C.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&&(N(t,{code:C.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&&(N(t,{code:C.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 Tt(t,l,t.path,a)))).then(l=>qe.mergeArray(s,l));const i=[...t.data].map((l,a)=>r.type._parseSync(new Tt(t,l,t.path,a)));return qe.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new mt({...this._def,minLength:{value:e,message:V.toString(t)}})}max(e,t){return new mt({...this._def,maxLength:{value:e,message:V.toString(t)}})}length(e,t){return new mt({...this._def,exactLength:{value:e,message:V.toString(t)}})}nonempty(e){return this.min(1,e)}}mt.create=(n,e)=>new mt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...ee(e)});function rs(n){if(n instanceof Te){const e={};for(const t in n.shape){const s=n.shape[t];e[t]=Dt.create(rs(s))}return new Te({...n._def,shape:()=>e})}else return n instanceof mt?new mt({...n._def,type:rs(n.element)}):n instanceof Dt?Dt.create(rs(n.unwrap())):n instanceof Nn?Nn.create(rs(n.unwrap())):n instanceof Ct?Ct.create(n.items.map(e=>rs(e))):n}class Te extends se{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=he.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==M.object){const o=this._getOrReturnCtx(e);return N(o,{code:C.invalid_type,expected:M.object,received:o.parsedType}),G}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof Rt&&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 Tt(s,c,s.path,o)),alwaysSet:o in s.data})}if(this._def.catchall instanceof Rt){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&&(N(s,{code:C.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 Tt(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=>qe.mergeObjectSync(t,o)):qe.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new Te({...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=V.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Te({...this._def,unknownKeys:"strip"})}passthrough(){return new Te({...this._def,unknownKeys:"passthrough"})}extend(e){return new Te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Te({...this._def,catchall:e})}pick(e){const t={};return he.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new Te({...this._def,shape:()=>t})}omit(e){const t={};return he.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new Te({...this._def,shape:()=>t})}deepPartial(){return rs(this)}partial(e){const t={};return he.objectKeys(this.shape).forEach(s=>{const r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}),new Te({...this._def,shape:()=>t})}required(e){const t={};return he.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let r=this.shape[s];for(;r instanceof Dt;)r=r._def.innerType;t[s]=r}}),new Te({...this._def,shape:()=>t})}keyof(){return Go(he.objectKeys(this.shape))}}Te.create=(n,e)=>new Te({shape:()=>n,unknownKeys:"strip",catchall:Rt.create(),typeName:F.ZodObject,...ee(e)}),Te.strictCreate=(n,e)=>new Te({shape:()=>n,unknownKeys:"strict",catchall:Rt.create(),typeName:F.ZodObject,...ee(e)}),Te.lazycreate=(n,e)=>new Te({shape:n,unknownKeys:"strip",catchall:Rt.create(),typeName:F.ZodObject,...ee(e)});class ur extends se{_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 pt(a.ctx.common.issues));return N(t,{code:C.invalid_union,unionErrors:l}),G}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 pt(o));return N(t,{code:C.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}}ur.create=(n,e)=>new ur({options:n,typeName:F.ZodUnion,...ee(e)});const vi=n=>n instanceof hr?vi(n.schema):n instanceof gt?vi(n.innerType()):n instanceof pr?[n.value]:n instanceof nn?n.options:n instanceof fr?Object.keys(n.enum):n instanceof mr?vi(n._def.innerType):n instanceof ar?[void 0]:n instanceof or?[null]:null;class bi extends se{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.object)return N(t,{code:C.invalid_type,expected:M.object,received:t.parsedType}),G;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}):(N(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),G)}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=vi(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 bi({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...ee(s)})}}function El(n,e){const t=Xt(n),s=Xt(e);if(n===e)return{valid:!0,data:n};if(t===M.object&&s===M.object){const r=he.objectKeys(e),i=he.objectKeys(n).filter(a=>r.indexOf(a)!==-1),l={...n,...e};for(const a of i){const o=El(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===M.array&&s===M.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=El(l,a);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}else return t===M.date&&s===M.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class cr extends se{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),r=(i,l)=>{if(Sl(i)||Sl(l))return G;const a=El(i.value,l.value);return a.valid?((Tl(i)||Tl(l))&&t.dirty(),{status:t.value,value:a.data}):(N(s,{code:C.invalid_intersection_types}),G)};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}))}}cr.create=(n,e,t)=>new cr({left:n,right:e,typeName:F.ZodIntersection,...ee(t)});class Ct extends se{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==M.array)return N(s,{code:C.invalid_type,expected:M.array,received:s.parsedType}),G;if(s.data.length<this._def.items.length)return N(s,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&s.data.length>this._def.items.length&&(N(s,{code:C.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 Tt(s,i,s.path,l)):null}).filter(i=>!!i);return s.common.async?Promise.all(r).then(i=>qe.mergeArray(t,i)):qe.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Ct({...this._def,rest:e})}}Ct.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ct({items:n,typeName:F.ZodTuple,rest:null,...ee(e)})};class dr extends se{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!==M.object)return N(s,{code:C.invalid_type,expected:M.object,received:s.parsedType}),G;const r=[],i=this._def.keyType,l=this._def.valueType;for(const a in s.data)r.push({key:i._parse(new Tt(s,a,s.path,a)),value:l._parse(new Tt(s,s.data[a],s.path,a))});return s.common.async?qe.mergeObjectAsync(t,r):qe.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof se?new dr({keyType:e,valueType:t,typeName:F.ZodRecord,...ee(s)}):new dr({keyType:ft.create(),valueType:e,typeName:F.ZodRecord,...ee(t)})}}class _i extends se{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!==M.map)return N(s,{code:C.invalid_type,expected:M.map,received:s.parsedType}),G;const r=this._def.keyType,i=this._def.valueType,l=[...s.data.entries()].map(([a,o],u)=>({key:r._parse(new Tt(s,a,s.path,[u,"key"])),value:i._parse(new Tt(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 G;(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 G;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}_i.create=(n,e,t)=>new _i({valueType:e,keyType:n,typeName:F.ZodMap,...ee(t)});class On extends se{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==M.set)return N(s,{code:C.invalid_type,expected:M.set,received:s.parsedType}),G;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(N(s,{code:C.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&&(N(s,{code:C.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 G;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 Tt(s,o,s.path,u)));return s.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new On({...this._def,minSize:{value:e,message:V.toString(t)}})}max(e,t){return new On({...this._def,maxSize:{value:e,message:V.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}On.create=(n,e)=>new On({valueType:n,minSize:null,maxSize:null,typeName:F.ZodSet,...ee(e)});class is extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.function)return N(t,{code:C.invalid_type,expected:M.function,received:t.parsedType}),G;function s(a,o){return fi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pi(),rr].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:o}})}function r(a,o){return fi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pi(),rr].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:o}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof ls){const a=this;return Qe(async function(...o){const u=new pt([]),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 Qe(function(...o){const u=a._def.args.safeParse(o,i);if(!u.success)throw new pt([s(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,i);if(!p.success)throw new pt([r(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new is({...this._def,args:Ct.create(e).rest(Mn.create())})}returns(e){return new is({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new is({args:e||Ct.create([]).rest(Mn.create()),returns:t||Mn.create(),typeName:F.ZodFunction,...ee(s)})}}class hr extends se{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})}}hr.create=(n,e)=>new hr({getter:n,typeName:F.ZodLazy,...ee(e)});class pr extends se{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return N(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}}pr.create=(n,e)=>new pr({value:n,typeName:F.ZodLiteral,...ee(e)});function Go(n,e){return new nn({values:n,typeName:F.ZodEnum,...ee(e)})}class nn extends se{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return N(t,{expected:he.joinValues(s),received:t.parsedType,code:C.invalid_type}),G}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),s=this._def.values;return N(t,{received:t.data,code:C.invalid_enum_value,options:s}),G}return Qe(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 nn.create(e)}exclude(e){return nn.create(this.options.filter(t=>!e.includes(t)))}}nn.create=Go;class fr extends se{_parse(e){const t=he.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==M.string&&s.parsedType!==M.number){const r=he.objectValues(t);return N(s,{expected:he.joinValues(r),received:s.parsedType,code:C.invalid_type}),G}if(t.indexOf(e.data)===-1){const r=he.objectValues(t);return N(s,{received:s.data,code:C.invalid_enum_value,options:r}),G}return Qe(e.data)}get enum(){return this._def.values}}fr.create=(n,e)=>new fr({values:n,typeName:F.ZodNativeEnum,...ee(e)});class ls extends se{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.promise&&t.common.async===!1)return N(t,{code:C.invalid_type,expected:M.promise,received:t.parsedType}),G;const s=t.parsedType===M.promise?t.data:Promise.resolve(t.data);return Qe(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ls.create=(n,e)=>new ls({type:n,typeName:F.ZodPromise,...ee(e)});class gt extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.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=>{N(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"?G:(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"?G:(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(!ir(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=>ir(l)?Promise.resolve(r.transform(l.value,i)).then(a=>({status:t.value,value:a})):l);he.assertNever(r)}}gt.create=(n,e,t)=>new gt({schema:n,typeName:F.ZodEffects,effect:e,...ee(t)}),gt.createWithPreprocess=(n,e,t)=>new gt({schema:e,effect:{type:"preprocess",transform:n},typeName:F.ZodEffects,...ee(t)});class Dt extends se{_parse(e){return this._getType(e)===M.undefined?Qe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dt.create=(n,e)=>new Dt({innerType:n,typeName:F.ZodOptional,...ee(e)});class Nn extends se{_parse(e){return this._getType(e)===M.null?Qe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(n,e)=>new Nn({innerType:n,typeName:F.ZodNullable,...ee(e)});class mr extends se{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===M.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}mr.create=(n,e)=>new mr({innerType:n,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ee(e)});class wi extends se{_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 mi(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pt(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pt(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}wi.create=(n,e)=>new wi({innerType:n,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ee(e)});class xi extends se{_parse(e){if(this._getType(e)!==M.nan){const t=this._getOrReturnCtx(e);return N(t,{code:C.invalid_type,expected:M.nan,received:t.parsedType}),G}return{status:"valid",value:e.data}}}xi.create=n=>new xi({typeName:F.ZodNaN,...ee(n)});const ep=Symbol("zod_brand");class Jo extends se{_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 gr extends se{_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"?G:r.status==="dirty"?(t.dirty(),Ko(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"?G: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 gr({in:e,out:t,typeName:F.ZodPipeline})}}class $i extends se{_parse(e){const t=this._def.innerType._parse(e);return ir(t)&&(t.value=Object.freeze(t.value)),t}}$i.create=(n,e)=>new $i({innerType:n,typeName:F.ZodReadonly,...ee(e)});const Qo=(n,e={},t)=>n?ss.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})}}):ss.create(),tp={object:Te.lazycreate};var F;(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"})(F||(F={}));const np=(n,e={message:`Input not instance of ${n.name}`})=>Qo(t=>t instanceof n,e),Xo=ft.create,eu=en.create,sp=xi.create,rp=tn.create,tu=lr.create,ip=In.create,lp=gi.create,ap=ar.create,op=or.create,up=ss.create,cp=Mn.create,dp=Rt.create,hp=yi.create,pp=mt.create,fp=Te.create,mp=Te.strictCreate,gp=ur.create,yp=bi.create,vp=cr.create,bp=Ct.create,_p=dr.create,wp=_i.create,xp=On.create,$p=is.create,kp=hr.create,Ap=pr.create,Sp=nn.create,Tp=fr.create,Cp=ls.create,nu=gt.create,Ep=Dt.create,Ip=Nn.create,Mp=gt.createWithPreprocess,Op=gr.create;var P=Object.freeze({__proto__:null,defaultErrorMap:rr,setErrorMap:Hh,getErrorMap:pi,makeIssue:fi,EMPTY_PATH:Uh,addIssueToContext:N,ParseStatus:qe,INVALID:G,DIRTY:Ko,OK:Qe,isAborted:Sl,isDirty:Tl,isValid:ir,isAsync:mi,get util(){return he},get objectUtil(){return Al},ZodParsedType:M,getParsedType:Xt,ZodType:se,ZodString:ft,ZodNumber:en,ZodBigInt:tn,ZodBoolean:lr,ZodDate:In,ZodSymbol:gi,ZodUndefined:ar,ZodNull:or,ZodAny:ss,ZodUnknown:Mn,ZodNever:Rt,ZodVoid:yi,ZodArray:mt,ZodObject:Te,ZodUnion:ur,ZodDiscriminatedUnion:bi,ZodIntersection:cr,ZodTuple:Ct,ZodRecord:dr,ZodMap:_i,ZodSet:On,ZodFunction:is,ZodLazy:hr,ZodLiteral:pr,ZodEnum:nn,ZodNativeEnum:fr,ZodPromise:ls,ZodEffects:gt,ZodTransformer:gt,ZodOptional:Dt,ZodNullable:Nn,ZodDefault:mr,ZodCatch:wi,ZodNaN:xi,BRAND:ep,ZodBranded:Jo,ZodPipeline:gr,ZodReadonly:$i,custom:Qo,Schema:se,ZodSchema:se,late:tp,get ZodFirstPartyTypeKind(){return F},coerce:{string:n=>ft.create({...n,coerce:!0}),number:n=>en.create({...n,coerce:!0}),boolean:n=>lr.create({...n,coerce:!0}),bigint:n=>tn.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:up,array:pp,bigint:rp,boolean:tu,date:ip,discriminatedUnion:yp,effect:nu,enum:Sp,function:$p,instanceof:np,intersection:vp,lazy:kp,literal:Ap,map:wp,nan:sp,nativeEnum:Tp,never:dp,null:op,nullable:Ip,number:eu,object:fp,oboolean:()=>tu().optional(),onumber:()=>eu().optional(),optional:Ep,ostring:()=>Xo().optional(),pipeline:Op,preprocess:Mp,promise:Cp,record:_p,set:xp,strictObject:mp,string:Xo,symbol:lp,transformer:nu,tuple:bp,undefined:ap,union:gp,unknown:cp,void:hp,NEVER:G,ZodIssueCode:C,quotelessJson:zh,ZodError:pt});const ki=P.object({assistantId:P.string(),params:P.record(P.any()).default({}),config:P.object({historyKey:P.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:P.string().default("Hello! How can I help you today?"),inactivityWarningMessage:P.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:P.string().default("Chat Ended"),resetEndedChatOnLoad:P.boolean().default(!1),initialReplyMessage:P.string().nullable().default(null),disclaimerMessage:P.string().nullable().default(null),disclaimerPopover:P.object({message:P.string().nullable().default(null),agreeButtonText:P.string().default("I Agree"),rememberDurationMinutes:P.number().default(60*24*3)}).default({}),placement:P.enum(["left","right"]).default("right"),openChatButton:P.object({imageSrc:P.string().nullable().default(null),width:P.union([P.string(),P.number()]).default("48px"),height:P.union([P.string(),P.number()]).default("48px"),cta:P.string().nullable().default(null)}).default({}),chatWindow:P.object({header:P.object({text:P.string().nullable().default("AI Chat"),imageSrc:P.string().nullable().default(null)}).default({}),showCloseButton:P.boolean().default(!0)}).default({}),styles:P.object({primaryColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null),linkColor:P.string().nullable().default(null),openChatButton:P.object({backgroundColor:P.string().nullable().default(null),iconColor:P.string().nullable().default(null)}).default({}),header:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),button:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),messages:P.object({user:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({}),assistant:P.object({backgroundColor:P.string().nullable().default(null),textColor:P.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:P.object({functionCalls:P.record(P.function().returns(P.union([P.any(),P.promise(P.any())]))).default({}),enhancedContent:P.record(P.function().returns(P.union([P.any(),P.promise(P.any())]))).default({})}).default({})});var Np=Object.defineProperty,Pp=Object.getOwnPropertyDescriptor,as=(n,e,t,s)=>{for(var r=s>1?void 0:s?Pp(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&&Np(e,t,r),r};let sn=class extends nt{constructor(){super(...arguments),this.isOpen=!1,this.ctaClosed=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?(Zh(this,{allowTouchMove:n=>n.nodeName==="IAI-CHAT-POPUP"}),this.isIosDevice||(document.documentElement.style.overflow="hidden")):(Fo(this),this.isIosDevice||(document.documentElement.style.overflow=this.initialHtmlOverflow))}}connectedCallback(){super.connectedCallback(),this.cleanOptions=ki.parse(this.options),this.identifyIosDevice(),this.setInitialHtmlOverflow(),this.initialScrollPosition={x:0,y:0},this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),Fo(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const{placement:n}=this.cleanOptions.config,{height:e,cta:t}=this.cleanOptions.config.openChatButton;return oe`
|
|
351
|
+
<div
|
|
352
|
+
class="chat-widget-popup fixed flex flex-col bottom-0 z-40 ${$l({"right-0 items-end":n==="right","left-0 items-start":n==="left"})}"
|
|
353
|
+
style=${er({colorScheme:"normal"})}
|
|
354
|
+
>
|
|
355
|
+
<iai-chat
|
|
356
|
+
.options=${this.options}
|
|
357
|
+
class="chat-widget w-dvw h-dvh md:mx-8 md:w-[350px] md:h-[500px] ${$l({invisible:!this.isOpen})}"
|
|
358
|
+
style="${er({"--iai-i-button-height":`${e}`})}"
|
|
359
|
+
@iai-chat-close=${this.toggleChat}
|
|
360
|
+
></iai-chat>
|
|
361
|
+
|
|
362
|
+
${Qt(t&&!this.ctaClosed&&!this.isOpen,()=>oe`
|
|
363
|
+
<iai-chat-cta-bubble
|
|
364
|
+
class="mx-8"
|
|
365
|
+
.message=${t}
|
|
366
|
+
.pointerPosition=${n}
|
|
367
|
+
@hide=${()=>this.ctaClosed=!0}
|
|
368
|
+
></iai-chat-cta-bubble>
|
|
369
|
+
`)}
|
|
370
|
+
|
|
371
|
+
<iai-chat-open-chat-button
|
|
372
|
+
class="m-8 mt-4 ${$l({hidden:this.isOpen,"md:block":this.isOpen})}"
|
|
373
|
+
.options=${this.cleanOptions}
|
|
374
|
+
@toggle-chat=${this.toggleChat}
|
|
375
|
+
></iai-chat-open-chat-button>
|
|
376
|
+
</div>
|
|
377
|
+
`}toggleChat(){this.isOpen=!this.isOpen;const n=this.isIosDevice&&window.innerWidth<768;n&&this.isOpen&&(this.initialScrollPosition={x:window.scrollX,y:window.scrollY}),this.onResizeHandler(),n&&!this.isOpen&&setTimeout(()=>{window.scrollTo(this.initialScrollPosition.x,this.initialScrollPosition.y)},500)}identifyIosDevice(){const{platform:n="",maxTouchPoints:e=0}=window.navigator||{};this.isIosDevice=typeof window<"u"&&!!window.navigator&&!!n&&(/iP(ad|hone|od)/.test(n)||n==="MacIntel"&&e>1)}setInitialHtmlOverflow(){var n;const{overflow:e="auto"}=((n=document.documentElement)==null?void 0:n.style)||{};this.initialHtmlOverflow=e}};sn.styles=[St,Nt`
|
|
378
|
+
.chat-widget-popup {
|
|
379
|
+
pointer-events: none;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.chat-widget-popup > * {
|
|
383
|
+
pointer-events: auto;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@media(min-width: 768px) {
|
|
387
|
+
.chat-widget {
|
|
388
|
+
min-height: calc(10rem);
|
|
389
|
+
max-height: calc(100dvh - var(--iai-i-button-height, 48px) - 4rem);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
`],as([Se({type:Object})],sn.prototype,"options",2),as([Jt()],sn.prototype,"isOpen",2),as([Jt()],sn.prototype,"ctaClosed",2),as([li("iai-chat")],sn.prototype,"chatWindow",2),as([kl.debounce(250)],sn.prototype,"onResizeHandler",2),sn=as([At("iai-chat-popup")],sn);const Rp="https://api.ai.inhabit.services",yr={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const t={...e,headers:{"Content-Type":"application/json",...e.headers}};n=n.replace(/^\//,"");const s=await fetch(`${Rp}/${n}`,t);if(!s.ok){if(s.status===429){const r=+(s.headers.get("Retry-After")||30);throw new vr(`Rate limited fetching ${n}: retry after ${r} seconds`,s.status,{retryAfter:r})}throw new vr(`Failed to fetch ${n}: ${s.statusText} (${s.status})`,s.status)}return s.json()}};async function Dp(n,e={}){return yr.post("/threads",{assistantId:n,params:e})}async function jp(n,e="No reason provided"){await yr.post(`/threads/${n}/end`,{reason:e})}async function Zp(n,e){return yr.post(`/threads/${n}/messages`,{content:e})}async function Lp(n,e,t,s=!1){return yr.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:s})}async function zp(n){return yr.post(`/threads/${n}/ping`)}class vr extends Error{constructor(e,t,s){super(e),this.status=t,this.details=s}}function Hp(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 Up{constructor(e,t={}){if(this._assistantId="",this._recurringKeepAliveInterval=null,this._recurringKeepAliveCallers=new Set,this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this._resetCounter=0,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:{},resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=Hp(),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 jp(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._recurringKeepAliveCallers.forEach(t=>t()),this.stopInactivityTimers(),this.setChatEndingWarningSent(!1),this.storageRemoveAll(),this._resetCounter+=1,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;if(i>s){if(this.chatEnded)return;this.setChatEnded(!0),this._emitter.emit("chatEnded")}else i>r?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},s-i)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),r-i),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},s-i))}registerRecurringKeepAlive(){if(!this.chatStarted)throw new Error("Chat not started");const e=()=>{this._recurringKeepAliveCallers.delete(e),this._recurringKeepAliveCallers.size===0&&this._recurringKeepAliveInterval&&(clearInterval(this._recurringKeepAliveInterval),this._recurringKeepAliveInterval=null)};return this._recurringKeepAliveCallers.add(e),this._recurringKeepAliveInterval||(this._recurringKeepAliveInterval=setInterval(()=>{this.chatStarted&&(this.keepAlive(),zp(this.threadId).then(()=>{}))},3e4)),e}async startChat(){if(this.chatStarted)return;const e=this.getResetChecker(),{id:t,inactivityWaitTime:s,inactivityWarningTime:r}=await Dp(this.assistantId,this.params);if(!t)throw new Il("Could not start chat","ChatStartError");if(e.resetOccurred)throw new Il("Chat was reset","ChatReset");this.setConversationDetails({threadId:t,inactivityWaitTime:s,inactivityWarningTime:r})}handleSendUserMessageResponse({messages:e,functions:t}){this.addMessages(e),t.forEach(s=>this._emitter.emit("functionCall",s))}addMessages(e){e.forEach(t=>this.addMessage(t))}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{const r=this.getResetChecker();this.setTyping(!0),this.keepAlive();const i=await Lp(this.threadId,e,t,s);if(r.resetOccurred)return;this.handleSendUserMessageResponse(i)}catch(r){r instanceof vr&&r.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${r.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",r)}finally{this.setTyping(!1)}}async sendUserMessage(e){try{const t=this.getResetChecker();if(this.addMessage({role:"user",content:e}),this.setTyping(!0),!this.chatStarted){const{initialReplyMessage:r}=this.options;r&&this.addMessage({role:"assistant",content:r});try{await this.startChat()}catch(i){if(i instanceof vr&&i.status===429){this.sendErrorMessage(`You are starting new chats too quickly. You may try again in ${i.details.retryAfter} second(s).`);return}if(i instanceof Il&&i.name==="ChatReset")return;this.sendErrorMessage(),console.error("Error starting chat",i)}}this.keepAlive();const s=await Zp(this.threadId,e);if(t.resetOccurred)return;this.handleSendUserMessageResponse(s)}catch(t){t instanceof vr&&t.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${t.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",t)}finally{this.setTyping(!1)}}sendErrorMessage(e="There was an unexpected error. Please try again later."){this.addMessage({role:"assistant",content:e})}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))}getResetChecker(){const e=this._resetCounter,t=this;return{get resetOccurred(){return e!==t._resetCounter}}}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)})}}class Il extends Error{constructor(e,t){super(e),this.name=t}}var su={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(Lh,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",le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ze=/\[([^\]]+)]|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,Ke={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(k){var b=["th","st","nd","rd"],y=k%100;return"["+k+(b[(y-20)%10]||b[y]||b[0])+"]"}},ue=function(k,b,y){var w=String(k);return!w||w.length>=b?k:""+Array(b+1-w.length).join(y)+k},Ye={s:ue,z:function(k){var b=-k.utcOffset(),y=Math.abs(b),w=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+ue(w,2,"0")+":"+ue(v,2,"0")},m:function k(b,y){if(b.date()<y.date())return-k(y,b);var w=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(w,p),T=y-v<0,x=b.clone().add(w+(T?-1:1),p);return+(-(w+(y-v)/(T?v-x:x-v))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:p,y:g,w:c,d:u,D:$,h:o,m:a,s:l,ms:i,Q:d}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},Ce="en",U={};U[Ce]=Ke;var st="$isDayjsObject",we=function(k){return k instanceof He||!(!k||!k[st])},Ge=function k(b,y,w){var v;if(!b)return Ce;if(typeof b=="string"){var T=b.toLowerCase();U[T]&&(v=T),y&&(U[T]=y,v=T);var x=b.split("-");if(!v&&x.length>1)return k(x[0])}else{var Z=b.name;U[Z]=b,v=Z}return!w&&v&&(Ce=v),v||!w&&Ce},J=function(k,b){if(we(k))return k.clone();var y=typeof b=="object"?b:{};return y.date=k,y.args=arguments,new He(y)},R=Ye;R.l=Ge,R.i=we,R.w=function(k,b){return J(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var He=function(){function k(y){this.$L=Ge(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[st]=!0}var b=k.prototype;return b.parse=function(y){this.$d=function(w){var v=w.date,T=w.utc;if(v===null)return new Date(NaN);if(R.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var x=v.match(le);if(x){var Z=x[2]-1||0,K=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,K)):new Date(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,K)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return R},b.isValid=function(){return this.$d.toString()!==W},b.isSame=function(y,w){var v=J(y);return this.startOf(w)<=v&&v<=this.endOf(w)},b.isAfter=function(y,w){return J(y)<this.startOf(w)},b.isBefore=function(y,w){return this.endOf(w)<J(y)},b.$g=function(y,w,v){return R.u(y)?this[w]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,w){var v=this,T=!!R.u(w)||w,x=R.p(y),Z=function(Ne,de){var Ee=R.w(v.$u?Date.UTC(v.$y,de,Ne):new Date(v.$y,de,Ne),v);return T?Ee:Ee.endOf(u)},K=function(Ne,de){return R.w(v.toDate()[Ne].apply(v.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(de)),v)},Q=this.$W,re=this.$M,pe=this.$D,Ve="set"+(this.$u?"UTC":"");switch(x){case g:return T?Z(1,0):Z(31,11);case p:return T?Z(1,re):Z(0,re+1);case c:var Pe=this.$locale().weekStart||0,et=(Q<Pe?Q+7:Q)-Pe;return Z(T?pe-et:pe+(6-et),re);case u:case $:return K(Ve+"Hours",0);case o:return K(Ve+"Minutes",1);case a:return K(Ve+"Seconds",2);case l:return K(Ve+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,w){var v,T=R.p(y),x="set"+(this.$u?"UTC":""),Z=(v={},v[u]=x+"Date",v[$]=x+"Date",v[p]=x+"Month",v[g]=x+"FullYear",v[o]=x+"Hours",v[a]=x+"Minutes",v[l]=x+"Seconds",v[i]=x+"Milliseconds",v)[T],K=T===u?this.$D+(w-this.$W):w;if(T===p||T===g){var Q=this.clone().set($,1);Q.$d[Z](K),Q.init(),this.$d=Q.set($,Math.min(this.$D,Q.daysInMonth())).$d}else Z&&this.$d[Z](K);return this.init(),this},b.set=function(y,w){return this.clone().$set(y,w)},b.get=function(y){return this[R.p(y)]()},b.add=function(y,w){var v,T=this;y=Number(y);var x=R.p(w),Z=function(re){var pe=J(T);return R.w(pe.date(pe.date()+Math.round(re*y)),T)};if(x===p)return this.set(p,this.$M+y);if(x===g)return this.set(g,this.$y+y);if(x===u)return Z(1);if(x===c)return Z(7);var K=(v={},v[a]=s,v[o]=r,v[l]=t,v)[x]||1,Q=this.$d.getTime()+y*K;return R.w(Q,this)},b.subtract=function(y,w){return this.add(-1*y,w)},b.format=function(y){var w=this,v=this.$locale();if(!this.isValid())return v.invalidDate||W;var T=y||"YYYY-MM-DDTHH:mm:ssZ",x=R.z(this),Z=this.$H,K=this.$m,Q=this.$M,re=v.weekdays,pe=v.months,Ve=v.meridiem,Pe=function(de,Ee,Be,ot){return de&&(de[Ee]||de(w,T))||Be[Ee].slice(0,ot)},et=function(de){return R.s(Z%12||12,de,"0")},Ne=Ve||function(de,Ee,Be){var ot=de<12?"AM":"PM";return Be?ot.toLowerCase():ot};return T.replace(ze,function(de,Ee){return Ee||function(Be){switch(Be){case"YY":return String(w.$y).slice(-2);case"YYYY":return R.s(w.$y,4,"0");case"M":return Q+1;case"MM":return R.s(Q+1,2,"0");case"MMM":return Pe(v.monthsShort,Q,pe,3);case"MMMM":return Pe(pe,Q);case"D":return w.$D;case"DD":return R.s(w.$D,2,"0");case"d":return String(w.$W);case"dd":return Pe(v.weekdaysMin,w.$W,re,2);case"ddd":return Pe(v.weekdaysShort,w.$W,re,3);case"dddd":return re[w.$W];case"H":return String(Z);case"HH":return R.s(Z,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return Ne(Z,K,!0);case"A":return Ne(Z,K,!1);case"m":return String(K);case"mm":return R.s(K,2,"0");case"s":return String(w.$s);case"ss":return R.s(w.$s,2,"0");case"SSS":return R.s(w.$ms,3,"0");case"Z":return x}return null}(de)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,w,v){var T,x=this,Z=R.p(w),K=J(y),Q=(K.utcOffset()-this.utcOffset())*s,re=this-K,pe=function(){return R.m(x,K)};switch(Z){case g:T=pe()/12;break;case p:T=pe();break;case d:T=pe()/3;break;case c:T=(re-Q)/6048e5;break;case u:T=(re-Q)/864e5;break;case o:T=re/r;break;case a:T=re/s;break;case l:T=re/t;break;default:T=re}return v?T:R.a(T)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,w){if(!y)return this.$L;var v=this.clone(),T=Ge(y,w,!0);return T&&(v.$L=T),v},b.clone=function(){return R.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),at=He.prototype;return J.prototype=at,[["$ms",i],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",$]].forEach(function(k){at[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),J.extend=function(k,b){return k.$i||(k(b,He,J),k.$i=!0),J},J.locale=Ge,J.isDayjs=we,J.unix=function(k){return J(1e3*k)},J.en=U[Ce],J.Ls=U,J.p={},J})})(su);var Vp=su.exports;const ru=Wo(Vp);function Bp(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)})}}}/**
|
|
348
393
|
* @license
|
|
349
394
|
* Copyright 2017 Google LLC
|
|
350
395
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
351
|
-
*/class
|
|
352
|
-
`).map(r=>{const
|
|
353
|
-
`)}class
|
|
354
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const
|
|
355
|
-
$1`);
|
|
356
|
-
`);const r=this.lexer.state.top;this.lexer.state.top=!0;const
|
|
357
|
-
`,1)[0].replace(/^\t+/,
|
|
396
|
+
*/class Ml extends vl{constructor(e){if(super(e),this.it=Oe,e.type!==gl.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Oe||e==null)return this._t=void 0,this.it=e;if(e===Yt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ml.directiveName="unsafeHTML",Ml.resultType=1;const Fp=yl(Ml);function Ol(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Pn=Ol();function iu(n){Pn=n}const lu=/[&<>"']/,Wp=new RegExp(lu.source,"g"),au=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,qp=new RegExp(au.source,"g"),Kp={"&":"&","<":"<",">":">",'"':""","'":"'"},ou=n=>Kp[n];function it(n,e){if(e){if(lu.test(n))return n.replace(Wp,ou)}else if(au.test(n))return n.replace(qp,ou);return n}const Yp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Gp(n){return n.replace(Yp,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Jp=/(^|[^\[])\^/g;function ve(n,e){let t=typeof n=="string"?n:n.source;e=e||"";const s={replace:(r,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(Jp,"$1"),t=t.replace(r,l),s},getRegex:()=>new RegExp(t,e)};return s}function uu(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const br={exec:()=>null};function cu(n,e){const t=n.replace(/\|/g,(i,l,a)=>{let o=!1,u=l;for(;--u>=0&&a[u]==="\\";)o=!o;return o?"|":" |"}),s=t.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(/\\\|/g,"|");return s}function Ai(n,e,t){const s=n.length;if(s===0)return"";let r=0;for(;r<s;){const i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}function Qp(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return-1}function du(n,e,t,s){const r=e.href,i=e.title?it(e.title):null,l=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){s.state.inLink=!0;const a={type:"link",raw:t,href:r,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}return{type:"image",raw:t,href:r,title:i,text:it(l)}}function Xp(n,e){const t=n.match(/^(\s+)(?:```)/);if(t===null)return e;const s=t[1];return e.split(`
|
|
397
|
+
`).map(r=>{const i=r.match(/^\s+/);if(i===null)return r;const[l]=i;return l.length>=s.length?r.slice(s.length):r}).join(`
|
|
398
|
+
`)}class Si{constructor(e){$e(this,"options"),$e(this,"rules"),$e(this,"lexer"),this.options=e||Pn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ai(s,`
|
|
399
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],r=Xp(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=Ai(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,`
|
|
400
|
+
$1`);s=Ai(s.replace(/^ *>[ \t]?/gm,""),`
|
|
401
|
+
`);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(`
|
|
402
|
+
`,1)[0].replace(/^\t+/,ze=>" ".repeat(3*ze.length)),d=e.split(`
|
|
358
403
|
`,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=
|
|
361
|
-
`+d.slice(g);else{if($||p.search(/[^ ]/)>=4||
|
|
362
|
-
`+d}!$&&!d.trim()&&($=!0),a+=
|
|
363
|
-
`,e=e.substring(
|
|
364
|
-
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(
|
|
365
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:
|
|
366
|
-
]`).replace("lheading",
|
|
367
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const
|
|
368
|
-
`:t.push(
|
|
369
|
-
`+
|
|
370
|
-
`+
|
|
371
|
-
`+
|
|
372
|
-
`+
|
|
373
|
-
`+
|
|
374
|
-
`+
|
|
375
|
-
`+
|
|
376
|
-
`+
|
|
377
|
-
`,
|
|
378
|
-
`:"<pre><code>"+(
|
|
404
|
+
`,e=e.substring(d.length+1),c=!0),!c){const ze=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),Ke=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),ue=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),Ye=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){const Ce=e.split(`
|
|
405
|
+
`,1)[0];if(d=Ce,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),ue.test(d)||Ye.test(d)||ze.test(d)||Ke.test(e))break;if(d.search(/[^ ]/)>=g||!d.trim())o+=`
|
|
406
|
+
`+d.slice(g);else{if($||p.search(/[^ ]/)>=4||ue.test(p)||Ye.test(p)||Ke.test(p))break;o+=`
|
|
407
|
+
`+d}!$&&!d.trim()&&($=!0),a+=Ce+`
|
|
408
|
+
`,e=e.substring(Ce.length+1),p=d.slice(g)}}i.loose||(u?i.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let W=null,le;this.options.gfm&&(W=/^\[[ xX]\] /.exec(o),W&&(le=W[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!W,checked:le,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=cu(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
409
|
+
`):[],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(cu(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)===`
|
|
410
|
+
`?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:it(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=Ai(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{const l=Qp(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)),du(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 du(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=it(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=it(t[1]),r="mailto:"+s):(s=it(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=it(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=it(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=it(t[0]),{type:"text",raw:t[0],text:s}}}}const ef=/^(?: *(?:\n|$))+/,tf=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,nf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_r=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hu=/(?:[*+-]|\d{1,9}[.)])/,pu=ve(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,hu).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(),Nl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rf=/^[^\n]+/,Pl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,lf=ve(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Pl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),af=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hu).getRegex(),Ti="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",Rl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,of=ve("^ {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",Rl).replace("tag",Ti).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fu=ve(Nl).replace("hr",_r).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",Ti).getRegex(),uf=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fu).getRegex(),Dl={blockquote:uf,code:tf,def:lf,fences:nf,heading:sf,hr:_r,html:of,lheading:pu,list:af,newline:ef,paragraph:fu,table:br,text:rf},mu=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_r).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",Ti).getRegex(),cf={...Dl,table:mu,paragraph:ve(Nl).replace("hr",_r).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",mu).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",Ti).getRegex()},df={...Dl,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rl).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:br,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(Nl).replace("hr",_r).replace("heading",` *#{1,6} *[^
|
|
411
|
+
]`).replace("lheading",pu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yu=/^( {2,}|\\)\n(?!\s*$)/,pf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wr="\\p{P}\\p{S}",ff=ve(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,wr).getRegex(),mf=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,gf=ve(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,wr).getRegex(),yf=ve("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,wr).getRegex(),vf=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,wr).getRegex(),bf=ve(/\\([punct])/,"gu").replace(/punct/g,wr).getRegex(),_f=ve(/^<(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(),wf=ve(Rl).replace("(?:-->|$)","-->").getRegex(),xf=ve("^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",wf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ci=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$f=ve(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ci).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vu=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",Ci).replace("ref",Pl).getRegex(),bu=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",Pl).getRegex(),kf=ve("reflink|nolink(?!\\()","g").replace("reflink",vu).replace("nolink",bu).getRegex(),jl={_backpedal:br,anyPunctuation:bf,autolink:_f,blockSkip:mf,br:yu,code:hf,del:br,emStrongLDelim:gf,emStrongRDelimAst:yf,emStrongRDelimUnd:vf,escape:gu,link:$f,nolink:bu,punctuation:ff,reflink:vu,reflinkSearch:kf,tag:xf,text:pf,url:br},Af={...jl,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Ci).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ci).getRegex()},Zl={...jl,escape:ve(gu).replace("])","~|])").getRegex(),url:ve(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sf={...Zl,br:ve(yu).replace("{2,}","*").getRegex(),text:ve(Zl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ei={normal:Dl,gfm:cf,pedantic:df},xr={normal:jl,gfm:Zl,breaks:Sf,pedantic:Af};class Et{constructor(e){$e(this,"tokens"),$e(this,"options"),$e(this,"state"),$e(this,"tokenizer"),$e(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pn,this.options.tokenizer=this.options.tokenizer||new Si,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:Ei.normal,inline:xr.normal};this.options.pedantic?(t.block=Ei.pedantic,t.inline=xr.pedantic):this.options.gfm&&(t.block=Ei.gfm,this.options.breaks?t.inline=xr.breaks:t.inline=xr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ei,inline:xr}}static lex(e,t){return new Et(t).lex(e)}static lexInline(e,t){return new Et(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
412
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,o,u)=>o+" ".repeat(u.length));let s,r,i,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length),s.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
413
|
+
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
414
|
+
`+s.raw,r.text+=`
|
|
415
|
+
`+s.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
416
|
+
`+s.raw,r.text+=`
|
|
417
|
+
`+s.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const o=e.slice(1);let u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},o),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){r=t[t.length-1],l&&r.type==="paragraph"?(r.raw+=`
|
|
418
|
+
`+s.raw,r.text+=`
|
|
419
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(s),l=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=`
|
|
420
|
+
`+s.raw,r.text+=`
|
|
421
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(s);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s,r,i,l=e,a,o,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,a.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(u=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(s=c.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r=t[t.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),r=t[t.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,l,u)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const p=e.slice(1);let d;this.options.extensions.startInline.forEach(g=>{d=g.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(i=e.substring(0,c+1))}if(s=this.tokenizer.inlineText(i)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(u=s.raw.slice(-1)),o=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}}class $r{constructor(e){$e(this,"options"),this.options=e||Pn}code(e,t,s){var r;const i=(r=(t||"").match(/^\S*/))==null?void 0:r[0];return e=e.replace(/\n$/,"")+`
|
|
422
|
+
`,i?'<pre><code class="language-'+it(i)+'">'+(s?e:it(e,!0))+`</code></pre>
|
|
423
|
+
`:"<pre><code>"+(s?e:it(e,!0))+`</code></pre>
|
|
379
424
|
`}blockquote(e){return`<blockquote>
|
|
380
425
|
${e}</blockquote>
|
|
381
|
-
`}html(e,t){return e}heading(e,t,
|
|
426
|
+
`}html(e,t){return e}heading(e,t,s){return`<h${t}>${e}</h${t}>
|
|
382
427
|
`}hr(){return`<hr>
|
|
383
|
-
`}list(e,t,
|
|
428
|
+
`}list(e,t,s){const r=t?"ol":"ul",i=t&&s!==1?' start="'+s+'"':"";return"<"+r+i+`>
|
|
384
429
|
`+e+"</"+r+`>
|
|
385
|
-
`}listitem(e,t,
|
|
430
|
+
`}listitem(e,t,s){return`<li>${e}</li>
|
|
386
431
|
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
|
|
387
432
|
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
388
433
|
<thead>
|
|
@@ -390,22 +435,22 @@ ${e}</blockquote>
|
|
|
390
435
|
`+t+`</table>
|
|
391
436
|
`}tablerow(e){return`<tr>
|
|
392
437
|
${e}</tr>
|
|
393
|
-
`}tablecell(e,t){const
|
|
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,
|
|
395
|
-
`+(l.tokens?this.parseInline(l.tokens):l.text);
|
|
396
|
-
Please report this to https://github.com/markedjs/marked.`,n){const
|
|
438
|
+
`}tablecell(e,t){const s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
|
|
439
|
+
`}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=uu(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=uu(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 Ll{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 It{constructor(e){$e(this,"options"),$e(this,"renderer"),$e(this,"textRenderer"),this.options=e||Pn,this.options.renderer=this.options.renderer||new $r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ll}static parse(e,t){return new It(t).parse(e)}static parseInline(e,t){return new It(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,Gp(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 W="";if(d.task){const le=this.renderer.checkbox(!!g);u?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=le+" "+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=le+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:le+" "}):W+=le+" "}W+=this.parse(d.tokens,u),c+=this.renderer.listitem(W,$,!!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+=`
|
|
440
|
+
`+(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 kr{constructor(e){$e(this,"options"),this.options=e||Pn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}$e(kr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ii,zl,Hl,_u;class wu{constructor(...e){za(this,Ii),za(this,Hl),$e(this,"defaults",Ol()),$e(this,"options",this.setOptions),$e(this,"parse",nl(this,Ii,zl).call(this,Et.lex,It.parse)),$e(this,"parseInline",nl(this,Ii,zl).call(this,Et.lexInline,It.parseInline)),$e(this,"Parser",It),$e(this,"Renderer",$r),$e(this,"TextRenderer",Ll),$e(this,"Lexer",Et),$e(this,"Tokenizer",Si),$e(this,"Hooks",kr),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 Si(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 kr;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];kr.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 Et.lex(e,t??this.defaults)}parser(e,t){return It.parse(e,t??this.defaults)}}Ii=new WeakSet,zl=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,Hl,_u).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)}}},Hl=new WeakSet,_u=function(n,e){return t=>{if(t.message+=`
|
|
441
|
+
Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An error occurred:</p><pre>"+it(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}};const Rn=new wu;function be(n,e){return Rn.parse(n,e)}be.options=be.setOptions=function(n){return Rn.setOptions(n),be.defaults=Rn.defaults,iu(be.defaults),be},be.getDefaults=Ol,be.defaults=Pn,be.use=function(...n){return Rn.use(...n),be.defaults=Rn.defaults,iu(be.defaults),be},be.walkTokens=function(n,e){return Rn.walkTokens(n,e)},be.parseInline=Rn.parseInline,be.Parser=It,be.parser=It.parse,be.Renderer=$r,be.TextRenderer=Ll,be.Lexer=Et,be.lexer=Et.lex,be.Tokenizer=Si,be.Hooks=kr,be.parse=be,be.options,be.setOptions,be.use,be.walkTokens,be.parseInline,It.parse,Et.lex;const Ul=new $r;Ul.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 Tf=new wu({renderer:Ul});function Cf(n){const e=Ef(n);return Tf.parse(e,{renderer:Ul})}function Vl(n){const e=Cf(n);return oe`
|
|
397
442
|
<div class="flex flex-col gap-3">
|
|
398
|
-
${
|
|
443
|
+
${Fp(e)}
|
|
399
444
|
</div>
|
|
400
|
-
`}function
|
|
445
|
+
`}function Ef(n){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return n.replace(/[&<>"']/g,t=>e[t])}var If=Object.defineProperty,Mf=Object.getOwnPropertyDescriptor,lt=(n,e,t,s)=>{for(var r=s>1?void 0:s?Mf(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&&If(e,t,r),r},xu=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},os=(n,e,t)=>(xu(n,e,"read from private field"),t?t.call(n):e.get(n)),$u=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},ku=(n,e,t,s)=>(xu(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),rn,Mi;let Xe=class extends nt{constructor(){super(),$u(this,rn,void 0),$u(this,Mi,Promise.resolve()),this.disableInput=!1,this.showTyping=!1,this.messages=[],this.inputValue="",this.internalDisableInput=!1,this.internalShowTyping=!1,this.showPopoverDisclaimer=!1,this.previousThreads=[],this._emitter=Bp(),this._emitter.on("*",(n,e)=>this.dispatchEvent(new CustomEvent(`iai-chat-${n.toString()}`,{bubbles:!0,composed:!0,detail:e})))}connectedCallback(){super.connectedCallback(),this.cleanOptions=ki.parse(this.options||{});const{assistantId:n,params:e,config:t}=this.cleanOptions;this.checkIfDisclaimerShouldBeShown(),ku(this,rn,new Up(n,{params:e,historyKey:t.historyKey,initialReplyMessage:t.initialReplyMessage,resetEndedChatOnLoad:t.resetEndedChatOnLoad})),this.updateMessages(os(this,rn).messages),this.showTyping=os(this,rn).isTyping,this.disableInput=os(this,rn).inputDisabled,this.chatManager.on("functionCall",({id:s,name:r,params:i})=>{const l=this.cleanOptions.handlers.functionCalls[r];if(!l){console.warn(`No function call handler found for ${r}`);return}l.call(this,{id:s,params:i,html:oe,chatWindow:this})}),this.chatManager.on("typing",s=>{this.showTyping=s}),this.chatManager.on("inputDisabled",s=>{this.disableInput=s}),this.chatManager.on("inactivityWarning",()=>{this.addMessage({role:"assistant",content:t.inactivityWarningMessage})}),this.chatManager.on("chatEnded",()=>{this.addMessage({role:"system",content:t.chatEndedMessage}),this.previousThreads.push([...this.messages]),this.chatManager.reset()}),this.chatManager.on("message",s=>{this.updateMessages([...this.messages,s])}),this.chatManager.on("messageRemoved",s=>{this.updateMessages(this.messages.filter(r=>r.id!==s))}),this.chatManager.on("reset",()=>{this.updateMessages([]),this.checkIfDisclaimerShouldBeShown()}),this.chatManager.on("*",this._emitter.emit)}disconnectedCallback(){super.disconnectedCallback(),this._emitter.all.clear(),os(this,rn).destroy()}firstUpdated(){this.focusOnInput()}updateMessages(n){this.messages=[...n],this.scrollChatToBottom()}render(){const{chatWindow:n,disclaimerMessage:e,disclaimerPopover:t}=this.cleanOptions.config,{header:s,showCloseButton:r}=n;return oe`
|
|
401
446
|
<div class="relative flex flex-col h-full rounded-lg shadow-lg bg-white text-black">
|
|
402
447
|
<div class="header rounded-t-lg text-lg p-2 flex justify-between items-center h-12">
|
|
403
448
|
<div class="flex flex-row h-full items-center">
|
|
404
|
-
${
|
|
405
|
-
<img src="${
|
|
449
|
+
${Qt(s.imageSrc,()=>oe`
|
|
450
|
+
<img src="${s.imageSrc}" alt="Logo" style="max-height: 100%" />
|
|
406
451
|
`)}
|
|
407
|
-
${
|
|
408
|
-
<span class="text-lg font-semibold ml-2">${
|
|
452
|
+
${Qt(s.text,()=>oe`
|
|
453
|
+
<span class="text-lg font-semibold ml-2">${s.text}</span>
|
|
409
454
|
`)}
|
|
410
455
|
</div>
|
|
411
456
|
|
|
@@ -415,20 +460,20 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
415
460
|
class="mr-2 h-6 w-6"
|
|
416
461
|
@click="${this.resetChat}"
|
|
417
462
|
>
|
|
418
|
-
${
|
|
463
|
+
${Th}
|
|
419
464
|
</button>
|
|
420
465
|
|
|
421
|
-
${
|
|
466
|
+
${Qt(r,()=>oe`
|
|
422
467
|
<button class="mr-2 h-6 w-6" @click="${this.closeChat}">
|
|
423
|
-
${
|
|
468
|
+
${Ch}
|
|
424
469
|
</button>
|
|
425
470
|
`)}
|
|
426
471
|
</div>
|
|
427
472
|
|
|
428
|
-
${
|
|
473
|
+
${Qt(this.showPopoverDisclaimer,()=>oe`
|
|
429
474
|
<div class="absolute top-12 left-0 right-0 bottom-0 bg-white z-10 flex flex-col gap-2 rounded-b-lg">
|
|
430
475
|
<div class="flex-grow overflow-y-auto pt-4 px-4 relative">
|
|
431
|
-
${
|
|
476
|
+
${Vl(t.message)}
|
|
432
477
|
|
|
433
478
|
<div class="sticky bottom-[-1px] left-0 right-0 h-12 bg-gradient-to-t from-white to-transparent"></div>
|
|
434
479
|
</div>
|
|
@@ -445,14 +490,13 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
445
490
|
`)}
|
|
446
491
|
|
|
447
492
|
<div id="chat-container" class="flex-1 overflow-y-auto p-4 flex flex-col gap-2">
|
|
448
|
-
${this.
|
|
493
|
+
${ml(this.previousThreads,(i,l)=>l,(i,l)=>oe`
|
|
494
|
+
${this.listMessages(i,`${l}`)}
|
|
449
495
|
|
|
450
|
-
|
|
451
|
-
<div>
|
|
452
|
-
${this.nameLabel(l)}
|
|
453
|
-
${this.chatMessage(s)}
|
|
454
|
-
</div>
|
|
496
|
+
${this.chatMessage({id:`chat-started-message-${l}`,role:"system",content:"Chat Started"})}
|
|
455
497
|
`)}
|
|
498
|
+
|
|
499
|
+
${this.listMessages(this.messages,"primary")}
|
|
456
500
|
</div>
|
|
457
501
|
|
|
458
502
|
<div class="px-4 pt-2 pb-2">
|
|
@@ -469,17 +513,18 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
469
513
|
rows="1"
|
|
470
514
|
placeholder="Type your message..."
|
|
471
515
|
autocomplete="off"
|
|
516
|
+
maxlength="500"
|
|
472
517
|
.disabled="${this.internalDisableInput||this.disableInput}"
|
|
473
518
|
.value="${this.inputValue}"
|
|
474
519
|
@input="${this.handleInput}"
|
|
475
|
-
@keydown="${
|
|
520
|
+
@keydown="${i=>this.handleKeyDown(i)}"
|
|
476
521
|
></textarea>
|
|
477
522
|
<button
|
|
478
523
|
type="submit"
|
|
479
524
|
class="button rounded-lg p-2 disabled:opacity-50 h-9 w-9"
|
|
480
525
|
.disabled="${this.isSubmitDisabled}"
|
|
481
526
|
>
|
|
482
|
-
${
|
|
527
|
+
${Sh}
|
|
483
528
|
</button>
|
|
484
529
|
</div>
|
|
485
530
|
</form>
|
|
@@ -489,19 +534,27 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
489
534
|
</p>
|
|
490
535
|
</div>
|
|
491
536
|
</div>
|
|
492
|
-
`}get isSubmitDisabled(){return!this.inputValue||this.internalDisableInput||this.disableInput}handleKeyDown(n){n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),!this.isSubmitDisabled&&this.sendUserMessage(n))}checkIfDisclaimerShouldBeShown(){const{config:n}=this.cleanOptions,e=localStorage.getItem(`iaiChatWindow-${n.historyKey}-acceptedDisclaimerTime`);this.showPopoverDisclaimer=!!(n.disclaimerPopover.message&&(!e||
|
|
493
|
-
|
|
494
|
-
|
|
537
|
+
`}get isSubmitDisabled(){return!this.inputValue||this.internalDisableInput||this.disableInput}handleKeyDown(n){n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),!this.isSubmitDisabled&&this.sendUserMessage(n))}checkIfDisclaimerShouldBeShown(){const{config:n}=this.cleanOptions,e=localStorage.getItem(`iaiChatWindow-${n.historyKey}-acceptedDisclaimerTime`);this.showPopoverDisclaimer=!!(n.disclaimerPopover.message&&(!e||ru().diff(e,"minutes")>=n.disclaimerPopover.rememberDurationMinutes))}acceptDisclaimer(){localStorage.setItem(`iaiChatWindow-${this.cleanOptions.config.historyKey}-acceptedDisclaimerTime`,ru().toISOString()),this.showPopoverDisclaimer=!1}handleInput(){const{inputElement:n,chatContainer:e}=this;if(!n||!e)return;this.inputValue=n.value;const{scrollTop:t,clientHeight:s,scrollHeight:r}=e,i=t+s>=r;n.style.height="auto",n.style.height=`${n.scrollHeight+2}px`,i&&this.scrollChatToBottom()}get chatManager(){return os(this,rn)}resetChat(){this.previousThreads=[],this.chatManager.reset("Manually reset by user")}addMessage(n){return this.chatManager.addMessage(n)}removeMessage(n){this.chatManager.removeMessage(n)}setInputDisabled(n=!0){this.chatManager.setInputDisabled(n)}setTypingIndicatorVisible(n=!0){this.chatManager.setTyping(n)}async sendFunctionCallResponse(n,e,t=!1){try{await this.chatManager.respondToFunctionCall(n,e,t)}catch(s){console.error("sendFunctionCallResponse error",s),this.addMessage({role:"assistant",content:"An unexpected error occurred. Please try again later."})}}async sendUserMessage(n){n.preventDefault(),!(this.internalDisableInput||this.disableInput)&&(this.internalDisableInput=!0,this.dispatchEvent(new CustomEvent("iai-chat-send-user-message",{bubbles:!0,composed:!0,detail:{message:this.inputValue},cancelable:!0}))&&(await os(this,Mi),ku(this,Mi,this.chatManager.sendUserMessage(this.inputValue))),this.inputValue="",this.inputElement&&(this.inputElement.style.height="auto"),this.internalDisableInput=!1,setTimeout(()=>{this.focusOnInput()},0))}focusOnInput(){var n;(n=this.inputElement)==null||n.focus()}scrollChatToBottom(){const{chatContainer:n}=this;n==null||n.scrollTo({top:n==null?void 0:n.scrollHeight,behavior:"smooth"})}listMessages(n,e=Math.random().toString(36).substring(7)){return oe`
|
|
538
|
+
${this.chatMessage({id:`intro-message-${e}`,role:"assistant",content:this.cleanOptions.config.welcomeMessage})}
|
|
539
|
+
|
|
540
|
+
${ml(n,t=>t.id,(t,s)=>oe`
|
|
541
|
+
<div>
|
|
542
|
+
${this.nameLabel(n,s)}
|
|
543
|
+
${this.chatMessage(t)}
|
|
544
|
+
</div>
|
|
545
|
+
`)}`}nameLabel(n,e){const t=n[e];if(t.role!=="assistant")return null;const s=t.name||"Assistant",r=n[e-1];return((r==null?void 0:r.name)||"Assistant")===s?null:oe`
|
|
546
|
+
<div class="name text-sm">${t.name||"Assistant"}</div>
|
|
547
|
+
`}chatMessage(n){switch(n.role){case"assistant":return oe`
|
|
495
548
|
<iai-chat-message-assistant
|
|
496
549
|
id="message-${n.id}"
|
|
497
550
|
.content="${n.content}"
|
|
498
551
|
></iai-chat-message-assistant>
|
|
499
|
-
`;case"user":return
|
|
552
|
+
`;case"user":return oe`
|
|
500
553
|
<iai-chat-message-user
|
|
501
554
|
id="message-${n.id}"
|
|
502
555
|
.content="${n.content}"
|
|
503
556
|
></iai-chat-message-user>
|
|
504
|
-
`;case"system":return
|
|
557
|
+
`;case"system":return oe`
|
|
505
558
|
<iai-chat-message-system
|
|
506
559
|
id="message-${n.id}"
|
|
507
560
|
.content="${n.content}"
|
|
@@ -509,7 +562,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
509
562
|
.contentHtmlTemplate="${n.contentHtmlTemplate}"
|
|
510
563
|
.options="${this.cleanOptions}"
|
|
511
564
|
></iai-chat-message-system>
|
|
512
|
-
`;default:return""}}closeChat(){this._emitter.emit("close")}};
|
|
565
|
+
`;default:return""}}closeChat(){this._emitter.emit("close")}};rn=new WeakMap,Mi=new WeakMap,Xe.styles=[St,Nt`
|
|
513
566
|
.header {
|
|
514
567
|
background-color: var(--iai-chat-i-header-bg);
|
|
515
568
|
color: var(--iai-chat-i-header-fg);
|
|
@@ -524,11 +577,11 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
524
577
|
.name {
|
|
525
578
|
color: #8c8c8c;
|
|
526
579
|
}
|
|
527
|
-
`],ot([Ce({type:Object})],tt.prototype,"options",2),ot([Ce()],tt.prototype,"disableInput",2),ot([Ce()],tt.prototype,"showTyping",2),ot([wn()],tt.prototype,"messages",2),ot([wn()],tt.prototype,"inputValue",2),ot([wn()],tt.prototype,"internalDisableInput",2),ot([wn()],tt.prototype,"internalShowTyping",2),ot([wn()],tt.prototype,"showPopoverDisclaimer",2),ot([ss("#chat-container")],tt.prototype,"chatContainer",2),ot([ss("#message-input")],tt.prototype,"inputElement",2),ot([_l.debounce(1)],tt.prototype,"scrollChatToBottom",1),tt=ot([Ot("iai-chat")],tt);var wu={exports:{}};(function(n){(function(e){if(typeof window>"u")return;var t=0,i=!1,r=!1,s="message",l=s.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(){we("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function W(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function le(_,M,se){_.addEventListener(M,se,!1)}function Ne(_,M,se){_.removeEventListener(M,se,!1)}function qe(){var _=["moz","webkit","o","ms"],M;for(M=0;M<_.length&&!c;M+=1)c=window[_[M]+"RequestAnimationFrame"];c?c=c.bind(window):U("setup","RequestAnimationFrame not supported")}function oe(_){var M="Host page: "+_;return window.top!==window.self&&(M=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+_:"Nested host page: "+_),M}function Ye(_){return a+"["+oe(_)+"]"}function Te(_){return d[_]?d[_].log:i}function U(_,M){Je("log",_,M,Te(_))}function nt(_,M){Je("info",_,M,Te(_))}function we(_,M){Je("warn",_,M,!0)}function Je(_,M,se,z){z===!0&&typeof window.console=="object"&&console[_](Ye(M),se)}function G(_){function M(){function D(){v(ge),b(Y),me("onResized",ge)}fe("Height"),fe("Width"),T(D,ge,"init")}function se(){var D=wt.slice(o).split(":"),te=D[1]?parseInt(D[1],10):0,_e=d[D[0]]&&d[D[0]].iframe,xe=getComputedStyle(_e);return{iframe:_e,id:D[0],height:te+z(xe)+ae(xe),width:D[2],type:D[3]}}function z(D){if(D.boxSizing!=="border-box")return 0;var te=D.paddingTop?parseInt(D.paddingTop,10):0,_e=D.paddingBottom?parseInt(D.paddingBottom,10):0;return te+_e}function ae(D){if(D.boxSizing!=="border-box")return 0;var te=D.borderTopWidth?parseInt(D.borderTopWidth,10):0,_e=D.borderBottomWidth?parseInt(D.borderBottomWidth,10):0;return te+_e}function fe(D){var te=Number(d[Y]["max"+D]),_e=Number(d[Y]["min"+D]),xe=D.toLowerCase(),Fe=Number(ge[xe]);U(Y,"Checking "+xe+" is in range "+_e+"-"+te),Fe<_e&&(Fe=_e,U(Y,"Set "+xe+" to min value")),Fe>te&&(Fe=te,U(Y,"Set "+xe+" to max value")),ge[xe]=""+Fe}function ut(){function D(){function xe(){var et=0,Lt=!1;for(U(Y,"Checking connection is from allowed list of origins: "+_e);et<_e.length;et++)if(_e[et]===te){Lt=!0;break}return Lt}function Fe(){var et=d[Y]&&d[Y].remoteHost;return U(Y,"Checking connection is from: "+et),te===et}return _e.constructor===Array?xe():Fe()}var te=_.origin,_e=d[Y]&&d[Y].checkOrigin;if(_e&&""+te!="null"&&!D())throw new Error("Unexpected message received from: "+te+" for "+ge.iframe.id+". Message was: "+_.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Zt(){return a===(""+wt).slice(0,o)&&wt.slice(o).split(":")[0]in d}function yt(){var D=ge.type in{true:1,false:1,undefined:1};return D&&U(Y,"Ignoring init message from meta parent page"),D}function vt(D){return wt.slice(wt.indexOf(":")+l+D)}function bt(D){U(Y,"onMessage passed: {iframe: "+ge.iframe.id+", message: "+D+"}"),me("onMessage",{iframe:ge.iframe,message:JSON.parse(D)}),U(Y,"--")}function Cr(){var D=document.body.getBoundingClientRect(),te=ge.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:te.height,iframeWidth:te.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(te.top-D.top,10),offsetLeft:parseInt(te.left-D.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function hi(D,te){function _e(){x("Send Page Info","pageInfo:"+Cr(),D,te)}Be(_e,32,te)}function Er(){function D(Fe,et){function Lt(){d[xe]?hi(d[xe].iframe,xe):te()}["scroll","resize"].forEach(function(Eu){U(xe,Fe+Eu+" listener for sendPageInfo"),et(window,Eu,Lt)})}function te(){D("Remove ",Ne)}function _e(){D("Add ",le)}var xe=Y;_e(),d[xe]&&(d[xe].stopPageInfo=te)}function pi(){d[Y]&&d[Y].stopPageInfo&&(d[Y].stopPageInfo(),delete d[Y].stopPageInfo)}function h(){var D=!0;return ge.iframe===null&&(we(Y,"IFrame ("+ge.id+") not found"),D=!1),D}function f(D){var te=D.getBoundingClientRect();return k(Y),{x:Math.floor(Number(te.left)+Number(u.x)),y:Math.floor(Number(te.top)+Number(u.y))}}function m(D){function te(){u=et,A(),U(Y,"--")}function _e(){return{x:Number(ge.width)+Fe.x,y:Number(ge.height)+Fe.y}}function xe(){window.parentIFrame?window.parentIFrame["scrollTo"+(D?"Offset":"")](et.x,et.y):we(Y,"Unable to scroll to requested position, window.parentIFrame not found")}var Fe=D?f(ge.iframe):{x:0,y:0},et=_e();U(Y,"Reposition requested from iFrame (offset x:"+Fe.x+" y:"+Fe.y+")"),window.top===window.self?te():xe()}function A(){me("onScroll",u)===!1?y():b(Y)}function j(D){function te(){var Lt=f(et);U(Y,"Moving to in page link (#"+xe+") at x: "+Lt.x+" y: "+Lt.y),u={x:Lt.x,y:Lt.y},A(),U(Y,"--")}function _e(){window.parentIFrame?window.parentIFrame.moveToAnchor(xe):U(Y,"In page link #"+xe+" not found and window.parentIFrame not found")}var xe=D.split("#")[1]||"",Fe=decodeURIComponent(xe),et=document.getElementById(Fe)||document.getElementsByName(Fe)[0];et?te():window.top===window.self?U(Y,"In page link #"+xe+" not found"):_e()}function H(D){var te={};if(Number(ge.width)===0&&Number(ge.height)===0){var _e=vt(9).split(":");te={x:_e[1],y:_e[0]}}else te={x:ge.width,y:ge.height};me(D,{iframe:ge.iframe,screenX:Number(te.x),screenY:Number(te.y),type:ge.type})}function me(D,te){return R(Y,D,te)}function Ie(){switch(d[Y]&&d[Y].firstRun&&Ir(),ge.type){case"close":{lt(ge.iframe);break}case"message":{bt(vt(6));break}case"mouseenter":{H("onMouseEnter");break}case"mouseleave":{H("onMouseLeave");break}case"autoResize":{d[Y].autoResize=JSON.parse(vt(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{hi(d[Y]&&d[Y].iframe,Y),Er();break}case"pageInfoStop":{pi();break}case"inPageLink":{j(vt(9));break}case"reset":{w(ge);break}case"init":{M(),me("onInit",ge.iframe);break}default:Number(ge.width)===0&&Number(ge.height)===0?we("Unsupported message received ("+ge.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):M()}}function Ue(D){var te=!0;return d[D]||(te=!1,we(ge.type+" No settings for "+D+". Message was: "+wt)),te}function _t(){for(var D in d)x("iFrame requested init",Z(D),d[D].iframe,D)}function Ir(){d[Y]&&(d[Y].firstRun=!1)}var wt=_.data,ge={},Y=null;wt==="[iFrameResizerChild]Ready"?_t():Zt()?(ge=se(),Y=ge.id,d[Y]&&(d[Y].loaded=!0),!yt()&&Ue(Y)&&(U(Y,"Received: "+wt),h()&&ut()&&Ie())):nt(Y,"Ignored: "+wt)}function R(_,M,se){var z=null,ae=null;if(d[_])if(z=d[_][M],typeof z=="function")ae=z(se);else throw new TypeError(M+" on iFrame["+_+"] is not a function");return ae}function He(_){var M=_.id;delete d[M]}function lt(_){var M=_.id;if(R(M,"onClose",M)===!1){U(M,"Close iframe cancelled by onClose event");return}U(M,"Removing iFrame: "+M);try{_.parentNode&&_.parentNode.removeChild(_)}catch(se){we(se)}R(M,"onClosed",M),U(M,"--"),He(_)}function k(_){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},U(_,"Get page position: "+u.x+","+u.y))}function b(_){u!==null&&(window.scrollTo(u.x,u.y),U(_,"Set page position: "+u.x+","+u.y),y())}function y(){u=null}function w(_){function M(){v(_),x("reset","reset",_.iframe,_.id)}U(_.id,"Size reset requested by "+(_.type==="init"?"host page":"iFrame")),k(_.id),T(M,_,"reset")}function v(_){function M(fe){if(!_.id){U("undefined","messageData id not set");return}_.iframe.style[fe]=_[fe]+"px",U(_.id,"IFrame ("+ae+") "+fe+" set to "+_[fe]+"px")}function se(fe){!r&&_[fe]==="0"&&(r=!0,U(ae,"Hidden iFrame detected, creating visibility listener"),Re())}function z(fe){M(fe),se(fe)}var ae=_.iframe.id;d[ae]&&(d[ae].sizeHeight&&z("height"),d[ae].sizeWidth&&z("width"))}function T(_,M,se){se!==M.type&&c&&!window.jasmine?(U(M.id,"Requesting animation frame"),c(_)):_()}function x(_,M,se,z,ae){function fe(){var bt=d[z]&&d[z].targetOrigin;U(z,"["+_+"] Sending msg to iframe["+z+"] ("+M+") targetOrigin: "+bt),se.contentWindow.postMessage(a+M,bt)}function ut(){we(z,"["+_+"] IFrame("+z+") not found")}function Zt(){se&&"contentWindow"in se&&se.contentWindow!==null?fe():ut()}function yt(){function bt(){d[z]&&!d[z].loaded&&!vt&&(vt=!0,we(z,"IFrame has not responded within "+d[z].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."))}ae&&d[z]&&d[z].warningTimeout&&(d[z].msgTimeout=setTimeout(bt,d[z].warningTimeout))}var vt=!1;z=z||se.id,d[z]&&(Zt(),yt())}function Z(_){return _+":"+d[_].bodyMarginV1+":"+d[_].sizeWidth+":"+d[_].log+":"+d[_].interval+":"+d[_].enablePublicMethods+":"+d[_].autoResize+":"+d[_].bodyMargin+":"+d[_].heightCalculationMethod+":"+d[_].bodyBackground+":"+d[_].bodyPadding+":"+d[_].tolerance+":"+d[_].inPageLinks+":"+d[_].resizeFrom+":"+d[_].widthCalculationMethod+":"+d[_].mouseEvents}function q(_){return typeof _=="number"}function Q(_,M){function se(){function m(j){var H=d[f][j];H!==1/0&&H!==0&&(_.style[j]=q(H)?H+"px":H,U(f,"Set "+j+" = "+_.style[j]))}function A(j){if(d[f]["min"+j]>d[f]["max"+j])throw new Error("Value for min"+j+" can not be greater than max"+j)}A("Height"),A("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function z(){var m=M&&M.id||$.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function ae(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(_.id=m=z(),i=(M||{}).log,U(m,"Added missing iframe ID: "+m+" ("+_.src+")")),m}function fe(){switch(U(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),_.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{_.scrolling="yes";break}case!1:{_.scrolling="no";break}default:_.scrolling=d[f]?d[f].scrolling:"no"}}function ut(){(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 Zt(){var m=d[f]&&d[f].firstRun,A=d[f]&&d[f].heightCalculationMethod in p;!m&&A&&w({iframe:_,height:0,width:0,type:"init"})}function yt(){d[f]&&(d[f].iframe.iFrameResizer={close:lt.bind(null,d[f].iframe),removeListeners:He.bind(null,d[f].iframe),resize:x.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){x("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),x("Send Message","message:"+m,d[f].iframe,f)}})}function vt(m){function A(){x("iFrame.onload",m,_,e,!0),Zt()}function j(me){if(_.parentNode){var Ie=new me(function(Ue){Ue.forEach(function(_t){var Ir=Array.prototype.slice.call(_t.removedNodes);Ir.forEach(function(wt){wt===_&<(_)})})});Ie.observe(_.parentNode,{childList:!0})}}var H=W();H&&j(H),le(_,"load",A),x("init",m,_,e,!0)}function bt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Cr(m){for(var A in $)Object.prototype.hasOwnProperty.call($,A)&&(d[f][A]=Object.prototype.hasOwnProperty.call(m,A)?m[A]:$[A])}function hi(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Er(m){var A=m.split("Callback");if(A.length===2){var j="on"+A[0].charAt(0).toUpperCase()+A[0].slice(1);this[j]=this[m],delete this[m],we(f,"Deprecated: '"+m+"' has been renamed '"+j+"'. The old method will be removed in the next major version.")}}function pi(m){m=m||{},d[f]=Object.create(null),d[f].iframe=_,d[f].firstRun=!0,d[f].remoteHost=_.src&&_.src.split("/").slice(0,3).join("/"),bt(m),Object.keys(m).forEach(Er,m),Cr(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?hi(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in _}var f=ae(_.id);h()?we(f,"Ignored iFrame, already setup."):(pi(M),fe(),se(),ut(),vt(Z(f)),yt())}function re(_,M){g===null&&(g=setTimeout(function(){g=null,_()},M))}var pe={};function Be(_,M,se){pe[se]||(pe[se]=setTimeout(function(){pe[se]=null,_()},M))}function Re(){function _(){function ae(fe){function ut(yt){return(d[fe]&&d[fe].iframe.style[yt])==="0px"}function Zt(yt){return yt.offsetParent!==null}d[fe]&&Zt(d[fe].iframe)&&(ut("height")||ut("width"))&&x("Visibility change","resize",d[fe].iframe,fe)}Object.keys(d).forEach(function(fe){ae(fe)})}function M(ae){U("window","Mutation observed: "+ae[0].target+" "+ae[0].type),re(_,16)}function se(){var ae=document.querySelector("body"),fe={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},ut=new z(M);ut.observe(ae,fe)}var z=W();z&&se()}function Xe(_){function M(){ce("Window "+_,"resize")}U("window","Trigger event: "+_),re(M,16)}function Pe(){function _(){ce("Tab Visible","resize")}document.visibilityState!=="hidden"&&(U("document","Trigger event: Visibility change"),re(_,16))}function ce(_,M){function se(z){return d[z]&&d[z].resizeFrom==="parent"&&d[z].autoResize&&!d[z].firstRun}Object.keys(d).forEach(function(z){se(z)&&x(_,M,d[z].iframe,z)})}function Ee(){le(window,"message",G),le(window,"resize",function(){Xe("resize")}),le(document,"visibilitychange",Pe),le(document,"-webkit-visibilitychange",Pe)}function Ve(){function _(z,ae){function fe(){if(ae.tagName){if(ae.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+ae.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}ae&&(fe(),Q(ae,z),se.push(ae))}function M(z){z&&z.enablePublicMethods&&we("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var se;return qe(),Ee(),function(z,ae){switch(se=[],M(z),typeof ae){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(ae||"iframe"),_.bind(e,z));break}case"object":{_(z,ae);break}default:throw new TypeError("Unexpected data type ("+typeof ae+")")}return se}}function at(_){_.fn?_.fn.iFrameResize||(_.fn.iFrameResize=function(M){function se(z,ae){Q(ae,M)}return this.filter("iframe").each(se).end()}):nt("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&at(window.jQuery),typeof e=="function"&&e.amd?e([],Ve):n.exports=Ve(),window.iFrameResize=window.iFrameResize||Ve()})()})(wu);var $f=wu.exports;const kf=Uo($f);var Af=Object.defineProperty,Sf=Object.getOwnPropertyDescriptor,Ll=(n,e,t,i)=>{for(var r=i>1?void 0:i?Sf(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&Af(e,t,r),r};let kr=class extends rt{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){kf({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 de`
|
|
580
|
+
`],lt([Se({type:Object})],Xe.prototype,"options",2),lt([Se()],Xe.prototype,"disableInput",2),lt([Se()],Xe.prototype,"showTyping",2),lt([Jt()],Xe.prototype,"messages",2),lt([Jt()],Xe.prototype,"inputValue",2),lt([Jt()],Xe.prototype,"internalDisableInput",2),lt([Jt()],Xe.prototype,"internalShowTyping",2),lt([Jt()],Xe.prototype,"showPopoverDisclaimer",2),lt([Jt()],Xe.prototype,"previousThreads",2),lt([li("#chat-container")],Xe.prototype,"chatContainer",2),lt([li("#message-input")],Xe.prototype,"inputElement",2),lt([kl.debounce(1)],Xe.prototype,"scrollChatToBottom",1),Xe=lt([At("iai-chat")],Xe);var Au={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(){we("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function W(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function le(_,O,ie){_.addEventListener(O,ie,!1)}function ze(_,O,ie){_.removeEventListener(O,ie,!1)}function Ke(){var _=["moz","webkit","o","ms"],O;for(O=0;O<_.length&&!c;O+=1)c=window[_[O]+"RequestAnimationFrame"];c?c=c.bind(window):U("setup","RequestAnimationFrame not supported")}function ue(_){var O="Host page: "+_;return window.top!==window.self&&(O=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+_:"Nested host page: "+_),O}function Ye(_){return a+"["+ue(_)+"]"}function Ce(_){return d[_]?d[_].log:s}function U(_,O){Ge("log",_,O,Ce(_))}function st(_,O){Ge("info",_,O,Ce(_))}function we(_,O){Ge("warn",_,O,!0)}function Ge(_,O,ie,z){z===!0&&typeof window.console=="object"&&console[_](Ye(O),ie)}function J(_){function O(){function D(){v(ge),b(Y),me("onResized",ge)}fe("Height"),fe("Width"),T(D,ge,"init")}function ie(){var D=wt.slice(o).split(":"),te=D[1]?parseInt(D[1],10):0,_e=d[D[0]]&&d[D[0]].iframe,xe=getComputedStyle(_e);return{iframe:_e,id:D[0],height:te+z(xe)+ae(xe),width:D[2],type:D[3]}}function z(D){if(D.boxSizing!=="border-box")return 0;var te=D.paddingTop?parseInt(D.paddingTop,10):0,_e=D.paddingBottom?parseInt(D.paddingBottom,10):0;return te+_e}function ae(D){if(D.boxSizing!=="border-box")return 0;var te=D.borderTopWidth?parseInt(D.borderTopWidth,10):0,_e=D.borderBottomWidth?parseInt(D.borderBottomWidth,10):0;return te+_e}function fe(D){var te=Number(d[Y]["max"+D]),_e=Number(d[Y]["min"+D]),xe=D.toLowerCase(),Fe=Number(ge[xe]);U(Y,"Checking "+xe+" is in range "+_e+"-"+te),Fe<_e&&(Fe=_e,U(Y,"Set "+xe+" to min value")),Fe>te&&(Fe=te,U(Y,"Set "+xe+" to max value")),ge[xe]=""+Fe}function ut(){function D(){function xe(){var tt=0,Lt=!1;for(U(Y,"Checking connection is from allowed list of origins: "+_e);tt<_e.length;tt++)if(_e[tt]===te){Lt=!0;break}return Lt}function Fe(){var tt=d[Y]&&d[Y].remoteHost;return U(Y,"Checking connection is from: "+tt),te===tt}return _e.constructor===Array?xe():Fe()}var te=_.origin,_e=d[Y]&&d[Y].checkOrigin;if(_e&&""+te!="null"&&!D())throw new Error("Unexpected message received from: "+te+" for "+ge.iframe.id+". Message was: "+_.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Zt(){return a===(""+wt).slice(0,o)&&wt.slice(o).split(":")[0]in d}function yt(){var D=ge.type in{true:1,false:1,undefined:1};return D&&U(Y,"Ignoring init message from meta parent page"),D}function vt(D){return wt.slice(wt.indexOf(":")+l+D)}function bt(D){U(Y,"onMessage passed: {iframe: "+ge.iframe.id+", message: "+D+"}"),me("onMessage",{iframe:ge.iframe,message:JSON.parse(D)}),U(Y,"--")}function Er(){var D=document.body.getBoundingClientRect(),te=ge.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:te.height,iframeWidth:te.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(te.top-D.top,10),offsetLeft:parseInt(te.left-D.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function ds(D,te){function _e(){x("Send Page Info","pageInfo:"+Er(),D,te)}Ve(_e,32,te)}function Ir(){function D(Fe,tt){function Lt(){d[xe]?ds(d[xe].iframe,xe):te()}["scroll","resize"].forEach(function(Ru){U(xe,Fe+Ru+" listener for sendPageInfo"),tt(window,Ru,Lt)})}function te(){D("Remove ",ze)}function _e(){D("Add ",le)}var xe=Y;_e(),d[xe]&&(d[xe].stopPageInfo=te)}function hs(){d[Y]&&d[Y].stopPageInfo&&(d[Y].stopPageInfo(),delete d[Y].stopPageInfo)}function h(){var D=!0;return ge.iframe===null&&(we(Y,"IFrame ("+ge.id+") not found"),D=!1),D}function f(D){var te=D.getBoundingClientRect();return k(Y),{x:Math.floor(Number(te.left)+Number(u.x)),y:Math.floor(Number(te.top)+Number(u.y))}}function m(D){function te(){u=tt,A(),U(Y,"--")}function _e(){return{x:Number(ge.width)+Fe.x,y:Number(ge.height)+Fe.y}}function xe(){window.parentIFrame?window.parentIFrame["scrollTo"+(D?"Offset":"")](tt.x,tt.y):we(Y,"Unable to scroll to requested position, window.parentIFrame not found")}var Fe=D?f(ge.iframe):{x:0,y:0},tt=_e();U(Y,"Reposition requested from iFrame (offset x:"+Fe.x+" y:"+Fe.y+")"),window.top===window.self?te():xe()}function A(){me("onScroll",u)===!1?y():b(Y)}function j(D){function te(){var Lt=f(tt);U(Y,"Moving to in page link (#"+xe+") at x: "+Lt.x+" y: "+Lt.y),u={x:Lt.x,y:Lt.y},A(),U(Y,"--")}function _e(){window.parentIFrame?window.parentIFrame.moveToAnchor(xe):U(Y,"In page link #"+xe+" not found and window.parentIFrame not found")}var xe=D.split("#")[1]||"",Fe=decodeURIComponent(xe),tt=document.getElementById(Fe)||document.getElementsByName(Fe)[0];tt?te():window.top===window.self?U(Y,"In page link #"+xe+" not found"):_e()}function H(D){var te={};if(Number(ge.width)===0&&Number(ge.height)===0){var _e=vt(9).split(":");te={x:_e[1],y:_e[0]}}else te={x:ge.width,y:ge.height};me(D,{iframe:ge.iframe,screenX:Number(te.x),screenY:Number(te.y),type:ge.type})}function me(D,te){return R(Y,D,te)}function Ie(){switch(d[Y]&&d[Y].firstRun&&Mr(),ge.type){case"close":{at(ge.iframe);break}case"message":{bt(vt(6));break}case"mouseenter":{H("onMouseEnter");break}case"mouseleave":{H("onMouseLeave");break}case"autoResize":{d[Y].autoResize=JSON.parse(vt(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{ds(d[Y]&&d[Y].iframe,Y),Ir();break}case"pageInfoStop":{hs();break}case"inPageLink":{j(vt(9));break}case"reset":{w(ge);break}case"init":{O(),me("onInit",ge.iframe);break}default:Number(ge.width)===0&&Number(ge.height)===0?we("Unsupported message received ("+ge.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):O()}}function Ue(D){var te=!0;return d[D]||(te=!1,we(ge.type+" No settings for "+D+". Message was: "+wt)),te}function _t(){for(var D in d)x("iFrame requested init",Z(D),d[D].iframe,D)}function Mr(){d[Y]&&(d[Y].firstRun=!1)}var wt=_.data,ge={},Y=null;wt==="[iFrameResizerChild]Ready"?_t():Zt()?(ge=ie(),Y=ge.id,d[Y]&&(d[Y].loaded=!0),!yt()&&Ue(Y)&&(U(Y,"Received: "+wt),h()&&ut()&&Ie())):st(Y,"Ignored: "+wt)}function R(_,O,ie){var z=null,ae=null;if(d[_])if(z=d[_][O],typeof z=="function")ae=z(ie);else throw new TypeError(O+" on iFrame["+_+"] is not a function");return ae}function He(_){var O=_.id;delete d[O]}function at(_){var O=_.id;if(R(O,"onClose",O)===!1){U(O,"Close iframe cancelled by onClose event");return}U(O,"Removing iFrame: "+O);try{_.parentNode&&_.parentNode.removeChild(_)}catch(ie){we(ie)}R(O,"onClosed",O),U(O,"--"),He(_)}function k(_){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},U(_,"Get page position: "+u.x+","+u.y))}function b(_){u!==null&&(window.scrollTo(u.x,u.y),U(_,"Set page position: "+u.x+","+u.y),y())}function y(){u=null}function w(_){function O(){v(_),x("reset","reset",_.iframe,_.id)}U(_.id,"Size reset requested by "+(_.type==="init"?"host page":"iFrame")),k(_.id),T(O,_,"reset")}function v(_){function O(fe){if(!_.id){U("undefined","messageData id not set");return}_.iframe.style[fe]=_[fe]+"px",U(_.id,"IFrame ("+ae+") "+fe+" set to "+_[fe]+"px")}function ie(fe){!r&&_[fe]==="0"&&(r=!0,U(ae,"Hidden iFrame detected, creating visibility listener"),Pe())}function z(fe){O(fe),ie(fe)}var ae=_.iframe.id;d[ae]&&(d[ae].sizeHeight&&z("height"),d[ae].sizeWidth&&z("width"))}function T(_,O,ie){ie!==O.type&&c&&!window.jasmine?(U(O.id,"Requesting animation frame"),c(_)):_()}function x(_,O,ie,z,ae){function fe(){var bt=d[z]&&d[z].targetOrigin;U(z,"["+_+"] Sending msg to iframe["+z+"] ("+O+") targetOrigin: "+bt),ie.contentWindow.postMessage(a+O,bt)}function ut(){we(z,"["+_+"] IFrame("+z+") not found")}function Zt(){ie&&"contentWindow"in ie&&ie.contentWindow!==null?fe():ut()}function yt(){function bt(){d[z]&&!d[z].loaded&&!vt&&(vt=!0,we(z,"IFrame has not responded within "+d[z].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."))}ae&&d[z]&&d[z].warningTimeout&&(d[z].msgTimeout=setTimeout(bt,d[z].warningTimeout))}var vt=!1;z=z||ie.id,d[z]&&(Zt(),yt())}function Z(_){return _+":"+d[_].bodyMarginV1+":"+d[_].sizeWidth+":"+d[_].log+":"+d[_].interval+":"+d[_].enablePublicMethods+":"+d[_].autoResize+":"+d[_].bodyMargin+":"+d[_].heightCalculationMethod+":"+d[_].bodyBackground+":"+d[_].bodyPadding+":"+d[_].tolerance+":"+d[_].inPageLinks+":"+d[_].resizeFrom+":"+d[_].widthCalculationMethod+":"+d[_].mouseEvents}function K(_){return typeof _=="number"}function Q(_,O){function ie(){function m(j){var H=d[f][j];H!==1/0&&H!==0&&(_.style[j]=K(H)?H+"px":H,U(f,"Set "+j+" = "+_.style[j]))}function A(j){if(d[f]["min"+j]>d[f]["max"+j])throw new Error("Value for min"+j+" can not be greater than max"+j)}A("Height"),A("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function z(){var m=O&&O.id||$.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function ae(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(_.id=m=z(),s=(O||{}).log,U(m,"Added missing iframe ID: "+m+" ("+_.src+")")),m}function fe(){switch(U(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),_.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{_.scrolling="yes";break}case!1:{_.scrolling="no";break}default:_.scrolling=d[f]?d[f].scrolling:"no"}}function ut(){(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 Zt(){var m=d[f]&&d[f].firstRun,A=d[f]&&d[f].heightCalculationMethod in p;!m&&A&&w({iframe:_,height:0,width:0,type:"init"})}function yt(){d[f]&&(d[f].iframe.iFrameResizer={close:at.bind(null,d[f].iframe),removeListeners:He.bind(null,d[f].iframe),resize:x.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){x("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),x("Send Message","message:"+m,d[f].iframe,f)}})}function vt(m){function A(){x("iFrame.onload",m,_,e,!0),Zt()}function j(me){if(_.parentNode){var Ie=new me(function(Ue){Ue.forEach(function(_t){var Mr=Array.prototype.slice.call(_t.removedNodes);Mr.forEach(function(wt){wt===_&&at(_)})})});Ie.observe(_.parentNode,{childList:!0})}}var H=W();H&&j(H),le(_,"load",A),x("init",m,_,e,!0)}function bt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Er(m){for(var A in $)Object.prototype.hasOwnProperty.call($,A)&&(d[f][A]=Object.prototype.hasOwnProperty.call(m,A)?m[A]:$[A])}function ds(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Ir(m){var A=m.split("Callback");if(A.length===2){var j="on"+A[0].charAt(0).toUpperCase()+A[0].slice(1);this[j]=this[m],delete this[m],we(f,"Deprecated: '"+m+"' has been renamed '"+j+"'. The old method will be removed in the next major version.")}}function hs(m){m=m||{},d[f]=Object.create(null),d[f].iframe=_,d[f].firstRun=!0,d[f].remoteHost=_.src&&_.src.split("/").slice(0,3).join("/"),bt(m),Object.keys(m).forEach(Ir,m),Er(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?ds(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in _}var f=ae(_.id);h()?we(f,"Ignored iFrame, already setup."):(hs(O),fe(),ie(),ut(),vt(Z(f)),yt())}function re(_,O){g===null&&(g=setTimeout(function(){g=null,_()},O))}var pe={};function Ve(_,O,ie){pe[ie]||(pe[ie]=setTimeout(function(){pe[ie]=null,_()},O))}function Pe(){function _(){function ae(fe){function ut(yt){return(d[fe]&&d[fe].iframe.style[yt])==="0px"}function Zt(yt){return yt.offsetParent!==null}d[fe]&&Zt(d[fe].iframe)&&(ut("height")||ut("width"))&&x("Visibility change","resize",d[fe].iframe,fe)}Object.keys(d).forEach(function(fe){ae(fe)})}function O(ae){U("window","Mutation observed: "+ae[0].target+" "+ae[0].type),re(_,16)}function ie(){var ae=document.querySelector("body"),fe={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},ut=new z(O);ut.observe(ae,fe)}var z=W();z&&ie()}function et(_){function O(){de("Window "+_,"resize")}U("window","Trigger event: "+_),re(O,16)}function Ne(){function _(){de("Tab Visible","resize")}document.visibilityState!=="hidden"&&(U("document","Trigger event: Visibility change"),re(_,16))}function de(_,O){function ie(z){return d[z]&&d[z].resizeFrom==="parent"&&d[z].autoResize&&!d[z].firstRun}Object.keys(d).forEach(function(z){ie(z)&&x(_,O,d[z].iframe,z)})}function Ee(){le(window,"message",J),le(window,"resize",function(){et("resize")}),le(document,"visibilitychange",Ne),le(document,"-webkit-visibilitychange",Ne)}function Be(){function _(z,ae){function fe(){if(ae.tagName){if(ae.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+ae.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}ae&&(fe(),Q(ae,z),ie.push(ae))}function O(z){z&&z.enablePublicMethods&&we("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var ie;return Ke(),Ee(),function(z,ae){switch(ie=[],O(z),typeof ae){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(ae||"iframe"),_.bind(e,z));break}case"object":{_(z,ae);break}default:throw new TypeError("Unexpected data type ("+typeof ae+")")}return ie}}function ot(_){_.fn?_.fn.iFrameResize||(_.fn.iFrameResize=function(O){function ie(z,ae){Q(ae,O)}return this.filter("iframe").each(ie).end()}):st("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&ot(window.jQuery),typeof e=="function"&&e.amd?e([],Be):n.exports=Be(),window.iFrameResize=window.iFrameResize||Be()})()})(Au);var Of=Au.exports;const Nf=Wo(Of);var Pf=Object.defineProperty,Rf=Object.getOwnPropertyDescriptor,Bl=(n,e,t,s)=>{for(var r=s>1?void 0:s?Rf(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&&Pf(e,t,r),r};let Ar=class extends nt{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){Nf({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 oe`
|
|
528
581
|
<div class="relative">
|
|
529
|
-
${
|
|
582
|
+
${Qt(this.showCloseButton,()=>oe`
|
|
530
583
|
<button class="absolute top-0 right-0 m-2 h-6 text-white focus:outline-none" @click="${this.close}">
|
|
531
|
-
${
|
|
584
|
+
${bl}
|
|
532
585
|
</button>
|
|
533
586
|
`)}
|
|
534
587
|
|
|
@@ -538,21 +591,21 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
538
591
|
@load=${this.onLoad}
|
|
539
592
|
></iframe>
|
|
540
593
|
</div>
|
|
541
|
-
`}};
|
|
594
|
+
`}};Ar.styles=[St],Bl([Se({type:String})],Ar.prototype,"src",2),Bl([Se({type:Boolean})],Ar.prototype,"showCloseButton",2),Ar=Bl([At("iai-chat-iframe")],Ar);var Df=Object.defineProperty,jf=Object.getOwnPropertyDescriptor,us=(n,e,t,s)=>{for(var r=s>1?void 0:s?jf(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&&Df(e,t,r),r};let ln=class extends nt{constructor(){super(...arguments),this.title="",this.src="",this.width="500px",this.height=null,this.showHeader=!0}async connectedCallback(){super.connectedCallback()}close(){this.dispatchEvent(new CustomEvent("close"))}render(){const n=er({width:this.width,height:this.height});return oe`
|
|
542
595
|
<div class="fixed inset-0 z-50 bg-black bg-opacity-50 flex justify-center items-center">
|
|
543
596
|
<div
|
|
544
597
|
class="flex flex-col rounded-lg shadow-lg bg-white mx-auto my-auto max-h-[90vh] max-w-[90vw] overflow-hidden"
|
|
545
598
|
style=${n}
|
|
546
599
|
part="modal"
|
|
547
600
|
>
|
|
548
|
-
${
|
|
601
|
+
${Qt(this.showHeader,()=>oe`
|
|
549
602
|
<div class="header text-lg p-2 flex justify-between items-center">
|
|
550
603
|
<div class="flex flex-row h-full items-center">
|
|
551
604
|
<span class="text-lg font-semibold ml-2">${this.title}</span>
|
|
552
605
|
</div>
|
|
553
606
|
|
|
554
607
|
<button class="mr-2 h-6 text-white focus:outline-none" @click="${this.close}">
|
|
555
|
-
${
|
|
608
|
+
${bl}
|
|
556
609
|
</button>
|
|
557
610
|
</div>
|
|
558
611
|
`)}
|
|
@@ -566,79 +619,67 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
566
619
|
</div>
|
|
567
620
|
</div>
|
|
568
621
|
</div>
|
|
569
|
-
`}};
|
|
622
|
+
`}};ln.styles=[St,Nt`
|
|
570
623
|
.header {
|
|
571
624
|
background-color: var(--iai-chat-i-iframe-modal-header-bg);
|
|
572
625
|
color: var(--iai-chat-i-iframe-modal-header-fg);
|
|
573
626
|
height: 50px;
|
|
574
627
|
}
|
|
575
|
-
`],
|
|
628
|
+
`],us([Se({type:String})],ln.prototype,"title",2),us([Se({type:String})],ln.prototype,"src",2),us([Se({type:String})],ln.prototype,"width",2),us([Se({type:String})],ln.prototype,"height",2),us([Se({type:Boolean})],ln.prototype,"showHeader",2),ln=us([At("iai-chat-iframe-modal")],ln);var Zf=Object.defineProperty,Lf=Object.getOwnPropertyDescriptor,Su=(n,e,t,s)=>{for(var r=s>1?void 0:s?Lf(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&&Zf(e,t,r),r};let Oi=class extends nt{constructor(){super(...arguments),this.content=""}render(){return oe`
|
|
576
629
|
<div class="flex items-end mr-20">
|
|
577
630
|
<div class="message rounded-lg px-4 py-2">
|
|
578
|
-
${
|
|
631
|
+
${Vl(this.content)}
|
|
579
632
|
</div>
|
|
580
633
|
</div>
|
|
581
|
-
`}};
|
|
634
|
+
`}};Oi.styles=[St,Nt`
|
|
582
635
|
.message {
|
|
583
636
|
background-color: var(--iai-chat-i-message-assistant-bg);
|
|
584
637
|
color: var(--iai-chat-i-message-assistant-fg);
|
|
585
638
|
}
|
|
586
|
-
`],
|
|
639
|
+
`],Su([Se({type:String})],Oi.prototype,"content",2),Oi=Su([At("iai-chat-message-assistant")],Oi);async function zf(n,e){const{type:t,params:s}=n,r=e[t];if(!r)throw new Error(`No handler for enhanced content type ${t}`);return r({params:s,html:oe})}var Hf=Object.defineProperty,Uf=Object.getOwnPropertyDescriptor,Sr=(n,e,t,s)=>{for(var r=s>1?void 0:s?Uf(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&&Hf(e,t,r),r};let Dn=class extends nt{constructor(){super(...arguments),this.content=""}async connectedCallback(){if(super.connectedCallback(),this.enhancedContent)try{this.contentHtmlTemplate=await zf(this.enhancedContent,this.options.handlers.enhancedContent)}catch(n){console.warn("Error processing enhanced content",n)}this.contentHtmlTemplate||(this.contentHtmlTemplate=oe`
|
|
587
640
|
<div class="text-center text-gray-400 text-sm">
|
|
588
|
-
${
|
|
641
|
+
${Vl(this.content)}
|
|
589
642
|
</div>
|
|
590
|
-
`)}render(){return
|
|
643
|
+
`)}render(){return oe`
|
|
591
644
|
<div>
|
|
592
645
|
${this.contentHtmlTemplate}
|
|
593
646
|
</div>
|
|
594
|
-
`}};
|
|
647
|
+
`}};Dn.styles=[St],Sr([Se({type:Object})],Dn.prototype,"options",2),Sr([Se({type:String})],Dn.prototype,"content",2),Sr([Se({type:Object})],Dn.prototype,"enhancedContent",2),Sr([Se()],Dn.prototype,"contentHtmlTemplate",2),Dn=Sr([At("iai-chat-message-system")],Dn);var Vf=Object.defineProperty,Bf=Object.getOwnPropertyDescriptor,Tu=(n,e,t,s)=>{for(var r=s>1?void 0:s?Bf(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&&Vf(e,t,r),r};let Ni=class extends nt{constructor(){super(...arguments),this.content=""}render(){return oe`
|
|
595
648
|
<div class="flex items-end justify-end ml-20">
|
|
596
649
|
<div class="message rounded-lg px-4 py-2 flex gap-2">
|
|
597
650
|
<p class="whitespace-pre-wrap">${this.content}</p>
|
|
598
651
|
</div>
|
|
599
652
|
</div>
|
|
600
|
-
`}};
|
|
653
|
+
`}};Ni.styles=[St,Nt`
|
|
601
654
|
.message {
|
|
602
655
|
background-color: var(--iai-chat-i-message-user-bg);
|
|
603
656
|
color: var(--iai-chat-i-message-user-fg);
|
|
604
657
|
}
|
|
605
|
-
`]
|
|
606
|
-
<
|
|
607
|
-
${
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
<span>${i}</span>
|
|
615
|
-
|
|
616
|
-
<div
|
|
617
|
-
class="absolute bottom-0 mx-4 mb-[-8px] w-0 h-0 border-x-8 border-t-8 border-x-transparent border-white"
|
|
618
|
-
style=${En({[r]:0})}
|
|
619
|
-
/>
|
|
658
|
+
`],Tu([Se({type:String})],Ni.prototype,"content",2),Ni=Tu([At("iai-chat-message-user")],Ni);var Ff=Object.defineProperty,Wf=Object.getOwnPropertyDescriptor,Cu=(n,e,t,s)=>{for(var r=s>1?void 0:s?Wf(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&&Ff(e,t,r),r};let Pi=class extends nt{render(){const{openChatButton:{width:n,height:e,imageSrc:t}}=this.options.config,s=er({width:n,height:e});return oe`
|
|
659
|
+
<button @click="${this.toggleChat}">
|
|
660
|
+
${Qt(t,()=>oe`
|
|
661
|
+
<img src="${t}" alt="Chat Icon" style=${s}/>
|
|
662
|
+
`,()=>oe`
|
|
663
|
+
<div class="button rounded-full flex items-center justify-center" style=${s}>
|
|
664
|
+
<div class="h-3/5 w-3/5">
|
|
665
|
+
${Ah}
|
|
620
666
|
</div>
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
</div>
|
|
630
|
-
`)}
|
|
631
|
-
</button>
|
|
632
|
-
</div>
|
|
633
|
-
`}toggleChat(){this.dispatchEvent(new CustomEvent("toggle-chat"))}};ci.styles=[Nt,fn`
|
|
667
|
+
</div>
|
|
668
|
+
`)}
|
|
669
|
+
</button>
|
|
670
|
+
`}toggleChat(){this.dispatchEvent(new CustomEvent("toggle-chat"))}};Pi.styles=[St,Nt`
|
|
671
|
+
:host {
|
|
672
|
+
display: inline-block;
|
|
673
|
+
}
|
|
674
|
+
|
|
634
675
|
.button {
|
|
635
676
|
background-color: var(--iai-chat-i-ocb-bg);
|
|
636
677
|
color: var(--iai-chat-i-ocb-fg);
|
|
637
678
|
}
|
|
638
|
-
`],
|
|
679
|
+
`],Cu([Se({type:Object})],Pi.prototype,"options",2),Pi=Cu([At("iai-chat-open-chat-button")],Pi);function qf(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Eu(n,e=""){return Object.keys(n).reduce((t,s)=>{const r=qf(s),i=e?`${e}-${r}`:r;return typeof n[s]=="object"&&n[s]!==null?Object.assign(t,Eu(n[s],i)):t[i]=n[s],t},{})}class Kf{constructor(e){this.widget=null,this.options=ki.parse(e);const t=document.createElement("iai-chat-popup");t.options=this.options;const s=Eu(this.options.config.styles);Object.entries(s).filter(([,r])=>r).forEach(([r,i])=>{t.style.setProperty(`--iai-chat-${r}`,i)}),document.body.appendChild(t),this.widget=t}get api(){if(!this.widget)throw new Error("Widget has not been initialized");return this.widget}destroy(){var e;(e=this.widget)==null||e.remove(),this.widget=null}}function Yf({html:n,params:e}){return n`
|
|
639
680
|
<div>
|
|
640
681
|
<iai-chat-carousel>
|
|
641
|
-
${e.units.map(t=>{const
|
|
682
|
+
${e.units.map(t=>{const s=t.floorPlanImage!=="Data not available"?n`<img src="${t.floorPlanImage}" alt="">`:"";return n`
|
|
642
683
|
<div>
|
|
643
684
|
<h2>Unit ${t.unitName}</h2>
|
|
644
685
|
<ul>
|
|
@@ -646,21 +687,21 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
646
687
|
<li>Bathrooms: ${t.bathroomCount}</li>
|
|
647
688
|
<li>SQFT: ${t.squareFeet}</li>
|
|
648
689
|
<li>Rent: $${t.pricing.rent}/mo for a ${t.pricing.term} Month Lease</li>
|
|
649
|
-
${
|
|
690
|
+
${s}
|
|
650
691
|
</ul>
|
|
651
692
|
</div>
|
|
652
693
|
`})}
|
|
653
694
|
</iai-chat-carousel>
|
|
654
695
|
</div>
|
|
655
|
-
`}var Au={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(qr,function(){var t=1e3,i=6e4,r=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",$="date",W="Invalid Date",le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Ne=/\[([^\]]+)]|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,qe={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(k){var b=["th","st","nd","rd"],y=k%100;return"["+k+(b[(y-20)%10]||b[y]||b[0])+"]"}},oe=function(k,b,y){var w=String(k);return!w||w.length>=b?k:""+Array(b+1-w.length).join(y)+k},Ye={s:oe,z:function(k){var b=-k.utcOffset(),y=Math.abs(b),w=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+oe(w,2,"0")+":"+oe(v,2,"0")},m:function k(b,y){if(b.date()<y.date())return-k(y,b);var w=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(w,p),T=y-v<0,x=b.clone().add(w+(T?-1:1),p);return+(-(w+(y-v)/(T?v-x:x-v))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:p,y:g,w:c,d:u,D:$,h:o,m:a,s:l,ms:s,Q:d}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},Te="en",U={};U[Te]=qe;var nt="$isDayjsObject",we=function(k){return k instanceof He||!(!k||!k[nt])},Je=function k(b,y,w){var v;if(!b)return Te;if(typeof b=="string"){var T=b.toLowerCase();U[T]&&(v=T),y&&(U[T]=y,v=T);var x=b.split("-");if(!v&&x.length>1)return k(x[0])}else{var Z=b.name;U[Z]=b,v=Z}return!w&&v&&(Te=v),v||!w&&Te},G=function(k,b){if(we(k))return k.clone();var y=typeof b=="object"?b:{};return y.date=k,y.args=arguments,new He(y)},R=Ye;R.l=Je,R.i=we,R.w=function(k,b){return G(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var He=function(){function k(y){this.$L=Je(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[nt]=!0}var b=k.prototype;return b.parse=function(y){this.$d=function(w){var v=w.date,T=w.utc;if(v===null)return new Date(NaN);if(R.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var x=v.match(le);if(x){var Z=x[2]-1||0,q=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,q)):new Date(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,q)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return R},b.isValid=function(){return this.$d.toString()!==W},b.isSame=function(y,w){var v=G(y);return this.startOf(w)<=v&&v<=this.endOf(w)},b.isAfter=function(y,w){return G(y)<this.startOf(w)},b.isBefore=function(y,w){return this.endOf(w)<G(y)},b.$g=function(y,w,v){return R.u(y)?this[w]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,w){var v=this,T=!!R.u(w)||w,x=R.p(y),Z=function(Pe,ce){var Ee=R.w(v.$u?Date.UTC(v.$y,ce,Pe):new Date(v.$y,ce,Pe),v);return T?Ee:Ee.endOf(u)},q=function(Pe,ce){return R.w(v.toDate()[Pe].apply(v.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ce)),v)},Q=this.$W,re=this.$M,pe=this.$D,Be="set"+(this.$u?"UTC":"");switch(x){case g:return T?Z(1,0):Z(31,11);case p:return T?Z(1,re):Z(0,re+1);case c:var Re=this.$locale().weekStart||0,Xe=(Q<Re?Q+7:Q)-Re;return Z(T?pe-Xe:pe+(6-Xe),re);case u:case $:return q(Be+"Hours",0);case o:return q(Be+"Minutes",1);case a:return q(Be+"Seconds",2);case l:return q(Be+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,w){var v,T=R.p(y),x="set"+(this.$u?"UTC":""),Z=(v={},v[u]=x+"Date",v[$]=x+"Date",v[p]=x+"Month",v[g]=x+"FullYear",v[o]=x+"Hours",v[a]=x+"Minutes",v[l]=x+"Seconds",v[s]=x+"Milliseconds",v)[T],q=T===u?this.$D+(w-this.$W):w;if(T===p||T===g){var Q=this.clone().set($,1);Q.$d[Z](q),Q.init(),this.$d=Q.set($,Math.min(this.$D,Q.daysInMonth())).$d}else Z&&this.$d[Z](q);return this.init(),this},b.set=function(y,w){return this.clone().$set(y,w)},b.get=function(y){return this[R.p(y)]()},b.add=function(y,w){var v,T=this;y=Number(y);var x=R.p(w),Z=function(re){var pe=G(T);return R.w(pe.date(pe.date()+Math.round(re*y)),T)};if(x===p)return this.set(p,this.$M+y);if(x===g)return this.set(g,this.$y+y);if(x===u)return Z(1);if(x===c)return Z(7);var q=(v={},v[a]=i,v[o]=r,v[l]=t,v)[x]||1,Q=this.$d.getTime()+y*q;return R.w(Q,this)},b.subtract=function(y,w){return this.add(-1*y,w)},b.format=function(y){var w=this,v=this.$locale();if(!this.isValid())return v.invalidDate||W;var T=y||"YYYY-MM-DDTHH:mm:ssZ",x=R.z(this),Z=this.$H,q=this.$m,Q=this.$M,re=v.weekdays,pe=v.months,Be=v.meridiem,Re=function(ce,Ee,Ve,at){return ce&&(ce[Ee]||ce(w,T))||Ve[Ee].slice(0,at)},Xe=function(ce){return R.s(Z%12||12,ce,"0")},Pe=Be||function(ce,Ee,Ve){var at=ce<12?"AM":"PM";return Ve?at.toLowerCase():at};return T.replace(Ne,function(ce,Ee){return Ee||function(Ve){switch(Ve){case"YY":return String(w.$y).slice(-2);case"YYYY":return R.s(w.$y,4,"0");case"M":return Q+1;case"MM":return R.s(Q+1,2,"0");case"MMM":return Re(v.monthsShort,Q,pe,3);case"MMMM":return Re(pe,Q);case"D":return w.$D;case"DD":return R.s(w.$D,2,"0");case"d":return String(w.$W);case"dd":return Re(v.weekdaysMin,w.$W,re,2);case"ddd":return Re(v.weekdaysShort,w.$W,re,3);case"dddd":return re[w.$W];case"H":return String(Z);case"HH":return R.s(Z,2,"0");case"h":return Xe(1);case"hh":return Xe(2);case"a":return Pe(Z,q,!0);case"A":return Pe(Z,q,!1);case"m":return String(q);case"mm":return R.s(q,2,"0");case"s":return String(w.$s);case"ss":return R.s(w.$s,2,"0");case"SSS":return R.s(w.$ms,3,"0");case"Z":return x}return null}(ce)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,w,v){var T,x=this,Z=R.p(w),q=G(y),Q=(q.utcOffset()-this.utcOffset())*i,re=this-q,pe=function(){return R.m(x,q)};switch(Z){case g:T=pe()/12;break;case p:T=pe();break;case d:T=pe()/3;break;case c:T=(re-Q)/6048e5;break;case u:T=(re-Q)/864e5;break;case o:T=re/r;break;case a:T=re/i;break;case l:T=re/t;break;default:T=re}return v?T:R.a(T)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,w){if(!y)return this.$L;var v=this.clone(),T=Je(y,w,!0);return T&&(v.$L=T),v},b.clone=function(){return R.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),lt=He.prototype;return G.prototype=lt,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",$]].forEach(function(k){lt[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),G.extend=function(k,b){return k.$i||(k(b,He,G),k.$i=!0),G},G.locale=Je,G.isDayjs=we,G.unix=function(k){return G(1e3*k)},G.en=U[Te],G.Ls=U,G.p={},G})})(Au);var Hf=Au.exports;const Uf=$d(Hf);function Bf(n){return async function({id:t,params:i,chatWindow:r}){r.setInputDisabled(!0);const s=r.chatManager.registerRecurringKeepAlive(),l={...i.guestCardId&&{guestCardId:i.guestCardId},...i.customerFirstName&&{firstName:i.customerFirstName},...i.customerLastName&&{lastName:i.customerLastName},...i.customerEmail&&{email:i.customerEmail},...i.customerPhoneNumber&&{phone:i.customerPhoneNumber},...i.desiredMoveInDate&&{moveInDate:Uf(i.desiredMoveInDate).format("MM/DD/YYYY")}},a=document.createElement("iai-chat-iframe-modal");a.title="Schedule a Tour",a.src=`${n}?${new URLSearchParams(l).toString()}`,a.showHeader=!1;const o=()=>{s(),a.remove(),window.removeEventListener("beforeunload",p),r.removeEventListener("iai-chat-reset",o),r.setInputDisabled(!1)},u=async({detail:d})=>{if(d.type!=="tourScheduled")return;const{tourType:g,tourDate:$,tourTime:W,guestCardId:le}=d;o(),r.addMessage({role:"system",content:"Your tour has been scheduled!"}),await r.sendFunctionCallResponse(t,{status:"scheduled",tourType:g,tourDate:$,tourTime:W,guestCardId:le},!0)},c=async()=>{o(),r.addMessage({role:"system",content:"Tour Scheduler Closed"}),await r.sendFunctionCallResponse(t,{status:"canceled"},!0)},p=async()=>{o(),r.addMessage({role:"system",content:"Tour Scheduler Closed"})};a.addEventListener("message-received",u),a.addEventListener("close",c),r.addEventListener("iai-chat-reset",o),window.addEventListener("beforeunload",p),document.body.appendChild(a),r.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const di="https://api.ai.inhabit.services";async function Vf(n,e={}){const t=await fetch(`${di}/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 Ff(n,e="No reason provided"){const t=await fetch(`${di}/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 Wf(n,e){const t=await fetch(`${di}/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 Kf(n,e,t,i=!1){const r=await fetch(`${di}/threads/${n}/functions/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({params:t,rerunLLM:i})});if(!r.ok)throw new Error(`Failed to respond to function call: ${r.statusText} (${r.status})`);return r.json()}async function qf(n){const e=await fetch(`${di}/threads/${n}/ping`,{method:"POST"});if(!e.ok)throw new Error(`Failed to ping thread: ${e.statusText} (${e.status})`)}const Yf=Object.freeze(Object.defineProperty({__proto__:null,baseUrl:di,createThread:Vf,endThread:Ff,pingThread:qf,respondToFunctionCall:Kf,sendUserMessage:Wf},Symbol.toStringTag,{value:"Module"}));function Su(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(r){r(t)}),(i=n.get("*"))&&i.slice().map(function(r){r(e,t)})}}}class Jf{constructor(e){this.chatWsUrl=e,this._emitter=Su(),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 i=JSON.parse(t.data);this._emitter.emit(i.type,i.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 Ps;(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={}))})(Ps||(Ps={}));const Gf=Ps.AcknowledgeType,Qf="Anyone Home",Xf="IB Chat Leasing";let em="https://five9.ah.inhabit.services";const tm="https://five9.ah.inhabit.services".replace("http","ws").replace(/\/$/,""),Tr=class Tr{constructor(){zl(this,jt,void 0);zl(this,Zn,void 0);this._emitter=Su(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),rn(this,jt,null),rn(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),i=new Tr;return t.sessionToken&&i.setSession(t.sessionToken),t.conversationId&&i.setConversationId(t.conversationId),i.conversationStarted=t.conversationStarted||!1,i}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Tr.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Qf})});return rn(this,jt,await e.json()),Ds(this,jt)}setSession(e){rn(this,jt,e)}setConversationId(e){rn(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 Jf(`${tm}/conversations/${this.conversationId}/ws`);e.on("*",(t,i)=>{this._emitter.emit(t,i)}),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:Gf.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:i}=this;if(!i)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const r=i.metadata.dataCenters[0].apiUrls[0].host,s=await fetch(`${Tr.generateBaseUrl(r)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:i.tokenId,farmId:i.context.farmId}});return s.status===204?null:s.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(s=>{const l=s;t[l]||delete t[l]});const i={...e,campaignName:Xf,tenantId:this.tenantId,callbackUrl:em};console.log("body",i);const r=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(i)});return this.setConversationId(r.id),r}async sendMessage(e){const{conversationId:t,conversationStarted:i}=this;if(!t||!i)throw new Error("Conversation not started");const r={messageType:Ps.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(),rn(this,jt,null),rn(this,Zn,null)}get sessionToken(){return Ds(this,jt)}get conversationId(){return Ds(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}};jt=new WeakMap,Zn=new WeakMap;let Rs=Tr;const{baseUrl:nm}=Yf;function Sr(n){return`any-${n||"main"}-chatSession`}async function im({id:n,params:e,chatWindow:t,html:i}){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},le=await fetch(`${nm}/anyone-home/newGuestCard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)}),{guestCardId:Ne}=await le.json();e.guestCardId=Ne},s=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 Rs;await c.createSession();const{summary:p,subject:d,guestCardId:g,firstName:$,lastName:W,phoneNumber:le,email:Ne}=e;await c.createConversation({contact:{firstName:$,lastName:W,number1:le,email:Ne},attributes:{"Chat.gc_id":g,Question:d,"AI Summary":p}}),localStorage.setItem(Sr(t.cleanOptions.config.historyKey),c.serialize()),Tu(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:i`
|
|
696
|
+
`}var Iu={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(Yr,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",le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ze=/\[([^\]]+)]|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,Ke={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(k){var b=["th","st","nd","rd"],y=k%100;return"["+k+(b[(y-20)%10]||b[y]||b[0])+"]"}},ue=function(k,b,y){var w=String(k);return!w||w.length>=b?k:""+Array(b+1-w.length).join(y)+k},Ye={s:ue,z:function(k){var b=-k.utcOffset(),y=Math.abs(b),w=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+ue(w,2,"0")+":"+ue(v,2,"0")},m:function k(b,y){if(b.date()<y.date())return-k(y,b);var w=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(w,p),T=y-v<0,x=b.clone().add(w+(T?-1:1),p);return+(-(w+(y-v)/(T?v-x:x-v))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:p,y:g,w:c,d:u,D:$,h:o,m:a,s:l,ms:i,Q:d}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},Ce="en",U={};U[Ce]=Ke;var st="$isDayjsObject",we=function(k){return k instanceof He||!(!k||!k[st])},Ge=function k(b,y,w){var v;if(!b)return Ce;if(typeof b=="string"){var T=b.toLowerCase();U[T]&&(v=T),y&&(U[T]=y,v=T);var x=b.split("-");if(!v&&x.length>1)return k(x[0])}else{var Z=b.name;U[Z]=b,v=Z}return!w&&v&&(Ce=v),v||!w&&Ce},J=function(k,b){if(we(k))return k.clone();var y=typeof b=="object"?b:{};return y.date=k,y.args=arguments,new He(y)},R=Ye;R.l=Ge,R.i=we,R.w=function(k,b){return J(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var He=function(){function k(y){this.$L=Ge(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[st]=!0}var b=k.prototype;return b.parse=function(y){this.$d=function(w){var v=w.date,T=w.utc;if(v===null)return new Date(NaN);if(R.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var x=v.match(le);if(x){var Z=x[2]-1||0,K=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,K)):new Date(x[1],Z,x[3]||1,x[4]||0,x[5]||0,x[6]||0,K)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return R},b.isValid=function(){return this.$d.toString()!==W},b.isSame=function(y,w){var v=J(y);return this.startOf(w)<=v&&v<=this.endOf(w)},b.isAfter=function(y,w){return J(y)<this.startOf(w)},b.isBefore=function(y,w){return this.endOf(w)<J(y)},b.$g=function(y,w,v){return R.u(y)?this[w]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,w){var v=this,T=!!R.u(w)||w,x=R.p(y),Z=function(Ne,de){var Ee=R.w(v.$u?Date.UTC(v.$y,de,Ne):new Date(v.$y,de,Ne),v);return T?Ee:Ee.endOf(u)},K=function(Ne,de){return R.w(v.toDate()[Ne].apply(v.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(de)),v)},Q=this.$W,re=this.$M,pe=this.$D,Ve="set"+(this.$u?"UTC":"");switch(x){case g:return T?Z(1,0):Z(31,11);case p:return T?Z(1,re):Z(0,re+1);case c:var Pe=this.$locale().weekStart||0,et=(Q<Pe?Q+7:Q)-Pe;return Z(T?pe-et:pe+(6-et),re);case u:case $:return K(Ve+"Hours",0);case o:return K(Ve+"Minutes",1);case a:return K(Ve+"Seconds",2);case l:return K(Ve+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,w){var v,T=R.p(y),x="set"+(this.$u?"UTC":""),Z=(v={},v[u]=x+"Date",v[$]=x+"Date",v[p]=x+"Month",v[g]=x+"FullYear",v[o]=x+"Hours",v[a]=x+"Minutes",v[l]=x+"Seconds",v[i]=x+"Milliseconds",v)[T],K=T===u?this.$D+(w-this.$W):w;if(T===p||T===g){var Q=this.clone().set($,1);Q.$d[Z](K),Q.init(),this.$d=Q.set($,Math.min(this.$D,Q.daysInMonth())).$d}else Z&&this.$d[Z](K);return this.init(),this},b.set=function(y,w){return this.clone().$set(y,w)},b.get=function(y){return this[R.p(y)]()},b.add=function(y,w){var v,T=this;y=Number(y);var x=R.p(w),Z=function(re){var pe=J(T);return R.w(pe.date(pe.date()+Math.round(re*y)),T)};if(x===p)return this.set(p,this.$M+y);if(x===g)return this.set(g,this.$y+y);if(x===u)return Z(1);if(x===c)return Z(7);var K=(v={},v[a]=s,v[o]=r,v[l]=t,v)[x]||1,Q=this.$d.getTime()+y*K;return R.w(Q,this)},b.subtract=function(y,w){return this.add(-1*y,w)},b.format=function(y){var w=this,v=this.$locale();if(!this.isValid())return v.invalidDate||W;var T=y||"YYYY-MM-DDTHH:mm:ssZ",x=R.z(this),Z=this.$H,K=this.$m,Q=this.$M,re=v.weekdays,pe=v.months,Ve=v.meridiem,Pe=function(de,Ee,Be,ot){return de&&(de[Ee]||de(w,T))||Be[Ee].slice(0,ot)},et=function(de){return R.s(Z%12||12,de,"0")},Ne=Ve||function(de,Ee,Be){var ot=de<12?"AM":"PM";return Be?ot.toLowerCase():ot};return T.replace(ze,function(de,Ee){return Ee||function(Be){switch(Be){case"YY":return String(w.$y).slice(-2);case"YYYY":return R.s(w.$y,4,"0");case"M":return Q+1;case"MM":return R.s(Q+1,2,"0");case"MMM":return Pe(v.monthsShort,Q,pe,3);case"MMMM":return Pe(pe,Q);case"D":return w.$D;case"DD":return R.s(w.$D,2,"0");case"d":return String(w.$W);case"dd":return Pe(v.weekdaysMin,w.$W,re,2);case"ddd":return Pe(v.weekdaysShort,w.$W,re,3);case"dddd":return re[w.$W];case"H":return String(Z);case"HH":return R.s(Z,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return Ne(Z,K,!0);case"A":return Ne(Z,K,!1);case"m":return String(K);case"mm":return R.s(K,2,"0");case"s":return String(w.$s);case"ss":return R.s(w.$s,2,"0");case"SSS":return R.s(w.$ms,3,"0");case"Z":return x}return null}(de)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,w,v){var T,x=this,Z=R.p(w),K=J(y),Q=(K.utcOffset()-this.utcOffset())*s,re=this-K,pe=function(){return R.m(x,K)};switch(Z){case g:T=pe()/12;break;case p:T=pe();break;case d:T=pe()/3;break;case c:T=(re-Q)/6048e5;break;case u:T=(re-Q)/864e5;break;case o:T=re/r;break;case a:T=re/s;break;case l:T=re/t;break;default:T=re}return v?T:R.a(T)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,w){if(!y)return this.$L;var v=this.clone(),T=Ge(y,w,!0);return T&&(v.$L=T),v},b.clone=function(){return R.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),at=He.prototype;return J.prototype=at,[["$ms",i],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",$]].forEach(function(k){at[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),J.extend=function(k,b){return k.$i||(k(b,He,J),k.$i=!0),J},J.locale=Ge,J.isDayjs=we,J.unix=function(k){return J(1e3*k)},J.en=U[Ce],J.Ls=U,J.p={},J})})(Iu);var Gf=Iu.exports;const Jf=Cd(Gf);function Qf(n){return async function({id:t,params:s,chatWindow:r}){r.setInputDisabled(!0);const i=r.chatManager.registerRecurringKeepAlive(),l={...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:Jf(s.desiredMoveInDate).format("MM/DD/YYYY")}},a=document.createElement("iai-chat-iframe-modal");a.title="Schedule a Tour",a.src=`${n}?${new URLSearchParams(l).toString()}`,a.showHeader=!1;const o=()=>{i(),a.remove(),window.removeEventListener("beforeunload",p),r.removeEventListener("iai-chat-reset",o),r.setInputDisabled(!1)},u=async({detail:d})=>{if(d.type!=="tourScheduled")return;const{tourType:g,tourDate:$,tourTime:W,guestCardId:le}=d;o(),r.setInputDisabled(!0),r.addMessage({role:"system",content:"Your tour has been scheduled!"});try{await r.sendFunctionCallResponse(t,{status:"scheduled",tourType:g,tourDate:$,tourTime:W,guestCardId:le},!0)}finally{r.setInputDisabled(!1)}},c=async()=>{o(),r.setInputDisabled(!0),r.addMessage({role:"system",content:"Tour Scheduler Closed"});try{await r.sendFunctionCallResponse(t,{status:"canceled"},!0)}finally{r.setInputDisabled(!1)}},p=async()=>{o(),r.addMessage({role:"system",content:"Tour Scheduler Closed"})};a.addEventListener("message-received",u),a.addEventListener("close",c),r.addEventListener("iai-chat-reset",o),window.addEventListener("beforeunload",p),document.body.appendChild(a),r.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const Mu="https://api.ai.inhabit.services",cs={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const t={...e,headers:{"Content-Type":"application/json",...e.headers}};n=n.replace(/^\//,"");const s=await fetch(`${Mu}/${n}`,t);if(!s.ok){if(s.status===429){const r=+(s.headers.get("Retry-After")||30);throw new Fl(`Rate limited fetching ${n}: retry after ${r} seconds`,s.status,{retryAfter:r})}throw new Fl(`Failed to fetch ${n}: ${s.statusText} (${s.status})`,s.status)}return s.json()}};async function Xf(n,e={}){return cs.post("/threads",{assistantId:n,params:e})}async function em(n,e="No reason provided"){await cs.post(`/threads/${n}/end`,{reason:e})}async function tm(n,e){return cs.post(`/threads/${n}/messages`,{content:e})}async function nm(n,e,t,s=!1){return cs.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:s})}async function sm(n){return cs.post(`/threads/${n}/ping`)}class Fl extends Error{constructor(e,t,s){super(e),this.status=t,this.details=s}}const rm=Object.freeze(Object.defineProperty({__proto__:null,APIError:Fl,baseApi:cs,baseUrl:Mu,createThread:Xf,endThread:em,pingThread:sm,respondToFunctionCall:nm,sendUserMessage:tm},Symbol.toStringTag,{value:"Module"}));function Ou(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 im{constructor(e){this.chatWsUrl=e,this._emitter=Ou(),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 Ri;(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={}))})(Ri||(Ri={}));const lm=Ri.AcknowledgeType,am="Anyone Home",om="IB Chat Leasing";let um="https://five9.ah.inhabit.services";const cm="https://five9.ah.inhabit.services".replace("http","ws").replace(/\/$/,""),Cr=class Cr{constructor(){Wl(this,jt,void 0);Wl(this,jn,void 0);this._emitter=Ou(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),an(this,jt,null),an(this,jn,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 Cr;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(`${Cr.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:am})});return an(this,jt,await e.json()),ji(this,jt)}setSession(e){an(this,jt,e)}setConversationId(e){an(this,jn,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 im(`${cm}/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:lm.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(`${Cr.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:om,tenantId:this.tenantId,callbackUrl:um};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:Ri.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(),an(this,jt,null),an(this,jn,null)}get sessionToken(){return ji(this,jt)}get conversationId(){return ji(this,jn)}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}};jt=new WeakMap,jn=new WeakMap;let Di=Cr;const{baseApi:dm}=rm;function Tr(n){return`any-${n||"main"}-chatSession`}async function hm({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},{guestCardId:le}=await dm.post("/anyone-home/newGuestCard",W);e.guestCardId=le},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 Di;await c.createSession();const{summary:p,subject:d,guestCardId:g,firstName:$,lastName:W,phoneNumber:le,email:ze}=e;await c.createConversation({contact:{firstName:$,lastName:W,number1:le,email:ze},attributes:{"Chat.gc_id":g,Question:d,"AI Summary":p}}),localStorage.setItem(Tr(t.cleanOptions.config.historyKey),c.serialize()),Nu(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
697
|
<any-contact-form
|
|
657
698
|
.params=${e}
|
|
658
699
|
@submit=${c}
|
|
659
|
-
@cancel=${
|
|
700
|
+
@cancel=${i}
|
|
660
701
|
></any-contact-form>
|
|
661
|
-
`})};t.addMessage({id:"transferMessageId",role:"system",contentHtmlTemplate:
|
|
702
|
+
`})};t.addMessage({id:"transferMessageId",role:"system",contentHtmlTemplate:s`
|
|
662
703
|
<any-transfer-confirmation
|
|
663
704
|
@transfer=${l}
|
|
664
|
-
@cancel=${
|
|
705
|
+
@cancel=${i}
|
|
665
706
|
></any-transfer-confirmation>
|
|
666
|
-
`})}function
|
|
707
|
+
`})}function Nu(n,e){e.on("*",(l,a)=>{console.log("event:",l,a)}),e.on("conversationCreated",()=>{n.setInputDisabled(!1),localStorage.setItem(Tr(n.cleanOptions.config.historyKey),e.serialize())}),e.on("conversationAccepted",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTyping",()=>{n.setTypingIndicatorVisible(!0)}),e.on("agentJoined",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTransferredConversation",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.toDisplayName}`})}),e.on("conversationTransferredToGroup",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.groupName}`})}),e.on("agentLeftConversation",l=>{n.addMessage({role:"system",content:`${l.displayName} has left the chat`})}),e.on("conversationTerminated",l=>{n.addMessage({role:"system",content:"The chat has ended"}),n.setInputDisabled(!0),localStorage.removeItem(Tr(n.cleanOptions.config.historyKey))}),e.on("message",l=>{switch(l.from){case"SYSTEM":n.addMessage({role:"system",content:l.text});break;case"USER":n.setTypingIndicatorVisible(!1),n.addMessage({role:"assistant",name:l.displayName,content:l.text});break;default:console.log("unhandled message:",l);break}}),e.connect();const t=async l=>{l.preventDefault(),n.addMessage({role:"user",content:l.detail.message}),await e.sendMessage(l.detail.message)},s=async()=>{e.destroy(),n.removeEventListener("iai-chat-send-user-message",t),n.removeEventListener("iai-chat-reset",i),n.removeEventListener("iai-chat-destroy",s)},r=n.cleanOptions.config.disclaimerMessage,i=async()=>{await e.terminateConversation(),await s(),localStorage.removeItem(Tr(n.cleanOptions.config.historyKey)),n.cleanOptions.config.disclaimerMessage=r};n.cleanOptions.config.disclaimerMessage="",n.addEventListener("iai-chat-send-user-message",t),n.addEventListener("iai-chat-reset",i),n.addEventListener("iai-chat-destroy",s)}class pm{constructor(e,t){const s=ki.parse({assistantId:"657acbb4-d23e-487f-9090-4ac9a237b474",...e,config:{...e.config,styles:e.styles||{}}});s.handlers.functionCalls.transferToLiveAgent=hm,s.handlers.functionCalls.showScheduleTourWidget=Qf(t.schedulerUrl),s.handlers.enhancedContent.unitList=Yf,this.chatWidget=new Kf(s);const r=localStorage.getItem(Tr(s.config.historyKey));if(r){const i=Di.deserialize(r);setTimeout(()=>{Nu(this.chatWidget.api.chatWindow,i)},0)}}destroy(){this.chatWidget.destroy()}}Me.AnyChatWidget=pm,Object.defineProperty(Me,Symbol.toStringTag,{value:"Module"})});
|