PageSourceSearch

https://new.scopeapp.io/_next/static/chunks/pages/admin/customer_invite-b8d0e533780c848d.js

js scopeapp.io collected 2026-09-26 03:35:09 UTC 9,579 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9432],{98840:(e,n,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/customer_invite",function(){return a(98919)}])},98919:(e,n,a)=>{"use strict";a.r(n),a.d(n,{default:()=>R});var l=a(37876),t=a(27964),s=a(54431),i=a(64177),r=a(14232),c=a(2827),o=a(25573),m=a(47528),u=a(12514),d=a(28888),_=a(79350);function x(){let e=(0,d._)(["\n  mutation Admin_customer_invite(\n    $email: String!\n    $countryCode: Int!\n    $startImmediately: Boolean!\n    $displayname: String!\n    $companyLabel: String!\n    $companyIgUsername: String!\n    $trialEndedPageId: ID!\n    $trialExpiresAt: String\n    $companyPlanName: String\n    $accountRole: String\n  ) {\n    admin_customer_invite(\n      email: $email\n      country_code: $countryCode\n      start_immediately: $startImmediately\n      displayname: $displayname\n      company_label: $companyLabel\n      company_ig_username: $companyIgUsername\n      trial_ended_page_id: $trialEndedPageId\n      trial_expires_at: $trialExpiresAt\n      company_plan_name: $companyPlanName\n      account_role: $accountRole\n    ) {\n      success\n      errors\n      invite_link\n    }\n  }\n"]);return x=function(){return e},e}let v=(0,_.J1)(x());var p=a(45322),h=a(56557),f=a.n(h);function y(){let e=(0,d._)(["\n  query Admin_customer_invite_context {\n    admin_customer_invite_context {\n      success\n      errors\n      plan_names\n      trial_ended_pages {\n        id\n        name\n        template\n      }\n    }\n  }\n"]);return y=function(){return e},e}let g=(0,_.J1)(y());var b=a(97685),S=a(42638),N=a(61637),j=a(8373),C=a(86515);let $=[{label:"Admin",value:"company_admin"},{label:"User",value:"user"},{label:"Finance",value:"finance"}];function A(){var e,n,a,d,_,x,h,y,A,R,T;let B,L,U,V,F,J,O,X,q,z,D,M,W,G,H,K,Q,Y,Z,ee,en,ea,el,et,es,ei,er,ec,eo,em,eu,ed,e_,ex,ev,ep,eh=(0,t.c)(86),{data:ef}=(0,s.IT)(g);eh[0]!==(null==ef||null==(e=ef.admin_customer_invite_context)?void 0:e.trial_ended_pages)?(B=null!=(_=null==ef||null==(a=ef.admin_customer_invite_context)?void 0:a.trial_ended_pages.map(P))?_:[{label:"Select...",value:""}],eh[0]=null==ef||null==(d=ef.admin_customer_invite_context)?void 0:d.trial_ended_pages,eh[1]=B):B=eh[1];let ey=B;if(eh[2]!==(null==ef||null==(n=ef.admin_customer_invite_context)?void 0:n.plan_names)){let e;eh[4]===Symbol.for("react.memo_cache_sentinel")?(e={label:"None (default)",value:""},eh[4]=e):e=eh[4],L=[...null!=(A=null==ef||null==(h=ef.admin_customer_invite_context)||null==(x=h.plan_names)?void 0:x.map(k))?A:[],e],eh[2]=null==ef||null==(y=ef.admin_customer_invite_context)?void 0:y.plan_names,eh[3]=L}else L=eh[3];let eg=L,[eb]=(0,i.n)(v),[eS,eN]=(0,r.useState)(""),[ej,eC]=(0,r.useState)(""),[e$,eA]=(0,r.useState)(""),[eE,ew]=(0,r.useState)(""),[eI,ek]=(0,r.useState)(!1),[eP,eR]=(0,r.useState)(ey[0]),[eT,eB]=(0,r.useState)(null),[eL,eU]=(0,r.useState)(eg[0]);eh[5]===Symbol.for("react.memo_cache_sentinel")?(U=null!=(T=null==(R=p.A.filter(I))?void 0:R.map(w)[0])?T:{code:46,name:"SE"},eh[5]=U):U=eh[5];let[eV,eF]=(0,r.useState)(U),[eJ,eO]=(0,r.useState)($[0]),[eX,eq]=(0,r.useState)("");eh[6]===Symbol.for("react.memo_cache_sentinel")?(V=[],eh[6]=V):V=eh[6];let[ez,eD]=(0,r.useState)(V),eM=!(0,N.B9)(eS)||!ej||!e$||!eE||!eP.value.length||!eL||!eV;eh[7]!==eE||eh[8]!==e$||eh[9]!==eV||eh[10]!==eb||eh[11]!==eS||eh[12]!==eT||eh[13]!==ej||eh[14]!==eM||eh[15]!==eP||eh[16]!==eL||eh[17]!==eJ||eh[18]!==eI?(F=async()=>{var e,n,a,l,t;if(eM)return void b.oR.error("Missing fields");let s=await eb({variables:{email:eS,displayname:ej,companyLabel:e$,companyIgUsername:eE,startImmediately:eI,trialEndedPageId:eP.value,trialExpiresAt:f()(eT).isValid()?f()(eT).format(S.iW):void 0,companyPlanName:eL.value,countryCode:eV.code,accountRole:eJ.value}});(null==(n=s.data)||null==(e=n.admin_customer_invite.errors)?void 0:e.length)?(eD(null==(a=s.data)?void 0:a.admin_customer_invite.errors),b.oR.error("Failed to create invite link")):(eq(null!=(t=null==(l=s.data)?void 0:l.admin_customer_invite.invite_link)?t:""),b.oR.success("Created"))},eh[7]=eE,eh[8]=e$,eh[9]=eV,eh[10]=eb,eh[11]=eS,eh[12]=eT,eh[13]=ej,eh[14]=eM,eh[15]=eP,eh[16]=eL,eh[17]=eJ,eh[18]=eI,eh[19]=F):F=eh[19];let eW=F;eh[20]===Symbol.for("react.memo_cache_sentinel")?(J=(0,l.jsx)("h1",{className:"text-lg text-gray-700",children:"Invite New Customer"}),eh[20]=J):J=eh[20],eh[21]===Symbol.for("react.memo_cache_sentinel")?(O=e=>eN(e.target.value),eh[21]=O):O=eh[21],eh[22]!==eS?(X=(0,l.jsx)(m.A,{onChange:O,value:e
1S,label:"Email",type:"email",placeholder:"Enter email address"}),q=eS.length&&!(0,N.B9)(eS)?(0,l.jsx)("span",{className:"absolute right-0 top-0 z-50 text-xs text-red-500",children:"Email not valid"}):null,eh[22]=eS,eh[23]=X,eh[24]=q):(X=eh[23],q=eh[24]),eh[25]!==X||eh[26]!==q?(z=(0,l.jsxs)("div",{className:"relative",children:[X,q]}),eh[25]=X,eh[26]=q,eh[27]=z):z=eh[27],eh[28]===Symbol.for("react.memo_cache_sentinel")?(D=e=>eC(e.target.value),eh[28]=D):D=eh[28],eh[29]!==ej?(M=(0,l.jsx)(m.A,{onChange:D,value:ej,label:"Name",placeholder:"Enter full name"}),eh[29]=ej,eh[30]=M):M=eh[30],eh[31]===Symbol.for("react.memo_cache_sentinel")?(W=e=>eA(e.target.value),eh[31]=W):W=eh[31],eh[32]!==e$?(G=(0,l.jsx)(m.A,{onChange:W,value:e$,label:"Company Name",placeholder:"Enter company name"}),eh[32]=e$,eh[33]=G):G=eh[33],eh[34]===Symbol.for("react.memo_cache_sentinel")?(H=e=>ew(e.target.value),eh[34]=H):H=eh[34],eh[35]!==eE?(K=(0,l.jsx)(m.A,{onChange:H,value:eE,label:"Brand Instagram username",placeholder:"Enter instagram username"}),eh[35]=eE,eh[36]=K):K=eh[36],eh[37]===Symbol.for("react.memo_cache_sentinel")?(Q=e=>ek(e.target.checked),eh[37]=Q):Q=eh[37],eh[38]!==eI?(Y=(0,l.jsx)(o.A,{isValueShown:eI,onChange:Q,label:"Start immediately (skip trial)"}),eh[38]=eI,eh[39]=Y):Y=eh[39],eh[40]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Account Role"}),eh[40]=Z):Z=eh[40],eh[41]===Symbol.for("react.memo_cache_sentinel")?(ee=e=>e&&eO(e),eh[41]=ee):ee=eh[41],eh[42]!==eJ?(en=(0,l.jsxs)("div",{className:"flex flex-col",children:[Z,(0,l.jsx)(c.Ay,{options:$,value:eJ,onChange:ee})]}),eh[42]=eJ,eh[43]=en):en=eh[43],eh[44]===Symbol.for("react.memo_cache_sentinel")?(ea=(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Select page to show when trial expires:"}),eh[44]=ea):ea=eh[44],eh[45]===Symbol.for("react.memo_cache_sentinel")?(el=e=>eR(null!=e?e:{label:"None (default)",value:""}),eh[45]=el):el=eh[45],eh[46]!==ey||eh[47]!==eP?(et=(0,l.jsxs)("div",{className:"flex flex-col",children:[ea,(0,l.jsx)(c.Ay,{options:ey,value:eP,onChange:el})]}),eh[46]=ey,eh[47]=eP,eh[48]=et):et=eh[48],eh[49]===Symbol.for("react.memo_cache_sentinel")?(es=(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Trial expiry date"}),eh[49]=es):es=eh[49],eh[50]===Symbol.for("react.memo_cache_sentinel")?(ei=e=>eB(e),eh[50]=ei):ei=eh[50],eh[51]!==eT?(er=(0,l.jsxs)("div",{className:"flex w-3/4 flex-col",children:[es,(0,l.jsx)(j.A,{onChange:ei,value:eT})]}),eh[51]=eT,eh[52]=er):er=eh[52],eh[53]===Symbol.for("react.memo_cache_sentinel")?(ec=(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Pre-select plan (leave None for standard plans)"}),eh[53]=ec):ec=eh[53],eh[54]!==eg[0]?(eo=e=>eU(e||eg[0]),eh[54]=eg[0],eh[55]=eo):eo=eh[55],eh[56]!==eg||eh[57]!==eL||eh[58]!==eo?(em=(0,l.jsxs)("div",{className:"flex flex-col",children:[ec,(0,l.jsx)(c.Ay,{options:eg,value:eL,onChange:eo})]}),eh[56]=eg,eh[57]=eL,eh[58]=eo,eh[59]=em):em=eh[59],eh[60]===Symbol.for("react.memo_cache_sentinel")?(eu=(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Country"}),eh[60]=eu):eu=eh[60],eh[61]!==eV?(ed=(0,l.jsxs)("div",{className:"flex flex-col",children:[eu,(0,l.jsx)(C.A,{onValueChange:eF,initialValue:eV})]}),eh[61]=eV,eh[62]=ed):ed=eh[62];let eG=eM?"disabled":"primary";return eh[63]!==eW||eh[64]!==eM||eh[65]!==eG?(e_=(0,l.jsx)(u.A,{styleType:eG,label:"Create Link",className:"w-fit",onClick:eW,disabled:eM}),eh[63]=eW,eh[64]=eM,eh[65]=eG,eh[66]=e_):e_=eh[66],eh[67]!==ez||eh[68]!==eX?(ex=!eX&&ez.length?(0,l.jsx)("div",{className:"flex flex-col gap-2",children:ez.map(E)}):null,eh[67]=ez,eh[68]=eX,eh[69]=ex):ex=eh[69],eh[70]!==eX?(ev=eX?(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("span",{className:"text-xs text-green-500",children:"Invite link created!"}),(0,l.jsx)("span",{className:"text-green-500",children:eX})]}):null,eh[70]=eX,eh[71]=ev):ev=eh[71],eh[72]!==M||eh[73]!==G||eh[74]!==K||eh[75]!==Y||eh[76]!==en||eh[77]!==et||eh[78]!==er||eh[79]!==em||eh[80]!==ed||eh[81]!==e_||eh[82]!==ex||eh[83]!==ev||eh[84]!==z?(ep=(0,l.jsx)("div",{className:"flex w-full flex-col gap-8",children:(0,l.jsxs)("div",{className:"flex max-w-md flex-col gap-4",children:[J,z,M,G,K,Y,en,et,er,em,ed,e_,ex,ev]})}),eh[72]=M,eh[73]=G,eh[74]=K,eh[75]=Y,eh[76]=en,eh[77]=et,eh[78]=er,eh[79]=em,eh[80]=ed,eh[81]=e_,eh[82]=ex,eh[83]=ev,eh[84]=z,eh[85]=ep):ep=eh[85],ep}function E(e){return(0,l.jsx)("span",{className:"text-xs text-red-500",children:e},e)}function w(e){return{code:e.ccode,name:e.ccode_name}}function I(e){return"SE"===e.ccode_name}function k(e){return{label:e,value:e}}function P(e){return{label:e.name,value:e.id}}function R(){let e,n=(0,t.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsxs)("div",{className:"flex w-full flex-col gap-8 pb-16",children:[(0,l.jsx)("h1",{className:"text-xl text-gray-700",children:"Customer Invite"}),(0,l.jsx)(A,{})]}),n[0]=e):e=n[0],e}}},e=>{e.O(0,[6515,6593,636,8792],()=>e(e.s=98840)),_N_E=e.O()}]);

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.