PageSourceSearch

https://www.twain.ai/assets/dist-DbdyPjtQ.js

js twain.ai collected 2026-10-01 13:10:35 UTC 6,484 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`b2f0c21e-d61c-458d-981a-7fdfc3acf436`,e._sentryDebugIdIdentifier=`sentry-dbid-b2f0c21e-d61c-458d-981a-7fdfc3acf436`)}catch{}})();import{a as e}from"./rolldown-runtime-BMeI84Mc.js";import{t}from"./react-WDKYc4qm.js";var n=e(t(),1),r=Object.defineProperty,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||={})a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},l=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},u=(e,t)=>{let n=`[react-use-intercom]`;switch(e){case`info`:console.log(`${n} ${t}`);break;case`warn`:console.warn(`${n} ${t}`);break;case`error`:console.error(`${n} ${t}`);break;default:console.log(`${n} ${t}`)}},d=typeof window>`u`,f=e=>(Object.keys(e).forEach(t=>{e[t]&&typeof e[t]==`object`?f(e[t]):e[t]===void 0&&delete e[t]}),e),p=(e,...t)=>{if(!d&&window.Intercom)return window.Intercom.apply(null,[e,...t]);u(`error`,`${e} Intercom instance is not initalized yet`)},m=n.createContext(void 0),h=(e,t=0,n)=>{var r=window,i=r.Intercom;if(typeof i==`function`)i(`reattach_activator`),i(`update`,r.intercomSettings);else{var a=document,o=function(){o.c(arguments)};o.q=[],o.c=function(e){o.q.push(e)},r.Intercom=o;var s=function(){setTimeout(function(){var t=a.createElement(`script`);t.type=`text/javascript`,t.async=!0,n&&t.setAttribute(`nonce`,n),t.src=`https://widget.intercom.io/widget/`+e;var r=a.getElementsByTagName(`script`)[0];r.parentNode.insertBefore(t,r)},t)};document.readyState===`complete`?s():r.attachEvent?r.attachEvent(`onload`,s):r.addEventListener(`load`,s,!1)}},g=e=>({custom_launcher_selector:e.customLauncherSelector,alignment:e.alignment,vertical_padding:e.verticalPadding,horizontal_padding:e.horizontalPadding,z_index:e.zIndex,hide_default_launcher:e.hideDefaultLauncher,session_duration:e.sessionDuration,action_color:e.actionColor,background_color:e.backgroundColor}),_=e=>c({company_id:e.companyId,name:e.name,created_at:e.createdAt,plan:e.plan,monthly_spend:e.monthlySpend,user_count:e.userCount,size:e.size,website:e.website,industry:e.industry},e.customAttributes),v=e=>({type:e.type,image_url:e.imageUrl}),y=e=>c({email:e.email,user_id:e.userId,created_at:e.createdAt,name:e.name,phone:e.phone,last_request_at:e.lastRequestAt,unsubscribed_from_emails:e.unsubscribedFromEmails,language_override:e.languageOverride,utm_campaign:e.utmCampaign,utm_content:e.utmContent,utm_medium:e.utmMedium,utm_source:e.utmSource,utm_term:e.utmTerm,avatar:e.avatar&&v(e.avatar),user_hash:e.userHash,company:e.company&&_(e.company),companies:e.companies?.map(_),intercom_user_jwt:e.intercomUserJwt},e.customAttributes),b=e=>f(c(c({},g(e)),y(e))),x=e=>{var t=e,{appId:r,autoBoot:i=!1,autoBootProps:a,children:o,onHide:s,onShow:f,onUnreadCountChange:g,onUserEmailSupplied:_,shouldInitialize:v=!d,apiBase:y,initializeDelay:x,cspNonce:S}=t,C=l(t,[`appId`,`autoBoot`,`autoBootProps`,`children`,`onHide`,`onShow`,`onUnreadCountChange`,`onUserEmailSupplied`,`shouldInitialize`,`apiBase`,`initializeDelay`,`cspNonce`]);let w=n.useRef(!1),T=n.useRef(!1),[E,D]=n.useState(!1),O=Object.keys(C).filter(e=>!e.startsWith(`data-`));O.length>0&&u(`warn`,[`some invalid props were passed to IntercomProvider. `,`Please check following props: ${O.join(`, `)}.`].join(``));let k=n.useCallback(e=>{if(!window.Intercom&&!v){u(`warn`,"Intercom instance is not initialized because `shouldInitialize` is set to `false` in `IntercomProvider`");return}if(w.current)return;p(`onHide`,()=>{D(!1),s?.()}),p(`onShow`,()=>{D(!0),f?.()}),p(`onUserEmailSupplied`,_),g&&p(`onUnreadCountChange`,g);let t=c(c({app_id:r},y&&{api_base:y}),e&&b(e));window.intercomSettings=t,p(`boot`,t),w.current=!0},[y,r,s,f,g,_,v]);!d&&v&&!T.current&&(h(r,x,S),i&&k(a),T.current=!0);let A=n.useCallback((e,t)=>{if(!window.Intercom&&!v){u(`warn`,"Intercom instance is not initialized because `shouldInitialize` is set to `false` in `IntercomProvider`");return}if(!w.current){u(`warn`,[`"${e}" was called but Intercom has not booted yet. `,`Please call 'boot' before calling '${e}' or `,`set 'autoBoot' to true in the IntercomProvider.`].join(``));return}return t()},[v]),j=n.useCallback(()=>{w.current&&=(p(`shutdown`),delete window.intercomSettings,!1)},[]),M=n.useCallback(()=>{w.current&&=(p(`shutdown`),delete window.Intercom,delete window.intercomSettings,!1)},[]),N=n.useCallback(()=>{A(`update`,()=>{p(`update`,{last_request_at:Math.floor(new Date().getTime()/1e3)})})},[A]),P=n.useCallback(e=>{A(`update`,()=>{if(!e){N();return}let t=b(e);window.intercomSettings=c(c({},window.intercomSettings),t),p(`update`,t)})},[A,N]),F=n.useCallback(()=>{A(`hide`,()=>{p(`hide`)})},[A]),I=n.useCallback(()=>{A(`show`,()=>p(`show`))},[A]),L=n.useCallback(()=>{A(`showMessages`,()=>{p(`showMessages`)})},[A]),R=n.useCallback(e=>{A(`showNewMessage`,()=>{e?p(`showNewMessage`,e):p(`showNewMessage`)})},[A]),z=n.useCallback(()=>A(`getVisitorId`,()=>p(`getVisitorId`)),[A]),B=n.useCallback(e=>{A(`startTour`,()=>{p(`startTour`,e)})},[A]),V=n.useCallback(e=>{A(`startChecklist`,()=>{p(`startChecklist`,e)})},[A]),H=n.useCallback((e,t)=>{A(`trackEvent`,()=>{t?p(`trackEvent`,e,t):p(`trackEvent`,e)})},[A]),U=n.useCallback(e=>A(`showArticle`,()=>{p(`showArticle`,e)}),[A]),W=n.useCallback(e=>A(`showSpace`,()=>{p(`showSpace`,e)}),[A]),G=n.useCallback(e=>{A(`startSurvey`,()=>{p(`startSurvey`,e)})},[A]),K=n.useCallback(e=>A(`showNews`,()=>{p(`showNews`,e)}),[A]),q=n.useCallback(e=>A(`showTicket`,()=>{p(`showTicket`,e)}),[A]),J=n.useCallback(e=>A(`showConversation`,()=>{p(`showConversation`,e)}),[A]),Y=n.useMemo(()=>({boot:k,shutdown:j,hardShutdown:M,update:P,hide:F,show:I,isOpen:E,showMessages:L,showNewMessage:R,getVisitorId:z,startTour:B,startChecklist:V,trackEvent:H,showArticle:U,startSurvey:G,showSpace:W,showNews:K,showTicket:q,showConversation:J}),[k,j,M,P,F,I,E,L,R,z,B,V,H,U,G,W,K,q,J]);return n.createElement(m.Provider,{value:Y},o)},S=()=>{let e=n.useContext(m);if(e===void 0)throw Error('"useIntercom" must be used within `IntercomProvider`.');return e},C=()=>S();export{C as n,x as t};

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.