(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2494],{1e3:(e,t,r)=>{"use strict";r.d(t,{E:()=>n});var o=r(95155);r(12115);var s=r(43791);function n(e){let{className:t,width:r,height:n,sx:a,variant:i="text",children:l}=e;return(0,o.jsx)(s.A,{className:t,height:n,sx:a,variant:i,width:r,children:l})}},7720:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var o=r(80074),s=r(91845);let n={locale:(0,o.eU)(s.q)}},20599:(e,t,r)=>{Promise.resolve().then(r.bind(r,26530)),Promise.resolve().then(r.bind(r,94541))},25803:(e,t,r)=>{"use strict";r.d(t,{IB:()=>n,RH:()=>s,q:()=>a,ts:()=>o});let o="ja",s="en",n=[o,s],a=o},26530:(e,t,r)=>{"use strict";r.d(t,{BookmarksPageContainer:()=>I});var o=r(95155),s=r(12115),n=r(92840),a=r(94896),i=r(47101),l=r(14909);function c(e){let{onClick:t}=e;return(0,o.jsx)(i.$,{sx:{backgroundColor:"#333",borderRadius:"50px",padding:"10px"},variant:"contained",onClick:t,children:(0,o.jsx)(l.I,{name:"delete",color:"white",opacity:"full"})})}var d=r(99621),u=r(36968),x=r(59849),m=r(88294);function f(e){let{title:t,children:r,open:s,slotProps:n,sx:a,onClose:i}=e;return(0,o.jsx)(d.l,{open:s,slotProps:{root:{disableScrollLock:!1,style:{zIndex:m.R.position.zIndex.bottomDialog},...null==n?void 0:n.root},backdrop:{...null==n?void 0:n.backdrop},container:{style:{alignItems:"flex-end"},...null==n?void 0:n.container},paper:{style:{margin:0,width:"100%",maxWidth:"100%",boxShadow:"none"},...null==n?void 0:n.paper}},sx:a,onClose:i,children:(0,o.jsxs)("div",{children:[t&&(0,o.jsx)(x.L,{children:(0,o.jsx)("div",{children:t})}),(0,o.jsx)(u.C,{children:r})]})})}function h(e){let{open:t,selectedBookmarkQueries:r,onClose:s,onDelete:a}=e,{t:l}=(0,n.PZ)();return(0,o.jsxs)(f,{open:t,slotProps:{root:{disableScrollLock:!0,hideBackdrop:!0,style:{position:"fixed",top:"inherit",left:0,right:0,bottom:0,zIndex:m.R.position.zIndex.bottomDialog,textAlign:"center",backgroundColor:"var(--color-background)"}},paper:{sx:{backgroundColor:"var(--color-background)"}}},children:[r.length>0?(0,o.jsxs)("span",{children:[r.length," ",l("page.bookmarks.delete-dialog.selected.message")]}):(0,o.jsx)("span",{className:"text-(--color-disabled)",children:l("page.bookmarks.delete-dialog.no-selection.message")}),(0,o.jsx)("div",{className:"pt-3",children:(0,o.jsx)(i.$,{className:"w-full max-w-[600px] mb-3 flex flex-row gap-2 justify-center items-center",disabled:0===r.length,sx:{borderRadius:"30px",paddingTop:"16px",paddingBottom:"16px",fontSize:"16px",color:"var(--kobe-sub)",border:"1px solid var(--kobe-sub)",backgroundColor:"var(--color-background)",fontWeight:"bolder",boxShadow:"none","&.Mui-disabled":{color:"var(--color-disabled)",backgroundColor:"var(--color-background)",border:"1px solid var(--color-disabled)"}},variant:"contained",onClick:a,children:l("action.delete.label")})}),(0,o.jsx)("div",{children:(0,o.jsx)(i.$,{sx:{color:"var(--color-secondary)",fontSize:"large",fontWeight:"bold"},variant:"text",onClick:s,children:l("action.cancel.label")})})]})}var p=r(58108),g=r(13664);function b(e){let{checked:t=!1,disabled:r=!1,value:s,onChange:n}=e;return(0,o.jsx)(g.A,{checked:t,disabled:r,value:s,onChange:n})}var k=r(7291);function v(e){let{control:t,checked:r=!1,label:s,sx:n,slots:a,slotProps:i}=e;return(0,o.jsx)(k.A,{checked:r,control:t,label:s,slotProps:i,slots:a,sx:n})}function j(e){let{bookmark:t,isSelected:r,onCheckboxChange:s}=e,n=(0,o.jsxs)("div",{className:"bg-white rounded-xl flex flex-col py-4 px-6 w-full",children:[(0,o.jsx)("span",{className:"text-lg font-bold",children:(0,p.sV)(t)}),(0,o.jsx)("span",{className:"text-sm font-(--color-secondary)",children:t.platformName||void 0})]});return(0,o.jsx)("div",{className:"w-full",children:(0,o.jsx)(v,{checked:r,control:(0,o.jsx)(b,{onChange:e=>{s(t.query,e.target.checked)}}),label:n,sx:{width:"100%","& .MuiFormControlLabel-label":{width:"100%"},"& .MuiSvgIcon-root":{fill:"var(--color-disabled)"},"& .Mui-checked .MuiSvgIcon-root":{fill:"var(--kobe-sub)"}}})})}function y(e){let{selectedBookmarkQueries:t,onSelectionChange:r}=e,n=(0,a.jd)(),i=(0,s.useCallback)((e,o)=>{r(o?[...t,e]:t.filter(t=>t!==e))},[r,t]),l="hasData"===n.state?n.data:[];return(0,o.jsx)("div",{children:l.map(e=>(0,o.jsx)("div",{className:"mb-3 flex flex-row w-full",children:(0,o.jsx)(j,{bookmark:e,isSelected:t.includes(e.query),onCheckboxChange:i})},e.query))})}var N=r(76640),S=r(1e3);function w(){return(0,o.jsx)("div",{className:"bg-white rounded-xl flex items-center justify-between p-4",children:(0,o.jsxs)("div",{className:"flex flex-col justify-start pl-2 gap-1",children:[(0,o.jsx)(S.E,{sx:{fontSize:"1rem"},variant:"text",width:150}),(0,o.jsx)(S.E,{sx:{fontSize:"0.875rem"},variant:"text",width:100})]})})}function C(){return(0,o.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((e,t)=>(0,o.jsx)("div",{children:(0,o.jsx)(w,{})},t))})}function E(){let{locale:e,t}=(0,n.PZ)(),{showNotification:r}=(0,n.M)(),s=(0,a.jd)();if("loading"===s.state)return(0,o.jsx)(C,{});if("hasError"===s.state)return r(t("error-message.find-bookmarks"),{severity:"error"}),null;let i=s.data;return 0===i.length?(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center text-center h-[70vh]",children:[(0,o.jsx)("p",{className:"text-(--color-accent) mb-2",children:t("page.bookmarks.no-bookmarks.message")}),(0,o.jsx)("p",{className:"text-(--color-accent) mb-6",children:t("page.bookmarks.no-bookmarks.description")}),(0,o.jsxs)("div",{className:"flex flex-row justify-center",children:[(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,o.jsx)("span",{className:"text-xs text-(--color-secondary)",children:t("page.bookmarks.state.unregistered.message")}),(0,o.jsx)(l.I,{name:"star",color:"black",opacity:"medium"})]}),(0,o.jsx)("div",{className:"px-6 pt-5 align-middle","aria-hidden":"true",children:(0,o.jsx)(l.I,{name:"arrow_both",color:"black",opacity:"medium"})}),(0,o.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,o.jsx)("span",{className:"text-xs text-(--color-green-secondary)",children:t("page.bookmarks.state.registered.message")}),(0,o.jsx)(l.I,{name:"star",color:"green",opacity:"full"})]})]})]}):(0,o.jsx)("div",{className:"flex flex-col gap-3",children:i.length>0&&i.map(t=>(0,o.jsx)("div",{children:(0,o.jsx)(N.d,{href:(0,p.nG)(e,t.query),description:t.platformName||void 0,title:(0,p.sV)(t)})},t.query))})}function B(e){let{}=e,[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)([]),l=(0,a.c1)(),d=(0,a.jd)(),u="hasData"===d.state&&d.data.length>0,x=(0,s.useCallback)(()=>{i([]),r(!1)},[]),m=(0,s.useCallback)(()=>{l(n),x()},[l,x,n]),f=(0,s.useCallback)(()=>{x()},[x]);return(0,o.jsxs)("div",{className:"mb-12 max-w-[767px] mx-auto",children:[(0,o.jsxs)("div",{children:[t?(0,o.jsx)(y,{selectedBookmarkQueries:n,onSelectionChange:i}):(0,o.jsx)(E,{}),!t&&u&&(0,o.jsx)("div",{className:"absolute bottom-24 right-4",children:(0,o.jsx)(c,{onClick:()=>{r(!0)}})})]}),(0,o.jsx)(h,{open:t,selectedBookmarkQueries:n,onClose:f,onDelete:m})]})}function I(){let{t:e}=(0,n.PZ)(),{setPageTitle:t,resetOriginStop:r,resetDestinationStop:a,resetStopPlatform:i}=(0,n.Sz)();return(0,s.useEffect)(()=>{t(e("page.bookmarks.title"))},[e,t]),(0,s.useEffect)(()=>{r(),a(),i()},[]),(0,o.jsx)(B,{})}},36968:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});var o=r(95155);r(12115);var s=r(99496);function n(e){let{className:t,sx:r,children:n}=e;return(0,o.jsx)(s.A,{className:t,sx:r,children:n})}},37250:(e,t,r)=>{"use strict";r.d(t,{eD:()=>a,co:()=>l,aA:()=>i});var o=r(80074),s=r(58640),n=r(7720);function a(e){return{id:e.id,sameId:e.sameId,code:e.code,name:e.name,desc:e.desc,translationName:e.translationName,lat:e.lat,lon:e.lon,pickupAndDropoff:e.pickupAndDropoff}}function i(e,t,r){var o;let s=[t,function(e){if(!e.includes("@"))return e;let t=e.indexOf("@");return e.slice(t+1)}(r)].join("-");return null==(o=e.find(e=>e.id.startsWith(s)))?void 0:o.price}function l(e){if(!e.desc)return"";let t=(0,o.zp)().get(n.T.locale);return(0,s.g)(t)?"".concat(e.desc,"行き"):"To ".concat(e.desc)}},46985:(e,t,r)=>{"use strict";r.d(t,{v7:()=>o,Qy:()=>c,qQ:()=>n,j$:()=>l,PO:()=>i,m_:()=>a,D_:()=>s});class o extends Error{constructor(e="Bad Request"){super(e),this.statusCode=400,this.name="BadRequestError"}}class s extends Error{constructor(e="Unauthorized"){super(e),this.statusCode=401,this.name="UnauthorizedError"}}class n extends Error{constructor(e="forbidden"){super(e),this.statusCode=403,this.name="ForbiddenError"}}class a extends Error{constructor(e="not found"){super(e),this.statusCode=404,this.name="NotFoundError"}}class i extends Error{constructor(e="internal server error"){super(e),this.statusCode=500,this.name="InternalServerError"}}class l extends Error{constructor(e,t){super(t),this.name="HttpError",this.statusCode=e}}class c extends Error{constructor(e="Bookmark limit exceeded"){super(e),this.statusCode=400,this.name="BookmarkLimitError"}}},47101:(e,t,r)=>{"use strict";r.d(t,{$:()=>n});var o=r(95155);r(12115);var s=r(27855);function n(e){let{className:t,color:r,disabled:n=!1,href:a,sx:i,variant:l,onClick:c,children:d}=e;return(0,o.jsx)(s.A,{className:t,href:c?void 0:a,color:r,disabled:n,sx:i,variant:l,onClick:c,children:d})}},58108:(e,t,r)=>{"use strict";r.d(t,{eB:()=>d,nG:()=>m,Sv:()=>u,sV:()=>x,v6:()=>h,GK:()=>f,r7:()=>g,oM:()=>b,sP:()=>p});var o=r(76767);function s(e){if(e instanceof DOMException){if("QuotaExceededError"===e.name)throw Error("ストレージ容量が不足しています",{cause:e});else if("SecurityError"===e.name)throw Error("ストレージへのアクセスが許可されていません",{cause:e})}throw Error("ストレージエラーが発生しました",{cause:e})}function n(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){s(e)}}var a=r(46985),i=r(37250),l=r(92964);let c={bookmarksStorage:"bookmarksStorage"},d=(e,t,r)=>({originStopName:(null==e?void 0:e.name)||"",destinationStopName:(null==t?void 0:t.name)||"",platformName:r?(0,i.co)(r):"",query:u(e,t,r)}),u=(e,t,r)=>"originStop=".concat((null==e?void 0:e.id)||"").concat(t?"&destinationStop=".concat(t.id):"").concat(r?"&stopPlatform=".concat(r.id):""),x=e=>e.destinationStopName?"".concat(e.originStopName," → ").concat(e.destinationStopName):e.originStopName,m=(e,t)=>{let r=Object.fromEntries(new URLSearchParams(t));return(0,l.tQ)(e,r)};function f(){let e=c.bookmarksStorage;try{let t=function(e){try{let t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(e){s(e)}return null}(e);return null!=t?t:[]}catch(e){return console.error("getBookmarks failed: ",e),[]}}function h(e){return f().find(t=>t.query===e)}function p(e){let t=c.bookmarksStorage,r=f().filter(t=>t.query!==e.query);if(r.length>=o.q.maxBookmarks)throw new a.Qy;n(t,[...r,e].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()))}function g(e){n(c.bookmarksStorage,f().filter(t=>t.query!==e))}function b(e){let t=c.bookmarksStorage,r=f(),o=new Set(e);n(t,r.filter(e=>!o.has(e.query)))}},58640:(e,t,r)=>{"use strict";r.d(t,{g:()=>s});var o=r(91845);let s=e=>e===o.y1},59849:(e,t,r)=>{"use strict";r.d(t,{L:()=>n});var o=r(95155);r(12115);var s=r(2021);function n(e){let{className:t,sx:r,children:n}=e;return(0,o.jsx)(s.A,{className:t,sx:r,children:n})}},76640:(e,t,r)=>{"use strict";r.d(t,{d:()=>i});var o=r(95155),s=r(52619),n=r.n(s),a=r(14909);function i(e){let{href:t,title:r,description:s,onClick:i}=e;return(0,o.jsx)("div",{className:"mb-3",children:(0,o.jsxs)(n(),{className:"bg-white rounded-xl flex items-center justify-between p-4",href:t,onClick:i,children:[(0,o.jsxs)("div",{className:"flex flex-col justify-start pl-2",children:[(0,o.jsx)("span",{className:"font-bold text-lg text-(--color-primary)",children:r}),s&&(0,o.jsx)("span",{className:"text-sm text-(--color-secondary)",children:s})]}),(0,o.jsx)(a.I,{name:"advance",color:"black",opacity:"high"})]})})}},76767:(e,t,r)=>{"use strict";r.d(t,{q:()=>o});let o={maintenanceMode:!1,maintenanceScheduledEndAt:"Tue, 2025-09-30 14:00",findBusStopsByNameLimit:30,findBusStopsByNameDebounceMsec:300,findBusStopsByRouteIdDebounceMsec:300,findBusTripsPastMinutes:60,nearbyBusStopDistanceLimitMeters:500,busTripAutoUpdateIntervalSec:30,maxBusStopSuggestions:10,maxNearestBusStops:20,maxBusStopTimes:10,maxBookmarks:10,accordionTransitionExpandMsec:0,accordionTransitionCollapseMsec:0,externalNewsPageUrl:"https://kotsu.city.kobe.lg.jp",externalPolicyPageUrl:"https://www.city.kobe.lg.jp/a57337/homepage/p_policy.html"}},91845:(e,t,r)=>{"use strict";r.d(t,{q:()=>s,y1:()=>o});let o=r(25803).ts,s=o},92964:(e,t,r)=>{"use strict";r.d(t,{ph:()=>a,$U:()=>l,WU:()=>c,Q1:()=>d,nu:()=>i,gY:()=>m,xe:()=>x,tQ:()=>u,j9:()=>f,_H:()=>g,YJ:()=>h,$Z:()=>p,Ad:()=>b,cq:()=>k,lw:()=>v,b_:()=>n});var o=r(76767);let s=["originStop","destinationStop","stopPlatform","trip","route","action","view"];function n(e){return s.filter(t=>void 0!==e[t]).reduce((t,r)=>(t[r]=e[r],t),{})}function a(e,t){if(!t)return e;let r=new URLSearchParams(n(t)).toString();return"".concat(e,"?").concat(r)}function i(e,t){return a("/".concat(e,"/"),t)}function l(e,t){return a("/".concat(e,"/search-by-route/"),t)}function c(e,t){return a("/".concat(e,"/search-by-route/stops/"),t)}function d(e,t){return a("/".concat(e,"/search-nearby/"),t)}function u(e,t){return a("/".concat(e,"/trips/"),t)}function x(e,t){return a("/".concat(e,"/trips/detail/"),t)}function m(e,t){return a("/".concat(e,"/support/"),t)}function f(e,t){return a("/".concat(e,"/bookmarks/"),t)}function h(){return o.q.externalNewsPageUrl}function p(){return o.q.externalPolicyPageUrl}function g(){return"https://kotsucitykobe-delay.mobustation.jp/delay/main.aspx?c=kobecity"}function b(e){return e?"".concat(e.latitude.toFixed(6),",").concat(e.longitude.toFixed(6)):""}function k(e){return/^\/[a-z]{2}\/search-by-route(\/stops)?\/?$/.test(e)}function v(e){return/^\/[a-z]{2}\/search-nearby\/?$/.test(e)}},94541:(e,t,r)=>{"use strict";function o(e){let{children:t}=e;return t}r.d(t,{BookmarksPageGuard:()=>o}),r(12115)},94896:(e,t,r)=>{"use strict";r.d(t,{ec:()=>v,Tc:()=>j,c1:()=>y,pR:()=>g,dv:()=>b,jd:()=>k});var o=r(12115),s=r(77202),n=r(46985),a=r(92840),i=r(58108),l=r(80074),c=r(51208),d=r(86919);let u={refreshTrigger:(0,l.eU)(0),isClientInitialized:(0,l.eU)(!1)},x=new Promise(()=>{}),m=(0,d.I)(e=>(0,l.eU)(async t=>t(u.isClientInitialized)?(t(u.refreshTrigger),(0,i.v6)(e)):x)),f=(0,d.I)(e=>(0,c.Rq)(m(e))),h=(0,l.eU)(async e=>e(u.isClientInitialized)?(e(u.refreshTrigger),(0,i.GK)()):x),p={loadableBookmarkByQuery:f,loadableBookmarks:(0,c.Rq)(h)},g=()=>{let e=(0,s.Xr)(u.isClientInitialized);return(0,o.useCallback)(()=>{e(!0)},[e])},b=e=>(0,s.md)(p.loadableBookmarkByQuery(e)),k=()=>(0,s.md)(p.loadableBookmarks),v=()=>{let e=(0,s.Xr)(u.refreshTrigger),{triggerError:t}=(0,a.pu)();return(0,o.useCallback)(r=>{let o={...r,createdAt:new Date().toISOString()};try{(0,i.sP)(o),e(e=>e+1)}catch(e){if(e instanceof n.Qy)throw e;t(e,"おきにいりの登録に失敗しました")}},[e,t])},j=()=>{let e=(0,s.Xr)(u.refreshTrigger),{triggerError:t}=(0,a.pu)();return(0,o.useCallback)(r=>{try{(0,i.r7)(r),e(e=>e+1)}catch(e){t(e,"おきにいりの削除に失敗しました")}},[e,t])},y=()=>{let e=(0,s.Xr)(u.refreshTrigger),{triggerError:t}=(0,a.pu)();return(0,o.useCallback)(r=>{try{(0,i.oM)(r),e(e=>e+1)}catch(e){t(e,"おきにいりの削除に失敗しました")}},[e,t])}},99621:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});var o=r(95155);r(12115);var s=r(75265);function n(e){let{className:t,disableRestoreFocus:r=!1,fullScreen:n=!1,fullWidth:a=!1,open:i,slotProps:l,slots:c,sx:d,transitionDuration:u=0,onClose:x,children:m}=e;return(0,o.jsx)(s.A,{className:t,disableRestoreFocus:r,fullScreen:n,fullWidth:a,open:i,slotProps:l,slots:c,sx:d,transitionDuration:u,onClose:x,children:m})}}},e=>{e.O(0,[74,4923,2619,4195,7855,3092,2026,5256,4560,2036,8441,1255,7358],()=>e(e.s=20599)),_N_E=e.O()}]);