PageSourceSearch

https://console.graffer.jp/aistudio/_next/static/chunks/pages/t/[slug]/admin/templates-fb017d4ce62fe3a8.js

js graffer.jp collected 2026-10-01 10:15:28 UTC 6,512 bytes, 35 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="abaabc2e-bd9e-482a-a6e9-411163710c29",e._sentryDebugIdIdentifier="sentry-dbid-abaabc2e-bd9e-482a-a6e9-411163710c29")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[504],{16553:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>C});var a=t(15383),l=t(45561),n=t(83939),r=t(80063),i=t(14343),o=t(96588),d=t(10813);let u=({initialFilter:e,initialGroup:s,applyFilter:t})=>{let[l,n]=i.useState("tenantId"===e.filterBy?"tenantScope":"groupScope"),{setInputValue:r,onSelect:u,options:c,selected:p}=(e=>{let{setInputValue:s,onSelect:t,options:a,selected:l}=(0,d.Z)({isMulti:!1});return{setInputValue:s,onSelect:t,options:a,selected:i.useMemo(()=>l??(e?{value:e.id,label:e.name}:void 0),[l,e])}})(s),g=i.useCallback(()=>{switch(l){case"tenantScope":t({filterBy:"tenantId"});break;case"groupScope":p&&t({filterBy:"groupId",groupId:p.value})}},[p,l,t]);return(0,a.jsxs)(o.FilterContainer,{buttons:[(0,a.jsx)(o.SecondaryButton,{onClick:g,text:"絞り込み",disabled:"groupScope"===l&&!p},"searchButton")],children:[(0,a.jsx)(o.FilterRow,{fullWidth:!0,children:(0,a.jsx)(o.InlineRadioButton,{label:"共有範囲",onChange:e=>{let{value:s}=e.target;n(s)},options:[{name:"全体",value:"tenantScope"},{name:"グループごと",value:"groupScope"}],value:l})}),"groupScope"===l&&(0,a.jsx)(o.FilterRow,{fullWidth:!0,children:(0,a.jsx)(o.InlineReactSelect,{label:"グループ",onInputChange:r,onChange:u,options:c,placeholder:"テキストを入力してグループを検索",value:p,width:"auto",isMulti:!1})})]})},c=({templates:e,onClickRow:s})=>(0,a.jsxs)(o.Table,{children:[(0,a.jsx)(o.TableHeader,{children:(0,a.jsxs)(o.TableRow,{children:[(0,a.jsx)(o.Th,{children:"タイトル"}),(0,a.jsx)(o.Th,{children:"説明"}),(0,a.jsx)(o.Th,{children:"作成日"}),(0,a.jsx)(o.Th,{})]})}),(0,a.jsx)(o.TableBody,{children:e.map(({id:e,title:t,description:l,createdAtUnixSecond:n})=>{let r=new Date(1e3*n),i=`${r.getFullYear()}/${r.getMonth()+1}/${r.getDate()}`;return(0,a.jsxs)(o.TableRow,{children:[(0,a.jsx)(o.Td,{children:t}),(0,a.jsx)(o.Td,{children:l}),(0,a.jsx)(o.Td,{children:i}),(0,a.jsx)(o.Td,{children:(0,a.jsx)(o.SecondaryButton,{onClick:()=>{s(e)},text:"編集"})})]},e)})})]});var p=t(28794),g=t(90265),h=t(90123),m=t(76324),x=t(98096),j=t(82753);(0,x.J1)`
2  query MessageTemplatesForAdmin(
3    $first: Int!
4    $groupIds: [ID!]!
5    $includeTenant: Boolean!
6    $after: Cursor
7  ) {
8    messageTemplateSharedScope(
9      first: $first
10      groupIds: $groupIds
11      includeTenant: $includeTenant
12      after: $after
13    ) {
14      edges {
15        cursor
16        node {
17          ...MessageTemplateFragment
18          createdAtUnixSecond
19        }
20      }
21      pageInfo {
22        hasNextPage
23        hasPreviousPage
24        startCursor
25        endCursor
26      }
27    }
28    listGroups(groupIds: $groupIds) {
29      id
30      name
31      status
32    }
33  }
34  ${h.S}
35`;var f=t(75910),b=t(15060);let y="filterBy",T="groupId",I=()=>{let e=(0,b.useSearchParams)(),s=(0,r.useRouter)(),t=(0,f.l)(),l=i.useMemo(()=>{let s=e.get(y),t=e.get(T);return"groupId"===s&&t?{filterBy:"groupId",groupId:t}:{filterBy:"tenantId"}},[e]),{templates:n,paginationProps:o,group:d}=(e=>{let s=i.useMemo(()=>({first:50,groupIds:"groupId"===e.filterBy?[e.groupId]:[],includeTenant:"tenantId"===e.filterBy}),[e]),{data:t,loading:a,refetch:l}=(0,j.I)(m.gtK,{variables:s,fetchPolicy:"network-only"}),n=(({refetch:e,baseVariables:s,next:t})=>{let[a,l]=i.useState([]);i.useEffect(()=>{l([])},[s]);let n=i.useMemo(()=>({hasNextPage:t?.hasNextPage??!1,onNextPageClick:()=>{t?.endCursor&&(e({...s,after:t.endCursor}),l(e=>[...e,t.endCursor]))}}),[e,s,t]),r=i.useMemo(()=>({hasPreviousPage:a.length>0,onPreviousPageClick:()=>{let t=a.slice(0,-1),n=t[t.length-1];e({...s,after:n}),l(t)}}),[e,s,a]);return{...n,...r}})({refetch:l,baseVariables:s,next:t?.messageTemplateSharedScope.pageInfo});return{isLoading:a,templates:t?.messageTemplateSharedScope.edges.map(e=>e.node)??[],paginationProps:n,group:t?.listGroups[0]}})(l),h=i.useCallback(()=>{s.push(g.B.Admin.TemplateNew.link(s.query.slug))},[s]),x=i.useCallback(e=>{let a={};a[y]=e.filterBy,"groupId"===e.filterBy&&(a[T]=e.groupId),s.push({pathname:g.B.Admin.TemplateSetting.link(t),query:a})},[t,s]),I=i.useCallback(e=>{s.push(g.B.Admin.TemplateEdit.link(s.query.slug,e))},[s]);return(0,a.jsxs)("section",{children:[(0,a.jsx)(v,{onClickCreate:h}),(0,a.jsx)(u,{initialFilter:l,initialGroup:d,applyFilter:x}),(0,a.jsx)("div",{className:"mt-6"}),n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{templates:n,onClickRow:I}),(0,a.jsx)("div",{className:"mt-5"}),(0,a.jsx)(p.w,{...o})]})]})},v=({onClickCreate:e})=>(0,a.jsx)("header",{children:(0,a.jsx)("div",{className:"columns mt-3",children:(0,a.jsxs)("div",{className:"column is-flex is-justify-content-space-between is-align-items-center",children:[(0,a.jsx)("h1",{className:"title is-size-4",children:g.B.Admin.TemplateSetting.title}),(0,a.jsx)(o.PrimaryButton,{onClick:e,disabled:!1,text:"新規作成"})]})})}),C=()=>(0,a.jsx)(l.U,{sideMenu:(0,a.jsx)(n.o,{}),children:(0,a.jsx)(I,{})})},28794:(e,s,t)=>{"use strict";t.d(s,{w:()=>l});var a=t(15383);let l=({hasNextPage:e,hasPreviousPage:s,onNextPageClick:t,onPreviousPageClick:l})=>(0,a.jsxs)("div",{className:"columns is-marginles is-paddingless",children:[l&&(0,a.jsx)("div",{className:"column has-text-left",children:(0,a.jsx)("div",{className:"pagination-previous is-clickable"+(s?"":" is-disabled"),onClick:()=>{s&&l()},children:"前へ"})}),t&&(0,a.jsx)("div",{className:"column has-text-right",children:(0,a.jsx)("div",{className:"pagination-previous is-clickable"+(e?"":" is-disabled"),onClick:()=>{e&&t()},children:"次へ"})})]})},60796:(e,s,t)=>{"use strict";t.d(s,{m:()=>i});var a=t(15383);t(14343);
35var l=t(10329),n=t(5159);let r=(0,l.Ay)(({className:e,...s})=>(0,a.jsx)(n.A,{...s,classes:{popper:e}}))({"& .MuiTooltip-tooltip":{marginTop:"7px !important"}}),i=({children:e,disabled:s,onDelayedClose:t,onClose:l,...n})=>s?e:(0,a.jsx)(r,{arrow:!0,onClose:e=>{if(!t)return l?.(e);setTimeout(()=>{t?.(e)},500)},...n,children:e})},68371:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/t/[slug]/admin/templates",function(){return t(16553)}])}},e=>{e.O(0,[8971,7738,8534,9482,900,4361,5159,5060,8635,123,9933,636,6593,8792],()=>e(e.s=68371)),_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.