{"version":3,"file":"SupportQueryOverrides.DbIS2bOS.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/ww27dYHiWE9l3IJxIJrw/x2SxTb5tVVEhi5tHOPze/SupportQueryOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/** URLクエリ取得（SSR対策込み） */function getQueryParam(name){if(typeof window===\"undefined\")return\"\";return(new URLSearchParams(window.location.search).get(name)||\"\").trim();}/** 現在の言語プレフィックスを返す（例: \"\" or \"/ja\"） */function getLocalePrefixFromPathname(pathname){const parts=pathname.split(\"/\").filter(Boolean);const first=parts[0]||\"\";if(/^[a-z]{2}$/i.test(first))return`/${first.toLowerCase()}`;return\"\";}/** 現在ページの言語プレフィックス（\"\" or \"/ja\"） */function getCurrentLocalePrefix(){if(typeof window===\"undefined\")return\"\";return getLocalePrefixFromPathname(window.location.pathname);}/** 相対/絶対どちらもURL化 */function toAbsUrl(pathOrUrl){if(typeof window===\"undefined\")return null;return new URL(pathOrUrl,window.location.origin);}/** URLの pathname に対して「現在ページの言語 prefix」を維持する */function applyCurrentLocalePrefix(u){const currentLocale=getCurrentLocalePrefix();if(!currentLocale)return u;const targetLocale=getLocalePrefixFromPathname(u.pathname);if(targetLocale)return u// すでに言語付きならそのまま\n;u.pathname=`${currentLocale}${u.pathname.startsWith(\"/\")?\"\":\"/\"}${u.pathname}`;return u;}/** model(slug) → 表示名 */const MODEL_LABEL_MAP={granboard3s:\"GRANBOARD3s\",granboard132:\"GRANBOARD132\",\"granboard-dash\":\"GRANBOARD dash\",\"gran-eye\":\"GRAN EYE\",\"gran-eye-gen-1\":\"GRAN EYE Gen1\"};/**\n * ✅ ページ上部表示用：?model=xxxx を表示名に変換して出す\n * 例) ?model=granboard3s → GRANBOARD3s\n */export function ShowModelFromQuery(){const model=getQueryParam(\"model\");return{text:MODEL_LABEL_MAP[model]||model};}/**\n * ✅ 遷移元で「?model=」を動的付与して遷移（任意）\n * props.issueLink  : /support/issue/:slug（CMSリンクをバインド）\n * props.modelValue : 例）granboard3s / granboard-dash / gran-eye（統一slugを入れる）\n *\n * 多言語対応:\n * - 現在ページが /ja/... の場合、遷移先も /ja/... に補正する\n */export function NavigateIssueWithModelQuery(){return{onTap:(_event,props)=>{const issueLink=(props?.issueLink||\"\").toString().trim();const modelValue=(props?.modelValue||\"\").toString().trim();if(!issueLink)return;const url=toAbsUrl(issueLink);if(!url)return;if(modelValue)url.searchParams.set(\"model\",modelValue);applyCurrentLocalePrefix(url);window.location.assign(url.toString());}};}/**\n * ✅ モデルの portal に戻る（例：/model/support/granboard3s/portal）\n * 多言語対応:\n * - 現在 /ja/... なら /ja/model/support/... に遷移\n */export function GoModelPortalFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/model/support/${model}/portal`);}};}export function GoModelIssuesFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/model/support/${model}/issue-category`);}};}export function GoModelMaintenanceFromQuery(){return{onTap:()=>{const model=getQueryParam(\"model\");if(!model)return;const locale=getCurrentLocalePrefix();window.location.assign(`${locale}/support/maintenance/${model}`);}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withShowModelFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ShowModelFromQuery(props)});};}withShowModelFromQuery.displayName=\"ShowModelFromQuery\";export function withNavigateIssueWithModelQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...NavigateIssueWithModelQuery(props)});};}withNavigateIssueWithModelQuery.displayName=\"NavigateIssueWithModelQuery\";export function withGoModelPortalFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelPortalFromQuery(props)});};}withGoModelPortalFromQuery.displayName=\"GoModelPortalFromQuery\";export function withGoModelIssuesFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelIssuesFromQuery(props)});};}withGoModelIssuesFromQuery.displayName=\"GoModelIssuesFromQuery\";export function withGoModelMaintenanceFromQuery(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GoModelMaintenanceFromQuery(props)});};}withGoModelMaintenanceFromQuery.displayName=\"GoModelMaintenanceFromQuery\";\nexport const __FramerMetadata__ = {\"exports\":{\"withShowModelFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withShowModelFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelIssuesFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelIssuesFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNavigateIssueWithModelQuery\":{\"type\":\"reactHoc\",\"name\":\"withNavigateIssueWithModelQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelPortalFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelPortalFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelMaintenanceFromQuery\":{\"type\":\"override\",\"name\":\"GoModelMaintenanceFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelPortalFromQuery\":{\"type\":\"override\",\"name\":\"GoModelPortalFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GoModelIssuesFromQuery\":{\"type\":\"override\",\"name\":\"GoModelIssuesFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ShowModelFromQuery\":{\"type\":\"override\",\"name\":\"ShowModelFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoModelMaintenanceFromQuery\":{\"type\":\"reactHoc\",\"name\":\"withGoModelMaintenanceFromQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NavigateIssueWithModelQuery\":{\"type\":\"override\",\"name\":\"NavigateIssueWithModelQuery\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SupportQueryOverrides.map"],"mappings":"kLAAmE,SAAS,EAAc,EAAK,CAAyC,OAA9B,IAAS,OAAkB,IAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,EAAK,EAAE,IAAI,MAAM,CAAwC,SAAS,EAA4B,EAAS,CAAiD,IAAM,EAA1C,EAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAmB,IAAI,GAAgE,MAA1D,cAAc,KAAK,EAAM,CAAO,IAAI,EAAM,aAAa,GAAS,GAAuC,SAAS,GAAwB,CAAyC,OAA9B,IAAS,OAAkB,GAAU,EAA4B,EAAO,SAAS,SAAS,CAAsB,SAAS,EAAS,EAAU,CAA4C,OAAjC,IAAS,OAAmB,KAAY,IAAI,IAAI,EAAU,EAAO,SAAS,OAAO,CAAiD,SAAS,EAAyB,EAAE,CAAC,IAAM,EAAc,GAAwB,CAChyB,MADoyB,CAAC,GAA0C,EAA4B,EAAE,SAAS,GACr8B,EAAE,SAAS,GAAG,IAAgB,EAAE,SAAS,WAAW,IAAI,CAAC,GAAG,MAAM,EAAE,YADy5B,EAI39B,SAAgB,GAAoB,CAAC,IAAM,EAAM,EAAc,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAgB,IAAQ,EAAM,CAOlH,SAAgB,GAA6B,CAAC,MAAM,CAAC,OAAO,EAAO,IAAQ,CAAC,IAAM,GAAW,GAAO,WAAW,IAAI,UAAU,CAAC,MAAM,CAAO,GAAY,GAAO,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAU,OAAO,IAAM,EAAI,EAAS,EAAU,CAAK,IAAc,GAAW,EAAI,aAAa,IAAI,QAAQ,EAAW,CAAC,EAAyB,EA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