window.storecrm_config = {"line":{"line_login_enable":false,"line_login_onlypreview":false},"favorite":{"button_text":"お気に入りに追加する","button_text_remove":"お気に入り済み","favoriteMode":"product","is_only_member":false},"favoriteListMode":"simple","favoriteList":{"list_title":"お気に入り一覧","loading_text":"読込中です...","non_item_text":"現在お気に入り中の商品はありません","show_cart":true,"insert_cart_directly":true},"restock":{"button_text":"再入荷通知を受け取る"},"restockPopup":{"popup_title":"再入荷通知","popup_description":"再入荷通知をご希望の方は以下から、ご選択ください。","emailaddress":"ご連絡メールアドレス","button_text":"再入荷通知を有効にする","success_text":"再入荷通知が登録されました。","error_text":"再入荷通知の登録に失敗しました。しばらくたってから再度お試しください。","error_text_email":"メールアドレスが正しくありません。確認の上、再度ご記入ください。","accepts_marketing_checkbox_text":"メルマガ配信に同意する","email_confirmation_text":"こちらのメールアドレスで間違いないですか?"},"lineRestock":{"button_text":"LINEで再入荷通知を受け取る"},"lineRestockPopup":{"title":"LINE再入荷通知","description_text":"この商品の再入荷をLINEでお知らせします","button_text":"再入荷通知を有効にする","success_text":"再入荷通知が登録されました!","error_text":"再入荷通知の登録に失敗しました。しばらくたってから再度お試しください。"},"locales":{},"backendUrl":"https://obake.groovymedia.co","appProxyName":"obake"}; (()=>{"use strict";var e={13(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExcludedAccountPage=void 0,function(e){e.LOGIN="login",e.REGISTER="register",e.RECOVER="recover",e.ACTIVATE="activate",e.RESET="reset"}(n||(t.ExcludedAccountPage=n={}))},77(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},250(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.renderWidgetSelector=t.hideWidgetSelector=t.render=t.getIcon=void 0;t.getIcon=(e,t=!1)=>{let n=null;return"star"===e.buttonicon?n=t?'':'':"heart"===e.buttonicon?n=t?'':'':"tag"===e.buttonicon?n='':"clip"===e.buttonicon&&(n=''),n&&(n=n.replace("viewBox",`width="${e.icon_size}" height="${e.icon_size}" style="margin-right: ${e.icon_margin}px;" viewBox`)),n};class n{constructor(e,t,n,o,i,r=!1,s=!1,a){this.eventTriggered=!1,this.variants=n,this.buttonSettings=Object.assign({},o),this.productId=t,this.button=i,this.isFavorited=r,this.hasVariantSelector=s,this.variantId=a,this.buttonSettings.has_background||(this.buttonSettings.button_width="auto",this.buttonSettings.button_height="auto",this.buttonSettings.button_radius=0,this.buttonSettings.button_border_width=0,this.buttonSettings.button_background_color="transparent",this.buttonSettings.button_border_color="transparent",this.buttonSettings.button_hover_border_color="transparent",this.buttonSettings.button_hover_background_color="transparent")}static getInstance(e,t,o,i,r,s=!1,a=!1,c){if(n.instances[e]){const l=n.instances[e];l.isFavorited=s,l.hasVariantSelector=a,l.buttonSettings=Object.assign({},i),l.variants=o,l.button=r,l.productId=t,l.variantId=c}else n.instances[e]=new n(e,t,o,i,r,s,a,c);return n.instances[e]}checkRender(e){document.querySelectorAll(`.storecrm-wishlistbutton-${e}`).forEach(e=>{if(e instanceof HTMLElement&&e.closest('[data-type="wishlist-button"]')){const t=new URL(location.href),n=t.searchParams.get("variant")&&t.searchParams.get("variant")||"";n&&(e.dataset.variantId=n),window.storecrm&&window.storecrm.render(!0)}})}render(e,n=!1){const o=(0,t.getIcon)(this.buttonSettings,this.isFavorited),i=new URL(location.href),r=parseInt(i.searchParams.get("variant")||this.variantId||"0",10)||"",s=this.hasVariantSelector?"data-variant-selector":"",a=void 0!==this.button.dataset.noLabel;if(!this.eventTriggered)if(window.navigation)window.navigation.addEventListener("navigate",()=>{window.setTimeout(()=>this.checkRender(e),100)}),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3);else{let t=location.href;window.setInterval(()=>{t!==location.href&&(t=location.href,this.checkRender(e))},1e3),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3)}this.eventTriggered;this.eventTriggered=!0;const c=n?"":`onclick="event.preventDefault();window.storecrm ? window.storecrm.toggleWishlist(this, ${this.isFavorited?"true":"false"}, ${this.buttonSettings.is_only_member}, '${this.buttonSettings.non_member_link||""}') : alert('\u8aad\u8fbc\u4e2d\u3067\u3059\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');"`,l=``,d=document.querySelector("#storecrm-wishlistbutton-style");return n?(d&&d.remove(),document.body.insertAdjacentHTML("afterend",l)):d||document.body.insertAdjacentHTML("afterend",l),`
\n\n
`}}n.instances={};let o,i,r;t.render=({productId:e,variantId:t,id:o,variants:i,product:r,button:s,buttonSettings:a,isFavorited:c=!1,preview:l=!1,hasVariantSelector:d=!1})=>n.getInstance(o,e,i,a,s,c,d,t).render(o,l);t.hideWidgetSelector=()=>{o&&(o.remove(),o=void 0),document.querySelectorAll(".storecrm-variantselector-dropdown").forEach(e=>e.remove()),i=void 0,r=void 0};t.renderWidgetSelector=({button:e,productId:n,variants:s,wishlist:a,buttonSettings:c,preview:l=!1,rerender:d=!1})=>{const u=Array.isArray(null==a?void 0:a.variants)?a.variants:[];a.variants=u;const h=i===n&&r?r:s,m=o&&d&&i==n?o.style:void 0;let g=0;if(!l&&o&&d&&(g=o.scrollTop),!l&&d&&i!==n)return;if(!l&&o&&(o.remove(),o=void 0,!d))return;i=n,r=h;const p=h.map(e=>{const o=u.indexOf(e.id.toString())>=0,i=(0,t.getIcon)(c,o),r=l?"":`onclick="event.preventDefault();event.stopPropagation();window.storecrm ? window.storecrm.toggleWishlist(this, ${o?"true":"false"}, ${c.is_only_member}, '${c.non_member_link||""}') : alert('\u8aad\u8fbc\u4e2d\u3067\u3059\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');"`;return`\n ${i||(o?c.button_text_remove:c.button_text)}\n ${e.title}\n `}).join("");let f="";if(l)f="position: static;";else if(m)f=`top: ${m.top}; left: ${m.left};`;else{const t=e.getBoundingClientRect(),n=250;let o=t.left+document.documentElement.scrollLeft;o+n>window.innerWidth&&(o=window.innerWidth-n),f=`top: ${t.bottom+document.documentElement.scrollTop}px; left: ${o}px;`}const _=``;l||(document.body.insertAdjacentHTML("afterend",_),o=document.querySelector(".storecrm-variantselector-dropdown"),d&&g>0&&(o.scrollTop=g));{const e=e=>{e.target&&e.target instanceof HTMLElement&&e.target.closest("[data-variant-selector]")||o&&(o.remove(),o=void 0)};document.addEventListener("click",e),document.addEventListener("resize",e)}return _},t.schema={preview:(e,n)=>{let o=`
${"ja"===n?"\u304a\u6c17\u306b\u5165\u308a\u30dc\u30bf\u30f3(\u304a\u6c17\u306b\u5165\u308a\u524d)":"Favorite button (before it is added)"}
`;return o+=(0,t.render)({productId:"TEMP_product",id:"TEMP_favorite",buttonSettings:e,button:document.createElement("div"),isFavorited:!1,preview:!0,variants:[],product:null}),"variant"===e.favoriteMode&&(o+=`
${"ja"===n?"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e2\u30fc\u30c9\u306e\u969b\u306e\u304a\u6c17\u306b\u5165\u308a\u30dc\u30bf\u30f3":"Favorite button for variant mode"}
`,o+=(0,t.renderWidgetSelector)({productId:"TEMP_product",variants:"ja"===n?[{id:"1",title:"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f31"},{id:"2",title:"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f32"},{id:"3",title:"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f33"}]:[{id:"1",title:"Variant 1"},{id:"2",title:"Variant 2"},{id:"3",title:"Variant 3"}],wishlist:{products:[],variants:[]},buttonSettings:e,button:document.createElement("div"),preview:!0,rerender:!1})),o+=`
${"ja"===n?"\u304a\u6c17\u306b\u5165\u308a\u30dc\u30bf\u30f3(\u304a\u6c17\u306b\u5165\u308a\u5f8c)":"Favorite button (after it is added)"}
`,o+=(0,t.render)({productId:"TEMP_product",id:"TEMP_favorite2",buttonSettings:e,button:document.createElement("div"),isFavorited:!0,preview:!0,variants:[],product:null}),o},rows:[{type:"card",slug:"favoriteMode",nameJa:"\u304a\u6c17\u306b\u5165\u308a\u306e\u30e2\u30fc\u30c9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044",nameEn:"Choose the favorite mode",default:"product",selectOptionsJa:[{value:"product",label:"\u5546\u54c1\u3054\u3068\u306b\u304a\u6c17\u306b\u5165\u308a\u3092\u3059\u308b"},{value:"variant",label:"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3(\u5546\u54c1\u306e\u8272\u3084\u30b5\u30a4\u30ba\u306a\u3069)\u3054\u3068\u306b\u304a\u6c17\u306b\u5165\u308a\u3092\u3059\u308b"}],selectOptionsEn:[{value:"product",label:"Favorite by product"},{value:"variant",label:"Favorite by variant (such as color or size)"}],warningOnChangeJa:"\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u65e2\u5b58\u306e\u304a\u6c17\u306b\u5165\u308a\u30c7\u30fc\u30bf\u304c\u7121\u52b9\u3068\u306a\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u79fb\u7ba1\u3092\u3054\u5e0c\u671b\u306e\u65b9\u306f\u3053\u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u305b\u305a\u306b\u3001\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002",warningOnChangeEn:"Changing the setting will invalidate existing favorite data. Please contact us if you wish to transfer the data.",fullsize:!0},{type:"checkbox",slug:"is_only_member",nameJa:"\u304a\u6c17\u306b\u5165\u308a\u6a5f\u80fd\u306e\u5229\u7528\u3092\u4f1a\u54e1\u9650\u5b9a\u306b\u3059\u308b",nameEn:"Enable favorite function for sign-in customers only",default:!1,fullsize:!0},{type:"text",slug:"non_member_link",nameJa:"\u30b2\u30b9\u30c8\u304c\u304a\u6c17\u306b\u5165\u308a\u3092\u62bc\u3057\u305f\u5834\u5408\u306e\u9077\u79fb\u5148URL\u3000\u203b\u7a7a\u6b04\u306e\u5834\u5408\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306b\u9077\u79fb\u3057\u307e\u3059",nameEn:"URL to redirect to when a guest clicks the favorite button. If left blank, the login screen will be displayed.",default:"",depends:"is_only_member",fullsize:!0},{type:"select",slug:"buttonicon",nameJa:"\u30a2\u30a4\u30b3\u30f3",nameEn:"buttonIcon",selectOptionsJa:[{value:"star",label:"\u661f\u30de\u30fc\u30af(\u2606)"},{value:"heart",label:"\u30cf\u30fc\u30c8\u30de\u30fc\u30af(\u2661)"},{value:"tag",label:"\u30bf\u30b0\u30a2\u30a4\u30b3\u30f3"},{value:"clip",label:"\u30af\u30ea\u30c3\u30d7\u30a2\u30a4\u30b3\u30f3"},{value:"none",label:"\u306a\u3057"}],selectOptionsEn:[{value:"star",label:"Star icon (\u2606)"},{value:"heart",label:"Heart icon (\u2661)"},{value:"tag",label:"Tag icon"},{value:"clip",label:"Clip icon"},{value:"none",label:"None"}],default:"star"},{type:"text",slug:"button_text",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"buttonText",defaultJa:"\u304a\u6c17\u306b\u5165\u308a",defaultEn:"Favorite"},{type:"text",slug:"button_text_remove",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8(\u304a\u6c17\u306b\u5165\u308a\u89e3\u9664)",nameEn:"buttonTextRemove",defaultJa:"\u304a\u6c17\u306b\u5165\u308a\u6e08\u307f",defaultEn:"Favorited"},{type:"checkbox",slug:"has_background",nameJa:"\u80cc\u666f\u304c\u3042\u308b\u30dc\u30bf\u30f3\u306b\u3059\u308b",nameEn:"hasBackground",default:!1},{type:"range",slug:"button_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u5e45",nameEn:"buttonWidth",default:200,min:50,max:600,step:10,depends:"has_background"},{type:"range",slug:"button_height",nameJa:"\u30dc\u30bf\u30f3\u306e\u9ad8\u3055",nameEn:"buttonHeight",default:50,min:30,max:100,step:10,depends:"has_background"},{type:"colorpicker",slug:"button_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272",nameEn:"buttonColor",default:"#000000"},{type:"colorpicker",slug:"icon_color",nameJa:"\u30a2\u30a4\u30b3\u30f3\u306e\u6587\u5b57\u8272",nameEn:"iconColor",default:"#000000"},{type:"colorpicker",slug:"button_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"buttonBackgroundColor",default:"#ffffff",depends:"has_background"},{type:"colorpicker",slug:"button_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272",nameEn:"buttonBorderColor",default:"#000000",depends:"has_background"},{type:"colorpicker",slug:"button_hover_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverColor",default:"#222222"},{type:"colorpicker",slug:"icon_hover_color",nameJa:"\u30a2\u30a4\u30b3\u30f3\u306e\u6587\u5b57\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"iconHoverColor",default:"#000000"},{type:"colorpicker",slug:"button_hover_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBackgroundColor",default:"#dddddd",depends:"has_background"},{type:"colorpicker",slug:"button_hover_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBorderColor",default:"#222222",depends:"has_background"},{type:"range",slug:"button_radius",nameJa:"\u30dc\u30bf\u30f3\u306e\u4e38\u307f",nameEn:"buttonRadius",default:5,min:0,max:20,step:1,depends:"has_background"},{type:"range",slug:"button_border_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u592a\u3055",nameEn:"buttonBorderWidth",default:0,min:0,max:10,step:1,depends:"has_background"},{type:"fontpicker",slug:"button_font",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8",nameEn:"buttonFont",default:"helvetica_n4"},{type:"range",slug:"button_fontsize",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba",nameEn:"buttonFontSize",default:16,min:10,max:30,step:1},{type:"range",slug:"button_fontweight",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30a6\u30a7\u30a4\u30c8",nameEn:"buttonFontWeight",default:400,min:100,max:900,step:100},{type:"range",slug:"icon_size",nameJa:"\u30a2\u30a4\u30b3\u30f3\u306e\u30b5\u30a4\u30ba",nameEn:"iconSize",default:16,min:10,max:30,step:1},{type:"range",slug:"icon_margin",nameJa:"\u30a2\u30a4\u30b3\u30f3\u3068\u30c6\u30ad\u30b9\u30c8\u3068\u306e\u9593\u9694",nameEn:"iconMargin",default:5,min:0,max:20,step:1},{type:"range",slug:"button_speed",nameJa:"\u30dc\u30bf\u30f3\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u901f\u5ea6",nameEn:"buttonSpeed",default:.3,min:0,max:1,step:.1},{type:"select",slug:"align",nameJa:"\u30dc\u30bf\u30f3\u306e\u914d\u7f6e",nameEn:"align",default:"center",selectOptionsJa:[{value:"left",label:"\u5de6\u5bc4\u305b"},{value:"center",label:"\u4e2d\u592e\u5bc4\u305b"},{value:"right",label:"\u53f3\u5bc4\u305b"}],selectOptionsEn:[{value:"left",label:"Align left"},{value:"center",label:"Align center"},{value:"right",label:"Align right"}]},{type:"colorpicker",slug:"popup_text_color",nameJa:"POPUP\u306e\u30c6\u30ad\u30b9\u30c8\u8272",nameEn:"popupTextColor",default:"#000000",checkVisible:e=>"variant"===e.favoriteMode},{type:"colorpicker",slug:"popup_background_color",nameJa:"POPUP\u306e\u80cc\u666f\u8272",nameEn:"popupBackgroundColor",default:"#ffffff",checkVisible:e=>"variant"===e.favoriteMode},{type:"colorpicker",slug:"popup_icon_color",nameJa:"POPUP\u306e\u30a2\u30a4\u30b3\u30f3\u8272",nameEn:"popupIconColor",default:"#000000",checkVisible:e=>"variant"===e.favoriteMode},{type:"colorpicker",slug:"popup_icon_hover_color",nameJa:"POPUP\u306e\u30a2\u30a4\u30b3\u30f3\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"popupIconHoverColor",default:"#000000",checkVisible:e=>"variant"===e.favoriteMode},{type:"range",slug:"popup_border_width",nameJa:"POPUP\u306e\u7dda\u306e\u592a\u3055",nameEn:"popupBorderWidth",default:0,min:0,max:10,step:1,checkVisible:e=>"variant"===e.favoriteMode},{type:"colorpicker",slug:"popup_border_color",nameJa:"POPUP\u306e\u7dda\u306e\u8272",nameEn:"popupBorderColor",default:"#999",checkVisible:e=>"variant"===e.favoriteMode}]}},259(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.generateDefaultSettings=t.render=t.RestockButton=void 0;class n{constructor(e,t,n,o,i){this.eventTriggered=!1,this.variants=n,this.buttonSettings=o,this.productId=t,this.product=i}static getInstance(e,t=null,o=null,i=null,r=null){if(n.instances[e])i&&(n.instances[e].buttonSettings=i);else{if(!(t&&o&&i&&r))throw new Error("StoreCRM Restock: productId, variants, buttonSettings, product are required");n.instances[e]=new n(e,t,o,i,r)}return n.instances[e]}createScript(e,t){const n=e?"":"onclick=\"event.preventDefault();window.storecrm ? window.storecrm.showRestock(this) : alert('\u8aad\u8fbc\u4e2d\u3067\u3059\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');\"";return`\n\n\n
\n\n
\n `}checkRender(e){document.querySelectorAll(`.storecrm-restock-${e}`).forEach(e=>{var t;if(e instanceof HTMLElement&&e.closest('[data-type="restock-button"]')){const n=new URL(location.href),o=(null===(t=this.variants.find(e=>e.available))||void 0===t?void 0:t.id)||this.variants[0].id||null,i=parseInt(n.searchParams.get("variant")||o,10);if(!i)return void console.error("StoreCRM Restock: variantId is not set",i);if(!this.product||!this.product.tags||this.product.tags.indexOf("storecrm-restock-hidden")>=0)return console.error("StoreCRM: Restock:product not found or hidden"),void(e.style.display="none");const r=window.Shopify&&window.Shopify.designMode||this.variants.find(e=>!e.available&&e.id===i);e.style.display=r?"inline-block":"none"}})}render(e,t=!1){if(t)return this.createScript(!0,e);if(!this.eventTriggered){if(this.eventTriggered=!0,window.navigation)window.navigation.addEventListener("navigate",()=>{window.setTimeout(()=>this.checkRender(e),100)}),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3);else{let t=location.href;window.setInterval(()=>{t!==location.href&&(t=location.href,this.checkRender(e))},1e3),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3)}return this.createScript(!1,e)}}}t.RestockButton=n,n.instances={};t.render=({productId:e,variantId:t,variants:o,id:i,buttonSettings:r,isOutOfStock:s,product:a,preview:c=!1})=>n.getInstance(i,e,o,r,a).render(i,c);t.generateDefaultSettings=(e="ja")=>{const n={};return t.schema.rows.forEach(t=>{"text"===t.type?n[t.slug]="ja"===e?t.defaultJa:t.defaultEn:(t.type,n[t.slug]=t.default)}),n};const o=e=>{const t=[`opacity: ${((e,t,n,o)=>{const i=Number(e);return Number.isFinite(i)?Math.min(o,Math.max(n,i)):t})(e.registered_button_opacity,.55,.3,1)}`,"cursor: not-allowed","pointer-events: none"];return e.registered_button_color&&t.push(`color: ${e.registered_button_color}`),e.registered_button_background_color&&t.push(`background-color: ${e.registered_button_background_color}`),e.registered_button_border_color&&t.push(`border-color: ${e.registered_button_border_color}`),t.join("; ")},i=(e,t,n)=>{const i=t.registered_button_text||("ja"===n?"\u767b\u9332\u6e08\u307f":"Registered");return`\n
\n
${"ja"===n?"\u767b\u9332\u6e08\u307f\u8868\u793a":"Registered state"}
\n ${(e||"").replace(/]*)>[\s\S]*?<\/button>/,(e,n)=>{const r=String(n||"").replace(/\sonclick="[^"]*"/g,"");return`${s=i,String(null!=s?s:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}`;var s})}\n
`};t.schema={preview:(e,n)=>((e,t,n,o)=>`\n
\n
\n
${"ja"===o?"\u901a\u5e38\u8868\u793a":"Default state"}
\n ${e||""}\n
\n ${i(t,n,o)}\n
`)((0,t.render)({productId:"TEMP_productId",id:"TEMP_restock",buttonSettings:e,isOutOfStock:!1,preview:!0,product:{tags:[]},variants:[]}),(0,t.render)({productId:"TEMP_productId",id:"TEMP_restock_registered",buttonSettings:e,isOutOfStock:!1,preview:!0,product:{tags:[]},variants:[]}),e,n),rows:[{type:"text",slug:"button_text",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"buttonText",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b",defaultEn:"Notify restock"},{type:"text",slug:"registered_button_text",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u30dc\u30bf\u30f3\u30c6\u30ad\u30b9\u30c8",nameEn:"Registered button text",defaultJa:"\u767b\u9332\u6e08\u307f",defaultEn:"Registered"},{type:"range",slug:"button_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u5e45",nameEn:"buttonWidth",default:200,min:50,max:600,step:10},{type:"range",slug:"button_height",nameJa:"\u30dc\u30bf\u30f3\u306e\u9ad8\u3055",nameEn:"buttonHeight",default:50,min:30,max:100,step:5},{type:"colorpicker",slug:"button_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272",nameEn:"buttonColor",default:"#000000"},{type:"colorpicker",slug:"button_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"buttonBackgroundColor",default:"#ffffff"},{type:"colorpicker",slug:"button_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272",nameEn:"buttonBorderColor",default:"#000000"},{type:"colorpicker",slug:"registered_button_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u6587\u5b57\u8272",nameEn:"Registered text color",default:"#666666"},{type:"colorpicker",slug:"registered_button_background_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u80cc\u666f\u8272",nameEn:"Registered background color",default:"#f3f4f6"},{type:"colorpicker",slug:"registered_button_border_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u67a0\u7dda\u8272",nameEn:"Registered border color",default:"#d1d5db"},{type:"colorpicker",slug:"button_hover_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverColor",default:"#222222"},{type:"colorpicker",slug:"button_hover_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBackgroundColor",default:"#dddddd"},{type:"colorpicker",slug:"button_hover_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBorderColor",default:"#222222"},{type:"range",slug:"button_radius",nameJa:"\u30dc\u30bf\u30f3\u306e\u4e38\u307f",nameEn:"buttonRadius",default:0,min:0,max:20,step:1},{type:"range",slug:"button_border_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u592a\u3055",nameEn:"buttonBorderWidth",default:0,min:0,max:5,step:1},{type:"fontpicker",slug:"button_font",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8",nameEn:"buttonFont",default:"helvetica_n4"},{type:"range",slug:"button_fontsize",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba",nameEn:"buttonFontSize",default:16,min:10,max:30,step:1},{type:"range",slug:"button_fontweight",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30a6\u30a7\u30a4\u30c8",nameEn:"buttonFontWeight",default:400,min:100,max:900,step:100},{type:"range",slug:"button_speed",nameJa:"\u30dc\u30bf\u30f3\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u901f\u5ea6",nameEn:"buttonSpeed",default:.3,min:0,max:1,step:.1},{type:"range",slug:"registered_button_opacity",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u900f\u660e\u5ea6",nameEn:"Registered opacity",default:.55,min:.3,max:1,step:.05},{type:"select",slug:"align",nameJa:"\u30dc\u30bf\u30f3\u306e\u914d\u7f6e",nameEn:"align",default:"center",defaultJa:"\u4e2d\u592e\u5bc4\u305b",defaultEn:"Center",selectOptionsJa:[{value:"left",label:"\u5de6\u5bc4\u305b"},{value:"center",label:"\u4e2d\u592e\u5bc4\u305b"},{value:"right",label:"\u53f3\u5bc4\u305b"}],selectOptionsEn:[{value:"left",label:"Align left"},{value:"center",label:"Align center"},{value:"right",label:"Align right"}]}]}},291(e){e.exports=function(e){return e[1]}},296(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},313(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.iconCart=t.iconDelete=void 0,t.iconDelete='',t.iconCart=''},381(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},496(e,t){var n=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function o(){var e,t,n,o,i;const r=(null===(t=null===(e=null===window||void 0===window?void 0:window.Shopify)||void 0===e?void 0:e.routes)||void 0===t?void 0:t.root)||(null===(o=null===(n=null===window||void 0===window?void 0:window.Shopify)||void 0===n?void 0:n.localization)||void 0===o?void 0:o.root)||(null===(i=null===window||void 0===window?void 0:window.Shopify)||void 0===i?void 0:i.locale)||"";if(!r||"/"===r||"//"===r)return"";const s=("/"+r).replace(/\/{2,}/g,"/").replace(/\/$/,"");return"/"===s?"":s}function i(e){return n(this,arguments,void 0,function*(e,t=""){try{const n=yield fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,quantity:1})});if(!n.ok)throw new Error(`Failed to add to cart: ${n.statusText}`);const o=yield n.json();console.log("StoreCRM: \u5546\u54c1\u304c\u30ab\u30fc\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f:",o),window.location.href=`${t}/cart`}catch(e){console.error("StoreCRM: \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f:",e),alert("\u30ab\u30fc\u30c8\u306b\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002")}})}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalePathPrefix=o,t.cartFavorite=function(e,t,n,r,s){const a=o(),c=s||("variant"===e?t:"");if(c&&("variant"===e||r))return void i(c,a);const l="variant"===e?`${a}/products/${encodeURIComponent(n)}?variant=${t}`:`${a}/products/${encodeURIComponent(n)}`;window.location.href=l},t.addToCart=i},511(e){var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},534(e,t,n){n.d(t,{A:()=>a});var o=n(291),i=n.n(o),r=n(748),s=n.n(r)()(i());s.push([e.id,".storecrm_modal {\n display: none;\n}\n\n.storecrm_modal.is-open {\n display: block;\n}\n\n.storecrm_modal_line {\n margin: 1rem 0;\n}\n\n.storecrm_modal_line label {\n display: flex;\n align-items: center;\n}\n\n#storecrm_restock_accepts_marketing {\n margin: 0 5px 0 0;\n max-width: 15px;\n}\n\n@media (hover: hover) {\n .storecrm_modal_line label:hover {\n cursor: pointer;\n }\n #storecrm_restock_accepts_marketing:hover {\n cursor: pointer;\n }\n}\n\n.storecrm_modal input,\n.storecrm_modal select {\n width: 100%;\n padding: 10px;\n font-size: 100%;\n margin: 1rem 0;\n}\n\n.storecrm_modal__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 10000;\n background: rgba(0, 0, 0, 0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.storecrm_modal__container {\n background-color: #fff;\n padding: 30px;\n min-width: 320px;\n max-width: 500px;\n min-height: 200px;\n max-height: 100vh;\n border-radius: 4px;\n overflow-y: auto;\n box-sizing: border-box;\n}\n\n.storecrm_modal__header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.storecrm_modal__title {\n margin-top: 0;\n margin-bottom: 0;\n font-weight: 600;\n font-size: 1.25;\n line-height: 1.25;\n box-sizing: border-box;\n}\n\n.storecrm_modal__close {\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.storecrm_modal_message {\n margin-top: 2rem;\n padding: 1rem;\n}\n\n.storecrm_modal__header .storecrm_modal__close:before {\n content: '\\2715';\n}\n\n.storecrm_modal__content {\n margin-top: 2rem;\n margin-bottom: 1rem;\n line-height: 1.5;\n color: rgba(0, 0, 0, 0.8);\n}\n\n.storecrm_modal__btn {\n display: block;\n width: 100%;\n padding-top: 1rem;\n padding-bottom: 1rem;\n background-color: #e6e6e6;\n color: rgba(0, 0, 0, 0.8);\n border-radius: 0.25rem;\n border-style: none;\n border-width: 0;\n cursor: pointer;\n -webkit-appearance: button;\n text-transform: none;\n overflow: visible;\n line-height: 1.15;\n margin: 0;\n margin-top: 1rem;\n will-change: transform;\n -moz-osx-font-smoothing: grayscale;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n transition: -webkit-transform 0.25s ease-out;\n transition: transform 0.25s ease-out;\n transition: transform 0.25s ease-out, -webkit-transform 0.25s ease-out;\n}\n\n.storecrm_modal__btn:hover {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n}\n\n.storecrm_modal__btn-primary {\n background-color: #00449e;\n color: #fff;\n}\n\n.storecrm_modal__btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.storecrm-restock-registered {\n pointer-events: none;\n}\n\n.storecrm_login_required_modal .storecrm_modal__overlay {\n background: rgba(0, 0, 0, 0.55);\n padding: 16px;\n box-sizing: border-box;\n}\n\n.storecrm_login_required_modal .storecrm_modal__container {\n width: min(576px, 100%);\n min-width: 0;\n min-height: 0;\n max-height: calc(100vh - 32px);\n padding: 20px 16px 16px;\n border-radius: 2px;\n}\n\n.storecrm_login_required_modal .storecrm_modal__title {\n font-size: 20px;\n line-height: 1.4;\n font-weight: 600;\n}\n\n.storecrm_login_required_modal .storecrm_modal__content {\n margin-top: 14px;\n margin-bottom: 0;\n color: #111;\n font-size: 16px;\n line-height: 1.65;\n}\n\n.storecrm_login_required_actions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n margin-top: 28px;\n}\n\n.storecrm_login_required_login,\n.storecrm_login_required_cancel {\n min-height: 52px;\n padding: 0 16px;\n border-radius: 32px;\n font-size: 16px;\n font-weight: 600;\n line-height: 1.2;\n cursor: pointer;\n appearance: none;\n}\n\n.storecrm_login_required_login {\n color: #fff;\n background: #000;\n border: 1px solid #000;\n}\n\n.storecrm_login_required_cancel {\n color: #111;\n background: #fff;\n border: 1px solid #111;\n}\n\n@media (max-width: 480px) {\n .storecrm_login_required_actions {\n grid-template-columns: 1fr;\n gap: 12px;\n }\n}\n\n@keyframes mmfadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes mmfadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@keyframes mmslideIn {\n from {\n transform: translateY(15%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes mmslideOut {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-10%);\n }\n}\n\n.micromodal-slide {\n display: none;\n}\n\n.micromodal-slide.is-open {\n display: block;\n}\n\n.micromodal-slide[aria-hidden='false'] .storecrm_modal__overlay {\n animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden='false'] .storecrm_modal__container {\n animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden='true'] .storecrm_modal__overlay {\n animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden='true'] .storecrm_modal__container {\n animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);\n}\n\n.micromodal-slide .storecrm_modal__container,\n.micromodal-slide .storecrm_modal__overlay {\n will-change: transform;\n}\n\n/* \u30d5\u30a7\u30fc\u30c9\u30a4\u30f3\u30fb\u30d5\u30a7\u30fc\u30c9\u30a2\u30a6\u30c8\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u7528\u306e\u30af\u30e9\u30b9 */\n.fade-out {\n animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n}\n\n.fade-in {\n animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n}\n\n.storecrm-status-widget {\n width: 100%;\n border: 1px solid #e6e6e6;\n display: flex;\n align-items: center;\n justify-content: center;\n max-height: 3em;\n}\n\n.storecrm-status-widget > div {\n padding: 1rem;\n}\n\n@media (max-width: 767px) {\n .storecrm-status-widget {\n flex-direction: column;\n max-height: none; /* Remove height restriction */\n }\n}\n\n.storecrm-status-widget button {\n margin-left: 0.5rem;\n}\n\n.storecrm-on {\n /* deep green, bold */\n color: #094c00;\n font-weight: bold;\n}\n\n.storecrm-off {\n color: #df8536c6;\n font-weight: bold;\n}\n\n.line-chat-preview {\n display: flex;\n flex-direction: column;\n width: 360px;\n height: 640px;\n border: 1px solid #ddd;\n overflow: hidden;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n background-color: #92aad4;\n}\n\n.line-chat-header {\n display: flex;\n align-items: center;\n padding: 10px 16px;\n background-color: #44556f;\n color: white;\n height: 50px;\n}\n\n.line-chat-body {\n flex-grow: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n position: relative;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n\n.line-chat-body::-webkit-scrollbar {\n display: none;\n}\n\n.line-chat-footer {\n padding: 0 16px 0 16px;\n background-color: #ffffff;\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 50px;\n}\n\n.line-chat-keyboard-icon {\n width: 22px;\n height: 22px;\n}\n\n.line-chat-chatbarText {\n flex-grow: 1;\n font-size: 14px;\n color: #000;\n text-align: center;\n}\n\n/* \u30ea\u30c3\u30c1\u30e1\u30cb\u30e5\u30fc\u8868\u793a\u6642\u306e\u30b9\u30bf\u30a4\u30eb */\n.line-chat-footer.menu-open .line-chat-chatbarText:after {\n content: '\u25bc';\n}\n\n/* \u30ea\u30c3\u30c1\u30e1\u30cb\u30e5\u30fc\u975e\u8868\u793a\u6642\u306e\u30b9\u30bf\u30a4\u30eb */\n.line-chat-footer:not(.menu-open) .line-chat-chatbarText:after {\n content: '\u25b2';\n}\n\n.line-richmenu-preview {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: #ffffff;\n transform: translateY(100%);\n transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1);\n z-index: 10;\n box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);\n}\n\n.line-richmenu-preview.menu-open {\n transform: translateY(0);\n}\n\n.line-richmenu-preview.menu-closed {\n transform: translateY(100%);\n}\n\n/* LINE\u518d\u5165\u8377\u901a\u77e5\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u7528\u306e\u30b9\u30bf\u30a4\u30eb */\n.storecrm-line-restock-popup-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 10000;\n background: rgba(0, 0, 0, 0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n}\n\n.storecrm-line-restock-popup {\n background-color: #fff;\n padding: 30px;\n min-width: 320px;\n max-width: 500px;\n min-height: 150px;\n max-height: 100vh;\n border-radius: 8px;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n text-align: center;\n overflow-y: auto;\n transform: translateY(15%);\n animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n will-change: transform;\n}\n\n.storecrm-line-restock-popup-text {\n font-size: 16px;\n line-height: 1.5;\n margin-bottom: 20px;\n color: rgba(0, 0, 0, 0.8);\n font-weight: 500;\n}\n\n.storecrm-line-restock-popup-button {\n display: block;\n width: 100%;\n padding: 12px 16px;\n background-color: #3b82f6;\n color: white;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n will-change: transform;\n backface-visibility: hidden;\n transform: translateZ(0);\n transition: transform 0.25s ease-out, background-color 0.2s ease;\n}\n\n.storecrm-line-restock-popup-button:hover {\n background-color: #2563eb;\n transform: scale(1.02);\n}\n\n.storecrm-line-restock-popup-button:active {\n transform: scale(0.98);\n}\n\n.storecrm-line-restock-popup-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n}\n\n/* \u9589\u3058\u308b\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u7528\u306e\u30af\u30e9\u30b9 */\n.storecrm-line-restock-popup-overlay.fade-out {\n animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n}\n\n.storecrm-line-restock-popup-overlay.fade-out .storecrm-line-restock-popup {\n animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;\n}\n\n/* \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u5b9a\u7fa9 */\n@keyframes mmfadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes mmfadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@keyframes mmslideIn {\n from {\n transform: translateY(15%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes mmslideOut {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-10%);\n }\n}\n\n/* \u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc */\n@media (max-width: 480px) {\n .storecrm-line-restock-popup {\n min-width: 280px;\n max-width: 90vw;\n padding: 20px;\n margin: 0 15px;\n }\n\n .storecrm-line-restock-popup-text {\n font-size: 14px;\n margin-bottom: 15px;\n }\n\n .storecrm-line-restock-popup-button {\n padding: 10px 14px;\n font-size: 13px;\n }\n}\n",""]);const a=s},556(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StatusWidget=void 0;t.StatusWidget=class{getMessages(){var e;const t=(null===(e=null===window||void 0===window?void 0:window.Shopify)||void 0===e?void 0:e.locale)||"";return"string"==typeof t&&t.toLowerCase().startsWith("ja")?{lineTitle:"LINE\u8a2d\u5b9a: ",lineOn:"\u8a2d\u5b9a\u6e08",lineOff:"\u672a\u767b\u9332",lineConnect:"\u767b\u9332\u3059\u308b",lineDisconnect:"\u89e3\u9664\u3059\u308b",mailTitle:"\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3: ",mailOn:"\u8cfc\u8aad\u4e2d",mailOff:"\u672a\u8cfc\u8aad",mailSubscribe:"\u8cfc\u8aad\u3059\u308b",mailUnsubscribe:"\u8cfc\u8aad\u89e3\u9664\u3059\u308b"}:{lineTitle:"LINE settings: ",lineOn:"Connected",lineOff:"Not connected",lineConnect:"Connect",lineDisconnect:"Disconnect",mailTitle:"Newsletter: ",mailOn:"Subscribed",mailOff:"Not subscribed",mailSubscribe:"Subscribe",mailUnsubscribe:"Unsubscribe"}}constructor(e,t,n){this.position="beforeend",this.header=e,this.config=n,this.position=t}setParent(e){this.parent=e}render(){this.parent&&this.parent.getStatus(e=>{this.renderedWidget&&(this.renderedWidget.remove(),this.renderedWidget=void 0),this.renderedWidget=this.createWidget(e),this.header.insertAdjacentElement(this.position,this.renderedWidget)},e=>{console.error("StoreCRM: StatusWidget render failed",e)}),this.parent||console.error("StoreCRM render: no parent. Abort.")}isLineVisible(e){return e.line_show_account&&(!e.line_debug_account||document.querySelector("#OnlineStorePreviewBarNextData")||window.Shopify.designMode)}createWidget(e){var t,n,o,i;const r=document.createElement("div");function s(e){const t=document.createElement("span");return t.classList.add("storecrm-off"),t.appendChild(document.createTextNode(e)),t}function a(e){const t=document.createElement("span");return t.classList.add("storecrm-on"),t.appendChild(document.createTextNode(e)),t}function c(e){const t=document.createElement("button");return t.classList.add("storecrm-button","storecrm-button-off"),t.appendChild(document.createTextNode(e)),t}function l(e){const t=document.createElement("button");return t.classList.add("storecrm-button","storecrm-button-on"),t.appendChild(document.createTextNode(e)),t}r.classList.add("storecrm-status-widget");const d=this.getMessages();if(this.isLineVisible(e)){const o=document.createElement("div");o.appendChild(document.createTextNode(d.lineTitle)),o.appendChild(e.line?a(d.lineOn):s(d.lineOff)),this.lineButton=e.line?c(d.lineDisconnect):l(d.lineConnect),o.appendChild(this.lineButton),r.appendChild(o),e.line?null===(t=this.lineButton)||void 0===t||t.addEventListener("click",this.lineUnsubscribe.bind(this)):null===(n=this.lineButton)||void 0===n||n.addEventListener("click",this.lineSubscribe.bind(this))}if(e.mail_show_account){const t=document.createElement("div");t.appendChild(document.createTextNode(d.mailTitle)),t.appendChild(e.accepts_marketing?a(d.mailOn):s(d.mailOff)),this.mailButton=e.accepts_marketing?c(d.mailUnsubscribe):l(d.mailSubscribe),t.appendChild(this.mailButton),r.appendChild(t),e.accepts_marketing?null===(o=this.mailButton)||void 0===o||o.addEventListener("click",this.unsubscribe.bind(this)):null===(i=this.mailButton)||void 0===i||i.addEventListener("click",this.subscribe.bind(this))}return r}lineSubscribe(){this.parent&&this.parent.lineSubscribe(function(e){alert(e)})}lineUnsubscribe(){this.parent&&this.parent.lineUnsubscribe(function(e){alert(e)})}subscribe(){this.parent&&this.parent.mailSubscribe(function(e){alert(e)})}unsubscribe(){this.parent&&this.parent.mailUnsubscribe(function(e){alert(e)})}}},575(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.style=t.render=void 0;const n='',o='';t.render=(e,t)=>{const i="ja"===("ja"===t?"ja":"en")?"\u30c6\u30b9\u30c8\u5546\u54c1":"Test Product";return`\n \n \n \n \n \n \n ${i}\n \n \n \n \n \n \n \n \n \n ${i}\n \n \n \n \n \n \n \n \n \n \n \n \n ${i}\n \n \n \n \n \n \n `};t.style=e=>"\n \n",t.schema={preview:(e,n)=>{let o='
';return o+=(0,t.style)(e),o+=`

${e.list_title}

`,o+=`${e.loading_text}`,o+=`${e.non_item_text}`,o+="",o+="",o+=(0,t.render)(e,n),o+="",o+="
",o+="
",o},rows:[{type:"text",slug:"list_title",nameJa:"\u30bf\u30a4\u30c8\u30eb",nameEn:"title",defaultJa:"\u304a\u6c17\u306b\u5165\u308a\u4e00\u89a7",defaultEn:"Your favorites"},{type:"text",slug:"loading_text",nameJa:"\u8aad\u307f\u8fbc\u307f\u4e2d\u306b\u8868\u793a\u3059\u308b\u30c6\u30ad\u30b9\u30c8",nameEn:"loading text",defaultJa:"\u8aad\u8fbc\u4e2d\u3067\u3059...",defaultEn:"Loading..."},{type:"text",slug:"non_item_text",nameJa:"\u304a\u6c17\u306b\u5165\u308a\u767b\u9332\u304c\u306a\u3044\u5834\u5408\u306b\u8868\u793a\u3059\u308b\u30c6\u30ad\u30b9\u30c8",nameEn:"non item text",defaultJa:"\u73fe\u5728\u304a\u6c17\u306b\u5165\u308a\u4e2d\u306e\u5546\u54c1\u306f\u3042\u308a\u307e\u305b\u3093",defaultEn:"There are currently no favorited items."},{type:"checkbox",slug:"show_cart",nameJa:"\u30ab\u30fc\u30c8\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3059\u308b",nameEn:"show cart button",default:!0},{type:"checkbox",slug:"insert_cart_directly",nameJa:"\u30ab\u30fc\u30c8\u30dc\u30bf\u30f3\u3067\u76f4\u63a5\u30ab\u30fc\u30c8\u306b\u5165\u308c\u308b",nameEn:"insert cart directly",default:!0,descriptionJa:"\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e2\u30fc\u30c9\u306e\u5834\u5408\u306e\u307f\u6709\u52b9\u3067\u3059\u3002\u30ab\u30fc\u30c8\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u3001\u81ea\u52d5\u3067\u30ab\u30fc\u30c8\u306b\u5165\u308a\u3001\u30ab\u30fc\u30c8\u30da\u30fc\u30b8\u306b\u9077\u79fb\u3057\u307e\u3059\u3002",descriptionEn:"Only for variation mode. When you press the cart button, it will automatically be added to the cart and transition to the cart page."}]}},600(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(n(805));window.storecrm=new i.default(window.storecrm_config||{}),window.storecrm.init()},669(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.render=t.generateDefaultSettings=t.LineRestockButton=void 0;class n{constructor(e,t,n,o,i){this.eventTriggered=!1,this.variants=n,this.buttonSettings=o,this.productId=t,this.product=i}static getInstance(e,t=null,o=null,i=null,r=null){if(n.instances[e])i&&(n.instances[e].buttonSettings=i);else{if(!(t&&o&&i&&r))throw new Error("StoreCRM LineRestock: productId, variants, buttonSettings, product are required");n.instances[e]=new n(e,t,o,i,r)}return n.instances[e]}createScript(e,t){const n=e?"onclick=\"event.preventDefault();(function(){ const el=document.getElementById('storecrm-line-restock-modal'); if(el){ el.style.display='flex'; } })();\"":`onclick="event.preventDefault();window.storecrm ? window.storecrm.showLineRestockPopup('${t}') : alert('\u8aad\u8fbc\u4e2d\u3067\u3059\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');"`;return`\n\n\n
\n\n
\n `}checkRender(e){document.querySelectorAll(`.storecrm-line-restock-${e}`).forEach(t=>{var n,o;if(t instanceof HTMLElement&&t.closest('[data-type="line-restock-button"]')){const i=new URL(location.href),r=(null===(n=this.variants.find(e=>e.available))||void 0===n?void 0:n.id)||this.variants[0].id||null,s=parseInt(i.searchParams.get("variant")||r,10);if(!s)return void console.error("StoreCRM Restock: variantId is not set",s);if(!this.product||!this.product.tags||this.product.tags.indexOf("storecrm-restock-hidden")>=0)return void(t.style.display="none");const a=window.Shopify&&window.Shopify.designMode||this.variants.find(e=>!e.available&&e.id===s);t.style.display=a?"inline-block":"none";const c=new URLSearchParams(window.location.search),l=(c.get("line_profile_data"),c.get("line_login_error"));if(l)return void console.error("LINE\u30ed\u30b0\u30a4\u30f3\u95a2\u9023\u306e\u30a8\u30e9\u30fc:",l);if(c.get("line_connect"))return void(null===(o=window.storecrm)||void 0===o||o.showLineRestockPopup(e))}})}render(e,t=!1){if(t)return this.createScript(!0,e);if(!this.eventTriggered){if(this.eventTriggered=!0,window.navigation)window.navigation.addEventListener("navigate",()=>{window.setTimeout(()=>this.checkRender(e),100)}),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3);else{let t=location.href;window.setInterval(()=>{t!==location.href&&(t=location.href,this.checkRender(e))},1e3),window.setTimeout(()=>this.checkRender(e),100),window.setTimeout(()=>this.checkRender(e),1e3)}return this.createScript(!1,e)}}}t.LineRestockButton=n,n.instances={};t.generateDefaultSettings=(e="ja")=>{const n={};return t.schema.rows.forEach(t=>{"text"===t.type?n[t.slug]="ja"===e?t.defaultJa:t.defaultEn:(t.type,n[t.slug]=t.default)}),n};t.render=({productId:e,variantId:t,variants:o,id:i,buttonSettings:r,isOutOfStock:s,product:a,preview:c=!1})=>n.getInstance(i,e,o,r,a).render(i,c);const o=e=>{const t=[`opacity: ${((e,t,n,o)=>{const i=Number(e);return Number.isFinite(i)?Math.min(o,Math.max(n,i)):t})(e.registered_button_opacity,.55,.3,1)}`,"cursor: not-allowed","pointer-events: none"];return e.registered_button_color&&t.push(`color: ${e.registered_button_color}`),e.registered_button_background_color&&t.push(`background-color: ${e.registered_button_background_color}`),e.registered_button_border_color&&t.push(`border-color: ${e.registered_button_border_color}`),t.join("; ")},i=(e,t,n)=>{const i=t.registered_button_text||("ja"===n?"LINE\u767b\u9332\u6e08\u307f":"LINE registered");return`\n
\n
${"ja"===n?"\u767b\u9332\u6e08\u307f\u8868\u793a":"Registered state"}
\n ${(e||"").replace(/]*)>[\s\S]*?<\/button>/,(e,n)=>{const r=String(n||"").replace(/\sonclick="[^"]*"/g,"");return`${s=i,String(null!=s?s:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}`;var s})}\n
`};t.schema={preview:(e,n)=>((e,t,n,o)=>`\n
\n
\n
${"ja"===o?"\u901a\u5e38\u8868\u793a":"Default state"}
\n ${e||""}\n
\n ${i(t,n,o)}\n
`)((0,t.render)({productId:"TEMP_productId",id:"TEMP_line_restock",buttonSettings:e,isOutOfStock:!1,preview:!0,product:{tags:[]},variants:[]}),(0,t.render)({productId:"TEMP_productId",id:"TEMP_line_restock_registered",buttonSettings:e,isOutOfStock:!1,preview:!0,product:{tags:[]},variants:[]}),e,n),info:{textJa:"\u30ef\u30f3\u30b9\u30c6\u30c3\u30d7\u3067\u518d\u5165\u8377\u901a\u77e5\u3092LINE\u3067\u53d7\u3051\u53d6\u308c\u308b\u30dc\u30bf\u30f3\u3092\u8a2d\u7f6e\u3057\u307e\u3059\u3002",textEn:"Set up a button that allows customers to receive restock notifications via LINE in one step.",noteJa:'\u203b\u672c\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306fLINE\u9023\u643a\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002',noteEn:'\u203bLINE integration settings must be completed to enable this feature.'},rows:[{type:"text",slug:"button_text",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"buttonText",defaultJa:"LINE\u3067\u518d\u5165\u8377\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b",defaultEn:"Get LINE restock notifications"},{type:"text",slug:"registered_button_text",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u30dc\u30bf\u30f3\u30c6\u30ad\u30b9\u30c8",nameEn:"Registered button text",defaultJa:"LINE\u767b\u9332\u6e08\u307f",defaultEn:"LINE registered"},{type:"range",slug:"button_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u5e45",nameEn:"buttonWidth",default:240,min:50,max:600,step:10},{type:"range",slug:"button_height",nameJa:"\u30dc\u30bf\u30f3\u306e\u9ad8\u3055",nameEn:"buttonHeight",default:50,min:30,max:100,step:5},{type:"colorpicker",slug:"button_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272",nameEn:"buttonColor",default:"#000000"},{type:"colorpicker",slug:"button_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"buttonBackgroundColor",default:"#ffffff"},{type:"colorpicker",slug:"button_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272",nameEn:"buttonBorderColor",default:"#000000"},{type:"colorpicker",slug:"registered_button_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u6587\u5b57\u8272",nameEn:"Registered text color",default:"#047857"},{type:"colorpicker",slug:"registered_button_background_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u80cc\u666f\u8272",nameEn:"Registered background color",default:"#ecfdf5"},{type:"colorpicker",slug:"registered_button_border_color",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u67a0\u7dda\u8272",nameEn:"Registered border color",default:"#a7f3d0"},{type:"colorpicker",slug:"button_hover_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverColor",default:"#222222"},{type:"colorpicker",slug:"button_hover_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBackgroundColor",default:"#dddddd"},{type:"colorpicker",slug:"button_hover_border_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u8272(\u30db\u30d0\u30fc\u6642)",nameEn:"buttonHoverBorderColor",default:"#222222"},{type:"range",slug:"button_radius",nameJa:"\u30dc\u30bf\u30f3\u306e\u4e38\u307f",nameEn:"buttonRadius",default:0,min:0,max:20,step:1},{type:"range",slug:"button_border_width",nameJa:"\u30dc\u30bf\u30f3\u306e\u7dda\u306e\u592a\u3055",nameEn:"buttonBorderWidth",default:0,min:0,max:5,step:1},{type:"fontpicker",slug:"button_font",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8",nameEn:"buttonFont",default:"helvetica_n4"},{type:"range",slug:"button_fontsize",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba",nameEn:"buttonFontSize",default:16,min:10,max:30,step:1},{type:"range",slug:"button_fontweight",nameJa:"\u30dc\u30bf\u30f3\u306e\u30d5\u30a9\u30f3\u30c8\u30a6\u30a7\u30a4\u30c8",nameEn:"buttonFontWeight",default:400,min:100,max:900,step:100},{type:"range",slug:"button_speed",nameJa:"\u30dc\u30bf\u30f3\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u901f\u5ea6",nameEn:"buttonSpeed",default:.3,min:0,max:1,step:.1},{type:"range",slug:"registered_button_opacity",nameJa:"\u767b\u9332\u6e08\u307f\u6642\u306e\u900f\u660e\u5ea6",nameEn:"Registered opacity",default:.55,min:.3,max:1,step:.05},{type:"select",slug:"align",nameJa:"\u30dc\u30bf\u30f3\u306e\u914d\u7f6e",nameEn:"align",default:"center",defaultJa:"\u4e2d\u592e\u5bc4\u305b",defaultEn:"Center",selectOptionsJa:[{value:"left",label:"\u5de6\u5bc4\u305b"},{value:"center",label:"\u4e2d\u592e\u5bc4\u305b"},{value:"right",label:"\u53f3\u5bc4\u305b"}],selectOptionsEn:[{value:"left",label:"Align left"},{value:"center",label:"Align center"},{value:"right",label:"Align right"}]}]}},720(e,t,n){function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);nh});var s,a,c,l,d,u=(s=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],a=function(){function e(t){var n=t.targetModal,o=t.triggers,r=void 0===o?[]:o,s=t.onShow,a=void 0===s?function(){}:s,c=t.onClose,l=void 0===c?function(){}:c,d=t.openTrigger,u=void 0===d?"data-micromodal-trigger":d,h=t.closeTrigger,m=void 0===h?"data-micromodal-close":h,g=t.openClass,p=void 0===g?"is-open":g,f=t.disableScroll,_=void 0!==f&&f,v=t.disableFocus,b=void 0!==v&&v,y=t.awaitCloseAnimation,k=void 0!==y&&y,w=t.awaitOpenAnimation,S=void 0!==w&&w,x=t.debugMode,R=void 0!==x&&x;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modal=document.getElementById(n),this.config={debugMode:R,disableScroll:_,openTrigger:u,closeTrigger:m,openClass:p,onShow:a,onClose:l,awaitCloseAnimation:k,awaitOpenAnimation:S,disableFocus:b},r.length>0&&this.registerTriggers.apply(this,i(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t,n;return t=e,(n=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,n=new Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){this.modal.addEventListener("animationend",function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()},!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var n=this.config.openClass;this.modal.addEventListener("animationend",function e(){t.classList.remove(n),t.removeEventListener("animationend",e,!1)},!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(s);return Array.apply(void 0,i(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var n=t.filter(function(t){return!t.hasAttribute(e.config.closeTrigger)});n.length>0&&n[0].focus(),0===n.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter(function(e){return null!==e.offsetParent}),this.modal.contains(document.activeElement)){var n=t.indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&o(t.prototype,n),e}(),c=null,l=function(e){if(!document.getElementById(e))return console.warn("MicroModal: \u2757Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},d=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: \u2757Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var n in t)l(n);return!0},{init:function(e){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=i(document.querySelectorAll("[".concat(t.openTrigger,"]"))),o=function(e,t){var n=[];return e.forEach(function(e){var o=e.attributes[t].value;void 0===n[o]&&(n[o]=[]),n[o].push(e)}),n}(n,t.openTrigger);if(!0!==t.debugMode||!1!==d(n,o))for(var r in o){var s=o[r];t.targetModal=r,t.triggers=i(s),c=new a(t)}},show:function(e,t){var n=t||{};n.targetModal=e,!0===n.debugMode&&!1===l(e)||(c&&c.removeEventListeners(),(c=new a(n)).showModal())},close:function(e){e?c.closeModalById(e):c.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=u);const h=u},729(e,t,n){n.r(t),n.d(t,{default:()=>_});var o=n(812),i=n.n(o),r=n(381),s=n.n(r),a=n(511),c=n.n(a),l=n(932),d=n.n(l),u=n(296),h=n.n(u),m=n(77),g=n.n(m),p=n(534),f={};f.styleTagTransform=g(),f.setAttributes=d(),f.insert=c().bind(null,"head"),f.domAPI=s(),f.insertStyleElement=h();i()(p.A,f);const _=p.A&&p.A.locals?p.A.locals:void 0},745(e,t){Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(e){this.loginButtonImg="/buttons/images/line_login_btn.png",this.parent=e}static isLoginOrRegisterPage(){const e=window.location.pathname,t=n.isLoginPath(e),o=n.isRegisterPath(e);if(t||o)return!0;const i=n.isLoginPage(),r=n.isRegisterPage();return!(!i&&!r)}static isLineLoginEnabled(){return window.storecrm_config.line&&window.storecrm_config.line.line_login_enable?!(window.storecrm_config.line.line_login_onlypreview&&!(window.Shopify&&window.Shopify.designMode||document.querySelector("#OnlineStorePreviewBarNextData")))||(console.info("StoreCRM: line_login_onlypreview is set, but not in Shopify designMode. LINE login will not be initialized."),!1):(console.info("StoreCRM: line_login_enable is not set or false. LINE login will not be initialized."),!1)}init(){if(n.isLineLoginEnabled())try{const e=document.querySelectorAll(`.${n.CUSTOM_CONTAINER_CLASS}`);if(e.length>0)return void e.forEach(e=>{const t=this.createLineButton(!0);e.appendChild(t)});n.isLoginPage()&&this.addLoginButton(),n.isRegisterPage()&&this.addRegisterButton(),this.clearSessionStorage()}catch(e){console.error("Error in init:",e)}}clearSessionStorage(){location.pathname.includes("/register")||(sessionStorage.removeItem("line_email"),sessionStorage.removeItem("line_lineId"))}static isLoginPage(){try{return!!document.querySelector('form[action*="login"], form[action*="sign_in"]')}catch(e){return console.error("Error in isLoginPage:",e),!1}}static isRegisterPage(){try{return!!document.querySelector('form[action^="/account"]')}catch(e){return console.error("Error in isRegisterPage:",e),!1}}addLoginButton(){var e;const t=document.querySelector('form[action*="/account/login"]');if(!t)return;let n=t.querySelector('button[type="submit"]');if(n||(n=t.querySelector("button")),!n){const e=document.createElement("div");e.className="line-login-container",e.style.marginTop="20px",e.style.textAlign="center";const n=this.createLineButton(!0);return e.appendChild(n),void t.appendChild(e)}const o=document.createElement("div");o.className="line-login-container",o.style.marginTop="20px",o.style.textAlign="center";const i=this.createLineButton(!0);o.appendChild(i),null===(e=n.parentNode)||void 0===e||e.insertBefore(o,n.nextSibling)}addRegisterButton(){var e;const t=document.querySelector('form[action^="/account"]');if(!t)return;const n=new URLSearchParams(window.location.search);let o=n.get("email"),i=n.get("line_id");if(o?sessionStorage.setItem("line_email",o):o=sessionStorage.getItem("line_email"),i?sessionStorage.setItem("line_lineId",i):i=sessionStorage.getItem("line_lineId"),o&&o.includes("@")){const e=t.querySelector('input[name="customer[email]"]');e&&(e.value=o)}if(i){let e=t.querySelector('input[name="customer[note][lineId]"]');e||(e=document.createElement("input"),e.type="hidden",e.name="customer[note][lineId]",t.appendChild(e)),e.value=i}if(i||o)try{const e=t,n=new URL(e.action,window.location.origin);i?n.searchParams.set("line_id",i):n.searchParams.delete("line_id"),o?n.searchParams.set("email",o):n.searchParams.delete("email"),e.action=n.pathname+(n.search?n.search:"")}catch(e){console.error("Failed to update form action with line_id/email:",e)}if(i){const e=document.createElement("div");return e.textContent="LINE\u30ed\u30b0\u30a4\u30f3\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u9023\u643a\u3092\u884c\u3063\u3066\u4f1a\u54e1\u767b\u9332\u3092\u884c\u3046\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30d5\u30a9\u30fc\u30e0\u3088\u308a\u3054\u767b\u9332\u304f\u3060\u3055\u3044",e.style.color="#d32f2f",e.style.fontWeight="bold",e.style.fontSize="13px",e.style.marginBottom="20px",e.style.textAlign="center",void t.insertBefore(e,t.firstChild)}let r=t.querySelector('button[type="submit"]');if(r||(r=t.querySelector("button")),!r){const e=document.createElement("div");e.className="line-login-container",e.style.marginTop="20px",e.style.textAlign="center";const n=this.createLineButton(!1);return e.appendChild(n),void t.appendChild(e)}const s=document.createElement("div");s.className="line-login-container",s.style.marginTop="20px",s.style.textAlign="center";const a=this.createLineButton(!1);s.appendChild(a),null===(e=r.parentNode)||void 0===e||e.insertBefore(s,r.nextSibling)}createLineButton(e=!0){if(!document.getElementById("btn-line-login-style")){const e=document.createElement("style");e.id="btn-line-login-style",e.innerHTML=".btn-line-login::after { box-shadow: none !important; }",document.head.appendChild(e)}const t=document.createElement("button");t.type="button",t.className="btn-line-login",t.style.backgroundColor="#06C755",t.style.color="#FFFFFF",t.style.border="none",t.style.borderRadius="4px",t.style.padding="0 6px",t.style.cursor="pointer",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.width="auto",t.style.height="48px",t.style.marginBottom="10px",t.style.textAlign="center",t.style.fontWeight="bold",t.style.fontSize="16px",t.style.letterSpacing="0.03em",t.style.boxShadow="0 2px 4px 0 rgba(0,0,0,0.04)",t.style.transition="background 0.2s",t.style.position="relative",t.style.overflow="hidden",t.style.boxSizing="border-box",t.style.marginTop="12px",t.style.marginBottom="12px",t.style.paddingTop="0",t.style.paddingBottom="0",t.onmouseover=()=>{t.style.backgroundColor="#06C755",t.style.filter="brightness(0.95)"},t.onmouseout=()=>{t.style.backgroundColor="#06C755",t.style.filter="none"},t.onmousedown=()=>{t.style.backgroundColor="#06C755",t.style.filter="brightness(0.85)"},t.onmouseup=()=>{t.style.backgroundColor="#06C755",t.style.filter="brightness(0.95)"};const o=document.createElement("span");o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.marginRight="12px",o.style.width="32px",o.style.height="32px",o.style.flexShrink="0",o.style.background="none";const i=document.createElement("img");i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAACpUlEQVRYhe2XTYhNURzAf8cMZSQSRT4LSRaGfISNlLJ8WUiUUMrKRoqFlUyyQNnY2tnaaEI2vmZKeoo0YUE+UhYTEoN+FveOnjvn3ufNu++N9H6re+85//P/nf875577oEOHDh3+K0IzwWo3sAXYDqwDlgMLgClplxHgNfAMeADcBO6EEH40k3c8ovPUs+p7G+d9GjuvHaLT1DPqt3GIZhlJx5rWKtledagE0SxDam/ZstvUTy2QHeWTuq0s2c3qlxbKjvJF3VzPp/Atoc4GqsD8UmZfnzdAbwjhQ16HSXUG6KN9sqS5+oo65FZYXQy8ALpKlqrHT2BpCOFlrLG7IHAfY2WHgGFgY+b5C+AtsAl4BbwjOVBGeUJyiKwC7mdie4D1Nfddae5TBW5jUe9GNsbWtC1LJX1eVfen1xdq2teoS9RqJM/MyHh387yKKryqoRmO5RiwgaTqZiQrQCW9jR0cubmLNt2MBgWzTAV2AbEd/5VkaQ0DHxvJXVThZrkM7AT2kGyk34QQ+oF+SJYEcPBvBy2qcHSXNkAFOBpCuAE8rm1QD6frvQoMRGJf5Q1aVOFBYHFO24Ga66LqnFEHQwi39Y9lPECyLABmAuczcfcKxoyj7o7s3h2RfpfSvkF9qh5Su2ti3qpz1eXq40j8nEienXleRQfHFOA5sLDh2TbHc2Bl3kd+7hoOIYwAx1tlVcCRpv6RqFciP1mruNj0dNUe46de2VxXJzctnEpPV6+1UPaW2lOKbI30JPWE+rVk2auly2bEl5ms658lyJ5T2/P5qi5ST6qPxiH6Wd3dFtEc+VnqdvW4+qyO7EN1xYTJZlHX5Yh+V0+bHEj/DuraiOwDdfVEu0VR99aIDqtHbdfGGg8mn46fTd4Asyfap0OHDh3+cX4BcUOZ2CqT2BUAAAAASUVORK5CYII=",i.width=32,i.height=32,i.alt="LINE",i.style.display="block",i.style.width="32px",i.style.height="32px",o.appendChild(i);const r=document.createElement("span");r.textContent=e?n.BUTTON_TEXT:n.REGISTER_BUTTON_TEXT,r.style.display="inline-block",r.style.whiteSpace="nowrap",r.style.fontWeight="bold",r.style.fontSize="16px",r.style.lineHeight="1",r.style.letterSpacing="0.03em",r.style.userSelect="none",r.style.padding="0 32px",t.appendChild(o),t.appendChild(r);const s=document.createElement("div");s.className="line-login-container",s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center",s.style.width="100%",s.style.marginTop="20px",s.style.marginBottom="10px",s.appendChild(t),t.onclick=()=>{this.parent.doLineLogin()};const a=new URLSearchParams(window.location.search).get("line_login_error"),c=document.createElement("div");if(c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.width="100%",c.appendChild(s),a){const e=document.createElement("div");e.textContent=a,e.style.color="#d32f2f",e.style.fontWeight="bold",e.style.fontSize="13px",e.style.marginTop="0px",e.style.marginBottom="15px",e.style.textAlign="center",c.appendChild(e)}return c}static isLoginPath(e){return"/account/login"===e||/\blogin\b/i.test(e)}static isRegisterPath(e){return"/account/register"===e||(/\bregister\b/i.test(e)||/\bsignup\b/i.test(e))}}n.BUTTON_CLASS="line-login-button",n.CUSTOM_CONTAINER_CLASS="line-login-custom-container",n.instance=null,n.BUTTON_TEXT="LINE\u3067\u30ed\u30b0\u30a4\u30f3",n.REGISTER_BUTTON_TEXT="LINE\u3067\u767b\u9332",t.default=n},748(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,o,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var a=0;a0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},754(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.RestockPopupManager=void 0;const i=o(n(720));class r{constructor(e,t=!1){this.content=null,this.title=null,this.secondTitle=null,this.popup=null,this.button=null,this.footer=null,this.secondFooter=null,this.preview=!1,this.showSecondPopup=!1,this.container=null,this.secondContainer=null,this.secondContent=null,this.close=null,this.product_id=null,this.inited=!1,this.preview=t,this.config=e,this.init()}static getInstance(e,t=!1){return r.instance?(r.instance.config=e,r.instance.preview=t):r.instance=new r(e,t),r.instance}setParent(e){this.parent=e}renderTemplate(){document&&document.body?document.body.insertAdjacentHTML("beforeend",r.template):window.setTimeout(this.renderTemplate.bind(this),100)}init(){document&&document.body?this.runInit():window.setTimeout(this.init.bind(this),100)}runInit(){this.inited=!0,this.preview||document.body.insertAdjacentHTML("beforeend",r.template),i.default.init(),this.updateElements(),this.container&&this.container.addEventListener("click",e=>{e.stopPropagation()}),this.close=this.container&&this.container.querySelectorAll(".storecrm_modal__close"),this.close&&!this.preview&&this.close.forEach(e=>{e.addEventListener("click",e=>{i.default.close("storecrm-modal")})})}updateElements(){this.popup=document.getElementById("storecrm-modal"),this.content=document.getElementById("storecrm-modal-content"),this.secondContent=document.getElementById("storecrm-modal-second-content"),this.title=document.getElementById("storecrm-modal-title"),this.secondTitle=document.getElementById("storecrm-modal-second-title"),this.footer=document.querySelector(".storecrm_modal__footer"),this.secondFooter=document.getElementById("storecrm-modal-second-footer"),this.container=document.querySelector(".storecrm_modal__container"),this.secondContainer=document.getElementById("storecrm-modal-second-popup-preview")}render(e,t,n={}){var o,i,r,s;if(this.preview&&this.updateElements(),this.showSecondPopup=e.add_accepts_marketing_checkbox&&this.preview,this.footer&&0!==this.footer.children.length&&(this.footer.innerHTML=""),this.button=null,!n.hideSubmitButton){const t=document.createElement("button");t.className="storecrm_modal__btn storecrm_modal__btn-primary",t.innerHTML=e.button_text,null===(o=this.footer)||void 0===o||o.appendChild(t),this.button=t}this.button&&!this.preview&&this.button.addEventListener("click",()=>{this.checkAcceptsMarketingStatusAndClearMessages()}),this.config=e;const a=n.email||(null===(i=window.storecrm_data)||void 0===i?void 0:i.customer_email)||window.localStorage.getItem("storecrm_restock_email")||"",c=n.readOnly?' disabled aria-disabled="true"':"",l=n.readOnly?' readonly aria-readonly="true"':"";if(this.title&&this.content&&this.popup){this.title.innerText=e.popup_title;let o=`\n
${e.popup_description}
\n
\n
${e.emailaddress}
\n${e.add_accepts_marketing_checkbox?``:""}\n${e.add_accepts_marketing_checkbox?``:""}\n
\n`.trim(),i=n.variantId||null;if(location.search&&location.search.includes("variant")){const e=new URL(location.href);i=i||e.searchParams.get("variant")}console.error("RestockPopupManager: render: variants",t,i);const r=t.filter(e=>!e.available).map(e=>``).join("");t&&Array.isArray(t)&&t.length>1?(o=o.replace("\x3c!-- select_style --\x3e",""),o=o.replace("\x3c!-- options --\x3e",r)):(o=o.replace("\x3c!-- select_style --\x3e","display:none"),o=o.replace("\x3c!-- options --\x3e",r)),this.content.innerHTML=o,this.content.style.color=e.text_color,this.container&&(this.container.style.backgroundColor=e.background_color,this.container.style.borderRadius=`${e.button_radius}px`,this.container.style.width="100%"),this.button&&(this.button.style.backgroundColor=e.button_background_color,this.button.style.color=e.button_text_color),this.close&&this.close.forEach(t=>{t.style.color=e.close_text_color})}if(this.resetMessage(),this.showSecondPopup&&this.secondTitle&&this.secondContent&&this.secondContainer){this.secondContainer.style.display="block",this.secondTitle.innerText=e.popup_title;let t="";t=`\n
${e.email_confirmation_text}
hogehoge@hoge.com
\n
`,this.secondContent.innerHTML=t,this.secondContent.style.color=e.text_color,this.secondContainer.style.backgroundColor=e.background_color,this.secondContainer.style.borderRadius=`${e.button_radius}px`,this.secondContainer.style.marginTop="20px",this.secondContainer.style.width="100%",this.secondFooter&&0!==this.secondFooter.children.length&&(this.secondFooter.innerHTML="");const n=document.createElement("button");n.className="storecrm_modal__btn storecrm_modal__btn-primary",n.innerHTML=e.button_text,n.style.backgroundColor=e.button_background_color,n.style.color=e.button_text_color,null===(r=this.secondFooter)||void 0===r||r.appendChild(n)}else this.secondContainer&&(this.secondContainer.style.display="none");this.preview||null===(s=document.getElementById("storecrm-modal-second-popup-preview"))||void 0===s||s.remove(),this.preview&&(this.success(this.config.success_text),this.failure(this.config.error_text),this.popup&&this.popup.querySelectorAll(".storecrm_modal__overlay,.storecrm_modal__close").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}))}resetMessage(){var e,t;this.footer&&(null===(e=this.footer)||void 0===e||e.querySelectorAll(".storecrm_modal_message").forEach(e=>e.remove())),this.preview&&this.secondFooter&&(null===(t=this.secondFooter)||void 0===t||t.querySelectorAll(".storecrm_modal_message").forEach(e=>e.remove()))}disableButton(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.innerText="Sending...")}enableButtion(){this.button&&(this.button.removeAttribute("disabled"),this.button.innerText=this.config.button_text||"Enable Restock Notification")}submit(e=!1){var t,n,o;if(this.preview)return;this.resetMessage(),this.disableButton();const i=null===(t=this.content)||void 0===t?void 0:t.querySelector("#storecrm_restock_email"),r=null===(n=this.content)||void 0===n?void 0:n.querySelector("#storecrm_restock_variant"),s=null===(o=this.content)||void 0===o?void 0:o.querySelector("#storecrm_restock_accepts_marketing"),a=i?i.value:"",c=r?r.value:"",l=this.product_id,d=s?s.checked:null;this.parent&&this.parent.storeRestock(a,c,l,d,this.config.add_accepts_marketing_checkbox,e,this.success.bind(this),this.failure.bind(this))}show(e,t,n,o={}){this.product_id=n,this.inited?this.runShow(e,t,o):window.setTimeout(()=>this.show(e,t,n,o),100)}runShow(e,t,n={}){this.render(e,t,n);if(document.getElementById("storecrm-modal"))try{i.default.show("storecrm-modal")}catch(e){console.warn("StoreCRM: MicroModal show failed",e)}else console.warn("StoreCRM: restock popup modal element not found, skip show")}hide(){if(document.getElementById("storecrm-modal"))try{i.default.close("storecrm-modal")}catch(e){console.warn("StoreCRM: MicroModal close failed",e)}}success(e){this.enableButtion();const t=document.createElement("div");t.classList.add("storecrm_modal_success","storecrm_modal_message"),t.style.color=this.config.success_text_color,t.style.backgroundColor=this.config.success_background_color,t.innerText=e,this.showSecondPopup?this.secondFooter&&this.secondFooter.appendChild(t):this.footer&&this.footer.appendChild(t)}failure(e){this.enableButtion();const t=document.createElement("div");t.classList.add("storecrm_modal_error","storecrm_modal_message"),t.style.color=this.config.failure_text_color,t.style.backgroundColor=this.config.failure_background_color,t.innerText=e,this.showSecondPopup?this.secondFooter&&this.secondFooter.appendChild(t):this.footer&&this.footer.appendChild(t)}checkAcceptsMarketingStatusAndClearMessages(){var e;if(this.resetMessage(),!this.config.add_accepts_marketing_checkbox)return void this.submit(!1);const t=null===(e=this.content)||void 0===e?void 0:e.querySelector("#storecrm_restock_email");this.parent.doMailCheck(t.value,this.failure.bind(this)).then(e=>{e.email?e.accepts_marketing?this.submit(!1):this.showAcceptsMarketingCheckbox(!1):this.showAcceptsMarketingCheckbox(!0)})}showAcceptsMarketingCheckbox(e){var t;const n=document.getElementById("storecrm-modal-content"),o=null===(t=this.content)||void 0===t?void 0:t.querySelector("#storecrm_restock_email"),i=document.getElementById("accepts_marketing_checkbox_container"),r=document.getElementById("email_confirmation_container");if(!n||!i||!r)return;r.innerHTML=this.config.email_confirmation_text+"
"+o.value;const s=Array.from(n.children);s.forEach(e=>{"none"!==e.style.display&&e.classList.add("fade-out")}),setTimeout(()=>{s.forEach(e=>{e.style.display="none"})},300),i.classList.add("fade-in"),setTimeout(()=>{i.style.display="block"},300),r.classList.add("fade-in"),setTimeout(()=>{r.style.display="block"},300),this.switchSubmitButton(e)}switchSubmitButton(e){var t;this.footer&&(this.footer.innerHTML="");const n=document.createElement("button");n.className="storecrm_modal__btn storecrm_modal__btn-primary",n.style.color=this.config.button_text_color,n.style.backgroundColor=this.config.button_background_color,n.innerHTML=this.config.button_text,this.footer&&this.footer.appendChild(n),this.button=n,null===(t=this.button)||void 0===t||t.addEventListener("click",()=>{this.submit(e)})}}t.RestockPopupManager=r,r.template='';let s=null;t.schema={preview:(e,t)=>{var n,o;return n=()=>{r.getInstance(e,!0).show(e,[],"1234567890")},o=300,clearTimeout(s),s=setTimeout(n,o),r.template},rows:[{type:"text",slug:"popup_title",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30bf\u30a4\u30c8\u30eb",nameEn:"Popup title",defaultJa:"\u518d\u5165\u8377\u901a\u77e5",defaultEn:"Restock Notification"},{type:"text",slug:"popup_description",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u672c\u6587",nameEn:"Popup description",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u3054\u5e0c\u671b\u306e\u65b9\u306f\u4ee5\u4e0b\u304b\u3089\u3001\u3054\u9078\u629e\u304f\u3060\u3055\u3044\u3002",defaultEn:"If you would like to receive a restock notification, please select from below."},{type:"text",slug:"emailaddress",nameJa:"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30d5\u30a9\u30fc\u30e0\u540d",nameEn:"Email address form name",defaultJa:"\u3054\u9023\u7d61\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9",defaultEn:"Contact Email Address"},{type:"colorpicker",slug:"background_color",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u80cc\u666f\u8272",nameEn:"Popup background color",default:"#ffffff"},{type:"colorpicker",slug:"text_color",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30c6\u30ad\u30b9\u30c8\u8272",nameEn:"Popup text color",default:"#000000"},{type:"colorpicker",slug:"close_text_color",nameJa:"\u9589\u3058\u308b\u30dc\u30bf\u30f3\u306e\u8272",nameEn:"Popup close button text color",default:"#000000"},{type:"colorpicker",slug:"button_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"buttonHoverColor",default:"#222222"},{type:"colorpicker",slug:"button_text_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8\u30ab\u30e9\u30fc",nameEn:"buttonHoverBackgroundColor",default:"#dddddd"},{type:"text",slug:"button_text",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"buttonText",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b",defaultEn:"Enable restock notification"},{type:"text",slug:"success_text",nameJa:"\u6210\u529f\u6642\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Success text",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u304c\u767b\u9332\u3055\u308c\u307e\u3057\u305f\u3002",defaultEn:"Restock notification has been registered."},{type:"colorpicker",slug:"success_background_color",nameJa:"\u6210\u529f\u6642\u306e\u80cc\u666f\u8272",nameEn:"Success background color",default:"#F0FDF4"},{type:"colorpicker",slug:"success_text_color",nameJa:"\u6210\u529f\u6642\u306e\u6587\u5b57\u8272",nameEn:"Success text color",default:"#166534"},{type:"text",slug:"error_text",nameJa:"\u5931\u6557\u6642\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Error text",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u306e\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002",defaultEn:"Failed to register restock notification. Please try again later."},{type:"text",slug:"error_text_email",nameJa:"\u5931\u6557\u6642\u306e\u30c6\u30ad\u30b9\u30c8(\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5224\u5b9a)",nameEn:"Error text",defaultJa:"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u78ba\u8a8d\u306e\u4e0a\u3001\u518d\u5ea6\u3054\u8a18\u5165\u304f\u3060\u3055\u3044\u3002",defaultEn:"The email address is incorrect. Please check and re-enter."},{type:"colorpicker",slug:"failure_background_color",nameJa:"\u30a8\u30e9\u30fc\u6642\u306e\u80cc\u666f\u8272",nameEn:"Success background color",default:"#FEF2F2"},{type:"colorpicker",slug:"failure_text_color",nameJa:"\u30a8\u30e9\u30fc\u6642\u306e\u6587\u5b57\u8272",nameEn:"Success text color",default:"#991B1B"},{type:"range",slug:"button_radius",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u4e38\u307f",nameEn:"buttonRadius",default:10,min:0,max:40,step:1},{type:"checkbox",slug:"add_accepts_marketing_checkbox",nameJa:"\u30e1\u30eb\u30de\u30ac\u914d\u4fe1\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u6709\u52b9\u5316",nameEn:"Add accepts marketing checkbox",default:!1},{type:"text",slug:"accepts_marketing_checkbox_text",nameJa:"\u30e1\u30eb\u30de\u30ac\u914d\u4fe1\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Accepts marketing checkbox text",defaultJa:"\u30e1\u30eb\u30de\u30ac\u914d\u4fe1\u306b\u540c\u610f\u3059\u308b",defaultEn:"I agree to receive marketing emails"},{type:"text",slug:"email_confirmation_text",nameJa:"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u78ba\u8a8d\u30c6\u30ad\u30b9\u30c8",nameEn:"Email confirmation text",defaultJa:"\u3053\u3061\u3089\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u9593\u9055\u3044\u306a\u3044\u3067\u3059\u304b\uff1f",defaultEn:"Is this the correct email address?"},{type:"checkbox",slug:"create_shopify_customer",nameJa:"\u30e1\u30eb\u30de\u30ac\u8cfc\u8aadON\u6642\u306bShopify\u9867\u5ba2\u3092\u4f5c\u6210\u3059\u308b",nameEn:"Create Shopify customer when marketing is subscribed",default:!1,checkVisible:e=>!0===e.add_accepts_marketing_checkbox},{type:"text",slug:"create_shopify_customer_tags",nameJa:"Shopify\u9867\u5ba2\u4f5c\u6210\u6642\u306b\u4ed8\u4e0e\u3059\u308b\u30bf\u30b0\uff08\u30ab\u30f3\u30de\u533a\u5207\u308a\uff09",nameEn:"Tags to add when creating Shopify customer (comma separated)",defaultJa:"",defaultEn:"",checkVisible:e=>!0===e.add_accepts_marketing_checkbox&&!0===e.create_shopify_customer}]}},785(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.schema=void 0;const n=e=>String(null!=e?e:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),o=e=>"string"==typeof e&&""!==e.trim()&&"undefined"!==e,i=(e,t,n)=>o(null==e?void 0:e[t])?e[t]:n,r=(e,t,n)=>{const i=null==e?void 0:e[t];return o(i)&&/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(i)?i:n},s=(e,t,n,o,i)=>{const r=null==e?void 0:e[t],s="number"==typeof r?r:Number.parseFloat(r);return Number.isFinite(s)?Math.min(i,Math.max(o,s)):n};t.schema={preview:(e,t)=>{const o="ja"===t?{title:"\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059",description:"\u518d\u5165\u8377\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b\u306b\u306f\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002",login:"\u30ed\u30b0\u30a4\u30f3",cancel:"\u30ad\u30e3\u30f3\u30bb\u30eb"}:{title:"Login required",description:"Please log in to receive restock notifications.",login:"Login",cancel:"Cancel"},a=n(i(e,"login_required_modal_title",o.title)),c=n(i(e,"login_required_modal_description",o.description)),l=n(i(e,"login_required_modal_login_button_text",o.login)),d=n(i(e,"login_required_modal_cancel_button_text",o.cancel)),u=r(e,"login_required_modal_background_color","#ffffff"),h=r(e,"login_required_modal_text_color","#111111"),m=r(e,"login_required_modal_overlay_color","#000000"),g=s(e,"login_required_modal_overlay_opacity",55,0,90),p=s(e,"login_required_modal_radius",2,0,24),f=s(e,"login_required_modal_width",576,320,720),_=r(e,"login_required_modal_login_button_background_color","#000000"),v=r(e,"login_required_modal_login_button_text_color","#ffffff"),b=r(e,"login_required_modal_cancel_button_background_color","#ffffff"),y=r(e,"login_required_modal_cancel_button_text_color","#111111"),k=r(e,"login_required_modal_cancel_button_border_color","#111111"),w=s(e,"login_required_modal_button_radius",32,0,40);return`\n \n \n `},rows:[{type:"checkbox",slug:"require_login_for_restock",nameJa:"\u518d\u5165\u8377\u901a\u77e5\u306e\u5229\u7528\u3092\u4f1a\u54e1\u9650\u5b9a\u306b\u3059\u308b",nameEn:"Require sign-in for restock notifications",descriptionJa:"ON\u306b\u3059\u308b\u3068\u3001\u672a\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306f\u30e1\u30fc\u30eb\u5165\u529b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u306f\u306a\u304f\u30ed\u30b0\u30a4\u30f3\u6848\u5185\u306b\u9032\u307f\u307e\u3059\u3002OFF\u306e\u5834\u5408\u306f\u5f93\u6765\u3069\u304a\u308a\u30b2\u30b9\u30c8\u306e\u30e1\u30fc\u30eb\u5165\u529b\u3067\u767b\u9332\u3067\u304d\u307e\u3059\u3002",descriptionEn:"When enabled, guests see the login prompt instead of the email input popup. When disabled, the existing guest email flow remains unchanged.",default:!1,fullsize:!0},{type:"checkbox",slug:"auto_register_after_login",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5f8c\u306b\u518d\u5165\u8377\u901a\u77e5\u3092\u81ea\u52d5\u767b\u9332\u3059\u308b",nameEn:"Automatically register restock notification after sign-in",descriptionJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u304cON\u306e\u3068\u304d\u3060\u3051\u6709\u52b9\u3067\u3059\u3002\u30ed\u30b0\u30a4\u30f3\u307e\u305f\u306f\u4f1a\u54e1\u767b\u9332\u5f8c\u306b\u5546\u54c1\u30da\u30fc\u30b8\u3078\u623b\u3063\u305f\u969b\u3001\u9867\u5ba2\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u30e1\u30fc\u30eb\u518d\u5165\u8377\u901a\u77e5\u3092\u81ea\u52d5\u767b\u9332\u3057\u307e\u3059\u3002\u30e1\u30fc\u30eb\u304c\u53d6\u5f97\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u81ea\u52d5\u767b\u9332\u305b\u305a\u3001\u518d\u64cd\u4f5c\u304c\u5fc5\u8981\u306a\u72b6\u614b\u306b\u3057\u307e\u3059\u3002",descriptionEn:"Only applies when sign-in is required. After sign-in or account creation, the customer returns to the product page and email restock is registered with their customer email. If email is unavailable, automatic registration is skipped and the customer must retry manually.",default:!1,depends:"require_login_for_restock",fullsize:!0},{type:"checkbox",slug:"one_click_when_logged_in",nameJa:"\u30ed\u30b0\u30a4\u30f3\u6e08\u307f\u9867\u5ba2\u306f\u30ef\u30f3\u30af\u30ea\u30c3\u30af\u3067\u518d\u5165\u8377\u901a\u77e5\u3092\u767b\u9332\u3059\u308b",nameEn:"Let signed-in customers register restock notifications in one click",descriptionJa:"\u30ed\u30b0\u30a4\u30f3\u6e08\u307f\u9867\u5ba2\u304c\u30e1\u30fc\u30eb\u307e\u305f\u306fLINE\u306e\u518d\u5165\u8377\u901a\u77e5\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u3001\u5165\u529b\u64cd\u4f5c\u3092\u7701\u7565\u3057\u3066\u767b\u9332\u3057\u307e\u3059\u3002\u767b\u9332\u7d50\u679c\u306f\u65e2\u5b58\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3092\u8aad\u307f\u53d6\u308a\u5c02\u7528\u306e\u5b8c\u4e86\u8868\u793a\u3068\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002",descriptionEn:"When a signed-in customer clicks the email or LINE restock button, registration runs without asking for input. The existing popup is reused as a read-only completion view.",default:!1,fullsize:!0},{type:"checkbox",slug:"show_registered_status_when_logged_in",nameJa:"\u30ed\u30b0\u30a4\u30f3\u6e08\u307f\u9867\u5ba2\u306b\u518d\u5165\u8377\u901a\u77e5\u306e\u767b\u9332\u6e08\u307f\u8868\u793a\u3092\u51fa\u3059",nameEn:"Show registered state to signed-in customers",descriptionJa:"\u30ed\u30b0\u30a4\u30f3\u6e08\u307f\u9867\u5ba2\u3060\u3051\u304c\u5bfe\u8c61\u3067\u3059\u3002active\u306a\u30e1\u30fc\u30eb\u307e\u305f\u306fLINE\u518d\u5165\u8377\u901a\u77e5\u304c\u3042\u308b\u5834\u5408\u3001\u5546\u54c1\u8a73\u7d30\u30da\u30fc\u30b8\u306e\u30dc\u30bf\u30f3\u3092\u767b\u9332\u6e08\u307f\u8868\u793a\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u5546\u54c1\u8868\u793a\u6642\u3068\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u5207\u308a\u66ff\u3048\u6642\u306b\u72b6\u614b\u78ba\u8a8dAPI\u3092\u4f7f\u3044\u307e\u3059\u3002",descriptionEn:"Only applies to signed-in customers. When an active email or LINE restock notification exists, the product page button switches to its registered state. This uses the status API on page load and variant changes.",default:!1,fullsize:!0},{type:"text",slug:"guest_redirect_url",nameJa:"\u30b2\u30b9\u30c8\u304c\u518d\u5165\u8377\u901a\u77e5\u3092\u62bc\u3057\u305f\u5834\u5408\u306e\u9077\u79fb\u5148URL\u3000\u203b\u7a7a\u6b04\u306e\u5834\u5408\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306b\u9077\u79fb\u3057\u307e\u3059",nameEn:"URL to redirect to when a guest clicks the restock notification button. If left blank, the login screen will be displayed.",descriptionJa:"\u672a\u6307\u5b9a\u306e\u5834\u5408\u306f\u30b9\u30c8\u30a2\u306e\u30ed\u30b0\u30a4\u30f3URL\u3001\u53d6\u5f97\u3067\u304d\u306a\u3044\u5834\u5408\u306f /account/login \u306b\u9077\u79fb\u3057\u307e\u3059\u3002\u5546\u54c1\u30da\u30fc\u30b8\u3078\u623b\u308b\u305f\u3081\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u81ea\u52d5\u3067\u4ed8\u4e0e\u3057\u307e\u3059\u3002",descriptionEn:"If blank, the storefront login URL is used, falling back to /account/login. The return parameter for the product page is added automatically.",defaultJa:"",defaultEn:"",depends:"require_login_for_restock",fullsize:!0},{type:"text",slug:"login_required_modal_title",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30bf\u30a4\u30c8\u30eb",nameEn:"Login required popup title",defaultJa:"\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059",defaultEn:"Login required",depends:"require_login_for_restock",showWithPreview:!0},{type:"text",slug:"login_required_modal_description",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u672c\u6587",nameEn:"Login required popup description",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b\u306b\u306f\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002",defaultEn:"Please log in to receive restock notifications.",depends:"require_login_for_restock",showWithPreview:!0},{type:"text",slug:"login_required_modal_login_button_text",nameJa:"\u30ed\u30b0\u30a4\u30f3\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Login button text",defaultJa:"\u30ed\u30b0\u30a4\u30f3",defaultEn:"Login",depends:"require_login_for_restock",showWithPreview:!0},{type:"text",slug:"login_required_modal_cancel_button_text",nameJa:"\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Cancel button text",defaultJa:"\u30ad\u30e3\u30f3\u30bb\u30eb",defaultEn:"Cancel",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_background_color",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u80cc\u666f\u8272",nameEn:"Login required popup background color",default:"#ffffff",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_text_color",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u6587\u5b57\u8272",nameEn:"Login required popup text color",default:"#111111",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_overlay_color",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u80cc\u666f\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u8272",nameEn:"Login required popup overlay color",default:"#000000",depends:"require_login_for_restock",showWithPreview:!0},{type:"range",slug:"login_required_modal_overlay_opacity",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u80cc\u666f\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u6fc3\u5ea6",nameEn:"Login required popup overlay opacity",default:55,min:0,max:90,step:5,depends:"require_login_for_restock",showWithPreview:!0},{type:"range",slug:"login_required_modal_radius",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u89d2\u4e38",nameEn:"Login required popup border radius",default:2,min:0,max:24,step:1,depends:"require_login_for_restock",showWithPreview:!0},{type:"range",slug:"login_required_modal_width",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u5e45",nameEn:"Login required popup width",default:576,min:320,max:720,step:8,depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_login_button_background_color",nameJa:"\u30ed\u30b0\u30a4\u30f3\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"Login button background color",default:"#000000",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_login_button_text_color",nameJa:"\u30ed\u30b0\u30a4\u30f3\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272",nameEn:"Login button text color",default:"#ffffff",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_cancel_button_background_color",nameJa:"\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"Cancel button background color",default:"#ffffff",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_cancel_button_text_color",nameJa:"\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u8272",nameEn:"Cancel button text color",default:"#111111",depends:"require_login_for_restock",showWithPreview:!0},{type:"colorpicker",slug:"login_required_modal_cancel_button_border_color",nameJa:"\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u306e\u67a0\u7dda\u8272",nameEn:"Cancel button border color",default:"#111111",depends:"require_login_for_restock",showWithPreview:!0},{type:"range",slug:"login_required_modal_button_radius",nameJa:"\u30ed\u30b0\u30a4\u30f3\u5fc5\u9808\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30dc\u30bf\u30f3\u89d2\u4e38",nameEn:"Login required popup button border radius",default:32,min:0,max:40,step:1,depends:"require_login_for_restock",showWithPreview:!0},{type:"card",slug:"allowFavorite",nameJa:"\u9867\u5ba2\u304c\u304a\u6c17\u306b\u5165\u308a\u3057\u305f\u5546\u54c1\u3082\u518d\u5165\u8377\u901a\u77e5\u3057\u307e\u3059\u304b\uff1f",nameEn:"Do you want to notify customers of restocked items that they have favorited?",default:"no",selectOptionsJa:[{value:"no",label:"\u304a\u6c17\u306b\u5165\u308a\u5546\u54c1\u306e\u518d\u5165\u8377\u901a\u77e5\u306f\u3057\u306a\u3044"},{value:"yes",label:"\u304a\u6c17\u306b\u5165\u308a\u5546\u54c1\u3082\u518d\u5165\u8377\u901a\u77e5\u3059\u308b"}],selectOptionsEn:[{value:"no",label:"Do not notify for favorited items"},{value:"yes",label:"Also notify for favorited items"}]},{type:"card",slug:"limitPolicy",nameJa:"\u9001\u4fe1\u5236\u9650\u65b9\u6cd5",nameEn:"Limit policy",default:"nolimit",descriptionJa:"\u518d\u5165\u8377\u901a\u77e5\u306e\u9001\u4fe1\u6570\u3001\u9001\u4fe1\u9593\u9694\u3092\u5236\u9650\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002",descriptionEn:"You can limit the number of restock notifications and the interval between them.",selectOptionsJa:[{value:"strict",label:"\u9001\u4fe1\u6570\u3092\u5236\u9650\u3059\u308b",description:"\u518d\u5165\u8377\u901a\u77e5\u306e\u9001\u4fe1\u6570\u3092\u6307\u5b9a\u306e\u6570\u91cf\uff08\u56fa\u5b9a\u5024\u304b\u5728\u5eab\u6570\u306b\u5bfe\u3059\u308b\u5272\u5408\u3092\u9078\u629e\u53ef\uff09\u3067\u5236\u9650\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002"},{value:"interval",label:"\u9001\u4fe1\u6570\u3001\u9001\u4fe1\u9593\u9694\u3092\u5236\u9650\u3059\u308b",description:"\u6307\u5b9a\u6570\u91cf(1\u9001\u4fe1\u6bce\u306e\u9001\u4ed8\u6570)\u3092\u6307\u5b9a\u9593\u9694\uff08\u65e5\u3001\u6642\u9593\u5358\u4f4d\uff09\u3067\u9001\u4fe1\u3057\u7d9a\u3051\u307e\u3059\u3002\u5728\u5eab\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u5728\u5eab\u6570\u3092\u3057\u305f\u307e\u308f\u308b\u304b\u3001\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u8005\u5168\u54e1\u306b\u9001\u4fe1\u3057\u7d42\u308f\u308b\u3068\u51e6\u7406\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002"},{value:"nolimit",label:"\u5236\u9650\u3057\u306a\u3044",description:"\u6570\u91cf\u3001\u9593\u9694\u3092\u6307\u5b9a\u305b\u305a\u3001\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u8005\u5168\u54e1\u306b\u9001\u4fe1\u3057\u307e\u3059\u30021\u5ea6\u306b\u9001\u4fe1\u3067\u304d\u308b\u91cf\u306f5000\u4ef6\u7a0b\u5ea6\u3067\u305d\u308c\u3092\u8d85\u3048\u308b\u767b\u9332\u6570\u306e\u5834\u5408\u8907\u6570\u56de\u306b\u5206\u3051\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002"}],selectOptionsEn:[{value:"strict",label:"Limit the number of notifications",description:"You can limit the number of restock notifications by a specified quantity (either a fixed value or a percentage of stock)."},{value:"interval",label:"Limit the number and interval of notifications",description:"Continue sending at a specified quantity (per send) at specified intervals (days or hours). The process ends when the stock falls below the set amount or all registrants have been notified."},{value:"nolimit",label:"No limit",description:"Send to all registrants without specifying quantity or interval. If the number exceeds about 5000, it will be sent in multiple batches."}]},{type:"card",slug:"limitBasis",nameJa:"\u9001\u4fe1\u6570\u8a08\u7b97\u65b9\u6cd5",nameEn:"Limit calculation method",default:"static",selectOptionsJa:[{value:"static",label:"\u56fa\u5b9a\u5024"},{value:"stock_amount",label:"\u5728\u5eab\u6570\xd7\u25cb\u25cb\uff05\u4ef6\u9001\u4fe1\u3059\u308b\uff081\u56de\u306e\u9001\u4fe1\u6570\uff09\u3000"}],selectOptionsEn:[{value:"static",label:"Fixed value"},{value:"stock_amount",label:"Send as a percentage of stock per batch"}],checkVisible:e=>"nolimit"!==e.limitPolicy},{type:"number",slug:"limitAmount",nameJa:"1\u56de\u306e\u9001\u4fe1\u6570 \u307e\u305f\u306f \u5728\u5eab\u6570\u306b\u304b\u3051\u308b\u30d1\u30fc\u30bb\u30f3\u30c8",nameEn:"Limit amount or percentage of stock",default:100,min:0,max:1e3,step:1,checkVisible:e=>"nolimit"!==e.limitPolicy&&"nolimit"!==e.limitBasis,customize:(e,t)=>Object.assign(Object.assign({},t),{nameJa:"stock_amount"===e.limitBasis?"\u5728\u5eab\u6570\xd7\u30d1\u30fc\u30bb\u30f3\u30c8\u4ef6\u9001\u308b":"1\u56de\u306e\u9001\u4fe1\u6570",nameEn:"stock_amount"===e.limitBasis?"Percentage of stock":"Limit amount"})},{type:"interval",slug:"interval",nameJa:"\u9001\u4fe1\u9593\u9694",nameEn:"Sending interval",default:{count:1,term:"day"},checkVisible:e=>"strict"!==e.limitPolicy&&"nolimit"!==e.limitPolicy},{type:"card",slug:"sendingOrder",nameJa:"\u9001\u4fe1\u9806\u5e8f",nameEn:"Sending order",default:"requested",selectOptionsJa:[{value:"requested",label:"\u30ea\u30af\u30a8\u30b9\u30c8\u9806(\u53e4\u3044\u9806)",description:"\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u3092\u3057\u305f\u9806\uff08\u767b\u9332\u3057\u305f\u65e5\u6642\u304c\u53e4\u3044\u9806\uff09\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002"},{value:"requestedDesc",label:"\u30ea\u30af\u30a8\u30b9\u30c8\u9006\u9806(\u65b0\u3057\u3044\u9806)",description:"\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u3092\u3057\u305f\u9006\u9806\uff08\u767b\u9332\u3057\u305f\u65e5\u6642\u304c\u65b0\u3057\u3044\u9806\uff09\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002"}],selectOptionsEn:[{value:"requested",label:"Order of request (oldest first)",description:"Send in the order of registration (oldest registration date first)."},{value:"requestedDesc",label:"Reverse order of request (newest first)",description:"Send in the reverse order of registration (newest registration date first)."}]},{type:"card",slug:"sendingOrderPreferType",nameJa:"\u30ea\u30d4\u30fc\u30bf\u30fc\u306e\u9001\u4fe1\u9806\u5e8f",nameEn:"Sending order of repeaters",default:"none",selectOptionsJa:[{value:"repeater",label:"\u30ea\u30d4\u30fc\u30bf\u30fc\u3092\u512a\u5148",description:"\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u3092\u3057\u305f\u9867\u5ba2\u306e\u4e2d\u3067\u30ea\u30d4\u30fc\u30bf\u30fc\uff08\u904e\u53bb\u8cfc\u5165\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u9867\u5ba2\uff09\u304b\u3089\u512a\u5148\u3057\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002\u30ea\u30d4\u30fc\u30bf\u30fc\u5185\u3001\u672a\u8cfc\u5165\u8005\u5185\u3067\u306e\u9001\u4fe1\u9806\u756a\u306f\u3001\u9001\u4fe1\u9806\u5e8f\u306e\u8a2d\u5b9a\u306b\u57fa\u3065\u3044\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002"},{value:"nonbuyer",label:"\u672a\u8cfc\u5165\u8005\u3092\u512a\u5148",description:"\u518d\u5165\u8377\u901a\u77e5\u767b\u9332\u3092\u3057\u305f\u9867\u5ba2\u306e\u4e2d\u3067\u672a\u8cfc\u5165\u8005\u5185\u304b\u3089\u512a\u5148\u3057\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002\u672a\u8cfc\u5165\u8005\u5185\u3001\u30ea\u30d4\u30fc\u30bf\u30fc\u5185\uff08\u904e\u53bb\u8cfc\u5165\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u9867\u5ba2\uff09\u3067\u306e\u9001\u4fe1\u9806\u756a\u306f\u3001\u9001\u4fe1\u9806\u5e8f\u306e\u8a2d\u5b9a\u306b\u57fa\u3065\u3044\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002"},{value:"none",label:"\u30ea\u30d4\u30fc\u30bf\u30fc\u30fb\u672a\u8cfc\u5165\u8005\u3069\u3061\u3089\u3082\u512a\u5148\u3057\u306a\u3044",description:"\u30ea\u30d4\u30fc\u30bf\u30fc\u306b\u57fa\u3065\u304f\u9001\u4fe1\u9806\u756a\u8a2d\u5b9a\u3092\u7121\u52b9\u306b\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u30ea\u30d4\u30fc\u30bf\u30fc\u3001\u672a\u8cfc\u5165\u8005\u554f\u308f\u305a\u9001\u4ed8\u9806\u5e8f\u306e\u8a2d\u5b9a\u306b\u57fa\u3065\u3044\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002"}],selectOptionsEn:[{value:"repeater",label:"Prioritize repeaters",description:"Prioritize customers who have purchased before. Within repeaters and non-buyers, the sending order is based on the sending order setting."},{value:"nonbuyer",label:"Prioritize non-buyers",description:"Prioritize non-buyers among registrants. Within non-buyers and repeaters, the sending order is based on the sending order setting."},{value:"none",label:"Do not prioritize either",description:"Disable sending order based on repeaters. In this case, the sending order setting applies regardless of repeater status."}]},{type:"card",slug:"resendPolicy",nameJa:"\u518d\u9001\u4fe1\u30dd\u30ea\u30b7\u30fc(\u518d\u5165\u8377\u901a\u77e5\u53ca\u3073\u304a\u6c17\u306b\u5165\u308a)",nameEn:"Resend policy",default:"none",selectOptionsJa:[{value:"none",label:"\u518d\u9001\u4fe1\u3057\u306a\u3044(1\u5ea6\u3057\u304b\u9001\u3089\u306a\u3044)",description:"\u4e00\u5ea6\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u3063\u3066\u3044\u308b\u9867\u5ba2\u306e\u5834\u5408\u3001\u518d\u5ea6\u540c\u3058\u5546\u54c1\u3001\u540c\u3058\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u5165\u8377\u3057\u305f\u969b\u306f\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u305b\u3093\u3002"},{value:"always",label:"\u5e38\u306b\u518d\u9001\u4fe1\u3059\u308b",description:"\u4e00\u5ea6\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u3063\u305f\u9867\u5ba2\u3067\u3082\u3001\u518d\u5ea6\u540c\u3058\u5546\u54c1\u3001\u540c\u3058\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u5165\u8377\u3057\u305f\u5834\u5408\u306b\u4f55\u5ea6\u3067\u3082\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u52d5\u4f5c\u78ba\u8a8d\u7b49\u691c\u8a3c\u306e\u969b\u306b\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002"},{value:"interval",label:"\u6307\u5b9a\u306e\u9593\u9694\u3067\u518d\u9001\u4fe1\u3059\u308b",description:"\u4e00\u5ea6\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u3063\u305f\u9867\u5ba2\u3067\u3082\u8a2d\u5b9a\u3057\u305f\u65e5\u6570\u3001\u6642\u9593\u4ee5\u4e0a\u7d4c\u904e\u3057\u3066\u3044\u308c\u3070\u3001\u901a\u5e38\u901a\u308a\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u524d\u56de\u306e\u901a\u77e5\u304b\u3089\u306e\u7d4c\u904e\u6642\u9593\u304c\u8a2d\u5b9a\u3057\u305f\u65e5\u6570\u3001\u6642\u9593\u672a\u6e80\u306e\u5834\u5408\u306f\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u305b\u3093\u3002\u9593\u9694\u306f\u6642\u9593\u5358\u4f4d\u304b\u65e5\u6570\u5358\u4f4d\u3067\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002"},{value:"24hours",label:"24\u6642\u9593\u6bce\u306b\u518d\u9001\u4fe1\u3059\u308b",description:"\u4e00\u5ea6\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u3063\u305f\u9867\u5ba2\u3067\u3082\u3001\u524d\u56de\u306e\u901a\u77e5\u304b\u308924\u6642\u9593\u4ee5\u4e0a\u7d4c\u904e\u3057\u3066\u3044\u308c\u3070\u3001\u901a\u5e38\u901a\u308a\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u524d\u56de\u306e\u901a\u77e5\u304b\u3089\u306e\u7d4c\u904e\u6642\u9593\u304c24\u6642\u9593\u672a\u6e80\u306e\u5834\u5408\u306f\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3057\u307e\u305b\u3093\u3002"}],selectOptionsEn:[{value:"none",label:"Do not resend (only once)",description:"If a customer has already received a restock notification, no further notifications will be sent for the same product/variant."},{value:"always",label:"Always resend",description:"Even if a customer has already received a notification, notifications will be sent every time the same product/variant is restocked. Useful for testing."},{value:"interval",label:"Resend at specified intervals",description:"If the set number of days/hours has passed since the last notification, a new notification will be sent. Otherwise, no notification will be sent. The interval can be specified in hours or days."},{value:"24hours",label:"Resend every 24 hours",description:"If 24 hours have passed since the last notification, a new notification will be sent. Otherwise, no notification will be sent."}]},{type:"interval",slug:"resendPolicyInterval",nameJa:"\u518d\u9001\u4fe1\u9593\u9694",nameEn:"Resend interval",default:{count:1,term:"day"},checkVisible:e=>"interval"===e.resendPolicy},{type:"number",slug:"restockMinimumStock",nameJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u5728\u5eab\u6570",nameEn:"Minimum stock for restock notification",descriptionJa:"\u518d\u5165\u8377\u901a\u77e5\u51e6\u7406\u304c\u52d5\u4f5c\u3059\u308b\u305f\u3081\u306e\u6700\u4f4e\u5728\u5eab\u6570\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u30705\u3067\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u5728\u5eab\u6570\u304c5\u672a\u6e80\u306e\u72b6\u614b\u304b\u3089\u30015\u4ee5\u4e0a\u306b\u5897\u3048\u305f\u5834\u5408\u306b\u518d\u5165\u8377\u901a\u77e5\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002",descriptionEn:"Set the minimum stock required for the restock notification process to operate. For example, if you set it to 5, the restock notification process will be executed when the stock quantity increases from less than 5 to 5 or more.",default:1,min:1,max:1e3,step:1},{type:"card",slug:"favoriteVariantPolicy",nameJa:"\u304a\u6c17\u306b\u5165\u308a\u304b\u3089\u306e\u518d\u5165\u8377\u901a\u77e5\u306e\u91cd\u8907\u9001\u4fe1\u8a2d\u5b9a",nameEn:"Variation rule for restock notification from favorites",default:"always",selectOptionsJa:[{value:"always",label:"\u5e38\u306b\u9001\u4fe1\u3059\u308b",description:"\u9867\u5ba2\u304c\u3068\u3042\u308b\u5546\u54c1\u3092\u304a\u6c17\u306b\u5165\u308a\u767b\u9332\u3067\u3001\u3059\u3067\u306b\u5225\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u304c\u518d\u5165\u8377\u901a\u77e5\u9001\u4ed8\u3055\u308c\u3066\u3044\u305f\u5834\u5408\u3067\u3082\u3001\u518d\u5165\u8377\u901a\u77e5\u9023\u7d61\u3092\u9001\u308a\u307e\u3059\u3002\uff08\u4f8b\uff1aS\u306eT\u30b7\u30e3\u30c4\u304c\u5165\u5eab\u3057\u305f\u3000\u7fcc\u65e5M\u306eT\u30b7\u30e3\u30c4\u304c\u5165\u5eab\u3057\u305f\u30b1\u30fc\u30b9\uff09"},{value:"none",label:"\u9001\u4fe1\u3057\u306a\u3044",description:"\u9867\u5ba2\u304c\u3068\u3042\u308b\u5546\u54c1\u3092\u304a\u6c17\u306b\u5165\u308a\u767b\u9332\u3092\u3057\u3066\u3001\u4e00\u5ea6\u3067\u3082\u3044\u305a\u308c\u304b\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3067\u518d\u5165\u8377\u901a\u77e5\u304c\u9001\u3089\u308c\u305f\u5834\u5408\u3001\u518d\u5165\u8377\u901a\u77e5\u306f\u4ee5\u5f8c\u9001\u3089\u308c\u307e\u305b\u3093\u3002"}],selectOptionsEn:[{value:"always",label:"Always send",description:"Even if a customer has already received a restock notification for another variation, a notification will be sent again. (e.g., S size T-shirt restocked, then M size restocked the next day)"},{value:"none",label:"Do not send",description:"If a customer has already received a restock notification for any variation, no further notifications will be sent."}]}]}},805(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(250),s=n(575),a=n(259),c=n(669),l=n(754),d=n(785),u=n(900),h=n(556),m=n(895),g=i(n(745)),p=n(13);n(729);class f{constructor(e){this.statusWidget=void 0,this.isTokenRefreshed=!1,this.isTokenFetching=!1,this.favoriteMode="product",this.favoriteKey="products",this.checkConnectExecuted=!1,this.widgetTemplates={},this.widgetTemplateLoaded=!1,this.pendingRestockIntentProcessing=!1,this.pendingRestockRetryAttempts=0,this.restockStatusCache=new Map,this.restockStatusRequests=new Map,this.optimisticRestockRegistered=new Map,this.restockStateWatcherStarted=!1,this.lastRestockStateHref="",this.restockButtonVariantByKey=new Map,window.storecrm_data=window.storecrm_data||{},console.log("StoreCRM initialized version 0.7.97",e),this.config=this.applyLocaleOverrides(e),this.currentLocale=this.detectLocale(),this.applyDefaults(),this.popupManager=l.RestockPopupManager.getInstance(this.config.restockPopup),this.popupManager.setParent(this),this.lineRestockPopupManager=u.LineRestockPopupManager.getInstance(this.config.lineRestockPopup),this.lineRestockPopupManager.setParent(this)}init(){(()=>{o(this,void 0,void 0,function*(){try{yield this.bootstrapTemplates(),yield this.checkCustomer(),yield this.syncWishlist()}catch(e){console.error("StoreCRM: init: error",e)}yield this.render(),yield this.handlePendingRestockIntent(),window.location.pathname.includes("/apps/")&&(yield this.renderFavoriteList())})})(),window.addEventListener("pageshow",e=>{e.persisted&&(this.render(!0),this.handlePendingRestockIntent().catch(e=>{console.warn("StoreCRM: pending restock check after pageshow failed",e)}))}),document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&(this.render(!0),this.handlePendingRestockIntent().catch(e=>{console.warn("StoreCRM: pending restock check after visibilitychange failed",e)}))}),this.initLineLogin(),this.initRestockStateWatcher(),this.initDynamicRenderObserver()}initLineLogin(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.executeLineLoginInit()}):this.executeLineLoginInit()}executeLineLoginInit(){if(g.default.isLoginOrRegisterPage()){new g.default(this).init()}}getCurrentShopifyCustomerId(){try{return window.storecrm_data.customer_id||window.ShopifyAnalytics.meta.page.customerId}catch(e){return null}}checkCustomer(){return o(this,void 0,void 0,function*(){if(window.storecrm_data.is_customer_checked)return;window.storecrm_data.is_customer_checked=!0;const e=(window.localStorage.getItem("storecrm_customer_id")||"").toString(),t=(this.getCurrentShopifyCustomerId()||"").toString();if(e!==t){if(t)return!e||e.startsWith("TEMP_")&&t?(yield this.refreshToken(!1),void(yield this.syncWishlist(null,e,!0))):void(e===t||(yield this.refreshToken(!0)));(null==e?void 0:e.startsWith("TEMP_"))||(yield this.refreshToken(!0))}})}refreshToken(){return o(this,arguments,void 0,function*(e=!1){return e&&(window.localStorage.removeItem("storecrm_customer_id"),window.localStorage.removeItem("storecrm_wishlist")),yield this.fetchToken()})}detectLocale(){var e,t;return([window.Shopify&&(window.Shopify.locale||(null===(t=null===(e=window.Shopify.localization)||void 0===e?void 0:e.language)||void 0===t?void 0:t.isoCode)),document.documentElement.getAttribute("lang"),navigator.language].find(e=>"string"==typeof e&&e.length>0)||"en").replace("_","-")}normalizeLocaleValue(e){if("string"==typeof e)return e.replace("_","-").toLowerCase()}findLocaleFromConfig(e){var t;const n=this.normalizeLocaleValue(null===(t=window.Shopify)||void 0===t?void 0:t.locale);if(!e||!n)return;const o=Object.entries(e).map(([e,t])=>({normalizedKey:this.normalizeLocaleValue(e),value:t})).filter(e=>e.normalizedKey),i=o.find(e=>e.normalizedKey===n);if(i)return i.value;const r=n.split("-")[0],s=o.find(e=>e.normalizedKey&&e.normalizedKey.split("-")[0]===r);if(s)return s.value;const a=o.find(e=>e.normalizedKey&&e.normalizedKey.startsWith(r));return a?a.value:void 0}isPlainObject(e){return"[object Object]"===Object.prototype.toString.call(e)}deepMergeConfig(e,t){if(!this.isPlainObject(t)&&!Array.isArray(t))return t;if(Array.isArray(t))return t.slice();const n=this.isPlainObject(e)?Object.assign({},e):{};return Object.keys(t||{}).forEach(e=>{const o=n[e],i=t[e];e.indexOf(["favoriteMode"])>=0||(this.isPlainObject(o)&&this.isPlainObject(i)?n[e]=this.deepMergeConfig(o,i):this.isPlainObject(i)?n[e]=this.deepMergeConfig({},i):Array.isArray(i)?n[e]=i.slice():n[e]=i)}),n}applyLocaleOverrides(e){const t=e.locales,n=Object.assign({},e),o=this.findLocaleFromConfig(t);if(!o)return n;const i=this.deepMergeConfig(n,o);return t&&(i.locales=t),i}getSchemaDefault(e){const t=(this.currentLocale||"en").toLowerCase();if(null==e)return;const n=e=>null!=e;return void 0!==e.default&&null!==e.default&&"text"!==e.type?e.default:t.startsWith("ja")&&n(e.defaultJa)?e.defaultJa:t.startsWith("en")&&n(e.defaultEn)?e.defaultEn:n(e.default)?e.default:n(e.defaultEn)?e.defaultEn:n(e.defaultJa)?e.defaultJa:""}mergeWidgetConfig(e,t,n){const o=Object.assign({},t||{});return(e&&e.rows||[]).forEach(e=>{const t=e.slug;if(t){if(n&&Object.prototype.hasOwnProperty.call(n,t)){const i=n[t];if(!Object.prototype.hasOwnProperty.call(o,t))return void(o[t]=i);const r=o[t],s=this.getSchemaDefault(e);return void(null!=r&&""!==r&&r!==s||(o[t]=i))}Object.prototype.hasOwnProperty.call(o,t)||(o[t]=this.getSchemaDefault(e))}}),o}applyDefaults(e){const t=e||this.widgetTemplates||{};this.config.favorite=this.mergeWidgetConfig(r.schema,this.config.favorite,t.favorite),this.config.favoriteList=this.mergeWidgetConfig(s.schema,this.config.favoriteList,t["favorite-list"]),this.config.restock=this.mergeWidgetConfig(a.schema,this.config.restock,t.restock),this.config.lineRestock=this.mergeWidgetConfig((()=>{try{return n(669).schema||{rows:[]}}catch(e){return{rows:[]}}})(),this.config.lineRestock,t["line-restock"]),this.config.restockPopup=this.mergeWidgetConfig(l.schema,this.config.restockPopup,t["restock-popup"]),this.config.restockOption=this.mergeWidgetConfig(d.schema,this.config.restockOption,void 0),this.config.lineRestockPopup=this.mergeWidgetConfig(u.schema,this.config.lineRestockPopup,t["line-restock-popup"]),this.favoriteMode=this.config.favorite.favoriteMode||"product",this.favoriteKey="product"===this.favoriteMode?"products":"variants",console.log("StoreCRM: Current favorite mode: ",this.favoriteMode)}bootstrapTemplates(){return o(this,void 0,void 0,function*(){if(this.widgetTemplateLoaded)return;const e=encodeURIComponent(this.currentLocale||"en"),t=Object.entries({favorite:"favorite",restock:"restock","restock-popup":"restock-popup","line-restock":"line-restock","line-restock-popup":"line-restock-popup"}),n=yield Promise.all(t.map(t=>o(this,[t],void 0,function*([t,n]){try{const o=yield fetch(`${this.config.backendUrl}/widget/templates/${n}?locale=${e}`,{credentials:"same-origin"});if(!o.ok)return[t,void 0];return[t,(yield o.json()).template||{}]}catch(e){return console.warn("StoreCRM: Failed to load widget template",n,e),[t,void 0]}}))),i={};n.forEach(([e,t])=>{t&&(i[e]=t)}),this.widgetTemplates=i,this.applyDefaults(i),this.popupManager.config=this.config.restockPopup,this.lineRestockPopupManager.config=this.config.lineRestockPopup,this.widgetTemplateLoaded=!0})}render(e=!1){this.doRender(e),e||(window.setTimeout(this.doRender.bind(this),500),window.setTimeout(this.doRender.bind(this),2e3),window.setTimeout(this.doRender.bind(this),5e3))}initDynamicRenderObserver(){if(this.dynamicRenderObserver||"undefined"==typeof MutationObserver)return;const e=document.body||document.documentElement;e?(this.dynamicRenderObserver=new MutationObserver(e=>{e.some(e=>Array.from(e.addedNodes).some(e=>this.isStorecrmRenderableNode(e)))&&this.scheduleDynamicRender()}),this.dynamicRenderObserver.observe(e,{childList:!0,subtree:!0})):document.addEventListener("DOMContentLoaded",()=>this.initDynamicRenderObserver(),{once:!0})}isStorecrmRenderableNode(e){if(!(e instanceof Element))return!1;const t=".storecrm-button[data-type], .storecrm-favorite, .storecrm_favoritelist";return e.matches(t)||Boolean(e.querySelector(t))}scheduleDynamicRender(e=50){void 0===this.dynamicRenderTimer&&(this.dynamicRenderTimer=window.setTimeout(()=>{this.dynamicRenderTimer=void 0,this.render(!0),this.handlePendingRestockIntent().catch(e=>{console.warn("StoreCRM: pending restock check after dynamic render failed",e)})},e))}doRender(e=!1){window.location.pathname.includes("/apps")&&window.location.pathname.endsWith("/connect")&&this.checkConnect();const t=JSON.parse(window.localStorage.getItem("storecrm_wishlist")||"{}");t.products||(t.products=[]),t.variants||(t.variants=[]),document.querySelectorAll(".storecrm-button").forEach(e=>{if(e instanceof HTMLElement==!1)return;const n=e.id||"storecrm-button-"+Math.random().toString(36).slice(-8);e.id||(e.id=n);const o=new URL(location.href),i=o.searchParams.get("variant")&&o.searchParams.get("variant"),s=e.dataset.productId,l=i||e.dataset.variantId,d=void 0!==e.dataset.variantSelector,u=JSON.parse(e.dataset.variants||"[]"),h={tags:JSON.parse(e.dataset.productTags||"[]"),id:e.dataset.productId};if(!h||!s||!l)return;const m=t&&("product"===this.favoriteMode?t.products&&t.products.includes(s):t.variants&&t.variants.includes(l)),g=!!e.dataset.currentVariantAvailable,p="wishlist-button"===e.dataset.type?(0,r.render)({productId:s,variantId:l,id:n,button:e,variants:u,product:h,buttonSettings:this.config.favorite,isFavorited:m,hasVariantSelector:d}):"line-restock-button"===e.dataset.type?(0,c.render)({productId:s,variantId:l,id:n,buttonSettings:this.config.lineRestock||(0,c.generateDefaultSettings)(),isOutOfStock:g,product:h,variants:u}):(0,a.render)({productId:s,variantId:l,id:n,buttonSettings:this.config.restock,isOutOfStock:g,product:h,variants:u});p&&(e.innerHTML=p)}),this.refreshAllRestockButtonStates(),document.querySelectorAll(".storecrm-favorite").forEach(n=>{if(n instanceof HTMLElement==!1)return;if(!e&&"true"===n.dataset.isRendered)return;n.dataset.isRendered="true";const o=n.dataset.productId||"",i=n.dataset.variantId||"";if(!o)return;const s=void 0!==n.dataset.variantSelector,a=n.id||"storecrm-favorite-"+Math.random().toString(36).slice(-8);n.id||(n.id=a);const c=JSON.parse(n.dataset.variants||"[]"),l={tags:JSON.parse(n.dataset.productTags||"[]"),id:n.dataset.productId},d=t&&t.products&&t.products.includes(o);n.innerHTML=(0,r.render)({productId:o,variantId:i,button:n,id:a,buttonSettings:this.config.favorite,isFavorited:d,hasVariantSelector:s,variants:c,product:l})||""}),this.shouldRenderStatusWidget(window.location.pathname)&&this.renderStatusWidget(),this.checkToken()}checkToken(){this.isTokenRefreshed||this.isTokenRefreshNeeded()&&this.fetchToken()}isTokenRefreshNeeded(){const e=window.localStorage.getItem("storecrm_customer_id"),t=parseInt(window.localStorage.getItem("storecrm_customer_id")||"0",10),n=window.localStorage.getItem("storecrm_token");let o=null;try{o=n?n.split("|")[1]:null}catch(e){}return this.isTokenRefreshed?(console.log("StoreCRM: Token refresh needed: false (already refreshed)"),!1):e&&n&&o?window.ShopifyAnalytics&&window.ShopifyAnalytics.meta&&window.ShopifyAnalytics.meta.page&&window.ShopifyAnalytics.meta.page.customerId&&window.ShopifyAnalytics.meta.page.customerId!==t?(console.log("StoreCRM: Token refresh needed: true (customerId mismatch)"),!0):window.ShopifyAnalytics&&window.ShopifyAnalytics.meta&&window.ShopifyAnalytics.meta.page&&window.ShopifyAnalytics.meta.page.customerId?1e3*parseFloat(o)<(new Date).getTime()&&(console.log("StoreCRM: Token refresh needed: true (expired)"),!0):(console.log("StoreCRM: Token refresh needed: true (no customerId)"),!0):(console.log("StoreCRM: Token refresh needed: true (no token)"),!0)}shouldRenderStatusWidget(e){try{const t=this.normalizePathname(e);if(!t)return!1;const n=this.getAccountPathIndex(t);if(-1===n)return!1;const o=(t.split("/")[n+1]||"").toLowerCase();return!this.getExcludedAccountPages().has(o)}catch(t){return console.warn("StoreCRM: Invalid pathname for widget rendering:",e,t),!1}}getExcludedAccountPages(){return new Set(this.config.excludedAccountPages||f.DEFAULT_EXCLUDED_ACCOUNT_PAGES)}getAccountPathIndex(e){const t=this.normalizePathname(e);if(!t)return-1;const n=t.split("/"),o=(n[0]||"").toLowerCase();if("account"===o)return 0;const i=(n[1]||"").toLowerCase();return n.length>=2&&f.LOCALE_PATTERN.test(o)&&"account"===i?1:-1}normalizePathname(e){if("string"!=typeof e)throw new TypeError("Expected pathname to be a string, but received "+typeof e);return e.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")||null}fetchToken(){return o(this,void 0,void 0,function*(){if(this.isTokenFetching)return yield new Promise(e=>{const t=setInterval(()=>{this.isTokenFetching||(clearInterval(t),e(null))},100)}),window.localStorage.getItem("storecrm_token");this.isTokenFetching=!0;const e=window.localStorage.getItem("storecrm_customer_id"),t=yield fetch(`/apps/${this.config.appProxyName}/token?current_customer_id=${e}`),n=(yield t.text()).match(/\[data\]([\s\S]*?)\[\/data\]/);if(!n)throw this.isTokenRefreshed=!0,new Error("No data from API");const o=JSON.parse(n[1]);if(!o||!o.customer)throw this.isTokenRefreshed=!0,new Error("No data from API2");return window.localStorage.setItem("storecrm_token",o.customer.token),window.localStorage.setItem("storecrm_customer_id",o.customer.id),this.isTokenRefreshed=!0,(null==e?void 0:e.startsWith("TEMP_"))&&o.customer.id!==e&&(yield this.syncWishlist(null,e)),this.isTokenFetching=!1,o.customer.token})}getToken(){return o(this,void 0,void 0,function*(){return this.isTokenFetching&&(yield this.fetchToken()),window.localStorage.getItem("storecrm_token")})}getCustomerId(){return o(this,void 0,void 0,function*(){return this.isTokenFetching&&(yield this.fetchToken()),window.localStorage.getItem("storecrm_customer_id")})}request(){return o(this,arguments,void 0,function*(e="GET",t,n=null,o=!1){const i=yield this.getCustomerId(),r=yield this.getToken(),s=window.location.href;t.includes("?")?t+=`&customer_id=${i}&host=${window.location.host}&referrer=${encodeURIComponent(s)}`:t+=`?customer_id=${i}&host=${window.location.host}&referrer=${encodeURIComponent(s)}`;const a=yield fetch(t,{method:e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:n?JSON.stringify(n):null,credentials:o?"include":"same-origin"});if(!a.ok)throw new Error("API request failed");return a.json()})}toggleWishlist(e,t=!1,n=!1,o=""){n?this.fetchToken().then(()=>{var n=window.localStorage.getItem("storecrm_customer_id");n&&!/^TEMP_/.test(n)?this.doToggleWishlist(e,!t).then(()=>{}).catch(e=>{console.error(e),alert("\u30b5\u30fc\u30d0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff01 error: "+e.message+" \u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002")}):window.location.href=o&&""!==o&&"undefined"!==o&&void 0!==o?o:"/account/login"}):this.doToggleWishlist(e,!t).then(()=>{}).catch(e=>{console.error(e),alert("\u30b5\u30fc\u30d0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff01 error: "+e.message+" \u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002")})}syncWishlist(){return o(this,arguments,void 0,function*(e=null,t=void 0,n=!1){if(!n){const e=JSON.parse(window.localStorage.getItem("storecrm_wishlist")||"{}"),t=6e4;if(e.lastUpdated&&Date.now()-e.lastUpdated{console.error("StoreCRM Restock: click flow failed",e),this.popupManager.show(this.config.restockPopup,n.variants,n.productId)}):console.error("StoreCRM Restock: restockButton not found")}isRestockLoginRequired(){var e;return this.toBoolean(null===(e=this.config.restockOption)||void 0===e?void 0:e.require_login_for_restock)}shouldAutoRegisterRestockAfterLogin(){var e;return this.toBoolean(null===(e=this.config.restockOption)||void 0===e?void 0:e.auto_register_after_login)}shouldOneClickRestockWhenLoggedIn(){var e;return this.toBoolean(null===(e=this.config.restockOption)||void 0===e?void 0:e.one_click_when_logged_in)}shouldShowRestockRegisteredState(){var e;return this.toBoolean(null===(e=this.config.restockOption)||void 0===e?void 0:e.show_registered_status_when_logged_in)}getRestockRegistrationMode(e=[],t=""){return t||Array.isArray(e)&&e.length>1?"variant":this.favoriteMode}toBoolean(e){return!0===e||"true"===e||1===e||"1"===e}handleRestockButtonClick(e,t){return o(this,void 0,void 0,function*(){var n;const o=yield this.isLoggedInCustomer(),i=this.getCurrentRestockVariantId(t.variants),r=this.getRestockRegistrationMode(t.variants,i);if(o){if(this.shouldShowRestockRegisteredState()){const o=yield this.getRestockStatus(t.productId,i,r,!0);if(null===(n=null==o?void 0:o.email)||void 0===n?void 0:n.registered)return void this.applyRestockButtonRegisteredState("email",e,!0)}if(this.shouldOneClickRestockWhenLoggedIn())return void(yield this.registerEmailRestockOneClick(e,t,i))}if(this.isRestockLoginRequired()&&!o){const n=this.buildPendingRestockIntent(e,t);return void this.showRestockLoginRequiredModal(n)}this.popupManager.show(this.config.restockPopup,t.variants,t.productId)})}registerEmailRestockOneClick(e,t,n){return o(this,void 0,void 0,function*(){var o;const i=null===(o=window.storecrm_data)||void 0===o?void 0:o.customer_email;if(!i||!this.checkEmailFormat(i))return this.popupManager.show(this.config.restockPopup,t.variants,t.productId),void this.popupManager.failure("\u30ed\u30b0\u30a4\u30f3\u4e2d\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002");try{const o=this.getRestockRegistrationMode(t.variants,n);yield this.doStoreRestock(n,t.productId,i,!1,!1,!1,o),this.shouldShowRestockRegisteredState()?(this.markRestockStatusCacheRegistered("email",t.productId,n,o),this.applyRestockButtonRegisteredState("email",e,!0),this.refreshAllRestockButtonStates(!1)):this.invalidateRestockStatusCache(t.productId,n,o),this.popupManager.show(this.config.restockPopup,t.variants,t.productId,{readOnly:!0,hideSubmitButton:!0,variantId:n,email:i}),this.popupManager.success(this.config.restockPopup.success_text)}catch(e){console.error("StoreCRM Restock: one-click registration failed",e),this.popupManager.show(this.config.restockPopup,t.variants,t.productId),this.popupManager.failure(this.config.restockPopup.error_text)}})}handleLoginRequiredRestockClick(e,t){return o(this,void 0,void 0,function*(){if(yield this.isLoggedInCustomer())return void this.popupManager.show(this.config.restockPopup,t.variants,t.productId);const n=this.buildPendingRestockIntent(e,t);this.showRestockLoginRequiredModal(n)})}buildPendingRestockIntent(e,t){return{version:1,product_id:String(t.productId),variant_id:this.getCurrentRestockVariantId(t.variants),pdp_url:window.location.href,button_id:e,clicked_at:(new Date).toISOString(),created_at:Date.now(),auto_register_after_login:this.shouldAutoRegisterRestockAfterLogin(),mode:this.getRestockRegistrationMode(t.variants,this.getCurrentRestockVariantId(t.variants))}}getCurrentRestockVariantId(e){const t=new URL(window.location.href).searchParams.get("variant");if(t)return String(t);const n=this.getSelectedProductFormVariantId(e);if(n)return n;const o=(e||[]).find(e=>!e.available)||(e||[])[0];return o&&o.id?String(o.id):""}getSelectedProductFormVariantId(e){if(!document||!Array.isArray(e)||0===e.length)return"";const t=new Set(e.map(e=>String(e.id))),n=['form[action*="/cart/add"] input[name="id"]','form[action*="/cart/add"] select[name="id"]','product-form input[name="id"]','product-form select[name="id"]','input[name="id"]','select[name="id"]'];for(const e of n){const n=Array.from(document.querySelectorAll(e)).find(e=>{const n=String(e.value||"");return n&&t.has(n)});if(n)return String(n.value)}return""}initRestockStateWatcher(){if(this.restockStateWatcherStarted)return;this.restockStateWatcherStarted=!0,this.lastRestockStateHref=window.location.href;const e=()=>{this.refreshAllRestockButtonStates(!1)},t=()=>{this.refreshAllRestockButtonStates(!0)},n=()=>{e(),window.setTimeout(e,60),window.setTimeout(t,250)};window.navigation&&window.navigation.addEventListener("navigate",()=>{n()}),this.patchHistoryForRestockStateWatcher(),window.addEventListener("storecrm:locationchange",n),window.addEventListener("popstate",n),document.addEventListener("change",e=>{this.isVariantChangeTarget(e.target)&&n()},!0),["variant:change","variant:changed","product:variant-change","shopify:section:load"].forEach(e=>{document.addEventListener(e,n)}),window.setInterval(()=>{this.lastRestockStateHref!==window.location.href&&(this.lastRestockStateHref=window.location.href,n())},1e3)}patchHistoryForRestockStateWatcher(){const e="__storecrmRestockHistoryPatched";window[e]||(window[e]=!0,["pushState","replaceState"].forEach(e=>{const t=window.history[e];window.history[e]=(...e)=>{const n=t.apply(window.history,e);return window.dispatchEvent(new Event("storecrm:locationchange")),n}}))}isVariantChangeTarget(e){if(!(e instanceof HTMLElement))return!1;if(e.matches('input[name="id"], select[name="id"]'))return!0;const t=e.name||e.getAttribute("name")||"";return!!/options?\[|option-|variant/i.test(t)||Boolean(e.closest('variant-selects, variant-radios, product-form, .product-form, [data-product-form], [data-section*="product"]')&&e.matches("input, select"))}refreshAllRestockButtonStates(e=!1){document.querySelectorAll(".storecrm-button").forEach(t=>{if(!(t instanceof HTMLElement))return;const n=t.id;if(n)try{if("restock-button"===t.dataset.type){const t=a.RestockButton.getInstance(n);this.refreshRestockButtonState("email",n,t.productId,t.variants,this.getRestockRegistrationMode(t.variants,this.getCurrentRestockVariantId(t.variants)),e)}else if("line-restock-button"===t.dataset.type){const t=c.LineRestockButton.getInstance(n);this.refreshRestockButtonState("line",n,t.productId,t.variants,this.getRestockRegistrationMode(t.variants,this.getCurrentRestockVariantId(t.variants)),e)}}catch(e){}})}refreshRestockButtonState(e,t,n,i,r){return o(this,arguments,void 0,function*(e,t,n,o,i,r=!1){let s="";try{if(s=this.prepareRestockButtonStateRefresh(e,t,n,o,i),!this.shouldApplyRestockRegisteredState())return this.applyRestockButtonLoadingState(e,t,!1),void this.applyRestockButtonRegisteredState(e,t,!1);const a=this.getFreshCachedRestockStatus(n,s,i);if(a&&(this.applyRestockButtonLoadingState(e,t,!1),this.applyRestockButtonRegisteredState(e,t,this.isRestockStatusRegistered(e,n,s,i,a)),!r))return;const c=yield this.isLoggedInCustomer(),l=this.getCurrentRestockVariantId(o);if(l!==s)return void this.refreshRestockButtonState(e,t,n,o,this.getRestockRegistrationMode(o,l),!0);if(!c)return this.applyRestockButtonLoadingState(e,t,!1),void this.applyRestockButtonRegisteredState(e,t,!1);const d=yield this.getRestockStatus(n,s,i,r),u=this.getCurrentRestockVariantId(o);if(u!==s)return void this.refreshRestockButtonState(e,t,n,o,this.getRestockRegistrationMode(o,u),!0);this.applyRestockButtonLoadingState(e,t,!1),this.applyRestockButtonRegisteredState(e,t,this.isRestockStatusRegistered(e,n,s,i,d))}catch(n){s&&this.getCurrentRestockVariantId(o)===s&&this.applyRestockButtonLoadingState(e,t,!1),console.warn("StoreCRM Restock: failed to refresh registration status",n)}})}prepareRestockButtonStateRefresh(e,t,n,o,i){const r=this.getCurrentRestockVariantId(o),s=`${e}:${t}`,a=this.restockButtonVariantByKey.get(s),c=Boolean(a&&a!==r);c&&this.applyRestockButtonRegisteredState(e,t,!1),this.restockButtonVariantByKey.set(s,r);return this.getFreshCachedRestockStatus(n,r,i)?this.applyRestockButtonLoadingState(e,t,!1):c&&(this.applyRestockButtonRegisteredState(e,t,!1),this.applyRestockButtonLoadingState(e,t,!0)),r}getRestockStatusCacheKey(e,t,n){return`${n}:${e}:${t||""}`}getOptimisticRestockRegisteredKey(e,t,n,o){return`${e}:${this.getRestockStatusCacheKey(t,n,o)}`}isOptimisticRestockRegistered(e,t,n,o){const i=this.getOptimisticRestockRegisteredKey(e,t,n,o),r=this.optimisticRestockRegistered.get(i);return!!r&&(!(Date.now()-r>=3e4)||(this.optimisticRestockRegistered.delete(i),!1))}isRestockStatusRegistered(e,t,n,o,i){var r;return Boolean(null===(r=null==i?void 0:i[e])||void 0===r?void 0:r.registered)||this.isOptimisticRestockRegistered(e,t,n,o)}shouldApplyRestockRegisteredState(){return this.shouldShowRestockRegisteredState()}getFreshCachedRestockStatus(e,t,n){const o=this.restockStatusCache.get(this.getRestockStatusCacheKey(e,t,n));return!o||Date.now()-o.fetchedAt>=3e4?null:o.value}invalidateRestockStatusCache(e,t,n){this.restockStatusCache.delete(this.getRestockStatusCacheKey(e,t,n))}markRestockStatusCacheRegistered(e,t,n,o){this.optimisticRestockRegistered.set(this.getOptimisticRestockRegisteredKey(e,t,n,o),Date.now());const i=this.getFreshCachedRestockStatus(t,n,o)||{mode:o,product_id:t,variant_id:n||null,email:{registered:!1,customer_restock_id:null},line:{registered:!1,customer_restock_id:null,line_connected:!1}};i[e]=Object.assign(Object.assign({},i[e]),{registered:!0}),this.restockStatusCache.set(this.getRestockStatusCacheKey(t,n,o),{value:i,fetchedAt:Date.now()})}getRestockStatus(e,t,n){return o(this,arguments,void 0,function*(e,t,n,o=!1){var i;if(!e||"variant"===n&&!t)return null;const r=this.getRestockStatusCacheKey(e,t,n),s=this.getFreshCachedRestockStatus(e,t,n);if(!o&&s)return s;const a=this.restockStatusRequests.get(r);if(a)return a;const c=new URLSearchParams({product_id:e,mode:n});t&&c.set("variant_id",t);const l=null===(i=window.storecrm_data)||void 0===i?void 0:i.customer_email;l&&this.checkEmailFormat(l)&&c.set("email",l);const d=this.request("GET",`${this.config.backendUrl}/frontend/restock/status?${c.toString()}`).then(e=>(this.restockStatusCache.set(r,{value:e,fetchedAt:Date.now()}),e)).catch(e=>(console.warn("StoreCRM Restock: status request failed",e),null)).finally(()=>{this.restockStatusRequests.delete(r)});return this.restockStatusRequests.set(r,d),d})}getRestockButtonSettings(e){return"line"===e?this.config.lineRestock||{}:this.config.restock||{}}getNonEmptyRestockButtonSetting(e,t){var n;const o=null===(n=this.getRestockButtonSettings(e))||void 0===n?void 0:n[t];return"string"==typeof o&&""!==o.trim()?o:void 0}getRegisteredRestockButtonText(e){const t=this.getNonEmptyRestockButtonSetting(e,"registered_button_text");return t||(/^ja\b/i.test(this.currentLocale||"")?"\u767b\u9332\u6e08\u307f":"Registered")}getRegisteredRestockButtonOpacity(e){var t;const n=null===(t=this.getRestockButtonSettings(e))||void 0===t?void 0:t.registered_button_opacity,o="number"==typeof n?n:parseFloat(String(null!=n?n:""));return Number.isFinite(o)?String(Math.min(1,Math.max(.3,o))):"0.55"}getRestockButtonLoadingLabel(){return/^ja\b/i.test(this.currentLocale||"")?"\u78ba\u8a8d\u4e2d":"Checking"}ensureRestockLoadingStyle(){if(document.getElementById(f.RESTOCK_LOADING_STYLE_ID))return;const e=document.createElement("style");e.id=f.RESTOCK_LOADING_STYLE_ID,e.textContent="\n @keyframes storecrm-restock-spin {\n to { transform: rotate(360deg); }\n }\n .storecrm-restock-loading {\n position: relative;\n }\n .storecrm-restock-loading-spinner {\n width: 1.15em;\n height: 1.15em;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 999px;\n display: inline-block;\n animation: storecrm-restock-spin 0.75s linear infinite;\n }\n .storecrm-restock-loading-label {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n ",(document.head||document.body||document.documentElement).appendChild(e)}getRestockButtonLoadingHtml(){return`${this.getRestockButtonLoadingLabel()}`}rememberRestockButtonInlineStyles(e){"true"!==e.dataset.storecrmOriginalStyleSaved&&(e.dataset.storecrmOriginalStyleSaved="true",e.dataset.storecrmOriginalColor=e.style.color||"",e.dataset.storecrmOriginalBackgroundColor=e.style.backgroundColor||"",e.dataset.storecrmOriginalBorderColor=e.style.borderColor||"",e.dataset.storecrmOriginalOpacity=e.style.opacity||"",e.dataset.storecrmOriginalCursor=e.style.cursor||"",e.dataset.storecrmOriginalMinWidth=e.style.minWidth||"")}restoreRestockButtonInlineStyles(e){e.style.color=e.dataset.storecrmOriginalColor||"",e.style.backgroundColor=e.dataset.storecrmOriginalBackgroundColor||"",e.style.borderColor=e.dataset.storecrmOriginalBorderColor||"",e.style.opacity=e.dataset.storecrmOriginalOpacity||"",e.style.cursor=e.dataset.storecrmOriginalCursor||"",e.style.minWidth=e.dataset.storecrmOriginalMinWidth||"",delete e.dataset.storecrmOriginalStyleSaved,delete e.dataset.storecrmOriginalColor,delete e.dataset.storecrmOriginalBackgroundColor,delete e.dataset.storecrmOriginalBorderColor,delete e.dataset.storecrmOriginalOpacity,delete e.dataset.storecrmOriginalCursor,delete e.dataset.storecrmOriginalMinWidth}escapeCssIdentifier(e){return String(e).replace(/([^\w-])/g,"\\$1")}getRestockButtonSelector(e,t){return`.${"line"===e?"storecrm-line-restock":"storecrm-restock"}-${this.escapeCssIdentifier(t)}`}applyRestockButtonLoadingState(e,t,n){const o=this.getRestockButtonSelector(e,t);document.querySelectorAll(o).forEach(e=>{if(e instanceof HTMLButtonElement){if(e.dataset.storecrmOriginalText||(e.dataset.storecrmOriginalText=e.textContent||""),n)return this.ensureRestockLoadingStyle(),this.rememberRestockButtonInlineStyles(e),e.dataset.storecrmRestockLoading="true",e.dataset.storecrmRestockOriginalHtml||(e.dataset.storecrmRestockOriginalHtml=e.innerHTML),e.offsetWidth>0&&(e.style.minWidth=`${e.offsetWidth}px`),e.innerHTML=this.getRestockButtonLoadingHtml(),e.setAttribute("disabled","disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-busy","true"),e.classList.add("storecrm-restock-loading"),void(e.style.cursor="progress");"true"===e.dataset.storecrmRestockLoading&&(e.removeAttribute("aria-busy"),e.classList.remove("storecrm-restock-loading"),delete e.dataset.storecrmRestockLoading,"true"!==e.dataset.storecrmRegistered&&(e.removeAttribute("disabled"),e.removeAttribute("aria-disabled"),e.innerHTML=e.dataset.storecrmRestockOriginalHtml||e.dataset.storecrmOriginalText||e.innerHTML||"",this.restoreRestockButtonInlineStyles(e)),delete e.dataset.storecrmRestockOriginalHtml)}})}applyRestockButtonRegisteredState(e,t,n){const o=this.getRestockButtonSelector(e,t);document.querySelectorAll(o).forEach(t=>{if(t instanceof HTMLButtonElement){if(t.dataset.storecrmOriginalText||(t.dataset.storecrmOriginalText=t.textContent||""),n)return this.rememberRestockButtonInlineStyles(t),t.dataset.storecrmStateDisabled="true",t.dataset.storecrmRegistered="true",t.textContent=this.getRegisteredRestockButtonText(e),t.setAttribute("disabled","disabled"),t.setAttribute("aria-disabled","true"),t.classList.add("storecrm-restock-registered"),t.style.color=this.getNonEmptyRestockButtonSetting(e,"registered_button_color")||t.style.color,t.style.backgroundColor=this.getNonEmptyRestockButtonSetting(e,"registered_button_background_color")||t.style.backgroundColor,t.style.borderColor=this.getNonEmptyRestockButtonSetting(e,"registered_button_border_color")||t.style.borderColor,t.style.opacity=this.getRegisteredRestockButtonOpacity(e),void(t.style.cursor="not-allowed");"true"===t.dataset.storecrmStateDisabled&&(t.removeAttribute("disabled"),t.removeAttribute("aria-disabled"),t.classList.remove("storecrm-restock-registered"),t.textContent=t.dataset.storecrmOriginalText||t.textContent||"",delete t.dataset.storecrmStateDisabled,delete t.dataset.storecrmRegistered,this.restoreRestockButtonInlineStyles(t))}})}buildGuestRestockRedirectUrl(e){var t;const n=null===(t=this.config.restockOption)||void 0===t?void 0:t.guest_redirect_url;if(this.isNonEmptyOption(n))return this.buildConfiguredGuestRestockRedirectUrl(n,e);const o=this.toGuestRestockReturnPath(e);try{const e=new URL(this.getStoreAccountLoginUrl(),window.location.origin);return e.searchParams.set(this.getGuestRestockReturnParamName(e),o),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:e.toString()}catch(e){return`/account/login?return_url=${encodeURIComponent(o)}`}}buildConfiguredGuestRestockRedirectUrl(e,t){const n=this.toGuestRestockReturnPath(t);try{const t=new URL(e,window.location.origin);return t.searchParams.set(this.getConfiguredGuestRestockReturnParamName(t),n),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString()}catch(t){return e.trim()}}getConfiguredGuestRestockReturnParamName(e){return e.searchParams.has("return_to")||e.pathname.includes("/customer_authentication/login")?"return_to":"return_url"}getStoreAccountLoginUrl(){var e,t;const n=null===(e=window.storecrm_data)||void 0===e?void 0:e.account_login_url,o=null===(t=window.storecrm_data)||void 0===t?void 0:t.storefront_login_url;return this.isNewCustomerAccountsStore()?this.isNonEmptyOption(o)?o:this.isNonEmptyOption(n)?n:"/account/login":this.isNonEmptyOption(n)?n:this.isNonEmptyOption(o)?o:"/account/login"}isNewCustomerAccountsStore(){const e=this.config.shopifyCustomerAccountsIsClassic;if(!1===e||"false"===e||"0"===e)return!0;const t=String(this.config.shopifyCustomerAccountsVersion||"").toUpperCase();return"NEW"===t||"NEW_CUSTOMER_ACCOUNTS"===t}getGuestRestockReturnParamName(e){return e.searchParams.has("return_to")||e.pathname.includes("/customer_authentication/login")?"return_to":"return_url"}isNonEmptyOption(e){return"string"==typeof e&&""!==e.trim()&&"undefined"!==e}toGuestRestockReturnPath(e){try{const t=new URL(e,window.location.origin);return t.origin===window.location.origin||/(^|\/)products\//.test(t.pathname)?`${t.pathname}${t.search}${t.hash}`:t.toString()}catch(e){return window.location.pathname+window.location.search+window.location.hash}}setPendingRestockIntent(e){window.localStorage.setItem(f.PENDING_RESTOCK_INTENT_KEY,JSON.stringify(e))}getPendingRestockIntent(){const e=window.localStorage.getItem(f.PENDING_RESTOCK_INTENT_KEY);if(!e)return null;try{const t=JSON.parse(e);return t&&t.product_id&&t.pdp_url&&t.created_at?t:(this.clearPendingRestockIntent(),null)}catch(e){return this.clearPendingRestockIntent(),null}}clearPendingRestockIntent(){this.clearPendingRestockRetryTimer(),window.localStorage.removeItem(f.PENDING_RESTOCK_INTENT_KEY)}clearPendingRestockRetryTimer(){void 0!==this.pendingRestockRetryTimer&&(window.clearTimeout(this.pendingRestockRetryTimer),this.pendingRestockRetryTimer=void 0),this.pendingRestockRetryAttempts=0}schedulePendingRestockIntentRetry(e=600){void 0===this.pendingRestockRetryTimer&&(this.pendingRestockRetryAttempts>=10||(this.pendingRestockRetryAttempts+=1,this.pendingRestockRetryTimer=window.setTimeout(()=>{this.pendingRestockRetryTimer=void 0,this.handlePendingRestockIntent().catch(e=>{console.warn("StoreCRM: pending restock retry failed",e)})},e)))}showRestockLoginRequiredModal(e){this.pendingRestockLoginIntent=e,this.clearPendingRestockIntent();const t=this.ensureRestockLoginRequiredModal();if(!t)return this.setPendingRestockIntent(e),void(window.location.href=this.buildGuestRestockRedirectUrl(e.pdp_url));t.classList.add("is-open"),t.setAttribute("aria-hidden","false"),void 0===this.restockLoginRequiredPreviousOverflow&&(this.restockLoginRequiredPreviousOverflow=document.documentElement.style.overflow),document.documentElement.style.overflow="hidden";const n=t.querySelector('[data-storecrm-restock-login-action="login"]');null==n||n.focus()}hideRestockLoginRequiredModal(){const e=document.getElementById(f.RESTOCK_LOGIN_REQUIRED_MODAL_ID);e&&(e.classList.remove("is-open"),e.setAttribute("aria-hidden","true"),document.documentElement.style.overflow=this.restockLoginRequiredPreviousOverflow||"",this.restockLoginRequiredPreviousOverflow=void 0)}ensureRestockLoginRequiredModal(){if(!document||!document.body)return null;let e=document.getElementById(f.RESTOCK_LOGIN_REQUIRED_MODAL_ID);return e||(document.body.insertAdjacentHTML("beforeend",``),e=document.getElementById(f.RESTOCK_LOGIN_REQUIRED_MODAL_ID),this.bindRestockLoginRequiredModal(e)),e&&this.applyRestockLoginRequiredModalSettings(e),e}bindRestockLoginRequiredModal(e){e&&"true"!==e.dataset.storecrmBound&&(e.dataset.storecrmBound="true",e.addEventListener("click",e=>{var t;const n=e.target,o=null===(t=null==n?void 0:n.closest("[data-storecrm-restock-login-action]"))||void 0===t?void 0:t.getAttribute("data-storecrm-restock-login-action");if(o){if("login"===o){e.preventDefault();const t=this.pendingRestockLoginIntent;return t?(this.setPendingRestockIntent(t),this.hideRestockLoginRequiredModal(),void(window.location.href=this.buildGuestRestockRedirectUrl(t.pdp_url))):void this.hideRestockLoginRequiredModal()}e.preventDefault(),this.pendingRestockLoginIntent=void 0,this.clearPendingRestockIntent(),this.hideRestockLoginRequiredModal()}}))}getRestockLoginRequiredCopy(){const e=/^ja\b/i.test(this.currentLocale||"")?{title:"\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059",description:"\u518d\u5165\u8377\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b\u306b\u306f\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002",login:"\u30ed\u30b0\u30a4\u30f3",cancel:"\u30ad\u30e3\u30f3\u30bb\u30eb"}:{title:"Login required",description:"Please log in to receive restock notifications.",login:"Login",cancel:"Cancel"};return{title:this.getRestockLoginRequiredTextOption("login_required_modal_title",e.title),description:this.getRestockLoginRequiredTextOption("login_required_modal_description",e.description),login:this.getRestockLoginRequiredTextOption("login_required_modal_login_button_text",e.login),cancel:this.getRestockLoginRequiredTextOption("login_required_modal_cancel_button_text",e.cancel)}}getRestockLoginRequiredTextOption(e,t){var n;const o=null===(n=this.config.restockOption)||void 0===n?void 0:n[e];return this.isNonEmptyOption(o)?o:t}getRestockLoginRequiredColorOption(e,t){var n;const o=null===(n=this.config.restockOption)||void 0===n?void 0:n[e];return this.isNonEmptyOption(o)?o:t}getRestockLoginRequiredNumberOption(e,t,n,o){var i;const r=null===(i=this.config.restockOption)||void 0===i?void 0:i[e],s="number"==typeof r?r:Number.parseFloat(r);return Number.isFinite(s)?Math.min(o,Math.max(n,s)):t}applyRestockLoginRequiredModalSettings(e){const t=this.getRestockLoginRequiredCopy(),n=e.querySelector(".storecrm_modal__overlay"),o=e.querySelector(".storecrm_modal__container"),i=e.querySelector("#storecrm-restock-login-required-title"),r=e.querySelector("#storecrm-restock-login-required-content"),s=e.querySelector(".storecrm_login_required_login"),a=e.querySelector(".storecrm_login_required_cancel");i&&(i.textContent=t.title),r&&(r.textContent=t.description),s&&(s.textContent=t.login),a&&(a.textContent=t.cancel);const c=this.getRestockLoginRequiredColorOption("login_required_modal_overlay_color","#000000"),l=this.getRestockLoginRequiredNumberOption("login_required_modal_overlay_opacity",55,0,90),d=this.getRestockLoginRequiredColorOption("login_required_modal_text_color","#111111"),u=this.getRestockLoginRequiredNumberOption("login_required_modal_width",576,320,720),h=this.getRestockLoginRequiredNumberOption("login_required_modal_radius",2,0,24),m=this.getRestockLoginRequiredNumberOption("login_required_modal_button_radius",32,0,40),g=this.getRestockLoginRequiredColorOption("login_required_modal_login_button_background_color","#000000"),p=this.getRestockLoginRequiredColorOption("login_required_modal_login_button_text_color","#ffffff"),f=this.getRestockLoginRequiredColorOption("login_required_modal_cancel_button_background_color","#ffffff"),_=this.getRestockLoginRequiredColorOption("login_required_modal_cancel_button_text_color","#111111"),v=this.getRestockLoginRequiredColorOption("login_required_modal_cancel_button_border_color","#111111");n&&(n.style.backgroundColor=this.toRgba(c,l/100)),o&&(o.style.backgroundColor=this.getRestockLoginRequiredColorOption("login_required_modal_background_color","#ffffff"),o.style.color=d,o.style.width=`min(${u}px, 100%)`,o.style.borderRadius=`${h}px`),i&&(i.style.color=d),r&&(r.style.color=d),s&&(s.style.backgroundColor=g,s.style.borderColor=g,s.style.color=p,s.style.borderRadius=`${m}px`),a&&(a.style.backgroundColor=f,a.style.borderColor=v,a.style.color=_,a.style.borderRadius=`${m}px`)}toRgba(e,t){const n=Math.min(1,Math.max(0,t)),o=e.trim(),i=o.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i),r=o.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);if(i){const[,e,t,o]=i;return`rgba(${parseInt(e+e,16)}, ${parseInt(t+t,16)}, ${parseInt(o+o,16)}, ${n})`}if(r){const[,e,t,o]=r;return`rgba(${parseInt(e,16)}, ${parseInt(t,16)}, ${parseInt(o,16)}, ${n})`}return`rgba(0, 0, 0, ${n})`}isPendingRestockIntentExpired(e){return!e.created_at||Date.now()-e.created_at>f.PENDING_RESTOCK_INTENT_TTL_MS}isLoggedInCustomer(){return o(this,void 0,void 0,function*(){const e=(this.getCurrentShopifyCustomerId()||"").toString();if(!e)return!1;let t=(window.localStorage.getItem("storecrm_customer_id")||"").toString();if(!t||/^TEMP_/.test(t)||t!==e){try{yield this.fetchToken()}catch(e){console.warn("StoreCRM: failed to refresh token for restock login check",e)}t=(window.localStorage.getItem("storecrm_customer_id")||"").toString()}return!!t&&!/^TEMP_/.test(t)&&t===e})}isCurrentPageSameAsPendingPdp(e){try{const t=new URL(window.location.href,window.location.origin),n=new URL(e.pdp_url,window.location.origin);return t.origin===n.origin&&t.pathname===n.pathname&&t.search===n.search}catch(e){return!1}}isAccountPage(){return-1!==this.getAccountPathIndex(window.location.pathname)}showPendingRestockPopup(e,t={}){const n=e.variant_id?[{id:e.variant_id,title:"",available:!1}]:[];this.popupManager.show(this.config.restockPopup,n,e.product_id,t)}handlePendingRestockIntent(){return o(this,void 0,void 0,function*(){var e;if(this.pendingRestockIntentProcessing)return;const t=this.getPendingRestockIntent();if(t)if(this.isPendingRestockIntentExpired(t))this.clearPendingRestockIntent();else{this.pendingRestockIntentProcessing=!0;try{if(!(yield this.isLoggedInCustomer()))return void(this.isAccountPage()||this.schedulePendingRestockIntentRetry());if(!this.isCurrentPageSameAsPendingPdp(t))return void(window.location.href=t.pdp_url);if(!t.auto_register_after_login)return void this.clearPendingRestockIntent();const n=null===(e=window.storecrm_data)||void 0===e?void 0:e.customer_email;if(this.clearPendingRestockIntent(),!n||!this.checkEmailFormat(n))return this.showPendingRestockPopup(t),void this.popupManager.failure("\u30ed\u30b0\u30a4\u30f3\u4e2d\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u518d\u5165\u8377\u901a\u77e5\u30dc\u30bf\u30f3\u304b\u3089\u3082\u3046\u4e00\u5ea6\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002");yield this.doStoreRestock(t.variant_id,t.product_id,n,!1,!1,!1,t.mode),this.shouldShowRestockRegisteredState()?(this.markRestockStatusCacheRegistered("email",t.product_id,t.variant_id,t.mode),t.button_id&&this.applyRestockButtonRegisteredState("email",t.button_id,!0),this.refreshAllRestockButtonStates(!1)):this.invalidateRestockStatusCache(t.product_id,t.variant_id,t.mode),this.showPendingRestockPopup(t,{readOnly:!0,hideSubmitButton:!0,variantId:t.variant_id,email:n}),this.popupManager.success(this.config.restockPopup.success_text)}catch(e){this.clearPendingRestockIntent(),console.error("StoreCRM: pending restock auto registration failed",e),t&&this.showPendingRestockPopup(t),this.popupManager.failure(this.config.restockPopup.error_text)}finally{this.pendingRestockIntentProcessing=!1}}})}showLineRestockPopup(e){return o(this,void 0,void 0,function*(){var t,n,o;const i=c.LineRestockButton.getInstance(e);if(!i)return void console.error("StoreCRM LineRestock: lineRestockButton not found");const r=yield this.isLoggedInCustomer(),s=this.getCurrentRestockVariantId(i.variants),a=this.getRestockRegistrationMode(i.variants,s);let l,d=!1,u=null;if(r){if((this.shouldShowRestockRegisteredState()||this.shouldOneClickRestockWhenLoggedIn())&&(u=yield this.getRestockStatus(i.productId,s,a,!0)),this.shouldShowRestockRegisteredState()&&(null===(t=null==u?void 0:u.line)||void 0===t?void 0:t.registered))return void this.applyRestockButtonRegisteredState("line",e,!0);if(this.shouldOneClickRestockWhenLoggedIn()){const t=yield this.tryGetLineProfile();if(l=t,d=!0,(null==t?void 0:t.line_customer_id)||(null===(n=null==u?void 0:u.line)||void 0===n?void 0:n.line_connected)){const n=Boolean(null==t?void 0:t.line_customer_id)||Boolean(null==t?void 0:t.display_name)||Boolean(null==t?void 0:t.picture_url);try{return yield this.doStoreLineRestock(i.productId,s,(null==t?void 0:t.line_customer_id)||"",(null==t?void 0:t.display_name)||"",n?JSON.stringify(t):"",a),this.shouldShowRestockRegisteredState()?(this.markRestockStatusCacheRegistered("line",i.productId,s,a),this.applyRestockButtonRegisteredState("line",e,!0),this.refreshAllRestockButtonStates(!1)):this.invalidateRestockStatusCache(i.productId,s,a),this.lineRestockPopupManager.show(this.config.lineRestockPopup,i.variants,i.productId,t,{readOnly:!0,hideSubmitButton:!0,variantId:s}),void this.lineRestockPopupManager.success(this.config.lineRestockPopup.success_text)}catch(e){return console.error("StoreCRM LineRestock: one-click registration failed",e),this.lineRestockPopupManager.show(this.config.lineRestockPopup,i.variants,i.productId,t),void this.lineRestockPopupManager.failure(this.config.lineRestockPopup.error_text)}}}}if(null===(o=window.storecrm_data)||void 0===o?void 0:o.customer_id){const e=d?l:yield this.tryGetLineProfile();this.lineRestockPopupManager.show(this.config.lineRestockPopup,i.variants,i.productId,e)}else this.lineRestockPopupManager.show(this.config.lineRestockPopup,i.variants,i.productId,void 0)})}tryGetLineProfile(){return o(this,void 0,void 0,function*(){try{return yield this.doGetLineProfile()}catch(e){return void console.warn("StoreCRM LineRestock: failed to get LINE profile",e)}})}storeRestock(e,t,n,o,i,r,s=void 0,a=void 0){if(!this.checkEmailFormat(e))return a&&a("\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002");const c=this.getRestockRegistrationMode([],t);this.doStoreRestock(t,n,e,i,o,r,c).then(()=>{this.invalidateRestockStatusCache(n,t,c),this.refreshAllRestockButtonStates(!0),s&&s(this.config.restockPopup.success_text)}).catch(e=>{console.error("StoreCRM: API call failed:",e),a&&a(this.config.restockPopup.error_text)})}doStoreRestock(e,t,n,i,r,s){return o(this,arguments,void 0,function*(e,t,n,o,i,r,s=this.favoriteMode){var a,c;if(o)try{const e=(null===(a=this.config.restockPopup)||void 0===a?void 0:a.create_shopify_customer)||!1,t=e&&(null===(c=this.config.restockPopup)||void 0===c?void 0:c.create_shopify_customer_tags)||void 0;yield this.doUpsertCustomerAcceptsMarketing(n,i,r,t,e)}catch(e){console.error("API call failed:",e)}return yield this.request("POST",`${this.config.backendUrl}/frontend/restock/`,{product_id:t,variant_id:e,email:n,mode:s})})}storeLineRestock(e,t,n,o,i,r=void 0,s=void 0){const a=this.getRestockRegistrationMode([],t);this.doStoreLineRestock(e,t,n,o,i,a).then(()=>{this.invalidateRestockStatusCache(e,t,a),this.refreshAllRestockButtonStates(!0),r&&r(this.config.lineRestockPopup.success_text)}).catch(e=>{console.error("StoreCRM: API call failed:",e),s&&s(this.config.lineRestockPopup.error_text)})}doStoreLineRestock(e,t,n,i,r){return o(this,arguments,void 0,function*(e,t,n,o,i,r=this.favoriteMode){return yield this.request("POST",`${this.config.backendUrl}/frontend/line/restock/`,{product_id:e,variant_id:t,line_customer_id:n,line_name:o,line_profile:i,mode:r})})}doUpsertCustomerAcceptsMarketing(e,t,n,i,r){return o(this,void 0,void 0,function*(){const o={email:e,accepts_marketing:t,new_customer:n,create_shopify_customer:r||!1};i&&(o.tags=i);return yield this.request("POST",`${this.config.backendUrl}/frontend/accepts-marketing/`,o)})}doGetLineProfile(){return o(this,void 0,void 0,function*(){return yield this.request("GET",`${this.config.backendUrl}/frontend/line/profile`)})}renderStatusWidget(){if(this.statusWidget)return;const e=document.querySelector(".storecrm-status-widget-target"),t=document.querySelector("#shopify-section-header,.section-header,.section--header,header,.header-wrapper,.header,.header_nav"),n=document.querySelector("#MainContent, #main, .main, main");if(t||n||e){if(e)this.statusWidget=new h.StatusWidget(e,"beforeend",this.config);else if(n)this.statusWidget=new h.StatusWidget(n,"afterbegin",this.config);else{if(!t)return;this.statusWidget=new h.StatusWidget(t,"beforeend",this.config)}this.statusWidget.setParent(this),this.statusWidget.render()}else console.error("Shopify header not found. Please assign following class/id/element to header: #shopify-section-header,.section-header,.section--header,header,.header_nav")}getStatus(e,t){this.doGetStatus().then(t=>{e(t)}).catch(e=>{console.error(e),t("\u30b5\u30fc\u30d0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002")})}doGetStatus(){return o(this,void 0,void 0,function*(){return yield this.request("GET",`${this.config.backendUrl}/frontend/status`)})}lineSubscribe(e=void 0){this.doLineSubscribe()}doLineSubscribe(){return o(this,void 0,void 0,function*(){const e=yield this.getCustomerId(),t=yield this.getToken(),n=window.location.href;location.href=`${this.config.backendUrl}/frontend/line/connect?token=${t}&customer_id=${e}&host=${window.location.host}&referrer=${encodeURIComponent(n)}`})}doLineLogin(){return o(this,void 0,void 0,function*(){const e=yield this.getCustomerId(),t=yield this.getToken(),n=window.location.href;location.href=`${this.config.backendUrl}/frontend/line/connect?is_multipass=true&token=${t}&customer_id=${e}&host=${window.location.host}&referrer=${encodeURIComponent(n)}`})}lineUnsubscribe(e=void 0){this.doLineUnsubscribe().then(e=>{e&&"string"==typeof e.redirect_url&&e.redirect_url?location.href=e.redirect_url:location.href=location.pathname+"?line_disconnect=1"}).catch(t=>{console.error(t),e?e("LINE\u306e\u901a\u77e5\u89e3\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002"):alert("LINE\u306e\u901a\u77e5\u89e3\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002")})}doLineUnsubscribe(){return o(this,void 0,void 0,function*(){return yield this.request("POST",`${this.config.backendUrl}/frontend/line/disconnect`)})}mailSubscribe(){this.doMailSubscribe().then(e=>{console.log("StoreCRM: \u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u8cfc\u8aad\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002",e);const t=document.getElementById("storecrm_message");t&&(t.innerHTML="\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u8cfc\u8aad\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002"),this.statusWidget&&this.statusWidget.render()}).catch(e=>{console.error(e),alert("\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u8cfc\u8aad\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002")})}doMailSubscribe(){return o(this,void 0,void 0,function*(){return yield this.request("POST",`${this.config.backendUrl}/frontend/email/subscribe`)})}mailUnsubscribe(){this.doMailUnsubscribe().then(e=>{console.log("StoreCRM: \u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u89e3\u9664\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002",e);const t=document.getElementById("storecrm_message");t&&(t.innerHTML="\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u89e3\u9664\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002"),this.statusWidget&&this.statusWidget.render()}).catch(e=>{console.error(e);const t=document.getElementById("storecrm_message");t&&(t.innerHTML="\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u89e3\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002","API"in e.toString()&&(t.innerHTML+='
\u89e3\u9664\u3092\u9032\u3081\u308b\u306b\u306f\u30ed\u30b0\u30a4\u30f3\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002')),alert("\u30e1\u30fc\u30eb\u30de\u30ac\u30b8\u30f3\u306e\u89e3\u9664\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002")})}doMailUnsubscribe(){return o(this,void 0,void 0,function*(){return yield this.request("POST",`${this.config.backendUrl}/frontend/email/unsubscribe`)})}doMailCheck(e){return o(this,arguments,void 0,function*(e,t=void 0){if(!this.checkEmailFormat(e))return t&&t("\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002");return yield this.request("GET",`${this.config.backendUrl}/frontend/accepts-marketing/?email=${encodeURIComponent(e)}`)})}birthdaySet(){}checkEmailFormat(e){return!(!e||!e.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/))}checkConnect(){const e=new URLSearchParams(window.location.search),t=e.get("storecrm"),n=window.localStorage.getItem("storecrm_customer_id");if(!n||n.startsWith("TEMP_")){const e=document.getElementById("storecrm_message");return void(e&&(e.innerHTML='\u8a2d\u5b9a\u5909\u66f4\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
\u9032\u3081\u308b\u306b\u306f\u30ed\u30b0\u30a4\u30f3\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002'))}if(!this.checkConnectExecuted){if(this.checkConnectExecuted=!0,"line_connect"===t?this.lineSubscribe(function(){console.log("StoreCRM: LINE\u306e\u901a\u77e5\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002")}):"line_disconnect"===t?this.lineUnsubscribe():"email_subscribe"===t?this.mailSubscribe():"email_unsubscribe"===t?this.mailUnsubscribe():"birthday_set"===t&&this.birthdaySet(),e.get("line_disconnect")){const e=document.querySelector("#storecrm_message");e&&(e.innerHTML="LINE\u306e\u901a\u77e5\u3092\u89e3\u9664\u3057\u307e\u3057\u305f\u3002")}if(e.get("line_connect")){const e=document.querySelector("#storecrm_message");e&&(e.innerHTML="LINE\u3092\u9023\u643a\u3057\u307e\u3057\u305f\u3002")}}}}f.PENDING_RESTOCK_INTENT_KEY="storecrm_pending_restock_intent",f.PENDING_RESTOCK_INTENT_TTL_MS=864e5,f.RESTOCK_LOGIN_REQUIRED_MODAL_ID="storecrm-restock-login-required-modal",f.RESTOCK_LOADING_STYLE_ID="storecrm-restock-loading-style",f.LOCALE_PATTERN=/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/i,f.DEFAULT_EXCLUDED_ACCOUNT_PAGES=[p.ExcludedAccountPage.LOGIN,p.ExcludedAccountPage.REGISTER,p.ExcludedAccountPage.RECOVER,p.ExcludedAccountPage.ACTIVATE,p.ExcludedAccountPage.RESET],t.default=f},812(e){var t=[];function n(e){for(var n=-1,o=0;o{e.addEventListener("click",e=>{var t,n;const o=e.currentTarget,i=o.dataset.productId;o.dataset.variantId;i&&(e.preventDefault(),this.parent.toggleWishlist(o,!0,null===(t=this.parent.config.favorite)||void 0===t?void 0:t.is_only_member,null===(n=this.parent.config.favorite)||void 0===n?void 0:n.non_member_link))})});e.querySelectorAll("[data-cart-variant-id], [data-cart-product-id]").forEach(e=>{e.addEventListener("click",e=>{const t=e.currentTarget,n=t.dataset.cartVariantId,o=t.dataset.cartProductId,r=t.dataset.cartProductHandle||"",s=n||o;s&&(e.preventDefault(),(0,i.cartFavorite)(this.mode,s,r,this.config.insert_cart_directly,n))})})}loadProductAndRender(e){return o(this,void 0,void 0,function*(){var t,n;const o=window.Shopify&&(window.Shopify.locale||(null===(n=null===(t=window.Shopify.localization)||void 0===t?void 0:t.language)||void 0===n?void 0:n.isoCode))||this.parent.currentLocale,i=o?`&locale=${encodeURIComponent(o)}`:"",r=yield fetch(`/apps/${this.parent.config.appProxyName}/favorites/products?mode=${this.mode}&ids=${e}${i}`),s=yield r.json();this.renderProducts(s)})}renderProducts(e){const t=document.querySelector(".storecrm_favoritelist tbody"),n=document.querySelector(".storecrm_favoritelist_loading"),o=document.querySelector(".storecrm_favoritelist table"),i=document.querySelector(".storecrm_favoritelist_non_item");if(!(t&&n&&o&&t instanceof HTMLElement&&n instanceof HTMLElement&&o instanceof HTMLElement))return;const r="variant"===this.mode?e.variants:e.products;if(!r||0===r.length)return o.style.display="none",n.style.display="none",void(i&&(i.style.display="block"));for(;t.firstChild;)t.removeChild(t.firstChild);r.forEach(e=>t.appendChild(this.createFavoriteRow(t,e))),n.style.display="none",o.style.display="table",i&&(i.style.display="none")}createFavoriteRow(e,t){const n=document.createElement("tr");n.classList.add(`storecrm_favoritelist_id-${t.variant_id||t.product_id}`);const o=(0,i.getLocalePathPrefix)(),s=t.url||("product"===this.mode?`${o}/products/${t.handle}`:`${o}/products/${t.handle}?variant=${t.variant_id}`),a=document.createElement("td");a.classList.add("storecrm_favoritelist_lefttd");const c=document.createElement("a");if(c.href=s,c.textContent=t.title,t.thumbnail_url){const e=document.createElement("img");e.classList.add("storecrm_favoritelist_img"),e.src=t.thumbnail_url,a.appendChild(e)}a.appendChild(c);const l=document.createElement("td");l.classList.add("storecrm_favoritelist_righttd");const d=document.createElement("div");if(d.classList.add("storecrm_favoritelist_links"),this.config.show_cart&&t.available){const e=document.createElement("a");e.classList.add("storecrm_favoritelist_link"),e.href="javascript:void(0);",e.innerHTML=r.iconCart,e.onclick=()=>(0,i.cartFavorite)(this.mode,"product"==this.mode?t.variant_id||t.product_id:t.variant_id||"",t.handle,this.config.insert_cart_directly,t.variant_id),d.appendChild(e)}const u=document.createElement("a");return u.classList.add("storecrm_favoritelist_link"),u.href="javascript:void(0);",u.innerHTML=r.iconDelete,"product"==this.mode||(u.dataset.variantId=t.variant_id),u.dataset.productId=t.product_id,u.onclick=()=>this.parent.toggleWishlist(u,!0,this.parent.config.favorite.is_only_member,this.parent.config.favorite.non_member_link),d.appendChild(u),l.appendChild(d),n.appendChild(a),n.appendChild(l),n}}t.Renderer=a,a.instance=void 0},900(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.schema=t.LineRestockPopupManager=void 0;const r=i(n(720));class s{constructor(e,t=!1){this.preview=!1,this.inited=!1,this.container=null,this.title=null,this.content=null,this.footer=null,this.button=null,this.lineLoginButton=null,this.close=null,this.product_id=null,this.line_profile=null,this.preview=t,this.config=e,this.init()}static getInstance(e,t=!1){return s.instance?(s.instance.config=e,s.instance.preview=t):s.instance=new s(e,t),s.instance}setParent(e){this.parent=e}renderTemplate(){document&&document.body?document.body.insertAdjacentHTML("beforeend",s.template):window.setTimeout(this.renderTemplate.bind(this),100)}init(){document&&document.body?this.runInit():window.setTimeout(this.init.bind(this),100)}runInit(){this.inited=!0,this.preview||document.body.insertAdjacentHTML("beforeend",s.template),r.default.init(),this.updateElements(),this.container&&this.container.addEventListener("click",e=>{e.stopPropagation()}),this.close&&!this.preview&&this.close.addEventListener("click",e=>{r.default.close("storecrm-line-restock-modal")})}updateElements(){this.container=document.getElementById("storecrm-line-restock-modal"),this.title=document.getElementById("storecrm-line-restock-title"),this.content=document.getElementById("storecrm-line-restock-content"),this.footer=document.getElementById("storecrm-line-restock-footer"),this.close=document.getElementById("storecrm-line-restock-close")}getLineProfileFromURL(){console.log("StoreCRM: getLineProfileFromURL called");try{const e=new URLSearchParams(window.location.search).get("line_profile_data");if(e){const t=atob(e),n=JSON.parse(t),o={display_name:n.displayName||"",picture_url:n.pictureUrl||"",line_customer_id:n.userId||""};window.sessionStorage.setItem("storecrm_line_profile",JSON.stringify(o));const i=new URL(window.location.href);return i.searchParams.delete("line_profile_data"),window.history.replaceState({},"",i.toString()),o}}catch(e){console.error("StoreCRM: Failed to parse line profile from URL",e)}}getLineProfileFromSessionStorage(){try{const e=window.sessionStorage.getItem("storecrm_line_profile");if(e)return JSON.parse(e)}catch(e){console.error("StoreCRM: Failed to parse line profile from session storage",e)}}render(e,t,n,o={}){var i;this.preview&&this.updateElements();let r=!1;if(n||this.preview||((n=this.getLineProfileFromURL())?r=!0:n=this.getLineProfileFromSessionStorage()),n&&!this.preview&&(null!=n.display_name&&null!=n.picture_url&&null!=n.line_customer_id||(n=void 0,window.sessionStorage.removeItem("storecrm_line_profile"))),!this.title||!this.content||!this.footer)return;const s=document.createElement("button");s.className="storecrm_modal__btn storecrm_modal__btn-primary",s.innerHTML=e.button_text||"\u518d\u5165\u8377\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b";const a=document.createElement("button");a.className="storecrm_modal__btn storecrm_modal__btn-primary storecrm_modal__btn-line-login",a.innerHTML="LINE\u9023\u643a\u3092\u884c\u3046",n||this.preview||(s.style.display="none",a.style.display="block"),n&&!this.preview&&(a.style.display="none",s.style.display="block"),0!==this.footer.children.length&&(this.footer.innerHTML=""),this.button=null,this.lineLoginButton=null,o.hideSubmitButton||(this.footer.appendChild(s),this.footer.appendChild(a),this.button=s,this.lineLoginButton=a),this.button&&!this.preview&&(this.button.addEventListener("click",()=>{this.handleEnableClick()}),null===(i=this.lineLoginButton)||void 0===i||i.addEventListener("click",()=>{this.handleLineSubscribeClick()})),this.config=e,this.title.innerText=e.title||"LINE\u518d\u5165\u8377\u901a\u77e5";const c=o.readOnly?' disabled aria-disabled="true"':"";let l=`\n
${e.description_text||"\u3053\u306e\u5546\u54c1\u306e\u518d\u5165\u8377\u3092LINE\u3067\u304a\u77e5\u3089\u305b\u3057\u307e\u3059"}
\n
\n `,d=o.variantId||null;if(location.search&&location.search.includes("variant")){const e=new URL(location.href);d=d||e.searchParams.get("variant")}const u=t.filter(e=>!e.available).map(e=>``).join("");if(t&&Array.isArray(t)&&t.length>1?(l=l.replace("\x3c!-- select_style --\x3e",""),l=l.replace("\x3c!-- options --\x3e",u)):(l=l.replace("\x3c!-- select_style --\x3e","display:none"),l=l.replace("\x3c!-- options --\x3e",u)),(n||this.preview)&&(this.line_profile=n||{display_name:"LINE\u9867\u5ba2\u540d",picture_url:"https://placehold.co/60x60?text=LINE&font=roboto",line_customer_id:"preview-user"},l+=`\n
\n avatar\n
${this.line_profile.display_name}
\n
`),l+='
',this.content.innerHTML=l,this.content.style.color=e.text_color||"#000000",this.container){const t=this.container.querySelector(".storecrm_modal__container");t&&(t.style.backgroundColor=e.background_color||"#ffffff",t.style.borderRadius=`${e.popup_radius||10}px`)}this.button&&(this.button.style.backgroundColor=e.button_background_color||"#222222",this.button.style.color=e.button_text_color||"#dddddd",this.button.style.borderRadius="4px"),this.lineLoginButton&&(this.lineLoginButton.style.backgroundColor="#06C755",this.lineLoginButton.style.color="#ffffff",this.lineLoginButton.style.borderRadius="4px"),this.close&&(this.close.style.color=e.close_text_color||"#000000"),this.resetMessage(),this.preview&&(this.success(e.success_text||"\u518d\u5165\u8377\u901a\u77e5\u304c\u767b\u9332\u3055\u308c\u307e\u3057\u305f\uff01"),this.failure(e.error_text||"\u518d\u5165\u8377\u901a\u77e5\u306e\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002"),this.container&&this.container.querySelectorAll(".storecrm_modal__overlay,.storecrm_modal__close").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})}))}handleEnableClick(){return o(this,void 0,void 0,function*(){var e,t,n;if(this.preview)return;this.resetMessage(),this.disableButton();const o=null===(e=this.content)||void 0===e?void 0:e.querySelector("#storecrm_restock_variant"),i=o?o.value:"";this.parent&&this.parent.storeLineRestock(this.product_id,i,null===(t=this.line_profile)||void 0===t?void 0:t.line_customer_id,null===(n=this.line_profile)||void 0===n?void 0:n.display_name,JSON.stringify(this.line_profile),this.success.bind(this),this.failure.bind(this))})}handleLineSubscribeClick(){return o(this,void 0,void 0,function*(){this.preview||(this.resetMessage(),this.disableButton(),console.log("StoreCRM: LINE\u8cfc\u8aad\u51e6\u7406\u3092\u3057\u307e\u3059"),this.parent&&this.parent.lineSubscribe(function(e){alert(e)}))})}resetMessage(){this.footer&&this.footer.querySelectorAll(".storecrm_modal_message").forEach(e=>e.remove())}disableButton(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.innerText="\u9001\u4fe1\u4e2d...")}enableButton(){this.button&&(this.button.removeAttribute("disabled"),this.button.innerText=this.config.button_text||"\u518d\u5165\u8377\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b")}success(e){this.enableButton();const t=document.createElement("div");t.classList.add("storecrm_modal_success","storecrm_modal_message"),t.style.color=this.config.success_text_color||"#166534",t.style.backgroundColor=this.config.success_background_color||"#F0FDF4",t.style.padding="1rem",t.style.marginTop="1rem",t.style.borderRadius="4px",t.innerText=e,this.footer&&this.footer.appendChild(t)}failure(e){this.enableButton();const t=document.createElement("div");t.classList.add("storecrm_modal_error","storecrm_modal_message"),t.style.color=this.config.error_text_color||"#991B1B",t.style.backgroundColor=this.config.error_background_color||"#FEF2F2",t.style.padding="1rem",t.style.marginTop="1rem",t.style.borderRadius="4px",t.innerText=e,this.footer&&this.footer.appendChild(t)}show(e,t,n,o,i={}){this.product_id=n,this.inited?this.runShow(e,t,o,i):window.setTimeout(()=>this.show(e,t,n,o,i),100)}runShow(e,t,n,o={}){this.render(e,t,n,o);if(document.getElementById("storecrm-line-restock-modal"))try{r.default.show("storecrm-line-restock-modal",{disableFocus:!0})}catch(e){console.warn("StoreCRM: line restock popup show failed",e)}else console.warn("StoreCRM: line restock popup modal element not found, skip show")}hide(){if(document.getElementById("storecrm-line-restock-modal"))try{r.default.close("storecrm-line-restock-modal")}catch(e){console.warn("StoreCRM: line restock popup close failed",e)}}}t.LineRestockPopupManager=s,s.template='';let a=null;t.schema={preview:(e,t)=>{var n,o;return n=()=>{s.getInstance(e,!0).show(e,[],"1234567890",void 0)},o=300,clearTimeout(a),a=setTimeout(n,o),s.template},rows:[{type:"text",slug:"title",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30bf\u30a4\u30c8\u30eb",nameEn:"Popup title",defaultJa:"LINE\u518d\u5165\u8377\u901a\u77e5",defaultEn:"LINE Restock Notification"},{type:"text",slug:"description_text",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u672c\u6587",nameEn:"Popup description",defaultJa:"\u3053\u306e\u5546\u54c1\u306e\u518d\u5165\u8377\u3092LINE\u3067\u304a\u77e5\u3089\u305b\u3057\u307e\u3059",defaultEn:"We will notify you via LINE when this product is restocked."},{type:"colorpicker",slug:"background_color",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u80cc\u666f\u8272",nameEn:"Popup background color",default:"#ffffff"},{type:"colorpicker",slug:"text_color",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u30c6\u30ad\u30b9\u30c8\u8272",nameEn:"Text color",default:"#000000"},{type:"colorpicker",slug:"close_text_color",nameJa:"\u9589\u3058\u308b\u30dc\u30bf\u30f3\u306e\u8272",nameEn:"Popup close button text color",default:"#000000"},{type:"colorpicker",slug:"button_background_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272",nameEn:"Button background color",default:"#222222"},{type:"colorpicker",slug:"button_text_color",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8\u30ab\u30e9\u30fc",nameEn:"Button text color",default:"#dddddd"},{type:"text",slug:"button_text",nameJa:"\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Button text",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b",defaultEn:"Enable restock notification"},{type:"text",slug:"success_text",nameJa:"\u6210\u529f\u6642\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Success text",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u304c\u767b\u9332\u3055\u308c\u307e\u3057\u305f\uff01",defaultEn:"Restock notification registered!"},{type:"colorpicker",slug:"success_background_color",nameJa:"\u6210\u529f\u6642\u306e\u80cc\u666f\u8272",nameEn:"Success background color",default:"#F0FDF4"},{type:"colorpicker",slug:"success_text_color",nameJa:"\u6210\u529f\u6642\u306e\u6587\u5b57\u8272",nameEn:"Success text color",default:"#166534"},{type:"text",slug:"error_text",nameJa:"\u5931\u6557\u6642\u306e\u30c6\u30ad\u30b9\u30c8",nameEn:"Error text",defaultJa:"\u518d\u5165\u8377\u901a\u77e5\u306e\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u3057\u3070\u3089\u304f\u305f\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002",defaultEn:"Failed to register restock notification. Please try again later."},{type:"colorpicker",slug:"error_background_color",nameJa:"\u30a8\u30e9\u30fc\u6642\u306e\u80cc\u666f\u8272",nameEn:"Error background color",default:"#FEF2F2"},{type:"colorpicker",slug:"error_text_color",nameJa:"\u30a8\u30e9\u30fc\u6642\u306e\u6587\u5b57\u8272",nameEn:"Error text color",default:"#991B1B"},{type:"range",slug:"popup_radius",nameJa:"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306e\u4e38\u307f",nameEn:"Popup border radius",default:10,min:0,max:20,step:1}]}},932(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;n(600)})();