/*! For license information please see sdk.js.LICENSE */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("liff",[],t):"object"==typeof exports?exports.liff=t():e.liff=t()}(window,(function(){return function(e){function t(t){for(var n,i,o=t[0],s=t[1],a=0,u=[];a>>t|e<<32-t}for(var r,i,o=Math.pow,s=o(2,32),a="",c=[],u=8*t.length,l=e.h=e.h||[],f=e.k=e.k||[],d=f.length,h={},p=2;d<64;p++)if(!h[p]){for(r=0;r<313;r+=p)h[r]=p;l[d]=o(p,.5)*s|0,f[d++]=o(p,1/3)*s|0}for(t+="€";t.length%64-56;)t+="\0";for(r=0;r>8)return;c[r>>2]|=i<<(3-r)%4*8}for(c[c.length]=u/s|0,c[c.length]=u,i=0;i>>3)+y[r-7]+(n(m,17)^n(m,19)^m>>>10)|0);(l=[_+((n(b,2)^n(b,13)^n(b,22))+(b&l[1]^b&l[2]^l[1]&l[2]))|0].concat(l))[4]=l[4]+_|0}for(r=0;r<8;r++)l[r]=l[r]+v[r]|0}for(r=0;r<8;r++)for(i=3;i+1;i--){var T=l[r]>>8*i&255;a+=(T<16?0:"")+T.toString(16)}return a};return e.code='var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\\x80";b[h]%64-56;)b+="\\x00";for(d=0;d>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;ed;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i};',e})?r.apply(t,i):r)||(e.exports=o)},function(e,t,n){(function(t){var r=n(10),i="production",o=t.env.PORT||8080,s=t.env.CIRCLE_BRANCH||"",a=r.version.match(/\d+/g)[0],c=t.env.SERVER_END_POINT||"line.me",u=t.env.LIFF_END_POINT||null,l=t.env.CDN||"https://static.line-scdn.net/liff/edge/"+a+"/";e.exports={CDN:l,ENV:i,PORT:o,SERVER_END_POINT:c,LIFF_END_POINT:u,VERSION:r.version,IOS_HOMESCREEN_SHORTCUT_URL:"https://line.me/channel/shortcut",SHARE_TARGET_PICKER_SCHEME_URL:"line://picker",BRANCH:s}}).call(this,n(4))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(8),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var t=n(5),r=n(0),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();"Promise"in i?i.Promise.prototype.finally||(i.Promise.prototype.finally=r.a):i.Promise=t.a}).call(this,n(3))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,s,a,c=1,u={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=9.5.0","nodemon":"^2.0.2","prettier":"^1.19.1","qs":"^6.9.1","request":"^2.88.0","request-promise":"^4.2.5","serve-handler":"^6.1.2","shelljs":"^0.8.3","terser-webpack-plugin":"^2.3.1","ts-loader":"^6.2.1","tslib":"^1.9.3","typescript":"^3.7.4","vconsole":"^3.3.4","vue":"^2.6.11","vue-loader":"^15.8.1","vue-style-loader":"^4.1.2","vue-template-compiler":"^2.6.11","webpack":"^4.41.4","webpack-bundle-analyzer":"^3.6.0","webpack-cli":"^3.3.10"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.ts":["prettier --write","eslint --fix","git add"],"*.test.js":["prettier --write","eslint --fix","git add"]}}')},function(e,t,n){"use strict";n.r(t);var r={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function d(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=f(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];m.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})};var g=self.DOMException;try{new g}catch($t){(g=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),g.prototype.constructor=g}function _(e,t){return new Promise((function(n,i){var o=new v(e,t);if(o.signal&&o.signal.aborted)return i(new g("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new m(i,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new g("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",a)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=u,self.Request=v,self.Response=m);n(7);var T=function(e,t){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function E(e,t){function n(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k,I=function(){return(I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?1:-1}return 0}function C(){var e=navigator.userAgent.match(/Line\/\d+(\.\d+)*/i);return e?e[0].slice(5):null}var x,N="UNAUTHORIZED",j="INVALID_ARGUMENT",D="INIT_FAILED",R="FORBIDDEN",L="INVALID_CONFIG",M="INVALID_ID_TOKEN",F="CREATE_SUBWINDOW_FAILED",U="EXCEPTION_IN_SUBWINDOW",B="liffEvent",H="LIFF_STORE",W={ACCESS_TOKEN:"accessToken",ID_TOKEN:"IDToken",DECODED_ID_TOKEN:"decodedIDToken",FEATURE_TOKEN:"featureToken",FEATURES:"features",LOGIN_TMP:"loginTmp",CONFIG:"config",CONTEXT:"context",EXPIRES:"expires",RAW_CONTEXT:"rawContext",CLIENT_ID:"clientId"},K="isInClient";!function(e){e.NONE="none",e.HASH="hash",e.HISTORY="history"}(x||(x={}));var V=["context_token","feature_token","access_token","id_token","client_id"],q=5;var z=null,G="1",J="0";function X(){var e;return null===z&&(void 0===e&&(e=window.navigator.userAgent),z=/Line\/\d+\.\d+\.\d+ LIFF/.test(e)||function(e){return void 0===e&&(e=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(e)}()&&/[\#|\&]access_token=/.test(location.hash)||sessionStorage.getItem(H+":"+K)===G,sessionStorage.setItem(H+":"+K,z?G:J)),!!z}var Y=new Set(["400","401","403","404","429","500"]),$=function(e){function t(t,n){var r=e.call(this,n)||this;return r.code=t,r}return E(t,e),t}(Error);function Q(e,t){return new $(e,t||"")}function Z(e){return function(e,t){if(!t)throw Q(L,"liffId is necessary for liff.init()");var n=(X()?sessionStorage:localStorage).getItem(H+":"+t+":"+e);try{return null===n?null:JSON.parse(n)}catch(r){return null}}(e,oe().liffId)}function ee(e,t){var n=oe().liffId;if(!n)throw Q(L,"liffId is necessary for liff.init()");(X()?sessionStorage:localStorage).setItem(H+":"+n+":"+e,JSON.stringify(t))}function te(e){var t=oe().liffId;if(!t)throw Q(L,"liffId is necessary for liff.init()");(X()?sessionStorage:localStorage).removeItem(H+":"+t+":"+e)}var ne={set:function(e,t,n){var r=e+"="+t;if(n)for(var i in n){r+="; "+i+(n[i]?"="+n[i]:"")}document.cookie=r},get:function(e){var t=new RegExp("(?:(?:^|.*;\\s*)"+e+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(t,"$1")},remove:function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(t)for(var r in t)n+="; "+r+"="+t[r];document.cookie=n}},re={get:Z,set:ee,remove:te,clean:function(){var e;Object.keys(W).forEach((function(e){te(W[e])})),e=oe(),ne.remove(H+":"+W.EXPIRES+":"+e.liffId,{path:"/"})}},ie={};function oe(){return ie}var se=[];function ae(){return se}function ce(e){se=e}function ue(){return Z(W.LOGIN_TMP)}function le(){te(W.LOGIN_TMP)}function fe(){return Z(W.ACCESS_TOKEN)}function de(e){ee(W.ACCESS_TOKEN,e)}var he=function(){return Z(W.RAW_CONTEXT)},pe=function(){return Z(W.CLIENT_ID)};function ye(){return Z(W.ID_TOKEN)}function ve(e){ee(W.ID_TOKEN,e)}function we(){return Z(W.DECODED_ID_TOKEN)}function me(e){ee(W.DECODED_ID_TOKEN,e)}function be(){return Z(W.FEATURE_TOKEN)}function ge(){return Z(W.CONTEXT)}function _e(e){ee(W.CONTEXT,e)}function Te(){return!!fe()}function Ee(){var e;return!(e=oe(),ne.get(H+":"+W.EXPIRES+":"+e.liffId))}function ke(){re.clean()}function Ie(e){return Object.keys(e).map((function(t){var n=e[t],r=function(e){return void 0!==e?encodeURIComponent(t)+"="+encodeURIComponent(e):encodeURIComponent(t)};return Array.isArray(n)?n.map((function(e){return r(e)})).join("&"):r(n)})).join("&")}var Oe={parse:function(e){return e.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(e){return e.length>0})).reduce((function(e,t){var n=t.split("=").map(decodeURIComponent),r=n[0],i=n[1],o=e[r];return Array.isArray(o)?o.push(i):e.hasOwnProperty(r)?e[r]=[o,i]:e[r]=i,e}),{})},stringify:Ie},Pe="",Ae=function(){var e=ge();if(!e)throw Q(D,"Could not get Context from server.");if(!e.endpointUrl)throw Q(D,"Could not get endpointUrl from server.");if(!e.permanentLinkPattern)throw Q(D,"Could not get permanentLinkPattern from server.");return e},Se=function(e){var t=Ae(),n=decodeURIComponent(e),r=new URL(t.endpointUrl),i=r.origin,o=r.pathname,s=r.search,a=t.permanentLinkPattern,c=n.indexOf("?"),u=n.indexOf("#",c+1),l=n.substring(0,c>=0?c:u>=0?u:n.length),f=u>0?"#"+n.substring(u+1):"",d=c>-1?n.substring(c+1,u<0?void 0:u):"";return"replace"===a?l||d||f?""+window.location.origin+l+(d?"?"+d:"")+f:window.location.href:(l.length>0&&("/"===l?l="":n.startsWith("/")||(l="/"+l)),n=d?l+"?"+(s?s.substring(1)+"&":"")+d+f:""+l+s+f,""+i+(o.endsWith("/")?o.substring(0,o.length-1):o)+n)};var Ce=n(1),xe=n.n(Ce);function Ne(e){return(t=xe()(e),n="",t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(e){n+=String.fromCharCode(parseInt(e))})),window.btoa(n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");var t,n}var je="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function De(e){for(var t="",n=0;n=0&&n.splice(r,1)}}var Ke=function(e){return Object.entries(e).map((function(e){var t=e[0],n=e[1];return encodeURIComponent(t)+"="+encodeURIComponent(function(t){if("object"==typeof t)try{return JSON.stringify(t)}catch(e){return""+t}return""+t}(n))})).join("&")},Ve=function(e,t){var n=!1,r=document.createElement("img");if(r.width=1,r.height=1,"function"==typeof t){var i=function(){n||(t(r),n=!0)};r.onload=i,setTimeout(i,1500)}r.src="https://torimochi.line-apps.com/1/req?"+Ke(e)};var qe=function(e){return e.replace(/-/g,"+").replace(/_/g,"/")};function ze(e){var t=e.split(".");if(t[1])try{var n=qe(t[1]);return JSON.parse(window.atob(n))}catch(r){return null}return null}function Ge(e){return window.atob(e.replace(/\-/g,"+").replace(/_/g,"/"))}function Je(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i1?(d="potential abuser",p={cid:"liff",eventType:"debug",timestamp:Date.now(),logVersion:"1.6.9",threshold:0,productKey:"liff-real",productVersion:"latest",url:location.href,host:location.hostname,path:location.pathname,query:location.search,hash:location.hash,referrer:document.referrer,userId:"liff",sessionId:"none",sessionPath:"",sessionQuery:"",sessionTime:"0",sessionDuration:"0",sessionParams:{},touchX:"0",touchY:"0",scrollX:"0",scrollY:"0",windowX:"0",windowY:"0",targets:[],content:{debug:{message:d}}},Ve(p,h)):(f=o,ee(W.FEATURE_TOKEN,f),de(r))}return s&&!ye()&&ve(s),s&&a&&!we()?[4,at(s,a)]:[3,3];case 2:(u=l.sent())&&me(u),l.label=3;case 3:return[2]}var f,d,h,p}))}))}function ft(e){return O(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return P(this,(function(c){switch(c.label){case 0:return t=Me("apps"),n=t+"/"+e+"/contextToken",r=fe(),i={"Content-Type":"application/json",Accept:"application/json"},r&&(i.Authorization="Bearer "+r),[4,Ye(n,{headers:i})];case 1:if(o=c.sent(),!(s=o.contextToken))throw Q(D,"Can not get context from server.");if(!(a=ze(s)))throw Q(D,"Invalid context token.");return[2,a]}}))}))}function dt(){return O(this,void 0,void 0,(function(){var e;return P(this,(function(t){switch(t.label){case 0:if(!(e=oe().liffId))throw Q(D,"Invalid LIFF ID.");return[4,ft(e)];case 1:return _e(t.sent()),[2]}}))}))}function ht(e){return O(this,void 0,void 0,(function(){var t,n,r,i=this;return P(this,(function(o){switch(o.label){case 0:t=function(){return O(i,void 0,void 0,(function(){var t,n,r,i,o;return P(this,(function(s){switch(s.label){case 0:return[4,(a=oe(),c=Oe.parse(window.location.search),u=ue(),l={grant_type:"authorization_code",client_id:c.liffClientId,appId:a.liffId,code:c.code,code_verifier:u.codeVerifier,redirect_uri:a.redirectUri||c.liffRedirectUri,id_token_key_type:"JWK"},f=Oe.stringify(l),Ye(Me("token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:f}))];case 1:return t=s.sent(),n=t.access_token,r=t.id_token,i=t.expires_in,de(n),function(e){var t=oe();ne.set(H+":"+W.EXPIRES+":"+t.liffId,e.getTime(),{expires:e.toUTCString(),path:"/",secure:null})}(new Date(Date.now()+1e3*i)),le(),r?(ve(r),[4,at(r,e)]):[3,3];case 2:(o=s.sent())&&me(o),s.label=3;case 3:return[4,dt()];case 4:return s.sent(),[2]}var a,c,u,l,f}))}))},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t()];case 2:return o.sent(),[3,4];case 3:throw n=o.sent(),r=n,le(),r;case 4:return[2]}}))}))}function pt(e){return O(this,void 0,void 0,(function(){var t;return P(this,(function(n){switch(n.label){case 0:if(!e.liffId)throw Q(L,"liffId is necessary for liff.init()");return ie=e,t=Oe.parse(window.location.search),s=t.code,a=ue(),Boolean(s&&!Te()&&a&&a.codeVerifier)?[4,ht(t.liffClientId)]:[3,2];case 1:return[2,n.sent()];case 2:if(t.error&&t.liffOAuth2Error)throw r=t.error,i=t.error_description,o=i.replace(/\+/g," "),Q(D,r+": "+o);return X()?[4,lt(e)]:[3,4];case 3:n.sent(),n.label=4;case 4:return Te()?[3,6]:[4,dt()];case 5:n.sent(),n.label=6;case 6:return t["liff.state"]&&function(e){try{var t=location.href,n=Se(e);n!==t&&location.replace(n)}catch(r){if(r.code===D)throw r}}(t["liff.state"]),X()||!Te()?[2]:Ee()?(ke(),[2]):[2,dt()]}var r,i,o,s,a}))}))}var yt=new Promise((function(e){ct=e}));function vt(){var e;return"ios"===A()?(e=C())&&S(e,"9.19.0")<0?"https://static.line-scdn.net/liff/edge/2/ios-918-extensions.js":"https://static.line-scdn.net/liff/edge/2/ios-extensions.js":"https://static.line-scdn.net/liff/edge/2/non-ios-extensions.js"}function wt(e,t,n){var r=this;return function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return[3,2];case 1:return[2,e.sent().default];case 2:return[2,new Promise((function(e,t){var n=document.createElement("script"),r=vt();n.onload=function(){var n=window.liffClientExtension;n?e(n):t(Q(D,"Unable to load client features. (Extension is empty)"))},n.onerror=function(){t(Q(D,"Unable to load client features."))},n.src=r,n.type="text/javascript",document.body.appendChild(n)}))]}}))}))}().then((function(t){return function(e){window&&!window.liff&&(window.liff=e)}(r),t.install(r),pt(e)})).then((function(){"function"==typeof t&&t(),ct()})).catch((function(e){return"function"==typeof n&&n(e),Promise.reject(e)}))}var mt=["shareTargetPicker"],bt={shareTargetPicker:function(){if(!Te())return!1;var e=ge();if(!e)return!1;var t=e.availability.shareTargetPicker,n=t.permission,r=t.minVer;if(!n)return!1;if(X()){var i=C();return null!==i&&S(i,r)>=0}return!0}},gt=function(e){if(!mt.includes(e))throw Q(j,"Unexpected API name.");var t=bt[e];return!t||t()};n(9);function _t(e,t,n){void 0===t&&(t={}),void 0===n&&(n="");var r=be();if(!r)throw Q(R,"Invalid featureToken for client features");if(!window._liff||!window._liff.postMessage)throw Q(j,"postMessage is not available from client");window._liff.postMessage(e,r,n,JSON.stringify(t))}function Tt(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={once:!0}),be()?(n=I({callbackId:De(12),once:!0},n),new Promise((function(r,i){var o=function(t){if(t&&t.detail){var s=t.detail.callbackId===n.callbackId,a="string"!=typeof t.detail.callbackId;(s||a)&&(n.once&&We(e,o),t.detail.error?i(t.detail.error):t.detail.data?r(t.detail.data):i(t.detail))}i()};He(e,o),_t(e,t,n.callbackId)}))):Promise.reject(Q(R,"Invalid featureToken for client features"))}var Et,kt=function(e,t){var n=e.split("?"),r=n[0],i=n[1],o=(void 0===i?"":i).split("#"),s=o[0],a=o[1];return r+"?is_liff_external_open_window="+!!t+(s?"&"+s.split("&").map(decodeURIComponent).filter((function(e){return-1===e.indexOf("is_liff_external_open_window")})).join("&").concat(a?"#"+a:""):"")};!function(e){e.none="none",e.ott="ott"}(Et||(Et={}));var It=function(e){return"object"==typeof e&&null!==e&&function(e){return"string"==typeof e||e instanceof String}(e.type)},Ot=function(e){return Array.isArray(e)&&e.every(It)},Pt=function(e){return Boolean(e&&e.type!==Et.none)},At=function(e){return e.type===Et.ott&&Boolean(e.token&&0!==e.token.length)},St=5;function Ct(e){return Promise.reject(Q(j,e))}function xt(e,t){var n=Nt,r=t.split(".")[0];e.removeEventListener(r,n[t]),n[t]=null}var Nt={},jt=!1,Dt=!1;function Rt(e,t,n,r){jt||(Dt=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch($t){e=!1}return e}(),jt=!0);var i=t.split(".")[0];return new Promise((function(o){var s=function(i){o(i),n&&n(i),r&&r.once&&xt(e,t)};Nt[t]=s,e.addEventListener(i,s,!!Dt&&r)}))}var Lt=function(){function e(){this.listenKeyName="message.liff"}return e.prototype.init=function(e,t,n){var r=this;this.receiver=e,this.destination=t,this.destroy(),Rt(this.receiver,this.listenKeyName,(function(e){return O(r,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return e&&e.data&&e.data.name?[4,n(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.send=function(e,t){void 0===t&&(t={});var n=Me("userPickerDomain"),r={name:e,body:t};this.destination.postMessage(r,n)},e.prototype.destroy=function(){xt(this.receiver,this.listenKeyName)},e}(),Mt=function(){function e(e,t,n){void 0===n&&(n=window),this.url=e||"",this.uniqAttr="",this.accessToken=t,this.namespace=n,this.windowPostMessage=new Lt}return e.prototype.init=function(){return O(this,void 0,void 0,(function(){var e=this;return P(this,(function(t){switch(t.label){case 0:return[4,this.prepareWindow()];case 1:return t.sent(),this.windowPostMessage.init(this.namespace,this.postmessageDestination,this.postMessageCallback),this.pingHandler=setInterval((function(){e.windowPostMessage.send("ping")}),1e3),this.healthcheckHandler=setInterval((function(){e.postmessageDestination.closed&&e.resolve&&e.resolve(null)}),1e3),[2]}}))}))},e.prototype.start=function(){return O(this,void 0,void 0,(function(){var e=this;return P(this,(function(t){return[2,new Promise((function(t,n){e.resolve=t,e.reject=n}))]}))}))},e.prototype.destroy=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){return clearInterval(this.pingHandler),clearInterval(this.healthcheckHandler),this.breakWindow(),this.windowPostMessage.destroy(),[2]}))}))},e.prototype.postMessageCallback=function(e){return O(this,void 0,void 0,(function(){return P(this,(function(t){switch(e.data.name){case"ping":clearInterval(this.pingHandler),this.windowPostMessage.send("pong",{accessToken:this.accessToken});break;case"exception":this.destroy(),this.reject(e.data.body)}return[2]}))}))},e}(),Ft=function(){return"data-l-{0}".replace("{0}",De(6))};var Ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),Object.defineProperty(t.prototype,"postmessageDestination",{get:function(){return this.iframe.contentWindow},enumerable:!0,configurable:!0}),t.prototype.init=function(){return O(this,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return[4,e.prototype.init.call(this)];case 1:return t.sent(),[2]}}))}))},t.prototype.prepareWindow=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){return this.uniqAttr=function(e){void 0===e&&(e=window);for(var t,n=1;n<=100;n++){var r=Ft();if(t=r,!e.document.body.querySelector("["+t+"]"))return r}throw new Error("can't make a relavent name space for LIFF on HTML")}(),this.contentElm=this.prepareDom(),this.styleElm=this.prepareStyle(),this.changeBodyStyle(),this.namespace.document.body.appendChild(this.contentElm),this.namespace.document.head.appendChild(this.styleElm),[2]}))}))},t.prototype.breakWindow=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){return this.namespace.document.body.removeChild(this.contentElm),this.namespace.document.head.removeChild(this.styleElm),[2]}))}))},t.prototype.prepareDom=function(){var e=this.namespace.document.createElement("iframe");return e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.setAttribute("name","LIFF-iframe-"+this.uniqAttr),e.setAttribute("src",this.url),e.setAttribute("class","liff-iframe"),e.setAttribute(this.uniqAttr,""),this.iframe=e,e},t.prototype.prepareStyle=function(){return this.namespace.document.createElement("style")},t}(Mt);var Bt=function(e){var t=e.match(/^(https?:\/\/.*?)\//);return t&&t[1]||""},Ht=function(){return Bt(Me("userPicker"))},Wt=function(e){function t(t,n,r){void 0===r&&(r=window);var i=e.call(this,t,n,r)||this;return i.submittedData=!1,i.originalBodyStyle="",i.orgDocumentStyle="",i.originalBodyPos={x:0,y:0},i.postMessageCallback=i.postMessageCallback.bind(i),i}return E(t,e),t.prototype.init=function(t){return O(this,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return t!==x.HASH&&t!==x.HISTORY&&(t=x.NONE),this.routerMode=t,[4,e.prototype.init.call(this)];case 1:return n.sent(),[4,this.historyAdd()];case 2:return n.sent(),this.startWatchingHistoryChange(),[2]}}))}))},t.prototype.prepareDom=function(){var t=e.prototype.prepareDom.call(this),n=this.namespace.document.createElement("div");n.setAttribute("class","liff-wrap"),n.setAttribute(this.uniqAttr,"");var r=this.namespace.document.createElement("div");return r.setAttribute("class","liff-wrap_in isOpening"),r.setAttribute(this.uniqAttr,""),r.appendChild(t),n.appendChild(r),this.wrapperIn=r,n},t.prototype.prepareStyle=function(){var t,n,r=e.prototype.prepareStyle.call(this);return r.textContent=function e(t,n){void 0===n&&(n=!0);var r="";for(var i in t)"object"==typeof t[i]?(i.indexOf("@keyframes")>=0&&(n=!1),r+=i+"{"+e(t[i],n)+"}"):r+=i+":"+t[i]+(n?"!important":"")+";";return r}((t=this.uniqAttr,(n={})["["+t+"]"]={margin:0,padding:0,border:0,width:"100vw","font-size":"100%",font:"inherit","vertical-align":"baseline","box-size":"border-box",display:"block",position:"initial",all:"initial"},n[".liff-wrap["+t+"]"]={position:"relative","z-index":1e4},n[".liff-wrap_in["+t+"]"]={position:"fixed",width:"100vw",border:"none","overflow-x":"hidden","overflow-y":"auto",top:0,bottom:0,left:0,right:0,"z-index":1e4,"-webkit-overflow-scrolling":"touch","background-color":"white"},n[".liff-button-area["+t+"]"]={position:"fixed",bottom:0,left:0,right:0,padding:"8px 16px",background:"#ffffff","background-color":"white","z-index":10001,display:"flex","justify-content":"center"},n[".liff-button-area["+t+"] > button"]={flex:"0 1 100%",height:"45px","margin-right":"7.5px",border:"none","border-radius":"5px",color:"#6c7985","background-color":"#dee5ec","font-weight":600,"line-height":"20px","font-size":"16px","text-decoration":"none","word-break":"break-all","text-align":"center",opacity:0},n[".liff-button-area["+t+"] > button.liff-isDisp"]={transition:"opacity .4s ease-in",opacity:1},n[".liff-button-area["+t+"] > .liff-button-submit"]={color:"#ffffff","background-color":"#00b900"},n[".liff-button-area["+t+"] > button:disabled"]={color:"rgba(255,255,255, 0.5)",cursor:"initial"},n[".liff-button-area["+t+"] > button:last-of-type"]={"margin-right":0},n[".liff-wrap_in["+t+"].isOpening"]={animation:"fadein-"+t+" 0.4s forwards ease-out"},n[".liff-wrap_in["+t+"].isClosing"]={animation:"fadein-"+t+"reverse 0.4s forwards ease-in"},n[".liff-iframe["+t+"]"]={width:"100%",height:"100%",border:"none"},n["@keyframes fadein-"+t]={from:{opacity:0,transform:"translateY(100vh)"},to:{opacity:1,transform:"translateY(0)"}},n["@keyframes fadein-"+t+"reverse"]={from:{opacity:1,transform:"translateY(0)"},to:{opacity:0,transform:"translateY(100vh)"}},n)),r},t.prototype.cancel=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return this.resolve(null),[4,this.destroy()];case 1:return e.sent(),[2]}}))}))},t.prototype.submit=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return this.resolve(this.submittedData),[4,this.destroy()];case 1:return e.sent(),[2]}}))}))},t.prototype.destroy=function(){return O(this,void 0,void 0,(function(){var t=this;return P(this,(function(n){switch(n.label){case 0:return this.revertBodyStyle(),[4,new Promise((function(e){"onanimationend"in window?(t.wrapperIn.classList.remove("isOpening"),setTimeout((function(){t.wrapperIn.classList.add("isClosing"),Rt(t.wrapperIn,"animationend.iframe",void 0,{once:!0}).then(e),setTimeout((function(){xt(t.wrapperIn,"animationend.iframe"),e()}),480)}),0)):e()}))];case 1:return n.sent(),[4,e.prototype.destroy.call(this)];case 2:return n.sent(),[2]}}))}))},t.prototype.changeBodyStyle=function(){this.originalBodyPos.x=window.scrollX,this.originalBodyPos.y=window.scrollY,this.originalBodyStyle=this.namespace.document.body.style.cssText,this.orgDocumentStyle=this.namespace.document.documentElement.style.cssText,this.namespace.document.body.style.cssText=this.originalBodyStyle+"overflow:hidden!important;height: 100%!important;",this.namespace.document.documentElement.style.cssText="overflow:hidden!important;height: 100%!important;",Rt(this.namespace,"scroll.liff.iframe",(function(){window.scrollTo(0,0)}),{passive:!1})},t.prototype.revertBodyStyle=function(){this.namespace.document.body.style.cssText=this.originalBodyStyle,this.namespace.document.documentElement.style.cssText=this.orgDocumentStyle,window.scrollTo(this.originalBodyPos.x,this.originalBodyPos.y),xt(this.namespace,"scroll.liff.iframe")},t.prototype.filter=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&e[n]&&n.length&&(t[n]=e[n]);return t},t.prototype.postMessageCallback=function(t){return O(this,void 0,void 0,(function(){var n;return P(this,(function(r){switch(r.label){case 0:return this.allowPostMessageOrigin||(this.allowPostMessageOrigin=Ht()),t.origin!==this.allowPostMessageOrigin?[2]:[4,e.prototype.postMessageCallback.call(this,t)];case 1:switch(r.sent(),t.data.name){case"cancel":return[3,2];case"submit":return[3,6]}return[3,10];case 2:return this.routerMode!==x.NONE?[3,4]:[4,this.cancel()];case 3:return r.sent(),[3,5];case 4:this.namespace.history.back(),r.label=5;case 5:return[3,10];case 6:if(!((n=t.data)&&n.body&&n.body.token))throw new Error("submitted without data");return this.submittedData=n.body.token,this.routerMode!==x.NONE?[3,8]:[4,this.submit()];case 7:return r.sent(),[3,9];case 8:this.namespace.history.back(),r.label=9;case 9:return[3,10];case 10:return[2]}}))}))},t.prototype.historyAdd=function(){if(this.routerMode===x.NONE)return Promise.resolve();switch(this.routerMode){case x.HASH:return this.namespace.location.hash=Oe.stringify(I(I({},Oe.parse(this.namespace.location.hash)),{userpicker:!0})),new Promise((function(e){setTimeout(e,0)}));case x.HISTORY:return this.namespace.history.pushState({userpicker:!0},"liff userpicker",""),Promise.resolve()}},t.prototype.startWatchingHistoryChange=function(){var e=this,t=function(){return O(e,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return this.submittedData?[4,this.submit()]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,this.cancel()];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))};switch(this.routerMode){case x.HASH:Rt(this.namespace,"hashchange.liff.iframe",t,{once:!0});break;case x.HISTORY:Rt(this.namespace,"popstate.liff.iframe",t,{once:!0})}},t.prototype.historyRemove=function(){switch(this.routerMode){case x.HASH:xt(this.namespace,"hashchange.liff.iframe");var e=Oe.parse(window.location.hash);delete e.userpicker,window.location.hash=Oe.stringify(this.filter(e));break;case x.HISTORY:xt(this.namespace,"popstate.liff.iframe"),window.history.replaceState({userpicker:!1},"liff userpicker","")}},t}(Ut),Kt=function(e){function t(t,n,r){void 0===r&&(r=window);var i=e.call(this,t,n,r)||this;return i.submittedData=!1,i.postMessageCallback=i.postMessageCallback.bind(i),i}return E(t,e),t.prototype.init=function(){return O(this,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return[4,e.prototype.init.call(this)];case 1:return t.sent(),[2]}}))}))},t.prototype.cancel=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return this.resolve(null),[4,this.destroy()];case 1:return e.sent(),[2]}}))}))},t.prototype.submit=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return this.resolve(this.submittedData),[4,this.destroy()];case 1:return e.sent(),[2]}}))}))},t.prototype.destroy=function(){return O(this,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return[4,e.prototype.destroy.call(this)];case 1:return t.sent(),[2]}}))}))},t.prototype.postMessageCallback=function(t){return O(this,void 0,void 0,(function(){var n;return P(this,(function(r){switch(r.label){case 0:return this.allowPostMessageOrigin||(this.allowPostMessageOrigin=Ht()),t.origin!==this.allowPostMessageOrigin?[2]:[4,e.prototype.postMessageCallback.call(this,t)];case 1:switch(r.sent(),t.data.name){case"cancel":return[3,2];case"submit":return[3,4]}return[3,6];case 2:return[4,this.cancel()];case 3:return r.sent(),[3,6];case 4:if(!((n=t.data)&&n.body&&n.body.token))throw new Error("submitted without data");return this.submittedData=n.body.token,[4,this.submit()];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},t}(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),Object.defineProperty(t.prototype,"postmessageDestination",{get:function(){return this.windowProxy},enumerable:!0,configurable:!0}),t.prototype.init=function(){return O(this,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return[4,e.prototype.init.call(this)];case 1:return t.sent(),[2]}}))}))},t.prototype.prepareWindow=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){return this.windowProxy=window.open(this.url,"liffpopup","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"),[2]}))}))},t.prototype.breakWindow=function(){return O(this,void 0,void 0,(function(){return P(this,(function(e){return this.windowProxy.close(),[2]}))}))},t}(Mt));var Vt=n(2);function qt(e,t,n,r){if(void 0===n&&(n={}),"object"!=typeof e||!e.postMessage)throw Q(j,"target must be window object");if("string"!=typeof t)throw Q(j,"keyname must be string");if("object"!=typeof n)throw Q(j,"incorrect body format. It should be Object or Array comprised of Object");if(!r)throw Q(j,"serverEndPointUrl isn't passed. please fill up with proper url");if("development"!==Vt.ENV&&"*"===r)throw new Error("serverEndPointUrl doesn't allow to set '*'");var i={name:t,body:n};e.postMessage(i,r)}function zt(e,t){var n;Rt(window,"message."+(n="receivedHealthcheck"),function(e,t,n){return function(r){r.origin===n&&r.data.name===e&&t(r)}}(n,e,t))}var Gt=function(){function e(){this.payloadToShareTargetPicker=null,this.popupWindow=null,this.doesWaitForSubwindowResult=!1}return e.getInstance=function(){return e.instance?e.instance.reset():e.instance=new e,e.instance},e.prototype.init=function(e){return O(this,void 0,void 0,(function(){var t,n;return P(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.liffId=e.referrer.liffId,this.doesWaitForSubwindowResult=!(!e.options||!e.options.waitForSubwindowResult),this.allowPostMessageOrigin=this.initAllowPostMessageOrigin(),this.payloadToShareTargetPicker=this.buildPayloadToShareTargetPicker(e),window.AbortController&&(this.abortController=new window.AbortController),this.prepareAnotherWindow(),[4,this.initOtt()];case 1:return r.sent(),this.initListener(),this.openAnotherWindow(),this.doesWaitForSubwindowResult?[4,this.pollingShareResult()]:[3,3];case 2:return t=r.sent(),this.finalize(),[2,t];case 3:return[2];case 4:return[3,6];case 5:if(n=r.sent(),this.finalize(),"AbortError"!==n.name)throw n;return[3,6];case 6:return[2]}}))}))},e.prototype.resetAllVariables=function(){this.liffId="",this.allowPostMessageOrigin="",this.payloadToShareTargetPicker=null,this.ott="",this.popupWindow=null,this.timeoutIDForHealthCheck=null,this.abortController=null,this.internalError=null,this.doesWaitForSubwindowResult=!1},e.prototype.reset=function(){this.finalize(),this.resetAllVariables()},e.prototype.finalize=function(){var e,t;this.abortController&&this.abortController.abort(),X()||(e=this.timeoutIDForHealthCheck,t=this.popupWindow,xt(window,"message.receivedHealthcheck"),e&&clearTimeout(e),t&&!t.closed&&t.close())},e.prototype.buildPayloadToShareTargetPicker=function(e){return{messages:e.messages,referrer:e.referrer}},e.prototype.initAllowPostMessageOrigin=function(e){return void 0===e&&(e=Me("shareTargetPicker")),Bt(e)},e.prototype.initOtt=function(){return O(this,void 0,void 0,(function(){var e,t,n;return P(this,(function(r){switch(r.label){case 0:return this.abortController&&(e=this.abortController.signal),t=Me("shareTargetPickerOtt")+"?"+Ie({liffId:this.liffId}),n=this,[4,Ye(t,{method:"GET",signal:e}).then((function(e){return e.ott}))];case 1:return n.ott=r.sent(),[2]}}))}))},e.prototype.prepareAnotherWindow=function(){var e;X()||("ios"!==A()||(void 0===e&&(e=window.navigator.userAgent),/ipad/.test(e.toLowerCase()))?this.popupWindow=window.open("","liffpopup","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):this.popupWindow=window.open())},e.prototype.openAnotherWindow=function(){if(X()&&this.payloadToShareTargetPicker)e=this.liffId,t=this.ott,n=this.payloadToShareTargetPicker,r={liffId:e,ott:t,data:JSON.stringify(n)},location.href=Vt.SHARE_TARGET_PICKER_SCHEME_URL+"?"+Ie(r);else{if(this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),!this.popupWindow)throw Q(F);!function(e,t,n){var r={liffId:t,ott:n};e.location.href=Me("shareTargetPicker")+"?"+Ie(r)}(this.popupWindow,this.liffId,this.ott)}var e,t,n,r},e.prototype.initListener=function(){X()||zt(this.onReceivedHealthcheck.bind(this),this.allowPostMessageOrigin)},e.prototype.healthCheck=function(){return O(this,void 0,void 0,(function(){var e;return P(this,(function(t){switch(t.label){case 0:if(this.popupWindow&&!this.popupWindow.closed)return[3,7];if(!this.doesWaitForSubwindowResult)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.onCanceled()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.internalError=e,[3,4];case 4:return[3,6];case 5:this.finalize(),t.label=6;case 6:return[3,8];case 7:n=this.popupWindow,r=this.allowPostMessageOrigin,qt(n,"healthcheck",void 0,r),this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),t.label=8;case 8:return[2]}var n,r}))}))},e.prototype.onReceivedHealthcheck=function(){if(!this.popupWindow||!this.payloadToShareTargetPicker)throw Q(F);var e,t,n;e=this.popupWindow,t=this.payloadToShareTargetPicker,n=this.allowPostMessageOrigin,qt(e,"ready",t,n)},e.prototype.onCanceled=function(){return O(this,void 0,void 0,(function(){var e,t;return P(this,(function(n){switch(n.label){case 0:if(X()||!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},[4,Ye(Me("shareTargetPickerResult")+"?"+Ie(t),{method:"POST",signal:e,headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"result=CANCEL"})];case 1:return[2,"ok"===n.sent().status]}}))}))},e.prototype.getShareResult=function(){return O(this,void 0,void 0,(function(){var e,t;return P(this,(function(n){if(!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},[2,Ye(Me("shareTargetPickerResult")+"?"+Ie(t),{method:"GET",headers:{Accept:"application/json"},signal:e})]}))}))},e.isPollingTimeOut=function(e,t){return(t-e)/6e4>=10},e.prototype.pollingShareResult=function(){return O(this,void 0,void 0,(function(){var t,n;return P(this,(function(r){switch(r.label){case 0:t=Date.now(),r.label=1;case 1:if(e.isPollingTimeOut(t,Date.now()))return[3,4];if(this.internalError)throw this.internalError;return[4,this.getShareResult()];case 2:if((n=r.sent())&&n.result)switch(n.result){case"SUCCESS":return[2,{status:"success"}];case"CANCEL":return[2];case"FAILURE":default:throw new Error(n.resultDescription)}return[4,new Promise((function(e){setTimeout(e,500)}))];case 3:return r.sent(),[3,1];case 4:throw new Error("Timeout: not finished within 10min")}}))}))},e}(),Jt="10.11.0";var Xt={init:wt,getOS:A,getVersion:function(){return"2.3.0"},getLanguage:function(){return navigator.language},isInClient:X,isLoggedIn:Te,login:Fe,logout:ke,getAccessToken:fe,getIDToken:ye,getDecodedIDToken:we,getContext:ge,openWindow:function(e){if(!function(e){if(!e||"object"!=typeof e)return!1;var t=e,n=t.url,r=[typeof n,typeof t.external],i=r[1];return"string"===r[0]&&""!==n&&("undefined"===i||"boolean"===i)}(e))throw Q(j,"Invalid parameters for liff.openWindow()");if(X())if(window._liff.postMessage)Tt("openWindow",e);else{var t=e.url,n=e.external,r=void 0!==n&&n;window.open(kt(t,r))}else window.open(e.url,"_blank")},closeWindow:function(){window._liff&&window._liff.postMessage?Tt("closeWindow"):window.close()},getFeatures:ae,getFriendship:function(){return Ye(Me("friendship"))},checkFeature:function(e){return ae().indexOf(e)>-1},getAId:function(){return((ge()||{}).d||{}).aId},getProfilePlus:function(){return(ge()||{}).profilePlus},getIsVideoAutoPlay:function(){return((ge()||{}).d||{}).autoplay||!1},getLineVersion:C,isApiAvailable:gt,getProfile:function(){return Ye(Me("profile"))},sendMessages:function(e,t){if(!Ot(e))return Ct("Parameter 'messages' must be an array of { type, ... }");var n=e.length;return n<1||n>St?Ct("Number of messages should be in range 1 to "+St+"."):Pt(t)?At(t)?Ye(Me("messageOTT"),{method:"POST",body:JSON.stringify({token:t.token,messages:e})}):Ct("incorrect options"):Ye(Me("message"),{method:"POST",body:JSON.stringify({messages:e})})},userPicker:function(e){return void 0===e&&(e={routerMode:x.NONE}),O(this,void 0,void 0,(function(){var t,n,r,i,o;return P(this,(function(s){switch(s.label){case 0:if(t=Me("userPicker")+"?liffId="+oe().liffId,!Te())throw Q(N,"Need access_token for api call, Please login first");s.label=1;case 1:if(s.trys.push([1,6,,7]),!(r=fe()))throw new Error("AccessToken is empty");return"web"!==A()||function(e){void 0===e&&(e=window.navigator.userAgent);var t=e.toLowerCase();return-1!=t.indexOf("msie")||-1!=t.indexOf("trident")}()?[3,3]:[4,(n=new Kt(t,r,window)).init()];case 2:return s.sent(),[3,5];case 3:return[4,(n=new Wt(t,r,window)).init(e.routerMode)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:throw i=s.sent(),Q(F,i.message);case 7:return s.trys.push([7,9,,10]),[4,n.start()];case 8:return[2,s.sent()];case 9:throw o=s.sent(),Q(U,o.message);case 10:return[2]}}))}))},shareTargetPicker:function(e){return O(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,l;return P(this,(function(f){switch(f.label){case 0:if(t=(ge()||{}).availability,n=(t||{}).shareTargetPicker,i=(r=n||{}).permission,o=r.minVer,!i)throw X()?Q(R,"Need LINE App "+o+" at least or consent on shareTargetPicker usage on LINE developer site"):Q(R,"Need consent on shareTargetPicker usage on LINE developer site");if(!Te())throw Q(N,"Need access_token for api call, Please login first");if(!e||!Array.isArray(e)||0===e.length)throw Q(j,"no proper argument");if(e.length>q)throw Q(j,"exceed the limit of num of messages");if(!(s=oe().liffId))throw Q(L);f.label=1;case 1:return f.trys.push([1,3,,4]),a=Gt.getInstance(),c=C(),u={waitForSubwindowResult:!0},X()&&c&&S(c,Jt)<0&&(u.waitForSubwindowResult=!1),[4,a.init({messages:e,referrer:{liffId:s,url:location.origin},options:u})];case 2:return[2,f.sent()];case 3:throw(l=f.sent())instanceof $?l:Q(U,l.message);case 4:return[2]}}))}))},permanentLink:{createUrl:function(){var e=Ae(),t=window.location,n=t.pathname,r=t.search,i=t.hash,o=t.origin,s=new URL(e.endpointUrl);if(s.origin!==o||!function(e,t){return 0===t.indexOf(e)&&(e.endsWith("/")&&(e=e.substring(0,e.length-1)),void 0===t[e.length]||"/"===t[e.length])}(s.pathname,n))throw Q(L,"Current page is not under entrypoint.");var a=n.substring(s.pathname.length);a.length>0&&"/"!==a[0]&&(a="/"+a);for(var c=new RegExp("^"+V.join("|")),u=i.substring(1).split("&").filter((function(e){return!c.test(e)&&Boolean(e)})).join("&"),l=function(e){return e.substring(1).split("&").concat(Pe).filter((function(e){return!/liff\.state/.test(e)&&Boolean(e)})).map((function(e){return e.split("=")}))},f=l(r),d=l(s.search),h=!0,p=0;p