UNPKG

@nagwa-limited/kashida-engine

Version:

An engine to unify array of Arabic strings to the same width using Kashidas

2 lines 30.3 kB
!function(){var t={9662:function(t,n,r){var e=r(7854),o=r(614),i=r(6330),u=e.TypeError;t.exports=function(t){if(o(t))return t;throw u(i(t)+" is not a function")}},9483:function(t,n,r){var e=r(7854),o=r(4411),i=r(6330),u=e.TypeError;t.exports=function(t){if(o(t))return t;throw u(i(t)+" is not a constructor")}},6077:function(t,n,r){var e=r(7854),o=r(614),i=e.String,u=e.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw u("Can't set "+i(t)+" as a prototype")}},1223:function(t,n,r){var e=r(5112),o=r(30),i=r(3070),u=e("unscopables"),c=Array.prototype;null==c[u]&&i.f(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},1530:function(t,n,r){"use strict";var e=r(8710).charAt;t.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},9670:function(t,n,r){var e=r(7854),o=r(111),i=e.String,u=e.TypeError;t.exports=function(t){if(o(t))return t;throw u(i(t)+" is not an object")}},1318:function(t,n,r){var e=r(5656),o=r(1400),i=r(6244),u=function(t){return function(n,r,u){var c,a=e(n),f=i(a),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},4326:function(t,n,r){var e=r(1702),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:function(t,n,r){var e=r(7854),o=r(1694),i=r(614),u=r(4326),c=r(5112)("toStringTag"),a=e.Object,f="Arguments"==u(function(){return arguments}());t.exports=o?u:function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=a(t),c))?r:f?u(n):"Object"==(e=u(n))&&i(n.callee)?"Arguments":e}},9920:function(t,n,r){var e=r(2597),o=r(3887),i=r(1236),u=r(3070);t.exports=function(t,n,r){for(var c=o(n),a=u.f,f=i.f,s=0;s<c.length;s++){var l=c[s];e(t,l)||r&&e(r,l)||a(t,l,f(n,l))}}},8544:function(t,n,r){var e=r(7293);t.exports=!e((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:function(t,n,r){"use strict";var e=r(3383).IteratorPrototype,o=r(30),i=r(9114),u=r(8003),c=r(7497),a=function(){return this};t.exports=function(t,n,r,f){var s=n+" Iterator";return t.prototype=o(e,{next:i(+!f,r)}),u(t,s,!1,!0),c[s]=a,t}},8880:function(t,n,r){var e=r(9781),o=r(3070),i=r(9114);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},9114:function(t){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},654:function(t,n,r){"use strict";var e=r(2109),o=r(6916),i=r(1913),u=r(6530),c=r(614),a=r(4994),f=r(9518),s=r(7674),l=r(8003),p=r(8880),v=r(1320),g=r(5112),d=r(7497),x=r(3383),y=u.PROPER,h=u.CONFIGURABLE,b=x.IteratorPrototype,_=x.BUGGY_SAFARI_ITERATORS,m=g("iterator"),S="keys",w="values",O="entries",E=function(){return this};t.exports=function(t,n,r,u,g,x,T){a(r,n,u);var j,A,I,P=function(t){if(t===g&&k)return k;if(!_&&t in M)return M[t];switch(t){case S:case w:case O:return function(){return new r(this,t)}}return function(){return new r(this)}},R=n+" Iterator",L=!1,M=t.prototype,$=M[m]||M["@@iterator"]||g&&M[g],k=!_&&$||P(g),C="Array"==n&&M.entries||$;if(C&&(j=f(C.call(new t)))!==Object.prototype&&j.next&&(i||f(j)===b||(s?s(j,b):c(j[m])||v(j,m,E)),l(j,R,!0,!0),i&&(d[R]=E)),y&&g==w&&$&&$.name!==w&&(!i&&h?p(M,"name",w):(L=!0,k=function(){return o($,this)})),g)if(A={values:P(w),keys:x?k:P(S),entries:P(O)},T)for(I in A)(_||L||!(I in M))&&v(M,I,A[I]);else e({target:n,proto:!0,forced:_||L},A);return i&&!T||M[m]===k||v(M,m,k,{name:g}),d[n]=k,A}},9781:function(t,n,r){var e=r(7293);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(t,n,r){var e=r(7854),o=r(111),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(t,n,r){var e=r(317)("span").classList,o=e&&e.constructor&&e.constructor.prototype;t.exports=o===Object.prototype?void 0:o},8113:function(t,n,r){var e=r(5005);t.exports=e("navigator","userAgent")||""},7392:function(t,n,r){var e,o,i=r(7854),u=r(8113),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,n,r){var e=r(7854),o=r(1236).f,i=r(8880),u=r(1320),c=r(3505),a=r(9920),f=r(4705);t.exports=function(t,n){var r,s,l,p,v,g=t.target,d=t.global,x=t.stat;if(r=d?e:x?e[g]||c(g,{}):(e[g]||{}).prototype)for(s in n){if(p=n[s],l=t.noTargetGet?(v=o(r,s))&&v.value:r[s],!f(d?s:g+(x?".":"#")+s,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;a(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(r,s,p,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,n,r){"use strict";r(4916);var e=r(1702),o=r(1320),i=r(2261),u=r(7293),c=r(5112),a=r(8880),f=c("species"),s=RegExp.prototype;t.exports=function(t,n,r,l){var p=c(t),v=!u((function(){var n={};return n[p]=function(){return 7},7!=""[t](n)})),g=v&&!u((function(){var n=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[f]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return n=!0,null},r[p](""),!n}));if(!v||!g||r){var d=e(/./[p]),x=n(p,""[t],(function(t,n,r,o,u){var c=e(t),a=n.exec;return a===i||a===s.exec?v&&!u?{done:!0,value:d(n,r,o)}:{done:!0,value:c(r,n,o)}:{done:!1}}));o(String.prototype,t,x[0]),o(s,p,x[1])}l&&a(s[p],"sham",!0)}},2104:function(t,n,r){var e=r(4374),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?u.bind(i):function(){return u.apply(i,arguments)})},4374:function(t,n,r){var e=r(7293);t.exports=!e((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,n,r){var e=r(4374),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(t,n,r){var e=r(9781),o=r(2597),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},1702:function(t,n,r){var e=r(4374),o=Function.prototype,i=o.bind,u=o.call,c=e&&i.bind(u,u);t.exports=e?function(t){return t&&c(t)}:function(t){return t&&function(){return u.apply(t,arguments)}}},5005:function(t,n,r){var e=r(7854),o=r(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t]):e[t]&&e[t][n]}},8173:function(t,n,r){var e=r(9662);t.exports=function(t,n){var r=t[n];return null==r?void 0:e(r)}},647:function(t,n,r){var e=r(1702),o=r(7908),i=Math.floor,u=e("".charAt),c=e("".replace),a=e("".slice),f=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,n,r,e,l,p){var v=r+t.length,g=e.length,d=s;return void 0!==l&&(l=o(l),d=f),c(p,d,(function(o,c){var f;switch(u(c,0)){case"$":return"$";case"&":return t;case"`":return a(n,0,r);case"'":return a(n,v);case"<":f=l[a(c,1,-1)];break;default:var s=+c;if(0===s)return o;if(s>g){var p=i(s/10);return 0===p?o:p<=g?void 0===e[p-1]?u(c,1):e[p-1]+u(c,1):o}f=e[s-1]}return void 0===f?"":f}))}},7854:function(t,n,r){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:function(t,n,r){var e=r(1702),o=r(7908),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},3501:function(t){t.exports={}},490:function(t,n,r){var e=r(5005);t.exports=e("document","documentElement")},4664:function(t,n,r){var e=r(9781),o=r(7293),i=r(317);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,n,r){var e=r(7854),o=r(1702),i=r(7293),u=r(4326),c=e.Object,a=o("".split);t.exports=i((function(){return!c("z").propertyIsEnumerable(0)}))?function(t){return"String"==u(t)?a(t,""):c(t)}:c},2788:function(t,n,r){var e=r(1702),o=r(614),i=r(5465),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},9909:function(t,n,r){var e,o,i,u=r(8536),c=r(7854),a=r(1702),f=r(111),s=r(8880),l=r(2597),p=r(5465),v=r(6200),g=r(3501),d="Object already initialized",x=c.TypeError,y=c.WeakMap;if(u||p.state){var h=p.state||(p.state=new y),b=a(h.get),_=a(h.has),m=a(h.set);e=function(t,n){if(_(h,t))throw new x(d);return n.facade=t,m(h,t,n),n},o=function(t){return b(h,t)||{}},i=function(t){return _(h,t)}}else{var S=v("state");g[S]=!0,e=function(t,n){if(l(t,S))throw new x(d);return n.facade=t,s(t,S,n),n},o=function(t){return l(t,S)?t[S]:{}},i=function(t){return l(t,S)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!f(n)||(r=o(n)).type!==t)throw x("Incompatible receiver, "+t+" required");return r}}}},614:function(t){t.exports=function(t){return"function"==typeof t}},4411:function(t,n,r){var e=r(1702),o=r(7293),i=r(614),u=r(648),c=r(5005),a=r(2788),f=function(){},s=[],l=c("Reflect","construct"),p=/^\s*(?:class|function)\b/,v=e(p.exec),g=!p.exec(f),d=function(t){if(!i(t))return!1;try{return l(f,s,t),!0}catch(t){return!1}},x=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return g||!!v(p,a(t))}catch(t){return!0}};x.sham=!0,t.exports=!l||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?x:d},4705:function(t,n,r){var e=r(7293),o=r(614),i=/#|\.prototype\./,u=function(t,n){var r=a[c(t)];return r==s||r!=f&&(o(n)?e(n):!!n)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},111:function(t,n,r){var e=r(614);t.exports=function(t){return"object"==typeof t?null!==t:e(t)}},1913:function(t){t.exports=!1},7850:function(t,n,r){var e=r(111),o=r(4326),i=r(5112)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},2190:function(t,n,r){var e=r(7854),o=r(5005),i=r(614),u=r(7976),c=r(3307),a=e.Object;t.exports=c?function(t){return"symbol"==typeof t}:function(t){var n=o("Symbol");return i(n)&&u(n.prototype,a(t))}},3383:function(t,n,r){"use strict";var e,o,i,u=r(7293),c=r(614),a=r(30),f=r(9518),s=r(1320),l=r(5112),p=r(1913),v=l("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(o=f(f(i)))!==Object.prototype&&(e=o):g=!0),null==e||u((function(){var t={};return e[v].call(t)!==t}))?e={}:p&&(e=a(e)),c(e[v])||s(e,v,(function(){return this})),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:g}},7497:function(t){t.exports={}},6244:function(t,n,r){var e=r(7466);t.exports=function(t){return e(t.length)}},133:function(t,n,r){var e=r(7392),o=r(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))},8536:function(t,n,r){var e=r(7854),o=r(614),i=r(2788),u=e.WeakMap;t.exports=o(u)&&/native code/.test(i(u))},30:function(t,n,r){var e,o=r(9670),i=r(6048),u=r(748),c=r(3501),a=r(490),f=r(317),s=r(6200),l=s("IE_PROTO"),p=function(){},v=function(t){return"<script>"+t+"</"+"script>"},g=function(t){t.write(v("")),t.close();var n=t.parentWindow.Object;return t=null,n},d=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,n;d="undefined"!=typeof document?document.domain&&e?g(e):((n=f("iframe")).style.display="none",a.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F):g(e);for(var r=u.length;r--;)delete d.prototype[u[r]];return d()};c[l]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(p.prototype=o(t),r=new p,p.prototype=null,r[l]=t):r=d(),void 0===n?r:i.f(r,n)}},6048:function(t,n,r){var e=r(9781),o=r(3353),i=r(3070),u=r(9670),c=r(5656),a=r(1956);n.f=e&&!o?Object.defineProperties:function(t,n){u(t);for(var r,e=c(n),o=a(n),f=o.length,s=0;f>s;)i.f(t,r=o[s++],e[r]);return t}},3070:function(t,n,r){var e=r(7854),o=r(9781),i=r(4664),u=r(3353),c=r(9670),a=r(4948),f=e.TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p="enumerable",v="configurable",g="writable";n.f=o?u?function(t,n,r){if(c(t),n=a(n),c(r),"function"==typeof t&&"prototype"===n&&"value"in r&&g in r&&!r.writable){var e=l(t,n);e&&e.writable&&(t[n]=r.value,r={configurable:v in r?r.configurable:e.configurable,enumerable:p in r?r.enumerable:e.enumerable,writable:!1})}return s(t,n,r)}:s:function(t,n,r){if(c(t),n=a(n),c(r),i)try{return s(t,n,r)}catch(t){}if("get"in r||"set"in r)throw f("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},1236:function(t,n,r){var e=r(9781),o=r(6916),i=r(5296),u=r(9114),c=r(5656),a=r(4948),f=r(2597),s=r(4664),l=Object.getOwnPropertyDescriptor;n.f=e?l:function(t,n){if(t=c(t),n=a(n),s)try{return l(t,n)}catch(t){}if(f(t,n))return u(!o(i.f,t,n),t[n])}},8006:function(t,n,r){var e=r(6324),o=r(748).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},5181:function(t,n){n.f=Object.getOwnPropertySymbols},9518:function(t,n,r){var e=r(7854),o=r(2597),i=r(614),u=r(7908),c=r(6200),a=r(8544),f=c("IE_PROTO"),s=e.Object,l=s.prototype;t.exports=a?s.getPrototypeOf:function(t){var n=u(t);if(o(n,f))return n[f];var r=n.constructor;return i(r)&&n instanceof r?r.prototype:n instanceof s?l:null}},7976:function(t,n,r){var e=r(1702);t.exports=e({}.isPrototypeOf)},6324:function(t,n,r){var e=r(1702),o=r(2597),i=r(5656),u=r(1318).indexOf,c=r(3501),a=e([].push);t.exports=function(t,n){var r,e=i(t),f=0,s=[];for(r in e)!o(c,r)&&o(e,r)&&a(s,r);for(;n.length>f;)o(e,r=n[f++])&&(~u(s,r)||a(s,r));return s}},1956:function(t,n,r){var e=r(6324),o=r(748);t.exports=Object.keys||function(t){return e(t,o)}},5296:function(t,n){"use strict";var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!r.call({1:2},1);n.f=o?function(t){var n=e(this,t);return!!n&&n.enumerable}:r},7674:function(t,n,r){var e=r(1702),o=r(9670),i=r(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{(t=e(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),n=r instanceof Array}catch(t){}return function(r,e){return o(r),i(e),n?t(r,e):r.__proto__=e,r}}():void 0)},2140:function(t,n,r){var e=r(7854),o=r(6916),i=r(614),u=r(111),c=e.TypeError;t.exports=function(t,n){var r,e;if("string"===n&&i(r=t.toString)&&!u(e=o(r,t)))return e;if(i(r=t.valueOf)&&!u(e=o(r,t)))return e;if("string"!==n&&i(r=t.toString)&&!u(e=o(r,t)))return e;throw c("Can't convert object to primitive value")}},3887:function(t,n,r){var e=r(5005),o=r(1702),i=r(8006),u=r(5181),c=r(9670),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?a(n,r(t)):n}},1320:function(t,n,r){var e=r(7854),o=r(614),i=r(2597),u=r(8880),c=r(3505),a=r(2788),f=r(9909),s=r(6530).CONFIGURABLE,l=f.get,p=f.enforce,v=String(String).split("String");(t.exports=function(t,n,r,a){var f,l=!!a&&!!a.unsafe,g=!!a&&!!a.enumerable,d=!!a&&!!a.noTargetGet,x=a&&void 0!==a.name?a.name:n;o(r)&&("Symbol("===String(x).slice(0,7)&&(x="["+String(x).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(r,"name")||s&&r.name!==x)&&u(r,"name",x),(f=p(r)).source||(f.source=v.join("string"==typeof x?x:""))),t!==e?(l?!d&&t[n]&&(g=!0):delete t[n],g?t[n]=r:u(t,n,r)):g?t[n]=r:c(n,r)})(Function.prototype,"toString",(function(){return o(this)&&l(this).source||a(this)}))},7651:function(t,n,r){var e=r(7854),o=r(6916),i=r(9670),u=r(614),c=r(4326),a=r(2261),f=e.TypeError;t.exports=function(t,n){var r=t.exec;if(u(r)){var e=o(r,t,n);return null!==e&&i(e),e}if("RegExp"===c(t))return o(a,t,n);throw f("RegExp#exec called on incompatible receiver")}},2261:function(t,n,r){"use strict";var e,o,i=r(6916),u=r(1702),c=r(1340),a=r(7066),f=r(2999),s=r(2309),l=r(30),p=r(9909).get,v=r(9441),g=r(7168),d=s("native-string-replace",String.prototype.replace),x=RegExp.prototype.exec,y=x,h=u("".charAt),b=u("".indexOf),_=u("".replace),m=u("".slice),S=(o=/b*/g,i(x,e=/a/,"a"),i(x,o,"a"),0!==e.lastIndex||0!==o.lastIndex),w=f.BROKEN_CARET,O=void 0!==/()??/.exec("")[1];(S||O||w||v||g)&&(y=function(t){var n,r,e,o,u,f,s,v=this,g=p(v),E=c(t),T=g.raw;if(T)return T.lastIndex=v.lastIndex,n=i(y,T,E),v.lastIndex=T.lastIndex,n;var j=g.groups,A=w&&v.sticky,I=i(a,v),P=v.source,R=0,L=E;if(A&&(I=_(I,"y",""),-1===b(I,"g")&&(I+="g"),L=m(E,v.lastIndex),v.lastIndex>0&&(!v.multiline||v.multiline&&"\n"!==h(E,v.lastIndex-1))&&(P="(?: "+P+")",L=" "+L,R++),r=new RegExp("^(?:"+P+")",I)),O&&(r=new RegExp("^"+P+"$(?!\\s)",I)),S&&(e=v.lastIndex),o=i(x,A?r:v,L),A?o?(o.input=m(o.input,R),o[0]=m(o[0],R),o.index=v.lastIndex,v.lastIndex+=o[0].length):v.lastIndex=0:S&&o&&(v.lastIndex=v.global?o.index+o[0].length:e),O&&o&&o.length>1&&i(d,o[0],r,(function(){for(u=1;u<arguments.length-2;u++)void 0===arguments[u]&&(o[u]=void 0)})),o&&j)for(o.groups=f=l(null),u=0;u<j.length;u++)f[(s=j[u])[0]]=o[s[1]];return o}),t.exports=y},7066:function(t,n,r){"use strict";var e=r(9670);t.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},2999:function(t,n,r){var e=r(7293),o=r(7854).RegExp,i=e((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),u=i||e((function(){return!o("a","y").sticky})),c=i||e((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:c,MISSED_STICKY:u,UNSUPPORTED_Y:i}},9441:function(t,n,r){var e=r(7293),o=r(7854).RegExp;t.exports=e((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},7168:function(t,n,r){var e=r(7293),o=r(7854).RegExp;t.exports=e((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:function(t,n,r){var e=r(7854).TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},3505:function(t,n,r){var e=r(7854),o=Object.defineProperty;t.exports=function(t,n){try{o(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}},8003:function(t,n,r){var e=r(3070).f,o=r(2597),i=r(5112)("toStringTag");t.exports=function(t,n,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:n})}},6200:function(t,n,r){var e=r(2309),o=r(9711),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:function(t,n,r){var e=r(7854),o=r(3505),i="__core-js_shared__",u=e[i]||o(i,{});t.exports=u},2309:function(t,n,r){var e=r(1913),o=r(5465);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.21.1",mode:e?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(t,n,r){var e=r(9670),o=r(9483),i=r(5112)("species");t.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||null==(r=e(u)[i])?n:o(r)}},8710:function(t,n,r){var e=r(1702),o=r(9303),i=r(1340),u=r(4488),c=e("".charAt),a=e("".charCodeAt),f=e("".slice),s=function(t){return function(n,r){var e,s,l=i(u(n)),p=o(r),v=l.length;return p<0||p>=v?t?"":void 0:(e=a(l,p))<55296||e>56319||p+1===v||(s=a(l,p+1))<56320||s>57343?t?c(l,p):e:t?f(l,p,p+2):s-56320+(e-55296<<10)+65536}};t.exports={codeAt:s(!1),charAt:s(!0)}},1400:function(t,n,r){var e=r(9303),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},5656:function(t,n,r){var e=r(8361),o=r(4488);t.exports=function(t){return e(o(t))}},9303:function(t){var n=Math.ceil,r=Math.floor;t.exports=function(t){var e=+t;return e!=e||0===e?0:(e>0?r:n)(e)}},7466:function(t,n,r){var e=r(9303),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},7908:function(t,n,r){var e=r(7854),o=r(4488),i=e.Object;t.exports=function(t){return i(o(t))}},7593:function(t,n,r){var e=r(7854),o=r(6916),i=r(111),u=r(2190),c=r(8173),a=r(2140),f=r(5112),s=e.TypeError,l=f("toPrimitive");t.exports=function(t,n){if(!i(t)||u(t))return t;var r,e=c(t,l);if(e){if(void 0===n&&(n="default"),r=o(e,t,n),!i(r)||u(r))return r;throw s("Can't convert object to primitive value")}return void 0===n&&(n="number"),a(t,n)}},4948:function(t,n,r){var e=r(7593),o=r(2190);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},1694:function(t,n,r){var e={};e[r(5112)("toStringTag")]="z",t.exports="[object z]"===String(e)},1340:function(t,n,r){var e=r(7854),o=r(648),i=e.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},6330:function(t,n,r){var e=r(7854).String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:function(t,n,r){var e=r(1702),o=0,i=Math.random(),u=e(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},3307:function(t,n,r){var e=r(133);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,n,r){var e=r(9781),o=r(7293);t.exports=e&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:function(t,n,r){var e=r(7854),o=r(2309),i=r(2597),u=r(9711),c=r(133),a=r(3307),f=o("wks"),s=e.Symbol,l=s&&s.for,p=a?s:s&&s.withoutSetter||u;t.exports=function(t){if(!i(f,t)||!c&&"string"!=typeof f[t]){var n="Symbol."+t;c&&i(s,t)?f[t]=s[t]:f[t]=a&&l?l(n):p(n)}return f[t]}},6992:function(t,n,r){"use strict";var e=r(5656),o=r(1223),i=r(7497),u=r(9909),c=r(3070).f,a=r(654),f=r(1913),s=r(9781),l="Array Iterator",p=u.set,v=u.getterFor(l);t.exports=a(Array,"Array",(function(t,n){p(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var t=v(this),n=t.target,r=t.kind,e=t.index++;return!n||e>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:e,done:!1}:"values"==r?{value:n[e],done:!1}:{value:[e,n[e]],done:!1}}),"values");var g=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!f&&s&&"values"!==g.name)try{c(g,"name",{value:"values"})}catch(t){}},4916:function(t,n,r){"use strict";var e=r(2109),o=r(2261);e({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},6373:function(t,n,r){"use strict";var e=r(2109),o=r(7854),i=r(6916),u=r(1702),c=r(4994),a=r(4488),f=r(7466),s=r(1340),l=r(9670),p=r(4326),v=r(7976),g=r(7850),d=r(7066),x=r(8173),y=r(1320),h=r(7293),b=r(5112),_=r(6707),m=r(1530),S=r(7651),w=r(9909),O=r(1913),E=b("matchAll"),T="RegExp String",j="RegExp String Iterator",A=w.set,I=w.getterFor(j),P=RegExp.prototype,R=o.TypeError,L=u(d),M=u("".indexOf),$=u("".matchAll),k=!!$&&!h((function(){$("a",/./)})),C=c((function(t,n,r,e){A(this,{type:j,regexp:t,string:n,global:r,unicode:e,done:!1})}),T,(function(){var t=I(this);if(t.done)return{value:void 0,done:!0};var n=t.regexp,r=t.string,e=S(n,r);return null===e?{value:void 0,done:t.done=!0}:t.global?(""===s(e[0])&&(n.lastIndex=m(r,f(n.lastIndex),t.unicode)),{value:e,done:!1}):(t.done=!0,{value:e,done:!1})})),F=function(t){var n,r,e,o,i,u,c=l(this),a=s(t);return n=_(c,RegExp),void 0===(r=c.flags)&&v(P,c)&&!("flags"in P)&&(r=L(c)),e=void 0===r?"":s(r),o=new n(n===RegExp?c.source:c,e),i=!!~M(e,"g"),u=!!~M(e,"u"),o.lastIndex=f(c.lastIndex),new C(o,a,i,u)};e({target:"String",proto:!0,forced:k},{matchAll:function(t){var n,r,e,o,u=a(this);if(null!=t){if(g(t)&&(n=s(a("flags"in P?t.flags:L(t))),!~M(n,"g")))throw R("`.matchAll` does not allow non-global regexes");if(k)return $(u,t);if(void 0===(e=x(t,E))&&O&&"RegExp"==p(t)&&(e=F),e)return i(e,t,u)}else if(k)return $(u,t);return r=s(u),o=new RegExp(t,"g"),O?i(F,o,r):o[E](r)}}),O||E in P||y(P,E,F)},8757:function(t,n,r){"use strict";var e=r(2109),o=r(7854),i=r(6916),u=r(1702),c=r(4488),a=r(614),f=r(7850),s=r(1340),l=r(8173),p=r(7066),v=r(647),g=r(5112),d=r(1913),x=g("replace"),y=RegExp.prototype,h=o.TypeError,b=u(p),_=u("".indexOf),m=u("".replace),S=u("".slice),w=Math.max,O=function(t,n,r){return r>t.length?-1:""===n?r:_(t,n,r)};e({target:"String",proto:!0},{replaceAll:function(t,n){var r,e,o,u,p,g,E,T,j,A=c(this),I=0,P=0,R="";if(null!=t){if((r=f(t))&&(e=s(c("flags"in y?t.flags:b(t))),!~_(e,"g")))throw h("`.replaceAll` does not allow non-global regexes");if(o=l(t,x))return i(o,t,A,n);if(d&&r)return m(s(A),t,n)}for(u=s(A),p=s(t),(g=a(n))||(n=s(n)),E=p.length,T=w(1,E),I=O(u,p,0);-1!==I;)j=g?s(n(p,I,u)):v(p,u,I,[],void 0,n),R+=S(u,P,I)+j,P=I+E,I=O(u,p,I+T);return P<u.length&&(R+=S(u,P)),R}})},5306:function(t,n,r){"use strict";var e=r(2104),o=r(6916),i=r(1702),u=r(7007),c=r(7293),a=r(9670),f=r(614),s=r(9303),l=r(7466),p=r(1340),v=r(4488),g=r(1530),d=r(8173),x=r(647),y=r(7651),h=r(5112)("replace"),b=Math.max,_=Math.min,m=i([].concat),S=i([].push),w=i("".indexOf),O=i("".slice),E="$0"==="a".replace(/./,"$0"),T=!!/./[h]&&""===/./[h]("a","$0");u("replace",(function(t,n,r){var i=T?"$":"$0";return[function(t,r){var e=v(this),i=null==t?void 0:d(t,h);return i?o(i,t,e,r):o(n,p(e),t,r)},function(t,o){var u=a(this),c=p(t);if("string"==typeof o&&-1===w(o,i)&&-1===w(o,"$<")){var v=r(n,u,c,o);if(v.done)return v.value}var d=f(o);d||(o=p(o));var h=u.global;if(h){var E=u.unicode;u.lastIndex=0}for(var T=[];;){var j=y(u,c);if(null===j)break;if(S(T,j),!h)break;""===p(j[0])&&(u.lastIndex=g(c,l(u.lastIndex),E))}for(var A,I="",P=0,R=0;R<T.length;R++){for(var L=p((j=T[R])[0]),M=b(_(s(j.index),c.length),0),$=[],k=1;k<j.length;k++)S($,void 0===(A=j[k])?A:String(A));var C=j.groups;if(d){var F=m([L],$,M,c);void 0!==C&&S(F,C);var G=p(e(o,void 0,F))}else G=x(L,c,M,$,C,o);M>=P&&(I+=O(c,P,M)+G,P=M+L.length)}return I+O(c,P)}]}),!!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!E||T)},3948:function(t,n,r){var e=r(7854),o=r(8324),i=r(8509),u=r(6992),c=r(8880),a=r(5112),f=a("iterator"),s=a("toStringTag"),l=u.values,p=function(t,n){if(t){if(t[f]!==l)try{c(t,f,l)}catch(n){t[f]=l}if(t[s]||c(t,s,n),o[n])for(var r in u)if(t[r]!==u[r])try{c(t,r,u[r])}catch(n){t[r]=u[r]}}};for(var v in o)p(e[v]&&e[v].prototype,v);p(i,"DOMTokenList")}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=function(t,n){for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};!function(){"use strict";r.r(e),r.d(e,{getTextWidth:function(){return f},getTextsWidths:function(){return l},renderKashidaToPoems:function(){return v},unifyTextsWidths:function(){return p}});r(3948);var t=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".linesGroup div div";const r=Array.from(t.querySelectorAll(n)),e=r.map((t=>t.innerText));return[r,e]};var n=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".poem";return Array.from(document.querySelectorAll(t))};var o=(t,n)=>{if(t.length!==n.length)throw new Error("Lines elements and texts lengths are not matching");t.forEach(((t,r)=>t.innerText=n[r]))};r(6373),r(5306);var i=(t,n,r)=>{if(n<=0)throw new Error("Total number of matches can not be less than or equals 0");if(r<0)throw new Error("Total number of Kashidas needed can not be less than 0");if(t<0||t>=n)throw new Error("Index is out of range");return Math.floor(r/n)+(t+1>r%n?0:1)};r(8757);const u=(t,n)=>{if("string"!=typeof t||!t)throw new Error("The text argument provided was not a string or was an empty string");if(!n)return t;const r=u.regexForKashidaSlots||(u.regexForKashidaSlots=/(?=([جحخهعغفقثصضطكمنتلبيسشىئ]{1}[\u064b-\u0652]*[\u0622-\u064a]{1}))/g),e=u.exceptionsPlaceholderMap||(u.exceptionsPlaceholderMap={"بالله":"___${1}__/_","فالله":"___${2}__/_","تالله":"___${3}__/_","والله":"___${4}__/_","آلله":"___${5}__/_","ألله":"___${6}__/_","ولله":"___${7}__/_","فلله":"___${8}__/_","فبالله":"___${9}__/_","وبالله":"___${10}__/_","وتالله":"___${11}__/_","فتالله":"___${12}__/_","الله":"___${13}__/_","لله":"___${14}__/_","لأ":"___${15}__/_","لا":"___${16}__/_","لإ":"___${17}__/_","لآ":"___${18}__/_"});let o=t;o=((t,n)=>{for(const r in n)t=t.replaceAll(r,n[r]);return t})(o,e);const c=[...o.matchAll(r)].filter((t=>{let[,n]=t;return!e.hasOwnProperty(n.replace(/[\u064c\u064b\u064d\u064e\u064f\u0650\u0651\u0652]*/g,""))}));let a=0;return c.forEach(((t,r,e)=>{let{length:u}=e;const c=i(r,u,n),f=t[1],s=t.index+a,l=s+f.length,p=f.slice(0,-1)+"ـ".repeat(c)+f.slice(-1);o=o.substring(0,s)+p+o.substring(l),a+=c})),o=((t,n)=>{for(const r in n)t=t.replaceAll(n[r],r);return t})(o,e),o};var c=u;const a=(t,n)=>{const r=(a.canvas||(a.canvas=document.createElement("canvas"))).getContext("2d");r.font=n;return r.measureText(t).width};var f=a;const s=(t,n)=>{const r=t.map((t=>f(t,n)));return{textWidths:r,maxTextWidth:Math.max.apply(Math,r)}};var l=s;var p=(t,n)=>{const{textWidths:r,maxTextWidth:e}=s(t,n),o=f("ـ",n);return t.map(((t,n)=>{const i=r[n],u=e-i,a=Math.round(u/o);return c(t,a)}))};var v=function(r,e){e="string"==typeof e&&e?e:".linesGroup div div";const i=n(r="string"==typeof r&&r?r:".poem");for(const n of i){const r=getComputedStyle(n).font,[i,u]=t(n,e),c=p(u,r);o(i,c)}};window.addEventListener("load",v)}(),window.KashidaEngine=e}(); //# sourceMappingURL=kashida-engine.min.js.map