voxnix 1.0.0 → 1.0.1
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/README.md +54 -70
- package/dist/voxnix.js +1 -1
- package/dist/voxnix.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Voxnix
|
|
1
|
+
# Voxnix
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A React Component SDK for seamless Voice PABX Integration.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Voxnix is a ready-to-use SDK designed to quickly integrate voice and PABX calling features into your React applications. It provides a self-contained dialer UI and automatically handles voice engine connectivity.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -16,86 +16,70 @@ yarn add voxnix
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Embed the widget using an iframe in your React parent application. The communication protocol uses `window.postMessage`.
|
|
19
|
+
You can use the `Voxnix` component directly in your React application. Pass the required PABX configuration credentials through the `config` prop and use the event callbacks to listen for call states.
|
|
22
20
|
|
|
23
21
|
```jsx
|
|
24
|
-
import React, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (event.data?.type === 'sync_incoming_call') {
|
|
52
|
-
console.log('Incoming call notification');
|
|
53
|
-
}
|
|
54
|
-
if (event.data?.type === 'sync_call_answered') {
|
|
55
|
-
console.log('Call answered');
|
|
56
|
-
}
|
|
57
|
-
if (event.data?.type === 'sync_call_ended') {
|
|
58
|
-
console.log('Call ended');
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
window.addEventListener('message', handleMessage);
|
|
63
|
-
return () => window.removeEventListener('message', handleMessage);
|
|
64
|
-
}, []);
|
|
22
|
+
import React, { useState } from 'react';
|
|
23
|
+
import { Voxnix } from 'voxnix';
|
|
24
|
+
|
|
25
|
+
const App = () => {
|
|
26
|
+
const pabxConfig = {
|
|
27
|
+
auth: {
|
|
28
|
+
username: "YOUR_USERNAME",
|
|
29
|
+
password: "YOUR_PASSWORD",
|
|
30
|
+
host: "YOUR_PABX_HOST" // e.g., sip.example.com
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleIncomingCall = (callData) => {
|
|
35
|
+
console.log('Incoming call notification:', callData);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleCallAnswered = () => {
|
|
39
|
+
console.log('Call has been answered');
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleCallEnded = () => {
|
|
43
|
+
console.log('Call has ended');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleRegisterStatus = (status) => {
|
|
47
|
+
console.log('PABX Registration Status:', status); // "REGISTERED" | "FAILED"
|
|
48
|
+
};
|
|
65
49
|
|
|
66
50
|
return (
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
51
|
+
<div style={{ padding: '20px' }}>
|
|
52
|
+
<h1>Voice Integration App</h1>
|
|
53
|
+
|
|
54
|
+
{/* Voxnix Voice Engine & UI Component */}
|
|
55
|
+
<Voxnix
|
|
56
|
+
config={pabxConfig}
|
|
57
|
+
onIncomingCall={handleIncomingCall}
|
|
58
|
+
onCallAnswered={handleCallAnswered}
|
|
59
|
+
onCallEnded={handleCallEnded}
|
|
60
|
+
onRegisterStatus={handleRegisterStatus}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
73
63
|
);
|
|
74
64
|
};
|
|
75
65
|
|
|
76
|
-
export default
|
|
66
|
+
export default App;
|
|
77
67
|
```
|
|
78
68
|
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
- **Sip.js**
|
|
82
|
-
- **Yeastar**
|
|
83
|
-
- **Flashphoner**
|
|
84
|
-
|
|
85
|
-
## Message Events Protocol
|
|
86
|
-
|
|
87
|
-
### Parent -> Widget
|
|
88
|
-
- `init_config`: Sent from parent to widget. Contains credentials (`tenantName`, `platform`, `pabxConfig: { auth: { username, password, host } }`).
|
|
69
|
+
## Component Props
|
|
89
70
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
| Prop | Type | Description |
|
|
72
|
+
|------|------|-------------|
|
|
73
|
+
| `config` | `Object` | Configuration object containing `auth` credentials (`username`, `password`, `host`). |
|
|
74
|
+
| `onIncomingCall` | `Function` | Callback triggered when there is an incoming call. |
|
|
75
|
+
| `onCallAnswered` | `Function` | Callback triggered when the call is answered. |
|
|
76
|
+
| `onCallEnded` | `Function` | Callback triggered when the call ends. |
|
|
77
|
+
| `onCallUnanswered` | `Function` | Callback triggered when an incoming call is not answered. |
|
|
78
|
+
| `onRegisterStatus` | `Function` | Callback triggered when the PABX registration status changes. |
|
|
95
79
|
|
|
96
80
|
## Development
|
|
97
81
|
|
|
98
|
-
To
|
|
82
|
+
To run the project locally for development:
|
|
99
83
|
|
|
100
84
|
```bash
|
|
101
85
|
yarn install
|
package/dist/voxnix.js
CHANGED
|
@@ -17480,5 +17480,5 @@ function zh({ config: s, onIncomingCall: e, onCallAnswered: t, onCallEnded: r, o
|
|
|
17480
17480
|
return !!((g.username || g.user_pbx) && (g.pwd_pbx || g.secret)) || d != null && d.accessToken ? null : /* @__PURE__ */ qe.jsx("div", { className: "fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4", children: /* @__PURE__ */ qe.jsx(Gh, { onSubmit: l }) });
|
|
17481
17481
|
}
|
|
17482
17482
|
export {
|
|
17483
|
-
zh as
|
|
17483
|
+
zh as Voxnix
|
|
17484
17484
|
};
|
package/dist/voxnix.umd.cjs
CHANGED
|
@@ -99,4 +99,4 @@ var Ca;function L(){return Ca.apply(null,arguments)}function M0(s){Ca=s}function
|
|
|
99
99
|
[`+n+"] ";for(a in arguments[0])ce(arguments[0],a)&&(i+=a+": "+arguments[0][a]+", ");i=i.slice(0,-2)}else i=arguments[n];r.push(i)}ba(s+`
|
|
100
100
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
101
101
|
`+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Aa={};function Ta(s,e){L.deprecationHandler!=null&&L.deprecationHandler(s,e),Aa[s]||(ba(e),Aa[s]=!0)}L.suppressDeprecationWarnings=!1,L.deprecationHandler=null;function xt(s){return typeof Function<"u"&&s instanceof Function||Object.prototype.toString.call(s)==="[object Function]"}function q0(s){var e,t;for(t in s)ce(s,t)&&(e=s[t],xt(e)?this[t]=e:this["_"+t]=e);this._config=s,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Pi(s,e){var t=Ut({},s),r;for(r in e)ce(e,r)&&(ir(s[r])&&ir(e[r])?(t[r]={},Ut(t[r],s[r]),Ut(t[r],e[r])):e[r]!=null?t[r]=e[r]:delete t[r]);for(r in s)ce(s,r)&&!ce(e,r)&&ir(s[r])&&(t[r]=Ut({},t[r]));return t}function Oi(s){s!=null&&this.set(s)}var Mi;Object.keys?Mi=Object.keys:Mi=function(s){var e,t=[];for(e in s)ce(s,e)&&t.push(e);return t};var U0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function L0(s,e,t){var r=this._calendar[s]||this._calendar.sameElse;return xt(r)?r.call(e,t):r}function pt(s,e,t){var r=""+Math.abs(s),i=e-r.length,n=s>=0;return(n?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Ni=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ds=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qi={},pr={};function G(s,e,t,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),s&&(pr[s]=i),e&&(pr[e[0]]=function(){return pt(i.apply(this,arguments),e[1],e[2])}),t&&(pr[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),s)})}function j0(s){return s.match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"")}function Y0(s){var e=s.match(Ni),t,r;for(t=0,r=e.length;t<r;t++)pr[e[t]]?e[t]=pr[e[t]]:e[t]=j0(e[t]);return function(i){var n="",a;for(a=0;a<r;a++)n+=xt(e[a])?e[a].call(i,s):e[a];return n}}function ls(s,e){return s.isValid()?(e=Sa(e,s.localeData()),qi[e]=qi[e]||Y0(e),qi[e](s)):s.localeData().invalidDate()}function Sa(s,e){var t=5;function r(i){return e.longDateFormat(i)||i}for(ds.lastIndex=0;t>=0&&ds.test(s);)s=s.replace(ds,r),ds.lastIndex=0,t-=1;return s}var W0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V0(s){var e=this._longDateFormat[s],t=this._longDateFormat[s.toUpperCase()];return e||!t?e:(this._longDateFormat[s]=t.match(Ni).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[s])}var G0="Invalid date";function z0(){return this._invalidDate}var K0="%d",Z0=/\d{1,2}/;function J0(s){return this._ordinal.replace("%d",s)}var X0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q0(s,e,t,r){var i=this._relativeTime[t];return xt(i)?i(s,e,t,r):i.replace(/%d/i,s)}function ec(s,e){var t=this._relativeTime[s>0?"future":"past"];return xt(t)?t(e):t.replace(/%s/i,e)}var Ra={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Qe(s){return typeof s=="string"?Ra[s]||Ra[s.toLowerCase()]:void 0}function Ui(s){var e={},t,r;for(r in s)ce(s,r)&&(t=Qe(r),t&&(e[t]=s[r]));return e}var tc={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function rc(s){var e=[],t;for(t in s)ce(s,t)&&e.push({unit:t,priority:tc[t]});return e.sort(function(r,i){return r.priority-i.priority}),e}var Fa=/\d/,ze=/\d\d/,Ba=/\d{3}/,Li=/\d{4}/,hs=/[+-]?\d{6}/,ve=/\d\d?/,ka=/\d\d\d\d?/,Ia=/\d\d\d\d\d\d?/,us=/\d{1,3}/,ji=/\d{1,4}/,fs=/[+-]?\d{1,6}/,mr=/\d+/,gs=/[+-]?\d+/,sc=/Z|[+-]\d\d:?\d\d/gi,xs=/Z|[+-]\d\d(?::?\d\d)?/gi,ic=/[+-]?\d+(\.\d{1,3})?/,Mr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,vr=/^[1-9]\d?/,Yi=/^([1-9]\d|\d)/,ps;ps={};function W(s,e,t){ps[s]=xt(e)?e:function(r,i){return r&&t?t:e}}function nc(s,e){return ce(ps,s)?ps[s](e._strict,e._locale):new RegExp(ac(s))}function ac(s){return _t(s.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,i,n){return t||r||i||n}))}function _t(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(s){return s<0?Math.ceil(s)||0:Math.floor(s)}function ee(s){var e=+s,t=0;return e!==0&&isFinite(e)&&(t=et(e)),t}var Wi={};function xe(s,e){var t,r=e,i;for(typeof s=="string"&&(s=[s]),Ct(e)&&(r=function(n,a){a[e]=ee(n)}),i=s.length,t=0;t<i;t++)Wi[s[t]]=r}function Nr(s,e){xe(s,function(t,r,i,n){i._w=i._w||{},e(t,i._w,i,n)})}function oc(s,e,t){e!=null&&ce(Wi,s)&&Wi[s](e,t._a,t,s)}function ms(s){return s%4===0&&s%100!==0||s%400===0}var He=0,Dt=1,mt=2,Te=3,at=4,bt=5,nr=6,cc=7,dc=8;G("Y",0,0,function(){var s=this.year();return s<=9999?pt(s,4):"+"+s}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),W("Y",gs),W("YY",ve,ze),W("YYYY",ji,Li),W("YYYYY",fs,hs),W("YYYYYY",fs,hs),xe(["YYYYY","YYYYYY"],He),xe("YYYY",function(s,e){e[He]=s.length===2?L.parseTwoDigitYear(s):ee(s)}),xe("YY",function(s,e){e[He]=L.parseTwoDigitYear(s)}),xe("Y",function(s,e){e[He]=parseInt(s,10)});function qr(s){return ms(s)?366:365}L.parseTwoDigitYear=function(s){return ee(s)+(ee(s)>68?1900:2e3)};var $a=Er("FullYear",!0);function lc(){return ms(this.year())}function Er(s,e){return function(t){return t!=null?(Ha(this,s,t),L.updateOffset(this,e),this):Ur(this,s)}}function Ur(s,e){if(!s.isValid())return NaN;var t=s._d,r=s._isUTC;switch(e){case"Milliseconds":return r?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return r?t.getUTCSeconds():t.getSeconds();case"Minutes":return r?t.getUTCMinutes():t.getMinutes();case"Hours":return r?t.getUTCHours():t.getHours();case"Date":return r?t.getUTCDate():t.getDate();case"Day":return r?t.getUTCDay():t.getDay();case"Month":return r?t.getUTCMonth():t.getMonth();case"FullYear":return r?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Ha(s,e,t){var r,i,n,a,o;if(!(!s.isValid()||isNaN(t))){switch(r=s._d,i=s._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(t):r.setMilliseconds(t));case"Seconds":return void(i?r.setUTCSeconds(t):r.setSeconds(t));case"Minutes":return void(i?r.setUTCMinutes(t):r.setMinutes(t));case"Hours":return void(i?r.setUTCHours(t):r.setHours(t));case"Date":return void(i?r.setUTCDate(t):r.setDate(t));case"FullYear":break;default:return}n=t,a=s.month(),o=s.date(),o=o===29&&a===1&&!ms(n)?28:o,i?r.setUTCFullYear(n,a,o):r.setFullYear(n,a,o)}}function hc(s){return s=Qe(s),xt(this[s])?this[s]():this}function uc(s,e){if(typeof s=="object"){s=Ui(s);var t=rc(s),r,i=t.length;for(r=0;r<i;r++)this[t[r].unit](s[t[r].unit])}else if(s=Qe(s),xt(this[s]))return this[s](e);return this}function fc(s,e){return(s%e+e)%e}var Ce;Array.prototype.indexOf?Ce=Array.prototype.indexOf:Ce=function(s){var e;for(e=0;e<this.length;++e)if(this[e]===s)return e;return-1};function Vi(s,e){if(isNaN(s)||isNaN(e))return NaN;var t=fc(e,12);return s+=(e-t)/12,t===1?ms(s)?29:28:31-t%7%2}G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(s){return this.localeData().monthsShort(this,s)}),G("MMMM",0,0,function(s){return this.localeData().months(this,s)}),W("M",ve,vr),W("MM",ve,ze),W("MMM",function(s,e){return e.monthsShortRegex(s)}),W("MMMM",function(s,e){return e.monthsRegex(s)}),xe(["M","MM"],function(s,e){e[Dt]=ee(s)-1}),xe(["MMM","MMMM"],function(s,e,t,r){var i=t._locale.monthsParse(s,r,t._strict);i!=null?e[Dt]=i:X(t).invalidMonth=s});var gc="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pa="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Oa=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,xc=Mr,pc=Mr;function mc(s,e){return s?it(this._months)?this._months[s.month()]:this._months[(this._months.isFormat||Oa).test(e)?"format":"standalone"][s.month()]:it(this._months)?this._months:this._months.standalone}function vc(s,e){return s?it(this._monthsShort)?this._monthsShort[s.month()]:this._monthsShort[Oa.test(e)?"format":"standalone"][s.month()]:it(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ec(s,e,t){var r,i,n,a=s.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)n=gt([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(n,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(n,"").toLocaleLowerCase();return t?e==="MMM"?(i=Ce.call(this._shortMonthsParse,a),i!==-1?i:null):(i=Ce.call(this._longMonthsParse,a),i!==-1?i:null):e==="MMM"?(i=Ce.call(this._shortMonthsParse,a),i!==-1?i:(i=Ce.call(this._longMonthsParse,a),i!==-1?i:null)):(i=Ce.call(this._longMonthsParse,a),i!==-1?i:(i=Ce.call(this._shortMonthsParse,a),i!==-1?i:null))}function yc(s,e,t){var r,i,n;if(this._monthsParseExact)return Ec.call(this,s,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=gt([2e3,r]),t&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[r]&&(n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(n.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[r].test(s))return r;if(t&&e==="MMM"&&this._shortMonthsParse[r].test(s))return r;if(!t&&this._monthsParse[r].test(s))return r}}function Ma(s,e){if(!s.isValid())return s;if(typeof e=="string"){if(/^\d+$/.test(e))e=ee(e);else if(e=s.localeData().monthsParse(e),!Ct(e))return s}var t=e,r=s.date();return r=r<29?r:Math.min(r,Vi(s.year(),t)),s._isUTC?s._d.setUTCMonth(t,r):s._d.setMonth(t,r),s}function Na(s){return s!=null?(Ma(this,s),L.updateOffset(this,!0),this):Ur(this,"Month")}function wc(){return Vi(this.year(),this.month())}function Cc(s){return this._monthsParseExact?(ce(this,"_monthsRegex")||qa.call(this),s?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=xc),this._monthsShortStrictRegex&&s?this._monthsShortStrictRegex:this._monthsShortRegex)}function _c(s){return this._monthsParseExact?(ce(this,"_monthsRegex")||qa.call(this),s?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=pc),this._monthsStrictRegex&&s?this._monthsStrictRegex:this._monthsRegex)}function qa(){function s(d,c){return c.length-d.length}var e=[],t=[],r=[],i,n,a,o;for(i=0;i<12;i++)n=gt([2e3,i]),a=_t(this.monthsShort(n,"")),o=_t(this.months(n,"")),e.push(a),t.push(o),r.push(o),r.push(a);e.sort(s),t.sort(s),r.sort(s),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Dc(s,e,t,r,i,n,a){var o;return s<100&&s>=0?(o=new Date(s+400,e,t,r,i,n,a),isFinite(o.getFullYear())&&o.setFullYear(s)):o=new Date(s,e,t,r,i,n,a),o}function Lr(s){var e,t;return s<100&&s>=0?(t=Array.prototype.slice.call(arguments),t[0]=s+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(s)):e=new Date(Date.UTC.apply(null,arguments)),e}function vs(s,e,t){var r=7+e-t,i=(7+Lr(s,0,r).getUTCDay()-e)%7;return-i+r-1}function Ua(s,e,t,r,i){var n=(7+t-r)%7,a=vs(s,r,i),o=1+7*(e-1)+n+a,d,c;return o<=0?(d=s-1,c=qr(d)+o):o>qr(s)?(d=s+1,c=o-qr(s)):(d=s,c=o),{year:d,dayOfYear:c}}function jr(s,e,t){var r=vs(s.year(),e,t),i=Math.floor((s.dayOfYear()-r-1)/7)+1,n,a;return i<1?(a=s.year()-1,n=i+At(a,e,t)):i>At(s.year(),e,t)?(n=i-At(s.year(),e,t),a=s.year()+1):(a=s.year(),n=i),{week:n,year:a}}function At(s,e,t){var r=vs(s,e,t),i=vs(s+1,e,t);return(qr(s)-r+i)/7}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),W("w",ve,vr),W("ww",ve,ze),W("W",ve,vr),W("WW",ve,ze),Nr(["w","ww","W","WW"],function(s,e,t,r){e[r.substr(0,1)]=ee(s)});function bc(s){return jr(s,this._week.dow,this._week.doy).week}var Ac={dow:0,doy:6};function Tc(){return this._week.dow}function Sc(){return this._week.doy}function Rc(s){var e=this.localeData().week(this);return s==null?e:this.add((s-e)*7,"d")}function Fc(s){var e=jr(this,1,4).week;return s==null?e:this.add((s-e)*7,"d")}G("d",0,"do","day"),G("dd",0,0,function(s){return this.localeData().weekdaysMin(this,s)}),G("ddd",0,0,function(s){return this.localeData().weekdaysShort(this,s)}),G("dddd",0,0,function(s){return this.localeData().weekdays(this,s)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),W("d",ve),W("e",ve),W("E",ve),W("dd",function(s,e){return e.weekdaysMinRegex(s)}),W("ddd",function(s,e){return e.weekdaysShortRegex(s)}),W("dddd",function(s,e){return e.weekdaysRegex(s)}),Nr(["dd","ddd","dddd"],function(s,e,t,r){var i=t._locale.weekdaysParse(s,r,t._strict);i!=null?e.d=i:X(t).invalidWeekday=s}),Nr(["d","e","E"],function(s,e,t,r){e[r]=ee(s)});function Bc(s,e){return typeof s!="string"?s:isNaN(s)?(s=e.weekdaysParse(s),typeof s=="number"?s:null):parseInt(s,10)}function kc(s,e){return typeof s=="string"?e.weekdaysParse(s)%7||7:isNaN(s)?null:s}function Gi(s,e){return s.slice(e,7).concat(s.slice(0,e))}var Ic="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),La="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$c="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Hc=Mr,Pc=Mr,Oc=Mr;function Mc(s,e){var t=it(this._weekdays)?this._weekdays:this._weekdays[s&&s!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return s===!0?Gi(t,this._week.dow):s?t[s.day()]:t}function Nc(s){return s===!0?Gi(this._weekdaysShort,this._week.dow):s?this._weekdaysShort[s.day()]:this._weekdaysShort}function qc(s){return s===!0?Gi(this._weekdaysMin,this._week.dow):s?this._weekdaysMin[s.day()]:this._weekdaysMin}function Uc(s,e,t){var r,i,n,a=s.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)n=gt([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(n,"").toLocaleLowerCase();return t?e==="dddd"?(i=Ce.call(this._weekdaysParse,a),i!==-1?i:null):e==="ddd"?(i=Ce.call(this._shortWeekdaysParse,a),i!==-1?i:null):(i=Ce.call(this._minWeekdaysParse,a),i!==-1?i:null):e==="dddd"?(i=Ce.call(this._weekdaysParse,a),i!==-1||(i=Ce.call(this._shortWeekdaysParse,a),i!==-1)?i:(i=Ce.call(this._minWeekdaysParse,a),i!==-1?i:null)):e==="ddd"?(i=Ce.call(this._shortWeekdaysParse,a),i!==-1||(i=Ce.call(this._weekdaysParse,a),i!==-1)?i:(i=Ce.call(this._minWeekdaysParse,a),i!==-1?i:null)):(i=Ce.call(this._minWeekdaysParse,a),i!==-1||(i=Ce.call(this._weekdaysParse,a),i!==-1)?i:(i=Ce.call(this._shortWeekdaysParse,a),i!==-1?i:null))}function Lc(s,e,t){var r,i,n;if(this._weekdaysParseExact)return Uc.call(this,s,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=gt([2e3,1]).day(r),t&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(n="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(n.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[r].test(s))return r;if(t&&e==="ddd"&&this._shortWeekdaysParse[r].test(s))return r;if(t&&e==="dd"&&this._minWeekdaysParse[r].test(s))return r;if(!t&&this._weekdaysParse[r].test(s))return r}}function jc(s){if(!this.isValid())return s!=null?this:NaN;var e=Ur(this,"Day");return s!=null?(s=Bc(s,this.localeData()),this.add(s-e,"d")):e}function Yc(s){if(!this.isValid())return s!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return s==null?e:this.add(s-e,"d")}function Wc(s){if(!this.isValid())return s!=null?this:NaN;if(s!=null){var e=kc(s,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Vc(s){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||zi.call(this),s?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=Hc),this._weekdaysStrictRegex&&s?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gc(s){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||zi.call(this),s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Pc),this._weekdaysShortStrictRegex&&s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function zc(s){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||zi.call(this),s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Oc),this._weekdaysMinStrictRegex&&s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zi(){function s(l,g){return g.length-l.length}var e=[],t=[],r=[],i=[],n,a,o,d,c;for(n=0;n<7;n++)a=gt([2e3,1]).day(n),o=_t(this.weekdaysMin(a,"")),d=_t(this.weekdaysShort(a,"")),c=_t(this.weekdays(a,"")),e.push(o),t.push(d),r.push(c),i.push(o),i.push(d),i.push(c);e.sort(s),t.sort(s),r.sort(s),i.sort(s),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Ki(){return this.hours()%12||12}function Kc(){return this.hours()||24}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Ki),G("k",["kk",2],0,Kc),G("hmm",0,0,function(){return""+Ki.apply(this)+pt(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Ki.apply(this)+pt(this.minutes(),2)+pt(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+pt(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+pt(this.minutes(),2)+pt(this.seconds(),2)});function ja(s,e){G(s,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}ja("a",!0),ja("A",!1);function Ya(s,e){return e._meridiemParse}W("a",Ya),W("A",Ya),W("H",ve,Yi),W("h",ve,vr),W("k",ve,vr),W("HH",ve,ze),W("hh",ve,ze),W("kk",ve,ze),W("hmm",ka),W("hmmss",Ia),W("Hmm",ka),W("Hmmss",Ia),xe(["H","HH"],Te),xe(["k","kk"],function(s,e,t){var r=ee(s);e[Te]=r===24?0:r}),xe(["a","A"],function(s,e,t){t._isPm=t._locale.isPM(s),t._meridiem=s}),xe(["h","hh"],function(s,e,t){e[Te]=ee(s),X(t).bigHour=!0}),xe("hmm",function(s,e,t){var r=s.length-2;e[Te]=ee(s.substr(0,r)),e[at]=ee(s.substr(r)),X(t).bigHour=!0}),xe("hmmss",function(s,e,t){var r=s.length-4,i=s.length-2;e[Te]=ee(s.substr(0,r)),e[at]=ee(s.substr(r,2)),e[bt]=ee(s.substr(i)),X(t).bigHour=!0}),xe("Hmm",function(s,e,t){var r=s.length-2;e[Te]=ee(s.substr(0,r)),e[at]=ee(s.substr(r))}),xe("Hmmss",function(s,e,t){var r=s.length-4,i=s.length-2;e[Te]=ee(s.substr(0,r)),e[at]=ee(s.substr(r,2)),e[bt]=ee(s.substr(i))});function Zc(s){return(s+"").toLowerCase().charAt(0)==="p"}var Jc=/[ap]\.?m?\.?/i,Xc=Er("Hours",!0);function Qc(s,e,t){return s>11?t?"pm":"PM":t?"am":"AM"}var Wa={calendar:U0,longDateFormat:W0,invalidDate:G0,ordinal:K0,dayOfMonthOrdinalParse:Z0,relativeTime:X0,months:gc,monthsShort:Pa,week:Ac,weekdays:Ic,weekdaysMin:$c,weekdaysShort:La,meridiemParse:Jc},ye={},Yr={},Wr;function ed(s,e){var t,r=Math.min(s.length,e.length);for(t=0;t<r;t+=1)if(s[t]!==e[t])return t;return r}function Va(s){return s&&s.toLowerCase().replace("_","-")}function td(s){for(var e=0,t,r,i,n;e<s.length;){for(n=Va(s[e]).split("-"),t=n.length,r=Va(s[e+1]),r=r?r.split("-"):null;t>0;){if(i=Es(n.slice(0,t).join("-")),i)return i;if(r&&r.length>=t&&ed(n,r)>=t-1)break;t--}e++}return Wr}function rd(s){return!!(s&&s.match("^[^/\\\\]*$"))}function Es(s){var e=null,t;if(ye[s]===void 0&&typeof module<"u"&&module&&module.exports&&rd(s))try{e=Wr._abbr,t=require,t("./locale/"+s),Lt(e)}catch{ye[s]=null}return ye[s]}function Lt(s,e){var t;return s&&(Ye(e)?t=Tt(s):t=Zi(s,e),t?Wr=t:typeof console<"u"&&console.warn&&console.warn("Locale "+s+" not found. Did you forget to load it?")),Wr._abbr}function Zi(s,e){if(e!==null){var t,r=Wa;if(e.abbr=s,ye[s]!=null)Ta("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ye[s]._config;else if(e.parentLocale!=null)if(ye[e.parentLocale]!=null)r=ye[e.parentLocale]._config;else if(t=Es(e.parentLocale),t!=null)r=t._config;else return Yr[e.parentLocale]||(Yr[e.parentLocale]=[]),Yr[e.parentLocale].push({name:s,config:e}),null;return ye[s]=new Oi(Pi(r,e)),Yr[s]&&Yr[s].forEach(function(i){Zi(i.name,i.config)}),Lt(s),ye[s]}else return delete ye[s],null}function sd(s,e){if(e!=null){var t,r,i=Wa;ye[s]!=null&&ye[s].parentLocale!=null?ye[s].set(Pi(ye[s]._config,e)):(r=Es(s),r!=null&&(i=r._config),e=Pi(i,e),r==null&&(e.abbr=s),t=new Oi(e),t.parentLocale=ye[s],ye[s]=t),Lt(s)}else ye[s]!=null&&(ye[s].parentLocale!=null?(ye[s]=ye[s].parentLocale,s===Lt()&&Lt(s)):ye[s]!=null&&delete ye[s]);return ye[s]}function Tt(s){var e;if(s&&s._locale&&s._locale._abbr&&(s=s._locale._abbr),!s)return Wr;if(!it(s)){if(e=Es(s),e)return e;s=[s]}return td(s)}function id(){return Mi(ye)}function Ji(s){var e,t=s._a;return t&&X(s).overflow===-2&&(e=t[Dt]<0||t[Dt]>11?Dt:t[mt]<1||t[mt]>Vi(t[He],t[Dt])?mt:t[Te]<0||t[Te]>24||t[Te]===24&&(t[at]!==0||t[bt]!==0||t[nr]!==0)?Te:t[at]<0||t[at]>59?at:t[bt]<0||t[bt]>59?bt:t[nr]<0||t[nr]>999?nr:-1,X(s)._overflowDayOfYear&&(e<He||e>mt)&&(e=mt),X(s)._overflowWeeks&&e===-1&&(e=cc),X(s)._overflowWeekday&&e===-1&&(e=dc),X(s).overflow=e),s}var nd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ad=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,od=/Z|[+-]\d\d(?::?\d\d)?/,ys=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xi=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],cd=/^\/?Date\((-?\d+)/i,dd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ld={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ga(s){var e,t,r=s._i,i=nd.exec(r)||ad.exec(r),n,a,o,d,c=ys.length,l=Xi.length;if(i){for(X(s).iso=!0,e=0,t=c;e<t;e++)if(ys[e][1].exec(i[1])){a=ys[e][0],n=ys[e][2]!==!1;break}if(a==null){s._isValid=!1;return}if(i[3]){for(e=0,t=l;e<t;e++)if(Xi[e][1].exec(i[3])){o=(i[2]||" ")+Xi[e][0];break}if(o==null){s._isValid=!1;return}}if(!n&&o!=null){s._isValid=!1;return}if(i[4])if(od.exec(i[4]))d="Z";else{s._isValid=!1;return}s._f=a+(o||"")+(d||""),en(s)}else s._isValid=!1}function hd(s,e,t,r,i,n){var a=[ud(s),Pa.indexOf(e),parseInt(t,10),parseInt(r,10),parseInt(i,10)];return n&&a.push(parseInt(n,10)),a}function ud(s){var e=parseInt(s,10);return e<=49?2e3+e:e<=999?1900+e:e}function fd(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function gd(s,e,t){if(s){var r=La.indexOf(s),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return X(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function xd(s,e,t){if(s)return ld[s];if(e)return 0;var r=parseInt(t,10),i=r%100,n=(r-i)/100;return n*60+i}function za(s){var e=dd.exec(fd(s._i)),t;if(e){if(t=hd(e[4],e[3],e[2],e[5],e[6],e[7]),!gd(e[1],t,s))return;s._a=t,s._tzm=xd(e[8],e[9],e[10]),s._d=Lr.apply(null,s._a),s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),X(s).rfc2822=!0}else s._isValid=!1}function pd(s){var e=cd.exec(s._i);if(e!==null){s._d=new Date(+e[1]);return}if(Ga(s),s._isValid===!1)delete s._isValid;else return;if(za(s),s._isValid===!1)delete s._isValid;else return;s._strict?s._isValid=!1:L.createFromInputFallback(s)}L.createFromInputFallback=Xe("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(s){s._d=new Date(s._i+(s._useUTC?" UTC":""))});function yr(s,e,t){return s??e??t}function md(s){var e=new Date(L.now());return s._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Qi(s){var e,t,r=[],i,n,a;if(!s._d){for(i=md(s),s._w&&s._a[mt]==null&&s._a[Dt]==null&&vd(s),s._dayOfYear!=null&&(a=yr(s._a[He],i[He]),(s._dayOfYear>qr(a)||s._dayOfYear===0)&&(X(s)._overflowDayOfYear=!0),t=Lr(a,0,s._dayOfYear),s._a[Dt]=t.getUTCMonth(),s._a[mt]=t.getUTCDate()),e=0;e<3&&s._a[e]==null;++e)s._a[e]=r[e]=i[e];for(;e<7;e++)s._a[e]=r[e]=s._a[e]==null?e===2?1:0:s._a[e];s._a[Te]===24&&s._a[at]===0&&s._a[bt]===0&&s._a[nr]===0&&(s._nextDay=!0,s._a[Te]=0),s._d=(s._useUTC?Lr:Dc).apply(null,r),n=s._useUTC?s._d.getUTCDay():s._d.getDay(),s._tzm!=null&&s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),s._nextDay&&(s._a[Te]=24),s._w&&typeof s._w.d<"u"&&s._w.d!==n&&(X(s).weekdayMismatch=!0)}}function vd(s){var e,t,r,i,n,a,o,d,c;e=s._w,e.GG!=null||e.W!=null||e.E!=null?(n=1,a=4,t=yr(e.GG,s._a[He],jr(Ee(),1,4).year),r=yr(e.W,1),i=yr(e.E,1),(i<1||i>7)&&(d=!0)):(n=s._locale._week.dow,a=s._locale._week.doy,c=jr(Ee(),n,a),t=yr(e.gg,s._a[He],c.year),r=yr(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(d=!0)):e.e!=null?(i=e.e+n,(e.e<0||e.e>6)&&(d=!0)):i=n),r<1||r>At(t,n,a)?X(s)._overflowWeeks=!0:d!=null?X(s)._overflowWeekday=!0:(o=Ua(t,r,i,n,a),s._a[He]=o.year,s._dayOfYear=o.dayOfYear)}L.ISO_8601=function(){},L.RFC_2822=function(){};function en(s){if(s._f===L.ISO_8601){Ga(s);return}if(s._f===L.RFC_2822){za(s);return}s._a=[],X(s).empty=!0;var e=""+s._i,t,r,i,n,a,o=e.length,d=0,c,l;for(i=Sa(s._f,s._locale).match(Ni)||[],l=i.length,t=0;t<l;t++)n=i[t],r=(e.match(nc(n,s))||[])[0],r&&(a=e.substr(0,e.indexOf(r)),a.length>0&&X(s).unusedInput.push(a),e=e.slice(e.indexOf(r)+r.length),d+=r.length),pr[n]?(r?X(s).empty=!1:X(s).unusedTokens.push(n),oc(n,r,s)):s._strict&&!r&&X(s).unusedTokens.push(n);X(s).charsLeftOver=o-d,e.length>0&&X(s).unusedInput.push(e),s._a[Te]<=12&&X(s).bigHour===!0&&s._a[Te]>0&&(X(s).bigHour=void 0),X(s).parsedDateParts=s._a.slice(0),X(s).meridiem=s._meridiem,s._a[Te]=Ed(s._locale,s._a[Te],s._meridiem),c=X(s).era,c!==null&&(s._a[He]=s._locale.erasConvertYear(c,s._a[He])),Qi(s),Ji(s)}function Ed(s,e,t){var r;return t==null?e:s.meridiemHour!=null?s.meridiemHour(e,t):(s.isPM!=null&&(r=s.isPM(t),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function yd(s){var e,t,r,i,n,a,o=!1,d=s._f.length;if(d===0){X(s).invalidFormat=!0,s._d=new Date(NaN);return}for(i=0;i<d;i++)n=0,a=!1,e=Hi({},s),s._useUTC!=null&&(e._useUTC=s._useUTC),e._f=s._f[i],en(e),Ii(e)&&(a=!0),n+=X(e).charsLeftOver,n+=X(e).unusedTokens.length*10,X(e).score=n,o?n<r&&(r=n,t=e):(r==null||n<r||a)&&(r=n,t=e,a&&(o=!0));Ut(s,t||e)}function wd(s){if(!s._d){var e=Ui(s._i),t=e.day===void 0?e.date:e.day;s._a=_a([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),Qi(s)}}function Cd(s){var e=new Or(Ji(Ka(s)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ka(s){var e=s._i,t=s._f;return s._locale=s._locale||Tt(s._l),e===null||t===void 0&&e===""?cs({nullInput:!0}):(typeof e=="string"&&(s._i=e=s._locale.preparse(e)),nt(e)?new Or(Ji(e)):(Pr(e)?s._d=e:it(t)?yd(s):t?en(s):_d(s),Ii(s)||(s._d=null),s))}function _d(s){var e=s._i;Ye(e)?s._d=new Date(L.now()):Pr(e)?s._d=new Date(e.valueOf()):typeof e=="string"?pd(s):it(e)?(s._a=_a(e.slice(0),function(t){return parseInt(t,10)}),Qi(s)):ir(e)?wd(s):Ct(e)?s._d=new Date(e):L.createFromInputFallback(s)}function Za(s,e,t,r,i){var n={};return(e===!0||e===!1)&&(r=e,e=void 0),(t===!0||t===!1)&&(r=t,t=void 0),(ir(s)&&Bi(s)||it(s)&&s.length===0)&&(s=void 0),n._isAMomentObject=!0,n._useUTC=n._isUTC=i,n._l=t,n._i=s,n._f=e,n._strict=r,Cd(n)}function Ee(s,e,t,r){return Za(s,e,t,r,!1)}var Dd=Xe("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var s=Ee.apply(null,arguments);return this.isValid()&&s.isValid()?s<this?this:s:cs()}),bd=Xe("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var s=Ee.apply(null,arguments);return this.isValid()&&s.isValid()?s>this?this:s:cs()});function Ja(s,e){var t,r;if(e.length===1&&it(e[0])&&(e=e[0]),!e.length)return Ee();for(t=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][s](t))&&(t=e[r]);return t}function Ad(){var s=[].slice.call(arguments,0);return Ja("isBefore",s)}function Td(){var s=[].slice.call(arguments,0);return Ja("isAfter",s)}var Sd=function(){return Date.now?Date.now():+new Date},Vr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rd(s){var e,t=!1,r,i=Vr.length;for(e in s)if(ce(s,e)&&!(Ce.call(Vr,e)!==-1&&(s[e]==null||!isNaN(s[e]))))return!1;for(r=0;r<i;++r)if(s[Vr[r]]){if(t)return!1;parseFloat(s[Vr[r]])!==ee(s[Vr[r]])&&(t=!0)}return!0}function Fd(){return this._isValid}function Bd(){return ot(NaN)}function ws(s){var e=Ui(s),t=e.year||0,r=e.quarter||0,i=e.month||0,n=e.week||e.isoWeek||0,a=e.day||0,o=e.hour||0,d=e.minute||0,c=e.second||0,l=e.millisecond||0;this._isValid=Rd(e),this._milliseconds=+l+c*1e3+d*6e4+o*1e3*60*60,this._days=+a+n*7,this._months=+i+r*3+t*12,this._data={},this._locale=Tt(),this._bubble()}function Cs(s){return s instanceof ws}function tn(s){return s<0?Math.round(-1*s)*-1:Math.round(s)}function kd(s,e,t){var r=Math.min(s.length,e.length),i=Math.abs(s.length-e.length),n=0,a;for(a=0;a<r;a++)ee(s[a])!==ee(e[a])&&n++;return n+i}function Xa(s,e){G(s,0,0,function(){var t=this.utcOffset(),r="+";return t<0&&(t=-t,r="-"),r+pt(~~(t/60),2)+e+pt(~~t%60,2)})}Xa("Z",":"),Xa("ZZ",""),W("Z",xs),W("ZZ",xs),xe(["Z","ZZ"],function(s,e,t){t._useUTC=!0,t._tzm=rn(xs,s)});var Id=/([\+\-]|\d\d)/gi;function rn(s,e){var t=(e||"").match(s),r,i,n;return t===null?null:(r=t[t.length-1]||[],i=(r+"").match(Id)||["-",0,0],n=+(i[1]*60)+ee(i[2]),n===0?0:i[0]==="+"?n:-n)}function sn(s,e){var t,r;return e._isUTC?(t=e.clone(),r=(nt(s)||Pr(s)?s.valueOf():Ee(s).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+r),L.updateOffset(t,!1),t):Ee(s).local()}function nn(s){return-Math.round(s._d.getTimezoneOffset())}L.updateOffset=function(){};function $d(s,e,t){var r=this._offset||0,i;if(!this.isValid())return s!=null?this:NaN;if(s!=null){if(typeof s=="string"){if(s=rn(xs,s),s===null)return this}else Math.abs(s)<16&&!t&&(s=s*60);return!this._isUTC&&e&&(i=nn(this)),this._offset=s,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==s&&(!e||this._changeInProgress?ro(this,ot(s-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,L.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:nn(this)}function Hd(s,e){return s!=null?(typeof s!="string"&&(s=-s),this.utcOffset(s,e),this):-this.utcOffset()}function Pd(s){return this.utcOffset(0,s)}function Od(s){return this._isUTC&&(this.utcOffset(0,s),this._isUTC=!1,s&&this.subtract(nn(this),"m")),this}function Md(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var s=rn(sc,this._i);s!=null?this.utcOffset(s):this.utcOffset(0,!0)}return this}function Nd(s){return this.isValid()?(s=s?Ee(s).utcOffset():0,(this.utcOffset()-s)%60===0):!1}function qd(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ud(){if(!Ye(this._isDSTShifted))return this._isDSTShifted;var s={},e;return Hi(s,this),s=Ka(s),s._a?(e=s._isUTC?gt(s._a):Ee(s._a),this._isDSTShifted=this.isValid()&&kd(s._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ld(){return this.isValid()?!this._isUTC:!1}function jd(){return this.isValid()?this._isUTC:!1}function Qa(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Yd=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Wd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ot(s,e){var t=s,r=null,i,n,a;return Cs(s)?t={ms:s._milliseconds,d:s._days,M:s._months}:Ct(s)||!isNaN(+s)?(t={},e?t[e]=+s:t.milliseconds=+s):(r=Yd.exec(s))?(i=r[1]==="-"?-1:1,t={y:0,d:ee(r[mt])*i,h:ee(r[Te])*i,m:ee(r[at])*i,s:ee(r[bt])*i,ms:ee(tn(r[nr]*1e3))*i}):(r=Wd.exec(s))?(i=r[1]==="-"?-1:1,t={y:ar(r[2],i),M:ar(r[3],i),w:ar(r[4],i),d:ar(r[5],i),h:ar(r[6],i),m:ar(r[7],i),s:ar(r[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(a=Vd(Ee(t.from),Ee(t.to)),t={},t.ms=a.milliseconds,t.M=a.months),n=new ws(t),Cs(s)&&ce(s,"_locale")&&(n._locale=s._locale),Cs(s)&&ce(s,"_isValid")&&(n._isValid=s._isValid),n}ot.fn=ws.prototype,ot.invalid=Bd;function ar(s,e){var t=s&&parseFloat(s.replace(",","."));return(isNaN(t)?0:t)*e}function eo(s,e){var t={};return t.months=e.month()-s.month()+(e.year()-s.year())*12,s.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+s.clone().add(t.months,"M"),t}function Vd(s,e){var t;return s.isValid()&&e.isValid()?(e=sn(e,s),s.isBefore(e)?t=eo(s,e):(t=eo(e,s),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function to(s,e){return function(t,r){var i,n;return r!==null&&!isNaN(+r)&&(Ta(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=t,t=r,r=n),i=ot(t,r),ro(this,i,s),this}}function ro(s,e,t,r){var i=e._milliseconds,n=tn(e._days),a=tn(e._months);s.isValid()&&(r=r??!0,a&&Ma(s,Ur(s,"Month")+a*t),n&&Ha(s,"Date",Ur(s,"Date")+n*t),i&&s._d.setTime(s._d.valueOf()+i*t),r&&L.updateOffset(s,n||a))}var Gd=to(1,"add"),zd=to(-1,"subtract");function so(s){return typeof s=="string"||s instanceof String}function Kd(s){return nt(s)||Pr(s)||so(s)||Ct(s)||Jd(s)||Zd(s)||s===null||s===void 0}function Zd(s){var e=ir(s)&&!Bi(s),t=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,n,a=r.length;for(i=0;i<a;i+=1)n=r[i],t=t||ce(s,n);return e&&t}function Jd(s){var e=it(s),t=!1;return e&&(t=s.filter(function(r){return!Ct(r)&&so(s)}).length===0),e&&t}function Xd(s){var e=ir(s)&&!Bi(s),t=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,n;for(i=0;i<r.length;i+=1)n=r[i],t=t||ce(s,n);return e&&t}function Qd(s,e){var t=s.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function el(s,e){arguments.length===1&&(arguments[0]?Kd(arguments[0])?(s=arguments[0],e=void 0):Xd(arguments[0])&&(e=arguments[0],s=void 0):(s=void 0,e=void 0));var t=s||Ee(),r=sn(t,this).startOf("day"),i=L.calendarFormat(this,r)||"sameElse",n=e&&(xt(e[i])?e[i].call(this,t):e[i]);return this.format(n||this.localeData().calendar(i,this,Ee(t)))}function tl(){return new Or(this)}function rl(s,e){var t=nt(s)?s:Ee(s);return this.isValid()&&t.isValid()?(e=Qe(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function sl(s,e){var t=nt(s)?s:Ee(s);return this.isValid()&&t.isValid()?(e=Qe(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function il(s,e,t,r){var i=nt(s)?s:Ee(s),n=nt(e)?e:Ee(e);return this.isValid()&&i.isValid()&&n.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(r[1]===")"?this.isBefore(n,t):!this.isAfter(n,t))):!1}function nl(s,e){var t=nt(s)?s:Ee(s),r;return this.isValid()&&t.isValid()?(e=Qe(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(r=t.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function al(s,e){return this.isSame(s,e)||this.isAfter(s,e)}function ol(s,e){return this.isSame(s,e)||this.isBefore(s,e)}function cl(s,e,t){var r,i,n;if(!this.isValid())return NaN;if(r=sn(s,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Qe(e),e){case"year":n=_s(this,r)/12;break;case"month":n=_s(this,r);break;case"quarter":n=_s(this,r)/3;break;case"second":n=(this-r)/1e3;break;case"minute":n=(this-r)/6e4;break;case"hour":n=(this-r)/36e5;break;case"day":n=(this-r-i)/864e5;break;case"week":n=(this-r-i)/6048e5;break;default:n=this-r}return t?n:et(n)}function _s(s,e){if(s.date()<e.date())return-_s(e,s);var t=(e.year()-s.year())*12+(e.month()-s.month()),r=s.clone().add(t,"months"),i,n;return e-r<0?(i=s.clone().add(t-1,"months"),n=(e-r)/(r-i)):(i=s.clone().add(t+1,"months"),n=(e-r)/(i-r)),-(t+n)||0}L.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",L.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function dl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ll(s){if(!this.isValid())return null;var e=s!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?ls(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):xt(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ls(t,"Z")):ls(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function hl(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var s="moment",e="",t,r,i,n;return this.isLocal()||(s=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+s+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",n=e+'[")]',this.format(t+r+i+n)}function ul(s){s||(s=this.isUtc()?L.defaultFormatUtc:L.defaultFormat);var e=ls(this,s);return this.localeData().postformat(e)}function fl(s,e){return this.isValid()&&(nt(s)&&s.isValid()||Ee(s).isValid())?ot({to:this,from:s}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function gl(s){return this.from(Ee(),s)}function xl(s,e){return this.isValid()&&(nt(s)&&s.isValid()||Ee(s).isValid())?ot({from:this,to:s}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function pl(s){return this.to(Ee(),s)}function io(s){var e;return s===void 0?this._locale._abbr:(e=Tt(s),e!=null&&(this._locale=e),this)}var no=Xe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(s){return s===void 0?this.localeData():this.locale(s)});function ao(){return this._locale}var Ds=1e3,wr=60*Ds,bs=60*wr,oo=(365*400+97)*24*bs;function Cr(s,e){return(s%e+e)%e}function co(s,e,t){return s<100&&s>=0?new Date(s+400,e,t)-oo:new Date(s,e,t).valueOf()}function lo(s,e,t){return s<100&&s>=0?Date.UTC(s+400,e,t)-oo:Date.UTC(s,e,t)}function ml(s){var e,t;if(s=Qe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?lo:co,s){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Cr(e+(this._isUTC?0:this.utcOffset()*wr),bs);break;case"minute":e=this._d.valueOf(),e-=Cr(e,wr);break;case"second":e=this._d.valueOf(),e-=Cr(e,Ds);break}return this._d.setTime(e),L.updateOffset(this,!0),this}function vl(s){var e,t;if(s=Qe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?lo:co,s){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=bs-Cr(e+(this._isUTC?0:this.utcOffset()*wr),bs)-1;break;case"minute":e=this._d.valueOf(),e+=wr-Cr(e,wr)-1;break;case"second":e=this._d.valueOf(),e+=Ds-Cr(e,Ds)-1;break}return this._d.setTime(e),L.updateOffset(this,!0),this}function El(){return this._d.valueOf()-(this._offset||0)*6e4}function yl(){return Math.floor(this.valueOf()/1e3)}function wl(){return new Date(this.valueOf())}function Cl(){var s=this;return[s.year(),s.month(),s.date(),s.hour(),s.minute(),s.second(),s.millisecond()]}function _l(){var s=this;return{years:s.year(),months:s.month(),date:s.date(),hours:s.hours(),minutes:s.minutes(),seconds:s.seconds(),milliseconds:s.milliseconds()}}function Dl(){return this.isValid()?this.toISOString():null}function bl(){return Ii(this)}function Al(){return Ut({},X(this))}function Tl(){return X(this).overflow}function Sl(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}G("N",0,0,"eraAbbr"),G("NN",0,0,"eraAbbr"),G("NNN",0,0,"eraAbbr"),G("NNNN",0,0,"eraName"),G("NNNNN",0,0,"eraNarrow"),G("y",["y",1],"yo","eraYear"),G("y",["yy",2],0,"eraYear"),G("y",["yyy",3],0,"eraYear"),G("y",["yyyy",4],0,"eraYear"),W("N",an),W("NN",an),W("NNN",an),W("NNNN",Nl),W("NNNNN",ql),xe(["N","NN","NNN","NNNN","NNNNN"],function(s,e,t,r){var i=t._locale.erasParse(s,r,t._strict);i?X(t).era=i:X(t).invalidEra=s}),W("y",mr),W("yy",mr),W("yyy",mr),W("yyyy",mr),W("yo",Ul),xe(["y","yy","yyy","yyyy"],He),xe(["yo"],function(s,e,t,r){var i;t._locale._eraYearOrdinalRegex&&(i=s.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[He]=t._locale.eraYearOrdinalParse(s,i):e[He]=parseInt(s,10)});function Rl(s,e){var t,r,i,n=this._eras||Tt("en")._eras;for(t=0,r=n.length;t<r;++t){switch(typeof n[t].since){case"string":i=L(n[t].since).startOf("day"),n[t].since=i.valueOf();break}switch(typeof n[t].until){case"undefined":n[t].until=1/0;break;case"string":i=L(n[t].until).startOf("day").valueOf(),n[t].until=i.valueOf();break}}return n}function Fl(s,e,t){var r,i,n=this.eras(),a,o,d;for(s=s.toUpperCase(),r=0,i=n.length;r<i;++r)if(a=n[r].name.toUpperCase(),o=n[r].abbr.toUpperCase(),d=n[r].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(o===s)return n[r];break;case"NNNN":if(a===s)return n[r];break;case"NNNNN":if(d===s)return n[r];break}else if([a,o,d].indexOf(s)>=0)return n[r]}function Bl(s,e){var t=s.since<=s.until?1:-1;return e===void 0?L(s.since).year():L(s.since).year()+(e-s.offset)*t}function kl(){var s,e,t,r=this.localeData().eras();for(s=0,e=r.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),r[s].since<=t&&t<=r[s].until||r[s].until<=t&&t<=r[s].since)return r[s].name;return""}function Il(){var s,e,t,r=this.localeData().eras();for(s=0,e=r.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),r[s].since<=t&&t<=r[s].until||r[s].until<=t&&t<=r[s].since)return r[s].narrow;return""}function $l(){var s,e,t,r=this.localeData().eras();for(s=0,e=r.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),r[s].since<=t&&t<=r[s].until||r[s].until<=t&&t<=r[s].since)return r[s].abbr;return""}function Hl(){var s,e,t,r,i=this.localeData().eras();for(s=0,e=i.length;s<e;++s)if(t=i[s].since<=i[s].until?1:-1,r=this.clone().startOf("day").valueOf(),i[s].since<=r&&r<=i[s].until||i[s].until<=r&&r<=i[s].since)return(this.year()-L(i[s].since).year())*t+i[s].offset;return this.year()}function Pl(s){return ce(this,"_erasNameRegex")||on.call(this),s?this._erasNameRegex:this._erasRegex}function Ol(s){return ce(this,"_erasAbbrRegex")||on.call(this),s?this._erasAbbrRegex:this._erasRegex}function Ml(s){return ce(this,"_erasNarrowRegex")||on.call(this),s?this._erasNarrowRegex:this._erasRegex}function an(s,e){return e.erasAbbrRegex(s)}function Nl(s,e){return e.erasNameRegex(s)}function ql(s,e){return e.erasNarrowRegex(s)}function Ul(s,e){return e._eraYearOrdinalRegex||mr}function on(){var s=[],e=[],t=[],r=[],i,n,a,o,d,c=this.eras();for(i=0,n=c.length;i<n;++i)a=_t(c[i].name),o=_t(c[i].abbr),d=_t(c[i].narrow),e.push(a),s.push(o),t.push(d),r.push(a),r.push(o),r.push(d);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100});function As(s,e){G(0,[s,s.length],0,e)}As("gggg","weekYear"),As("ggggg","weekYear"),As("GGGG","isoWeekYear"),As("GGGGG","isoWeekYear"),W("G",gs),W("g",gs),W("GG",ve,ze),W("gg",ve,ze),W("GGGG",ji,Li),W("gggg",ji,Li),W("GGGGG",fs,hs),W("ggggg",fs,hs),Nr(["gggg","ggggg","GGGG","GGGGG"],function(s,e,t,r){e[r.substr(0,2)]=ee(s)}),Nr(["gg","GG"],function(s,e,t,r){e[r]=L.parseTwoDigitYear(s)});function Ll(s){return ho.call(this,s,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function jl(s){return ho.call(this,s,this.isoWeek(),this.isoWeekday(),1,4)}function Yl(){return At(this.year(),1,4)}function Wl(){return At(this.isoWeekYear(),1,4)}function Vl(){var s=this.localeData()._week;return At(this.year(),s.dow,s.doy)}function Gl(){var s=this.localeData()._week;return At(this.weekYear(),s.dow,s.doy)}function ho(s,e,t,r,i){var n;return s==null?jr(this,r,i).year:(n=At(s,r,i),e>n&&(e=n),zl.call(this,s,e,t,r,i))}function zl(s,e,t,r,i){var n=Ua(s,e,t,r,i),a=Lr(n.year,0,n.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}G("Q",0,"Qo","quarter"),W("Q",Fa),xe("Q",function(s,e){e[Dt]=(ee(s)-1)*3});function Kl(s){return s==null?Math.ceil((this.month()+1)/3):this.month((s-1)*3+this.month()%3)}G("D",["DD",2],"Do","date"),W("D",ve,vr),W("DD",ve,ze),W("Do",function(s,e){return s?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),xe(["D","DD"],mt),xe("Do",function(s,e){e[mt]=ee(s.match(ve)[0])});var uo=Er("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),W("DDD",us),W("DDDD",Ba),xe(["DDD","DDDD"],function(s,e,t){t._dayOfYear=ee(s)});function Zl(s){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return s==null?e:this.add(s-e,"d")}G("m",["mm",2],0,"minute"),W("m",ve,Yi),W("mm",ve,ze),xe(["m","mm"],at);var Jl=Er("Minutes",!1);G("s",["ss",2],0,"second"),W("s",ve,Yi),W("ss",ve,ze),xe(["s","ss"],bt);var Xl=Er("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return this.millisecond()*10}),G(0,["SSSSS",5],0,function(){return this.millisecond()*100}),G(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),G(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),G(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),G(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),W("S",us,Fa),W("SS",us,ze),W("SSS",us,Ba);var jt,fo;for(jt="SSSS";jt.length<=9;jt+="S")W(jt,mr);function Ql(s,e){e[nr]=ee(("0."+s)*1e3)}for(jt="S";jt.length<=9;jt+="S")xe(jt,Ql);fo=Er("Milliseconds",!1),G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");function eh(){return this._isUTC?"UTC":""}function th(){return this._isUTC?"Coordinated Universal Time":""}var O=Or.prototype;O.add=Gd,O.calendar=el,O.clone=tl,O.diff=cl,O.endOf=vl,O.format=ul,O.from=fl,O.fromNow=gl,O.to=xl,O.toNow=pl,O.get=hc,O.invalidAt=Tl,O.isAfter=rl,O.isBefore=sl,O.isBetween=il,O.isSame=nl,O.isSameOrAfter=al,O.isSameOrBefore=ol,O.isValid=bl,O.lang=no,O.locale=io,O.localeData=ao,O.max=bd,O.min=Dd,O.parsingFlags=Al,O.set=uc,O.startOf=ml,O.subtract=zd,O.toArray=Cl,O.toObject=_l,O.toDate=wl,O.toISOString=ll,O.inspect=hl,typeof Symbol<"u"&&Symbol.for!=null&&(O[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),O.toJSON=Dl,O.toString=dl,O.unix=yl,O.valueOf=El,O.creationData=Sl,O.eraName=kl,O.eraNarrow=Il,O.eraAbbr=$l,O.eraYear=Hl,O.year=$a,O.isLeapYear=lc,O.weekYear=Ll,O.isoWeekYear=jl,O.quarter=O.quarters=Kl,O.month=Na,O.daysInMonth=wc,O.week=O.weeks=Rc,O.isoWeek=O.isoWeeks=Fc,O.weeksInYear=Vl,O.weeksInWeekYear=Gl,O.isoWeeksInYear=Yl,O.isoWeeksInISOWeekYear=Wl,O.date=uo,O.day=O.days=jc,O.weekday=Yc,O.isoWeekday=Wc,O.dayOfYear=Zl,O.hour=O.hours=Xc,O.minute=O.minutes=Jl,O.second=O.seconds=Xl,O.millisecond=O.milliseconds=fo,O.utcOffset=$d,O.utc=Pd,O.local=Od,O.parseZone=Md,O.hasAlignedHourOffset=Nd,O.isDST=qd,O.isLocal=Ld,O.isUtcOffset=jd,O.isUtc=Qa,O.isUTC=Qa,O.zoneAbbr=eh,O.zoneName=th,O.dates=Xe("dates accessor is deprecated. Use date instead.",uo),O.months=Xe("months accessor is deprecated. Use month instead",Na),O.years=Xe("years accessor is deprecated. Use year instead",$a),O.zone=Xe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Hd),O.isDSTShifted=Xe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ud);function rh(s){return Ee(s*1e3)}function sh(){return Ee.apply(null,arguments).parseZone()}function go(s){return s}var de=Oi.prototype;de.calendar=L0,de.longDateFormat=V0,de.invalidDate=z0,de.ordinal=J0,de.preparse=go,de.postformat=go,de.relativeTime=Q0,de.pastFuture=ec,de.set=q0,de.eras=Rl,de.erasParse=Fl,de.erasConvertYear=Bl,de.erasAbbrRegex=Ol,de.erasNameRegex=Pl,de.erasNarrowRegex=Ml,de.months=mc,de.monthsShort=vc,de.monthsParse=yc,de.monthsRegex=_c,de.monthsShortRegex=Cc,de.week=bc,de.firstDayOfYear=Sc,de.firstDayOfWeek=Tc,de.weekdays=Mc,de.weekdaysMin=qc,de.weekdaysShort=Nc,de.weekdaysParse=Lc,de.weekdaysRegex=Vc,de.weekdaysShortRegex=Gc,de.weekdaysMinRegex=zc,de.isPM=Zc,de.meridiem=Qc;function Ts(s,e,t,r){var i=Tt(),n=gt().set(r,e);return i[t](n,s)}function xo(s,e,t){if(Ct(s)&&(e=s,s=void 0),s=s||"",e!=null)return Ts(s,e,t,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ts(s,r,t,"month");return i}function cn(s,e,t,r){typeof s=="boolean"?(Ct(e)&&(t=e,e=void 0),e=e||""):(e=s,t=e,s=!1,Ct(e)&&(t=e,e=void 0),e=e||"");var i=Tt(),n=s?i._week.dow:0,a,o=[];if(t!=null)return Ts(e,(t+n)%7,r,"day");for(a=0;a<7;a++)o[a]=Ts(e,(a+n)%7,r,"day");return o}function ih(s,e){return xo(s,e,"months")}function nh(s,e){return xo(s,e,"monthsShort")}function ah(s,e,t){return cn(s,e,t,"weekdays")}function oh(s,e,t){return cn(s,e,t,"weekdaysShort")}function ch(s,e,t){return cn(s,e,t,"weekdaysMin")}Lt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(s){var e=s%10,t=ee(s%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return s+t}}),L.lang=Xe("moment.lang is deprecated. Use moment.locale instead.",Lt),L.langData=Xe("moment.langData is deprecated. Use moment.localeData instead.",Tt);var St=Math.abs;function dh(){var s=this._data;return this._milliseconds=St(this._milliseconds),this._days=St(this._days),this._months=St(this._months),s.milliseconds=St(s.milliseconds),s.seconds=St(s.seconds),s.minutes=St(s.minutes),s.hours=St(s.hours),s.months=St(s.months),s.years=St(s.years),this}function po(s,e,t,r){var i=ot(e,t);return s._milliseconds+=r*i._milliseconds,s._days+=r*i._days,s._months+=r*i._months,s._bubble()}function lh(s,e){return po(this,s,e,1)}function hh(s,e){return po(this,s,e,-1)}function mo(s){return s<0?Math.floor(s):Math.ceil(s)}function uh(){var s=this._milliseconds,e=this._days,t=this._months,r=this._data,i,n,a,o,d;return s>=0&&e>=0&&t>=0||s<=0&&e<=0&&t<=0||(s+=mo(dn(t)+e)*864e5,e=0,t=0),r.milliseconds=s%1e3,i=et(s/1e3),r.seconds=i%60,n=et(i/60),r.minutes=n%60,a=et(n/60),r.hours=a%24,e+=et(a/24),d=et(vo(e)),t+=d,e-=mo(dn(d)),o=et(t/12),t%=12,r.days=e,r.months=t,r.years=o,this}function vo(s){return s*4800/146097}function dn(s){return s*146097/4800}function fh(s){if(!this.isValid())return NaN;var e,t,r=this._milliseconds;if(s=Qe(s),s==="month"||s==="quarter"||s==="year")switch(e=this._days+r/864e5,t=this._months+vo(e),s){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(dn(this._months)),s){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+s)}}function Rt(s){return function(){return this.as(s)}}var Eo=Rt("ms"),gh=Rt("s"),xh=Rt("m"),ph=Rt("h"),mh=Rt("d"),vh=Rt("w"),Eh=Rt("M"),yh=Rt("Q"),wh=Rt("y"),Ch=Eo;function _h(){return ot(this)}function Dh(s){return s=Qe(s),this.isValid()?this[s+"s"]():NaN}function or(s){return function(){return this.isValid()?this._data[s]:NaN}}var bh=or("milliseconds"),Ah=or("seconds"),Th=or("minutes"),Sh=or("hours"),Rh=or("days"),Fh=or("months"),Bh=or("years");function kh(){return et(this.days()/7)}var Ft=Math.round,_r={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Ih(s,e,t,r,i){return i.relativeTime(e||1,!!t,s,r)}function $h(s,e,t,r){var i=ot(s).abs(),n=Ft(i.as("s")),a=Ft(i.as("m")),o=Ft(i.as("h")),d=Ft(i.as("d")),c=Ft(i.as("M")),l=Ft(i.as("w")),g=Ft(i.as("y")),u=n<=t.ss&&["s",n]||n<t.s&&["ss",n]||a<=1&&["m"]||a<t.m&&["mm",a]||o<=1&&["h"]||o<t.h&&["hh",o]||d<=1&&["d"]||d<t.d&&["dd",d];return t.w!=null&&(u=u||l<=1&&["w"]||l<t.w&&["ww",l]),u=u||c<=1&&["M"]||c<t.M&&["MM",c]||g<=1&&["y"]||["yy",g],u[2]=e,u[3]=+s>0,u[4]=r,Ih.apply(null,u)}function Hh(s){return s===void 0?Ft:typeof s=="function"?(Ft=s,!0):!1}function Ph(s,e){return _r[s]===void 0?!1:e===void 0?_r[s]:(_r[s]=e,s==="s"&&(_r.ss=e-1),!0)}function Oh(s,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,r=_r,i,n;return typeof s=="object"&&(e=s,s=!1),typeof s=="boolean"&&(t=s),typeof e=="object"&&(r=Object.assign({},_r,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),n=$h(this,!t,r,i),t&&(n=i.pastFuture(+this,n)),i.postformat(n)}var ln=Math.abs;function Dr(s){return(s>0)-(s<0)||+s}function Ss(){if(!this.isValid())return this.localeData().invalidDate();var s=ln(this._milliseconds)/1e3,e=ln(this._days),t=ln(this._months),r,i,n,a,o=this.asSeconds(),d,c,l,g;return o?(r=et(s/60),i=et(r/60),s%=60,r%=60,n=et(t/12),t%=12,a=s?s.toFixed(3).replace(/\.?0+$/,""):"",d=o<0?"-":"",c=Dr(this._months)!==Dr(o)?"-":"",l=Dr(this._days)!==Dr(o)?"-":"",g=Dr(this._milliseconds)!==Dr(o)?"-":"",d+"P"+(n?c+n+"Y":"")+(t?c+t+"M":"")+(e?l+e+"D":"")+(i||r||s?"T":"")+(i?g+i+"H":"")+(r?g+r+"M":"")+(s?g+a+"S":"")):"P0D"}var ne=ws.prototype;ne.isValid=Fd,ne.abs=dh,ne.add=lh,ne.subtract=hh,ne.as=fh,ne.asMilliseconds=Eo,ne.asSeconds=gh,ne.asMinutes=xh,ne.asHours=ph,ne.asDays=mh,ne.asWeeks=vh,ne.asMonths=Eh,ne.asQuarters=yh,ne.asYears=wh,ne.valueOf=Ch,ne._bubble=uh,ne.clone=_h,ne.get=Dh,ne.milliseconds=bh,ne.seconds=Ah,ne.minutes=Th,ne.hours=Sh,ne.days=Rh,ne.weeks=kh,ne.months=Fh,ne.years=Bh,ne.humanize=Oh,ne.toISOString=Ss,ne.toString=Ss,ne.toJSON=Ss,ne.locale=io,ne.localeData=ao,ne.toIsoString=Xe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ss),ne.lang=no,G("X",0,0,"unix"),G("x",0,0,"valueOf"),W("x",gs),W("X",ic),xe("X",function(s,e,t){t._d=new Date(parseFloat(s)*1e3)}),xe("x",function(s,e,t){t._d=new Date(ee(s))});//! moment.js
|
|
102
|
-
L.version="2.30.1",M0(Ee),L.fn=O,L.min=Ad,L.max=Td,L.now=Sd,L.utc=gt,L.unix=rh,L.months=ih,L.isDate=Pr,L.locale=Lt,L.invalid=cs,L.duration=ot,L.isMoment=nt,L.weekdays=ah,L.parseZone=sh,L.localeData=Tt,L.isDuration=Cs,L.monthsShort=nh,L.weekdaysMin=ch,L.defineLocale=Zi,L.updateLocale=sd,L.locales=id,L.weekdaysShort=oh,L.normalizeUnits=Qe,L.relativeTimeRounding=Hh,L.relativeTimeThreshold=Ph,L.calendarFormat=Qd,L.prototype=O,L.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};let Rs=null,Se=null,yo=null;const Mh=()=>{se.on("incoming_call",()=>{sr.pushSound()}),se.on("local_dial",({number:s})=>{if(Rs){const e=Qt.makeURI(`sip:${s}@${Rs.configuration.uri.domain}`),t=new Sn(Rs,e);t.stateChange.addListener(r=>{r===B.Establishing?se.emitLocal("call_status","Calling..."):r===B.Established?(Se=t,se.emitLocal("call_status","InCall")):r===B.Terminated&&(se.emitLocal("call_status","Idle"),Se=null)}),t.invite()}}),se.on("local_hangup",()=>{sr.stopSound(),Se&&(Se.state===B.Established?Se.bye():typeof Se.reject=="function"?Se.reject():Se.cancel()),se.emitLocal("call_status","Idle"),se.emitLocal("call_duration","00:00"),se.emitToParent("sync_call_ended")}),se.on("local_answer",()=>{sr.stopSound(),Se&&Se.accept()}),se.on("local_toggle_mute",({muted:s})=>{}),se.on("local_toggle_hold",({hold:s})=>{Se&&typeof Se.hold=="function"&&(s?Se.hold():Se.unhold())}),se.on("local_dtmf",({key:s})=>{Se&&Se.sessionDescriptionHandler&&Se.sessionDescriptionHandler.sendDtmf(s)})},Nh=async s=>{var a,o;window.__sipjsEventsBound||(Mh(),window.__sipjsEventsBound=!0);const{auth:e}=s;if(!e)return;const t=e.user_pbx||e.username,r=e.pwd_pbx||e.secret,i=((o=(a=e.pabx_host)==null?void 0:a.replace("http://",""))==null?void 0:o.replace("https://",""))||e.pbxurl,n=e.port||8089;if(!(!t||!i))try{const d=Qt.makeURI(`sip:${t}@${i}`);if(!d)throw new Error("Failed to create SIP URI");const c=`wss://${i}:${n}`,l=new Qt({uri:d,transportOptions:{server:c},authorizationUsername:t,authorizationPassword:r,sessionDescriptionHandlerFactoryOptions:{peerConnectionConfiguration:{iceServers:[]},constraints:{audio:!0,video:!1}},logLevel:"warn"});Rs=l;const g=new ut(l);g.stateChange.addListener(u=>{u===le.Registered?se.emitLocal("register_status","REGISTERED"):(u===le.Unregistered||u===le.Terminated)&&se.emitLocal("register_status",{status:"FAILED",reason:"SIP Unregistered or Terminated"})}),l.delegate={onInvite(u){let y=!1;Se=u,se.emitLocal("sipjsSession",u),sr.pushSound(),sr.pushNotification(`New incoming call from ${u.remoteIdentity.uri.user}`),se.emitLocal("incoming_call",u),se.emitToParent("sync_incoming_call",u),u.stateChange.addListener(v=>{if(v===B.Established){y=!0,se.emitLocal("call_status","InCall"),se.emitToParent("sync_call_answered");const C=L();yo=setInterval(()=>{const _=L.duration(L().diff(C));se.emitLocal("call_duration",sr.toHHMMSS(_.asSeconds()))},1e3)}else v===B.Terminated&&(clearInterval(yo),sr.stopSound(),se.emitLocal("call_duration","00:00"),se.emitLocal("call_status","Idle"),y?se.emitToParent("sync_call_ended"):se.emitToParent("sync_call_unanswered"),Se=null)})}},await l.start(),await g.register()}catch(d){console.error("SipJS init error:",d),se.emitLocal("register_status",{status:"FAILED",reason:d.message||"Failed to connect to SIP server"})}},qh=({onSubmit:s})=>{const[e,t]=Ue.useState(""),[r,i]=Ue.useState(""),[n,a]=Ue.useState(""),o=d=>{d.preventDefault(),e&&r&&n&&s({username:e,password:r,host:n})};return Me.jsxs("div",{className:"w-full max-w-sm mx-auto p-6 bg-white/90 backdrop-blur-md rounded-2xl shadow-xl border border-gray-100",children:[Me.jsx("h2",{className:"text-2xl font-bold text-center text-primary mb-6",children:"Voice Login"}),Me.jsxs("form",{onSubmit:o,className:"space-y-4",children:[Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Username"}),Me.jsx("input",{type:"text",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"e.g. 1001",value:e,onChange:d=>t(d.target.value)})]}),Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Password"}),Me.jsx("input",{type:"password",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"••••••••",value:r,onChange:d=>i(d.target.value)})]}),Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Domain / Host"}),Me.jsx("input",{type:"text",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"e.g. sip.example.com",value:n,onChange:d=>a(d.target.value)})]}),Me.jsx("button",{type:"submit",className:"w-full py-2.5 px-4 bg-primary hover:bg-primary-hover text-white font-semibold rounded-lg shadow-md transition-colors active:scale-95 mt-4",children:"Connect"})]})]})};function Uh({config:s,onIncomingCall:e,onCallAnswered:t,onCallEnded:r,onCallUnanswered:i,onRegisterStatus:n}){var y;const[a,o]=Ue.useState(!1),[d,c]=Ue.useState(s);Ue.useEffect(()=>{c(s)},[s]),Ue.useEffect(()=>{var C;const v=(d==null?void 0:d.auth)||((C=d==null?void 0:d.pabxConfig)==null?void 0:C.auth)||{};!a&&(v.username||v.user_pbx)&&(v.pwd_pbx||v.secret)&&(v.pabx_host||v.host)&&(Nh({auth:v}),o(!0))},[d,a]);const l=v=>{const C={...d,auth:{...d==null?void 0:d.auth,username:v.username,user_pbx:v.username,pwd_pbx:v.password,secret:v.password,pabx_host:v.host}};c(C)};Ue.useEffect(()=>{const v=se.on("sync_incoming_call",E=>e&&e(E)),C=se.on("sync_call_answered",E=>t&&t(E)),_=se.on("sync_call_ended",E=>r&&r(E)),x=se.on("sync_call_unanswered",E=>i&&i(E)),p=se.on("register_status",E=>{E==="REGISTERED"?n&&n("REGISTERED"):(E==null?void 0:E.status)==="FAILED"&&n&&n("FAILED")});return()=>{v(),C(),_(),x(),p()}},[e,t,r,i,n]);const g=(d==null?void 0:d.auth)||((y=d==null?void 0:d.pabxConfig)==null?void 0:y.auth)||{};return!!((g.username||g.user_pbx)&&(g.pwd_pbx||g.secret))||d!=null&&d.accessToken?null:Me.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:Me.jsx(qh,{onSubmit:l})})}Kt.
|
|
102
|
+
L.version="2.30.1",M0(Ee),L.fn=O,L.min=Ad,L.max=Td,L.now=Sd,L.utc=gt,L.unix=rh,L.months=ih,L.isDate=Pr,L.locale=Lt,L.invalid=cs,L.duration=ot,L.isMoment=nt,L.weekdays=ah,L.parseZone=sh,L.localeData=Tt,L.isDuration=Cs,L.monthsShort=nh,L.weekdaysMin=ch,L.defineLocale=Zi,L.updateLocale=sd,L.locales=id,L.weekdaysShort=oh,L.normalizeUnits=Qe,L.relativeTimeRounding=Hh,L.relativeTimeThreshold=Ph,L.calendarFormat=Qd,L.prototype=O,L.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};let Rs=null,Se=null,yo=null;const Mh=()=>{se.on("incoming_call",()=>{sr.pushSound()}),se.on("local_dial",({number:s})=>{if(Rs){const e=Qt.makeURI(`sip:${s}@${Rs.configuration.uri.domain}`),t=new Sn(Rs,e);t.stateChange.addListener(r=>{r===B.Establishing?se.emitLocal("call_status","Calling..."):r===B.Established?(Se=t,se.emitLocal("call_status","InCall")):r===B.Terminated&&(se.emitLocal("call_status","Idle"),Se=null)}),t.invite()}}),se.on("local_hangup",()=>{sr.stopSound(),Se&&(Se.state===B.Established?Se.bye():typeof Se.reject=="function"?Se.reject():Se.cancel()),se.emitLocal("call_status","Idle"),se.emitLocal("call_duration","00:00"),se.emitToParent("sync_call_ended")}),se.on("local_answer",()=>{sr.stopSound(),Se&&Se.accept()}),se.on("local_toggle_mute",({muted:s})=>{}),se.on("local_toggle_hold",({hold:s})=>{Se&&typeof Se.hold=="function"&&(s?Se.hold():Se.unhold())}),se.on("local_dtmf",({key:s})=>{Se&&Se.sessionDescriptionHandler&&Se.sessionDescriptionHandler.sendDtmf(s)})},Nh=async s=>{var a,o;window.__sipjsEventsBound||(Mh(),window.__sipjsEventsBound=!0);const{auth:e}=s;if(!e)return;const t=e.user_pbx||e.username,r=e.pwd_pbx||e.secret,i=((o=(a=e.pabx_host)==null?void 0:a.replace("http://",""))==null?void 0:o.replace("https://",""))||e.pbxurl,n=e.port||8089;if(!(!t||!i))try{const d=Qt.makeURI(`sip:${t}@${i}`);if(!d)throw new Error("Failed to create SIP URI");const c=`wss://${i}:${n}`,l=new Qt({uri:d,transportOptions:{server:c},authorizationUsername:t,authorizationPassword:r,sessionDescriptionHandlerFactoryOptions:{peerConnectionConfiguration:{iceServers:[]},constraints:{audio:!0,video:!1}},logLevel:"warn"});Rs=l;const g=new ut(l);g.stateChange.addListener(u=>{u===le.Registered?se.emitLocal("register_status","REGISTERED"):(u===le.Unregistered||u===le.Terminated)&&se.emitLocal("register_status",{status:"FAILED",reason:"SIP Unregistered or Terminated"})}),l.delegate={onInvite(u){let y=!1;Se=u,se.emitLocal("sipjsSession",u),sr.pushSound(),sr.pushNotification(`New incoming call from ${u.remoteIdentity.uri.user}`),se.emitLocal("incoming_call",u),se.emitToParent("sync_incoming_call",u),u.stateChange.addListener(v=>{if(v===B.Established){y=!0,se.emitLocal("call_status","InCall"),se.emitToParent("sync_call_answered");const C=L();yo=setInterval(()=>{const _=L.duration(L().diff(C));se.emitLocal("call_duration",sr.toHHMMSS(_.asSeconds()))},1e3)}else v===B.Terminated&&(clearInterval(yo),sr.stopSound(),se.emitLocal("call_duration","00:00"),se.emitLocal("call_status","Idle"),y?se.emitToParent("sync_call_ended"):se.emitToParent("sync_call_unanswered"),Se=null)})}},await l.start(),await g.register()}catch(d){console.error("SipJS init error:",d),se.emitLocal("register_status",{status:"FAILED",reason:d.message||"Failed to connect to SIP server"})}},qh=({onSubmit:s})=>{const[e,t]=Ue.useState(""),[r,i]=Ue.useState(""),[n,a]=Ue.useState(""),o=d=>{d.preventDefault(),e&&r&&n&&s({username:e,password:r,host:n})};return Me.jsxs("div",{className:"w-full max-w-sm mx-auto p-6 bg-white/90 backdrop-blur-md rounded-2xl shadow-xl border border-gray-100",children:[Me.jsx("h2",{className:"text-2xl font-bold text-center text-primary mb-6",children:"Voice Login"}),Me.jsxs("form",{onSubmit:o,className:"space-y-4",children:[Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Username"}),Me.jsx("input",{type:"text",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"e.g. 1001",value:e,onChange:d=>t(d.target.value)})]}),Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Password"}),Me.jsx("input",{type:"password",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"••••••••",value:r,onChange:d=>i(d.target.value)})]}),Me.jsxs("div",{children:[Me.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"SIP Domain / Host"}),Me.jsx("input",{type:"text",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none transition-all",placeholder:"e.g. sip.example.com",value:n,onChange:d=>a(d.target.value)})]}),Me.jsx("button",{type:"submit",className:"w-full py-2.5 px-4 bg-primary hover:bg-primary-hover text-white font-semibold rounded-lg shadow-md transition-colors active:scale-95 mt-4",children:"Connect"})]})]})};function Uh({config:s,onIncomingCall:e,onCallAnswered:t,onCallEnded:r,onCallUnanswered:i,onRegisterStatus:n}){var y;const[a,o]=Ue.useState(!1),[d,c]=Ue.useState(s);Ue.useEffect(()=>{c(s)},[s]),Ue.useEffect(()=>{var C;const v=(d==null?void 0:d.auth)||((C=d==null?void 0:d.pabxConfig)==null?void 0:C.auth)||{};!a&&(v.username||v.user_pbx)&&(v.pwd_pbx||v.secret)&&(v.pabx_host||v.host)&&(Nh({auth:v}),o(!0))},[d,a]);const l=v=>{const C={...d,auth:{...d==null?void 0:d.auth,username:v.username,user_pbx:v.username,pwd_pbx:v.password,secret:v.password,pabx_host:v.host}};c(C)};Ue.useEffect(()=>{const v=se.on("sync_incoming_call",E=>e&&e(E)),C=se.on("sync_call_answered",E=>t&&t(E)),_=se.on("sync_call_ended",E=>r&&r(E)),x=se.on("sync_call_unanswered",E=>i&&i(E)),p=se.on("register_status",E=>{E==="REGISTERED"?n&&n("REGISTERED"):(E==null?void 0:E.status)==="FAILED"&&n&&n("FAILED")});return()=>{v(),C(),_(),x(),p()}},[e,t,r,i,n]);const g=(d==null?void 0:d.auth)||((y=d==null?void 0:d.pabxConfig)==null?void 0:y.auth)||{};return!!((g.username||g.user_pbx)&&(g.pwd_pbx||g.secret))||d!=null&&d.accessToken?null:Me.jsx("div",{className:"fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:Me.jsx(qh,{onSubmit:l})})}Kt.Voxnix=Uh,Object.defineProperty(Kt,Symbol.toStringTag,{value:"Module"})});
|