PageSourceSearch

https://spellcrmpro.com/_next/static/chunks/5251.2fa04e3b376ea9aa.js

js spellcrmpro.com collected 2026-10-02 00:57:34 UTC 8,722 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5251],{13732:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(27541),o=n(7620),l=n.t(o,2),a=n(66056),u=l["use".trim()],c=n(21055),i=n(30634),s=n(60724),d=n(54568),f=n(52472);function p(e){let{Link:t,config:n,getPathname:l,...p}=function(e,t){var n,l,a;let f={...n=t||{},localePrefix:"object"==typeof(a=n.localePrefix)?a:{mode:a||"always"},localeCookie:!!((l=n.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof l&&l},localeDetection:n.localeDetection??!0,alternateLinks:n.alternateLinks??!0},p=f.pathnames,h=(0,o.forwardRef)(function({href:t,locale:n,...r},o){let l,a;"object"==typeof t?(l=t.pathname,a=t.params):l=t;let s=(0,c._x)(t),h=e(),g=(0,c.yL)(h)?u(h):h,y=s?m({locale:n||g,href:null==p?l:{pathname:l,params:a},forcePrefix:null!=n||void 0}):l;return(0,d.jsx)(i.default,{ref:o,href:"object"==typeof t?{...t,pathname:y}:y,locale:n,localeCookie:f.localeCookie,...r})});function m(e){let t,{forcePrefix:n,href:r,locale:o}=e;return null==p?"object"==typeof r?(t=r.pathname,r.query&&(t+=(0,s.Zn)(r.query))):t=r:t=(0,s.FP)({locale:o,...(0,s.TK)(r),pathnames:f.pathnames}),(0,s.x3)(t,o,f,n)}function g(e){return function(t,...n){return e(m(t),...n)}}return{config:f,Link:h,redirect:g(r.redirect),permanentRedirect:g(r.permanentRedirect),getPathname:m}}(a.Ym,e);return{...p,Link:t,usePathname:function(){let e=function(e){let t=(0,r.usePathname)(),n=(0,a.Ym)();return(0,o.useMemo)(()=>{if(!t)return t;let r=t,o=(0,c.XP)(n,e.localePrefix);if((0,c.wO)(o,t))r=(0,c.MY)(t,o);else if("never"!==e.localePrefix.mode&&e.localePrefix.prefixes){let e=(0,c.bL)(n);(0,c.wO)(e,t)&&(r=(0,c.MY)(t,e))}return r},[e.localePrefix,n,t])}(n),t=(0,a.Ym)();return(0,o.useMemo)(()=>e&&n.pathnames?(0,s.aM)(t,e,n.pathnames):e,[t,e])},useRouter:function(){let e=(0,r.useRouter)(),t=(0,a.Ym)(),u=(0,r.usePathname)();return(0,o.useMemo)(()=>{function r(e){return function(r,o){let{locale:a,...c}=o||{},i=[l({href:r,locale:a||t,forcePrefix:null!=a||void 0})];Object.keys(c).length>0&&i.push(c),(0,f.A)(n.localeCookie,u,t,a),e(...i)}}return{...e,push:r(e.push),replace:r(e.replace),prefetch:r(e.prefetch)}},[t,u,e])},getPathname:l}}},20185:(e,t,n)=>{n.d(t,{E:()=>o});var r=n(7620);function o(){let[e]=(0,r.useState)(()=>{try{return window.self!==window.top}catch(e){return!0}});return e}},35025:(e,t,n)=>{n.d(t,{FX:()=>a,jH:()=>u});var r=n(7620),o=n(54568),l=r.createContext(void 0),a=e=>{let{dir:t,children:n}=e;return(0,o.jsx)(l.Provider,{value:t,children:n})};function u(e){let t=r.useContext(l);return e||t||"ltr"}},70630:(e,t,n)=>{n.d(t,{G_:()=>f,Wp:()=>p,kH:()=>d});var r=n(54568),o=n(7620),l=n(12982),a=n(95979),u=n(20185),c=n(3600),i=n(48078);let s=o.createContext(null);function d(){let e=o.useContext(s);if(!e)throw Error("useSoftphone must be used within SoftphoneProvider");return e}function f(){return o.useContext(s)}function p(e){let{children:t}=e,{t:d}=(0,i.x_)(),{user:f,token:p}=(0,a.useAuthStore)(),[h,m]=o.useState("idle"),[g,y]=o.useState(null),[v,w]=o.useState(null),[k,b]=o.useState(null),[S,P]=o.useState(null),[C,x]=o.useState(!1),E=(0,u.E)(),A=o.useRef(null),M=o.useRef(null),T=o.useCallback(async()=>{try{return(await l.FH.get("/voice/token")).data.token}catch(n){var e,t;return(null==n?void 0:n.status)===400||(null==n||null==(t=n.message)||null==(e=t.toLowerCase)?void 0:e.call(t).includes("not configured"))?m("unconfigured"):(m("error"),console.warn("[softphone] token mint failed:",n)),null}},[]),j=o.useCallback((e,t,n)=>{y(e),w(t),b(n),x(!1),"outbound"===t?m("connecting"):m("incoming"),e.on("accept",()=>{m("on-call"),P(Date.now())}),e.on("disconnect",()=>{m("ready"),y(null),w(null),b(null),P(null),x(!1)}),e.on("cancel",()=>{m("ready"),y(null),w(null),b(null)}),e.on("reject",()=>{m("ready"),y(null),w(null),b(null)}),e.on("error",e=>{console.warn("[softphone] call error:",e),c.Ay.error(d("ui.4aadc495815d",{p0:e.message||"unknown"})),m("ready"),y(null),w(null),b(null)})},[]);o.useEffect(()=>{if(E)return void m("unconfigured");if(!f||!p){var e;null==(e=A.current)||e.destroy(),A.current=null,m("idle");return}let t=!1,r=Date.now();return(async()=>{let e=await new Promise(e=>{let t=!1,n=n=>{t||(t=!0,window.removeEventListener("message",o),clearTimeout(l),e(n))},r=new Set(["ready","embed-ready","app-ready","init-ack"]),o=e=>{try{if(!new URL(e.origin).hostname.endsWith("spell.solutions"))return}catch(e){return}let t=e.data;if(console.log("[softphone] messenger postMessage:",t),t&&"object"==typeof t){let e=t.type||t.event||t.kind;e&&r.has(String(e))&&n("postMessage:".concat(e))}};window.addEventListener("message",o);let l=setTimeout(()=>n("timeout"),8e3)});(async()=>
1{if(t)return;let o=Date.now()-r;console.log("[softphone] init gate released after ".concat(o,"ms (").concat(e,")")),m("registering");let{Device:a}=await n.e(3753).then(n.bind(n,6134));if(t)return;let u=await T();if(!t&&u)try{let e=new a(u,{codecPreferences:["opus","pcmu"],logLevel:1}),t=()=>{l.FH.post("/voice/presence",{}).catch(()=>{})};e.on("registered",()=>{m("ready"),t(),M.current&&clearInterval(M.current),M.current=setInterval(t,3e4)}),e.on("unregistered",()=>{M.current&&(clearInterval(M.current),M.current=null)}),e.on("error",t=>{console.warn("[softphone] device error:",t),20104===t.code||31005===t.code?T().then(t=>t&&e.updateToken(t)):m("error")}),e.on("tokenWillExpire",async()=>{let t=await T();t&&e.updateToken(t)}),e.on("incoming",e=>{var t;let n=(null==(t=e.parameters)?void 0:t.From)||"Unknown";j(e,"inbound",n)}),await e.register(),A.current=e}catch(e){console.warn("[softphone] device init failed:",e),m("error")}})()})(),()=>{t=!0,M.current&&(clearInterval(M.current),M.current=null)}},[null==f?void 0:f.id,p,E]);let L=o.useCallback(async e=>{if(!A.current)return void c.Ay.error(d("ui.e60fb70c166b"));if("unconfigured"===h)return void c.Ay.error(d("ui.9dc7a8ea398d"));if(g)return void c.Ay.error(d("ui.2d7bb36f0929"));try{let t=await A.current.connect({params:{To:e,userId:(null==f?void 0:f.id)||""}});j(t,"outbound",e)}catch(e){c.Ay.error(d("ui.0d19e144b3b3",{p0:(null==e?void 0:e.message)||"unknown"}))}},[g,h,j]),D=o.useCallback(()=>{null==g||g.disconnect()},[g]),N=o.useCallback(()=>{null==g||g.accept()},[g]),I=o.useCallback(()=>{null==g||g.reject()},[g]),R=o.useCallback(e=>{null==g||g.mute(e),x(e)},[g]),O=o.useCallback(e=>{null==g||g.sendDigits(e)},[g]);return(0,r.jsx)(s.Provider,{value:{status:h,currentCall:g,callDirection:v,remoteParty:k,callStartedAt:S,isMuted:C,dial:L,hangup:D,acceptIncoming:N,rejectIncoming:I,setMuted:R,sendDigit:O},children:t})}},81747:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var r=n(54568),o=n(7620),l=n(70630);function a(){return(0,r.jsx)(l.Wp,{children:(0,r.jsx)(u,{})})}function u(){let e=(0,l.kH)(),t=(0,o.useRef)("");return(0,o.useEffect)(()=>{let t=window;return t.softphoneCommand=t=>{try{let n="string"==typeof t?JSON.parse(t):t;switch(null==n?void 0:n.type){case"DIAL":"string"==typeof n.to&&n.to.length>0&&e.dial(n.to).catch(e=>{var t;c({type:"STATE",state:"error",error:String(null!=(t=null==e?void 0:e.message)?t:e)})});break;case"HANGUP":e.hangup();break;case"MUTE":e.setMuted(!!n.muted);break;case"SEND_DIGIT":"string"==typeof n.digit&&e.sendDigit(n.digit);break;case"ACCEPT":e.acceptIncoming();break;case"REJECT":e.rejectIncoming();break;case"PING":c({type:"PONG"})}}catch(e){var n;c({type:"STATE",state:"error",error:"bridge: "+String(null!=(n=null==e?void 0:e.message)?n:e)})}},c({type:"READY"}),()=>{delete t.softphoneCommand}},[e]),(0,o.useEffect)(()=>{var n,r;let o=JSON.stringify({type:"STATE",state:function(e,t){let n=String(null!=e?e:"").toLowerCase();return n.includes("error")||n.includes("fail")?"error":n.includes("connected")||n.includes("open")?"connected":n.includes("ringing")||n.includes("pending")||"connecting"===n?"inbound"===t?"incoming":"ringing":n.includes("disconnect")||"closed"===n||"ended"===n?"idle":n||"idle"}(e.status,e.callDirection),remoteParty:null!=(n=e.remoteParty)?n:null,callStartedAt:null!=(r=e.callStartedAt)?r:null});o!==t.current&&(t.current=o,c(JSON.parse(o)))},[e.status,e.callDirection,e.remoteParty,e.callStartedAt]),(0,o.useEffect)(()=>{c({type:"MUTED",muted:e.isMuted})},[e.isMuted]),null}function c(e){var t,n;let r;try{r=JSON.stringify(e)}catch(e){return}let o=window;if(o.SoftphoneNative&&"function"==typeof o.SoftphoneNative.postMessage)try{o.SoftphoneNative.postMessage(r);return}catch(e){}let l=null==(n=o.webkit)||null==(t=n.messageHandlers)?void 0:t.softphone;if(l&&"function"==typeof l.postMessage)try{l.postMessage(r);return}catch(e){}if(o.AndroidSoftphone&&"function"==typeof o.AndroidSoftphone.postMessage)try{o.AndroidSoftphone.postMessage(r);return}catch(e){}}},98318:(e,t,n)=>{n.d(t,{A:()=>r});function r(e){return e}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.