Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f7d22750f | ||
|
|
3f47d5ecd2 | ||
|
|
9773bc0496 | ||
|
|
f0c4d5f413 | ||
|
|
6b9e01d876 | ||
|
|
a1a416ca4a | ||
|
|
7425cb409e | ||
|
|
93bd5435ac | ||
|
|
3b4c5c98bc | ||
|
|
2824dedd42 |
No files matched your search
@@ -79,6 +79,14 @@ PUBLIC_WEB_BASE_URL=http://localhost
|
||||
# SITE_PUBLIC_HOST=web4ai.o2osolution.ai
|
||||
# 비우면 색인 통보를 건너뛴다(발행은 정상)
|
||||
INDEXNOW_KEY=
|
||||
|
||||
# Google Search Console — 최초 소유권/서비스 계정 권한 설정 후 켠다 (docs/SEARCH_CONSOLE.md).
|
||||
GSC_ENABLED=0
|
||||
GSC_PROPERTY_URL=
|
||||
GSC_CREDENTIALS_FILE=
|
||||
GSC_CREDENTIALS_HOST_FILE=
|
||||
GSC_ALERT_DAYS=7
|
||||
GSC_ALERT_WEBHOOK_URL=
|
||||
# 비우면 로컬 발행만 한다
|
||||
AZURE_STORAGE_CONNECTION_STRING=
|
||||
AZURE_STORAGE_CONTAINER=
|
||||
|
||||
@@ -34,7 +34,48 @@
|
||||
→ **`out/assets` 에서 파일을 지우는 코드는 `out/s/**` 의 HTML 이 참조하는 것을 먼저 뺀다**
|
||||
(`prerender.ts` `referencedAssets`). 보관 기간으로는 못 막는다 — 기간이 지나면 같은 일이 난다.
|
||||
→ 목업을 다루는 작업은 `out/s/` 를 먼저 열어 **payload 가 없는 디렉토리가 무엇인지** 본다.
|
||||
→ ★ **`stay` 는 프리렌더가 굽지 않는다** (`prerender.ts` `PROTECTED_SLUGS`, 기본 `stay` ·
|
||||
`PRERENDER_PROTECTED_SLUGS` 로 덮어쓴다). "payload 가 없으면 안 굽는다"
|
||||
는 보호가 못 된다 — **payload 가 생기는 순간** 덮인다. 실측(2026-09-15): 누가 빌더에서
|
||||
슬러그 `stay` 로 발행해 `payloads/stay.json` 이 생기자 프리렌더가 `/s/stay` 를 그 payload 로
|
||||
구워 목업을 통째로 날렸다(캐치프레이즈 100개·미니 플레이어·날씨 문구·주입분 전부).
|
||||
그 payload 는 `solution/site/payloads-mockup-hold/` 로 옮긴다 — 지우면 재발행 때 또 온다.
|
||||
|
||||
- **★ 굽기는 네트워크를 탄다 — 사진을 내려받는다** (`prerender.ts` `mirrorMedia`).
|
||||
`payload.media[].url` 이 남의 도메인이면 `out/s/<slug>/img/<주소해시>.<확장자>` 로 받아 놓고
|
||||
payload 의 주소를 **우리 오리진 절대주소**로 바꾼 뒤에 굽는다. 이유는 캔버스다 —
|
||||
수집처(`*.pstatic.net` · `tong.visitkorea.or.kr`)가 `Access-Control-Allow-Origin` 을 안 줘서
|
||||
그 사진을 캔버스에 그리면 오염돼 `toBlob` 이 막히고, **엽서 쓰기의 저장·공유가 모든 발행
|
||||
사이트에서 죽어 있었다**(실측 2026-09-15). 클라이언트에서는 못 넘는다.
|
||||
→ 못 받은 사진은 **원래 주소를 그대로 쓴다**(사진이 사라지는 것보다 낫다). 로그에 한 줄 남는다.
|
||||
→ 주소가 그대로면 파일명도 그대로라 **다시 구워도 내려받지 않는다.** 처음 한 번만 느리다.
|
||||
→ ★ **이미 나가 있는 사이트는 그대로 둔다.** 새 기능은 사장님이 **다시 발행할 때** 들어간다
|
||||
(아래 항목). 그 사이를 메우는 건 **중계**다 — `/v1/image/relay?url=…`
|
||||
(`backend/router/v1/media/relay.py`). 캔버스가 CORS 로 사진을 못 받으면 같은 오리진의
|
||||
이 주소로 한 번 더 받아 본다(`site/src/lib/postcard-canvas.ts` `loadImage`).
|
||||
열린 프록시가 아니다 — https · 호스트 allowlist · 이미지 타입 · 8MB · 리다이렉트 후
|
||||
호스트 재검사. **호스트를 늘릴 때는 "우리가 이미 그 사진을 화면에 싣고 있는가" 를 먼저 본다.**
|
||||
→ `originUrl` · `sourceType` 은 손대지 않는다 — 재게시 권리(DECISIONS 1-2)가 "불가" 로
|
||||
결론 나면 `sourceType = CRAWL` 을 빼는 그 대응이 그대로 먹어야 한다.
|
||||
- **★★ 배포해도 기존 사이트를 다시 굽지 않는다 — 자산 주소만 갈아 끼운다.**
|
||||
(2026-09-15 대표 지시: "전체 재굽기 할 필요가 없어, 사장님이 재발행하면 끝인데 /
|
||||
css js만 안 깨지게 하란 말이야")
|
||||
예전에는 `solution-prerender` 가 뜰 때마다 payload 를 **전부 다시 구웠다.** 그러면 렌더러를
|
||||
한 줄 고칠 때마다 이미 나가 있는 사이트의 HTML 이 통째로 바뀐다 — 사장님은 발행한 적이
|
||||
없는데 내용이 달라지고, 구글이 다시 읽어 가는 값도 달라진다.
|
||||
지금 기동이 하는 일은 `prerender.js --refresh-assets` 하나다
|
||||
(`watch-payloads.mjs` `refreshAssets` → `prerender.ts` `refreshBakedAssets`):
|
||||
→ 구워진 `index.html` 안의 `assets/index-<해시>.css|js` **파일명만** 새 번들로 바꾼다.
|
||||
내용·구조·payload 는 손대지 않는다. 접두사(`/assets` · `/sites/assets`)도 그대로 둔다.
|
||||
→ **한 번도 안 구워진 payload 만** 굽는다(볼륨이 비었거나 감시가 꺼진 새 발행).
|
||||
→ ★ **payload 가 없는 디렉토리는 건드리지 않는다**(목업 `stay3` · `*.old`, 그리고
|
||||
`PROTECTED_SLUGS`). 손으로 만든 유일본에 최신 번들을 물렸다가 깨지면 되돌릴 수 없다 —
|
||||
그쪽 번들 교체는 사람이 한다(mockup/README "번들만 갈아 끼운다").
|
||||
대상은 `--payload-dir` 에 `<슬러그>.json` 이 있는 사이트뿐이다.
|
||||
★ 그래서 **정적 HTML 은 옛 렌더러의 것이고 스크립트는 새 렌더러**다. 어긋나면 리액트가
|
||||
그 자리에서 다시 그리므로 손님 화면은 새것이지만, **크롤러가 읽는 HTML 은 옛것**이다.
|
||||
둘을 맞추는 방법은 재발행뿐이고 그건 사장님이 누른다. 급하면 `republish_all.py` 지만
|
||||
**먼저 묻는다** — 전 사이트의 발행일이 한꺼번에 움직이는 일이다.
|
||||
- **번들 파일명은 콘텐츠 해시다.** HTML 은 `/assets/index-DvNTmLhy.css` 를 **루트 절대경로**로
|
||||
가리킨다. 경로는 프리렌더가 `dist/client/.vite/manifest.json` 에서 읽어 박는다
|
||||
(`prerender.ts:160`). 렌더러 CSS 를 고치면 이름이 바뀐다.
|
||||
@@ -50,15 +91,19 @@
|
||||
없고**, 그때 디스크에 있던 기존 자산이 전부 "대장에 없음" 으로 분류돼 한꺼번에 삭제됐다.
|
||||
옛 자산을 남기려고 만든 코드가 첫 실행에서 정확히 반대로 동작했다.
|
||||
→ 자산을 지우는 코드를 손볼 때는 **"기록이 없다"와 "만료됐다"를 절대 같이 묶지 않는다.**
|
||||
→ 이미 끊겼다면 복구는 `docker compose restart solution-prerender` (기동하며 전체 재굽기).
|
||||
→ 이미 끊겼다면 복구는 `docker compose restart solution-prerender` — 기동이 공용 자산을
|
||||
다시 깔고 구워진 HTML 의 자산 주소를 맞춘다(전체 재굽기가 아니다, 위 ★★ 항목).
|
||||
- **★ 사이트를 굽는 컨테이너는 `solution-prerender` 다.** `solution-frontend` 는 **개발용**이라
|
||||
운영에서는 아예 뜨지 않는다(`docker-compose.yml` `profiles: ["dev"]`). 이름이 비슷해서
|
||||
`restart solution-frontend` 를 치면 **아무 일도 안 일어나는데 명령은 성공한다** —
|
||||
재굽기를 했다고 믿고 넘어가게 된다. 실제로 그렇게 복구가 한 번 헛돌았다(2026-09-07).
|
||||
- **★ 프론트(`solution/site`)를 배포하면 반드시 전체 재굽기 + 전체 재업로드.**
|
||||
`azure_static.publish(slug)` 는 공용 자산 + `s/<slug>` 만 올린다 —
|
||||
**렌더러를 고쳐도 다른 사이트에는 반영되지 않는다.**
|
||||
→ `docker compose restart solution-prerender` 후 `python scripts/republish_all.py`
|
||||
- **★ 프론트(`solution/site`)를 고쳐도 기존 사이트의 내용은 안 바뀐다.** 기동은 자산 주소만
|
||||
맞춘다(위 ★★ 항목) — 새 렌더러로 다시 그려지는 건 **그 사장님이 다시 발행할 때**다.
|
||||
Azure 를 쓰는 경우엔 한 겹 더 있다: `azure_static.publish(slug)` 는 공용 자산 + `s/<slug>` 만
|
||||
올린다 — 다른 사이트의 블롭은 그대로다.
|
||||
→ 전 사이트를 한꺼번에 새 렌더러로 맞춰야 할 일이 생기면
|
||||
`docker compose restart solution-prerender` 후 `python scripts/republish_all.py` 인데,
|
||||
**먼저 묻는다**(발행일이 전부 움직인다).
|
||||
- **발행 호스트는 두 곳에 있고 같아야 한다.** 백엔드 `SITE_PUBLIC_HOST`(기본 `web4ai.o2osolution.ai`,
|
||||
`site_payload.py`) ↔ 프론트 `VITE_PUBLISH_HOST`. canonical·og:url·sitemap·IndexNow 가 전부
|
||||
이 값을 쓴다. 그리고 **`origin` 은 payload JSON 에 구워진다** — 호스트를 바꾸면 프리렌더
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# 선택 연동. 키 파일은 저장소 밖에 두고 기존 API 스케줄러에만 읽기 전용으로 전달한다.
|
||||
# docker compose -f docker-compose.yml -f docker-compose.search-console.yml up -d solution-backend
|
||||
services:
|
||||
solution-backend:
|
||||
environment:
|
||||
GSC_CREDENTIALS_FILE: /run/secrets/search-console.json
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ${GSC_CREDENTIALS_HOST_FILE:?Search Console 키 파일 절대경로 필요}
|
||||
target: /run/secrets/search-console.json
|
||||
read_only: true
|
||||
bind:
|
||||
create_host_path: false
|
||||
@@ -69,6 +69,10 @@ BUILD 잡 (worker) ─ services/build_service.py:99 run_build()
|
||||
|
||||
## 3. 서빙 — 테스트 서버가 정적 파일을 직접 서빙한다
|
||||
|
||||
Google 추적은 발행 잡 밖에서 실행한다. 기존 API 스케줄러가 발행 완료 DB를 감지해
|
||||
사이트맵 제출·색인 조회·알림을 수행하고 `site_search_status`에 저장한다.
|
||||
선택 설정/인증/재시도 경계는 [SEARCH_CONSOLE.md](SEARCH_CONSOLE.md)가 단일 출처다.
|
||||
|
||||
**결정 (2026-08-31).** 발행 사이트는 **서버 안에서 nginx 가 정적 파일로 서빙한다.**
|
||||
Azure Blob 업로드 경로(`azure_static.py`)는 코드에 있고 동작하지만 **지금은 켜지 않는다** —
|
||||
`AZURE_STORAGE_CONNECTION_STRING` 을 비워 두면 발행 잡이 업로드 단계를 건너뛴다.
|
||||
|
||||
+3
-1
@@ -7,6 +7,8 @@
|
||||
여기서는 그 앞뒤를 잇는다.
|
||||
- 수집이 **무엇을 어디서 가져오는지**는 [COLLECTION_SEO_AEO_FLOW.md](COLLECTION_SEO_AEO_FLOW.md).
|
||||
- 표를 고치는 절차는 [postgres-init/migrations/README.md](../postgres-init/migrations/README.md).
|
||||
- Google 제출/색인 관측은 `site_search_status`의 별도 상태다. 발행 상태와 섞지 않는다.
|
||||
컬럼 의미·조회·설정은 [SEARCH_CONSOLE.md](SEARCH_CONSOLE.md).
|
||||
|
||||
정의는 두 곳이고 **둘 다 최신이어야 한다** — ORM(`solution/backend/common/database/model/models.py`)
|
||||
과 DDL(`postgres-init/init-data/init.sql` + `migrations/`). 컬럼 주석은 ORM 이 더 자세하다.
|
||||
@@ -170,7 +172,7 @@ Gemini 가 쓰고, 곡은 Suno 가 붙인다.
|
||||
|---|---|---|
|
||||
| 1 WEATHER | Open-Meteo | — |
|
||||
| 2 FESTIVAL · 3 ATTRACTION · 4 RESTAURANT · 5 COURSE | TourAPI (좌표 반경) | — |
|
||||
| 6 STORY | Perplexity | `songs` `people` `chronicle` `postcard` `quiz` |
|
||||
| 6 STORY | Perplexity | `songs` `daily` `people` `chronicle` `reading` `postcard` `quiz` |
|
||||
|
||||
`body`(JSONB)에 항목이 들어간다. **지역 이야기는 종류당 한 행**이고 항목들은 `body.items` 안에 있다.
|
||||
|
||||
|
||||
@@ -5,6 +5,34 @@
|
||||
|
||||
---
|
||||
|
||||
## 2026-09-15 — Google 사이트맵 자동 제출·색인 관측
|
||||
|
||||
- 기존 스케줄러에서 발행 완료 DB 감지 → 사이트맵 제출 → 색인 조회 → 지연/실패 알림.
|
||||
- 관측값·재시도·알림 시각은 `site_search_status`에 보관. 발행 잡/상태는 건드리지 않는다.
|
||||
- API 인증/호출과 DB·배치·알림 모듈 분리. Google·Teams 실호출은 설정 전까지 꺼진다.
|
||||
- 설정/적용/관측 의미: [SEARCH_CONSOLE.md](SEARCH_CONSOLE.md). 운영 배포·권한 부여는 미실행.
|
||||
|
||||
**검증** — 관련 59건 통과. 추가 회귀 23건 통과·기존 발행 검수 실패 1건(변경 전 코드에서도 재현).
|
||||
|
||||
## 2026-09-14 — 엽서 쓰기를 발행본에도 넣는다 (사진이 남의 도메인이면 저장·공유는 막힌다)
|
||||
|
||||
**무슨 일** — 시연본에만 주입 스크립트로 있던 '엽서 쓰기'(사진 고르기 + 한 마디 + 캔버스 엽서)를
|
||||
발행본 컴포넌트로 옮겼다. 그리기 규칙은 `site/src/lib/postcard-canvas.ts` 한 곳에 두고,
|
||||
화면·입력·공유는 `sections/items/PostcardMakerSection.tsx` 가 맡는다. 사진이 있는 사이트면 나간다.
|
||||
|
||||
**★ 저장·공유가 사진 출처에 걸린다** — 캔버스는 **남의 도메인 사진을 그리면 오염돼서**(tainted)
|
||||
`toBlob` 이 SecurityError 로 막힌다. 미리보기는 멀쩡히 보이는데 저장·공유만 죽는, 눈으로는 못 찾는 종류다.
|
||||
CORS 로 받으면 안 오염되지만 실측(2026-09-14) 발행본 사진은 네이버 CDN(`*.pstatic.net`)에 있고
|
||||
그쪽은 `Access-Control-Allow-Origin` 을 주지 않는다 — `curl -I` 로 확인했다.
|
||||
|
||||
→ 지금은 **정직하게 막는다.** CORS 로 한 번 받아 보고, 실패하면 CORS 없이 다시 받아 미리보기만 세우고
|
||||
저장·공유 단추를 아예 감춘다("이 사진은 다른 사이트에 올라와 있어 …"). 눌러도 안 되는 단추를 두지 않는다.
|
||||
→ **근본 해결은 사진을 우리 오리진으로 옮기는 것이다.** 시연본이 `img/mirror/` 로 그렇게 하고 있고,
|
||||
발행 파이프라인이 같은 일을 하면(빌드 때 내려받아 `out/s/<slug>/img/` 에 두고 payload 주소를 바꾼다)
|
||||
저장·공유가 풀린다. 덤으로 외부 주소 만료·핫링크 문제도 같이 사라진다. **아직 안 했다.**
|
||||
|
||||
---
|
||||
|
||||
## 2026-09-14 — FAQ 를 20개까지 채운다 (펜션 공통 질문 30개 + 문의 안내)
|
||||
|
||||
**무슨 일** — COPY 잡의 FAQ 생성 상한을 8 → 20 으로 올리고, 그래도 모자라면 펜션 공통 질문 카탈로그에서
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# Google Search Console 자동 추적
|
||||
|
||||
`발행 DB 감지 → 공개 사이트맵 확인/제출 → 색인 조회 → 상태 저장·Teams 알림`
|
||||
|
||||
## 경계
|
||||
|
||||
- 기존 API의 스케줄러에서 10분마다 실행한다. 컨테이너 추가 없음.
|
||||
- `sites.status=PUBLISHED`인 사이트만 등록하므로 초안/목업 디렉토리 나열을 작업 원장으로 쓰지 않는다.
|
||||
- 발행 DB에서 재발견한다. 발행 순간 별도 큐 적재가 실패하는 틈이 없고 재시작해도 이어진다.
|
||||
- 발행 트랜잭션/잡과 독립적이다. Google 실패가 사이트 발행을 실패로 바꾸지 않는다.
|
||||
- 한 번에 신규 발행 100개 등록, 조회는 오래 기다린 5개 처리. 정상 조회는 24시간 후 반복.
|
||||
- 현재 렌더러의 단일 루트 urlset만 지원하고 읽기 상한은 5MB다. 향후 sitemap index 분할 시 확장한다.
|
||||
- 오류는 1·2·4·8·16·24시간 간격 재시도. 기본 주기 기준 하루 최대 720회 검사이며,
|
||||
다른 도구의 같은 속성 사용량도 Google 할당량에 포함된다. 대량 백로그는 여러 날에 걸쳐 소진한다.
|
||||
- PostgreSQL transaction advisory lock으로 다중 API 프로세스의 동시 배치를 막는다.
|
||||
단일 배치는 외부 호출 동안 트랜잭션/연결 1개를 점유한다(검사 1건 최대 90초, 최대 5건).
|
||||
- 사이트맵 제출 성공과 URL 색인 성공은 별개다. `first_indexed_at`은 **우리가 처음 PASS를 관측한 시각**이다.
|
||||
Google 내부 색인 시각이나 최신 발행 버전 반영 시각이 아니다. 원본 `lastCrawlTime`도 함께 보관한다.
|
||||
- 재발행 시 해당 발행의 관측 상태를 초기화한다. 지난 관측 이력 전체를 누적하는 이벤트 저장소는 아니다.
|
||||
- `SITE_PUBLIC_HOST` 변경은 기존 지침대로 재발행이 필요하다. 사이트 주소의 단일 출처는 `site_payload`다.
|
||||
|
||||
## 최초 설정 (운영자)
|
||||
|
||||
1. Search Console에서 발행 도메인의 소유권 확인. URL-prefix 속성이면
|
||||
`https://web4ai.o2osolution.ai/`, 도메인 속성이면 `sc-domain:web4ai.o2osolution.ai` 형태.
|
||||
2. Google Cloud에서 Search Console API 활성화, 전용 서비스 계정 생성.
|
||||
3. Search Console 속성 설정 → 사용자 및 권한에서 그 서비스 계정 이메일에 전체 사용자 권한 부여.
|
||||
Google 로그인용 `GOOGLE_CLIENT_ID`와는 다른 인증이다.
|
||||
4. 서비스 계정 JSON 키는 **저장소 밖**에 보관한다. 권한을 최소화하고 git/이미지/로그에 넣지 않는다.
|
||||
5. 루트 `.env` 설정:
|
||||
|
||||
```dotenv
|
||||
GSC_ENABLED=1
|
||||
GSC_PROPERTY_URL=https://web4ai.o2osolution.ai/
|
||||
GSC_CREDENTIALS_HOST_FILE=/secure/location/search-console.json
|
||||
GSC_ALERT_DAYS=7
|
||||
GSC_ALERT_WEBHOOK_URL=
|
||||
```
|
||||
|
||||
키 생성/권한 부여/실제 알림 전송은 구현 검증 중 자동 수행하지 않는다.
|
||||
|
||||
## 배포
|
||||
|
||||
먼저 새 이미지에 requirements를 설치하고 `0014_search_console.sql`을 기존 마이그레이션 도구로 적용한다.
|
||||
프로젝트 전체 마이그레이션 순서를 확인한 뒤 실행한다. 아래는 운영자가 실행할 명령이며 자동 배포하지 않았다.
|
||||
|
||||
```bash
|
||||
docker compose exec -T solution-backend python scripts/migrate.py
|
||||
docker compose -f docker-compose.yml -f docker-compose.search-console.yml up -d --build solution-backend
|
||||
```
|
||||
|
||||
선택 compose 파일은 API에만 키를 읽기 전용 마운트하고 `GSC_CREDENTIALS_FILE`을 설정한다.
|
||||
없는 파일을 디렉토리로 자동 생성하지 않는다. 이후 배포에서도 이 override를 함께 사용해야 한다.
|
||||
로컬 Python 실행은 `GSC_CREDENTIALS_FILE`에 로컬 키 파일 경로를 지정한다.
|
||||
켜진 스케줄러는 첫 10분 주기부터 기존 발행 사이트도 등록한다. `GSC_ENABLED=0`이면 DB/Google 호출 모두 생략한다.
|
||||
|
||||
## 알림
|
||||
|
||||
Teams Workflows의 webhook 수신 → 채널에 Adaptive Card 게시 흐름 URL을
|
||||
`GSC_ALERT_WEBHOOK_URL`에 넣는다. 비우면 외부 전송 없이 경고 로그/DB만 남는다.
|
||||
API/사이트맵 오류 또는 발행 후 기본 7일 미색인 시 알린다. 성공한 알림은 사이트별 24시간 중복 억제.
|
||||
전송 실패는 `alerted_at`을 갱신하지 않아 다음 검사 때 재시도한다.
|
||||
외부 전송 후 DB commit 전에 죽으면 중복 알림이 가능하다(at-least-once).
|
||||
키·토큰·webhook URL·Google 오류 본문은 알림에 포함하지 않는다.
|
||||
|
||||
## 결과 확인
|
||||
|
||||
```bash
|
||||
docker compose exec -T solution-backend python scripts/search_console_status.py
|
||||
```
|
||||
|
||||
읽기 전용이며 Google API를 추가 호출하지 않는다. 프론트 화면/API 계약은 변경하지 않았다.
|
||||
|
||||
| 파일 | 책임 |
|
||||
|---|---|
|
||||
| `services/search_console_client.py` | 인증·Google HTTP·오류 정규화 |
|
||||
| `services/search_console_settings.py` | 선택 설정·속성 URL 범위 |
|
||||
| `services/search_console_service.py` | 배치 흐름·재시도·관측 결과 |
|
||||
| `crud/search_console_crud.py` | 발행 감지·등록·조회 순서·동시 실행 잠금 |
|
||||
| `services/search_console_alerts.py` | 알림 조건·Teams 전송 |
|
||||
|
||||
## 구글 지원 범위 / 남은 운영 작업
|
||||
|
||||
- [사이트맵 제출 API](https://developers.google.com/webmaster-tools/v1/sitemaps/submit)는 지원된다.
|
||||
- [URL Inspection API](https://developers.google.com/webmaster-tools/v1/urlInspection.index/inspect)는
|
||||
Google이 이미 알고 있는 상태 조회용이며 실시간 페이지 테스트나 색인 요청 API가 아니다.
|
||||
- 일반 숙박 사이트는 [Indexing API](https://developers.google.com/search/apis/indexing-api/v3/using-api) 대상이 아니다.
|
||||
- [검사 할당량](https://developers.google.com/webmaster-tools/limits)은 속성당 하루 2,000회다.
|
||||
- [Teams webhook 형식](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).
|
||||
- 실제 서비스 계정 권한/사이트맵 제출/색인 관측/Teams 수신은 설정 후 운영 검증이 필요하다.
|
||||
- 기존 루트 사이트맵의 백업 URL 정리와 IndexNow 개별 사이트맵 참조 문제는 이 기능과 별도다.
|
||||
이 기능은 기존 공개 사이트맵을 제출하며 내용을 다시 만들거나 목업을 삭제하지 않는다.
|
||||
|
||||
## 구현 검증 (2026-09-15)
|
||||
|
||||
- 격리 PostgreSQL에서 클라이언트·배치·스키마·IndexNow 관련 59건 통과.
|
||||
- 발행·설정·사이트 목록 회귀검사: 23건 통과, `test_unverified_fact_blocks_publish` 1건 실패.
|
||||
해당 실패는 변경 전 HEAD `9773bc0`의 발행 코드에서도 동일 재현됨(GSC 비활성).
|
||||
- Google/Teams 실호출 없음. 서비스 계정 권한·실제 제출·채널 수신은 운영 설정 후 검증 대상.
|
||||
@@ -0,0 +1,71 @@
|
||||
# Search Console 클라이언트
|
||||
|
||||
`solution/backend/services/search_console_client.py` — Google Search Console 에
|
||||
사이트맵을 제출하고 URL 색인 상태를 조회하는 REST 클라이언트만 다룬다.
|
||||
DB 저장·스케줄링·발행 감지·환경 설정은 [SEARCH_CONSOLE.md](SEARCH_CONSOLE.md)를 따른다.
|
||||
|
||||
공식 문서: [Sitemaps.submit](https://developers.google.com/webmaster-tools/v1/sitemaps/submit) ·
|
||||
[urlInspection.index.inspect](https://developers.google.com/webmaster-tools/v1/urlInspection.index/inspect)
|
||||
|
||||
## 1. 계약
|
||||
|
||||
```python
|
||||
class SearchConsoleClient:
|
||||
def __init__(self, credentials_file: str, *, transport: httpx.AsyncBaseTransport | None = None): ...
|
||||
async def submit_sitemap(self, property_url: str, sitemap_url: str) -> None: ...
|
||||
async def inspect_url(self, property_url: str, page_url: str) -> dict: ... # indexStatusResult 만
|
||||
async def aclose(self) -> None: ...
|
||||
# async with SearchConsoleClient(...) as client: ...
|
||||
```
|
||||
|
||||
- `credentials_file`: 서비스 계정 JSON 키 파일 경로.
|
||||
- `transport`: 테스트에서 `httpx.MockTransport` 를 꽂는 자리 — 실제 Google 호출 없이 검증한다.
|
||||
- `inspect_url` 은 응답의 `inspectionResult.indexStatusResult` 만 돌려준다. 그 경로가
|
||||
없거나(검사 실패) 빈 dict 면(실제 검사가 안 된 응답) `SearchConsoleError` 를 올린다 —
|
||||
**"미색인"으로 넘겨짚지 않는다.**
|
||||
|
||||
## 2. 인증
|
||||
|
||||
서비스 계정 JSON 키 파일 + scope `https://www.googleapis.com/auth/webmasters`.
|
||||
`google.oauth2.service_account` · `google.auth.transport.requests.Request` · `requests` 는
|
||||
전부 함수 안에서 import 한다. 두 패키지는 백엔드 `requirements.txt`에 포함되어 있다.
|
||||
|
||||
- 토큰은 클라이언트 인스턴스에 캐시된다(`credentials.valid` 인 동안 재사용, 매 호출
|
||||
갱신하지 않는다). 동시 호출은 `asyncio.Lock` 으로 갱신을 한 번만 태운다.
|
||||
- 갱신은 `asyncio.to_thread` 로 별도 스레드에서 돈다. 내부 `requests.Session` 요청에는
|
||||
타임아웃을 강제로 20초로 덮어씌운다(`Request.__call__` 기본값 120초를 무시) — 만료된
|
||||
키·막힌 네트워크에서 무한정 걸리는 것을 막는다.
|
||||
|
||||
## 3. 오류 — `SearchConsoleError(code)`
|
||||
|
||||
`code` 문자열 하나만 들고 다닌다. **Google 응답 본문·액세스 토큰·키 파일 내용·원본 예외
|
||||
메시지는 절대 담지 않는다** — 로그·잡 상태·관리 화면 어디로 흘러도 안전하다.
|
||||
|
||||
| code | 뜻 |
|
||||
|---|---|
|
||||
| `invalid_credentials_file` | 키 파일을 못 읽거나 형식이 잘못됨 |
|
||||
| `auth_failed` | 토큰 갱신 실패, 또는 갱신 후에도 토큰이 비어 있음 |
|
||||
| `unauthorized` | HTTP 401 |
|
||||
| `forbidden` | HTTP 403 |
|
||||
| `rate_limited` | HTTP 429 |
|
||||
| `server_error` | HTTP 5xx |
|
||||
| `http_<code>` | 그 외 실패 상태코드 |
|
||||
| `timeout` | 요청 타임아웃 |
|
||||
| `transport_error` | 그 외 전송 실패(연결 끊김 등) |
|
||||
| `invalid_json` | 200 인데 본문이 JSON 이 아님 |
|
||||
| `missing_inspection_result` | 응답에 `inspectionResult` 가 없음 |
|
||||
| `missing_index_status_result` | `inspectionResult` 는 있는데 `indexStatusResult` 가 없거나 빈 dict |
|
||||
|
||||
## 4. 테스트
|
||||
|
||||
```bash
|
||||
cd solution/backend
|
||||
APP_ENV=test .venv/bin/python -m pytest tests/test_search_console_client.py --confcutdir=tests
|
||||
```
|
||||
|
||||
`--confcutdir=tests` 가 필요한 이유: 저장소 루트 `conftest.py` 의 세션 스코프 autouse
|
||||
픽스처가 실 Postgres 연결을 요구한다(`solution/backend/conftest.py`). 이 클라이언트
|
||||
테스트는 DB 를 전혀 쓰지 않으므로 그 픽스처를 건너뛴다 — `--confcutdir=tests` 로 상위
|
||||
`conftest.py` 탐색을 끊는다. (통합 후 전체 스위트를 돌릴 때는 이 플래그 없이 실행한다.)
|
||||
|
||||
Google 실 API 는 전부 `httpx.MockTransport` 로 막았다 — 네트워크 호출도, 과금도 없다.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Teams 웹훅 확인 (2026-09-15)
|
||||
|
||||
- Adaptive Card 요청의 `contentUrl: null` 및 `$schema`를 공식 예제에 맞춰 보완했다.
|
||||
- HTTP 202는 워크플로의 요청 접수다. Teams 채널 게시 성공을 뜻하지 않는다.
|
||||
- 실제 전송 2건은 202였지만 사용자가 확인한 워크플로 실행은 실패였다.
|
||||
상세 오류를 확인하지 못했으므로 누락 필드를 실제 실패 원인으로 단정하지 않는다.
|
||||
- 운영 자동 알림 활성화 전, 채널 수신 또는 워크플로의 최종 게시 단계 성공을 확인해야 한다.
|
||||
- 웹훅은 `.env`에만 보관하고 커밋하지 않는다.
|
||||
|
||||
검증: 백엔드에서 `APP_ENV=test PYTHONPATH=. .venv/bin/pytest tests/test_search_console_alerts.py --confcutdir=tests`.
|
||||
공식 형식: https://learn.microsoft.com/en-us/connectors/teams/#adaptivecarditemschema
|
||||
Generated
+32
@@ -13,6 +13,9 @@
|
||||
"solution/site",
|
||||
"admin/frontend"
|
||||
],
|
||||
"devDependencies": {
|
||||
"playwright": "^1.63.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
@@ -7337,6 +7340,35 @@
|
||||
"pathe": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.63.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
|
||||
"integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.63.0"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.63.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
|
||||
"integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/pony-cause": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-1.1.1.tgz",
|
||||
|
||||
@@ -26,5 +26,8 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"playwright": "^1.63.0"
|
||||
}
|
||||
}
|
||||
@@ -317,6 +317,25 @@ CREATE TABLE IF NOT EXISTS public.place_area_refs (
|
||||
-- ★ 정적 빌드 — DB 는 빌드 시점에만 읽고 방문자와 만나지 않는다.
|
||||
-- ★ 해지는 물리 삭제가 아니라 상태 전이다. 색인된 페이지를 갑자기 404 로 만들지 않는다.
|
||||
-- ============================================================
|
||||
CREATE TABLE IF NOT EXISTS public.site_search_status (
|
||||
site_id uuid PRIMARY KEY,
|
||||
site_version_id uuid NOT NULL,
|
||||
property_url TEXT NOT NULL,
|
||||
page_url TEXT NOT NULL,
|
||||
published_at TIMESTAMPTZ NOT NULL,
|
||||
sitemap_submitted_at TIMESTAMPTZ NULL,
|
||||
inspected_at TIMESTAMPTZ NULL,
|
||||
first_indexed_at TIMESTAMPTZ NULL,
|
||||
inspection JSONB NULL,
|
||||
error_code VARCHAR(100) NULL,
|
||||
failures INTEGER NOT NULL DEFAULT 0,
|
||||
next_check_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
alerted_at TIMESTAMPTZ NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
deleted BOOLEAN NOT NULL DEFAULT false
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.sites (
|
||||
site_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
place_id uuid NOT NULL, -- 사업장과 1:1
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
-- 발행 상태를 바꾸지 않고 Google 제출/검사 결과를 추적한다.
|
||||
CREATE TABLE IF NOT EXISTS public.site_search_status (
|
||||
site_id uuid PRIMARY KEY,
|
||||
site_version_id uuid NOT NULL,
|
||||
property_url TEXT NOT NULL,
|
||||
page_url TEXT NOT NULL,
|
||||
published_at TIMESTAMPTZ NOT NULL,
|
||||
sitemap_submitted_at TIMESTAMPTZ NULL,
|
||||
inspected_at TIMESTAMPTZ NULL,
|
||||
first_indexed_at TIMESTAMPTZ NULL,
|
||||
inspection JSONB NULL,
|
||||
error_code VARCHAR(100) NULL,
|
||||
failures INTEGER NOT NULL DEFAULT 0,
|
||||
next_check_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
alerted_at TIMESTAMPTZ NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
deleted BOOLEAN NOT NULL DEFAULT false
|
||||
);
|
||||
@@ -454,6 +454,25 @@ class sites(MainTableMixin, MAIN_BASE):
|
||||
thumbnail_url = Column(String(500), nullable=True)
|
||||
|
||||
|
||||
class site_search_status(MainTableMixin, MAIN_BASE):
|
||||
"""발행 성공과 Google 색인 성공은 다른 사건이라 별도 보관한다."""
|
||||
|
||||
__tablename__ = "site_search_status"
|
||||
site_id = Column(UUID(as_uuid=True), primary_key=True)
|
||||
site_version_id = Column(UUID(as_uuid=True), nullable=False)
|
||||
property_url = Column(Text, nullable=False)
|
||||
page_url = Column(Text, nullable=False)
|
||||
published_at = Column(DateTime(timezone=True), nullable=False)
|
||||
sitemap_submitted_at = Column(DateTime(timezone=True), nullable=True)
|
||||
inspected_at = Column(DateTime(timezone=True), nullable=True)
|
||||
first_indexed_at = Column(DateTime(timezone=True), nullable=True)
|
||||
inspection = Column(JSONB, nullable=True)
|
||||
error_code = Column(String(100), nullable=True)
|
||||
failures = Column(Integer, nullable=False, server_default=text("0"))
|
||||
next_check_at = Column(DateTime(timezone=True), nullable=False, server_default=_utc_now_sql())
|
||||
alerted_at = Column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
|
||||
class site_sections(MainTableMixin, MAIN_BASE):
|
||||
"""섹션 하나의 콘텐츠. **JSON import/export 의 단위**다.
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ class LocalContentType(CodeEnum):
|
||||
|
||||
# 코드값 ↔ **타입명**. `area_contents.kind` 와 `site_sections.data.items[].kind` 가 같은 어휘를 쓴다 —
|
||||
# 개인화 행(거리·숨김)이 어느 공용 실체를 가리키는지 이름만 보고 알 수 있어야 한다.
|
||||
# ★ STORY 는 여기 없다. 그 다섯(songs·people·chronicle·postcard·quiz)은 kind 가 곧 타입명이고,
|
||||
# ★ STORY 는 여기 없다. 그것들(songs·people·chronicle·reading·postcard·quiz)은 kind 가 곧 타입명이고,
|
||||
# 코드값 하나(6)를 나눠 쓴다. 아래 표는 kind 가 비어 있던 장소류를 채우기 위한 것이다.
|
||||
AREA_KIND = {
|
||||
LocalContentType.WEATHER.value: "weather",
|
||||
@@ -328,9 +328,9 @@ AREA_KIND = {
|
||||
LocalContentType.COURSE.value: "course",
|
||||
}
|
||||
|
||||
# 지역 이야기 여섯. `services/prompts/story.py` 의 산출물 키와 같아야 한다.
|
||||
# 지역 이야기 일곱. `services/prompts/story.py` 의 산출물 키와 같아야 한다.
|
||||
# ★ 순서는 발행본 '지역 이야기' 탭 순서다(`site/sections/items/StorySection.tsx`).
|
||||
STORY_KINDS = ("songs", "daily", "people", "chronicle", "postcard", "quiz")
|
||||
STORY_KINDS = ("songs", "daily", "people", "chronicle", "reading", "postcard", "quiz")
|
||||
|
||||
|
||||
class LocalSource(CodeEnum):
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
"""발행 DB를 작업 원장으로 사용해 알림 적재 실패/재시작에도 대상을 다시 찾는다."""
|
||||
from sqlalchemy import select, or_, text
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
|
||||
from common.database.model.models import sites, places, site_versions, site_search_status as Status
|
||||
from common.enums import SiteStatus
|
||||
|
||||
|
||||
def published_conditions():
|
||||
return (
|
||||
sites.deleted.is_(False), places.deleted.is_(False),
|
||||
sites.status == SiteStatus.PUBLISHED.value,
|
||||
sites.published_at.is_not(None), sites.current_version_id.is_not(None),
|
||||
)
|
||||
|
||||
|
||||
async def lock_batch(session) -> bool:
|
||||
# 여러 API 프로세스가 같은 크론을 등록해도 외부 호출은 한 곳만 수행한다.
|
||||
return bool(await session.scalar(text("SELECT pg_try_advisory_xact_lock(734920151)")))
|
||||
|
||||
|
||||
async def new_publications(session, property_url: str):
|
||||
result = await session.execute(
|
||||
select(sites, places, site_versions)
|
||||
.join(places, places.place_id == sites.place_id)
|
||||
.join(site_versions, site_versions.site_version_id == sites.current_version_id)
|
||||
.outerjoin(Status, Status.site_id == sites.site_id)
|
||||
.where(*published_conditions(), site_versions.deleted.is_(False), or_(
|
||||
Status.site_id.is_(None), Status.site_version_id != sites.current_version_id,
|
||||
Status.property_url != property_url, Status.published_at != sites.published_at,
|
||||
))
|
||||
.order_by(sites.published_at).limit(100)
|
||||
)
|
||||
return result.all()
|
||||
|
||||
|
||||
async def register(session, values: dict):
|
||||
reset = dict(values, sitemap_submitted_at=None, inspected_at=None, first_indexed_at=None,
|
||||
inspection=None, error_code=None, failures=0, alerted_at=None,
|
||||
next_check_at=text("now()"), updated_at=text("now()"), deleted=False)
|
||||
await session.execute(insert(Status).values(**values).on_conflict_do_update(
|
||||
index_elements=[Status.site_id], set_=reset,
|
||||
))
|
||||
|
||||
|
||||
async def due_sites(session, property_url: str):
|
||||
result = await session.execute(
|
||||
select(Status).join(sites, sites.site_id == Status.site_id)
|
||||
.join(places, places.place_id == sites.place_id)
|
||||
.where(*published_conditions(), Status.deleted.is_(False),
|
||||
Status.site_version_id == sites.current_version_id,
|
||||
Status.published_at == sites.published_at, Status.property_url == property_url,
|
||||
Status.next_check_at <= text("now()"))
|
||||
.order_by(Status.next_check_at).limit(5)
|
||||
.with_for_update(of=Status)
|
||||
)
|
||||
return result.scalars().all()
|
||||
@@ -9,6 +9,8 @@ orjson
|
||||
pydantic>=2.0
|
||||
python-multipart
|
||||
httpx
|
||||
google-auth>=2.0 # Search Console 서비스 계정 인증 (선택 기능)
|
||||
requests>=2.31 # google-auth 토큰 갱신 transport
|
||||
apscheduler>=3.10
|
||||
pydantic-settings # 환경변수·.env 로드 (FastAPI 공식 설정 방식)
|
||||
azure-storage-blob>=12.19
|
||||
|
||||
@@ -15,6 +15,7 @@ import router.v1.place.place
|
||||
import router.v1.fact.fact
|
||||
import router.v1.faq.faq
|
||||
import router.v1.media.media
|
||||
import router.v1.media.relay
|
||||
import router.v1.job.job
|
||||
import router.v1.site.site
|
||||
import router.v1.site.showcase
|
||||
@@ -86,6 +87,9 @@ app.include_router(router.v1.place.place.router)
|
||||
app.include_router(router.v1.fact.fact.router)
|
||||
app.include_router(router.v1.faq.faq.router)
|
||||
app.include_router(router.v1.media.media.router)
|
||||
# ★ 인증 없는 공개 중계. 발행본(정적 페이지)이 캔버스에 사진을 그릴 때 부른다 —
|
||||
# 남의 CDN 이 CORS 를 안 줘서 캔버스가 오염되는 것을 피하는 유일한 길이다(relay.py).
|
||||
app.include_router(router.v1.media.relay.router)
|
||||
app.include_router(router.v1.job.job.router)
|
||||
app.include_router(router.v1.site.site.router)
|
||||
app.include_router(router.v1.site.site.my_router)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
"""사진 중계 — 남의 도메인 사진을 **우리 오리진으로** 흘려보낸다.
|
||||
|
||||
★ 왜 필요한가 (2026-09-15, 실측)
|
||||
수집한 사진은 `*.pstatic.net` · `tong.visitkorea.or.kr` 에 있고 그쪽은
|
||||
`Access-Control-Allow-Origin` 을 주지 않는다. 그 사진을 캔버스에 그리면 캔버스가 **오염돼**
|
||||
`toBlob` 이 막힌다 — 엽서 쓰기의 저장·공유가 죽는다. 브라우저 정책이라 클라이언트에서는
|
||||
못 넘는다. CORS 없는 `fetch` 도 같은 벽이다. **같은 오리진에서 바이트가 와야** 풀린다.
|
||||
|
||||
★ 굽는 쪽(`site/scripts/prerender.ts` mirrorMedia)이 이미 사진을 내려받아 사이트 폴더에
|
||||
놓는다. 그게 근본이다. 다만 그건 **다시 굽는 사이트에만** 적용된다 — 이미 나가 있는
|
||||
사이트는 사장님이 재발행할 때까지 옛 주소를 문다. 이 중계가 그 사이를 메운다.
|
||||
|
||||
★ 열린 프록시가 되지 않게 좁혀 둔다. 이건 "아무 주소나 가져다주는 통로" 가 아니다:
|
||||
· https 만
|
||||
· 호스트가 `_ALLOWED_SUFFIXES` 에 있는 것만 (우리 수집기가 쓰는 사진 CDN)
|
||||
· 응답이 이미지가 아니면 거절, 크기 상한
|
||||
· 리다이렉트를 따라가되 최종 호스트도 다시 검사한다 — 안 그러면 allowlist 를 우회한다
|
||||
"""
|
||||
import ipaddress
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import httpx
|
||||
from fastapi import APIRouter, HTTPException, Query, Response
|
||||
|
||||
from common.logger import LOG
|
||||
|
||||
router = APIRouter(prefix="/v1/image", tags=["Image"])
|
||||
|
||||
# 우리 수집기가 사진을 가져오는 곳. 여기 없는 호스트는 중계하지 않는다.
|
||||
# ★ 늘릴 때는 "우리가 이미 그 사진을 화면에 싣고 있는 곳인가" 를 먼저 본다.
|
||||
_ALLOWED_SUFFIXES = (
|
||||
".pstatic.net",
|
||||
"tong.visitkorea.or.kr",
|
||||
".visitkorea.or.kr",
|
||||
"upload.wikimedia.org",
|
||||
)
|
||||
|
||||
_MAX_BYTES = 8 * 1024 * 1024
|
||||
_TIMEOUT = httpx.Timeout(10.0, connect=5.0)
|
||||
# 기본 UA 를 거절하는 CDN 이 있다. 탐지 우회가 아니라 평범한 브라우저로 보이게 하는 것뿐이다.
|
||||
_HEADERS = {"user-agent": "Mozilla/5.0 (compatible; o2o-web4ai/1.0)"}
|
||||
|
||||
|
||||
def _allowed(url: str) -> bool:
|
||||
parsed = urlparse(url)
|
||||
if parsed.scheme != "https" or not parsed.hostname:
|
||||
return False
|
||||
host = parsed.hostname.lower()
|
||||
# 숫자 주소는 받지 않는다 — 사내망으로 향하는 통로를 만들지 않는다.
|
||||
try:
|
||||
ipaddress.ip_address(host)
|
||||
return False
|
||||
except ValueError:
|
||||
pass
|
||||
return any(host == suffix.lstrip(".") or host.endswith(suffix) for suffix in _ALLOWED_SUFFIXES)
|
||||
|
||||
|
||||
@router.get("/relay", summary="사진 중계 — 캔버스 오염을 피하려고 같은 오리진으로 흘려보낸다")
|
||||
async def relay(url: str = Query(min_length=8, max_length=2000)):
|
||||
"""인증을 요구하지 않는다. 발행본은 로그인 없이 열리는 정적 페이지이고, 여기서 나가는
|
||||
것은 **그 페이지가 이미 화면에 싣고 있는 사진**뿐이다(allowlist 가 그걸 보장한다)."""
|
||||
if not _allowed(url):
|
||||
raise HTTPException(status_code=400, detail="중계할 수 없는 주소입니다")
|
||||
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=_TIMEOUT, headers=_HEADERS, follow_redirects=True) as client:
|
||||
res = await client.get(url)
|
||||
except httpx.HTTPError as ex:
|
||||
LOG.w(f"[image] 중계 실패 {url}: {ex}")
|
||||
raise HTTPException(status_code=502, detail="사진을 가져오지 못했습니다")
|
||||
|
||||
# 리다이렉트로 allowlist 밖으로 나갔으면 거기서 끊는다.
|
||||
if not _allowed(str(res.url)):
|
||||
raise HTTPException(status_code=400, detail="중계할 수 없는 주소입니다")
|
||||
|
||||
kind = (res.headers.get("content-type") or "").split(";")[0].strip().lower()
|
||||
if res.status_code != 200 or not kind.startswith("image/"):
|
||||
raise HTTPException(status_code=502, detail="사진이 아닙니다")
|
||||
if len(res.content) == 0 or len(res.content) > _MAX_BYTES:
|
||||
raise HTTPException(status_code=502, detail="사진 크기가 범위를 벗어났습니다")
|
||||
|
||||
# 주소가 곧 내용이다(원본이 바뀌면 주소도 바뀐다) — 길게 캐시해서 중계 횟수를 줄인다.
|
||||
return Response(
|
||||
content=res.content,
|
||||
media_type=kind,
|
||||
headers={"cache-control": "public, max-age=604800, immutable"},
|
||||
)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
다중 워커(운영)에서 잡이 워커마다 중복 실행되면 안 되므로 SCHEDULER_ENABLED=1 인 프로세스에서만 등록한다.
|
||||
|
||||
등록된 잡: 없음(스켈레톤). 붙을 잡 —
|
||||
등록된 잡: Search Console (GSC_ENABLED=1, 10분마다). 붙을 잡 —
|
||||
· 지역정보 갱신 : 축제 주 1회 / 관광정보 월 1회 / 날씨 시간 단위 — 행정구역 코드 단위 캐시 갱신
|
||||
· 수집 재시도 : 실패한 수집 작업 재시도 (외부 API 실패 시 직전 값 유지 + 내부 알림)
|
||||
· 사이트 재빌드 : 검증 상태가 바뀐 place 만 개별 재빌드 (전체 재빌드 금지)
|
||||
@@ -33,8 +33,12 @@ def start_scheduler():
|
||||
|
||||
# 한국시간 기준. 잡은 scheduler/jobs.py 에 정의하고 여기서 add_job 으로 등록한다.
|
||||
_scheduler = AsyncIOScheduler(timezone="Asia/Seoul")
|
||||
if os.environ.get("GSC_ENABLED") == "1":
|
||||
from services.search_console_service import run_scheduled_check
|
||||
_scheduler.add_job(run_scheduled_check, "interval", minutes=10,
|
||||
id="search-console", max_instances=1, coalesce=True)
|
||||
_scheduler.start()
|
||||
LOG.i("[scheduler] started (KST: 등록된 잡 없음)")
|
||||
LOG.i(f"[scheduler] started (KST: {len(_scheduler.get_jobs())}개 잡)")
|
||||
|
||||
|
||||
def shutdown_scheduler():
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
"""저장된 관측값만 출력한다. Google 호출/색인 요청은 하지 않는다."""
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from sqlalchemy import select
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import site_search_status as Status
|
||||
from common.enums import DBType
|
||||
|
||||
|
||||
async def main():
|
||||
async def read(session):
|
||||
rows = (await session.execute(select(Status).where(Status.deleted.is_(False))
|
||||
.order_by(Status.published_at.desc()))).scalars().all()
|
||||
return [{"url": row.page_url, "published_at": row.published_at,
|
||||
"sitemap_submitted_at": row.sitemap_submitted_at,
|
||||
"inspected_at": row.inspected_at, "first_indexed_at": row.first_indexed_at,
|
||||
"inspection": row.inspection, "error_code": row.error_code,
|
||||
"next_check_at": row.next_check_at, "alerted_at": row.alerted_at} for row in rows]
|
||||
try:
|
||||
rows = await DB_SESSION_MNG.execute_lambda_write(DBType.MAIN.value, read)
|
||||
print(json.dumps(rows, ensure_ascii=False, indent=2, default=str))
|
||||
finally:
|
||||
await DB_SESSION_MNG.dispose_all()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
@@ -11,9 +11,12 @@
|
||||
`search_results` 의 첫 줄을 붙인다 — 모델 답변은 환각이 섞이지만 search_results 는
|
||||
실제로 검색된 주소다(`grounding/channels.py` 와 같은 판단).
|
||||
둘 다 없으면 항목을 버린다. 출처 없는 사실은 이 레포의 규칙 위반이다.
|
||||
★ 예외가 하나 있다 — `_SEARCH_LINK_KINDS`. 거기 있는 종류는 **모델의 URL 을 아예 안 받고**
|
||||
제목으로 찾아가는 검색 링크를 코드가 만든다.
|
||||
"""
|
||||
import json
|
||||
import re
|
||||
from urllib.parse import quote
|
||||
|
||||
from common.logger import LOG
|
||||
|
||||
@@ -23,10 +26,27 @@ _TITLE_KEY = {
|
||||
"daily": "title",
|
||||
"people": "name",
|
||||
"chronicle": "title",
|
||||
"reading": "title",
|
||||
"postcard": "line",
|
||||
"quiz": "question",
|
||||
}
|
||||
|
||||
# ★ 출처를 **모델에게 받지 않고 코드가 만드는** 종류.
|
||||
# 개별 문서 주소(`terms.naver.com/entry.naver?docId=…`)는 짐작해서 적으면 없는 문서로
|
||||
# 이어진다 — 레포 절대규칙(없는 사실을 짓지 않는다)에 걸린다. 검색 링크는 제목을 그대로
|
||||
# 넘기니 항상 관련 결과로 뜬다. 2026-09-14 대표 지시("확인필요 없애고 링크는 네이버 링크로"),
|
||||
# 시연본 구현은 `site/scripts/mockup/build_reading.py` 의 `naver()`.
|
||||
_SEARCH_LINK_KINDS = {"reading"}
|
||||
|
||||
|
||||
def _search_source(title: str, region_label: str) -> dict:
|
||||
"""제목으로 찾아가는 검색 링크. 지역명이 제목에 없으면 붙여 검색 정확도를 올린다."""
|
||||
region = (region_label or "").split()[-1] if region_label else ""
|
||||
query = title if (not region or region[:-1] in title or region in title) else f"{title} {region}"
|
||||
return {"name": "네이버에서 찾아보기",
|
||||
"url": "https://search.naver.com/search.naver?query=" + quote(query)}
|
||||
|
||||
|
||||
# 코드펜스를 두르고 오는 경우가 있다. 규칙 1 로 금지했지만 모델은 종종 어긴다.
|
||||
_FENCE_RE = re.compile(r"^\s*```(?:json)?\s*|\s*```\s*$", re.MULTILINE)
|
||||
|
||||
@@ -57,7 +77,9 @@ def _clean_source(value) -> dict | None:
|
||||
return {"name": (value.get("name") or url).strip(), "url": url}
|
||||
|
||||
|
||||
def parse_items(payload: dict, kind: str, limit: int) -> tuple[list[dict], list[str]]:
|
||||
def parse_items(
|
||||
payload: dict, kind: str, limit: int, region_label: str = ""
|
||||
) -> tuple[list[dict], list[str]]:
|
||||
"""(쓸 수 있는 항목, 버린 이유) — 버린 이유는 로그와 잡 결과에 남긴다.
|
||||
|
||||
한 항목이 잘못돼도 나머지를 살린다. 지역 하나에 8~14건인데 한 줄 때문에 전부 버리면
|
||||
@@ -101,6 +123,14 @@ def parse_items(payload: dict, kind: str, limit: int) -> tuple[list[dict], list[
|
||||
item = {k: v for k, v in raw.items() if v not in (None, "", [], {})}
|
||||
item[title_key] = title
|
||||
|
||||
if kind in _SEARCH_LINK_KINDS:
|
||||
# 출처는 코드가 만든다(위 _SEARCH_LINK_KINDS). 모델이 URL 을 적어 왔어도 버린다 —
|
||||
# 짐작해 적은 주소가 섞이는 통로를 아예 남기지 않는다. 검수 배지도 함께 뺀다.
|
||||
item["source"] = _search_source(title, region_label)
|
||||
item.pop("verified", None)
|
||||
out.append(item)
|
||||
continue
|
||||
|
||||
source = _clean_source(raw.get("source")) or fallback
|
||||
if source is None:
|
||||
dropped.append(f"{title}: 출처가 없다")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"label": "가요 다방",
|
||||
"maxItems": 8,
|
||||
"task": "[해야 할 일]\n[지역]을 노래한 대중가요를 8곡까지 찾아 아래 JSON 으로 정리한다.\n1960~80년대 곡을 우선하고, 지명·항구·강·다리가 제목이나 배경에 나오는 곡을 고른다.\n\n[스키마]\n{ \"kind\":\"songs\", \"version\":1, \"title\":\"가요 다방\", \"subtitle\":\"...\", \"items\":[\n { \"title\":\"곡명\", \"artist\":\"가수\", \"lyricist\":\"작사\", \"composer\":\"작곡\",\n \"year\":1966, \"label\":\"음반사\", \"labelColor\":\"#d4551f\",\n \"story\":\"곡의 배경 (두 문장 이내, 가사 없이)\",\n \"connection\":\"[업소]와 이 곡을 잇는 한 문장\",\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||
"rules": "\n[이 아이템만의 규칙]\n· lyrics 필드는 스키마에 없다. 어떤 이유로도 만들지 마라. 가사 한 소절도 안 된다.\n· labelColor 는 레코드 라벨 색이다. 곡의 분위기에 맞춰 진한 색 하나를 hex 로 고른다.\n· 작사·작곡·발표연도를 모르면 그 필드를 뺀다. \"미상\" 이라고 쓰지 않는다.\n"
|
||||
"rules": "\n[이 아이템만의 규칙]\n· lyrics 필드는 스키마에 없다. 어떤 이유로도 만들지 마라. 가사 한 소절도 안 된다.\n· labelColor 는 레코드 라벨 색이다. 곡의 분위기에 맞춰 진한 색 하나를 hex 로 고른다.\n **이건 사실이 아니라 디자인 값이다 — 공통 규칙 2 를 적용하지 말고 곡마다 반드시 채운다.**\n 앞뒤 곡과 같은 색을 쓰지 않는다. 비워 두면 판이 전부 한 색으로 깔린다(실측 2026-09-15:\n 67곡 중 63곡이 비어 있었다).\n· 작사·작곡·발표연도를 모르면 그 필드를 뺀다. \"미상\" 이라고 쓰지 않는다.\n"
|
||||
},
|
||||
"daily": {
|
||||
"kind": "daily",
|
||||
@@ -30,6 +30,13 @@
|
||||
"task": "[해야 할 일]\n[지역]의 역사를 연도순으로 10~14개 사건으로 정리한다.\n가장 오래된 것부터 가장 최근까지 고르게 펴고, 한 시대에 몰지 않는다.\n\n[스키마]\n{ \"kind\":\"chronicle\", \"version\":1, \"title\":\"시간의 골목\", \"items\":[\n { \"year\":1899, \"title\":\"사건 이름\", \"summary\":\"두 문장 이내\",\n \"place\":\"지금 가 볼 수 있는 자리\", \"turning\":true,\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||
"rules": "\n[이 아이템만의 규칙]\n· turning 은 도시의 성격을 바꾼 해에만 true 다. 3~4개를 넘기지 않는다.\n· 연도가 불확실하면 그 항목을 통째로 뺀다. 연표에서 틀린 연도는 바로 들킨다.\n· place 는 지금도 찾아갈 수 있는 자리만 적는다. 없으면 필드를 뺀다.\n· 다만 **찾아갈 수 있는 자리가 있으면 반드시 적는다.** 행정 개편처럼 장소가 없어 보이는\n 사건에도 그 일이 남긴 자리가 대개 있다(개항 → 항구, 부두 건설 → 그 부두, 준공 → 그 구조물).\n 이 값으로 공공데이터에서 그 해의 사진을 찾아 붙인다 — 비면 연표가 활자만으로 선다.\n"
|
||||
},
|
||||
"reading": {
|
||||
"kind": "reading",
|
||||
"label": "지역 읽기",
|
||||
"maxItems": 34,
|
||||
"task": "[해야 할 일]\n[지역]을 소개하는 글 30~34꼭지를 갈래로 나눠 쓴다.\n갈래는 다섯이다 — 문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활.\n한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.\n\n[스키마]\n{ \"kind\":\"reading\", \"version\":1, \"title\":\"[지역] 읽기\",\n \"subtitle\":\"문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지\",\n \"items\":[\n { \"group\":\"문학|섬과 바다|역사|장소|음식과 생활\",\n \"title\":\"꼭지 제목\", \"body\":\"서너 문장\", \"year\":1937 } ] }",
|
||||
"rules": "\n[이 아이템만의 규칙]\n· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.\n 다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.\n· **이미 다른 자리에 선 것은 쓰지 않는다.** 인물·대중가요·축제·연표 사건·주변 명소·맛집은\n 각자 섹션이 있다. 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.\n· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.\n· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —\n 제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).\n· 시·소설·가사의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.\n· 부제에 전체 개수를 적지 않는다. 화면은 이 중 5~6개만 매번 무작위로 보여준다 —\n 숫자를 박으면 보이는 개수와 어긋난다.\n"
|
||||
},
|
||||
"postcard": {
|
||||
"kind": "postcard",
|
||||
"label": "오늘의 엽서",
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
"""Teams Workflow 수신용. 원문 오류/인증 정보는 메시지에 싣지 않는다."""
|
||||
from datetime import timedelta
|
||||
|
||||
import httpx
|
||||
|
||||
from common.logger import LOG
|
||||
|
||||
|
||||
def alert_reason(row, now, days: int) -> str | None:
|
||||
if row.alerted_at and now - row.alerted_at < timedelta(days=1):
|
||||
return None
|
||||
if row.error_code:
|
||||
return f"조회/제출 실패: {row.error_code}"
|
||||
if (row.inspection or {}).get("verdict") == "PASS":
|
||||
return None
|
||||
if now - row.published_at >= timedelta(days=days):
|
||||
return f"발행 후 {days}일 이상 색인 미확인"
|
||||
return None
|
||||
|
||||
|
||||
async def send_alert(webhook_url: str, page_url: str, reason: str) -> bool:
|
||||
if not webhook_url:
|
||||
return False
|
||||
if not webhook_url.startswith("https://"):
|
||||
LOG.w("[search-console] ALERT_URL_INVALID")
|
||||
return False
|
||||
payload = {"type": "message", "attachments": [{
|
||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
||||
"contentUrl": None,
|
||||
"content": {"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
||||
"type": "AdaptiveCard", "version": "1.2", "body": [
|
||||
{"type": "TextBlock", "text": "Google 색인 확인 필요", "weight": "Bolder"},
|
||||
{"type": "TextBlock", "text": page_url, "wrap": True},
|
||||
{"type": "TextBlock", "text": reason, "wrap": True},
|
||||
]},
|
||||
}]}
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=10, follow_redirects=False) as client:
|
||||
response = await client.post(webhook_url, json=payload)
|
||||
response.raise_for_status()
|
||||
return True
|
||||
except httpx.HTTPError:
|
||||
# webhook 주소 자체가 인증 수단이므로 예외 문자열도 로그에 남기지 않는다.
|
||||
LOG.w("[search-console] ALERT_DELIVERY_FAILED")
|
||||
return False
|
||||
@@ -0,0 +1,164 @@
|
||||
"""Google Search Console REST 클라이언트 — 사이트맵 제출 · URL 색인 상태 조회.
|
||||
|
||||
PUT https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}
|
||||
POST https://searchconsole.googleapis.com/v1/urlInspection/index:inspect
|
||||
|
||||
자세한 계약은 docs/SEARCH_CONSOLE_CLIENT.md.
|
||||
|
||||
★ `SearchConsoleError` 는 `code` 문자열만 담는다 — Google 응답 본문·토큰·키·원본
|
||||
예외 메시지는 절대 싣지 않는다.
|
||||
★ `inspectionResult`·`indexStatusResult` 가 없거나 빈 응답은 "미색인"으로
|
||||
넘겨짚지 않고 예외로 끊는다 — 검사 실패와 색인 결과를 구분 못하면 오판이 된다.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from typing import Any
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
SITEMAPS_BASE = "https://www.googleapis.com/webmasters/v3/sites"
|
||||
INSPECT_URL = "https://searchconsole.googleapis.com/v1/urlInspection/index:inspect"
|
||||
SCOPES = ["https://www.googleapis.com/auth/webmasters"]
|
||||
TIMEOUT_SEC = 20.0
|
||||
AUTH_REFRESH_TIMEOUT_SEC = 20.0
|
||||
|
||||
|
||||
class SearchConsoleError(RuntimeError):
|
||||
"""code 만 담는다 — Google 응답 본문·토큰·키는 여기 실으면 안 된다."""
|
||||
|
||||
def __init__(self, code: str):
|
||||
self.code = code
|
||||
super().__init__(code)
|
||||
|
||||
|
||||
def _service_account_credentials(credentials_file: str):
|
||||
"""lazy import — 미설치여도 이 모듈의 import 자체는 죽지 않는다."""
|
||||
from google.oauth2 import service_account
|
||||
|
||||
return service_account.Credentials.from_service_account_file(credentials_file, scopes=SCOPES)
|
||||
|
||||
|
||||
def _refresh_sync(credentials) -> None:
|
||||
"""동기 토큰 갱신. `asyncio.to_thread` 로 감싸 부른다.
|
||||
|
||||
`Request.__call__` 기본 타임아웃(120s)을 그대로 두면 만료된 키·막힌 네트워크에서
|
||||
오래 걸릴 수 있다 — 매 요청에 상한을 강제로 덮어씌운다(호출측이 넘긴 값 포함)."""
|
||||
import requests
|
||||
from google.auth.transport.requests import Request
|
||||
|
||||
with requests.Session() as session:
|
||||
original_request = session.request
|
||||
|
||||
def _request_with_timeout(*args, **kwargs):
|
||||
kwargs["timeout"] = AUTH_REFRESH_TIMEOUT_SEC
|
||||
return original_request(*args, **kwargs)
|
||||
|
||||
session.request = _request_with_timeout
|
||||
credentials.refresh(Request(session=session))
|
||||
|
||||
|
||||
def _status_error_code(status_code: int) -> str:
|
||||
if status_code == 401:
|
||||
return "unauthorized"
|
||||
if status_code == 403:
|
||||
return "forbidden"
|
||||
if status_code == 429:
|
||||
return "rate_limited"
|
||||
if 500 <= status_code < 600:
|
||||
return "server_error"
|
||||
return f"http_{status_code}"
|
||||
|
||||
|
||||
def _transport_error_code(ex: httpx.HTTPError) -> str:
|
||||
if isinstance(ex, httpx.TimeoutException):
|
||||
return "timeout"
|
||||
return "transport_error"
|
||||
|
||||
|
||||
class SearchConsoleClient:
|
||||
def __init__(self, credentials_file: str, *, transport: httpx.AsyncBaseTransport | None = None):
|
||||
self._credentials_file = credentials_file
|
||||
self._client = httpx.AsyncClient(timeout=TIMEOUT_SEC, transport=transport)
|
||||
self._credentials: Any = None
|
||||
self._auth_lock = asyncio.Lock()
|
||||
|
||||
async def __aenter__(self) -> "SearchConsoleClient":
|
||||
return self
|
||||
|
||||
async def __aexit__(self, exc_type, exc, tb) -> None:
|
||||
await self.aclose()
|
||||
|
||||
async def aclose(self) -> None:
|
||||
await self._client.aclose()
|
||||
|
||||
async def submit_sitemap(self, property_url: str, sitemap_url: str) -> None:
|
||||
url = f"{SITEMAPS_BASE}/{quote(property_url, safe='')}/sitemaps/{quote(sitemap_url, safe='')}"
|
||||
headers = await self._auth_headers()
|
||||
res = await self._put(url, headers)
|
||||
self._raise_for_status(res)
|
||||
|
||||
async def inspect_url(self, property_url: str, page_url: str) -> dict[str, Any]:
|
||||
headers = await self._auth_headers()
|
||||
body = {"inspectionUrl": page_url, "siteUrl": property_url}
|
||||
res = await self._post(INSPECT_URL, headers, body)
|
||||
self._raise_for_status(res)
|
||||
return _index_status_result(res)
|
||||
|
||||
async def _put(self, url: str, headers: dict[str, str]) -> httpx.Response:
|
||||
try:
|
||||
return await self._client.put(url, headers=headers)
|
||||
except httpx.HTTPError as ex:
|
||||
raise SearchConsoleError(_transport_error_code(ex)) from None
|
||||
|
||||
async def _post(self, url: str, headers: dict[str, str], body: dict[str, Any]) -> httpx.Response:
|
||||
try:
|
||||
return await self._client.post(url, headers=headers, json=body)
|
||||
except httpx.HTTPError as ex:
|
||||
raise SearchConsoleError(_transport_error_code(ex)) from None
|
||||
|
||||
def _raise_for_status(self, res: httpx.Response) -> None:
|
||||
if not res.is_success:
|
||||
raise SearchConsoleError(_status_error_code(res.status_code))
|
||||
|
||||
async def _auth_headers(self) -> dict[str, str]:
|
||||
token = await self._access_token()
|
||||
return {"Authorization": f"Bearer {token}"}
|
||||
|
||||
async def _access_token(self) -> str:
|
||||
credentials = self._load_credentials()
|
||||
if not getattr(credentials, "valid", False):
|
||||
async with self._auth_lock:
|
||||
if not getattr(credentials, "valid", False):
|
||||
try:
|
||||
await asyncio.to_thread(_refresh_sync, credentials)
|
||||
except Exception:
|
||||
raise SearchConsoleError("auth_failed") from None
|
||||
token = getattr(credentials, "token", None)
|
||||
if not token:
|
||||
raise SearchConsoleError("auth_failed")
|
||||
return token
|
||||
|
||||
def _load_credentials(self) -> Any:
|
||||
if self._credentials is None:
|
||||
try:
|
||||
self._credentials = _service_account_credentials(self._credentials_file)
|
||||
except Exception:
|
||||
raise SearchConsoleError("invalid_credentials_file") from None
|
||||
return self._credentials
|
||||
|
||||
|
||||
def _index_status_result(res: httpx.Response) -> dict[str, Any]:
|
||||
try:
|
||||
data = res.json()
|
||||
except ValueError:
|
||||
raise SearchConsoleError("invalid_json") from None
|
||||
inspection_result = data.get("inspectionResult") if isinstance(data, dict) else None
|
||||
if not isinstance(inspection_result, dict):
|
||||
raise SearchConsoleError("missing_inspection_result")
|
||||
index_status_result = inspection_result.get("indexStatusResult")
|
||||
if not isinstance(index_status_result, dict) or not index_status_result:
|
||||
raise SearchConsoleError("missing_index_status_result")
|
||||
return index_status_result
|
||||
@@ -0,0 +1,129 @@
|
||||
"""발행 감지 → 사이트맵 제출 → 색인 조회 → 알림. 발행 잡과 별도 트랜잭션이다."""
|
||||
import asyncio
|
||||
import xml.etree.ElementTree as ET
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
import httpx
|
||||
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.enums import DBType
|
||||
from common.logger import LOG
|
||||
from crud import search_console_crud as store
|
||||
from services import site_payload
|
||||
from services.search_console_alerts import alert_reason, send_alert
|
||||
from services.search_console_client import SearchConsoleClient, SearchConsoleError
|
||||
from services.search_console_settings import load_settings, belongs_to_property
|
||||
|
||||
|
||||
async def run_scheduled_check():
|
||||
try:
|
||||
settings = load_settings()
|
||||
if settings is None:
|
||||
return
|
||||
await DB_SESSION_MNG.execute_lambda_write(
|
||||
DBType.MAIN.value, lambda session: run_batch(session, settings),
|
||||
)
|
||||
except Exception:
|
||||
# 크론 실패가 API/발행에 전파되지 않고 다음 주기에 재시도된다.
|
||||
LOG.w("[search-console] BATCH_FAILED — 설정 및 DB 마이그레이션 확인 필요")
|
||||
|
||||
|
||||
async def run_batch(session, settings):
|
||||
if not await store.lock_batch(session):
|
||||
return
|
||||
if not belongs_to_property(site_payload.publish_origin() + "/sitemap.xml", settings.property_url):
|
||||
raise SearchConsoleError("PROPERTY_MISMATCH")
|
||||
await register_publications(session, settings)
|
||||
rows = await store.due_sites(session, settings.property_url)
|
||||
if not rows:
|
||||
return
|
||||
async with SearchConsoleClient(settings.credentials_file) as client:
|
||||
submitted = set()
|
||||
for row in rows:
|
||||
await check_site(client, row, settings, submitted)
|
||||
await session.flush()
|
||||
|
||||
|
||||
async def register_publications(session, settings):
|
||||
for site, place, version in await store.new_publications(session, settings.property_url):
|
||||
slug = site_payload.publish_slug(place, site)
|
||||
page_url = f"{site_payload.publish_origin()}/s/{slug}"
|
||||
if not belongs_to_property(page_url, settings.property_url):
|
||||
LOG.w("[search-console] PROPERTY_MISMATCH")
|
||||
continue
|
||||
await store.register(session, {
|
||||
"site_id": site.site_id, "site_version_id": version.site_version_id,
|
||||
"property_url": settings.property_url, "page_url": page_url,
|
||||
"published_at": site.published_at,
|
||||
})
|
||||
|
||||
|
||||
async def read_sitemap(sitemap_url: str) -> set[str]:
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=20, follow_redirects=False) as client:
|
||||
async with client.stream("GET", sitemap_url) as response:
|
||||
response.raise_for_status()
|
||||
body = bytearray()
|
||||
async for chunk in response.aiter_bytes():
|
||||
body.extend(chunk)
|
||||
if len(body) > 5_000_000:
|
||||
raise SearchConsoleError("SITEMAP_TOO_LARGE")
|
||||
root = ET.fromstring(body)
|
||||
return {(item.text or "").strip() for item in root.iter(
|
||||
"{http://www.sitemaps.org/schemas/sitemap/0.9}loc"
|
||||
)}
|
||||
except (httpx.HTTPError, ET.ParseError):
|
||||
raise SearchConsoleError("SITEMAP_UNAVAILABLE") from None
|
||||
|
||||
|
||||
async def submit_sitemap(client, row, submitted: set):
|
||||
if row.sitemap_submitted_at:
|
||||
return
|
||||
sitemap_url = site_payload.publish_origin() + "/sitemap.xml"
|
||||
# 디스크가 아니라 실제 공개 URL을 확인한다. 업로드 지연 시 Google에 먼저 알리지 않는다.
|
||||
urls = await read_sitemap(sitemap_url)
|
||||
if row.page_url not in urls:
|
||||
raise SearchConsoleError("URL_NOT_IN_SITEMAP")
|
||||
if sitemap_url not in submitted:
|
||||
await client.submit_sitemap(row.property_url, sitemap_url)
|
||||
submitted.add(sitemap_url)
|
||||
row.sitemap_submitted_at = datetime.now(timezone.utc)
|
||||
|
||||
|
||||
def record_inspection(row, inspection: dict, now):
|
||||
row.inspection = inspection
|
||||
row.inspected_at = now
|
||||
row.error_code = None
|
||||
row.failures = 0
|
||||
if inspection.get("verdict") == "PASS":
|
||||
row.first_indexed_at = row.first_indexed_at or now
|
||||
row.next_check_at = now + timedelta(days=1)
|
||||
|
||||
|
||||
def record_error(row, code: str, now):
|
||||
row.error_code = code
|
||||
row.failures = (row.failures or 0) + 1
|
||||
hours = min(24, 2 ** min(row.failures - 1, 5))
|
||||
row.next_check_at = now + timedelta(hours=hours)
|
||||
|
||||
|
||||
async def check_site(client, row, settings, submitted: set):
|
||||
now = datetime.now(timezone.utc)
|
||||
try:
|
||||
if not belongs_to_property(row.page_url, settings.property_url):
|
||||
raise SearchConsoleError("PROPERTY_MISMATCH")
|
||||
async with asyncio.timeout(90):
|
||||
await submit_sitemap(client, row, submitted)
|
||||
inspection = await client.inspect_url(row.property_url, row.page_url)
|
||||
record_inspection(row, inspection, now)
|
||||
except SearchConsoleError as ex:
|
||||
record_error(row, ex.code, now)
|
||||
except TimeoutError:
|
||||
record_error(row, "CHECK_TIMEOUT", now)
|
||||
except Exception:
|
||||
record_error(row, "CHECK_FAILED", now)
|
||||
reason = alert_reason(row, now, settings.alert_days)
|
||||
if reason:
|
||||
LOG.w(f"[search-console] site={row.site_id} {reason}")
|
||||
if await send_alert(settings.alert_url, row.page_url, reason):
|
||||
row.alerted_at = now
|
||||
@@ -0,0 +1,43 @@
|
||||
"""Google 로그인 설정과 분리한다. 서비스 계정 키는 서버 파일로만 읽는다."""
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SearchConsoleSettings:
|
||||
property_url: str
|
||||
credentials_file: str
|
||||
alert_url: str = ""
|
||||
alert_days: int = 7
|
||||
|
||||
|
||||
def load_settings() -> SearchConsoleSettings | None:
|
||||
if os.environ.get("GSC_ENABLED") != "1":
|
||||
return None
|
||||
prop = os.environ.get("GSC_PROPERTY_URL", "").strip()
|
||||
key_file = os.environ.get("GSC_CREDENTIALS_FILE", "").strip()
|
||||
if not prop or not key_file:
|
||||
raise ValueError("GSC_CONFIG_MISSING")
|
||||
parsed = urlsplit(prop)
|
||||
domain_property = prop.startswith("sc-domain:") and bool(prop.removeprefix("sc-domain:"))
|
||||
root_property = (parsed.scheme == "https" and parsed.hostname and parsed.path == "/"
|
||||
and not parsed.query and not parsed.fragment and not parsed.username)
|
||||
if not domain_property and not root_property:
|
||||
raise ValueError("GSC_PROPERTY_INVALID")
|
||||
days = int(os.environ.get("GSC_ALERT_DAYS", "7"))
|
||||
if days < 1:
|
||||
raise ValueError("GSC_ALERT_DAYS_INVALID")
|
||||
return SearchConsoleSettings(prop, key_file, os.environ.get("GSC_ALERT_WEBHOOK_URL", ""), days)
|
||||
|
||||
|
||||
def belongs_to_property(page_url: str, property_url: str) -> bool:
|
||||
parsed = urlsplit(page_url)
|
||||
if parsed.scheme != "https" or not parsed.hostname or parsed.username or parsed.password:
|
||||
return False
|
||||
if parsed.query or parsed.fragment:
|
||||
return False
|
||||
if property_url.startswith("sc-domain:"):
|
||||
domain = property_url.removeprefix("sc-domain:").lower()
|
||||
return bool(domain) and (parsed.hostname == domain or parsed.hostname.endswith("." + domain))
|
||||
return page_url.startswith(property_url)
|
||||
@@ -140,7 +140,7 @@ _DEFAULT_THEME = {
|
||||
# 수집이 다 됐어도 그 섹션이 아예 안 나온다 — 저장값이 없는 사업장에는 이 표가 곧 발행본이다.
|
||||
# ★ "이용 규정"은 뺐다 (2026-09-09) — 발행본에 그 섹션이 없다. 체크인·취소·취사·
|
||||
# 반려동물 줄은 기본 정보 안에서 규정 덩이로 묶여 나간다(EssentialInfoSection).
|
||||
# ★ 가요·일력·인물·연표·엽서는 여기 넣지 않는다. 이 표의 항목은 전부 켜서 나가는데
|
||||
# ★ 가요·일력·인물·연표·읽기·엽서는 여기 넣지 않는다. 이 표의 항목은 전부 켜서 나가는데
|
||||
# (`_sections`), 그것들은 '지역 이야기'(story) 탭 **안에서** 그려지는 것이라
|
||||
# 켜면 탭 밖에 한 번 더 선다. story 하나만 두면 데이터가 있는 것만 탭이 된다.
|
||||
# ★ 퀴즈(quiz)도 넣지 않지만 사정이 다르다 — 탭이 아니라 **독립 섹션**이라
|
||||
|
||||
@@ -128,12 +128,21 @@ async def run_song(job: dict) -> dict:
|
||||
|
||||
발행 경로는 이 잡을 거치지 않고 `ensure_song` 을 직접 부른다(build_service)."""
|
||||
payload = job["payload"]
|
||||
return await ensure_song(payload["place_id"], payload["owner_user_id"])
|
||||
# ★ 이 잡은 "다시 만들어 달라" 는 요청이다 — 기존 곡이 있어도 만든다(ensure_song 주석).
|
||||
return await ensure_song(payload["place_id"], payload["owner_user_id"], force=True)
|
||||
|
||||
|
||||
async def ensure_song(place_id: str, owner_user_id: str) -> dict:
|
||||
async def ensure_song(place_id: str, owner_user_id: str, *, force: bool = False) -> dict:
|
||||
"""이 업장의 노래를 한 곡 만든다. 돌려주는 dict 가 곧 잡 결과이자 빌드 로그다.
|
||||
|
||||
★ **이미 완성된 곡이 있으면 만들지 않는다**(2026-09-15 대표: "재발행할 때 노래 다시
|
||||
생성하면 안 되거든"). 예전에는 `build_service` 가 `publish=True` 마다 이 함수를 불렀고
|
||||
여기에 가드가 없어서, 내용이 하나도 안 바뀐 재발행에도 **Gemini 가사 1회 + Suno 작곡
|
||||
1회**가 그대로 나갔다. 사장님이 발행을 다섯 번 누르면 유료 호출 다섯 번에
|
||||
`place_songs` 행이 다섯 개다. 화면은 최신 READY 한 곡만 쓰므로(`SongCRUD.latest_ready`)
|
||||
나머지는 값을 만들지 않고 돈만 쓴다.
|
||||
★ 곡을 **일부러 다시 만드는 길은 남긴다** — `force=True`. 그 길은 발행이 아니라
|
||||
SONG 잡(`run_song`)이고, 사람이 눌러야 돈다.
|
||||
★ 실패를 예외로 올리지 않는다(사업장을 못 찾는 것 같은 진짜 고장만 예외다).
|
||||
발행이 이 함수를 기다리는데 여기서 예외가 나면 **노래 때문에 발행이 통째로 실패**한다.
|
||||
음악 API 가 느린 날 사장님 사이트가 안 나가는 것은 맞바꿀 수 없는 손해다."""
|
||||
@@ -142,6 +151,17 @@ async def ensure_song(place_id: str, owner_user_id: str) -> dict:
|
||||
LOG.i(f"[song] place={place_id} 건너뜀 — SUNO_API_KEY 미설정")
|
||||
return {"place_id": place_id, "skipped": "SUNO_API_KEY 미설정"}
|
||||
|
||||
if not force:
|
||||
err, ready = await DB_SESSION_MNG.execute_lambda(
|
||||
place_songs.DBType(),
|
||||
DBWRType.DB_READ.value,
|
||||
lambda s: _song_crud.latest_ready(s, uuid.UUID(place_id)),
|
||||
)
|
||||
# `execute()` 는 리스트를 준다(limit 1 이라 0개 아니면 1개다) — None 비교로 보지 않는다.
|
||||
if err == ErrorType.SUCCESS and ready:
|
||||
LOG.i(f"[song] place={place_id} 건너뜀 — 이미 곡이 있다(재발행은 다시 만들지 않는다)")
|
||||
return {"place_id": place_id, "skipped": "이미 곡이 있다"}
|
||||
|
||||
err, place = await DB_SESSION_MNG.execute_lambda(
|
||||
places.DBType(),
|
||||
DBWRType.DB_READ.value,
|
||||
|
||||
@@ -74,7 +74,7 @@ async def _generate_kind(client: httpx.AsyncClient, kind: str, region_label: str
|
||||
LOG.w(f"[story] {kind} 호출 실패 region={region_label}: {ex}")
|
||||
return [], [f"호출 실패: {ex}"]
|
||||
|
||||
items, dropped = grounding.parse_items(payload, kind, prompts.max_items(kind))
|
||||
items, dropped = grounding.parse_items(payload, kind, prompts.max_items(kind), region_label)
|
||||
items = await _attach_images(kind, items, region_label)
|
||||
LOG.i(f"[story] {region_label} {kind}: {len(items)}건 채택, {len(dropped)}건 버림")
|
||||
return items, dropped
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import httpx
|
||||
from services import search_console_alerts as alerts
|
||||
|
||||
|
||||
async def test_teams_payload_has_required_attachment_fields(monkeypatch):
|
||||
requests = []
|
||||
real_client = httpx.AsyncClient
|
||||
|
||||
def receive(request):
|
||||
import json
|
||||
requests.append(json.loads(request.content))
|
||||
return httpx.Response(202)
|
||||
|
||||
monkeypatch.setattr(alerts.httpx, "AsyncClient", lambda **kw: real_client(
|
||||
transport=httpx.MockTransport(receive), **kw,
|
||||
))
|
||||
assert await alerts.send_alert("https://example.test/webhook", "https://example.test/s/a", "test")
|
||||
card = requests[0]["attachments"][0]
|
||||
assert card["contentType"] == "application/vnd.microsoft.card.adaptive"
|
||||
assert "contentUrl" in card and card["contentUrl"] is None
|
||||
assert card["content"]["$schema"] == "http://adaptivecards.io/schemas/adaptive-card.json"
|
||||
@@ -0,0 +1,342 @@
|
||||
"""Search Console 클라이언트 — 사이트맵 제출 · URL 검사.
|
||||
|
||||
★ 실제 Google API 를 호출하지 않는다(httpx.MockTransport). google-auth 도 이
|
||||
저장소의 의존성이 아니라서(Codex 가 추가) 인증은 모듈 함수
|
||||
`_service_account_credentials` / `_refresh_sync` 를 monkeypatch 해서 흉내 낸다 —
|
||||
설치 여부와 무관하게 이 테스트가 돌아야 한다.
|
||||
|
||||
여기서 고정하는 것:
|
||||
1. `inspect_url` 은 `inspectionResult.indexStatusResult` 만 돌려준다
|
||||
2. ★ 그 필드가 없는 응답을 "미색인"으로 짐작하지 않고 예외를 올린다
|
||||
3. 오류는 전부 `SearchConsoleError(code)` 로 정규화되고, 원본 예외 메시지·응답
|
||||
본문이 `code` 에 섞여 나오지 않는다
|
||||
4. 사이트맵 제출 URL 은 property/sitemap 주소를 완전 percent-encode 한다
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from services import search_console_client as scc
|
||||
from services.search_console_client import SearchConsoleClient, SearchConsoleError
|
||||
|
||||
PROPERTY = "https://example.com/"
|
||||
SITEMAP = "https://example.com/sitemap.xml"
|
||||
PAGE = "https://example.com/s/butter/"
|
||||
|
||||
|
||||
def _auth(monkeypatch, *, token="test-token", load_error=None, refresh_error=None):
|
||||
"""`_service_account_credentials`/`_refresh_sync` 를 흉내내 google-auth 없이 인증을 통과시킨다."""
|
||||
state = {"loads": 0, "refreshes": 0}
|
||||
|
||||
class _FakeCredentials:
|
||||
def __init__(self):
|
||||
self.token = None
|
||||
self.valid = False
|
||||
|
||||
def fake_load(path):
|
||||
state["loads"] += 1
|
||||
if load_error is not None:
|
||||
raise load_error
|
||||
return _FakeCredentials()
|
||||
|
||||
def fake_refresh(creds):
|
||||
state["refreshes"] += 1
|
||||
if refresh_error is not None:
|
||||
raise refresh_error
|
||||
creds.token = token
|
||||
creds.valid = bool(token)
|
||||
|
||||
monkeypatch.setattr(scc, "_service_account_credentials", fake_load)
|
||||
monkeypatch.setattr(scc, "_refresh_sync", fake_refresh)
|
||||
return state
|
||||
|
||||
|
||||
def _client(handler, monkeypatch, **auth_kwargs) -> SearchConsoleClient:
|
||||
_auth(monkeypatch, **auth_kwargs)
|
||||
return SearchConsoleClient("dummy-credentials.json", transport=httpx.MockTransport(handler))
|
||||
|
||||
|
||||
# ── 1) 사이트맵 제출 ──────────────────────────────────────────────────────
|
||||
async def test_사이트맵_제출은_URL을_완전_퍼센트인코딩한다(monkeypatch):
|
||||
"""검증: property/sitemap 주소를 PUT 경로에 싣는다.
|
||||
기대결과: 두 주소 모두 `/` `:` 까지 percent-encode 되어 경로 세그먼트 하나로 들어간다."""
|
||||
captured = {}
|
||||
|
||||
def handler(request: httpx.Request) -> httpx.Response:
|
||||
captured["method"] = request.method
|
||||
captured["url"] = str(request.url)
|
||||
captured["auth"] = request.headers.get("Authorization")
|
||||
return httpx.Response(200)
|
||||
|
||||
client = _client(handler, monkeypatch, token="tok-abc")
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert captured["method"] == "PUT"
|
||||
assert captured["url"] == (
|
||||
f"{scc.SITEMAPS_BASE}/https%3A%2F%2Fexample.com%2F"
|
||||
"/sitemaps/https%3A%2F%2Fexample.com%2Fsitemap.xml"
|
||||
)
|
||||
assert captured["auth"] == "Bearer tok-abc"
|
||||
|
||||
|
||||
async def test_사이트맵_제출_성공은_아무것도_돌려주지_않는다(monkeypatch):
|
||||
"""검증: 2xx 응답(빈 본문).
|
||||
기대결과: 예외 없이 끝난다 — 반환값은 None."""
|
||||
def handler(request):
|
||||
return httpx.Response(200)
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
async with client:
|
||||
assert await client.submit_sitemap(PROPERTY, SITEMAP) is None
|
||||
|
||||
|
||||
# ── 2) URL 검사 ───────────────────────────────────────────────────────────
|
||||
async def test_URL_검사는_indexStatusResult만_돌려준다(monkeypatch):
|
||||
"""검증: 응답에 indexStatusResult 외에 mobileUsabilityResult 등 다른 필드도 있다.
|
||||
기대결과: indexStatusResult 만 뽑아 돌려준다."""
|
||||
def handler(request: httpx.Request) -> httpx.Response:
|
||||
assert request.method == "POST"
|
||||
assert scc.INSPECT_URL in str(request.url)
|
||||
return httpx.Response(200, json={
|
||||
"inspectionResult": {
|
||||
"indexStatusResult": {"verdict": "PASS", "coverageState": "Submitted and indexed"},
|
||||
"mobileUsabilityResult": {"verdict": "PASS"},
|
||||
}
|
||||
})
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
async with client:
|
||||
result = await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert result == {"verdict": "PASS", "coverageState": "Submitted and indexed"}
|
||||
|
||||
|
||||
async def test_URL_검사_요청_본문은_inspectionUrl과_siteUrl이다(monkeypatch):
|
||||
"""검증: 검사 요청 본문.
|
||||
기대결과: {"inspectionUrl": 검사할 페이지, "siteUrl": 프로퍼티} 그대로."""
|
||||
captured = {}
|
||||
|
||||
def handler(request: httpx.Request) -> httpx.Response:
|
||||
captured["body"] = request.content
|
||||
return httpx.Response(200, json={"inspectionResult": {"indexStatusResult": {"verdict": "PASS"}}})
|
||||
|
||||
import json as _json
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert _json.loads(captured["body"]) == {"inspectionUrl": PAGE, "siteUrl": PROPERTY}
|
||||
|
||||
|
||||
async def test_inspectionResult가_없으면_미색인으로_넘겨짚지_않는다(monkeypatch):
|
||||
"""검증: ★ 응답 본문이 비어 있다({}).
|
||||
기대결과: SearchConsoleError("missing_inspection_result") — 빈 dict 를 돌려주지 않는다.
|
||||
(호출측이 빈 dict 를 "미색인"으로 오판할 수 있으므로 여기서 예외로 끊는다.)"""
|
||||
def handler(request):
|
||||
return httpx.Response(200, json={})
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "missing_inspection_result"
|
||||
|
||||
|
||||
async def test_indexStatusResult가_없으면_예외(monkeypatch):
|
||||
"""검증: inspectionResult 는 있는데 indexStatusResult 가 없다(다른 결과만 있음).
|
||||
기대결과: SearchConsoleError("missing_index_status_result")."""
|
||||
def handler(request):
|
||||
return httpx.Response(200, json={"inspectionResult": {"mobileUsabilityResult": {}}})
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "missing_index_status_result"
|
||||
|
||||
|
||||
async def test_indexStatusResult가_빈_객체면_예외(monkeypatch):
|
||||
"""검증: indexStatusResult 는 있지만 빈 dict({}) — 실제 검사가 안 된 응답이다.
|
||||
기대결과: SearchConsoleError("missing_index_status_result") — 빈 결과를 색인 상태로 돌려주지 않는다."""
|
||||
def handler(request):
|
||||
return httpx.Response(200, json={"inspectionResult": {"indexStatusResult": {}}})
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "missing_index_status_result"
|
||||
|
||||
|
||||
async def test_비정상_JSON_본문은_invalid_json(monkeypatch):
|
||||
"""검증: 200 인데 본문이 JSON 이 아니다.
|
||||
기대결과: SearchConsoleError("invalid_json") — 파싱 실패가 조용히 넘어가지 않는다."""
|
||||
def handler(request):
|
||||
return httpx.Response(200, text="<html>not json</html>")
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "invalid_json"
|
||||
|
||||
|
||||
# ── 3) HTTP 상태 코드 정규화 ─────────────────────────────────────────────
|
||||
@pytest.mark.parametrize(
|
||||
("status", "code"),
|
||||
[(401, "unauthorized"), (403, "forbidden"), (429, "rate_limited"), (500, "server_error"), (503, "server_error")],
|
||||
)
|
||||
async def test_HTTP_오류_상태코드는_code로_정규화된다(monkeypatch, status, code):
|
||||
"""검증: 401/403/429/5xx 응답.
|
||||
기대결과: SearchConsoleError.code 가 상태별로 정규화되고, Google 응답 본문은 code 에 섞이지 않는다."""
|
||||
def handler(request):
|
||||
return httpx.Response(status, text="google 응답 본문(비밀은 아니지만 새면 안 된다)")
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert exc.value.code == code
|
||||
assert "google 응답 본문" not in str(exc.value)
|
||||
|
||||
|
||||
# ── 4) 전송 오류 ─────────────────────────────────────────────────────────
|
||||
async def test_타임아웃은_timeout으로_정규화(monkeypatch):
|
||||
"""검증: 요청이 타임아웃된다.
|
||||
기대결과: SearchConsoleError("timeout")."""
|
||||
def handler(request):
|
||||
raise httpx.ReadTimeout("timed out", request=request)
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "timeout"
|
||||
|
||||
|
||||
async def test_연결_실패는_transport_error로_정규화(monkeypatch):
|
||||
"""검증: 연결 자체가 끊긴다(DNS 실패 등).
|
||||
기대결과: SearchConsoleError("transport_error")."""
|
||||
def handler(request):
|
||||
raise httpx.ConnectError("연결 실패", request=request)
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert exc.value.code == "transport_error"
|
||||
|
||||
|
||||
# ── 5) 인증 실패 ─────────────────────────────────────────────────────────
|
||||
async def test_키파일_로딩_실패는_invalid_credentials_file(monkeypatch):
|
||||
"""검증: 서비스 계정 키 파일을 못 읽는다(없음·손상).
|
||||
기대결과: SearchConsoleError("invalid_credentials_file") — 원본 예외 메시지는 안 실린다."""
|
||||
def handler(request):
|
||||
raise AssertionError("인증에 실패했으면 네트워크를 타면 안 된다")
|
||||
|
||||
client = _client(handler, monkeypatch, load_error=ValueError("키 파일 내용: super-secret-key-material"))
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert exc.value.code == "invalid_credentials_file"
|
||||
assert "super-secret-key-material" not in str(exc.value)
|
||||
|
||||
|
||||
async def test_토큰_갱신_실패는_auth_failed(monkeypatch):
|
||||
"""검증: 키 파일은 읽었지만 Google 토큰 발급이 거부된다(폐기된 키 등).
|
||||
기대결과: SearchConsoleError("auth_failed") — 원본 예외 메시지는 안 실린다."""
|
||||
def handler(request):
|
||||
raise AssertionError("인증에 실패했으면 네트워크를 타면 안 된다")
|
||||
|
||||
client = _client(handler, monkeypatch, refresh_error=RuntimeError("invalid_grant: token revoked=xyz"))
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.inspect_url(PROPERTY, PAGE)
|
||||
|
||||
assert exc.value.code == "auth_failed"
|
||||
assert "revoked=xyz" not in str(exc.value)
|
||||
|
||||
|
||||
async def test_토큰이_비면_auth_failed(monkeypatch):
|
||||
"""검증: 갱신은 예외 없이 끝났지만 credentials.token 이 비어 있다.
|
||||
기대결과: SearchConsoleError("auth_failed") — 빈 토큰으로 요청을 보내지 않는다."""
|
||||
def handler(request):
|
||||
raise AssertionError("빈 토큰으로 네트워크를 타면 안 된다")
|
||||
|
||||
client = _client(handler, monkeypatch, token="")
|
||||
with pytest.raises(SearchConsoleError) as exc:
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert exc.value.code == "auth_failed"
|
||||
|
||||
|
||||
async def test_인증정보_로딩과_유효한_토큰_갱신은_한_번만_한다(monkeypatch):
|
||||
"""검증: 같은 클라이언트로 두 번 호출한다.
|
||||
기대결과: 키 파일 로딩 1회 · 토큰 갱신 1회 — 두 번째 호출은 여전히 유효한(`credentials.valid`)
|
||||
토큰을 그대로 재사용한다."""
|
||||
def handler(request):
|
||||
return httpx.Response(200)
|
||||
|
||||
state = _auth(monkeypatch)
|
||||
client = SearchConsoleClient("dummy-credentials.json", transport=httpx.MockTransport(handler))
|
||||
async with client:
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
await client.submit_sitemap(PROPERTY, SITEMAP)
|
||||
|
||||
assert state["loads"] == 1
|
||||
assert state["refreshes"] == 1
|
||||
|
||||
|
||||
async def test_동시_호출은_토큰_갱신을_한_번만_한다(monkeypatch):
|
||||
"""검증: 아직 토큰이 없는 클라이언트를 두 요청이 동시에 부른다.
|
||||
기대결과: 갱신 1회 — 잠금 없이 두 번째 요청이 갱신 중인 자격을 다시 갱신하면
|
||||
Google 토큰 엔드포인트를 요청 수만큼 때리게 된다."""
|
||||
import time as _time
|
||||
|
||||
def handler(request):
|
||||
return httpx.Response(200)
|
||||
|
||||
state = _auth(monkeypatch)
|
||||
|
||||
def slow_refresh(creds):
|
||||
_time.sleep(0.05)
|
||||
state["refreshes"] += 1
|
||||
creds.token = "tok"
|
||||
creds.valid = True
|
||||
|
||||
monkeypatch.setattr(scc, "_refresh_sync", slow_refresh)
|
||||
|
||||
client = SearchConsoleClient("dummy-credentials.json", transport=httpx.MockTransport(handler))
|
||||
async with client:
|
||||
await asyncio.gather(
|
||||
client.submit_sitemap(PROPERTY, SITEMAP),
|
||||
client.submit_sitemap(PROPERTY, SITEMAP),
|
||||
)
|
||||
|
||||
assert state["refreshes"] == 1
|
||||
|
||||
|
||||
# ── 6) 닫기 ──────────────────────────────────────────────────────────────
|
||||
async def test_async_컨텍스트매니저는_내부_httpx_클라이언트를_닫는다(monkeypatch):
|
||||
"""검증: `async with` 블록을 빠져나간다.
|
||||
기대결과: 내부 httpx.AsyncClient 가 닫힌다 — 커넥션을 남겨두지 않는다."""
|
||||
def handler(request):
|
||||
return httpx.Response(200)
|
||||
|
||||
client = _client(handler, monkeypatch)
|
||||
async with client:
|
||||
pass
|
||||
|
||||
assert client._client.is_closed is True
|
||||
@@ -0,0 +1,273 @@
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import places, sites, site_versions, site_search_status
|
||||
from crud import search_console_crud as store
|
||||
from services import search_console_service as service
|
||||
from services.search_console_client import SearchConsoleError
|
||||
from services.search_console_alerts import alert_reason, send_alert
|
||||
from services.search_console_settings import SearchConsoleSettings, belongs_to_property, load_settings
|
||||
|
||||
NOW = datetime.now(timezone.utc)
|
||||
SETTINGS = SearchConsoleSettings("https://example.com/", "/test/key.json")
|
||||
|
||||
|
||||
def status(**changes):
|
||||
return SimpleNamespace(site_id=uuid.uuid4(), page_url="https://example.com/s/stay",
|
||||
property_url=SETTINGS.property_url, published_at=NOW - timedelta(days=8),
|
||||
sitemap_submitted_at=None, inspected_at=None, inspection=None,
|
||||
first_indexed_at=None, error_code=None, failures=0, alerted_at=None,
|
||||
next_check_at=NOW, **changes)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("url,prop,expected", [
|
||||
("https://example.com/s/a", "https://example.com/", True),
|
||||
("https://example.com.evil.test/s/a", "https://example.com/", False),
|
||||
("https://sub.example.com/s/a", "sc-domain:example.com", True),
|
||||
("https://notexample.com/s/a", "sc-domain:example.com", False),
|
||||
("http://example.com/s/a", "sc-domain:example.com", False),
|
||||
("https://example.com/s/a?secret=x", "sc-domain:example.com", False),
|
||||
])
|
||||
def test_property_scope(url, prop, expected):
|
||||
assert belongs_to_property(url, prop) is expected
|
||||
|
||||
|
||||
def test_disabled_needs_no_credentials(monkeypatch):
|
||||
monkeypatch.delenv("GSC_ENABLED", raising=False)
|
||||
assert load_settings() is None
|
||||
monkeypatch.setenv("GSC_ENABLED", "1")
|
||||
monkeypatch.delenv("GSC_PROPERTY_URL", raising=False)
|
||||
with pytest.raises(ValueError):
|
||||
load_settings()
|
||||
|
||||
|
||||
async def test_submit_and_inspect_are_separate(monkeypatch):
|
||||
row = status()
|
||||
client = SimpleNamespace(submit_sitemap=AsyncMock(), inspect_url=AsyncMock(return_value={"verdict": "NEUTRAL"}))
|
||||
monkeypatch.setattr(service, "read_sitemap", AsyncMock(return_value={row.page_url}))
|
||||
monkeypatch.setattr(service.site_payload, "publish_origin", lambda: "https://example.com")
|
||||
await service.check_site(client, row, SETTINGS, set())
|
||||
assert row.sitemap_submitted_at
|
||||
assert row.inspected_at
|
||||
assert row.first_indexed_at is None
|
||||
assert row.next_check_at > NOW
|
||||
assert row.error_code is None
|
||||
|
||||
|
||||
async def test_missing_sitemap_url_retries_without_google_call(monkeypatch):
|
||||
row = status()
|
||||
client = SimpleNamespace(submit_sitemap=AsyncMock(), inspect_url=AsyncMock())
|
||||
monkeypatch.setattr(service, "read_sitemap", AsyncMock(return_value=set()))
|
||||
await service.check_site(client, row, SETTINGS, set())
|
||||
assert row.error_code == "URL_NOT_IN_SITEMAP"
|
||||
assert row.sitemap_submitted_at is None
|
||||
assert row.failures == 1
|
||||
client.submit_sitemap.assert_not_awaited()
|
||||
client.inspect_url.assert_not_awaited()
|
||||
|
||||
|
||||
async def test_one_sitemap_submission_per_batch(monkeypatch):
|
||||
client = SimpleNamespace(submit_sitemap=AsyncMock())
|
||||
monkeypatch.setattr(service, "read_sitemap", AsyncMock(return_value={status().page_url}))
|
||||
seen = set()
|
||||
await service.submit_sitemap(client, status(), seen)
|
||||
await service.submit_sitemap(client, status(), seen)
|
||||
client.submit_sitemap.assert_awaited_once()
|
||||
|
||||
|
||||
async def test_inspection_failure_preserves_previous_observation():
|
||||
row = status()
|
||||
row.sitemap_submitted_at = NOW
|
||||
row.inspection = {"verdict": "PASS"}
|
||||
row.inspected_at = NOW - timedelta(days=1)
|
||||
client = SimpleNamespace(inspect_url=AsyncMock(side_effect=SearchConsoleError("HTTP_429")))
|
||||
await service.check_site(client, row, SETTINGS, set())
|
||||
assert row.inspection == {"verdict": "PASS"}
|
||||
assert row.inspected_at < NOW
|
||||
assert row.error_code == "HTTP_429"
|
||||
assert row.failures == 1
|
||||
|
||||
|
||||
def test_first_indexed_is_observation_time_not_google_crawl_time():
|
||||
row = status()
|
||||
service.record_inspection(row, {"verdict": "PASS", "lastCrawlTime": "2020-01-01T00:00:00Z"}, NOW)
|
||||
service.record_inspection(row, {"verdict": "PASS"}, NOW + timedelta(days=1))
|
||||
assert row.first_indexed_at == NOW
|
||||
|
||||
|
||||
def test_alert_cooldown_and_backoff():
|
||||
row = status()
|
||||
assert alert_reason(row, NOW, 7)
|
||||
row.alerted_at = NOW
|
||||
assert alert_reason(row, NOW, 7) is None
|
||||
for _ in range(30):
|
||||
service.record_error(row, "HTTP_503", NOW)
|
||||
assert row.next_check_at == NOW + timedelta(days=1)
|
||||
|
||||
|
||||
async def test_failed_alert_does_not_mark_delivered(monkeypatch):
|
||||
row = status()
|
||||
row.sitemap_submitted_at = NOW
|
||||
client = SimpleNamespace(inspect_url=AsyncMock(return_value={"verdict": "NEUTRAL"}))
|
||||
send = AsyncMock(return_value=False)
|
||||
monkeypatch.setattr(service, "send_alert", send)
|
||||
await service.check_site(client, row, SETTINGS, set())
|
||||
send.assert_awaited_once()
|
||||
assert row.alerted_at is None
|
||||
|
||||
|
||||
async def test_empty_alert_url_never_calls_network():
|
||||
assert not await send_alert("", "https://example.com/s/a", "delayed")
|
||||
|
||||
|
||||
async def test_disabled_cron_never_opens_database(monkeypatch):
|
||||
monkeypatch.delenv("GSC_ENABLED", raising=False)
|
||||
call = AsyncMock()
|
||||
monkeypatch.setattr(service.DB_SESSION_MNG, "execute_lambda_write", call)
|
||||
await service.run_scheduled_check()
|
||||
call.assert_not_awaited()
|
||||
|
||||
|
||||
async def seed_site(session, *, state=3):
|
||||
place = places(place_id=uuid.uuid4(), owner_user_id=uuid.uuid4(), name="숙소", category=1)
|
||||
site = sites(site_id=uuid.uuid4(), place_id=place.place_id, status=state,
|
||||
domain="stay", published_at=NOW)
|
||||
version = site_versions(site_version_id=uuid.uuid4(), site_id=site.site_id, version=1, build_status=2)
|
||||
site.current_version_id = version.site_version_id
|
||||
session.add_all([place, site, version])
|
||||
await session.flush()
|
||||
return site, place, version
|
||||
|
||||
|
||||
async def test_registration_survives_restart_and_resets_on_publish(db_engine, monkeypatch):
|
||||
monkeypatch.setattr(service.site_payload, "publish_origin", lambda: "https://example.com")
|
||||
async with AsyncSession(db_engine, expire_on_commit=False) as session:
|
||||
site, _, _ = await seed_site(session)
|
||||
await service.register_publications(session, SETTINGS)
|
||||
await session.commit()
|
||||
row = await session.get(site_search_status, site.site_id)
|
||||
row.sitemap_submitted_at = NOW
|
||||
row.first_indexed_at = NOW
|
||||
await session.commit()
|
||||
await service.register_publications(session, SETTINGS)
|
||||
assert row.first_indexed_at == NOW
|
||||
site.published_at = NOW + timedelta(seconds=1)
|
||||
await session.commit()
|
||||
await service.register_publications(session, SETTINGS)
|
||||
await session.commit()
|
||||
await session.refresh(row)
|
||||
assert row.first_indexed_at is None
|
||||
assert row.sitemap_submitted_at is None
|
||||
|
||||
|
||||
async def test_unpublished_and_deleted_places_are_not_checked(db_engine, monkeypatch):
|
||||
monkeypatch.setattr(service.site_payload, "publish_origin", lambda: "https://example.com")
|
||||
async with AsyncSession(db_engine) as session:
|
||||
site, place, _ = await seed_site(session)
|
||||
await service.register_publications(session, SETTINGS)
|
||||
assert len(await store.due_sites(session, SETTINGS.property_url)) == 1
|
||||
site.status = 5
|
||||
await session.flush()
|
||||
assert not await store.due_sites(session, SETTINGS.property_url)
|
||||
site.status = 3
|
||||
place.deleted = True
|
||||
await session.flush()
|
||||
assert not await store.due_sites(session, SETTINGS.property_url)
|
||||
|
||||
|
||||
async def test_batch_lock_excludes_second_process(db_engine):
|
||||
async with AsyncSession(db_engine) as first, AsyncSession(db_engine) as second:
|
||||
assert await store.lock_batch(first)
|
||||
assert not await store.lock_batch(second)
|
||||
await first.rollback()
|
||||
assert await store.lock_batch(second)
|
||||
|
||||
|
||||
async def test_full_batch_commits_and_does_not_repeat_same_day(db_engine, monkeypatch):
|
||||
monkeypatch.setattr(service.site_payload, "publish_origin", lambda: "https://example.com")
|
||||
monkeypatch.setattr(service, "read_sitemap", AsyncMock(return_value={status().page_url}))
|
||||
client = SimpleNamespace(submit_sitemap=AsyncMock(), inspect_url=AsyncMock(return_value={"verdict": "PASS"}))
|
||||
|
||||
class FakeClient:
|
||||
def __init__(self, *_):
|
||||
pass
|
||||
|
||||
async def __aenter__(self):
|
||||
return client
|
||||
|
||||
async def __aexit__(self, *_):
|
||||
pass
|
||||
|
||||
monkeypatch.setattr(service, "SearchConsoleClient", FakeClient)
|
||||
async with AsyncSession(db_engine) as session:
|
||||
site, _, _ = await seed_site(session)
|
||||
sid = site.site_id
|
||||
await session.commit()
|
||||
await service.run_batch(session, SETTINGS)
|
||||
await session.commit()
|
||||
async with AsyncSession(db_engine) as session:
|
||||
row = await session.get(site_search_status, sid)
|
||||
assert row.sitemap_submitted_at
|
||||
assert row.first_indexed_at
|
||||
await service.run_batch(session, SETTINGS)
|
||||
await session.commit()
|
||||
client.submit_sitemap.assert_awaited_once()
|
||||
client.inspect_url.assert_awaited_once()
|
||||
|
||||
|
||||
async def test_cron_failure_is_isolated(monkeypatch):
|
||||
monkeypatch.setattr(service, "load_settings", lambda: SETTINGS)
|
||||
monkeypatch.setattr(service.DB_SESSION_MNG, "execute_lambda_write", AsyncMock(side_effect=RuntimeError("db")))
|
||||
await service.run_scheduled_check()
|
||||
|
||||
|
||||
async def test_sitemap_http_parser(monkeypatch):
|
||||
import httpx
|
||||
|
||||
real_client = httpx.AsyncClient
|
||||
transport = httpx.MockTransport(lambda request: httpx.Response(200, text='''
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url><loc>https://example.com/s/stay</loc></url></urlset>'''))
|
||||
monkeypatch.setattr(service.httpx, "AsyncClient", lambda **kw: real_client(transport=transport, **kw))
|
||||
assert await service.read_sitemap("https://example.com/sitemap.xml") == {status().page_url}
|
||||
|
||||
|
||||
async def test_sitemap_redirect_is_not_followed(monkeypatch):
|
||||
import httpx
|
||||
|
||||
real_client = httpx.AsyncClient
|
||||
transport = httpx.MockTransport(lambda request: httpx.Response(302, headers={"location": "http://internal/"}))
|
||||
monkeypatch.setattr(service.httpx, "AsyncClient", lambda **kw: real_client(transport=transport, **kw))
|
||||
with pytest.raises(SearchConsoleError, match="SITEMAP_UNAVAILABLE"):
|
||||
await service.read_sitemap("https://example.com/sitemap.xml")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("enabled,count", [("0", 0), ("1", 1)])
|
||||
def test_existing_scheduler_registers_optional_job(monkeypatch, enabled, count):
|
||||
import scheduler
|
||||
|
||||
instance = SimpleNamespace(add_job=lambda *a, **kw: jobs.append((a, kw)),
|
||||
start=lambda: None, get_jobs=lambda: jobs)
|
||||
jobs = []
|
||||
monkeypatch.setattr(scheduler, "_scheduler", None)
|
||||
monkeypatch.setattr(scheduler, "AsyncIOScheduler", lambda **kw: instance)
|
||||
monkeypatch.setenv("SCHEDULER_ENABLED", "1")
|
||||
monkeypatch.setenv("GSC_ENABLED", enabled)
|
||||
scheduler.start_scheduler()
|
||||
assert len(jobs) == count
|
||||
if jobs:
|
||||
assert jobs[0][1]["minutes"] == 10
|
||||
assert jobs[0][1]["max_instances"] == 1
|
||||
|
||||
|
||||
def test_migration_matches_fresh_database_schema():
|
||||
from pathlib import Path
|
||||
root = Path(__file__).resolve().parents[3]
|
||||
migration = (root / "postgres-init/migrations/0014_search_console.sql").read_text()
|
||||
ddl = migration[migration.index("CREATE TABLE"):].strip()
|
||||
assert ddl in (root / "postgres-init/init-data/init.sql").read_text()
|
||||
@@ -23,7 +23,7 @@ def _reply(content: str, search_results=None) -> dict:
|
||||
# ── 프롬프트 ────────────────────────────────────────────────────────────
|
||||
def test_프롬프트는_shared_산출물에서_온다():
|
||||
"""여섯 종이 모두 있고, 지역명이 빈칸 없이 박힌다."""
|
||||
assert set(prompts.kinds()) == {"songs", "daily", "people", "chronicle", "postcard", "quiz"}
|
||||
assert set(prompts.kinds()) == {"songs", "daily", "people", "chronicle", "reading", "postcard", "quiz"}
|
||||
text = prompts.build_prompt("songs", "전북 군산시")
|
||||
assert "[지역] 전북 군산시" in text
|
||||
assert "[지역]을 노래한 대중가요" in text # task 원문
|
||||
|
||||
@@ -141,51 +141,12 @@ export function CanvasView() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<footer
|
||||
className="border-t border-black/10 p-6 text-center text-xs"
|
||||
style={{backgroundColor: template.colors.bg, color: template.colors.secondary}}
|
||||
>
|
||||
<div className="mx-auto max-w-4xl space-y-2">
|
||||
<p className="font-bold" style={{color: template.colors.text}}>
|
||||
{storeName}
|
||||
</p>
|
||||
<p className="text-[11px]">
|
||||
{infoFields.find((f) => f.id === 'address')?.value || location}
|
||||
</p>
|
||||
<p className="pt-2 text-[10px] opacity-60">
|
||||
© {new Date().getFullYear()} {storeName}. Powered by Web4Ai.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{viewport === 'mobile' && (
|
||||
<nav
|
||||
aria-label="모바일 하단 내비게이션 미리보기"
|
||||
className="sticky inset-x-0 bottom-0 z-30 flex items-center justify-around border-t border-black/10 bg-white/95 px-2 py-1.5 backdrop-blur-md"
|
||||
>
|
||||
{MOBILE_TABS.map(({key, label, anchor, icon: Icon}) => (
|
||||
<button
|
||||
key={key}
|
||||
type="button"
|
||||
onClick={() => scrollToSection(anchor, key)}
|
||||
className={cn(
|
||||
'flex cursor-pointer flex-col items-center justify-center rounded-lg px-2 py-1 transition-all',
|
||||
activeMobileTab === key ? 'font-bold text-zinc-950' : 'text-zinc-500',
|
||||
)}
|
||||
>
|
||||
<Icon className="size-4" />
|
||||
<span className="mt-0.5 text-[10px]">{label}</span>
|
||||
</button>
|
||||
))}
|
||||
<span
|
||||
className="flex items-center gap-1 rounded-lg px-3 py-1.5 text-[11px] font-bold text-white"
|
||||
style={{backgroundColor: template.colors.primary}}
|
||||
>
|
||||
<Calendar className="size-3.5" />
|
||||
<span>예약하기</span>
|
||||
</span>
|
||||
</nav>
|
||||
)}
|
||||
{/* ★ 푸터도 모바일 하단 탭바도 여기서 그리지 않는다
|
||||
(2026-09-15 대표: "에디터에서 이 부분 필요없음 / 이 부분 자체가 필요없음")
|
||||
발행본이 iframe 안에서 **둘 다 이미 그린다** — 푸터는 `site/sections/SiteFooter.tsx`,
|
||||
탭바는 `site/sections/MobileTabBar.tsx`(App 과 레이아웃 Shell 다섯이 모두 세운다).
|
||||
바깥에 한 벌 더 그리면 상호·주소·저작권·탭이 두 번 서고, 두 벌의 값이 어긋날 수도
|
||||
있다 — 이 캔버스가 "발행되는 그 화면"이어야 한다는 원칙(SitePreview 주석)에 어긋난다. */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -343,6 +343,52 @@ export const SECTION_DATA_SPEC: Record<string, SectionDataSpec> = {
|
||||
],
|
||||
},
|
||||
|
||||
reading: {
|
||||
kind: 'reading',
|
||||
label: '지역 읽기',
|
||||
sample: JSON.stringify(
|
||||
{
|
||||
kind: 'reading',
|
||||
version: 1,
|
||||
title: '군산 읽기',
|
||||
subtitle: '문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지',
|
||||
items: [
|
||||
{
|
||||
group: '문학',
|
||||
title: '채만식 『탁류』',
|
||||
body:
|
||||
'일제강점기 군산을 무대로 한 장편소설입니다. 쌀을 사고팔던 미두장을 중심으로, ' +
|
||||
'가족을 지키려던 초봉이 시대의 소용돌이에 휩쓸려 무너지는 과정을 그렸습니다. ' +
|
||||
'금강 하구의 흙탕물이라는 제목처럼, 개항장 군산의 실제 지명과 풍경 위에 ' +
|
||||
'이야기가 펼쳐집니다.',
|
||||
year: 1937,
|
||||
},
|
||||
{
|
||||
group: '섬과 바다',
|
||||
title: '고군산군도',
|
||||
body:
|
||||
'예순 남짓한 섬이 모인 군도입니다. 새만금 방조제가 육지와 신시도를 잇고, ' +
|
||||
'그 뒤로 무녀도 · 선유도 · 장자도가 다리로 차례로 이어져 차로 들어갈 수 ' +
|
||||
'있습니다. 섬마다 성격이 달라 하루로는 다 못 봅니다.',
|
||||
},
|
||||
],
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
task: SECTION_PROMPTS.reading.task,
|
||||
rules: SECTION_PROMPTS.reading.rules,
|
||||
/* 출처 칸이 없다 — 이 종류의 출처는 서버가 제목으로 만든 검색 링크다
|
||||
(`backend/services/grounding/story.py` `_SEARCH_LINK_KINDS`). 손으로 적는 칸을 두면
|
||||
거기 적힌 주소가 그 규칙을 비껴간다. */
|
||||
fields: [
|
||||
{key: 'group', label: '갈래', half: true, hint: '문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활'},
|
||||
{key: 'year', label: '연도', type: 'number', half: true},
|
||||
{key: 'title', label: '꼭지 제목'},
|
||||
{key: 'body', label: '본문', type: 'area', hint: '서너 문장'},
|
||||
],
|
||||
},
|
||||
|
||||
postcard: {
|
||||
kind: 'postcard',
|
||||
label: '오늘의 엽서',
|
||||
|
||||
@@ -64,6 +64,7 @@ import {SongsTurntable} from './variants/songs/SongsTurntable';
|
||||
import {DailyCalendar} from './variants/daily/DailyCalendar';
|
||||
import {PeopleFilmstrip} from './variants/people/PeopleFilmstrip';
|
||||
import {ChronicleRail} from './variants/chronicle/ChronicleRail';
|
||||
import {ReadingRail} from './variants/reading/ReadingRail';
|
||||
import {PostcardStack} from './variants/postcard/PostcardStack';
|
||||
import {QuizFlip} from './variants/quiz/QuizFlip';
|
||||
|
||||
@@ -413,6 +414,17 @@ export const SECTION_VARIANTS: Record<string, SectionVariant[]> = {
|
||||
],
|
||||
|
||||
|
||||
reading: [
|
||||
{
|
||||
id: 'reading.posts',
|
||||
name: '읽기 카드',
|
||||
description: '한 슬라이드에 한 꼭지. 발행본은 이 중 5~6개만 매번 무작위로 세운다.',
|
||||
thumb: 'carousel',
|
||||
Component: ReadingRail,
|
||||
isDefault: true,
|
||||
},
|
||||
],
|
||||
|
||||
postcard: [
|
||||
{
|
||||
id: 'postcard.stack',
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* 지역 읽기 — 한 슬라이드에 한 꼭지.
|
||||
*
|
||||
* ★ 에디터는 **전부 보여준다.** 발행본은 이 중 5~6개만 매번 무작위로 세우지만
|
||||
* (`site/sections/items/ReadingSection.tsx`), 고칠 사람은 안 뽑힌 꼭지도 봐야 한다 —
|
||||
* 에디터에서 무작위로 가리면 방금 고친 글이 다음 렌더에 사라진다.
|
||||
* ★ 출처 줄이 없다. 이 종류의 출처는 제목으로 만든 검색 링크라 서버가 붙인다
|
||||
* (`backend/services/grounding/story.py` `_SEARCH_LINK_KINDS`) — 붙여넣기 단계에는 없다.
|
||||
*/
|
||||
import {Rail, SectionBody, SectionFrame} from '../../primitives';
|
||||
import type {SectionRenderProps} from '../../types';
|
||||
import {parseSectionData, type ReadingItem} from '@o2o/shared';
|
||||
import {
|
||||
ITEM_ACCENT,
|
||||
ITEM_BODY,
|
||||
ITEM_BORDER,
|
||||
ITEM_CARD,
|
||||
ITEM_HEADING,
|
||||
ParseError,
|
||||
PasteHint,
|
||||
} from '../items/common';
|
||||
import '../items/items.css';
|
||||
|
||||
function Post({item}: {item: ReadingItem}) {
|
||||
return (
|
||||
<article
|
||||
className="w-[300px] shrink-0 snap-center border p-4"
|
||||
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
|
||||
>
|
||||
{item.group && (
|
||||
<p
|
||||
className="text-[11px] font-bold tracking-[0.18em]"
|
||||
style={{color: ITEM_ACCENT, fontFamily: ITEM_BODY}}
|
||||
>
|
||||
{item.group}
|
||||
{item.year != null && <span className="font-normal opacity-70"> · {item.year}</span>}
|
||||
</p>
|
||||
)}
|
||||
<h3
|
||||
className="mt-2 border-b-2 pb-2 text-lg leading-snug"
|
||||
style={{fontFamily: ITEM_HEADING, borderColor: 'currentColor'}}
|
||||
>
|
||||
{item.title}
|
||||
</h3>
|
||||
<p
|
||||
className="mt-2.5 text-[13px] leading-[1.8] break-keep opacity-80"
|
||||
style={{fontFamily: ITEM_BODY}}
|
||||
>
|
||||
{item.body}
|
||||
</p>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
export function ReadingRail(props: SectionRenderProps) {
|
||||
const {section, isSelected, onSelect} = props;
|
||||
const parsed = parseSectionData<ReadingItem>(section.type, section.data);
|
||||
|
||||
return (
|
||||
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
|
||||
<SectionBody width="wide">
|
||||
<div className="space-y-1.5">
|
||||
<h2 className="text-2xl sm:text-3xl" style={{fontFamily: ITEM_HEADING}}>
|
||||
{parsed.title || section.name}
|
||||
</h2>
|
||||
{(parsed.subtitle || section.description) && (
|
||||
<p className="text-sm opacity-75" style={{fontFamily: ITEM_BODY}}>
|
||||
{parsed.subtitle || section.description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{parsed.error ? (
|
||||
<ParseError message={parsed.error} />
|
||||
) : parsed.items.length === 0 ? (
|
||||
<PasteHint label="지역 읽기" />
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
{/* 발행본과 에디터가 다르게 보이는 자리라, 몇 개가 나가는지 여기서 밝힌다. */}
|
||||
<p className="text-[11px] opacity-60">
|
||||
전체 {parsed.items.length}꼭지 · 발행본은 이 중 5~6개를 매번 무작위로 세웁니다
|
||||
</p>
|
||||
<Rail label="지역 읽기" gap={0}>
|
||||
{parsed.items.map((item, index) => (
|
||||
<Post key={`${item.title}-${index}`} item={item} />
|
||||
))}
|
||||
</Rail>
|
||||
</div>
|
||||
)}
|
||||
</SectionBody>
|
||||
</SectionFrame>
|
||||
);
|
||||
}
|
||||
@@ -125,6 +125,32 @@ export interface ChronicleItem {
|
||||
source?: DataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 지역 읽기 — 도시를 갈래로 묶어 한 꼭지씩 넘겨 보는 글.
|
||||
*
|
||||
* ★ 왜 일력(daily)과 따로 있나 (2026-09-14 대표 의견: "오늘의 한 장으로 군산을 소개하기는
|
||||
* 무리다, 하루에 하나씩밖에 안 알려 주니까")
|
||||
* 일력은 오늘·어제·내일 **세 장만** 화면에 선다. 도시를 소개하는 그릇으로는 작다.
|
||||
* 이쪽은 갈래(문학·섬과 바다·역사·장소·음식과 생활)로 묶은 더미에서 매번 몇 개만 뽑아 낸다.
|
||||
* ★ 이미 제 자리를 가진 것은 여기 넣지 않는다 — 인물·가요·축제·연표·명소·맛집.
|
||||
* 같은 이야기를 두 번 세우면 페이지만 길어진다(프롬프트 규칙으로도 막는다).
|
||||
*/
|
||||
export interface ReadingItem {
|
||||
/** 갈래 이름. 카드 위 이름표로만 쓴다 — 갈래별로 묶어 세우지 않는다(뽑기는 갈래를 안 가린다). */
|
||||
group?: string;
|
||||
title: string;
|
||||
/** 서너 문장. 두 문장짜리는 카드가 한 줄로 접혀 빈 카드처럼 보인다(2026-09-14 대표 지적). */
|
||||
body: string;
|
||||
/** 연도를 댈 수 있는 꼭지만. 없으면 이름표에 연도를 안 붙인다. */
|
||||
year?: number;
|
||||
verified?: DataVerified;
|
||||
/**
|
||||
* 출처. **모델이 적지 않는다** — 제목으로 찾아가는 검색 링크를 서버가 붙인다
|
||||
* (`services/grounding/story.py`). 개별 문서 주소를 짐작해 적으면 없는 문서로 이어진다.
|
||||
*/
|
||||
source?: DataSource;
|
||||
}
|
||||
|
||||
export interface LiteratureItem {
|
||||
workTitle: string;
|
||||
author?: string;
|
||||
@@ -288,6 +314,7 @@ export const SECTION_ITEM_REQUIRED_KEY: Record<string, string> = {
|
||||
schedule: 'name',
|
||||
people: 'name',
|
||||
chronicle: 'title',
|
||||
reading: 'title',
|
||||
literature: 'workTitle',
|
||||
postcard: 'line',
|
||||
quiz: 'question',
|
||||
|
||||
@@ -15,7 +15,14 @@
|
||||
*/
|
||||
|
||||
/** 아이템 종류. `area_contents.kind` · JSON 봉투의 `kind` 와 같은 값이다. */
|
||||
export type StoryKind = 'songs' | 'daily' | 'people' | 'chronicle' | 'postcard' | 'quiz';
|
||||
export type StoryKind =
|
||||
| 'songs'
|
||||
| 'daily'
|
||||
| 'people'
|
||||
| 'chronicle'
|
||||
| 'reading'
|
||||
| 'postcard'
|
||||
| 'quiz';
|
||||
|
||||
/**
|
||||
* 순서는 발행본 '지역 이야기' 탭 순서다(`site/sections/items/StorySection.tsx`).
|
||||
@@ -30,6 +37,7 @@ export const STORY_KINDS: StoryKind[] = [
|
||||
'daily',
|
||||
'people',
|
||||
'chronicle',
|
||||
'reading',
|
||||
'postcard',
|
||||
'quiz',
|
||||
];
|
||||
@@ -84,6 +92,9 @@ export const SECTION_PROMPTS: Record<StoryKind, SectionPromptSpec> = {
|
||||
[이 아이템만의 규칙]
|
||||
· lyrics 필드는 스키마에 없다. 어떤 이유로도 만들지 마라. 가사 한 소절도 안 된다.
|
||||
· labelColor 는 레코드 라벨 색이다. 곡의 분위기에 맞춰 진한 색 하나를 hex 로 고른다.
|
||||
**이건 사실이 아니라 디자인 값이다 — 공통 규칙 2 를 적용하지 말고 곡마다 반드시 채운다.**
|
||||
앞뒤 곡과 같은 색을 쓰지 않는다. 비워 두면 판이 전부 한 색으로 깔린다(실측 2026-09-15:
|
||||
67곡 중 63곡이 비어 있었다).
|
||||
· 작사·작곡·발표연도를 모르면 그 필드를 뺀다. "미상" 이라고 쓰지 않는다.
|
||||
`,
|
||||
},
|
||||
@@ -157,6 +168,36 @@ export const SECTION_PROMPTS: Record<StoryKind, SectionPromptSpec> = {
|
||||
`,
|
||||
},
|
||||
|
||||
reading: {
|
||||
kind: 'reading',
|
||||
label: '지역 읽기',
|
||||
maxItems: 34,
|
||||
task: `[해야 할 일]
|
||||
[지역]을 소개하는 글 30~34꼭지를 갈래로 나눠 쓴다.
|
||||
갈래는 다섯이다 — 문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활.
|
||||
한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.
|
||||
|
||||
[스키마]
|
||||
{ "kind":"reading", "version":1, "title":"[지역] 읽기",
|
||||
"subtitle":"문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지",
|
||||
"items":[
|
||||
{ "group":"문학|섬과 바다|역사|장소|음식과 생활",
|
||||
"title":"꼭지 제목", "body":"서너 문장", "year":1937 } ] }`,
|
||||
rules: `
|
||||
[이 아이템만의 규칙]
|
||||
· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.
|
||||
다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.
|
||||
· **이미 다른 자리에 선 것은 쓰지 않는다.** 인물·대중가요·축제·연표 사건·주변 명소·맛집은
|
||||
각자 섹션이 있다. 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.
|
||||
· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.
|
||||
· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —
|
||||
제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).
|
||||
· 시·소설·가사의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.
|
||||
· 부제에 전체 개수를 적지 않는다. 화면은 이 중 5~6개만 매번 무작위로 보여준다 —
|
||||
숫자를 박으면 보이는 개수와 어긋난다.
|
||||
`,
|
||||
},
|
||||
|
||||
postcard: {
|
||||
kind: 'postcard',
|
||||
label: '오늘의 엽서',
|
||||
|
||||
@@ -204,6 +204,7 @@ import type {
|
||||
PeopleItem,
|
||||
PostcardItem,
|
||||
QuizItem,
|
||||
ReadingItem,
|
||||
SongItem,
|
||||
} from '../lib/section-data';
|
||||
|
||||
@@ -222,7 +223,7 @@ export interface LocalContents {
|
||||
*/
|
||||
itineraries?: ItineraryItem[];
|
||||
/**
|
||||
* 지역 이야기 — 서버가 지역 단위로 생성한 가요·일력·인물·연표·엽서·퀴즈.
|
||||
* 지역 이야기 — 서버가 지역 단위로 생성한 가요·일력·인물·연표·읽기·엽서·퀴즈.
|
||||
*
|
||||
* ★ 사장님이 붙여넣는 같은 종류의 JSON(`theme.sections[].data`)과 **모양이 같다.**
|
||||
* 화면은 둘을 한 배열로 이어 그린다(`StorySection`) — 사장님 값이 앞이다.
|
||||
@@ -235,12 +236,13 @@ export interface LocalContents {
|
||||
syncedAt?: string;
|
||||
}
|
||||
|
||||
/** 지역 이야기 여섯 종. 데이터가 없는 종류는 키 자체가 없다 — 빈 배열을 만들지 않는다. */
|
||||
/** 지역 이야기 일곱 종. 데이터가 없는 종류는 키 자체가 없다 — 빈 배열을 만들지 않는다. */
|
||||
export interface LocalStories {
|
||||
songs?: SongItem[];
|
||||
daily?: DailyItem[];
|
||||
people?: PeopleItem[];
|
||||
chronicle?: ChronicleItem[];
|
||||
reading?: ReadingItem[];
|
||||
postcard?: PostcardItem[];
|
||||
quiz?: QuizItem[];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# 자동재생 — 안 된다. 왜 안 되는지와, 그래서 뭘 했는지
|
||||
|
||||
> ★ **2026-09-15 — 자동재생을 껐다.** 대표: "노래가 자동재생 안 되고 클릭하고 나서 되니까
|
||||
> 사람들이 에러로 보잖아 그냥 꺼놔." 아래 내용은 **왜 자동재생이 어려운가**의 기록으로 남긴다
|
||||
> — 되살릴 일이 생기면 `inject.js` 의 `void autoplay;` 를 `autoplay();` 로 되돌리면 된다.
|
||||
> 함수와 첫 손길 처리는 지우지 않았다.
|
||||
|
||||
`/s/stay` 배경음악을 **새로고침 직후 바로** 나게 하려고 시도한 것 전부와 실측값이다.
|
||||
같은 얘기가 다시 나오면 이 파일부터 본다.
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
| `local` | 지역 정보 | `local.attractions/restaurants` | TourAPI 수집 (시연본 맛집은 `restaurants.json` 31곳) | |
|
||||
| `itinerary` | **추천 일정** | `data(kind=itinerary)` | `services/itinerary.py` + 빌더 프롬프트 `dataSpec.ts:556` | **T2** |
|
||||
| `story` | 군산 이야기 | 아래 6탭 껍데기 | — | |
|
||||
| `reading` | 지역 읽기 | `local.story.reading` | LLM `section-prompts.ts` `reading` | |
|
||||
| `songs` | 가요 다방 | `data(kind=songs)` | LLM `section-prompts.ts:67` | **T3 T5** |
|
||||
| `daily` | 오늘의 한 장 | `data(kind=daily)` | LLM `:91` | 시연본은 노래·문학 39장(`build_daily.py`) |
|
||||
| `people` | 인물 열전 | `data(kind=people)` | LLM `:113` | **T3 T5** |
|
||||
@@ -95,8 +96,9 @@
|
||||
| `weather` | 날씨 | `local.weather` | open-meteo | |
|
||||
| `planner` | 계절별 추천 하루 | `data(kind=planner)` | **없음** | (시연본은 꺼 둠) |
|
||||
|
||||
섹션이 아닌 것이 셋 더 있다 — 헤더 음악 플레이어(**T4**) · **군산 읽기**(**T7**, '군산 이야기'
|
||||
탭 묶음의 여섯 번째 탭) · **엽서 쓰기**(독립 섹션, `festival` 바로 앞).
|
||||
섹션이 아닌 것이 둘 더 있다 — 헤더 음악 플레이어(**T4**) · **엽서 쓰기**(독립 섹션,
|
||||
`festival` 바로 앞). **군산 읽기**(T7)는 2026-09-15 에 렌더러로 들어갔다 — 이제 payload 에
|
||||
`local.story.reading` 만 있으면 새 업장에서도 탭이 선다.
|
||||
|
||||
---
|
||||
|
||||
@@ -273,11 +275,25 @@
|
||||
|
||||
---
|
||||
|
||||
### T7 — 도시를 펼쳐 보이는 자리
|
||||
### T7 — 도시를 펼쳐 보이는 자리 ✔ 제품에 들어갔다 (2026-09-15)
|
||||
|
||||
**증상** 도시 이야기를 담는 자리가 전부 한 번에 하나만 보인다. 하루에 한 장만 보여주는
|
||||
일력이나, 넉 장짜리 엽서 레일 정도로는 군산이라는 도시를 소개하기엔 부족하다.
|
||||
|
||||
**제품에서 어디에 있나** — 이제 주입분이 아니라 렌더러가 그린다.
|
||||
|
||||
| 자리 | 파일 |
|
||||
|---|---|
|
||||
| 항목 계약 `ReadingItem` | `shared/src/lib/section-data.ts` |
|
||||
| 프롬프트(단일 출처) | `shared/src/lib/section-prompts.ts` `reading` |
|
||||
| 생성·출처 링크 | `backend/services/grounding/story.py` `_SEARCH_LINK_KINDS` |
|
||||
| 발행본 | `site/src/sections/items/ReadingSection.tsx` — '지역 이야기' 여섯 번째 탭 |
|
||||
| 빌더 캔버스 | `frontend/.../canvas/variants/reading/ReadingRail.tsx` |
|
||||
|
||||
★ 제품과 시연본이 **한 군데 다르다**: 탭 이름이 `{지명} 읽기` 다(시연본은 '군산 읽기' 고정).
|
||||
★ 제품은 출처를 모델에게 받지 않는다 — 제목으로 만든 네이버 검색 링크를 서버가 붙인다
|
||||
(`build_reading.py` `naver()` 를 그대로 옮긴 것이다).
|
||||
|
||||
**할 일** 문학·역사·섬과 바다·장소·음식처럼 갈래로 나눈 도시 이야기를, 한 화면에서
|
||||
옆으로 넘겨 가며 볼 수 있는 자리를 만든다.
|
||||
|
||||
@@ -679,6 +695,50 @@ node audit-all.mjs
|
||||
그 기계에서 구운 번들 해시와 **무관하게** 뜬다.
|
||||
(2026-09-11 이전 판은 `/assets/…` 를 가리켜 다른 기계에서 흰 화면이었다.)
|
||||
|
||||
### 점검 도구는 어디서 도나 — 개발 PC에서, 주소를 받아서
|
||||
|
||||
`audit-all.mjs` · `rails-test.mjs` 는 **Playwright 로 진짜 크롬을 띄운다.** 그래서
|
||||
|
||||
- **킹서버에서는 못 돈다.** 그 서버에는 node 도 node_modules 도 없다(브라우저는 더더욱).
|
||||
- 대신 **개발 PC에서 주소를 주고 돌린다.** 대상이 로컬이든 킹서버든 명령은 같다.
|
||||
|
||||
```bash
|
||||
npm install # 레포 루트에서 한 번 (playwright 는 devDependencies)
|
||||
node audit-all.mjs # http://localhost/s/stay
|
||||
node audit-all.mjs https://web4ai.o2osolution.ai/s/stay
|
||||
```
|
||||
|
||||
★ 도커에 넣지 않는다. 점검은 **배포물이 아니라 개발 도구**다 — 운영 이미지에 브라우저(300MB+)를
|
||||
넣으면 서버가 그만큼 무거워지는데, 정작 점검은 사람이 볼 때만 돌린다.
|
||||
|
||||
### 렌더러를 다시 구운 뒤 (번들만 갈아 끼운다)
|
||||
|
||||
목업은 **다시 만들지 않는다.** `vendor/` 안의 css·js 한 벌만 새 번들로 바꾸고 주소를 다시 박는다.
|
||||
|
||||
```bash
|
||||
C=o2o-web4ai-solution-prerender
|
||||
CSS=$(docker exec $C sh -c 'ls -t /app/solution/site/out/assets | grep -E "^index-.*\.css$" | head -1')
|
||||
JS=$(docker exec $C sh -c 'ls -t /app/solution/site/out/assets | grep -E "^index-.*\.js$" | head -1')
|
||||
mkdir -p vendor/retired && mv vendor/index-*.css vendor/index-*.js vendor/retired/
|
||||
docker cp $C:/app/solution/site/out/assets/$CSS vendor/
|
||||
docker cp $C:/app/solution/site/out/assets/$JS vendor/
|
||||
python3 patch_stay.py # vendor 안의 한 벌을 찾아 주소만 박는다
|
||||
```
|
||||
|
||||
★ `vendor/` 에는 css·js 가 **각각 한 개만** 있어야 한다(`patch_stay.py` 가 assert 로 막는다).
|
||||
★ 번들이 낡으면 **payload 에 값이 있어도 화면이 빈다.** 소스에 섹션이 있다고 화면에 있는 게 아니다 —
|
||||
실측(2026-09-14): 머지 뒤 이미지를 안 구워서 `StorySection`·`DailySection` 이 번들에 없었다.
|
||||
|
||||
### 점검 기준이 결정을 따라가야 한다 (2026-09-14)
|
||||
|
||||
화면과 `audit-all.mjs` 가 갈리면 점검이 거짓말을 한다. 그날 바뀐 결정 셋:
|
||||
|
||||
| 자리 | 결정 | 점검 |
|
||||
|---|---|---|
|
||||
| 오늘의 한 장 | 탭을 세우지 않는다(사장님: "주석처리해주쇼") — `patch_stay.py` `HIDE_TABS` | `오늘의 한 장 숨김` — 탭이 **없어야** 통과 |
|
||||
| 엽서 | 도시 엽서 4장을 빼고 손님이 쓰는 엽서로(`inject.js` `postcardMaker`) | `엽서 쓰기` — `#w4d-pm-section` 유무 |
|
||||
| 군산 읽기 | 34가지 중 **무작위 5~6꼭지** 카로셀. 신문 조판(제호·면·격자)은 걷어냈다 | `군산 읽기 화면` — 5~6꼭지 |
|
||||
|
||||
### 내용을 바꾼 뒤 (전체 굽기)
|
||||
|
||||
```bash
|
||||
@@ -875,8 +935,13 @@ docker cp vendor/. \$C:/app/solution/site/out/s/stay/vendor/"
|
||||
|
||||
1. **캐치프레이즈 순환** — 대표 문구 `<p>` 를 찾아 **그 아래에 줄(`#w4d-sub`)을 붙이고** 단어 단위로 갈아 끼운다. 대표 문구는 안 건드린다 → T1
|
||||
2. **헤더 미니 플레이어** — 카세트 아이콘 + 재생/멈춤 + 목록. 자작곡 5곡.
|
||||
**자동재생**은 걸어 보고, 브라우저가 막으면 첫 손길에 켠다(**1.3 T4**) → T4
|
||||
3. **군산 읽기** — 렌더러에 없는 섹션. '군산 이야기' 탭 묶음의 **여섯 번째 탭**으로 들어가
|
||||
★ **자동재생은 껐다** (2026-09-15 대표: "자동재생 안 되고 클릭하고 나서 되니까 사람들이
|
||||
에러로 보잖아 그냥 꺼놔"). 세 번째 뒤집기다(09-11 빼 → 09-14 켜 → 09-15 끔). 이번 이유는
|
||||
앞의 둘과 다르다 — 정책을 못 이겨서가 아니라, **정책에 걸린 그 모습이 고장으로 읽혀서**다.
|
||||
`inject.js` 의 `autoplay()` 는 남아 있고 호출만 뺐다(`void autoplay;`) → T4
|
||||
3. **군산 읽기** — ★ **2026-09-15 부터 렌더러에 있다**(`ReadingSection.tsx`, **T7**). 아래는
|
||||
시연본 주입분이 어떻게 굴러가는지의 기록이고, 제품을 고칠 때는 렌더러를 본다.
|
||||
'군산 이야기' 탭 묶음의 **여섯 번째 탭**으로 들어가
|
||||
34꼭지 중 5~6개를 매번 무작위로 카로셀(embla, 한 슬라이드에 한 꼭지) 로 보여준다.
|
||||
`startReading()` 이 story 탭 패널들의 마지막(postcard) 뒤에 자기 패널을 꽂고,
|
||||
자기 탭 버튼은 진짜 탭들의 `[role="tablist"]` 끝에 붙인다 → **T7**
|
||||
|
||||
@@ -53,16 +53,16 @@ const d = await page.evaluate(() => {
|
||||
groups: (e.groups || []).length,
|
||||
sourced: e.items.filter((x) => x.source && x.source.url).length,
|
||||
}; })(),
|
||||
domReadCards: document.querySelectorAll('#w4d-reading .w4d-read-card').length,
|
||||
domReadGroups: document.querySelectorAll('#w4d-reading .w4d-read-group').length,
|
||||
domReadSrc: document.querySelectorAll('#w4d-reading .w4d-read-src a').length,
|
||||
domReadCards: document.querySelectorAll('#w4d-reading-panel .w4d-read-card').length,
|
||||
domReadGroups: document.querySelectorAll('#w4d-reading-panel .w4d-read-group').length,
|
||||
domReadSrc: document.querySelectorAll('#w4d-reading-panel .w4d-read-src a').length,
|
||||
// 레일이 아니어야 한다 — 가로로 밀어야 보이면 '펼쳐 둔다' 가 아니다.
|
||||
// 신문 조판이라 단(column)으로 흐른다(2026-09-14 대표: "신문처럼").
|
||||
readCols: (() => { const el = document.querySelector('#w4d-reading .w4d-read-grid');
|
||||
readCols: (() => { const el = document.querySelector('#w4d-reading-panel .w4d-read-grid');
|
||||
if (!el) return null;
|
||||
return {cols: getComputedStyle(el).columnCount, overflow: el.scrollWidth - el.clientWidth}; })(),
|
||||
readPaper: !!document.querySelector('#w4d-reading .w4d-read-head h2')
|
||||
&& !!document.querySelector('#w4d-reading .w4d-read-dateline'),
|
||||
readPaper: !!document.querySelector('#w4d-reading-panel .w4d-read-head h2')
|
||||
&& !!document.querySelector('#w4d-reading-panel .w4d-read-dateline'),
|
||||
dailyCats: [...new Set(sec('daily').items.map((x) => x.category))].sort(),
|
||||
dailySourced: sec('daily').items.filter((x) => x.source && x.source.url).length,
|
||||
domDailyPages: document.querySelectorAll('#daily article').length,
|
||||
@@ -93,6 +93,7 @@ const d = await page.evaluate(() => {
|
||||
tagline: document.querySelector('#root h1')?.nextElementSibling?.textContent.trim(),
|
||||
sub: document.getElementById('w4d-sub')?.textContent.trim(),
|
||||
subIsCatch: (() => { const t = document.getElementById('w4d-sub')?.textContent.trim(); return !!t && (P.narrative.catchphrases?.items || []).some((x) => x.text.replace(/\s+/g, ' ').trim() === t); })(),
|
||||
postcardMaker: !!document.getElementById('w4d-pm-section'),
|
||||
restaurants: P.local.restaurants.length,
|
||||
// 걸어서 10분(800m) 넘는 맛집 — 없으면 '10분 이상' 탭에서 맛집 칸이 빈다(2026-09-11 사장님 지적)
|
||||
restPhotos: P.local.restaurants.filter((r) => r.imageUrl).length,
|
||||
@@ -131,17 +132,20 @@ ok('정거장마다 할 일 문구', d.hasNote, d.hasNote ? '전 정거장' : '
|
||||
ok('일정 사진 없음', d.stopImages === 0 && d.domItinImg === 0, `payload ${d.stopImages} · 화면 ${d.domItinImg}`);
|
||||
ok('숙소에서 쉬는 날', d.restDays >= 3, `${d.restDays}일`);
|
||||
ok('종료 시각 분산', d.endTimes[1] - d.endTimes[0] > 240, `${(d.endTimes[0] / 60 | 0)}:${String(d.endTimes[0] % 60).padStart(2, '0')} ~ ${(d.endTimes[1] / 60 | 0)}:${String(d.endTimes[1] % 60).padStart(2, '0')}`);
|
||||
ok('군산 읽기 — 한 화면에 다 편다',
|
||||
d.reading.items >= 30 && d.domReadCards === d.reading.items
|
||||
&& d.readCols && d.readCols.overflow <= 2 && Number(d.readCols.cols) >= 2,
|
||||
`payload ${d.reading.items} · 화면 ${d.domReadCards}꼭지 · ${d.domReadGroups}면 · ${d.readCols?.cols}단 · 가로넘침 ${d.readCols?.overflow}px`);
|
||||
ok('군산 읽기 신문 조판', d.readPaper, d.readPaper ? '제호 · 발행일 줄 있음' : '없음');
|
||||
ok('군산 읽기 출처', d.reading.sourced === d.reading.items && d.domReadSrc === d.reading.items,
|
||||
`payload ${d.reading.sourced}/${d.reading.items} · 화면 ${d.domReadSrc}`);
|
||||
ok('오늘의 한 장', d.daily >= 39 && d.domDailyPages === d.daily,
|
||||
`payload ${d.daily}장 · 화면 ${d.domDailyPages}장 · ${d.dailyCats.join('/')}`);
|
||||
ok('오늘의 한 장 출처', d.dailySourced === d.daily, `${d.dailySourced}/${d.daily}`);
|
||||
ok('이야기 탭에 일력', d.storyTabs.includes('오늘의 한 장'), d.storyTabs.join(','));
|
||||
/* 군산 읽기 — 34가지 중 **무작위 5~6꼭지만** 카로셀로 (2026-09-14 대표: "그냥 5-6개 정도만
|
||||
보여주는거 어때? 랜덤으로"). 신문 조판(제호·면·격자)은 같은 날 대표가 걷어냈다("문학면?
|
||||
말이 안 되는거 같네") — 그 항목을 여기서도 뺀다. 화면과 점검이 갈리면 점검이 거짓말을 한다. */
|
||||
ok('군산 읽기 재료', d.reading.items >= 30, `payload ${d.reading.items}가지`);
|
||||
ok('군산 읽기 화면', d.domReadCards >= 5 && d.domReadCards <= 6,
|
||||
`${d.domReadCards}꼭지 (매번 무작위 5~6)`);
|
||||
ok('군산 읽기 출처', d.reading.sourced === d.reading.items && d.domReadSrc === d.domReadCards,
|
||||
`payload ${d.reading.sourced}/${d.reading.items} · 화면 ${d.domReadSrc}/${d.domReadCards}`);
|
||||
/* 오늘의 한 장 — 탭을 **세우지 않는 것**이 정상이다 (2026-09-14 사장님: "오늘의 한장은
|
||||
주석처리해주쇼", patch_stay.py HIDE_TABS). 값은 stay-payload-new.json 에 그대로 있다. */
|
||||
ok('오늘의 한 장 숨김', !d.storyTabs.includes('오늘의 한 장') && d.daily === 0,
|
||||
`탭 없음 · payload ${d.daily}장`);
|
||||
/* 엽서 — 도시 엽서 4장은 뺐고(2026-09-14 대표), 그 자리는 손님이 직접 쓰는 엽서다. */
|
||||
ok('엽서 쓰기', d.postcardMaker, d.postcardMaker ? '있음' : '없음');
|
||||
ok('가요 다방 곡', d.songs >= 25, `${d.songs}곡`);
|
||||
ok('가요 다방에 자작곡 없음', d.ownInSongs === 0, `${d.ownInSongs}곡`);
|
||||
ok('노래마다 링크', d.songLinks === d.songs, `${d.songLinks}/${d.songs}`);
|
||||
@@ -152,7 +156,6 @@ ok('인물 사진', d.peoplePhotos >= 18 && d.domPeopleImg === d.peoplePhotos, `
|
||||
ok('사진 있는 사람이 앞', d.photoFirst, d.photoFirst ? `앞 ${d.peoplePhotos}명` : '흩어져 있다');
|
||||
ok('사진 저작자 표시', d.domCredit === d.peopleCredits, `${d.domCredit}/${d.peopleCredits} (미러 ${d.peoplePhotos - d.peopleCredits}장 제외)`);
|
||||
ok('일정 지도 링크', d.domItinLinks > 150, `${d.domItinLinks}개`);
|
||||
ok('엽서 지도 링크', d.domPostcardLinks === 4, `${d.domPostcardLinks}개`);
|
||||
ok('플레이어 단추 2개', d.miniBtns.length === 2 && !d.miniBtns.includes('w4d-next'), d.miniBtns.join(','));
|
||||
ok('카세트 아이콘', d.cassette, d.cassette ? '있음' : '없음');
|
||||
ok('자작곡 5곡', d.ownSongs === 5, `${d.ownSongs}곡`);
|
||||
|
||||
@@ -569,7 +569,17 @@
|
||||
buildList();
|
||||
mount();
|
||||
render();
|
||||
autoplay();
|
||||
/* ★ 자동재생을 **끈다** (2026-09-15 대표: "노래가 자동재생 안 되고 클릭하고 나서 되니까
|
||||
사람들이 에러로 보잖아 그냥 꺼놔"). 세 번째 뒤집기다 — 09-11 "자동 빼" → 09-14 "자동재생
|
||||
한다" → 09-15 끈다. 뒤집은 이유가 매번 다르다: 이번은 **정책을 못 이겨서**가 아니라
|
||||
정책에 걸린 그 모습이 고장으로 읽혀서다. 브라우저는 손님이 페이지를 만지기 전에는
|
||||
소리를 거절하므로(정책), 자동재생을 켜 두면 "눌러야 나는 플레이어"가 되고 그건
|
||||
고장과 구별되지 않는다.
|
||||
★ 함수는 남긴다 — 네 번째 뒤집기가 오면 이 한 줄만 되살린다. 지운 자리를 다시 짜면
|
||||
첫 손길 리스너의 클릭 삼킴(2026-09-11)을 또 밟는다.
|
||||
★ 제품 렌더러(`site/src/sections/SongPlayer.tsx`)에는 원래 자동재생이 없다 —
|
||||
이제 목업과 제품이 같은 동작이다. */
|
||||
void autoplay;
|
||||
if (window.MutationObserver) {
|
||||
new MutationObserver(function () {
|
||||
if (!mini.isConnected) { mount(); render(); }
|
||||
|
||||
@@ -441,6 +441,23 @@ html = html.replace(OLD_UPDATED_AT, UPDATED_AT)
|
||||
html = html.replace(f">{OLD_UPDATED_AT[:10]}</time>", f">{UPDATED_AT[:10]}</time>")
|
||||
assert OLD_UPDATED_AT not in html and OLD_UPDATED_AT[:10] not in html, "옛 날짜가 남았다"
|
||||
|
||||
# ── 푸터 '만든 곳' 한 줄 ──────────────────────────────────────────────────────
|
||||
# ★ 왜 (2026-09-15 대표: "푸터 하단에 Web4ai ai o2o 얘기도 적어주셈 목업 빌더 다 똑같아")
|
||||
# 렌더러가 박는 줄이라(`SiteFooter.tsx`) 굽는 사이트에는 전부 들어가는데, 이 한 장은
|
||||
# 2026-09-09 판 프리렌더 결과물(`orig/index.html`)이라 그 줄이 없다.
|
||||
# ★ 마크업은 렌더러가 내보내는 것과 **글자 하나까지 같아야** 한다 — 정적 HTML 위에
|
||||
# 하이드레이션이 얹히므로(entry-client.tsx) 어긋나면 React 가 그 자리를 다시 그린다.
|
||||
# 위 문자열은 `render(payload)` 출력에서 그대로 떠 온 것이다(속성 순서까지).
|
||||
# ★ 화면이 실제로 따라오는 것은 `vendor/` 번들을 다시 복사한 다음이다(아래 ★ 갱신 절차) —
|
||||
# 지금 넣는 것은 크롤러와 첫 화면이 보는 값이고, 날짜를 payload 밖에서도 고치는 것과
|
||||
# 같은 이유다.
|
||||
MADE_BY = ('<p class="pt-3 text-[length:var(--fs-xs)] opacity-55">'
|
||||
'<a href="https://www.o2osolution.ai/" target="_blank" rel="noopener noreferrer" '
|
||||
'class="underline-offset-2 hover:underline">AI O2O</a>'
|
||||
'의 Web4Ai로 만든 사이트입니다.</p>')
|
||||
html, n = re.subn(r"</div></footer>", lambda _m: MADE_BY + "</div></footer>", html, count=1)
|
||||
assert n == 1, "푸터 끝(</div></footer>)을 못 찾았다"
|
||||
|
||||
# ★ 이용 정보 **맨 아래 구분선**을 지운다 (2026-09-10 사장님 지시).
|
||||
# 항목이 끝난 자리에 선이 한 줄 더 그어져 있어, 빈 칸이 하나 더 있는 것처럼 보인다.
|
||||
# 항목(바비큐 이용) 자체는 그대로 둔다 — 지우라고 한 것은 선이다.
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"schemaVersion": 1, "site": {"siteId": "e929e6b4-e502-4761-9786-0bb82178b375", "placeId": "66894a1b-a331-43f1-942c-0ae064a704d6", "status": 3, "origin": "https://web4ai.o2osolution.ai", "basePath": "/s/stay", "slug": "stay", "publishedAt": "2026-09-03T01:27:39.284442+00:00", "updatedAt": "2026-09-14T07:42:00+00:00", "version": 11}, "place": {"name": "스테이,머뭄", "category": 1, "roadAddress": "전북 군산시 절골길 18", "address": "전북 군산시 신흥동 63-18", "addressRegion": "전북", "addressLocality": "군산시", "addressSubLocality": null, "addressRegionCode": "KR-45", "phone": "0507-1497-0983", "latitude": 35.9864175, "longitude": 126.7061254, "regionCode": "52군산시", "kakaoPlaceId": null}, "facts": [{"key": "parking", "label": "주차 가능", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.678003+00:00", "verifiedAt": "2026-08-28T02:12:21.402109+00:00"}, {"key": "intro", "label": "숙소 소개", "value": "1920년대에 지어진 백 년 고택을 리모델링한 독채 펜션입니다. 히로쓰 가옥 후문 바로 옆이고, 침구는 매일 세탁·살균·건조합니다.", "unit": null, "type": "text", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.547669+00:00", "verifiedAt": "2026-08-28T02:12:21.922925+00:00"}, {"key": "wifi", "label": "와이파이", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.757070+00:00", "verifiedAt": "2026-08-28T02:12:22.356600+00:00"}, {"key": "check_out_time", "label": "체크아웃 시간", "value": "11:00", "unit": null, "type": "time", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "cancel_policy", "label": "취소·환불 규정", "value": "입실 당일 취소와 노쇼(No Show)는 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.", "unit": null, "type": "text", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "cooking_allowed", "label": "취사 가능", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "pet_allowed", "label": "반려동물 동반", "value": "false", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "smoking", "label": "흡연 가능", "value": "false", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": false, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "extra_person_fee", "label": "인원 추가 요금", "value": "20000", "unit": "원", "type": "number", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": false, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "check_in_time", "label": "체크인 시간", "value": "15:00", "unit": null, "type": "time", "scope": "place", "status": 3, "sourceType": 1, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T23:31:05.719599+00:00"}, {"key": "pickup_service", "label": "픽업 서비스", "value": "false", "type": "bool", "scope": "place", "unit": null, "status": 3, "sourceType": 3, "sourceUrl": "htLine truncated
|
||||
{"schemaVersion": 1, "site": {"siteId": "e929e6b4-e502-4761-9786-0bb82178b375", "placeId": "66894a1b-a331-43f1-942c-0ae064a704d6", "status": 3, "origin": "https://web4ai.o2osolution.ai", "basePath": "/s/stay", "slug": "stay", "publishedAt": "2026-09-03T01:27:39.284442+00:00", "updatedAt": "2026-09-14T07:42:00+00:00", "version": 11}, "place": {"name": "스테이,머뭄", "category": 1, "roadAddress": "전북 군산시 절골길 18", "address": "전북 군산시 신흥동 63-18", "addressRegion": "전북", "addressLocality": "군산시", "addressSubLocality": null, "addressRegionCode": "KR-45", "phone": "0507-1497-0983", "latitude": 35.9864175, "longitude": 126.7061254, "regionCode": "52군산시", "kakaoPlaceId": null}, "facts": [{"key": "parking", "label": "주차 가능", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.678003+00:00", "verifiedAt": "2026-08-28T02:12:21.402109+00:00"}, {"key": "intro", "label": "숙소 소개", "value": "1920년대에 지어진 백 년 고택을 리모델링한 독채 펜션입니다. 히로쓰 가옥 후문 바로 옆이고, 침구는 매일 세탁·살균·건조합니다.", "unit": null, "type": "text", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.547669+00:00", "verifiedAt": "2026-08-28T02:12:21.922925+00:00"}, {"key": "wifi", "label": "와이파이", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://m.place.naver.com/place/1133638931/home", "critical": false, "required": false, "unitId": null, "collectedAt": "2026-08-28T02:10:08.757070+00:00", "verifiedAt": "2026-08-28T02:12:22.356600+00:00"}, {"key": "check_out_time", "label": "체크아웃 시간", "value": "11:00", "unit": null, "type": "time", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "cancel_policy", "label": "취소·환불 규정", "value": "입실 당일 취소와 노쇼(No Show)는 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.", "unit": null, "type": "text", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "cooking_allowed", "label": "취사 가능", "value": "true", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "pet_allowed", "label": "반려동물 동반", "value": "false", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "smoking", "label": "흡연 가능", "value": "false", "unit": null, "type": "bool", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": false, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "extra_person_fee", "label": "인원 추가 요금", "value": "20000", "unit": "원", "type": "number", "scope": "place", "status": 3, "sourceType": 3, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": false, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T13:27:53.241391+00:00"}, {"key": "check_in_time", "label": "체크인 시간", "value": "15:00", "unit": null, "type": "time", "scope": "place", "status": 3, "sourceType": 1, "sourceUrl": "https://travel.interpark.com/checkinnow/goods/GY0002361440", "critical": true, "required": true, "unitId": null, "collectedAt": "2026-09-02T13:27:53.241391+00:00", "verifiedAt": "2026-09-02T23:31:05.719599+00:00"}, {"key": "pickup_service", "label": "픽업 서비스", "value": "false", "type": "bool", "scope": "place", "unit": null, "status": 3, "sourceType": 3, "sourceUrl": "htLine truncated
|
||||
@@ -0,0 +1,340 @@
|
||||
(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function o(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(f){if(f.ep)return;f.ep=!0;const d=o(f);fetch(f.href,d)}})();const Pg="modulepreload",eb=function(i){return"/"+i},xh={},tb=function(c,o,u){let f=Promise.resolve();if(o&&o.length>0){let h=function(x){return Promise.all(x.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));f=h(o.map(x=>{if(x=eb(x),x in xh)return;xh[x]=!0;const v=x.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${y}`))return;const z=document.createElement("link");if(z.rel=v?"stylesheet":Pg,v||(z.as="script"),z.crossOrigin="",z.href=x,g&&z.setAttribute("nonce",g),document.head.appendChild(z),v)return new Promise((w,N)=>{z.addEventListener("load",w),z.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${x}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return f.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return c().catch(d)})};var Mo={exports:{}},zs={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var gh;function lb(){if(gh)return zs;gh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function o(u,f,d){var h=null;if(d!==void 0&&(h=""+d),f.key!==void 0&&(h=""+f.key),"key"in f){d={};for(var p in f)p!=="key"&&(d[p]=f[p])}else d=f;return f=d.ref,{$$typeof:i,type:u,key:h,ref:f!==void 0?f:null,props:d}}return zs.Fragment=c,zs.jsx=o,zs.jsxs=o,zs}var bh;function ab(){return bh||(bh=1,Mo.exports=lb()),Mo.exports}var n=ab(),ko={exports:{}},ue={};/**
|
||||
* @license React
|
||||
* react.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var vh;function nb(){if(vh)return ue;vh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),z=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=z&&S[z]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,D={};function U(S,L,V){this.props=S,this.context=L,this.refs=D,this.updater=V||N}U.prototype.isReactComponent={},U.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},U.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function X(){}X.prototype=U.prototype;function Z(S,L,V){this.props=S,this.context=L,this.refs=D,this.updater=V||N}var P=Z.prototype=new X;P.constructor=Z,A(P,U.prototype),P.isPureReactComponent=!0;var $=Array.isArray;function K(){}var G={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function se(S,L,V){var J=V.ref;return{$$typeof:i,type:S,key:L,ref:J!==void 0?J:null,props:V}}function Q(S,L){return se(S.type,L,S.props)}function ae(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function ye(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(V){return L[V]})}var Ge=/\/+/g;function Qe(S,L){return typeof S=="object"&&S!==null&&S.key!=null?ye(""+S.key):L.toString(36)}function ce(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(K,K):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,L,V,J,re){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var oe=!1;if(S===null)oe=!0;else switch(fe){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(S.$$typeof){case i:case c:oe=!0;break;case v:return oe=S._init,k(oe(S._payload),L,V,J,re)}}if(oe)return re=re(S),oe=J===""?"."+Qe(S,0):J,$(re)?(V="",oe!=null&&(V=oe.replace(Ge,"$&/")+"/"),k(re,L,V,"",function(at){return at})):re!=null&&(ae(re)&&(re=Q(re,V+(re.key==null||S&&S.key===re.key?"":(""+re.key).replace(Ge,"$&/")+"/")+oe)),L.push(re)),1;oe=0;var ze=J===""?".":J+":";if($(S))for(var Ee=0;Ee<S.length;Ee++)J=S[Ee],fe=ze+Qe(J,Ee),oe+=k(J,L,V,fe,re);else if(Ee=w(S),typeof Ee=="function")for(S=Ee.call(S),Ee=0;!(J=S.next()).done;)J=J.value,fe=ze+Qe(J,Ee++),oe+=k(J,L,V,fe,re);else if(fe==="object"){if(typeof S.then=="function")return k(ce(S),L,V,J,re);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return oe}function Y(S,L,V){if(S==null)return S;var J=[],re=0;return k(S,J,"","",function(fe){return L.call(V,fe,re++)}),J}function te(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(V){(S._status===0||S._status===-1)&&(S._status=1,S._result=V)},function(V){(S._status===0||S._status===-1)&&(S._status=2,S._result=V)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var he=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},je={map:Y,forEach:function(S,L,V){Y(S,function(){L.apply(this,arguments)},V)},count:function(S){var L=0;return Y(S,function(){L++}),L},toArray:function(S){return Y(S,function(L){return L})||[]},only:function(S){if(!ae(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=y,ue.Children=je,ue.Component=U,ue.Fragment=o,ue.Profiler=f,ue.PureComponent=Z,ue.StrictMode=u,ue.Suspense=g,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return G.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,L,V){if(S==null)throw ErroLine truncated
|
||||
* @license React
|
||||
* scheduler.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var jh;function sb(){return jh||(jh=1,(function(i){function c(k,Y){var te=k.length;k.push(Y);e:for(;0<te;){var he=te-1>>>1,je=k[he];if(0<f(je,Y))k[he]=Y,k[te]=je,te=he;else break e}}function o(k){return k.length===0?null:k[0]}function u(k){if(k.length===0)return null;var Y=k[0],te=k.pop();if(te!==Y){k[0]=te;e:for(var he=0,je=k.length,S=je>>>1;he<S;){var L=2*(he+1)-1,V=k[L],J=L+1,re=k[J];if(0>f(V,te))J<je&&0>f(re,V)?(k[he]=re,k[J]=te,he=J):(k[he]=V,k[L]=te,he=L);else if(J<je&&0>f(re,te))k[he]=re,k[J]=te,he=J;else break e}}return Y}function f(k,Y){var te=k.sortIndex-Y.sortIndex;return te!==0?te:k.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();i.unstable_now=function(){return h.now()-p}}var g=[],x=[],v=1,y=null,z=3,w=!1,N=!1,A=!1,D=!1,U=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function P(k){for(var Y=o(x);Y!==null;){if(Y.callback===null)u(x);else if(Y.startTime<=k)u(x),Y.sortIndex=Y.expirationTime,c(g,Y);else break;Y=o(x)}}function $(k){if(A=!1,P(k),!N)if(o(g)!==null)N=!0,K||(K=!0,ye());else{var Y=o(x);Y!==null&&ce($,Y.startTime-k)}}var K=!1,G=-1,ee=5,se=-1;function Q(){return D?!0:!(i.unstable_now()-se<ee)}function ae(){if(D=!1,K){var k=i.unstable_now();se=k;var Y=!0;try{e:{N=!1,A&&(A=!1,X(G),G=-1),w=!0;var te=z;try{t:{for(P(k),y=o(g);y!==null&&!(y.expirationTime>k&&Q());){var he=y.callback;if(typeof he=="function"){y.callback=null,z=y.priorityLevel;var je=he(y.expirationTime<=k);if(k=i.unstable_now(),typeof je=="function"){y.callback=je,P(k),Y=!0;break t}y===o(g)&&u(g),P(k)}else u(g);y=o(g)}if(y!==null)Y=!0;else{var S=o(x);S!==null&&ce($,S.startTime-k),Y=!1}}break e}finally{y=null,z=te,w=!1}Y=void 0}}finally{Y?ye():K=!1}}}var ye;if(typeof Z=="function")ye=function(){Z(ae)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Qe=Ge.port2;Ge.port1.onmessage=ae,ye=function(){Qe.postMessage(null)}}else ye=function(){U(ae,0)};function ce(k,Y){G=U(function(){k(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(k){k.callback=null},i.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<k?Math.floor(1e3/k):5},i.unstable_getCurrentPriorityLevel=function(){return z},i.unstable_next=function(k){switch(z){case 1:case 2:case 3:var Y=3;break;default:Y=z}var te=z;z=Y;try{return k()}finally{z=te}},i.unstable_requestPaint=function(){D=!0},i.unstable_runWithPriority=function(k,Y){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var te=z;z=k;try{return Y()}finally{z=te}},i.unstable_scheduleCallback=function(k,Y,te){var he=i.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?he+te:he):te=he,k){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=te+je,k={id:v++,callback:Y,priorityLevel:k,startTime:te,expirationTime:je,sortIndex:-1},te>he?(k.sortIndex=te,c(x,k),o(g)===null&&k===o(x)&&(A?(X(G),G=-1):A=!0,ce($,te-he))):(k.sortIndex=je,c(g,k),N||w||(N=!0,K||(K=!0,ye()))),k},i.unstable_shouldYield=Q,i.unstable_wrapCallback=function(k){var Y=z;return function(){var te=z;z=Y;try{return k.apply(this,arguments)}finally{z=te}}}})(Ro)),Ro}var Nh;function ib(){return Nh||(Nh=1,Do.exports=sb()),Do.exports}var Uo={exports:{}},mt={};/**
|
||||
* @license React
|
||||
* react-dom.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Sh;function cb(){if(Sh)return mt;Sh=1;var i=Fo();function c(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(c(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(g,x,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:y==null?null:""+y,children:g,containerInfo:x,implementation:v}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,mt.createPortal=function(g,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(c(299));return d(g,x,null,v)},mt.flushSync=function(g){var x=h.T,v=u.p;try{if(h.T=null,u.p=2,g)return g()}finally{h.T=x,u.p=v,u.d.f()}},mt.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,u.d.C(g,x))},mt.prefetchDNS=function(g){typeof g=="string"&&u.d.D(g)},mt.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var v=x.as,y=p(v,x.crossOrigin),z=typeof x.integrity=="string"?x.integrity:void 0,w=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?u.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:z,fetchPriority:w}):v==="script"&&u.d.X(g,{crossOrigin:y,integrity:z,fetchPriority:w,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},mt.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=p(x.as,x.crossOrigin);u.d.M(g,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&u.d.M(g)},mt.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,y=p(v,x.crossOrigin);u.d.L(g,v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},mt.preloadModule=function(g,x){if(typeof g=="string")if(x){var v=p(x.as,x.crossOrigin);u.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else u.d.m(g)},mt.requestFormReset=function(g){u.d.r(g)},mt.unstable_batchedUpdates=function(g,x){return g(x)},mt.useFormState=function(g,x,v){return h.H.useFormState(g,x,v)},mt.useFormStatus=function(){return h.H.useHostTransitionStatus()},mt.version="19.2.8",mt}var zh;function rb(){if(zh)return Uo.exports;zh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Uo.exports=cb(),Uo.exports}/**
|
||||
* @license React
|
||||
* react-dom-client.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Eh;function ob(){if(Eh)return Es;Eh=1;var i=ib(),c=Fo(),o=rb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(u(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return g(s),e;if(r===a)return g(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var m=!1,b=s.child;b;){if(b===l){m=!0,l=s,a=r;break}if(b===a){m=!0,a=s,l=r;break}b=b.sibling}if(!m){for(b=r.child;b;){if(b===l){m=!0,l=r,a=s;break}if(b===a){m=!0,a=r,l=s;break}b=b.sibling}if(!m)throw Error(u(189))}}if(l.alternate!==a)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,z=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Qe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case U:return"Profiler";case D:return"StrictMode";case $:return"Suspense";case K:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Z:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:Qe(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Qe(e(t))}catch{}}return null}var ce=Array.isArray,k=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},he=[],je=-1;function S(e){return{current:e}}function L(e){0>je||(e.current=he[je],he[je]=null,je--)}function V(e,t){je++,he[je]=e.current,e.current=t}var J=S(null),re=S(null),fe=S(null),oe=S(null);function ze(e,t){switch(V(fe,t),V(re,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bm(t),e=qm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(J),V(J,e)}function Ee(){L(J),L(re),L(fe)}function at(e){e.memoizedState!==null&&V(oe,e);var t=J.current,l=qm(t,e.type);t!==l&&(V(re,e),V(J,l))}function Me(e){re.current===e&&(L(J),L(re)),oe.current===e&&(L(oe),ys._currentValue=te)}var I,Te;function ke(e){if(I===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||"",Te=-1<l.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+I+e+Te}var tt=!1;function yt(e,t){if(!e||tt)return"";tt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(O){var M=O}Reflect.construct(e,[],B)}else{try{B.call()}catch(O){M=O}e.call(B.prototype)}}else{try{throw Error()}catch(O){M=O}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(O){if(O&&M&&typeof O.stack=="string")return[O.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),m=r[0],b=r[1];if(m&&b){var j=m.split(`
|
||||
`),C=b.split(`
|
||||
`);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===C.length)for(a=j.length-1,s=C.length-1;1<=a&&0<=s&&j[a]!==C[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==C[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==C[s]){var R=`
|
||||
`+j[a].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=a&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ke(l):""}function Jt(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return yt(e.type,!1);case 11:return yt(e.type.render,!1);case 1:return yt(e.type,!0);case 31:return ke("Activity");default:return""}}function ll(e){try{var t="",l=null;do t+=Jt(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
||||
Error generating stack: `+a.message+`
|
||||
`+a.stack}}var Ht=Object.prototype.hasOwnProperty,Wt=i.unstable_scheduleCallback,hl=i.unstable_cancelCallback,An=i.unstable_shouldYield,_n=i.unstable_requestPaint,dt=i.unstable_now,$s=i.unstable_getCurrentPriorityLevel,Qs=i.unstable_ImmediatePriority,Cn=i.unstable_UserBlockingPriority,Da=i.unstable_NormalPriority,Mn=i.unstable_LowPriority,pl=i.unstable_IdlePriority,kn=i.log,On=i.unstable_setDisableYieldValue,al=null,pt=null;function nl(e){if(typeof kn=="function"&&On(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(al,e)}catch{}}var xt=Math.clz32?Math.clz32:Xs,xc=Math.log,gc=Math.LN2;function Xs(e){return e>>>=0,e===0?32:31-(xc(e)/gc|0)|0}var Ra=256,da=262144,ma=4194304;function sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ua(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=a&134217727;return b!==0?(a=b&~r,a!==0?s=sl(a):(m&=b,m!==0?s=sl(m):l||(l=b&~e,l!==0&&(s=sl(l))))):(b=a&~r,b!==0?s=sl(b):m!==0?s=sl(m):l||(l=a&~e,l!==0&&(s=sl(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function Ul(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vs(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zs(){var e=ma;return ma<<=1,(ma&62914560)===0&&(ma=4194304),e}function bc(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Dn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Yp(e,t,l,a,s,r){var m=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,j=e.expirationTimes,C=e.hiddenUpdates;for(l=m&~l;0<l;){var R=31-xt(l),B=1<<R;b[R]=0,j[R]=-1;var M=C[R];if(M!==null)for(C[R]=null,R=0;R<M.length;R++){var O=M[R];O!==null&&(O.lane&=-536870913)}l&=~B}a!==0&&yu(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(m&~t))}function yu(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-xt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function ju(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-xt(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function Nu(e,t){var l=t&-t;return l=(l&42)!==0?1:vc(l),(l&(e.suspendedLanes|t))!==0?0:l}function vc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Su(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function zu(e,t){var l=Y.p;try{return Y.p=e,t()}finally{Y.p=l}}var Hl=Math.random().toString(36).slice(2),it="__reactFiber$"+Hl,jt="__reactProps$"+Hl,Ha="__reactContainer$"+Hl,jc="__reactEvents$"+Hl,Gp="__reactListeners$"+Hl,$p="__reactHandles$"+Hl,Eu="__reactResources$"+Hl,Rn="__reactMarker$"+Hl;function Nc(e){delete e[it],delete e[jt],delete e[jc],delete e[Gp],delete e[$p]}function La(e){var t=e[it];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ha]||l[it]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Zm(e);e!==null;){if(l=e[it])return l;e=Zm(e)}return t}e=l,l=e.parentNode}return null}function Ba(e){if(e=e[it]||e[Ha]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Un(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function qa(e){var t=e[Eu];return t||(t=e[Eu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Rn]=!0}var wu=new Set,Tu={};function ha(e,t){Ya(e,t),Ya(e+"Capture",t)}function Ya(e,t){for(Tu[e]=t,e=0;e<t.length;e++)wu.add(t[e])}var Qp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21
Line truncated
|
||||
`).replace(jg,"")}function Hm(e,t){return t=Um(t),Um(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$a(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$a(e,""+a);break;case"className":Js(e,"class",a);break;case"tabIndex":Js(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Js(e,l,a);break;case"style":Uu(e,a,r);break;case"data":if(t!=="object"){Js(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Fs(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Fs(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=gl);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Fs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Ks(e,"popover",a);break;case"xlinkActuate":xl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":xl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":xl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":xl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":xl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":xl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":xl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":xl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":xl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Ks(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Jp.get(l)||l,Ks(e,l,a))}}function mo(e,t,l,a,s,r){switch(l){case"style":Uu(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$a(e,a):(typeof a=="number"||typeof a=="bigint")&&$a(e,""+a);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=gl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const fb=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),db=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,o,u)=>u?u.toUpperCase():o.toLowerCase()),Th=i=>{const c=db(i);return c.charAt(0).toUpperCase()+c.slice(1)},fp=(...i)=>i.filter((c,o,u)=>!!c&&c.trim()!==""&&u.indexOf(c)===o).join(" ").trim(),mb=i=>{for(const c in i)if(c.startsWith("aria-")||c==="role"||c==="title")return!0};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var hb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const pb=q.forwardRef(({color:i="currentColor",size:c=24,strokeWidth:o=2,absoluteStrokeWidth:u,className:f="",children:d,iconNode:h,...p},g)=>q.createElement("svg",{ref:g,...hb,width:c,height:c,stroke:i,strokeWidth:u?Number(o)*24/Number(c):o,className:fp("lucide",f),...!d&&!mb(p)&&{"aria-hidden":"true"},...p},[...h.map(([x,v])=>q.createElement(x,v)),...Array.isArray(d)?d:[d]]));/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const He=(i,c)=>{const o=q.forwardRef(({className:u,...f},d)=>q.createElement(pb,{ref:d,iconNode:c,className:fp(`lucide-${fb(Th(i))}`,`lucide-${i}`,u),...f}));return o.displayName=Th(i),o};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const xb=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Sn=He("arrow-up-right",xb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const gb=[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]],bb=He("bed-double",gb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const vb=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],yb=He("calendar-check",vb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const jb=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Nb=He("calendar-days",jb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Sb=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],zb=He("car",Sb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Eb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dp=He("check",Eb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const wb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fc=He("chevron-down",wb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Tb=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oa=He("chevron-left",Tb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ab=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ua=He("chevron-right",Ab);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _b=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Cb=He("clock",_b);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Mb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],kb=He("copy",Mb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ob=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Db=He("external-link",Ob);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Rb=[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]],Ub=He("instagram",Rb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Hb=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],mp=He("mail",Hb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Lb=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ls=He("map-pin",Lb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Bb=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],hp=He("menu",Bb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qb=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Io=He("message-circle",qb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Yb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Gb=He("minus",Yb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $b=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Ho=He("navigation",$b);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Qb=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],_t=He("phone",Qb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Xb=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Vb=He("play",Xb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Zb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kb=He("plus",Zb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Jb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Wb=He("rotate-ccw",Jb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Fb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ib=He("shield-check",Fb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Pb=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],e0=He("utensils",Pb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const t0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pp=He("x",t0);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const l0=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],a0=He("youtube",l0),xp=q.createContext(null);function n0({payload:i,children:c}){return n.jsx(xp.Provider,{value:i,children:c})}function le(){const i=q.useContext(xp);if(!i)throw new Error("SiteProvider 밖에서 useSite() 를 불렀습니다. payload 없이는 렌더할 수 없습니다.");return i}function s0(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[n.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),n.jsxs("g",{className:"w4d-reel",children:[n.jsx("circle",{cx:"8.5",cy:"12",r:"2.6"}),n.jsx("path",{d:"M8.5 9.4v5.2M5.9 12h5.2"})]}),n.jsxs("g",{className:"w4d-reel",children:[n.jsx("circle",{cx:"15.5",cy:"12",r:"2.6"}),n.jsx("path",{d:"M15.5 9.4v5.2M12.9 12h5.2"})]}),n.jsx("path",{d:"M6 19l1.5-2.4h9L18 19"})]})}function i0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M8 5v14l11-7z"})})}function c0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M7 5h3.4v14H7zm6.6 0H17v14h-3.4z"})})}function r0(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[n.jsx("path",{d:"M4 7h11M4 12h11M4 17h7"}),n.jsx("path",{d:"M19 17.5V9l3 1.2"}),n.jsx("circle",{cx:"17.4",cy:"17.6",r:"1.7",fill:"currentColor",stroke:"none"})]})}function o0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M6 6l12 12M18 6L6 18"})})}function Ah(i){if(typeof i!="number"||!Number.isFinite(i))return"";const c=Math.floor(i/60),o=Math.floor(i%60);return`${c}:${o<10?"0":""}${o}`}function u0(){const i=le(),c=(i.songs??[]).filter($=>$.audioUrl),[o,u]=q.useState(0),[f,d]=q.useState(!1),[h,p]=q.useState(!1),[g,x]=q.useState({now:0,total:0}),[v,y]=q.useState({}),z=q.useRef(null),w=q.useRef(null),N=q.useRef(null),A=c.length;q.useEffect(()=>{A>1&&u(Math.floor(Math.random()*A))},[A]);const D=q.useCallback(()=>{var ee;const $=document.querySelector("header"),K=$==null?void 0:$.getBoundingClientRect(),G={top:`${K?K.bottom+6:66}px`};if(window.innerWidth<=640)G.left="8px",G.right="8px";else{G.left="auto";const se=(ee=w.current)==null?void 0:ee.getBoundingClientRect();G.right=`${Math.max(12,window.innerWidth-((se==null?void 0:se.right)??0))}px`}y(G)},[]);if(q.useEffect(()=>{if(!h)return;D();const $=()=>D(),K=G=>{var se,Q;const ee=G.target;(se=N.current)!=null&&se.contains(ee)||(Q=w.current)!=null&&Q.contains(ee)||p(!1)};return window.addEventListener("resize",$),window.addEventListener("scroll",$,{passive:!0}),document.addEventListener("click",K),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$),document.removeEventListener("click",K)}},[h,D]),q.useEffect(()=>()=>{var $;return($=z.current)==null?void 0:$.pause()},[]),c.length===0)return null;const U=c[o]??c[0],X=($=o)=>{const K=z.current,G=c[$];!K||!G||(K.getAttribute("src")!==G.audioUrl&&(K.src=G.audioUrl),K.play().then(()=>d(!0),()=>d(!1)))},Z=()=>{var $;($=z.current)==null||$.pause(),d(!1)},P=$=>{const K=($%c.length+c.length)%c.length;u(K),x({now:0,total:0}),X(K)};return n.jsxs(n.Fragment,{children:[n.jsxs("span",{id:"w4d-mini",ref:w,"data-playing":f?"1":"0",children:[n.jsx("span",{id:"w4d-tape","aria-hidden":!0,title:`${i.place.name}이(가) 만든 노래`,children:n.jsx(s0,{})}),n.jsx("span",{id:"w4d-now","aria-live":"polite",children:U.title}),n.jsx("button",{type:"button",id:"w4d-play","data-playing":f?"1":"0",title:`${f?"멈춤":"재생"} · ${U.title}`,onClick:()=>f?Z():X(),children:f?n.jsx(c0,{}):n.jsx(i0,{})}),n.jsx("button",{type:"button",id:"w4d-toggle",title:"노래 목록","aria-expanded":h,onClick:()=>p($=>!$),children:n.jsx(r0,{})})]}),n.jsx("audio",{ref:z,src:c[0].audioUrl,preload:"none",onTimeUpdate:$=>x({now:$.currentTarget.currentTime,total:$.currentTarget.duration}),onDurationChange:$=>x(K=>({...K,total:$.currentTarget.duration})),onEnded:()=>P(o+1),onError:()=>d(!1)}),n.jsxs("div",{id:"w4d-panel",ref:N,hidden:!h,style:v,children:[n.jsxs("div",{className:"w4d-head",children:[n.jsxs("span",{className:"w4d-head-t",children:[i.place.name,"이(가) 만든 노래"]}),n.jsxs("span",{className:"w4d-head-n",children:[c.length,"곡"]}),n.jsx("button",{type:"button",id:"w4d-close",title:"닫기","aria-label":"닫기",onClick:()=>p(!1),children:n.jsx(o0,{})})]}),n.jsx("ol",{children:c.map(($,K)=>n.jsx("li",{children:n.jsxs("button",{type:"button",className:"w4d-item","aria-current":K===o,"data-playing":K===o&&f?"1":"0",onClick:()=>P(K),children:[n.jsxs("span",{className:"w4d-mark",children:[n.jsx("span",{className:"w4d-disc-sm"}),n.jsxs("span",{className:"w4d-eq","aria-hidden":!0,children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]Line truncated
|
||||
|
||||
`).trim()})]})]})}const Ma={LODGING:1,CAFE:2,RESTAURANT:3,CLINIC:4},f0={OWNER:1,CRAWL:3,TEMPLATE:5},_h={UNVERIFIED:1,VERIFIED:3,CORRECTED:4},d0=[_h.VERIFIED,_h.CORRECTED];function gp(i){return d0.includes(i)}const bt={YANOLJA:1,GOODCHOICE:2,NAVER_PLACE:3,INSTAGRAM:4,OFFICIAL_SITE:5,BLOG:6,NAVER_BOOKING:7,ETC:99},S1={PUBLISHED:3};function Bs(i){return i.filter(c=>gp(c.status)&&c.value!=null&&c.value!=="")}function bp(i){const c=new Map;for(const o of Bs(i))c.set(o.key,o);return c}function ca(i,c){const o=bp(i).get(c);return(o==null?void 0:o.value)??void 0}function At(i,c){const o=bp(i).get(c);if(!(o!=null&&o.value))return;const u=o.type==="number"?m0(o.value):o.value;return o.unit?`${u}${o.unit}`:u}function m0(i){const c=Number(i.replace(/,/g,""));return Number.isFinite(c)?c.toLocaleString("ko-KR"):i}function Po(i){return i.type!=="bool"?i.label:i.label.replace(/\s*(가능|여부)$/,"")||i.label}function h0(i){return i.filter(c=>gp(c.status)&&c.question&&c.answer).sort((c,o)=>c.sortOrder-o.sortOrder)}function eu(i){return i.map(c=>({...c,facts:Bs(c.facts)})).sort((c,o)=>c.sortOrder-o.sortOrder)}const p0={songs:"title",daily:"title",course:"name",schedule:"name",people:"name",chronicle:"title",literature:"workTitle",postcard:"line",quiz:"question",planner:"name",itinerary:"name",video:"url",event:"title"};function x0(i){const c=(i??"").trim();if(!c)return;const o=/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/|live\/)|youtu\.be\/)([A-Za-z0-9_-]{6,20})/.exec(c);return o==null?void 0:o[1]}function g0(i){return/youtube\.com\/shorts\//.test((i??"").trim())}function b0(i){return`https://i.ytimg.com/vi/${i}/hqdefault.jpg`}function v0(i){return`https://www.youtube-nocookie.com/embed/${i}?autoplay=1&rel=0&modestbranding=1`}const ic={items:[],unverified:0,sourced:0};function y0(i,c){var x,v;const o=y=>{const z=i.slice(0,Math.max(0,y)),w=z.split(`
|
||||
`).length,N=y-z.lastIndexOf(`
|
||||
`);return`${w}번째 줄 ${N}번째 글자`},u=(x=/Unexpected token '(.)'/.exec(c))==null?void 0:x[1],f=u==="}"||u==="]"?"닫는 괄호 바로 앞에 쉼표가 하나 더 있는지 보세요.":"그 앞의 쉼표·따옴표·괄호를 확인해 주세요.",d=/line (\d+) column (\d+)/.exec(c);if(d)return`${d[1]}번째 줄 ${d[2]}번째 글자에서 JSON 이 끊깁니다. ${f}`;const h=/position (\d+)/.exec(c);if(h)return`${o(Number(h[1]))}에서 JSON 이 끊깁니다. ${f}`;const p=(v=/\.\.\."([\s\S]*?)" is not valid JSON/.exec(c))==null?void 0:v[1],g=p?i.indexOf(p):-1;return g>=0?`${o(g+p.length)} 부근에서 JSON 이 끊깁니다. ${f}`:"JSON 이 아닙니다. ChatGPT 가 준 답에서 { 로 시작해 } 로 끝나는 부분만 붙여넣어 주세요."}function j0(i,c){const o=p0[i],u=(c??"").trim();if(!o||!u)return ic;let f;try{f=JSON.parse(u)}catch(y){return{...ic,error:y0(u,y instanceof Error?y.message:"")}}if(typeof f!="object"||f===null||Array.isArray(f))return{...ic,error:"바깥이 { } 로 감싸인 JSON 이어야 합니다."};const d=f,h=typeof d.kind=="string"?d.kind:void 0,p=d.items;if(!Array.isArray(p))return{...ic,error:"items 배열이 없습니다. 프롬프트로 다시 만들어 주세요."};const g=p.filter(y=>typeof y=="object"&&y!==null&&!Array.isArray(y)&&typeof y[o]=="string"&&y[o].trim().length>0);let x=0,v=0;for(const y of g){const z=y;z.verified!=="확인"&&(x+=1),z.source&&typeof z.source=="object"&&(v+=1)}return{items:g,title:typeof d.title=="string"?d.title:void 0,subtitle:typeof d.subtitle=="string"?d.subtitle:void 0,linkUrl:typeof d.linkUrl=="string"&&/^https?:\/\//.test(d.linkUrl)?d.linkUrl:void 0,linkLabel:typeof d.linkLabel=="string"?d.linkLabel:void 0,kindMismatch:h&&h!==i?h:void 0,unverified:x,sourced:v}}const N0=1260,S0=60,z0="10:00",Ch=["봄","여름","가을","겨울"];function Mh(i){const c=/^(\d{1,2}):(\d{2})$/.exec(i.trim());if(!c)return;const o=Number(c[1]),u=Number(c[2]);if(!(o>23||u>59))return o*60+u}function cc(i){const c=(i%1440+1440)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`}function E0(i){const c=Mh(i.startTime??"")??Mh(z0)??600,o=[];let u=c,f=0;for(const d of i.stops??[]){const h=Math.max(0,d.moveMinutes??0),p=Math.max(1,d.minutes??S0),g=u+h;if(g+p>N0){f+=1;continue}o.push({stop:d,time:cc(g),until:cc(g+p),move:h}),u=g+p}return{stops:o,from:cc(c),to:cc(u),totalMinutes:u-c,dropped:f}}function w0(i=new Date){const c=i.getMonth()+1,o=Math.floor((c-3+12)%12/3),u=Ch[o];return c%3===0&&i.getDate()<=15?[Ch[(o+3)%4],u]:[u]}function kh(i){const c=parseInt(i.replace("#",""),16);return[c>>16&255,c>>8&255,c&255]}function Oh(i,c,o){if(!/^#[0-9a-fA-F]{6}$/.test(i)||!/^#[0-9a-fA-F]{6}$/.test(c))return i;const[u,f,d]=kh(i),[h,p,g]=kh(c),x=(y,z)=>Math.round(y+(z-y)*o),v=y=>y.toString(16).padStart(2,"0");return`#${v(x(u,h))}${v(x(f,p))}${v(x(d,g))}`}function T0(i){return{surface:Oh(i.bg,i.text,.06),surfaceAlt:i.card,inverse:"#1c1917",border:Oh(i.bg,i.text,.2)}}const vp={[Ma.LODGING]:{type:"HotelRoom",path:"rooms",label:"객실"},[Ma.CAFE]:{type:"MenuItem",path:"menu",label:"메뉴"},[Ma.RESTAURANT]:{type:"MenuItem",path:"menu",label:"메뉴"},[Ma.CLINIC]:{type:"Product",path:"programs",label:"시술"}};function A0(i){return i.links.filter(c=>c.confirmed&&/^https?:\/\//i.test(c.url??""))}function yp(i){var c;for(const[o,u]of[["weekday_price","주중 1박"],["price","1박"],["weekend_price","주말 1박"],["peak_price","성수기 1박"]]){const f=Number((c=ca(i.facts,o))==null?void 0:c.replace(/[^0-9]/g,""));if(Number.isFinite(f)&&f>0)return{price:f,label:u}}}const Dh=[bt.NAVER_BOOKING,bt.YANOLJA,bt.GOODCHOICE,bt.NAVER_PLACE];function dc(i){return Bs(i.facts).filter(c=>c.scope==="place").map(c=>({label:Po(c),value:tu(c,i.facts)})).filter(c=>c.value!=="")}function tu(i,c){const o=At(c,i.key);return o?i.type!=="bool"?o:/여부$/.test(i.label)?o==="true"?"있음":o==="false"?"없음":o:o==="true"?"가능":o==="false"?"불가":o:""}const _0=new Set(["weekday_price","weekend_price","peak_price","price_range"]);function fl(i){const c=vp[i.place.category],o=new Map(i.media.map(u=>[u.mediaId,u]));return eu(i.units).map(u=>{const f=At(u.facts,"room_intro")??At(u.facts,"description"),d=i.place.category===Ma.LODGING?["standard_capacity","max_capacity","bed_type","room_size"]:["price","volume","origin"];return{unitId:u.unitId,slug:u.slug,name:u.name,intro:f,chips:d.map(h=>{var x;const p=At(u.facts,h),g=((x=u.facts.find(v=>v.key===h))==null?void 0:x.label)??h;return p?{label:g,value:p}:null}).filter(h=>h!==null),rows:u.facts.filter(h=>!_0.has(h.key)).map(h=>({label:Po(h),value:tu(h,u.facts)})).filter(h=>h.value!==""),images:u.mediaIds.map(h=>o.get(h)).filter(h=>{var p;return!!((p=h==null?void 0:h.alt)!=null&&p.trim())}),priceText:C0(u),prices:k0(u),href:`/${c.path}/${u.slug}`}})}function C0(i){var d,h;const c=At(i.facts,"price_range");if(c)return c;const o=Number((d=At(i.facts,"weekday_price"))==null?void 0:d.replace(/[^0-9]/g,"")),u=Number((h=At
Line truncated
|
||||
.stay2-hero-slide { animation: stay2-hero-fade ${c}s ease-in-out infinite; }
|
||||
@keyframes stay2-hero-fade {
|
||||
0% { opacity: 1; }
|
||||
${o(rc)} { opacity: 1; }
|
||||
${o(rc+Xo)} { opacity: 0; }
|
||||
${o(c-Xo)} { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}`}
|
||||
.stay2-hero-focus { animation: stay2-hero-focus 1.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
|
||||
@keyframes stay2-hero-focus {
|
||||
0% { opacity: 0; filter: blur(0.22em); }
|
||||
40% { opacity: 1; }
|
||||
100% { opacity: 1; filter: blur(0); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.stay2-hero-slide, .stay2-hero-focus { animation: none; }
|
||||
}
|
||||
`}function rv(i,c){return((c-i)%c*rc+Xo).toFixed(1)}function ov(){const i=le(),{place:c,narrative:o}=i,u=ft(i),f=Ze(i)[0],d=o.tagline??o.heroSubline,h=[...i.media].filter(x=>{var v;return(v=x.alt)==null?void 0:v.trim()}).sort((x,v)=>Number(v.isPrimary)-Number(x.isPrimary)),p=h.length<2?0:Math.min(h.length,iv),g=f?{href:f.url,label:`${ks(f)}에서 예약`,external:!0}:c.phone?{href:`tel:${c.phone}`,label:`${c.phone} 예약 문의`,external:!1}:i.units.length>0?{href:"#units",label:`${u.label} 보기`,external:!1}:null;return n.jsxs("section",{id:"top",className:"w-full",children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:cv(p)}}),n.jsxs("div",{className:"relative flex w-full items-center justify-center overflow-hidden",style:{backgroundColor:"var(--tpl-inverse, #1c1917)",color:"var(--tpl-bg, #ffffff)",height:"100svh"},children:[h.map((x,v)=>n.jsx("img",{src:x.url,alt:x.alt,fetchPriority:v===0?"high":v<p?"auto":"low",loading:v<Math.max(p,1)?void 0:"lazy",decoding:"async",width:x.width,height:x.height,className:`absolute inset-0 size-full object-cover object-center ${v<p?"stay2-hero-slide":""}`,style:{opacity:v===0?1:0,animationDelay:v<p?`-${rv(v,p)}s`:void 0}},x.mediaId)),n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(to bottom, color-mix(in srgb, var(--tpl-inverse, #1c1917) 16%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 14%, transparent) 40%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 34%, transparent) 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-48",style:{background:"linear-gradient(to bottom, color-mix(in srgb, var(--tpl-inverse, #1c1917) 68%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 40%, transparent) 45%, transparent 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 58% 42% at 50% 52%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 38%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 18%, transparent) 55%, transparent 78%)"}}),n.jsxs("div",{className:"shell relative z-10 flex flex-col items-center pt-20 text-center",style:{textShadow:"0 1px 3px color-mix(in srgb, var(--tpl-inverse, #1c1917) 55%, transparent)"},children:[n.jsx("h1",{className:"stay2-hero-focus serif",style:{fontSize:"var(--fs-display)",fontWeight:300,letterSpacing:"0.06em",lineHeight:1.25,animationDelay:"0.05s"},children:c.name}),d&&n.jsx("p",{className:"stay2-hero-focus measure mt-6 text-[length:var(--fs-lead)] font-light leading-loose opacity-95",style:{animationDelay:"0.3s"},children:d}),g&&n.jsx("a",{href:g.href,...g.external?{target:"_blank",rel:"noopener noreferrer"}:{},className:"stay2-hero-focus tap mt-10 inline-flex items-center justify-center border border-current/70 px-9 text-[length:var(--fs-sm)] font-light tracking-[0.14em] transition-colors hover:border-current",style:{animationDelay:"0.55s",backgroundColor:"color-mix(in srgb, var(--tpl-inverse, #1c1917) 22%, transparent)",boxShadow:"0 1px 6px color-mix(in srgb, var(--tpl-inverse, #1c1917) 30%, transparent)"},children:g.label})]})]})]})}function uv(){const i=le(),{place:c,narrative:o}=i,u=mc(i),f=En(i),d=Ze(i),h=Oa(i),p=h.length>0?h:dc(i).slice(0,4),g=(u==null?void 0:u.caption)??c.name;return n.jsxs("section",{id:"top","data-oasi":!0,"aria-labelledby":"top-heading",className:"pt-12 lg:pt-16",children:[n.jsx("h1",{id:"top-heading",className:"text-[length:var(--fs-sm)] font-normal tracking-[0.08em] leading-[1.9]",children:c.name}),o.heroHeadline&&n.jsx("p",{className:"text-muted measure mt-3 text-[length:var(--fs-xs)] leading-[1.9]",children:o.heroHeadline}),u&&n.jsxs("figure",{className:"relative mx-auto mt-10 w-full max-w-[34rem]",children:[n.jsx("img",{src:u.url,alt:u.alt,fetchPriority:"high",decoding:"async",width:u.width,height:u.height,className:"block h-[clamp(17rem,27vw,24rem)] w-full object-cover"}),n.jsx("figcaption",{className:"text-muted absolute left-full top-0 ml-5 hidden max-h-full overflow-hidden text-ellipsis whitespace-nowrap text-[length:var(--fs-xs)] tracking-[0.14em] xl:block",style:{writingMode:"vertical-rl"},children:g})]}),(f||p.length>0)&&n.jsxs("dl",{className:"border-line mt-10 flex flex-wrap gap-x-10 gap-y-4 border-t pt-5 text-[length:var(--fs-xs)] leading-[1.9]",children:[f&&n.jsxs("div",{children:[n.jsx("dt",{className:"text-muted",children:"최저가"}),n.jsx("dd",{children:f})]}),p.map(x=>n.jsxs("div",{children:[n.jsx("dt",{className:"text-muted",children:x.label}),n.jsx("dd",{children:x.value})]},x.label))]}),d.length>0&&n.jsx("ul",{className:"mt-6 flex flex-wrap items-center gap-x-8",children:d.map(x=>n.jsx("li",{children:n.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:"tap inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]",style:{color:"var(--color-brand)"},children:ht(x)})},x.url))})]})}function fv(){const i=le(),c=lu(i),o=mc(i),u=o&&c.some(f=>f.mediaId===o.mediaI
Line truncated
|
||||
.oasi-page main > section:not([data-oasi]) {
|
||||
background-color: transparent !important;
|
||||
background-image: none !important;
|
||||
border-color: transparent !important;
|
||||
color: var(--tpl-text) !important;
|
||||
padding-block: var(--oasi-gap) 0 !important;
|
||||
}
|
||||
.oasi-page main > section:not([data-oasi]) .shell {
|
||||
max-width: none;
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#about > .shell > .grid {
|
||||
display: block;
|
||||
}
|
||||
.oasi-page main > section#about > .shell > .grid > * + * {
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
.oasi-page main > section#summary dl {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
/*
|
||||
* 붙여넣기 아이템 카드 — 소식 · 영상 · 추천 일정 (2026-09-04, 사장님: "1,2,3안 다 맞추세요")
|
||||
*
|
||||
* ★ 이 카드들은 .panel 이 아니라 제 인라인 style 로 면을 그린다(items/common.tsx 의
|
||||
* ITEM_CARD·ITEM_BORDER). 그래서 위 .panel 규칙이 안 닿았고, 섹션 띠를 다 지운 3안에서
|
||||
* **소식 카드만 갱지 결에 2px 테두리를 두른 상자로 혼자 서 있었다.**
|
||||
* ★ w4-paper 의 결은 1안(레트로 갱지)의 것이다. 여기서는 결을 지우고 테두리를 실선 한 겹으로
|
||||
* 낮춘다. 상자를 아예 없애지는 않는다 — 전단 여섯 장이 경계 없이 붙으면 어디까지가 한 장인지
|
||||
* 안 보인다. 면은 빼고 테두리만 남기는 게 이 안의 타협점이다.
|
||||
* ★ 배경은 transparent 로 두지 않는다. 사진 없는 공지 카드가 종이에 바로 얹히면
|
||||
* 본문과 구분이 사라진다 — 아주 옅은 틴트 한 겹만 남긴다.
|
||||
* ★ 영상은 뺐다 (2026-09-04, 사장님: "영상 border 안 예쁘다")
|
||||
* 영상 카드는 상자가 아니라 **표지 사진 한 장**이고, 쇼츠라 9:16 세로다. li 에 틴트를 깔면
|
||||
* 영상보다 넓은 회색 판이 뒤에 깔려 액자처럼 보인다. 사진은 제 테두리가 곧 경계다.
|
||||
*/
|
||||
.oasi-page section#event li,
|
||||
.oasi-page section#itinerary article {
|
||||
background-image: none !important;
|
||||
background-color: color-mix(in oklab, currentcolor 3%, transparent) !important;
|
||||
border-width: 1px !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.oasi-page .panel,
|
||||
.oasi-page .panel-sunken {
|
||||
background-color: transparent;
|
||||
border-width: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.oasi-page main > section#faq > .shell > div:last-of-type {
|
||||
row-gap: 0;
|
||||
column-gap: 2.5rem;
|
||||
}
|
||||
.oasi-page main > section#faq details {
|
||||
margin-block: 0;
|
||||
border-top: 1px solid var(--site-line);
|
||||
}
|
||||
.oasi-page main > section#faq summary {
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#faq summary > span:first-child {
|
||||
width: 1.125rem;
|
||||
}
|
||||
.oasi-page main > section#faq summary + div {
|
||||
border-top-width: 0;
|
||||
padding-inline: 1.875rem 0;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.oasi-page main > section#info dl.panel > div {
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#info dl > div.panel {
|
||||
border-top: 1px solid var(--site-line);
|
||||
padding-inline: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#location .panel {
|
||||
border-top: 1px solid var(--site-line);
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#weather .panel {
|
||||
padding-inline: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#guide .panel > span:last-child {
|
||||
padding-inline: 0;
|
||||
}
|
||||
@media (min-width: 40rem) {
|
||||
.oasi-page main > section#festival .panel > span:last-child {
|
||||
padding-inline: 0;
|
||||
}
|
||||
}
|
||||
`,o1={"--oasi-gap":"clamp(3.5rem, 7vw, var(--tpl-section-space, 4rem))",backgroundColor:"var(--tpl-bg)",color:"var(--tpl-text)"};function u1({children:i}){var v,y,z,w;const c=le(),{place:o}=c,u=ft(c),f=Ze(c)[0],d=wn(c),h=[{label:"처음",href:"#top",show:!0},{label:"소개",href:"#about",show:Kt(c,"intro")},{label:u.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"자주 묻는 질문",href:"#faq",show:c.faqs.length>0}].filter(N=>N.show),p=[...Oa(c).map(N=>`${N.label} ${N.value}`),...c.theme.sections.filter(N=>{var A;return N.enabled&&((A=N.name)==null?void 0:A.trim())}).map(N=>N.name.trim())].slice(0,3),g=c.narrative.tagline??c.narrative.heroSubline,x=o.roadAddress??o.address;return n.jsxs("div",{className:"oasi-page flex min-h-screen w-full flex-col",style:o1,children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:r1}}),n.jsxs("div",{className:"mx-auto flex w-full max-w-[72rem] flex-col gap-10 px-5 pb-16 pt-10 lg:flex-row lg:gap-14 lg:px-10 lg:pb-24 lg:pt-16",children:[n.jsxs("header",{className:"lg:sticky lg:top-12 lg:h-fit lg:w-[18.75rem] lg:shrink-0",children:[n.jsxs("a",{href:"#top",className:"block",children:[n.jsx("span",{className:"serif block leading-none",style:{fontSize:"var(--fs-display)",fontWeight:300,letterSpacing:"0.14em"},children:o.name}),o.englishName&&n.jsx("span",{className:"text-muted mt-3 block text-[length:var(--fs-xs)] tracking-[0.24em]",children:o.englishName})]}),n.jsx("nav",{"aria-label":"주요 메뉴",className:"mt-12 lg:mt-24",children:n.jsx("ul",{className:"flex flex-wrap items-center gap-x-6 gap-y-1 lg:block",children:h.map((N,A)=>n.jsx("li",{children:n.jsx("a",{href:N.href,"aria-current":A===0?"true":void 0,className:`tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 ${A===0?"":"text-muted"}`,children:N.label})},N.label))})}),f&&n.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"tap mt-2 inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]",style:{color:"var(--color-brand)"},children:ht(f)})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[(p.length>0||g)&&n.jsxs("div",{className:"border-line flex flex-col gap-3 border-y py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[p.length>0&&n.jsx("ul",{className:"text-muted flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 text-[length:var(--fs-xs)]",children:p.map((N,A)=>n.jsxs("li",{className:"flex items-center gap-4",children:[A>0&&n.jsx("span",{"aria-hidden":!0,className:"opacity-40",children:"|"}),n.jsx("span",{children:N})]},N))}),g&&n.jsx("p",{className:"text-muted measure shrink-0 text-[length:var(--fs-xs)] leading-[1.9] sm:max-w-[18rem] sm:text-right",children:g})]}),i]})]}),n.jsx("footer",{className:"border-line mt-auto w-full border-t",children:n.jsxs("div",{className:"mx-auto grid w-full max-w-[72rem] grid-cols-1 gap-8 px-5 pb-28 pt-10 text-[length:var(--fs-xs)] leading-[1.9] sm:grid-cols-3 lg:px-10 lg:pb-14",children:[n.jsxs("p",{children:["[",o.name,"]"]}),d.length>0?n.jsx("ul",{className:"space-y-1",children:d.map(N=>n.jsx("li",{children:n.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-[5px]",children:ks(N)})},N.url))}):n.jsx("span",{}),n.jsxs("div",{className:"text-muted space-y-1 sm:text-right",children:[x&&n.jsx("p",{children:x}),o.phone&&n.jsx("p",{children:n.jsx("a",{href:`tel:${o.phone}`,className:"underline underline-offset-[5px]",children:o.phone})}),o.email&&n.jsx("p",{children:o.email}),((v=o.legal)==null?void 0:v.representative)&&n.jsxs("p",{children:["대표 ",o.legal.representative]}),((y=o.legal)==null?void 0:y.businessRegistrationNumber)&&n.jsxs("p",{children:["사업자등록번호 ",o.legal.businessRegistrationNumber]}),((z=o.legal)==null?void 0:z.mailOrderNumber)&&n.jsxs("p",{children:["통신판매업신고 ",o.legal.mailOrderNumber]}),((w=o.legal)==null?void 0:w.licenseNumber)&&n.jsxs("p",{children:[o.legal.licenseLabel??"인허가번호"," ",o.legal.licenseNumber]}),n.jsxs("p",{className:"byline",children:[n.jsxs("span",{className:"author",children:["작성·운영 ",o.name]})," · 최종 업데이트: ",n.jsx("time",{dateTime:c.site.updatedAt,children:qs(c.site.updatedAt)})]})]})]})}),n.jsx(Tn,{})]})}function f1({children:i}){var z,w,N,A;const c=le(),{place:o,narrative:u,site:f}=c,d=ft(c),h=En(c),p=Oa(c),g=Ze(c)[0],x=c.links.filter(D=>D.confirmed),v=o.roadAddress??o.address,y=[{label:"소개",href:"#about",show:Kt(c,"intro")},{label:d.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변 정보",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"자주 묻는 질문",href:"#faq",show:c.faqs.length>0}].filter(D=>D.show);return n.jsxs("div",{className:"flex min-h-screen w-f
Line truncated
|
||||
.pastel-page > main > section:not([data-pastel]) {
|
||||
border-color: transparent;
|
||||
background-image: none;
|
||||
color: var(--pastel-ink) !important;
|
||||
}
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+1) { background-color: var(--pastel-1) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+2) { background-color: var(--pastel-soft) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+3) { background-color: var(--pastel-2) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n) { background-color: var(--pastel-3) !important; }
|
||||
`,m1={"--pastel-1":"var(--tpl-card)","--pastel-2":"var(--tpl-accent)","--pastel-3":"var(--tpl-secondary)","--pastel-soft":"var(--tpl-bg)","--pastel-ink":"var(--tpl-text)","--section-space":"clamp(2.75rem, 8vw, calc(var(--tpl-section-space, 4rem) * 1.4))",backgroundColor:"var(--pastel-soft)",color:"var(--pastel-ink)"};function h1({children:i}){const c=le(),o=ft(c),u=wn(c),f=[{label:"소개",href:"#about",show:Kt(c,"intro")},{label:o.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"FAQ",href:"#faq",show:c.faqs.length>0}].filter(d=>d.show);return n.jsxs("div",{className:"pastel-page flex min-h-screen w-full flex-col",style:m1,children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:d1}}),n.jsx("header",{className:"sticky top-0 z-40 w-full",style:{backgroundColor:"color-mix(in srgb, var(--tpl-surface, #fff) 92%, transparent)"},children:n.jsxs("div",{className:"shell flex h-16 items-center justify-between gap-3",children:[n.jsx("a",{href:"#top",className:"flex min-w-0 items-center gap-2",children:n.jsx("span",{className:"serif truncate italic",style:{fontSize:"var(--fs-lead)",fontWeight:800,display:"inline-block",transform:"rotate(-1.5deg)"},children:c.place.name})}),n.jsx("nav",{"aria-label":"주요 메뉴",className:"hidden items-center gap-8 lg:flex",children:f.map(d=>n.jsx("a",{href:d.href,className:"py-1 text-[length:var(--fs-xs)] font-bold tracking-[0.2em] opacity-70 transition-opacity hover:opacity-100",children:d.label},d.label))}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.place.phone&&n.jsx("a",{href:`tel:${c.place.phone}`,"aria-label":"전화",className:"tap flex items-center justify-center rounded-full",style:{backgroundColor:"var(--pastel-1)"},children:n.jsx(_t,{className:"size-4"})}),u.map(d=>n.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer","aria-label":ml(d),className:"tap flex items-center justify-center rounded-full",style:{backgroundColor:"var(--pastel-2)"},children:/instagram/i.test(d.url)?n.jsx(Ub,{className:"size-4"}):n.jsx(Io,{className:"size-4"})},d.url)),n.jsxs("details",{className:"relative lg:hidden",children:[n.jsx("summary",{className:"tap flex cursor-pointer items-center justify-center rounded-full marker:content-none [&::-webkit-details-marker]:hidden","aria-label":"메뉴 열기",children:n.jsx(hp,{className:"size-5"})}),n.jsx("nav",{"aria-label":"전체 메뉴",className:"absolute right-0 top-[calc(100%+0.5rem)] z-50 w-48 overflow-hidden rounded-2xl",style:{backgroundColor:"var(--tpl-surface, #fff)",boxShadow:"0 10px 30px rgb(0 0 0 / 0.12)"},children:n.jsx("ul",{children:f.map(d=>n.jsx("li",{children:n.jsx("a",{href:d.href,className:"tap flex items-center px-4 text-[length:var(--fs-sm)] font-bold tracking-[0.08em]",children:d.label})},d.label))})})]})]})]})}),i,n.jsx("div",{style:{"--tpl-inverse":"var(--pastel-3)","--tpl-bg":"var(--pastel-ink)"},children:n.jsx(Op,{})}),n.jsx(Tn,{})]})}function p1({children:i}){var x,v,y,z;const c=le(),{place:o,site:u}=c,f=Ep(),d=x1(f),h=Ze(c)[0],p=c.links.filter(w=>w.confirmed),g=o.roadAddress??o.address;return n.jsxs("div",{className:"flex min-h-screen w-full flex-col",style:{backgroundColor:"var(--tpl-bg)",color:"var(--tpl-text)"},children:[n.jsx("header",{className:"sticky top-0 z-40 w-full border-b-2 backdrop-blur-md",style:{backgroundColor:"color-mix(in srgb, var(--tpl-bg) 90%, transparent)",borderColor:"var(--tpl-text)"},children:n.jsxs("div",{className:"flex h-14 items-center justify-between gap-4 px-4 sm:px-6 xl:px-8",children:[n.jsx("a",{href:"#top",className:"serif min-w-0 truncate text-[length:var(--fs-lead)] font-extrabold",children:o.name}),n.jsxs("div",{className:"flex shrink-0 items-center gap-4 text-[length:var(--fs-sm)]",children:[o.phone&&n.jsx("a",{href:`tel:${o.phone}`,className:"tap inline-flex items-center underline underline-offset-4",children:o.phone}),h&&n.jsx("a",{href:h.url,target:"_blank",rel:"noopener noreferrer",className:"tap inline-flex items-center font-bold underline underline-offset-4",children:ht(h)})]})]})}),n.jsxs("div",{className:"flex w-full flex-1",children:[f.length>0&&n.jsx("aside",{className:"border-line sticky top-14 hidden h-[calc(100vh-3.5rem)] w-44 shrink-0 self-start border-r xl:block",style:{backgroundImage:Os},children:n.jsx("nav",{"aria-label":"차례",className:"flex h-full flex-col justify-center gap-0.5 py-8 pl-6 pr-3",children:f.map(w=>{const N=w.anchor===d;return n.jsxs("a",{href:`#${w.anchor}`,"aria-current":N?"true":void 0,className:"flex items-baseline gap-2 py-2 text-[length:var(--fs-sm)] leading-tight motion-safe:transition-opacity",style:{opacity:N?1:.35},children:[n.jsx("span",{className:"shrink-0 text-[length:var(--fs-xs)] font-bold tabular-nums",children:w.no}),n.jsx("span",{className:"truncate",style:{fontWeight:N?700:400},children:w.label})]},w.anchor)})})}),n.jsx("div",{className:"flex min-w-0
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
#w4d-mini{display:inline-flex;align-items:center;gap:2px;margin-right:6px;padding-right:8px;border-right:1px solid var(--tpl-border, #bcb49e)}#w4d-mini button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;color:var(--tpl-text, #1b1a15);background:transparent;border:0;border-radius:var(--tpl-radius, 0);cursor:pointer;opacity:.75}#w4d-mini button:hover{opacity:1;background:#1b1a150f}#w4d-mini svg{width:16px;height:16px}#w4d-now{max-width:150px;overflow:hidden;font-size:11.5px;font-weight:700;white-space:nowrap;text-overflow:ellipsis;color:var(--tpl-accent, #bf2f1b);padding-right:2px}#w4d-mini[data-playing="0"] #w4d-now{opacity:.55;font-weight:400}@media(max-width:860px){#w4d-now{display:none}}#w4d-tape{display:inline-flex;align-items:center;padding:0 4px 0 2px;color:var(--tpl-text, #1b1a15);opacity:.8}#w4d-tape svg{width:20px;height:20px}#w4d-mini[data-playing="1"] #w4d-tape{color:var(--tpl-accent, #bf2f1b);opacity:1}#w4d-mini[data-playing="1"] .w4d-reel{transform-box:fill-box;transform-origin:center;animation:w4d-reel 2.6s linear infinite}@keyframes w4d-reel{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.w4d-reel{animation:none!important}}#w4d-mini button[data-playing="1"]{color:var(--tpl-accent, #bf2f1b);opacity:1}@media(max-width:400px){#w4d-mini{margin-right:2px;padding-right:4px}#w4d-mini button{width:27px;height:27px}}#w4d-panel{position:fixed;z-index:45;width:344px;max-width:calc(100vw - 16px);max-height:min(64vh,520px);display:flex;flex-direction:column;overflow:hidden;font-family:var(--tpl-font-body, serif);color:var(--tpl-text, #1b1a15);background:var(--tpl-card, #efe7d3);border:var(--tpl-border-width, 2px) solid var(--tpl-primary, #1b1a15);box-shadow:var(--tpl-shadow, 4px 4px 0 rgb(27 26 21 / .16))}#w4d-panel[hidden]{display:none}@media(max-width:640px){#w4d-panel{width:auto}}#w4d-panel .w4d-head{display:flex;align-items:center;gap:8px;flex:0 0 auto;padding:11px 8px 11px 14px;border-bottom:var(--tpl-border-width, 2px) solid var(--tpl-primary, #1b1a15)}.w4d-head-t{font-size:12px;font-weight:700;letter-spacing:.06em}.w4d-head-n{flex:1 1 auto;font-size:11px;opacity:.5}#w4d-panel .w4d-head button{display:inline-flex;width:28px;height:28px;flex:0 0 auto;align-items:center;justify-content:center;color:inherit;background:transparent;border:0;cursor:pointer;opacity:.6}#w4d-panel .w4d-head button:hover{opacity:1}#w4d-panel .w4d-head svg{width:14px;height:14px}#w4d-panel ol{flex:1 1 auto;margin:0;padding:4px 0;overflow-y:auto;list-style:none;-webkit-overflow-scrolling:touch}.w4d-item{display:flex;width:100%;min-height:52px;align-items:center;gap:11px;padding:8px 14px;color:inherit;background:transparent;border:0;font:inherit;text-align:left;cursor:pointer}.w4d-item+.w4d-item{border-top:1px dashed var(--tpl-border, #bcb49e)}.w4d-item:hover{background:#1b1a150d}.w4d-item[aria-current=true]{background:#1b1a150f}.w4d-item[aria-current=true] .w4d-t{color:var(--tpl-accent, #bf2f1b)}.w4d-mark{position:relative;flex:0 0 26px;height:26px}.w4d-disc-sm{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:radial-gradient(circle at 50% 50%,var(--w4d-lbl, #bf2f1b) 0 34%,transparent 34%),repeating-radial-gradient(circle at 50% 50%,rgb(255 255 255 / .12) 0 1px,transparent 1px 3px),#14110f}.w4d-disc-sm:after{content:"";position:absolute;top:45%;right:45%;bottom:45%;left:45%;border-radius:50%;background:var(--tpl-card, #efe7d3)}.w4d-eq{position:absolute;top:0;right:0;bottom:0;left:0;display:none;align-items:flex-end;justify-content:center;gap:3px;padding-bottom:4px}.w4d-eq i{width:3px;height:6px;background:var(--tpl-accent, #bf2f1b);animation:w4d-eq .9s ease-in-out infinite}.w4d-eq i:nth-child(2){animation-delay:.18s}.w4d-eq i:nth-child(3){animation-delay:.36s}@keyframes w4d-eq{0%,to{height:5px}50%{height:17px}}.w4d-item[data-playing="1"] .w4d-disc-sm{display:none}.w4d-item[data-playing="1"] .w4d-eq{display:flex}@media(prefers-reduced-motion:reduce){.w4d-eq i{animation:none;height:11px}}.w4d-info{min-width:0;flex:1 1 auto}.w4d-t{display:block;overflow:hidden;font-size:13.5px;font-weight:700;white-space:nowrap;text-overflow:ellipsis}.w4d-sub{display:block;margin-top:2px;overflow:hidden;font-size:11px;white-space:nowrap;text-overflow:ellipsis;opacity:.55}.w4d-time{flex:0 0 auto;font-size:11px;opacity:.6;font-variant-numeric:tabular-nums}#w4d-lyrics-box{padding:10px 12px 14px;border-top:1px dashed var(--tpl-border, #bcb49e);white-space:pre-line;font-size:12px;line-height:1.9;overflow-y:auto}#w4d-lyrics-box[hidden]{display:none}.w4-sky{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;overflow:hidden}.w4-sky[data-mood=비]:before{content:"";position:absolute;top:-20%;right:-10%;bottom:-20%;left:-10%;background-image:repeating-linear-gradient(102deg,transparent 0 9px,currentcolor 9px 10px,transparent 10px 22px);opacity:.13;animation:w4-rain .9s linear infinite}@keyframes w4-rain{to{transform:translate3d(-22px,108px,0)}}Line truncated
|
||||
File renamed without changes.
@@ -0,0 +1,340 @@
|
||||
(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function o(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(f){if(f.ep)return;f.ep=!0;const d=o(f);fetch(f.href,d)}})();const Pg="modulepreload",eb=function(i){return"/"+i},xh={},tb=function(c,o,u){let f=Promise.resolve();if(o&&o.length>0){let h=function(x){return Promise.all(x.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));f=h(o.map(x=>{if(x=eb(x),x in xh)return;xh[x]=!0;const v=x.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${y}`))return;const z=document.createElement("link");if(z.rel=v?"stylesheet":Pg,v||(z.as="script"),z.crossOrigin="",z.href=x,g&&z.setAttribute("nonce",g),document.head.appendChild(z),v)return new Promise((w,N)=>{z.addEventListener("load",w),z.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${x}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return f.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return c().catch(d)})};var Mo={exports:{}},zs={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var gh;function lb(){if(gh)return zs;gh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function o(u,f,d){var h=null;if(d!==void 0&&(h=""+d),f.key!==void 0&&(h=""+f.key),"key"in f){d={};for(var p in f)p!=="key"&&(d[p]=f[p])}else d=f;return f=d.ref,{$$typeof:i,type:u,key:h,ref:f!==void 0?f:null,props:d}}return zs.Fragment=c,zs.jsx=o,zs.jsxs=o,zs}var bh;function ab(){return bh||(bh=1,Mo.exports=lb()),Mo.exports}var n=ab(),ko={exports:{}},ue={};/**
|
||||
* @license React
|
||||
* react.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var vh;function nb(){if(vh)return ue;vh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),z=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=z&&S[z]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,D={};function U(S,L,V){this.props=S,this.context=L,this.refs=D,this.updater=V||N}U.prototype.isReactComponent={},U.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},U.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function X(){}X.prototype=U.prototype;function Z(S,L,V){this.props=S,this.context=L,this.refs=D,this.updater=V||N}var P=Z.prototype=new X;P.constructor=Z,A(P,U.prototype),P.isPureReactComponent=!0;var $=Array.isArray;function K(){}var G={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function se(S,L,V){var J=V.ref;return{$$typeof:i,type:S,key:L,ref:J!==void 0?J:null,props:V}}function Q(S,L){return se(S.type,L,S.props)}function ae(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function ye(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(V){return L[V]})}var Ge=/\/+/g;function Qe(S,L){return typeof S=="object"&&S!==null&&S.key!=null?ye(""+S.key):L.toString(36)}function ce(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(K,K):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,L,V,J,re){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var oe=!1;if(S===null)oe=!0;else switch(fe){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(S.$$typeof){case i:case c:oe=!0;break;case v:return oe=S._init,k(oe(S._payload),L,V,J,re)}}if(oe)return re=re(S),oe=J===""?"."+Qe(S,0):J,$(re)?(V="",oe!=null&&(V=oe.replace(Ge,"$&/")+"/"),k(re,L,V,"",function(at){return at})):re!=null&&(ae(re)&&(re=Q(re,V+(re.key==null||S&&S.key===re.key?"":(""+re.key).replace(Ge,"$&/")+"/")+oe)),L.push(re)),1;oe=0;var ze=J===""?".":J+":";if($(S))for(var Ee=0;Ee<S.length;Ee++)J=S[Ee],fe=ze+Qe(J,Ee),oe+=k(J,L,V,fe,re);else if(Ee=w(S),typeof Ee=="function")for(S=Ee.call(S),Ee=0;!(J=S.next()).done;)J=J.value,fe=ze+Qe(J,Ee++),oe+=k(J,L,V,fe,re);else if(fe==="object"){if(typeof S.then=="function")return k(ce(S),L,V,J,re);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return oe}function Y(S,L,V){if(S==null)return S;var J=[],re=0;return k(S,J,"","",function(fe){return L.call(V,fe,re++)}),J}function te(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(V){(S._status===0||S._status===-1)&&(S._status=1,S._result=V)},function(V){(S._status===0||S._status===-1)&&(S._status=2,S._result=V)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var he=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},je={map:Y,forEach:function(S,L,V){Y(S,function(){L.apply(this,arguments)},V)},count:function(S){var L=0;return Y(S,function(){L++}),L},toArray:function(S){return Y(S,function(L){return L})||[]},only:function(S){if(!ae(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=y,ue.Children=je,ue.Component=U,ue.Fragment=o,ue.Profiler=f,ue.PureComponent=Z,ue.StrictMode=u,ue.Suspense=g,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return G.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,L,V){if(S==null)throw ErroLine truncated
|
||||
* @license React
|
||||
* scheduler.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var jh;function sb(){return jh||(jh=1,(function(i){function c(k,Y){var te=k.length;k.push(Y);e:for(;0<te;){var he=te-1>>>1,je=k[he];if(0<f(je,Y))k[he]=Y,k[te]=je,te=he;else break e}}function o(k){return k.length===0?null:k[0]}function u(k){if(k.length===0)return null;var Y=k[0],te=k.pop();if(te!==Y){k[0]=te;e:for(var he=0,je=k.length,S=je>>>1;he<S;){var L=2*(he+1)-1,V=k[L],J=L+1,re=k[J];if(0>f(V,te))J<je&&0>f(re,V)?(k[he]=re,k[J]=te,he=J):(k[he]=V,k[L]=te,he=L);else if(J<je&&0>f(re,te))k[he]=re,k[J]=te,he=J;else break e}}return Y}function f(k,Y){var te=k.sortIndex-Y.sortIndex;return te!==0?te:k.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();i.unstable_now=function(){return h.now()-p}}var g=[],x=[],v=1,y=null,z=3,w=!1,N=!1,A=!1,D=!1,U=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function P(k){for(var Y=o(x);Y!==null;){if(Y.callback===null)u(x);else if(Y.startTime<=k)u(x),Y.sortIndex=Y.expirationTime,c(g,Y);else break;Y=o(x)}}function $(k){if(A=!1,P(k),!N)if(o(g)!==null)N=!0,K||(K=!0,ye());else{var Y=o(x);Y!==null&&ce($,Y.startTime-k)}}var K=!1,G=-1,ee=5,se=-1;function Q(){return D?!0:!(i.unstable_now()-se<ee)}function ae(){if(D=!1,K){var k=i.unstable_now();se=k;var Y=!0;try{e:{N=!1,A&&(A=!1,X(G),G=-1),w=!0;var te=z;try{t:{for(P(k),y=o(g);y!==null&&!(y.expirationTime>k&&Q());){var he=y.callback;if(typeof he=="function"){y.callback=null,z=y.priorityLevel;var je=he(y.expirationTime<=k);if(k=i.unstable_now(),typeof je=="function"){y.callback=je,P(k),Y=!0;break t}y===o(g)&&u(g),P(k)}else u(g);y=o(g)}if(y!==null)Y=!0;else{var S=o(x);S!==null&&ce($,S.startTime-k),Y=!1}}break e}finally{y=null,z=te,w=!1}Y=void 0}}finally{Y?ye():K=!1}}}var ye;if(typeof Z=="function")ye=function(){Z(ae)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Qe=Ge.port2;Ge.port1.onmessage=ae,ye=function(){Qe.postMessage(null)}}else ye=function(){U(ae,0)};function ce(k,Y){G=U(function(){k(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(k){k.callback=null},i.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<k?Math.floor(1e3/k):5},i.unstable_getCurrentPriorityLevel=function(){return z},i.unstable_next=function(k){switch(z){case 1:case 2:case 3:var Y=3;break;default:Y=z}var te=z;z=Y;try{return k()}finally{z=te}},i.unstable_requestPaint=function(){D=!0},i.unstable_runWithPriority=function(k,Y){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var te=z;z=k;try{return Y()}finally{z=te}},i.unstable_scheduleCallback=function(k,Y,te){var he=i.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?he+te:he):te=he,k){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=te+je,k={id:v++,callback:Y,priorityLevel:k,startTime:te,expirationTime:je,sortIndex:-1},te>he?(k.sortIndex=te,c(x,k),o(g)===null&&k===o(x)&&(A?(X(G),G=-1):A=!0,ce($,te-he))):(k.sortIndex=je,c(g,k),N||w||(N=!0,K||(K=!0,ye()))),k},i.unstable_shouldYield=Q,i.unstable_wrapCallback=function(k){var Y=z;return function(){var te=z;z=Y;try{return k.apply(this,arguments)}finally{z=te}}}})(Ro)),Ro}var Nh;function ib(){return Nh||(Nh=1,Do.exports=sb()),Do.exports}var Uo={exports:{}},mt={};/**
|
||||
* @license React
|
||||
* react-dom.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Sh;function cb(){if(Sh)return mt;Sh=1;var i=Fo();function c(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(c(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(g,x,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:y==null?null:""+y,children:g,containerInfo:x,implementation:v}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,mt.createPortal=function(g,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(c(299));return d(g,x,null,v)},mt.flushSync=function(g){var x=h.T,v=u.p;try{if(h.T=null,u.p=2,g)return g()}finally{h.T=x,u.p=v,u.d.f()}},mt.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,u.d.C(g,x))},mt.prefetchDNS=function(g){typeof g=="string"&&u.d.D(g)},mt.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var v=x.as,y=p(v,x.crossOrigin),z=typeof x.integrity=="string"?x.integrity:void 0,w=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?u.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:z,fetchPriority:w}):v==="script"&&u.d.X(g,{crossOrigin:y,integrity:z,fetchPriority:w,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},mt.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=p(x.as,x.crossOrigin);u.d.M(g,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&u.d.M(g)},mt.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,y=p(v,x.crossOrigin);u.d.L(g,v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},mt.preloadModule=function(g,x){if(typeof g=="string")if(x){var v=p(x.as,x.crossOrigin);u.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else u.d.m(g)},mt.requestFormReset=function(g){u.d.r(g)},mt.unstable_batchedUpdates=function(g,x){return g(x)},mt.useFormState=function(g,x,v){return h.H.useFormState(g,x,v)},mt.useFormStatus=function(){return h.H.useHostTransitionStatus()},mt.version="19.2.8",mt}var zh;function rb(){if(zh)return Uo.exports;zh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Uo.exports=cb(),Uo.exports}/**
|
||||
* @license React
|
||||
* react-dom-client.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Eh;function ob(){if(Eh)return Es;Eh=1;var i=ib(),c=Fo(),o=rb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(u(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return g(s),e;if(r===a)return g(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var m=!1,b=s.child;b;){if(b===l){m=!0,l=s,a=r;break}if(b===a){m=!0,a=s,l=r;break}b=b.sibling}if(!m){for(b=r.child;b;){if(b===l){m=!0,l=r,a=s;break}if(b===a){m=!0,a=r,l=s;break}b=b.sibling}if(!m)throw Error(u(189))}}if(l.alternate!==a)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,z=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Qe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case U:return"Profiler";case D:return"StrictMode";case $:return"Suspense";case K:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Z:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:Qe(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Qe(e(t))}catch{}}return null}var ce=Array.isArray,k=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},he=[],je=-1;function S(e){return{current:e}}function L(e){0>je||(e.current=he[je],he[je]=null,je--)}function V(e,t){je++,he[je]=e.current,e.current=t}var J=S(null),re=S(null),fe=S(null),oe=S(null);function ze(e,t){switch(V(fe,t),V(re,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bm(t),e=qm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(J),V(J,e)}function Ee(){L(J),L(re),L(fe)}function at(e){e.memoizedState!==null&&V(oe,e);var t=J.current,l=qm(t,e.type);t!==l&&(V(re,e),V(J,l))}function Me(e){re.current===e&&(L(J),L(re)),oe.current===e&&(L(oe),ys._currentValue=te)}var I,Te;function ke(e){if(I===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||"",Te=-1<l.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+I+e+Te}var tt=!1;function yt(e,t){if(!e||tt)return"";tt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(O){var M=O}Reflect.construct(e,[],B)}else{try{B.call()}catch(O){M=O}e.call(B.prototype)}}else{try{throw Error()}catch(O){M=O}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(O){if(O&&M&&typeof O.stack=="string")return[O.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),m=r[0],b=r[1];if(m&&b){var j=m.split(`
|
||||
`),C=b.split(`
|
||||
`);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===C.length)for(a=j.length-1,s=C.length-1;1<=a&&0<=s&&j[a]!==C[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==C[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==C[s]){var R=`
|
||||
`+j[a].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=a&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ke(l):""}function Jt(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return yt(e.type,!1);case 11:return yt(e.type.render,!1);case 1:return yt(e.type,!0);case 31:return ke("Activity");default:return""}}function ll(e){try{var t="",l=null;do t+=Jt(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
||||
Error generating stack: `+a.message+`
|
||||
`+a.stack}}var Ht=Object.prototype.hasOwnProperty,Wt=i.unstable_scheduleCallback,hl=i.unstable_cancelCallback,An=i.unstable_shouldYield,_n=i.unstable_requestPaint,dt=i.unstable_now,$s=i.unstable_getCurrentPriorityLevel,Qs=i.unstable_ImmediatePriority,Cn=i.unstable_UserBlockingPriority,Da=i.unstable_NormalPriority,Mn=i.unstable_LowPriority,pl=i.unstable_IdlePriority,kn=i.log,On=i.unstable_setDisableYieldValue,al=null,pt=null;function nl(e){if(typeof kn=="function"&&On(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(al,e)}catch{}}var xt=Math.clz32?Math.clz32:Xs,xc=Math.log,gc=Math.LN2;function Xs(e){return e>>>=0,e===0?32:31-(xc(e)/gc|0)|0}var Ra=256,da=262144,ma=4194304;function sl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ua(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=a&134217727;return b!==0?(a=b&~r,a!==0?s=sl(a):(m&=b,m!==0?s=sl(m):l||(l=b&~e,l!==0&&(s=sl(l))))):(b=a&~r,b!==0?s=sl(b):m!==0?s=sl(m):l||(l=a&~e,l!==0&&(s=sl(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function Ul(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vs(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zs(){var e=ma;return ma<<=1,(ma&62914560)===0&&(ma=4194304),e}function bc(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Dn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Yp(e,t,l,a,s,r){var m=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,j=e.expirationTimes,C=e.hiddenUpdates;for(l=m&~l;0<l;){var R=31-xt(l),B=1<<R;b[R]=0,j[R]=-1;var M=C[R];if(M!==null)for(C[R]=null,R=0;R<M.length;R++){var O=M[R];O!==null&&(O.lane&=-536870913)}l&=~B}a!==0&&yu(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(m&~t))}function yu(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-xt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function ju(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-xt(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function Nu(e,t){var l=t&-t;return l=(l&42)!==0?1:vc(l),(l&(e.suspendedLanes|t))!==0?0:l}function vc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Su(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function zu(e,t){var l=Y.p;try{return Y.p=e,t()}finally{Y.p=l}}var Hl=Math.random().toString(36).slice(2),it="__reactFiber$"+Hl,jt="__reactProps$"+Hl,Ha="__reactContainer$"+Hl,jc="__reactEvents$"+Hl,Gp="__reactListeners$"+Hl,$p="__reactHandles$"+Hl,Eu="__reactResources$"+Hl,Rn="__reactMarker$"+Hl;function Nc(e){delete e[it],delete e[jt],delete e[jc],delete e[Gp],delete e[$p]}function La(e){var t=e[it];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ha]||l[it]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Zm(e);e!==null;){if(l=e[it])return l;e=Zm(e)}return t}e=l,l=e.parentNode}return null}function Ba(e){if(e=e[it]||e[Ha]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Un(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function qa(e){var t=e[Eu];return t||(t=e[Eu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Rn]=!0}var wu=new Set,Tu={};function ha(e,t){Ya(e,t),Ya(e+"Capture",t)}function Ya(e,t){for(Tu[e]=t,e=0;e<t.length;e++)wu.add(t[e])}var Qp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21
Line truncated
|
||||
`).replace(jg,"")}function Hm(e,t){return t=Um(t),Um(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$a(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$a(e,""+a);break;case"className":Js(e,"class",a);break;case"tabIndex":Js(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Js(e,l,a);break;case"style":Uu(e,a,r);break;case"data":if(t!=="object"){Js(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Fs(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Fs(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=gl);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Fs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Ks(e,"popover",a);break;case"xlinkActuate":xl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":xl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":xl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":xl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":xl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":xl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":xl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":xl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":xl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Ks(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Jp.get(l)||l,Ks(e,l,a))}}function mo(e,t,l,a,s,r){switch(l){case"style":Uu(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof a=="string"?$a(e,a):(typeof a=="number"||typeof a=="bigint")&&$a(e,""+a);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=gl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const fb=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),db=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,o,u)=>u?u.toUpperCase():o.toLowerCase()),Th=i=>{const c=db(i);return c.charAt(0).toUpperCase()+c.slice(1)},fp=(...i)=>i.filter((c,o,u)=>!!c&&c.trim()!==""&&u.indexOf(c)===o).join(" ").trim(),mb=i=>{for(const c in i)if(c.startsWith("aria-")||c==="role"||c==="title")return!0};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/var hb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const pb=q.forwardRef(({color:i="currentColor",size:c=24,strokeWidth:o=2,absoluteStrokeWidth:u,className:f="",children:d,iconNode:h,...p},g)=>q.createElement("svg",{ref:g,...hb,width:c,height:c,stroke:i,strokeWidth:u?Number(o)*24/Number(c):o,className:fp("lucide",f),...!d&&!mb(p)&&{"aria-hidden":"true"},...p},[...h.map(([x,v])=>q.createElement(x,v)),...Array.isArray(d)?d:[d]]));/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const He=(i,c)=>{const o=q.forwardRef(({className:u,...f},d)=>q.createElement(pb,{ref:d,iconNode:c,className:fp(`lucide-${fb(Th(i))}`,`lucide-${i}`,u),...f}));return o.displayName=Th(i),o};/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const xb=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Sn=He("arrow-up-right",xb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const gb=[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]],bb=He("bed-double",gb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const vb=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],yb=He("calendar-check",vb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const jb=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Nb=He("calendar-days",jb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Sb=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],zb=He("car",Sb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Eb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dp=He("check",Eb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const wb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fc=He("chevron-down",wb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Tb=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oa=He("chevron-left",Tb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ab=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ua=He("chevron-right",Ab);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _b=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Cb=He("clock",_b);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Mb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],kb=He("copy",Mb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Ob=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Db=He("external-link",Ob);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Rb=[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]],Ub=He("instagram",Rb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Hb=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],mp=He("mail",Hb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Lb=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ls=He("map-pin",Lb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Bb=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],hp=He("menu",Bb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const qb=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Io=He("message-circle",qb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Yb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Gb=He("minus",Yb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $b=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Ho=He("navigation",$b);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Qb=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],_t=He("phone",Qb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Xb=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Vb=He("play",Xb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Zb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kb=He("plus",Zb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Jb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Wb=He("rotate-ccw",Jb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Fb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ib=He("shield-check",Fb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Pb=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],e0=He("utensils",Pb);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const t0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pp=He("x",t0);/**
|
||||
* @license lucide-react v0.546.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const l0=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],a0=He("youtube",l0),xp=q.createContext(null);function n0({payload:i,children:c}){return n.jsx(xp.Provider,{value:i,children:c})}function le(){const i=q.useContext(xp);if(!i)throw new Error("SiteProvider 밖에서 useSite() 를 불렀습니다. payload 없이는 렌더할 수 없습니다.");return i}function s0(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[n.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),n.jsxs("g",{className:"w4d-reel",children:[n.jsx("circle",{cx:"8.5",cy:"12",r:"2.6"}),n.jsx("path",{d:"M8.5 9.4v5.2M5.9 12h5.2"})]}),n.jsxs("g",{className:"w4d-reel",children:[n.jsx("circle",{cx:"15.5",cy:"12",r:"2.6"}),n.jsx("path",{d:"M15.5 9.4v5.2M12.9 12h5.2"})]}),n.jsx("path",{d:"M6 19l1.5-2.4h9L18 19"})]})}function i0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M8 5v14l11-7z"})})}function c0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M7 5h3.4v14H7zm6.6 0H17v14h-3.4z"})})}function r0(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[n.jsx("path",{d:"M4 7h11M4 12h11M4 17h7"}),n.jsx("path",{d:"M19 17.5V9l3 1.2"}),n.jsx("circle",{cx:"17.4",cy:"17.6",r:"1.7",fill:"currentColor",stroke:"none"})]})}function o0(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M6 6l12 12M18 6L6 18"})})}function Ah(i){if(typeof i!="number"||!Number.isFinite(i))return"";const c=Math.floor(i/60),o=Math.floor(i%60);return`${c}:${o<10?"0":""}${o}`}function u0(){const i=le(),c=(i.songs??[]).filter($=>$.audioUrl),[o,u]=q.useState(0),[f,d]=q.useState(!1),[h,p]=q.useState(!1),[g,x]=q.useState({now:0,total:0}),[v,y]=q.useState({}),z=q.useRef(null),w=q.useRef(null),N=q.useRef(null),A=c.length;q.useEffect(()=>{A>1&&u(Math.floor(Math.random()*A))},[A]);const D=q.useCallback(()=>{var ee;const $=document.querySelector("header"),K=$==null?void 0:$.getBoundingClientRect(),G={top:`${K?K.bottom+6:66}px`};if(window.innerWidth<=640)G.left="8px",G.right="8px";else{G.left="auto";const se=(ee=w.current)==null?void 0:ee.getBoundingClientRect();G.right=`${Math.max(12,window.innerWidth-((se==null?void 0:se.right)??0))}px`}y(G)},[]);if(q.useEffect(()=>{if(!h)return;D();const $=()=>D(),K=G=>{var se,Q;const ee=G.target;(se=N.current)!=null&&se.contains(ee)||(Q=w.current)!=null&&Q.contains(ee)||p(!1)};return window.addEventListener("resize",$),window.addEventListener("scroll",$,{passive:!0}),document.addEventListener("click",K),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$),document.removeEventListener("click",K)}},[h,D]),q.useEffect(()=>()=>{var $;return($=z.current)==null?void 0:$.pause()},[]),c.length===0)return null;const U=c[o]??c[0],X=($=o)=>{const K=z.current,G=c[$];!K||!G||(K.getAttribute("src")!==G.audioUrl&&(K.src=G.audioUrl),K.play().then(()=>d(!0),()=>d(!1)))},Z=()=>{var $;($=z.current)==null||$.pause(),d(!1)},P=$=>{const K=($%c.length+c.length)%c.length;u(K),x({now:0,total:0}),X(K)};return n.jsxs(n.Fragment,{children:[n.jsxs("span",{id:"w4d-mini",ref:w,"data-playing":f?"1":"0",children:[n.jsx("span",{id:"w4d-tape","aria-hidden":!0,title:`${i.place.name}이(가) 만든 노래`,children:n.jsx(s0,{})}),n.jsx("span",{id:"w4d-now","aria-live":"polite",children:U.title}),n.jsx("button",{type:"button",id:"w4d-play","data-playing":f?"1":"0",title:`${f?"멈춤":"재생"} · ${U.title}`,onClick:()=>f?Z():X(),children:f?n.jsx(c0,{}):n.jsx(i0,{})}),n.jsx("button",{type:"button",id:"w4d-toggle",title:"노래 목록","aria-expanded":h,onClick:()=>p($=>!$),children:n.jsx(r0,{})})]}),n.jsx("audio",{ref:z,src:c[0].audioUrl,preload:"none",onTimeUpdate:$=>x({now:$.currentTarget.currentTime,total:$.currentTarget.duration}),onDurationChange:$=>x(K=>({...K,total:$.currentTarget.duration})),onEnded:()=>P(o+1),onError:()=>d(!1)}),n.jsxs("div",{id:"w4d-panel",ref:N,hidden:!h,style:v,children:[n.jsxs("div",{className:"w4d-head",children:[n.jsxs("span",{className:"w4d-head-t",children:[i.place.name,"이(가) 만든 노래"]}),n.jsxs("span",{className:"w4d-head-n",children:[c.length,"곡"]}),n.jsx("button",{type:"button",id:"w4d-close",title:"닫기","aria-label":"닫기",onClick:()=>p(!1),children:n.jsx(o0,{})})]}),n.jsx("ol",{children:c.map(($,K)=>n.jsx("li",{children:n.jsxs("button",{type:"button",className:"w4d-item","aria-current":K===o,"data-playing":K===o&&f?"1":"0",onClick:()=>P(K),children:[n.jsxs("span",{className:"w4d-mark",children:[n.jsx("span",{className:"w4d-disc-sm"}),n.jsxs("span",{className:"w4d-eq","aria-hidden":!0,children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]Line truncated
|
||||
|
||||
`).trim()})]})]})}const Ma={LODGING:1,CAFE:2,RESTAURANT:3,CLINIC:4},f0={OWNER:1,CRAWL:3,TEMPLATE:5},_h={UNVERIFIED:1,VERIFIED:3,CORRECTED:4},d0=[_h.VERIFIED,_h.CORRECTED];function gp(i){return d0.includes(i)}const bt={YANOLJA:1,GOODCHOICE:2,NAVER_PLACE:3,INSTAGRAM:4,OFFICIAL_SITE:5,BLOG:6,NAVER_BOOKING:7,ETC:99},S1={PUBLISHED:3};function Bs(i){return i.filter(c=>gp(c.status)&&c.value!=null&&c.value!=="")}function bp(i){const c=new Map;for(const o of Bs(i))c.set(o.key,o);return c}function ca(i,c){const o=bp(i).get(c);return(o==null?void 0:o.value)??void 0}function At(i,c){const o=bp(i).get(c);if(!(o!=null&&o.value))return;const u=o.type==="number"?m0(o.value):o.value;return o.unit?`${u}${o.unit}`:u}function m0(i){const c=Number(i.replace(/,/g,""));return Number.isFinite(c)?c.toLocaleString("ko-KR"):i}function Po(i){return i.type!=="bool"?i.label:i.label.replace(/\s*(가능|여부)$/,"")||i.label}function h0(i){return i.filter(c=>gp(c.status)&&c.question&&c.answer).sort((c,o)=>c.sortOrder-o.sortOrder)}function eu(i){return i.map(c=>({...c,facts:Bs(c.facts)})).sort((c,o)=>c.sortOrder-o.sortOrder)}const p0={songs:"title",daily:"title",course:"name",schedule:"name",people:"name",chronicle:"title",literature:"workTitle",postcard:"line",quiz:"question",planner:"name",itinerary:"name",video:"url",event:"title"};function x0(i){const c=(i??"").trim();if(!c)return;const o=/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/|live\/)|youtu\.be\/)([A-Za-z0-9_-]{6,20})/.exec(c);return o==null?void 0:o[1]}function g0(i){return/youtube\.com\/shorts\//.test((i??"").trim())}function b0(i){return`https://i.ytimg.com/vi/${i}/hqdefault.jpg`}function v0(i){return`https://www.youtube-nocookie.com/embed/${i}?autoplay=1&rel=0&modestbranding=1`}const ic={items:[],unverified:0,sourced:0};function y0(i,c){var x,v;const o=y=>{const z=i.slice(0,Math.max(0,y)),w=z.split(`
|
||||
`).length,N=y-z.lastIndexOf(`
|
||||
`);return`${w}번째 줄 ${N}번째 글자`},u=(x=/Unexpected token '(.)'/.exec(c))==null?void 0:x[1],f=u==="}"||u==="]"?"닫는 괄호 바로 앞에 쉼표가 하나 더 있는지 보세요.":"그 앞의 쉼표·따옴표·괄호를 확인해 주세요.",d=/line (\d+) column (\d+)/.exec(c);if(d)return`${d[1]}번째 줄 ${d[2]}번째 글자에서 JSON 이 끊깁니다. ${f}`;const h=/position (\d+)/.exec(c);if(h)return`${o(Number(h[1]))}에서 JSON 이 끊깁니다. ${f}`;const p=(v=/\.\.\."([\s\S]*?)" is not valid JSON/.exec(c))==null?void 0:v[1],g=p?i.indexOf(p):-1;return g>=0?`${o(g+p.length)} 부근에서 JSON 이 끊깁니다. ${f}`:"JSON 이 아닙니다. ChatGPT 가 준 답에서 { 로 시작해 } 로 끝나는 부분만 붙여넣어 주세요."}function j0(i,c){const o=p0[i],u=(c??"").trim();if(!o||!u)return ic;let f;try{f=JSON.parse(u)}catch(y){return{...ic,error:y0(u,y instanceof Error?y.message:"")}}if(typeof f!="object"||f===null||Array.isArray(f))return{...ic,error:"바깥이 { } 로 감싸인 JSON 이어야 합니다."};const d=f,h=typeof d.kind=="string"?d.kind:void 0,p=d.items;if(!Array.isArray(p))return{...ic,error:"items 배열이 없습니다. 프롬프트로 다시 만들어 주세요."};const g=p.filter(y=>typeof y=="object"&&y!==null&&!Array.isArray(y)&&typeof y[o]=="string"&&y[o].trim().length>0);let x=0,v=0;for(const y of g){const z=y;z.verified!=="확인"&&(x+=1),z.source&&typeof z.source=="object"&&(v+=1)}return{items:g,title:typeof d.title=="string"?d.title:void 0,subtitle:typeof d.subtitle=="string"?d.subtitle:void 0,linkUrl:typeof d.linkUrl=="string"&&/^https?:\/\//.test(d.linkUrl)?d.linkUrl:void 0,linkLabel:typeof d.linkLabel=="string"?d.linkLabel:void 0,kindMismatch:h&&h!==i?h:void 0,unverified:x,sourced:v}}const N0=1260,S0=60,z0="10:00",Ch=["봄","여름","가을","겨울"];function Mh(i){const c=/^(\d{1,2}):(\d{2})$/.exec(i.trim());if(!c)return;const o=Number(c[1]),u=Number(c[2]);if(!(o>23||u>59))return o*60+u}function cc(i){const c=(i%1440+1440)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`}function E0(i){const c=Mh(i.startTime??"")??Mh(z0)??600,o=[];let u=c,f=0;for(const d of i.stops??[]){const h=Math.max(0,d.moveMinutes??0),p=Math.max(1,d.minutes??S0),g=u+h;if(g+p>N0){f+=1;continue}o.push({stop:d,time:cc(g),until:cc(g+p),move:h}),u=g+p}return{stops:o,from:cc(c),to:cc(u),totalMinutes:u-c,dropped:f}}function w0(i=new Date){const c=i.getMonth()+1,o=Math.floor((c-3+12)%12/3),u=Ch[o];return c%3===0&&i.getDate()<=15?[Ch[(o+3)%4],u]:[u]}function kh(i){const c=parseInt(i.replace("#",""),16);return[c>>16&255,c>>8&255,c&255]}function Oh(i,c,o){if(!/^#[0-9a-fA-F]{6}$/.test(i)||!/^#[0-9a-fA-F]{6}$/.test(c))return i;const[u,f,d]=kh(i),[h,p,g]=kh(c),x=(y,z)=>Math.round(y+(z-y)*o),v=y=>y.toString(16).padStart(2,"0");return`#${v(x(u,h))}${v(x(f,p))}${v(x(d,g))}`}function T0(i){return{surface:Oh(i.bg,i.text,.06),surfaceAlt:i.card,inverse:"#1c1917",border:Oh(i.bg,i.text,.2)}}const vp={[Ma.LODGING]:{type:"HotelRoom",path:"rooms",label:"객실"},[Ma.CAFE]:{type:"MenuItem",path:"menu",label:"메뉴"},[Ma.RESTAURANT]:{type:"MenuItem",path:"menu",label:"메뉴"},[Ma.CLINIC]:{type:"Product",path:"programs",label:"시술"}};function A0(i){return i.links.filter(c=>c.confirmed&&/^https?:\/\//i.test(c.url??""))}function yp(i){var c;for(const[o,u]of[["weekday_price","주중 1박"],["price","1박"],["weekend_price","주말 1박"],["peak_price","성수기 1박"]]){const f=Number((c=ca(i.facts,o))==null?void 0:c.replace(/[^0-9]/g,""));if(Number.isFinite(f)&&f>0)return{price:f,label:u}}}const Dh=[bt.NAVER_BOOKING,bt.YANOLJA,bt.GOODCHOICE,bt.NAVER_PLACE];function dc(i){return Bs(i.facts).filter(c=>c.scope==="place").map(c=>({label:Po(c),value:tu(c,i.facts)})).filter(c=>c.value!=="")}function tu(i,c){const o=At(c,i.key);return o?i.type!=="bool"?o:/여부$/.test(i.label)?o==="true"?"있음":o==="false"?"없음":o:o==="true"?"가능":o==="false"?"불가":o:""}const _0=new Set(["weekday_price","weekend_price","peak_price","price_range"]);function fl(i){const c=vp[i.place.category],o=new Map(i.media.map(u=>[u.mediaId,u]));return eu(i.units).map(u=>{const f=At(u.facts,"room_intro")??At(u.facts,"description"),d=i.place.category===Ma.LODGING?["standard_capacity","max_capacity","bed_type","room_size"]:["price","volume","origin"];return{unitId:u.unitId,slug:u.slug,name:u.name,intro:f,chips:d.map(h=>{var x;const p=At(u.facts,h),g=((x=u.facts.find(v=>v.key===h))==null?void 0:x.label)??h;return p?{label:g,value:p}:null}).filter(h=>h!==null),rows:u.facts.filter(h=>!_0.has(h.key)).map(h=>({label:Po(h),value:tu(h,u.facts)})).filter(h=>h.value!==""),images:u.mediaIds.map(h=>o.get(h)).filter(h=>{var p;return!!((p=h==null?void 0:h.alt)!=null&&p.trim())}),priceText:C0(u),prices:k0(u),href:`/${c.path}/${u.slug}`}})}function C0(i){var d,h;const c=At(i.facts,"price_range");if(c)return c;const o=Number((d=At(i.facts,"weekday_price"))==null?void 0:d.replace(/[^0-9]/g,"")),u=Number((h=At
Line truncated
|
||||
.stay2-hero-slide { animation: stay2-hero-fade ${c}s ease-in-out infinite; }
|
||||
@keyframes stay2-hero-fade {
|
||||
0% { opacity: 1; }
|
||||
${o(rc)} { opacity: 1; }
|
||||
${o(rc+Xo)} { opacity: 0; }
|
||||
${o(c-Xo)} { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}`}
|
||||
.stay2-hero-focus { animation: stay2-hero-focus 1.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
|
||||
@keyframes stay2-hero-focus {
|
||||
0% { opacity: 0; filter: blur(0.22em); }
|
||||
40% { opacity: 1; }
|
||||
100% { opacity: 1; filter: blur(0); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.stay2-hero-slide, .stay2-hero-focus { animation: none; }
|
||||
}
|
||||
`}function rv(i,c){return((c-i)%c*rc+Xo).toFixed(1)}function ov(){const i=le(),{place:c,narrative:o}=i,u=ft(i),f=Ze(i)[0],d=o.tagline??o.heroSubline,h=[...i.media].filter(x=>{var v;return(v=x.alt)==null?void 0:v.trim()}).sort((x,v)=>Number(v.isPrimary)-Number(x.isPrimary)),p=h.length<2?0:Math.min(h.length,iv),g=f?{href:f.url,label:`${ks(f)}에서 예약`,external:!0}:c.phone?{href:`tel:${c.phone}`,label:`${c.phone} 예약 문의`,external:!1}:i.units.length>0?{href:"#units",label:`${u.label} 보기`,external:!1}:null;return n.jsxs("section",{id:"top",className:"w-full",children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:cv(p)}}),n.jsxs("div",{className:"relative flex w-full items-center justify-center overflow-hidden",style:{backgroundColor:"var(--tpl-inverse, #1c1917)",color:"var(--tpl-bg, #ffffff)",height:"100svh"},children:[h.map((x,v)=>n.jsx("img",{src:x.url,alt:x.alt,fetchPriority:v===0?"high":v<p?"auto":"low",loading:v<Math.max(p,1)?void 0:"lazy",decoding:"async",width:x.width,height:x.height,className:`absolute inset-0 size-full object-cover object-center ${v<p?"stay2-hero-slide":""}`,style:{opacity:v===0?1:0,animationDelay:v<p?`-${rv(v,p)}s`:void 0}},x.mediaId)),n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(to bottom, color-mix(in srgb, var(--tpl-inverse, #1c1917) 16%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 14%, transparent) 40%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 34%, transparent) 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-48",style:{background:"linear-gradient(to bottom, color-mix(in srgb, var(--tpl-inverse, #1c1917) 68%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 40%, transparent) 45%, transparent 100%)"}}),n.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 58% 42% at 50% 52%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 38%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 18%, transparent) 55%, transparent 78%)"}}),n.jsxs("div",{className:"shell relative z-10 flex flex-col items-center pt-20 text-center",style:{textShadow:"0 1px 3px color-mix(in srgb, var(--tpl-inverse, #1c1917) 55%, transparent)"},children:[n.jsx("h1",{className:"stay2-hero-focus serif",style:{fontSize:"var(--fs-display)",fontWeight:300,letterSpacing:"0.06em",lineHeight:1.25,animationDelay:"0.05s"},children:c.name}),d&&n.jsx("p",{className:"stay2-hero-focus measure mt-6 text-[length:var(--fs-lead)] font-light leading-loose opacity-95",style:{animationDelay:"0.3s"},children:d}),g&&n.jsx("a",{href:g.href,...g.external?{target:"_blank",rel:"noopener noreferrer"}:{},className:"stay2-hero-focus tap mt-10 inline-flex items-center justify-center border border-current/70 px-9 text-[length:var(--fs-sm)] font-light tracking-[0.14em] transition-colors hover:border-current",style:{animationDelay:"0.55s",backgroundColor:"color-mix(in srgb, var(--tpl-inverse, #1c1917) 22%, transparent)",boxShadow:"0 1px 6px color-mix(in srgb, var(--tpl-inverse, #1c1917) 30%, transparent)"},children:g.label})]})]})]})}function uv(){const i=le(),{place:c,narrative:o}=i,u=mc(i),f=En(i),d=Ze(i),h=Oa(i),p=h.length>0?h:dc(i).slice(0,4),g=(u==null?void 0:u.caption)??c.name;return n.jsxs("section",{id:"top","data-oasi":!0,"aria-labelledby":"top-heading",className:"pt-12 lg:pt-16",children:[n.jsx("h1",{id:"top-heading",className:"text-[length:var(--fs-sm)] font-normal tracking-[0.08em] leading-[1.9]",children:c.name}),o.heroHeadline&&n.jsx("p",{className:"text-muted measure mt-3 text-[length:var(--fs-xs)] leading-[1.9]",children:o.heroHeadline}),u&&n.jsxs("figure",{className:"relative mx-auto mt-10 w-full max-w-[34rem]",children:[n.jsx("img",{src:u.url,alt:u.alt,fetchPriority:"high",decoding:"async",width:u.width,height:u.height,className:"block h-[clamp(17rem,27vw,24rem)] w-full object-cover"}),n.jsx("figcaption",{className:"text-muted absolute left-full top-0 ml-5 hidden max-h-full overflow-hidden text-ellipsis whitespace-nowrap text-[length:var(--fs-xs)] tracking-[0.14em] xl:block",style:{writingMode:"vertical-rl"},children:g})]}),(f||p.length>0)&&n.jsxs("dl",{className:"border-line mt-10 flex flex-wrap gap-x-10 gap-y-4 border-t pt-5 text-[length:var(--fs-xs)] leading-[1.9]",children:[f&&n.jsxs("div",{children:[n.jsx("dt",{className:"text-muted",children:"최저가"}),n.jsx("dd",{children:f})]}),p.map(x=>n.jsxs("div",{children:[n.jsx("dt",{className:"text-muted",children:x.label}),n.jsx("dd",{children:x.value})]},x.label))]}),d.length>0&&n.jsx("ul",{className:"mt-6 flex flex-wrap items-center gap-x-8",children:d.map(x=>n.jsx("li",{children:n.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:"tap inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]",style:{color:"var(--color-brand)"},children:ht(x)})},x.url))})]})}function fv(){const i=le(),c=lu(i),o=mc(i),u=o&&c.some(f=>f.mediaId===o.mediaI
Line truncated
|
||||
.oasi-page main > section:not([data-oasi]) {
|
||||
background-color: transparent !important;
|
||||
background-image: none !important;
|
||||
border-color: transparent !important;
|
||||
color: var(--tpl-text) !important;
|
||||
padding-block: var(--oasi-gap) 0 !important;
|
||||
}
|
||||
.oasi-page main > section:not([data-oasi]) .shell {
|
||||
max-width: none;
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#about > .shell > .grid {
|
||||
display: block;
|
||||
}
|
||||
.oasi-page main > section#about > .shell > .grid > * + * {
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
.oasi-page main > section#summary dl {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
/*
|
||||
* 붙여넣기 아이템 카드 — 소식 · 영상 · 추천 일정 (2026-09-04, 사장님: "1,2,3안 다 맞추세요")
|
||||
*
|
||||
* ★ 이 카드들은 .panel 이 아니라 제 인라인 style 로 면을 그린다(items/common.tsx 의
|
||||
* ITEM_CARD·ITEM_BORDER). 그래서 위 .panel 규칙이 안 닿았고, 섹션 띠를 다 지운 3안에서
|
||||
* **소식 카드만 갱지 결에 2px 테두리를 두른 상자로 혼자 서 있었다.**
|
||||
* ★ w4-paper 의 결은 1안(레트로 갱지)의 것이다. 여기서는 결을 지우고 테두리를 실선 한 겹으로
|
||||
* 낮춘다. 상자를 아예 없애지는 않는다 — 전단 여섯 장이 경계 없이 붙으면 어디까지가 한 장인지
|
||||
* 안 보인다. 면은 빼고 테두리만 남기는 게 이 안의 타협점이다.
|
||||
* ★ 배경은 transparent 로 두지 않는다. 사진 없는 공지 카드가 종이에 바로 얹히면
|
||||
* 본문과 구분이 사라진다 — 아주 옅은 틴트 한 겹만 남긴다.
|
||||
* ★ 영상은 뺐다 (2026-09-04, 사장님: "영상 border 안 예쁘다")
|
||||
* 영상 카드는 상자가 아니라 **표지 사진 한 장**이고, 쇼츠라 9:16 세로다. li 에 틴트를 깔면
|
||||
* 영상보다 넓은 회색 판이 뒤에 깔려 액자처럼 보인다. 사진은 제 테두리가 곧 경계다.
|
||||
*/
|
||||
.oasi-page section#event li,
|
||||
.oasi-page section#itinerary article {
|
||||
background-image: none !important;
|
||||
background-color: color-mix(in oklab, currentcolor 3%, transparent) !important;
|
||||
border-width: 1px !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.oasi-page .panel,
|
||||
.oasi-page .panel-sunken {
|
||||
background-color: transparent;
|
||||
border-width: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.oasi-page main > section#faq > .shell > div:last-of-type {
|
||||
row-gap: 0;
|
||||
column-gap: 2.5rem;
|
||||
}
|
||||
.oasi-page main > section#faq details {
|
||||
margin-block: 0;
|
||||
border-top: 1px solid var(--site-line);
|
||||
}
|
||||
.oasi-page main > section#faq summary {
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#faq summary > span:first-child {
|
||||
width: 1.125rem;
|
||||
}
|
||||
.oasi-page main > section#faq summary + div {
|
||||
border-top-width: 0;
|
||||
padding-inline: 1.875rem 0;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.oasi-page main > section#info dl.panel > div {
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#info dl > div.panel {
|
||||
border-top: 1px solid var(--site-line);
|
||||
padding-inline: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#location .panel {
|
||||
border-top: 1px solid var(--site-line);
|
||||
padding-inline: 0;
|
||||
}
|
||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#weather .panel {
|
||||
padding-inline: 0;
|
||||
}
|
||||
|
||||
.oasi-page main > section#guide .panel > span:last-child {
|
||||
padding-inline: 0;
|
||||
}
|
||||
@media (min-width: 40rem) {
|
||||
.oasi-page main > section#festival .panel > span:last-child {
|
||||
padding-inline: 0;
|
||||
}
|
||||
}
|
||||
`,o1={"--oasi-gap":"clamp(3.5rem, 7vw, var(--tpl-section-space, 4rem))",backgroundColor:"var(--tpl-bg)",color:"var(--tpl-text)"};function u1({children:i}){var v,y,z,w;const c=le(),{place:o}=c,u=ft(c),f=Ze(c)[0],d=wn(c),h=[{label:"처음",href:"#top",show:!0},{label:"소개",href:"#about",show:Kt(c,"intro")},{label:u.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"자주 묻는 질문",href:"#faq",show:c.faqs.length>0}].filter(N=>N.show),p=[...Oa(c).map(N=>`${N.label} ${N.value}`),...c.theme.sections.filter(N=>{var A;return N.enabled&&((A=N.name)==null?void 0:A.trim())}).map(N=>N.name.trim())].slice(0,3),g=c.narrative.tagline??c.narrative.heroSubline,x=o.roadAddress??o.address;return n.jsxs("div",{className:"oasi-page flex min-h-screen w-full flex-col",style:o1,children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:r1}}),n.jsxs("div",{className:"mx-auto flex w-full max-w-[72rem] flex-col gap-10 px-5 pb-16 pt-10 lg:flex-row lg:gap-14 lg:px-10 lg:pb-24 lg:pt-16",children:[n.jsxs("header",{className:"lg:sticky lg:top-12 lg:h-fit lg:w-[18.75rem] lg:shrink-0",children:[n.jsxs("a",{href:"#top",className:"block",children:[n.jsx("span",{className:"serif block leading-none",style:{fontSize:"var(--fs-display)",fontWeight:300,letterSpacing:"0.14em"},children:o.name}),o.englishName&&n.jsx("span",{className:"text-muted mt-3 block text-[length:var(--fs-xs)] tracking-[0.24em]",children:o.englishName})]}),n.jsx("nav",{"aria-label":"주요 메뉴",className:"mt-12 lg:mt-24",children:n.jsx("ul",{className:"flex flex-wrap items-center gap-x-6 gap-y-1 lg:block",children:h.map((N,A)=>n.jsx("li",{children:n.jsx("a",{href:N.href,"aria-current":A===0?"true":void 0,className:`tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 ${A===0?"":"text-muted"}`,children:N.label})},N.label))})}),f&&n.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"tap mt-2 inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]",style:{color:"var(--color-brand)"},children:ht(f)})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[(p.length>0||g)&&n.jsxs("div",{className:"border-line flex flex-col gap-3 border-y py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[p.length>0&&n.jsx("ul",{className:"text-muted flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 text-[length:var(--fs-xs)]",children:p.map((N,A)=>n.jsxs("li",{className:"flex items-center gap-4",children:[A>0&&n.jsx("span",{"aria-hidden":!0,className:"opacity-40",children:"|"}),n.jsx("span",{children:N})]},N))}),g&&n.jsx("p",{className:"text-muted measure shrink-0 text-[length:var(--fs-xs)] leading-[1.9] sm:max-w-[18rem] sm:text-right",children:g})]}),i]})]}),n.jsx("footer",{className:"border-line mt-auto w-full border-t",children:n.jsxs("div",{className:"mx-auto grid w-full max-w-[72rem] grid-cols-1 gap-8 px-5 pb-28 pt-10 text-[length:var(--fs-xs)] leading-[1.9] sm:grid-cols-3 lg:px-10 lg:pb-14",children:[n.jsxs("p",{children:["[",o.name,"]"]}),d.length>0?n.jsx("ul",{className:"space-y-1",children:d.map(N=>n.jsx("li",{children:n.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-[5px]",children:ks(N)})},N.url))}):n.jsx("span",{}),n.jsxs("div",{className:"text-muted space-y-1 sm:text-right",children:[x&&n.jsx("p",{children:x}),o.phone&&n.jsx("p",{children:n.jsx("a",{href:`tel:${o.phone}`,className:"underline underline-offset-[5px]",children:o.phone})}),o.email&&n.jsx("p",{children:o.email}),((v=o.legal)==null?void 0:v.representative)&&n.jsxs("p",{children:["대표 ",o.legal.representative]}),((y=o.legal)==null?void 0:y.businessRegistrationNumber)&&n.jsxs("p",{children:["사업자등록번호 ",o.legal.businessRegistrationNumber]}),((z=o.legal)==null?void 0:z.mailOrderNumber)&&n.jsxs("p",{children:["통신판매업신고 ",o.legal.mailOrderNumber]}),((w=o.legal)==null?void 0:w.licenseNumber)&&n.jsxs("p",{children:[o.legal.licenseLabel??"인허가번호"," ",o.legal.licenseNumber]}),n.jsxs("p",{className:"byline",children:[n.jsxs("span",{className:"author",children:["작성·운영 ",o.name]})," · 최종 업데이트: ",n.jsx("time",{dateTime:c.site.updatedAt,children:qs(c.site.updatedAt)})]})]})]})}),n.jsx(Tn,{})]})}function f1({children:i}){var z,w,N,A;const c=le(),{place:o,narrative:u,site:f}=c,d=ft(c),h=En(c),p=Oa(c),g=Ze(c)[0],x=c.links.filter(D=>D.confirmed),v=o.roadAddress??o.address,y=[{label:"소개",href:"#about",show:Kt(c,"intro")},{label:d.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변 정보",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"자주 묻는 질문",href:"#faq",show:c.faqs.length>0}].filter(D=>D.show);return n.jsxs("div",{className:"flex min-h-screen w-f
Line truncated
|
||||
.pastel-page > main > section:not([data-pastel]) {
|
||||
border-color: transparent;
|
||||
background-image: none;
|
||||
color: var(--pastel-ink) !important;
|
||||
}
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+1) { background-color: var(--pastel-1) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+2) { background-color: var(--pastel-soft) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n+3) { background-color: var(--pastel-2) !important; }
|
||||
.pastel-page > main > section:not([data-pastel]):nth-of-type(4n) { background-color: var(--pastel-3) !important; }
|
||||
`,m1={"--pastel-1":"var(--tpl-card)","--pastel-2":"var(--tpl-accent)","--pastel-3":"var(--tpl-secondary)","--pastel-soft":"var(--tpl-bg)","--pastel-ink":"var(--tpl-text)","--section-space":"clamp(2.75rem, 8vw, calc(var(--tpl-section-space, 4rem) * 1.4))",backgroundColor:"var(--pastel-soft)",color:"var(--pastel-ink)"};function h1({children:i}){const c=le(),o=ft(c),u=wn(c),f=[{label:"소개",href:"#about",show:Kt(c,"intro")},{label:o.label,href:"#units",show:c.units.length>0},{label:"이용 정보",href:"#info",show:!0},{label:"주변",href:"#guide",show:Kt(c,"local")},{label:"오시는 길",href:"#location",show:!0},{label:"FAQ",href:"#faq",show:c.faqs.length>0}].filter(d=>d.show);return n.jsxs("div",{className:"pastel-page flex min-h-screen w-full flex-col",style:m1,children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:d1}}),n.jsx("header",{className:"sticky top-0 z-40 w-full",style:{backgroundColor:"color-mix(in srgb, var(--tpl-surface, #fff) 92%, transparent)"},children:n.jsxs("div",{className:"shell flex h-16 items-center justify-between gap-3",children:[n.jsx("a",{href:"#top",className:"flex min-w-0 items-center gap-2",children:n.jsx("span",{className:"serif truncate italic",style:{fontSize:"var(--fs-lead)",fontWeight:800,display:"inline-block",transform:"rotate(-1.5deg)"},children:c.place.name})}),n.jsx("nav",{"aria-label":"주요 메뉴",className:"hidden items-center gap-8 lg:flex",children:f.map(d=>n.jsx("a",{href:d.href,className:"py-1 text-[length:var(--fs-xs)] font-bold tracking-[0.2em] opacity-70 transition-opacity hover:opacity-100",children:d.label},d.label))}),n.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.place.phone&&n.jsx("a",{href:`tel:${c.place.phone}`,"aria-label":"전화",className:"tap flex items-center justify-center rounded-full",style:{backgroundColor:"var(--pastel-1)"},children:n.jsx(_t,{className:"size-4"})}),u.map(d=>n.jsx("a",{href:d.url,target:"_blank",rel:"noopener noreferrer","aria-label":ml(d),className:"tap flex items-center justify-center rounded-full",style:{backgroundColor:"var(--pastel-2)"},children:/instagram/i.test(d.url)?n.jsx(Ub,{className:"size-4"}):n.jsx(Io,{className:"size-4"})},d.url)),n.jsxs("details",{className:"relative lg:hidden",children:[n.jsx("summary",{className:"tap flex cursor-pointer items-center justify-center rounded-full marker:content-none [&::-webkit-details-marker]:hidden","aria-label":"메뉴 열기",children:n.jsx(hp,{className:"size-5"})}),n.jsx("nav",{"aria-label":"전체 메뉴",className:"absolute right-0 top-[calc(100%+0.5rem)] z-50 w-48 overflow-hidden rounded-2xl",style:{backgroundColor:"var(--tpl-surface, #fff)",boxShadow:"0 10px 30px rgb(0 0 0 / 0.12)"},children:n.jsx("ul",{children:f.map(d=>n.jsx("li",{children:n.jsx("a",{href:d.href,className:"tap flex items-center px-4 text-[length:var(--fs-sm)] font-bold tracking-[0.08em]",children:d.label})},d.label))})})]})]})]})}),i,n.jsx("div",{style:{"--tpl-inverse":"var(--pastel-3)","--tpl-bg":"var(--pastel-ink)"},children:n.jsx(Op,{})}),n.jsx(Tn,{})]})}function p1({children:i}){var x,v,y,z;const c=le(),{place:o,site:u}=c,f=Ep(),d=x1(f),h=Ze(c)[0],p=c.links.filter(w=>w.confirmed),g=o.roadAddress??o.address;return n.jsxs("div",{className:"flex min-h-screen w-full flex-col",style:{backgroundColor:"var(--tpl-bg)",color:"var(--tpl-text)"},children:[n.jsx("header",{className:"sticky top-0 z-40 w-full border-b-2 backdrop-blur-md",style:{backgroundColor:"color-mix(in srgb, var(--tpl-bg) 90%, transparent)",borderColor:"var(--tpl-text)"},children:n.jsxs("div",{className:"flex h-14 items-center justify-between gap-4 px-4 sm:px-6 xl:px-8",children:[n.jsx("a",{href:"#top",className:"serif min-w-0 truncate text-[length:var(--fs-lead)] font-extrabold",children:o.name}),n.jsxs("div",{className:"flex shrink-0 items-center gap-4 text-[length:var(--fs-sm)]",children:[o.phone&&n.jsx("a",{href:`tel:${o.phone}`,className:"tap inline-flex items-center underline underline-offset-4",children:o.phone}),h&&n.jsx("a",{href:h.url,target:"_blank",rel:"noopener noreferrer",className:"tap inline-flex items-center font-bold underline underline-offset-4",children:ht(h)})]})]})}),n.jsxs("div",{className:"flex w-full flex-1",children:[f.length>0&&n.jsx("aside",{className:"border-line sticky top-14 hidden h-[calc(100vh-3.5rem)] w-44 shrink-0 self-start border-r xl:block",style:{backgroundImage:Os},children:n.jsx("nav",{"aria-label":"차례",className:"flex h-full flex-col justify-center gap-0.5 py-8 pl-6 pr-3",children:f.map(w=>{const N=w.anchor===d;return n.jsxs("a",{href:`#${w.anchor}`,"aria-current":N?"true":void 0,className:"flex items-baseline gap-2 py-2 text-[length:var(--fs-sm)] leading-tight motion-safe:transition-opacity",style:{opacity:N?1:.35},children:[n.jsx("span",{className:"shrink-0 text-[length:var(--fs-xs)] font-bold tabular-nums",children:w.no}),n.jsx("span",{className:"truncate",style:{fontWeight:N?700:400},children:w.label})]},w.anchor)})})}),n.jsx("div",{className:"flex min-w-0
Line truncated
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
#w4d-mini{display:inline-flex;align-items:center;gap:2px;margin-right:6px;padding-right:8px;border-right:1px solid var(--tpl-border, #bcb49e)}#w4d-mini button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;color:var(--tpl-text, #1b1a15);background:transparent;border:0;border-radius:var(--tpl-radius, 0);cursor:pointer;opacity:.75}#w4d-mini button:hover{opacity:1;background:#1b1a150f}#w4d-mini svg{width:16px;height:16px}#w4d-now{max-width:150px;overflow:hidden;font-size:11.5px;font-weight:700;white-space:nowrap;text-overflow:ellipsis;color:var(--tpl-accent, #bf2f1b);padding-right:2px}#w4d-mini[data-playing="0"] #w4d-now{opacity:.55;font-weight:400}@media(max-width:860px){#w4d-now{display:none}}#w4d-tape{display:inline-flex;align-items:center;padding:0 4px 0 2px;color:var(--tpl-text, #1b1a15);opacity:.8}#w4d-tape svg{width:20px;height:20px}#w4d-mini[data-playing="1"] #w4d-tape{color:var(--tpl-accent, #bf2f1b);opacity:1}#w4d-mini[data-playing="1"] .w4d-reel{transform-box:fill-box;transform-origin:center;animation:w4d-reel 2.6s linear infinite}@keyframes w4d-reel{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.w4d-reel{animation:none!important}}#w4d-mini button[data-playing="1"]{color:var(--tpl-accent, #bf2f1b);opacity:1}@media(max-width:400px){#w4d-mini{margin-right:2px;padding-right:4px}#w4d-mini button{width:27px;height:27px}}#w4d-panel{position:fixed;z-index:45;width:344px;max-width:calc(100vw - 16px);max-height:min(64vh,520px);display:flex;flex-direction:column;overflow:hidden;font-family:var(--tpl-font-body, serif);color:var(--tpl-text, #1b1a15);background:var(--tpl-card, #efe7d3);border:var(--tpl-border-width, 2px) solid var(--tpl-primary, #1b1a15);box-shadow:var(--tpl-shadow, 4px 4px 0 rgb(27 26 21 / .16))}#w4d-panel[hidden]{display:none}@media(max-width:640px){#w4d-panel{width:auto}}#w4d-panel .w4d-head{display:flex;align-items:center;gap:8px;flex:0 0 auto;padding:11px 8px 11px 14px;border-bottom:var(--tpl-border-width, 2px) solid var(--tpl-primary, #1b1a15)}.w4d-head-t{font-size:12px;font-weight:700;letter-spacing:.06em}.w4d-head-n{flex:1 1 auto;font-size:11px;opacity:.5}#w4d-panel .w4d-head button{display:inline-flex;width:28px;height:28px;flex:0 0 auto;align-items:center;justify-content:center;color:inherit;background:transparent;border:0;cursor:pointer;opacity:.6}#w4d-panel .w4d-head button:hover{opacity:1}#w4d-panel .w4d-head svg{width:14px;height:14px}#w4d-panel ol{flex:1 1 auto;margin:0;padding:4px 0;overflow-y:auto;list-style:none;-webkit-overflow-scrolling:touch}.w4d-item{display:flex;width:100%;min-height:52px;align-items:center;gap:11px;padding:8px 14px;color:inherit;background:transparent;border:0;font:inherit;text-align:left;cursor:pointer}.w4d-item+.w4d-item{border-top:1px dashed var(--tpl-border, #bcb49e)}.w4d-item:hover{background:#1b1a150d}.w4d-item[aria-current=true]{background:#1b1a150f}.w4d-item[aria-current=true] .w4d-t{color:var(--tpl-accent, #bf2f1b)}.w4d-mark{position:relative;flex:0 0 26px;height:26px}.w4d-disc-sm{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:radial-gradient(circle at 50% 50%,var(--w4d-lbl, #bf2f1b) 0 34%,transparent 34%),repeating-radial-gradient(circle at 50% 50%,rgb(255 255 255 / .12) 0 1px,transparent 1px 3px),#14110f}.w4d-disc-sm:after{content:"";position:absolute;top:45%;right:45%;bottom:45%;left:45%;border-radius:50%;background:var(--tpl-card, #efe7d3)}.w4d-eq{position:absolute;top:0;right:0;bottom:0;left:0;display:none;align-items:flex-end;justify-content:center;gap:3px;padding-bottom:4px}.w4d-eq i{width:3px;height:6px;background:var(--tpl-accent, #bf2f1b);animation:w4d-eq .9s ease-in-out infinite}.w4d-eq i:nth-child(2){animation-delay:.18s}.w4d-eq i:nth-child(3){animation-delay:.36s}@keyframes w4d-eq{0%,to{height:5px}50%{height:17px}}.w4d-item[data-playing="1"] .w4d-disc-sm{display:none}.w4d-item[data-playing="1"] .w4d-eq{display:flex}@media(prefers-reduced-motion:reduce){.w4d-eq i{animation:none;height:11px}}.w4d-info{min-width:0;flex:1 1 auto}.w4d-t{display:block;overflow:hidden;font-size:13.5px;font-weight:700;white-space:nowrap;text-overflow:ellipsis}.w4d-sub{display:block;margin-top:2px;overflow:hidden;font-size:11px;white-space:nowrap;text-overflow:ellipsis;opacity:.55}.w4d-time{flex:0 0 auto;font-size:11px;opacity:.6;font-variant-numeric:tabular-nums}#w4d-lyrics-box{padding:10px 12px 14px;border-top:1px dashed var(--tpl-border, #bcb49e);white-space:pre-line;font-size:12px;line-height:1.9;overflow-y:auto}#w4d-lyrics-box[hidden]{display:none}.w4-sky{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;overflow:hidden}.w4-sky[data-mood=비]:before{content:"";position:absolute;top:-20%;right:-10%;bottom:-20%;left:-10%;background-image:repeating-linear-gradient(102deg,transparent 0 9px,currentcolor 9px 10px,transparent 10px 22px);opacity:.13;animation:w4-rain .9s linear infinite}@keyframes w4-rain{to{transform:translate3d(-22px,108px,0)}}Line truncated
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
statSync,
|
||||
writeFileSync,
|
||||
} from 'node:fs';
|
||||
import {createHash} from 'node:crypto';
|
||||
import {writeFile as writeFileAsync} from 'node:fs/promises';
|
||||
import {basename, dirname, join, resolve} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {SourceType, type SitePayload} from '@o2o/shared';
|
||||
@@ -75,6 +77,33 @@ import {MOONLIGHT_STAY_PAYLOAD} from '@site/fixtures/moonlight-stay';
|
||||
/** 사이트별 산출물이 놓이는 디렉터리. 발행 주소 `<host>/s/<slug>` 와 같은 모양이다. */
|
||||
const SITE_DIR = 's';
|
||||
|
||||
/**
|
||||
* 손으로 만든 시연본(목업)이 차지한 슬러그. **이 슬러그는 굽지 않는다.**
|
||||
*
|
||||
* ★ 왜 (2026-09-15, 실측)
|
||||
* `/s/stay` 는 payload 가 없는 목업이고 그 index.html 이 **유일본**이다(AGENTS.md 함정 1).
|
||||
* 그런데 누군가 빌더에서 슬러그 `stay` 로 발행하자 `payloads/stay.json` 이 생겼고, 프리렌더가
|
||||
* 기동하며 그 payload 로 같은 자리를 구워 **목업을 통째로 덮었다** — 캐치프레이즈 100개 ·
|
||||
* 미니 플레이어 · 날씨 문구 · 주입분이 전부 사라졌다. 파일을 백업에서 되돌려야 했다.
|
||||
* "payload 가 없으면 안 굽는다" 는 목업을 지켜 주지 못한다. **payload 가 생기는 순간** 덮인다.
|
||||
*
|
||||
* ★ 슬러그를 막는 것이지 발행을 막는 것이 아니다. 백엔드는 발행에 성공했다고 보고, 여기서
|
||||
* 실패 보고서를 써 준다 — 사장님 화면에 사유가 뜨고, 목업은 그대로 남는다.
|
||||
*
|
||||
* ★ `stay` 하나만 막는다. `stay2` · `stay3` 도 원래 목업이었지만 그 슬러그는 이미 실제 사이트가
|
||||
* 가져가 발행 중이라(버터브루 = stay2) 막으면 그 사이트가 재굽기에서 빠진다.
|
||||
* 시연본은 `/s/stay` 다(mockup/README 2.1).
|
||||
*
|
||||
* ★ 목업을 늘리거나 걷어낼 때는 `PRERENDER_PROTECTED_SLUGS`(쉼표) 로 덮어쓴다. 값을 비우면
|
||||
* 보호가 전부 풀린다 — 목업을 정식 사이트로 넘길 때만 그렇게 한다.
|
||||
*/
|
||||
const PROTECTED_SLUGS = new Set(
|
||||
(process.env.PRERENDER_PROTECTED_SLUGS ?? 'stay')
|
||||
.split(',')
|
||||
.map((slug) => slug.trim())
|
||||
.filter(Boolean),
|
||||
);
|
||||
|
||||
const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const SITE_ROOT = resolve(HERE, '..', '..'); // dist/prerender → site/
|
||||
// 백엔드가 노래 파일을 떨구는 자리. payload 디렉토리와 나란히 둔다(한 디렉토리 약속).
|
||||
@@ -85,14 +114,25 @@ interface Args {
|
||||
/** --payload 은 여러 번 줄 수 있다. 비면 데모 payload 로 굽는다. */
|
||||
payloads: string[];
|
||||
out: string;
|
||||
/** 굽지 않고 **이미 구워진 HTML 의 자산 주소만** 새 번들로 갈아 끼운다. `main()` 주석 참조. */
|
||||
refreshAssets: boolean;
|
||||
/** payload 가 사는 디렉토리. 자산 주소를 갈아 끼울 대상을 **payload 가 있는 슬러그로** 좁힌다. */
|
||||
payloadDir: string;
|
||||
}
|
||||
|
||||
function parseArgs(): Args {
|
||||
const args: Args = {payloads: [], out: join(SITE_ROOT, 'out')};
|
||||
const args: Args = {
|
||||
payloads: [],
|
||||
out: join(SITE_ROOT, 'out'),
|
||||
refreshAssets: false,
|
||||
payloadDir: join(SITE_ROOT, 'payloads'),
|
||||
};
|
||||
for (const arg of process.argv.slice(2)) {
|
||||
const [key, value] = arg.replace(/^--/, '').split('=');
|
||||
if (key === 'payload' && value) args.payloads.push(value);
|
||||
if (key === 'out' && value) args.out = resolve(process.cwd(), value);
|
||||
if (key === 'refresh-assets') args.refreshAssets = true;
|
||||
if (key === 'payload-dir' && value) args.payloadDir = resolve(process.cwd(), value);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
@@ -271,6 +311,156 @@ function copyDirectoryFiles(source: string, destination: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 내려받은 사진이 놓이는 폴더. 사이트 디렉토리 안이라 Azure 발행 때 함께 올라간다. */
|
||||
const MEDIA_DIR = 'img';
|
||||
|
||||
/** 한 장당 상한(바이트). 원본이 통짜 PNG 인 경우가 있어 막아 둔다 — 넘으면 원래 주소로 둔다. */
|
||||
const MEDIA_MAX_BYTES = 8 * 1024 * 1024;
|
||||
|
||||
const MEDIA_EXT: Record<string, string> = {
|
||||
'image/jpeg': '.jpg',
|
||||
'image/jpg': '.jpg',
|
||||
'image/png': '.png',
|
||||
'image/webp': '.webp',
|
||||
'image/avif': '.avif',
|
||||
'image/gif': '.gif',
|
||||
};
|
||||
|
||||
/**
|
||||
* 사진을 **우리 오리진으로 옮긴다.**
|
||||
*
|
||||
* ★ 왜 (2026-09-15, 실측)
|
||||
* 발행본 사진은 수집한 자리(`*.pstatic.net` · `tong.visitkorea.or.kr`)를 그대로 가리켰다.
|
||||
* 그 호스트들은 `Access-Control-Allow-Origin` 을 주지 않는다 — 그래서 그 사진을 캔버스에
|
||||
* 그리면 **캔버스가 오염돼 파일로 못 뽑는다**(브라우저 정책). 엽서 쓰기의 저장·공유가
|
||||
* 모든 발행 사이트에서 막혀 있었고("이 사진은 다른 사이트에 올라와 있어…"),
|
||||
* 화면에는 미리보기만 남았다. 클라이언트에서는 넘을 방법이 없다 — CORS 없는 `fetch` 도
|
||||
* 같은 벽에 막힌다. **같은 오리진에 파일이 있어야** 풀린다.
|
||||
* ★ 덤이 아니라 같이 딸려 오는 것: 남의 CDN 이 핫링크를 끊거나 주소를 바꾸면 사진이
|
||||
* 통째로 사라지는데, 옮겨 놓으면 그 일이 우리 사이트를 건드리지 못한다.
|
||||
* ★ **재게시 권리(DECISIONS 1-2)의 결론을 앞당기지 않는다.** 화면에 이미 싣고 있는 것만
|
||||
* 같은 자리로 옮기는 것이고, `originUrl` · `sourceType` 은 그대로 남는다 —
|
||||
* "불가" 로 결론 나면 `sourceType = CRAWL` 을 발행에서 빼는 그 대응이 그대로 먹는다.
|
||||
* ★ 실패는 조용히 넘긴다. 못 받은 사진은 **원래 주소를 그대로 쓴다** — 사진이 사라지는 것보다
|
||||
* 공유가 막힌 채로 보이는 쪽이 낫다.
|
||||
*/
|
||||
async function mirrorMedia(payload: SitePayload, outRoot: string) {
|
||||
const items = (payload.media ?? []).filter((item) => /^https?:\/\//i.test(item.url ?? ''));
|
||||
if (items.length === 0) return;
|
||||
|
||||
const siteDir = join(outRoot, SITE_DIR, payload.site.slug);
|
||||
const dir = join(siteDir, MEDIA_DIR);
|
||||
// ★ 절대 주소로 바꾼다. 이 주소는 `<img src>` 뿐 아니라 og:image · JSON-LD 의 image 로도
|
||||
// 나가는데, 그 둘은 절대 주소여야 한다(상대 주소를 주면 크롤러마다 다르게 읽는다).
|
||||
// 수집 주소도 절대였으니 바뀌는 것은 호스트뿐이다.
|
||||
const publicBase = joinUrl(payload.site.origin, payload.site.basePath);
|
||||
mkdirSync(dir, {recursive: true});
|
||||
|
||||
const wanted = new Set<string>();
|
||||
let fetched = 0;
|
||||
|
||||
for (const item of items) {
|
||||
const origin = item.url;
|
||||
// 파일명은 **주소의 해시**다. 같은 사진이 두 사이트에 있어도 각자 폴더라 부딪히지 않고,
|
||||
// 주소가 그대로면 이름도 그대로라 다시 구워도 내려받지 않는다.
|
||||
const stem = createHash('sha1').update(origin).digest('hex').slice(0, 16);
|
||||
const hit = readdirSync(dir).find((name) => name.startsWith(`${stem}.`));
|
||||
if (hit) {
|
||||
wanted.add(hit);
|
||||
item.url = joinUrl(publicBase, `${MEDIA_DIR}/${hit}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch(origin, {
|
||||
// 봇 차단을 우회하는 게 아니라, 기본 UA 를 거절하는 CDN 에 평범한 브라우저로 보이게 한다.
|
||||
headers: {'user-agent': 'Mozilla/5.0 (compatible; o2o-web4ai/1.0)'},
|
||||
signal: AbortSignal.timeout(15_000),
|
||||
});
|
||||
const type = (res.headers.get('content-type') ?? '').split(';')[0].trim().toLowerCase();
|
||||
const ext = MEDIA_EXT[type];
|
||||
if (!res.ok || !ext) throw new Error(`${res.status} ${type || '타입 없음'}`);
|
||||
const body = new Uint8Array(await res.arrayBuffer());
|
||||
if (body.byteLength === 0 || body.byteLength > MEDIA_MAX_BYTES) {
|
||||
throw new Error(`${body.byteLength} 바이트`);
|
||||
}
|
||||
const name = `${stem}${ext}`;
|
||||
await writeFileAsync(join(dir, name), body);
|
||||
wanted.add(name);
|
||||
item.url = joinUrl(publicBase, `${MEDIA_DIR}/${name}`);
|
||||
fetched += 1;
|
||||
} catch (ex) {
|
||||
console.warn(` ! 사진을 못 받았습니다(원래 주소를 씁니다): ${origin} — ${ex}`);
|
||||
}
|
||||
}
|
||||
|
||||
// 지난 발행의 사진은 치운다 — 노래(copySongs)와 같은 이유다. 안 치우면 사장님이 사진을
|
||||
// 바꿀 때마다 쌓이고, Azure 발행 때 그대로 같이 올라간다.
|
||||
for (const name of readdirSync(dir)) {
|
||||
if (!wanted.has(name)) rmSync(join(dir, name), {force: true});
|
||||
}
|
||||
if (fetched > 0) console.log(` 사진 ${fetched}장을 내려받았습니다 (총 ${wanted.size}장)`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미 구워진 사이트의 **자산 주소만** 새 번들로 갈아 끼운다. 내용은 건드리지 않는다.
|
||||
*
|
||||
* ★ 왜 이게 기본인가 (2026-09-15 대표 지시: "새로 만드는거만 기능적용, 나머지는 css js
|
||||
* 에셋 주소만 바꿔치기")
|
||||
* 예전에는 컨테이너가 뜰 때마다 payload 전부를 다시 구웠다. 그러면 렌더러를 한 줄 고칠
|
||||
* 때마다 **이미 나가 있는 사이트의 HTML 이 통째로 바뀐다** — 사장님이 발행한 적 없는데
|
||||
* 내용이 달라지고, 구글이 다시 읽어 가는 값도 달라진다. 새 기능은 **다음 발행 때** 들어간다.
|
||||
* ★ 그런데 번들 파일명은 콘텐츠 해시라, 아무것도 안 하면 옛 HTML 이 옛 번들을 가리킨 채
|
||||
* 남는다. 그 자산은 `referencedAssets` 덕에 지워지지는 않지만(AGENTS.md), 디자인 수정이
|
||||
* 영영 반영되지 않는다. 그래서 **주소만** 바꾼다 — 시연본(`/s/stay`)에 하던 그 일이다
|
||||
* (mockup/README "번들만 갈아 끼운다").
|
||||
* ★ 서버가 그린 HTML 은 옛 렌더러의 것이고 붙는 스크립트는 새 렌더러다. 하이드레이션이
|
||||
* 어긋나면 리액트가 그 자리에서 다시 그린다 — 손님 화면은 새것, 크롤러가 읽는 정적
|
||||
* HTML 은 옛것이다. 그 둘을 맞추는 방법은 재발행뿐이고, 그건 사장님이 누르는 것이다.
|
||||
* ★ 이번에 구운 사이트는 건너뛴다(이미 새 주소다).
|
||||
* ★ ★ **payload 가 없는 디렉토리는 건드리지 않는다** — 목업(`stay3` · `*.old`)이다.
|
||||
* 손으로 만든 유일본이라 다시 만들 수 없고(AGENTS.md 함정 1), 옛 렌더러가 그린 HTML 에
|
||||
* 최신 번들을 물리면 어떻게 깨지든 되돌릴 방법이 없다. 그것들의 번들 교체는 사람이
|
||||
* 한다(mockup/README "번들만 갈아 끼운다"). 보호 슬러그도 같은 이유로 건너뛴다.
|
||||
*/
|
||||
function refreshBakedAssets(
|
||||
outRoot: string,
|
||||
assets: {script: string; css: string[]},
|
||||
baked: Set<string>,
|
||||
payloadDir: string,
|
||||
) {
|
||||
const sitesDir = join(outRoot, SITE_DIR);
|
||||
if (!existsSync(sitesDir)) return;
|
||||
|
||||
const owned = new Set(
|
||||
(existsSync(payloadDir) ? readdirSync(payloadDir) : [])
|
||||
.filter((name) => name.endsWith('.json') && !name.startsWith('.'))
|
||||
.map((name) => name.slice(0, -'.json'.length)),
|
||||
);
|
||||
|
||||
const css = assets.css[0];
|
||||
let changed = 0;
|
||||
|
||||
for (const entry of readdirSync(sitesDir, {withFileTypes: true})) {
|
||||
if (!entry.isDirectory()) continue;
|
||||
if (baked.has(entry.name) || PROTECTED_SLUGS.has(entry.name)) continue;
|
||||
if (!owned.has(entry.name)) continue;
|
||||
|
||||
const file = join(sitesDir, entry.name, 'index.html');
|
||||
if (!existsSync(file)) continue;
|
||||
const before = readFileSync(file, 'utf-8');
|
||||
// 접두사(`/assets` · `/sites/assets`)는 그대로 두고 파일명만 바꾼다 — 사이트가
|
||||
// 서브패스에 마운트돼 있으면 접두사가 다르다(assetPlan).
|
||||
let after = before.replace(/(assets\/)index-[A-Za-z0-9_-]+\.js/g, `$1${assets.script}`);
|
||||
if (css) after = after.replace(/(assets\/)index-[A-Za-z0-9_-]+\.css/g, `$1${css}`);
|
||||
if (after === before) continue;
|
||||
writeFileSync(file, after, 'utf-8');
|
||||
changed += 1;
|
||||
}
|
||||
|
||||
console.log(` ✓ 자산 주소 갱신 ${changed}곳 (내용은 그대로 — 새 기능은 다음 발행 때)`);
|
||||
}
|
||||
|
||||
function assetPlan(payload: SitePayload, outRoot: string, siteDir: string) {
|
||||
const basePath = payload.site.basePath.replace(/\/+$/, '');
|
||||
const suffix = `/${SITE_DIR}/${payload.site.slug}`;
|
||||
@@ -828,11 +1018,26 @@ function writeIndexNowKey(outRoot: string) {
|
||||
console.log(' ✓ IndexNow 키 파일');
|
||||
}
|
||||
|
||||
function main() {
|
||||
async function main() {
|
||||
const args = parseArgs();
|
||||
const loaded = loadPayloads(args.payloads);
|
||||
const assets = readAssets();
|
||||
|
||||
/*
|
||||
* ★ 기동 모드 — 굽지 않고 자산 주소만 갈아 끼운다(`refreshBakedAssets` 주석).
|
||||
* 컨테이너가 뜰 때 전부 다시 굽던 자리다. 2026-09-15 대표 지시로 바뀌었다:
|
||||
* **새로 발행하는 사이트만 새 기능을 받는다.**
|
||||
*/
|
||||
if (args.refreshAssets && args.payloads.length === 0) {
|
||||
console.log(`[prerender] 자산 주소만 갱신 → ${args.out}`);
|
||||
writeSharedAssets(args.out, referencedAssets(args.out));
|
||||
refreshBakedAssets(args.out, assets, new Set(), args.payloadDir);
|
||||
writePreviewShell(args.out, assets);
|
||||
console.log('[prerender] 완료');
|
||||
return;
|
||||
}
|
||||
|
||||
const loaded = loadPayloads(args.payloads);
|
||||
|
||||
console.log(`[prerender] 사이트 ${loaded.length}개 → ${args.out}`);
|
||||
|
||||
// ★ 굽기 **전에** 참조를 훑는다. 이번에 다시 굽지 않는 사이트(payload 가 없는 목업 포함)가
|
||||
@@ -843,6 +1048,8 @@ function main() {
|
||||
writeSharedAssets(args.out, referenced);
|
||||
|
||||
let failed = 0;
|
||||
/** 이번에 실제로 구운 슬러그. 자산 주소 갱신에서 빼려고 모은다(이미 새 주소다). */
|
||||
const baked = new Set<string>();
|
||||
/** 루트 기계용 파일을 쓸 오리진. 이 호스트의 사이트는 전부 같은 오리진을 쓴다. */
|
||||
let origin = '';
|
||||
|
||||
@@ -883,9 +1090,22 @@ function main() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// ★ 목업이 쓰는 슬러그는 굽지 않는다 — 구우면 손으로 만든 유일본을 덮는다(PROTECTED_SLUGS).
|
||||
if (PROTECTED_SLUGS.has(entry.payload.site.slug)) {
|
||||
fail(
|
||||
entry,
|
||||
`슬러그 '${entry.payload.site.slug}' 는 시연본이 쓰고 있어 발행할 수 없습니다. 다른 슬러그로 발행해 주세요.`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
// ★ 굽기 **전에** 사진을 우리 자리로 옮긴다 — 렌더·JSON-LD·og:image 가 전부 같은
|
||||
// payload 를 보므로, 여기서 주소를 바꿔 놓아야 한 벌로 맞는다.
|
||||
await mirrorMedia(entry.payload, args.out);
|
||||
const result = prerenderSite(entry.payload, args.out, assets, referenced);
|
||||
const payload = result.payload;
|
||||
baked.add(payload.site.slug);
|
||||
origin = origin || payload.site.origin;
|
||||
const home = joinUrl(payload.site.origin, payload.site.basePath);
|
||||
console.log(
|
||||
@@ -927,6 +1147,9 @@ function main() {
|
||||
}
|
||||
}
|
||||
|
||||
// ★ 이번에 안 구운 사이트도 **번들 주소는** 새것으로 맞춰 둔다. 내용은 그대로다.
|
||||
if (args.refreshAssets) refreshBakedAssets(args.out, assets, baked, args.payloadDir);
|
||||
|
||||
// ★ 실패한 사이트가 있어도 루트 파일은 갱신한다 — 성공한 사이트까지 색인에서 빠질 이유가 없다.
|
||||
// (인덱스는 디스크를 훑으므로 실패한 사이트는 애초에 들어가지 않는다.)
|
||||
writePreviewShell(args.out, assets);
|
||||
@@ -940,4 +1163,4 @@ function main() {
|
||||
console.log('[prerender] 완료');
|
||||
}
|
||||
|
||||
main();
|
||||
void main();
|
||||
@@ -33,6 +33,7 @@ const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const ROOT = resolve(HERE, '..');
|
||||
const PAYLOAD_DIR = join(ROOT, 'payloads');
|
||||
const PRERENDER_JS = join(ROOT, 'dist', 'prerender', 'prerender.js');
|
||||
const SITES_DIR = join(ROOT, 'out', 's');
|
||||
const ONCE = process.argv.includes('--once');
|
||||
|
||||
/** 폴링 간격. 발행은 분 단위 작업이라 2초 지연은 문제가 되지 않는다. */
|
||||
@@ -156,6 +157,27 @@ function prerender(files, reason) {
|
||||
return run('node', [PRERENDER_JS, ...files.map((file) => `--payload=${file}`)], label);
|
||||
}
|
||||
|
||||
/**
|
||||
* 기동 때 하는 일 — **굽지 않고 자산 주소만 갈아 끼운다.**
|
||||
*
|
||||
* ★ 왜 (2026-09-15 대표 지시: "전체 재굽기 할 필요가 없어, 사장님이 재발행하면 끝인데 /
|
||||
* css js만 안 깨지게 하란 말이야")
|
||||
* 예전에는 여기서 payload 를 전부 다시 구웠다. 그러면 렌더러를 고칠 때마다 이미 나가 있는
|
||||
* 사이트의 HTML 이 통째로 바뀐다 — 사장님은 발행한 적이 없는데 내용이 달라진다.
|
||||
* 새 기능은 **다음 발행 때** 들어가면 되고, 기존 사이트는 번들만 안 깨지면 된다.
|
||||
* ★ 번들 파일명이 콘텐츠 해시라 이것마저 안 하면 옛 HTML 이 옛 번들을 가리킨 채 굳는다.
|
||||
* 자산 자체는 지워지지 않지만(`prerender.ts` referencedAssets) 디자인 수정이 영영 안 간다.
|
||||
*/
|
||||
function refreshAssets() {
|
||||
// payload 디렉토리를 넘긴다 — 자산 주소를 갈아 끼울 대상을 **payload 가 있는 슬러그로**
|
||||
// 좁히려는 것이다. 목업(payload 없는 디렉토리)은 손으로 바꾼다(AGENTS.md 함정 1).
|
||||
return run(
|
||||
'node',
|
||||
[PRERENDER_JS, '--refresh-assets', `--payload-dir=${PAYLOAD_DIR}`],
|
||||
'자산 주소 갱신 — 기동',
|
||||
);
|
||||
}
|
||||
|
||||
// ── 큐 ────────────────────────────────────────────────────────────────────
|
||||
/** 굽기를 기다리는 payload 경로. 굽는 동안 들어온 변경은 여기에 쌓였다가 이어서 돈다. */
|
||||
const pending = new Set();
|
||||
@@ -209,6 +231,11 @@ function basenameOf(file) {
|
||||
return file.slice(file.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
/** 그 payload 가 이미 구워져 있나. 파일명이 슬러그다(백엔드가 `<slug>.json` 으로 쓴다). */
|
||||
function bakedIndexOf(file) {
|
||||
return join(SITES_DIR, basenameOf(file).replace(/\.json$/, ''), 'index.html');
|
||||
}
|
||||
|
||||
/** payload 디렉토리의 *.json 목록. 백엔드가 rename 전에 쓰는 임시파일(.tmp)은 건너뛴다. */
|
||||
function listPayloads() {
|
||||
if (!existsSync(PAYLOAD_DIR)) return [];
|
||||
@@ -228,11 +255,16 @@ async function main() {
|
||||
return;
|
||||
}
|
||||
|
||||
// 기동 시 한 번은 전부 굽는다. 감시가 꺼져 있는 동안 발행된 것도 사이트가 있어야 하고,
|
||||
// 코드가 바뀌었다면 번들이 새로 나왔으므로 기존 사이트도 다시 구워야 맞다.
|
||||
// ★ 기동 시 전부 굽지 않는다(refreshAssets 주석). 자산 주소만 맞추고, 내용은
|
||||
// 사장님이 다시 발행할 때 새 렌더러로 구워진다.
|
||||
const all = listPayloads();
|
||||
const seen = new Map(all.map((file) => [file, statSync(file).mtimeMs]));
|
||||
await prerender(all, '기동');
|
||||
await refreshAssets();
|
||||
|
||||
// 아직 한 번도 안 구워진 payload 는 굽는다 — 감시가 꺼져 있는 동안 발행됐거나 볼륨이
|
||||
// 비어 있던 경우다. 사이트가 아예 없는 것과 "옛 내용으로 서 있는 것" 은 다른 문제다.
|
||||
const unbuilt = all.filter((file) => !existsSync(bakedIndexOf(file)));
|
||||
await prerender(unbuilt, '아직 안 구워진 것');
|
||||
|
||||
if (ONCE) return;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ const ANCHOR: Record<string, string> = {
|
||||
songs: 'songs',
|
||||
daily: 'daily',
|
||||
chronicle: 'chronicle',
|
||||
reading: 'reading',
|
||||
people: 'people',
|
||||
quiz: 'quiz',
|
||||
postcard: 'postcard',
|
||||
@@ -84,6 +85,7 @@ const FALLBACK_LABEL: Record<string, string> = {
|
||||
songs: '노래',
|
||||
daily: '일력',
|
||||
chronicle: '연표',
|
||||
reading: '읽기',
|
||||
people: '인물',
|
||||
quiz: '퀴즈',
|
||||
postcard: '엽서',
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
/**
|
||||
* 엽서 한 장을 캔버스에 그린다.
|
||||
*
|
||||
* ★ 시연본이 먼저다. `solution/site/scripts/mockup/inject.js` 의 `postcardMaker` 가 이 그림을
|
||||
* 먼저 만들었고(2026-09-14 대표 확정), 여기는 그 규칙을 발행본으로 옮긴 것이다.
|
||||
* 여백 56 · 우표 칸 190 · 최대 4줄 같은 값은 두 곳에 같이 있다 — 하나를 고치면 같이 고친다.
|
||||
* ★ 그리기만 한다. 사진 고르기·글자 입력·공유는 부르는 쪽(PostcardMakerSection)이 맡는다 —
|
||||
* 캔버스 규칙과 화면 조작을 한 파일에 섞으면 둘 다 못 읽게 된다.
|
||||
*/
|
||||
|
||||
/** 정사각형 1080 — 공유 시트에 올라가는 이미지의 1:1 관례와 같다. */
|
||||
export const POSTCARD_SIZE = 1080;
|
||||
/** 문구는 넉 줄까지만 (2026-09-14 대표: "4줄이상 못쓰게 막으라고"). */
|
||||
export const MAX_LINES = 4;
|
||||
|
||||
const MARGIN = 56;
|
||||
const STAMP_COL_W = 190;
|
||||
const INK = '#1b1a15';
|
||||
const PAPER = '#efe7d3';
|
||||
const ACCENT = '#bf2f1b';
|
||||
|
||||
/** 문구가 들어갈 칸의 폭. 입력을 막을 때도 이 값으로 미리 재야 화면과 그림이 갈리지 않는다. */
|
||||
export function textColumnWidth(size: number = POSTCARD_SIZE): number {
|
||||
return size - MARGIN - STAMP_COL_W - MARGIN - 24;
|
||||
}
|
||||
|
||||
/**
|
||||
* 캔버스는 CSS 처럼 저절로 줄을 안 바꾼다 — 폭에 맞춰 손으로 접는다.
|
||||
* ★ 엔터는 그대로 줄바꿈이다. 먼저 `\n` 으로 문단을 가르고 문단만 접는다 —
|
||||
* 공백과 같이 묶어 쪼개면 손님이 누른 엔터가 사라진다.
|
||||
* ★ 공백 없는 긴 글자열(자음만 이어친 것)은 글자 단위로도 접는다. 안 그러면 우표 칸으로 넘친다.
|
||||
*/
|
||||
export function wrapLines(ctx: CanvasRenderingContext2D, text: string, maxWidth: number): string[] {
|
||||
const lines: string[] = [];
|
||||
text.split('\n').forEach((para) => {
|
||||
if (para.trim() === '') {
|
||||
lines.push('');
|
||||
return;
|
||||
}
|
||||
let line = '';
|
||||
para.split(' ').forEach((word) => {
|
||||
const test = line ? `${line} ${word}` : word;
|
||||
if (ctx.measureText(test).width <= maxWidth) {
|
||||
line = test;
|
||||
return;
|
||||
}
|
||||
if (line) lines.push(line);
|
||||
if (ctx.measureText(word).width <= maxWidth) {
|
||||
line = word;
|
||||
return;
|
||||
}
|
||||
let chunk = '';
|
||||
for (const ch of word) {
|
||||
const next = chunk + ch;
|
||||
if (ctx.measureText(next).width > maxWidth && chunk) {
|
||||
lines.push(chunk);
|
||||
chunk = ch;
|
||||
} else {
|
||||
chunk = next;
|
||||
}
|
||||
}
|
||||
line = chunk;
|
||||
});
|
||||
if (line) lines.push(line);
|
||||
});
|
||||
return lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* 소인(우표 옆 회전 원) 안 상호명.
|
||||
* ★ 업소 이름을 박아 두지 않는다 — 숙소든 카페든 같은 코드가 그린다. 콤마·공백에서 먼저 끊고,
|
||||
* 그래도 넓으면 글자 단위로 접는다("스테이,머뭄" 처럼 공백 없는 상호가 있다).
|
||||
*/
|
||||
function stampLines(ctx: CanvasRenderingContext2D, name: string, maxWidth: number): string[] {
|
||||
const lines: string[] = [];
|
||||
let line = '';
|
||||
name.split(/[,\s]+/).filter(Boolean).forEach((part) => {
|
||||
const test = line ? `${line} ${part}` : part;
|
||||
if (ctx.measureText(test).width <= maxWidth) {
|
||||
line = test;
|
||||
return;
|
||||
}
|
||||
if (line) lines.push(line);
|
||||
if (ctx.measureText(part).width <= maxWidth) {
|
||||
line = part;
|
||||
return;
|
||||
}
|
||||
let chunk = '';
|
||||
for (const ch of part) {
|
||||
const next = chunk + ch;
|
||||
if (ctx.measureText(next).width > maxWidth && chunk) {
|
||||
lines.push(chunk);
|
||||
chunk = ch;
|
||||
} else {
|
||||
chunk = next;
|
||||
}
|
||||
}
|
||||
line = chunk;
|
||||
});
|
||||
if (line) lines.push(line);
|
||||
return lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* 사진 한 장. 돌려주는 `exportable` 이 **이 엽서를 파일로 뽑을 수 있는지**를 가른다.
|
||||
*
|
||||
* ★ 캔버스는 남의 도메인 사진을 그리면 오염돼서(tainted) `toBlob` 이 막힌다 — 미리보기는
|
||||
* 보이는데 저장·공유만 SecurityError 로 죽는, 눈으로는 못 찾는 종류다.
|
||||
* ★ CORS 로 받아오면 안 오염된다. 그래서 먼저 `crossOrigin="anonymous"` 로 받아 본다.
|
||||
* 실측(2026-09-14): 발행본 사진은 네이버 CDN(`*.pstatic.net`)에 있고 그쪽은
|
||||
* `Access-Control-Allow-Origin` 을 주지 않는다 — 그래서 이 시도는 실패하고,
|
||||
* **CORS 없이 다시 받아 미리보기만** 세운다(저장·공유는 부르는 쪽이 막는다).
|
||||
* ★ **2026-09-15 에 근본을 고쳤다** — 굽는 쪽이 사진을 내려받아 `s/<slug>/img/` 에 두고
|
||||
* payload 의 주소를 우리 오리진으로 바꾼다(`scripts/prerender.ts` `mirrorMedia`).
|
||||
* 같은 오리진이면 오염되지 않는다. **다만 그건 다시 굽는 사이트에만 적용된다** —
|
||||
* 이미 나가 있는 사이트는 사장님이 재발행할 때까지 옛 주소를 문다.
|
||||
* ★ 그 사이를 **중계**가 메운다(`backend/router/v1/media/relay.py`). 두 번째 시도가 그것이다:
|
||||
* 같은 오리진의 `/v1/image/relay?url=…` 로 바이트를 받아 오면 브라우저는 그걸 우리 사진으로
|
||||
* 본다. 세 번째(맨손 로드)는 중계까지 막혔을 때의 미리보기 전용이다.
|
||||
* ★ 순서를 바꾸지 않는다 — 이미 우리 자리에 있는 사진은 첫 시도에서 끝나야 한다.
|
||||
* 중계를 먼저 걸면 우리 사진까지 서버를 한 번 더 거친다.
|
||||
*/
|
||||
const RELAY = '/v1/image/relay?url=';
|
||||
|
||||
async function loadImage(url: string): Promise<{img: HTMLImageElement; exportable: boolean}> {
|
||||
const tryLoad = (src: string, crossOrigin: string | null) =>
|
||||
new Promise<HTMLImageElement>((resolve, reject) => {
|
||||
const img = new Image();
|
||||
if (crossOrigin) img.crossOrigin = crossOrigin;
|
||||
img.onload = () => resolve(img);
|
||||
img.onerror = reject;
|
||||
img.src = src;
|
||||
});
|
||||
|
||||
try {
|
||||
return {img: await tryLoad(url, 'anonymous'), exportable: true};
|
||||
} catch {
|
||||
// 남의 CDN 이 CORS 를 안 줬다 — 우리 서버를 거쳐 같은 오리진으로 받아 본다.
|
||||
}
|
||||
if (/^https?:\/\//i.test(url)) {
|
||||
try {
|
||||
return {img: await tryLoad(`${RELAY}${encodeURIComponent(url)}`, 'anonymous'), exportable: true};
|
||||
} catch {
|
||||
// 중계가 없는 환경(정적 호스팅만 있는 미리보기)이거나 allowlist 밖이다.
|
||||
}
|
||||
}
|
||||
return {img: await tryLoad(url, null), exportable: false};
|
||||
}
|
||||
|
||||
/** 이 사이트가 쓰는 세리프를 그대로 쓴다 — 화면의 카드와 그림의 글씨가 갈리지 않게. */
|
||||
function serifFamily(): string {
|
||||
const probe = document.querySelector('.serif');
|
||||
const family = probe ? getComputedStyle(probe).fontFamily : '';
|
||||
return family || 'serif';
|
||||
}
|
||||
|
||||
/** 돌려주는 값: 이 그림을 파일로 뽑을 수 있는가(사진이 오염시키지 않았는가). */
|
||||
export async function drawPostcard(
|
||||
canvas: HTMLCanvasElement,
|
||||
{photoUrl, text, placeName, region}: {photoUrl: string; text: string; placeName: string; region: string},
|
||||
): Promise<boolean> {
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) return false;
|
||||
const size = canvas.width;
|
||||
const serif = serifFamily();
|
||||
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
ctx.fillStyle = PAPER;
|
||||
ctx.fillRect(0, 0, size, size);
|
||||
|
||||
const {img, exportable} = await loadImage(photoUrl);
|
||||
|
||||
// 위 — 사진(실제 카드 앞면과 같은 3:2)
|
||||
const photoW = size - MARGIN * 2;
|
||||
const photoH = photoW / 1.5;
|
||||
const scale = Math.max(photoW / img.width, photoH / img.height);
|
||||
const w = img.width * scale;
|
||||
const h = img.height * scale;
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.rect(MARGIN, MARGIN, photoW, photoH);
|
||||
ctx.clip();
|
||||
ctx.drawImage(img, MARGIN + (photoW - w) / 2, MARGIN + (photoH - h) / 2, w, h);
|
||||
ctx.restore();
|
||||
ctx.strokeStyle = 'rgba(27,26,21,0.25)';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeRect(MARGIN + 0.5, MARGIN + 0.5, photoW - 1, photoH - 1);
|
||||
|
||||
// 아래 — 괘선으로 가른 두 칸(문구 | 우표)
|
||||
const bodyY = MARGIN + photoH + 36;
|
||||
const dividerX = size - MARGIN - STAMP_COL_W;
|
||||
const textColW = textColumnWidth(size);
|
||||
ctx.strokeStyle = 'rgba(27,26,21,0.35)';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(dividerX, bodyY);
|
||||
ctx.lineTo(dividerX, size - MARGIN - 46);
|
||||
ctx.stroke();
|
||||
|
||||
// 왼쪽 — 손님이 쓴 한 마디
|
||||
ctx.fillStyle = INK;
|
||||
ctx.font = `600 46px ${serif}`;
|
||||
ctx.textAlign = 'left';
|
||||
ctx.textBaseline = 'alphabetic';
|
||||
const wrapped = wrapLines(ctx, `“${text.trim() || '오늘, 이 숙소에서 하루를 보냅니다.'}”`, textColW);
|
||||
// 입력에서 이미 막지만 여기서도 자른다 — 붙여넣기 같은 다른 경로로 들어와도 카드가 안 깨지게.
|
||||
const lines = wrapped.slice(0, MAX_LINES);
|
||||
if (wrapped.length > MAX_LINES) {
|
||||
let last = lines[MAX_LINES - 1];
|
||||
while (last.length && ctx.measureText(`${last}…`).width > textColW) last = last.slice(0, -1);
|
||||
lines[MAX_LINES - 1] = `${last}…`;
|
||||
}
|
||||
lines.forEach((line, i) => ctx.fillText(line, MARGIN, bodyY + 50 + i * 60));
|
||||
|
||||
// 오른쪽 — 우표 칸과 소인
|
||||
const stampCx = dividerX + STAMP_COL_W / 2;
|
||||
ctx.strokeStyle = INK;
|
||||
ctx.lineWidth = 1.5;
|
||||
ctx.setLineDash([4, 4]);
|
||||
ctx.strokeRect(stampCx - 44, bodyY, 88, 108);
|
||||
ctx.setLineDash([]);
|
||||
ctx.fillStyle = INK;
|
||||
ctx.font = `400 20px ${serif}`;
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText('郵票', stampCx, bodyY + 46);
|
||||
ctx.fillText('10원', stampCx, bodyY + 78);
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(stampCx, bodyY + 210);
|
||||
ctx.rotate((-6 * Math.PI) / 180);
|
||||
ctx.strokeStyle = ACCENT;
|
||||
ctx.lineWidth = 3;
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 62, 0, Math.PI * 2);
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = ACCENT;
|
||||
ctx.font = `600 22px ${serif}`;
|
||||
const nameLines = stampLines(ctx, placeName, 100).slice(0, 2);
|
||||
const startY = 8 - ((nameLines.length - 1) * 26) / 2;
|
||||
nameLines.forEach((line, i) => ctx.fillText(line, 0, startY + i * 26));
|
||||
ctx.restore();
|
||||
|
||||
// 맨 아래 — 점선과 서명 줄
|
||||
const footY = size - MARGIN - 30;
|
||||
ctx.strokeStyle = 'rgba(27,26,21,0.3)';
|
||||
ctx.setLineDash([3, 3]);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(MARGIN, footY - 20);
|
||||
ctx.lineTo(size - MARGIN, footY - 20);
|
||||
ctx.stroke();
|
||||
ctx.setLineDash([]);
|
||||
ctx.fillStyle = 'rgba(27,26,21,0.6)';
|
||||
ctx.font = `400 22px ${serif}`;
|
||||
ctx.textAlign = 'left';
|
||||
ctx.fillText(`${placeName} · ${region}`, MARGIN, footY + 6);
|
||||
return exportable;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
LocalGuideSection,
|
||||
WeatherSection,
|
||||
LocationSection,
|
||||
PostcardMakerSection,
|
||||
SpaceSection,
|
||||
UnitsSection,
|
||||
StayBookingSection,
|
||||
@@ -83,6 +84,20 @@ export function HomePage() {
|
||||
|
||||
const rendered = new Set<string>();
|
||||
|
||||
/*
|
||||
* 엽서 쓰기가 설 자리 — **계절별 축제 바로 앞**이다 (2026-09-14 대표: "이건 축제소개 전에
|
||||
* 섹션으로 빼줘", 2026-09-15: "목업처럼 순서 바꿔").
|
||||
*
|
||||
* ★ 섹션 설정(`theme.sections`)에 자리가 없는 기능이라 목록을 따라 그릴 수 없다. 그래서
|
||||
* **축제 바로 앞에 끼워 넣고**, 축제가 꺼져 있거나 없는 사이트에서는 맨 뒤로 보낸다 —
|
||||
* 자리를 못 찾았다고 기능을 통째로 빠뜨리지 않는다.
|
||||
* ★ 예전에는 목록을 다 그린 **뒤** 맨 아래에 뒀다. 그러면 FAQ·예약 안내보다도 밑이라
|
||||
* 시연본과 순서가 달랐다(시연본은 축제 앞).
|
||||
*/
|
||||
const festivalFirst = payload.theme.sections.some(
|
||||
(section) => section.enabled && section.id === 'festival' && SECTION_COMPONENTS.festival,
|
||||
);
|
||||
|
||||
return (
|
||||
<main className="w-full flex-1">
|
||||
<HeroSection />
|
||||
@@ -105,12 +120,17 @@ export function HomePage() {
|
||||
* 화면 id(`gallery`)와 설정 id(`photos`)가 달라서 필요하다.
|
||||
*/
|
||||
<div key={section.id} data-editor-id={section.id} style={{display: 'contents'}}>
|
||||
{/* 사진이 한 장도 없으면 만들 엽서가 없으므로 컴포넌트가 스스로 빠진다. */}
|
||||
{section.id === 'festival' && <PostcardMakerSection />}
|
||||
<Component />
|
||||
{section.id === 'intro' && <AnswerBlock />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* 축제 섹션이 없는 사이트 — 앞에 끼울 자리가 없었으니 여기서 낸다. */}
|
||||
{!festivalFirst && <PostcardMakerSection />}
|
||||
|
||||
{/* 섹션 설정에 없더라도 오시는 길은 항상 나간다 — 위치 질의의 근거다. */}
|
||||
{!isSectionEnabled(payload, 'map') && <LocationSection />}
|
||||
|
||||
|
||||
@@ -112,6 +112,25 @@ export function SiteFooter() {
|
||||
<time dateTime={site.updatedAt}>{isoDate(site.updatedAt)}</time>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/*
|
||||
★ 만든 곳 표기 (2026-09-15 대표: "푸터 하단에 Web4ai ai o2o 얘기도 적어주셈").
|
||||
payload 가 아니라 렌더러가 박는다 — 사장님이 어떤 템플릿을 골라도, 어떤 값을
|
||||
비워 두어도 모든 발행본에 같은 자리로 나와야 하는 한 줄이다.
|
||||
★ 위 두 칸(사업자 표기·byline)과 같은 활자·불투명도를 쓴다. 이 줄이 눈에 띄면
|
||||
사장님 사이트가 아니라 우리 사이트로 보인다.
|
||||
*/}
|
||||
<p className="pt-3 text-[length:var(--fs-xs)] opacity-55">
|
||||
<a
|
||||
href="https://www.o2osolution.ai/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline-offset-2 hover:underline"
|
||||
>
|
||||
AI O2O
|
||||
</a>
|
||||
의 Web4Ai로 만든 사이트입니다.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
|
||||
@@ -21,3 +21,4 @@ export {SiteFooter} from './SiteFooter';
|
||||
export {MobileTabBar} from './MobileTabBar';
|
||||
// 붙여넣기 아이템 — 데이터가 fact 가 아니라 사장님이 넣은 JSON 에서 온다(theme.sections[].data).
|
||||
export {ITEM_SECTIONS} from './items';
|
||||
export {PostcardMakerSection} from './items/PostcardMakerSection';
|
||||
@@ -0,0 +1,194 @@
|
||||
/**
|
||||
* 엽서 쓰기 — 손님이 사진을 고르고 한 마디를 적어 그 자리에서 엽서를 만들어 공유한다.
|
||||
*
|
||||
* ★ 시연본(`scripts/mockup/inject.js` postcardMaker)에서 옮겨 왔다 (2026-09-14 대표:
|
||||
* "웹빌드 해도 엽서쓰기 나오게"). 시연본은 주입 스크립트라 발행본에는 없었다.
|
||||
* ★ 그림 규칙은 `@site/lib/postcard-canvas` 한 곳에 있다 — 여기서는 고르기·입력·공유만 한다.
|
||||
* ★ **파일 그대로 공유**다(대표 확정). Web Share API 가 파일을 받으면 이미지가 그대로 대화방에
|
||||
* 올라간다. 못 받는 브라우저(주로 데스크톱)는 링크만 보내고, 그것도 안 되면 저장으로 떨어진다.
|
||||
* ★ 버튼 문구에 앱 이름을 못 박지 않는다 — 공유 시트는 OS 가 채운다. 손끝으로 쓰는 기기에서만
|
||||
* "카카오톡 등으로 공유" 라고 적는다(맥에서는 메시지·AirDrop 정도만 떠서 거짓말이 된다).
|
||||
*/
|
||||
import {useEffect, useRef, useState} from 'react';
|
||||
import {useSite} from '@site/lib/site-context';
|
||||
import {Carousel, Section} from '@site/lib/ui';
|
||||
import {MAX_LINES, POSTCARD_SIZE, drawPostcard, textColumnWidth, wrapLines} from '@site/lib/postcard-canvas';
|
||||
|
||||
const FILE_NAME = 'postcard.png';
|
||||
|
||||
export function PostcardMakerSection() {
|
||||
const payload = useSite();
|
||||
const photos = (payload.media ?? []).filter((m) => m.url);
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
const [picked, setPicked] = useState(0);
|
||||
const [text, setText] = useState('');
|
||||
const [hint, setHint] = useState('');
|
||||
const [touch, setTouch] = useState(false);
|
||||
/* 사진이 남의 도메인이면 캔버스가 오염돼 파일로 못 뽑는다(postcard-canvas.loadImage 주석).
|
||||
굽는 쪽이 사진을 우리 오리진으로 옮기고부터(prerender `mirrorMedia`) 여기 걸리는 건
|
||||
**내려받기에 실패한 사진**뿐이다. 그때는 미리보기만 남기고 저장·공유를 막는다 —
|
||||
눌러도 안 되는 단추를 두지 않는다. */
|
||||
const [exportable, setExportable] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
setTouch(window.matchMedia?.('(pointer: coarse)').matches ?? false);
|
||||
}, []);
|
||||
|
||||
const placeName = payload.place.name;
|
||||
const region = String(payload.place.address ?? '').split(' ').slice(0, 2).join(' ');
|
||||
|
||||
useEffect(() => {
|
||||
const canvas = canvasRef.current;
|
||||
const photo = photos[picked];
|
||||
if (!canvas || !photo?.url) return;
|
||||
// 글자를 칠 때마다 다시 그린다. 80ms 는 시연본과 같은 값 — 한 글자마다 그리면 캔버스가 버벅인다.
|
||||
const timer = window.setTimeout(() => {
|
||||
void drawPostcard(canvas, {photoUrl: photo.url, text, placeName, region}).then(setExportable);
|
||||
}, 80);
|
||||
return () => window.clearTimeout(timer);
|
||||
}, [picked, text, placeName, region, photos]);
|
||||
|
||||
// 폰트가 늦게 실리면 글씨가 기본 서체로 그려진 채 남는다 — 실리고 나서 한 번 더 그린다.
|
||||
useEffect(() => {
|
||||
const canvas = canvasRef.current;
|
||||
const photo = photos[picked];
|
||||
if (!canvas || !photo?.url || !document.fonts?.ready) return;
|
||||
void document.fonts.ready.then(() => drawPostcard(canvas, {photoUrl: photo.url, text, placeName, region}).then(setExportable));
|
||||
// 첫 그림 한 번만 — 이후는 위 효과가 맡는다.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
if (photos.length === 0) return null;
|
||||
|
||||
/** 몇 줄로 접힐지는 폭·서체에 달려 글자 수로는 못 잰다 — 그릴 때와 같은 함수로 재서 막는다. */
|
||||
function withinLineLimit(next: string): boolean {
|
||||
const ctx = canvasRef.current?.getContext('2d');
|
||||
if (!ctx) return true;
|
||||
ctx.font = `600 46px serif`;
|
||||
return wrapLines(ctx, `“${next}”`, textColumnWidth()).length <= MAX_LINES;
|
||||
}
|
||||
|
||||
function exportBlob(): Promise<Blob | null> {
|
||||
return new Promise((resolve) => {
|
||||
const canvas = canvasRef.current;
|
||||
if (!canvas) return resolve(null);
|
||||
canvas.toBlob((blob) => resolve(blob), 'image/png', 0.95);
|
||||
});
|
||||
}
|
||||
|
||||
function download(blob: Blob) {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = FILE_NAME;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
async function share() {
|
||||
const blob = await exportBlob();
|
||||
if (!blob) return;
|
||||
const pageUrl = document.querySelector<HTMLMetaElement>('meta[property="og:url"]')?.content
|
||||
?? `${location.origin}${location.pathname}`;
|
||||
const file = new File([blob], FILE_NAME, {type: 'image/png'});
|
||||
// 손님이 시트를 닫은 것도 거절로 온다 — 오류로 다루지 않는다.
|
||||
if (navigator.canShare?.({files: [file]})) {
|
||||
await navigator.share({files: [file], title: `${placeName} 엽서`, text: pageUrl}).catch(() => {});
|
||||
return;
|
||||
}
|
||||
if (navigator.share) {
|
||||
await navigator.share({title: `${placeName} 엽서`, url: pageUrl}).catch(() => {});
|
||||
setHint('이 브라우저는 사진을 같이 못 보내 링크만 보냈습니다. 사진은 "이미지로 저장" 을 눌러 주세요.');
|
||||
return;
|
||||
}
|
||||
download(blob);
|
||||
setHint('이 브라우저는 공유 시트를 못 열어 저장으로 대신했습니다.');
|
||||
}
|
||||
|
||||
return (
|
||||
<Section
|
||||
id="postcard-maker"
|
||||
title="엽서 쓰기"
|
||||
lead={`${placeName}에서 보내는 한 장을 직접 써 봅니다. 사진을 고르고 한 마디를 적으면 그 자리에서 엽서가 되고, 그대로 공유하거나 저장할 수 있습니다.`}
|
||||
>
|
||||
{/* ★ 폭을 묶어 둔다 (2026-09-15 대표: "엽서 ui 너무 큼"). 엽서는 1:1 이라 열 폭을
|
||||
그대로 주면 넓은 화면에서 한 변이 700px 넘는 정사각이 서서, 예약하러 온 손님이
|
||||
이 한 칸을 스크롤로 넘겨야 다음 섹션에 닿는다. 미리보기는 손바닥만 하면 된다.
|
||||
★ 폭은 두 번 왔다 갔다 했다(2026-09-15): 320 → 240(너무 작다) → **360**.
|
||||
기준은 "한 화면에서 엽서와 입력칸이 나란히 보이는 가장 큰 크기" 다. */}
|
||||
<div className="mx-auto grid max-w-3xl gap-5 sm:grid-cols-[minmax(0,360px)_minmax(0,1fr)] sm:items-start">
|
||||
<canvas
|
||||
ref={canvasRef}
|
||||
width={POSTCARD_SIZE}
|
||||
height={POSTCARD_SIZE}
|
||||
aria-label="내가 만든 엽서 미리보기"
|
||||
/* ★ 비율을 CSS 로 못 박는다 (2026-09-15 대표: "모바일에서 깨지잖아").
|
||||
`<canvas>` 에 width 만 주면 브라우저에 따라 **높이가 속성값(1080px) 그대로** 남아
|
||||
1080 폭짜리 그림이 좁은 폭에 눌린 채 늘어난다. `aspect-square h-auto` 로 못 박으면
|
||||
어느 브라우저에서도 정사각이다. `block` 은 inline 기준선 아래 생기는 틈을 없앤다. */
|
||||
className="border-line mx-auto block aspect-square h-auto w-full max-w-[360px] border"
|
||||
/>
|
||||
{/* ★ `min-w-0` 이 없으면 모바일에서 칸이 통째로 밀려난다 (2026-09-15 대표: "모바일에서
|
||||
엽서 넘침"). 그리드 칸의 기본 `min-width:auto` 는 **안에 든 것의 최소 너비**다 —
|
||||
사진 레일은 썸네일을 옆으로 죽 늘어놓으므로 그 값이 2,000px 을 넘었고(실측 390px
|
||||
화면에서 칸이 2056px), 칸이 화면 밖으로 나갔다. 스크롤 상자를 품은 칸에는 늘 붙인다. */}
|
||||
<div className="flex min-w-0 flex-col gap-2.5">
|
||||
{/* ★ 이 사이트가 쓰는 캐러셀을 그대로 쓴다 (2026-09-15 대표: "왜 이미지 리스트에
|
||||
slide js 안 걸려 있음?"). 처음엔 `.slider-viewport`·`.slider-track` 마크업만
|
||||
손으로 찍었는데, 그 둘은 **스크립트가 붙기 전의 기본 상태**다(Carousel.tsx 주석)
|
||||
— 손가락·트랙패드로만 밀리고 휠 마우스로는 옆에 더 있는 줄도 모른다. */}
|
||||
<div className="min-w-0" role="radiogroup" aria-label={`엽서 사진 고르기(${photos.length}장)`}>
|
||||
<Carousel label="엽서 사진" gap={0.5} dots={false} autoplay={false}>
|
||||
{photos.map((photo, i) => (
|
||||
<button
|
||||
key={photo.url}
|
||||
type="button"
|
||||
onClick={() => setPicked(i)}
|
||||
role="radio"
|
||||
aria-checked={i === picked}
|
||||
aria-label={`사진 ${i + 1}`}
|
||||
className="border-line size-10 shrink-0 overflow-hidden rounded border transition-opacity"
|
||||
style={{opacity: i === picked ? 1 : 0.5}}
|
||||
>
|
||||
<img src={photo.url} alt="" loading="lazy" className="size-full object-cover" />
|
||||
</button>
|
||||
))}
|
||||
</Carousel>
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
rows={2}
|
||||
maxLength={60}
|
||||
value={text}
|
||||
placeholder="엽서에 쓸 한 마디를 적어 보세요"
|
||||
onChange={(e) => { if (withinLineLimit(e.target.value)) setText(e.target.value); }}
|
||||
className="border-line w-full rounded border p-2.5 text-[length:var(--fs-sm)]"
|
||||
/>
|
||||
<p className="text-muted -mt-1 text-[length:var(--fs-xs)]">{text.length}/60</p>
|
||||
|
||||
{exportable ? (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button type="button" onClick={() => void share()} className="tap border-line rounded-full border px-3.5 py-1.5 text-[length:var(--fs-sm)] font-bold">
|
||||
{touch ? '카카오톡 등으로 공유' : '공유하기'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => void exportBlob().then((b) => b && download(b))}
|
||||
className="tap border-line rounded-full border px-3.5 py-1.5 text-[length:var(--fs-sm)]"
|
||||
>
|
||||
이미지로 저장
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
/* 브라우저 정책이라 여기서는 못 넘는다 — 사진이 이 사이트 주소로 와야 풀리고,
|
||||
그 일은 굽는 쪽(prerender `mirrorMedia`)이 한다. 여기까지 왔다는 건 그게 실패했다는 뜻. */
|
||||
<p className="text-muted text-[length:var(--fs-sm)]">
|
||||
이 사진은 다른 사이트에 올라와 있어 저장·공유가 막혀 있습니다. 화면으로만 보여 드립니다.
|
||||
</p>
|
||||
)}
|
||||
{hint && <p className="text-muted text-[length:var(--fs-xs)]">{hint}</p>}
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 지역 읽기 — 도시 이야기 더미에서 **매번 몇 개만** 뽑아 한 꼭지씩 넘겨 본다.
|
||||
*
|
||||
* ★ 왜 다 안 보여주나 (2026-09-14 대표: "34개중 15~19개인데 왜 34개라고 써놔?" →
|
||||
* "그냥 5-6개 정도만 보여주는거 어때?" → "랜덤으로")
|
||||
* 서른 꼭지를 한 화면에 펴면 스크롤 압박이 된다. 접는 게 아니라 **돌려 보여준다** —
|
||||
* 다음에 들어오면 다른 조합이 뜬다. 그래서 `<details>` 를 쓰지 않는다(다 남겨야 하는
|
||||
* FAQ·일력과는 다른 경우다).
|
||||
* ★ 인용은 손해 보지 않는다 — 안 뽑힌 꼭지도 `window.__SITE_PAYLOAD__` 로 문서 안에 그대로
|
||||
* 남는다(`scripts/prerender.ts`). 화면에서 고르는 것과 문서에서 지우는 것은 다른 일이다.
|
||||
* ★ 뽑기는 **붙은 뒤에** 한다. 구운 HTML 과 첫 렌더가 달라지면 하이드레이션이 깨진다 —
|
||||
* 서버는 앞에서부터 여섯 개를 세우고(크롤러가 읽는 것이 이것이다), 브라우저가 붙는 순간
|
||||
* 한 번 섞는다. 다시 섞지는 않는다(재렌더마다 바뀌면 읽던 카드가 눈앞에서 사라진다).
|
||||
* ★ 갈래(문학·역사·…)로 묶어 세우지 않는다. 갈래는 카드 위 이름표로만 쓰고, 뽑기는
|
||||
* 갈래를 가리지 않는다 — 갈래마다 3~4개씩 뽑던 판은 한 번에 15~19개가 떴다.
|
||||
*/
|
||||
import {useEffect, useState} from 'react';
|
||||
import type {ReadingItem} from '@o2o/shared';
|
||||
import {useSite} from '@site/lib/site-context';
|
||||
import {sectionItems, sectionName} from '@site/lib/derive';
|
||||
import {ITEM_ACCENT, ITEM_BORDER, ITEM_CARD, ItemSection, Rail, SourceLine} from './common';
|
||||
|
||||
/** 한 번에 세우는 꼭지 수. 5 와 6 사이에서 흔들어 "볼 때마다 다르다"를 만든다. */
|
||||
const MIN_PICK = 5;
|
||||
const MAX_PICK = 6;
|
||||
|
||||
function shuffled<T>(list: readonly T[]): T[] {
|
||||
const copy = list.slice();
|
||||
for (let i = copy.length - 1; i > 0; i -= 1) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[copy[i], copy[j]] = [copy[j], copy[i]];
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
export function ReadingSection() {
|
||||
const payload = useSite();
|
||||
const parsed = sectionItems<ReadingItem>(payload, 'reading');
|
||||
const all = parsed.items;
|
||||
// 서버·첫 렌더가 같아야 한다. 섞기는 아래 useEffect 가 붙은 뒤에 한 번만.
|
||||
const [picked, setPicked] = useState<ReadingItem[]>(() => all.slice(0, MAX_PICK));
|
||||
|
||||
useEffect(() => {
|
||||
if (all.length <= MIN_PICK) return;
|
||||
const count = Math.random() < 0.5 ? MIN_PICK : MAX_PICK;
|
||||
setPicked(shuffled(all).slice(0, count));
|
||||
// 더미 전체가 바뀔 때만 다시 뽑는다(발행본에서는 한 번뿐이다).
|
||||
}, [all]);
|
||||
|
||||
if (all.length === 0) return null;
|
||||
|
||||
const region = payload.place.addressLocality ?? '지역';
|
||||
return (
|
||||
<ItemSection
|
||||
id="reading"
|
||||
name={parsed.title || sectionName(payload, 'reading', `${region} 읽기`)}
|
||||
subtitle={parsed.subtitle}
|
||||
>
|
||||
<Rail label={`${region} 읽기`}>
|
||||
{picked.map((item, index) => (
|
||||
<article
|
||||
key={`${item.title}-${index}`}
|
||||
className="w-[86%] shrink-0 grow-0 sm:w-[min(600px,56%)]"
|
||||
>
|
||||
<div
|
||||
className="h-full border p-5"
|
||||
style={{backgroundColor: ITEM_CARD, borderColor: ITEM_BORDER}}
|
||||
>
|
||||
{/* 갈래 이름표. '문학면' 처럼 신문 지면으로 부르지 않는다 — 그 틀이 없다. */}
|
||||
{item.group && (
|
||||
<p
|
||||
className="text-[11px] font-bold tracking-[0.18em]"
|
||||
style={{color: ITEM_ACCENT}}
|
||||
>
|
||||
{item.group}
|
||||
{item.year != null && <span className="font-normal opacity-70"> · {item.year}</span>}
|
||||
</p>
|
||||
)}
|
||||
<h3
|
||||
className="serif mt-2 border-b-2 pb-2.5 text-xl leading-snug font-bold"
|
||||
style={{borderColor: 'currentColor'}}
|
||||
>
|
||||
{item.title}
|
||||
</h3>
|
||||
{/* 서너 문장이 들어온다 — 줄바꿈이 낱말 가운데를 끊지 않게 keep-all 로 둔다. */}
|
||||
<p className="mt-3 text-[14.5px] leading-[1.8] break-keep opacity-90">{item.body}</p>
|
||||
<div className="mt-4 border-t border-dashed pt-2.5" style={{borderColor: ITEM_BORDER}}>
|
||||
<SourceLine source={item.source} verified={item.verified} />
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</Rail>
|
||||
</ItemSection>
|
||||
);
|
||||
}
|
||||
@@ -24,8 +24,39 @@ import {
|
||||
tally,
|
||||
} from './common';
|
||||
|
||||
/** 곡이 라벨 색을 안 주면 템플릿 강조색이 라벨이 된다. */
|
||||
const FALLBACK_LABEL = ITEM_ACCENT;
|
||||
/**
|
||||
* 곡이 라벨 색을 안 줬을 때 쓸 색.
|
||||
*
|
||||
* ★ 왜 팔레트인가 (2026-09-15 대표 지적: "왜 색깔 다 빨간색이야")
|
||||
* 예전 폴백은 템플릿 강조색 하나였다(`ITEM_ACCENT`). 그런데 **실측 67곡 중 63곡에
|
||||
* `labelColor` 가 없다** — 프롬프트가 그 칸을 시키는데도 모델이 공통 규칙 2
|
||||
* ("확인되지 않은 값은 필드를 통째로 뺀다")를 색에까지 적용해 버린다. 결과는
|
||||
* 판 스물다섯 장이 전부 같은 주朱색인 진열대였다. 색은 사실이 아니라 디자인 값이라
|
||||
* **비어 있어도 화면은 달라야 한다.**
|
||||
* ★ **색은 시연본(`/s/stay`)이 쓰는 그 23색 그대로다** (2026-09-15 대표: "그냥 정해놔 ·
|
||||
* /s/stay 보고서 맞춰라"). 시연본은 25곡에 색이 다 붙어 있어 판 진열대가 알록달록한데,
|
||||
* 제품은 그 값이 비어 한 색으로 깔렸다. 목록을 새로 짜지 않고 **그 팔레트를 옮겨 왔다** —
|
||||
* 두 벌이 되면 시연본과 제품의 판 색이 갈린다. 원본은
|
||||
* `site/scripts/mockup/stay-payload-new.json` 의 `songs[].labelColor` 다.
|
||||
* ★ 제목으로 고른다 — **무작위가 아니다.** 서버에서 구운 색과 브라우저가 고른 색이
|
||||
* 달라지면 하이드레이션이 어긋나고, 새로고침마다 판 색이 바뀌면 그것도 우스워진다.
|
||||
*/
|
||||
const LABEL_PALETTE = [
|
||||
'#d4551f', '#1d3c74', '#2a6053', '#7a3b52', '#a34a2a',
|
||||
'#334b6d', '#4f6b3a', '#6b2f3a', '#2b6b7a', '#8a4b2a',
|
||||
'#4a3f6b', '#3a5a4a', '#b5603a', '#356b8a', '#6b4a2a',
|
||||
'#2f5b6b', '#a3562a', '#4a4a6b', '#c8873a', '#2f6b4f',
|
||||
'#7a4a6b', '#5a5a4a', '#3f5f6b',
|
||||
];
|
||||
|
||||
/** 제목 → 팔레트 index. 짧고 안정적이면 된다(암호학적 용도가 아니다). */
|
||||
function labelColorOf(song: SongItem): string {
|
||||
if (song.labelColor) return song.labelColor;
|
||||
const key = song.title ?? '';
|
||||
let hash = 0;
|
||||
for (let i = 0; i < key.length; i += 1) hash = (hash * 31 + key.charCodeAt(i)) >>> 0;
|
||||
return LABEL_PALETTE[hash % LABEL_PALETTE.length];
|
||||
}
|
||||
|
||||
export function SongsSection() {
|
||||
const payload = useSite();
|
||||
@@ -72,7 +103,7 @@ export function SongsSection() {
|
||||
<div
|
||||
className="w4-disc w4-spin absolute inset-2 rounded-full"
|
||||
style={{
|
||||
['--lbl' as string]: current.labelColor || FALLBACK_LABEL,
|
||||
['--lbl' as string]: labelColorOf(current),
|
||||
['--w4-vinyl' as string]: ITEM_INVERSE,
|
||||
}}
|
||||
>
|
||||
@@ -159,7 +190,7 @@ export function SongsSection() {
|
||||
<span
|
||||
className="w4-disc-mini mx-auto block size-[76px] rounded-full transition-transform hover:scale-105"
|
||||
style={{
|
||||
['--lbl' as string]: song.labelColor || FALLBACK_LABEL,
|
||||
['--lbl' as string]: labelColorOf(song),
|
||||
['--w4-vinyl' as string]: ITEM_INVERSE,
|
||||
boxShadow:
|
||||
index === playing ? `0 0 0 2px ${ITEM_ACCENT}` : undefined,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 군산 이야기 — 레트로 아이템 다섯을 한 섹션에 묶고 탭으로 가른다.
|
||||
* 지역 이야기 — 레트로 아이템 다섯을 한 섹션에 묶고 탭으로 가른다.
|
||||
*
|
||||
* ★ 왜 묶나 (2026-09-04, 사장님 요청)
|
||||
* 가요 다방·오늘의 한 장·인물 열전·시간의 골목·오늘의 엽서가 각각 섹션으로 서 있었다.
|
||||
* 가요 다방·인물 열전·시간의 골목·지역 읽기·오늘의 엽서가 각각 섹션으로 서 있었다.
|
||||
* 실측 390px 에서 다섯이 합쳐 3,470px — 전체의 17% 이고, 예약하러 온 손님은 이 구간을
|
||||
* 다섯 화면 넘게 밀어야 아래(주변·FAQ)에 닿았다. 성격이 같은 것들이니 한 자리에 묶고
|
||||
* **한 번에 하나만** 편다.
|
||||
@@ -17,6 +17,7 @@ import {sectionItems, sectionName} from '@site/lib/derive';
|
||||
import {SongsSection} from './SongsSection';
|
||||
import {PeopleSection} from './PeopleSection';
|
||||
import {ChronicleSection} from './ChronicleSection';
|
||||
import {ReadingSection} from './ReadingSection';
|
||||
import {PostcardSection} from './PostcardSection';
|
||||
import {ITEM_BORDER, ITEM_INK, ITEM_INVERSE_INK} from './common';
|
||||
|
||||
@@ -25,20 +26,28 @@ import {ITEM_BORDER, ITEM_INK, ITEM_INVERSE_INK} from './common';
|
||||
* 탭은 데이터가 있는 것만 선다 — 사장님이 아이템 하나를 끄면 문장이 곧바로 거짓말이 된다.
|
||||
* 실제로 '가요 다방'과 '오늘의 한 장'을 뺐더니 셋인데 "다섯 갈래"라고 적혀 있었다.
|
||||
*/
|
||||
const COUNT_WORD: Record<number, string> = {1: '한', 2: '두', 3: '세', 4: '네', 5: '다섯'};
|
||||
const COUNT_WORD: Record<number, string> = {
|
||||
1: '한', 2: '두', 3: '세', 4: '네', 5: '다섯', 6: '여섯', 7: '일곱',
|
||||
};
|
||||
|
||||
const TABS = [
|
||||
{id: 'songs', label: '가요 다방', Component: SongsSection},
|
||||
{id: 'people', label: '인물 열전', Component: PeopleSection},
|
||||
{id: 'chronicle', label: '시간의 골목', Component: ChronicleSection},
|
||||
{id: 'postcard', label: '오늘의 엽서', Component: PostcardSection},
|
||||
] as const;
|
||||
/* ★ '읽기' 만 라벨에 지명이 든다 — 나머지 넷은 어느 도시에서도 같은 이름이지만
|
||||
이건 "그 도시를 읽는다" 가 이름의 뜻이라 지명을 빼면 무엇을 읽는지가 사라진다.
|
||||
지명을 코드에 박지 않는다(`군산 읽기` 는 시연본 한 곳의 값이다). */
|
||||
const tabsOf = (region: string) =>
|
||||
[
|
||||
{id: 'songs', label: '가요 다방', Component: SongsSection},
|
||||
{id: 'people', label: '인물 열전', Component: PeopleSection},
|
||||
{id: 'chronicle', label: '시간의 골목', Component: ChronicleSection},
|
||||
{id: 'reading', label: `${region} 읽기`, Component: ReadingSection},
|
||||
{id: 'postcard', label: '오늘의 엽서', Component: PostcardSection},
|
||||
] as const;
|
||||
|
||||
export function StorySection() {
|
||||
const payload = useSite();
|
||||
const title = sectionName(payload, 'story', `${payload.place.addressLocality ?? '지역'} 이야기`);
|
||||
const region = payload.place.addressLocality ?? '지역';
|
||||
const title = sectionName(payload, 'story', `${region} 이야기`);
|
||||
// 데이터가 있는 것만 탭이 된다 — 눌러서 빈 화면을 보게 하지 않는다.
|
||||
const tabs = TABS.filter((tab) => sectionItems(payload, tab.id).items.length > 0);
|
||||
const tabs = tabsOf(region).filter((tab) => sectionItems(payload, tab.id).items.length > 0);
|
||||
const [active, setActive] = useState(0);
|
||||
|
||||
if (tabs.length === 0) return null;
|
||||
|
||||
@@ -8,6 +8,7 @@ import {SongsSection} from './SongsSection';
|
||||
import {DailySection} from './DailySection';
|
||||
import {PeopleSection} from './PeopleSection';
|
||||
import {ChronicleSection} from './ChronicleSection';
|
||||
import {ReadingSection} from './ReadingSection';
|
||||
import {PostcardSection} from './PostcardSection';
|
||||
import {QuizSection} from './QuizSection';
|
||||
import {ItinerarySection} from './ItinerarySection';
|
||||
@@ -20,12 +21,13 @@ export const ITEM_SECTIONS: Record<string, () => React.ReactElement | null> = {
|
||||
daily: DailySection,
|
||||
people: PeopleSection,
|
||||
chronicle: ChronicleSection,
|
||||
reading: ReadingSection,
|
||||
postcard: PostcardSection,
|
||||
quiz: QuizSection,
|
||||
itinerary: ItinerarySection,
|
||||
video: VideoSection,
|
||||
// 인스타에 올라오는 그때그때의 행사. 사장님이 옮겨 적고 원문 주소를 단다.
|
||||
event: EventSection,
|
||||
// 레트로 다섯(가요다방·오늘의한장·인물열전·시간의골목·엽서)을 탭으로 묶은 자리.
|
||||
// 레트로 아이템(가요다방·인물열전·시간의골목·지역읽기·엽서)을 탭으로 묶은 자리.
|
||||
story: StorySection,
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
import {expect, it} from 'vitest';
|
||||
import {renderToStaticMarkup} from 'react-dom/server';
|
||||
import type {ReadingItem} from '@o2o/shared';
|
||||
import {SiteProvider} from '@site/lib/site-context';
|
||||
import {MOONLIGHT_STAY_PAYLOAD} from '@site/fixtures/moonlight-stay';
|
||||
import {ReadingSection} from './ReadingSection';
|
||||
import {StorySection} from './StorySection';
|
||||
|
||||
function withReading(items: ReadingItem[]) {
|
||||
const payload = structuredClone(MOONLIGHT_STAY_PAYLOAD);
|
||||
payload.local.story = {...(payload.local.story ?? {}), reading: items};
|
||||
return payload;
|
||||
}
|
||||
|
||||
const ITEMS: ReadingItem[] = Array.from({length: 9}, (_, i) => ({
|
||||
group: '문학',
|
||||
title: `꼭지 ${i}`,
|
||||
body: `본문 ${i}`,
|
||||
source: {name: '네이버에서 찾아보기', url: `https://search.naver.com/search.naver?query=${i}`},
|
||||
}));
|
||||
|
||||
it('구운 HTML 은 앞에서부터 여섯 꼭지다 — 섞기는 붙은 뒤에 한다', () => {
|
||||
// 서버와 첫 렌더가 달라지면 하이드레이션이 깨진다. 무작위는 useEffect 뒤에만 돈다.
|
||||
const html = renderToStaticMarkup(
|
||||
<SiteProvider payload={withReading(ITEMS)}>
|
||||
<ReadingSection />
|
||||
</SiteProvider>,
|
||||
);
|
||||
expect(html).toContain('꼭지 0');
|
||||
expect(html).toContain('꼭지 5');
|
||||
expect(html).not.toContain('꼭지 6');
|
||||
});
|
||||
|
||||
it('꼭지가 없으면 섹션 자체가 없다', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<SiteProvider payload={withReading([])}>
|
||||
<ReadingSection />
|
||||
</SiteProvider>,
|
||||
);
|
||||
expect(html).toBe('');
|
||||
});
|
||||
|
||||
it('출처 링크를 그대로 단다 — 검색 링크는 서버가 만든 값이다', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<SiteProvider payload={withReading(ITEMS.slice(0, 1))}>
|
||||
<ReadingSection />
|
||||
</SiteProvider>,
|
||||
);
|
||||
expect(html).toContain('search.naver.com');
|
||||
expect(html).toContain('네이버에서 찾아보기');
|
||||
});
|
||||
|
||||
it("'지역 이야기' 탭에 지명이 든 이름으로 선다 — 군산을 코드에 박지 않는다", () => {
|
||||
const payload = withReading(ITEMS);
|
||||
const region = payload.place.addressLocality;
|
||||
const html = renderToStaticMarkup(
|
||||
<SiteProvider payload={payload}>
|
||||
<StorySection />
|
||||
</SiteProvider>,
|
||||
);
|
||||
expect(html).toContain(`${region} 읽기`);
|
||||
});
|
||||
Reference in new issue
Block a user